From 0b3fee479c1fd7d6b9223c9499ff8620c2250688 Mon Sep 17 00:00:00 2001 From: lxdklp Date: Thu, 20 Nov 2025 18:04:18 +0800 Subject: [PATCH 1/2] fix: Some pages do not support i18n. --- .../{index-BQIU9U77.js => index-DXB6avHW.js} | 72 ++++---- fastapi_radar/dashboard/dist/index.html | 2 +- .../dashboard/src/components/Layout.tsx | 4 +- .../dashboard/src/components/TracesList.tsx | 29 ++-- .../dashboard/src/i18n/translations.ts | 157 +++++++++++++++++- .../src/pages/BackgroundTasksPage.tsx | 32 ++-- .../dashboard/src/pages/DashboardPage.tsx | 6 +- .../dashboard/src/pages/PerformancePage.tsx | 4 +- .../dashboard/src/pages/RequestsPage.tsx | 12 +- 9 files changed, 243 insertions(+), 75 deletions(-) rename fastapi_radar/dashboard/dist/assets/{index-BQIU9U77.js => index-DXB6avHW.js} (59%) diff --git a/fastapi_radar/dashboard/dist/assets/index-BQIU9U77.js b/fastapi_radar/dashboard/dist/assets/index-DXB6avHW.js similarity index 59% rename from fastapi_radar/dashboard/dist/assets/index-BQIU9U77.js rename to fastapi_radar/dashboard/dist/assets/index-DXB6avHW.js index 649fe52..89423dc 100644 --- a/fastapi_radar/dashboard/dist/assets/index-BQIU9U77.js +++ b/fastapi_radar/dashboard/dist/assets/index-DXB6avHW.js @@ -1,4 +1,4 @@ -var hI=Object.defineProperty;var kw=e=>{throw TypeError(e)};var mI=(e,t,r)=>t in e?hI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Iu=(e,t,r)=>mI(e,typeof t!="symbol"?t+"":t,r),fm=(e,t,r)=>t.has(e)||kw("Cannot "+r);var k=(e,t,r)=>(fm(e,t,"read from private field"),r?r.call(e):t.get(e)),te=(e,t,r)=>t.has(e)?kw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),H=(e,t,r,n)=>(fm(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),ce=(e,t,r)=>(fm(e,t,"access private method"),r);var Lu=(e,t,r,n)=>({set _(a){H(e,t,a,r)},get _(){return k(e,t,n)}});function vI(e,t){for(var r=0;rn[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();function qn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qP={exports:{}},jp={},HP={exports:{}},pe={};/** +var hI=Object.defineProperty;var Cw=e=>{throw TypeError(e)};var mI=(e,t,r)=>t in e?hI(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Iu=(e,t,r)=>mI(e,typeof t!="symbol"?t+"":t,r),fm=(e,t,r)=>t.has(e)||Cw("Cannot "+r);var C=(e,t,r)=>(fm(e,t,"read from private field"),r?r.call(e):t.get(e)),te=(e,t,r)=>t.has(e)?Cw("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,r),H=(e,t,r,n)=>(fm(e,t,"write to private field"),n?n.call(e,r):t.set(e,r),r),ce=(e,t,r)=>(fm(e,t,"access private method"),r);var Lu=(e,t,r,n)=>({set _(a){H(e,t,a,r)},get _(){return C(e,t,n)}});function gI(e,t){for(var r=0;rn[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))n(a);new MutationObserver(a=>{for(const i of a)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(a){const i={};return a.integrity&&(i.integrity=a.integrity),a.referrerPolicy&&(i.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?i.credentials="include":a.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function n(a){if(a.ep)return;a.ep=!0;const i=r(a);fetch(a.href,i)}})();function Hn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var qP={exports:{}},jp={},HP={exports:{}},pe={};/** * @license React * react.production.min.js * @@ -6,7 +6,7 @@ var hI=Object.defineProperty;var kw=e=>{throw TypeError(e)};var mI=(e,t,r)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var Jc=Symbol.for("react.element"),gI=Symbol.for("react.portal"),yI=Symbol.for("react.fragment"),xI=Symbol.for("react.strict_mode"),bI=Symbol.for("react.profiler"),wI=Symbol.for("react.provider"),SI=Symbol.for("react.context"),EI=Symbol.for("react.forward_ref"),jI=Symbol.for("react.suspense"),PI=Symbol.for("react.memo"),CI=Symbol.for("react.lazy"),Nw=Symbol.iterator;function kI(e){return e===null||typeof e!="object"?null:(e=Nw&&e[Nw]||e["@@iterator"],typeof e=="function"?e:null)}var KP={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},VP=Object.assign,YP={};function rl(e,t,r){this.props=e,this.context=t,this.refs=YP,this.updater=r||KP}rl.prototype.isReactComponent={};rl.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};rl.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function GP(){}GP.prototype=rl.prototype;function qy(e,t,r){this.props=e,this.context=t,this.refs=YP,this.updater=r||KP}var Hy=qy.prototype=new GP;Hy.constructor=qy;VP(Hy,rl.prototype);Hy.isPureReactComponent=!0;var Ow=Array.isArray,QP=Object.prototype.hasOwnProperty,Ky={current:null},XP={key:!0,ref:!0,__self:!0,__source:!0};function ZP(e,t,r){var n,a={},i=null,o=null;if(t!=null)for(n in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(i=""+t.key),t)QP.call(t,n)&&!XP.hasOwnProperty(n)&&(a[n]=t[n]);var s=arguments.length-2;if(s===1)a.children=r;else if(1{throw TypeError(e)};var mI=(e,t,r)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var TI=m,RI=Symbol.for("react.element"),DI=Symbol.for("react.fragment"),MI=Object.prototype.hasOwnProperty,II=TI.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,LI={key:!0,ref:!0,__self:!0,__source:!0};function eC(e,t,r){var n,a={},i=null,o=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)MI.call(t,n)&&!LI.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)a[n]===void 0&&(a[n]=t[n]);return{$$typeof:RI,type:e,key:i,ref:o,props:a,_owner:II.current}}jp.Fragment=DI;jp.jsx=eC;jp.jsxs=eC;qP.exports=jp;var d=qP.exports,Pv={},tC={exports:{}},Or={},rC={exports:{}},nC={};/** + */var _I=m,RI=Symbol.for("react.element"),DI=Symbol.for("react.fragment"),MI=Object.prototype.hasOwnProperty,II=_I.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,LI={key:!0,ref:!0,__self:!0,__source:!0};function ek(e,t,r){var n,a={},i=null,o=null;r!==void 0&&(i=""+r),t.key!==void 0&&(i=""+t.key),t.ref!==void 0&&(o=t.ref);for(n in t)MI.call(t,n)&&!LI.hasOwnProperty(n)&&(a[n]=t[n]);if(e&&e.defaultProps)for(n in t=e.defaultProps,t)a[n]===void 0&&(a[n]=t[n]);return{$$typeof:RI,type:e,key:i,ref:o,props:a,_owner:II.current}}jp.Fragment=DI;jp.jsx=ek;jp.jsxs=ek;qP.exports=jp;var d=qP.exports,Pg={},tk={exports:{}},Or={},rk={exports:{}},nk={};/** * @license React * scheduler.production.min.js * @@ -22,7 +22,7 @@ var hI=Object.defineProperty;var kw=e=>{throw TypeError(e)};var mI=(e,t,r)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */(function(e){function t(T,$){var W=T.length;T.push($);e:for(;0>>1,K=T[re];if(0>>1;rea(_e,W))Xea(ee,_e)?(T[re]=ee,T[Xe]=W,re=Xe):(T[re]=_e,T[ze]=W,re=ze);else if(Xea(ee,W))T[re]=ee,T[Xe]=W,re=Xe;else break e}}return $}function a(T,$){var W=T.sortIndex-$.sortIndex;return W!==0?W:T.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],c=[],u=1,f=null,p=3,h=!1,g=!1,v=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(T){for(var $=r(c);$!==null;){if($.callback===null)n(c);else if($.startTime<=T)n(c),$.sortIndex=$.expirationTime,t(l,$);else break;$=r(c)}}function S(T){if(v=!1,w(T),!g)if(r(l)!==null)g=!0,B(E);else{var $=r(c);$!==null&&U(S,$.startTime-T)}}function E(T,$){g=!1,v&&(v=!1,b(C),C=-1),h=!0;var W=p;try{for(w($),f=r(l);f!==null&&(!(f.expirationTime>$)||T&&!A());){var re=f.callback;if(typeof re=="function"){f.callback=null,p=f.priorityLevel;var K=re(f.expirationTime<=$);$=e.unstable_now(),typeof K=="function"?f.callback=K:f===r(l)&&n(l),w($)}else n(l);f=r(l)}if(f!==null)var ot=!0;else{var ze=r(c);ze!==null&&U(S,ze.startTime-$),ot=!1}return ot}finally{f=null,p=W,h=!1}}var j=!1,P=null,C=-1,N=5,O=-1;function A(){return!(e.unstable_now()-OT||125re?(T.sortIndex=W,t(c,T),r(l)===null&&T===r(c)&&(v?(b(C),C=-1):v=!0,U(S,W-re))):(T.sortIndex=K,t(l,T),g||h||(g=!0,B(E))),T},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(T){var $=p;return function(){var W=p;p=$;try{return T.apply(this,arguments)}finally{p=W}}}})(nC);rC.exports=nC;var $I=rC.exports;/** + */(function(e){function t(_,$){var W=_.length;_.push($);e:for(;0>>1,K=_[re];if(0>>1;rea(Te,W))Xea(ee,Te)?(_[re]=ee,_[Xe]=W,re=Xe):(_[re]=Te,_[ze]=W,re=ze);else if(Xea(ee,W))_[re]=ee,_[Xe]=W,re=Xe;else break e}}return $}function a(_,$){var W=_.sortIndex-$.sortIndex;return W!==0?W:_.id-$.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;e.unstable_now=function(){return i.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var l=[],c=[],u=1,f=null,p=3,h=!1,v=!1,g=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,y=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(_){for(var $=r(c);$!==null;){if($.callback===null)n(c);else if($.startTime<=_)n(c),$.sortIndex=$.expirationTime,t(l,$);else break;$=r(c)}}function S(_){if(g=!1,w(_),!v)if(r(l)!==null)v=!0,B(E);else{var $=r(c);$!==null&&U(S,$.startTime-_)}}function E(_,$){v=!1,g&&(g=!1,b(k),k=-1),h=!0;var W=p;try{for(w($),f=r(l);f!==null&&(!(f.expirationTime>$)||_&&!A());){var re=f.callback;if(typeof re=="function"){f.callback=null,p=f.priorityLevel;var K=re(f.expirationTime<=$);$=e.unstable_now(),typeof K=="function"?f.callback=K:f===r(l)&&n(l),w($)}else n(l);f=r(l)}if(f!==null)var ot=!0;else{var ze=r(c);ze!==null&&U(S,ze.startTime-$),ot=!1}return ot}finally{f=null,p=W,h=!1}}var j=!1,P=null,k=-1,N=5,O=-1;function A(){return!(e.unstable_now()-O_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):N=0<_?Math.floor(1e3/_):5},e.unstable_getCurrentPriorityLevel=function(){return p},e.unstable_getFirstCallbackNode=function(){return r(l)},e.unstable_next=function(_){switch(p){case 1:case 2:case 3:var $=3;break;default:$=p}var W=p;p=$;try{return _()}finally{p=W}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(_,$){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var W=p;p=_;try{return $()}finally{p=W}},e.unstable_scheduleCallback=function(_,$,W){var re=e.unstable_now();switch(typeof W=="object"&&W!==null?(W=W.delay,W=typeof W=="number"&&0re?(_.sortIndex=W,t(c,_),r(l)===null&&_===r(c)&&(g?(b(k),k=-1):g=!0,U(S,W-re))):(_.sortIndex=K,t(l,_),v||h||(v=!0,B(E))),_},e.unstable_shouldYield=A,e.unstable_wrapCallback=function(_){var $=p;return function(){var W=p;p=$;try{return _.apply(this,arguments)}finally{p=W}}}})(nk);rk.exports=nk;var $I=rk.exports;/** * @license React * react-dom.production.min.js * @@ -30,14 +30,14 @@ var hI=Object.defineProperty;var kw=e=>{throw TypeError(e)};var mI=(e,t,r)=>t in * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. - */var FI=m,kr=$I;function F(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cv=Object.prototype.hasOwnProperty,BI=/^[: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]*$/,_w={},Tw={};function zI(e){return Cv.call(Tw,e)?!0:Cv.call(_w,e)?!1:BI.test(e)?Tw[e]=!0:(_w[e]=!0,!1)}function UI(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function WI(e,t,r,n){if(t===null||typeof t>"u"||UI(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.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 er(e,t,r,n,a,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var _t={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){_t[e]=new er(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];_t[t]=new er(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){_t[e]=new er(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){_t[e]=new er(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){_t[e]=new er(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){_t[e]=new er(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){_t[e]=new er(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){_t[e]=new er(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){_t[e]=new er(e,5,!1,e.toLowerCase(),null,!1,!1)});var Gy=/[\-:]([a-z])/g;function Qy(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(Gy,Qy);_t[t]=new er(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(Gy,Qy);_t[t]=new er(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(Gy,Qy);_t[t]=new er(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){_t[e]=new er(e,1,!1,e.toLowerCase(),null,!1,!1)});_t.xlinkHref=new er("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){_t[e]=new er(e,1,!1,e.toLowerCase(),null,!0,!0)});function Xy(e,t,r,n){var a=_t.hasOwnProperty(t)?_t[t]:null;(a!==null?a.type!==0:n||!(2"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),kg=Object.prototype.hasOwnProperty,BI=/^[: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]*$/,Tw={},_w={};function zI(e){return kg.call(_w,e)?!0:kg.call(Tw,e)?!1:BI.test(e)?_w[e]=!0:(Tw[e]=!0,!1)}function UI(e,t,r,n){if(r!==null&&r.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function WI(e,t,r,n){if(t===null||typeof t>"u"||UI(e,t,r,n))return!0;if(n)return!1;if(r!==null)switch(r.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 er(e,t,r,n,a,i,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=n,this.attributeNamespace=a,this.mustUseProperty=r,this.propertyName=e,this.type=t,this.sanitizeURL=i,this.removeEmptyString=o}var Tt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){Tt[e]=new er(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];Tt[t]=new er(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){Tt[e]=new er(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){Tt[e]=new er(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){Tt[e]=new er(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){Tt[e]=new er(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){Tt[e]=new er(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){Tt[e]=new er(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){Tt[e]=new er(e,5,!1,e.toLowerCase(),null,!1,!1)});var Gy=/[\-:]([a-z])/g;function Qy(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(Gy,Qy);Tt[t]=new er(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(Gy,Qy);Tt[t]=new er(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(Gy,Qy);Tt[t]=new er(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){Tt[e]=new er(e,1,!1,e.toLowerCase(),null,!1,!1)});Tt.xlinkHref=new er("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){Tt[e]=new er(e,1,!1,e.toLowerCase(),null,!0,!0)});function Xy(e,t,r,n){var a=Tt.hasOwnProperty(t)?Tt[t]:null;(a!==null?a.type!==0:n||!(2s||a[o]!==i[s]){var l=` -`+a[o].replace(" at new "," at ");return e.displayName&&l.includes("")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{mm=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Hl(e):""}function qI(e){switch(e.tag){case 5:return Hl(e.type);case 16:return Hl("Lazy");case 13:return Hl("Suspense");case 19:return Hl("SuspenseList");case 0:case 2:case 15:return e=vm(e.type,!1),e;case 11:return e=vm(e.type.render,!1),e;case 1:return e=vm(e.type,!0),e;default:return""}}function Av(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 Jo:return"Fragment";case Zo:return"Portal";case kv:return"Profiler";case Zy:return"StrictMode";case Nv:return"Suspense";case Ov:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case oC:return(e.displayName||"Context")+".Consumer";case iC:return(e._context.displayName||"Context")+".Provider";case Jy:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ex:return t=e.displayName||null,t!==null?t:Av(e.type)||"Memo";case Ka:t=e._payload,e=e._init;try{return Av(e(t))}catch{}}return null}function HI(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 Av(t);case 8:return t===Zy?"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 wi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function lC(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function KI(e){var t=lC(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){n=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Bu(e){e._valueTracker||(e._valueTracker=KI(e))}function cC(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=lC(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Qd(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 _v(e,t){var r=t.checked;return Ve({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Dw(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=wi(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function uC(e,t){t=t.checked,t!=null&&Xy(e,"checked",t,!1)}function Tv(e,t){uC(e,t);var r=wi(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Rv(e,t.type,r):t.hasOwnProperty("defaultValue")&&Rv(e,t.type,wi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Mw(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Rv(e,t,r){(t!=="number"||Qd(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Kl=Array.isArray;function ds(e,t,r,n){if(e=e.options,t){t={};for(var a=0;a"+t.valueOf().toString()+"",t=zu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function fc(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Jl={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},VI=["Webkit","ms","Moz","O"];Object.keys(Jl).forEach(function(e){VI.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Jl[t]=Jl[e]})});function hC(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Jl.hasOwnProperty(e)&&Jl[e]?(""+t).trim():t+"px"}function mC(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,a=hC(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,a):e[r]=a}}var YI=Ve({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 Iv(e,t){if(t){if(YI[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(F(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(F(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(F(61))}if(t.style!=null&&typeof t.style!="object")throw Error(F(62))}}function Lv(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 $v=null;function tx(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fv=null,fs=null,ps=null;function $w(e){if(e=ru(e)){if(typeof Fv!="function")throw Error(F(280));var t=e.stateNode;t&&(t=Op(t),Fv(e.stateNode,e.type,t))}}function vC(e){fs?ps?ps.push(e):ps=[e]:fs=e}function gC(){if(fs){var e=fs,t=ps;if(ps=fs=null,$w(e),t)for(e=0;e>>=0,e===0?32:31-(iL(e)/oL|0)|0}var Uu=64,Wu=4194304;function Vl(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 ef(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,a=e.suspendedLanes,i=e.pingedLanes,o=r&268435455;if(o!==0){var s=o&~a;s!==0?n=Vl(s):(i&=o,i!==0&&(n=Vl(i)))}else o=r&~a,o!==0?n=Vl(o):i!==0&&(n=Vl(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&a)&&(a=n&-n,i=t&-t,a>=i||a===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function eu(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-dn(t),e[t]=r}function uL(e,t){var r=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 n=e.eventTimes;for(e=e.expirationTimes;0=tc),Vw=" ",Yw=!1;function LC(e,t){switch(e){case"keyup":return $L.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $C(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var es=!1;function BL(e,t){switch(e){case"compositionend":return $C(t);case"keypress":return t.which!==32?null:(Yw=!0,Vw);case"textInput":return e=t.data,e===Vw&&Yw?null:e;default:return null}}function zL(e,t){if(es)return e==="compositionend"||!cx&&LC(e,t)?(e=MC(),Ad=ox=li=null,es=!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)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Zw(r)}}function UC(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?UC(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function WC(){for(var e=window,t=Qd();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Qd(e.document)}return t}function ux(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 QL(e){var t=WC(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&UC(r.ownerDocument.documentElement,r)){if(n!==null&&ux(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=r.textContent.length,i=Math.min(n.start,a);n=n.end===void 0?i:Math.min(n.end,a),!e.extend&&i>n&&(a=n,n=i,i=a),a=Jw(r,i);var o=Jw(r,n);a&&o&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,ts=null,Hv=null,nc=null,Kv=!1;function e1(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Kv||ts==null||ts!==Qd(n)||(n=ts,"selectionStart"in n&&ux(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),nc&&yc(nc,n)||(nc=n,n=nf(Hv,"onSelect"),0as||(e.current=Zv[as],Zv[as]=null,as--)}function De(e,t){as++,Zv[as]=e.current,e.current=t}var Si={},zt=Oi(Si),cr=Oi(!1),go=Si;function Ms(e,t){var r=e.type.contextTypes;if(!r)return Si;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in r)a[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function ur(e){return e=e.childContextTypes,e!=null}function of(){Fe(cr),Fe(zt)}function s1(e,t,r){if(zt.current!==Si)throw Error(F(168));De(zt,t),De(cr,r)}function ZC(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var a in n)if(!(a in t))throw Error(F(108,HI(e)||"Unknown",a));return Ve({},r,n)}function sf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Si,go=zt.current,De(zt,e),De(cr,cr.current),!0}function l1(e,t,r){var n=e.stateNode;if(!n)throw Error(F(169));r?(e=ZC(e,t,go),n.__reactInternalMemoizedMergedChildContext=e,Fe(cr),Fe(zt),De(zt,e)):Fe(cr),De(cr,r)}var ta=null,Ap=!1,Am=!1;function JC(e){ta===null?ta=[e]:ta.push(e)}function l$(e){Ap=!0,JC(e)}function Ai(){if(!Am&&ta!==null){Am=!0;var e=0,t=ke;try{var r=ta;for(ke=1;e>=o,a-=o,la=1<<32-dn(t)+a|r<C?(N=P,P=null):N=P.sibling;var O=p(b,P,w[C],S);if(O===null){P===null&&(P=N);break}e&&P&&O.alternate===null&&t(b,P),y=i(O,y,C),j===null?E=O:j.sibling=O,j=O,P=N}if(C===w.length)return r(b,P),Ue&&Bi(b,C),E;if(P===null){for(;CC?(N=P,P=null):N=P.sibling;var A=p(b,P,O.value,S);if(A===null){P===null&&(P=N);break}e&&P&&A.alternate===null&&t(b,P),y=i(A,y,C),j===null?E=A:j.sibling=A,j=A,P=N}if(O.done)return r(b,P),Ue&&Bi(b,C),E;if(P===null){for(;!O.done;C++,O=w.next())O=f(b,O.value,S),O!==null&&(y=i(O,y,C),j===null?E=O:j.sibling=O,j=O);return Ue&&Bi(b,C),E}for(P=n(b,P);!O.done;C++,O=w.next())O=h(P,b,C,O.value,S),O!==null&&(e&&O.alternate!==null&&P.delete(O.key===null?C:O.key),y=i(O,y,C),j===null?E=O:j.sibling=O,j=O);return e&&P.forEach(function(_){return t(b,_)}),Ue&&Bi(b,C),E}function x(b,y,w,S){if(typeof w=="object"&&w!==null&&w.type===Jo&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Fu:e:{for(var E=w.key,j=y;j!==null;){if(j.key===E){if(E=w.type,E===Jo){if(j.tag===7){r(b,j.sibling),y=a(j,w.props.children),y.return=b,b=y;break e}}else if(j.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ka&&d1(E)===j.type){r(b,j.sibling),y=a(j,w.props),y.ref=Ol(b,j,w),y.return=b,b=y;break e}r(b,j);break}else t(b,j);j=j.sibling}w.type===Jo?(y=uo(w.props.children,b.mode,S,w.key),y.return=b,b=y):(S=$d(w.type,w.key,w.props,null,b.mode,S),S.ref=Ol(b,y,w),S.return=b,b=S)}return o(b);case Zo:e:{for(j=w.key;y!==null;){if(y.key===j)if(y.tag===4&&y.stateNode.containerInfo===w.containerInfo&&y.stateNode.implementation===w.implementation){r(b,y.sibling),y=a(y,w.children||[]),y.return=b,b=y;break e}else{r(b,y);break}else t(b,y);y=y.sibling}y=$m(w,b.mode,S),y.return=b,b=y}return o(b);case Ka:return j=w._init,x(b,y,j(w._payload),S)}if(Kl(w))return g(b,y,w,S);if(jl(w))return v(b,y,w,S);Qu(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,y!==null&&y.tag===6?(r(b,y.sibling),y=a(y,w),y.return=b,b=y):(r(b,y),y=Lm(w,b.mode,S),y.return=b,b=y),o(b)):r(b,y)}return x}var Ls=nk(!0),ak=nk(!1),uf=Oi(null),df=null,ss=null,hx=null;function mx(){hx=ss=df=null}function vx(e){var t=uf.current;Fe(uf),e._currentValue=t}function tg(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function ms(e,t){df=e,hx=ss=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(or=!0),e.firstContext=null)}function Kr(e){var t=e._currentValue;if(hx!==e)if(e={context:e,memoizedValue:t,next:null},ss===null){if(df===null)throw Error(F(308));ss=e,df.dependencies={lanes:0,firstContext:e}}else ss=ss.next=e;return t}var Vi=null;function gx(e){Vi===null?Vi=[e]:Vi.push(e)}function ik(e,t,r,n){var a=t.interleaved;return a===null?(r.next=r,gx(t)):(r.next=a.next,a.next=r),t.interleaved=r,Sa(e,n)}function Sa(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Va=!1;function yx(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function ok(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 pa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function mi(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ye&2){var a=n.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),n.pending=t,Sa(e,r)}return a=n.interleaved,a===null?(t.next=t,gx(n)):(t.next=a.next,a.next=t),n.interleaved=t,Sa(e,r)}function Td(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,nx(e,r)}}function f1(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var a=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?a=i=o:i=i.next=o,r=r.next}while(r!==null);i===null?a=i=t:i=i.next=t}else a=i=t;r={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function ff(e,t,r,n){var a=e.updateQueue;Va=!1;var i=a.firstBaseUpdate,o=a.lastBaseUpdate,s=a.shared.pending;if(s!==null){a.shared.pending=null;var l=s,c=l.next;l.next=null,o===null?i=c:o.next=c,o=l;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(i!==null){var f=a.baseState;o=0,u=c=l=null,s=i;do{var p=s.lane,h=s.eventTime;if((n&p)===p){u!==null&&(u=u.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var g=e,v=s;switch(p=t,h=r,v.tag){case 1:if(g=v.payload,typeof g=="function"){f=g.call(h,f,p);break e}f=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=v.payload,p=typeof g=="function"?g.call(h,f,p):g,p==null)break e;f=Ve({},f,p);break e;case 2:Va=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=a.effects,p===null?a.effects=[s]:p.push(s))}else h={eventTime:h,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(c=u=h,l=f):u=u.next=h,o|=p;if(s=s.next,s===null){if(s=a.shared.pending,s===null)break;p=s,s=p.next,p.next=null,a.lastBaseUpdate=p,a.shared.pending=null}}while(!0);if(u===null&&(l=f),a.baseState=l,a.firstBaseUpdate=c,a.lastBaseUpdate=u,t=a.shared.interleaved,t!==null){a=t;do o|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);bo|=o,e.lanes=o,e.memoizedState=f}}function p1(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=Tm.transition;Tm.transition={};try{e(!1),t()}finally{ke=r,Tm.transition=n}}function Ek(){return Vr().memoizedState}function f$(e,t,r){var n=gi(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},jk(e))Pk(t,r);else if(r=ik(e,t,r,n),r!==null){var a=Zt();fn(r,e,n,a),Ck(r,t,n)}}function p$(e,t,r){var n=gi(e),a={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(jk(e))Pk(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,s=i(o,r);if(a.hasEagerState=!0,a.eagerState=s,pn(s,o)){var l=t.interleaved;l===null?(a.next=a,gx(t)):(a.next=l.next,l.next=a),t.interleaved=a;return}}catch{}finally{}r=ik(e,t,a,n),r!==null&&(a=Zt(),fn(r,e,n,a),Ck(r,t,n))}}function jk(e){var t=e.alternate;return e===Ke||t!==null&&t===Ke}function Pk(e,t){ac=hf=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function Ck(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,nx(e,r)}}var mf={readContext:Kr,useCallback:Dt,useContext:Dt,useEffect:Dt,useImperativeHandle:Dt,useInsertionEffect:Dt,useLayoutEffect:Dt,useMemo:Dt,useReducer:Dt,useRef:Dt,useState:Dt,useDebugValue:Dt,useDeferredValue:Dt,useTransition:Dt,useMutableSource:Dt,useSyncExternalStore:Dt,useId:Dt,unstable_isNewReconciler:!1},h$={readContext:Kr,useCallback:function(e,t){return En().memoizedState=[e,t===void 0?null:t],e},useContext:Kr,useEffect:m1,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Dd(4194308,4,yk.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Dd(4194308,4,e,t)},useInsertionEffect:function(e,t){return Dd(4,2,e,t)},useMemo:function(e,t){var r=En();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=En();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=f$.bind(null,Ke,e),[n.memoizedState,e]},useRef:function(e){var t=En();return e={current:e},t.memoizedState=e},useState:h1,useDebugValue:Cx,useDeferredValue:function(e){return En().memoizedState=e},useTransition:function(){var e=h1(!1),t=e[0];return e=d$.bind(null,e[1]),En().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ke,a=En();if(Ue){if(r===void 0)throw Error(F(407));r=r()}else{if(r=t(),wt===null)throw Error(F(349));xo&30||uk(n,t,r)}a.memoizedState=r;var i={value:r,getSnapshot:t};return a.queue=i,m1(fk.bind(null,n,i,e),[e]),n.flags|=2048,Cc(9,dk.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=En(),t=wt.identifierPrefix;if(Ue){var r=ca,n=la;r=(n&~(1<<32-dn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=jc++,0")&&(l=l.replace("",e.displayName)),l}while(1<=o&&0<=s);break}}}finally{mm=!1,Error.prepareStackTrace=r}return(e=e?e.displayName||e.name:"")?Hl(e):""}function qI(e){switch(e.tag){case 5:return Hl(e.type);case 16:return Hl("Lazy");case 13:return Hl("Suspense");case 19:return Hl("SuspenseList");case 0:case 2:case 15:return e=gm(e.type,!1),e;case 11:return e=gm(e.type.render,!1),e;case 1:return e=gm(e.type,!0),e;default:return""}}function Ag(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 Jo:return"Fragment";case Zo:return"Portal";case Cg:return"Profiler";case Zy:return"StrictMode";case Ng:return"Suspense";case Og:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case ok:return(e.displayName||"Context")+".Consumer";case ik:return(e._context.displayName||"Context")+".Provider";case Jy:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ex:return t=e.displayName||null,t!==null?t:Ag(e.type)||"Memo";case Ka:t=e._payload,e=e._init;try{return Ag(e(t))}catch{}}return null}function HI(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 Ag(t);case 8:return t===Zy?"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 wi(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function lk(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function KI(e){var t=lk(e)?"checked":"value",r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),n=""+e[t];if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var a=r.get,i=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return a.call(this)},set:function(o){n=""+o,i.call(this,o)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Bu(e){e._valueTracker||(e._valueTracker=KI(e))}function ck(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var r=t.getValue(),n="";return e&&(n=lk(e)?e.checked?"true":"false":e.value),e=n,e!==r?(t.setValue(e),!0):!1}function Qd(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 Tg(e,t){var r=t.checked;return Ve({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??e._wrapperState.initialChecked})}function Dw(e,t){var r=t.defaultValue==null?"":t.defaultValue,n=t.checked!=null?t.checked:t.defaultChecked;r=wi(t.value!=null?t.value:r),e._wrapperState={initialChecked:n,initialValue:r,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function uk(e,t){t=t.checked,t!=null&&Xy(e,"checked",t,!1)}function _g(e,t){uk(e,t);var r=wi(t.value),n=t.type;if(r!=null)n==="number"?(r===0&&e.value===""||e.value!=r)&&(e.value=""+r):e.value!==""+r&&(e.value=""+r);else if(n==="submit"||n==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?Rg(e,t.type,r):t.hasOwnProperty("defaultValue")&&Rg(e,t.type,wi(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Mw(e,t,r){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var n=t.type;if(!(n!=="submit"&&n!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,r||t===e.value||(e.value=t),e.defaultValue=t}r=e.name,r!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,r!==""&&(e.name=r)}function Rg(e,t,r){(t!=="number"||Qd(e.ownerDocument)!==e)&&(r==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+r&&(e.defaultValue=""+r))}var Kl=Array.isArray;function ds(e,t,r,n){if(e=e.options,t){t={};for(var a=0;a"+t.valueOf().toString()+"",t=zu.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function fc(e,t){if(t){var r=e.firstChild;if(r&&r===e.lastChild&&r.nodeType===3){r.nodeValue=t;return}}e.textContent=t}var Jl={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},VI=["Webkit","ms","Moz","O"];Object.keys(Jl).forEach(function(e){VI.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),Jl[t]=Jl[e]})});function hk(e,t,r){return t==null||typeof t=="boolean"||t===""?"":r||typeof t!="number"||t===0||Jl.hasOwnProperty(e)&&Jl[e]?(""+t).trim():t+"px"}function mk(e,t){e=e.style;for(var r in t)if(t.hasOwnProperty(r)){var n=r.indexOf("--")===0,a=hk(r,t[r],n);r==="float"&&(r="cssFloat"),n?e.setProperty(r,a):e[r]=a}}var YI=Ve({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 Ig(e,t){if(t){if(YI[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(F(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(F(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(F(61))}if(t.style!=null&&typeof t.style!="object")throw Error(F(62))}}function Lg(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 $g=null;function tx(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Fg=null,fs=null,ps=null;function $w(e){if(e=ru(e)){if(typeof Fg!="function")throw Error(F(280));var t=e.stateNode;t&&(t=Op(t),Fg(e.stateNode,e.type,t))}}function gk(e){fs?ps?ps.push(e):ps=[e]:fs=e}function vk(){if(fs){var e=fs,t=ps;if(ps=fs=null,$w(e),t)for(e=0;e>>=0,e===0?32:31-(iL(e)/oL|0)|0}var Uu=64,Wu=4194304;function Vl(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 ef(e,t){var r=e.pendingLanes;if(r===0)return 0;var n=0,a=e.suspendedLanes,i=e.pingedLanes,o=r&268435455;if(o!==0){var s=o&~a;s!==0?n=Vl(s):(i&=o,i!==0&&(n=Vl(i)))}else o=r&~a,o!==0?n=Vl(o):i!==0&&(n=Vl(i));if(n===0)return 0;if(t!==0&&t!==n&&!(t&a)&&(a=n&-n,i=t&-t,a>=i||a===16&&(i&4194240)!==0))return t;if(n&4&&(n|=r&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=n;0r;r++)t.push(e);return t}function eu(e,t,r){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-fn(t),e[t]=r}function uL(e,t){var r=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 n=e.eventTimes;for(e=e.expirationTimes;0=tc),Vw=" ",Yw=!1;function Lk(e,t){switch(e){case"keyup":return $L.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $k(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var es=!1;function BL(e,t){switch(e){case"compositionend":return $k(t);case"keypress":return t.which!==32?null:(Yw=!0,Vw);case"textInput":return e=t.data,e===Vw&&Yw?null:e;default:return null}}function zL(e,t){if(es)return e==="compositionend"||!cx&&Lk(e,t)?(e=Mk(),Ad=ox=li=null,es=!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)return{node:r,offset:t-e};e=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=Zw(r)}}function Uk(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Uk(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Wk(){for(var e=window,t=Qd();t instanceof e.HTMLIFrameElement;){try{var r=typeof t.contentWindow.location.href=="string"}catch{r=!1}if(r)e=t.contentWindow;else break;t=Qd(e.document)}return t}function ux(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 QL(e){var t=Wk(),r=e.focusedElem,n=e.selectionRange;if(t!==r&&r&&r.ownerDocument&&Uk(r.ownerDocument.documentElement,r)){if(n!==null&&ux(r)){if(t=n.start,e=n.end,e===void 0&&(e=t),"selectionStart"in r)r.selectionStart=t,r.selectionEnd=Math.min(e,r.value.length);else if(e=(t=r.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var a=r.textContent.length,i=Math.min(n.start,a);n=n.end===void 0?i:Math.min(n.end,a),!e.extend&&i>n&&(a=n,n=i,i=a),a=Jw(r,i);var o=Jw(r,n);a&&o&&(e.rangeCount!==1||e.anchorNode!==a.node||e.anchorOffset!==a.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(a.node,a.offset),e.removeAllRanges(),i>n?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=r;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,ts=null,Hg=null,nc=null,Kg=!1;function e1(e,t,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Kg||ts==null||ts!==Qd(n)||(n=ts,"selectionStart"in n&&ux(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),nc&&yc(nc,n)||(nc=n,n=nf(Hg,"onSelect"),0as||(e.current=Zg[as],Zg[as]=null,as--)}function De(e,t){as++,Zg[as]=e.current,e.current=t}var Si={},zt=Oi(Si),cr=Oi(!1),vo=Si;function Ms(e,t){var r=e.type.contextTypes;if(!r)return Si;var n=e.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===t)return n.__reactInternalMemoizedMaskedChildContext;var a={},i;for(i in r)a[i]=t[i];return n&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=a),a}function ur(e){return e=e.childContextTypes,e!=null}function of(){Fe(cr),Fe(zt)}function s1(e,t,r){if(zt.current!==Si)throw Error(F(168));De(zt,t),De(cr,r)}function Zk(e,t,r){var n=e.stateNode;if(t=t.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var a in n)if(!(a in t))throw Error(F(108,HI(e)||"Unknown",a));return Ve({},r,n)}function sf(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Si,vo=zt.current,De(zt,e),De(cr,cr.current),!0}function l1(e,t,r){var n=e.stateNode;if(!n)throw Error(F(169));r?(e=Zk(e,t,vo),n.__reactInternalMemoizedMergedChildContext=e,Fe(cr),Fe(zt),De(zt,e)):Fe(cr),De(cr,r)}var ta=null,Ap=!1,Am=!1;function Jk(e){ta===null?ta=[e]:ta.push(e)}function l$(e){Ap=!0,Jk(e)}function Ai(){if(!Am&&ta!==null){Am=!0;var e=0,t=Ce;try{var r=ta;for(Ce=1;e>=o,a-=o,la=1<<32-fn(t)+a|r<k?(N=P,P=null):N=P.sibling;var O=p(b,P,w[k],S);if(O===null){P===null&&(P=N);break}e&&P&&O.alternate===null&&t(b,P),y=i(O,y,k),j===null?E=O:j.sibling=O,j=O,P=N}if(k===w.length)return r(b,P),Ue&&Bi(b,k),E;if(P===null){for(;kk?(N=P,P=null):N=P.sibling;var A=p(b,P,O.value,S);if(A===null){P===null&&(P=N);break}e&&P&&A.alternate===null&&t(b,P),y=i(A,y,k),j===null?E=A:j.sibling=A,j=A,P=N}if(O.done)return r(b,P),Ue&&Bi(b,k),E;if(P===null){for(;!O.done;k++,O=w.next())O=f(b,O.value,S),O!==null&&(y=i(O,y,k),j===null?E=O:j.sibling=O,j=O);return Ue&&Bi(b,k),E}for(P=n(b,P);!O.done;k++,O=w.next())O=h(P,b,k,O.value,S),O!==null&&(e&&O.alternate!==null&&P.delete(O.key===null?k:O.key),y=i(O,y,k),j===null?E=O:j.sibling=O,j=O);return e&&P.forEach(function(T){return t(b,T)}),Ue&&Bi(b,k),E}function x(b,y,w,S){if(typeof w=="object"&&w!==null&&w.type===Jo&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Fu:e:{for(var E=w.key,j=y;j!==null;){if(j.key===E){if(E=w.type,E===Jo){if(j.tag===7){r(b,j.sibling),y=a(j,w.props.children),y.return=b,b=y;break e}}else if(j.elementType===E||typeof E=="object"&&E!==null&&E.$$typeof===Ka&&d1(E)===j.type){r(b,j.sibling),y=a(j,w.props),y.ref=Ol(b,j,w),y.return=b,b=y;break e}r(b,j);break}else t(b,j);j=j.sibling}w.type===Jo?(y=uo(w.props.children,b.mode,S,w.key),y.return=b,b=y):(S=$d(w.type,w.key,w.props,null,b.mode,S),S.ref=Ol(b,y,w),S.return=b,b=S)}return o(b);case Zo:e:{for(j=w.key;y!==null;){if(y.key===j)if(y.tag===4&&y.stateNode.containerInfo===w.containerInfo&&y.stateNode.implementation===w.implementation){r(b,y.sibling),y=a(y,w.children||[]),y.return=b,b=y;break e}else{r(b,y);break}else t(b,y);y=y.sibling}y=$m(w,b.mode,S),y.return=b,b=y}return o(b);case Ka:return j=w._init,x(b,y,j(w._payload),S)}if(Kl(w))return v(b,y,w,S);if(jl(w))return g(b,y,w,S);Qu(b,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,y!==null&&y.tag===6?(r(b,y.sibling),y=a(y,w),y.return=b,b=y):(r(b,y),y=Lm(w,b.mode,S),y.return=b,b=y),o(b)):r(b,y)}return x}var Ls=nC(!0),aC=nC(!1),uf=Oi(null),df=null,ss=null,hx=null;function mx(){hx=ss=df=null}function gx(e){var t=uf.current;Fe(uf),e._currentValue=t}function tv(e,t,r){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===r)break;e=e.return}}function ms(e,t){df=e,hx=ss=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(or=!0),e.firstContext=null)}function Vr(e){var t=e._currentValue;if(hx!==e)if(e={context:e,memoizedValue:t,next:null},ss===null){if(df===null)throw Error(F(308));ss=e,df.dependencies={lanes:0,firstContext:e}}else ss=ss.next=e;return t}var Vi=null;function vx(e){Vi===null?Vi=[e]:Vi.push(e)}function iC(e,t,r,n){var a=t.interleaved;return a===null?(r.next=r,vx(t)):(r.next=a.next,a.next=r),t.interleaved=r,Sa(e,n)}function Sa(e,t){e.lanes|=t;var r=e.alternate;for(r!==null&&(r.lanes|=t),r=e,e=e.return;e!==null;)e.childLanes|=t,r=e.alternate,r!==null&&(r.childLanes|=t),r=e,e=e.return;return r.tag===3?r.stateNode:null}var Va=!1;function yx(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function oC(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 pa(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function mi(e,t,r){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,ye&2){var a=n.pending;return a===null?t.next=t:(t.next=a.next,a.next=t),n.pending=t,Sa(e,r)}return a=n.interleaved,a===null?(t.next=t,vx(n)):(t.next=a.next,a.next=t),n.interleaved=t,Sa(e,r)}function _d(e,t,r){if(t=t.updateQueue,t!==null&&(t=t.shared,(r&4194240)!==0)){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,nx(e,r)}}function f1(e,t){var r=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var a=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?a=i=o:i=i.next=o,r=r.next}while(r!==null);i===null?a=i=t:i=i.next=t}else a=i=t;r={baseState:n.baseState,firstBaseUpdate:a,lastBaseUpdate:i,shared:n.shared,effects:n.effects},e.updateQueue=r;return}e=r.lastBaseUpdate,e===null?r.firstBaseUpdate=t:e.next=t,r.lastBaseUpdate=t}function ff(e,t,r,n){var a=e.updateQueue;Va=!1;var i=a.firstBaseUpdate,o=a.lastBaseUpdate,s=a.shared.pending;if(s!==null){a.shared.pending=null;var l=s,c=l.next;l.next=null,o===null?i=c:o.next=c,o=l;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=c:s.next=c,u.lastBaseUpdate=l))}if(i!==null){var f=a.baseState;o=0,u=c=l=null,s=i;do{var p=s.lane,h=s.eventTime;if((n&p)===p){u!==null&&(u=u.next={eventTime:h,lane:0,tag:s.tag,payload:s.payload,callback:s.callback,next:null});e:{var v=e,g=s;switch(p=t,h=r,g.tag){case 1:if(v=g.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=g.payload,p=typeof v=="function"?v.call(h,f,p):v,p==null)break e;f=Ve({},f,p);break e;case 2:Va=!0}}s.callback!==null&&s.lane!==0&&(e.flags|=64,p=a.effects,p===null?a.effects=[s]:p.push(s))}else h={eventTime:h,lane:p,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(c=u=h,l=f):u=u.next=h,o|=p;if(s=s.next,s===null){if(s=a.shared.pending,s===null)break;p=s,s=p.next,p.next=null,a.lastBaseUpdate=p,a.shared.pending=null}}while(!0);if(u===null&&(l=f),a.baseState=l,a.firstBaseUpdate=c,a.lastBaseUpdate=u,t=a.shared.interleaved,t!==null){a=t;do o|=a.lane,a=a.next;while(a!==t)}else i===null&&(a.shared.lanes=0);bo|=o,e.lanes=o,e.memoizedState=f}}function p1(e,t,r){if(e=t.effects,t.effects=null,e!==null)for(t=0;tr?r:4,e(!0);var n=_m.transition;_m.transition={};try{e(!1),t()}finally{Ce=r,_m.transition=n}}function EC(){return Yr().memoizedState}function f$(e,t,r){var n=vi(e);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},jC(e))PC(t,r);else if(r=iC(e,t,r,n),r!==null){var a=Zt();pn(r,e,n,a),kC(r,t,n)}}function p$(e,t,r){var n=vi(e),a={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(jC(e))PC(t,a);else{var i=e.alternate;if(e.lanes===0&&(i===null||i.lanes===0)&&(i=t.lastRenderedReducer,i!==null))try{var o=t.lastRenderedState,s=i(o,r);if(a.hasEagerState=!0,a.eagerState=s,hn(s,o)){var l=t.interleaved;l===null?(a.next=a,vx(t)):(a.next=l.next,l.next=a),t.interleaved=a;return}}catch{}finally{}r=iC(e,t,a,n),r!==null&&(a=Zt(),pn(r,e,n,a),kC(r,t,n))}}function jC(e){var t=e.alternate;return e===Ke||t!==null&&t===Ke}function PC(e,t){ac=hf=!0;var r=e.pending;r===null?t.next=t:(t.next=r.next,r.next=t),e.pending=t}function kC(e,t,r){if(r&4194240){var n=t.lanes;n&=e.pendingLanes,r|=n,t.lanes=r,nx(e,r)}}var mf={readContext:Vr,useCallback:Dt,useContext:Dt,useEffect:Dt,useImperativeHandle:Dt,useInsertionEffect:Dt,useLayoutEffect:Dt,useMemo:Dt,useReducer:Dt,useRef:Dt,useState:Dt,useDebugValue:Dt,useDeferredValue:Dt,useTransition:Dt,useMutableSource:Dt,useSyncExternalStore:Dt,useId:Dt,unstable_isNewReconciler:!1},h$={readContext:Vr,useCallback:function(e,t){return jn().memoizedState=[e,t===void 0?null:t],e},useContext:Vr,useEffect:m1,useImperativeHandle:function(e,t,r){return r=r!=null?r.concat([e]):null,Dd(4194308,4,yC.bind(null,t,e),r)},useLayoutEffect:function(e,t){return Dd(4194308,4,e,t)},useInsertionEffect:function(e,t){return Dd(4,2,e,t)},useMemo:function(e,t){var r=jn();return t=t===void 0?null:t,e=e(),r.memoizedState=[e,t],e},useReducer:function(e,t,r){var n=jn();return t=r!==void 0?r(t):t,n.memoizedState=n.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},n.queue=e,e=e.dispatch=f$.bind(null,Ke,e),[n.memoizedState,e]},useRef:function(e){var t=jn();return e={current:e},t.memoizedState=e},useState:h1,useDebugValue:kx,useDeferredValue:function(e){return jn().memoizedState=e},useTransition:function(){var e=h1(!1),t=e[0];return e=d$.bind(null,e[1]),jn().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,r){var n=Ke,a=jn();if(Ue){if(r===void 0)throw Error(F(407));r=r()}else{if(r=t(),wt===null)throw Error(F(349));xo&30||uC(n,t,r)}a.memoizedState=r;var i={value:r,getSnapshot:t};return a.queue=i,m1(fC.bind(null,n,i,e),[e]),n.flags|=2048,kc(9,dC.bind(null,n,i,r,t),void 0,null),r},useId:function(){var e=jn(),t=wt.identifierPrefix;if(Ue){var r=ca,n=la;r=(n&~(1<<32-fn(n)-1)).toString(32)+r,t=":"+t+"R"+r,r=jc++,0<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[kn]=t,e[wc]=n,Ik(e,t,!1,!1),t.stateNode=e;e:{switch(o=Lv(r,n),r){case"dialog":Le("cancel",e),Le("close",e),a=n;break;case"iframe":case"object":case"embed":Le("load",e),a=n;break;case"video":case"audio":for(a=0;aBs&&(t.flags|=128,n=!0,Al(i,!1),t.lanes=4194304)}else{if(!n)if(e=pf(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Al(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Ue)return Mt(t),null}else 2*Je()-i.renderingStartTime>Bs&&r!==1073741824&&(t.flags|=128,n=!0,Al(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(r=i.last,r!==null?r.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Je(),t.sibling=null,r=He.current,De(He,n?r&1|2:r&1),t):(Mt(t),null);case 22:case 23:return Tx(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?yr&1073741824&&(Mt(t),t.subtreeFlags&6&&(t.flags|=8192)):Mt(t),null;case 24:return null;case 25:return null}throw Error(F(156,t.tag))}function S$(e,t){switch(fx(t),t.tag){case 1:return ur(t.type)&&of(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return $s(),Fe(cr),Fe(zt),wx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return bx(t),null;case 13:if(Fe(He),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(F(340));Is()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Fe(He),null;case 4:return $s(),null;case 10:return vx(t.type._context),null;case 22:case 23:return Tx(),null;case 24:return null;default:return null}}var Zu=!1,$t=!1,E$=typeof WeakSet=="function"?WeakSet:Set,Y=null;function ls(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Qe(e,t,n)}else r.current=null}function ug(e,t,r){try{r()}catch(n){Qe(e,t,n)}}var C1=!1;function j$(e,t){if(Vv=tf,e=WC(),ux(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var a=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var o=0,s=-1,l=-1,c=0,u=0,f=e,p=null;t:for(;;){for(var h;f!==r||a!==0&&f.nodeType!==3||(s=o+a),f!==i||n!==0&&f.nodeType!==3||(l=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===r&&++c===a&&(s=o),p===i&&++u===n&&(l=o),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Yv={focusedElem:e,selectionRange:r},tf=!1,Y=t;Y!==null;)if(t=Y,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Y=e;else for(;Y!==null;){t=Y;try{var g=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var v=g.memoizedProps,x=g.memoizedState,b=t.stateNode,y=b.getSnapshotBeforeUpdate(t.elementType===t.type?v:rn(t.type,v),x);b.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(F(163))}}catch(S){Qe(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Y=e;break}Y=t.return}return g=C1,C1=!1,g}function ic(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var a=n=n.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&ug(t,r,i)}a=a.next}while(a!==n)}}function Rp(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function dg(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function Fk(e){var t=e.alternate;t!==null&&(e.alternate=null,Fk(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[kn],delete t[wc],delete t[Xv],delete t[o$],delete t[s$])),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 Bk(e){return e.tag===5||e.tag===3||e.tag===4}function k1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Bk(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 fg(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=af));else if(n!==4&&(e=e.child,e!==null))for(fg(e,t,r),e=e.sibling;e!==null;)fg(e,t,r),e=e.sibling}function pg(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(pg(e,t,r),e=e.sibling;e!==null;)pg(e,t,r),e=e.sibling}var kt=null,on=!1;function Ba(e,t,r){for(r=r.child;r!==null;)zk(e,t,r),r=r.sibling}function zk(e,t,r){if(Dn&&typeof Dn.onCommitFiberUnmount=="function")try{Dn.onCommitFiberUnmount(Pp,r)}catch{}switch(r.tag){case 5:$t||ls(r,t);case 6:var n=kt,a=on;kt=null,Ba(e,t,r),kt=n,on=a,kt!==null&&(on?(e=kt,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):kt.removeChild(r.stateNode));break;case 18:kt!==null&&(on?(e=kt,r=r.stateNode,e.nodeType===8?Om(e.parentNode,r):e.nodeType===1&&Om(e,r),vc(e)):Om(kt,r.stateNode));break;case 4:n=kt,a=on,kt=r.stateNode.containerInfo,on=!0,Ba(e,t,r),kt=n,on=a;break;case 0:case 11:case 14:case 15:if(!$t&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){a=n=n.next;do{var i=a,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&ug(r,t,o),a=a.next}while(a!==n)}Ba(e,t,r);break;case 1:if(!$t&&(ls(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){Qe(r,t,s)}Ba(e,t,r);break;case 21:Ba(e,t,r);break;case 22:r.mode&1?($t=(n=$t)||r.memoizedState!==null,Ba(e,t,r),$t=n):Ba(e,t,r);break;default:Ba(e,t,r)}}function N1(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new E$),t.forEach(function(n){var a=R$.bind(null,e,n);r.has(n)||(r.add(n),n.then(a,a))})}}function en(e,t){var r=t.deletions;if(r!==null)for(var n=0;na&&(a=o),n&=~i}if(n=a,n=Je()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*C$(n/1960))-n,10e?16:e,ci===null)var n=!1;else{if(e=ci,ci=null,yf=0,ye&6)throw Error(F(331));var a=ye;for(ye|=4,Y=e.current;Y!==null;){var i=Y,o=i.child;if(Y.flags&16){var s=i.deletions;if(s!==null){for(var l=0;lJe()-Ax?co(e,0):Ox|=r),dr(e,t)}function Gk(e,t){t===0&&(e.mode&1?(t=Wu,Wu<<=1,!(Wu&130023424)&&(Wu=4194304)):t=1);var r=Zt();e=Sa(e,t),e!==null&&(eu(e,t,r),dr(e,r))}function T$(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),Gk(e,r)}function R$(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(F(314))}n!==null&&n.delete(t),Gk(e,r)}var Qk;Qk=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||cr.current)or=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return or=!1,b$(e,t,r);or=!!(e.flags&131072)}else or=!1,Ue&&t.flags&1048576&&ek(t,cf,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Md(e,t),e=t.pendingProps;var a=Ms(t,zt.current);ms(t,r),a=Ex(null,t,n,e,a,r);var i=jx();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ur(n)?(i=!0,sf(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,yx(t),a.updater=Tp,t.stateNode=a,a._reactInternals=t,ng(t,n,e,r),t=og(null,t,n,!0,i,r)):(t.tag=0,Ue&&i&&dx(t),Vt(null,t,a,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Md(e,t),e=t.pendingProps,a=n._init,n=a(n._payload),t.type=n,a=t.tag=M$(n),e=rn(n,e),a){case 0:t=ig(null,t,n,e,r);break e;case 1:t=E1(null,t,n,e,r);break e;case 11:t=w1(null,t,n,e,r);break e;case 14:t=S1(null,t,n,rn(n.type,e),r);break e}throw Error(F(306,n,""))}return t;case 0:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:rn(n,a),ig(e,t,n,a,r);case 1:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:rn(n,a),E1(e,t,n,a,r);case 3:e:{if(Rk(t),e===null)throw Error(F(387));n=t.pendingProps,i=t.memoizedState,a=i.element,ok(e,t),ff(t,n,null,r);var o=t.memoizedState;if(n=o.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=Fs(Error(F(423)),t),t=j1(e,t,n,r,a);break e}else if(n!==a){a=Fs(Error(F(424)),t),t=j1(e,t,n,r,a);break e}else for(Er=hi(t.stateNode.containerInfo.firstChild),jr=t,Ue=!0,ln=null,r=ak(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Is(),n===a){t=Ea(e,t,r);break e}Vt(e,t,n,r)}t=t.child}return t;case 5:return sk(t),e===null&&eg(t),n=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,o=a.children,Gv(n,a)?o=null:i!==null&&Gv(n,i)&&(t.flags|=32),Tk(e,t),Vt(e,t,o,r),t.child;case 6:return e===null&&eg(t),null;case 13:return Dk(e,t,r);case 4:return xx(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ls(t,null,n,r):Vt(e,t,n,r),t.child;case 11:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:rn(n,a),w1(e,t,n,a,r);case 7:return Vt(e,t,t.pendingProps,r),t.child;case 8:return Vt(e,t,t.pendingProps.children,r),t.child;case 12:return Vt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,a=t.pendingProps,i=t.memoizedProps,o=a.value,De(uf,n._currentValue),n._currentValue=o,i!==null)if(pn(i.value,o)){if(i.children===a.children&&!cr.current){t=Ea(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){o=i.child;for(var l=s.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=pa(-1,r&-r),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),tg(i.return,r,t),s.lanes|=r;break}l=l.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(F(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),tg(o,r,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Vt(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,n=t.pendingProps.children,ms(t,r),a=Kr(a),n=n(a),t.flags|=1,Vt(e,t,n,r),t.child;case 14:return n=t.type,a=rn(n,t.pendingProps),a=rn(n.type,a),S1(e,t,n,a,r);case 15:return Ak(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:rn(n,a),Md(e,t),t.tag=1,ur(n)?(e=!0,sf(t)):e=!1,ms(t,r),kk(t,n,a),ng(t,n,a,r),og(null,t,n,!0,e,r);case 19:return Mk(e,t,r);case 22:return _k(e,t,r)}throw Error(F(156,t.tag))};function Xk(e,t){return jC(e,t)}function D$(e,t,r,n){this.tag=e,this.key=r,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wr(e,t,r,n){return new D$(e,t,r,n)}function Dx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function M$(e){if(typeof e=="function")return Dx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Jy)return 11;if(e===ex)return 14}return 2}function yi(e,t){var r=e.alternate;return r===null?(r=Wr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function $d(e,t,r,n,a,i){var o=2;if(n=e,typeof e=="function")Dx(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Jo:return uo(r.children,a,i,t);case Zy:o=8,a|=8;break;case kv:return e=Wr(12,r,t,a|2),e.elementType=kv,e.lanes=i,e;case Nv:return e=Wr(13,r,t,a),e.elementType=Nv,e.lanes=i,e;case Ov:return e=Wr(19,r,t,a),e.elementType=Ov,e.lanes=i,e;case sC:return Mp(r,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case iC:o=10;break e;case oC:o=9;break e;case Jy:o=11;break e;case ex:o=14;break e;case Ka:o=16,n=null;break e}throw Error(F(130,e==null?e:typeof e,""))}return t=Wr(o,r,t,a),t.elementType=e,t.type=n,t.lanes=i,t}function uo(e,t,r,n){return e=Wr(7,e,n,t),e.lanes=r,e}function Mp(e,t,r,n){return e=Wr(22,e,n,t),e.elementType=sC,e.lanes=r,e.stateNode={isHidden:!1},e}function Lm(e,t,r){return e=Wr(6,e,null,t),e.lanes=r,e}function $m(e,t,r){return t=Wr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function I$(e,t,r,n,a){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=ym(0),this.expirationTimes=ym(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ym(0),this.identifierPrefix=n,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function Mx(e,t,r,n,a,i,o,s,l){return e=new I$(e,t,r,s,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=Wr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},yx(i),e}function L$(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tN)}catch(e){console.error(e)}}tN(),tC.exports=Or;var _i=tC.exports;const U$=qn(_i);var I1=_i;Pv.createRoot=I1.createRoot,Pv.hydrateRoot=I1.hydrateRoot;var il=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(){}},W$={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ja,Wy,RP,q$=(RP=class{constructor(){te(this,Ja,W$);te(this,Wy,!1)}setTimeoutProvider(e){H(this,Ja,e)}setTimeout(e,t){return k(this,Ja).setTimeout(e,t)}clearTimeout(e){k(this,Ja).clearTimeout(e)}setInterval(e,t){return k(this,Ja).setInterval(e,t)}clearInterval(e){k(this,Ja).clearInterval(e)}},Ja=new WeakMap,Wy=new WeakMap,RP),Gi=new q$;function H$(e){setTimeout(e,0)}var So=typeof window>"u"||"Deno"in globalThis;function Yt(){}function K$(e,t){return typeof e=="function"?e(t):e}function yg(e){return typeof e=="number"&&e>=0&&e!==1/0}function rN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function xi(e,t){return typeof e=="function"?e(t):e}function $r(e,t){return typeof e=="function"?e(t):e}function L1(e,t){const{type:r="all",exact:n,fetchStatus:a,predicate:i,queryKey:o,stale:s}=e;if(o){if(n){if(t.queryHash!==Fx(o,t.options))return!1}else if(!Nc(t.queryKey,o))return!1}if(r!=="all"){const l=t.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||a&&a!==t.state.fetchStatus||i&&!i(t))}function $1(e,t){const{exact:r,status:n,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(Eo(t.options.mutationKey)!==Eo(i))return!1}else if(!Nc(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||a&&!a(t))}function Fx(e,t){return((t==null?void 0:t.queryKeyHashFn)||Eo)(e)}function Eo(e){return JSON.stringify(e,(t,r)=>xg(r)?Object.keys(r).sort().reduce((n,a)=>(n[a]=r[a],n),{}):r)}function Nc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Nc(e[r],t[r])):!1}var V$=Object.prototype.hasOwnProperty;function nN(e,t){if(e===t)return e;const r=F1(e)&&F1(t);if(!r&&!(xg(e)&&xg(t)))return t;const a=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),o=i.length,s=r?new Array(o):{};let l=0;for(let c=0;c{Gi.setTimeout(t,e)})}function bg(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?nN(e,t):t}function G$(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Q$(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Bx=Symbol();function aN(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Bx?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function iN(e,t){return typeof e=="function"?e(...t):!!e}var eo,ei,Ss,DP,X$=(DP=class extends il{constructor(){super();te(this,eo);te(this,ei);te(this,Ss);H(this,Ss,t=>{if(!So&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){k(this,ei)||this.setEventListener(k(this,Ss))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,ei))==null||t.call(this),H(this,ei,void 0))}setEventListener(t){var r;H(this,Ss,t),(r=k(this,ei))==null||r.call(this),H(this,ei,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){k(this,eo)!==t&&(H(this,eo,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof k(this,eo)=="boolean"?k(this,eo):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},eo=new WeakMap,ei=new WeakMap,Ss=new WeakMap,DP),zx=new X$;function wg(){let e,t;const r=new Promise((a,i)=>{e=a,t=i});r.status="pending",r.catch(()=>{});function n(a){Object.assign(r,a),delete r.resolve,delete r.reject}return r.resolve=a=>{n({status:"fulfilled",value:a}),e(a)},r.reject=a=>{n({status:"rejected",reason:a}),t(a)},r}var Z$=H$;function J$(){let e=[],t=0,r=s=>{s()},n=s=>{s()},a=Z$;const i=s=>{t?e.push(s):a(()=>{r(s)})},o=()=>{const s=e;e=[],s.length&&a(()=>{n(()=>{s.forEach(l=>{r(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||o()}return l},batchCalls:s=>(...l)=>{i(()=>{s(...l)})},schedule:i,setNotifyFunction:s=>{r=s},setBatchNotifyFunction:s=>{n=s},setScheduler:s=>{a=s}}}var ft=J$(),Es,ti,js,MP,e3=(MP=class extends il{constructor(){super();te(this,Es,!0);te(this,ti);te(this,js);H(this,js,t=>{if(!So&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){k(this,ti)||this.setEventListener(k(this,js))}onUnsubscribe(){var t;this.hasListeners()||((t=k(this,ti))==null||t.call(this),H(this,ti,void 0))}setEventListener(t){var r;H(this,js,t),(r=k(this,ti))==null||r.call(this),H(this,ti,t(this.setOnline.bind(this)))}setOnline(t){k(this,Es)!==t&&(H(this,Es,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return k(this,Es)}},Es=new WeakMap,ti=new WeakMap,js=new WeakMap,MP),Sf=new e3;function t3(e){return Math.min(1e3*2**e,3e4)}function oN(e){return(e??"online")==="online"?Sf.isOnline():!0}var Sg=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function sN(e){let t=!1,r=0,n;const a=wg(),i=()=>a.status!=="pending",o=v=>{var x;if(!i()){const b=new Sg(v);p(b),(x=e.onCancel)==null||x.call(e,b)}},s=()=>{t=!0},l=()=>{t=!1},c=()=>zx.isFocused()&&(e.networkMode==="always"||Sf.isOnline())&&e.canRun(),u=()=>oN(e.networkMode)&&e.canRun(),f=v=>{i()||(n==null||n(),a.resolve(v))},p=v=>{i()||(n==null||n(),a.reject(v))},h=()=>new Promise(v=>{var x;n=b=>{(i()||c())&&v(b)},(x=e.onPause)==null||x.call(e)}).then(()=>{var v;n=void 0,i()||(v=e.onContinue)==null||v.call(e)}),g=()=>{if(i())return;let v;const x=r===0?e.initialPromise:void 0;try{v=x??e.fn()}catch(b){v=Promise.reject(b)}Promise.resolve(v).then(f).catch(b=>{var j;if(i())return;const y=e.retry??(So?0:3),w=e.retryDelay??t3,S=typeof w=="function"?w(r,b):w,E=y===!0||typeof y=="number"&&rc()?void 0:h()).then(()=>{t?p(b):g()})})};return{promise:a,status:()=>a.status,cancel:o,continue:()=>(n==null||n(),a),cancelRetry:s,continueRetry:l,canStart:u,start:()=>(u()?g():h().then(g),a)}}var to,IP,lN=(IP=class{constructor(){te(this,to)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),yg(this.gcTime)&&H(this,to,Gi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(So?1/0:5*60*1e3))}clearGcTimeout(){k(this,to)&&(Gi.clearTimeout(k(this,to)),H(this,to,void 0))}},to=new WeakMap,IP),ro,Ps,Lr,no,gt,Yc,ao,nn,Zn,LP,r3=(LP=class extends lN{constructor(t){super();te(this,nn);te(this,ro);te(this,Ps);te(this,Lr);te(this,no);te(this,gt);te(this,Yc);te(this,ao);H(this,ao,!1),H(this,Yc,t.defaultOptions),this.setOptions(t.options),this.observers=[],H(this,no,t.client),H(this,Lr,k(this,no).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,H(this,ro,z1(this.options)),this.state=t.state??k(this,ro),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=k(this,gt))==null?void 0:t.promise}setOptions(t){if(this.options={...k(this,Yc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=z1(this.options);r.data!==void 0&&(this.setData(r.data,{updatedAt:r.dataUpdatedAt,manual:!0}),H(this,ro,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&k(this,Lr).remove(this)}setData(t,r){const n=bg(this.state.data,t,this.options);return ce(this,nn,Zn).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){ce(this,nn,Zn).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,a;const r=(n=k(this,gt))==null?void 0:n.promise;return(a=k(this,gt))==null||a.cancel(t),r?r.then(Yt).catch(Yt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(k(this,ro))}isActive(){return this.observers.some(t=>$r(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Bx||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>xi(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:!rN(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=k(this,gt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=k(this,gt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),k(this,Lr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(k(this,gt)&&(k(this,ao)?k(this,gt).cancel({revert:!0}):k(this,gt).cancelRetry()),this.scheduleGc()),k(this,Lr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ce(this,nn,Zn).call(this,{type:"invalidate"})}async fetch(t,r){var l,c,u,f,p,h,g,v,x,b,y,w;if(this.state.fetchStatus!=="idle"&&((l=k(this,gt))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(k(this,gt))return k(this,gt).continueRetry(),k(this,gt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(E=>E.options.queryFn);S&&this.setOptions(S.options)}const n=new AbortController,a=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(H(this,ao,!0),n.signal)})},i=()=>{const S=aN(this.options,r),j=(()=>{const P={client:k(this,no),queryKey:this.queryKey,meta:this.meta};return a(P),P})();return H(this,ao,!1),this.options.persister?this.options.persister(S,j,this):S(j)},s=(()=>{const S={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:k(this,no),state:this.state,fetchFn:i};return a(S),S})();(c=this.options.behavior)==null||c.onFetch(s,this),H(this,Ps,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=s.fetchOptions)==null?void 0:u.meta))&&ce(this,nn,Zn).call(this,{type:"fetch",meta:(f=s.fetchOptions)==null?void 0:f.meta}),H(this,gt,sN({initialPromise:r==null?void 0:r.initialPromise,fn:s.fetchFn,onCancel:S=>{S instanceof Sg&&S.revert&&this.setState({...k(this,Ps),fetchStatus:"idle"}),n.abort()},onFail:(S,E)=>{ce(this,nn,Zn).call(this,{type:"failed",failureCount:S,error:E})},onPause:()=>{ce(this,nn,Zn).call(this,{type:"pause"})},onContinue:()=>{ce(this,nn,Zn).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}));try{const S=await k(this,gt).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(h=(p=k(this,Lr).config).onSuccess)==null||h.call(p,S,this),(v=(g=k(this,Lr).config).onSettled)==null||v.call(g,S,this.state.error,this),S}catch(S){if(S instanceof Sg){if(S.silent)return k(this,gt).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw ce(this,nn,Zn).call(this,{type:"error",error:S}),(b=(x=k(this,Lr).config).onError)==null||b.call(x,S,this),(w=(y=k(this,Lr).config).onSettled)==null||w.call(y,this.state.data,S,this),S}finally{this.scheduleGc()}}},ro=new WeakMap,Ps=new WeakMap,Lr=new WeakMap,no=new WeakMap,gt=new WeakMap,Yc=new WeakMap,ao=new WeakMap,nn=new WeakSet,Zn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...cN(n.data,this.options),fetchMeta:t.meta??null};case"success":const a={...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return H(this,Ps,t.manual?a:void 0),a;case"error":const i=t.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),ft.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),k(this,Lr).notify({query:this,type:"updated",action:t})})},LP);function cN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:oN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function z1(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var tr,he,Gc,Ht,io,Cs,ra,ri,Qc,ks,Ns,oo,so,ni,Os,Se,Gl,Eg,jg,Pg,Cg,kg,Ng,Og,uN,$P,n3=($P=class extends il{constructor(t,r){super();te(this,Se);te(this,tr);te(this,he);te(this,Gc);te(this,Ht);te(this,io);te(this,Cs);te(this,ra);te(this,ri);te(this,Qc);te(this,ks);te(this,Ns);te(this,oo);te(this,so);te(this,ni);te(this,Os,new Set);this.options=r,H(this,tr,t),H(this,ri,null),H(this,ra,wg()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(k(this,he).addObserver(this),U1(k(this,he),this.options)?ce(this,Se,Gl).call(this):this.updateResult(),ce(this,Se,Cg).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ag(k(this,he),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ag(k(this,he),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ce(this,Se,kg).call(this),ce(this,Se,Ng).call(this),k(this,he).removeObserver(this)}setOptions(t){const r=this.options,n=k(this,he);if(this.options=k(this,tr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof $r(this.options.enabled,k(this,he))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ce(this,Se,Og).call(this),k(this,he).setOptions(this.options),r._defaulted&&!wf(this.options,r)&&k(this,tr).getQueryCache().notify({type:"observerOptionsUpdated",query:k(this,he),observer:this});const a=this.hasListeners();a&&W1(k(this,he),n,this.options,r)&&ce(this,Se,Gl).call(this),this.updateResult(),a&&(k(this,he)!==n||$r(this.options.enabled,k(this,he))!==$r(r.enabled,k(this,he))||xi(this.options.staleTime,k(this,he))!==xi(r.staleTime,k(this,he)))&&ce(this,Se,Eg).call(this);const i=ce(this,Se,jg).call(this);a&&(k(this,he)!==n||$r(this.options.enabled,k(this,he))!==$r(r.enabled,k(this,he))||i!==k(this,ni))&&ce(this,Se,Pg).call(this,i)}getOptimisticResult(t){const r=k(this,tr).getQueryCache().build(k(this,tr),t),n=this.createResult(r,t);return i3(this,n)&&(H(this,Ht,n),H(this,Cs,this.options),H(this,io,k(this,he).state)),n}getCurrentResult(){return k(this,Ht)}trackResult(t,r){return new Proxy(t,{get:(n,a)=>(this.trackProp(a),r==null||r(a),a==="promise"&&!this.options.experimental_prefetchInRender&&k(this,ra).status==="pending"&&k(this,ra).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(n,a))})}trackProp(t){k(this,Os).add(t)}getCurrentQuery(){return k(this,he)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=k(this,tr).defaultQueryOptions(t),n=k(this,tr).getQueryCache().build(k(this,tr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return ce(this,Se,Gl).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),k(this,Ht)))}createResult(t,r){var N;const n=k(this,he),a=this.options,i=k(this,Ht),o=k(this,io),s=k(this,Cs),c=t!==n?t.state:k(this,Gc),{state:u}=t;let f={...u},p=!1,h;if(r._optimisticResults){const O=this.hasListeners(),A=!O&&U1(t,r),_=O&&W1(t,n,r,a);(A||_)&&(f={...f,...cN(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:g,errorUpdatedAt:v,status:x}=f;h=f.data;let b=!1;if(r.placeholderData!==void 0&&h===void 0&&x==="pending"){let O;i!=null&&i.isPlaceholderData&&r.placeholderData===(s==null?void 0:s.placeholderData)?(O=i.data,b=!0):O=typeof r.placeholderData=="function"?r.placeholderData((N=k(this,Ns))==null?void 0:N.state.data,k(this,Ns)):r.placeholderData,O!==void 0&&(x="success",h=bg(i==null?void 0:i.data,O,r),p=!0)}if(r.select&&h!==void 0&&!b)if(i&&h===(o==null?void 0:o.data)&&r.select===k(this,Qc))h=k(this,ks);else try{H(this,Qc,r.select),h=r.select(h),h=bg(i==null?void 0:i.data,h,r),H(this,ks,h),H(this,ri,null)}catch(O){H(this,ri,O)}k(this,ri)&&(g=k(this,ri),h=k(this,ks),v=Date.now(),x="error");const y=f.fetchStatus==="fetching",w=x==="pending",S=x==="error",E=w&&y,j=h!==void 0,C={status:x,fetchStatus:f.fetchStatus,isPending:w,isSuccess:x==="success",isError:S,isInitialLoading:E,isLoading:E,data:h,dataUpdatedAt:f.dataUpdatedAt,error:g,errorUpdatedAt:v,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!w,isLoadingError:S&&!j,isPaused:f.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:S&&j,isStale:Ux(t,r),refetch:this.refetch,promise:k(this,ra),isEnabled:$r(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const O=L=>{C.status==="error"?L.reject(C.error):C.data!==void 0&&L.resolve(C.data)},A=()=>{const L=H(this,ra,C.promise=wg());O(L)},_=k(this,ra);switch(_.status){case"pending":t.queryHash===n.queryHash&&O(_);break;case"fulfilled":(C.status==="error"||C.data!==_.value)&&A();break;case"rejected":(C.status!=="error"||C.error!==_.reason)&&A();break}}return C}updateResult(){const t=k(this,Ht),r=this.createResult(k(this,he),this.options);if(H(this,io,k(this,he).state),H(this,Cs,this.options),k(this,io).data!==void 0&&H(this,Ns,k(this,he)),wf(r,t))return;H(this,Ht,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,i=typeof a=="function"?a():a;if(i==="all"||!i&&!k(this,Os).size)return!0;const o=new Set(i??k(this,Os));return this.options.throwOnError&&o.add("error"),Object.keys(k(this,Ht)).some(s=>{const l=s;return k(this,Ht)[l]!==t[l]&&o.has(l)})};ce(this,Se,uN).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ce(this,Se,Cg).call(this)}},tr=new WeakMap,he=new WeakMap,Gc=new WeakMap,Ht=new WeakMap,io=new WeakMap,Cs=new WeakMap,ra=new WeakMap,ri=new WeakMap,Qc=new WeakMap,ks=new WeakMap,Ns=new WeakMap,oo=new WeakMap,so=new WeakMap,ni=new WeakMap,Os=new WeakMap,Se=new WeakSet,Gl=function(t){ce(this,Se,Og).call(this);let r=k(this,he).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Yt)),r},Eg=function(){ce(this,Se,kg).call(this);const t=xi(this.options.staleTime,k(this,he));if(So||k(this,Ht).isStale||!yg(t))return;const n=rN(k(this,Ht).dataUpdatedAt,t)+1;H(this,oo,Gi.setTimeout(()=>{k(this,Ht).isStale||this.updateResult()},n))},jg=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(k(this,he)):this.options.refetchInterval)??!1},Pg=function(t){ce(this,Se,Ng).call(this),H(this,ni,t),!(So||$r(this.options.enabled,k(this,he))===!1||!yg(k(this,ni))||k(this,ni)===0)&&H(this,so,Gi.setInterval(()=>{(this.options.refetchIntervalInBackground||zx.isFocused())&&ce(this,Se,Gl).call(this)},k(this,ni)))},Cg=function(){ce(this,Se,Eg).call(this),ce(this,Se,Pg).call(this,ce(this,Se,jg).call(this))},kg=function(){k(this,oo)&&(Gi.clearTimeout(k(this,oo)),H(this,oo,void 0))},Ng=function(){k(this,so)&&(Gi.clearInterval(k(this,so)),H(this,so,void 0))},Og=function(){const t=k(this,tr).getQueryCache().build(k(this,tr),this.options);if(t===k(this,he))return;const r=k(this,he);H(this,he,t),H(this,Gc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},uN=function(t){ft.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(k(this,Ht))}),k(this,tr).getQueryCache().notify({query:k(this,he),type:"observerResultsUpdated"})})},$P);function a3(e,t){return $r(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function U1(e,t){return a3(e,t)||e.state.data!==void 0&&Ag(e,t,t.refetchOnMount)}function Ag(e,t,r){if($r(t.enabled,e)!==!1&&xi(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Ux(e,t)}return!1}function W1(e,t,r,n){return(e!==t||$r(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Ux(e,r)}function Ux(e,t){return $r(t.enabled,e)!==!1&&e.isStaleByTime(xi(t.staleTime,e))}function i3(e,t){return!wf(e.getCurrentResult(),t)}function q1(e){return{onFetch:(t,r)=>{var u,f,p,h,g;const n=t.options,a=(p=(f=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:p.direction,i=((h=t.state.data)==null?void 0:h.pages)||[],o=((g=t.state.data)==null?void 0:g.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let v=!1;const x=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?v=!0:t.signal.addEventListener("abort",()=>{v=!0}),t.signal)})},b=aN(t.options,t.fetchOptions),y=async(w,S,E)=>{if(v)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const P=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:S,direction:E?"backward":"forward",meta:t.options.meta};return x(A),A})(),C=await b(P),{maxPages:N}=t.options,O=E?Q$:G$;return{pages:O(w.pages,C,N),pageParams:O(w.pageParams,S,N)}};if(a&&i.length){const w=a==="backward",S=w?o3:H1,E={pages:i,pageParams:o},j=S(n,E);s=await y(E,j,w)}else{const w=e??i.length;do{const S=l===0?o[0]??n.initialPageParam:H1(n,s);if(l>0&&S==null)break;s=await y(s,S),l++}while(l{var v,x;return(x=(v=t.options).persister)==null?void 0:x.call(v,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=c}}}function H1(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function o3(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Xc,jn,Kt,lo,Pn,qa,FP,s3=(FP=class extends lN{constructor(t){super();te(this,Pn);te(this,Xc);te(this,jn);te(this,Kt);te(this,lo);H(this,Xc,t.client),this.mutationId=t.mutationId,H(this,Kt,t.mutationCache),H(this,jn,[]),this.state=t.state||dN(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){k(this,jn).includes(t)||(k(this,jn).push(t),this.clearGcTimeout(),k(this,Kt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){H(this,jn,k(this,jn).filter(r=>r!==t)),this.scheduleGc(),k(this,Kt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){k(this,jn).length||(this.state.status==="pending"?this.scheduleGc():k(this,Kt).remove(this))}continue(){var t;return((t=k(this,lo))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,s,l,c,u,f,p,h,g,v,x,b,y,w,S,E,j,P,C,N;const r=()=>{ce(this,Pn,qa).call(this,{type:"continue"})},n={client:k(this,Xc),meta:this.options.meta,mutationKey:this.options.mutationKey};H(this,lo,sN({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(O,A)=>{ce(this,Pn,qa).call(this,{type:"failed",failureCount:O,error:A})},onPause:()=>{ce(this,Pn,qa).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>k(this,Kt).canRun(this)}));const a=this.state.status==="pending",i=!k(this,lo).canStart();try{if(a)r();else{ce(this,Pn,qa).call(this,{type:"pending",variables:t,isPaused:i}),await((s=(o=k(this,Kt).config).onMutate)==null?void 0:s.call(o,t,this,n));const A=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t,n));A!==this.state.context&&ce(this,Pn,qa).call(this,{type:"pending",context:A,variables:t,isPaused:i})}const O=await k(this,lo).start();return await((f=(u=k(this,Kt).config).onSuccess)==null?void 0:f.call(u,O,t,this.state.context,this,n)),await((h=(p=this.options).onSuccess)==null?void 0:h.call(p,O,t,this.state.context,n)),await((v=(g=k(this,Kt).config).onSettled)==null?void 0:v.call(g,O,null,this.state.variables,this.state.context,this,n)),await((b=(x=this.options).onSettled)==null?void 0:b.call(x,O,null,t,this.state.context,n)),ce(this,Pn,qa).call(this,{type:"success",data:O}),O}catch(O){try{throw await((w=(y=k(this,Kt).config).onError)==null?void 0:w.call(y,O,t,this.state.context,this,n)),await((E=(S=this.options).onError)==null?void 0:E.call(S,O,t,this.state.context,n)),await((P=(j=k(this,Kt).config).onSettled)==null?void 0:P.call(j,void 0,O,this.state.variables,this.state.context,this,n)),await((N=(C=this.options).onSettled)==null?void 0:N.call(C,void 0,O,t,this.state.context,n)),O}finally{ce(this,Pn,qa).call(this,{type:"error",error:O})}}finally{k(this,Kt).runNext(this)}}},Xc=new WeakMap,jn=new WeakMap,Kt=new WeakMap,lo=new WeakMap,Pn=new WeakSet,qa=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,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{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),ft.batch(()=>{k(this,jn).forEach(n=>{n.onMutationUpdate(t)}),k(this,Kt).notify({mutation:this,type:"updated",action:t})})},FP);function dN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var na,an,Zc,BP,l3=(BP=class extends il{constructor(t={}){super();te(this,na);te(this,an);te(this,Zc);this.config=t,H(this,na,new Set),H(this,an,new Map),H(this,Zc,0)}build(t,r,n){const a=new s3({client:t,mutationCache:this,mutationId:++Lu(this,Zc)._,options:t.defaultMutationOptions(r),state:n});return this.add(a),a}add(t){k(this,na).add(t);const r=td(t);if(typeof r=="string"){const n=k(this,an).get(r);n?n.push(t):k(this,an).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(k(this,na).delete(t)){const r=td(t);if(typeof r=="string"){const n=k(this,an).get(r);if(n)if(n.length>1){const a=n.indexOf(t);a!==-1&&n.splice(a,1)}else n[0]===t&&k(this,an).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=td(t);if(typeof r=="string"){const n=k(this,an).get(r),a=n==null?void 0:n.find(i=>i.state.status==="pending");return!a||a===t}else return!0}runNext(t){var n;const r=td(t);if(typeof r=="string"){const a=(n=k(this,an).get(r))==null?void 0:n.find(i=>i!==t&&i.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ft.batch(()=>{k(this,na).forEach(t=>{this.notify({type:"removed",mutation:t})}),k(this,na).clear(),k(this,an).clear()})}getAll(){return Array.from(k(this,na))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>$1(r,n))}findAll(t={}){return this.getAll().filter(r=>$1(t,r))}notify(t){ft.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return ft.batch(()=>Promise.all(t.map(r=>r.continue().catch(Yt))))}},na=new WeakMap,an=new WeakMap,Zc=new WeakMap,BP);function td(e){var t;return(t=e.options.scope)==null?void 0:t.id}var aa,ai,rr,ia,xa,Fd,_g,zP,c3=(zP=class extends il{constructor(r,n){super();te(this,xa);te(this,aa);te(this,ai);te(this,rr);te(this,ia);H(this,aa,r),this.setOptions(n),this.bindMethods(),ce(this,xa,Fd).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var a;const n=this.options;this.options=k(this,aa).defaultMutationOptions(r),wf(this.options,n)||k(this,aa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:k(this,rr),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Eo(n.mutationKey)!==Eo(this.options.mutationKey)?this.reset():((a=k(this,rr))==null?void 0:a.state.status)==="pending"&&k(this,rr).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=k(this,rr))==null||r.removeObserver(this)}onMutationUpdate(r){ce(this,xa,Fd).call(this),ce(this,xa,_g).call(this,r)}getCurrentResult(){return k(this,ai)}reset(){var r;(r=k(this,rr))==null||r.removeObserver(this),H(this,rr,void 0),ce(this,xa,Fd).call(this),ce(this,xa,_g).call(this)}mutate(r,n){var a;return H(this,ia,n),(a=k(this,rr))==null||a.removeObserver(this),H(this,rr,k(this,aa).getMutationCache().build(k(this,aa),this.options)),k(this,rr).addObserver(this),k(this,rr).execute(r)}},aa=new WeakMap,ai=new WeakMap,rr=new WeakMap,ia=new WeakMap,xa=new WeakSet,Fd=function(){var n;const r=((n=k(this,rr))==null?void 0:n.state)??dN();H(this,ai,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},_g=function(r){ft.batch(()=>{var n,a,i,o,s,l,c,u;if(k(this,ia)&&this.hasListeners()){const f=k(this,ai).variables,p=k(this,ai).context,h={client:k(this,aa),meta:this.options.meta,mutationKey:this.options.mutationKey};(r==null?void 0:r.type)==="success"?((a=(n=k(this,ia)).onSuccess)==null||a.call(n,r.data,f,p,h),(o=(i=k(this,ia)).onSettled)==null||o.call(i,r.data,null,f,p,h)):(r==null?void 0:r.type)==="error"&&((l=(s=k(this,ia)).onError)==null||l.call(s,r.error,f,p,h),(u=(c=k(this,ia)).onSettled)==null||u.call(c,void 0,r.error,f,p,h))}this.listeners.forEach(f=>{f(k(this,ai))})})},zP),Cn,UP,u3=(UP=class extends il{constructor(t={}){super();te(this,Cn);this.config=t,H(this,Cn,new Map)}build(t,r,n){const a=r.queryKey,i=r.queryHash??Fx(a,r);let o=this.get(i);return o||(o=new r3({client:t,queryKey:a,queryHash:i,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(a)}),this.add(o)),o}add(t){k(this,Cn).has(t.queryHash)||(k(this,Cn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=k(this,Cn).get(t.queryHash);r&&(t.destroy(),r===t&&k(this,Cn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ft.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return k(this,Cn).get(t)}getAll(){return[...k(this,Cn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>L1(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>L1(t,n)):r}notify(t){ft.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){ft.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ft.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Cn=new WeakMap,UP),Ge,ii,oi,As,_s,si,Ts,Rs,WP,d3=(WP=class{constructor(e={}){te(this,Ge);te(this,ii);te(this,oi);te(this,As);te(this,_s);te(this,si);te(this,Ts);te(this,Rs);H(this,Ge,e.queryCache||new u3),H(this,ii,e.mutationCache||new l3),H(this,oi,e.defaultOptions||{}),H(this,As,new Map),H(this,_s,new Map),H(this,si,0)}mount(){Lu(this,si)._++,k(this,si)===1&&(H(this,Ts,zx.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,Ge).onFocus())})),H(this,Rs,Sf.subscribe(async e=>{e&&(await this.resumePausedMutations(),k(this,Ge).onOnline())})))}unmount(){var e,t;Lu(this,si)._--,k(this,si)===0&&((e=k(this,Ts))==null||e.call(this),H(this,Ts,void 0),(t=k(this,Rs))==null||t.call(this),H(this,Rs,void 0))}isFetching(e){return k(this,Ge).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return k(this,ii).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=k(this,Ge).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=k(this,Ge).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(xi(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return k(this,Ge).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),a=k(this,Ge).get(n.queryHash),i=a==null?void 0:a.state.data,o=K$(t,i);if(o!==void 0)return k(this,Ge).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return ft.batch(()=>k(this,Ge).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=k(this,Ge).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=k(this,Ge);ft.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=k(this,Ge);return ft.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=ft.batch(()=>k(this,Ge).findAll(e).map(a=>a.cancel(r)));return Promise.all(n).then(Yt).catch(Yt)}invalidateQueries(e,t={}){return ft.batch(()=>(k(this,Ge).findAll(e).forEach(r=>{r.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 r={...t,cancelRefetch:t.cancelRefetch??!0},n=ft.batch(()=>k(this,Ge).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,r);return r.throwOnError||(i=i.catch(Yt)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(Yt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=k(this,Ge).build(this,t);return r.isStaleByTime(xi(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Yt).catch(Yt)}fetchInfiniteQuery(e){return e.behavior=q1(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Yt).catch(Yt)}ensureInfiniteQueryData(e){return e.behavior=q1(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Sf.isOnline()?k(this,ii).resumePausedMutations():Promise.resolve()}getQueryCache(){return k(this,Ge)}getMutationCache(){return k(this,ii)}getDefaultOptions(){return k(this,oi)}setDefaultOptions(e){H(this,oi,e)}setQueryDefaults(e,t){k(this,As).set(Eo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...k(this,As).values()],r={};return t.forEach(n=>{Nc(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){k(this,_s).set(Eo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...k(this,_s).values()],r={};return t.forEach(n=>{Nc(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...k(this,oi).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Fx(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===Bx&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...k(this,oi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){k(this,Ge).clear(),k(this,ii).clear()}},Ge=new WeakMap,ii=new WeakMap,oi=new WeakMap,As=new WeakMap,_s=new WeakMap,si=new WeakMap,Ts=new WeakMap,Rs=new WeakMap,WP),fN=m.createContext(void 0),pN=e=>{const t=m.useContext(fN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},f3=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(fN.Provider,{value:e,children:t})),hN=m.createContext(!1),p3=()=>m.useContext(hN);hN.Provider;function h3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var m3=m.createContext(h3()),v3=()=>m.useContext(m3),g3=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},y3=e=>{m.useEffect(()=>{e.clearReset()},[e])},x3=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(a&&e.data===void 0||iN(r,[e.error,n])),b3=e=>{if(e.suspense){const r=a=>a==="static"?a:Math.max(a??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...a)=>r(n(...a)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},w3=(e,t)=>e.isLoading&&e.isFetching&&!t,S3=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,K1=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function E3(e,t,r){var f,p,h,g,v;const n=p3(),a=v3(),i=pN(),o=i.defaultQueryOptions(e);(p=(f=i.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||p.call(f,o),o._optimisticResults=n?"isRestoring":"optimistic",b3(o),g3(o,a),y3(a);const s=!i.getQueryCache().get(o.queryHash),[l]=m.useState(()=>new t(i,o)),c=l.getOptimisticResult(o),u=!n&&e.subscribed!==!1;if(m.useSyncExternalStore(m.useCallback(x=>{const b=u?l.subscribe(ft.batchCalls(x)):Yt;return l.updateResult(),b},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),m.useEffect(()=>{l.setOptions(o)},[o,l]),S3(o,c))throw K1(o,l,a);if(x3({result:c,errorResetBoundary:a,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw c.error;if((g=(h=i.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||g.call(h,o,c),o.experimental_prefetchInRender&&!So&&w3(c,n)){const x=s?K1(o,l,a):(v=i.getQueryCache().get(o.queryHash))==null?void 0:v.promise;x==null||x.catch(Yt).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?c:l.trackResult(c)}function tt(e,t){return E3(e,n3)}function j3(e,t){const r=pN(),[n]=m.useState(()=>new c3(r,e));m.useEffect(()=>{n.setOptions(e)},[n,e]);const a=m.useSyncExternalStore(m.useCallback(o=>n.subscribe(ft.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),i=m.useCallback((o,s)=>{n.mutate(o,s).catch(Yt)},[n]);if(a.error&&iN(n.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:i,mutateAsync:a.mutate}}/** +`+i.stack}return{value:e,source:t,stack:a,digest:null}}function Mm(e,t,r){return{value:e,source:null,stack:r??null,digest:t??null}}function av(e,t){try{console.error(t.value)}catch(r){setTimeout(function(){throw r})}}var v$=typeof WeakMap=="function"?WeakMap:Map;function NC(e,t,r){r=pa(-1,r),r.tag=3,r.payload={element:null};var n=t.value;return r.callback=function(){vf||(vf=!0,hv=n),av(e,t)},r}function OC(e,t,r){r=pa(-1,r),r.tag=3;var n=e.type.getDerivedStateFromError;if(typeof n=="function"){var a=t.value;r.payload=function(){return n(a)},r.callback=function(){av(e,t)}}var i=e.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){av(e,t),typeof n!="function"&&(gi===null?gi=new Set([this]):gi.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),r}function y1(e,t,r){var n=e.pingCache;if(n===null){n=e.pingCache=new v$;var a=new Set;n.set(t,a)}else a=n.get(t),a===void 0&&(a=new Set,n.set(t,a));a.has(r)||(a.add(r),e=T$.bind(null,e,t,r),t.then(e,e))}function x1(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 b1(e,t,r,n,a){return e.mode&1?(e.flags|=65536,e.lanes=a,e):(e===t?e.flags|=65536:(e.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(t=pa(-1,1),t.tag=2,mi(r,t,1))),r.lanes|=1),e)}var y$=_a.ReactCurrentOwner,or=!1;function Vt(e,t,r,n){t.child=e===null?aC(t,null,r,n):Ls(t,e.child,r,n)}function w1(e,t,r,n,a){r=r.render;var i=t.ref;return ms(t,a),n=Ex(e,t,r,n,i,a),r=jx(),e!==null&&!or?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Ea(e,t,a)):(Ue&&r&&dx(t),t.flags|=1,Vt(e,t,n,a),t.child)}function S1(e,t,r,n,a){if(e===null){var i=r.type;return typeof i=="function"&&!Dx(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(t.tag=15,t.type=i,AC(e,t,i,n,a)):(e=$d(r.type,null,n,t,t.mode,a),e.ref=t.ref,e.return=t,t.child=e)}if(i=e.child,!(e.lanes&a)){var o=i.memoizedProps;if(r=r.compare,r=r!==null?r:yc,r(o,n)&&e.ref===t.ref)return Ea(e,t,a)}return t.flags|=1,e=yi(i,n),e.ref=t.ref,e.return=t,t.child=e}function AC(e,t,r,n,a){if(e!==null){var i=e.memoizedProps;if(yc(i,n)&&e.ref===t.ref)if(or=!1,t.pendingProps=n=i,(e.lanes&a)!==0)e.flags&131072&&(or=!0);else return t.lanes=e.lanes,Ea(e,t,a)}return iv(e,t,r,n,a)}function TC(e,t,r){var n=t.pendingProps,a=n.children,i=e!==null?e.memoizedState:null;if(n.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},De(cs,yr),yr|=r;else{if(!(r&1073741824))return e=i!==null?i.baseLanes|r:r,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,De(cs,yr),yr|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,De(cs,yr),yr|=n}else i!==null?(n=i.baseLanes|r,t.memoizedState=null):n=r,De(cs,yr),yr|=n;return Vt(e,t,a,r),t.child}function _C(e,t){var r=t.ref;(e===null&&r!==null||e!==null&&e.ref!==r)&&(t.flags|=512,t.flags|=2097152)}function iv(e,t,r,n,a){var i=ur(r)?vo:zt.current;return i=Ms(t,i),ms(t,a),r=Ex(e,t,r,n,i,a),n=jx(),e!==null&&!or?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a,Ea(e,t,a)):(Ue&&n&&dx(t),t.flags|=1,Vt(e,t,r,a),t.child)}function E1(e,t,r,n,a){if(ur(r)){var i=!0;sf(t)}else i=!1;if(ms(t,a),t.stateNode===null)Md(e,t),CC(t,r,n),nv(t,r,n,a),n=!0;else if(e===null){var o=t.stateNode,s=t.memoizedProps;o.props=s;var l=o.context,c=r.contextType;typeof c=="object"&&c!==null?c=Vr(c):(c=ur(r)?vo:zt.current,c=Ms(t,c));var u=r.getDerivedStateFromProps,f=typeof u=="function"||typeof o.getSnapshotBeforeUpdate=="function";f||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==n||l!==c)&&v1(t,o,n,c),Va=!1;var p=t.memoizedState;o.state=p,ff(t,n,o,a),l=t.memoizedState,s!==n||p!==l||cr.current||Va?(typeof u=="function"&&(rv(t,r,u,n),l=t.memoizedState),(s=Va||g1(t,r,s,n,p,l,c))?(f||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=l),o.props=n,o.state=l,o.context=c,n=s):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,oC(e,t),s=t.memoizedProps,c=t.type===t.elementType?s:nn(t.type,s),o.props=c,f=t.pendingProps,p=o.context,l=r.contextType,typeof l=="object"&&l!==null?l=Vr(l):(l=ur(r)?vo:zt.current,l=Ms(t,l));var h=r.getDerivedStateFromProps;(u=typeof h=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(s!==f||p!==l)&&v1(t,o,n,l),Va=!1,p=t.memoizedState,o.state=p,ff(t,n,o,a);var v=t.memoizedState;s!==f||p!==v||cr.current||Va?(typeof h=="function"&&(rv(t,r,h,n),v=t.memoizedState),(c=Va||g1(t,r,c,n,p,v,l)||!1)?(u||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,v,l),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,v,l)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=v),o.props=n,o.state=v,o.context=l,n=c):(typeof o.componentDidUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||s===e.memoizedProps&&p===e.memoizedState||(t.flags|=1024),n=!1)}return ov(e,t,r,n,i,a)}function ov(e,t,r,n,a,i){_C(e,t);var o=(t.flags&128)!==0;if(!n&&!o)return a&&l1(t,r,!1),Ea(e,t,i);n=t.stateNode,y$.current=t;var s=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return t.flags|=1,e!==null&&o?(t.child=Ls(t,e.child,null,i),t.child=Ls(t,null,s,i)):Vt(e,t,s,i),t.memoizedState=n.state,a&&l1(t,r,!0),t.child}function RC(e){var t=e.stateNode;t.pendingContext?s1(e,t.pendingContext,t.pendingContext!==t.context):t.context&&s1(e,t.context,!1),xx(e,t.containerInfo)}function j1(e,t,r,n,a){return Is(),px(a),t.flags|=256,Vt(e,t,r,n),t.child}var sv={dehydrated:null,treeContext:null,retryLane:0};function lv(e){return{baseLanes:e,cachePool:null,transitions:null}}function DC(e,t,r){var n=t.pendingProps,a=He.current,i=!1,o=(t.flags&128)!==0,s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:(a&2)!==0),s?(i=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(a|=1),De(He,a&1),e===null)return ev(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):(o=n.children,e=n.fallback,i?(n=t.mode,i=t.child,o={mode:"hidden",children:o},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Mp(o,n,0,null),e=uo(e,n,r,null),i.return=t,e.return=t,i.sibling=e,t.child=i,t.child.memoizedState=lv(r),t.memoizedState=sv,e):Cx(t,o));if(a=e.memoizedState,a!==null&&(s=a.dehydrated,s!==null))return x$(e,t,o,n,s,a,r);if(i){i=n.fallback,o=t.mode,a=e.child,s=a.sibling;var l={mode:"hidden",children:n.children};return!(o&1)&&t.child!==a?(n=t.child,n.childLanes=0,n.pendingProps=l,t.deletions=null):(n=yi(a,l),n.subtreeFlags=a.subtreeFlags&14680064),s!==null?i=yi(s,i):(i=uo(i,o,r,null),i.flags|=2),i.return=t,n.return=t,n.sibling=i,t.child=n,n=i,i=t.child,o=e.child.memoizedState,o=o===null?lv(r):{baseLanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=e.childLanes&~r,t.memoizedState=sv,n}return i=e.child,e=i.sibling,n=yi(i,{mode:"visible",children:n.children}),!(t.mode&1)&&(n.lanes=r),n.return=t,n.sibling=null,e!==null&&(r=t.deletions,r===null?(t.deletions=[e],t.flags|=16):r.push(e)),t.child=n,t.memoizedState=null,n}function Cx(e,t){return t=Mp({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function Xu(e,t,r,n){return n!==null&&px(n),Ls(t,e.child,null,r),e=Cx(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function x$(e,t,r,n,a,i,o){if(r)return t.flags&256?(t.flags&=-257,n=Mm(Error(F(422))),Xu(e,t,o,n)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(i=n.fallback,a=t.mode,n=Mp({mode:"visible",children:n.children},a,0,null),i=uo(i,a,o,null),i.flags|=2,n.return=t,i.return=t,n.sibling=i,t.child=n,t.mode&1&&Ls(t,e.child,null,o),t.child.memoizedState=lv(o),t.memoizedState=sv,i);if(!(t.mode&1))return Xu(e,t,o,null);if(a.data==="$!"){if(n=a.nextSibling&&a.nextSibling.dataset,n)var s=n.dgst;return n=s,i=Error(F(419)),n=Mm(i,n,void 0),Xu(e,t,o,n)}if(s=(o&e.childLanes)!==0,or||s){if(n=wt,n!==null){switch(o&-o){case 4:a=2;break;case 16:a=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:a=32;break;case 536870912:a=268435456;break;default:a=0}a=a&(n.suspendedLanes|o)?0:a,a!==0&&a!==i.retryLane&&(i.retryLane=a,Sa(e,a),pn(n,e,a,-1))}return Rx(),n=Mm(Error(F(421))),Xu(e,t,o,n)}return a.data==="$?"?(t.flags|=128,t.child=e.child,t=_$.bind(null,e),a._reactRetry=t,null):(e=i.treeContext,Er=hi(a.nextSibling),jr=t,Ue=!0,cn=null,e!==null&&(Br[zr++]=la,Br[zr++]=ca,Br[zr++]=yo,la=e.id,ca=e.overflow,yo=t),t=Cx(t,n.children),t.flags|=4096,t)}function P1(e,t,r){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),tv(e.return,t,r)}function Im(e,t,r,n,a){var i=e.memoizedState;i===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:a}:(i.isBackwards=t,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=a)}function MC(e,t,r){var n=t.pendingProps,a=n.revealOrder,i=n.tail;if(Vt(e,t,n.children,r),n=He.current,n&2)n=n&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&&P1(e,r,t);else if(e.tag===19)P1(e,r,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}n&=1}if(De(He,n),!(t.mode&1))t.memoizedState=null;else switch(a){case"forwards":for(r=t.child,a=null;r!==null;)e=r.alternate,e!==null&&pf(e)===null&&(a=r),r=r.sibling;r=a,r===null?(a=t.child,t.child=null):(a=r.sibling,r.sibling=null),Im(t,!1,a,r,i);break;case"backwards":for(r=null,a=t.child,t.child=null;a!==null;){if(e=a.alternate,e!==null&&pf(e)===null){t.child=a;break}e=a.sibling,a.sibling=r,r=a,a=e}Im(t,!0,r,null,i);break;case"together":Im(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function Md(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function Ea(e,t,r){if(e!==null&&(t.dependencies=e.dependencies),bo|=t.lanes,!(r&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(F(153));if(t.child!==null){for(e=t.child,r=yi(e,e.pendingProps),t.child=r,r.return=t;e.sibling!==null;)e=e.sibling,r=r.sibling=yi(e,e.pendingProps),r.return=t;r.sibling=null}return t.child}function b$(e,t,r){switch(t.tag){case 3:RC(t),Is();break;case 5:sC(t);break;case 1:ur(t.type)&&sf(t);break;case 4:xx(t,t.stateNode.containerInfo);break;case 10:var n=t.type._context,a=t.memoizedProps.value;De(uf,n._currentValue),n._currentValue=a;break;case 13:if(n=t.memoizedState,n!==null)return n.dehydrated!==null?(De(He,He.current&1),t.flags|=128,null):r&t.child.childLanes?DC(e,t,r):(De(He,He.current&1),e=Ea(e,t,r),e!==null?e.sibling:null);De(He,He.current&1);break;case 19:if(n=(r&t.childLanes)!==0,e.flags&128){if(n)return MC(e,t,r);t.flags|=128}if(a=t.memoizedState,a!==null&&(a.rendering=null,a.tail=null,a.lastEffect=null),De(He,He.current),n)break;return null;case 22:case 23:return t.lanes=0,TC(e,t,r)}return Ea(e,t,r)}var IC,cv,LC,$C;IC=function(e,t){for(var r=t.child;r!==null;){if(r.tag===5||r.tag===6)e.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===t)break;for(;r.sibling===null;){if(r.return===null||r.return===t)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};cv=function(){};LC=function(e,t,r,n){var a=e.memoizedProps;if(a!==n){e=t.stateNode,Yi(In.current);var i=null;switch(r){case"input":a=Tg(e,a),n=Tg(e,n),i=[];break;case"select":a=Ve({},a,{value:void 0}),n=Ve({},n,{value:void 0}),i=[];break;case"textarea":a=Dg(e,a),n=Dg(e,n),i=[];break;default:typeof a.onClick!="function"&&typeof n.onClick=="function"&&(e.onclick=af)}Ig(r,n);var o;r=null;for(c in a)if(!n.hasOwnProperty(c)&&a.hasOwnProperty(c)&&a[c]!=null)if(c==="style"){var s=a[c];for(o in s)s.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else c!=="dangerouslySetInnerHTML"&&c!=="children"&&c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&c!=="autoFocus"&&(dc.hasOwnProperty(c)?i||(i=[]):(i=i||[]).push(c,null));for(c in n){var l=n[c];if(s=a!=null?a[c]:void 0,n.hasOwnProperty(c)&&l!==s&&(l!=null||s!=null))if(c==="style")if(s){for(o in s)!s.hasOwnProperty(o)||l&&l.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in l)l.hasOwnProperty(o)&&s[o]!==l[o]&&(r||(r={}),r[o]=l[o])}else r||(i||(i=[]),i.push(c,r)),r=l;else c==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,s=s?s.__html:void 0,l!=null&&s!==l&&(i=i||[]).push(c,l)):c==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(c,""+l):c!=="suppressContentEditableWarning"&&c!=="suppressHydrationWarning"&&(dc.hasOwnProperty(c)?(l!=null&&c==="onScroll"&&Le("scroll",e),i||s===l||(i=[])):(i=i||[]).push(c,l))}r&&(i=i||[]).push("style",r);var c=i;(t.updateQueue=c)&&(t.flags|=4)}};$C=function(e,t,r,n){r!==n&&(t.flags|=4)};function Al(e,t){if(!Ue)switch(e.tailMode){case"hidden":t=e.tail;for(var r=null;t!==null;)t.alternate!==null&&(r=t),t=t.sibling;r===null?e.tail=null:r.sibling=null;break;case"collapsed":r=e.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Mt(e){var t=e.alternate!==null&&e.alternate.child===e.child,r=0,n=0;if(t)for(var a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags&14680064,n|=a.flags&14680064,a.return=e,a=a.sibling;else for(a=e.child;a!==null;)r|=a.lanes|a.childLanes,n|=a.subtreeFlags,n|=a.flags,a.return=e,a=a.sibling;return e.subtreeFlags|=n,e.childLanes=r,t}function w$(e,t,r){var n=t.pendingProps;switch(fx(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mt(t),null;case 1:return ur(t.type)&&of(),Mt(t),null;case 3:return n=t.stateNode,$s(),Fe(cr),Fe(zt),wx(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Gu(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,cn!==null&&(vv(cn),cn=null))),cv(e,t),Mt(t),null;case 5:bx(t);var a=Yi(Ec.current);if(r=t.type,e!==null&&t.stateNode!=null)LC(e,t,r,n,a),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!n){if(t.stateNode===null)throw Error(F(166));return Mt(t),null}if(e=Yi(In.current),Gu(t)){n=t.stateNode,r=t.type;var i=t.memoizedProps;switch(n[Nn]=t,n[wc]=i,e=(t.mode&1)!==0,r){case"dialog":Le("cancel",n),Le("close",n);break;case"iframe":case"object":case"embed":Le("load",n);break;case"video":case"audio":for(a=0;a<\/script>",e=e.removeChild(e.firstChild)):typeof n.is=="string"?e=o.createElement(r,{is:n.is}):(e=o.createElement(r),r==="select"&&(o=e,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):e=o.createElementNS(e,r),e[Nn]=t,e[wc]=n,IC(e,t,!1,!1),t.stateNode=e;e:{switch(o=Lg(r,n),r){case"dialog":Le("cancel",e),Le("close",e),a=n;break;case"iframe":case"object":case"embed":Le("load",e),a=n;break;case"video":case"audio":for(a=0;aBs&&(t.flags|=128,n=!0,Al(i,!1),t.lanes=4194304)}else{if(!n)if(e=pf(o),e!==null){if(t.flags|=128,n=!0,r=e.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),Al(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Ue)return Mt(t),null}else 2*Je()-i.renderingStartTime>Bs&&r!==1073741824&&(t.flags|=128,n=!0,Al(i,!1),t.lanes=4194304);i.isBackwards?(o.sibling=t.child,t.child=o):(r=i.last,r!==null?r.sibling=o:t.child=o,i.last=o)}return i.tail!==null?(t=i.tail,i.rendering=t,i.tail=t.sibling,i.renderingStartTime=Je(),t.sibling=null,r=He.current,De(He,n?r&1|2:r&1),t):(Mt(t),null);case 22:case 23:return _x(),n=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==n&&(t.flags|=8192),n&&t.mode&1?yr&1073741824&&(Mt(t),t.subtreeFlags&6&&(t.flags|=8192)):Mt(t),null;case 24:return null;case 25:return null}throw Error(F(156,t.tag))}function S$(e,t){switch(fx(t),t.tag){case 1:return ur(t.type)&&of(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return $s(),Fe(cr),Fe(zt),wx(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return bx(t),null;case 13:if(Fe(He),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(F(340));Is()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Fe(He),null;case 4:return $s(),null;case 10:return gx(t.type._context),null;case 22:case 23:return _x(),null;case 24:return null;default:return null}}var Zu=!1,$t=!1,E$=typeof WeakSet=="function"?WeakSet:Set,Y=null;function ls(e,t){var r=e.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Qe(e,t,n)}else r.current=null}function uv(e,t,r){try{r()}catch(n){Qe(e,t,n)}}var k1=!1;function j$(e,t){if(Vg=tf,e=Wk(),ux(e)){if("selectionStart"in e)var r={start:e.selectionStart,end:e.selectionEnd};else e:{r=(r=e.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var a=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var o=0,s=-1,l=-1,c=0,u=0,f=e,p=null;t:for(;;){for(var h;f!==r||a!==0&&f.nodeType!==3||(s=o+a),f!==i||n!==0&&f.nodeType!==3||(l=o+n),f.nodeType===3&&(o+=f.nodeValue.length),(h=f.firstChild)!==null;)p=f,f=h;for(;;){if(f===e)break t;if(p===r&&++c===a&&(s=o),p===i&&++u===n&&(l=o),(h=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=h}r=s===-1||l===-1?null:{start:s,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(Yg={focusedElem:e,selectionRange:r},tf=!1,Y=t;Y!==null;)if(t=Y,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Y=e;else for(;Y!==null;){t=Y;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 g=v.memoizedProps,x=v.memoizedState,b=t.stateNode,y=b.getSnapshotBeforeUpdate(t.elementType===t.type?g:nn(t.type,g),x);b.__reactInternalSnapshotBeforeUpdate=y}break;case 3:var w=t.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(F(163))}}catch(S){Qe(t,t.return,S)}if(e=t.sibling,e!==null){e.return=t.return,Y=e;break}Y=t.return}return v=k1,k1=!1,v}function ic(e,t,r){var n=t.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var a=n=n.next;do{if((a.tag&e)===e){var i=a.destroy;a.destroy=void 0,i!==void 0&&uv(t,r,i)}a=a.next}while(a!==n)}}function Rp(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var r=t=t.next;do{if((r.tag&e)===e){var n=r.create;r.destroy=n()}r=r.next}while(r!==t)}}function dv(e){var t=e.ref;if(t!==null){var r=e.stateNode;switch(e.tag){case 5:e=r;break;default:e=r}typeof t=="function"?t(e):t.current=e}}function FC(e){var t=e.alternate;t!==null&&(e.alternate=null,FC(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[Nn],delete t[wc],delete t[Xg],delete t[o$],delete t[s$])),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 BC(e){return e.tag===5||e.tag===3||e.tag===4}function C1(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||BC(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 fv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.nodeType===8?r.parentNode.insertBefore(e,t):r.insertBefore(e,t):(r.nodeType===8?(t=r.parentNode,t.insertBefore(e,r)):(t=r,t.appendChild(e)),r=r._reactRootContainer,r!=null||t.onclick!==null||(t.onclick=af));else if(n!==4&&(e=e.child,e!==null))for(fv(e,t,r),e=e.sibling;e!==null;)fv(e,t,r),e=e.sibling}function pv(e,t,r){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?r.insertBefore(e,t):r.appendChild(e);else if(n!==4&&(e=e.child,e!==null))for(pv(e,t,r),e=e.sibling;e!==null;)pv(e,t,r),e=e.sibling}var Ct=null,sn=!1;function Ba(e,t,r){for(r=r.child;r!==null;)zC(e,t,r),r=r.sibling}function zC(e,t,r){if(Mn&&typeof Mn.onCommitFiberUnmount=="function")try{Mn.onCommitFiberUnmount(Pp,r)}catch{}switch(r.tag){case 5:$t||ls(r,t);case 6:var n=Ct,a=sn;Ct=null,Ba(e,t,r),Ct=n,sn=a,Ct!==null&&(sn?(e=Ct,r=r.stateNode,e.nodeType===8?e.parentNode.removeChild(r):e.removeChild(r)):Ct.removeChild(r.stateNode));break;case 18:Ct!==null&&(sn?(e=Ct,r=r.stateNode,e.nodeType===8?Om(e.parentNode,r):e.nodeType===1&&Om(e,r),gc(e)):Om(Ct,r.stateNode));break;case 4:n=Ct,a=sn,Ct=r.stateNode.containerInfo,sn=!0,Ba(e,t,r),Ct=n,sn=a;break;case 0:case 11:case 14:case 15:if(!$t&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){a=n=n.next;do{var i=a,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&uv(r,t,o),a=a.next}while(a!==n)}Ba(e,t,r);break;case 1:if(!$t&&(ls(r,t),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){Qe(r,t,s)}Ba(e,t,r);break;case 21:Ba(e,t,r);break;case 22:r.mode&1?($t=(n=$t)||r.memoizedState!==null,Ba(e,t,r),$t=n):Ba(e,t,r);break;default:Ba(e,t,r)}}function N1(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var r=e.stateNode;r===null&&(r=e.stateNode=new E$),t.forEach(function(n){var a=R$.bind(null,e,n);r.has(n)||(r.add(n),n.then(a,a))})}}function tn(e,t){var r=t.deletions;if(r!==null)for(var n=0;na&&(a=o),n&=~i}if(n=a,n=Je()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*k$(n/1960))-n,10e?16:e,ci===null)var n=!1;else{if(e=ci,ci=null,yf=0,ye&6)throw Error(F(331));var a=ye;for(ye|=4,Y=e.current;Y!==null;){var i=Y,o=i.child;if(Y.flags&16){var s=i.deletions;if(s!==null){for(var l=0;lJe()-Ax?co(e,0):Ox|=r),dr(e,t)}function GC(e,t){t===0&&(e.mode&1?(t=Wu,Wu<<=1,!(Wu&130023424)&&(Wu=4194304)):t=1);var r=Zt();e=Sa(e,t),e!==null&&(eu(e,t,r),dr(e,r))}function _$(e){var t=e.memoizedState,r=0;t!==null&&(r=t.retryLane),GC(e,r)}function R$(e,t){var r=0;switch(e.tag){case 13:var n=e.stateNode,a=e.memoizedState;a!==null&&(r=a.retryLane);break;case 19:n=e.stateNode;break;default:throw Error(F(314))}n!==null&&n.delete(t),GC(e,r)}var QC;QC=function(e,t,r){if(e!==null)if(e.memoizedProps!==t.pendingProps||cr.current)or=!0;else{if(!(e.lanes&r)&&!(t.flags&128))return or=!1,b$(e,t,r);or=!!(e.flags&131072)}else or=!1,Ue&&t.flags&1048576&&eC(t,cf,t.index);switch(t.lanes=0,t.tag){case 2:var n=t.type;Md(e,t),e=t.pendingProps;var a=Ms(t,zt.current);ms(t,r),a=Ex(null,t,n,e,a,r);var i=jx();return t.flags|=1,typeof a=="object"&&a!==null&&typeof a.render=="function"&&a.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,ur(n)?(i=!0,sf(t)):i=!1,t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,yx(t),a.updater=_p,t.stateNode=a,a._reactInternals=t,nv(t,n,e,r),t=ov(null,t,n,!0,i,r)):(t.tag=0,Ue&&i&&dx(t),Vt(null,t,a,r),t=t.child),t;case 16:n=t.elementType;e:{switch(Md(e,t),e=t.pendingProps,a=n._init,n=a(n._payload),t.type=n,a=t.tag=M$(n),e=nn(n,e),a){case 0:t=iv(null,t,n,e,r);break e;case 1:t=E1(null,t,n,e,r);break e;case 11:t=w1(null,t,n,e,r);break e;case 14:t=S1(null,t,n,nn(n.type,e),r);break e}throw Error(F(306,n,""))}return t;case 0:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:nn(n,a),iv(e,t,n,a,r);case 1:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:nn(n,a),E1(e,t,n,a,r);case 3:e:{if(RC(t),e===null)throw Error(F(387));n=t.pendingProps,i=t.memoizedState,a=i.element,oC(e,t),ff(t,n,null,r);var o=t.memoizedState;if(n=o.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=i,t.memoizedState=i,t.flags&256){a=Fs(Error(F(423)),t),t=j1(e,t,n,r,a);break e}else if(n!==a){a=Fs(Error(F(424)),t),t=j1(e,t,n,r,a);break e}else for(Er=hi(t.stateNode.containerInfo.firstChild),jr=t,Ue=!0,cn=null,r=aC(t,null,n,r),t.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Is(),n===a){t=Ea(e,t,r);break e}Vt(e,t,n,r)}t=t.child}return t;case 5:return sC(t),e===null&&ev(t),n=t.type,a=t.pendingProps,i=e!==null?e.memoizedProps:null,o=a.children,Gg(n,a)?o=null:i!==null&&Gg(n,i)&&(t.flags|=32),_C(e,t),Vt(e,t,o,r),t.child;case 6:return e===null&&ev(t),null;case 13:return DC(e,t,r);case 4:return xx(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Ls(t,null,n,r):Vt(e,t,n,r),t.child;case 11:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:nn(n,a),w1(e,t,n,a,r);case 7:return Vt(e,t,t.pendingProps,r),t.child;case 8:return Vt(e,t,t.pendingProps.children,r),t.child;case 12:return Vt(e,t,t.pendingProps.children,r),t.child;case 10:e:{if(n=t.type._context,a=t.pendingProps,i=t.memoizedProps,o=a.value,De(uf,n._currentValue),n._currentValue=o,i!==null)if(hn(i.value,o)){if(i.children===a.children&&!cr.current){t=Ea(e,t,r);break e}}else for(i=t.child,i!==null&&(i.return=t);i!==null;){var s=i.dependencies;if(s!==null){o=i.child;for(var l=s.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=pa(-1,r&-r),l.tag=2;var c=i.updateQueue;if(c!==null){c=c.shared;var u=c.pending;u===null?l.next=l:(l.next=u.next,u.next=l),c.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),tv(i.return,r,t),s.lanes|=r;break}l=l.next}}else if(i.tag===10)o=i.type===t.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(F(341));o.lanes|=r,s=o.alternate,s!==null&&(s.lanes|=r),tv(o,r,t),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===t){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}Vt(e,t,a.children,r),t=t.child}return t;case 9:return a=t.type,n=t.pendingProps.children,ms(t,r),a=Vr(a),n=n(a),t.flags|=1,Vt(e,t,n,r),t.child;case 14:return n=t.type,a=nn(n,t.pendingProps),a=nn(n.type,a),S1(e,t,n,a,r);case 15:return AC(e,t,t.type,t.pendingProps,r);case 17:return n=t.type,a=t.pendingProps,a=t.elementType===n?a:nn(n,a),Md(e,t),t.tag=1,ur(n)?(e=!0,sf(t)):e=!1,ms(t,r),CC(t,n,a),nv(t,n,a,r),ov(null,t,n,!0,e,r);case 19:return MC(e,t,r);case 22:return TC(e,t,r)}throw Error(F(156,t.tag))};function XC(e,t){return jk(e,t)}function D$(e,t,r,n){this.tag=e,this.key=r,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qr(e,t,r,n){return new D$(e,t,r,n)}function Dx(e){return e=e.prototype,!(!e||!e.isReactComponent)}function M$(e){if(typeof e=="function")return Dx(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Jy)return 11;if(e===ex)return 14}return 2}function yi(e,t){var r=e.alternate;return r===null?(r=qr(e.tag,t,e.key,e.mode),r.elementType=e.elementType,r.type=e.type,r.stateNode=e.stateNode,r.alternate=e,e.alternate=r):(r.pendingProps=t,r.type=e.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=e.flags&14680064,r.childLanes=e.childLanes,r.lanes=e.lanes,r.child=e.child,r.memoizedProps=e.memoizedProps,r.memoizedState=e.memoizedState,r.updateQueue=e.updateQueue,t=e.dependencies,r.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},r.sibling=e.sibling,r.index=e.index,r.ref=e.ref,r}function $d(e,t,r,n,a,i){var o=2;if(n=e,typeof e=="function")Dx(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case Jo:return uo(r.children,a,i,t);case Zy:o=8,a|=8;break;case Cg:return e=qr(12,r,t,a|2),e.elementType=Cg,e.lanes=i,e;case Ng:return e=qr(13,r,t,a),e.elementType=Ng,e.lanes=i,e;case Og:return e=qr(19,r,t,a),e.elementType=Og,e.lanes=i,e;case sk:return Mp(r,a,i,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ik:o=10;break e;case ok:o=9;break e;case Jy:o=11;break e;case ex:o=14;break e;case Ka:o=16,n=null;break e}throw Error(F(130,e==null?e:typeof e,""))}return t=qr(o,r,t,a),t.elementType=e,t.type=n,t.lanes=i,t}function uo(e,t,r,n){return e=qr(7,e,n,t),e.lanes=r,e}function Mp(e,t,r,n){return e=qr(22,e,n,t),e.elementType=sk,e.lanes=r,e.stateNode={isHidden:!1},e}function Lm(e,t,r){return e=qr(6,e,null,t),e.lanes=r,e}function $m(e,t,r){return t=qr(4,e.children!==null?e.children:[],e.key,t),t.lanes=r,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function I$(e,t,r,n,a){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=ym(0),this.expirationTimes=ym(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=ym(0),this.identifierPrefix=n,this.onRecoverableError=a,this.mutableSourceEagerHydrationData=null}function Mx(e,t,r,n,a,i,o,s,l){return e=new I$(e,t,r,s,l),t===1?(t=1,i===!0&&(t|=8)):t=0,i=qr(3,null,null,t),e.current=i,i.stateNode=e,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},yx(i),e}function L$(e,t,r){var n=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(tN)}catch(e){console.error(e)}}tN(),tk.exports=Or;var Ti=tk.exports;const U$=Hn(Ti);var I1=Ti;Pg.createRoot=I1.createRoot,Pg.hydrateRoot=I1.hydrateRoot;var il=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(){}},W$={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Ja,Wy,RP,q$=(RP=class{constructor(){te(this,Ja,W$);te(this,Wy,!1)}setTimeoutProvider(e){H(this,Ja,e)}setTimeout(e,t){return C(this,Ja).setTimeout(e,t)}clearTimeout(e){C(this,Ja).clearTimeout(e)}setInterval(e,t){return C(this,Ja).setInterval(e,t)}clearInterval(e){C(this,Ja).clearInterval(e)}},Ja=new WeakMap,Wy=new WeakMap,RP),Gi=new q$;function H$(e){setTimeout(e,0)}var So=typeof window>"u"||"Deno"in globalThis;function Yt(){}function K$(e,t){return typeof e=="function"?e(t):e}function yv(e){return typeof e=="number"&&e>=0&&e!==1/0}function rN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function xi(e,t){return typeof e=="function"?e(t):e}function Fr(e,t){return typeof e=="function"?e(t):e}function L1(e,t){const{type:r="all",exact:n,fetchStatus:a,predicate:i,queryKey:o,stale:s}=e;if(o){if(n){if(t.queryHash!==Fx(o,t.options))return!1}else if(!Nc(t.queryKey,o))return!1}if(r!=="all"){const l=t.isActive();if(r==="active"&&!l||r==="inactive"&&l)return!1}return!(typeof s=="boolean"&&t.isStale()!==s||a&&a!==t.state.fetchStatus||i&&!i(t))}function $1(e,t){const{exact:r,status:n,predicate:a,mutationKey:i}=e;if(i){if(!t.options.mutationKey)return!1;if(r){if(Eo(t.options.mutationKey)!==Eo(i))return!1}else if(!Nc(t.options.mutationKey,i))return!1}return!(n&&t.state.status!==n||a&&!a(t))}function Fx(e,t){return((t==null?void 0:t.queryKeyHashFn)||Eo)(e)}function Eo(e){return JSON.stringify(e,(t,r)=>xv(r)?Object.keys(r).sort().reduce((n,a)=>(n[a]=r[a],n),{}):r)}function Nc(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(r=>Nc(e[r],t[r])):!1}var V$=Object.prototype.hasOwnProperty;function nN(e,t){if(e===t)return e;const r=F1(e)&&F1(t);if(!r&&!(xv(e)&&xv(t)))return t;const a=(r?e:Object.keys(e)).length,i=r?t:Object.keys(t),o=i.length,s=r?new Array(o):{};let l=0;for(let c=0;c{Gi.setTimeout(t,e)})}function bv(e,t,r){return typeof r.structuralSharing=="function"?r.structuralSharing(e,t):r.structuralSharing!==!1?nN(e,t):t}function G$(e,t,r=0){const n=[...e,t];return r&&n.length>r?n.slice(1):n}function Q$(e,t,r=0){const n=[t,...e];return r&&n.length>r?n.slice(0,-1):n}var Bx=Symbol();function aN(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===Bx?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function iN(e,t){return typeof e=="function"?e(...t):!!e}var eo,ei,Ss,DP,X$=(DP=class extends il{constructor(){super();te(this,eo);te(this,ei);te(this,Ss);H(this,Ss,t=>{if(!So&&window.addEventListener){const r=()=>t();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){C(this,ei)||this.setEventListener(C(this,Ss))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,ei))==null||t.call(this),H(this,ei,void 0))}setEventListener(t){var r;H(this,Ss,t),(r=C(this,ei))==null||r.call(this),H(this,ei,t(n=>{typeof n=="boolean"?this.setFocused(n):this.onFocus()}))}setFocused(t){C(this,eo)!==t&&(H(this,eo,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(r=>{r(t)})}isFocused(){var t;return typeof C(this,eo)=="boolean"?C(this,eo):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},eo=new WeakMap,ei=new WeakMap,Ss=new WeakMap,DP),zx=new X$;function wv(){let e,t;const r=new Promise((a,i)=>{e=a,t=i});r.status="pending",r.catch(()=>{});function n(a){Object.assign(r,a),delete r.resolve,delete r.reject}return r.resolve=a=>{n({status:"fulfilled",value:a}),e(a)},r.reject=a=>{n({status:"rejected",reason:a}),t(a)},r}var Z$=H$;function J$(){let e=[],t=0,r=s=>{s()},n=s=>{s()},a=Z$;const i=s=>{t?e.push(s):a(()=>{r(s)})},o=()=>{const s=e;e=[],s.length&&a(()=>{n(()=>{s.forEach(l=>{r(l)})})})};return{batch:s=>{let l;t++;try{l=s()}finally{t--,t||o()}return l},batchCalls:s=>(...l)=>{i(()=>{s(...l)})},schedule:i,setNotifyFunction:s=>{r=s},setBatchNotifyFunction:s=>{n=s},setScheduler:s=>{a=s}}}var ft=J$(),Es,ti,js,MP,e3=(MP=class extends il{constructor(){super();te(this,Es,!0);te(this,ti);te(this,js);H(this,js,t=>{if(!So&&window.addEventListener){const r=()=>t(!0),n=()=>t(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",n,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",n)}}})}onSubscribe(){C(this,ti)||this.setEventListener(C(this,js))}onUnsubscribe(){var t;this.hasListeners()||((t=C(this,ti))==null||t.call(this),H(this,ti,void 0))}setEventListener(t){var r;H(this,js,t),(r=C(this,ti))==null||r.call(this),H(this,ti,t(this.setOnline.bind(this)))}setOnline(t){C(this,Es)!==t&&(H(this,Es,t),this.listeners.forEach(n=>{n(t)}))}isOnline(){return C(this,Es)}},Es=new WeakMap,ti=new WeakMap,js=new WeakMap,MP),Sf=new e3;function t3(e){return Math.min(1e3*2**e,3e4)}function oN(e){return(e??"online")==="online"?Sf.isOnline():!0}var Sv=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function sN(e){let t=!1,r=0,n;const a=wv(),i=()=>a.status!=="pending",o=g=>{var x;if(!i()){const b=new Sv(g);p(b),(x=e.onCancel)==null||x.call(e,b)}},s=()=>{t=!0},l=()=>{t=!1},c=()=>zx.isFocused()&&(e.networkMode==="always"||Sf.isOnline())&&e.canRun(),u=()=>oN(e.networkMode)&&e.canRun(),f=g=>{i()||(n==null||n(),a.resolve(g))},p=g=>{i()||(n==null||n(),a.reject(g))},h=()=>new Promise(g=>{var x;n=b=>{(i()||c())&&g(b)},(x=e.onPause)==null||x.call(e)}).then(()=>{var g;n=void 0,i()||(g=e.onContinue)==null||g.call(e)}),v=()=>{if(i())return;let g;const x=r===0?e.initialPromise:void 0;try{g=x??e.fn()}catch(b){g=Promise.reject(b)}Promise.resolve(g).then(f).catch(b=>{var j;if(i())return;const y=e.retry??(So?0:3),w=e.retryDelay??t3,S=typeof w=="function"?w(r,b):w,E=y===!0||typeof y=="number"&&rc()?void 0:h()).then(()=>{t?p(b):v()})})};return{promise:a,status:()=>a.status,cancel:o,continue:()=>(n==null||n(),a),cancelRetry:s,continueRetry:l,canStart:u,start:()=>(u()?v():h().then(v),a)}}var to,IP,lN=(IP=class{constructor(){te(this,to)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),yv(this.gcTime)&&H(this,to,Gi.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(So?1/0:5*60*1e3))}clearGcTimeout(){C(this,to)&&(Gi.clearTimeout(C(this,to)),H(this,to,void 0))}},to=new WeakMap,IP),ro,Ps,$r,no,vt,Yc,ao,an,Zn,LP,r3=(LP=class extends lN{constructor(t){super();te(this,an);te(this,ro);te(this,Ps);te(this,$r);te(this,no);te(this,vt);te(this,Yc);te(this,ao);H(this,ao,!1),H(this,Yc,t.defaultOptions),this.setOptions(t.options),this.observers=[],H(this,no,t.client),H(this,$r,C(this,no).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,H(this,ro,z1(this.options)),this.state=t.state??C(this,ro),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=C(this,vt))==null?void 0:t.promise}setOptions(t){if(this.options={...C(this,Yc),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=z1(this.options);r.data!==void 0&&(this.setData(r.data,{updatedAt:r.dataUpdatedAt,manual:!0}),H(this,ro,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,$r).remove(this)}setData(t,r){const n=bv(this.state.data,t,this.options);return ce(this,an,Zn).call(this,{data:n,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),n}setState(t,r){ce(this,an,Zn).call(this,{type:"setState",state:t,setStateOptions:r})}cancel(t){var n,a;const r=(n=C(this,vt))==null?void 0:n.promise;return(a=C(this,vt))==null||a.cancel(t),r?r.then(Yt).catch(Yt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(C(this,ro))}isActive(){return this.observers.some(t=>Fr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Bx||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>xi(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:!rN(this.state.dataUpdatedAt,t)}onFocus(){var r;const t=this.observers.find(n=>n.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(r=C(this,vt))==null||r.continue()}onOnline(){var r;const t=this.observers.find(n=>n.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(r=C(this,vt))==null||r.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),C(this,$r).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(r=>r!==t),this.observers.length||(C(this,vt)&&(C(this,ao)?C(this,vt).cancel({revert:!0}):C(this,vt).cancelRetry()),this.scheduleGc()),C(this,$r).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ce(this,an,Zn).call(this,{type:"invalidate"})}async fetch(t,r){var l,c,u,f,p,h,v,g,x,b,y,w;if(this.state.fetchStatus!=="idle"&&((l=C(this,vt))==null?void 0:l.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(C(this,vt))return C(this,vt).continueRetry(),C(this,vt).promise}if(t&&this.setOptions(t),!this.options.queryFn){const S=this.observers.find(E=>E.options.queryFn);S&&this.setOptions(S.options)}const n=new AbortController,a=S=>{Object.defineProperty(S,"signal",{enumerable:!0,get:()=>(H(this,ao,!0),n.signal)})},i=()=>{const S=aN(this.options,r),j=(()=>{const P={client:C(this,no),queryKey:this.queryKey,meta:this.meta};return a(P),P})();return H(this,ao,!1),this.options.persister?this.options.persister(S,j,this):S(j)},s=(()=>{const S={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:C(this,no),state:this.state,fetchFn:i};return a(S),S})();(c=this.options.behavior)==null||c.onFetch(s,this),H(this,Ps,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((u=s.fetchOptions)==null?void 0:u.meta))&&ce(this,an,Zn).call(this,{type:"fetch",meta:(f=s.fetchOptions)==null?void 0:f.meta}),H(this,vt,sN({initialPromise:r==null?void 0:r.initialPromise,fn:s.fetchFn,onCancel:S=>{S instanceof Sv&&S.revert&&this.setState({...C(this,Ps),fetchStatus:"idle"}),n.abort()},onFail:(S,E)=>{ce(this,an,Zn).call(this,{type:"failed",failureCount:S,error:E})},onPause:()=>{ce(this,an,Zn).call(this,{type:"pause"})},onContinue:()=>{ce(this,an,Zn).call(this,{type:"continue"})},retry:s.options.retry,retryDelay:s.options.retryDelay,networkMode:s.options.networkMode,canRun:()=>!0}));try{const S=await C(this,vt).start();if(S===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(S),(h=(p=C(this,$r).config).onSuccess)==null||h.call(p,S,this),(g=(v=C(this,$r).config).onSettled)==null||g.call(v,S,this.state.error,this),S}catch(S){if(S instanceof Sv){if(S.silent)return C(this,vt).promise;if(S.revert){if(this.state.data===void 0)throw S;return this.state.data}}throw ce(this,an,Zn).call(this,{type:"error",error:S}),(b=(x=C(this,$r).config).onError)==null||b.call(x,S,this),(w=(y=C(this,$r).config).onSettled)==null||w.call(y,this.state.data,S,this),S}finally{this.scheduleGc()}}},ro=new WeakMap,Ps=new WeakMap,$r=new WeakMap,no=new WeakMap,vt=new WeakMap,Yc=new WeakMap,ao=new WeakMap,an=new WeakSet,Zn=function(t){const r=n=>{switch(t.type){case"failed":return{...n,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...n,fetchStatus:"paused"};case"continue":return{...n,fetchStatus:"fetching"};case"fetch":return{...n,...cN(n.data,this.options),fetchMeta:t.meta??null};case"success":const a={...n,data:t.data,dataUpdateCount:n.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return H(this,Ps,t.manual?a:void 0),a;case"error":const i=t.error;return{...n,error:i,errorUpdateCount:n.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:n.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...n,isInvalidated:!0};case"setState":return{...n,...t.state}}};this.state=r(this.state),ft.batch(()=>{this.observers.forEach(n=>{n.onQueryUpdate()}),C(this,$r).notify({query:this,type:"updated",action:t})})},LP);function cN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:oN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function z1(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,r=t!==void 0,n=r?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:r?n??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var tr,he,Gc,Ht,io,ks,ra,ri,Qc,Cs,Ns,oo,so,ni,Os,Se,Gl,Ev,jv,Pv,kv,Cv,Nv,Ov,uN,$P,n3=($P=class extends il{constructor(t,r){super();te(this,Se);te(this,tr);te(this,he);te(this,Gc);te(this,Ht);te(this,io);te(this,ks);te(this,ra);te(this,ri);te(this,Qc);te(this,Cs);te(this,Ns);te(this,oo);te(this,so);te(this,ni);te(this,Os,new Set);this.options=r,H(this,tr,t),H(this,ri,null),H(this,ra,wv()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(C(this,he).addObserver(this),U1(C(this,he),this.options)?ce(this,Se,Gl).call(this):this.updateResult(),ce(this,Se,kv).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Av(C(this,he),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Av(C(this,he),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ce(this,Se,Cv).call(this),ce(this,Se,Nv).call(this),C(this,he).removeObserver(this)}setOptions(t){const r=this.options,n=C(this,he);if(this.options=C(this,tr).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Fr(this.options.enabled,C(this,he))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ce(this,Se,Ov).call(this),C(this,he).setOptions(this.options),r._defaulted&&!wf(this.options,r)&&C(this,tr).getQueryCache().notify({type:"observerOptionsUpdated",query:C(this,he),observer:this});const a=this.hasListeners();a&&W1(C(this,he),n,this.options,r)&&ce(this,Se,Gl).call(this),this.updateResult(),a&&(C(this,he)!==n||Fr(this.options.enabled,C(this,he))!==Fr(r.enabled,C(this,he))||xi(this.options.staleTime,C(this,he))!==xi(r.staleTime,C(this,he)))&&ce(this,Se,Ev).call(this);const i=ce(this,Se,jv).call(this);a&&(C(this,he)!==n||Fr(this.options.enabled,C(this,he))!==Fr(r.enabled,C(this,he))||i!==C(this,ni))&&ce(this,Se,Pv).call(this,i)}getOptimisticResult(t){const r=C(this,tr).getQueryCache().build(C(this,tr),t),n=this.createResult(r,t);return i3(this,n)&&(H(this,Ht,n),H(this,ks,this.options),H(this,io,C(this,he).state)),n}getCurrentResult(){return C(this,Ht)}trackResult(t,r){return new Proxy(t,{get:(n,a)=>(this.trackProp(a),r==null||r(a),a==="promise"&&!this.options.experimental_prefetchInRender&&C(this,ra).status==="pending"&&C(this,ra).reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(n,a))})}trackProp(t){C(this,Os).add(t)}getCurrentQuery(){return C(this,he)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const r=C(this,tr).defaultQueryOptions(t),n=C(this,tr).getQueryCache().build(C(this,tr),r);return n.fetch().then(()=>this.createResult(n,r))}fetch(t){return ce(this,Se,Gl).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),C(this,Ht)))}createResult(t,r){var N;const n=C(this,he),a=this.options,i=C(this,Ht),o=C(this,io),s=C(this,ks),c=t!==n?t.state:C(this,Gc),{state:u}=t;let f={...u},p=!1,h;if(r._optimisticResults){const O=this.hasListeners(),A=!O&&U1(t,r),T=O&&W1(t,n,r,a);(A||T)&&(f={...f,...cN(u.data,t.options)}),r._optimisticResults==="isRestoring"&&(f.fetchStatus="idle")}let{error:v,errorUpdatedAt:g,status:x}=f;h=f.data;let b=!1;if(r.placeholderData!==void 0&&h===void 0&&x==="pending"){let O;i!=null&&i.isPlaceholderData&&r.placeholderData===(s==null?void 0:s.placeholderData)?(O=i.data,b=!0):O=typeof r.placeholderData=="function"?r.placeholderData((N=C(this,Ns))==null?void 0:N.state.data,C(this,Ns)):r.placeholderData,O!==void 0&&(x="success",h=bv(i==null?void 0:i.data,O,r),p=!0)}if(r.select&&h!==void 0&&!b)if(i&&h===(o==null?void 0:o.data)&&r.select===C(this,Qc))h=C(this,Cs);else try{H(this,Qc,r.select),h=r.select(h),h=bv(i==null?void 0:i.data,h,r),H(this,Cs,h),H(this,ri,null)}catch(O){H(this,ri,O)}C(this,ri)&&(v=C(this,ri),h=C(this,Cs),g=Date.now(),x="error");const y=f.fetchStatus==="fetching",w=x==="pending",S=x==="error",E=w&&y,j=h!==void 0,k={status:x,fetchStatus:f.fetchStatus,isPending:w,isSuccess:x==="success",isError:S,isInitialLoading:E,isLoading:E,data:h,dataUpdatedAt:f.dataUpdatedAt,error:v,errorUpdatedAt:g,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:y,isRefetching:y&&!w,isLoadingError:S&&!j,isPaused:f.fetchStatus==="paused",isPlaceholderData:p,isRefetchError:S&&j,isStale:Ux(t,r),refetch:this.refetch,promise:C(this,ra),isEnabled:Fr(r.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const O=L=>{k.status==="error"?L.reject(k.error):k.data!==void 0&&L.resolve(k.data)},A=()=>{const L=H(this,ra,k.promise=wv());O(L)},T=C(this,ra);switch(T.status){case"pending":t.queryHash===n.queryHash&&O(T);break;case"fulfilled":(k.status==="error"||k.data!==T.value)&&A();break;case"rejected":(k.status!=="error"||k.error!==T.reason)&&A();break}}return k}updateResult(){const t=C(this,Ht),r=this.createResult(C(this,he),this.options);if(H(this,io,C(this,he).state),H(this,ks,this.options),C(this,io).data!==void 0&&H(this,Ns,C(this,he)),wf(r,t))return;H(this,Ht,r);const n=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,i=typeof a=="function"?a():a;if(i==="all"||!i&&!C(this,Os).size)return!0;const o=new Set(i??C(this,Os));return this.options.throwOnError&&o.add("error"),Object.keys(C(this,Ht)).some(s=>{const l=s;return C(this,Ht)[l]!==t[l]&&o.has(l)})};ce(this,Se,uN).call(this,{listeners:n()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ce(this,Se,kv).call(this)}},tr=new WeakMap,he=new WeakMap,Gc=new WeakMap,Ht=new WeakMap,io=new WeakMap,ks=new WeakMap,ra=new WeakMap,ri=new WeakMap,Qc=new WeakMap,Cs=new WeakMap,Ns=new WeakMap,oo=new WeakMap,so=new WeakMap,ni=new WeakMap,Os=new WeakMap,Se=new WeakSet,Gl=function(t){ce(this,Se,Ov).call(this);let r=C(this,he).fetch(this.options,t);return t!=null&&t.throwOnError||(r=r.catch(Yt)),r},Ev=function(){ce(this,Se,Cv).call(this);const t=xi(this.options.staleTime,C(this,he));if(So||C(this,Ht).isStale||!yv(t))return;const n=rN(C(this,Ht).dataUpdatedAt,t)+1;H(this,oo,Gi.setTimeout(()=>{C(this,Ht).isStale||this.updateResult()},n))},jv=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(C(this,he)):this.options.refetchInterval)??!1},Pv=function(t){ce(this,Se,Nv).call(this),H(this,ni,t),!(So||Fr(this.options.enabled,C(this,he))===!1||!yv(C(this,ni))||C(this,ni)===0)&&H(this,so,Gi.setInterval(()=>{(this.options.refetchIntervalInBackground||zx.isFocused())&&ce(this,Se,Gl).call(this)},C(this,ni)))},kv=function(){ce(this,Se,Ev).call(this),ce(this,Se,Pv).call(this,ce(this,Se,jv).call(this))},Cv=function(){C(this,oo)&&(Gi.clearTimeout(C(this,oo)),H(this,oo,void 0))},Nv=function(){C(this,so)&&(Gi.clearInterval(C(this,so)),H(this,so,void 0))},Ov=function(){const t=C(this,tr).getQueryCache().build(C(this,tr),this.options);if(t===C(this,he))return;const r=C(this,he);H(this,he,t),H(this,Gc,t.state),this.hasListeners()&&(r==null||r.removeObserver(this),t.addObserver(this))},uN=function(t){ft.batch(()=>{t.listeners&&this.listeners.forEach(r=>{r(C(this,Ht))}),C(this,tr).getQueryCache().notify({query:C(this,he),type:"observerResultsUpdated"})})},$P);function a3(e,t){return Fr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function U1(e,t){return a3(e,t)||e.state.data!==void 0&&Av(e,t,t.refetchOnMount)}function Av(e,t,r){if(Fr(t.enabled,e)!==!1&&xi(t.staleTime,e)!=="static"){const n=typeof r=="function"?r(e):r;return n==="always"||n!==!1&&Ux(e,t)}return!1}function W1(e,t,r,n){return(e!==t||Fr(n.enabled,e)===!1)&&(!r.suspense||e.state.status!=="error")&&Ux(e,r)}function Ux(e,t){return Fr(t.enabled,e)!==!1&&e.isStaleByTime(xi(t.staleTime,e))}function i3(e,t){return!wf(e.getCurrentResult(),t)}function q1(e){return{onFetch:(t,r)=>{var u,f,p,h,v;const n=t.options,a=(p=(f=(u=t.fetchOptions)==null?void 0:u.meta)==null?void 0:f.fetchMore)==null?void 0:p.direction,i=((h=t.state.data)==null?void 0:h.pages)||[],o=((v=t.state.data)==null?void 0:v.pageParams)||[];let s={pages:[],pageParams:[]},l=0;const c=async()=>{let g=!1;const x=w=>{Object.defineProperty(w,"signal",{enumerable:!0,get:()=>(t.signal.aborted?g=!0:t.signal.addEventListener("abort",()=>{g=!0}),t.signal)})},b=aN(t.options,t.fetchOptions),y=async(w,S,E)=>{if(g)return Promise.reject();if(S==null&&w.pages.length)return Promise.resolve(w);const P=(()=>{const A={client:t.client,queryKey:t.queryKey,pageParam:S,direction:E?"backward":"forward",meta:t.options.meta};return x(A),A})(),k=await b(P),{maxPages:N}=t.options,O=E?Q$:G$;return{pages:O(w.pages,k,N),pageParams:O(w.pageParams,S,N)}};if(a&&i.length){const w=a==="backward",S=w?o3:H1,E={pages:i,pageParams:o},j=S(n,E);s=await y(E,j,w)}else{const w=e??i.length;do{const S=l===0?o[0]??n.initialPageParam:H1(n,s);if(l>0&&S==null)break;s=await y(s,S),l++}while(l{var g,x;return(x=(g=t.options).persister)==null?void 0:x.call(g,c,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},r)}:t.fetchFn=c}}}function H1(e,{pages:t,pageParams:r}){const n=t.length-1;return t.length>0?e.getNextPageParam(t[n],t,r[n],r):void 0}function o3(e,{pages:t,pageParams:r}){var n;return t.length>0?(n=e.getPreviousPageParam)==null?void 0:n.call(e,t[0],t,r[0],r):void 0}var Xc,Pn,Kt,lo,kn,qa,FP,s3=(FP=class extends lN{constructor(t){super();te(this,kn);te(this,Xc);te(this,Pn);te(this,Kt);te(this,lo);H(this,Xc,t.client),this.mutationId=t.mutationId,H(this,Kt,t.mutationCache),H(this,Pn,[]),this.state=t.state||dN(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){C(this,Pn).includes(t)||(C(this,Pn).push(t),this.clearGcTimeout(),C(this,Kt).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){H(this,Pn,C(this,Pn).filter(r=>r!==t)),this.scheduleGc(),C(this,Kt).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){C(this,Pn).length||(this.state.status==="pending"?this.scheduleGc():C(this,Kt).remove(this))}continue(){var t;return((t=C(this,lo))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var o,s,l,c,u,f,p,h,v,g,x,b,y,w,S,E,j,P,k,N;const r=()=>{ce(this,kn,qa).call(this,{type:"continue"})},n={client:C(this,Xc),meta:this.options.meta,mutationKey:this.options.mutationKey};H(this,lo,sN({fn:()=>this.options.mutationFn?this.options.mutationFn(t,n):Promise.reject(new Error("No mutationFn found")),onFail:(O,A)=>{ce(this,kn,qa).call(this,{type:"failed",failureCount:O,error:A})},onPause:()=>{ce(this,kn,qa).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,Kt).canRun(this)}));const a=this.state.status==="pending",i=!C(this,lo).canStart();try{if(a)r();else{ce(this,kn,qa).call(this,{type:"pending",variables:t,isPaused:i}),await((s=(o=C(this,Kt).config).onMutate)==null?void 0:s.call(o,t,this,n));const A=await((c=(l=this.options).onMutate)==null?void 0:c.call(l,t,n));A!==this.state.context&&ce(this,kn,qa).call(this,{type:"pending",context:A,variables:t,isPaused:i})}const O=await C(this,lo).start();return await((f=(u=C(this,Kt).config).onSuccess)==null?void 0:f.call(u,O,t,this.state.context,this,n)),await((h=(p=this.options).onSuccess)==null?void 0:h.call(p,O,t,this.state.context,n)),await((g=(v=C(this,Kt).config).onSettled)==null?void 0:g.call(v,O,null,this.state.variables,this.state.context,this,n)),await((b=(x=this.options).onSettled)==null?void 0:b.call(x,O,null,t,this.state.context,n)),ce(this,kn,qa).call(this,{type:"success",data:O}),O}catch(O){try{throw await((w=(y=C(this,Kt).config).onError)==null?void 0:w.call(y,O,t,this.state.context,this,n)),await((E=(S=this.options).onError)==null?void 0:E.call(S,O,t,this.state.context,n)),await((P=(j=C(this,Kt).config).onSettled)==null?void 0:P.call(j,void 0,O,this.state.variables,this.state.context,this,n)),await((N=(k=this.options).onSettled)==null?void 0:N.call(k,void 0,O,t,this.state.context,n)),O}finally{ce(this,kn,qa).call(this,{type:"error",error:O})}}finally{C(this,Kt).runNext(this)}}},Xc=new WeakMap,Pn=new WeakMap,Kt=new WeakMap,lo=new WeakMap,kn=new WeakSet,qa=function(t){const r=n=>{switch(t.type){case"failed":return{...n,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...n,isPaused:!0};case"continue":return{...n,isPaused:!1};case"pending":return{...n,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{...n,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...n,data:void 0,error:t.error,failureCount:n.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=r(this.state),ft.batch(()=>{C(this,Pn).forEach(n=>{n.onMutationUpdate(t)}),C(this,Kt).notify({mutation:this,type:"updated",action:t})})},FP);function dN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var na,on,Zc,BP,l3=(BP=class extends il{constructor(t={}){super();te(this,na);te(this,on);te(this,Zc);this.config=t,H(this,na,new Set),H(this,on,new Map),H(this,Zc,0)}build(t,r,n){const a=new s3({client:t,mutationCache:this,mutationId:++Lu(this,Zc)._,options:t.defaultMutationOptions(r),state:n});return this.add(a),a}add(t){C(this,na).add(t);const r=td(t);if(typeof r=="string"){const n=C(this,on).get(r);n?n.push(t):C(this,on).set(r,[t])}this.notify({type:"added",mutation:t})}remove(t){if(C(this,na).delete(t)){const r=td(t);if(typeof r=="string"){const n=C(this,on).get(r);if(n)if(n.length>1){const a=n.indexOf(t);a!==-1&&n.splice(a,1)}else n[0]===t&&C(this,on).delete(r)}}this.notify({type:"removed",mutation:t})}canRun(t){const r=td(t);if(typeof r=="string"){const n=C(this,on).get(r),a=n==null?void 0:n.find(i=>i.state.status==="pending");return!a||a===t}else return!0}runNext(t){var n;const r=td(t);if(typeof r=="string"){const a=(n=C(this,on).get(r))==null?void 0:n.find(i=>i!==t&&i.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){ft.batch(()=>{C(this,na).forEach(t=>{this.notify({type:"removed",mutation:t})}),C(this,na).clear(),C(this,on).clear()})}getAll(){return Array.from(C(this,na))}find(t){const r={exact:!0,...t};return this.getAll().find(n=>$1(r,n))}findAll(t={}){return this.getAll().filter(r=>$1(t,r))}notify(t){ft.batch(()=>{this.listeners.forEach(r=>{r(t)})})}resumePausedMutations(){const t=this.getAll().filter(r=>r.state.isPaused);return ft.batch(()=>Promise.all(t.map(r=>r.continue().catch(Yt))))}},na=new WeakMap,on=new WeakMap,Zc=new WeakMap,BP);function td(e){var t;return(t=e.options.scope)==null?void 0:t.id}var aa,ai,rr,ia,xa,Fd,Tv,zP,c3=(zP=class extends il{constructor(r,n){super();te(this,xa);te(this,aa);te(this,ai);te(this,rr);te(this,ia);H(this,aa,r),this.setOptions(n),this.bindMethods(),ce(this,xa,Fd).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var a;const n=this.options;this.options=C(this,aa).defaultMutationOptions(r),wf(this.options,n)||C(this,aa).getMutationCache().notify({type:"observerOptionsUpdated",mutation:C(this,rr),observer:this}),n!=null&&n.mutationKey&&this.options.mutationKey&&Eo(n.mutationKey)!==Eo(this.options.mutationKey)?this.reset():((a=C(this,rr))==null?void 0:a.state.status)==="pending"&&C(this,rr).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=C(this,rr))==null||r.removeObserver(this)}onMutationUpdate(r){ce(this,xa,Fd).call(this),ce(this,xa,Tv).call(this,r)}getCurrentResult(){return C(this,ai)}reset(){var r;(r=C(this,rr))==null||r.removeObserver(this),H(this,rr,void 0),ce(this,xa,Fd).call(this),ce(this,xa,Tv).call(this)}mutate(r,n){var a;return H(this,ia,n),(a=C(this,rr))==null||a.removeObserver(this),H(this,rr,C(this,aa).getMutationCache().build(C(this,aa),this.options)),C(this,rr).addObserver(this),C(this,rr).execute(r)}},aa=new WeakMap,ai=new WeakMap,rr=new WeakMap,ia=new WeakMap,xa=new WeakSet,Fd=function(){var n;const r=((n=C(this,rr))==null?void 0:n.state)??dN();H(this,ai,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},Tv=function(r){ft.batch(()=>{var n,a,i,o,s,l,c,u;if(C(this,ia)&&this.hasListeners()){const f=C(this,ai).variables,p=C(this,ai).context,h={client:C(this,aa),meta:this.options.meta,mutationKey:this.options.mutationKey};(r==null?void 0:r.type)==="success"?((a=(n=C(this,ia)).onSuccess)==null||a.call(n,r.data,f,p,h),(o=(i=C(this,ia)).onSettled)==null||o.call(i,r.data,null,f,p,h)):(r==null?void 0:r.type)==="error"&&((l=(s=C(this,ia)).onError)==null||l.call(s,r.error,f,p,h),(u=(c=C(this,ia)).onSettled)==null||u.call(c,void 0,r.error,f,p,h))}this.listeners.forEach(f=>{f(C(this,ai))})})},zP),Cn,UP,u3=(UP=class extends il{constructor(t={}){super();te(this,Cn);this.config=t,H(this,Cn,new Map)}build(t,r,n){const a=r.queryKey,i=r.queryHash??Fx(a,r);let o=this.get(i);return o||(o=new r3({client:t,queryKey:a,queryHash:i,options:t.defaultQueryOptions(r),state:n,defaultOptions:t.getQueryDefaults(a)}),this.add(o)),o}add(t){C(this,Cn).has(t.queryHash)||(C(this,Cn).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const r=C(this,Cn).get(t.queryHash);r&&(t.destroy(),r===t&&C(this,Cn).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){ft.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return C(this,Cn).get(t)}getAll(){return[...C(this,Cn).values()]}find(t){const r={exact:!0,...t};return this.getAll().find(n=>L1(r,n))}findAll(t={}){const r=this.getAll();return Object.keys(t).length>0?r.filter(n=>L1(t,n)):r}notify(t){ft.batch(()=>{this.listeners.forEach(r=>{r(t)})})}onFocus(){ft.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){ft.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Cn=new WeakMap,UP),Ge,ii,oi,As,Ts,si,_s,Rs,WP,d3=(WP=class{constructor(e={}){te(this,Ge);te(this,ii);te(this,oi);te(this,As);te(this,Ts);te(this,si);te(this,_s);te(this,Rs);H(this,Ge,e.queryCache||new u3),H(this,ii,e.mutationCache||new l3),H(this,oi,e.defaultOptions||{}),H(this,As,new Map),H(this,Ts,new Map),H(this,si,0)}mount(){Lu(this,si)._++,C(this,si)===1&&(H(this,_s,zx.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,Ge).onFocus())})),H(this,Rs,Sf.subscribe(async e=>{e&&(await this.resumePausedMutations(),C(this,Ge).onOnline())})))}unmount(){var e,t;Lu(this,si)._--,C(this,si)===0&&((e=C(this,_s))==null||e.call(this),H(this,_s,void 0),(t=C(this,Rs))==null||t.call(this),H(this,Rs,void 0))}isFetching(e){return C(this,Ge).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return C(this,ii).findAll({...e,status:"pending"}).length}getQueryData(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=C(this,Ge).get(t.queryHash))==null?void 0:r.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),r=C(this,Ge).build(this,t),n=r.state.data;return n===void 0?this.fetchQuery(e):(e.revalidateIfStale&&r.isStaleByTime(xi(t.staleTime,r))&&this.prefetchQuery(t),Promise.resolve(n))}getQueriesData(e){return C(this,Ge).findAll(e).map(({queryKey:t,state:r})=>{const n=r.data;return[t,n]})}setQueryData(e,t,r){const n=this.defaultQueryOptions({queryKey:e}),a=C(this,Ge).get(n.queryHash),i=a==null?void 0:a.state.data,o=K$(t,i);if(o!==void 0)return C(this,Ge).build(this,n).setData(o,{...r,manual:!0})}setQueriesData(e,t,r){return ft.batch(()=>C(this,Ge).findAll(e).map(({queryKey:n})=>[n,this.setQueryData(n,t,r)]))}getQueryState(e){var r;const t=this.defaultQueryOptions({queryKey:e});return(r=C(this,Ge).get(t.queryHash))==null?void 0:r.state}removeQueries(e){const t=C(this,Ge);ft.batch(()=>{t.findAll(e).forEach(r=>{t.remove(r)})})}resetQueries(e,t){const r=C(this,Ge);return ft.batch(()=>(r.findAll(e).forEach(n=>{n.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const r={revert:!0,...t},n=ft.batch(()=>C(this,Ge).findAll(e).map(a=>a.cancel(r)));return Promise.all(n).then(Yt).catch(Yt)}invalidateQueries(e,t={}){return ft.batch(()=>(C(this,Ge).findAll(e).forEach(r=>{r.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 r={...t,cancelRefetch:t.cancelRefetch??!0},n=ft.batch(()=>C(this,Ge).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let i=a.fetch(void 0,r);return r.throwOnError||(i=i.catch(Yt)),a.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(n).then(Yt)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const r=C(this,Ge).build(this,t);return r.isStaleByTime(xi(t.staleTime,r))?r.fetch(t):Promise.resolve(r.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(Yt).catch(Yt)}fetchInfiniteQuery(e){return e.behavior=q1(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(Yt).catch(Yt)}ensureInfiniteQueryData(e){return e.behavior=q1(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return Sf.isOnline()?C(this,ii).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,Ge)}getMutationCache(){return C(this,ii)}getDefaultOptions(){return C(this,oi)}setDefaultOptions(e){H(this,oi,e)}setQueryDefaults(e,t){C(this,As).set(Eo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...C(this,As).values()],r={};return t.forEach(n=>{Nc(e,n.queryKey)&&Object.assign(r,n.defaultOptions)}),r}setMutationDefaults(e,t){C(this,Ts).set(Eo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...C(this,Ts).values()],r={};return t.forEach(n=>{Nc(e,n.mutationKey)&&Object.assign(r,n.defaultOptions)}),r}defaultQueryOptions(e){if(e._defaulted)return e;const t={...C(this,oi).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Fx(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===Bx&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...C(this,oi).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){C(this,Ge).clear(),C(this,ii).clear()}},Ge=new WeakMap,ii=new WeakMap,oi=new WeakMap,As=new WeakMap,Ts=new WeakMap,si=new WeakMap,_s=new WeakMap,Rs=new WeakMap,WP),fN=m.createContext(void 0),pN=e=>{const t=m.useContext(fN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},f3=({client:e,children:t})=>(m.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),d.jsx(fN.Provider,{value:e,children:t})),hN=m.createContext(!1),p3=()=>m.useContext(hN);hN.Provider;function h3(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var m3=m.createContext(h3()),g3=()=>m.useContext(m3),v3=(e,t)=>{(e.suspense||e.throwOnError||e.experimental_prefetchInRender)&&(t.isReset()||(e.retryOnMount=!1))},y3=e=>{m.useEffect(()=>{e.clearReset()},[e])},x3=({result:e,errorResetBoundary:t,throwOnError:r,query:n,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&n&&(a&&e.data===void 0||iN(r,[e.error,n])),b3=e=>{if(e.suspense){const r=a=>a==="static"?a:Math.max(a??1e3,1e3),n=e.staleTime;e.staleTime=typeof n=="function"?(...a)=>r(n(...a)):r(n),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},w3=(e,t)=>e.isLoading&&e.isFetching&&!t,S3=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,K1=(e,t,r)=>t.fetchOptimistic(e).catch(()=>{r.clearReset()});function E3(e,t,r){var f,p,h,v,g;const n=p3(),a=g3(),i=pN(),o=i.defaultQueryOptions(e);(p=(f=i.getDefaultOptions().queries)==null?void 0:f._experimental_beforeQuery)==null||p.call(f,o),o._optimisticResults=n?"isRestoring":"optimistic",b3(o),v3(o,a),y3(a);const s=!i.getQueryCache().get(o.queryHash),[l]=m.useState(()=>new t(i,o)),c=l.getOptimisticResult(o),u=!n&&e.subscribed!==!1;if(m.useSyncExternalStore(m.useCallback(x=>{const b=u?l.subscribe(ft.batchCalls(x)):Yt;return l.updateResult(),b},[l,u]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),m.useEffect(()=>{l.setOptions(o)},[o,l]),S3(o,c))throw K1(o,l,a);if(x3({result:c,errorResetBoundary:a,throwOnError:o.throwOnError,query:i.getQueryCache().get(o.queryHash),suspense:o.suspense}))throw c.error;if((v=(h=i.getDefaultOptions().queries)==null?void 0:h._experimental_afterQuery)==null||v.call(h,o,c),o.experimental_prefetchInRender&&!So&&w3(c,n)){const x=s?K1(o,l,a):(g=i.getQueryCache().get(o.queryHash))==null?void 0:g.promise;x==null||x.catch(Yt).finally(()=>{l.updateResult()})}return o.notifyOnChangeProps?c:l.trackResult(c)}function tt(e,t){return E3(e,n3)}function j3(e,t){const r=pN(),[n]=m.useState(()=>new c3(r,e));m.useEffect(()=>{n.setOptions(e)},[n,e]);const a=m.useSyncExternalStore(m.useCallback(o=>n.subscribe(ft.batchCalls(o)),[n]),()=>n.getCurrentResult(),()=>n.getCurrentResult()),i=m.useCallback((o,s)=>{n.mutate(o,s).catch(Yt)},[n]);if(a.error&&iN(n.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:i,mutateAsync:a.mutate}}/** * react-router v7.9.1 * * Copyright (c) Remix Software Inc. @@ -46,9 +46,9 @@ Error generating stack: `+i.message+` * LICENSE.md file in the root directory of this source tree. * * @license MIT - */var V1="popstate";function P3(e={}){function t(n,a){let{pathname:i,search:o,hash:s}=n.location;return Tg("",{pathname:i,search:o,hash:s},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:Oc(a)}return k3(t,r,null,e)}function qe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function hn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function C3(){return Math.random().toString(36).substring(2,10)}function Y1(e,t){return{usr:e.state,key:e.key,idx:t}}function Tg(e,t,r=null,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ol(t):t,state:r,key:t&&t.key||n||C3()}}function Oc({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function ol(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function k3(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:i=!1}=n,o=a.history,s="POP",l=null,c=u();c==null&&(c=0,o.replaceState({...o.state,idx:c},""));function u(){return(o.state||{idx:null}).idx}function f(){s="POP";let x=u(),b=x==null?null:x-c;c=x,l&&l({action:s,location:v.location,delta:b})}function p(x,b){s="PUSH";let y=Tg(v.location,x,b);c=u()+1;let w=Y1(y,c),S=v.createHref(y);try{o.pushState(w,"",S)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;a.location.assign(S)}i&&l&&l({action:s,location:v.location,delta:1})}function h(x,b){s="REPLACE";let y=Tg(v.location,x,b);c=u();let w=Y1(y,c),S=v.createHref(y);o.replaceState(w,"",S),i&&l&&l({action:s,location:v.location,delta:0})}function g(x){return N3(x)}let v={get action(){return s},get location(){return e(a,o)},listen(x){if(l)throw new Error("A history only accepts one active listener");return a.addEventListener(V1,f),l=x,()=>{a.removeEventListener(V1,f),l=null}},createHref(x){return t(a,x)},createURL:g,encodeLocation(x){let b=g(x);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:p,replace:h,go(x){return o.go(x)}};return v}function N3(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),qe(r,"No window.location.(origin|href) available to create URL");let n=typeof e=="string"?e:Oc(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}function mN(e,t,r="/"){return O3(e,t,r,!1)}function O3(e,t,r,n){let a=typeof t=="string"?ol(t):t,i=ja(a.pathname||"/",r);if(i==null)return null;let o=vN(e);A3(o);let s=null;for(let l=0;s==null&&l{let u={relativePath:c===void 0?o.path||"":c,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};if(u.relativePath.startsWith("/")){if(!u.relativePath.startsWith(n)&&l)return;qe(u.relativePath.startsWith(n),`Absolute route path "${u.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),u.relativePath=u.relativePath.slice(n.length)}let f=ha([n,u.relativePath]),p=r.concat(u);o.children&&o.children.length>0&&(qe(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),vN(o.children,t,p,f,l)),!(o.path==null&&!o.index)&&t.push({path:f,score:L3(f,o.index),routesMeta:p})};return e.forEach((o,s)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))i(o,s);else for(let c of gN(o.path))i(o,s,!0,c)}),t}function gN(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let o=gN(n.join("/")),s=[];return s.push(...o.map(l=>l===""?i:[i,l].join("/"))),a&&s.push(...o),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function A3(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:$3(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var _3=/^:[\w-]+$/,T3=3,R3=2,D3=1,M3=10,I3=-2,G1=e=>e==="*";function L3(e,t){let r=e.split("/"),n=r.length;return r.some(G1)&&(n+=I3),t&&(n+=R3),r.filter(a=>!G1(a)).reduce((a,i)=>a+(_3.test(i)?T3:i===""?D3:M3),n)}function $3(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function F3(e,t,r=!1){let{routesMeta:n}=e,a={},i="/",o=[];for(let s=0;s{if(u==="*"){let g=s[p]||"";o=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const h=s[p];return f&&!h?c[u]=void 0:c[u]=(h||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:o,pattern:e}}function B3(e,t=!1,r=!0){hn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function z3(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return hn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ja(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function U3(e,t="/"){let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?ol(e):e;return{pathname:r?r.startsWith("/")?r:W3(r,t):t,search:K3(n),hash:V3(a)}}function W3(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Fm(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function q3(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Wx(e){let t=q3(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function qx(e,t,r,n=!1){let a;typeof e=="string"?a=ol(e):(a={...e},qe(!a.pathname||!a.pathname.includes("?"),Fm("?","pathname","search",a)),qe(!a.pathname||!a.pathname.includes("#"),Fm("#","pathname","hash",a)),qe(!a.search||!a.search.includes("#"),Fm("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,s;if(o==null)s=r;else{let f=t.length-1;if(!n&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),f-=1;a.pathname=p.join("/")}s=f>=0?t[f]:"/"}let l=U3(a,s),c=o&&o!=="/"&&o.endsWith("/"),u=(i||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}var ha=e=>e.join("/").replace(/\/\/+/g,"/"),H3=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),K3=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,V3=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Y3(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var yN=["POST","PUT","PATCH","DELETE"];new Set(yN);var G3=["GET",...yN];new Set(G3);var sl=m.createContext(null);sl.displayName="DataRouter";var Bp=m.createContext(null);Bp.displayName="DataRouterState";m.createContext(!1);var xN=m.createContext({isTransitioning:!1});xN.displayName="ViewTransition";var Q3=m.createContext(new Map);Q3.displayName="Fetchers";var X3=m.createContext(null);X3.displayName="Await";var yn=m.createContext(null);yn.displayName="Navigation";var au=m.createContext(null);au.displayName="Location";var Qr=m.createContext({outlet:null,matches:[],isDataRoute:!1});Qr.displayName="Route";var Hx=m.createContext(null);Hx.displayName="RouteError";function Z3(e,{relative:t}={}){qe(ll(),"useHref() may be used only in the context of a component.");let{basename:r,navigator:n}=m.useContext(yn),{hash:a,pathname:i,search:o}=iu(e,{relative:t}),s=i;return r!=="/"&&(s=i==="/"?r:ha([r,i])),n.createHref({pathname:s,search:o,hash:a})}function ll(){return m.useContext(au)!=null}function Ra(){return qe(ll(),"useLocation() may be used only in the context of a component."),m.useContext(au).location}var bN="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function wN(e){m.useContext(yn).static||m.useLayoutEffect(e)}function zp(){let{isDataRoute:e}=m.useContext(Qr);return e?hF():J3()}function J3(){qe(ll(),"useNavigate() may be used only in the context of a component.");let e=m.useContext(sl),{basename:t,navigator:r}=m.useContext(yn),{matches:n}=m.useContext(Qr),{pathname:a}=Ra(),i=JSON.stringify(Wx(n)),o=m.useRef(!1);return wN(()=>{o.current=!0}),m.useCallback((l,c={})=>{if(hn(o.current,bN),!o.current)return;if(typeof l=="number"){r.go(l);return}let u=qx(l,JSON.parse(i),a,c.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:ha([t,u.pathname])),(c.replace?r.replace:r.push)(u,c.state,c)},[t,r,i,a,e])}var eF=m.createContext(null);function tF(e){let t=m.useContext(Qr).outlet;return t&&m.createElement(eF.Provider,{value:e},t)}function rF(){let{matches:e}=m.useContext(Qr),t=e[e.length-1];return t?t.params:{}}function iu(e,{relative:t}={}){let{matches:r}=m.useContext(Qr),{pathname:n}=Ra(),a=JSON.stringify(Wx(r));return m.useMemo(()=>qx(e,JSON.parse(a),n,t==="path"),[e,a,n,t])}function nF(e,t){return SN(e,t)}function SN(e,t,r,n,a){var y;qe(ll(),"useRoutes() may be used only in the context of a component.");let{navigator:i}=m.useContext(yn),{matches:o}=m.useContext(Qr),s=o[o.length-1],l=s?s.params:{},c=s?s.pathname:"/",u=s?s.pathnameBase:"/",f=s&&s.route;{let w=f&&f.path||"";EN(c,!f||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${c}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. + */var V1="popstate";function P3(e={}){function t(n,a){let{pathname:i,search:o,hash:s}=n.location;return _v("",{pathname:i,search:o,hash:s},a.state&&a.state.usr||null,a.state&&a.state.key||"default")}function r(n,a){return typeof a=="string"?a:Oc(a)}return C3(t,r,null,e)}function qe(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function mn(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function k3(){return Math.random().toString(36).substring(2,10)}function Y1(e,t){return{usr:e.state,key:e.key,idx:t}}function _v(e,t,r=null,n){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?ol(t):t,state:r,key:t&&t.key||n||k3()}}function Oc({pathname:e="/",search:t="",hash:r=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function ol(e){let t={};if(e){let r=e.indexOf("#");r>=0&&(t.hash=e.substring(r),e=e.substring(0,r));let n=e.indexOf("?");n>=0&&(t.search=e.substring(n),e=e.substring(0,n)),e&&(t.pathname=e)}return t}function C3(e,t,r,n={}){let{window:a=document.defaultView,v5Compat:i=!1}=n,o=a.history,s="POP",l=null,c=u();c==null&&(c=0,o.replaceState({...o.state,idx:c},""));function u(){return(o.state||{idx:null}).idx}function f(){s="POP";let x=u(),b=x==null?null:x-c;c=x,l&&l({action:s,location:g.location,delta:b})}function p(x,b){s="PUSH";let y=_v(g.location,x,b);c=u()+1;let w=Y1(y,c),S=g.createHref(y);try{o.pushState(w,"",S)}catch(E){if(E instanceof DOMException&&E.name==="DataCloneError")throw E;a.location.assign(S)}i&&l&&l({action:s,location:g.location,delta:1})}function h(x,b){s="REPLACE";let y=_v(g.location,x,b);c=u();let w=Y1(y,c),S=g.createHref(y);o.replaceState(w,"",S),i&&l&&l({action:s,location:g.location,delta:0})}function v(x){return N3(x)}let g={get action(){return s},get location(){return e(a,o)},listen(x){if(l)throw new Error("A history only accepts one active listener");return a.addEventListener(V1,f),l=x,()=>{a.removeEventListener(V1,f),l=null}},createHref(x){return t(a,x)},createURL:v,encodeLocation(x){let b=v(x);return{pathname:b.pathname,search:b.search,hash:b.hash}},push:p,replace:h,go(x){return o.go(x)}};return g}function N3(e,t=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),qe(r,"No window.location.(origin|href) available to create URL");let n=typeof e=="string"?e:Oc(e);return n=n.replace(/ $/,"%20"),!t&&n.startsWith("//")&&(n=r+n),new URL(n,r)}function mN(e,t,r="/"){return O3(e,t,r,!1)}function O3(e,t,r,n){let a=typeof t=="string"?ol(t):t,i=ja(a.pathname||"/",r);if(i==null)return null;let o=gN(e);A3(o);let s=null;for(let l=0;s==null&&l{let u={relativePath:c===void 0?o.path||"":c,caseSensitive:o.caseSensitive===!0,childrenIndex:s,route:o};if(u.relativePath.startsWith("/")){if(!u.relativePath.startsWith(n)&&l)return;qe(u.relativePath.startsWith(n),`Absolute route path "${u.relativePath}" nested under path "${n}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),u.relativePath=u.relativePath.slice(n.length)}let f=ha([n,u.relativePath]),p=r.concat(u);o.children&&o.children.length>0&&(qe(o.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${f}".`),gN(o.children,t,p,f,l)),!(o.path==null&&!o.index)&&t.push({path:f,score:L3(f,o.index),routesMeta:p})};return e.forEach((o,s)=>{var l;if(o.path===""||!((l=o.path)!=null&&l.includes("?")))i(o,s);else for(let c of vN(o.path))i(o,s,!0,c)}),t}function vN(e){let t=e.split("/");if(t.length===0)return[];let[r,...n]=t,a=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return a?[i,""]:[i];let o=vN(n.join("/")),s=[];return s.push(...o.map(l=>l===""?i:[i,l].join("/"))),a&&s.push(...o),s.map(l=>e.startsWith("/")&&l===""?"/":l)}function A3(e){e.sort((t,r)=>t.score!==r.score?r.score-t.score:$3(t.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}var T3=/^:[\w-]+$/,_3=3,R3=2,D3=1,M3=10,I3=-2,G1=e=>e==="*";function L3(e,t){let r=e.split("/"),n=r.length;return r.some(G1)&&(n+=I3),t&&(n+=R3),r.filter(a=>!G1(a)).reduce((a,i)=>a+(T3.test(i)?_3:i===""?D3:M3),n)}function $3(e,t){return e.length===t.length&&e.slice(0,-1).every((n,a)=>n===t[a])?e[e.length-1]-t[t.length-1]:0}function F3(e,t,r=!1){let{routesMeta:n}=e,a={},i="/",o=[];for(let s=0;s{if(u==="*"){let v=s[p]||"";o=i.slice(0,i.length-v.length).replace(/(.)\/+$/,"$1")}const h=s[p];return f&&!h?c[u]=void 0:c[u]=(h||"").replace(/%2F/g,"/"),c},{}),pathname:i,pathnameBase:o,pattern:e}}function B3(e,t=!1,r=!0){mn(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let n=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,s,l)=>(n.push({paramName:s,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(n.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),n]}function z3(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return mn(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ja(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let r=t.endsWith("/")?t.length-1:t.length,n=e.charAt(r);return n&&n!=="/"?null:e.slice(r)||"/"}function U3(e,t="/"){let{pathname:r,search:n="",hash:a=""}=typeof e=="string"?ol(e):e;return{pathname:r?r.startsWith("/")?r:W3(r,t):t,search:K3(n),hash:V3(a)}}function W3(e,t){let r=t.replace(/\/+$/,"").split("/");return e.split("/").forEach(a=>{a===".."?r.length>1&&r.pop():a!=="."&&r.push(a)}),r.length>1?r.join("/"):"/"}function Fm(e,t,r,n){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(n)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in and the router will parse it for you.`}function q3(e){return e.filter((t,r)=>r===0||t.route.path&&t.route.path.length>0)}function Wx(e){let t=q3(e);return t.map((r,n)=>n===t.length-1?r.pathname:r.pathnameBase)}function qx(e,t,r,n=!1){let a;typeof e=="string"?a=ol(e):(a={...e},qe(!a.pathname||!a.pathname.includes("?"),Fm("?","pathname","search",a)),qe(!a.pathname||!a.pathname.includes("#"),Fm("#","pathname","hash",a)),qe(!a.search||!a.search.includes("#"),Fm("#","search","hash",a)));let i=e===""||a.pathname==="",o=i?"/":a.pathname,s;if(o==null)s=r;else{let f=t.length-1;if(!n&&o.startsWith("..")){let p=o.split("/");for(;p[0]==="..";)p.shift(),f-=1;a.pathname=p.join("/")}s=f>=0?t[f]:"/"}let l=U3(a,s),c=o&&o!=="/"&&o.endsWith("/"),u=(i||o===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(c||u)&&(l.pathname+="/"),l}var ha=e=>e.join("/").replace(/\/\/+/g,"/"),H3=e=>e.replace(/\/+$/,"").replace(/^\/*/,"/"),K3=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,V3=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e;function Y3(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}var yN=["POST","PUT","PATCH","DELETE"];new Set(yN);var G3=["GET",...yN];new Set(G3);var sl=m.createContext(null);sl.displayName="DataRouter";var Bp=m.createContext(null);Bp.displayName="DataRouterState";m.createContext(!1);var xN=m.createContext({isTransitioning:!1});xN.displayName="ViewTransition";var Q3=m.createContext(new Map);Q3.displayName="Fetchers";var X3=m.createContext(null);X3.displayName="Await";var xn=m.createContext(null);xn.displayName="Navigation";var au=m.createContext(null);au.displayName="Location";var Xr=m.createContext({outlet:null,matches:[],isDataRoute:!1});Xr.displayName="Route";var Hx=m.createContext(null);Hx.displayName="RouteError";function Z3(e,{relative:t}={}){qe(ll(),"useHref() may be used only in the context of a component.");let{basename:r,navigator:n}=m.useContext(xn),{hash:a,pathname:i,search:o}=iu(e,{relative:t}),s=i;return r!=="/"&&(s=i==="/"?r:ha([r,i])),n.createHref({pathname:s,search:o,hash:a})}function ll(){return m.useContext(au)!=null}function Ra(){return qe(ll(),"useLocation() may be used only in the context of a component."),m.useContext(au).location}var bN="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function wN(e){m.useContext(xn).static||m.useLayoutEffect(e)}function zp(){let{isDataRoute:e}=m.useContext(Xr);return e?hF():J3()}function J3(){qe(ll(),"useNavigate() may be used only in the context of a component.");let e=m.useContext(sl),{basename:t,navigator:r}=m.useContext(xn),{matches:n}=m.useContext(Xr),{pathname:a}=Ra(),i=JSON.stringify(Wx(n)),o=m.useRef(!1);return wN(()=>{o.current=!0}),m.useCallback((l,c={})=>{if(mn(o.current,bN),!o.current)return;if(typeof l=="number"){r.go(l);return}let u=qx(l,JSON.parse(i),a,c.relative==="path");e==null&&t!=="/"&&(u.pathname=u.pathname==="/"?t:ha([t,u.pathname])),(c.replace?r.replace:r.push)(u,c.state,c)},[t,r,i,a,e])}var eF=m.createContext(null);function tF(e){let t=m.useContext(Xr).outlet;return t&&m.createElement(eF.Provider,{value:e},t)}function rF(){let{matches:e}=m.useContext(Xr),t=e[e.length-1];return t?t.params:{}}function iu(e,{relative:t}={}){let{matches:r}=m.useContext(Xr),{pathname:n}=Ra(),a=JSON.stringify(Wx(r));return m.useMemo(()=>qx(e,JSON.parse(a),n,t==="path"),[e,a,n,t])}function nF(e,t){return SN(e,t)}function SN(e,t,r,n,a){var y;qe(ll(),"useRoutes() may be used only in the context of a component.");let{navigator:i}=m.useContext(xn),{matches:o}=m.useContext(Xr),s=o[o.length-1],l=s?s.params:{},c=s?s.pathname:"/",u=s?s.pathnameBase:"/",f=s&&s.route;{let w=f&&f.path||"";EN(c,!f||w.endsWith("*")||w.endsWith("*?"),`You rendered descendant (or called \`useRoutes()\`) at "${c}" (under ) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render. -Please change the parent to .`)}let p=Ra(),h;if(t){let w=typeof t=="string"?ol(t):t;qe(u==="/"||((y=w.pathname)==null?void 0:y.startsWith(u)),`When overriding the location using \`\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${u}" but pathname "${w.pathname}" was given in the \`location\` prop.`),h=w}else h=p;let g=h.pathname||"/",v=g;if(u!=="/"){let w=u.replace(/^\//,"").split("/");v="/"+g.replace(/^\//,"").split("/").slice(w.length).join("/")}let x=mN(e,{pathname:v});hn(f||x!=null,`No routes matched location "${h.pathname}${h.search}${h.hash}" `),hn(x==null||x[x.length-1].route.element!==void 0||x[x.length-1].route.Component!==void 0||x[x.length-1].route.lazy!==void 0,`Matched leaf route at location "${h.pathname}${h.search}${h.hash}" does not have an element or Component. This means it will render an with a null value by default resulting in an "empty" page.`);let b=lF(x&&x.map(w=>Object.assign({},w,{params:Object.assign({},l,w.params),pathname:ha([u,i.encodeLocation?i.encodeLocation(w.pathname).pathname:w.pathname]),pathnameBase:w.pathnameBase==="/"?u:ha([u,i.encodeLocation?i.encodeLocation(w.pathnameBase).pathname:w.pathnameBase])})),o,r,n,a);return t&&b?m.createElement(au.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...h},navigationType:"POP"}},b):b}function aF(){let e=pF(),t=Y3(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),r=e instanceof Error?e.stack:null,n="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:n},i={padding:"2px 4px",backgroundColor:n},o=null;return console.error("Error handled by React Router default ErrorBoundary:",e),o=m.createElement(m.Fragment,null,m.createElement("p",null,"💿 Hey developer 👋"),m.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",m.createElement("code",{style:i},"ErrorBoundary")," or"," ",m.createElement("code",{style:i},"errorElement")," prop on your route.")),m.createElement(m.Fragment,null,m.createElement("h2",null,"Unexpected Application Error!"),m.createElement("h3",{style:{fontStyle:"italic"}},t),r?m.createElement("pre",{style:a},r):null,o)}var iF=m.createElement(aF,null),oF=class extends m.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.unstable_onError?this.props.unstable_onError(e,t):console.error("React Router caught the following error during render",e)}render(){return this.state.error!==void 0?m.createElement(Qr.Provider,{value:this.props.routeContext},m.createElement(Hx.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function sF({routeContext:e,match:t,children:r}){let n=m.useContext(sl);return n&&n.static&&n.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(n.staticContext._deepestRenderedBoundaryId=t.route.id),m.createElement(Qr.Provider,{value:e},r)}function lF(e,t=[],r=null,n=null,a=null){if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,o=r==null?void 0:r.errors;if(o!=null){let c=i.findIndex(u=>u.route.id&&(o==null?void 0:o[u.route.id])!==void 0);qe(c>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),i=i.slice(0,Math.min(i.length,c+1))}let s=!1,l=-1;if(r)for(let c=0;c=0?i=i.slice(0,l+1):i=[i[0]];break}}}return i.reduceRight((c,u,f)=>{let p,h=!1,g=null,v=null;r&&(p=o&&u.route.id?o[u.route.id]:void 0,g=u.route.errorElement||iF,s&&(l<0&&f===0?(EN("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),h=!0,v=null):l===f&&(h=!0,v=u.route.hydrateFallbackElement||null)));let x=t.concat(i.slice(0,f+1)),b=()=>{let y;return p?y=g:h?y=v:u.route.Component?y=m.createElement(u.route.Component,null):u.route.element?y=u.route.element:y=c,m.createElement(sF,{match:u,routeContext:{outlet:c,matches:x,isDataRoute:r!=null},children:y})};return r&&(u.route.ErrorBoundary||u.route.errorElement||f===0)?m.createElement(oF,{location:r.location,revalidation:r.revalidation,component:g,error:p,children:b(),routeContext:{outlet:null,matches:x,isDataRoute:!0},unstable_onError:n}):b()},null)}function Kx(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cF(e){let t=m.useContext(sl);return qe(t,Kx(e)),t}function uF(e){let t=m.useContext(Bp);return qe(t,Kx(e)),t}function dF(e){let t=m.useContext(Qr);return qe(t,Kx(e)),t}function Vx(e){let t=dF(e),r=t.matches[t.matches.length-1];return qe(r.route.id,`${e} can only be used on routes that contain a unique "id"`),r.route.id}function fF(){return Vx("useRouteId")}function pF(){var n;let e=m.useContext(Hx),t=uF("useRouteError"),r=Vx("useRouteError");return e!==void 0?e:(n=t.errors)==null?void 0:n[r]}function hF(){let{router:e}=cF("useNavigate"),t=Vx("useNavigate"),r=m.useRef(!1);return wN(()=>{r.current=!0}),m.useCallback(async(a,i={})=>{hn(r.current,bN),r.current&&(typeof a=="number"?e.navigate(a):await e.navigate(a,{fromRouteId:t,...i}))},[e,t])}var Q1={};function EN(e,t,r){!t&&!Q1[e]&&(Q1[e]=!0,hn(!1,r))}m.memo(mF);function mF({routes:e,future:t,state:r,unstable_onError:n}){return SN(e,void 0,r,n,t)}function vF({to:e,replace:t,state:r,relative:n}){qe(ll()," may be used only in the context of a component.");let{static:a}=m.useContext(yn);hn(!a," must not be used on the initial render in a . This is a no-op, but you should modify your code so the is only ever rendered in response to some user interaction or state change.");let{matches:i}=m.useContext(Qr),{pathname:o}=Ra(),s=zp(),l=qx(e,Wx(i),o,n==="path"),c=JSON.stringify(l);return m.useEffect(()=>{s(JSON.parse(c),{replace:t,state:r,relative:n})},[s,c,n,t,r]),null}function gF(e){return tF(e.context)}function Mr(e){qe(!1,"A is only ever to be used as the child of element, never rendered directly. Please wrap your in a .")}function yF({basename:e="/",children:t=null,location:r,navigationType:n="POP",navigator:a,static:i=!1}){qe(!ll(),"You cannot render a inside another . You should never have more than one in your app.");let o=e.replace(/^\/*/,"/"),s=m.useMemo(()=>({basename:o,navigator:a,static:i,future:{}}),[o,a,i]);typeof r=="string"&&(r=ol(r));let{pathname:l="/",search:c="",hash:u="",state:f=null,key:p="default"}=r,h=m.useMemo(()=>{let g=ja(l,o);return g==null?null:{location:{pathname:g,search:c,hash:u,state:f,key:p},navigationType:n}},[o,l,c,u,f,p,n]);return hn(h!=null,` is not able to match the URL "${l}${c}${u}" because it does not start with the basename, so the won't render anything.`),h==null?null:m.createElement(yn.Provider,{value:s},m.createElement(au.Provider,{children:t,value:h}))}function xF({children:e,location:t}){return nF(Rg(e),t)}function Rg(e,t=[]){let r=[];return m.Children.forEach(e,(n,a)=>{if(!m.isValidElement(n))return;let i=[...t,a];if(n.type===m.Fragment){r.push.apply(r,Rg(n.props.children,i));return}qe(n.type===Mr,`[${typeof n.type=="string"?n.type:n.type.name}] is not a component. All component children of must be a or `),qe(!n.props.index||!n.props.children,"An index route cannot have child routes.");let o={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,hydrateFallbackElement:n.props.hydrateFallbackElement,HydrateFallback:n.props.HydrateFallback,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.hasErrorBoundary===!0||n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=Rg(n.props.children,i)),r.push(o)}),r}var Bd="get",zd="application/x-www-form-urlencoded";function Up(e){return e!=null&&typeof e.tagName=="string"}function bF(e){return Up(e)&&e.tagName.toLowerCase()==="button"}function wF(e){return Up(e)&&e.tagName.toLowerCase()==="form"}function SF(e){return Up(e)&&e.tagName.toLowerCase()==="input"}function EF(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function jF(e,t){return e.button===0&&(!t||t==="_self")&&!EF(e)}var rd=null;function PF(){if(rd===null)try{new FormData(document.createElement("form"),0),rd=!1}catch{rd=!0}return rd}var CF=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Bm(e){return e!=null&&!CF.has(e)?(hn(!1,`"${e}" is not a valid \`encType\` for \`
\`/\`\` and will default to "${zd}"`),null):e}function kF(e,t){let r,n,a,i,o;if(wF(e)){let s=e.getAttribute("action");n=s?ja(s,t):null,r=e.getAttribute("method")||Bd,a=Bm(e.getAttribute("enctype"))||zd,i=new FormData(e)}else if(bF(e)||SF(e)&&(e.type==="submit"||e.type==="image")){let s=e.form;if(s==null)throw new Error('Cannot submit a @@ -131,7 +134,7 @@ export function TracesList({ className }: TracesListProps) {
setFilters({ ...filters, search: e.target.value }) @@ -148,12 +151,12 @@ export function TracesList({ className }: TracesListProps) { } > - + - All statuses - Success - Error + {t("traceslist.all")} + {t("traceslist.success")} + {t("traceslist.error")} @@ -167,16 +170,16 @@ export function TracesList({ className }: TracesListProps) { - Last hour - Last 6 hours - Last 24 hours - Last week + {t("traceslist.lastHour")} + {t("traceslist.last6Hours")} + {t("traceslist.last24Hours")} + {t("traceslist.lastWeek")}
diff --git a/fastapi_radar/dashboard/src/i18n/translations.ts b/fastapi_radar/dashboard/src/i18n/translations.ts index 3833a22..c9c2b8f 100644 --- a/fastapi_radar/dashboard/src/i18n/translations.ts +++ b/fastapi_radar/dashboard/src/i18n/translations.ts @@ -55,12 +55,32 @@ export interface Translations { title: string; description: string; }; + backgroundTasks: { + title: string; + description: string; + }; settings: { title: string; description: string; }; }; + // Background Tasks page + backgroundTasks: { + noTasks: string; + failedToLoad: string; + started: string; + duration: string; + requestId: string; + created: string; + status: { + completed: string; + failed: string; + running: string; + pending: string; + }; + }; + // Common UI text common: { loading: string; @@ -116,6 +136,9 @@ export interface Translations { endpoint: string; duration: string; timestamp: string; + success: string; + error: string; + p50: string; }; // Settings page @@ -193,6 +216,8 @@ export interface Translations { method: string; searchPlaceholder: string; description: string; + timeRange: string; + apply: string; }; tabs: { all: string; @@ -218,6 +243,12 @@ export interface Translations { delete: string; patch: string; }; + timeRangeFilters: { + all: string; + lastHour: string; + last24Hours: string; + last7Days: string; + }; descriptions: { all: string; successful: string; @@ -280,7 +311,9 @@ export interface Translations { slowQueries: string; avgQueryTime: string; queryStatistics: string; + queryPerformanceScore: string; slowQueriesTitle: string; + noSlowQueries: string; errorAnalysisTitle: string; detailedMetrics: string; noEndpointData: string; @@ -383,7 +416,27 @@ export interface Translations { }; }; }; -} + + traceslist: { + search: string; + all: string; + success: string; + error: string; + lastHour: string; + last6Hours: string; + last24Hours: string; + lastWeek: string; + refresh: string; + failToLoadTraces: string; + anError: string; + tryAgain: string; + }; + + layout: { + connected: string; + }, +}; + // English translations const en: Translations = { @@ -437,12 +490,31 @@ const en: Translations = { title: "Performance", description: "Application performance metrics and analysis", }, + backgroundTasks: { + title: "Background Tasks", + description: "Monitor and track background tasks executed in your application", + }, settings: { title: "Settings", description: "Manage your dashboard preferences and data", }, }, + backgroundTasks: { + noTasks: "No background tasks found", + failedToLoad: "Failed to load background tasks", + started: "Started", + duration: "Duration", + requestId: "Request ID", + created: "Created", + status: { + completed: "Completed", + failed: "Failed", + running: "Running", + pending: "Pending", + }, + }, + common: { loading: "Loading...", error: "Error", @@ -495,6 +567,9 @@ const en: Translations = { endpoint: "Endpoint", duration: "Duration", timestamp: "Timestamp", + success: "Success", + error: "Error", + p50: "P50 (Median)", }, settings: { @@ -572,6 +647,8 @@ const en: Translations = { method: "Method", searchPlaceholder: "Search by path...", description: "Filter and search through request logs", + timeRange: "Time Range", + apply: "Apply Filters", }, tabs: { all: "All Requests", @@ -597,6 +674,12 @@ const en: Translations = { delete: "DELETE", patch: "PATCH", }, + timeRangeFilters: { + all: "All Time", + lastHour: "Last Hour", + last24Hours: "Last 24 Hours", + last7Days: "Last 7 Days", + }, descriptions: { all: "Complete list of all HTTP requests", successful: "Requests that completed successfully (2xx status codes)", @@ -656,8 +739,10 @@ const en: Translations = { queriesPerRequest: "Queries/Request", slowQueries: "Slow Queries", avgQueryTime: "Avg Query Time", + queryPerformanceScore: "Query Performance Score", queryStatistics: "Query Statistics", slowQueriesTitle: "Slow Queries", + noSlowQueries: "No slow queries detected", errorAnalysisTitle: "Error Analysis", detailedMetrics: "Detailed Metrics", noEndpointData: "No endpoint data available", @@ -759,6 +844,25 @@ const en: Translations = { }, }, }, + + traceslist: { + search: "Search by operation name...", + all: "All statuses", + success: "Success", + error: "Error", + lastHour: "Last Hour", + last6Hours: "Last 6 Hours", + last24Hours: "Last 24 Hours", + lastWeek: "Last Week", + refresh: "Refresh", + failToLoadTraces: "Failed to load traces", + anError: "There was an error loading the trace data.", + tryAgain: "Try again", + }, + + layout: { + connected: "Connected", + }, }; // Chinese translations @@ -811,12 +915,31 @@ const zh: Translations = { title: "性能分析", description: "应用程序性能指标和分析", }, + backgroundTasks: { + title: "后台任务", + description: "监控和跟踪应用程序中执行的后台任务", + }, settings: { title: "设置", description: "管理仪表板偏好设置和数据", }, }, + backgroundTasks: { + noTasks: "未找到后台任务", + failedToLoad: "加载后台任务失败", + started: "开始时间", + duration: "持续时间", + requestId: "请求 ID", + created: "创建时间", + status: { + completed: "已完成", + failed: "失败", + running: "运行中", + pending: "等待中", + }, + }, + common: { loading: "加载中...", error: "错误", @@ -869,6 +992,9 @@ const zh: Translations = { endpoint: "端点", duration: "持续时间", timestamp: "时间戳", + success: "成功", + error: "失败", + p50: "P50 (中位数)", }, settings: { @@ -945,6 +1071,8 @@ const zh: Translations = { method: "请求方法", searchPlaceholder: "按路径搜索...", description: "筛选和搜索请求日志", + timeRange: "时间范围", + apply: "应用筛选器", }, tabs: { all: "所有请求", @@ -970,6 +1098,12 @@ const zh: Translations = { delete: "DELETE", patch: "PATCH", }, + timeRangeFilters: { + all: "所有时间", + lastHour: "最近1小时", + last24Hours: "最近24小时", + last7Days: "最近7天", + }, descriptions: { all: "所有 HTTP 请求的完整列表", successful: "成功完成的请求 (2xx 状态码)", @@ -1029,8 +1163,10 @@ const zh: Translations = { queriesPerRequest: "每个请求的查询数", slowQueries: "慢查询", avgQueryTime: "平均查询时间", + queryPerformanceScore: "查询性能评分", queryStatistics: "查询统计", slowQueriesTitle: "慢查询", + noSlowQueries: "未检测到慢查询", errorAnalysisTitle: "错误分析", detailedMetrics: "详细指标", noEndpointData: "无端点数据", @@ -1132,6 +1268,25 @@ const zh: Translations = { }, }, }, + + traceslist: { + search: "按操作名称搜索...", + all: "所有状态", + success: "成功", + error: "失败", + lastHour: "最近1小时", + last6Hours: "最近6小时", + last24Hours: "最近24小时", + lastWeek: "最近7天", + refresh: "刷新", + failToLoadTraces: "加载追踪记录失败", + anError: "加载追踪数据时出错", + tryAgain: "重试", + }, + + layout: { + connected: "已连接", + }, }; // Export translations diff --git a/fastapi_radar/dashboard/src/pages/BackgroundTasksPage.tsx b/fastapi_radar/dashboard/src/pages/BackgroundTasksPage.tsx index 60d1dcc..f096e9c 100644 --- a/fastapi_radar/dashboard/src/pages/BackgroundTasksPage.tsx +++ b/fastapi_radar/dashboard/src/pages/BackgroundTasksPage.tsx @@ -6,9 +6,11 @@ import { Button } from "@/components/ui/button"; import { format } from "date-fns"; import { Clock, CheckCircle2, XCircle, Loader2, ExternalLink } from "lucide-react"; import { useNavigate } from "react-router-dom"; +import { useT } from "@/i18n"; export function BackgroundTasksPage() { const navigate = useNavigate(); + const t = useT(); const { data: tasks, isLoading, isError, error } = useQuery({ queryKey: ["background-tasks"], @@ -53,7 +55,7 @@ export function BackgroundTasksPage() { if (isLoading) { return (
-
Loading...
+
{t("common.loading")}
); } @@ -63,9 +65,9 @@ export function BackgroundTasksPage() {
-

Failed to load background tasks

+

{t("backgroundTasks.failedToLoad")}

- {error instanceof Error ? error.message : "Unknown error"} + {error instanceof Error ? error.message : t("detailDrawer.common.unknown")}

@@ -76,9 +78,9 @@ export function BackgroundTasksPage() { return (
-

Background Tasks

+

{t("pages.backgroundTasks.title")}

- Monitor and track background tasks executed in your application + {t("pages.backgroundTasks.description")}

@@ -86,7 +88,7 @@ export function BackgroundTasksPage() { {tasks && tasks.length === 0 && ( - No background tasks found + {t("backgroundTasks.noTasks")} )} @@ -105,14 +107,20 @@ export function BackgroundTasksPage() {

- {task.status} + {task.status === "completed" + ? t("backgroundTasks.status.completed") + : task.status === "failed" + ? t("backgroundTasks.status.failed") + : task.status === "running" + ? t("backgroundTasks.status.running") + : task.status}
-

Started

+

{t("backgroundTasks.started")}

{task.start_time ? format(new Date(task.start_time), "HH:mm:ss") @@ -120,11 +128,11 @@ export function BackgroundTasksPage() {

-

Duration

+

{t("backgroundTasks.duration")}

{formatDuration(task.duration_ms)}

-

Request ID

+

{t("backgroundTasks.requestId")}

{task.request_id ? (
diff --git a/fastapi_radar/dashboard/src/pages/RequestsPage.tsx b/fastapi_radar/dashboard/src/pages/RequestsPage.tsx index a1a910b..894fece 100644 --- a/fastapi_radar/dashboard/src/pages/RequestsPage.tsx +++ b/fastapi_radar/dashboard/src/pages/RequestsPage.tsx @@ -189,42 +189,42 @@ export function RequestsPage() {
- +
From 449afc7174b6d25255ca1e06eff369fdd2833a1b Mon Sep 17 00:00:00 2001 From: lxdklp Date: Thu, 20 Nov 2025 18:38:39 +0800 Subject: [PATCH 2/2] fix: typo --- .../dist/assets/{index-DXB6avHW.js => index-TW7wrctN.js} | 4 ++-- fastapi_radar/dashboard/dist/index.html | 2 +- fastapi_radar/dashboard/src/components/TracesList.tsx | 4 ++-- fastapi_radar/dashboard/src/i18n/translations.ts | 3 +++ 4 files changed, 8 insertions(+), 5 deletions(-) rename fastapi_radar/dashboard/dist/assets/{index-DXB6avHW.js => index-TW7wrctN.js} (90%) diff --git a/fastapi_radar/dashboard/dist/assets/index-DXB6avHW.js b/fastapi_radar/dashboard/dist/assets/index-TW7wrctN.js similarity index 90% rename from fastapi_radar/dashboard/dist/assets/index-DXB6avHW.js rename to fastapi_radar/dashboard/dist/assets/index-TW7wrctN.js index 89423dc..cd9bf8f 100644 --- a/fastapi_radar/dashboard/dist/assets/index-DXB6avHW.js +++ b/fastapi_radar/dashboard/dist/assets/index-TW7wrctN.js @@ -223,7 +223,7 @@ Please change the parent to {const l=o5();return l||t||l5()}),a=a5(r),i=l=>i5(a,l),o=l=>{n(l),s5(l)};m.useEffect(()=>{document.documentElement.lang=r},[r]);const s={language:r,setLanguage:o,t:i,translations:a};return d.jsx(zN.Provider,{value:s,children:e})}function e0(){const e=m.useContext(zN);if(e===void 0)throw new Error("useTranslation must be used within a LanguageProvider");return e}function Tr(){const{t:e}=e0();return e}function u5(){const{language:e,setLanguage:t}=e0();return{language:e,setLanguage:t}}const d5=[{titleKey:"nav.dashboard",icon:Y4,href:"/",badge:null},{titleKey:"nav.requests",icon:ou,href:"/requests",badge:null},{titleKey:"nav.tracking",icon:V4,href:"/tracing",badge:null},{titleKey:"nav.database",icon:su,href:"/database",badge:null},{titleKey:"nav.exceptions",icon:Bo,href:"/exceptions",badge:null},{titleKey:"nav.performance",icon:J4,href:"/performance",badge:null},{titleKey:"nav.backgroundTasks",icon:e5,href:"/background-tasks",badge:null}],f5=[{titleKey:"nav.settings",icon:Z4,href:"/settings",badge:null}];function p5({className:e,collapsed:t=!1}){const r=Ra(),n=Tr(),{data:a}=tt({queryKey:["sidebar-stats"],queryFn:()=>Me.getStats(1),refetchInterval:3e4}),i=d5.map(l=>({...l,title:n(l.titleKey)})),o=f5.map(l=>({...l,title:n(l.titleKey)})),s=i.map(l=>l.titleKey==="nav.exceptions"&&(a!=null&&a.total_exceptions)&&a.total_exceptions>0?{...l,badge:a.total_exceptions.toString(),badgeVariant:"destructive"}:l);return d.jsx("div",{className:V("pb-12",e),children:d.jsx("div",{className:"space-y-4 py-4",children:d.jsxs("div",{className:"px-3 py-2",children:[d.jsxs("div",{className:"flex items-center mb-6 px-3",children:[!t&&d.jsx(d.Fragment,{children:d.jsxs("div",{className:"flex items-center space-x-2",children:[d.jsx("span",{className:"text-2xl",children:"🚀"}),d.jsxs("div",{className:"flex flex-col",children:[d.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:"FastAPI Radar"}),d.jsx("span",{className:"text-xs text-muted-foreground",children:n("settings.about.description")})]})]})}),t&&d.jsx("span",{className:"text-2xl mx-auto",children:"🚀"})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("h2",{className:V("mb-2 px-4 text-xs font-semibold tracking-wider text-muted-foreground uppercase",t&&"sr-only"),children:t?null:n("sidebar.navigation")}),s.map(l=>d.jsx(oe,{variant:r.pathname===l.href?"secondary":"ghost",className:V("w-full justify-start relative",t&&"justify-center"),asChild:!0,children:d.jsxs(ui,{to:l.href,children:[d.jsx(l.icon,{className:V("h-4 w-4",!t&&"mr-2")}),!t&&d.jsxs(d.Fragment,{children:[l.title,l.badge&&d.jsx(ve,{variant:l.badgeVariant||"outline",className:"ml-auto",children:l.badge})]})]})},l.href))]}),d.jsxs("div",{className:"space-y-1 mt-6",children:[d.jsx("h2",{className:V("mb-2 px-4 text-xs font-semibold tracking-wider text-muted-foreground uppercase",t&&"sr-only"),children:t?null:n("sidebar.system")}),o.map(l=>d.jsx(oe,{variant:r.pathname===l.href?"secondary":"ghost",className:V("w-full justify-start",t&&"justify-center"),asChild:!0,children:d.jsxs(ui,{to:l.href,children:[d.jsx(l.icon,{className:V("h-4 w-4",!t&&"mr-2")}),!t&&l.title]})},l.href))]})]})})})}function ul(){const[e,t]=m.useState(()=>localStorage.getItem("theme")||"light");return m.useEffect(()=>{document.documentElement.className=e,localStorage.setItem("theme",e)},[e]),{theme:e,setTheme:t,toggleTheme:()=>{t(n=>n==="light"?"dark":"light")}}}function h5(){const[e,t]=m.useState(!1),{theme:r,toggleTheme:n}=ul(),[a,i]=m.useState(!1),o=Tr(),{refetch:s}=tt({queryKey:["stats"],queryFn:()=>Me.getStats(1)}),l=async()=>{i(!0),await s(),setTimeout(()=>i(!1),1e3)},c=async()=>{confirm("Are you sure you want to clear all captured data?")&&(await Me.clearData(),await s())};return d.jsxs("div",{className:"flex h-screen overflow-hidden",children:[d.jsx("div",{className:V("hidden md:flex h-full bg-background border-r transition-all duration-300",e?"w-16":"w-64"),children:d.jsx(p5,{collapsed:e,className:"w-full"})}),d.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[d.jsx("header",{className:"bg-background border-b px-6 py-3",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center space-x-4",children:[d.jsx(oe,{variant:"ghost",size:"icon",onClick:()=>t(!e),className:"hidden md:flex",children:e?d.jsx(aS,{className:"h-5 w-5"}):d.jsx(W4,{className:"h-5 w-5"})}),d.jsx(oe,{variant:"ghost",size:"icon",className:"md:hidden",children:d.jsx(aS,{className:"h-5 w-5"})})]}),d.jsxs("div",{className:"flex items-center space-x-3",children:[d.jsxs(ve,{variant:"outline",className:"hidden sm:flex items-center gap-1",children:[d.jsx("div",{className:"h-2 w-2 bg-green-500 rounded-full animate-pulse"}),o("layout.connected")]}),d.jsx(oe,{variant:"ghost",size:"icon",onClick:l,title:"Refresh data",children:d.jsx(Ac,{className:V("h-4 w-4",a&&"animate-spin")})}),d.jsx(oe,{variant:"ghost",size:"icon",onClick:c,title:"Clear all data",children:d.jsx(Ud,{className:"h-4 w-4"})}),d.jsx(oe,{variant:"ghost",size:"icon",onClick:n,title:"Toggle theme",children:r==="light"?d.jsx($N,{className:"h-4 w-4"}):d.jsx(BN,{className:"h-4 w-4"})})]})]})}),d.jsx("main",{className:"flex-1 overflow-auto bg-muted/10",children:d.jsx("div",{className:"p-6",children:d.jsx(vF,{})})})]})]})}function Mv(e,[t,r]){return Math.min(r,Math.max(t,e))}function ie(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e==null||e(a),r===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function m5(e,t){const r=m.createContext(t),n=i=>{const{children:o,...s}=i,l=m.useMemo(()=>s,Object.values(s));return d.jsx(r.Provider,{value:l,children:o})};n.displayName=e+"Provider";function a(i){const o=m.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,a]}function Kn(e,t=[]){let r=[];function n(i,o){const s=m.createContext(o),l=r.length;r=[...r,o];const c=f=>{var b;const{scope:p,children:h,...v}=f,g=((b=p==null?void 0:p[e])==null?void 0:b[l])||s,x=m.useMemo(()=>v,Object.values(v));return d.jsx(g.Provider,{value:x,children:h})};c.displayName=i+"Provider";function u(f,p){var g;const h=((g=p==null?void 0:p[e])==null?void 0:g[l])||s,v=m.useContext(h);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[c,u]}const a=()=>{const i=r.map(o=>m.createContext(o));return function(s){const l=(s==null?void 0:s[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return a.scopeName=e,[n,g5(a,...t)]}function g5(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((s,{useScope:l,scopeName:c})=>{const f=l(i)[`__scope${c}`];return{...s,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function WN(e){const t=e+"CollectionProvider",[r,n]=Kn(t),[a,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:x,children:b}=g,y=Jn.useRef(null),w=Jn.useRef(new Map).current;return d.jsx(a,{scope:x,itemMap:w,collectionRef:y,children:b})};o.displayName=t;const s=e+"CollectionSlot",l=zs(s),c=Jn.forwardRef((g,x)=>{const{scope:b,children:y}=g,w=i(s,b),S=be(x,w.collectionRef);return d.jsx(l,{ref:S,children:y})});c.displayName=s;const u=e+"CollectionItemSlot",f="data-radix-collection-item",p=zs(u),h=Jn.forwardRef((g,x)=>{const{scope:b,children:y,...w}=g,S=Jn.useRef(null),E=be(x,S),j=i(u,b);return Jn.useEffect(()=>(j.itemMap.set(S,{ref:S,...w}),()=>void j.itemMap.delete(S))),d.jsx(p,{[f]:"",ref:E,children:y})});h.displayName=u;function v(g){const x=i(e+"CollectionConsumer",g);return Jn.useCallback(()=>{const y=x.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(x.itemMap.values()).sort((j,P)=>w.indexOf(j.ref.current)-w.indexOf(P.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:o,Slot:c,ItemSlot:h},v,n]}var v5=m.createContext(void 0);function Hp(e){const t=m.useContext(v5);return e||t||"ltr"}var y5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],se=y5.reduce((e,t)=>{const r=zs(`Primitive.${t}`),n=m.forwardRef((a,i)=>{const{asChild:o,...s}=a,l=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(l,{...s,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function x5(e,t){e&&Ti.flushSync(()=>e.dispatchEvent(t))}function Qt(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function b5(e,t=globalThis==null?void 0:globalThis.document){const r=Qt(e);m.useEffect(()=>{const n=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var w5="DismissableLayer",Iv="dismissableLayer.update",S5="dismissableLayer.pointerDownOutside",E5="dismissableLayer.focusOutside",oS,qN=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Kp=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:s,...l}=e,c=m.useContext(qN),[u,f]=m.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=m.useState({}),v=be(t,P=>f(P)),g=Array.from(c.layers),[x]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=g.indexOf(x),y=u?g.indexOf(u):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,S=y>=b,E=k5(P=>{const k=P.target,N=[...c.branches].some(O=>O.contains(k));!S||N||(a==null||a(P),o==null||o(P),P.defaultPrevented||s==null||s())},p),j=C5(P=>{const k=P.target;[...c.branches].some(O=>O.contains(k))||(i==null||i(P),o==null||o(P),P.defaultPrevented||s==null||s())},p);return b5(P=>{y===c.layers.size-1&&(n==null||n(P),!P.defaultPrevented&&s&&(P.preventDefault(),s()))},p),m.useEffect(()=>{if(u)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(oS=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),sS(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=oS)}},[u,p,r,c]),m.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),sS())},[u,c]),m.useEffect(()=>{const P=()=>h({});return document.addEventListener(Iv,P),()=>document.removeEventListener(Iv,P)},[]),d.jsx(se.div,{...l,ref:v,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:ie(e.onFocusCapture,j.onFocusCapture),onBlurCapture:ie(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:ie(e.onPointerDownCapture,E.onPointerDownCapture)})});Kp.displayName=w5;var j5="DismissableLayerBranch",P5=m.forwardRef((e,t)=>{const r=m.useContext(qN),n=m.useRef(null),a=be(t,n);return m.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),d.jsx(se.div,{...e,ref:a})});P5.displayName=j5;function k5(e,t=globalThis==null?void 0:globalThis.document){const r=Qt(e),n=m.useRef(!1),a=m.useRef(()=>{});return m.useEffect(()=>{const i=s=>{if(s.target&&!n.current){let l=function(){HN(S5,r,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=l,t.addEventListener("click",a.current,{once:!0})):l()}else t.removeEventListener("click",a.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function C5(e,t=globalThis==null?void 0:globalThis.document){const r=Qt(e),n=m.useRef(!1);return m.useEffect(()=>{const a=i=>{i.target&&!n.current&&HN(E5,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function sS(){const e=new CustomEvent(Iv);document.dispatchEvent(e)}function HN(e,t,r,{discrete:n}){const a=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?x5(a,i):a.dispatchEvent(i)}var Wm=0;function KN(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??lS()),document.body.insertAdjacentElement("beforeend",e[1]??lS()),Wm++,()=>{Wm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Wm--}},[])}function lS(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var qm="focusScope.autoFocusOnMount",Hm="focusScope.autoFocusOnUnmount",cS={bubbles:!1,cancelable:!0},N5="FocusScope",t0=m.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[s,l]=m.useState(null),c=Qt(a),u=Qt(i),f=m.useRef(null),p=be(t,g=>l(g)),h=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(n){let g=function(w){if(h.paused||!s)return;const S=w.target;s.contains(S)?f.current=S:Ha(f.current,{select:!0})},x=function(w){if(h.paused||!s)return;const S=w.relatedTarget;S!==null&&(s.contains(S)||Ha(f.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const E of w)E.removedNodes.length>0&&Ha(s)};document.addEventListener("focusin",g),document.addEventListener("focusout",x);const y=new MutationObserver(b);return s&&y.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",x),y.disconnect()}}},[n,s,h.paused]),m.useEffect(()=>{if(s){dS.add(h);const g=document.activeElement;if(!s.contains(g)){const b=new CustomEvent(qm,cS);s.addEventListener(qm,c),s.dispatchEvent(b),b.defaultPrevented||(O5(D5(VN(s)),{select:!0}),document.activeElement===g&&Ha(s))}return()=>{s.removeEventListener(qm,c),setTimeout(()=>{const b=new CustomEvent(Hm,cS);s.addEventListener(Hm,u),s.dispatchEvent(b),b.defaultPrevented||Ha(g??document.body,{select:!0}),s.removeEventListener(Hm,u),dS.remove(h)},0)}}},[s,c,u,h]);const v=m.useCallback(g=>{if(!r&&!n||h.paused)return;const x=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,b=document.activeElement;if(x&&b){const y=g.currentTarget,[w,S]=A5(y);w&&S?!g.shiftKey&&b===S?(g.preventDefault(),r&&Ha(w,{select:!0})):g.shiftKey&&b===w&&(g.preventDefault(),r&&Ha(S,{select:!0})):b===y&&g.preventDefault()}},[r,n,h.paused]);return d.jsx(se.div,{tabIndex:-1,...o,ref:p,onKeyDown:v})});t0.displayName=N5;function O5(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Ha(n,{select:t}),document.activeElement!==r)return}function A5(e){const t=VN(e),r=uS(t,e),n=uS(t.reverse(),e);return[r,n]}function VN(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function uS(e,t){for(const r of e)if(!T5(r,{upTo:t}))return r}function T5(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function _5(e){return e instanceof HTMLInputElement&&"select"in e}function Ha(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&_5(e)&&t&&e.select()}}var dS=R5();function R5(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=fS(e,t),e.unshift(t)},remove(t){var r;e=fS(e,t),(r=e[0])==null||r.resume()}}}function fS(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function D5(e){return e.filter(t=>t.tagName!=="A")}var _t=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},M5=Yy[" useId ".trim().toString()]||(()=>{}),I5=0;function ma(e){const[t,r]=m.useState(M5());return _t(()=>{r(n=>n??String(I5++))},[e]),t?`radix-${t}`:""}const L5=["top","right","bottom","left"],Ei=Math.min,br=Math.max,jf=Math.round,ad=Math.floor,Ln=e=>({x:e,y:e}),$5={left:"right",right:"left",bottom:"top",top:"bottom"},F5={start:"end",end:"start"};function Lv(e,t,r){return br(e,Ei(t,r))}function Pa(e,t){return typeof e=="function"?e(t):e}function ka(e){return e.split("-")[0]}function dl(e){return e.split("-")[1]}function r0(e){return e==="x"?"y":"x"}function n0(e){return e==="y"?"height":"width"}const B5=new Set(["top","bottom"]);function _n(e){return B5.has(ka(e))?"y":"x"}function a0(e){return r0(_n(e))}function z5(e,t,r){r===void 0&&(r=!1);const n=dl(e),a=a0(e),i=n0(a);let o=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=Pf(o)),[o,Pf(o)]}function U5(e){const t=Pf(e);return[$v(e),t,$v(t)]}function $v(e){return e.replace(/start|end/g,t=>F5[t])}const pS=["left","right"],hS=["right","left"],W5=["top","bottom"],q5=["bottom","top"];function H5(e,t,r){switch(e){case"top":case"bottom":return r?t?hS:pS:t?pS:hS;case"left":case"right":return t?W5:q5;default:return[]}}function K5(e,t,r,n){const a=dl(e);let i=H5(ka(e),r==="start",n);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map($v)))),i}function Pf(e){return e.replace(/left|right|bottom|top/g,t=>$5[t])}function V5(e){return{top:0,right:0,bottom:0,left:0,...e}}function YN(e){return typeof e!="number"?V5(e):{top:e,right:e,bottom:e,left:e}}function kf(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function mS(e,t,r){let{reference:n,floating:a}=e;const i=_n(t),o=a0(t),s=n0(o),l=ka(t),c=i==="y",u=n.x+n.width/2-a.width/2,f=n.y+n.height/2-a.height/2,p=n[s]/2-a[s]/2;let h;switch(l){case"top":h={x:u,y:n.y-a.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:f};break;case"left":h={x:n.x-a.width,y:f};break;default:h={x:n.x,y:n.y}}switch(dl(t)){case"start":h[o]-=p*(r&&c?-1:1);break;case"end":h[o]+=p*(r&&c?-1:1);break}return h}const Y5=async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:i=[],platform:o}=r,s=i.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:f}=mS(c,n,l),p=n,h={},v=0;for(let g=0;g({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:i,platform:o,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Pa(e,t)||{};if(c==null)return{};const f=YN(u),p={x:r,y:n},h=a0(a),v=n0(h),g=await o.getDimensions(c),x=h==="y",b=x?"top":"left",y=x?"bottom":"right",w=x?"clientHeight":"clientWidth",S=i.reference[v]+i.reference[h]-p[h]-i.floating[v],E=p[h]-i.reference[h],j=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let P=j?j[w]:0;(!P||!await(o.isElement==null?void 0:o.isElement(j)))&&(P=s.floating[w]||i.floating[v]);const k=S/2-E/2,N=P/2-g[v]/2-1,O=Ei(f[b],N),A=Ei(f[y],N),T=O,L=P-g[v]-A,I=P/2-g[v]/2+k,q=Lv(T,I,L),B=!l.arrow&&dl(a)!=null&&I!==q&&i.reference[v]/2-(II<=0)){var A,T;const I=(((A=i.flip)==null?void 0:A.index)||0)+1,q=P[I];if(q&&(!(f==="alignment"?y!==_n(q):!1)||O.every(_=>_n(_.placement)===y?_.overflows[0]>0:!0)))return{data:{index:I,overflows:O},reset:{placement:q}};let B=(T=O.filter(U=>U.overflows[0]<=0).sort((U,_)=>U.overflows[1]-_.overflows[1])[0])==null?void 0:T.placement;if(!B)switch(h){case"bestFit":{var L;const U=(L=O.filter(_=>{if(j){const $=_n(_.placement);return $===y||$==="y"}return!0}).map(_=>[_.placement,_.overflows.filter($=>$>0).reduce(($,W)=>$+W,0)]).sort((_,$)=>_[1]-$[1])[0])==null?void 0:L[0];U&&(B=U);break}case"initialPlacement":B=s;break}if(a!==B)return{reset:{placement:B}}}return{}}}};function gS(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vS(e){return L5.some(t=>e[t]>=0)}const X5=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...a}=Pa(e,t);switch(n){case"referenceHidden":{const i=await Tc(t,{...a,elementContext:"reference"}),o=gS(i,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:vS(o)}}}case"escaped":{const i=await Tc(t,{...a,altBoundary:!0}),o=gS(i,r.floating);return{data:{escapedOffsets:o,escaped:vS(o)}}}default:return{}}}}},GN=new Set(["left","top"]);async function Z5(e,t){const{placement:r,platform:n,elements:a}=e,i=await(n.isRTL==null?void 0:n.isRTL(a.floating)),o=ka(r),s=dl(r),l=_n(r)==="y",c=GN.has(o)?-1:1,u=i&&l?-1:1,f=Pa(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*u,y:p*c}:{x:p*c,y:h*u}}const J5=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:i,placement:o,middlewareData:s}=t,l=await Z5(t,e);return o===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:a+l.x,y:i+l.y,data:{...l,placement:o}}}}},eB=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:s={fn:x=>{let{x:b,y}=x;return{x:b,y}}},...l}=Pa(e,t),c={x:r,y:n},u=await Tc(t,l),f=_n(ka(a)),p=r0(f);let h=c[p],v=c[f];if(i){const x=p==="y"?"top":"left",b=p==="y"?"bottom":"right",y=h+u[x],w=h-u[b];h=Lv(y,h,w)}if(o){const x=f==="y"?"top":"left",b=f==="y"?"bottom":"right",y=v+u[x],w=v-u[b];v=Lv(y,v,w)}const g=s.fn({...t,[p]:h,[f]:v});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[p]:i,[f]:o}}}}}},tB=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:i,middlewareData:o}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Pa(e,t),u={x:r,y:n},f=_n(a),p=r0(f);let h=u[p],v=u[f];const g=Pa(s,t),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const w=p==="y"?"height":"width",S=i.reference[p]-i.floating[w]+x.mainAxis,E=i.reference[p]+i.reference[w]-x.mainAxis;hE&&(h=E)}if(c){var b,y;const w=p==="y"?"width":"height",S=GN.has(ka(a)),E=i.reference[f]-i.floating[w]+(S&&((b=o.offset)==null?void 0:b[f])||0)+(S?0:x.crossAxis),j=i.reference[f]+i.reference[w]+(S?0:((y=o.offset)==null?void 0:y[f])||0)-(S?x.crossAxis:0);vj&&(v=j)}return{[p]:h,[f]:v}}}},rB=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:i,platform:o,elements:s}=t,{apply:l=()=>{},...c}=Pa(e,t),u=await Tc(t,c),f=ka(a),p=dl(a),h=_n(a)==="y",{width:v,height:g}=i.floating;let x,b;f==="top"||f==="bottom"?(x=f,b=p===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(b=f,x=p==="end"?"top":"bottom");const y=g-u.top-u.bottom,w=v-u.left-u.right,S=Ei(g-u[x],y),E=Ei(v-u[b],w),j=!t.middlewareData.shift;let P=S,k=E;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(k=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(P=y),j&&!p){const O=br(u.left,0),A=br(u.right,0),T=br(u.top,0),L=br(u.bottom,0);h?k=v-2*(O!==0||A!==0?O+A:br(u.left,u.right)):P=g-2*(T!==0||L!==0?T+L:br(u.top,u.bottom))}await l({...t,availableWidth:k,availableHeight:P});const N=await o.getDimensions(s.floating);return v!==N.width||g!==N.height?{reset:{rects:!0}}:{}}}};function Vp(){return typeof window<"u"}function fl(e){return QN(e)?(e.nodeName||"").toLowerCase():"#document"}function Pr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Vn(e){var t;return(t=(QN(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function QN(e){return Vp()?e instanceof Node||e instanceof Pr(e).Node:!1}function gn(e){return Vp()?e instanceof Element||e instanceof Pr(e).Element:!1}function Bn(e){return Vp()?e instanceof HTMLElement||e instanceof Pr(e).HTMLElement:!1}function yS(e){return!Vp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Pr(e).ShadowRoot}const nB=new Set(["inline","contents"]);function lu(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=vn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!nB.has(a)}const aB=new Set(["table","td","th"]);function iB(e){return aB.has(fl(e))}const oB=[":popover-open",":modal"];function Yp(e){return oB.some(t=>{try{return e.matches(t)}catch{return!1}})}const sB=["transform","translate","scale","rotate","perspective"],lB=["transform","translate","scale","rotate","perspective","filter"],cB=["paint","layout","strict","content"];function i0(e){const t=o0(),r=gn(e)?vn(e):e;return sB.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||lB.some(n=>(r.willChange||"").includes(n))||cB.some(n=>(r.contain||"").includes(n))}function uB(e){let t=ji(e);for(;Bn(t)&&!Us(t);){if(i0(t))return t;if(Yp(t))return null;t=ji(t)}return null}function o0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const dB=new Set(["html","body","#document"]);function Us(e){return dB.has(fl(e))}function vn(e){return Pr(e).getComputedStyle(e)}function Gp(e){return gn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ji(e){if(fl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||yS(e)&&e.host||Vn(e);return yS(t)?t.host:t}function XN(e){const t=ji(e);return Us(t)?e.ownerDocument?e.ownerDocument.body:e.body:Bn(t)&&lu(t)?t:XN(t)}function _c(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const a=XN(e),i=a===((n=e.ownerDocument)==null?void 0:n.body),o=Pr(a);if(i){const s=Fv(o);return t.concat(o,o.visualViewport||[],lu(a)?a:[],s&&r?_c(s):[])}return t.concat(a,_c(a,[],r))}function Fv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ZN(e){const t=vn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=Bn(e),i=a?e.offsetWidth:r,o=a?e.offsetHeight:n,s=jf(r)!==i||jf(n)!==o;return s&&(r=i,n=o),{width:r,height:n,$:s}}function s0(e){return gn(e)?e:e.contextElement}function ys(e){const t=s0(e);if(!Bn(t))return Ln(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:i}=ZN(t);let o=(i?jf(r.width):r.width)/n,s=(i?jf(r.height):r.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const fB=Ln(0);function JN(e){const t=Pr(e);return!o0()||!t.visualViewport?fB:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function pB(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Pr(e)?!1:t}function jo(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const a=e.getBoundingClientRect(),i=s0(e);let o=Ln(1);t&&(n?gn(n)&&(o=ys(n)):o=ys(e));const s=pB(i,r,n)?JN(i):Ln(0);let l=(a.left+s.x)/o.x,c=(a.top+s.y)/o.y,u=a.width/o.x,f=a.height/o.y;if(i){const p=Pr(i),h=n&&gn(n)?Pr(n):n;let v=p,g=Fv(v);for(;g&&n&&h!==v;){const x=ys(g),b=g.getBoundingClientRect(),y=vn(g),w=b.left+(g.clientLeft+parseFloat(y.paddingLeft))*x.x,S=b.top+(g.clientTop+parseFloat(y.paddingTop))*x.y;l*=x.x,c*=x.y,u*=x.x,f*=x.y,l+=w,c+=S,v=Pr(g),g=Fv(v)}}return kf({width:u,height:f,x:l,y:c})}function Qp(e,t){const r=Gp(e).scrollLeft;return t?t.left+r:jo(Vn(e)).left+r}function eO(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Qp(e,r),a=r.top+t.scrollTop;return{x:n,y:a}}function hB(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const i=a==="fixed",o=Vn(n),s=t?Yp(t.floating):!1;if(n===o||s&&i)return r;let l={scrollLeft:0,scrollTop:0},c=Ln(1);const u=Ln(0),f=Bn(n);if((f||!f&&!i)&&((fl(n)!=="body"||lu(o))&&(l=Gp(n)),Bn(n))){const h=jo(n);c=ys(n),u.x=h.x+n.clientLeft,u.y=h.y+n.clientTop}const p=o&&!f&&!i?eO(o,l):Ln(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:r.y*c.y-l.scrollTop*c.y+u.y+p.y}}function mB(e){return Array.from(e.getClientRects())}function gB(e){const t=Vn(e),r=Gp(e),n=e.ownerDocument.body,a=br(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=br(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+Qp(e);const s=-r.scrollTop;return vn(n).direction==="rtl"&&(o+=br(t.clientWidth,n.clientWidth)-a),{width:a,height:i,x:o,y:s}}const xS=25;function vB(e,t){const r=Pr(e),n=Vn(e),a=r.visualViewport;let i=n.clientWidth,o=n.clientHeight,s=0,l=0;if(a){i=a.width,o=a.height;const u=o0();(!u||u&&t==="fixed")&&(s=a.offsetLeft,l=a.offsetTop)}const c=Qp(n);if(c<=0){const u=n.ownerDocument,f=u.body,p=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,v=Math.abs(n.clientWidth-f.clientWidth-h);v<=xS&&(i-=v)}else c<=xS&&(i+=c);return{width:i,height:o,x:s,y:l}}const yB=new Set(["absolute","fixed"]);function xB(e,t){const r=jo(e,!0,t==="fixed"),n=r.top+e.clientTop,a=r.left+e.clientLeft,i=Bn(e)?ys(e):Ln(1),o=e.clientWidth*i.x,s=e.clientHeight*i.y,l=a*i.x,c=n*i.y;return{width:o,height:s,x:l,y:c}}function bS(e,t,r){let n;if(t==="viewport")n=vB(e,r);else if(t==="document")n=gB(Vn(e));else if(gn(t))n=xB(t,r);else{const a=JN(e);n={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return kf(n)}function tO(e,t){const r=ji(e);return r===t||!gn(r)||Us(r)?!1:vn(r).position==="fixed"||tO(r,t)}function bB(e,t){const r=t.get(e);if(r)return r;let n=_c(e,[],!1).filter(s=>gn(s)&&fl(s)!=="body"),a=null;const i=vn(e).position==="fixed";let o=i?ji(e):e;for(;gn(o)&&!Us(o);){const s=vn(o),l=i0(o);!l&&s.position==="fixed"&&(a=null),(i?!l&&!a:!l&&s.position==="static"&&!!a&&yB.has(a.position)||lu(o)&&!l&&tO(e,o))?n=n.filter(u=>u!==o):a=s,o=ji(o)}return t.set(e,n),n}function wB(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const o=[...r==="clippingAncestors"?Yp(t)?[]:bB(t,this._c):[].concat(r),n],s=o[0],l=o.reduce((c,u)=>{const f=bS(t,u,a);return c.top=br(f.top,c.top),c.right=Ei(f.right,c.right),c.bottom=Ei(f.bottom,c.bottom),c.left=br(f.left,c.left),c},bS(t,s,a));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function SB(e){const{width:t,height:r}=ZN(e);return{width:t,height:r}}function EB(e,t,r){const n=Bn(t),a=Vn(t),i=r==="fixed",o=jo(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=Ln(0);function c(){l.x=Qp(a)}if(n||!n&&!i)if((fl(t)!=="body"||lu(a))&&(s=Gp(t)),n){const h=jo(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else a&&c();i&&!n&&a&&c();const u=a&&!n&&!i?eO(a,s):Ln(0),f=o.left+s.scrollLeft-l.x-u.x,p=o.top+s.scrollTop-l.y-u.y;return{x:f,y:p,width:o.width,height:o.height}}function Km(e){return vn(e).position==="static"}function wS(e,t){if(!Bn(e)||vn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Vn(e)===r&&(r=r.ownerDocument.body),r}function rO(e,t){const r=Pr(e);if(Yp(e))return r;if(!Bn(e)){let a=ji(e);for(;a&&!Us(a);){if(gn(a)&&!Km(a))return a;a=ji(a)}return r}let n=wS(e,t);for(;n&&iB(n)&&Km(n);)n=wS(n,t);return n&&Us(n)&&Km(n)&&!i0(n)?r:n||uB(e)||r}const jB=async function(e){const t=this.getOffsetParent||rO,r=this.getDimensions,n=await r(e.floating);return{reference:EB(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function PB(e){return vn(e).direction==="rtl"}const kB={convertOffsetParentRelativeRectToViewportRelativeRect:hB,getDocumentElement:Vn,getClippingRect:wB,getOffsetParent:rO,getElementRects:jB,getClientRects:mB,getDimensions:SB,getScale:ys,isElement:gn,isRTL:PB};function nO(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function CB(e,t){let r=null,n;const a=Vn(e);function i(){var s;clearTimeout(n),(s=r)==null||s.disconnect(),r=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:f,width:p,height:h}=c;if(s||t(),!p||!h)return;const v=ad(f),g=ad(a.clientWidth-(u+p)),x=ad(a.clientHeight-(f+h)),b=ad(u),w={rootMargin:-v+"px "+-g+"px "+-x+"px "+-b+"px",threshold:br(0,Ei(1,l))||1};let S=!0;function E(j){const P=j[0].intersectionRatio;if(P!==l){if(!S)return o();P?o(!1,P):n=setTimeout(()=>{o(!1,1e-7)},1e3)}P===1&&!nO(c,e.getBoundingClientRect())&&o(),S=!1}try{r=new IntersectionObserver(E,{...w,root:a.ownerDocument})}catch{r=new IntersectionObserver(E,w)}r.observe(e)}return o(!0),i}function NB(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=s0(e),u=a||i?[...c?_c(c):[],..._c(t)]:[];u.forEach(b=>{a&&b.addEventListener("scroll",r,{passive:!0}),i&&b.addEventListener("resize",r)});const f=c&&s?CB(c,r):null;let p=-1,h=null;o&&(h=new ResizeObserver(b=>{let[y]=b;y&&y.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),r()}),c&&!l&&h.observe(c),h.observe(t));let v,g=l?jo(e):null;l&&x();function x(){const b=jo(e);g&&!nO(g,b)&&r(),g=b,v=requestAnimationFrame(x)}return r(),()=>{var b;u.forEach(y=>{a&&y.removeEventListener("scroll",r),i&&y.removeEventListener("resize",r)}),f==null||f(),(b=h)==null||b.disconnect(),h=null,l&&cancelAnimationFrame(v)}}const OB=J5,AB=eB,TB=Q5,_B=rB,RB=X5,SS=G5,DB=tB,MB=(e,t,r)=>{const n=new Map,a={platform:kB,...r},i={...a.platform,_c:n};return Y5(e,t,{...a,platform:i})};var IB=typeof document<"u",LB=function(){},Wd=IB?m.useLayoutEffect:LB;function Cf(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 r,n,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Cf(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;n--!==0;){const i=a[n];if(!(i==="_owner"&&e.$$typeof)&&!Cf(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function aO(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ES(e,t){const r=aO(e);return Math.round(t*r)/r}function Vm(e){const t=m.useRef(e);return Wd(()=>{t.current=e}),t}function $B(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:i,floating:o}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,f]=m.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=m.useState(n);Cf(p,n)||h(n);const[v,g]=m.useState(null),[x,b]=m.useState(null),y=m.useCallback(_=>{_!==j.current&&(j.current=_,g(_))},[]),w=m.useCallback(_=>{_!==P.current&&(P.current=_,b(_))},[]),S=i||v,E=o||x,j=m.useRef(null),P=m.useRef(null),k=m.useRef(u),N=l!=null,O=Vm(l),A=Vm(a),T=Vm(c),L=m.useCallback(()=>{if(!j.current||!P.current)return;const _={placement:t,strategy:r,middleware:p};A.current&&(_.platform=A.current),MB(j.current,P.current,_).then($=>{const W={...$,isPositioned:T.current!==!1};I.current&&!Cf(k.current,W)&&(k.current=W,Ti.flushSync(()=>{f(W)}))})},[p,t,r,A,T]);Wd(()=>{c===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,f(_=>({..._,isPositioned:!1})))},[c]);const I=m.useRef(!1);Wd(()=>(I.current=!0,()=>{I.current=!1}),[]),Wd(()=>{if(S&&(j.current=S),E&&(P.current=E),S&&E){if(O.current)return O.current(S,E,L);L()}},[S,E,L,O,N]);const q=m.useMemo(()=>({reference:j,floating:P,setReference:y,setFloating:w}),[y,w]),B=m.useMemo(()=>({reference:S,floating:E}),[S,E]),U=m.useMemo(()=>{const _={position:r,left:0,top:0};if(!B.floating)return _;const $=ES(B.floating,u.x),W=ES(B.floating,u.y);return s?{..._,transform:"translate("+$+"px, "+W+"px)",...aO(B.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:$,top:W}},[r,s,B.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:L,refs:q,elements:B,floatingStyles:U}),[u,L,q,B,U])}const FB=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:a}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?SS({element:n.current,padding:a}).fn(r):{}:n?SS({element:n,padding:a}).fn(r):{}}}},BB=(e,t)=>({...OB(e),options:[e,t]}),zB=(e,t)=>({...AB(e),options:[e,t]}),UB=(e,t)=>({...DB(e),options:[e,t]}),WB=(e,t)=>({...TB(e),options:[e,t]}),qB=(e,t)=>({..._B(e),options:[e,t]}),HB=(e,t)=>({...RB(e),options:[e,t]}),KB=(e,t)=>({...FB(e),options:[e,t]});var VB="Arrow",iO=m.forwardRef((e,t)=>{const{children:r,width:n=10,height:a=5,...i}=e;return d.jsx(se.svg,{...i,ref:t,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});iO.displayName=VB;var YB=iO;function oO(e){const[t,r]=m.useState(void 0);return _t(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,s;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;o=c.inlineSize,s=c.blockSize}else o=e.offsetWidth,s=e.offsetHeight;r({width:o,height:s})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var l0="Popper",[sO,Xp]=Kn(l0),[GB,lO]=sO(l0),cO=e=>{const{__scopePopper:t,children:r}=e,[n,a]=m.useState(null);return d.jsx(GB,{scope:t,anchor:n,onAnchorChange:a,children:r})};cO.displayName=l0;var uO="PopperAnchor",dO=m.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...a}=e,i=lO(uO,r),o=m.useRef(null),s=be(t,o),l=m.useRef(null);return m.useEffect(()=>{const c=l.current;l.current=(n==null?void 0:n.current)||o.current,c!==l.current&&i.onAnchorChange(l.current)}),n?null:d.jsx(se.div,{...a,ref:s})});dO.displayName=uO;var c0="PopperContent",[QB,XB]=sO(c0),fO=m.forwardRef((e,t)=>{var ee,Ee,z,Q,X,D;const{__scopePopper:r,side:n="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:v,...g}=e,x=lO(c0,r),[b,y]=m.useState(null),w=be(t,Ne=>y(Ne)),[S,E]=m.useState(null),j=oO(S),P=(j==null?void 0:j.width)??0,k=(j==null?void 0:j.height)??0,N=n+(i!=="center"?"-"+i:""),O=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},A=Array.isArray(c)?c:[c],T=A.length>0,L={padding:O,boundary:A.filter(JB),altBoundary:T},{refs:I,floatingStyles:q,placement:B,isPositioned:U,middlewareData:_}=$B({strategy:"fixed",placement:N,whileElementsMounted:(...Ne)=>NB(...Ne,{animationFrame:h==="always"}),elements:{reference:x.anchor},middleware:[BB({mainAxis:a+k,alignmentAxis:o}),l&&zB({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?UB():void 0,...L}),l&&WB({...L}),qB({...L,apply:({elements:Ne,rects:de,availableWidth:st,availableHeight:lt})=>{const{width:hr,height:Du}=de.reference,Mu=Ne.floating.style;Mu.setProperty("--radix-popper-available-width",`${st}px`),Mu.setProperty("--radix-popper-available-height",`${lt}px`),Mu.setProperty("--radix-popper-anchor-width",`${hr}px`),Mu.setProperty("--radix-popper-anchor-height",`${Du}px`)}}),S&&KB({element:S,padding:s}),ez({arrowWidth:P,arrowHeight:k}),p&&HB({strategy:"referenceHidden",...L})]}),[$,W]=mO(B),re=Qt(v);_t(()=>{U&&(re==null||re())},[U,re]);const K=(ee=_.arrow)==null?void 0:ee.x,ot=(Ee=_.arrow)==null?void 0:Ee.y,ze=((z=_.arrow)==null?void 0:z.centerOffset)!==0,[Te,Xe]=m.useState();return _t(()=>{b&&Xe(window.getComputedStyle(b).zIndex)},[b]),d.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:U?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Te,"--radix-popper-transform-origin":[(Q=_.transformOrigin)==null?void 0:Q.x,(X=_.transformOrigin)==null?void 0:X.y].join(" "),...((D=_.hide)==null?void 0:D.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(QB,{scope:r,placedSide:$,onArrowChange:E,arrowX:K,arrowY:ot,shouldHideArrow:ze,children:d.jsx(se.div,{"data-side":$,"data-align":W,...g,ref:w,style:{...g.style,animation:U?void 0:"none"}})})})});fO.displayName=c0;var pO="PopperArrow",ZB={top:"bottom",right:"left",bottom:"top",left:"right"},hO=m.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,i=XB(pO,n),o=ZB[i.placedSide];return d.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:d.jsx(YB,{...a,ref:r,style:{...a.style,display:"block"}})})});hO.displayName=pO;function JB(e){return e!==null}var ez=e=>({name:"transformOrigin",options:e,fn(t){var x,b,y;const{placement:r,rects:n,middlewareData:a}=t,o=((x=a.arrow)==null?void 0:x.centerOffset)!==0,s=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[c,u]=mO(r),f={start:"0%",center:"50%",end:"100%"}[u],p=(((b=a.arrow)==null?void 0:b.x)??0)+s/2,h=(((y=a.arrow)==null?void 0:y.y)??0)+l/2;let v="",g="";return c==="bottom"?(v=o?f:`${p}px`,g=`${-l}px`):c==="top"?(v=o?f:`${p}px`,g=`${n.floating.height+l}px`):c==="right"?(v=`${-l}px`,g=o?f:`${h}px`):c==="left"&&(v=`${n.floating.width+l}px`,g=o?f:`${h}px`),{data:{x:v,y:g}}}});function mO(e){const[t,r="center"]=e.split("-");return[t,r]}var gO=cO,vO=dO,yO=fO,xO=hO,tz="Portal",Zp=m.forwardRef((e,t)=>{var s;const{container:r,...n}=e,[a,i]=m.useState(!1);_t(()=>i(!0),[]);const o=r||a&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return o?U$.createPortal(d.jsx(se.div,{...n,ref:t}),o):null});Zp.displayName=tz;var rz=Yy[" useInsertionEffect ".trim().toString()]||_t;function Po({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[a,i,o]=nz({defaultProp:t,onChange:r}),s=e!==void 0,l=s?e:a;{const u=m.useRef(e!==void 0);m.useEffect(()=>{const f=u.current;f!==s&&console.warn(`${n} is changing from ${f?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,n])}const c=m.useCallback(u=>{var f;if(s){const p=az(u)?u(e):u;p!==e&&((f=o.current)==null||f.call(o,p))}else i(u)},[s,e,i,o]);return[l,c]}function nz({defaultProp:e,onChange:t}){const[r,n]=m.useState(e),a=m.useRef(r),i=m.useRef(t);return rz(()=>{i.current=t},[t]),m.useEffect(()=>{var o;a.current!==r&&((o=i.current)==null||o.call(i,r),a.current=r)},[r,a]),[r,n,i]}function az(e){return typeof e=="function"}function bO(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var wO=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),iz="VisuallyHidden",SO=m.forwardRef((e,t)=>d.jsx(se.span,{...e,ref:t,style:{...wO,...e.style}}));SO.displayName=iz;var oz=SO,sz=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Vo=new WeakMap,id=new WeakMap,od={},Ym=0,EO=function(e){return e&&(e.host||EO(e.parentNode))},lz=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=EO(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},cz=function(e,t,r,n){var a=lz(t,Array.isArray(e)?e:[e]);od[r]||(od[r]=new WeakMap);var i=od[r],o=[],s=new Set,l=new Set(a),c=function(f){!f||s.has(f)||(s.add(f),c(f.parentNode))};a.forEach(c);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(p){if(s.has(p))u(p);else try{var h=p.getAttribute(n),v=h!==null&&h!=="false",g=(Vo.get(p)||0)+1,x=(i.get(p)||0)+1;Vo.set(p,g),i.set(p,x),o.push(p),g===1&&v&&id.set(p,!0),x===1&&p.setAttribute(r,"true"),v||p.setAttribute(n,"true")}catch(b){console.error("aria-hidden: cannot operate on ",p,b)}})};return u(t),s.clear(),Ym++,function(){o.forEach(function(f){var p=Vo.get(f)-1,h=i.get(f)-1;Vo.set(f,p),i.set(f,h),p||(id.has(f)||f.removeAttribute(n),id.delete(f)),h||f.removeAttribute(r)}),Ym--,Ym||(Vo=new WeakMap,Vo=new WeakMap,id=new WeakMap,od={})}},jO=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=sz(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),cz(n,a,r,"aria-hidden")):function(){return null}},An=function(){return An=Object.assign||function(t){for(var r,n=1,a=arguments.length;n"u")return kz;var t=Cz(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Oz=NO(),xs="data-scroll-locked",Az=function(e,t,r,n){var a=e.left,i=e.top,o=e.right,s=e.gap;return r===void 0&&(r="margin"),` + */const e5=xe("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]);class t5{constructor(){Iu(this,"baseUrl","/__radar/api")}async getRequests(t){const r=new URLSearchParams;return t!=null&&t.limit&&r.append("limit",t.limit.toString()),t!=null&&t.offset&&r.append("offset",t.offset.toString()),t!=null&&t.status_code&&r.append("status_code",t.status_code.toString()),t!=null&&t.method&&r.append("method",t.method),t!=null&&t.search&&r.append("search",t.search),t!=null&&t.start_time&&r.append("start_time",t.start_time),t!=null&&t.end_time&&r.append("end_time",t.end_time),(await fetch(`${this.baseUrl}/requests?${r}`)).json()}async getRequestDetail(t){return(await fetch(`${this.baseUrl}/requests/${t}`)).json()}async getRequestAsCurl(t){return(await fetch(`${this.baseUrl}/requests/${t}/curl`)).json()}async replayRequest(t,r){const n=await fetch(`${this.baseUrl}/requests/${t}/replay`,{method:"POST",headers:{"Content-Type":"application/json"},body:r?JSON.stringify(r):null});if(!n.ok){const a=await n.json();throw new Error(a.detail||"Replay failed")}return n.json()}async getQueries(t){const r=new URLSearchParams;return t!=null&&t.limit&&r.append("limit",t.limit.toString()),t!=null&&t.offset&&r.append("offset",t.offset.toString()),t!=null&&t.slow_only&&r.append("slow_only",t.slow_only.toString()),t!=null&&t.slow_threshold&&r.append("slow_threshold",t.slow_threshold.toString()),t!=null&&t.search&&r.append("search",t.search),(await fetch(`${this.baseUrl}/queries?${r}`)).json()}async getExceptions(t){const r=new URLSearchParams;return t!=null&&t.limit&&r.append("limit",t.limit.toString()),t!=null&&t.offset&&r.append("offset",t.offset.toString()),t!=null&&t.exception_type&&r.append("exception_type",t.exception_type),(await fetch(`${this.baseUrl}/exceptions?${r}`)).json()}async getStats(t=1){return(await fetch(`${this.baseUrl}/stats?hours=${t}`)).json()}async clearData(t){const r=t?`?older_than_hours=${t}`:"";return(await fetch(`${this.baseUrl}/clear${r}`,{method:"DELETE"})).json()}async getTraces(t){const r=new URLSearchParams;return t!=null&&t.limit&&r.append("limit",t.limit.toString()),t!=null&&t.offset&&r.append("offset",t.offset.toString()),t!=null&&t.status&&r.append("status",t.status),t!=null&&t.service_name&&r.append("service_name",t.service_name),t!=null&&t.min_duration_ms&&r.append("min_duration_ms",t.min_duration_ms.toString()),t!=null&&t.hours&&r.append("hours",t.hours.toString()),(await fetch(`${this.baseUrl}/traces?${r}`)).json()}async getTraceDetail(t){return(await fetch(`${this.baseUrl}/traces/${t}`)).json()}async getTraceWaterfall(t){return(await fetch(`${this.baseUrl}/traces/${t}/waterfall`)).json()}async getBackgroundTasks(t){const r=new URLSearchParams;t!=null&&t.limit&&r.append("limit",t.limit.toString()),t!=null&&t.offset&&r.append("offset",t.offset.toString()),t!=null&&t.status&&r.append("status",t.status),t!=null&&t.request_id&&r.append("request_id",t.request_id);const n=await fetch(`${this.baseUrl}/background-tasks?${r}`);if(!n.ok)throw new Error(`Failed to fetch background tasks: ${n.statusText}`);return n.json()}}const Me=new t5,r5={nav:{dashboard:"Dashboard",requests:"Requests",tracking:"Tracking",database:"Database",exceptions:"Exceptions",performance:"Performance",backgroundTasks:"Background Tasks",settings:"Settings"},sidebar:{navigation:"Navigation",system:"System",collapse:"Collapse sidebar",expand:"Expand sidebar"},pages:{dashboard:{title:"Dashboard",description:"Real-time monitoring for your FastAPI application"},requests:{title:"Requests",description:"Monitor HTTP requests and responses"},tracing:{title:"Tracing",description:"View distributed traces and waterfall diagrams for your services",tracesCardTitle:"Traces",tracesCardDescription:"Browse all distributed tracing data and open detailed waterfall views",noTraces:"No trace data available",viewTrace:"View trace"},database:{title:"Database",description:"Database query monitoring and analysis",cardDescription:"All database queries executed by your application"},exceptions:{title:"Exceptions",description:"Track and analyze application exceptions"},performance:{title:"Performance",description:"Application performance metrics and analysis"},backgroundTasks:{title:"Background Tasks",description:"Monitor and track background tasks executed in your application"},settings:{title:"Settings",description:"Manage your dashboard preferences and data"}},backgroundTasks:{noTasks:"No background tasks found",failedToLoad:"Failed to load background tasks",started:"Started",duration:"Duration",requestId:"Request ID",created:"Created",status:{completed:"Completed",failed:"Failed",running:"Running",pending:"Pending"}},common:{loading:"Loading...",error:"Error",noData:"No data available",refresh:"Refresh",clear:"Clear",save:"Save",cancel:"Cancel",confirm:"Confirm",delete:"Delete",edit:"Edit",view:"View",search:"Search",filter:"Filter",export:"Export",import:"Import",close:"Close",open:"Open",back:"Back",next:"Next",previous:"Previous",all:"All",none:"None",yes:"Yes",no:"No",viewAll:"View all",copy:"Copy",copied:"Copied!"},timeRange:{lastHour:"Last Hour",last24Hours:"Last 24 Hours",last7Days:"Last 7 Days",last30Days:"Last 30 Days"},metrics:{totalRequests:"Total Requests",avgResponseTime:"Avg Response Time",errorRate:"Error Rate",successRate:"Success Rate",slowQueries:"Slow Queries",exceptions:"Exceptions",requestsPerMinute:"Requests/Minute",databaseQueries:"Database Queries",responseTime:"Response Time",statusCode:"Status Code",method:"Method",endpoint:"Endpoint",duration:"Duration",timestamp:"Timestamp",success:"Success",error:"Error",p50:"P50 (Median)"},settings:{appearance:{title:"Appearance",description:"Customize the look and feel of your dashboard",theme:"Theme",themeDescription:"Choose between light and dark mode",light:"Light",dark:"Dark",auto:"Auto"},database:{title:"Database Status",description:"Current database connection and performance",status:"Status",connected:"Connected",disconnected:"Disconnected",queries:"Queries",avgQueryTime:"Avg Query Time"},performance:{title:"Performance Overview",description:"Current application performance metrics",avgResponseTime:"Avg Response Time",requestsPerMinute:"Requests/Minute"},dataManagement:{title:"Data Management",description:"Manage your captured monitoring data",quickActions:"Quick Actions",quickActionsDescription:"Clear captured data to free up space or start fresh",clear1Day:"Clear data older than 1 day",clear7Days:"Clear data older than 7 days",clear30Days:"Clear data older than 30 days",dangerZone:"Danger Zone",dangerZoneDescription:"This action cannot be undone",clearAll:"Clear All Data",loading:"Loading statistics...",totalRequests:"Total Requests",totalQueries:"Total Queries",totalExceptions:"Total Exceptions",slowQueries:"Slow Queries",avgResponseTime:"Avg Response Time",requestsPerMinute:"Requests/Minute"},about:{title:"About FastAPI Radar",description:"Real-time monitoring dashboard for FastAPI applications",content:"FastAPI Radar provides comprehensive monitoring for your FastAPI applications, including request tracking, database query analysis, and exception monitoring.",features:"Features",feature1:"Real-time request monitoring",feature2:"Database query performance tracking",feature3:"Exception and error tracking",feature4:"Performance metrics and analytics",feature5:"Dark/Light theme support",version:"Version",dashboard:"Dashboard",connected:"Connected"},language:{title:"Language",description:"Choose your preferred language",current:"Current Language",english:"English",chinese:"中文"}},requests:{filters:{status:"Status",method:"Method",searchPlaceholder:"Search by path...",description:"Filter and search through request logs",timeRange:"Time Range",apply:"Apply Filters"},tabs:{all:"All Requests",recent:"Recent",slow:"Slow",errors:"Errors",successful:"Successful",failed:"Failed"},statusFilters:{all:"All status codes",success:"2xx Success",errors:"All Errors",clientErrors:"4xx Client Error",serverErrors:"5xx Server Error",redirect:"3xx Redirect"},methodFilters:{all:"All methods",get:"GET",post:"POST",put:"PUT",delete:"DELETE",patch:"PATCH"},timeRangeFilters:{all:"All Time",lastHour:"Last Hour",last24Hours:"Last 24 Hours",last7Days:"Last 7 Days"},descriptions:{all:"Complete list of all HTTP requests",successful:"Requests that completed successfully (2xx status codes)",failed:"Requests that resulted in errors (4xx and 5xx status codes)",slow:"Requests that took longer than 500ms"},empty:{all:"No requests captured yet",successful:"No successful requests",failed:"No failed requests",slow:"No slow requests"}},exceptions:{noExceptions:"No exceptions found",recentExceptions:"Recent Exceptions",exceptionType:"Exception Type",message:"Message",traceback:"Traceback",clickToView:"Click to view full traceback"},performance:{overview:"Performance Overview",responseTimeChart:"Response Time Trend",endpointPerformance:"Endpoint Performance",slowestEndpoints:"Slowest Endpoints",requestDistribution:"Request Distribution",excellent:"Excellent",acceptable:"Acceptable",needsAttention:"Needs Attention",errorAnalysis:"Error Analysis",average:"Average",throughput:"Throughput",requestsPerSec:"requests/sec",systemStatus:"System Status",queryPerformance:"Query Performance",responseTimeDescription:"Average response times over time",queryActivity:"Query Activity",queryActivityDescription:"Database query count per request",topEndpoints:"Top Endpoints",avgResponseByEndpoint:"Average response time by endpoint",recentRequests:"Recent Requests",healthScore:"Health Score",performanceSummary:"Performance Summary",realTimeMetrics:"Real-time metrics based on",avgResponse:"Avg Response",slowRequests:"Slow Requests",activeEndpoints:"Active Endpoints",performanceBreakdown:"Performance breakdown by API endpoint",responseTimesByEndpoint:"Response Times by Endpoint",p50Median:"P50 (Median)",p95:"P95",p99:"P99",totalQueries:"Total Queries",queriesPerRequest:"Queries/Request",slowQueries:"Slow Queries",avgQueryTime:"Avg Query Time",queryPerformanceScore:"Query Performance Score",queryStatistics:"Query Statistics",slowQueriesTitle:"Slow Queries",noSlowQueries:"No slow queries detected",errorAnalysisTitle:"Error Analysis",detailedMetrics:"Detailed Metrics",noEndpointData:"No endpoint data available",noExceptionsCaptured:"No exceptions captured",calls:"calls",errors:"errors",successRate:"Success rate"},database:{queries:"Database Queries",slowQueries:"Slow Queries",queryTime:"Query Time",queryType:"Query Type",affectedRows:"Affected Rows",searchPlaceholder:"Search queries...",showSlowOnly:"Show slow queries only",slowThreshold:"Slow threshold (ms)",noSlowQueries:"No slow queries found",noSlowQueriesShort:"All fast",noQueries:"No queries captured yet"},detailDrawer:{title:{request:"Request Details",query:"Query Details",exception:"Exception Details",trace:"Trace Details"},common:{pending:"pending",unknown:"Unknown"},request:{overview:{timestamp:"Timestamp",clientIp:"Client IP",requestId:"Request ID",url:"URL"},tabs:{headers:"Headers",body:"Body",response:"Response",queries:"Queries",errors:"Errors"},headers:{requestTitle:"Request Headers",responseTitle:"Response Headers",noRequestHeaders:"No headers",noResponseHeaders:"No response headers"},body:{queryParameters:"Query Parameters",requestTitle:"Request Body",noRequestBody:"No request body",responseTitle:"Response Body",noResponseBody:"No response body"},queries:{empty:"No queries executed",queryLabel:"Query",rows:"rows",parameters:"Parameters:"},errors:{empty:"No exceptions occurred"}},query:{placeholder:"Query details view"},exception:{placeholder:"Exception details view"},trace:{overview:{unknownOperation:"Unknown Operation",unknownService:"Unknown Service",traceId:"Trace ID",spanCount:"Span Count",startTime:"Start Time",duration:"Duration",tags:"Tags"},totalDuration:"Total duration",waterfall:{title:"Waterfall"},spans:{title:"Span Details",service:"Service",duration:"Duration",startOffset:"Start Offset",depth:"Depth",tags:"Tags:"}}},traceslist:{search:"Search by operation name...",all:"All statuses",success:"Success",error:"Error",lastHour:"Last Hour",last6Hours:"Last 6 Hours",last24Hours:"Last 24 Hours",lastWeek:"Last Week",refresh:"Refresh",failToLoadTraces:"Failed to load traces",anError:"There was an error loading the trace data.",tryAgain:"Try again",noTraces:"No traces found matching your criteria."},layout:{connected:"Connected"}},n5={nav:{dashboard:"仪表板",requests:"请求监控",tracking:"链路跟踪",database:"数据库",exceptions:"异常监控",performance:"性能分析",backgroundTasks:"后台任务",settings:"设置"},sidebar:{navigation:"导航",system:"系统",collapse:"收起侧边栏",expand:"展开侧边栏"},pages:{dashboard:{title:"仪表板",description:"FastAPI 应用程序实时监控"},requests:{title:"请求监控",description:"监控 HTTP 请求和响应"},tracing:{title:"链路跟踪",description:"查看服务的分布式追踪和瀑布流图",tracesCardTitle:"追踪记录",tracesCardDescription:"浏览所有链路追踪数据,点击查看详细的瀑布流图",noTraces:"暂无追踪数据",viewTrace:"查看追踪详情"},database:{title:"数据库监控",description:"数据库查询监控和分析",cardDescription:"您的应用程序执行的所有数据库查询"},exceptions:{title:"异常监控",description:"跟踪和分析应用程序异常"},performance:{title:"性能分析",description:"应用程序性能指标和分析"},backgroundTasks:{title:"后台任务",description:"监控和跟踪应用程序中执行的后台任务"},settings:{title:"设置",description:"管理仪表板偏好设置和数据"}},backgroundTasks:{noTasks:"未找到后台任务",failedToLoad:"加载后台任务失败",started:"开始时间",duration:"持续时间",requestId:"请求 ID",created:"创建时间",status:{completed:"已完成",failed:"失败",running:"运行中",pending:"等待中"}},common:{loading:"加载中...",error:"错误",noData:"暂无数据",refresh:"刷新",clear:"清除",save:"保存",cancel:"取消",confirm:"确认",delete:"删除",edit:"编辑",view:"查看",search:"搜索",filter:"筛选",export:"导出",import:"导入",close:"关闭",open:"打开",back:"返回",next:"下一页",previous:"上一页",all:"全部",none:"无",yes:"是",no:"否",viewAll:"查看全部",copy:"复制",copied:"已复制!"},timeRange:{lastHour:"最近1小时",last24Hours:"最近24小时",last7Days:"最近7天",last30Days:"最近30天"},metrics:{totalRequests:"总请求数",avgResponseTime:"平均响应时间",errorRate:"错误率",successRate:"成功率",slowQueries:"慢查询",exceptions:"异常数",requestsPerMinute:"每分钟请求数",databaseQueries:"数据库查询",responseTime:"响应时间",statusCode:"状态码",method:"请求方法",endpoint:"端点",duration:"持续时间",timestamp:"时间戳",success:"成功",error:"失败",p50:"P50 (中位数)"},settings:{appearance:{title:"外观设置",description:"自定义仪表板的外观和感觉",theme:"主题",themeDescription:"选择浅色或深色模式",light:"浅色",dark:"深色",auto:"自动"},database:{title:"数据库状态",description:"当前数据库连接和性能",status:"状态",connected:"已连接",disconnected:"未连接",queries:"查询数",avgQueryTime:"平均查询时间"},performance:{title:"性能概览",description:"当前应用程序性能指标",avgResponseTime:"平均响应时间",requestsPerMinute:"每分钟请求数"},dataManagement:{title:"数据管理",description:"管理捕获的监控数据",quickActions:"快速操作",quickActionsDescription:"清除捕获的数据以释放空间或重新开始",clear1Day:"清除1天前的数据",clear7Days:"清除7天前的数据",clear30Days:"清除30天前的数据",dangerZone:"危险区域",dangerZoneDescription:"此操作无法撤销",clearAll:"清除所有数据",loading:"加载统计数据中...",totalRequests:"总请求数",totalQueries:"总查询数",totalExceptions:"总异常数",slowQueries:"慢查询",avgResponseTime:"平均响应时间",requestsPerMinute:"每分钟请求数"},about:{title:"关于 FastAPI Radar",description:"FastAPI 应用程序实时监控仪表板",content:"FastAPI Radar 为您的 FastAPI 应用程序提供全面的监控,包括请求跟踪、数据库查询分析和异常监控。",features:"功能特性",feature1:"实时请求监控",feature2:"数据库查询性能跟踪",feature3:"异常和错误跟踪",feature4:"性能指标和分析",feature5:"深色/浅色主题支持",version:"版本",dashboard:"仪表板",connected:"已连接"},language:{title:"语言设置",description:"选择您的首选语言",current:"当前语言",english:"English",chinese:"中文"}},requests:{filters:{status:"状态码",method:"请求方法",searchPlaceholder:"按路径搜索...",description:"筛选和搜索请求日志",timeRange:"时间范围",apply:"应用筛选器"},tabs:{all:"所有请求",recent:"最近",slow:"慢请求",errors:"错误",successful:"成功",failed:"失败"},statusFilters:{all:"所有状态码",success:"2xx 成功",errors:"所有错误",clientErrors:"4xx 客户端错误",serverErrors:"5xx 服务器错误",redirect:"3xx 重定向"},methodFilters:{all:"所有方法",get:"GET",post:"POST",put:"PUT",delete:"DELETE",patch:"PATCH"},timeRangeFilters:{all:"所有时间",lastHour:"最近1小时",last24Hours:"最近24小时",last7Days:"最近7天"},descriptions:{all:"所有 HTTP 请求的完整列表",successful:"成功完成的请求 (2xx 状态码)",failed:"导致错误的请求 (4xx 和 5xx 状态码)",slow:"耗时超过 500ms 的请求"},empty:{all:"尚未捕获任何请求",successful:"没有成功的请求",failed:"没有失败的请求",slow:"没有慢请求"}},exceptions:{noExceptions:"未发现异常",recentExceptions:"最近异常",exceptionType:"异常类型",message:"消息",traceback:"堆栈跟踪",clickToView:"点击查看完整堆栈跟踪"},performance:{overview:"性能概览",responseTimeChart:"响应时间趋势",endpointPerformance:"端点性能",slowestEndpoints:"最慢端点",requestDistribution:"请求分布",excellent:"优秀",acceptable:"可接受",needsAttention:"需要关注",errorAnalysis:"错误分析",average:"平均值",throughput:"吞吐量",requestsPerSec:"每秒请求数",systemStatus:"系统状态",queryPerformance:"查询性能",responseTimeDescription:"随时间变化的平均响应时间",queryActivity:"查询活动",queryActivityDescription:"每个请求的数据库查询数量",topEndpoints:"热门端点",avgResponseByEndpoint:"按端点统计的平均响应时间",recentRequests:"最近请求",healthScore:"健康评分",performanceSummary:"性能摘要",realTimeMetrics:"基于最近请求的实时指标",avgResponse:"平均响应",slowRequests:"慢请求",activeEndpoints:"活跃端点",performanceBreakdown:"按 API 端点分解的性能",responseTimesByEndpoint:"按端点统计的响应时间",p50Median:"P50 (中位数)",p95:"P95",p99:"P99",totalQueries:"总查询数",queriesPerRequest:"每个请求的查询数",slowQueries:"慢查询",avgQueryTime:"平均查询时间",queryPerformanceScore:"查询性能评分",queryStatistics:"查询统计",slowQueriesTitle:"慢查询",noSlowQueries:"未检测到慢查询",errorAnalysisTitle:"错误分析",detailedMetrics:"详细指标",noEndpointData:"无端点数据",noExceptionsCaptured:"未捕获异常",calls:"次调用",errors:"个错误",successRate:"成功率"},database:{queries:"数据库查询",slowQueries:"慢查询",queryTime:"查询时间",queryType:"查询类型",affectedRows:"影响行数",searchPlaceholder:"搜索查询...",showSlowOnly:"仅显示慢查询",slowThreshold:"慢查询阈值 (ms)",noSlowQueries:"未发现慢查询",noSlowQueriesShort:"全部快速",noQueries:"尚未捕获任何查询"},detailDrawer:{title:{request:"请求详情",query:"查询详情",exception:"异常详情",trace:"链路跟踪详情"},common:{pending:"待处理",unknown:"未知"},request:{overview:{timestamp:"时间",clientIp:"客户端 IP",requestId:"请求 ID",url:"URL"},tabs:{headers:"请求头",body:"请求体",response:"响应体",queries:"数据库查询",errors:"异常"},headers:{requestTitle:"请求头",responseTitle:"响应头",noRequestHeaders:"无请求头",noResponseHeaders:"无响应头"},body:{queryParameters:"查询参数",requestTitle:"请求体",noRequestBody:"无请求体",responseTitle:"响应体",noResponseBody:"无响应体"},queries:{empty:"无数据库查询",queryLabel:"查询",rows:"行",parameters:"参数:"},errors:{empty:"无异常发生"}},query:{placeholder:"查询详情视图"},exception:{placeholder:"异常详情视图"},trace:{overview:{unknownOperation:"未知操作",unknownService:"未知服务",traceId:"Trace ID",spanCount:"Span 数量",startTime:"开始时间",duration:"持续时间",tags:"标签"},totalDuration:"总时长",waterfall:{title:"瀑布图"},spans:{title:"Span 详情",service:"服务",duration:"持续时间",startOffset:"起始偏移",depth:"层级",tags:"标签:"}}},traceslist:{search:"按操作名称搜索...",all:"所有状态",success:"成功",error:"失败",lastHour:"最近1小时",last6Hours:"最近6小时",last24Hours:"最近24小时",lastWeek:"最近7天",refresh:"刷新",failToLoadTraces:"加载追踪记录失败",anError:"加载追踪数据时出错",tryAgain:"重试",noTraces:"未找到匹配条件的追踪记录"},layout:{connected:"已连接"}},iS={en:r5,zh:n5},Jx="en";function a5(e){return iS[e]||iS[Jx]}function i5(e,t){const r=t.split(".");let n=e;for(const a of r)if(n&&typeof n=="object"&&a in n)n=n[a];else return t;return typeof n=="string"?n:t}const zN=m.createContext(void 0),UN="fastapi-radar-language";function o5(){try{const e=localStorage.getItem(UN);if(e==="en"||e==="zh")return e}catch(e){console.warn("Failed to read language from localStorage:",e)}return Jx}function s5(e){try{localStorage.setItem(UN,e)}catch(t){console.warn("Failed to save language to localStorage:",t)}}function l5(){try{if(navigator.language.toLowerCase().startsWith("zh"))return"zh"}catch{}return Jx}function c5({children:e,defaultLanguage:t}){const[r,n]=m.useState(()=>{const l=o5();return l||t||l5()}),a=a5(r),i=l=>i5(a,l),o=l=>{n(l),s5(l)};m.useEffect(()=>{document.documentElement.lang=r},[r]);const s={language:r,setLanguage:o,t:i,translations:a};return d.jsx(zN.Provider,{value:s,children:e})}function e0(){const e=m.useContext(zN);if(e===void 0)throw new Error("useTranslation must be used within a LanguageProvider");return e}function Tr(){const{t:e}=e0();return e}function u5(){const{language:e,setLanguage:t}=e0();return{language:e,setLanguage:t}}const d5=[{titleKey:"nav.dashboard",icon:Y4,href:"/",badge:null},{titleKey:"nav.requests",icon:ou,href:"/requests",badge:null},{titleKey:"nav.tracking",icon:V4,href:"/tracing",badge:null},{titleKey:"nav.database",icon:su,href:"/database",badge:null},{titleKey:"nav.exceptions",icon:Bo,href:"/exceptions",badge:null},{titleKey:"nav.performance",icon:J4,href:"/performance",badge:null},{titleKey:"nav.backgroundTasks",icon:e5,href:"/background-tasks",badge:null}],f5=[{titleKey:"nav.settings",icon:Z4,href:"/settings",badge:null}];function p5({className:e,collapsed:t=!1}){const r=Ra(),n=Tr(),{data:a}=tt({queryKey:["sidebar-stats"],queryFn:()=>Me.getStats(1),refetchInterval:3e4}),i=d5.map(l=>({...l,title:n(l.titleKey)})),o=f5.map(l=>({...l,title:n(l.titleKey)})),s=i.map(l=>l.titleKey==="nav.exceptions"&&(a!=null&&a.total_exceptions)&&a.total_exceptions>0?{...l,badge:a.total_exceptions.toString(),badgeVariant:"destructive"}:l);return d.jsx("div",{className:V("pb-12",e),children:d.jsx("div",{className:"space-y-4 py-4",children:d.jsxs("div",{className:"px-3 py-2",children:[d.jsxs("div",{className:"flex items-center mb-6 px-3",children:[!t&&d.jsx(d.Fragment,{children:d.jsxs("div",{className:"flex items-center space-x-2",children:[d.jsx("span",{className:"text-2xl",children:"🚀"}),d.jsxs("div",{className:"flex flex-col",children:[d.jsx("h2",{className:"text-lg font-semibold tracking-tight",children:"FastAPI Radar"}),d.jsx("span",{className:"text-xs text-muted-foreground",children:n("settings.about.description")})]})]})}),t&&d.jsx("span",{className:"text-2xl mx-auto",children:"🚀"})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("h2",{className:V("mb-2 px-4 text-xs font-semibold tracking-wider text-muted-foreground uppercase",t&&"sr-only"),children:t?null:n("sidebar.navigation")}),s.map(l=>d.jsx(oe,{variant:r.pathname===l.href?"secondary":"ghost",className:V("w-full justify-start relative",t&&"justify-center"),asChild:!0,children:d.jsxs(ui,{to:l.href,children:[d.jsx(l.icon,{className:V("h-4 w-4",!t&&"mr-2")}),!t&&d.jsxs(d.Fragment,{children:[l.title,l.badge&&d.jsx(ve,{variant:l.badgeVariant||"outline",className:"ml-auto",children:l.badge})]})]})},l.href))]}),d.jsxs("div",{className:"space-y-1 mt-6",children:[d.jsx("h2",{className:V("mb-2 px-4 text-xs font-semibold tracking-wider text-muted-foreground uppercase",t&&"sr-only"),children:t?null:n("sidebar.system")}),o.map(l=>d.jsx(oe,{variant:r.pathname===l.href?"secondary":"ghost",className:V("w-full justify-start",t&&"justify-center"),asChild:!0,children:d.jsxs(ui,{to:l.href,children:[d.jsx(l.icon,{className:V("h-4 w-4",!t&&"mr-2")}),!t&&l.title]})},l.href))]})]})})})}function ul(){const[e,t]=m.useState(()=>localStorage.getItem("theme")||"light");return m.useEffect(()=>{document.documentElement.className=e,localStorage.setItem("theme",e)},[e]),{theme:e,setTheme:t,toggleTheme:()=>{t(n=>n==="light"?"dark":"light")}}}function h5(){const[e,t]=m.useState(!1),{theme:r,toggleTheme:n}=ul(),[a,i]=m.useState(!1),o=Tr(),{refetch:s}=tt({queryKey:["stats"],queryFn:()=>Me.getStats(1)}),l=async()=>{i(!0),await s(),setTimeout(()=>i(!1),1e3)},c=async()=>{confirm("Are you sure you want to clear all captured data?")&&(await Me.clearData(),await s())};return d.jsxs("div",{className:"flex h-screen overflow-hidden",children:[d.jsx("div",{className:V("hidden md:flex h-full bg-background border-r transition-all duration-300",e?"w-16":"w-64"),children:d.jsx(p5,{collapsed:e,className:"w-full"})}),d.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[d.jsx("header",{className:"bg-background border-b px-6 py-3",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{className:"flex items-center space-x-4",children:[d.jsx(oe,{variant:"ghost",size:"icon",onClick:()=>t(!e),className:"hidden md:flex",children:e?d.jsx(aS,{className:"h-5 w-5"}):d.jsx(W4,{className:"h-5 w-5"})}),d.jsx(oe,{variant:"ghost",size:"icon",className:"md:hidden",children:d.jsx(aS,{className:"h-5 w-5"})})]}),d.jsxs("div",{className:"flex items-center space-x-3",children:[d.jsxs(ve,{variant:"outline",className:"hidden sm:flex items-center gap-1",children:[d.jsx("div",{className:"h-2 w-2 bg-green-500 rounded-full animate-pulse"}),o("layout.connected")]}),d.jsx(oe,{variant:"ghost",size:"icon",onClick:l,title:"Refresh data",children:d.jsx(Ac,{className:V("h-4 w-4",a&&"animate-spin")})}),d.jsx(oe,{variant:"ghost",size:"icon",onClick:c,title:"Clear all data",children:d.jsx(Ud,{className:"h-4 w-4"})}),d.jsx(oe,{variant:"ghost",size:"icon",onClick:n,title:"Toggle theme",children:r==="light"?d.jsx($N,{className:"h-4 w-4"}):d.jsx(BN,{className:"h-4 w-4"})})]})]})}),d.jsx("main",{className:"flex-1 overflow-auto bg-muted/10",children:d.jsx("div",{className:"p-6",children:d.jsx(vF,{})})})]})]})}function Mv(e,[t,r]){return Math.min(r,Math.max(t,e))}function ie(e,t,{checkForDefaultPrevented:r=!0}={}){return function(a){if(e==null||e(a),r===!1||!a.defaultPrevented)return t==null?void 0:t(a)}}function m5(e,t){const r=m.createContext(t),n=i=>{const{children:o,...s}=i,l=m.useMemo(()=>s,Object.values(s));return d.jsx(r.Provider,{value:l,children:o})};n.displayName=e+"Provider";function a(i){const o=m.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[n,a]}function Kn(e,t=[]){let r=[];function n(i,o){const s=m.createContext(o),l=r.length;r=[...r,o];const c=f=>{var b;const{scope:p,children:h,...v}=f,g=((b=p==null?void 0:p[e])==null?void 0:b[l])||s,x=m.useMemo(()=>v,Object.values(v));return d.jsx(g.Provider,{value:x,children:h})};c.displayName=i+"Provider";function u(f,p){var g;const h=((g=p==null?void 0:p[e])==null?void 0:g[l])||s,v=m.useContext(h);if(v)return v;if(o!==void 0)return o;throw new Error(`\`${f}\` must be used within \`${i}\``)}return[c,u]}const a=()=>{const i=r.map(o=>m.createContext(o));return function(s){const l=(s==null?void 0:s[e])||i;return m.useMemo(()=>({[`__scope${e}`]:{...s,[e]:l}}),[s,l])}};return a.scopeName=e,[n,g5(a,...t)]}function g5(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const n=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(i){const o=n.reduce((s,{useScope:l,scopeName:c})=>{const f=l(i)[`__scope${c}`];return{...s,...f}},{});return m.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}function WN(e){const t=e+"CollectionProvider",[r,n]=Kn(t),[a,i]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:x,children:b}=g,y=Jn.useRef(null),w=Jn.useRef(new Map).current;return d.jsx(a,{scope:x,itemMap:w,collectionRef:y,children:b})};o.displayName=t;const s=e+"CollectionSlot",l=zs(s),c=Jn.forwardRef((g,x)=>{const{scope:b,children:y}=g,w=i(s,b),S=be(x,w.collectionRef);return d.jsx(l,{ref:S,children:y})});c.displayName=s;const u=e+"CollectionItemSlot",f="data-radix-collection-item",p=zs(u),h=Jn.forwardRef((g,x)=>{const{scope:b,children:y,...w}=g,S=Jn.useRef(null),E=be(x,S),j=i(u,b);return Jn.useEffect(()=>(j.itemMap.set(S,{ref:S,...w}),()=>void j.itemMap.delete(S))),d.jsx(p,{[f]:"",ref:E,children:y})});h.displayName=u;function v(g){const x=i(e+"CollectionConsumer",g);return Jn.useCallback(()=>{const y=x.collectionRef.current;if(!y)return[];const w=Array.from(y.querySelectorAll(`[${f}]`));return Array.from(x.itemMap.values()).sort((j,P)=>w.indexOf(j.ref.current)-w.indexOf(P.ref.current))},[x.collectionRef,x.itemMap])}return[{Provider:o,Slot:c,ItemSlot:h},v,n]}var v5=m.createContext(void 0);function Hp(e){const t=m.useContext(v5);return e||t||"ltr"}var y5=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],se=y5.reduce((e,t)=>{const r=zs(`Primitive.${t}`),n=m.forwardRef((a,i)=>{const{asChild:o,...s}=a,l=o?r:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),d.jsx(l,{...s,ref:i})});return n.displayName=`Primitive.${t}`,{...e,[t]:n}},{});function x5(e,t){e&&Ti.flushSync(()=>e.dispatchEvent(t))}function Qt(e){const t=m.useRef(e);return m.useEffect(()=>{t.current=e}),m.useMemo(()=>(...r)=>{var n;return(n=t.current)==null?void 0:n.call(t,...r)},[])}function b5(e,t=globalThis==null?void 0:globalThis.document){const r=Qt(e);m.useEffect(()=>{const n=a=>{a.key==="Escape"&&r(a)};return t.addEventListener("keydown",n,{capture:!0}),()=>t.removeEventListener("keydown",n,{capture:!0})},[r,t])}var w5="DismissableLayer",Iv="dismissableLayer.update",S5="dismissableLayer.pointerDownOutside",E5="dismissableLayer.focusOutside",oS,qN=m.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Kp=m.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:n,onPointerDownOutside:a,onFocusOutside:i,onInteractOutside:o,onDismiss:s,...l}=e,c=m.useContext(qN),[u,f]=m.useState(null),p=(u==null?void 0:u.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,h]=m.useState({}),v=be(t,P=>f(P)),g=Array.from(c.layers),[x]=[...c.layersWithOutsidePointerEventsDisabled].slice(-1),b=g.indexOf(x),y=u?g.indexOf(u):-1,w=c.layersWithOutsidePointerEventsDisabled.size>0,S=y>=b,E=k5(P=>{const k=P.target,N=[...c.branches].some(O=>O.contains(k));!S||N||(a==null||a(P),o==null||o(P),P.defaultPrevented||s==null||s())},p),j=C5(P=>{const k=P.target;[...c.branches].some(O=>O.contains(k))||(i==null||i(P),o==null||o(P),P.defaultPrevented||s==null||s())},p);return b5(P=>{y===c.layers.size-1&&(n==null||n(P),!P.defaultPrevented&&s&&(P.preventDefault(),s()))},p),m.useEffect(()=>{if(u)return r&&(c.layersWithOutsidePointerEventsDisabled.size===0&&(oS=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),c.layersWithOutsidePointerEventsDisabled.add(u)),c.layers.add(u),sS(),()=>{r&&c.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=oS)}},[u,p,r,c]),m.useEffect(()=>()=>{u&&(c.layers.delete(u),c.layersWithOutsidePointerEventsDisabled.delete(u),sS())},[u,c]),m.useEffect(()=>{const P=()=>h({});return document.addEventListener(Iv,P),()=>document.removeEventListener(Iv,P)},[]),d.jsx(se.div,{...l,ref:v,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:ie(e.onFocusCapture,j.onFocusCapture),onBlurCapture:ie(e.onBlurCapture,j.onBlurCapture),onPointerDownCapture:ie(e.onPointerDownCapture,E.onPointerDownCapture)})});Kp.displayName=w5;var j5="DismissableLayerBranch",P5=m.forwardRef((e,t)=>{const r=m.useContext(qN),n=m.useRef(null),a=be(t,n);return m.useEffect(()=>{const i=n.current;if(i)return r.branches.add(i),()=>{r.branches.delete(i)}},[r.branches]),d.jsx(se.div,{...e,ref:a})});P5.displayName=j5;function k5(e,t=globalThis==null?void 0:globalThis.document){const r=Qt(e),n=m.useRef(!1),a=m.useRef(()=>{});return m.useEffect(()=>{const i=s=>{if(s.target&&!n.current){let l=function(){HN(S5,r,c,{discrete:!0})};const c={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=l,t.addEventListener("click",a.current,{once:!0})):l()}else t.removeEventListener("click",a.current);n.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",i),t.removeEventListener("click",a.current)}},[t,r]),{onPointerDownCapture:()=>n.current=!0}}function C5(e,t=globalThis==null?void 0:globalThis.document){const r=Qt(e),n=m.useRef(!1);return m.useEffect(()=>{const a=i=>{i.target&&!n.current&&HN(E5,r,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,r]),{onFocusCapture:()=>n.current=!0,onBlurCapture:()=>n.current=!1}}function sS(){const e=new CustomEvent(Iv);document.dispatchEvent(e)}function HN(e,t,r,{discrete:n}){const a=r.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&a.addEventListener(e,t,{once:!0}),n?x5(a,i):a.dispatchEvent(i)}var Wm=0;function KN(){m.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??lS()),document.body.insertAdjacentElement("beforeend",e[1]??lS()),Wm++,()=>{Wm===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),Wm--}},[])}function lS(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var qm="focusScope.autoFocusOnMount",Hm="focusScope.autoFocusOnUnmount",cS={bubbles:!1,cancelable:!0},N5="FocusScope",t0=m.forwardRef((e,t)=>{const{loop:r=!1,trapped:n=!1,onMountAutoFocus:a,onUnmountAutoFocus:i,...o}=e,[s,l]=m.useState(null),c=Qt(a),u=Qt(i),f=m.useRef(null),p=be(t,g=>l(g)),h=m.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;m.useEffect(()=>{if(n){let g=function(w){if(h.paused||!s)return;const S=w.target;s.contains(S)?f.current=S:Ha(f.current,{select:!0})},x=function(w){if(h.paused||!s)return;const S=w.relatedTarget;S!==null&&(s.contains(S)||Ha(f.current,{select:!0}))},b=function(w){if(document.activeElement===document.body)for(const E of w)E.removedNodes.length>0&&Ha(s)};document.addEventListener("focusin",g),document.addEventListener("focusout",x);const y=new MutationObserver(b);return s&&y.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",g),document.removeEventListener("focusout",x),y.disconnect()}}},[n,s,h.paused]),m.useEffect(()=>{if(s){dS.add(h);const g=document.activeElement;if(!s.contains(g)){const b=new CustomEvent(qm,cS);s.addEventListener(qm,c),s.dispatchEvent(b),b.defaultPrevented||(O5(D5(VN(s)),{select:!0}),document.activeElement===g&&Ha(s))}return()=>{s.removeEventListener(qm,c),setTimeout(()=>{const b=new CustomEvent(Hm,cS);s.addEventListener(Hm,u),s.dispatchEvent(b),b.defaultPrevented||Ha(g??document.body,{select:!0}),s.removeEventListener(Hm,u),dS.remove(h)},0)}}},[s,c,u,h]);const v=m.useCallback(g=>{if(!r&&!n||h.paused)return;const x=g.key==="Tab"&&!g.altKey&&!g.ctrlKey&&!g.metaKey,b=document.activeElement;if(x&&b){const y=g.currentTarget,[w,S]=A5(y);w&&S?!g.shiftKey&&b===S?(g.preventDefault(),r&&Ha(w,{select:!0})):g.shiftKey&&b===w&&(g.preventDefault(),r&&Ha(S,{select:!0})):b===y&&g.preventDefault()}},[r,n,h.paused]);return d.jsx(se.div,{tabIndex:-1,...o,ref:p,onKeyDown:v})});t0.displayName=N5;function O5(e,{select:t=!1}={}){const r=document.activeElement;for(const n of e)if(Ha(n,{select:t}),document.activeElement!==r)return}function A5(e){const t=VN(e),r=uS(t,e),n=uS(t.reverse(),e);return[r,n]}function VN(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function uS(e,t){for(const r of e)if(!T5(r,{upTo:t}))return r}function T5(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function _5(e){return e instanceof HTMLInputElement&&"select"in e}function Ha(e,{select:t=!1}={}){if(e&&e.focus){const r=document.activeElement;e.focus({preventScroll:!0}),e!==r&&_5(e)&&t&&e.select()}}var dS=R5();function R5(){let e=[];return{add(t){const r=e[0];t!==r&&(r==null||r.pause()),e=fS(e,t),e.unshift(t)},remove(t){var r;e=fS(e,t),(r=e[0])==null||r.resume()}}}function fS(e,t){const r=[...e],n=r.indexOf(t);return n!==-1&&r.splice(n,1),r}function D5(e){return e.filter(t=>t.tagName!=="A")}var _t=globalThis!=null&&globalThis.document?m.useLayoutEffect:()=>{},M5=Yy[" useId ".trim().toString()]||(()=>{}),I5=0;function ma(e){const[t,r]=m.useState(M5());return _t(()=>{r(n=>n??String(I5++))},[e]),t?`radix-${t}`:""}const L5=["top","right","bottom","left"],Ei=Math.min,br=Math.max,jf=Math.round,ad=Math.floor,Ln=e=>({x:e,y:e}),$5={left:"right",right:"left",bottom:"top",top:"bottom"},F5={start:"end",end:"start"};function Lv(e,t,r){return br(e,Ei(t,r))}function Pa(e,t){return typeof e=="function"?e(t):e}function ka(e){return e.split("-")[0]}function dl(e){return e.split("-")[1]}function r0(e){return e==="x"?"y":"x"}function n0(e){return e==="y"?"height":"width"}const B5=new Set(["top","bottom"]);function _n(e){return B5.has(ka(e))?"y":"x"}function a0(e){return r0(_n(e))}function z5(e,t,r){r===void 0&&(r=!1);const n=dl(e),a=a0(e),i=n0(a);let o=a==="x"?n===(r?"end":"start")?"right":"left":n==="start"?"bottom":"top";return t.reference[i]>t.floating[i]&&(o=Pf(o)),[o,Pf(o)]}function U5(e){const t=Pf(e);return[$v(e),t,$v(t)]}function $v(e){return e.replace(/start|end/g,t=>F5[t])}const pS=["left","right"],hS=["right","left"],W5=["top","bottom"],q5=["bottom","top"];function H5(e,t,r){switch(e){case"top":case"bottom":return r?t?hS:pS:t?pS:hS;case"left":case"right":return t?W5:q5;default:return[]}}function K5(e,t,r,n){const a=dl(e);let i=H5(ka(e),r==="start",n);return a&&(i=i.map(o=>o+"-"+a),t&&(i=i.concat(i.map($v)))),i}function Pf(e){return e.replace(/left|right|bottom|top/g,t=>$5[t])}function V5(e){return{top:0,right:0,bottom:0,left:0,...e}}function YN(e){return typeof e!="number"?V5(e):{top:e,right:e,bottom:e,left:e}}function kf(e){const{x:t,y:r,width:n,height:a}=e;return{width:n,height:a,top:r,left:t,right:t+n,bottom:r+a,x:t,y:r}}function mS(e,t,r){let{reference:n,floating:a}=e;const i=_n(t),o=a0(t),s=n0(o),l=ka(t),c=i==="y",u=n.x+n.width/2-a.width/2,f=n.y+n.height/2-a.height/2,p=n[s]/2-a[s]/2;let h;switch(l){case"top":h={x:u,y:n.y-a.height};break;case"bottom":h={x:u,y:n.y+n.height};break;case"right":h={x:n.x+n.width,y:f};break;case"left":h={x:n.x-a.width,y:f};break;default:h={x:n.x,y:n.y}}switch(dl(t)){case"start":h[o]-=p*(r&&c?-1:1);break;case"end":h[o]+=p*(r&&c?-1:1);break}return h}const Y5=async(e,t,r)=>{const{placement:n="bottom",strategy:a="absolute",middleware:i=[],platform:o}=r,s=i.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(t));let c=await o.getElementRects({reference:e,floating:t,strategy:a}),{x:u,y:f}=mS(c,n,l),p=n,h={},v=0;for(let g=0;g({name:"arrow",options:e,async fn(t){const{x:r,y:n,placement:a,rects:i,platform:o,elements:s,middlewareData:l}=t,{element:c,padding:u=0}=Pa(e,t)||{};if(c==null)return{};const f=YN(u),p={x:r,y:n},h=a0(a),v=n0(h),g=await o.getDimensions(c),x=h==="y",b=x?"top":"left",y=x?"bottom":"right",w=x?"clientHeight":"clientWidth",S=i.reference[v]+i.reference[h]-p[h]-i.floating[v],E=p[h]-i.reference[h],j=await(o.getOffsetParent==null?void 0:o.getOffsetParent(c));let P=j?j[w]:0;(!P||!await(o.isElement==null?void 0:o.isElement(j)))&&(P=s.floating[w]||i.floating[v]);const k=S/2-E/2,N=P/2-g[v]/2-1,O=Ei(f[b],N),A=Ei(f[y],N),T=O,L=P-g[v]-A,I=P/2-g[v]/2+k,q=Lv(T,I,L),B=!l.arrow&&dl(a)!=null&&I!==q&&i.reference[v]/2-(II<=0)){var A,T;const I=(((A=i.flip)==null?void 0:A.index)||0)+1,q=P[I];if(q&&(!(f==="alignment"?y!==_n(q):!1)||O.every(_=>_n(_.placement)===y?_.overflows[0]>0:!0)))return{data:{index:I,overflows:O},reset:{placement:q}};let B=(T=O.filter(U=>U.overflows[0]<=0).sort((U,_)=>U.overflows[1]-_.overflows[1])[0])==null?void 0:T.placement;if(!B)switch(h){case"bestFit":{var L;const U=(L=O.filter(_=>{if(j){const $=_n(_.placement);return $===y||$==="y"}return!0}).map(_=>[_.placement,_.overflows.filter($=>$>0).reduce(($,W)=>$+W,0)]).sort((_,$)=>_[1]-$[1])[0])==null?void 0:L[0];U&&(B=U);break}case"initialPlacement":B=s;break}if(a!==B)return{reset:{placement:B}}}return{}}}};function gS(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function vS(e){return L5.some(t=>e[t]>=0)}const X5=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:r}=t,{strategy:n="referenceHidden",...a}=Pa(e,t);switch(n){case"referenceHidden":{const i=await Tc(t,{...a,elementContext:"reference"}),o=gS(i,r.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:vS(o)}}}case"escaped":{const i=await Tc(t,{...a,altBoundary:!0}),o=gS(i,r.floating);return{data:{escapedOffsets:o,escaped:vS(o)}}}default:return{}}}}},GN=new Set(["left","top"]);async function Z5(e,t){const{placement:r,platform:n,elements:a}=e,i=await(n.isRTL==null?void 0:n.isRTL(a.floating)),o=ka(r),s=dl(r),l=_n(r)==="y",c=GN.has(o)?-1:1,u=i&&l?-1:1,f=Pa(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*u,y:p*c}:{x:p*c,y:h*u}}const J5=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var r,n;const{x:a,y:i,placement:o,middlewareData:s}=t,l=await Z5(t,e);return o===((r=s.offset)==null?void 0:r.placement)&&(n=s.arrow)!=null&&n.alignmentOffset?{}:{x:a+l.x,y:i+l.y,data:{...l,placement:o}}}}},eB=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:r,y:n,placement:a}=t,{mainAxis:i=!0,crossAxis:o=!1,limiter:s={fn:x=>{let{x:b,y}=x;return{x:b,y}}},...l}=Pa(e,t),c={x:r,y:n},u=await Tc(t,l),f=_n(ka(a)),p=r0(f);let h=c[p],v=c[f];if(i){const x=p==="y"?"top":"left",b=p==="y"?"bottom":"right",y=h+u[x],w=h-u[b];h=Lv(y,h,w)}if(o){const x=f==="y"?"top":"left",b=f==="y"?"bottom":"right",y=v+u[x],w=v-u[b];v=Lv(y,v,w)}const g=s.fn({...t,[p]:h,[f]:v});return{...g,data:{x:g.x-r,y:g.y-n,enabled:{[p]:i,[f]:o}}}}}},tB=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:r,y:n,placement:a,rects:i,middlewareData:o}=t,{offset:s=0,mainAxis:l=!0,crossAxis:c=!0}=Pa(e,t),u={x:r,y:n},f=_n(a),p=r0(f);let h=u[p],v=u[f];const g=Pa(s,t),x=typeof g=="number"?{mainAxis:g,crossAxis:0}:{mainAxis:0,crossAxis:0,...g};if(l){const w=p==="y"?"height":"width",S=i.reference[p]-i.floating[w]+x.mainAxis,E=i.reference[p]+i.reference[w]-x.mainAxis;hE&&(h=E)}if(c){var b,y;const w=p==="y"?"width":"height",S=GN.has(ka(a)),E=i.reference[f]-i.floating[w]+(S&&((b=o.offset)==null?void 0:b[f])||0)+(S?0:x.crossAxis),j=i.reference[f]+i.reference[w]+(S?0:((y=o.offset)==null?void 0:y[f])||0)-(S?x.crossAxis:0);vj&&(v=j)}return{[p]:h,[f]:v}}}},rB=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var r,n;const{placement:a,rects:i,platform:o,elements:s}=t,{apply:l=()=>{},...c}=Pa(e,t),u=await Tc(t,c),f=ka(a),p=dl(a),h=_n(a)==="y",{width:v,height:g}=i.floating;let x,b;f==="top"||f==="bottom"?(x=f,b=p===(await(o.isRTL==null?void 0:o.isRTL(s.floating))?"start":"end")?"left":"right"):(b=f,x=p==="end"?"top":"bottom");const y=g-u.top-u.bottom,w=v-u.left-u.right,S=Ei(g-u[x],y),E=Ei(v-u[b],w),j=!t.middlewareData.shift;let P=S,k=E;if((r=t.middlewareData.shift)!=null&&r.enabled.x&&(k=w),(n=t.middlewareData.shift)!=null&&n.enabled.y&&(P=y),j&&!p){const O=br(u.left,0),A=br(u.right,0),T=br(u.top,0),L=br(u.bottom,0);h?k=v-2*(O!==0||A!==0?O+A:br(u.left,u.right)):P=g-2*(T!==0||L!==0?T+L:br(u.top,u.bottom))}await l({...t,availableWidth:k,availableHeight:P});const N=await o.getDimensions(s.floating);return v!==N.width||g!==N.height?{reset:{rects:!0}}:{}}}};function Vp(){return typeof window<"u"}function fl(e){return QN(e)?(e.nodeName||"").toLowerCase():"#document"}function Pr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Vn(e){var t;return(t=(QN(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function QN(e){return Vp()?e instanceof Node||e instanceof Pr(e).Node:!1}function gn(e){return Vp()?e instanceof Element||e instanceof Pr(e).Element:!1}function Bn(e){return Vp()?e instanceof HTMLElement||e instanceof Pr(e).HTMLElement:!1}function yS(e){return!Vp()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Pr(e).ShadowRoot}const nB=new Set(["inline","contents"]);function lu(e){const{overflow:t,overflowX:r,overflowY:n,display:a}=vn(e);return/auto|scroll|overlay|hidden|clip/.test(t+n+r)&&!nB.has(a)}const aB=new Set(["table","td","th"]);function iB(e){return aB.has(fl(e))}const oB=[":popover-open",":modal"];function Yp(e){return oB.some(t=>{try{return e.matches(t)}catch{return!1}})}const sB=["transform","translate","scale","rotate","perspective"],lB=["transform","translate","scale","rotate","perspective","filter"],cB=["paint","layout","strict","content"];function i0(e){const t=o0(),r=gn(e)?vn(e):e;return sB.some(n=>r[n]?r[n]!=="none":!1)||(r.containerType?r.containerType!=="normal":!1)||!t&&(r.backdropFilter?r.backdropFilter!=="none":!1)||!t&&(r.filter?r.filter!=="none":!1)||lB.some(n=>(r.willChange||"").includes(n))||cB.some(n=>(r.contain||"").includes(n))}function uB(e){let t=ji(e);for(;Bn(t)&&!Us(t);){if(i0(t))return t;if(Yp(t))return null;t=ji(t)}return null}function o0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const dB=new Set(["html","body","#document"]);function Us(e){return dB.has(fl(e))}function vn(e){return Pr(e).getComputedStyle(e)}function Gp(e){return gn(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function ji(e){if(fl(e)==="html")return e;const t=e.assignedSlot||e.parentNode||yS(e)&&e.host||Vn(e);return yS(t)?t.host:t}function XN(e){const t=ji(e);return Us(t)?e.ownerDocument?e.ownerDocument.body:e.body:Bn(t)&&lu(t)?t:XN(t)}function _c(e,t,r){var n;t===void 0&&(t=[]),r===void 0&&(r=!0);const a=XN(e),i=a===((n=e.ownerDocument)==null?void 0:n.body),o=Pr(a);if(i){const s=Fv(o);return t.concat(o,o.visualViewport||[],lu(a)?a:[],s&&r?_c(s):[])}return t.concat(a,_c(a,[],r))}function Fv(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function ZN(e){const t=vn(e);let r=parseFloat(t.width)||0,n=parseFloat(t.height)||0;const a=Bn(e),i=a?e.offsetWidth:r,o=a?e.offsetHeight:n,s=jf(r)!==i||jf(n)!==o;return s&&(r=i,n=o),{width:r,height:n,$:s}}function s0(e){return gn(e)?e:e.contextElement}function ys(e){const t=s0(e);if(!Bn(t))return Ln(1);const r=t.getBoundingClientRect(),{width:n,height:a,$:i}=ZN(t);let o=(i?jf(r.width):r.width)/n,s=(i?jf(r.height):r.height)/a;return(!o||!Number.isFinite(o))&&(o=1),(!s||!Number.isFinite(s))&&(s=1),{x:o,y:s}}const fB=Ln(0);function JN(e){const t=Pr(e);return!o0()||!t.visualViewport?fB:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function pB(e,t,r){return t===void 0&&(t=!1),!r||t&&r!==Pr(e)?!1:t}function jo(e,t,r,n){t===void 0&&(t=!1),r===void 0&&(r=!1);const a=e.getBoundingClientRect(),i=s0(e);let o=Ln(1);t&&(n?gn(n)&&(o=ys(n)):o=ys(e));const s=pB(i,r,n)?JN(i):Ln(0);let l=(a.left+s.x)/o.x,c=(a.top+s.y)/o.y,u=a.width/o.x,f=a.height/o.y;if(i){const p=Pr(i),h=n&&gn(n)?Pr(n):n;let v=p,g=Fv(v);for(;g&&n&&h!==v;){const x=ys(g),b=g.getBoundingClientRect(),y=vn(g),w=b.left+(g.clientLeft+parseFloat(y.paddingLeft))*x.x,S=b.top+(g.clientTop+parseFloat(y.paddingTop))*x.y;l*=x.x,c*=x.y,u*=x.x,f*=x.y,l+=w,c+=S,v=Pr(g),g=Fv(v)}}return kf({width:u,height:f,x:l,y:c})}function Qp(e,t){const r=Gp(e).scrollLeft;return t?t.left+r:jo(Vn(e)).left+r}function eO(e,t){const r=e.getBoundingClientRect(),n=r.left+t.scrollLeft-Qp(e,r),a=r.top+t.scrollTop;return{x:n,y:a}}function hB(e){let{elements:t,rect:r,offsetParent:n,strategy:a}=e;const i=a==="fixed",o=Vn(n),s=t?Yp(t.floating):!1;if(n===o||s&&i)return r;let l={scrollLeft:0,scrollTop:0},c=Ln(1);const u=Ln(0),f=Bn(n);if((f||!f&&!i)&&((fl(n)!=="body"||lu(o))&&(l=Gp(n)),Bn(n))){const h=jo(n);c=ys(n),u.x=h.x+n.clientLeft,u.y=h.y+n.clientTop}const p=o&&!f&&!i?eO(o,l):Ln(0);return{width:r.width*c.x,height:r.height*c.y,x:r.x*c.x-l.scrollLeft*c.x+u.x+p.x,y:r.y*c.y-l.scrollTop*c.y+u.y+p.y}}function mB(e){return Array.from(e.getClientRects())}function gB(e){const t=Vn(e),r=Gp(e),n=e.ownerDocument.body,a=br(t.scrollWidth,t.clientWidth,n.scrollWidth,n.clientWidth),i=br(t.scrollHeight,t.clientHeight,n.scrollHeight,n.clientHeight);let o=-r.scrollLeft+Qp(e);const s=-r.scrollTop;return vn(n).direction==="rtl"&&(o+=br(t.clientWidth,n.clientWidth)-a),{width:a,height:i,x:o,y:s}}const xS=25;function vB(e,t){const r=Pr(e),n=Vn(e),a=r.visualViewport;let i=n.clientWidth,o=n.clientHeight,s=0,l=0;if(a){i=a.width,o=a.height;const u=o0();(!u||u&&t==="fixed")&&(s=a.offsetLeft,l=a.offsetTop)}const c=Qp(n);if(c<=0){const u=n.ownerDocument,f=u.body,p=getComputedStyle(f),h=u.compatMode==="CSS1Compat"&&parseFloat(p.marginLeft)+parseFloat(p.marginRight)||0,v=Math.abs(n.clientWidth-f.clientWidth-h);v<=xS&&(i-=v)}else c<=xS&&(i+=c);return{width:i,height:o,x:s,y:l}}const yB=new Set(["absolute","fixed"]);function xB(e,t){const r=jo(e,!0,t==="fixed"),n=r.top+e.clientTop,a=r.left+e.clientLeft,i=Bn(e)?ys(e):Ln(1),o=e.clientWidth*i.x,s=e.clientHeight*i.y,l=a*i.x,c=n*i.y;return{width:o,height:s,x:l,y:c}}function bS(e,t,r){let n;if(t==="viewport")n=vB(e,r);else if(t==="document")n=gB(Vn(e));else if(gn(t))n=xB(t,r);else{const a=JN(e);n={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return kf(n)}function tO(e,t){const r=ji(e);return r===t||!gn(r)||Us(r)?!1:vn(r).position==="fixed"||tO(r,t)}function bB(e,t){const r=t.get(e);if(r)return r;let n=_c(e,[],!1).filter(s=>gn(s)&&fl(s)!=="body"),a=null;const i=vn(e).position==="fixed";let o=i?ji(e):e;for(;gn(o)&&!Us(o);){const s=vn(o),l=i0(o);!l&&s.position==="fixed"&&(a=null),(i?!l&&!a:!l&&s.position==="static"&&!!a&&yB.has(a.position)||lu(o)&&!l&&tO(e,o))?n=n.filter(u=>u!==o):a=s,o=ji(o)}return t.set(e,n),n}function wB(e){let{element:t,boundary:r,rootBoundary:n,strategy:a}=e;const o=[...r==="clippingAncestors"?Yp(t)?[]:bB(t,this._c):[].concat(r),n],s=o[0],l=o.reduce((c,u)=>{const f=bS(t,u,a);return c.top=br(f.top,c.top),c.right=Ei(f.right,c.right),c.bottom=Ei(f.bottom,c.bottom),c.left=br(f.left,c.left),c},bS(t,s,a));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function SB(e){const{width:t,height:r}=ZN(e);return{width:t,height:r}}function EB(e,t,r){const n=Bn(t),a=Vn(t),i=r==="fixed",o=jo(e,!0,i,t);let s={scrollLeft:0,scrollTop:0};const l=Ln(0);function c(){l.x=Qp(a)}if(n||!n&&!i)if((fl(t)!=="body"||lu(a))&&(s=Gp(t)),n){const h=jo(t,!0,i,t);l.x=h.x+t.clientLeft,l.y=h.y+t.clientTop}else a&&c();i&&!n&&a&&c();const u=a&&!n&&!i?eO(a,s):Ln(0),f=o.left+s.scrollLeft-l.x-u.x,p=o.top+s.scrollTop-l.y-u.y;return{x:f,y:p,width:o.width,height:o.height}}function Km(e){return vn(e).position==="static"}function wS(e,t){if(!Bn(e)||vn(e).position==="fixed")return null;if(t)return t(e);let r=e.offsetParent;return Vn(e)===r&&(r=r.ownerDocument.body),r}function rO(e,t){const r=Pr(e);if(Yp(e))return r;if(!Bn(e)){let a=ji(e);for(;a&&!Us(a);){if(gn(a)&&!Km(a))return a;a=ji(a)}return r}let n=wS(e,t);for(;n&&iB(n)&&Km(n);)n=wS(n,t);return n&&Us(n)&&Km(n)&&!i0(n)?r:n||uB(e)||r}const jB=async function(e){const t=this.getOffsetParent||rO,r=this.getDimensions,n=await r(e.floating);return{reference:EB(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:n.width,height:n.height}}};function PB(e){return vn(e).direction==="rtl"}const kB={convertOffsetParentRelativeRectToViewportRelativeRect:hB,getDocumentElement:Vn,getClippingRect:wB,getOffsetParent:rO,getElementRects:jB,getClientRects:mB,getDimensions:SB,getScale:ys,isElement:gn,isRTL:PB};function nO(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function CB(e,t){let r=null,n;const a=Vn(e);function i(){var s;clearTimeout(n),(s=r)==null||s.disconnect(),r=null}function o(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),i();const c=e.getBoundingClientRect(),{left:u,top:f,width:p,height:h}=c;if(s||t(),!p||!h)return;const v=ad(f),g=ad(a.clientWidth-(u+p)),x=ad(a.clientHeight-(f+h)),b=ad(u),w={rootMargin:-v+"px "+-g+"px "+-x+"px "+-b+"px",threshold:br(0,Ei(1,l))||1};let S=!0;function E(j){const P=j[0].intersectionRatio;if(P!==l){if(!S)return o();P?o(!1,P):n=setTimeout(()=>{o(!1,1e-7)},1e3)}P===1&&!nO(c,e.getBoundingClientRect())&&o(),S=!1}try{r=new IntersectionObserver(E,{...w,root:a.ownerDocument})}catch{r=new IntersectionObserver(E,w)}r.observe(e)}return o(!0),i}function NB(e,t,r,n){n===void 0&&(n={});const{ancestorScroll:a=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=n,c=s0(e),u=a||i?[...c?_c(c):[],..._c(t)]:[];u.forEach(b=>{a&&b.addEventListener("scroll",r,{passive:!0}),i&&b.addEventListener("resize",r)});const f=c&&s?CB(c,r):null;let p=-1,h=null;o&&(h=new ResizeObserver(b=>{let[y]=b;y&&y.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(p),p=requestAnimationFrame(()=>{var w;(w=h)==null||w.observe(t)})),r()}),c&&!l&&h.observe(c),h.observe(t));let v,g=l?jo(e):null;l&&x();function x(){const b=jo(e);g&&!nO(g,b)&&r(),g=b,v=requestAnimationFrame(x)}return r(),()=>{var b;u.forEach(y=>{a&&y.removeEventListener("scroll",r),i&&y.removeEventListener("resize",r)}),f==null||f(),(b=h)==null||b.disconnect(),h=null,l&&cancelAnimationFrame(v)}}const OB=J5,AB=eB,TB=Q5,_B=rB,RB=X5,SS=G5,DB=tB,MB=(e,t,r)=>{const n=new Map,a={platform:kB,...r},i={...a.platform,_c:n};return Y5(e,t,{...a,platform:i})};var IB=typeof document<"u",LB=function(){},Wd=IB?m.useLayoutEffect:LB;function Cf(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 r,n,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(r=e.length,r!==t.length)return!1;for(n=r;n--!==0;)if(!Cf(e[n],t[n]))return!1;return!0}if(a=Object.keys(e),r=a.length,r!==Object.keys(t).length)return!1;for(n=r;n--!==0;)if(!{}.hasOwnProperty.call(t,a[n]))return!1;for(n=r;n--!==0;){const i=a[n];if(!(i==="_owner"&&e.$$typeof)&&!Cf(e[i],t[i]))return!1}return!0}return e!==e&&t!==t}function aO(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function ES(e,t){const r=aO(e);return Math.round(t*r)/r}function Vm(e){const t=m.useRef(e);return Wd(()=>{t.current=e}),t}function $B(e){e===void 0&&(e={});const{placement:t="bottom",strategy:r="absolute",middleware:n=[],platform:a,elements:{reference:i,floating:o}={},transform:s=!0,whileElementsMounted:l,open:c}=e,[u,f]=m.useState({x:0,y:0,strategy:r,placement:t,middlewareData:{},isPositioned:!1}),[p,h]=m.useState(n);Cf(p,n)||h(n);const[v,g]=m.useState(null),[x,b]=m.useState(null),y=m.useCallback(_=>{_!==j.current&&(j.current=_,g(_))},[]),w=m.useCallback(_=>{_!==P.current&&(P.current=_,b(_))},[]),S=i||v,E=o||x,j=m.useRef(null),P=m.useRef(null),k=m.useRef(u),N=l!=null,O=Vm(l),A=Vm(a),T=Vm(c),L=m.useCallback(()=>{if(!j.current||!P.current)return;const _={placement:t,strategy:r,middleware:p};A.current&&(_.platform=A.current),MB(j.current,P.current,_).then($=>{const W={...$,isPositioned:T.current!==!1};I.current&&!Cf(k.current,W)&&(k.current=W,Ti.flushSync(()=>{f(W)}))})},[p,t,r,A,T]);Wd(()=>{c===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,f(_=>({..._,isPositioned:!1})))},[c]);const I=m.useRef(!1);Wd(()=>(I.current=!0,()=>{I.current=!1}),[]),Wd(()=>{if(S&&(j.current=S),E&&(P.current=E),S&&E){if(O.current)return O.current(S,E,L);L()}},[S,E,L,O,N]);const q=m.useMemo(()=>({reference:j,floating:P,setReference:y,setFloating:w}),[y,w]),B=m.useMemo(()=>({reference:S,floating:E}),[S,E]),U=m.useMemo(()=>{const _={position:r,left:0,top:0};if(!B.floating)return _;const $=ES(B.floating,u.x),W=ES(B.floating,u.y);return s?{..._,transform:"translate("+$+"px, "+W+"px)",...aO(B.floating)>=1.5&&{willChange:"transform"}}:{position:r,left:$,top:W}},[r,s,B.floating,u.x,u.y]);return m.useMemo(()=>({...u,update:L,refs:q,elements:B,floatingStyles:U}),[u,L,q,B,U])}const FB=e=>{function t(r){return{}.hasOwnProperty.call(r,"current")}return{name:"arrow",options:e,fn(r){const{element:n,padding:a}=typeof e=="function"?e(r):e;return n&&t(n)?n.current!=null?SS({element:n.current,padding:a}).fn(r):{}:n?SS({element:n,padding:a}).fn(r):{}}}},BB=(e,t)=>({...OB(e),options:[e,t]}),zB=(e,t)=>({...AB(e),options:[e,t]}),UB=(e,t)=>({...DB(e),options:[e,t]}),WB=(e,t)=>({...TB(e),options:[e,t]}),qB=(e,t)=>({..._B(e),options:[e,t]}),HB=(e,t)=>({...RB(e),options:[e,t]}),KB=(e,t)=>({...FB(e),options:[e,t]});var VB="Arrow",iO=m.forwardRef((e,t)=>{const{children:r,width:n=10,height:a=5,...i}=e;return d.jsx(se.svg,{...i,ref:t,width:n,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:d.jsx("polygon",{points:"0,0 30,0 15,10"})})});iO.displayName=VB;var YB=iO;function oO(e){const[t,r]=m.useState(void 0);return _t(()=>{if(e){r({width:e.offsetWidth,height:e.offsetHeight});const n=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const i=a[0];let o,s;if("borderBoxSize"in i){const l=i.borderBoxSize,c=Array.isArray(l)?l[0]:l;o=c.inlineSize,s=c.blockSize}else o=e.offsetWidth,s=e.offsetHeight;r({width:o,height:s})});return n.observe(e,{box:"border-box"}),()=>n.unobserve(e)}else r(void 0)},[e]),t}var l0="Popper",[sO,Xp]=Kn(l0),[GB,lO]=sO(l0),cO=e=>{const{__scopePopper:t,children:r}=e,[n,a]=m.useState(null);return d.jsx(GB,{scope:t,anchor:n,onAnchorChange:a,children:r})};cO.displayName=l0;var uO="PopperAnchor",dO=m.forwardRef((e,t)=>{const{__scopePopper:r,virtualRef:n,...a}=e,i=lO(uO,r),o=m.useRef(null),s=be(t,o),l=m.useRef(null);return m.useEffect(()=>{const c=l.current;l.current=(n==null?void 0:n.current)||o.current,c!==l.current&&i.onAnchorChange(l.current)}),n?null:d.jsx(se.div,{...a,ref:s})});dO.displayName=uO;var c0="PopperContent",[QB,XB]=sO(c0),fO=m.forwardRef((e,t)=>{var ee,Ee,z,Q,X,D;const{__scopePopper:r,side:n="bottom",sideOffset:a=0,align:i="center",alignOffset:o=0,arrowPadding:s=0,avoidCollisions:l=!0,collisionBoundary:c=[],collisionPadding:u=0,sticky:f="partial",hideWhenDetached:p=!1,updatePositionStrategy:h="optimized",onPlaced:v,...g}=e,x=lO(c0,r),[b,y]=m.useState(null),w=be(t,Ne=>y(Ne)),[S,E]=m.useState(null),j=oO(S),P=(j==null?void 0:j.width)??0,k=(j==null?void 0:j.height)??0,N=n+(i!=="center"?"-"+i:""),O=typeof u=="number"?u:{top:0,right:0,bottom:0,left:0,...u},A=Array.isArray(c)?c:[c],T=A.length>0,L={padding:O,boundary:A.filter(JB),altBoundary:T},{refs:I,floatingStyles:q,placement:B,isPositioned:U,middlewareData:_}=$B({strategy:"fixed",placement:N,whileElementsMounted:(...Ne)=>NB(...Ne,{animationFrame:h==="always"}),elements:{reference:x.anchor},middleware:[BB({mainAxis:a+k,alignmentAxis:o}),l&&zB({mainAxis:!0,crossAxis:!1,limiter:f==="partial"?UB():void 0,...L}),l&&WB({...L}),qB({...L,apply:({elements:Ne,rects:de,availableWidth:st,availableHeight:lt})=>{const{width:hr,height:Du}=de.reference,Mu=Ne.floating.style;Mu.setProperty("--radix-popper-available-width",`${st}px`),Mu.setProperty("--radix-popper-available-height",`${lt}px`),Mu.setProperty("--radix-popper-anchor-width",`${hr}px`),Mu.setProperty("--radix-popper-anchor-height",`${Du}px`)}}),S&&KB({element:S,padding:s}),ez({arrowWidth:P,arrowHeight:k}),p&&HB({strategy:"referenceHidden",...L})]}),[$,W]=mO(B),re=Qt(v);_t(()=>{U&&(re==null||re())},[U,re]);const K=(ee=_.arrow)==null?void 0:ee.x,ot=(Ee=_.arrow)==null?void 0:Ee.y,ze=((z=_.arrow)==null?void 0:z.centerOffset)!==0,[Te,Xe]=m.useState();return _t(()=>{b&&Xe(window.getComputedStyle(b).zIndex)},[b]),d.jsx("div",{ref:I.setFloating,"data-radix-popper-content-wrapper":"",style:{...q,transform:U?q.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Te,"--radix-popper-transform-origin":[(Q=_.transformOrigin)==null?void 0:Q.x,(X=_.transformOrigin)==null?void 0:X.y].join(" "),...((D=_.hide)==null?void 0:D.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(QB,{scope:r,placedSide:$,onArrowChange:E,arrowX:K,arrowY:ot,shouldHideArrow:ze,children:d.jsx(se.div,{"data-side":$,"data-align":W,...g,ref:w,style:{...g.style,animation:U?void 0:"none"}})})})});fO.displayName=c0;var pO="PopperArrow",ZB={top:"bottom",right:"left",bottom:"top",left:"right"},hO=m.forwardRef(function(t,r){const{__scopePopper:n,...a}=t,i=XB(pO,n),o=ZB[i.placedSide];return d.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:d.jsx(YB,{...a,ref:r,style:{...a.style,display:"block"}})})});hO.displayName=pO;function JB(e){return e!==null}var ez=e=>({name:"transformOrigin",options:e,fn(t){var x,b,y;const{placement:r,rects:n,middlewareData:a}=t,o=((x=a.arrow)==null?void 0:x.centerOffset)!==0,s=o?0:e.arrowWidth,l=o?0:e.arrowHeight,[c,u]=mO(r),f={start:"0%",center:"50%",end:"100%"}[u],p=(((b=a.arrow)==null?void 0:b.x)??0)+s/2,h=(((y=a.arrow)==null?void 0:y.y)??0)+l/2;let v="",g="";return c==="bottom"?(v=o?f:`${p}px`,g=`${-l}px`):c==="top"?(v=o?f:`${p}px`,g=`${n.floating.height+l}px`):c==="right"?(v=`${-l}px`,g=o?f:`${h}px`):c==="left"&&(v=`${n.floating.width+l}px`,g=o?f:`${h}px`),{data:{x:v,y:g}}}});function mO(e){const[t,r="center"]=e.split("-");return[t,r]}var gO=cO,vO=dO,yO=fO,xO=hO,tz="Portal",Zp=m.forwardRef((e,t)=>{var s;const{container:r,...n}=e,[a,i]=m.useState(!1);_t(()=>i(!0),[]);const o=r||a&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return o?U$.createPortal(d.jsx(se.div,{...n,ref:t}),o):null});Zp.displayName=tz;var rz=Yy[" useInsertionEffect ".trim().toString()]||_t;function Po({prop:e,defaultProp:t,onChange:r=()=>{},caller:n}){const[a,i,o]=nz({defaultProp:t,onChange:r}),s=e!==void 0,l=s?e:a;{const u=m.useRef(e!==void 0);m.useEffect(()=>{const f=u.current;f!==s&&console.warn(`${n} is changing from ${f?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),u.current=s},[s,n])}const c=m.useCallback(u=>{var f;if(s){const p=az(u)?u(e):u;p!==e&&((f=o.current)==null||f.call(o,p))}else i(u)},[s,e,i,o]);return[l,c]}function nz({defaultProp:e,onChange:t}){const[r,n]=m.useState(e),a=m.useRef(r),i=m.useRef(t);return rz(()=>{i.current=t},[t]),m.useEffect(()=>{var o;a.current!==r&&((o=i.current)==null||o.call(i,r),a.current=r)},[r,a]),[r,n,i]}function az(e){return typeof e=="function"}function bO(e){const t=m.useRef({value:e,previous:e});return m.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}var wO=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),iz="VisuallyHidden",SO=m.forwardRef((e,t)=>d.jsx(se.span,{...e,ref:t,style:{...wO,...e.style}}));SO.displayName=iz;var oz=SO,sz=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},Vo=new WeakMap,id=new WeakMap,od={},Ym=0,EO=function(e){return e&&(e.host||EO(e.parentNode))},lz=function(e,t){return t.map(function(r){if(e.contains(r))return r;var n=EO(r);return n&&e.contains(n)?n:(console.error("aria-hidden",r,"in not contained inside",e,". Doing nothing"),null)}).filter(function(r){return!!r})},cz=function(e,t,r,n){var a=lz(t,Array.isArray(e)?e:[e]);od[r]||(od[r]=new WeakMap);var i=od[r],o=[],s=new Set,l=new Set(a),c=function(f){!f||s.has(f)||(s.add(f),c(f.parentNode))};a.forEach(c);var u=function(f){!f||l.has(f)||Array.prototype.forEach.call(f.children,function(p){if(s.has(p))u(p);else try{var h=p.getAttribute(n),v=h!==null&&h!=="false",g=(Vo.get(p)||0)+1,x=(i.get(p)||0)+1;Vo.set(p,g),i.set(p,x),o.push(p),g===1&&v&&id.set(p,!0),x===1&&p.setAttribute(r,"true"),v||p.setAttribute(n,"true")}catch(b){console.error("aria-hidden: cannot operate on ",p,b)}})};return u(t),s.clear(),Ym++,function(){o.forEach(function(f){var p=Vo.get(f)-1,h=i.get(f)-1;Vo.set(f,p),i.set(f,h),p||(id.has(f)||f.removeAttribute(n),id.delete(f)),h||f.removeAttribute(r)}),Ym--,Ym||(Vo=new WeakMap,Vo=new WeakMap,id=new WeakMap,od={})}},jO=function(e,t,r){r===void 0&&(r="data-aria-hidden");var n=Array.from(Array.isArray(e)?e:[e]),a=sz(e);return a?(n.push.apply(n,Array.from(a.querySelectorAll("[aria-live], script"))),cz(n,a,r,"aria-hidden")):function(){return null}},An=function(){return An=Object.assign||function(t){for(var r,n=1,a=arguments.length;n"u")return kz;var t=Cz(e),r=document.documentElement.clientWidth,n=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,n-r+t[2]-t[0])}},Oz=NO(),xs="data-scroll-locked",Az=function(e,t,r,n){var a=e.left,i=e.top,o=e.right,s=e.gap;return r===void 0&&(r="margin"),` .`.concat(dz,` { overflow: hidden `).concat(n,`; padding-right: `).concat(s,"px ").concat(n,`; @@ -349,7 +349,7 @@ prismjs/prism.js: * @namespace * @public *) -*/function Tn({data:e,fallback:t}){const{theme:r}=ul();if(!e)return d.jsx("pre",{className:"text-xs whitespace-pre-wrap break-all",children:t||"No data"});let n,a=!1;try{const i=JSON.parse(e);n=JSON.stringify(i,null,2),a=!0}catch{n=e}return a?d.jsx(Zae,{theme:r==="dark"?By.nightOwl:By.github,code:n,language:"json",children:({className:i,style:o,tokens:s,getLineProps:l,getTokenProps:c})=>d.jsx("pre",{className:`text-xs ${i}`,style:o,children:s.map((u,f)=>d.jsx("div",{...l({line:u}),children:u.map((p,h)=>d.jsx("span",{...c({token:p})},h))},f))})}):d.jsx("pre",{className:"text-xs whitespace-pre-wrap break-all",children:e})}function Jae(){var x,b;const{requestId:e}=rF(),t=zp(),[r,n]=m.useState(null),[a,i]=m.useState(null),{data:o,isLoading:s,isError:l,error:c}=tt({queryKey:["request-detail",e],queryFn:()=>e?Me.getRequestDetail(e):null,enabled:!!e}),u=j3({mutationFn:y=>Me.replayRequest(y),onSuccess:y=>{t(`/requests/${y.new_request_id}`)}}),f=(y,w)=>{navigator.clipboard.writeText(y),n(w),setTimeout(()=>n(null),2e3)},p=async()=>{if(e){i(null);try{const y=await Me.getRequestAsCurl(e);f(y.curl,"curl")}catch(y){const w=y instanceof Error?y.message:"Failed to export as cURL";i(w),setTimeout(()=>i(null),3e3)}}},h=y=>{if(!y)return null;try{return JSON.stringify(y,null,2)}catch{return String(y)}},v=y=>y?y>=200&&y<300?"default":y>=300&&y<400?"secondary":"destructive":"secondary",g=y=>y?y<1e3?`${y}ms`:`${(y/1e3).toFixed(2)}s`:"0ms";return s?d.jsx("div",{className:"flex items-center justify-center h-screen",children:d.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}):l?d.jsxs("div",{className:"flex flex-col items-center justify-center h-screen gap-4",children:[d.jsx(ne,{className:"border-destructive max-w-md",children:d.jsxs(ae,{className:"py-8 text-center",children:[d.jsx("p",{className:"text-destructive font-medium",children:"Failed to load request"}),d.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:c instanceof Error?c.message:"Unknown error"})]})}),d.jsxs(oe,{onClick:()=>t("/requests"),children:[d.jsx(Um,{className:"h-4 w-4 mr-2"}),"Back to Requests"]})]}):o?d.jsxs("div",{className:"container mx-auto py-6 space-y-6 max-w-7xl",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs(oe,{variant:"ghost",onClick:()=>t("/requests"),children:[d.jsx(Um,{className:"h-4 w-4 mr-2"}),"Back"]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs(oe,{variant:"outline",size:"sm",onClick:p,children:[d.jsx(On,{className:"h-4 w-4 mr-2"}),r==="curl"?"Copied!":"Export as cURL"]}),d.jsxs(oe,{variant:"outline",size:"sm",onClick:()=>e&&u.mutate(e),disabled:u.isPending,children:[d.jsx(X4,{className:"h-4 w-4 mr-2"}),u.isPending?"Replaying...":"Replay"]})]})]}),a&&d.jsx(ne,{className:"border-destructive",children:d.jsx(ae,{className:"py-4",children:d.jsx("p",{className:"text-destructive text-sm",children:a})})}),d.jsxs(ne,{children:[d.jsx(ue,{children:d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(ve,{variant:v(o.status_code),className:"text-lg px-3 py-1",children:o.status_code||"Pending"}),d.jsx("span",{className:"text-2xl font-bold font-mono",children:o.method})]}),d.jsx("p",{className:"text-lg text-muted-foreground break-all",children:o.path})]}),d.jsx(ve,{variant:"outline",className:"text-lg px-3 py-1",children:g(o.duration_ms)})]})}),d.jsxs(ae,{children:[d.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-6",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("p",{className:"text-sm text-muted-foreground",children:"Timestamp"}),d.jsx("p",{className:"font-medium",children:Rn(new Date(o.created_at),"PPpp")})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("p",{className:"text-sm text-muted-foreground",children:"Client IP"}),d.jsx("p",{className:"font-medium",children:o.client_ip||"Unknown"})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("p",{className:"text-sm text-muted-foreground",children:"Queries"}),d.jsx("p",{className:"font-medium",children:o.queries.length})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("p",{className:"text-sm text-muted-foreground",children:"Exceptions"}),d.jsx("p",{className:"font-medium",children:o.exceptions.length})]})]}),d.jsx(go,{className:"my-4"}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("p",{className:"text-sm text-muted-foreground",children:"Request ID"}),d.jsx("p",{className:"font-mono text-sm break-all",children:o.request_id})]}),d.jsxs("div",{className:"space-y-2 mt-4",children:[d.jsx("p",{className:"text-sm text-muted-foreground",children:"Full URL"}),d.jsx("p",{className:"font-mono text-sm break-all",children:o.url})]})]})]}),u.isSuccess&&d.jsxs(ne,{className:"border-green-500",children:[d.jsx(ue,{children:d.jsxs(fe,{className:"flex items-center justify-between",children:[d.jsx("span",{children:"Replay Successful"}),d.jsx(ve,{variant:u.data.status_code<400?"default":"destructive",children:u.data.status_code})]})}),d.jsxs(ae,{className:"space-y-2",children:[d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"text-muted-foreground",children:"Duration:"}),d.jsxs("span",{className:"font-mono",children:[u.data.elapsed_ms.toFixed(0),"ms"]})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"text-muted-foreground",children:"Original:"}),d.jsxs("span",{className:"font-mono",children:[(x=u.data.original_duration_ms)==null?void 0:x.toFixed(0),"ms"]})]})]})]}),u.isError&&d.jsx(ne,{className:"border-destructive",children:d.jsx(ae,{className:"py-4",children:d.jsxs("p",{className:"text-destructive",children:["Replay failed: ",(b=u.error)==null?void 0:b.message]})})}),d.jsx(ne,{children:d.jsxs(rm,{defaultValue:"overview",className:"w-full",children:[d.jsx(ue,{children:d.jsxs(_u,{className:"grid w-full grid-cols-5",children:[d.jsx(pt,{value:"overview",children:"Overview"}),d.jsx(pt,{value:"headers",children:"Headers"}),d.jsx(pt,{value:"body",children:"Request"}),d.jsx(pt,{value:"response",children:"Response"}),d.jsxs(pt,{value:"queries",children:["Queries ",o.queries.length>0&&`(${o.queries.length})`]})]})}),d.jsxs(ae,{children:[d.jsx(Bt,{value:"overview",className:"space-y-4",children:d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[d.jsxs(ne,{children:[d.jsx(ue,{children:d.jsx(fe,{className:"text-sm",children:"Request Info"})}),d.jsxs(ae,{className:"space-y-2 text-sm",children:[d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"text-muted-foreground",children:"Method:"}),d.jsx("span",{className:"font-mono",children:o.method})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"text-muted-foreground",children:"Status:"}),d.jsx("span",{className:"font-mono",children:o.status_code})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"text-muted-foreground",children:"Duration:"}),d.jsx("span",{className:"font-mono",children:g(o.duration_ms)})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"text-muted-foreground",children:"Queries:"}),d.jsx("span",{className:"font-mono",children:o.queries.length})]})]})]}),d.jsxs(ne,{children:[d.jsx(ue,{children:d.jsx(fe,{className:"text-sm",children:"Timeline"})}),d.jsxs(ae,{className:"space-y-2 text-sm",children:[d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"text-muted-foreground",children:"Created:"}),d.jsx("span",{children:Rn(new Date(o.created_at),"HH:mm:ss")})]}),o.queries.length>0&&d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"text-muted-foreground",children:"DB Time:"}),d.jsxs("span",{className:"font-mono",children:[o.queries.reduce((y,w)=>y+(w.duration_ms||0),0).toFixed(0),"ms"]})]})]})]})]})}),d.jsx(Bt,{value:"headers",className:"space-y-4",children:d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("h3",{className:"text-sm font-medium",children:"Request Headers"}),d.jsxs(oe,{size:"sm",variant:"ghost",onClick:()=>f(h(o.headers)||"","req-headers"),children:[d.jsx(On,{className:"h-3 w-3 mr-1"}),r==="req-headers"?"Copied":"Copy"]})]}),d.jsx(Lt,{className:"h-[300px] rounded-md border p-4",children:d.jsx(Tn,{data:h(o.headers),fallback:"No request headers"})})]}),o.response_headers&&d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("h3",{className:"text-sm font-medium",children:"Response Headers"}),d.jsxs(oe,{size:"sm",variant:"ghost",onClick:()=>f(h(o.response_headers)||"","res-headers"),children:[d.jsx(On,{className:"h-3 w-3 mr-1"}),r==="res-headers"?"Copied":"Copy"]})]}),d.jsx(Lt,{className:"h-[300px] rounded-md border p-4",children:d.jsx(Tn,{data:h(o.response_headers),fallback:"No response headers"})})]})]})}),d.jsxs(Bt,{value:"body",className:"space-y-4",children:[o.query_params&&Object.keys(o.query_params).length>0&&d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-medium mb-2",children:"Query Parameters"}),d.jsx(Lt,{className:"h-[150px] rounded-md border p-4",children:d.jsx(Tn,{data:h(o.query_params)})})]}),d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("h3",{className:"text-sm font-medium",children:"Request Body"}),d.jsxs(oe,{size:"sm",variant:"ghost",onClick:()=>f(o.body||"","body"),children:[d.jsx(On,{className:"h-3 w-3 mr-1"}),r==="body"?"Copied":"Copy"]})]}),d.jsx(Lt,{className:"h-[400px] rounded-md border p-4",children:d.jsx(Tn,{data:o.body,fallback:"No request body"})})]})]}),d.jsx(Bt,{value:"response",className:"space-y-4",children:d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("h3",{className:"text-sm font-medium",children:"Response Body"}),d.jsxs(oe,{size:"sm",variant:"ghost",onClick:()=>f(o.response_body||"","response"),children:[d.jsx(On,{className:"h-3 w-3 mr-1"}),r==="response"?"Copied":"Copy"]})]}),d.jsx(Lt,{className:"h-[500px] rounded-md border p-4",children:d.jsx(Tn,{data:o.response_body,fallback:"No response body"})})]})}),d.jsx(Bt,{value:"queries",className:"space-y-4",children:o.queries.length===0?d.jsx("p",{className:"text-center text-muted-foreground py-8",children:"No database queries captured"}):d.jsx("div",{className:"space-y-3",children:o.queries.map((y,w)=>{var S;return d.jsxs(ne,{children:[d.jsx(ue,{className:"py-3",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs(fe,{className:"text-sm",children:["Query #",w+1]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(ve,{variant:"outline",children:[(S=y.duration_ms)==null?void 0:S.toFixed(0),"ms"]}),y.rows_affected!==null&&d.jsxs(ve,{variant:"secondary",children:[y.rows_affected," rows"]})]})]})}),d.jsxs(ae,{children:[d.jsx(Lt,{className:"h-[120px] rounded-md border p-3",children:d.jsx("pre",{className:"text-xs whitespace-pre-wrap break-all",children:y.sql})}),y.parameters&&y.parameters.length>0&&d.jsxs("div",{className:"mt-2",children:[d.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Parameters"}),d.jsx("code",{className:"text-xs bg-muted px-2 py-1 rounded",children:JSON.stringify(y.parameters)})]})]})]},y.id)})})})]})]})}),o.exceptions.length>0&&d.jsxs(ne,{className:"border-destructive",children:[d.jsx(ue,{children:d.jsx(fe,{children:"Exceptions"})}),d.jsx(ae,{className:"space-y-3",children:o.exceptions.map(y=>d.jsxs(ne,{className:"border-destructive/50",children:[d.jsx(ue,{className:"py-3",children:d.jsx(fe,{className:"text-sm text-destructive",children:y.exception_type})}),d.jsxs(ae,{children:[y.exception_value&&d.jsx("p",{className:"text-sm mb-2",children:y.exception_value}),d.jsx(Lt,{className:"h-[200px] rounded-md border border-destructive/20 p-3",children:d.jsx("pre",{className:"text-xs text-destructive whitespace-pre-wrap break-all",children:y.traceback})})]})]},y.id))})]})]}):d.jsxs("div",{className:"flex flex-col items-center justify-center h-screen gap-4",children:[d.jsx("div",{className:"text-muted-foreground",children:"Request not found"}),d.jsxs(oe,{onClick:()=>t("/requests"),children:[d.jsx(Um,{className:"h-4 w-4 mr-2"}),"Back to Requests"]})]})}function eie(e){return e?e<1e3?`${e.toFixed(0)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`:"N/A"}function tie(e){switch(e.toLowerCase()){case"ok":case"success":return d.jsx(Xx,{className:"h-4 w-4 text-green-500"});case"error":case"failure":return d.jsx(Bo,{className:"h-4 w-4 text-red-500"});default:return d.jsx(ou,{className:"h-4 w-4 text-blue-500"})}}function rie(e){switch(e.toLowerCase()){case"ok":case"success":return"default";case"error":case"failure":return"destructive";default:return"secondary"}}function nie({className:e}){const{openDetail:t}=Uo(),r=Tr(),[n,a]=m.useState({search:"",status:"all",service:"",hours:24,minDuration:0}),[i,o]=m.useState(0),s=50,{data:l=[],isLoading:c,error:u,refetch:f}=tt({queryKey:["traces",n,i],queryFn:()=>Me.getTraces({limit:s,offset:i*s,status:n.status==="all"?void 0:n.status,service_name:n.service||void 0,min_duration_ms:n.minDuration||void 0,hours:n.hours}),refetchInterval:3e4}),p=h=>{t("trace",h.trace_id)};return u?d.jsx(ne,{className:e,children:d.jsx(ae,{className:"p-6",children:d.jsxs("div",{className:"text-center",children:[d.jsx(Bo,{className:"h-12 w-12 text-destructive mx-auto mb-4"}),d.jsx("h3",{className:"text-lg font-semibold mb-2",children:r("traceslist.failToLoadTraces")}),d.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:r("traceslist.anError")}),d.jsxs(oe,{onClick:()=>f(),children:[d.jsx(Ac,{className:"h-4 w-4 mr-2"}),r("traceslist.tryAgain")]})]})})}):d.jsxs("div",{className:e,children:[d.jsx(ne,{className:"mb-6",children:d.jsx(ae,{className:"p-4",children:d.jsxs("div",{className:"flex flex-wrap gap-4",children:[d.jsx("div",{className:"flex-1 min-w-[200px]",children:d.jsxs("div",{className:"relative",children:[d.jsx(FN,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),d.jsx(nm,{placeholder:r("traceslist.search"),value:n.search,onChange:h=>a({...n,search:h.target.value}),className:"pl-9"})]})}),d.jsxs(No,{value:n.status,onValueChange:h=>a({...n,status:h}),children:[d.jsx(Pi,{className:"w-[150px]",children:d.jsx(Oo,{placeholder:r("traceslist.allStatuses")})}),d.jsxs(ki,{children:[d.jsx(Pe,{value:"all",children:r("traceslist.all")}),d.jsx(Pe,{value:"ok",children:r("traceslist.success")}),d.jsx(Pe,{value:"error",children:r("traceslist.error")})]})]}),d.jsxs(No,{value:n.hours.toString(),onValueChange:h=>a({...n,hours:parseInt(h)}),children:[d.jsx(Pi,{className:"w-[150px]",children:d.jsx(Oo,{})}),d.jsxs(ki,{children:[d.jsx(Pe,{value:"1",children:r("traceslist.lastHour")}),d.jsx(Pe,{value:"6",children:r("traceslist.last6Hours")}),d.jsx(Pe,{value:"24",children:r("traceslist.last24Hours")}),d.jsx(Pe,{value:"168",children:r("traceslist.lastWeek")})]})]}),d.jsxs(oe,{onClick:()=>f(),size:"sm",variant:"outline",children:[d.jsx(Ac,{className:"h-4 w-4 mr-2"}),r("traceslist.refresh")]})]})})}),d.jsx(ne,{children:d.jsxs(ae,{className:"p-0",children:[c?d.jsx("div",{className:"p-6",children:d.jsx("div",{className:"space-y-4",children:[...Array(5)].map((h,v)=>d.jsx("div",{className:"animate-pulse",children:d.jsx("div",{className:"h-16 bg-muted rounded"})},v))})}):l.length===0?d.jsxs("div",{className:"p-6 text-center text-muted-foreground",children:[d.jsx(ou,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),d.jsx("p",{children:"No traces found matching your criteria."})]}):d.jsx("div",{className:"divide-y",children:l.map(h=>d.jsx("div",{className:"p-4 hover:bg-muted/50 cursor-pointer transition-colors",onClick:()=>p(h),children:d.jsx("div",{className:"flex items-start justify-between",children:d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[tie(h.status),d.jsx("h3",{className:"font-medium truncate",children:h.operation_name||"Unknown Operation"}),d.jsx(ve,{variant:rie(h.status),className:"text-xs",children:h.status})]}),d.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[d.jsxs("span",{children:["Service: ",h.service_name||"Unknown"]}),d.jsxs("span",{children:["Spans: ",h.span_count]}),d.jsxs("span",{children:["Duration: ",eie(h.duration_ms)]})]}),d.jsxs("div",{className:"flex items-center gap-2 mt-1 text-xs text-muted-foreground",children:[d.jsx(zo,{className:"h-3 w-3"}),d.jsx("span",{children:W6(new Date(h.start_time),{addSuffix:!0})}),d.jsx("span",{className:"text-muted-foreground/60",children:"•"}),d.jsxs("span",{children:[h.trace_id.slice(0,8),"..."]})]})]})})},h.trace_id))}),l.length===s&&d.jsx("div",{className:"p-4 border-t flex justify-center",children:d.jsx(oe,{variant:"outline",onClick:()=>o(i+1),children:"Load more"})})]})})]})}function aie(){const e=Tr();return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:e("pages.tracing.title")}),d.jsx("p",{className:"text-muted-foreground",children:e("pages.tracing.description")})]}),d.jsxs(ne,{children:[d.jsxs(ue,{children:[d.jsx(fe,{children:e("pages.tracing.tracesCardTitle")}),d.jsx(bt,{children:e("pages.tracing.tracesCardDescription")})]}),d.jsx(ae,{children:d.jsx(nie,{})})]})]})}function iie(){const[e,t]=m.useState("1h"),[r,n]=m.useState(5e3),{openDetail:a}=Uo(),i=Tr(),o=e==="1h"?1:e==="24h"?24:168,{data:s}=tt({queryKey:["performance-stats",e],queryFn:()=>Me.getStats(o),refetchInterval:r}),{data:l}=tt({queryKey:["performance-requests",e],queryFn:()=>Me.getRequests({limit:100}),refetchInterval:r}),{data:c}=tt({queryKey:["performance-queries",e],queryFn:()=>Me.getQueries({limit:100}),refetchInterval:r}),{data:u}=tt({queryKey:["performance-exceptions",e],queryFn:()=>Me.getExceptions({limit:100}),refetchInterval:r}),f=SA({requests:l,queries:c,exceptions:u,stats:s}),p=[{type:"successRate",label:i("metrics.successRate"),value:f.successRate,status:f.successRate>=99?"success":f.successRate>=95?"warning":"error",description:`${i("common.all")} ${f.totalRequests} ${i("metrics.totalRequests").toLowerCase()}`},{type:"avgResponseTime",label:i("metrics.avgResponseTime"),value:ar(f.avgResponseTime),rawValue:f.avgResponseTime,status:!f.avgResponseTime||f.avgResponseTime<100?"success":f.avgResponseTime<300?"warning":"error"},{type:"errorRate",label:i("metrics.errorRate"),value:`${f.errorRate.toFixed(1)}%`,rawValue:f.errorRate,status:f.errorRate<=1?"success":f.errorRate<=2?"warning":"error"},{type:"queryPerformance",label:i("performance.queryPerformance"),value:ar(f.avgQueryTime),rawValue:f.avgQueryTime,status:!f.avgQueryTime||f.avgQueryTime<50?"success":f.avgQueryTime<100?"warning":"error"}],h=f.endpointMetrics.slice(0,10).map(g=>({name:g.name,responseTime:g.avgResponseTime,calls:g.calls})),v=[{category:i("requests.statusFilters.clientErrors"),count:(l==null?void 0:l.filter(g=>g.status_code&&g.status_code>=400&&g.status_code<500).length)||0},{category:i("requests.statusFilters.serverErrors"),count:(l==null?void 0:l.filter(g=>g.status_code&&g.status_code>=500).length)||0},{category:i("metrics.exceptions"),count:f.totalExceptions}];return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:i("pages.performance.title")}),d.jsx("p",{className:"text-muted-foreground",children:i("pages.performance.description")})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(No,{value:e,onValueChange:t,children:[d.jsx(Pi,{className:"w-32",children:d.jsx(Oo,{})}),d.jsxs(ki,{children:[d.jsx(Pe,{value:"1h",children:i("timeRange.lastHour")}),d.jsx(Pe,{value:"24h",children:i("timeRange.last24Hours")}),d.jsx(Pe,{value:"7d",children:i("timeRange.last7Days")})]})]}),d.jsxs(No,{value:r.toString(),onValueChange:g=>n(parseInt(g)),children:[d.jsx(Pi,{className:"w-40",children:d.jsx(Oo,{})}),d.jsxs(ki,{children:[d.jsxs(Pe,{value:"5000",children:[i("common.refresh"),": 5s"]}),d.jsxs(Pe,{value:"10000",children:[i("common.refresh"),": 10s"]}),d.jsxs(Pe,{value:"30000",children:[i("common.refresh"),": 30s"]}),d.jsxs(Pe,{value:"0",children:[i("common.refresh"),": ",i("common.no")]})]})]})]})]}),d.jsx("div",{className:"grid gap-4 md:grid-cols-4",children:p.map(g=>d.jsxs(ne,{children:[d.jsxs(ue,{className:"pb-2",children:[d.jsx(fe,{className:"text-sm font-medium",children:g.label}),g.description&&d.jsx(bt,{className:"text-xs",children:g.description})]}),d.jsx(ae,{children:d.jsxs("div",{className:"space-y-3",children:[d.jsx("div",{className:"text-2xl font-bold tabular-nums",children:g.value}),d.jsx(Tf,{status:g.status,label:g.status==="success"?i("performance.excellent"):g.status==="warning"?i("performance.acceptable"):i("performance.needsAttention"),compact:!0}),g.rawValue!==void 0&&d.jsx(Vd,{label:"",value:g.type==="successRate"||g.type==="errorRate"?g.rawValue:g.type==="avgResponseTime"?Math.min(g.rawValue/1e3*100,100):g.type==="queryPerformance"?Math.min(g.rawValue/200*100,100):0,max:100,showPercentage:!1,compact:!0,status:g.status==="success"?"success":g.status==="warning"?"warning":"danger"})]})})]},g.label))}),d.jsxs(rm,{defaultValue:"overview",className:"space-y-4",children:[d.jsxs(_u,{children:[d.jsx(pt,{value:"overview",children:i("performance.overview")}),d.jsx(pt,{value:"endpoints",children:i("performance.endpointPerformance")}),d.jsx(pt,{value:"queries",children:i("nav.database")}),d.jsx(pt,{value:"errors",children:i("performance.errorAnalysis")})]}),d.jsxs(Bt,{value:"overview",className:"space-y-4",children:[d.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[d.jsxs(ne,{children:[d.jsx(ue,{className:"pb-3",children:d.jsx(fe,{className:"text-base",children:i("metrics.responseTime")})}),d.jsxs(ae,{className:"space-y-3",children:[d.jsx(ct,{label:i("performance.p50Median"),value:ar(f.responseTimePercentiles.p50)}),d.jsx(ct,{label:i("performance.p95"),value:ar(f.responseTimePercentiles.p95)}),d.jsx(ct,{label:i("performance.p99"),value:ar(f.responseTimePercentiles.p99)}),d.jsx(r9,{value:f.avgResponseTime||0,max:1e3,label:i("performance.average"),thresholds:[{value:100,label:"100ms"},{value:300,label:"300ms"},{value:1e3,label:"1s"}]})]})]}),d.jsxs(ne,{children:[d.jsx(ue,{className:"pb-3",children:d.jsx(fe,{className:"text-base",children:i("performance.throughput")})}),d.jsxs(ae,{className:"space-y-3",children:[d.jsx(ct,{label:i("performance.requestsPerSec"),value:f.requestsPerSecond.toFixed(1)}),d.jsx(ct,{label:i("metrics.totalRequests"),value:IS(s==null?void 0:s.total_requests)}),d.jsx(ct,{label:i("performance.totalQueries"),value:IS(s==null?void 0:s.total_queries)}),d.jsx(ct,{label:i("performance.queriesPerRequest"),value:s!=null&&s.total_queries&&(s!=null&&s.total_requests)?(s.total_queries/s.total_requests).toFixed(1):"0"})]})]}),d.jsxs(ne,{children:[d.jsx(ue,{className:"pb-3",children:d.jsx(fe,{className:"text-base",children:i("performance.errorAnalysis")})}),d.jsxs(ae,{className:"space-y-3",children:[d.jsx(NA,{value:100-f.errorRate,size:"sm",label:i("performance.healthScore")}),d.jsx(ct,{label:i("requests.tabs.failed"),value:f.failedRequests}),d.jsx(ct,{label:i("metrics.errorRate"),value:`${f.errorRate.toFixed(1)}%`}),d.jsx(ct,{label:i("metrics.exceptions"),value:f.totalExceptions})]})]})]}),d.jsxs(ne,{children:[d.jsxs(ue,{children:[d.jsx(fe,{children:i("performance.performanceSummary")}),d.jsxs(bt,{children:[i("performance.realTimeMetrics")," ",f.totalRequests," ",i("performance.recentRequests")]})]}),d.jsx(ae,{children:d.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-6",children:[d.jsx(ln,{label:i("metrics.successRate"),value:`${f.successRate.toFixed(1)}%`,minimal:!0}),d.jsx(ln,{label:i("performance.avgResponse"),value:ar(f.avgResponseTime),minimal:!0}),d.jsx(ln,{label:i("performance.slowRequests"),value:f.slowRequests,minimal:!0}),d.jsx(ln,{label:i("performance.activeEndpoints"),value:f.endpointMetrics.length,minimal:!0})]})})]})]}),d.jsx(Bt,{value:"endpoints",className:"space-y-4",children:d.jsxs(ne,{children:[d.jsxs(ue,{children:[d.jsx(fe,{children:i("performance.endpointPerformance")}),d.jsx(bt,{children:i("performance.performanceBreakdown")})]}),d.jsxs(ae,{className:"space-y-6",children:[h.length>0&&d.jsx(lne,{title:i("performance.responseTimesByEndpoint"),data:h,bars:[{dataKey:"responseTime",name:i("metrics.avgResponseTime")}],height:300,formatter:"duration",minimal:!0,horizontal:!0}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("h4",{className:"text-sm font-medium",children:i("performance.detailedMetrics")}),f.endpointMetrics.map(g=>d.jsxs("div",{className:"space-y-2 p-3 border rounded-lg",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("code",{className:"text-sm font-mono",children:g.name}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(ve,{variant:"outline",children:[g.calls," ",i("performance.calls")]}),g.errors>0&&d.jsxs(ve,{variant:"destructive",children:[g.errors," ",i("performance.errors")]})]})]}),d.jsx(Vd,{label:`${g.avgResponseTime}ms average`,value:Math.min(g.avgResponseTime/500*100,100),showPercentage:!1,sublabel:`${i("performance.successRate")}: ${g.successRate}%`,compact:!0})]},g.name)),f.endpointMetrics.length===0&&d.jsx("p",{className:"text-center text-muted-foreground py-4",children:i("performance.noEndpointData")})]})]})]})}),d.jsx(Bt,{value:"queries",className:"space-y-4",children:d.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[d.jsxs(ne,{children:[d.jsx(ue,{children:d.jsx(fe,{children:i("performance.queryStatistics")})}),d.jsxs(ae,{className:"space-y-3",children:[d.jsx(ct,{label:i("performance.totalQueries"),value:f.totalQueries}),d.jsx(ct,{label:i("performance.slowQueries"),value:f.slowQueries}),d.jsx(ct,{label:i("performance.avgQueryTime"),value:ar(f.avgQueryTime)}),d.jsx(Vd,{label:i("performance.queryPerformanceScore"),value:f.avgQueryTime?100-Math.min(f.avgQueryTime/200*100,100):100,status:!f.avgQueryTime||f.avgQueryTime<50?"success":f.avgQueryTime<100?"warning":"danger"})]})]}),d.jsxs(ne,{children:[d.jsxs(ue,{children:[d.jsx(fe,{children:i("performance.slowQueriesTitle")}),d.jsxs(bt,{children:[i("database.slowThreshold"),": 100ms"]})]}),d.jsx(ae,{children:d.jsxs("div",{className:"space-y-2",children:[c==null?void 0:c.filter(g=>g.duration_ms&&g.duration_ms>100).slice(0,5).map(g=>d.jsxs("div",{className:"text-xs cursor-pointer hover:bg-muted/50 p-2 rounded transition-colors",onClick:()=>a("request",g.request_id),children:[d.jsx("code",{className:"block truncate",children:g.sql}),d.jsxs("div",{className:"flex items-center justify-between mt-1",children:[d.jsx("span",{className:"text-muted-foreground",children:new Date(g.created_at).toLocaleTimeString()}),d.jsx(ve,{variant:"outline",className:"text-xs",children:ar(g.duration_ms)})]})]},g.id)),(!c||c.filter(g=>g.duration_ms&&g.duration_ms>100).length===0)&&d.jsx("p",{className:"text-center text-muted-foreground py-4",children:i("performance.noSlowQueries")})]})})]})]})}),d.jsx(Bt,{value:"errors",className:"space-y-4",children:d.jsxs(ne,{children:[d.jsxs(ue,{children:[d.jsx(fe,{children:i("performance.errorAnalysisTitle")}),d.jsx(bt,{children:i("performance.errorAnalysis")})]}),d.jsxs(ae,{className:"space-y-6",children:[d.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[d.jsx(ln,{label:i("requests.tabs.failed"),value:f.failedRequests,minimal:!0}),d.jsx(ln,{label:i("metrics.errorRate"),value:`${f.errorRate.toFixed(1)}%`,minimal:!0}),d.jsx(ln,{label:i("metrics.exceptions"),value:f.totalExceptions,minimal:!0})]}),d.jsx($D,{data:v}),d.jsxs("div",{className:"space-y-3",children:[d.jsx("h4",{className:"text-sm font-medium",children:"Recent Exceptions"}),u==null?void 0:u.slice(0,10).map(g=>d.jsx(Tf,{status:"error",label:g.exception_type,description:g.exception_value||void 0,value:new Date(g.created_at).toLocaleTimeString(),className:"cursor-pointer hover:bg-muted/50 p-2 -mx-2 rounded transition-colors",onClick:()=>a("request",g.request_id)},g.id)),(!u||u.length===0)&&d.jsx("p",{className:"text-center text-muted-foreground py-4",children:i("performance.noExceptionsCaptured")})]})]})]})})]})]})}function oie(){const{theme:e,setTheme:t}=ul(),{t:r}=e0(),{language:n,setLanguage:a}=u5(),{data:i,isLoading:o}=tt({queryKey:["settings-stats"],queryFn:()=>Me.getStats(24*7),refetchInterval:3e4}),s=async()=>{confirm("Are you sure you want to clear all captured data?")&&(await Me.clearData(),window.location.reload())},l=async c=>{const u=c/24,f=u===1?"1 day":`${u} days`;confirm(`Are you sure you want to clear data older than ${f}?`)&&(await Me.clearData(c),window.location.reload())};return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:r("pages.settings.title")}),d.jsx("p",{className:"text-muted-foreground",children:r("pages.settings.description")})]}),d.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[d.jsxs(ne,{children:[d.jsxs(ue,{children:[d.jsx(fe,{children:r("settings.appearance.title")}),d.jsx(bt,{children:r("settings.appearance.description")})]}),d.jsx(ae,{className:"space-y-4",children:d.jsxs("div",{className:"space-y-2",children:[d.jsx(Wr,{children:r("settings.appearance.theme")}),d.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:r("settings.appearance.themeDescription")}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(oe,{variant:e==="light"?"default":"outline",size:"sm",onClick:()=>t("light"),children:[d.jsx(BN,{className:"mr-2 h-4 w-4"}),r("settings.appearance.light")]}),d.jsxs(oe,{variant:e==="dark"?"default":"outline",size:"sm",onClick:()=>t("dark"),children:[d.jsx($N,{className:"mr-2 h-4 w-4"}),r("settings.appearance.dark")]})]})]})})]}),d.jsxs(ne,{children:[d.jsxs(ue,{children:[d.jsx(fe,{children:r("settings.language.title")}),d.jsx(bt,{children:r("settings.language.description")})]}),d.jsx(ae,{className:"space-y-4",children:d.jsxs("div",{className:"space-y-2",children:[d.jsx(Wr,{children:r("settings.language.current")}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(oe,{variant:n==="en"?"default":"outline",size:"sm",onClick:()=>a("en"),children:[d.jsx(nS,{className:"mr-2 h-4 w-4"}),r("settings.language.english")]}),d.jsxs(oe,{variant:n==="zh"?"default":"outline",size:"sm",onClick:()=>a("zh"),children:[d.jsx(nS,{className:"mr-2 h-4 w-4"}),r("settings.language.chinese")]})]})]})})]}),d.jsxs(ne,{children:[d.jsxs(ue,{children:[d.jsx(fe,{children:r("settings.database.title")}),d.jsx(bt,{children:r("settings.database.description")})]}),d.jsx(ae,{className:"space-y-3",children:o?d.jsx("div",{className:"text-center py-4 text-sm text-muted-foreground",children:r("settings.database.loading")}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-sm text-muted-foreground",children:r("settings.database.totalRequests")}),d.jsx("span",{className:"font-medium",children:(i==null?void 0:i.total_requests)!==void 0?i.total_requests.toLocaleString():"—"})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-sm text-muted-foreground",children:r("settings.database.totalQueries")}),d.jsx("span",{className:"font-medium",children:(i==null?void 0:i.total_queries)!==void 0?i.total_queries.toLocaleString():"—"})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-sm text-muted-foreground",children:r("settings.database.totalExceptions")}),d.jsx("span",{className:"font-medium",children:(i==null?void 0:i.total_exceptions)!==void 0?i.total_exceptions.toLocaleString():"—"})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-sm text-muted-foreground",children:r("settings.database.slowQueries")}),d.jsx("span",{className:"font-medium",children:(i==null?void 0:i.slow_queries)!==void 0?i.slow_queries.toLocaleString():"—"})]}),d.jsx(go,{}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-sm text-muted-foreground",children:r("settings.database.avgResponseTime")}),d.jsx("span",{className:"font-medium",children:(i==null?void 0:i.avg_response_time)!==null&&(i==null?void 0:i.avg_response_time)!==void 0?`${Math.round(i.avg_response_time)}ms`:"—"})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-sm text-muted-foreground",children:r("settings.database.requestsPerMinute")}),d.jsx("span",{className:"font-medium",children:(i==null?void 0:i.requests_per_minute)!==void 0?i.requests_per_minute.toFixed(1):"—"})]})]})})]}),d.jsxs(ne,{className:"md:col-span-2",children:[d.jsxs(ue,{children:[d.jsx(fe,{children:r("settings.dataManagement.title")}),d.jsx(bt,{children:r("settings.dataManagement.description")})]}),d.jsxs(ae,{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Wr,{children:r("settings.dataManagement.quickActions")}),d.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:r("settings.dataManagement.quickActionsDescription")}),d.jsxs("div",{className:"grid gap-2 sm:grid-cols-3",children:[d.jsxs(oe,{variant:"outline",className:"justify-start",onClick:()=>l(24),children:[d.jsx(Ud,{className:"mr-2 h-4 w-4"}),r("settings.dataManagement.clear1Day")]}),d.jsxs(oe,{variant:"outline",className:"justify-start",onClick:()=>l(24*7),children:[d.jsx(Ud,{className:"mr-2 h-4 w-4"}),r("settings.dataManagement.clear7Days")]}),d.jsxs(oe,{variant:"outline",className:"justify-start",onClick:()=>l(24*30),children:[d.jsx(Ud,{className:"mr-2 h-4 w-4"}),r("settings.dataManagement.clear30Days")]})]})]}),d.jsx(go,{}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Wr,{children:r("settings.dataManagement.dangerZone")}),d.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:r("settings.dataManagement.dangerZoneDescription")}),d.jsxs(oe,{variant:"destructive",onClick:s,children:[d.jsx(Bo,{className:"mr-2 h-4 w-4"}),r("settings.dataManagement.clearAll")]})]})]})]}),d.jsxs(ne,{className:"md:col-span-2",children:[d.jsxs(ue,{children:[d.jsx(fe,{children:r("settings.about.title")}),d.jsx(bt,{children:r("settings.about.description")})]}),d.jsxs(ae,{className:"space-y-4",children:[d.jsxs("div",{className:"text-sm text-muted-foreground",children:[d.jsx("p",{className:"mb-2",children:r("settings.about.content")}),d.jsx("p",{children:d.jsxs("strong",{children:[r("settings.about.features"),":"]})}),d.jsxs("ul",{className:"list-disc list-inside mt-1 space-y-1",children:[d.jsx("li",{children:r("settings.about.feature1")}),d.jsx("li",{children:r("settings.about.feature2")}),d.jsx("li",{children:r("settings.about.feature3")}),d.jsx("li",{children:r("settings.about.feature4")}),d.jsx("li",{children:r("settings.about.feature5")})]})]}),d.jsx(go,{}),d.jsxs("div",{className:"flex items-center justify-between text-sm",children:[d.jsx("span",{className:"text-muted-foreground",children:r("settings.about.version")}),d.jsx("span",{className:"font-medium",children:"0.2.0"})]}),d.jsxs("div",{className:"flex items-center justify-between text-sm",children:[d.jsx("span",{className:"text-muted-foreground",children:r("settings.about.dashboard")}),d.jsxs("span",{className:"font-medium",children:[d.jsx(su,{className:"inline h-3 w-3 mr-1"}),r("settings.about.connected")]})]})]})]})]})]})}function sie(){const e=zp(),t=Tr(),{data:r,isLoading:n,isError:a,error:i}=tt({queryKey:["background-tasks"],queryFn:()=>Me.getBackgroundTasks({limit:100}),refetchInterval:3e3}),o=c=>{switch(c){case"completed":return"default";case"failed":return"destructive";case"running":return"secondary";default:return"outline"}},s=c=>{switch(c){case"completed":return d.jsx(U4,{className:"h-4 w-4"});case"failed":return d.jsx(Zx,{className:"h-4 w-4"});case"running":return d.jsx(G4,{className:"h-4 w-4 animate-spin"});default:return d.jsx(zo,{className:"h-4 w-4"})}},l=c=>c?c<1e3?`${c}ms`:`${(c/1e3).toFixed(2)}s`:"N/A";return n?d.jsx("div",{className:"flex items-center justify-center h-screen",children:d.jsx("div",{className:"text-muted-foreground",children:t("common.loading")})}):a?d.jsx("div",{className:"flex items-center justify-center h-screen",children:d.jsx(ne,{className:"border-destructive",children:d.jsxs(ae,{className:"py-8 text-center",children:[d.jsx("p",{className:"text-destructive font-medium",children:t("backgroundTasks.failedToLoad")}),d.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:i instanceof Error?i.message:t("detailDrawer.common.unknown")})]})})}):d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:t("pages.backgroundTasks.title")}),d.jsx("p",{className:"text-muted-foreground",children:t("pages.backgroundTasks.description")})]}),d.jsxs("div",{className:"grid gap-4",children:[r&&r.length===0&&d.jsx(ne,{children:d.jsx(ae,{className:"py-8 text-center text-muted-foreground",children:t("backgroundTasks.noTasks")})}),r==null?void 0:r.map(c=>d.jsxs(ne,{children:[d.jsx(ue,{children:d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsxs(fe,{className:"text-base flex items-center gap-2",children:[s(c.status),c.name]}),d.jsx("p",{className:"text-sm text-muted-foreground font-mono",children:c.task_id})]}),d.jsx(ve,{variant:o(c.status),children:c.status==="completed"?t("backgroundTasks.status.completed"):c.status==="failed"?t("backgroundTasks.status.failed"):c.status==="running"?t("backgroundTasks.status.running"):c.status})]})}),d.jsxs(ae,{children:[d.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-muted-foreground",children:t("backgroundTasks.started")}),d.jsx("p",{className:"font-medium",children:c.start_time?Rn(new Date(c.start_time),"HH:mm:ss"):"N/A"})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-muted-foreground",children:t("backgroundTasks.duration")}),d.jsx("p",{className:"font-medium",children:l(c.duration_ms)})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-muted-foreground",children:t("backgroundTasks.requestId")}),c.request_id?d.jsxs(oe,{variant:"link",size:"sm",className:"h-auto p-0 font-mono text-xs",onClick:()=>e(`/requests/${c.request_id}`),children:[c.request_id.slice(0,8),d.jsx(H4,{className:"h-3 w-3 ml-1"})]}):d.jsx("p",{className:"font-mono text-xs",children:"N/A"})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-muted-foreground",children:t("backgroundTasks.created")}),d.jsx("p",{className:"font-medium",children:Rn(new Date(c.created_at),"HH:mm:ss")})]})]}),c.error&&d.jsxs("div",{className:"mt-4 p-3 bg-destructive/10 border border-destructive/20 rounded",children:[d.jsxs("p",{className:"text-sm text-destructive font-medium",children:[t("common.error"),":"]}),d.jsx("p",{className:"text-sm text-destructive mt-1",children:c.error})]})]})]},c.task_id))]})]})}var lm="Dialog",[NM]=Kn(lm),[lie,Sn]=NM(lm),OM=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,s=m.useRef(null),l=m.useRef(null),[c,u]=Po({prop:n,defaultProp:a??!1,onChange:i,caller:lm});return d.jsx(lie,{scope:t,triggerRef:s,contentRef:l,contentId:ma(),titleId:ma(),descriptionId:ma(),open:c,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(f=>!f),[u]),modal:o,children:r})};OM.displayName=lm;var AM="DialogTrigger",cie=m.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=Sn(AM,r),i=be(t,a.triggerRef);return d.jsx(se.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":jw(a.open),...n,ref:i,onClick:ie(e.onClick,a.onOpenToggle)})});cie.displayName=AM;var Sw="DialogPortal",[uie,TM]=NM(Sw,{forceMount:void 0}),_M=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:a}=e,i=Sn(Sw,t);return d.jsx(uie,{scope:t,forceMount:r,children:m.Children.map(n,o=>d.jsx(wn,{present:r||i.open,children:d.jsx(Zp,{asChild:!0,container:a,children:o})}))})};_M.displayName=Sw;var Ep="DialogOverlay",RM=m.forwardRef((e,t)=>{const r=TM(Ep,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=Sn(Ep,e.__scopeDialog);return i.modal?d.jsx(wn,{present:n||i.open,children:d.jsx(fie,{...a,ref:t})}):null});RM.displayName=Ep;var die=zs("DialogOverlay.RemoveScroll"),fie=m.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=Sn(Ep,r);return d.jsx(u0,{as:die,allowPinchZoom:!0,shards:[a.contentRef],children:d.jsx(se.div,{"data-state":jw(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Lo="DialogContent",DM=m.forwardRef((e,t)=>{const r=TM(Lo,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=Sn(Lo,e.__scopeDialog);return d.jsx(wn,{present:n||i.open,children:i.modal?d.jsx(pie,{...a,ref:t}):d.jsx(hie,{...a,ref:t})})});DM.displayName=Lo;var pie=m.forwardRef((e,t)=>{const r=Sn(Lo,e.__scopeDialog),n=m.useRef(null),a=be(t,r.contentRef,n);return m.useEffect(()=>{const i=n.current;if(i)return jO(i)},[]),d.jsx(MM,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ie(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ie(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,s=o.button===0&&o.ctrlKey===!0;(o.button===2||s)&&i.preventDefault()}),onFocusOutside:ie(e.onFocusOutside,i=>i.preventDefault())})}),hie=m.forwardRef((e,t)=>{const r=Sn(Lo,e.__scopeDialog),n=m.useRef(!1),a=m.useRef(!1);return d.jsx(MM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,s;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(n.current||(s=r.triggerRef.current)==null||s.focus(),i.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((c=r.triggerRef.current)==null?void 0:c.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),MM=m.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,s=Sn(Lo,r),l=m.useRef(null),c=be(t,l);return KN(),d.jsxs(d.Fragment,{children:[d.jsx(t0,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:i,children:d.jsx(Kp,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":jw(s.open),...o,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(mie,{titleId:s.titleId}),d.jsx(vie,{contentRef:l,descriptionId:s.descriptionId})]})]})}),Ew="DialogTitle",IM=m.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=Sn(Ew,r);return d.jsx(se.h2,{id:a.titleId,...n,ref:t})});IM.displayName=Ew;var LM="DialogDescription",$M=m.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=Sn(LM,r);return d.jsx(se.p,{id:a.descriptionId,...n,ref:t})});$M.displayName=LM;var FM="DialogClose",BM=m.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=Sn(FM,r);return d.jsx(se.button,{type:"button",...n,ref:t,onClick:ie(e.onClick,()=>a.onOpenChange(!1))})});BM.displayName=FM;function jw(e){return e?"open":"closed"}var zM="DialogTitleWarning",[Roe,UM]=m5(zM,{contentName:Lo,titleName:Ew,docsSlug:"dialog"}),mie=({titleId:e})=>{const t=UM(zM),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. +*/function Tn({data:e,fallback:t}){const{theme:r}=ul();if(!e)return d.jsx("pre",{className:"text-xs whitespace-pre-wrap break-all",children:t||"No data"});let n,a=!1;try{const i=JSON.parse(e);n=JSON.stringify(i,null,2),a=!0}catch{n=e}return a?d.jsx(Zae,{theme:r==="dark"?By.nightOwl:By.github,code:n,language:"json",children:({className:i,style:o,tokens:s,getLineProps:l,getTokenProps:c})=>d.jsx("pre",{className:`text-xs ${i}`,style:o,children:s.map((u,f)=>d.jsx("div",{...l({line:u}),children:u.map((p,h)=>d.jsx("span",{...c({token:p})},h))},f))})}):d.jsx("pre",{className:"text-xs whitespace-pre-wrap break-all",children:e})}function Jae(){var x,b;const{requestId:e}=rF(),t=zp(),[r,n]=m.useState(null),[a,i]=m.useState(null),{data:o,isLoading:s,isError:l,error:c}=tt({queryKey:["request-detail",e],queryFn:()=>e?Me.getRequestDetail(e):null,enabled:!!e}),u=j3({mutationFn:y=>Me.replayRequest(y),onSuccess:y=>{t(`/requests/${y.new_request_id}`)}}),f=(y,w)=>{navigator.clipboard.writeText(y),n(w),setTimeout(()=>n(null),2e3)},p=async()=>{if(e){i(null);try{const y=await Me.getRequestAsCurl(e);f(y.curl,"curl")}catch(y){const w=y instanceof Error?y.message:"Failed to export as cURL";i(w),setTimeout(()=>i(null),3e3)}}},h=y=>{if(!y)return null;try{return JSON.stringify(y,null,2)}catch{return String(y)}},v=y=>y?y>=200&&y<300?"default":y>=300&&y<400?"secondary":"destructive":"secondary",g=y=>y?y<1e3?`${y}ms`:`${(y/1e3).toFixed(2)}s`:"0ms";return s?d.jsx("div",{className:"flex items-center justify-center h-screen",children:d.jsx("div",{className:"text-muted-foreground",children:"Loading..."})}):l?d.jsxs("div",{className:"flex flex-col items-center justify-center h-screen gap-4",children:[d.jsx(ne,{className:"border-destructive max-w-md",children:d.jsxs(ae,{className:"py-8 text-center",children:[d.jsx("p",{className:"text-destructive font-medium",children:"Failed to load request"}),d.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:c instanceof Error?c.message:"Unknown error"})]})}),d.jsxs(oe,{onClick:()=>t("/requests"),children:[d.jsx(Um,{className:"h-4 w-4 mr-2"}),"Back to Requests"]})]}):o?d.jsxs("div",{className:"container mx-auto py-6 space-y-6 max-w-7xl",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs(oe,{variant:"ghost",onClick:()=>t("/requests"),children:[d.jsx(Um,{className:"h-4 w-4 mr-2"}),"Back"]}),d.jsxs("div",{className:"flex gap-2",children:[d.jsxs(oe,{variant:"outline",size:"sm",onClick:p,children:[d.jsx(On,{className:"h-4 w-4 mr-2"}),r==="curl"?"Copied!":"Export as cURL"]}),d.jsxs(oe,{variant:"outline",size:"sm",onClick:()=>e&&u.mutate(e),disabled:u.isPending,children:[d.jsx(X4,{className:"h-4 w-4 mr-2"}),u.isPending?"Replaying...":"Replay"]})]})]}),a&&d.jsx(ne,{className:"border-destructive",children:d.jsx(ae,{className:"py-4",children:d.jsx("p",{className:"text-destructive text-sm",children:a})})}),d.jsxs(ne,{children:[d.jsx(ue,{children:d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsxs("div",{className:"flex items-center gap-3",children:[d.jsx(ve,{variant:v(o.status_code),className:"text-lg px-3 py-1",children:o.status_code||"Pending"}),d.jsx("span",{className:"text-2xl font-bold font-mono",children:o.method})]}),d.jsx("p",{className:"text-lg text-muted-foreground break-all",children:o.path})]}),d.jsx(ve,{variant:"outline",className:"text-lg px-3 py-1",children:g(o.duration_ms)})]})}),d.jsxs(ae,{children:[d.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-6",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsx("p",{className:"text-sm text-muted-foreground",children:"Timestamp"}),d.jsx("p",{className:"font-medium",children:Rn(new Date(o.created_at),"PPpp")})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("p",{className:"text-sm text-muted-foreground",children:"Client IP"}),d.jsx("p",{className:"font-medium",children:o.client_ip||"Unknown"})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("p",{className:"text-sm text-muted-foreground",children:"Queries"}),d.jsx("p",{className:"font-medium",children:o.queries.length})]}),d.jsxs("div",{className:"space-y-1",children:[d.jsx("p",{className:"text-sm text-muted-foreground",children:"Exceptions"}),d.jsx("p",{className:"font-medium",children:o.exceptions.length})]})]}),d.jsx(go,{className:"my-4"}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("p",{className:"text-sm text-muted-foreground",children:"Request ID"}),d.jsx("p",{className:"font-mono text-sm break-all",children:o.request_id})]}),d.jsxs("div",{className:"space-y-2 mt-4",children:[d.jsx("p",{className:"text-sm text-muted-foreground",children:"Full URL"}),d.jsx("p",{className:"font-mono text-sm break-all",children:o.url})]})]})]}),u.isSuccess&&d.jsxs(ne,{className:"border-green-500",children:[d.jsx(ue,{children:d.jsxs(fe,{className:"flex items-center justify-between",children:[d.jsx("span",{children:"Replay Successful"}),d.jsx(ve,{variant:u.data.status_code<400?"default":"destructive",children:u.data.status_code})]})}),d.jsxs(ae,{className:"space-y-2",children:[d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"text-muted-foreground",children:"Duration:"}),d.jsxs("span",{className:"font-mono",children:[u.data.elapsed_ms.toFixed(0),"ms"]})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"text-muted-foreground",children:"Original:"}),d.jsxs("span",{className:"font-mono",children:[(x=u.data.original_duration_ms)==null?void 0:x.toFixed(0),"ms"]})]})]})]}),u.isError&&d.jsx(ne,{className:"border-destructive",children:d.jsx(ae,{className:"py-4",children:d.jsxs("p",{className:"text-destructive",children:["Replay failed: ",(b=u.error)==null?void 0:b.message]})})}),d.jsx(ne,{children:d.jsxs(rm,{defaultValue:"overview",className:"w-full",children:[d.jsx(ue,{children:d.jsxs(_u,{className:"grid w-full grid-cols-5",children:[d.jsx(pt,{value:"overview",children:"Overview"}),d.jsx(pt,{value:"headers",children:"Headers"}),d.jsx(pt,{value:"body",children:"Request"}),d.jsx(pt,{value:"response",children:"Response"}),d.jsxs(pt,{value:"queries",children:["Queries ",o.queries.length>0&&`(${o.queries.length})`]})]})}),d.jsxs(ae,{children:[d.jsx(Bt,{value:"overview",className:"space-y-4",children:d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[d.jsxs(ne,{children:[d.jsx(ue,{children:d.jsx(fe,{className:"text-sm",children:"Request Info"})}),d.jsxs(ae,{className:"space-y-2 text-sm",children:[d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"text-muted-foreground",children:"Method:"}),d.jsx("span",{className:"font-mono",children:o.method})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"text-muted-foreground",children:"Status:"}),d.jsx("span",{className:"font-mono",children:o.status_code})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"text-muted-foreground",children:"Duration:"}),d.jsx("span",{className:"font-mono",children:g(o.duration_ms)})]}),d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"text-muted-foreground",children:"Queries:"}),d.jsx("span",{className:"font-mono",children:o.queries.length})]})]})]}),d.jsxs(ne,{children:[d.jsx(ue,{children:d.jsx(fe,{className:"text-sm",children:"Timeline"})}),d.jsxs(ae,{className:"space-y-2 text-sm",children:[d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"text-muted-foreground",children:"Created:"}),d.jsx("span",{children:Rn(new Date(o.created_at),"HH:mm:ss")})]}),o.queries.length>0&&d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"text-muted-foreground",children:"DB Time:"}),d.jsxs("span",{className:"font-mono",children:[o.queries.reduce((y,w)=>y+(w.duration_ms||0),0).toFixed(0),"ms"]})]})]})]})]})}),d.jsx(Bt,{value:"headers",className:"space-y-4",children:d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("h3",{className:"text-sm font-medium",children:"Request Headers"}),d.jsxs(oe,{size:"sm",variant:"ghost",onClick:()=>f(h(o.headers)||"","req-headers"),children:[d.jsx(On,{className:"h-3 w-3 mr-1"}),r==="req-headers"?"Copied":"Copy"]})]}),d.jsx(Lt,{className:"h-[300px] rounded-md border p-4",children:d.jsx(Tn,{data:h(o.headers),fallback:"No request headers"})})]}),o.response_headers&&d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("h3",{className:"text-sm font-medium",children:"Response Headers"}),d.jsxs(oe,{size:"sm",variant:"ghost",onClick:()=>f(h(o.response_headers)||"","res-headers"),children:[d.jsx(On,{className:"h-3 w-3 mr-1"}),r==="res-headers"?"Copied":"Copy"]})]}),d.jsx(Lt,{className:"h-[300px] rounded-md border p-4",children:d.jsx(Tn,{data:h(o.response_headers),fallback:"No response headers"})})]})]})}),d.jsxs(Bt,{value:"body",className:"space-y-4",children:[o.query_params&&Object.keys(o.query_params).length>0&&d.jsxs("div",{children:[d.jsx("h3",{className:"text-sm font-medium mb-2",children:"Query Parameters"}),d.jsx(Lt,{className:"h-[150px] rounded-md border p-4",children:d.jsx(Tn,{data:h(o.query_params)})})]}),d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("h3",{className:"text-sm font-medium",children:"Request Body"}),d.jsxs(oe,{size:"sm",variant:"ghost",onClick:()=>f(o.body||"","body"),children:[d.jsx(On,{className:"h-3 w-3 mr-1"}),r==="body"?"Copied":"Copy"]})]}),d.jsx(Lt,{className:"h-[400px] rounded-md border p-4",children:d.jsx(Tn,{data:o.body,fallback:"No request body"})})]})]}),d.jsx(Bt,{value:"response",className:"space-y-4",children:d.jsxs("div",{children:[d.jsxs("div",{className:"flex items-center justify-between mb-2",children:[d.jsx("h3",{className:"text-sm font-medium",children:"Response Body"}),d.jsxs(oe,{size:"sm",variant:"ghost",onClick:()=>f(o.response_body||"","response"),children:[d.jsx(On,{className:"h-3 w-3 mr-1"}),r==="response"?"Copied":"Copy"]})]}),d.jsx(Lt,{className:"h-[500px] rounded-md border p-4",children:d.jsx(Tn,{data:o.response_body,fallback:"No response body"})})]})}),d.jsx(Bt,{value:"queries",className:"space-y-4",children:o.queries.length===0?d.jsx("p",{className:"text-center text-muted-foreground py-8",children:"No database queries captured"}):d.jsx("div",{className:"space-y-3",children:o.queries.map((y,w)=>{var S;return d.jsxs(ne,{children:[d.jsx(ue,{className:"py-3",children:d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs(fe,{className:"text-sm",children:["Query #",w+1]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(ve,{variant:"outline",children:[(S=y.duration_ms)==null?void 0:S.toFixed(0),"ms"]}),y.rows_affected!==null&&d.jsxs(ve,{variant:"secondary",children:[y.rows_affected," rows"]})]})]})}),d.jsxs(ae,{children:[d.jsx(Lt,{className:"h-[120px] rounded-md border p-3",children:d.jsx("pre",{className:"text-xs whitespace-pre-wrap break-all",children:y.sql})}),y.parameters&&y.parameters.length>0&&d.jsxs("div",{className:"mt-2",children:[d.jsx("p",{className:"text-xs text-muted-foreground mb-1",children:"Parameters"}),d.jsx("code",{className:"text-xs bg-muted px-2 py-1 rounded",children:JSON.stringify(y.parameters)})]})]})]},y.id)})})})]})]})}),o.exceptions.length>0&&d.jsxs(ne,{className:"border-destructive",children:[d.jsx(ue,{children:d.jsx(fe,{children:"Exceptions"})}),d.jsx(ae,{className:"space-y-3",children:o.exceptions.map(y=>d.jsxs(ne,{className:"border-destructive/50",children:[d.jsx(ue,{className:"py-3",children:d.jsx(fe,{className:"text-sm text-destructive",children:y.exception_type})}),d.jsxs(ae,{children:[y.exception_value&&d.jsx("p",{className:"text-sm mb-2",children:y.exception_value}),d.jsx(Lt,{className:"h-[200px] rounded-md border border-destructive/20 p-3",children:d.jsx("pre",{className:"text-xs text-destructive whitespace-pre-wrap break-all",children:y.traceback})})]})]},y.id))})]})]}):d.jsxs("div",{className:"flex flex-col items-center justify-center h-screen gap-4",children:[d.jsx("div",{className:"text-muted-foreground",children:"Request not found"}),d.jsxs(oe,{onClick:()=>t("/requests"),children:[d.jsx(Um,{className:"h-4 w-4 mr-2"}),"Back to Requests"]})]})}function eie(e){return e?e<1e3?`${e.toFixed(0)}ms`:e<6e4?`${(e/1e3).toFixed(2)}s`:`${(e/6e4).toFixed(2)}m`:"N/A"}function tie(e){switch(e.toLowerCase()){case"ok":case"success":return d.jsx(Xx,{className:"h-4 w-4 text-green-500"});case"error":case"failure":return d.jsx(Bo,{className:"h-4 w-4 text-red-500"});default:return d.jsx(ou,{className:"h-4 w-4 text-blue-500"})}}function rie(e){switch(e.toLowerCase()){case"ok":case"success":return"default";case"error":case"failure":return"destructive";default:return"secondary"}}function nie({className:e}){const{openDetail:t}=Uo(),r=Tr(),[n,a]=m.useState({search:"",status:"all",service:"",hours:24,minDuration:0}),[i,o]=m.useState(0),s=50,{data:l=[],isLoading:c,error:u,refetch:f}=tt({queryKey:["traces",n,i],queryFn:()=>Me.getTraces({limit:s,offset:i*s,status:n.status==="all"?void 0:n.status,service_name:n.service||void 0,min_duration_ms:n.minDuration||void 0,hours:n.hours}),refetchInterval:3e4}),p=h=>{t("trace",h.trace_id)};return u?d.jsx(ne,{className:e,children:d.jsx(ae,{className:"p-6",children:d.jsxs("div",{className:"text-center",children:[d.jsx(Bo,{className:"h-12 w-12 text-destructive mx-auto mb-4"}),d.jsx("h3",{className:"text-lg font-semibold mb-2",children:r("traceslist.failToLoadTraces")}),d.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:r("traceslist.anError")}),d.jsxs(oe,{onClick:()=>f(),children:[d.jsx(Ac,{className:"h-4 w-4 mr-2"}),r("traceslist.tryAgain")]})]})})}):d.jsxs("div",{className:e,children:[d.jsx(ne,{className:"mb-6",children:d.jsx(ae,{className:"p-4",children:d.jsxs("div",{className:"flex flex-wrap gap-4",children:[d.jsx("div",{className:"flex-1 min-w-[200px]",children:d.jsxs("div",{className:"relative",children:[d.jsx(FN,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-muted-foreground"}),d.jsx(nm,{placeholder:r("traceslist.search"),value:n.search,onChange:h=>a({...n,search:h.target.value}),className:"pl-9"})]})}),d.jsxs(No,{value:n.status,onValueChange:h=>a({...n,status:h}),children:[d.jsx(Pi,{className:"w-[150px]",children:d.jsx(Oo,{placeholder:r("traceslist.all")})}),d.jsxs(ki,{children:[d.jsx(Pe,{value:"all",children:r("traceslist.all")}),d.jsx(Pe,{value:"ok",children:r("traceslist.success")}),d.jsx(Pe,{value:"error",children:r("traceslist.error")})]})]}),d.jsxs(No,{value:n.hours.toString(),onValueChange:h=>a({...n,hours:parseInt(h)}),children:[d.jsx(Pi,{className:"w-[150px]",children:d.jsx(Oo,{})}),d.jsxs(ki,{children:[d.jsx(Pe,{value:"1",children:r("traceslist.lastHour")}),d.jsx(Pe,{value:"6",children:r("traceslist.last6Hours")}),d.jsx(Pe,{value:"24",children:r("traceslist.last24Hours")}),d.jsx(Pe,{value:"168",children:r("traceslist.lastWeek")})]})]}),d.jsxs(oe,{onClick:()=>f(),size:"sm",variant:"outline",children:[d.jsx(Ac,{className:"h-4 w-4 mr-2"}),r("traceslist.refresh")]})]})})}),d.jsx(ne,{children:d.jsxs(ae,{className:"p-0",children:[c?d.jsx("div",{className:"p-6",children:d.jsx("div",{className:"space-y-4",children:[...Array(5)].map((h,v)=>d.jsx("div",{className:"animate-pulse",children:d.jsx("div",{className:"h-16 bg-muted rounded"})},v))})}):l.length===0?d.jsxs("div",{className:"p-6 text-center text-muted-foreground",children:[d.jsx(ou,{className:"h-12 w-12 mx-auto mb-4 opacity-50"}),d.jsx("p",{children:r("traceslist.noTraces")})]}):d.jsx("div",{className:"divide-y",children:l.map(h=>d.jsx("div",{className:"p-4 hover:bg-muted/50 cursor-pointer transition-colors",onClick:()=>p(h),children:d.jsx("div",{className:"flex items-start justify-between",children:d.jsxs("div",{className:"flex-1 min-w-0",children:[d.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[tie(h.status),d.jsx("h3",{className:"font-medium truncate",children:h.operation_name||"Unknown Operation"}),d.jsx(ve,{variant:rie(h.status),className:"text-xs",children:h.status})]}),d.jsxs("div",{className:"flex items-center gap-4 text-sm text-muted-foreground",children:[d.jsxs("span",{children:["Service: ",h.service_name||"Unknown"]}),d.jsxs("span",{children:["Spans: ",h.span_count]}),d.jsxs("span",{children:["Duration: ",eie(h.duration_ms)]})]}),d.jsxs("div",{className:"flex items-center gap-2 mt-1 text-xs text-muted-foreground",children:[d.jsx(zo,{className:"h-3 w-3"}),d.jsx("span",{children:W6(new Date(h.start_time),{addSuffix:!0})}),d.jsx("span",{className:"text-muted-foreground/60",children:"•"}),d.jsxs("span",{children:[h.trace_id.slice(0,8),"..."]})]})]})})},h.trace_id))}),l.length===s&&d.jsx("div",{className:"p-4 border-t flex justify-center",children:d.jsx(oe,{variant:"outline",onClick:()=>o(i+1),children:"Load more"})})]})})]})}function aie(){const e=Tr();return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:e("pages.tracing.title")}),d.jsx("p",{className:"text-muted-foreground",children:e("pages.tracing.description")})]}),d.jsxs(ne,{children:[d.jsxs(ue,{children:[d.jsx(fe,{children:e("pages.tracing.tracesCardTitle")}),d.jsx(bt,{children:e("pages.tracing.tracesCardDescription")})]}),d.jsx(ae,{children:d.jsx(nie,{})})]})]})}function iie(){const[e,t]=m.useState("1h"),[r,n]=m.useState(5e3),{openDetail:a}=Uo(),i=Tr(),o=e==="1h"?1:e==="24h"?24:168,{data:s}=tt({queryKey:["performance-stats",e],queryFn:()=>Me.getStats(o),refetchInterval:r}),{data:l}=tt({queryKey:["performance-requests",e],queryFn:()=>Me.getRequests({limit:100}),refetchInterval:r}),{data:c}=tt({queryKey:["performance-queries",e],queryFn:()=>Me.getQueries({limit:100}),refetchInterval:r}),{data:u}=tt({queryKey:["performance-exceptions",e],queryFn:()=>Me.getExceptions({limit:100}),refetchInterval:r}),f=SA({requests:l,queries:c,exceptions:u,stats:s}),p=[{type:"successRate",label:i("metrics.successRate"),value:f.successRate,status:f.successRate>=99?"success":f.successRate>=95?"warning":"error",description:`${i("common.all")} ${f.totalRequests} ${i("metrics.totalRequests").toLowerCase()}`},{type:"avgResponseTime",label:i("metrics.avgResponseTime"),value:ar(f.avgResponseTime),rawValue:f.avgResponseTime,status:!f.avgResponseTime||f.avgResponseTime<100?"success":f.avgResponseTime<300?"warning":"error"},{type:"errorRate",label:i("metrics.errorRate"),value:`${f.errorRate.toFixed(1)}%`,rawValue:f.errorRate,status:f.errorRate<=1?"success":f.errorRate<=2?"warning":"error"},{type:"queryPerformance",label:i("performance.queryPerformance"),value:ar(f.avgQueryTime),rawValue:f.avgQueryTime,status:!f.avgQueryTime||f.avgQueryTime<50?"success":f.avgQueryTime<100?"warning":"error"}],h=f.endpointMetrics.slice(0,10).map(g=>({name:g.name,responseTime:g.avgResponseTime,calls:g.calls})),v=[{category:i("requests.statusFilters.clientErrors"),count:(l==null?void 0:l.filter(g=>g.status_code&&g.status_code>=400&&g.status_code<500).length)||0},{category:i("requests.statusFilters.serverErrors"),count:(l==null?void 0:l.filter(g=>g.status_code&&g.status_code>=500).length)||0},{category:i("metrics.exceptions"),count:f.totalExceptions}];return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:i("pages.performance.title")}),d.jsx("p",{className:"text-muted-foreground",children:i("pages.performance.description")})]}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(No,{value:e,onValueChange:t,children:[d.jsx(Pi,{className:"w-32",children:d.jsx(Oo,{})}),d.jsxs(ki,{children:[d.jsx(Pe,{value:"1h",children:i("timeRange.lastHour")}),d.jsx(Pe,{value:"24h",children:i("timeRange.last24Hours")}),d.jsx(Pe,{value:"7d",children:i("timeRange.last7Days")})]})]}),d.jsxs(No,{value:r.toString(),onValueChange:g=>n(parseInt(g)),children:[d.jsx(Pi,{className:"w-40",children:d.jsx(Oo,{})}),d.jsxs(ki,{children:[d.jsxs(Pe,{value:"5000",children:[i("common.refresh"),": 5s"]}),d.jsxs(Pe,{value:"10000",children:[i("common.refresh"),": 10s"]}),d.jsxs(Pe,{value:"30000",children:[i("common.refresh"),": 30s"]}),d.jsxs(Pe,{value:"0",children:[i("common.refresh"),": ",i("common.no")]})]})]})]})]}),d.jsx("div",{className:"grid gap-4 md:grid-cols-4",children:p.map(g=>d.jsxs(ne,{children:[d.jsxs(ue,{className:"pb-2",children:[d.jsx(fe,{className:"text-sm font-medium",children:g.label}),g.description&&d.jsx(bt,{className:"text-xs",children:g.description})]}),d.jsx(ae,{children:d.jsxs("div",{className:"space-y-3",children:[d.jsx("div",{className:"text-2xl font-bold tabular-nums",children:g.value}),d.jsx(Tf,{status:g.status,label:g.status==="success"?i("performance.excellent"):g.status==="warning"?i("performance.acceptable"):i("performance.needsAttention"),compact:!0}),g.rawValue!==void 0&&d.jsx(Vd,{label:"",value:g.type==="successRate"||g.type==="errorRate"?g.rawValue:g.type==="avgResponseTime"?Math.min(g.rawValue/1e3*100,100):g.type==="queryPerformance"?Math.min(g.rawValue/200*100,100):0,max:100,showPercentage:!1,compact:!0,status:g.status==="success"?"success":g.status==="warning"?"warning":"danger"})]})})]},g.label))}),d.jsxs(rm,{defaultValue:"overview",className:"space-y-4",children:[d.jsxs(_u,{children:[d.jsx(pt,{value:"overview",children:i("performance.overview")}),d.jsx(pt,{value:"endpoints",children:i("performance.endpointPerformance")}),d.jsx(pt,{value:"queries",children:i("nav.database")}),d.jsx(pt,{value:"errors",children:i("performance.errorAnalysis")})]}),d.jsxs(Bt,{value:"overview",className:"space-y-4",children:[d.jsxs("div",{className:"grid gap-4 md:grid-cols-3",children:[d.jsxs(ne,{children:[d.jsx(ue,{className:"pb-3",children:d.jsx(fe,{className:"text-base",children:i("metrics.responseTime")})}),d.jsxs(ae,{className:"space-y-3",children:[d.jsx(ct,{label:i("performance.p50Median"),value:ar(f.responseTimePercentiles.p50)}),d.jsx(ct,{label:i("performance.p95"),value:ar(f.responseTimePercentiles.p95)}),d.jsx(ct,{label:i("performance.p99"),value:ar(f.responseTimePercentiles.p99)}),d.jsx(r9,{value:f.avgResponseTime||0,max:1e3,label:i("performance.average"),thresholds:[{value:100,label:"100ms"},{value:300,label:"300ms"},{value:1e3,label:"1s"}]})]})]}),d.jsxs(ne,{children:[d.jsx(ue,{className:"pb-3",children:d.jsx(fe,{className:"text-base",children:i("performance.throughput")})}),d.jsxs(ae,{className:"space-y-3",children:[d.jsx(ct,{label:i("performance.requestsPerSec"),value:f.requestsPerSecond.toFixed(1)}),d.jsx(ct,{label:i("metrics.totalRequests"),value:IS(s==null?void 0:s.total_requests)}),d.jsx(ct,{label:i("performance.totalQueries"),value:IS(s==null?void 0:s.total_queries)}),d.jsx(ct,{label:i("performance.queriesPerRequest"),value:s!=null&&s.total_queries&&(s!=null&&s.total_requests)?(s.total_queries/s.total_requests).toFixed(1):"0"})]})]}),d.jsxs(ne,{children:[d.jsx(ue,{className:"pb-3",children:d.jsx(fe,{className:"text-base",children:i("performance.errorAnalysis")})}),d.jsxs(ae,{className:"space-y-3",children:[d.jsx(NA,{value:100-f.errorRate,size:"sm",label:i("performance.healthScore")}),d.jsx(ct,{label:i("requests.tabs.failed"),value:f.failedRequests}),d.jsx(ct,{label:i("metrics.errorRate"),value:`${f.errorRate.toFixed(1)}%`}),d.jsx(ct,{label:i("metrics.exceptions"),value:f.totalExceptions})]})]})]}),d.jsxs(ne,{children:[d.jsxs(ue,{children:[d.jsx(fe,{children:i("performance.performanceSummary")}),d.jsxs(bt,{children:[i("performance.realTimeMetrics")," ",f.totalRequests," ",i("performance.recentRequests")]})]}),d.jsx(ae,{children:d.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-6",children:[d.jsx(ln,{label:i("metrics.successRate"),value:`${f.successRate.toFixed(1)}%`,minimal:!0}),d.jsx(ln,{label:i("performance.avgResponse"),value:ar(f.avgResponseTime),minimal:!0}),d.jsx(ln,{label:i("performance.slowRequests"),value:f.slowRequests,minimal:!0}),d.jsx(ln,{label:i("performance.activeEndpoints"),value:f.endpointMetrics.length,minimal:!0})]})})]})]}),d.jsx(Bt,{value:"endpoints",className:"space-y-4",children:d.jsxs(ne,{children:[d.jsxs(ue,{children:[d.jsx(fe,{children:i("performance.endpointPerformance")}),d.jsx(bt,{children:i("performance.performanceBreakdown")})]}),d.jsxs(ae,{className:"space-y-6",children:[h.length>0&&d.jsx(lne,{title:i("performance.responseTimesByEndpoint"),data:h,bars:[{dataKey:"responseTime",name:i("metrics.avgResponseTime")}],height:300,formatter:"duration",minimal:!0,horizontal:!0}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("h4",{className:"text-sm font-medium",children:i("performance.detailedMetrics")}),f.endpointMetrics.map(g=>d.jsxs("div",{className:"space-y-2 p-3 border rounded-lg",children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("code",{className:"text-sm font-mono",children:g.name}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(ve,{variant:"outline",children:[g.calls," ",i("performance.calls")]}),g.errors>0&&d.jsxs(ve,{variant:"destructive",children:[g.errors," ",i("performance.errors")]})]})]}),d.jsx(Vd,{label:`${g.avgResponseTime}ms average`,value:Math.min(g.avgResponseTime/500*100,100),showPercentage:!1,sublabel:`${i("performance.successRate")}: ${g.successRate}%`,compact:!0})]},g.name)),f.endpointMetrics.length===0&&d.jsx("p",{className:"text-center text-muted-foreground py-4",children:i("performance.noEndpointData")})]})]})]})}),d.jsx(Bt,{value:"queries",className:"space-y-4",children:d.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[d.jsxs(ne,{children:[d.jsx(ue,{children:d.jsx(fe,{children:i("performance.queryStatistics")})}),d.jsxs(ae,{className:"space-y-3",children:[d.jsx(ct,{label:i("performance.totalQueries"),value:f.totalQueries}),d.jsx(ct,{label:i("performance.slowQueries"),value:f.slowQueries}),d.jsx(ct,{label:i("performance.avgQueryTime"),value:ar(f.avgQueryTime)}),d.jsx(Vd,{label:i("performance.queryPerformanceScore"),value:f.avgQueryTime?100-Math.min(f.avgQueryTime/200*100,100):100,status:!f.avgQueryTime||f.avgQueryTime<50?"success":f.avgQueryTime<100?"warning":"danger"})]})]}),d.jsxs(ne,{children:[d.jsxs(ue,{children:[d.jsx(fe,{children:i("performance.slowQueriesTitle")}),d.jsxs(bt,{children:[i("database.slowThreshold"),": 100ms"]})]}),d.jsx(ae,{children:d.jsxs("div",{className:"space-y-2",children:[c==null?void 0:c.filter(g=>g.duration_ms&&g.duration_ms>100).slice(0,5).map(g=>d.jsxs("div",{className:"text-xs cursor-pointer hover:bg-muted/50 p-2 rounded transition-colors",onClick:()=>a("request",g.request_id),children:[d.jsx("code",{className:"block truncate",children:g.sql}),d.jsxs("div",{className:"flex items-center justify-between mt-1",children:[d.jsx("span",{className:"text-muted-foreground",children:new Date(g.created_at).toLocaleTimeString()}),d.jsx(ve,{variant:"outline",className:"text-xs",children:ar(g.duration_ms)})]})]},g.id)),(!c||c.filter(g=>g.duration_ms&&g.duration_ms>100).length===0)&&d.jsx("p",{className:"text-center text-muted-foreground py-4",children:i("performance.noSlowQueries")})]})})]})]})}),d.jsx(Bt,{value:"errors",className:"space-y-4",children:d.jsxs(ne,{children:[d.jsxs(ue,{children:[d.jsx(fe,{children:i("performance.errorAnalysisTitle")}),d.jsx(bt,{children:i("performance.errorAnalysis")})]}),d.jsxs(ae,{className:"space-y-6",children:[d.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[d.jsx(ln,{label:i("requests.tabs.failed"),value:f.failedRequests,minimal:!0}),d.jsx(ln,{label:i("metrics.errorRate"),value:`${f.errorRate.toFixed(1)}%`,minimal:!0}),d.jsx(ln,{label:i("metrics.exceptions"),value:f.totalExceptions,minimal:!0})]}),d.jsx($D,{data:v}),d.jsxs("div",{className:"space-y-3",children:[d.jsx("h4",{className:"text-sm font-medium",children:"Recent Exceptions"}),u==null?void 0:u.slice(0,10).map(g=>d.jsx(Tf,{status:"error",label:g.exception_type,description:g.exception_value||void 0,value:new Date(g.created_at).toLocaleTimeString(),className:"cursor-pointer hover:bg-muted/50 p-2 -mx-2 rounded transition-colors",onClick:()=>a("request",g.request_id)},g.id)),(!u||u.length===0)&&d.jsx("p",{className:"text-center text-muted-foreground py-4",children:i("performance.noExceptionsCaptured")})]})]})]})})]})]})}function oie(){const{theme:e,setTheme:t}=ul(),{t:r}=e0(),{language:n,setLanguage:a}=u5(),{data:i,isLoading:o}=tt({queryKey:["settings-stats"],queryFn:()=>Me.getStats(24*7),refetchInterval:3e4}),s=async()=>{confirm("Are you sure you want to clear all captured data?")&&(await Me.clearData(),window.location.reload())},l=async c=>{const u=c/24,f=u===1?"1 day":`${u} days`;confirm(`Are you sure you want to clear data older than ${f}?`)&&(await Me.clearData(c),window.location.reload())};return d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:r("pages.settings.title")}),d.jsx("p",{className:"text-muted-foreground",children:r("pages.settings.description")})]}),d.jsxs("div",{className:"grid gap-6 md:grid-cols-2",children:[d.jsxs(ne,{children:[d.jsxs(ue,{children:[d.jsx(fe,{children:r("settings.appearance.title")}),d.jsx(bt,{children:r("settings.appearance.description")})]}),d.jsx(ae,{className:"space-y-4",children:d.jsxs("div",{className:"space-y-2",children:[d.jsx(Wr,{children:r("settings.appearance.theme")}),d.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:r("settings.appearance.themeDescription")}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(oe,{variant:e==="light"?"default":"outline",size:"sm",onClick:()=>t("light"),children:[d.jsx(BN,{className:"mr-2 h-4 w-4"}),r("settings.appearance.light")]}),d.jsxs(oe,{variant:e==="dark"?"default":"outline",size:"sm",onClick:()=>t("dark"),children:[d.jsx($N,{className:"mr-2 h-4 w-4"}),r("settings.appearance.dark")]})]})]})})]}),d.jsxs(ne,{children:[d.jsxs(ue,{children:[d.jsx(fe,{children:r("settings.language.title")}),d.jsx(bt,{children:r("settings.language.description")})]}),d.jsx(ae,{className:"space-y-4",children:d.jsxs("div",{className:"space-y-2",children:[d.jsx(Wr,{children:r("settings.language.current")}),d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsxs(oe,{variant:n==="en"?"default":"outline",size:"sm",onClick:()=>a("en"),children:[d.jsx(nS,{className:"mr-2 h-4 w-4"}),r("settings.language.english")]}),d.jsxs(oe,{variant:n==="zh"?"default":"outline",size:"sm",onClick:()=>a("zh"),children:[d.jsx(nS,{className:"mr-2 h-4 w-4"}),r("settings.language.chinese")]})]})]})})]}),d.jsxs(ne,{children:[d.jsxs(ue,{children:[d.jsx(fe,{children:r("settings.database.title")}),d.jsx(bt,{children:r("settings.database.description")})]}),d.jsx(ae,{className:"space-y-3",children:o?d.jsx("div",{className:"text-center py-4 text-sm text-muted-foreground",children:r("settings.database.loading")}):d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-sm text-muted-foreground",children:r("settings.database.totalRequests")}),d.jsx("span",{className:"font-medium",children:(i==null?void 0:i.total_requests)!==void 0?i.total_requests.toLocaleString():"—"})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-sm text-muted-foreground",children:r("settings.database.totalQueries")}),d.jsx("span",{className:"font-medium",children:(i==null?void 0:i.total_queries)!==void 0?i.total_queries.toLocaleString():"—"})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-sm text-muted-foreground",children:r("settings.database.totalExceptions")}),d.jsx("span",{className:"font-medium",children:(i==null?void 0:i.total_exceptions)!==void 0?i.total_exceptions.toLocaleString():"—"})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-sm text-muted-foreground",children:r("settings.database.slowQueries")}),d.jsx("span",{className:"font-medium",children:(i==null?void 0:i.slow_queries)!==void 0?i.slow_queries.toLocaleString():"—"})]}),d.jsx(go,{}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-sm text-muted-foreground",children:r("settings.database.avgResponseTime")}),d.jsx("span",{className:"font-medium",children:(i==null?void 0:i.avg_response_time)!==null&&(i==null?void 0:i.avg_response_time)!==void 0?`${Math.round(i.avg_response_time)}ms`:"—"})]}),d.jsxs("div",{className:"flex items-center justify-between",children:[d.jsx("span",{className:"text-sm text-muted-foreground",children:r("settings.database.requestsPerMinute")}),d.jsx("span",{className:"font-medium",children:(i==null?void 0:i.requests_per_minute)!==void 0?i.requests_per_minute.toFixed(1):"—"})]})]})})]}),d.jsxs(ne,{className:"md:col-span-2",children:[d.jsxs(ue,{children:[d.jsx(fe,{children:r("settings.dataManagement.title")}),d.jsx(bt,{children:r("settings.dataManagement.description")})]}),d.jsxs(ae,{className:"space-y-4",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx(Wr,{children:r("settings.dataManagement.quickActions")}),d.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:r("settings.dataManagement.quickActionsDescription")}),d.jsxs("div",{className:"grid gap-2 sm:grid-cols-3",children:[d.jsxs(oe,{variant:"outline",className:"justify-start",onClick:()=>l(24),children:[d.jsx(Ud,{className:"mr-2 h-4 w-4"}),r("settings.dataManagement.clear1Day")]}),d.jsxs(oe,{variant:"outline",className:"justify-start",onClick:()=>l(24*7),children:[d.jsx(Ud,{className:"mr-2 h-4 w-4"}),r("settings.dataManagement.clear7Days")]}),d.jsxs(oe,{variant:"outline",className:"justify-start",onClick:()=>l(24*30),children:[d.jsx(Ud,{className:"mr-2 h-4 w-4"}),r("settings.dataManagement.clear30Days")]})]})]}),d.jsx(go,{}),d.jsxs("div",{className:"space-y-2",children:[d.jsx(Wr,{children:r("settings.dataManagement.dangerZone")}),d.jsx("p",{className:"text-sm text-muted-foreground mb-3",children:r("settings.dataManagement.dangerZoneDescription")}),d.jsxs(oe,{variant:"destructive",onClick:s,children:[d.jsx(Bo,{className:"mr-2 h-4 w-4"}),r("settings.dataManagement.clearAll")]})]})]})]}),d.jsxs(ne,{className:"md:col-span-2",children:[d.jsxs(ue,{children:[d.jsx(fe,{children:r("settings.about.title")}),d.jsx(bt,{children:r("settings.about.description")})]}),d.jsxs(ae,{className:"space-y-4",children:[d.jsxs("div",{className:"text-sm text-muted-foreground",children:[d.jsx("p",{className:"mb-2",children:r("settings.about.content")}),d.jsx("p",{children:d.jsxs("strong",{children:[r("settings.about.features"),":"]})}),d.jsxs("ul",{className:"list-disc list-inside mt-1 space-y-1",children:[d.jsx("li",{children:r("settings.about.feature1")}),d.jsx("li",{children:r("settings.about.feature2")}),d.jsx("li",{children:r("settings.about.feature3")}),d.jsx("li",{children:r("settings.about.feature4")}),d.jsx("li",{children:r("settings.about.feature5")})]})]}),d.jsx(go,{}),d.jsxs("div",{className:"flex items-center justify-between text-sm",children:[d.jsx("span",{className:"text-muted-foreground",children:r("settings.about.version")}),d.jsx("span",{className:"font-medium",children:"0.2.0"})]}),d.jsxs("div",{className:"flex items-center justify-between text-sm",children:[d.jsx("span",{className:"text-muted-foreground",children:r("settings.about.dashboard")}),d.jsxs("span",{className:"font-medium",children:[d.jsx(su,{className:"inline h-3 w-3 mr-1"}),r("settings.about.connected")]})]})]})]})]})]})}function sie(){const e=zp(),t=Tr(),{data:r,isLoading:n,isError:a,error:i}=tt({queryKey:["background-tasks"],queryFn:()=>Me.getBackgroundTasks({limit:100}),refetchInterval:3e3}),o=c=>{switch(c){case"completed":return"default";case"failed":return"destructive";case"running":return"secondary";default:return"outline"}},s=c=>{switch(c){case"completed":return d.jsx(U4,{className:"h-4 w-4"});case"failed":return d.jsx(Zx,{className:"h-4 w-4"});case"running":return d.jsx(G4,{className:"h-4 w-4 animate-spin"});default:return d.jsx(zo,{className:"h-4 w-4"})}},l=c=>c?c<1e3?`${c}ms`:`${(c/1e3).toFixed(2)}s`:"N/A";return n?d.jsx("div",{className:"flex items-center justify-center h-screen",children:d.jsx("div",{className:"text-muted-foreground",children:t("common.loading")})}):a?d.jsx("div",{className:"flex items-center justify-center h-screen",children:d.jsx(ne,{className:"border-destructive",children:d.jsxs(ae,{className:"py-8 text-center",children:[d.jsx("p",{className:"text-destructive font-medium",children:t("backgroundTasks.failedToLoad")}),d.jsx("p",{className:"text-sm text-muted-foreground mt-2",children:i instanceof Error?i.message:t("detailDrawer.common.unknown")})]})})}):d.jsxs("div",{className:"space-y-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-bold tracking-tight",children:t("pages.backgroundTasks.title")}),d.jsx("p",{className:"text-muted-foreground",children:t("pages.backgroundTasks.description")})]}),d.jsxs("div",{className:"grid gap-4",children:[r&&r.length===0&&d.jsx(ne,{children:d.jsx(ae,{className:"py-8 text-center text-muted-foreground",children:t("backgroundTasks.noTasks")})}),r==null?void 0:r.map(c=>d.jsxs(ne,{children:[d.jsx(ue,{children:d.jsxs("div",{className:"flex items-start justify-between",children:[d.jsxs("div",{className:"space-y-1",children:[d.jsxs(fe,{className:"text-base flex items-center gap-2",children:[s(c.status),c.name]}),d.jsx("p",{className:"text-sm text-muted-foreground font-mono",children:c.task_id})]}),d.jsx(ve,{variant:o(c.status),children:c.status==="completed"?t("backgroundTasks.status.completed"):c.status==="failed"?t("backgroundTasks.status.failed"):c.status==="running"?t("backgroundTasks.status.running"):c.status})]})}),d.jsxs(ae,{children:[d.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[d.jsxs("div",{children:[d.jsx("p",{className:"text-muted-foreground",children:t("backgroundTasks.started")}),d.jsx("p",{className:"font-medium",children:c.start_time?Rn(new Date(c.start_time),"HH:mm:ss"):"N/A"})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-muted-foreground",children:t("backgroundTasks.duration")}),d.jsx("p",{className:"font-medium",children:l(c.duration_ms)})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-muted-foreground",children:t("backgroundTasks.requestId")}),c.request_id?d.jsxs(oe,{variant:"link",size:"sm",className:"h-auto p-0 font-mono text-xs",onClick:()=>e(`/requests/${c.request_id}`),children:[c.request_id.slice(0,8),d.jsx(H4,{className:"h-3 w-3 ml-1"})]}):d.jsx("p",{className:"font-mono text-xs",children:"N/A"})]}),d.jsxs("div",{children:[d.jsx("p",{className:"text-muted-foreground",children:t("backgroundTasks.created")}),d.jsx("p",{className:"font-medium",children:Rn(new Date(c.created_at),"HH:mm:ss")})]})]}),c.error&&d.jsxs("div",{className:"mt-4 p-3 bg-destructive/10 border border-destructive/20 rounded",children:[d.jsxs("p",{className:"text-sm text-destructive font-medium",children:[t("common.error"),":"]}),d.jsx("p",{className:"text-sm text-destructive mt-1",children:c.error})]})]})]},c.task_id))]})]})}var lm="Dialog",[NM]=Kn(lm),[lie,Sn]=NM(lm),OM=e=>{const{__scopeDialog:t,children:r,open:n,defaultOpen:a,onOpenChange:i,modal:o=!0}=e,s=m.useRef(null),l=m.useRef(null),[c,u]=Po({prop:n,defaultProp:a??!1,onChange:i,caller:lm});return d.jsx(lie,{scope:t,triggerRef:s,contentRef:l,contentId:ma(),titleId:ma(),descriptionId:ma(),open:c,onOpenChange:u,onOpenToggle:m.useCallback(()=>u(f=>!f),[u]),modal:o,children:r})};OM.displayName=lm;var AM="DialogTrigger",cie=m.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=Sn(AM,r),i=be(t,a.triggerRef);return d.jsx(se.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":jw(a.open),...n,ref:i,onClick:ie(e.onClick,a.onOpenToggle)})});cie.displayName=AM;var Sw="DialogPortal",[uie,TM]=NM(Sw,{forceMount:void 0}),_M=e=>{const{__scopeDialog:t,forceMount:r,children:n,container:a}=e,i=Sn(Sw,t);return d.jsx(uie,{scope:t,forceMount:r,children:m.Children.map(n,o=>d.jsx(wn,{present:r||i.open,children:d.jsx(Zp,{asChild:!0,container:a,children:o})}))})};_M.displayName=Sw;var Ep="DialogOverlay",RM=m.forwardRef((e,t)=>{const r=TM(Ep,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=Sn(Ep,e.__scopeDialog);return i.modal?d.jsx(wn,{present:n||i.open,children:d.jsx(fie,{...a,ref:t})}):null});RM.displayName=Ep;var die=zs("DialogOverlay.RemoveScroll"),fie=m.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=Sn(Ep,r);return d.jsx(u0,{as:die,allowPinchZoom:!0,shards:[a.contentRef],children:d.jsx(se.div,{"data-state":jw(a.open),...n,ref:t,style:{pointerEvents:"auto",...n.style}})})}),Lo="DialogContent",DM=m.forwardRef((e,t)=>{const r=TM(Lo,e.__scopeDialog),{forceMount:n=r.forceMount,...a}=e,i=Sn(Lo,e.__scopeDialog);return d.jsx(wn,{present:n||i.open,children:i.modal?d.jsx(pie,{...a,ref:t}):d.jsx(hie,{...a,ref:t})})});DM.displayName=Lo;var pie=m.forwardRef((e,t)=>{const r=Sn(Lo,e.__scopeDialog),n=m.useRef(null),a=be(t,r.contentRef,n);return m.useEffect(()=>{const i=n.current;if(i)return jO(i)},[]),d.jsx(MM,{...e,ref:a,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ie(e.onCloseAutoFocus,i=>{var o;i.preventDefault(),(o=r.triggerRef.current)==null||o.focus()}),onPointerDownOutside:ie(e.onPointerDownOutside,i=>{const o=i.detail.originalEvent,s=o.button===0&&o.ctrlKey===!0;(o.button===2||s)&&i.preventDefault()}),onFocusOutside:ie(e.onFocusOutside,i=>i.preventDefault())})}),hie=m.forwardRef((e,t)=>{const r=Sn(Lo,e.__scopeDialog),n=m.useRef(!1),a=m.useRef(!1);return d.jsx(MM,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:i=>{var o,s;(o=e.onCloseAutoFocus)==null||o.call(e,i),i.defaultPrevented||(n.current||(s=r.triggerRef.current)==null||s.focus(),i.preventDefault()),n.current=!1,a.current=!1},onInteractOutside:i=>{var l,c;(l=e.onInteractOutside)==null||l.call(e,i),i.defaultPrevented||(n.current=!0,i.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const o=i.target;((c=r.triggerRef.current)==null?void 0:c.contains(o))&&i.preventDefault(),i.detail.originalEvent.type==="focusin"&&a.current&&i.preventDefault()}})}),MM=m.forwardRef((e,t)=>{const{__scopeDialog:r,trapFocus:n,onOpenAutoFocus:a,onCloseAutoFocus:i,...o}=e,s=Sn(Lo,r),l=m.useRef(null),c=be(t,l);return KN(),d.jsxs(d.Fragment,{children:[d.jsx(t0,{asChild:!0,loop:!0,trapped:n,onMountAutoFocus:a,onUnmountAutoFocus:i,children:d.jsx(Kp,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":jw(s.open),...o,ref:c,onDismiss:()=>s.onOpenChange(!1)})}),d.jsxs(d.Fragment,{children:[d.jsx(mie,{titleId:s.titleId}),d.jsx(vie,{contentRef:l,descriptionId:s.descriptionId})]})]})}),Ew="DialogTitle",IM=m.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=Sn(Ew,r);return d.jsx(se.h2,{id:a.titleId,...n,ref:t})});IM.displayName=Ew;var LM="DialogDescription",$M=m.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=Sn(LM,r);return d.jsx(se.p,{id:a.descriptionId,...n,ref:t})});$M.displayName=LM;var FM="DialogClose",BM=m.forwardRef((e,t)=>{const{__scopeDialog:r,...n}=e,a=Sn(FM,r);return d.jsx(se.button,{type:"button",...n,ref:t,onClick:ie(e.onClick,()=>a.onOpenChange(!1))})});BM.displayName=FM;function jw(e){return e?"open":"closed"}var zM="DialogTitleWarning",[Roe,UM]=m5(zM,{contentName:Lo,titleName:Ew,docsSlug:"dialog"}),mie=({titleId:e})=>{const t=UM(zM),r=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. diff --git a/fastapi_radar/dashboard/dist/index.html b/fastapi_radar/dashboard/dist/index.html index edaebdd..d122c81 100644 --- a/fastapi_radar/dashboard/dist/index.html +++ b/fastapi_radar/dashboard/dist/index.html @@ -4,7 +4,7 @@ FastAPI Radar - Debugging Dashboard - + diff --git a/fastapi_radar/dashboard/src/components/TracesList.tsx b/fastapi_radar/dashboard/src/components/TracesList.tsx index b5f3c2b..25dac89 100644 --- a/fastapi_radar/dashboard/src/components/TracesList.tsx +++ b/fastapi_radar/dashboard/src/components/TracesList.tsx @@ -151,7 +151,7 @@ export function TracesList({ className }: TracesListProps) { } > - + {t("traceslist.all")} @@ -201,7 +201,7 @@ export function TracesList({ className }: TracesListProps) { ) : traces.length === 0 ? (
-

No traces found matching your criteria.

+

{t("traceslist.noTraces")}

) : (
diff --git a/fastapi_radar/dashboard/src/i18n/translations.ts b/fastapi_radar/dashboard/src/i18n/translations.ts index c9c2b8f..fad4bed 100644 --- a/fastapi_radar/dashboard/src/i18n/translations.ts +++ b/fastapi_radar/dashboard/src/i18n/translations.ts @@ -430,6 +430,7 @@ export interface Translations { failToLoadTraces: string; anError: string; tryAgain: string; + noTraces: string; }; layout: { @@ -858,6 +859,7 @@ const en: Translations = { failToLoadTraces: "Failed to load traces", anError: "There was an error loading the trace data.", tryAgain: "Try again", + noTraces: "No traces found matching your criteria.", }, layout: { @@ -1282,6 +1284,7 @@ const zh: Translations = { failToLoadTraces: "加载追踪记录失败", anError: "加载追踪数据时出错", tryAgain: "重试", + noTraces: "未找到匹配条件的追踪记录", }, layout: {