@tokenbuddy/tokenbuddy 1.0.29 → 1.0.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/dist/src/daemon.d.ts +11 -4
  2. package/dist/src/daemon.d.ts.map +1 -1
  3. package/dist/src/daemon.js +130 -42
  4. package/dist/src/daemon.js.map +1 -1
  5. package/dist/src/doctor-diagnostics.d.ts.map +1 -1
  6. package/dist/src/doctor-diagnostics.js +7 -1
  7. package/dist/src/doctor-diagnostics.js.map +1 -1
  8. package/dist/src/prewarm-cache.d.ts +4 -0
  9. package/dist/src/prewarm-cache.d.ts.map +1 -1
  10. package/dist/src/prewarm-cache.js +1 -0
  11. package/dist/src/prewarm-cache.js.map +1 -1
  12. package/dist/src/prewarm-scheduler.d.ts +2 -0
  13. package/dist/src/prewarm-scheduler.d.ts.map +1 -1
  14. package/dist/src/prewarm-scheduler.js +4 -1
  15. package/dist/src/prewarm-scheduler.js.map +1 -1
  16. package/dist/src/provider-install.d.ts.map +1 -1
  17. package/dist/src/provider-install.js +196 -18
  18. package/dist/src/provider-install.js.map +1 -1
  19. package/dist/src/seller-catalog.d.ts +4 -0
  20. package/dist/src/seller-catalog.d.ts.map +1 -1
  21. package/dist/src/seller-catalog.js.map +1 -1
  22. package/dist/src/seller-pool.d.ts +13 -0
  23. package/dist/src/seller-pool.d.ts.map +1 -1
  24. package/dist/src/seller-pool.js +43 -2
  25. package/dist/src/seller-pool.js.map +1 -1
  26. package/dist/src/seller-route-planner.d.ts +9 -0
  27. package/dist/src/seller-route-planner.d.ts.map +1 -1
  28. package/dist/src/seller-route-planner.js +39 -15
  29. package/dist/src/seller-route-planner.js.map +1 -1
  30. package/dist/src/seller-routing-strategy.d.ts +6 -4
  31. package/dist/src/seller-routing-strategy.d.ts.map +1 -1
  32. package/dist/src/seller-routing-strategy.js +15 -12
  33. package/dist/src/seller-routing-strategy.js.map +1 -1
  34. package/dist/src/terminal-detect.d.ts +5 -5
  35. package/dist/src/terminal-detect.d.ts.map +1 -1
  36. package/dist/src/terminal-detect.js +79 -26
  37. package/dist/src/terminal-detect.js.map +1 -1
  38. package/package.json +1 -1
  39. package/src/daemon.ts +168 -46
  40. package/src/doctor-diagnostics.ts +5 -1
  41. package/src/prewarm-cache.ts +5 -0
  42. package/src/prewarm-scheduler.ts +6 -1
  43. package/src/provider-install.ts +203 -18
  44. package/src/seller-catalog.ts +4 -0
  45. package/src/seller-pool.ts +68 -2
  46. package/src/seller-route-planner.ts +61 -15
  47. package/src/seller-routing-strategy.ts +21 -16
  48. package/src/terminal-detect.ts +81 -24
  49. package/static/ui/assets/index-DEDEl8o2.js +236 -0
  50. package/static/ui/assets/{index-UAfOhbwC.js.map → index-DEDEl8o2.js.map} +1 -1
  51. package/static/ui/index.html +1 -1
  52. package/tests/control-plane-ui-endpoints.test.ts +73 -0
  53. package/tests/seller-pool.test.ts +55 -0
  54. package/tests/seller-route-planner.test.ts +45 -1
  55. package/tests/seller-routing-strategy.test.ts +6 -5
  56. package/tests/tokenbuddy.test.ts +346 -38
  57. package/static/ui/assets/index-UAfOhbwC.js +0 -236
@@ -0,0 +1,236 @@
1
+ var Kb=Object.defineProperty;var mv=a=>{throw TypeError(a)};var Xb=(a,i,r)=>i in a?Kb(a,i,{enumerable:!0,configurable:!0,writable:!0,value:r}):a[i]=r;var xd=(a,i,r)=>Xb(a,typeof i!="symbol"?i+"":i,r),yd=(a,i,r)=>i.has(a)||mv("Cannot "+r);var N=(a,i,r)=>(yd(a,i,"read from private field"),r?r.call(a):i.get(a)),ue=(a,i,r)=>i.has(a)?mv("Cannot add the same private member more than once"):i instanceof WeakSet?i.add(a):i.set(a,r),ee=(a,i,r,u)=>(yd(a,i,"write to private field"),u?u.call(a,r):i.set(a,r),r),ye=(a,i,r)=>(yd(a,i,"access private method"),r);var zo=(a,i,r,u)=>({set _(d){ee(a,i,d,r)},get _(){return N(a,i,u)}});(function(){const i=document.createElement("link").relList;if(i&&i.supports&&i.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const m of d)if(m.type==="childList")for(const h of m.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&u(h)}).observe(document,{childList:!0,subtree:!0});function r(d){const m={};return d.integrity&&(m.integrity=d.integrity),d.referrerPolicy&&(m.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?m.credentials="include":d.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function u(d){if(d.ep)return;d.ep=!0;const m=r(d);fetch(d.href,m)}})();var bd={exports:{}},Ur={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var hv;function Vb(){if(hv)return Ur;hv=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.fragment");function r(u,d,m){var h=null;if(m!==void 0&&(h=""+m),d.key!==void 0&&(h=""+d.key),"key"in d){m={};for(var x in d)x!=="key"&&(m[x]=d[x])}else m=d;return d=m.ref,{$$typeof:a,type:u,key:h,ref:d!==void 0?d:null,props:m}}return Ur.Fragment=i,Ur.jsx=r,Ur.jsxs=r,Ur}var pv;function Zb(){return pv||(pv=1,bd.exports=Vb()),bd.exports}var s=Zb(),gd={exports:{}},he={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var vv;function $b(){if(vv)return he;vv=1;var a=Symbol.for("react.transitional.element"),i=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),m=Symbol.for("react.consumer"),h=Symbol.for("react.context"),x=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),v=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),E=Symbol.iterator;function T(M){return M===null||typeof M!="object"?null:(M=E&&M[E]||M["@@iterator"],typeof M=="function"?M:null)}var A={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z=Object.assign,Q={};function U(M,k,Z){this.props=M,this.context=k,this.refs=Q,this.updater=Z||A}U.prototype.isReactComponent={},U.prototype.setState=function(M,k){if(typeof M!="object"&&typeof M!="function"&&M!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,M,k,"setState")},U.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function L(){}L.prototype=U.prototype;function K(M,k,Z){this.props=M,this.context=k,this.refs=Q,this.updater=Z||A}var B=K.prototype=new L;B.constructor=K,z(B,U.prototype),B.isPureReactComponent=!0;var V=Array.isArray;function P(){}var J={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function te(M,k,Z){var W=Z.ref;return{$$typeof:a,type:M,key:k,ref:W!==void 0?W:null,props:Z}}function se(M,k){return te(M.type,k,M.props)}function F(M){return typeof M=="object"&&M!==null&&M.$$typeof===a}function fe(M){var k={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(Z){return k[Z]})}var pe=/\/+/g;function Ae(M,k){return typeof M=="object"&&M!==null&&M.key!=null?fe(""+M.key):k.toString(36)}function me(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(P,P):(M.status="pending",M.then(function(k){M.status==="pending"&&(M.status="fulfilled",M.value=k)},function(k){M.status==="pending"&&(M.status="rejected",M.reason=k)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function _(M,k,Z,W,X){var le=typeof M;(le==="undefined"||le==="boolean")&&(M=null);var re=!1;if(M===null)re=!0;else switch(le){case"bigint":case"string":case"number":re=!0;break;case"object":switch(M.$$typeof){case a:case i:re=!0;break;case g:return re=M._init,_(re(M._payload),k,Z,W,X)}}if(re)return X=X(M),re=W===""?"."+Ae(M,0):W,V(X)?(Z="",re!=null&&(Z=re.replace(pe,"$&/")+"/"),_(X,k,Z,"",function(qt){return qt})):X!=null&&(F(X)&&(X=se(X,Z+(X.key==null||M&&M.key===X.key?"":(""+X.key).replace(pe,"$&/")+"/")+re)),k.push(X)),1;re=0;var Te=W===""?".":W+":";if(V(M))for(var ze=0;ze<M.length;ze++)W=M[ze],le=Te+Ae(W,ze),re+=_(W,k,Z,le,X);else if(ze=T(M),typeof ze=="function")for(M=ze.call(M),ze=0;!(W=M.next()).done;)W=W.value,le=Te+Ae(W,ze++),re+=_(W,k,Z,le,X);else if(le==="object"){if(typeof M.then=="function")return _(me(M),k,Z,W,X);throw k=String(M),Error("Objects are not valid as a React child (found: "+(k==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":k)+"). If you meant to render a collection of children, use an array instead.")}return re}function $(M,k,Z){if(M==null)return M;var W=[],X=0;return _(M,W,"","",function(le){return k.call(Z,le,X++)}),W}function ne(M){if(M._status===-1){var k=M._result;k=k(),k.then(function(Z){(M._status===0||M._status===-1)&&(M._status=1,M._result=Z)},function(Z){(M._status===0||M._status===-1)&&(M._status=2,M._result=Z)}),M._status===-1&&(M._status=0,M._result=k)}if(M._status===1)return M._result.default;throw M._result}var be=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var k=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(k))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},ge={map:$,forEach:function(M,k,Z){$(M,function(){k.apply(this,arguments)},Z)},count:function(M){var k=0;return $(M,function(){k++}),k},toArray:function(M){return $(M,function(k){return k})||[]},only:function(M){if(!F(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return he.Activity=b,he.Children=ge,he.Component=U,he.Fragment=r,he.Profiler=d,he.PureComponent=K,he.StrictMode=u,he.Suspense=p,he.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=J,he.__COMPILER_RUNTIME={__proto__:null,c:function(M){return J.H.useMemoCache(M)}},he.cache=function(M){return function(){return M.apply(null,arguments)}},he.cacheSignal=function(){return null},he.cloneElement=function(M,k,Z){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var W=z({},M.props),X=M.key;if(k!=null)for(le in k.key!==void 0&&(X=""+k.key),k)!I.call(k,le)||le==="key"||le==="__self"||le==="__source"||le==="ref"&&k.ref===void 0||(W[le]=k[le]);var le=arguments.length-2;if(le===1)W.children=Z;else if(1<le){for(var re=Array(le),Te=0;Te<le;Te++)re[Te]=arguments[Te+2];W.children=re}return te(M.type,X,W)},he.createContext=function(M){return M={$$typeof:h,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:m,_context:M},M},he.createElement=function(M,k,Z){var W,X={},le=null;if(k!=null)for(W in k.key!==void 0&&(le=""+k.key),k)I.call(k,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(X[W]=k[W]);var re=arguments.length-2;if(re===1)X.children=Z;else if(1<re){for(var Te=Array(re),ze=0;ze<re;ze++)Te[ze]=arguments[ze+2];X.children=Te}if(M&&M.defaultProps)for(W in re=M.defaultProps,re)X[W]===void 0&&(X[W]=re[W]);return te(M,le,X)},he.createRef=function(){return{current:null}},he.forwardRef=function(M){return{$$typeof:x,render:M}},he.isValidElement=F,he.lazy=function(M){return{$$typeof:g,_payload:{_status:-1,_result:M},_init:ne}},he.memo=function(M,k){return{$$typeof:v,type:M,compare:k===void 0?null:k}},he.startTransition=function(M){var k=J.T,Z={};J.T=Z;try{var W=M(),X=J.S;X!==null&&X(Z,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(P,be)}catch(le){be(le)}finally{k!==null&&Z.types!==null&&(k.types=Z.types),J.T=k}},he.unstable_useCacheRefresh=function(){return J.H.useCacheRefresh()},he.use=function(M){return J.H.use(M)},he.useActionState=function(M,k,Z){return J.H.useActionState(M,k,Z)},he.useCallback=function(M,k){return J.H.useCallback(M,k)},he.useContext=function(M){return J.H.useContext(M)},he.useDebugValue=function(){},he.useDeferredValue=function(M,k){return J.H.useDeferredValue(M,k)},he.useEffect=function(M,k){return J.H.useEffect(M,k)},he.useEffectEvent=function(M){return J.H.useEffectEvent(M)},he.useId=function(){return J.H.useId()},he.useImperativeHandle=function(M,k,Z){return J.H.useImperativeHandle(M,k,Z)},he.useInsertionEffect=function(M,k){return J.H.useInsertionEffect(M,k)},he.useLayoutEffect=function(M,k){return J.H.useLayoutEffect(M,k)},he.useMemo=function(M,k){return J.H.useMemo(M,k)},he.useOptimistic=function(M,k){return J.H.useOptimistic(M,k)},he.useReducer=function(M,k,Z){return J.H.useReducer(M,k,Z)},he.useRef=function(M){return J.H.useRef(M)},he.useState=function(M){return J.H.useState(M)},he.useSyncExternalStore=function(M,k,Z){return J.H.useSyncExternalStore(M,k,Z)},he.useTransition=function(){return J.H.useTransition()},he.version="19.2.7",he}var xv;function af(){return xv||(xv=1,gd.exports=$b()),gd.exports}var j=af(),jd={exports:{}},Br={},Sd={exports:{}},Nd={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var yv;function Jb(){return yv||(yv=1,(function(a){function i(_,$){var ne=_.length;_.push($);e:for(;0<ne;){var be=ne-1>>>1,ge=_[be];if(0<d(ge,$))_[be]=$,_[ne]=ge,ne=be;else break e}}function r(_){return _.length===0?null:_[0]}function u(_){if(_.length===0)return null;var $=_[0],ne=_.pop();if(ne!==$){_[0]=ne;e:for(var be=0,ge=_.length,M=ge>>>1;be<M;){var k=2*(be+1)-1,Z=_[k],W=k+1,X=_[W];if(0>d(Z,ne))W<ge&&0>d(X,Z)?(_[be]=X,_[W]=ne,be=W):(_[be]=Z,_[k]=ne,be=k);else if(W<ge&&0>d(X,ne))_[be]=X,_[W]=ne,be=W;else break e}}return $}function d(_,$){var ne=_.sortIndex-$.sortIndex;return ne!==0?ne:_.id-$.id}if(a.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;a.unstable_now=function(){return m.now()}}else{var h=Date,x=h.now();a.unstable_now=function(){return h.now()-x}}var p=[],v=[],g=1,b=null,E=3,T=!1,A=!1,z=!1,Q=!1,U=typeof setTimeout=="function"?setTimeout:null,L=typeof clearTimeout=="function"?clearTimeout:null,K=typeof setImmediate<"u"?setImmediate:null;function B(_){for(var $=r(v);$!==null;){if($.callback===null)u(v);else if($.startTime<=_)u(v),$.sortIndex=$.expirationTime,i(p,$);else break;$=r(v)}}function V(_){if(z=!1,B(_),!A)if(r(p)!==null)A=!0,P||(P=!0,fe());else{var $=r(v);$!==null&&me(V,$.startTime-_)}}var P=!1,J=-1,I=5,te=-1;function se(){return Q?!0:!(a.unstable_now()-te<I)}function F(){if(Q=!1,P){var _=a.unstable_now();te=_;var $=!0;try{e:{A=!1,z&&(z=!1,L(J),J=-1),T=!0;var ne=E;try{t:{for(B(_),b=r(p);b!==null&&!(b.expirationTime>_&&se());){var be=b.callback;if(typeof be=="function"){b.callback=null,E=b.priorityLevel;var ge=be(b.expirationTime<=_);if(_=a.unstable_now(),typeof ge=="function"){b.callback=ge,B(_),$=!0;break t}b===r(p)&&u(p),B(_)}else u(p);b=r(p)}if(b!==null)$=!0;else{var M=r(v);M!==null&&me(V,M.startTime-_),$=!1}}break e}finally{b=null,E=ne,T=!1}$=void 0}}finally{$?fe():P=!1}}}var fe;if(typeof K=="function")fe=function(){K(F)};else if(typeof MessageChannel<"u"){var pe=new MessageChannel,Ae=pe.port2;pe.port1.onmessage=F,fe=function(){Ae.postMessage(null)}}else fe=function(){U(F,0)};function me(_,$){J=U(function(){_(a.unstable_now())},$)}a.unstable_IdlePriority=5,a.unstable_ImmediatePriority=1,a.unstable_LowPriority=4,a.unstable_NormalPriority=3,a.unstable_Profiling=null,a.unstable_UserBlockingPriority=2,a.unstable_cancelCallback=function(_){_.callback=null},a.unstable_forceFrameRate=function(_){0>_||125<_?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<_?Math.floor(1e3/_):5},a.unstable_getCurrentPriorityLevel=function(){return E},a.unstable_next=function(_){switch(E){case 1:case 2:case 3:var $=3;break;default:$=E}var ne=E;E=$;try{return _()}finally{E=ne}},a.unstable_requestPaint=function(){Q=!0},a.unstable_runWithPriority=function(_,$){switch(_){case 1:case 2:case 3:case 4:case 5:break;default:_=3}var ne=E;E=_;try{return $()}finally{E=ne}},a.unstable_scheduleCallback=function(_,$,ne){var be=a.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?be+ne:be):ne=be,_){case 1:var ge=-1;break;case 2:ge=250;break;case 5:ge=1073741823;break;case 4:ge=1e4;break;default:ge=5e3}return ge=ne+ge,_={id:g++,callback:$,priorityLevel:_,startTime:ne,expirationTime:ge,sortIndex:-1},ne>be?(_.sortIndex=ne,i(v,_),r(p)===null&&_===r(v)&&(z?(L(J),J=-1):z=!0,me(V,ne-be))):(_.sortIndex=ge,i(p,_),A||T||(A=!0,P||(P=!0,fe()))),_},a.unstable_shouldYield=se,a.unstable_wrapCallback=function(_){var $=E;return function(){var ne=E;E=$;try{return _.apply(this,arguments)}finally{E=ne}}}})(Nd)),Nd}var bv;function Fb(){return bv||(bv=1,Sd.exports=Jb()),Sd.exports}var Md={exports:{}},bt={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var gv;function Pb(){if(gv)return bt;gv=1;var a=af();function i(p){var v="https://react.dev/errors/"+p;if(1<arguments.length){v+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)v+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+p+"; visit "+v+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var u={d:{f:r,r:function(){throw Error(i(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},d=Symbol.for("react.portal");function m(p,v,g){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:b==null?null:""+b,children:p,containerInfo:v,implementation:g}}var h=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function x(p,v){if(p==="font")return"";if(typeof v=="string")return v==="use-credentials"?v:""}return bt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,bt.createPortal=function(p,v){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!v||v.nodeType!==1&&v.nodeType!==9&&v.nodeType!==11)throw Error(i(299));return m(p,v,null,g)},bt.flushSync=function(p){var v=h.T,g=u.p;try{if(h.T=null,u.p=2,p)return p()}finally{h.T=v,u.p=g,u.d.f()}},bt.preconnect=function(p,v){typeof p=="string"&&(v?(v=v.crossOrigin,v=typeof v=="string"?v==="use-credentials"?v:"":void 0):v=null,u.d.C(p,v))},bt.prefetchDNS=function(p){typeof p=="string"&&u.d.D(p)},bt.preinit=function(p,v){if(typeof p=="string"&&v&&typeof v.as=="string"){var g=v.as,b=x(g,v.crossOrigin),E=typeof v.integrity=="string"?v.integrity:void 0,T=typeof v.fetchPriority=="string"?v.fetchPriority:void 0;g==="style"?u.d.S(p,typeof v.precedence=="string"?v.precedence:void 0,{crossOrigin:b,integrity:E,fetchPriority:T}):g==="script"&&u.d.X(p,{crossOrigin:b,integrity:E,fetchPriority:T,nonce:typeof v.nonce=="string"?v.nonce:void 0})}},bt.preinitModule=function(p,v){if(typeof p=="string")if(typeof v=="object"&&v!==null){if(v.as==null||v.as==="script"){var g=x(v.as,v.crossOrigin);u.d.M(p,{crossOrigin:g,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0})}}else v==null&&u.d.M(p)},bt.preload=function(p,v){if(typeof p=="string"&&typeof v=="object"&&v!==null&&typeof v.as=="string"){var g=v.as,b=x(g,v.crossOrigin);u.d.L(p,g,{crossOrigin:b,integrity:typeof v.integrity=="string"?v.integrity:void 0,nonce:typeof v.nonce=="string"?v.nonce:void 0,type:typeof v.type=="string"?v.type:void 0,fetchPriority:typeof v.fetchPriority=="string"?v.fetchPriority:void 0,referrerPolicy:typeof v.referrerPolicy=="string"?v.referrerPolicy:void 0,imageSrcSet:typeof v.imageSrcSet=="string"?v.imageSrcSet:void 0,imageSizes:typeof v.imageSizes=="string"?v.imageSizes:void 0,media:typeof v.media=="string"?v.media:void 0})}},bt.preloadModule=function(p,v){if(typeof p=="string")if(v){var g=x(v.as,v.crossOrigin);u.d.m(p,{as:typeof v.as=="string"&&v.as!=="script"?v.as:void 0,crossOrigin:g,integrity:typeof v.integrity=="string"?v.integrity:void 0})}else u.d.m(p)},bt.requestFormReset=function(p){u.d.r(p)},bt.unstable_batchedUpdates=function(p,v){return p(v)},bt.useFormState=function(p,v,g){return h.H.useFormState(p,v,g)},bt.useFormStatus=function(){return h.H.useHostTransitionStatus()},bt.version="19.2.7",bt}var jv;function Wb(){if(jv)return Md.exports;jv=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),Md.exports=Pb(),Md.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Sv;function Ib(){if(Sv)return Br;Sv=1;var a=Fb(),i=af(),r=Wb();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)t+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var t=e,l=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(l=t.return),e=t.return;while(e)}return t.tag===3?l:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function x(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(m(e)!==e)throw Error(u(188))}function v(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(u(188));return t!==e?null:e}for(var l=e,n=t;;){var o=l.return;if(o===null)break;var c=o.alternate;if(c===null){if(n=o.return,n!==null){l=n;continue}break}if(o.child===c.child){for(c=o.child;c;){if(c===l)return p(o),e;if(c===n)return p(o),t;c=c.sibling}throw Error(u(188))}if(l.return!==n.return)l=o,n=c;else{for(var f=!1,y=o.child;y;){if(y===l){f=!0,l=o,n=c;break}if(y===n){f=!0,n=o,l=c;break}y=y.sibling}if(!f){for(y=c.child;y;){if(y===l){f=!0,l=c,n=o;break}if(y===n){f=!0,n=c,l=o;break}y=y.sibling}if(!f)throw Error(u(189))}}if(l.alternate!==n)throw Error(u(190))}if(l.tag!==3)throw Error(u(188));return l.stateNode.current===l?e:t}function g(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=g(e),t!==null)return t;e=e.sibling}return null}var b=Object.assign,E=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),A=Symbol.for("react.portal"),z=Symbol.for("react.fragment"),Q=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),L=Symbol.for("react.consumer"),K=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),V=Symbol.for("react.suspense"),P=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),se=Symbol.for("react.memo_cache_sentinel"),F=Symbol.iterator;function fe(e){return e===null||typeof e!="object"?null:(e=F&&e[F]||e["@@iterator"],typeof e=="function"?e:null)}var pe=Symbol.for("react.client.reference");function Ae(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===pe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case z:return"Fragment";case U:return"Profiler";case Q:return"StrictMode";case V:return"Suspense";case P:return"SuspenseList";case te:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case A:return"Portal";case K:return e.displayName||"Context";case L:return(e._context.displayName||"Context")+".Consumer";case B:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case J:return t=e.displayName||null,t!==null?t:Ae(e.type)||"Memo";case I:t=e._payload,e=e._init;try{return Ae(e(t))}catch{}}return null}var me=Array.isArray,_=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},be=[],ge=-1;function M(e){return{current:e}}function k(e){0>ge||(e.current=be[ge],be[ge]=null,ge--)}function Z(e,t){ge++,be[ge]=e.current,e.current=t}var W=M(null),X=M(null),le=M(null),re=M(null);function Te(e,t){switch(Z(le,t),Z(X,e),Z(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Up(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Up(t),e=Bp(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}k(W),Z(W,e)}function ze(){k(W),k(X),k(le)}function qt(e){e.memoizedState!==null&&Z(re,e);var t=W.current,l=Bp(t,e.type);t!==l&&(Z(X,e),Z(W,l))}function fl(e){X.current===e&&(k(W),k(X)),re.current===e&&(k(re),Or._currentValue=ne)}var De,zt;function ht(e){if(De===void 0)try{throw Error()}catch(l){var t=l.stack.trim().match(/\n( *(at )?)/);De=t&&t[1]||"",zt=-1<l.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+De+e+zt}var An=!1;function oa(e,t){if(!e||An)return"";An=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var G=function(){throw Error()};if(Object.defineProperty(G.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(G,[])}catch(H){var D=H}Reflect.construct(e,[],G)}else{try{G.call()}catch(H){D=H}e.call(G.prototype)}}else{try{throw Error()}catch(H){D=H}(G=e())&&typeof G.catch=="function"&&G.catch(function(){})}}catch(H){if(H&&D&&typeof H.stack=="string")return[H.stack,D.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var o=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");o&&o.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=n.DetermineComponentFrameRoot(),f=c[0],y=c[1];if(f&&y){var S=f.split(`
44
+ `),O=y.split(`
45
+ `);for(o=n=0;n<S.length&&!S[n].includes("DetermineComponentFrameRoot");)n++;for(;o<O.length&&!O[o].includes("DetermineComponentFrameRoot");)o++;if(n===S.length||o===O.length)for(n=S.length-1,o=O.length-1;1<=n&&0<=o&&S[n]!==O[o];)o--;for(;1<=n&&0<=o;n--,o--)if(S[n]!==O[o]){if(n!==1||o!==1)do if(n--,o--,0>o||S[n]!==O[o]){var q=`
46
+ `+S[n].replace(" at new "," at ");return e.displayName&&q.includes("<anonymous>")&&(q=q.replace("<anonymous>",e.displayName)),q}while(1<=n&&0<=o);break}}}finally{An=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?ht(l):""}function au(e,t){switch(e.tag){case 26:case 27:case 5:return ht(e.type);case 16:return ht("Lazy");case 13:return e.child!==t&&t!==null?ht("Suspense Fallback"):ht("Suspense");case 19:return ht("SuspenseList");case 0:case 15:return oa(e.type,!1);case 11:return oa(e.type.render,!1);case 1:return oa(e.type,!0);case 31:return ht("Activity");default:return""}}function zn(e){try{var t="",l=null;do t+=au(e,l),l=e,e=e.return;while(e);return t}catch(n){return`
47
+ Error generating stack: `+n.message+`
48
+ `+n.stack}}var Sl=Object.prototype.hasOwnProperty,Va=a.unstable_scheduleCallback,Za=a.unstable_cancelCallback,os=a.unstable_shouldYield,us=a.unstable_requestPaint,Nt=a.unstable_now,nu=a.unstable_getCurrentPriorityLevel,cs=a.unstable_ImmediatePriority,ds=a.unstable_UserBlockingPriority,Rn=a.unstable_NormalPriority,iu=a.unstable_LowPriority,fs=a.unstable_IdlePriority,ru=a.log,su=a.unstable_setDisableYieldValue,$a=null,Mt=null;function Nl(e){if(typeof ru=="function"&&su(e),Mt&&typeof Mt.setStrictMode=="function")try{Mt.setStrictMode($a,e)}catch{}}var wt=Math.clz32?Math.clz32:ps,ms=Math.log,hs=Math.LN2;function ps(e){return e>>>=0,e===0?32:31-(ms(e)/hs|0)|0}var Ja=256,Fa=262144,Pa=4194304;function Ml(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Wa(e,t,l){var n=e.pendingLanes;if(n===0)return 0;var o=0,c=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var y=n&134217727;return y!==0?(n=y&~c,n!==0?o=Ml(n):(f&=y,f!==0?o=Ml(f):l||(l=y&~e,l!==0&&(o=Ml(l))))):(y=n&~c,y!==0?o=Ml(y):f!==0?o=Ml(f):l||(l=n&~e,l!==0&&(o=Ml(l)))),o===0?0:t!==0&&t!==o&&(t&c)===0&&(c=o&-o,l=t&-t,c>=l||c===32&&(l&4194048)!==0)?t:o}function ua(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function vs(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Gi(){var e=Pa;return Pa<<=1,(Pa&62914560)===0&&(Pa=4194304),e}function On(e){for(var t=[],l=0;31>l;l++)t.push(e);return t}function oe(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ye(e,t,l,n,o,c){var f=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var y=e.entanglements,S=e.expirationTimes,O=e.hiddenUpdates;for(l=f&~l;0<l;){var q=31-wt(l),G=1<<q;y[q]=0,S[q]=-1;var D=O[q];if(D!==null)for(O[q]=null,q=0;q<D.length;q++){var H=D[q];H!==null&&(H.lane&=-536870913)}l&=~G}n!==0&&Qt(e,n,0),c!==0&&o===0&&e.tag!==0&&(e.suspendedLanes|=c&~(f&~t))}function Qt(e,t,l){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-wt(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|l&261930}function ca(e,t){var l=e.entangledLanes|=t;for(e=e.entanglements;l;){var n=31-wt(l),o=1<<n;o&t|e[n]&t&&(e[n]|=t),l&=~o}}function Ki(e,t){var l=t&-t;return l=(l&42)!==0?1:kn(l),(l&(e.suspendedLanes|t))!==0?0:l}function kn(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function _n(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Xi(){var e=$.p;return e!==0?e:(e=window.event,e===void 0?32:rv(e.type))}function Vi(e,t){var l=$.p;try{return $.p=e,t()}finally{$.p=l}}var ut=Math.random().toString(36).slice(2),Ge="__reactFiber$"+ut,tt="__reactProps$"+ut,Dn="__reactContainer$"+ut,ou="__reactEvents$"+ut,k0="__reactListeners$"+ut,_0="__reactHandles$"+ut,Nf="__reactResources$"+ut,Zi="__reactMarker$"+ut;function uu(e){delete e[Ge],delete e[tt],delete e[ou],delete e[k0],delete e[_0]}function Un(e){var t=e[Ge];if(t)return t;for(var l=e.parentNode;l;){if(t=l[Dn]||l[Ge]){if(l=t.alternate,t.child!==null||l!==null&&l.child!==null)for(e=Kp(e);e!==null;){if(l=e[Ge])return l;e=Kp(e)}return t}e=l,l=e.parentNode}return null}function Bn(e){if(e=e[Ge]||e[Dn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function $i(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function Hn(e){var t=e[Nf];return t||(t=e[Nf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ct(e){e[Zi]=!0}var Mf=new Set,wf={};function Ia(e,t){Ln(e,t),Ln(e+"Capture",t)}function Ln(e,t){for(wf[e]=t,e=0;e<t.length;e++)Mf.add(t[e])}var D0=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),Tf={},Cf={};function U0(e){return Sl.call(Cf,e)?!0:Sl.call(Tf,e)?!1:D0.test(e)?Cf[e]=!0:(Tf[e]=!0,!1)}function xs(e,t,l){if(U0(t))if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+l)}}function ys(e,t,l){if(l===null)e.removeAttribute(t);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+l)}}function _l(e,t,l,n){if(n===null)e.removeAttribute(l);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(t,l,""+n)}}function Wt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ef(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function B0(e,t,l){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var o=n.get,c=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return o.call(this)},set:function(f){l=""+f,c.call(this,f)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return l},setValue:function(f){l=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function cu(e){if(!e._valueTracker){var t=Ef(e)?"checked":"value";e._valueTracker=B0(e,t,""+e[t])}}function Af(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var l=t.getValue(),n="";return e&&(n=Ef(e)?e.checked?"true":"false":e.value),e=n,e!==l?(t.setValue(e),!0):!1}function bs(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}}var H0=/[\n"\\]/g;function It(e){return e.replace(H0,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function du(e,t,l,n,o,c,f,y){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Wt(t)):e.value!==""+Wt(t)&&(e.value=""+Wt(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?fu(e,f,Wt(t)):l!=null?fu(e,f,Wt(l)):n!=null&&e.removeAttribute("value"),o==null&&c!=null&&(e.defaultChecked=!!c),o!=null&&(e.checked=o&&typeof o!="function"&&typeof o!="symbol"),y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"?e.name=""+Wt(y):e.removeAttribute("name")}function zf(e,t,l,n,o,c,f,y){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||l!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){cu(e);return}l=l!=null?""+Wt(l):"",t=t!=null?""+Wt(t):l,y||t===e.value||(e.value=t),e.defaultValue=t}n=n??o,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=y?e.checked:!!n,e.defaultChecked=!!n,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),cu(e)}function fu(e,t,l){t==="number"&&bs(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function qn(e,t,l,n){if(e=e.options,t){t={};for(var o=0;o<l.length;o++)t["$"+l[o]]=!0;for(l=0;l<e.length;l++)o=t.hasOwnProperty("$"+e[l].value),e[l].selected!==o&&(e[l].selected=o),o&&n&&(e[l].defaultSelected=!0)}else{for(l=""+Wt(l),t=null,o=0;o<e.length;o++){if(e[o].value===l){e[o].selected=!0,n&&(e[o].defaultSelected=!0);return}t!==null||e[o].disabled||(t=e[o])}t!==null&&(t.selected=!0)}}function Rf(e,t,l){if(t!=null&&(t=""+Wt(t),t!==e.value&&(e.value=t),l==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=l!=null?""+Wt(l):""}function Of(e,t,l,n){if(t==null){if(n!=null){if(l!=null)throw Error(u(92));if(me(n)){if(1<n.length)throw Error(u(93));n=n[0]}l=n}l==null&&(l=""),t=l}l=Wt(t),e.defaultValue=l,n=e.textContent,n===l&&n!==""&&n!==null&&(e.value=n),cu(e)}function Qn(e,t){if(t){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=t;return}}e.textContent=t}var L0=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function kf(e,t,l){var n=t.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,l):typeof l!="number"||l===0||L0.has(t)?t==="float"?e.cssFloat=l:e[t]=(""+l).trim():e[t]=l+"px"}function _f(e,t,l){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,l!=null){for(var n in l)!l.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var o in t)n=t[o],t.hasOwnProperty(o)&&l[o]!==n&&kf(e,o,n)}else for(var c in t)t.hasOwnProperty(c)&&kf(e,c,t[c])}function mu(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var q0=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Q0=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function gs(e){return Q0.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Dl(){}var hu=null;function pu(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Yn=null,Gn=null;function Df(e){var t=Bn(e);if(t&&(e=t.stateNode)){var l=e[tt]||null;e:switch(e=t.stateNode,t.type){case"input":if(du(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),t=l.name,l.type==="radio"&&t!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+It(""+t)+'"][type="radio"]'),t=0;t<l.length;t++){var n=l[t];if(n!==e&&n.form===e.form){var o=n[tt]||null;if(!o)throw Error(u(90));du(n,o.value,o.defaultValue,o.defaultValue,o.checked,o.defaultChecked,o.type,o.name)}}for(t=0;t<l.length;t++)n=l[t],n.form===e.form&&Af(n)}break e;case"textarea":Rf(e,l.value,l.defaultValue);break e;case"select":t=l.value,t!=null&&qn(e,!!l.multiple,t,!1)}}}var vu=!1;function Uf(e,t,l){if(vu)return e(t,l);vu=!0;try{var n=e(t);return n}finally{if(vu=!1,(Yn!==null||Gn!==null)&&(so(),Yn&&(t=Yn,e=Gn,Gn=Yn=null,Df(t),e)))for(t=0;t<e.length;t++)Df(e[t])}}function Ji(e,t){var l=e.stateNode;if(l===null)return null;var n=l[tt]||null;if(n===null)return null;l=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(u(231,t,typeof l));return l}var Ul=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),xu=!1;if(Ul)try{var Fi={};Object.defineProperty(Fi,"passive",{get:function(){xu=!0}}),window.addEventListener("test",Fi,Fi),window.removeEventListener("test",Fi,Fi)}catch{xu=!1}var da=null,yu=null,js=null;function Bf(){if(js)return js;var e,t=yu,l=t.length,n,o="value"in da?da.value:da.textContent,c=o.length;for(e=0;e<l&&t[e]===o[e];e++);var f=l-e;for(n=1;n<=f&&t[l-n]===o[c-n];n++);return js=o.slice(e,1<n?1-n:void 0)}function Ss(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Ns(){return!0}function Hf(){return!1}function Rt(e){function t(l,n,o,c,f){this._reactName=l,this._targetInst=o,this.type=n,this.nativeEvent=c,this.target=f,this.currentTarget=null;for(var y in e)e.hasOwnProperty(y)&&(l=e[y],this[y]=l?l(c):c[y]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Ns:Hf,this.isPropagationStopped=Hf,this}return b(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Ns)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ns)},persist:function(){},isPersistent:Ns}),t}var en={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ms=Rt(en),Pi=b({},en,{view:0,detail:0}),Y0=Rt(Pi),bu,gu,Wi,ws=b({},Pi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Su,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Wi&&(Wi&&e.type==="mousemove"?(bu=e.screenX-Wi.screenX,gu=e.screenY-Wi.screenY):gu=bu=0,Wi=e),bu)},movementY:function(e){return"movementY"in e?e.movementY:gu}}),Lf=Rt(ws),G0=b({},ws,{dataTransfer:0}),K0=Rt(G0),X0=b({},Pi,{relatedTarget:0}),ju=Rt(X0),V0=b({},en,{animationName:0,elapsedTime:0,pseudoElement:0}),Z0=Rt(V0),$0=b({},en,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),J0=Rt($0),F0=b({},en,{data:0}),qf=Rt(F0),P0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},W0={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},I0={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ey(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=I0[e])?!!t[e]:!1}function Su(){return ey}var ty=b({},Pi,{key:function(e){if(e.key){var t=P0[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ss(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?W0[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Su,charCode:function(e){return e.type==="keypress"?Ss(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ss(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ly=Rt(ty),ay=b({},ws,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Qf=Rt(ay),ny=b({},Pi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Su}),iy=Rt(ny),ry=b({},en,{propertyName:0,elapsedTime:0,pseudoElement:0}),sy=Rt(ry),oy=b({},ws,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),uy=Rt(oy),cy=b({},en,{newState:0,oldState:0}),dy=Rt(cy),fy=[9,13,27,32],Nu=Ul&&"CompositionEvent"in window,Ii=null;Ul&&"documentMode"in document&&(Ii=document.documentMode);var my=Ul&&"TextEvent"in window&&!Ii,Yf=Ul&&(!Nu||Ii&&8<Ii&&11>=Ii),Gf=" ",Kf=!1;function Xf(e,t){switch(e){case"keyup":return fy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Vf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Kn=!1;function hy(e,t){switch(e){case"compositionend":return Vf(t);case"keypress":return t.which!==32?null:(Kf=!0,Gf);case"textInput":return e=t.data,e===Gf&&Kf?null:e;default:return null}}function py(e,t){if(Kn)return e==="compositionend"||!Nu&&Xf(e,t)?(e=Bf(),js=yu=da=null,Kn=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Yf&&t.locale!=="ko"?null:t.data;default:return null}}var vy={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Zf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!vy[e.type]:t==="textarea"}function $f(e,t,l,n){Yn?Gn?Gn.push(n):Gn=[n]:Yn=n,t=po(t,"onChange"),0<t.length&&(l=new Ms("onChange","change",null,l,n),e.push({event:l,listeners:t}))}var er=null,tr=null;function xy(e){zp(e,0)}function Ts(e){var t=$i(e);if(Af(t))return e}function Jf(e,t){if(e==="change")return t}var Ff=!1;if(Ul){var Mu;if(Ul){var wu="oninput"in document;if(!wu){var Pf=document.createElement("div");Pf.setAttribute("oninput","return;"),wu=typeof Pf.oninput=="function"}Mu=wu}else Mu=!1;Ff=Mu&&(!document.documentMode||9<document.documentMode)}function Wf(){er&&(er.detachEvent("onpropertychange",If),tr=er=null)}function If(e){if(e.propertyName==="value"&&Ts(tr)){var t=[];$f(t,tr,e,pu(e)),Uf(xy,t)}}function yy(e,t,l){e==="focusin"?(Wf(),er=t,tr=l,er.attachEvent("onpropertychange",If)):e==="focusout"&&Wf()}function by(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ts(tr)}function gy(e,t){if(e==="click")return Ts(t)}function jy(e,t){if(e==="input"||e==="change")return Ts(t)}function Sy(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Yt=typeof Object.is=="function"?Object.is:Sy;function lr(e,t){if(Yt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var l=Object.keys(e),n=Object.keys(t);if(l.length!==n.length)return!1;for(n=0;n<l.length;n++){var o=l[n];if(!Sl.call(t,o)||!Yt(e[o],t[o]))return!1}return!0}function em(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function tm(e,t){var l=em(e);e=0;for(var n;l;){if(l.nodeType===3){if(n=e+l.textContent.length,e<=t&&n>=t)return{node:l,offset:t-e};e=n}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=em(l)}}function lm(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?lm(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function am(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=bs(e.document);t instanceof e.HTMLIFrameElement;){try{var l=typeof t.contentWindow.location.href=="string"}catch{l=!1}if(l)e=t.contentWindow;else break;t=bs(e.document)}return t}function Tu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var Ny=Ul&&"documentMode"in document&&11>=document.documentMode,Xn=null,Cu=null,ar=null,Eu=!1;function nm(e,t,l){var n=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Eu||Xn==null||Xn!==bs(n)||(n=Xn,"selectionStart"in n&&Tu(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}),ar&&lr(ar,n)||(ar=n,n=po(Cu,"onSelect"),0<n.length&&(t=new Ms("onSelect","select",null,t,l),e.push({event:t,listeners:n}),t.target=Xn)))}function tn(e,t){var l={};return l[e.toLowerCase()]=t.toLowerCase(),l["Webkit"+e]="webkit"+t,l["Moz"+e]="moz"+t,l}var Vn={animationend:tn("Animation","AnimationEnd"),animationiteration:tn("Animation","AnimationIteration"),animationstart:tn("Animation","AnimationStart"),transitionrun:tn("Transition","TransitionRun"),transitionstart:tn("Transition","TransitionStart"),transitioncancel:tn("Transition","TransitionCancel"),transitionend:tn("Transition","TransitionEnd")},Au={},im={};Ul&&(im=document.createElement("div").style,"AnimationEvent"in window||(delete Vn.animationend.animation,delete Vn.animationiteration.animation,delete Vn.animationstart.animation),"TransitionEvent"in window||delete Vn.transitionend.transition);function ln(e){if(Au[e])return Au[e];if(!Vn[e])return e;var t=Vn[e],l;for(l in t)if(t.hasOwnProperty(l)&&l in im)return Au[e]=t[l];return e}var rm=ln("animationend"),sm=ln("animationiteration"),om=ln("animationstart"),My=ln("transitionrun"),wy=ln("transitionstart"),Ty=ln("transitioncancel"),um=ln("transitionend"),cm=new Map,zu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");zu.push("scrollEnd");function ml(e,t){cm.set(e,t),Ia(t,[e])}var Cs=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},el=[],Zn=0,Ru=0;function Es(){for(var e=Zn,t=Ru=Zn=0;t<e;){var l=el[t];el[t++]=null;var n=el[t];el[t++]=null;var o=el[t];el[t++]=null;var c=el[t];if(el[t++]=null,n!==null&&o!==null){var f=n.pending;f===null?o.next=o:(o.next=f.next,f.next=o),n.pending=o}c!==0&&dm(l,o,c)}}function As(e,t,l,n){el[Zn++]=e,el[Zn++]=t,el[Zn++]=l,el[Zn++]=n,Ru|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Ou(e,t,l,n){return As(e,t,l,n),zs(e)}function an(e,t){return As(e,null,null,t),zs(e)}function dm(e,t,l){e.lanes|=l;var n=e.alternate;n!==null&&(n.lanes|=l);for(var o=!1,c=e.return;c!==null;)c.childLanes|=l,n=c.alternate,n!==null&&(n.childLanes|=l),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(o=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,o&&t!==null&&(o=31-wt(l),e=c.hiddenUpdates,n=e[o],n===null?e[o]=[t]:n.push(t),t.lane=l|536870912),c):null}function zs(e){if(50<wr)throw wr=0,Qc=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var $n={};function Cy(e,t,l,n){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Gt(e,t,l,n){return new Cy(e,t,l,n)}function ku(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Bl(e,t){var l=e.alternate;return l===null?(l=Gt(e.tag,t,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=t,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,t=e.dependencies,l.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function fm(e,t){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,t=l.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Rs(e,t,l,n,o,c){var f=0;if(n=e,typeof e=="function")ku(e)&&(f=1);else if(typeof e=="string")f=Ob(e,l,W.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case te:return e=Gt(31,l,t,o),e.elementType=te,e.lanes=c,e;case z:return nn(l.children,o,c,t);case Q:f=8,o|=24;break;case U:return e=Gt(12,l,t,o|2),e.elementType=U,e.lanes=c,e;case V:return e=Gt(13,l,t,o),e.elementType=V,e.lanes=c,e;case P:return e=Gt(19,l,t,o),e.elementType=P,e.lanes=c,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case K:f=10;break e;case L:f=9;break e;case B:f=11;break e;case J:f=14;break e;case I:f=16,n=null;break e}f=29,l=Error(u(130,e===null?"null":typeof e,"")),n=null}return t=Gt(f,l,t,o),t.elementType=e,t.type=n,t.lanes=c,t}function nn(e,t,l,n){return e=Gt(7,e,n,t),e.lanes=l,e}function _u(e,t,l){return e=Gt(6,e,null,t),e.lanes=l,e}function mm(e){var t=Gt(18,null,null,0);return t.stateNode=e,t}function Du(e,t,l){return t=Gt(4,e.children!==null?e.children:[],e.key,t),t.lanes=l,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var hm=new WeakMap;function tl(e,t){if(typeof e=="object"&&e!==null){var l=hm.get(e);return l!==void 0?l:(t={value:e,source:t,stack:zn(t)},hm.set(e,t),t)}return{value:e,source:t,stack:zn(t)}}var Jn=[],Fn=0,Os=null,nr=0,ll=[],al=0,fa=null,wl=1,Tl="";function Hl(e,t){Jn[Fn++]=nr,Jn[Fn++]=Os,Os=e,nr=t}function pm(e,t,l){ll[al++]=wl,ll[al++]=Tl,ll[al++]=fa,fa=e;var n=wl;e=Tl;var o=32-wt(n)-1;n&=~(1<<o),l+=1;var c=32-wt(t)+o;if(30<c){var f=o-o%5;c=(n&(1<<f)-1).toString(32),n>>=f,o-=f,wl=1<<32-wt(t)+o|l<<o|n,Tl=c+e}else wl=1<<c|l<<o|n,Tl=e}function Uu(e){e.return!==null&&(Hl(e,1),pm(e,1,0))}function Bu(e){for(;e===Os;)Os=Jn[--Fn],Jn[Fn]=null,nr=Jn[--Fn],Jn[Fn]=null;for(;e===fa;)fa=ll[--al],ll[al]=null,Tl=ll[--al],ll[al]=null,wl=ll[--al],ll[al]=null}function vm(e,t){ll[al++]=wl,ll[al++]=Tl,ll[al++]=fa,wl=t.id,Tl=t.overflow,fa=e}var pt=null,Xe=null,Ce=!1,ma=null,nl=!1,Hu=Error(u(519));function ha(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ir(tl(t,e)),Hu}function xm(e){var t=e.stateNode,l=e.type,n=e.memoizedProps;switch(t[Ge]=e,t[tt]=n,l){case"dialog":Se("cancel",t),Se("close",t);break;case"iframe":case"object":case"embed":Se("load",t);break;case"video":case"audio":for(l=0;l<Cr.length;l++)Se(Cr[l],t);break;case"source":Se("error",t);break;case"img":case"image":case"link":Se("error",t),Se("load",t);break;case"details":Se("toggle",t);break;case"input":Se("invalid",t),zf(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Se("invalid",t);break;case"textarea":Se("invalid",t),Of(t,n.value,n.defaultValue,n.children)}l=n.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||t.textContent===""+l||n.suppressHydrationWarning===!0||_p(t.textContent,l)?(n.popover!=null&&(Se("beforetoggle",t),Se("toggle",t)),n.onScroll!=null&&Se("scroll",t),n.onScrollEnd!=null&&Se("scrollend",t),n.onClick!=null&&(t.onclick=Dl),t=!0):t=!1,t||ha(e,!0)}function ym(e){for(pt=e.return;pt;)switch(pt.tag){case 5:case 31:case 13:nl=!1;return;case 27:case 3:nl=!0;return;default:pt=pt.return}}function Pn(e){if(e!==pt)return!1;if(!Ce)return ym(e),Ce=!0,!1;var t=e.tag,l;if((l=t!==3&&t!==27)&&((l=t===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||ld(e.type,e.memoizedProps)),l=!l),l&&Xe&&ha(e),ym(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Xe=Gp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));Xe=Gp(e)}else t===27?(t=Xe,Ea(e.type)?(e=sd,sd=null,Xe=e):Xe=t):Xe=pt?rl(e.stateNode.nextSibling):null;return!0}function rn(){Xe=pt=null,Ce=!1}function Lu(){var e=ma;return e!==null&&(Dt===null?Dt=e:Dt.push.apply(Dt,e),ma=null),e}function ir(e){ma===null?ma=[e]:ma.push(e)}var qu=M(null),sn=null,Ll=null;function pa(e,t,l){Z(qu,t._currentValue),t._currentValue=l}function ql(e){e._currentValue=qu.current,k(qu)}function Qu(e,t,l){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===l)break;e=e.return}}function Yu(e,t,l,n){var o=e.child;for(o!==null&&(o.return=e);o!==null;){var c=o.dependencies;if(c!==null){var f=o.child;c=c.firstContext;e:for(;c!==null;){var y=c;c=o;for(var S=0;S<t.length;S++)if(y.context===t[S]){c.lanes|=l,y=c.alternate,y!==null&&(y.lanes|=l),Qu(c.return,l,e),n||(f=null);break e}c=y.next}}else if(o.tag===18){if(f=o.return,f===null)throw Error(u(341));f.lanes|=l,c=f.alternate,c!==null&&(c.lanes|=l),Qu(f,l,e),f=null}else f=o.child;if(f!==null)f.return=o;else for(f=o;f!==null;){if(f===e){f=null;break}if(o=f.sibling,o!==null){o.return=f.return,f=o;break}f=f.return}o=f}}function Wn(e,t,l,n){e=null;for(var o=t,c=!1;o!==null;){if(!c){if((o.flags&524288)!==0)c=!0;else if((o.flags&262144)!==0)break}if(o.tag===10){var f=o.alternate;if(f===null)throw Error(u(387));if(f=f.memoizedProps,f!==null){var y=o.type;Yt(o.pendingProps.value,f.value)||(e!==null?e.push(y):e=[y])}}else if(o===re.current){if(f=o.alternate,f===null)throw Error(u(387));f.memoizedState.memoizedState!==o.memoizedState.memoizedState&&(e!==null?e.push(Or):e=[Or])}o=o.return}e!==null&&Yu(t,e,l,n),t.flags|=262144}function ks(e){for(e=e.firstContext;e!==null;){if(!Yt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function on(e){sn=e,Ll=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function vt(e){return bm(sn,e)}function _s(e,t){return sn===null&&on(e),bm(e,t)}function bm(e,t){var l=t._currentValue;if(t={context:t,memoizedValue:l,next:null},Ll===null){if(e===null)throw Error(u(308));Ll=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ll=Ll.next=t;return l}var Ey=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(l,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(l){return l()})}},Ay=a.unstable_scheduleCallback,zy=a.unstable_NormalPriority,lt={$$typeof:K,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Gu(){return{controller:new Ey,data:new Map,refCount:0}}function rr(e){e.refCount--,e.refCount===0&&Ay(zy,function(){e.controller.abort()})}var sr=null,Ku=0,In=0,ei=null;function Ry(e,t){if(sr===null){var l=sr=[];Ku=0,In=Zc(),ei={status:"pending",value:void 0,then:function(n){l.push(n)}}}return Ku++,t.then(gm,gm),t}function gm(){if(--Ku===0&&sr!==null){ei!==null&&(ei.status="fulfilled");var e=sr;sr=null,In=0,ei=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Oy(e,t){var l=[],n={status:"pending",value:null,reason:null,then:function(o){l.push(o)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var o=0;o<l.length;o++)(0,l[o])(t)},function(o){for(n.status="rejected",n.reason=o,o=0;o<l.length;o++)(0,l[o])(void 0)}),n}var jm=_.S;_.S=function(e,t){np=Nt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Ry(e,t),jm!==null&&jm(e,t)};var un=M(null);function Xu(){var e=un.current;return e!==null?e:Ke.pooledCache}function Ds(e,t){t===null?Z(un,un.current):Z(un,t.pool)}function Sm(){var e=Xu();return e===null?null:{parent:lt._currentValue,pool:e}}var ti=Error(u(460)),Vu=Error(u(474)),Us=Error(u(542)),Bs={then:function(){}};function Nm(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Mm(e,t,l){switch(l=e[l],l===void 0?e.push(t):l!==t&&(t.then(Dl,Dl),t=l),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Tm(e),e;default:if(typeof t.status=="string")t.then(Dl,Dl);else{if(e=Ke,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var o=t;o.status="fulfilled",o.value=n}},function(n){if(t.status==="pending"){var o=t;o.status="rejected",o.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Tm(e),e}throw dn=t,ti}}function cn(e){try{var t=e._init;return t(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(dn=l,ti):l}}var dn=null;function wm(){if(dn===null)throw Error(u(459));var e=dn;return dn=null,e}function Tm(e){if(e===ti||e===Us)throw Error(u(483))}var li=null,or=0;function Hs(e){var t=or;return or+=1,li===null&&(li=[]),Mm(li,e,t)}function ur(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ls(e,t){throw t.$$typeof===E?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Cm(e){function t(C,w){if(e){var R=C.deletions;R===null?(C.deletions=[w],C.flags|=16):R.push(w)}}function l(C,w){if(!e)return null;for(;w!==null;)t(C,w),w=w.sibling;return null}function n(C){for(var w=new Map;C!==null;)C.key!==null?w.set(C.key,C):w.set(C.index,C),C=C.sibling;return w}function o(C,w){return C=Bl(C,w),C.index=0,C.sibling=null,C}function c(C,w,R){return C.index=R,e?(R=C.alternate,R!==null?(R=R.index,R<w?(C.flags|=67108866,w):R):(C.flags|=67108866,w)):(C.flags|=1048576,w)}function f(C){return e&&C.alternate===null&&(C.flags|=67108866),C}function y(C,w,R,Y){return w===null||w.tag!==6?(w=_u(R,C.mode,Y),w.return=C,w):(w=o(w,R),w.return=C,w)}function S(C,w,R,Y){var ce=R.type;return ce===z?q(C,w,R.props.children,Y,R.key):w!==null&&(w.elementType===ce||typeof ce=="object"&&ce!==null&&ce.$$typeof===I&&cn(ce)===w.type)?(w=o(w,R.props),ur(w,R),w.return=C,w):(w=Rs(R.type,R.key,R.props,null,C.mode,Y),ur(w,R),w.return=C,w)}function O(C,w,R,Y){return w===null||w.tag!==4||w.stateNode.containerInfo!==R.containerInfo||w.stateNode.implementation!==R.implementation?(w=Du(R,C.mode,Y),w.return=C,w):(w=o(w,R.children||[]),w.return=C,w)}function q(C,w,R,Y,ce){return w===null||w.tag!==7?(w=nn(R,C.mode,Y,ce),w.return=C,w):(w=o(w,R),w.return=C,w)}function G(C,w,R){if(typeof w=="string"&&w!==""||typeof w=="number"||typeof w=="bigint")return w=_u(""+w,C.mode,R),w.return=C,w;if(typeof w=="object"&&w!==null){switch(w.$$typeof){case T:return R=Rs(w.type,w.key,w.props,null,C.mode,R),ur(R,w),R.return=C,R;case A:return w=Du(w,C.mode,R),w.return=C,w;case I:return w=cn(w),G(C,w,R)}if(me(w)||fe(w))return w=nn(w,C.mode,R,null),w.return=C,w;if(typeof w.then=="function")return G(C,Hs(w),R);if(w.$$typeof===K)return G(C,_s(C,w),R);Ls(C,w)}return null}function D(C,w,R,Y){var ce=w!==null?w.key:null;if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return ce!==null?null:y(C,w,""+R,Y);if(typeof R=="object"&&R!==null){switch(R.$$typeof){case T:return R.key===ce?S(C,w,R,Y):null;case A:return R.key===ce?O(C,w,R,Y):null;case I:return R=cn(R),D(C,w,R,Y)}if(me(R)||fe(R))return ce!==null?null:q(C,w,R,Y,null);if(typeof R.then=="function")return D(C,w,Hs(R),Y);if(R.$$typeof===K)return D(C,w,_s(C,R),Y);Ls(C,R)}return null}function H(C,w,R,Y,ce){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return C=C.get(R)||null,y(w,C,""+Y,ce);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case T:return C=C.get(Y.key===null?R:Y.key)||null,S(w,C,Y,ce);case A:return C=C.get(Y.key===null?R:Y.key)||null,O(w,C,Y,ce);case I:return Y=cn(Y),H(C,w,R,Y,ce)}if(me(Y)||fe(Y))return C=C.get(R)||null,q(w,C,Y,ce,null);if(typeof Y.then=="function")return H(C,w,R,Hs(Y),ce);if(Y.$$typeof===K)return H(C,w,R,_s(w,Y),ce);Ls(w,Y)}return null}function ae(C,w,R,Y){for(var ce=null,Re=null,ie=w,xe=w=0,Me=null;ie!==null&&xe<R.length;xe++){ie.index>xe?(Me=ie,ie=null):Me=ie.sibling;var Oe=D(C,ie,R[xe],Y);if(Oe===null){ie===null&&(ie=Me);break}e&&ie&&Oe.alternate===null&&t(C,ie),w=c(Oe,w,xe),Re===null?ce=Oe:Re.sibling=Oe,Re=Oe,ie=Me}if(xe===R.length)return l(C,ie),Ce&&Hl(C,xe),ce;if(ie===null){for(;xe<R.length;xe++)ie=G(C,R[xe],Y),ie!==null&&(w=c(ie,w,xe),Re===null?ce=ie:Re.sibling=ie,Re=ie);return Ce&&Hl(C,xe),ce}for(ie=n(ie);xe<R.length;xe++)Me=H(ie,C,xe,R[xe],Y),Me!==null&&(e&&Me.alternate!==null&&ie.delete(Me.key===null?xe:Me.key),w=c(Me,w,xe),Re===null?ce=Me:Re.sibling=Me,Re=Me);return e&&ie.forEach(function(ka){return t(C,ka)}),Ce&&Hl(C,xe),ce}function de(C,w,R,Y){if(R==null)throw Error(u(151));for(var ce=null,Re=null,ie=w,xe=w=0,Me=null,Oe=R.next();ie!==null&&!Oe.done;xe++,Oe=R.next()){ie.index>xe?(Me=ie,ie=null):Me=ie.sibling;var ka=D(C,ie,Oe.value,Y);if(ka===null){ie===null&&(ie=Me);break}e&&ie&&ka.alternate===null&&t(C,ie),w=c(ka,w,xe),Re===null?ce=ka:Re.sibling=ka,Re=ka,ie=Me}if(Oe.done)return l(C,ie),Ce&&Hl(C,xe),ce;if(ie===null){for(;!Oe.done;xe++,Oe=R.next())Oe=G(C,Oe.value,Y),Oe!==null&&(w=c(Oe,w,xe),Re===null?ce=Oe:Re.sibling=Oe,Re=Oe);return Ce&&Hl(C,xe),ce}for(ie=n(ie);!Oe.done;xe++,Oe=R.next())Oe=H(ie,C,xe,Oe.value,Y),Oe!==null&&(e&&Oe.alternate!==null&&ie.delete(Oe.key===null?xe:Oe.key),w=c(Oe,w,xe),Re===null?ce=Oe:Re.sibling=Oe,Re=Oe);return e&&ie.forEach(function(Gb){return t(C,Gb)}),Ce&&Hl(C,xe),ce}function qe(C,w,R,Y){if(typeof R=="object"&&R!==null&&R.type===z&&R.key===null&&(R=R.props.children),typeof R=="object"&&R!==null){switch(R.$$typeof){case T:e:{for(var ce=R.key;w!==null;){if(w.key===ce){if(ce=R.type,ce===z){if(w.tag===7){l(C,w.sibling),Y=o(w,R.props.children),Y.return=C,C=Y;break e}}else if(w.elementType===ce||typeof ce=="object"&&ce!==null&&ce.$$typeof===I&&cn(ce)===w.type){l(C,w.sibling),Y=o(w,R.props),ur(Y,R),Y.return=C,C=Y;break e}l(C,w);break}else t(C,w);w=w.sibling}R.type===z?(Y=nn(R.props.children,C.mode,Y,R.key),Y.return=C,C=Y):(Y=Rs(R.type,R.key,R.props,null,C.mode,Y),ur(Y,R),Y.return=C,C=Y)}return f(C);case A:e:{for(ce=R.key;w!==null;){if(w.key===ce)if(w.tag===4&&w.stateNode.containerInfo===R.containerInfo&&w.stateNode.implementation===R.implementation){l(C,w.sibling),Y=o(w,R.children||[]),Y.return=C,C=Y;break e}else{l(C,w);break}else t(C,w);w=w.sibling}Y=Du(R,C.mode,Y),Y.return=C,C=Y}return f(C);case I:return R=cn(R),qe(C,w,R,Y)}if(me(R))return ae(C,w,R,Y);if(fe(R)){if(ce=fe(R),typeof ce!="function")throw Error(u(150));return R=ce.call(R),de(C,w,R,Y)}if(typeof R.then=="function")return qe(C,w,Hs(R),Y);if(R.$$typeof===K)return qe(C,w,_s(C,R),Y);Ls(C,R)}return typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint"?(R=""+R,w!==null&&w.tag===6?(l(C,w.sibling),Y=o(w,R),Y.return=C,C=Y):(l(C,w),Y=_u(R,C.mode,Y),Y.return=C,C=Y),f(C)):l(C,w)}return function(C,w,R,Y){try{or=0;var ce=qe(C,w,R,Y);return li=null,ce}catch(ie){if(ie===ti||ie===Us)throw ie;var Re=Gt(29,ie,null,C.mode);return Re.lanes=Y,Re.return=C,Re}finally{}}}var fn=Cm(!0),Em=Cm(!1),va=!1;function Zu(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function $u(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function xa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function ya(e,t,l){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(ke&2)!==0){var o=n.pending;return o===null?t.next=t:(t.next=o.next,o.next=t),n.pending=t,t=zs(e),dm(e,null,l),t}return As(e,n,t,l),zs(e)}function cr(e,t,l){if(t=t.updateQueue,t!==null&&(t=t.shared,(l&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,l|=n,t.lanes=l,ca(e,l)}}function Ju(e,t){var l=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,l===n)){var o=null,c=null;if(l=l.firstBaseUpdate,l!==null){do{var f={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};c===null?o=c=f:c=c.next=f,l=l.next}while(l!==null);c===null?o=c=t:c=c.next=t}else o=c=t;l={baseState:n.baseState,firstBaseUpdate:o,lastBaseUpdate:c,shared:n.shared,callbacks:n.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=t:e.next=t,l.lastBaseUpdate=t}var Fu=!1;function dr(){if(Fu){var e=ei;if(e!==null)throw e}}function fr(e,t,l,n){Fu=!1;var o=e.updateQueue;va=!1;var c=o.firstBaseUpdate,f=o.lastBaseUpdate,y=o.shared.pending;if(y!==null){o.shared.pending=null;var S=y,O=S.next;S.next=null,f===null?c=O:f.next=O,f=S;var q=e.alternate;q!==null&&(q=q.updateQueue,y=q.lastBaseUpdate,y!==f&&(y===null?q.firstBaseUpdate=O:y.next=O,q.lastBaseUpdate=S))}if(c!==null){var G=o.baseState;f=0,q=O=S=null,y=c;do{var D=y.lane&-536870913,H=D!==y.lane;if(H?(Ne&D)===D:(n&D)===D){D!==0&&D===In&&(Fu=!0),q!==null&&(q=q.next={lane:0,tag:y.tag,payload:y.payload,callback:null,next:null});e:{var ae=e,de=y;D=t;var qe=l;switch(de.tag){case 1:if(ae=de.payload,typeof ae=="function"){G=ae.call(qe,G,D);break e}G=ae;break e;case 3:ae.flags=ae.flags&-65537|128;case 0:if(ae=de.payload,D=typeof ae=="function"?ae.call(qe,G,D):ae,D==null)break e;G=b({},G,D);break e;case 2:va=!0}}D=y.callback,D!==null&&(e.flags|=64,H&&(e.flags|=8192),H=o.callbacks,H===null?o.callbacks=[D]:H.push(D))}else H={lane:D,tag:y.tag,payload:y.payload,callback:y.callback,next:null},q===null?(O=q=H,S=G):q=q.next=H,f|=D;if(y=y.next,y===null){if(y=o.shared.pending,y===null)break;H=y,y=H.next,H.next=null,o.lastBaseUpdate=H,o.shared.pending=null}}while(!0);q===null&&(S=G),o.baseState=S,o.firstBaseUpdate=O,o.lastBaseUpdate=q,c===null&&(o.shared.lanes=0),Na|=f,e.lanes=f,e.memoizedState=G}}function Am(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function zm(e,t){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)Am(l[e],t)}var ai=M(null),qs=M(0);function Rm(e,t){e=Jl,Z(qs,e),Z(ai,t),Jl=e|t.baseLanes}function Pu(){Z(qs,Jl),Z(ai,ai.current)}function Wu(){Jl=qs.current,k(ai),k(qs)}var Kt=M(null),il=null;function ba(e){var t=e.alternate;Z(Ie,Ie.current&1),Z(Kt,e),il===null&&(t===null||ai.current!==null||t.memoizedState!==null)&&(il=e)}function Iu(e){Z(Ie,Ie.current),Z(Kt,e),il===null&&(il=e)}function Om(e){e.tag===22?(Z(Ie,Ie.current),Z(Kt,e),il===null&&(il=e)):ga()}function ga(){Z(Ie,Ie.current),Z(Kt,Kt.current)}function Xt(e){k(Kt),il===e&&(il=null),k(Ie)}var Ie=M(0);function Qs(e){for(var t=e;t!==null;){if(t.tag===13){var l=t.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||id(l)||rd(l)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ql=0,ve=null,He=null,at=null,Ys=!1,ni=!1,mn=!1,Gs=0,mr=0,ii=null,ky=0;function Fe(){throw Error(u(321))}function ec(e,t){if(t===null)return!1;for(var l=0;l<t.length&&l<e.length;l++)if(!Yt(e[l],t[l]))return!1;return!0}function tc(e,t,l,n,o,c){return Ql=c,ve=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,_.H=e===null||e.memoizedState===null?ph:vc,mn=!1,c=l(n,o),mn=!1,ni&&(c=_m(t,l,n,o)),km(e),c}function km(e){_.H=vr;var t=He!==null&&He.next!==null;if(Ql=0,at=He=ve=null,Ys=!1,mr=0,ii=null,t)throw Error(u(300));e===null||nt||(e=e.dependencies,e!==null&&ks(e)&&(nt=!0))}function _m(e,t,l,n){ve=e;var o=0;do{if(ni&&(ii=null),mr=0,ni=!1,25<=o)throw Error(u(301));if(o+=1,at=He=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}_.H=vh,c=t(l,n)}while(ni);return c}function _y(){var e=_.H,t=e.useState()[0];return t=typeof t.then=="function"?hr(t):t,e=e.useState()[0],(He!==null?He.memoizedState:null)!==e&&(ve.flags|=1024),t}function lc(){var e=Gs!==0;return Gs=0,e}function ac(e,t,l){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~l}function nc(e){if(Ys){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Ys=!1}Ql=0,at=He=ve=null,ni=!1,mr=Gs=0,ii=null}function Tt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return at===null?ve.memoizedState=at=e:at=at.next=e,at}function et(){if(He===null){var e=ve.alternate;e=e!==null?e.memoizedState:null}else e=He.next;var t=at===null?ve.memoizedState:at.next;if(t!==null)at=t,He=e;else{if(e===null)throw ve.alternate===null?Error(u(467)):Error(u(310));He=e,e={memoizedState:He.memoizedState,baseState:He.baseState,baseQueue:He.baseQueue,queue:He.queue,next:null},at===null?ve.memoizedState=at=e:at=at.next=e}return at}function Ks(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function hr(e){var t=mr;return mr+=1,ii===null&&(ii=[]),e=Mm(ii,e,t),t=ve,(at===null?t.memoizedState:at.next)===null&&(t=t.alternate,_.H=t===null||t.memoizedState===null?ph:vc),e}function Xs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return hr(e);if(e.$$typeof===K)return vt(e)}throw Error(u(438,String(e)))}function ic(e){var t=null,l=ve.updateQueue;if(l!==null&&(t=l.memoCache),t==null){var n=ve.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(o){return o.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),l===null&&(l=Ks(),ve.updateQueue=l),l.memoCache=t,l=t.data[t.index],l===void 0)for(l=t.data[t.index]=Array(e),n=0;n<e;n++)l[n]=se;return t.index++,l}function Yl(e,t){return typeof t=="function"?t(e):t}function Vs(e){var t=et();return rc(t,He,e)}function rc(e,t,l){var n=e.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=l;var o=e.baseQueue,c=n.pending;if(c!==null){if(o!==null){var f=o.next;o.next=c.next,c.next=f}t.baseQueue=o=c,n.pending=null}if(c=e.baseState,o===null)e.memoizedState=c;else{t=o.next;var y=f=null,S=null,O=t,q=!1;do{var G=O.lane&-536870913;if(G!==O.lane?(Ne&G)===G:(Ql&G)===G){var D=O.revertLane;if(D===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null}),G===In&&(q=!0);else if((Ql&D)===D){O=O.next,D===In&&(q=!0);continue}else G={lane:0,revertLane:O.revertLane,gesture:null,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},S===null?(y=S=G,f=c):S=S.next=G,ve.lanes|=D,Na|=D;G=O.action,mn&&l(c,G),c=O.hasEagerState?O.eagerState:l(c,G)}else D={lane:G,revertLane:O.revertLane,gesture:O.gesture,action:O.action,hasEagerState:O.hasEagerState,eagerState:O.eagerState,next:null},S===null?(y=S=D,f=c):S=S.next=D,ve.lanes|=G,Na|=G;O=O.next}while(O!==null&&O!==t);if(S===null?f=c:S.next=y,!Yt(c,e.memoizedState)&&(nt=!0,q&&(l=ei,l!==null)))throw l;e.memoizedState=c,e.baseState=f,e.baseQueue=S,n.lastRenderedState=c}return o===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function sc(e){var t=et(),l=t.queue;if(l===null)throw Error(u(311));l.lastRenderedReducer=e;var n=l.dispatch,o=l.pending,c=t.memoizedState;if(o!==null){l.pending=null;var f=o=o.next;do c=e(c,f.action),f=f.next;while(f!==o);Yt(c,t.memoizedState)||(nt=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),l.lastRenderedState=c}return[c,n]}function Dm(e,t,l){var n=ve,o=et(),c=Ce;if(c){if(l===void 0)throw Error(u(407));l=l()}else l=t();var f=!Yt((He||o).memoizedState,l);if(f&&(o.memoizedState=l,nt=!0),o=o.queue,cc(Hm.bind(null,n,o,e),[e]),o.getSnapshot!==t||f||at!==null&&at.memoizedState.tag&1){if(n.flags|=2048,ri(9,{destroy:void 0},Bm.bind(null,n,o,l,t),null),Ke===null)throw Error(u(349));c||(Ql&127)!==0||Um(n,t,l)}return l}function Um(e,t,l){e.flags|=16384,e={getSnapshot:t,value:l},t=ve.updateQueue,t===null?(t=Ks(),ve.updateQueue=t,t.stores=[e]):(l=t.stores,l===null?t.stores=[e]:l.push(e))}function Bm(e,t,l,n){t.value=l,t.getSnapshot=n,Lm(t)&&qm(e)}function Hm(e,t,l){return l(function(){Lm(t)&&qm(e)})}function Lm(e){var t=e.getSnapshot;e=e.value;try{var l=t();return!Yt(e,l)}catch{return!0}}function qm(e){var t=an(e,2);t!==null&&Ut(t,e,2)}function oc(e){var t=Tt();if(typeof e=="function"){var l=e;if(e=l(),mn){Nl(!0);try{l()}finally{Nl(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yl,lastRenderedState:e},t}function Qm(e,t,l,n){return e.baseState=l,rc(e,He,typeof n=="function"?n:Yl)}function Dy(e,t,l,n,o){if(Js(e))throw Error(u(485));if(e=t.action,e!==null){var c={payload:o,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){c.listeners.push(f)}};_.T!==null?l(!0):c.isTransition=!1,n(c),l=t.pending,l===null?(c.next=t.pending=c,Ym(t,c)):(c.next=l.next,t.pending=l.next=c)}}function Ym(e,t){var l=t.action,n=t.payload,o=e.state;if(t.isTransition){var c=_.T,f={};_.T=f;try{var y=l(o,n),S=_.S;S!==null&&S(f,y),Gm(e,t,y)}catch(O){uc(e,t,O)}finally{c!==null&&f.types!==null&&(c.types=f.types),_.T=c}}else try{c=l(o,n),Gm(e,t,c)}catch(O){uc(e,t,O)}}function Gm(e,t,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(n){Km(e,t,n)},function(n){return uc(e,t,n)}):Km(e,t,l)}function Km(e,t,l){t.status="fulfilled",t.value=l,Xm(t),e.state=l,t=e.pending,t!==null&&(l=t.next,l===t?e.pending=null:(l=l.next,t.next=l,Ym(e,l)))}function uc(e,t,l){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=l,Xm(t),t=t.next;while(t!==n)}e.action=null}function Xm(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Vm(e,t){return t}function Zm(e,t){if(Ce){var l=Ke.formState;if(l!==null){e:{var n=ve;if(Ce){if(Xe){t:{for(var o=Xe,c=nl;o.nodeType!==8;){if(!c){o=null;break t}if(o=rl(o.nextSibling),o===null){o=null;break t}}c=o.data,o=c==="F!"||c==="F"?o:null}if(o){Xe=rl(o.nextSibling),n=o.data==="F!";break e}}ha(n)}n=!1}n&&(t=l[0])}}return l=Tt(),l.memoizedState=l.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Vm,lastRenderedState:t},l.queue=n,l=fh.bind(null,ve,n),n.dispatch=l,n=oc(!1),c=pc.bind(null,ve,!1,n.queue),n=Tt(),o={state:t,dispatch:null,action:e,pending:null},n.queue=o,l=Dy.bind(null,ve,o,c,l),o.dispatch=l,n.memoizedState=e,[t,l,!1]}function $m(e){var t=et();return Jm(t,He,e)}function Jm(e,t,l){if(t=rc(e,t,Vm)[0],e=Vs(Yl)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=hr(t)}catch(f){throw f===ti?Us:f}else n=t;t=et();var o=t.queue,c=o.dispatch;return l!==t.memoizedState&&(ve.flags|=2048,ri(9,{destroy:void 0},Uy.bind(null,o,l),null)),[n,c,e]}function Uy(e,t){e.action=t}function Fm(e){var t=et(),l=He;if(l!==null)return Jm(t,l,e);et(),t=t.memoizedState,l=et();var n=l.queue.dispatch;return l.memoizedState=e,[t,n,!1]}function ri(e,t,l,n){return e={tag:e,create:l,deps:n,inst:t,next:null},t=ve.updateQueue,t===null&&(t=Ks(),ve.updateQueue=t),l=t.lastEffect,l===null?t.lastEffect=e.next=e:(n=l.next,l.next=e,e.next=n,t.lastEffect=e),e}function Pm(){return et().memoizedState}function Zs(e,t,l,n){var o=Tt();ve.flags|=e,o.memoizedState=ri(1|t,{destroy:void 0},l,n===void 0?null:n)}function $s(e,t,l,n){var o=et();n=n===void 0?null:n;var c=o.memoizedState.inst;He!==null&&n!==null&&ec(n,He.memoizedState.deps)?o.memoizedState=ri(t,c,l,n):(ve.flags|=e,o.memoizedState=ri(1|t,c,l,n))}function Wm(e,t){Zs(8390656,8,e,t)}function cc(e,t){$s(2048,8,e,t)}function By(e){ve.flags|=4;var t=ve.updateQueue;if(t===null)t=Ks(),ve.updateQueue=t,t.events=[e];else{var l=t.events;l===null?t.events=[e]:l.push(e)}}function Im(e){var t=et().memoizedState;return By({ref:t,nextImpl:e}),function(){if((ke&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function eh(e,t){return $s(4,2,e,t)}function th(e,t){return $s(4,4,e,t)}function lh(e,t){if(typeof t=="function"){e=e();var l=t(e);return function(){typeof l=="function"?l():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function ah(e,t,l){l=l!=null?l.concat([e]):null,$s(4,4,lh.bind(null,t,e),l)}function dc(){}function nh(e,t){var l=et();t=t===void 0?null:t;var n=l.memoizedState;return t!==null&&ec(t,n[1])?n[0]:(l.memoizedState=[e,t],e)}function ih(e,t){var l=et();t=t===void 0?null:t;var n=l.memoizedState;if(t!==null&&ec(t,n[1]))return n[0];if(n=e(),mn){Nl(!0);try{e()}finally{Nl(!1)}}return l.memoizedState=[n,t],n}function fc(e,t,l){return l===void 0||(Ql&1073741824)!==0&&(Ne&261930)===0?e.memoizedState=t:(e.memoizedState=l,e=rp(),ve.lanes|=e,Na|=e,l)}function rh(e,t,l,n){return Yt(l,t)?l:ai.current!==null?(e=fc(e,l,n),Yt(e,t)||(nt=!0),e):(Ql&42)===0||(Ql&1073741824)!==0&&(Ne&261930)===0?(nt=!0,e.memoizedState=l):(e=rp(),ve.lanes|=e,Na|=e,t)}function sh(e,t,l,n,o){var c=$.p;$.p=c!==0&&8>c?c:8;var f=_.T,y={};_.T=y,pc(e,!1,t,l);try{var S=o(),O=_.S;if(O!==null&&O(y,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var q=Oy(S,n);pr(e,t,q,$t(e))}else pr(e,t,n,$t(e))}catch(G){pr(e,t,{then:function(){},status:"rejected",reason:G},$t())}finally{$.p=c,f!==null&&y.types!==null&&(f.types=y.types),_.T=f}}function Hy(){}function mc(e,t,l,n){if(e.tag!==5)throw Error(u(476));var o=oh(e).queue;sh(e,o,t,ne,l===null?Hy:function(){return uh(e),l(n)})}function oh(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yl,lastRenderedState:ne},next:null};var l={};return t.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Yl,lastRenderedState:l},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function uh(e){var t=oh(e);t.next===null&&(t=e.alternate.memoizedState),pr(e,t.next.queue,{},$t())}function hc(){return vt(Or)}function ch(){return et().memoizedState}function dh(){return et().memoizedState}function Ly(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var l=$t();e=xa(l);var n=ya(t,e,l);n!==null&&(Ut(n,t,l),cr(n,t,l)),t={cache:Gu()},e.payload=t;return}t=t.return}}function qy(e,t,l){var n=$t();l={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},Js(e)?mh(t,l):(l=Ou(e,t,l,n),l!==null&&(Ut(l,e,n),hh(l,t,n)))}function fh(e,t,l){var n=$t();pr(e,t,l,n)}function pr(e,t,l,n){var o={lane:n,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(Js(e))mh(t,o);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var f=t.lastRenderedState,y=c(f,l);if(o.hasEagerState=!0,o.eagerState=y,Yt(y,f))return As(e,t,o,0),Ke===null&&Es(),!1}catch{}finally{}if(l=Ou(e,t,o,n),l!==null)return Ut(l,e,n),hh(l,t,n),!0}return!1}function pc(e,t,l,n){if(n={lane:2,revertLane:Zc(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Js(e)){if(t)throw Error(u(479))}else t=Ou(e,l,n,2),t!==null&&Ut(t,e,2)}function Js(e){var t=e.alternate;return e===ve||t!==null&&t===ve}function mh(e,t){ni=Ys=!0;var l=e.pending;l===null?t.next=t:(t.next=l.next,l.next=t),e.pending=t}function hh(e,t,l){if((l&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,l|=n,t.lanes=l,ca(e,l)}}var vr={readContext:vt,use:Xs,useCallback:Fe,useContext:Fe,useEffect:Fe,useImperativeHandle:Fe,useLayoutEffect:Fe,useInsertionEffect:Fe,useMemo:Fe,useReducer:Fe,useRef:Fe,useState:Fe,useDebugValue:Fe,useDeferredValue:Fe,useTransition:Fe,useSyncExternalStore:Fe,useId:Fe,useHostTransitionStatus:Fe,useFormState:Fe,useActionState:Fe,useOptimistic:Fe,useMemoCache:Fe,useCacheRefresh:Fe};vr.useEffectEvent=Fe;var ph={readContext:vt,use:Xs,useCallback:function(e,t){return Tt().memoizedState=[e,t===void 0?null:t],e},useContext:vt,useEffect:Wm,useImperativeHandle:function(e,t,l){l=l!=null?l.concat([e]):null,Zs(4194308,4,lh.bind(null,t,e),l)},useLayoutEffect:function(e,t){return Zs(4194308,4,e,t)},useInsertionEffect:function(e,t){Zs(4,2,e,t)},useMemo:function(e,t){var l=Tt();t=t===void 0?null:t;var n=e();if(mn){Nl(!0);try{e()}finally{Nl(!1)}}return l.memoizedState=[n,t],n},useReducer:function(e,t,l){var n=Tt();if(l!==void 0){var o=l(t);if(mn){Nl(!0);try{l(t)}finally{Nl(!1)}}}else o=t;return n.memoizedState=n.baseState=o,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:o},n.queue=e,e=e.dispatch=qy.bind(null,ve,e),[n.memoizedState,e]},useRef:function(e){var t=Tt();return e={current:e},t.memoizedState=e},useState:function(e){e=oc(e);var t=e.queue,l=fh.bind(null,ve,t);return t.dispatch=l,[e.memoizedState,l]},useDebugValue:dc,useDeferredValue:function(e,t){var l=Tt();return fc(l,e,t)},useTransition:function(){var e=oc(!1);return e=sh.bind(null,ve,e.queue,!0,!1),Tt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,l){var n=ve,o=Tt();if(Ce){if(l===void 0)throw Error(u(407));l=l()}else{if(l=t(),Ke===null)throw Error(u(349));(Ne&127)!==0||Um(n,t,l)}o.memoizedState=l;var c={value:l,getSnapshot:t};return o.queue=c,Wm(Hm.bind(null,n,c,e),[e]),n.flags|=2048,ri(9,{destroy:void 0},Bm.bind(null,n,c,l,t),null),l},useId:function(){var e=Tt(),t=Ke.identifierPrefix;if(Ce){var l=Tl,n=wl;l=(n&~(1<<32-wt(n)-1)).toString(32)+l,t="_"+t+"R_"+l,l=Gs++,0<l&&(t+="H"+l.toString(32)),t+="_"}else l=ky++,t="_"+t+"r_"+l.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:hc,useFormState:Zm,useActionState:Zm,useOptimistic:function(e){var t=Tt();t.memoizedState=t.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=l,t=pc.bind(null,ve,!0,l),l.dispatch=t,[e,t]},useMemoCache:ic,useCacheRefresh:function(){return Tt().memoizedState=Ly.bind(null,ve)},useEffectEvent:function(e){var t=Tt(),l={impl:e};return t.memoizedState=l,function(){if((ke&2)!==0)throw Error(u(440));return l.impl.apply(void 0,arguments)}}},vc={readContext:vt,use:Xs,useCallback:nh,useContext:vt,useEffect:cc,useImperativeHandle:ah,useInsertionEffect:eh,useLayoutEffect:th,useMemo:ih,useReducer:Vs,useRef:Pm,useState:function(){return Vs(Yl)},useDebugValue:dc,useDeferredValue:function(e,t){var l=et();return rh(l,He.memoizedState,e,t)},useTransition:function(){var e=Vs(Yl)[0],t=et().memoizedState;return[typeof e=="boolean"?e:hr(e),t]},useSyncExternalStore:Dm,useId:ch,useHostTransitionStatus:hc,useFormState:$m,useActionState:$m,useOptimistic:function(e,t){var l=et();return Qm(l,He,e,t)},useMemoCache:ic,useCacheRefresh:dh};vc.useEffectEvent=Im;var vh={readContext:vt,use:Xs,useCallback:nh,useContext:vt,useEffect:cc,useImperativeHandle:ah,useInsertionEffect:eh,useLayoutEffect:th,useMemo:ih,useReducer:sc,useRef:Pm,useState:function(){return sc(Yl)},useDebugValue:dc,useDeferredValue:function(e,t){var l=et();return He===null?fc(l,e,t):rh(l,He.memoizedState,e,t)},useTransition:function(){var e=sc(Yl)[0],t=et().memoizedState;return[typeof e=="boolean"?e:hr(e),t]},useSyncExternalStore:Dm,useId:ch,useHostTransitionStatus:hc,useFormState:Fm,useActionState:Fm,useOptimistic:function(e,t){var l=et();return He!==null?Qm(l,He,e,t):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:ic,useCacheRefresh:dh};vh.useEffectEvent=Im;function xc(e,t,l,n){t=e.memoizedState,l=l(n,t),l=l==null?t:b({},t,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var yc={enqueueSetState:function(e,t,l){e=e._reactInternals;var n=$t(),o=xa(n);o.payload=t,l!=null&&(o.callback=l),t=ya(e,o,n),t!==null&&(Ut(t,e,n),cr(t,e,n))},enqueueReplaceState:function(e,t,l){e=e._reactInternals;var n=$t(),o=xa(n);o.tag=1,o.payload=t,l!=null&&(o.callback=l),t=ya(e,o,n),t!==null&&(Ut(t,e,n),cr(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var l=$t(),n=xa(l);n.tag=2,t!=null&&(n.callback=t),t=ya(e,n,l),t!==null&&(Ut(t,e,l),cr(t,e,l))}};function xh(e,t,l,n,o,c,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,c,f):t.prototype&&t.prototype.isPureReactComponent?!lr(l,n)||!lr(o,c):!0}function yh(e,t,l,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(l,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(l,n),t.state!==e&&yc.enqueueReplaceState(t,t.state,null)}function hn(e,t){var l=t;if("ref"in t){l={};for(var n in t)n!=="ref"&&(l[n]=t[n])}if(e=e.defaultProps){l===t&&(l=b({},l));for(var o in e)l[o]===void 0&&(l[o]=e[o])}return l}function bh(e){Cs(e)}function gh(e){console.error(e)}function jh(e){Cs(e)}function Fs(e,t){try{var l=e.onUncaughtError;l(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Sh(e,t,l){try{var n=e.onCaughtError;n(l.value,{componentStack:l.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(o){setTimeout(function(){throw o})}}function bc(e,t,l){return l=xa(l),l.tag=3,l.payload={element:null},l.callback=function(){Fs(e,t)},l}function Nh(e){return e=xa(e),e.tag=3,e}function Mh(e,t,l,n){var o=l.type.getDerivedStateFromError;if(typeof o=="function"){var c=n.value;e.payload=function(){return o(c)},e.callback=function(){Sh(t,l,n)}}var f=l.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){Sh(t,l,n),typeof o!="function"&&(Ma===null?Ma=new Set([this]):Ma.add(this));var y=n.stack;this.componentDidCatch(n.value,{componentStack:y!==null?y:""})})}function Qy(e,t,l,n,o){if(l.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=l.alternate,t!==null&&Wn(t,l,o,!0),l=Kt.current,l!==null){switch(l.tag){case 31:case 13:return il===null?oo():l.alternate===null&&Pe===0&&(Pe=3),l.flags&=-257,l.flags|=65536,l.lanes=o,n===Bs?l.flags|=16384:(t=l.updateQueue,t===null?l.updateQueue=new Set([n]):t.add(n),Kc(e,n,o)),!1;case 22:return l.flags|=65536,n===Bs?l.flags|=16384:(t=l.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},l.updateQueue=t):(l=t.retryQueue,l===null?t.retryQueue=new Set([n]):l.add(n)),Kc(e,n,o)),!1}throw Error(u(435,l.tag))}return Kc(e,n,o),oo(),!1}if(Ce)return t=Kt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=o,n!==Hu&&(e=Error(u(422),{cause:n}),ir(tl(e,l)))):(n!==Hu&&(t=Error(u(423),{cause:n}),ir(tl(t,l))),e=e.current.alternate,e.flags|=65536,o&=-o,e.lanes|=o,n=tl(n,l),o=bc(e.stateNode,n,o),Ju(e,o),Pe!==4&&(Pe=2)),!1;var c=Error(u(520),{cause:n});if(c=tl(c,l),Mr===null?Mr=[c]:Mr.push(c),Pe!==4&&(Pe=2),t===null)return!0;n=tl(n,l),l=t;do{switch(l.tag){case 3:return l.flags|=65536,e=o&-o,l.lanes|=e,e=bc(l.stateNode,n,e),Ju(l,e),!1;case 1:if(t=l.type,c=l.stateNode,(l.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&(Ma===null||!Ma.has(c))))return l.flags|=65536,o&=-o,l.lanes|=o,o=Nh(o),Mh(o,e,l,n),Ju(l,o),!1}l=l.return}while(l!==null);return!1}var gc=Error(u(461)),nt=!1;function xt(e,t,l,n){t.child=e===null?Em(t,null,l,n):fn(t,e.child,l,n)}function wh(e,t,l,n,o){l=l.render;var c=t.ref;if("ref"in n){var f={};for(var y in n)y!=="ref"&&(f[y]=n[y])}else f=n;return on(t),n=tc(e,t,l,f,c,o),y=lc(),e!==null&&!nt?(ac(e,t,o),Gl(e,t,o)):(Ce&&y&&Uu(t),t.flags|=1,xt(e,t,n,o),t.child)}function Th(e,t,l,n,o){if(e===null){var c=l.type;return typeof c=="function"&&!ku(c)&&c.defaultProps===void 0&&l.compare===null?(t.tag=15,t.type=c,Ch(e,t,c,n,o)):(e=Rs(l.type,null,n,t,t.mode,o),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!Ec(e,o)){var f=c.memoizedProps;if(l=l.compare,l=l!==null?l:lr,l(f,n)&&e.ref===t.ref)return Gl(e,t,o)}return t.flags|=1,e=Bl(c,n),e.ref=t.ref,e.return=t,t.child=e}function Ch(e,t,l,n,o){if(e!==null){var c=e.memoizedProps;if(lr(c,n)&&e.ref===t.ref)if(nt=!1,t.pendingProps=n=c,Ec(e,o))(e.flags&131072)!==0&&(nt=!0);else return t.lanes=e.lanes,Gl(e,t,o)}return jc(e,t,l,n,o)}function Eh(e,t,l,n){var o=n.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|l:l,e!==null){for(n=t.child=e.child,o=0;n!==null;)o=o|n.lanes|n.childLanes,n=n.sibling;n=o&~c}else n=0,t.child=null;return Ah(e,t,c,l,n)}if((l&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ds(t,c!==null?c.cachePool:null),c!==null?Rm(t,c):Pu(),Om(t);else return n=t.lanes=536870912,Ah(e,t,c!==null?c.baseLanes|l:l,l,n)}else c!==null?(Ds(t,c.cachePool),Rm(t,c),ga(),t.memoizedState=null):(e!==null&&Ds(t,null),Pu(),ga());return xt(e,t,o,l),t.child}function xr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Ah(e,t,l,n,o){var c=Xu();return c=c===null?null:{parent:lt._currentValue,pool:c},t.memoizedState={baseLanes:l,cachePool:c},e!==null&&Ds(t,null),Pu(),Om(t),e!==null&&Wn(e,t,n,!0),t.childLanes=o,null}function Ps(e,t){return t=Is({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function zh(e,t,l){return fn(t,e.child,null,l),e=Ps(t,t.pendingProps),e.flags|=2,Xt(t),t.memoizedState=null,e}function Yy(e,t,l){var n=t.pendingProps,o=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ce){if(n.mode==="hidden")return e=Ps(t,n),t.lanes=536870912,xr(null,e);if(Iu(t),(e=Xe)?(e=Yp(e,nl),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:fa!==null?{id:wl,overflow:Tl}:null,retryLane:536870912,hydrationErrors:null},l=mm(e),l.return=t,t.child=l,pt=t,Xe=null)):e=null,e===null)throw ha(t);return t.lanes=536870912,null}return Ps(t,n)}var c=e.memoizedState;if(c!==null){var f=c.dehydrated;if(Iu(t),o)if(t.flags&256)t.flags&=-257,t=zh(e,t,l);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(nt||Wn(e,t,l,!1),o=(l&e.childLanes)!==0,nt||o){if(n=Ke,n!==null&&(f=Ki(n,l),f!==0&&f!==c.retryLane))throw c.retryLane=f,an(e,f),Ut(n,e,f),gc;oo(),t=zh(e,t,l)}else e=c.treeContext,Xe=rl(f.nextSibling),pt=t,Ce=!0,ma=null,nl=!1,e!==null&&vm(t,e),t=Ps(t,n),t.flags|=4096;return t}return e=Bl(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Ws(e,t){var l=t.ref;if(l===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(u(284));(e===null||e.ref!==l)&&(t.flags|=4194816)}}function jc(e,t,l,n,o){return on(t),l=tc(e,t,l,n,void 0,o),n=lc(),e!==null&&!nt?(ac(e,t,o),Gl(e,t,o)):(Ce&&n&&Uu(t),t.flags|=1,xt(e,t,l,o),t.child)}function Rh(e,t,l,n,o,c){return on(t),t.updateQueue=null,l=_m(t,n,l,o),km(e),n=lc(),e!==null&&!nt?(ac(e,t,c),Gl(e,t,c)):(Ce&&n&&Uu(t),t.flags|=1,xt(e,t,l,c),t.child)}function Oh(e,t,l,n,o){if(on(t),t.stateNode===null){var c=$n,f=l.contextType;typeof f=="object"&&f!==null&&(c=vt(f)),c=new l(n,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=yc,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=n,c.state=t.memoizedState,c.refs={},Zu(t),f=l.contextType,c.context=typeof f=="object"&&f!==null?vt(f):$n,c.state=t.memoizedState,f=l.getDerivedStateFromProps,typeof f=="function"&&(xc(t,l,f,n),c.state=t.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(f=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),f!==c.state&&yc.enqueueReplaceState(c,c.state,null),fr(t,n,c,o),dr(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){c=t.stateNode;var y=t.memoizedProps,S=hn(l,y);c.props=S;var O=c.context,q=l.contextType;f=$n,typeof q=="object"&&q!==null&&(f=vt(q));var G=l.getDerivedStateFromProps;q=typeof G=="function"||typeof c.getSnapshotBeforeUpdate=="function",y=t.pendingProps!==y,q||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(y||O!==f)&&yh(t,c,n,f),va=!1;var D=t.memoizedState;c.state=D,fr(t,n,c,o),dr(),O=t.memoizedState,y||D!==O||va?(typeof G=="function"&&(xc(t,l,G,n),O=t.memoizedState),(S=va||xh(t,l,S,n,D,O,f))?(q||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=O),c.props=n,c.state=O,c.context=f,n=S):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{c=t.stateNode,$u(e,t),f=t.memoizedProps,q=hn(l,f),c.props=q,G=t.pendingProps,D=c.context,O=l.contextType,S=$n,typeof O=="object"&&O!==null&&(S=vt(O)),y=l.getDerivedStateFromProps,(O=typeof y=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(f!==G||D!==S)&&yh(t,c,n,S),va=!1,D=t.memoizedState,c.state=D,fr(t,n,c,o),dr();var H=t.memoizedState;f!==G||D!==H||va||e!==null&&e.dependencies!==null&&ks(e.dependencies)?(typeof y=="function"&&(xc(t,l,y,n),H=t.memoizedState),(q=va||xh(t,l,q,n,D,H,S)||e!==null&&e.dependencies!==null&&ks(e.dependencies))?(O||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(n,H,S),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(n,H,S)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=H),c.props=n,c.state=H,c.context=S,n=q):(typeof c.componentDidUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&D===e.memoizedState||(t.flags|=1024),n=!1)}return c=n,Ws(e,t),n=(t.flags&128)!==0,c||n?(c=t.stateNode,l=n&&typeof l.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&n?(t.child=fn(t,e.child,null,o),t.child=fn(t,null,l,o)):xt(e,t,l,o),t.memoizedState=c.state,e=t.child):e=Gl(e,t,o),e}function kh(e,t,l,n){return rn(),t.flags|=256,xt(e,t,l,n),t.child}var Sc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Nc(e){return{baseLanes:e,cachePool:Sm()}}function Mc(e,t,l){return e=e!==null?e.childLanes&~l:0,t&&(e|=Zt),e}function _h(e,t,l){var n=t.pendingProps,o=!1,c=(t.flags&128)!==0,f;if((f=c)||(f=e!==null&&e.memoizedState===null?!1:(Ie.current&2)!==0),f&&(o=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ce){if(o?ba(t):ga(),(e=Xe)?(e=Yp(e,nl),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:fa!==null?{id:wl,overflow:Tl}:null,retryLane:536870912,hydrationErrors:null},l=mm(e),l.return=t,t.child=l,pt=t,Xe=null)):e=null,e===null)throw ha(t);return rd(e)?t.lanes=32:t.lanes=536870912,null}var y=n.children;return n=n.fallback,o?(ga(),o=t.mode,y=Is({mode:"hidden",children:y},o),n=nn(n,o,l,null),y.return=t,n.return=t,y.sibling=n,t.child=y,n=t.child,n.memoizedState=Nc(l),n.childLanes=Mc(e,f,l),t.memoizedState=Sc,xr(null,n)):(ba(t),wc(t,y))}var S=e.memoizedState;if(S!==null&&(y=S.dehydrated,y!==null)){if(c)t.flags&256?(ba(t),t.flags&=-257,t=Tc(e,t,l)):t.memoizedState!==null?(ga(),t.child=e.child,t.flags|=128,t=null):(ga(),y=n.fallback,o=t.mode,n=Is({mode:"visible",children:n.children},o),y=nn(y,o,l,null),y.flags|=2,n.return=t,y.return=t,n.sibling=y,t.child=n,fn(t,e.child,null,l),n=t.child,n.memoizedState=Nc(l),n.childLanes=Mc(e,f,l),t.memoizedState=Sc,t=xr(null,n));else if(ba(t),rd(y)){if(f=y.nextSibling&&y.nextSibling.dataset,f)var O=f.dgst;f=O,n=Error(u(419)),n.stack="",n.digest=f,ir({value:n,source:null,stack:null}),t=Tc(e,t,l)}else if(nt||Wn(e,t,l,!1),f=(l&e.childLanes)!==0,nt||f){if(f=Ke,f!==null&&(n=Ki(f,l),n!==0&&n!==S.retryLane))throw S.retryLane=n,an(e,n),Ut(f,e,n),gc;id(y)||oo(),t=Tc(e,t,l)}else id(y)?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,Xe=rl(y.nextSibling),pt=t,Ce=!0,ma=null,nl=!1,e!==null&&vm(t,e),t=wc(t,n.children),t.flags|=4096);return t}return o?(ga(),y=n.fallback,o=t.mode,S=e.child,O=S.sibling,n=Bl(S,{mode:"hidden",children:n.children}),n.subtreeFlags=S.subtreeFlags&65011712,O!==null?y=Bl(O,y):(y=nn(y,o,l,null),y.flags|=2),y.return=t,n.return=t,n.sibling=y,t.child=n,xr(null,n),n=t.child,y=e.child.memoizedState,y===null?y=Nc(l):(o=y.cachePool,o!==null?(S=lt._currentValue,o=o.parent!==S?{parent:S,pool:S}:o):o=Sm(),y={baseLanes:y.baseLanes|l,cachePool:o}),n.memoizedState=y,n.childLanes=Mc(e,f,l),t.memoizedState=Sc,xr(e.child,n)):(ba(t),l=e.child,e=l.sibling,l=Bl(l,{mode:"visible",children:n.children}),l.return=t,l.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=l,t.memoizedState=null,l)}function wc(e,t){return t=Is({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Is(e,t){return e=Gt(22,e,null,t),e.lanes=0,e}function Tc(e,t,l){return fn(t,e.child,null,l),e=wc(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Dh(e,t,l){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Qu(e.return,t,l)}function Cc(e,t,l,n,o,c){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:l,tailMode:o,treeForkCount:c}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=n,f.tail=l,f.tailMode=o,f.treeForkCount=c)}function Uh(e,t,l){var n=t.pendingProps,o=n.revealOrder,c=n.tail;n=n.children;var f=Ie.current,y=(f&2)!==0;if(y?(f=f&1|2,t.flags|=128):f&=1,Z(Ie,f),xt(e,t,n,l),n=Ce?nr:0,!y&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Dh(e,l,t);else if(e.tag===19)Dh(e,l,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}switch(o){case"forwards":for(l=t.child,o=null;l!==null;)e=l.alternate,e!==null&&Qs(e)===null&&(o=l),l=l.sibling;l=o,l===null?(o=t.child,t.child=null):(o=l.sibling,l.sibling=null),Cc(t,!1,o,l,c,n);break;case"backwards":case"unstable_legacy-backwards":for(l=null,o=t.child,t.child=null;o!==null;){if(e=o.alternate,e!==null&&Qs(e)===null){t.child=o;break}e=o.sibling,o.sibling=l,l=o,o=e}Cc(t,!0,l,null,c,n);break;case"together":Cc(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Gl(e,t,l){if(e!==null&&(t.dependencies=e.dependencies),Na|=t.lanes,(l&t.childLanes)===0)if(e!==null){if(Wn(e,t,l,!1),(l&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,l=Bl(e,e.pendingProps),t.child=l,l.return=t;e.sibling!==null;)e=e.sibling,l=l.sibling=Bl(e,e.pendingProps),l.return=t;l.sibling=null}return t.child}function Ec(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&ks(e)))}function Gy(e,t,l){switch(t.tag){case 3:Te(t,t.stateNode.containerInfo),pa(t,lt,e.memoizedState.cache),rn();break;case 27:case 5:qt(t);break;case 4:Te(t,t.stateNode.containerInfo);break;case 10:pa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Iu(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(ba(t),t.flags|=128,null):(l&t.child.childLanes)!==0?_h(e,t,l):(ba(t),e=Gl(e,t,l),e!==null?e.sibling:null);ba(t);break;case 19:var o=(e.flags&128)!==0;if(n=(l&t.childLanes)!==0,n||(Wn(e,t,l,!1),n=(l&t.childLanes)!==0),o){if(n)return Uh(e,t,l);t.flags|=128}if(o=t.memoizedState,o!==null&&(o.rendering=null,o.tail=null,o.lastEffect=null),Z(Ie,Ie.current),n)break;return null;case 22:return t.lanes=0,Eh(e,t,l,t.pendingProps);case 24:pa(t,lt,e.memoizedState.cache)}return Gl(e,t,l)}function Bh(e,t,l){if(e!==null)if(e.memoizedProps!==t.pendingProps)nt=!0;else{if(!Ec(e,l)&&(t.flags&128)===0)return nt=!1,Gy(e,t,l);nt=(e.flags&131072)!==0}else nt=!1,Ce&&(t.flags&1048576)!==0&&pm(t,nr,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=cn(t.elementType),t.type=e,typeof e=="function")ku(e)?(n=hn(e,n),t.tag=1,t=Oh(null,t,e,n,l)):(t.tag=0,t=jc(null,t,e,n,l));else{if(e!=null){var o=e.$$typeof;if(o===B){t.tag=11,t=wh(null,t,e,n,l);break e}else if(o===J){t.tag=14,t=Th(null,t,e,n,l);break e}}throw t=Ae(e)||e,Error(u(306,t,""))}}return t;case 0:return jc(e,t,t.type,t.pendingProps,l);case 1:return n=t.type,o=hn(n,t.pendingProps),Oh(e,t,n,o,l);case 3:e:{if(Te(t,t.stateNode.containerInfo),e===null)throw Error(u(387));n=t.pendingProps;var c=t.memoizedState;o=c.element,$u(e,t),fr(t,n,null,l);var f=t.memoizedState;if(n=f.cache,pa(t,lt,n),n!==c.cache&&Yu(t,[lt],l,!0),dr(),n=f.element,c.isDehydrated)if(c={element:n,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=kh(e,t,n,l);break e}else if(n!==o){o=tl(Error(u(424)),t),ir(o),t=kh(e,t,n,l);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Xe=rl(e.firstChild),pt=t,Ce=!0,ma=null,nl=!0,l=Em(t,null,n,l),t.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(rn(),n===o){t=Gl(e,t,l);break e}xt(e,t,n,l)}t=t.child}return t;case 26:return Ws(e,t),e===null?(l=$p(t.type,null,t.pendingProps,null))?t.memoizedState=l:Ce||(l=t.type,e=t.pendingProps,n=vo(le.current).createElement(l),n[Ge]=t,n[tt]=e,yt(n,l,e),ct(n),t.stateNode=n):t.memoizedState=$p(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return qt(t),e===null&&Ce&&(n=t.stateNode=Xp(t.type,t.pendingProps,le.current),pt=t,nl=!0,o=Xe,Ea(t.type)?(sd=o,Xe=rl(n.firstChild)):Xe=o),xt(e,t,t.pendingProps.children,l),Ws(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ce&&((o=n=Xe)&&(n=bb(n,t.type,t.pendingProps,nl),n!==null?(t.stateNode=n,pt=t,Xe=rl(n.firstChild),nl=!1,o=!0):o=!1),o||ha(t)),qt(t),o=t.type,c=t.pendingProps,f=e!==null?e.memoizedProps:null,n=c.children,ld(o,c)?n=null:f!==null&&ld(o,f)&&(t.flags|=32),t.memoizedState!==null&&(o=tc(e,t,_y,null,null,l),Or._currentValue=o),Ws(e,t),xt(e,t,n,l),t.child;case 6:return e===null&&Ce&&((e=l=Xe)&&(l=gb(l,t.pendingProps,nl),l!==null?(t.stateNode=l,pt=t,Xe=null,e=!0):e=!1),e||ha(t)),null;case 13:return _h(e,t,l);case 4:return Te(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=fn(t,null,n,l):xt(e,t,n,l),t.child;case 11:return wh(e,t,t.type,t.pendingProps,l);case 7:return xt(e,t,t.pendingProps,l),t.child;case 8:return xt(e,t,t.pendingProps.children,l),t.child;case 12:return xt(e,t,t.pendingProps.children,l),t.child;case 10:return n=t.pendingProps,pa(t,t.type,n.value),xt(e,t,n.children,l),t.child;case 9:return o=t.type._context,n=t.pendingProps.children,on(t),o=vt(o),n=n(o),t.flags|=1,xt(e,t,n,l),t.child;case 14:return Th(e,t,t.type,t.pendingProps,l);case 15:return Ch(e,t,t.type,t.pendingProps,l);case 19:return Uh(e,t,l);case 31:return Yy(e,t,l);case 22:return Eh(e,t,l,t.pendingProps);case 24:return on(t),n=vt(lt),e===null?(o=Xu(),o===null&&(o=Ke,c=Gu(),o.pooledCache=c,c.refCount++,c!==null&&(o.pooledCacheLanes|=l),o=c),t.memoizedState={parent:n,cache:o},Zu(t),pa(t,lt,o)):((e.lanes&l)!==0&&($u(e,t),fr(t,null,null,l),dr()),o=e.memoizedState,c=t.memoizedState,o.parent!==n?(o={parent:n,cache:n},t.memoizedState=o,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=o),pa(t,lt,n)):(n=c.cache,pa(t,lt,n),n!==o.cache&&Yu(t,[lt],l,!0))),xt(e,t,t.pendingProps.children,l),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function Kl(e){e.flags|=4}function Ac(e,t,l,n,o){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(o&335544128)===o)if(e.stateNode.complete)e.flags|=8192;else if(cp())e.flags|=8192;else throw dn=Bs,Vu}else e.flags&=-16777217}function Hh(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ip(t))if(cp())e.flags|=8192;else throw dn=Bs,Vu}function eo(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Gi():536870912,e.lanes|=t,ci|=t)}function yr(e,t){if(!Ce)switch(e.tailMode){case"hidden":t=e.tail;for(var l=null;t!==null;)t.alternate!==null&&(l=t),t=t.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var n=null;l!==null;)l.alternate!==null&&(n=l),l=l.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function Ve(e){var t=e.alternate!==null&&e.alternate.child===e.child,l=0,n=0;if(t)for(var o=e.child;o!==null;)l|=o.lanes|o.childLanes,n|=o.subtreeFlags&65011712,n|=o.flags&65011712,o.return=e,o=o.sibling;else for(o=e.child;o!==null;)l|=o.lanes|o.childLanes,n|=o.subtreeFlags,n|=o.flags,o.return=e,o=o.sibling;return e.subtreeFlags|=n,e.childLanes=l,t}function Ky(e,t,l){var n=t.pendingProps;switch(Bu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ve(t),null;case 1:return Ve(t),null;case 3:return l=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ql(lt),ze(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Pn(t)?Kl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Lu())),Ve(t),null;case 26:var o=t.type,c=t.memoizedState;return e===null?(Kl(t),c!==null?(Ve(t),Hh(t,c)):(Ve(t),Ac(t,o,null,n,l))):c?c!==e.memoizedState?(Kl(t),Ve(t),Hh(t,c)):(Ve(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Kl(t),Ve(t),Ac(t,o,e,n,l)),null;case 27:if(fl(t),l=le.current,o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Kl(t);else{if(!n){if(t.stateNode===null)throw Error(u(166));return Ve(t),null}e=W.current,Pn(t)?xm(t):(e=Xp(o,n,l),t.stateNode=e,Kl(t))}return Ve(t),null;case 5:if(fl(t),o=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Kl(t);else{if(!n){if(t.stateNode===null)throw Error(u(166));return Ve(t),null}if(c=W.current,Pn(t))xm(t);else{var f=vo(le.current);switch(c){case 1:c=f.createElementNS("http://www.w3.org/2000/svg",o);break;case 2:c=f.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;default:switch(o){case"svg":c=f.createElementNS("http://www.w3.org/2000/svg",o);break;case"math":c=f.createElementNS("http://www.w3.org/1998/Math/MathML",o);break;case"script":c=f.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof n.is=="string"?f.createElement("select",{is:n.is}):f.createElement("select"),n.multiple?c.multiple=!0:n.size&&(c.size=n.size);break;default:c=typeof n.is=="string"?f.createElement(o,{is:n.is}):f.createElement(o)}}c[Ge]=t,c[tt]=n;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)c.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=c;e:switch(yt(c,o,n),o){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Kl(t)}}return Ve(t),Ac(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,l),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Kl(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(u(166));if(e=le.current,Pn(t)){if(e=t.stateNode,l=t.memoizedProps,n=null,o=pt,o!==null)switch(o.tag){case 27:case 5:n=o.memoizedProps}e[Ge]=t,e=!!(e.nodeValue===l||n!==null&&n.suppressHydrationWarning===!0||_p(e.nodeValue,l)),e||ha(t,!0)}else e=vo(e).createTextNode(n),e[Ge]=t,t.stateNode=e}return Ve(t),null;case 31:if(l=t.memoizedState,e===null||e.memoizedState!==null){if(n=Pn(t),l!==null){if(e===null){if(!n)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[Ge]=t}else rn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ve(t),e=!1}else l=Lu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return t.flags&256?(Xt(t),t):(Xt(t),null);if((t.flags&128)!==0)throw Error(u(558))}return Ve(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(o=Pn(t),n!==null&&n.dehydrated!==null){if(e===null){if(!o)throw Error(u(318));if(o=t.memoizedState,o=o!==null?o.dehydrated:null,!o)throw Error(u(317));o[Ge]=t}else rn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Ve(t),o=!1}else o=Lu(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=o),o=!0;if(!o)return t.flags&256?(Xt(t),t):(Xt(t),null)}return Xt(t),(t.flags&128)!==0?(t.lanes=l,t):(l=n!==null,e=e!==null&&e.memoizedState!==null,l&&(n=t.child,o=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(o=n.alternate.memoizedState.cachePool.pool),c=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(c=n.memoizedState.cachePool.pool),c!==o&&(n.flags|=2048)),l!==e&&l&&(t.child.flags|=8192),eo(t,t.updateQueue),Ve(t),null);case 4:return ze(),e===null&&Pc(t.stateNode.containerInfo),Ve(t),null;case 10:return ql(t.type),Ve(t),null;case 19:if(k(Ie),n=t.memoizedState,n===null)return Ve(t),null;if(o=(t.flags&128)!==0,c=n.rendering,c===null)if(o)yr(n,!1);else{if(Pe!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=Qs(e),c!==null){for(t.flags|=128,yr(n,!1),e=c.updateQueue,t.updateQueue=e,eo(t,e),t.subtreeFlags=0,e=l,l=t.child;l!==null;)fm(l,e),l=l.sibling;return Z(Ie,Ie.current&1|2),Ce&&Hl(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&Nt()>io&&(t.flags|=128,o=!0,yr(n,!1),t.lanes=4194304)}else{if(!o)if(e=Qs(c),e!==null){if(t.flags|=128,o=!0,e=e.updateQueue,t.updateQueue=e,eo(t,e),yr(n,!0),n.tail===null&&n.tailMode==="hidden"&&!c.alternate&&!Ce)return Ve(t),null}else 2*Nt()-n.renderingStartTime>io&&l!==536870912&&(t.flags|=128,o=!0,yr(n,!1),t.lanes=4194304);n.isBackwards?(c.sibling=t.child,t.child=c):(e=n.last,e!==null?e.sibling=c:t.child=c,n.last=c)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=Nt(),e.sibling=null,l=Ie.current,Z(Ie,o?l&1|2:l&1),Ce&&Hl(t,n.treeForkCount),e):(Ve(t),null);case 22:case 23:return Xt(t),Wu(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(l&536870912)!==0&&(t.flags&128)===0&&(Ve(t),t.subtreeFlags&6&&(t.flags|=8192)):Ve(t),l=t.updateQueue,l!==null&&eo(t,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==l&&(t.flags|=2048),e!==null&&k(un),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),ql(lt),Ve(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function Xy(e,t){switch(Bu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ql(lt),ze(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return fl(t),null;case 31:if(t.memoizedState!==null){if(Xt(t),t.alternate===null)throw Error(u(340));rn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Xt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));rn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return k(Ie),null;case 4:return ze(),null;case 10:return ql(t.type),null;case 22:case 23:return Xt(t),Wu(),e!==null&&k(un),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ql(lt),null;case 25:return null;default:return null}}function Lh(e,t){switch(Bu(t),t.tag){case 3:ql(lt),ze();break;case 26:case 27:case 5:fl(t);break;case 4:ze();break;case 31:t.memoizedState!==null&&Xt(t);break;case 13:Xt(t);break;case 19:k(Ie);break;case 10:ql(t.type);break;case 22:case 23:Xt(t),Wu(),e!==null&&k(un);break;case 24:ql(lt)}}function br(e,t){try{var l=t.updateQueue,n=l!==null?l.lastEffect:null;if(n!==null){var o=n.next;l=o;do{if((l.tag&e)===e){n=void 0;var c=l.create,f=l.inst;n=c(),f.destroy=n}l=l.next}while(l!==o)}}catch(y){Be(t,t.return,y)}}function ja(e,t,l){try{var n=t.updateQueue,o=n!==null?n.lastEffect:null;if(o!==null){var c=o.next;n=c;do{if((n.tag&e)===e){var f=n.inst,y=f.destroy;if(y!==void 0){f.destroy=void 0,o=t;var S=l,O=y;try{O()}catch(q){Be(o,S,q)}}}n=n.next}while(n!==c)}}catch(q){Be(t,t.return,q)}}function qh(e){var t=e.updateQueue;if(t!==null){var l=e.stateNode;try{zm(t,l)}catch(n){Be(e,e.return,n)}}}function Qh(e,t,l){l.props=hn(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(n){Be(e,t,n)}}function gr(e,t){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof l=="function"?e.refCleanup=l(n):l.current=n}}catch(o){Be(e,t,o)}}function Cl(e,t){var l=e.ref,n=e.refCleanup;if(l!==null)if(typeof n=="function")try{n()}catch(o){Be(e,t,o)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(o){Be(e,t,o)}else l.current=null}function Yh(e){var t=e.type,l=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":l.autoFocus&&n.focus();break e;case"img":l.src?n.src=l.src:l.srcSet&&(n.srcset=l.srcSet)}}catch(o){Be(e,e.return,o)}}function zc(e,t,l){try{var n=e.stateNode;mb(n,e.type,l,t),n[tt]=t}catch(o){Be(e,e.return,o)}}function Gh(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ea(e.type)||e.tag===4}function Rc(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Gh(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ea(e.type)||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 Oc(e,t,l){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,t):(t=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,t.appendChild(e),l=l._reactRootContainer,l!=null||t.onclick!==null||(t.onclick=Dl));else if(n!==4&&(n===27&&Ea(e.type)&&(l=e.stateNode,t=null),e=e.child,e!==null))for(Oc(e,t,l),e=e.sibling;e!==null;)Oc(e,t,l),e=e.sibling}function to(e,t,l){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?l.insertBefore(e,t):l.appendChild(e);else if(n!==4&&(n===27&&Ea(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(to(e,t,l),e=e.sibling;e!==null;)to(e,t,l),e=e.sibling}function Kh(e){var t=e.stateNode,l=e.memoizedProps;try{for(var n=e.type,o=t.attributes;o.length;)t.removeAttributeNode(o[0]);yt(t,n,l),t[Ge]=e,t[tt]=l}catch(c){Be(e,e.return,c)}}var Xl=!1,it=!1,kc=!1,Xh=typeof WeakSet=="function"?WeakSet:Set,dt=null;function Vy(e,t){if(e=e.containerInfo,ed=No,e=am(e),Tu(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var n=l.getSelection&&l.getSelection();if(n&&n.rangeCount!==0){l=n.anchorNode;var o=n.anchorOffset,c=n.focusNode;n=n.focusOffset;try{l.nodeType,c.nodeType}catch{l=null;break e}var f=0,y=-1,S=-1,O=0,q=0,G=e,D=null;t:for(;;){for(var H;G!==l||o!==0&&G.nodeType!==3||(y=f+o),G!==c||n!==0&&G.nodeType!==3||(S=f+n),G.nodeType===3&&(f+=G.nodeValue.length),(H=G.firstChild)!==null;)D=G,G=H;for(;;){if(G===e)break t;if(D===l&&++O===o&&(y=f),D===c&&++q===n&&(S=f),(H=G.nextSibling)!==null)break;G=D,D=G.parentNode}G=H}l=y===-1||S===-1?null:{start:y,end:S}}else l=null}l=l||{start:0,end:0}}else l=null;for(td={focusedElem:e,selectionRange:l},No=!1,dt=t;dt!==null;)if(t=dt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,dt=e;else for(;dt!==null;){switch(t=dt,c=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)o=e[l],o.ref.impl=o.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&c!==null){e=void 0,l=t,o=c.memoizedProps,c=c.memoizedState,n=l.stateNode;try{var ae=hn(l.type,o);e=n.getSnapshotBeforeUpdate(ae,c),n.__reactInternalSnapshotBeforeUpdate=e}catch(de){Be(l,l.return,de)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,l=e.nodeType,l===9)nd(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":nd(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(u(163))}if(e=t.sibling,e!==null){e.return=t.return,dt=e;break}dt=t.return}}function Vh(e,t,l){var n=l.flags;switch(l.tag){case 0:case 11:case 15:Zl(e,l),n&4&&br(5,l);break;case 1:if(Zl(e,l),n&4)if(e=l.stateNode,t===null)try{e.componentDidMount()}catch(f){Be(l,l.return,f)}else{var o=hn(l.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(o,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){Be(l,l.return,f)}}n&64&&qh(l),n&512&&gr(l,l.return);break;case 3:if(Zl(e,l),n&64&&(e=l.updateQueue,e!==null)){if(t=null,l.child!==null)switch(l.child.tag){case 27:case 5:t=l.child.stateNode;break;case 1:t=l.child.stateNode}try{zm(e,t)}catch(f){Be(l,l.return,f)}}break;case 27:t===null&&n&4&&Kh(l);case 26:case 5:Zl(e,l),t===null&&n&4&&Yh(l),n&512&&gr(l,l.return);break;case 12:Zl(e,l);break;case 31:Zl(e,l),n&4&&Jh(e,l);break;case 13:Zl(e,l),n&4&&Fh(e,l),n&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=tb.bind(null,l),jb(e,l))));break;case 22:if(n=l.memoizedState!==null||Xl,!n){t=t!==null&&t.memoizedState!==null||it,o=Xl;var c=it;Xl=n,(it=t)&&!c?$l(e,l,(l.subtreeFlags&8772)!==0):Zl(e,l),Xl=o,it=c}break;case 30:break;default:Zl(e,l)}}function Zh(e){var t=e.alternate;t!==null&&(e.alternate=null,Zh(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&uu(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var $e=null,Ot=!1;function Vl(e,t,l){for(l=l.child;l!==null;)$h(e,t,l),l=l.sibling}function $h(e,t,l){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount($a,l)}catch{}switch(l.tag){case 26:it||Cl(l,t),Vl(e,t,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:it||Cl(l,t);var n=$e,o=Ot;Ea(l.type)&&($e=l.stateNode,Ot=!1),Vl(e,t,l),Ar(l.stateNode),$e=n,Ot=o;break;case 5:it||Cl(l,t);case 6:if(n=$e,o=Ot,$e=null,Vl(e,t,l),$e=n,Ot=o,$e!==null)if(Ot)try{($e.nodeType===9?$e.body:$e.nodeName==="HTML"?$e.ownerDocument.body:$e).removeChild(l.stateNode)}catch(c){Be(l,t,c)}else try{$e.removeChild(l.stateNode)}catch(c){Be(l,t,c)}break;case 18:$e!==null&&(Ot?(e=$e,qp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),yi(e)):qp($e,l.stateNode));break;case 4:n=$e,o=Ot,$e=l.stateNode.containerInfo,Ot=!0,Vl(e,t,l),$e=n,Ot=o;break;case 0:case 11:case 14:case 15:ja(2,l,t),it||ja(4,l,t),Vl(e,t,l);break;case 1:it||(Cl(l,t),n=l.stateNode,typeof n.componentWillUnmount=="function"&&Qh(l,t,n)),Vl(e,t,l);break;case 21:Vl(e,t,l);break;case 22:it=(n=it)||l.memoizedState!==null,Vl(e,t,l),it=n;break;default:Vl(e,t,l)}}function Jh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{yi(e)}catch(l){Be(t,t.return,l)}}}function Fh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{yi(e)}catch(l){Be(t,t.return,l)}}function Zy(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Xh),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Xh),t;default:throw Error(u(435,e.tag))}}function lo(e,t){var l=Zy(e);t.forEach(function(n){if(!l.has(n)){l.add(n);var o=lb.bind(null,e,n);n.then(o,o)}})}function kt(e,t){var l=t.deletions;if(l!==null)for(var n=0;n<l.length;n++){var o=l[n],c=e,f=t,y=f;e:for(;y!==null;){switch(y.tag){case 27:if(Ea(y.type)){$e=y.stateNode,Ot=!1;break e}break;case 5:$e=y.stateNode,Ot=!1;break e;case 3:case 4:$e=y.stateNode.containerInfo,Ot=!0;break e}y=y.return}if($e===null)throw Error(u(160));$h(c,f,o),$e=null,Ot=!1,c=o.alternate,c!==null&&(c.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ph(t,e),t=t.sibling}var hl=null;function Ph(e,t){var l=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:kt(t,e),_t(e),n&4&&(ja(3,e,e.return),br(3,e),ja(5,e,e.return));break;case 1:kt(t,e),_t(e),n&512&&(it||l===null||Cl(l,l.return)),n&64&&Xl&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?n:l.concat(n))));break;case 26:var o=hl;if(kt(t,e),_t(e),n&512&&(it||l===null||Cl(l,l.return)),n&4){var c=l!==null?l.memoizedState:null;if(n=e.memoizedState,l===null)if(n===null)if(e.stateNode===null){e:{n=e.type,l=e.memoizedProps,o=o.ownerDocument||o;t:switch(n){case"title":c=o.getElementsByTagName("title")[0],(!c||c[Zi]||c[Ge]||c.namespaceURI==="http://www.w3.org/2000/svg"||c.hasAttribute("itemprop"))&&(c=o.createElement(n),o.head.insertBefore(c,o.querySelector("head > title"))),yt(c,n,l),c[Ge]=e,ct(c),n=c;break e;case"link":var f=Pp("link","href",o).get(n+(l.href||""));if(f){for(var y=0;y<f.length;y++)if(c=f[y],c.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&c.getAttribute("rel")===(l.rel==null?null:l.rel)&&c.getAttribute("title")===(l.title==null?null:l.title)&&c.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){f.splice(y,1);break t}}c=o.createElement(n),yt(c,n,l),o.head.appendChild(c);break;case"meta":if(f=Pp("meta","content",o).get(n+(l.content||""))){for(y=0;y<f.length;y++)if(c=f[y],c.getAttribute("content")===(l.content==null?null:""+l.content)&&c.getAttribute("name")===(l.name==null?null:l.name)&&c.getAttribute("property")===(l.property==null?null:l.property)&&c.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&c.getAttribute("charset")===(l.charSet==null?null:l.charSet)){f.splice(y,1);break t}}c=o.createElement(n),yt(c,n,l),o.head.appendChild(c);break;default:throw Error(u(468,n))}c[Ge]=e,ct(c),n=c}e.stateNode=n}else Wp(o,e.type,e.stateNode);else e.stateNode=Fp(o,n,e.memoizedProps);else c!==n?(c===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):c.count--,n===null?Wp(o,e.type,e.stateNode):Fp(o,n,e.memoizedProps)):n===null&&e.stateNode!==null&&zc(e,e.memoizedProps,l.memoizedProps)}break;case 27:kt(t,e),_t(e),n&512&&(it||l===null||Cl(l,l.return)),l!==null&&n&4&&zc(e,e.memoizedProps,l.memoizedProps);break;case 5:if(kt(t,e),_t(e),n&512&&(it||l===null||Cl(l,l.return)),e.flags&32){o=e.stateNode;try{Qn(o,"")}catch(ae){Be(e,e.return,ae)}}n&4&&e.stateNode!=null&&(o=e.memoizedProps,zc(e,o,l!==null?l.memoizedProps:o)),n&1024&&(kc=!0);break;case 6:if(kt(t,e),_t(e),n&4){if(e.stateNode===null)throw Error(u(162));n=e.memoizedProps,l=e.stateNode;try{l.nodeValue=n}catch(ae){Be(e,e.return,ae)}}break;case 3:if(bo=null,o=hl,hl=xo(t.containerInfo),kt(t,e),hl=o,_t(e),n&4&&l!==null&&l.memoizedState.isDehydrated)try{yi(t.containerInfo)}catch(ae){Be(e,e.return,ae)}kc&&(kc=!1,Wh(e));break;case 4:n=hl,hl=xo(e.stateNode.containerInfo),kt(t,e),_t(e),hl=n;break;case 12:kt(t,e),_t(e);break;case 31:kt(t,e),_t(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,lo(e,n)));break;case 13:kt(t,e),_t(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(no=Nt()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,lo(e,n)));break;case 22:o=e.memoizedState!==null;var S=l!==null&&l.memoizedState!==null,O=Xl,q=it;if(Xl=O||o,it=q||S,kt(t,e),it=q,Xl=O,_t(e),n&8192)e:for(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,o&&(l===null||S||Xl||it||pn(e)),l=null,t=e;;){if(t.tag===5||t.tag===26){if(l===null){S=l=t;try{if(c=S.stateNode,o)f=c.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{y=S.stateNode;var G=S.memoizedProps.style,D=G!=null&&G.hasOwnProperty("display")?G.display:null;y.style.display=D==null||typeof D=="boolean"?"":(""+D).trim()}}catch(ae){Be(S,S.return,ae)}}}else if(t.tag===6){if(l===null){S=t;try{S.stateNode.nodeValue=o?"":S.memoizedProps}catch(ae){Be(S,S.return,ae)}}}else if(t.tag===18){if(l===null){S=t;try{var H=S.stateNode;o?Qp(H,!0):Qp(S.stateNode,!1)}catch(ae){Be(S,S.return,ae)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;l===t&&(l=null),t=t.return}l===t&&(l=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(l=n.retryQueue,l!==null&&(n.retryQueue=null,lo(e,l))));break;case 19:kt(t,e),_t(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,lo(e,n)));break;case 30:break;case 21:break;default:kt(t,e),_t(e)}}function _t(e){var t=e.flags;if(t&2){try{for(var l,n=e.return;n!==null;){if(Gh(n)){l=n;break}n=n.return}if(l==null)throw Error(u(160));switch(l.tag){case 27:var o=l.stateNode,c=Rc(e);to(e,c,o);break;case 5:var f=l.stateNode;l.flags&32&&(Qn(f,""),l.flags&=-33);var y=Rc(e);to(e,y,f);break;case 3:case 4:var S=l.stateNode.containerInfo,O=Rc(e);Oc(e,O,S);break;default:throw Error(u(161))}}catch(q){Be(e,e.return,q)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Wh(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Wh(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Zl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Vh(e,t.alternate,t),t=t.sibling}function pn(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:ja(4,t,t.return),pn(t);break;case 1:Cl(t,t.return);var l=t.stateNode;typeof l.componentWillUnmount=="function"&&Qh(t,t.return,l),pn(t);break;case 27:Ar(t.stateNode);case 26:case 5:Cl(t,t.return),pn(t);break;case 22:t.memoizedState===null&&pn(t);break;case 30:pn(t);break;default:pn(t)}e=e.sibling}}function $l(e,t,l){for(l=l&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,o=e,c=t,f=c.flags;switch(c.tag){case 0:case 11:case 15:$l(o,c,l),br(4,c);break;case 1:if($l(o,c,l),n=c,o=n.stateNode,typeof o.componentDidMount=="function")try{o.componentDidMount()}catch(O){Be(n,n.return,O)}if(n=c,o=n.updateQueue,o!==null){var y=n.stateNode;try{var S=o.shared.hiddenCallbacks;if(S!==null)for(o.shared.hiddenCallbacks=null,o=0;o<S.length;o++)Am(S[o],y)}catch(O){Be(n,n.return,O)}}l&&f&64&&qh(c),gr(c,c.return);break;case 27:Kh(c);case 26:case 5:$l(o,c,l),l&&n===null&&f&4&&Yh(c),gr(c,c.return);break;case 12:$l(o,c,l);break;case 31:$l(o,c,l),l&&f&4&&Jh(o,c);break;case 13:$l(o,c,l),l&&f&4&&Fh(o,c);break;case 22:c.memoizedState===null&&$l(o,c,l),gr(c,c.return);break;case 30:break;default:$l(o,c,l)}t=t.sibling}}function _c(e,t){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&rr(l))}function Dc(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&rr(e))}function pl(e,t,l,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ih(e,t,l,n),t=t.sibling}function Ih(e,t,l,n){var o=t.flags;switch(t.tag){case 0:case 11:case 15:pl(e,t,l,n),o&2048&&br(9,t);break;case 1:pl(e,t,l,n);break;case 3:pl(e,t,l,n),o&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&rr(e)));break;case 12:if(o&2048){pl(e,t,l,n),e=t.stateNode;try{var c=t.memoizedProps,f=c.id,y=c.onPostCommit;typeof y=="function"&&y(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(S){Be(t,t.return,S)}}else pl(e,t,l,n);break;case 31:pl(e,t,l,n);break;case 13:pl(e,t,l,n);break;case 23:break;case 22:c=t.stateNode,f=t.alternate,t.memoizedState!==null?c._visibility&2?pl(e,t,l,n):jr(e,t):c._visibility&2?pl(e,t,l,n):(c._visibility|=2,si(e,t,l,n,(t.subtreeFlags&10256)!==0||!1)),o&2048&&_c(f,t);break;case 24:pl(e,t,l,n),o&2048&&Dc(t.alternate,t);break;default:pl(e,t,l,n)}}function si(e,t,l,n,o){for(o=o&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,f=t,y=l,S=n,O=f.flags;switch(f.tag){case 0:case 11:case 15:si(c,f,y,S,o),br(8,f);break;case 23:break;case 22:var q=f.stateNode;f.memoizedState!==null?q._visibility&2?si(c,f,y,S,o):jr(c,f):(q._visibility|=2,si(c,f,y,S,o)),o&&O&2048&&_c(f.alternate,f);break;case 24:si(c,f,y,S,o),o&&O&2048&&Dc(f.alternate,f);break;default:si(c,f,y,S,o)}t=t.sibling}}function jr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var l=e,n=t,o=n.flags;switch(n.tag){case 22:jr(l,n),o&2048&&_c(n.alternate,n);break;case 24:jr(l,n),o&2048&&Dc(n.alternate,n);break;default:jr(l,n)}t=t.sibling}}var Sr=8192;function oi(e,t,l){if(e.subtreeFlags&Sr)for(e=e.child;e!==null;)ep(e,t,l),e=e.sibling}function ep(e,t,l){switch(e.tag){case 26:oi(e,t,l),e.flags&Sr&&e.memoizedState!==null&&kb(l,hl,e.memoizedState,e.memoizedProps);break;case 5:oi(e,t,l);break;case 3:case 4:var n=hl;hl=xo(e.stateNode.containerInfo),oi(e,t,l),hl=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Sr,Sr=16777216,oi(e,t,l),Sr=n):oi(e,t,l));break;default:oi(e,t,l)}}function tp(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Nr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var n=t[l];dt=n,ap(n,e)}tp(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)lp(e),e=e.sibling}function lp(e){switch(e.tag){case 0:case 11:case 15:Nr(e),e.flags&2048&&ja(9,e,e.return);break;case 3:Nr(e);break;case 12:Nr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ao(e)):Nr(e);break;default:Nr(e)}}function ao(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var l=0;l<t.length;l++){var n=t[l];dt=n,ap(n,e)}tp(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:ja(8,t,t.return),ao(t);break;case 22:l=t.stateNode,l._visibility&2&&(l._visibility&=-3,ao(t));break;default:ao(t)}e=e.sibling}}function ap(e,t){for(;dt!==null;){var l=dt;switch(l.tag){case 0:case 11:case 15:ja(8,l,t);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var n=l.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:rr(l.memoizedState.cache)}if(n=l.child,n!==null)n.return=l,dt=n;else e:for(l=e;dt!==null;){n=dt;var o=n.sibling,c=n.return;if(Zh(n),n===l){dt=null;break e}if(o!==null){o.return=c,dt=o;break e}dt=c}}}var $y={getCacheForType:function(e){var t=vt(lt),l=t.data.get(e);return l===void 0&&(l=e(),t.data.set(e,l)),l},cacheSignal:function(){return vt(lt).controller.signal}},Jy=typeof WeakMap=="function"?WeakMap:Map,ke=0,Ke=null,je=null,Ne=0,Ue=0,Vt=null,Sa=!1,ui=!1,Uc=!1,Jl=0,Pe=0,Na=0,vn=0,Bc=0,Zt=0,ci=0,Mr=null,Dt=null,Hc=!1,no=0,np=0,io=1/0,ro=null,Ma=null,rt=0,wa=null,di=null,Fl=0,Lc=0,qc=null,ip=null,wr=0,Qc=null;function $t(){return(ke&2)!==0&&Ne!==0?Ne&-Ne:_.T!==null?Zc():Xi()}function rp(){if(Zt===0)if((Ne&536870912)===0||Ce){var e=Fa;Fa<<=1,(Fa&3932160)===0&&(Fa=262144),Zt=e}else Zt=536870912;return e=Kt.current,e!==null&&(e.flags|=32),Zt}function Ut(e,t,l){(e===Ke&&(Ue===2||Ue===9)||e.cancelPendingCommit!==null)&&(fi(e,0),Ta(e,Ne,Zt,!1)),oe(e,l),((ke&2)===0||e!==Ke)&&(e===Ke&&((ke&2)===0&&(vn|=l),Pe===4&&Ta(e,Ne,Zt,!1)),El(e))}function sp(e,t,l){if((ke&6)!==0)throw Error(u(327));var n=!l&&(t&127)===0&&(t&e.expiredLanes)===0||ua(e,t),o=n?Wy(e,t):Gc(e,t,!0),c=n;do{if(o===0){ui&&!n&&Ta(e,t,0,!1);break}else{if(l=e.current.alternate,c&&!Fy(l)){o=Gc(e,t,!1),c=!1;continue}if(o===2){if(c=t,e.errorRecoveryDisabledLanes&c)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var y=e;o=Mr;var S=y.current.memoizedState.isDehydrated;if(S&&(fi(y,f).flags|=256),f=Gc(y,f,!1),f!==2){if(Uc&&!S){y.errorRecoveryDisabledLanes|=c,vn|=c,o=4;break e}c=Dt,Dt=o,c!==null&&(Dt===null?Dt=c:Dt.push.apply(Dt,c))}o=f}if(c=!1,o!==2)continue}}if(o===1){fi(e,0),Ta(e,t,0,!0);break}e:{switch(n=e,c=o,c){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:Ta(n,t,Zt,!Sa);break e;case 2:Dt=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(o=no+300-Nt(),10<o)){if(Ta(n,t,Zt,!Sa),Wa(n,0,!0)!==0)break e;Fl=t,n.timeoutHandle=Hp(op.bind(null,n,l,Dt,ro,Hc,t,Zt,vn,ci,Sa,c,"Throttled",-0,0),o);break e}op(n,l,Dt,ro,Hc,t,Zt,vn,ci,Sa,c,null,-0,0)}}break}while(!0);El(e)}function op(e,t,l,n,o,c,f,y,S,O,q,G,D,H){if(e.timeoutHandle=-1,G=t.subtreeFlags,G&8192||(G&16785408)===16785408){G={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Dl},ep(t,c,G);var ae=(c&62914560)===c?no-Nt():(c&4194048)===c?np-Nt():0;if(ae=_b(G,ae),ae!==null){Fl=c,e.cancelPendingCommit=ae(vp.bind(null,e,t,c,l,n,o,f,y,S,q,G,null,D,H)),Ta(e,c,f,!O);return}}vp(e,t,c,l,n,o,f,y,S)}function Fy(e){for(var t=e;;){var l=t.tag;if((l===0||l===11||l===15)&&t.flags&16384&&(l=t.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var n=0;n<l.length;n++){var o=l[n],c=o.getSnapshot;o=o.value;try{if(!Yt(c(),o))return!1}catch{return!1}}if(l=t.child,t.subtreeFlags&16384&&l!==null)l.return=t,t=l;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ta(e,t,l,n){t&=~Bc,t&=~vn,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var o=t;0<o;){var c=31-wt(o),f=1<<c;n[c]=-1,o&=~f}l!==0&&Qt(e,l,t)}function so(){return(ke&6)===0?(Tr(0),!1):!0}function Yc(){if(je!==null){if(Ue===0)var e=je.return;else e=je,Ll=sn=null,nc(e),li=null,or=0,e=je;for(;e!==null;)Lh(e.alternate,e),e=e.return;je=null}}function fi(e,t){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,vb(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),Fl=0,Yc(),Ke=e,je=l=Bl(e.current,null),Ne=t,Ue=0,Vt=null,Sa=!1,ui=ua(e,t),Uc=!1,ci=Zt=Bc=vn=Na=Pe=0,Dt=Mr=null,Hc=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var o=31-wt(n),c=1<<o;t|=e[o],n&=~c}return Jl=t,Es(),l}function up(e,t){ve=null,_.H=vr,t===ti||t===Us?(t=wm(),Ue=3):t===Vu?(t=wm(),Ue=4):Ue=t===gc?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Vt=t,je===null&&(Pe=1,Fs(e,tl(t,e.current)))}function cp(){var e=Kt.current;return e===null?!0:(Ne&4194048)===Ne?il===null:(Ne&62914560)===Ne||(Ne&536870912)!==0?e===il:!1}function dp(){var e=_.H;return _.H=vr,e===null?vr:e}function fp(){var e=_.A;return _.A=$y,e}function oo(){Pe=4,Sa||(Ne&4194048)!==Ne&&Kt.current!==null||(ui=!0),(Na&134217727)===0&&(vn&134217727)===0||Ke===null||Ta(Ke,Ne,Zt,!1)}function Gc(e,t,l){var n=ke;ke|=2;var o=dp(),c=fp();(Ke!==e||Ne!==t)&&(ro=null,fi(e,t)),t=!1;var f=Pe;e:do try{if(Ue!==0&&je!==null){var y=je,S=Vt;switch(Ue){case 8:Yc(),f=6;break e;case 3:case 2:case 9:case 6:Kt.current===null&&(t=!0);var O=Ue;if(Ue=0,Vt=null,mi(e,y,S,O),l&&ui){f=0;break e}break;default:O=Ue,Ue=0,Vt=null,mi(e,y,S,O)}}Py(),f=Pe;break}catch(q){up(e,q)}while(!0);return t&&e.shellSuspendCounter++,Ll=sn=null,ke=n,_.H=o,_.A=c,je===null&&(Ke=null,Ne=0,Es()),f}function Py(){for(;je!==null;)mp(je)}function Wy(e,t){var l=ke;ke|=2;var n=dp(),o=fp();Ke!==e||Ne!==t?(ro=null,io=Nt()+500,fi(e,t)):ui=ua(e,t);e:do try{if(Ue!==0&&je!==null){t=je;var c=Vt;t:switch(Ue){case 1:Ue=0,Vt=null,mi(e,t,c,1);break;case 2:case 9:if(Nm(c)){Ue=0,Vt=null,hp(t);break}t=function(){Ue!==2&&Ue!==9||Ke!==e||(Ue=7),El(e)},c.then(t,t);break e;case 3:Ue=7;break e;case 4:Ue=5;break e;case 7:Nm(c)?(Ue=0,Vt=null,hp(t)):(Ue=0,Vt=null,mi(e,t,c,7));break;case 5:var f=null;switch(je.tag){case 26:f=je.memoizedState;case 5:case 27:var y=je;if(f?Ip(f):y.stateNode.complete){Ue=0,Vt=null;var S=y.sibling;if(S!==null)je=S;else{var O=y.return;O!==null?(je=O,uo(O)):je=null}break t}}Ue=0,Vt=null,mi(e,t,c,5);break;case 6:Ue=0,Vt=null,mi(e,t,c,6);break;case 8:Yc(),Pe=6;break e;default:throw Error(u(462))}}Iy();break}catch(q){up(e,q)}while(!0);return Ll=sn=null,_.H=n,_.A=o,ke=l,je!==null?0:(Ke=null,Ne=0,Es(),Pe)}function Iy(){for(;je!==null&&!os();)mp(je)}function mp(e){var t=Bh(e.alternate,e,Jl);e.memoizedProps=e.pendingProps,t===null?uo(e):je=t}function hp(e){var t=e,l=t.alternate;switch(t.tag){case 15:case 0:t=Rh(l,t,t.pendingProps,t.type,void 0,Ne);break;case 11:t=Rh(l,t,t.pendingProps,t.type.render,t.ref,Ne);break;case 5:nc(t);default:Lh(l,t),t=je=fm(t,Jl),t=Bh(l,t,Jl)}e.memoizedProps=e.pendingProps,t===null?uo(e):je=t}function mi(e,t,l,n){Ll=sn=null,nc(t),li=null,or=0;var o=t.return;try{if(Qy(e,o,t,l,Ne)){Pe=1,Fs(e,tl(l,e.current)),je=null;return}}catch(c){if(o!==null)throw je=o,c;Pe=1,Fs(e,tl(l,e.current)),je=null;return}t.flags&32768?(Ce||n===1?e=!0:ui||(Ne&536870912)!==0?e=!1:(Sa=e=!0,(n===2||n===9||n===3||n===6)&&(n=Kt.current,n!==null&&n.tag===13&&(n.flags|=16384))),pp(t,e)):uo(t)}function uo(e){var t=e;do{if((t.flags&32768)!==0){pp(t,Sa);return}e=t.return;var l=Ky(t.alternate,t,Jl);if(l!==null){je=l;return}if(t=t.sibling,t!==null){je=t;return}je=t=e}while(t!==null);Pe===0&&(Pe=5)}function pp(e,t){do{var l=Xy(e.alternate,e);if(l!==null){l.flags&=32767,je=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!t&&(e=e.sibling,e!==null)){je=e;return}je=e=l}while(e!==null);Pe=6,je=null}function vp(e,t,l,n,o,c,f,y,S){e.cancelPendingCommit=null;do co();while(rt!==0);if((ke&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(c=t.lanes|t.childLanes,c|=Ru,Ye(e,l,c,f,y,S),e===Ke&&(je=Ke=null,Ne=0),di=t,wa=e,Fl=l,Lc=c,qc=o,ip=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,ab(Rn,function(){return jp(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=_.T,_.T=null,o=$.p,$.p=2,f=ke,ke|=4;try{Vy(e,t,l)}finally{ke=f,$.p=o,_.T=n}}rt=1,xp(),yp(),bp()}}function xp(){if(rt===1){rt=0;var e=wa,t=di,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=_.T,_.T=null;var n=$.p;$.p=2;var o=ke;ke|=4;try{Ph(t,e);var c=td,f=am(e.containerInfo),y=c.focusedElem,S=c.selectionRange;if(f!==y&&y&&y.ownerDocument&&lm(y.ownerDocument.documentElement,y)){if(S!==null&&Tu(y)){var O=S.start,q=S.end;if(q===void 0&&(q=O),"selectionStart"in y)y.selectionStart=O,y.selectionEnd=Math.min(q,y.value.length);else{var G=y.ownerDocument||document,D=G&&G.defaultView||window;if(D.getSelection){var H=D.getSelection(),ae=y.textContent.length,de=Math.min(S.start,ae),qe=S.end===void 0?de:Math.min(S.end,ae);!H.extend&&de>qe&&(f=qe,qe=de,de=f);var C=tm(y,de),w=tm(y,qe);if(C&&w&&(H.rangeCount!==1||H.anchorNode!==C.node||H.anchorOffset!==C.offset||H.focusNode!==w.node||H.focusOffset!==w.offset)){var R=G.createRange();R.setStart(C.node,C.offset),H.removeAllRanges(),de>qe?(H.addRange(R),H.extend(w.node,w.offset)):(R.setEnd(w.node,w.offset),H.addRange(R))}}}}for(G=[],H=y;H=H.parentNode;)H.nodeType===1&&G.push({element:H,left:H.scrollLeft,top:H.scrollTop});for(typeof y.focus=="function"&&y.focus(),y=0;y<G.length;y++){var Y=G[y];Y.element.scrollLeft=Y.left,Y.element.scrollTop=Y.top}}No=!!ed,td=ed=null}finally{ke=o,$.p=n,_.T=l}}e.current=t,rt=2}}function yp(){if(rt===2){rt=0;var e=wa,t=di,l=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||l){l=_.T,_.T=null;var n=$.p;$.p=2;var o=ke;ke|=4;try{Vh(e,t.alternate,t)}finally{ke=o,$.p=n,_.T=l}}rt=3}}function bp(){if(rt===4||rt===3){rt=0,us();var e=wa,t=di,l=Fl,n=ip;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?rt=5:(rt=0,di=wa=null,gp(e,e.pendingLanes));var o=e.pendingLanes;if(o===0&&(Ma=null),_n(l),t=t.stateNode,Mt&&typeof Mt.onCommitFiberRoot=="function")try{Mt.onCommitFiberRoot($a,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=_.T,o=$.p,$.p=2,_.T=null;try{for(var c=e.onRecoverableError,f=0;f<n.length;f++){var y=n[f];c(y.value,{componentStack:y.stack})}}finally{_.T=t,$.p=o}}(Fl&3)!==0&&co(),El(e),o=e.pendingLanes,(l&261930)!==0&&(o&42)!==0?e===Qc?wr++:(wr=0,Qc=e):wr=0,Tr(0)}}function gp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,rr(t)))}function co(){return xp(),yp(),bp(),jp()}function jp(){if(rt!==5)return!1;var e=wa,t=Lc;Lc=0;var l=_n(Fl),n=_.T,o=$.p;try{$.p=32>l?32:l,_.T=null,l=qc,qc=null;var c=wa,f=Fl;if(rt=0,di=wa=null,Fl=0,(ke&6)!==0)throw Error(u(331));var y=ke;if(ke|=4,lp(c.current),Ih(c,c.current,f,l),ke=y,Tr(0,!1),Mt&&typeof Mt.onPostCommitFiberRoot=="function")try{Mt.onPostCommitFiberRoot($a,c)}catch{}return!0}finally{$.p=o,_.T=n,gp(e,t)}}function Sp(e,t,l){t=tl(l,t),t=bc(e.stateNode,t,2),e=ya(e,t,2),e!==null&&(oe(e,2),El(e))}function Be(e,t,l){if(e.tag===3)Sp(e,e,l);else for(;t!==null;){if(t.tag===3){Sp(t,e,l);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Ma===null||!Ma.has(n))){e=tl(l,e),l=Nh(2),n=ya(t,l,2),n!==null&&(Mh(l,n,t,e),oe(n,2),El(n));break}}t=t.return}}function Kc(e,t,l){var n=e.pingCache;if(n===null){n=e.pingCache=new Jy;var o=new Set;n.set(t,o)}else o=n.get(t),o===void 0&&(o=new Set,n.set(t,o));o.has(l)||(Uc=!0,o.add(l),e=eb.bind(null,e,t,l),t.then(e,e))}function eb(e,t,l){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Ke===e&&(Ne&l)===l&&(Pe===4||Pe===3&&(Ne&62914560)===Ne&&300>Nt()-no?(ke&2)===0&&fi(e,0):Bc|=l,ci===Ne&&(ci=0)),El(e)}function Np(e,t){t===0&&(t=Gi()),e=an(e,t),e!==null&&(oe(e,t),El(e))}function tb(e){var t=e.memoizedState,l=0;t!==null&&(l=t.retryLane),Np(e,l)}function lb(e,t){var l=0;switch(e.tag){case 31:case 13:var n=e.stateNode,o=e.memoizedState;o!==null&&(l=o.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(u(314))}n!==null&&n.delete(t),Np(e,l)}function ab(e,t){return Va(e,t)}var fo=null,hi=null,Xc=!1,mo=!1,Vc=!1,Ca=0;function El(e){e!==hi&&e.next===null&&(hi===null?fo=hi=e:hi=hi.next=e),mo=!0,Xc||(Xc=!0,ib())}function Tr(e,t){if(!Vc&&mo){Vc=!0;do for(var l=!1,n=fo;n!==null;){if(e!==0){var o=n.pendingLanes;if(o===0)var c=0;else{var f=n.suspendedLanes,y=n.pingedLanes;c=(1<<31-wt(42|e)+1)-1,c&=o&~(f&~y),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(l=!0,Cp(n,c))}else c=Ne,c=Wa(n,n===Ke?c:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(c&3)===0||ua(n,c)||(l=!0,Cp(n,c));n=n.next}while(l);Vc=!1}}function nb(){Mp()}function Mp(){mo=Xc=!1;var e=0;Ca!==0&&pb()&&(e=Ca);for(var t=Nt(),l=null,n=fo;n!==null;){var o=n.next,c=wp(n,t);c===0?(n.next=null,l===null?fo=o:l.next=o,o===null&&(hi=l)):(l=n,(e!==0||(c&3)!==0)&&(mo=!0)),n=o}rt!==0&&rt!==5||Tr(e),Ca!==0&&(Ca=0)}function wp(e,t){for(var l=e.suspendedLanes,n=e.pingedLanes,o=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var f=31-wt(c),y=1<<f,S=o[f];S===-1?((y&l)===0||(y&n)!==0)&&(o[f]=vs(y,t)):S<=t&&(e.expiredLanes|=y),c&=~y}if(t=Ke,l=Ne,l=Wa(e,e===t?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,l===0||e===t&&(Ue===2||Ue===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&Za(n),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||ua(e,l)){if(t=l&-l,t===e.callbackPriority)return t;switch(n!==null&&Za(n),_n(l)){case 2:case 8:l=ds;break;case 32:l=Rn;break;case 268435456:l=fs;break;default:l=Rn}return n=Tp.bind(null,e),l=Va(l,n),e.callbackPriority=t,e.callbackNode=l,t}return n!==null&&n!==null&&Za(n),e.callbackPriority=2,e.callbackNode=null,2}function Tp(e,t){if(rt!==0&&rt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(co()&&e.callbackNode!==l)return null;var n=Ne;return n=Wa(e,e===Ke?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(sp(e,n,t),wp(e,Nt()),e.callbackNode!=null&&e.callbackNode===l?Tp.bind(null,e):null)}function Cp(e,t){if(co())return null;sp(e,t,!0)}function ib(){xb(function(){(ke&6)!==0?Va(cs,nb):Mp()})}function Zc(){if(Ca===0){var e=In;e===0&&(e=Ja,Ja<<=1,(Ja&261888)===0&&(Ja=256)),Ca=e}return Ca}function Ep(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:gs(""+e)}function Ap(e,t){var l=t.ownerDocument.createElement("input");return l.name=t.name,l.value=t.value,e.id&&l.setAttribute("form",e.id),t.parentNode.insertBefore(l,t),e=new FormData(e),l.parentNode.removeChild(l),e}function rb(e,t,l,n,o){if(t==="submit"&&l&&l.stateNode===o){var c=Ep((o[tt]||null).action),f=n.submitter;f&&(t=(t=f[tt]||null)?Ep(t.formAction):f.getAttribute("formAction"),t!==null&&(c=t,f=null));var y=new Ms("action","action",null,n,o);e.push({event:y,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Ca!==0){var S=f?Ap(o,f):new FormData(o);mc(l,{pending:!0,data:S,method:o.method,action:c},null,S)}}else typeof c=="function"&&(y.preventDefault(),S=f?Ap(o,f):new FormData(o),mc(l,{pending:!0,data:S,method:o.method,action:c},c,S))},currentTarget:o}]})}}for(var $c=0;$c<zu.length;$c++){var Jc=zu[$c],sb=Jc.toLowerCase(),ob=Jc[0].toUpperCase()+Jc.slice(1);ml(sb,"on"+ob)}ml(rm,"onAnimationEnd"),ml(sm,"onAnimationIteration"),ml(om,"onAnimationStart"),ml("dblclick","onDoubleClick"),ml("focusin","onFocus"),ml("focusout","onBlur"),ml(My,"onTransitionRun"),ml(wy,"onTransitionStart"),ml(Ty,"onTransitionCancel"),ml(um,"onTransitionEnd"),Ln("onMouseEnter",["mouseout","mouseover"]),Ln("onMouseLeave",["mouseout","mouseover"]),Ln("onPointerEnter",["pointerout","pointerover"]),Ln("onPointerLeave",["pointerout","pointerover"]),Ia("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ia("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ia("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ia("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ia("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ia("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Cr="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),ub=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Cr));function zp(e,t){t=(t&4)!==0;for(var l=0;l<e.length;l++){var n=e[l],o=n.event;n=n.listeners;e:{var c=void 0;if(t)for(var f=n.length-1;0<=f;f--){var y=n[f],S=y.instance,O=y.currentTarget;if(y=y.listener,S!==c&&o.isPropagationStopped())break e;c=y,o.currentTarget=O;try{c(o)}catch(q){Cs(q)}o.currentTarget=null,c=S}else for(f=0;f<n.length;f++){if(y=n[f],S=y.instance,O=y.currentTarget,y=y.listener,S!==c&&o.isPropagationStopped())break e;c=y,o.currentTarget=O;try{c(o)}catch(q){Cs(q)}o.currentTarget=null,c=S}}}}function Se(e,t){var l=t[ou];l===void 0&&(l=t[ou]=new Set);var n=e+"__bubble";l.has(n)||(Rp(t,e,2,!1),l.add(n))}function Fc(e,t,l){var n=0;t&&(n|=4),Rp(l,e,n,t)}var ho="_reactListening"+Math.random().toString(36).slice(2);function Pc(e){if(!e[ho]){e[ho]=!0,Mf.forEach(function(l){l!=="selectionchange"&&(ub.has(l)||Fc(l,!1,e),Fc(l,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ho]||(t[ho]=!0,Fc("selectionchange",!1,t))}}function Rp(e,t,l,n){switch(rv(t)){case 2:var o=Bb;break;case 8:o=Hb;break;default:o=fd}l=o.bind(null,t,l,e),o=void 0,!xu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(o=!0),n?o!==void 0?e.addEventListener(t,l,{capture:!0,passive:o}):e.addEventListener(t,l,!0):o!==void 0?e.addEventListener(t,l,{passive:o}):e.addEventListener(t,l,!1)}function Wc(e,t,l,n,o){var c=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var f=n.tag;if(f===3||f===4){var y=n.stateNode.containerInfo;if(y===o)break;if(f===4)for(f=n.return;f!==null;){var S=f.tag;if((S===3||S===4)&&f.stateNode.containerInfo===o)return;f=f.return}for(;y!==null;){if(f=Un(y),f===null)return;if(S=f.tag,S===5||S===6||S===26||S===27){n=c=f;continue e}y=y.parentNode}}n=n.return}Uf(function(){var O=c,q=pu(l),G=[];e:{var D=cm.get(e);if(D!==void 0){var H=Ms,ae=e;switch(e){case"keypress":if(Ss(l)===0)break e;case"keydown":case"keyup":H=ly;break;case"focusin":ae="focus",H=ju;break;case"focusout":ae="blur",H=ju;break;case"beforeblur":case"afterblur":H=ju;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":H=Lf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":H=K0;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":H=iy;break;case rm:case sm:case om:H=Z0;break;case um:H=sy;break;case"scroll":case"scrollend":H=Y0;break;case"wheel":H=uy;break;case"copy":case"cut":case"paste":H=J0;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":H=Qf;break;case"toggle":case"beforetoggle":H=dy}var de=(t&4)!==0,qe=!de&&(e==="scroll"||e==="scrollend"),C=de?D!==null?D+"Capture":null:D;de=[];for(var w=O,R;w!==null;){var Y=w;if(R=Y.stateNode,Y=Y.tag,Y!==5&&Y!==26&&Y!==27||R===null||C===null||(Y=Ji(w,C),Y!=null&&de.push(Er(w,Y,R))),qe)break;w=w.return}0<de.length&&(D=new H(D,ae,null,l,q),G.push({event:D,listeners:de}))}}if((t&7)===0){e:{if(D=e==="mouseover"||e==="pointerover",H=e==="mouseout"||e==="pointerout",D&&l!==hu&&(ae=l.relatedTarget||l.fromElement)&&(Un(ae)||ae[Dn]))break e;if((H||D)&&(D=q.window===q?q:(D=q.ownerDocument)?D.defaultView||D.parentWindow:window,H?(ae=l.relatedTarget||l.toElement,H=O,ae=ae?Un(ae):null,ae!==null&&(qe=m(ae),de=ae.tag,ae!==qe||de!==5&&de!==27&&de!==6)&&(ae=null)):(H=null,ae=O),H!==ae)){if(de=Lf,Y="onMouseLeave",C="onMouseEnter",w="mouse",(e==="pointerout"||e==="pointerover")&&(de=Qf,Y="onPointerLeave",C="onPointerEnter",w="pointer"),qe=H==null?D:$i(H),R=ae==null?D:$i(ae),D=new de(Y,w+"leave",H,l,q),D.target=qe,D.relatedTarget=R,Y=null,Un(q)===O&&(de=new de(C,w+"enter",ae,l,q),de.target=R,de.relatedTarget=qe,Y=de),qe=Y,H&&ae)t:{for(de=cb,C=H,w=ae,R=0,Y=C;Y;Y=de(Y))R++;Y=0;for(var ce=w;ce;ce=de(ce))Y++;for(;0<R-Y;)C=de(C),R--;for(;0<Y-R;)w=de(w),Y--;for(;R--;){if(C===w||w!==null&&C===w.alternate){de=C;break t}C=de(C),w=de(w)}de=null}else de=null;H!==null&&Op(G,D,H,de,!1),ae!==null&&qe!==null&&Op(G,qe,ae,de,!0)}}e:{if(D=O?$i(O):window,H=D.nodeName&&D.nodeName.toLowerCase(),H==="select"||H==="input"&&D.type==="file")var Re=Jf;else if(Zf(D))if(Ff)Re=jy;else{Re=by;var ie=yy}else H=D.nodeName,!H||H.toLowerCase()!=="input"||D.type!=="checkbox"&&D.type!=="radio"?O&&mu(O.elementType)&&(Re=Jf):Re=gy;if(Re&&(Re=Re(e,O))){$f(G,Re,l,q);break e}ie&&ie(e,D,O),e==="focusout"&&O&&D.type==="number"&&O.memoizedProps.value!=null&&fu(D,"number",D.value)}switch(ie=O?$i(O):window,e){case"focusin":(Zf(ie)||ie.contentEditable==="true")&&(Xn=ie,Cu=O,ar=null);break;case"focusout":ar=Cu=Xn=null;break;case"mousedown":Eu=!0;break;case"contextmenu":case"mouseup":case"dragend":Eu=!1,nm(G,l,q);break;case"selectionchange":if(Ny)break;case"keydown":case"keyup":nm(G,l,q)}var xe;if(Nu)e:{switch(e){case"compositionstart":var Me="onCompositionStart";break e;case"compositionend":Me="onCompositionEnd";break e;case"compositionupdate":Me="onCompositionUpdate";break e}Me=void 0}else Kn?Xf(e,l)&&(Me="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(Me="onCompositionStart");Me&&(Yf&&l.locale!=="ko"&&(Kn||Me!=="onCompositionStart"?Me==="onCompositionEnd"&&Kn&&(xe=Bf()):(da=q,yu="value"in da?da.value:da.textContent,Kn=!0)),ie=po(O,Me),0<ie.length&&(Me=new qf(Me,e,null,l,q),G.push({event:Me,listeners:ie}),xe?Me.data=xe:(xe=Vf(l),xe!==null&&(Me.data=xe)))),(xe=my?hy(e,l):py(e,l))&&(Me=po(O,"onBeforeInput"),0<Me.length&&(ie=new qf("onBeforeInput","beforeinput",null,l,q),G.push({event:ie,listeners:Me}),ie.data=xe)),rb(G,e,O,l,q)}zp(G,t)})}function Er(e,t,l){return{instance:e,listener:t,currentTarget:l}}function po(e,t){for(var l=t+"Capture",n=[];e!==null;){var o=e,c=o.stateNode;if(o=o.tag,o!==5&&o!==26&&o!==27||c===null||(o=Ji(e,l),o!=null&&n.unshift(Er(e,o,c)),o=Ji(e,t),o!=null&&n.push(Er(e,o,c))),e.tag===3)return n;e=e.return}return[]}function cb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Op(e,t,l,n,o){for(var c=t._reactName,f=[];l!==null&&l!==n;){var y=l,S=y.alternate,O=y.stateNode;if(y=y.tag,S!==null&&S===n)break;y!==5&&y!==26&&y!==27||O===null||(S=O,o?(O=Ji(l,c),O!=null&&f.unshift(Er(l,O,S))):o||(O=Ji(l,c),O!=null&&f.push(Er(l,O,S)))),l=l.return}f.length!==0&&e.push({event:t,listeners:f})}var db=/\r\n?/g,fb=/\u0000|\uFFFD/g;function kp(e){return(typeof e=="string"?e:""+e).replace(db,`
49
+ `).replace(fb,"")}function _p(e,t){return t=kp(t),kp(e)===t}function Le(e,t,l,n,o,c){switch(l){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Qn(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Qn(e,""+n);break;case"className":ys(e,"class",n);break;case"tabIndex":ys(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":ys(e,l,n);break;case"style":_f(e,n,c);break;case"data":if(t!=="object"){ys(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||l!=="href")){e.removeAttribute(l);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(l);break}n=gs(""+n),e.setAttribute(l,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof c=="function"&&(l==="formAction"?(t!=="input"&&Le(e,t,"name",o.name,o,null),Le(e,t,"formEncType",o.formEncType,o,null),Le(e,t,"formMethod",o.formMethod,o,null),Le(e,t,"formTarget",o.formTarget,o,null)):(Le(e,t,"encType",o.encType,o,null),Le(e,t,"method",o.method,o,null),Le(e,t,"target",o.target,o,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(l);break}n=gs(""+n),e.setAttribute(l,n);break;case"onClick":n!=null&&(e.onclick=Dl);break;case"onScroll":n!=null&&Se("scroll",e);break;case"onScrollEnd":n!=null&&Se("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(u(61));if(l=n.__html,l!=null){if(o.children!=null)throw Error(u(60));e.innerHTML=l}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}l=gs(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,""+n):e.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":n===!0?e.setAttribute(l,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(l,n):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(l,n):e.removeAttribute(l);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(l):e.setAttribute(l,n);break;case"popover":Se("beforetoggle",e),Se("toggle",e),xs(e,"popover",n);break;case"xlinkActuate":_l(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":_l(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":_l(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":_l(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":_l(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":_l(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":_l(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":_l(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":_l(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":xs(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=q0.get(l)||l,xs(e,l,n))}}function Ic(e,t,l,n,o,c){switch(l){case"style":_f(e,n,c);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(u(61));if(l=n.__html,l!=null){if(o.children!=null)throw Error(u(60));e.innerHTML=l}}break;case"children":typeof n=="string"?Qn(e,n):(typeof n=="number"||typeof n=="bigint")&&Qn(e,""+n);break;case"onScroll":n!=null&&Se("scroll",e);break;case"onScrollEnd":n!=null&&Se("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Dl);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!wf.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(o=l.endsWith("Capture"),t=l.slice(2,o?l.length-7:void 0),c=e[tt]||null,c=c!=null?c[l]:null,typeof c=="function"&&e.removeEventListener(t,c,o),typeof n=="function")){typeof c!="function"&&c!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(t,n,o);break e}l in e?e[l]=n:n===!0?e.setAttribute(l,""):xs(e,l,n)}}}function yt(e,t,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Se("error",e),Se("load",e);var n=!1,o=!1,c;for(c in l)if(l.hasOwnProperty(c)){var f=l[c];if(f!=null)switch(c){case"src":n=!0;break;case"srcSet":o=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Le(e,t,c,f,l,null)}}o&&Le(e,t,"srcSet",l.srcSet,l,null),n&&Le(e,t,"src",l.src,l,null);return;case"input":Se("invalid",e);var y=c=f=o=null,S=null,O=null;for(n in l)if(l.hasOwnProperty(n)){var q=l[n];if(q!=null)switch(n){case"name":o=q;break;case"type":f=q;break;case"checked":S=q;break;case"defaultChecked":O=q;break;case"value":c=q;break;case"defaultValue":y=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(u(137,t));break;default:Le(e,t,n,q,l,null)}}zf(e,c,y,S,O,f,o,!1);return;case"select":Se("invalid",e),n=f=c=null;for(o in l)if(l.hasOwnProperty(o)&&(y=l[o],y!=null))switch(o){case"value":c=y;break;case"defaultValue":f=y;break;case"multiple":n=y;default:Le(e,t,o,y,l,null)}t=c,l=f,e.multiple=!!n,t!=null?qn(e,!!n,t,!1):l!=null&&qn(e,!!n,l,!0);return;case"textarea":Se("invalid",e),c=o=n=null;for(f in l)if(l.hasOwnProperty(f)&&(y=l[f],y!=null))switch(f){case"value":n=y;break;case"defaultValue":o=y;break;case"children":c=y;break;case"dangerouslySetInnerHTML":if(y!=null)throw Error(u(91));break;default:Le(e,t,f,y,l,null)}Of(e,n,o,c);return;case"option":for(S in l)if(l.hasOwnProperty(S)&&(n=l[S],n!=null))switch(S){case"selected":e.selected=n&&typeof n!="function"&&typeof n!="symbol";break;default:Le(e,t,S,n,l,null)}return;case"dialog":Se("beforetoggle",e),Se("toggle",e),Se("cancel",e),Se("close",e);break;case"iframe":case"object":Se("load",e);break;case"video":case"audio":for(n=0;n<Cr.length;n++)Se(Cr[n],e);break;case"image":Se("error",e),Se("load",e);break;case"details":Se("toggle",e);break;case"embed":case"source":case"link":Se("error",e),Se("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(O in l)if(l.hasOwnProperty(O)&&(n=l[O],n!=null))switch(O){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Le(e,t,O,n,l,null)}return;default:if(mu(t)){for(q in l)l.hasOwnProperty(q)&&(n=l[q],n!==void 0&&Ic(e,t,q,n,l,void 0));return}}for(y in l)l.hasOwnProperty(y)&&(n=l[y],n!=null&&Le(e,t,y,n,l,null))}function mb(e,t,l,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var o=null,c=null,f=null,y=null,S=null,O=null,q=null;for(H in l){var G=l[H];if(l.hasOwnProperty(H)&&G!=null)switch(H){case"checked":break;case"value":break;case"defaultValue":S=G;default:n.hasOwnProperty(H)||Le(e,t,H,null,n,G)}}for(var D in n){var H=n[D];if(G=l[D],n.hasOwnProperty(D)&&(H!=null||G!=null))switch(D){case"type":c=H;break;case"name":o=H;break;case"checked":O=H;break;case"defaultChecked":q=H;break;case"value":f=H;break;case"defaultValue":y=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(u(137,t));break;default:H!==G&&Le(e,t,D,H,n,G)}}du(e,f,y,S,O,q,c,o);return;case"select":H=f=y=D=null;for(c in l)if(S=l[c],l.hasOwnProperty(c)&&S!=null)switch(c){case"value":break;case"multiple":H=S;default:n.hasOwnProperty(c)||Le(e,t,c,null,n,S)}for(o in n)if(c=n[o],S=l[o],n.hasOwnProperty(o)&&(c!=null||S!=null))switch(o){case"value":D=c;break;case"defaultValue":y=c;break;case"multiple":f=c;default:c!==S&&Le(e,t,o,c,n,S)}t=y,l=f,n=H,D!=null?qn(e,!!l,D,!1):!!n!=!!l&&(t!=null?qn(e,!!l,t,!0):qn(e,!!l,l?[]:"",!1));return;case"textarea":H=D=null;for(y in l)if(o=l[y],l.hasOwnProperty(y)&&o!=null&&!n.hasOwnProperty(y))switch(y){case"value":break;case"children":break;default:Le(e,t,y,null,n,o)}for(f in n)if(o=n[f],c=l[f],n.hasOwnProperty(f)&&(o!=null||c!=null))switch(f){case"value":D=o;break;case"defaultValue":H=o;break;case"children":break;case"dangerouslySetInnerHTML":if(o!=null)throw Error(u(91));break;default:o!==c&&Le(e,t,f,o,n,c)}Rf(e,D,H);return;case"option":for(var ae in l)if(D=l[ae],l.hasOwnProperty(ae)&&D!=null&&!n.hasOwnProperty(ae))switch(ae){case"selected":e.selected=!1;break;default:Le(e,t,ae,null,n,D)}for(S in n)if(D=n[S],H=l[S],n.hasOwnProperty(S)&&D!==H&&(D!=null||H!=null))switch(S){case"selected":e.selected=D&&typeof D!="function"&&typeof D!="symbol";break;default:Le(e,t,S,D,n,H)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var de in l)D=l[de],l.hasOwnProperty(de)&&D!=null&&!n.hasOwnProperty(de)&&Le(e,t,de,null,n,D);for(O in n)if(D=n[O],H=l[O],n.hasOwnProperty(O)&&D!==H&&(D!=null||H!=null))switch(O){case"children":case"dangerouslySetInnerHTML":if(D!=null)throw Error(u(137,t));break;default:Le(e,t,O,D,n,H)}return;default:if(mu(t)){for(var qe in l)D=l[qe],l.hasOwnProperty(qe)&&D!==void 0&&!n.hasOwnProperty(qe)&&Ic(e,t,qe,void 0,n,D);for(q in n)D=n[q],H=l[q],!n.hasOwnProperty(q)||D===H||D===void 0&&H===void 0||Ic(e,t,q,D,n,H);return}}for(var C in l)D=l[C],l.hasOwnProperty(C)&&D!=null&&!n.hasOwnProperty(C)&&Le(e,t,C,null,n,D);for(G in n)D=n[G],H=l[G],!n.hasOwnProperty(G)||D===H||D==null&&H==null||Le(e,t,G,D,n,H)}function Dp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function hb(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,l=performance.getEntriesByType("resource"),n=0;n<l.length;n++){var o=l[n],c=o.transferSize,f=o.initiatorType,y=o.duration;if(c&&y&&Dp(f)){for(f=0,y=o.responseEnd,n+=1;n<l.length;n++){var S=l[n],O=S.startTime;if(O>y)break;var q=S.transferSize,G=S.initiatorType;q&&Dp(G)&&(S=S.responseEnd,f+=q*(S<y?1:(y-O)/(S-O)))}if(--n,t+=8*(c+f)/(o.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var ed=null,td=null;function vo(e){return e.nodeType===9?e:e.ownerDocument}function Up(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Bp(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function ld(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var ad=null;function pb(){var e=window.event;return e&&e.type==="popstate"?e===ad?!1:(ad=e,!0):(ad=null,!1)}var Hp=typeof setTimeout=="function"?setTimeout:void 0,vb=typeof clearTimeout=="function"?clearTimeout:void 0,Lp=typeof Promise=="function"?Promise:void 0,xb=typeof queueMicrotask=="function"?queueMicrotask:typeof Lp<"u"?function(e){return Lp.resolve(null).then(e).catch(yb)}:Hp;function yb(e){setTimeout(function(){throw e})}function Ea(e){return e==="head"}function qp(e,t){var l=t,n=0;do{var o=l.nextSibling;if(e.removeChild(l),o&&o.nodeType===8)if(l=o.data,l==="/$"||l==="/&"){if(n===0){e.removeChild(o),yi(t);return}n--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")n++;else if(l==="html")Ar(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Ar(l);for(var c=l.firstChild;c;){var f=c.nextSibling,y=c.nodeName;c[Zi]||y==="SCRIPT"||y==="STYLE"||y==="LINK"&&c.rel.toLowerCase()==="stylesheet"||l.removeChild(c),c=f}}else l==="body"&&Ar(e.ownerDocument.body);l=o}while(l);yi(t)}function Qp(e,t){var l=e;e=0;do{var n=l.nextSibling;if(l.nodeType===1?t?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(t?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),n&&n.nodeType===8)if(l=n.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=n}while(l)}function nd(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var l=t;switch(t=t.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":nd(l),uu(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function bb(e,t,l,n){for(;e.nodeType===1;){var o=l;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[Zi])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==o.rel||e.getAttribute("href")!==(o.href==null||o.href===""?null:o.href)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin)||e.getAttribute("title")!==(o.title==null?null:o.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(c=e.getAttribute("src"),(c!==(o.src==null?null:o.src)||e.getAttribute("type")!==(o.type==null?null:o.type)||e.getAttribute("crossorigin")!==(o.crossOrigin==null?null:o.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=o.name==null?null:""+o.name;if(o.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=rl(e.nextSibling),e===null)break}return null}function gb(e,t,l){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=rl(e.nextSibling),e===null))return null;return e}function Yp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=rl(e.nextSibling),e===null))return null;return e}function id(e){return e.data==="$?"||e.data==="$~"}function rd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function jb(e,t){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||l.readyState!=="loading")t();else{var n=function(){t(),l.removeEventListener("DOMContentLoaded",n)};l.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function rl(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var sd=null;function Gp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(t===0)return rl(e.nextSibling);t--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||t++}e=e.nextSibling}return null}function Kp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(t===0)return e;t--}else l!=="/$"&&l!=="/&"||t++}e=e.previousSibling}return null}function Xp(e,t,l){switch(t=vo(l),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function Ar(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);uu(e)}var sl=new Map,Vp=new Set;function xo(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Pl=$.d;$.d={f:Sb,r:Nb,D:Mb,C:wb,L:Tb,m:Cb,X:Ab,S:Eb,M:zb};function Sb(){var e=Pl.f(),t=so();return e||t}function Nb(e){var t=Bn(e);t!==null&&t.tag===5&&t.type==="form"?uh(t):Pl.r(e)}var pi=typeof document>"u"?null:document;function Zp(e,t,l){var n=pi;if(n&&typeof t=="string"&&t){var o=It(t);o='link[rel="'+e+'"][href="'+o+'"]',typeof l=="string"&&(o+='[crossorigin="'+l+'"]'),Vp.has(o)||(Vp.add(o),e={rel:e,crossOrigin:l,href:t},n.querySelector(o)===null&&(t=n.createElement("link"),yt(t,"link",e),ct(t),n.head.appendChild(t)))}}function Mb(e){Pl.D(e),Zp("dns-prefetch",e,null)}function wb(e,t){Pl.C(e,t),Zp("preconnect",e,t)}function Tb(e,t,l){Pl.L(e,t,l);var n=pi;if(n&&e&&t){var o='link[rel="preload"][as="'+It(t)+'"]';t==="image"&&l&&l.imageSrcSet?(o+='[imagesrcset="'+It(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(o+='[imagesizes="'+It(l.imageSizes)+'"]')):o+='[href="'+It(e)+'"]';var c=o;switch(t){case"style":c=vi(e);break;case"script":c=xi(e)}sl.has(c)||(e=b({rel:"preload",href:t==="image"&&l&&l.imageSrcSet?void 0:e,as:t},l),sl.set(c,e),n.querySelector(o)!==null||t==="style"&&n.querySelector(zr(c))||t==="script"&&n.querySelector(Rr(c))||(t=n.createElement("link"),yt(t,"link",e),ct(t),n.head.appendChild(t)))}}function Cb(e,t){Pl.m(e,t);var l=pi;if(l&&e){var n=t&&typeof t.as=="string"?t.as:"script",o='link[rel="modulepreload"][as="'+It(n)+'"][href="'+It(e)+'"]',c=o;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=xi(e)}if(!sl.has(c)&&(e=b({rel:"modulepreload",href:e},t),sl.set(c,e),l.querySelector(o)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Rr(c)))return}n=l.createElement("link"),yt(n,"link",e),ct(n),l.head.appendChild(n)}}}function Eb(e,t,l){Pl.S(e,t,l);var n=pi;if(n&&e){var o=Hn(n).hoistableStyles,c=vi(e);t=t||"default";var f=o.get(c);if(!f){var y={loading:0,preload:null};if(f=n.querySelector(zr(c)))y.loading=5;else{e=b({rel:"stylesheet",href:e,"data-precedence":t},l),(l=sl.get(c))&&od(e,l);var S=f=n.createElement("link");ct(S),yt(S,"link",e),S._p=new Promise(function(O,q){S.onload=O,S.onerror=q}),S.addEventListener("load",function(){y.loading|=1}),S.addEventListener("error",function(){y.loading|=2}),y.loading|=4,yo(f,t,n)}f={type:"stylesheet",instance:f,count:1,state:y},o.set(c,f)}}}function Ab(e,t){Pl.X(e,t);var l=pi;if(l&&e){var n=Hn(l).hoistableScripts,o=xi(e),c=n.get(o);c||(c=l.querySelector(Rr(o)),c||(e=b({src:e,async:!0},t),(t=sl.get(o))&&ud(e,t),c=l.createElement("script"),ct(c),yt(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},n.set(o,c))}}function zb(e,t){Pl.M(e,t);var l=pi;if(l&&e){var n=Hn(l).hoistableScripts,o=xi(e),c=n.get(o);c||(c=l.querySelector(Rr(o)),c||(e=b({src:e,async:!0,type:"module"},t),(t=sl.get(o))&&ud(e,t),c=l.createElement("script"),ct(c),yt(c,"link",e),l.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},n.set(o,c))}}function $p(e,t,l,n){var o=(o=le.current)?xo(o):null;if(!o)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(t=vi(l.href),l=Hn(o).hoistableStyles,n=l.get(t),n||(n={type:"style",instance:null,count:0,state:null},l.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=vi(l.href);var c=Hn(o).hoistableStyles,f=c.get(e);if(f||(o=o.ownerDocument||o,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,f),(c=o.querySelector(zr(e)))&&!c._p&&(f.instance=c,f.state.loading=5),sl.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},sl.set(e,l),c||Rb(o,e,l,f.state))),t&&n===null)throw Error(u(528,""));return f}if(t&&n!==null)throw Error(u(529,""));return null;case"script":return t=l.async,l=l.src,typeof l=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=xi(l),l=Hn(o).hoistableScripts,n=l.get(t),n||(n={type:"script",instance:null,count:0,state:null},l.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function vi(e){return'href="'+It(e)+'"'}function zr(e){return'link[rel="stylesheet"]['+e+"]"}function Jp(e){return b({},e,{"data-precedence":e.precedence,precedence:null})}function Rb(e,t,l,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),yt(t,"link",l),ct(t),e.head.appendChild(t))}function xi(e){return'[src="'+It(e)+'"]'}function Rr(e){return"script[async]"+e}function Fp(e,t,l){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+It(l.href)+'"]');if(n)return t.instance=n,ct(n),n;var o=b({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),ct(n),yt(n,"style",o),yo(n,l.precedence,e),t.instance=n;case"stylesheet":o=vi(l.href);var c=e.querySelector(zr(o));if(c)return t.state.loading|=4,t.instance=c,ct(c),c;n=Jp(l),(o=sl.get(o))&&od(n,o),c=(e.ownerDocument||e).createElement("link"),ct(c);var f=c;return f._p=new Promise(function(y,S){f.onload=y,f.onerror=S}),yt(c,"link",n),t.state.loading|=4,yo(c,l.precedence,e),t.instance=c;case"script":return c=xi(l.src),(o=e.querySelector(Rr(c)))?(t.instance=o,ct(o),o):(n=l,(o=sl.get(c))&&(n=b({},l),ud(n,o)),e=e.ownerDocument||e,o=e.createElement("script"),ct(o),yt(o,"link",n),e.head.appendChild(o),t.instance=o);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,yo(n,l.precedence,e));return t.instance}function yo(e,t,l){for(var n=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),o=n.length?n[n.length-1]:null,c=o,f=0;f<n.length;f++){var y=n[f];if(y.dataset.precedence===t)c=y;else if(c!==o)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=l.nodeType===9?l.head:l,t.insertBefore(e,t.firstChild))}function od(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function ud(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var bo=null;function Pp(e,t,l){if(bo===null){var n=new Map,o=bo=new Map;o.set(l,n)}else o=bo,n=o.get(l),n||(n=new Map,o.set(l,n));if(n.has(e))return n;for(n.set(e,null),l=l.getElementsByTagName(e),o=0;o<l.length;o++){var c=l[o];if(!(c[Zi]||c[Ge]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var f=c.getAttribute(t)||"";f=e+f;var y=n.get(f);y?y.push(c):n.set(f,[c])}}return n}function Wp(e,t,l){e=e.ownerDocument||e,e.head.insertBefore(l,t==="title"?e.querySelector("head > title"):null)}function Ob(e,t,l){if(l===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Ip(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function kb(e,t,l,n){if(l.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var o=vi(n.href),c=t.querySelector(zr(o));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=go.bind(e),t.then(e,e)),l.state.loading|=4,l.instance=c,ct(c);return}c=t.ownerDocument||t,n=Jp(n),(o=sl.get(o))&&od(n,o),c=c.createElement("link"),ct(c);var f=c;f._p=new Promise(function(y,S){f.onload=y,f.onerror=S}),yt(c,"link",n),l.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,t),(t=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=go.bind(e),t.addEventListener("load",l),t.addEventListener("error",l))}}var cd=0;function _b(e,t){return e.stylesheets&&e.count===0&&So(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var n=setTimeout(function(){if(e.stylesheets&&So(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&cd===0&&(cd=62500*hb());var o=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&So(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>cd?50:800)+t);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(o)}}:null}function go(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)So(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var jo=null;function So(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,jo=new Map,t.forEach(Db,e),jo=null,go.call(e))}function Db(e,t){if(!(t.state.loading&4)){var l=jo.get(e);if(l)var n=l.get(null);else{l=new Map,jo.set(e,l);for(var o=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<o.length;c++){var f=o[c];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(l.set(f.dataset.precedence,f),n=f)}n&&l.set(null,n)}o=t.instance,f=o.getAttribute("data-precedence"),c=l.get(f)||n,c===n&&l.set(null,o),l.set(f,o),this.count++,n=go.bind(this),o.addEventListener("load",n),o.addEventListener("error",n),c?c.parentNode.insertBefore(o,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(o,e.firstChild)),t.state.loading|=4}}var Or={$$typeof:K,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function Ub(e,t,l,n,o,c,f,y,S){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=On(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=On(0),this.hiddenUpdates=On(null),this.identifierPrefix=n,this.onUncaughtError=o,this.onCaughtError=c,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function ev(e,t,l,n,o,c,f,y,S,O,q,G){return e=new Ub(e,t,l,f,S,O,q,G,y),t=1,c===!0&&(t|=24),c=Gt(3,null,null,t),e.current=c,c.stateNode=e,t=Gu(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:n,isDehydrated:l,cache:t},Zu(c),e}function tv(e){return e?(e=$n,e):$n}function lv(e,t,l,n,o,c){o=tv(o),n.context===null?n.context=o:n.pendingContext=o,n=xa(t),n.payload={element:l},c=c===void 0?null:c,c!==null&&(n.callback=c),l=ya(e,n,t),l!==null&&(Ut(l,e,t),cr(l,e,t))}function av(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<t?l:t}}function dd(e,t){av(e,t),(e=e.alternate)&&av(e,t)}function nv(e){if(e.tag===13||e.tag===31){var t=an(e,67108864);t!==null&&Ut(t,e,67108864),dd(e,67108864)}}function iv(e){if(e.tag===13||e.tag===31){var t=$t();t=kn(t);var l=an(e,t);l!==null&&Ut(l,e,t),dd(e,t)}}var No=!0;function Bb(e,t,l,n){var o=_.T;_.T=null;var c=$.p;try{$.p=2,fd(e,t,l,n)}finally{$.p=c,_.T=o}}function Hb(e,t,l,n){var o=_.T;_.T=null;var c=$.p;try{$.p=8,fd(e,t,l,n)}finally{$.p=c,_.T=o}}function fd(e,t,l,n){if(No){var o=md(n);if(o===null)Wc(e,t,n,Mo,l),sv(e,n);else if(qb(o,e,t,l,n))n.stopPropagation();else if(sv(e,n),t&4&&-1<Lb.indexOf(e)){for(;o!==null;){var c=Bn(o);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var f=Ml(c.pendingLanes);if(f!==0){var y=c;for(y.pendingLanes|=2,y.entangledLanes|=2;f;){var S=1<<31-wt(f);y.entanglements[1]|=S,f&=~S}El(c),(ke&6)===0&&(io=Nt()+500,Tr(0))}}break;case 31:case 13:y=an(c,2),y!==null&&Ut(y,c,2),so(),dd(c,2)}if(c=md(n),c===null&&Wc(e,t,n,Mo,l),c===o)break;o=c}o!==null&&n.stopPropagation()}else Wc(e,t,n,null,l)}}function md(e){return e=pu(e),hd(e)}var Mo=null;function hd(e){if(Mo=null,e=Un(e),e!==null){var t=m(e);if(t===null)e=null;else{var l=t.tag;if(l===13){if(e=h(t),e!==null)return e;e=null}else if(l===31){if(e=x(t),e!==null)return e;e=null}else if(l===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Mo=e,null}function rv(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(nu()){case cs:return 2;case ds:return 8;case Rn:case iu:return 32;case fs:return 268435456;default:return 32}default:return 32}}var pd=!1,Aa=null,za=null,Ra=null,kr=new Map,_r=new Map,Oa=[],Lb="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function sv(e,t){switch(e){case"focusin":case"focusout":Aa=null;break;case"dragenter":case"dragleave":za=null;break;case"mouseover":case"mouseout":Ra=null;break;case"pointerover":case"pointerout":kr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":_r.delete(t.pointerId)}}function Dr(e,t,l,n,o,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:l,eventSystemFlags:n,nativeEvent:c,targetContainers:[o]},t!==null&&(t=Bn(t),t!==null&&nv(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,o!==null&&t.indexOf(o)===-1&&t.push(o),e)}function qb(e,t,l,n,o){switch(t){case"focusin":return Aa=Dr(Aa,e,t,l,n,o),!0;case"dragenter":return za=Dr(za,e,t,l,n,o),!0;case"mouseover":return Ra=Dr(Ra,e,t,l,n,o),!0;case"pointerover":var c=o.pointerId;return kr.set(c,Dr(kr.get(c)||null,e,t,l,n,o)),!0;case"gotpointercapture":return c=o.pointerId,_r.set(c,Dr(_r.get(c)||null,e,t,l,n,o)),!0}return!1}function ov(e){var t=Un(e.target);if(t!==null){var l=m(t);if(l!==null){if(t=l.tag,t===13){if(t=h(l),t!==null){e.blockedOn=t,Vi(e.priority,function(){iv(l)});return}}else if(t===31){if(t=x(l),t!==null){e.blockedOn=t,Vi(e.priority,function(){iv(l)});return}}else if(t===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function wo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var l=md(e.nativeEvent);if(l===null){l=e.nativeEvent;var n=new l.constructor(l.type,l);hu=n,l.target.dispatchEvent(n),hu=null}else return t=Bn(l),t!==null&&nv(t),e.blockedOn=l,!1;t.shift()}return!0}function uv(e,t,l){wo(e)&&l.delete(t)}function Qb(){pd=!1,Aa!==null&&wo(Aa)&&(Aa=null),za!==null&&wo(za)&&(za=null),Ra!==null&&wo(Ra)&&(Ra=null),kr.forEach(uv),_r.forEach(uv)}function To(e,t){e.blockedOn===t&&(e.blockedOn=null,pd||(pd=!0,a.unstable_scheduleCallback(a.unstable_NormalPriority,Qb)))}var Co=null;function cv(e){Co!==e&&(Co=e,a.unstable_scheduleCallback(a.unstable_NormalPriority,function(){Co===e&&(Co=null);for(var t=0;t<e.length;t+=3){var l=e[t],n=e[t+1],o=e[t+2];if(typeof n!="function"){if(hd(n||l)===null)continue;break}var c=Bn(l);c!==null&&(e.splice(t,3),t-=3,mc(c,{pending:!0,data:o,method:l.method,action:n},n,o))}}))}function yi(e){function t(S){return To(S,e)}Aa!==null&&To(Aa,e),za!==null&&To(za,e),Ra!==null&&To(Ra,e),kr.forEach(t),_r.forEach(t);for(var l=0;l<Oa.length;l++){var n=Oa[l];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Oa.length&&(l=Oa[0],l.blockedOn===null);)ov(l),l.blockedOn===null&&Oa.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(n=0;n<l.length;n+=3){var o=l[n],c=l[n+1],f=o[tt]||null;if(typeof c=="function")f||cv(l);else if(f){var y=null;if(c&&c.hasAttribute("formAction")){if(o=c,f=c[tt]||null)y=f.formAction;else if(hd(o)!==null)continue}else y=f.action;typeof y=="function"?l[n+1]=y:(l.splice(n,3),n-=3),cv(l)}}}function dv(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(f){return o=f})},focusReset:"manual",scroll:"manual"})}function t(){o!==null&&(o(),o=null),n||setTimeout(l,20)}function l(){if(!n&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,o=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(l,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),o!==null&&(o(),o=null)}}}function vd(e){this._internalRoot=e}Eo.prototype.render=vd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var l=t.current,n=$t();lv(l,n,e,t,null,null)},Eo.prototype.unmount=vd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;lv(e.current,2,null,e,null,null),so(),t[Dn]=null}};function Eo(e){this._internalRoot=e}Eo.prototype.unstable_scheduleHydration=function(e){if(e){var t=Xi();e={blockedOn:null,target:e,priority:t};for(var l=0;l<Oa.length&&t!==0&&t<Oa[l].priority;l++);Oa.splice(l,0,e),l===0&&ov(e)}};var fv=i.version;if(fv!=="19.2.7")throw Error(u(527,fv,"19.2.7"));$.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=v(t),e=e!==null?g(e):null,e=e===null?null:e.stateNode,e};var Yb={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:_,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ao=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ao.isDisabled&&Ao.supportsFiber)try{$a=Ao.inject(Yb),Mt=Ao}catch{}}return Br.createRoot=function(e,t){if(!d(e))throw Error(u(299));var l=!1,n="",o=bh,c=gh,f=jh;return t!=null&&(t.unstable_strictMode===!0&&(l=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=ev(e,1,!1,null,null,l,n,null,o,c,f,dv),e[Dn]=t.current,Pc(e),new vd(t)},Br.hydrateRoot=function(e,t,l){if(!d(e))throw Error(u(299));var n=!1,o="",c=bh,f=gh,y=jh,S=null;return l!=null&&(l.unstable_strictMode===!0&&(n=!0),l.identifierPrefix!==void 0&&(o=l.identifierPrefix),l.onUncaughtError!==void 0&&(c=l.onUncaughtError),l.onCaughtError!==void 0&&(f=l.onCaughtError),l.onRecoverableError!==void 0&&(y=l.onRecoverableError),l.formState!==void 0&&(S=l.formState)),t=ev(e,1,!0,t,l??null,n,o,S,c,f,y,dv),t.context=tv(null),l=t.current,n=$t(),n=kn(n),o=xa(n),o.callback=null,ya(l,o,n),l=n,t.current.lanes=l,oe(t,l),El(t),e[Dn]=t.current,Pc(e),new Eo(t)},Br.version="19.2.7",Br}var Nv;function eg(){if(Nv)return jd.exports;Nv=1;function a(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(a)}catch(i){console.error(i)}}return a(),jd.exports=Ib(),jd.exports}var tg=eg();/**
50
+ * react-router v7.17.0
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var Mv="popstate";function wv(a){return typeof a=="object"&&a!=null&&"pathname"in a&&"search"in a&&"hash"in a&&"state"in a&&"key"in a}function lg(a={}){function i(u,d){var v;let m=(v=d.state)==null?void 0:v.masked,{pathname:h,search:x,hash:p}=m||u.location;return kd("",{pathname:h,search:x,hash:p},d.state&&d.state.usr||null,d.state&&d.state.key||"default",m?{pathname:u.location.pathname,search:u.location.search,hash:u.location.hash}:void 0)}function r(u,d){return typeof d=="string"?d:Kr(d)}return ng(i,r,null,a)}function Je(a,i){if(a===!1||a===null||typeof a>"u")throw new Error(i)}function Ol(a,i){if(!a){typeof console<"u"&&console.warn(i);try{throw new Error(i)}catch{}}}function ag(){return Math.random().toString(36).substring(2,10)}function Tv(a,i){return{usr:a.state,key:a.key,idx:i,masked:a.mask?{pathname:a.pathname,search:a.search,hash:a.hash}:void 0}}function kd(a,i,r=null,u,d){return{pathname:typeof a=="string"?a:a.pathname,search:"",hash:"",...typeof i=="string"?Li(i):i,state:r,key:i&&i.key||u||ag(),mask:d}}function Kr({pathname:a="/",search:i="",hash:r=""}){return i&&i!=="?"&&(a+=i.charAt(0)==="?"?i:"?"+i),r&&r!=="#"&&(a+=r.charAt(0)==="#"?r:"#"+r),a}function Li(a){let i={};if(a){let r=a.indexOf("#");r>=0&&(i.hash=a.substring(r),a=a.substring(0,r));let u=a.indexOf("?");u>=0&&(i.search=a.substring(u),a=a.substring(0,u)),a&&(i.pathname=a)}return i}function ng(a,i,r,u={}){let{window:d=document.defaultView,v5Compat:m=!1}=u,h=d.history,x="POP",p=null,v=g();v==null&&(v=0,h.replaceState({...h.state,idx:v},""));function g(){return(h.state||{idx:null}).idx}function b(){x="POP";let Q=g(),U=Q==null?null:Q-v;v=Q,p&&p({action:x,location:z.location,delta:U})}function E(Q,U){x="PUSH";let L=wv(Q)?Q:kd(z.location,Q,U);v=g()+1;let K=Tv(L,v),B=z.createHref(L.mask||L);try{h.pushState(K,"",B)}catch(V){if(V instanceof DOMException&&V.name==="DataCloneError")throw V;d.location.assign(B)}m&&p&&p({action:x,location:z.location,delta:1})}function T(Q,U){x="REPLACE";let L=wv(Q)?Q:kd(z.location,Q,U);v=g();let K=Tv(L,v),B=z.createHref(L.mask||L);h.replaceState(K,"",B),m&&p&&p({action:x,location:z.location,delta:0})}function A(Q){return ig(d,Q)}let z={get action(){return x},get location(){return a(d,h)},listen(Q){if(p)throw new Error("A history only accepts one active listener");return d.addEventListener(Mv,b),p=Q,()=>{d.removeEventListener(Mv,b),p=null}},createHref(Q){return i(d,Q)},createURL:A,encodeLocation(Q){let U=A(Q);return{pathname:U.pathname,search:U.search,hash:U.hash}},push:E,replace:T,go(Q){return h.go(Q)}};return z}function ig(a,i,r=!1){let u="http://localhost";a&&(u=a.location.origin!=="null"?a.location.origin:a.location.href),Je(u,"No window.location.(origin|href) available to create URL");let d=typeof i=="string"?i:Kr(i);return d=d.replace(/ $/,"%20"),!r&&d.startsWith("//")&&(d=u+d),new URL(d,u)}function yx(a,i,r="/"){return rg(a,i,r,!1)}function rg(a,i,r,u,d){let m=typeof i=="string"?Li(i):i,h=na(m.pathname||"/",r);if(h==null)return null;let x=sg(a),p=null,v=bg(h);for(let g=0;p==null&&g<x.length;++g)p=xg(x[g],v,u);return p}function sg(a){let i=bx(a);return og(i),i}function bx(a,i=[],r=[],u="",d=!1){let m=(h,x,p=d,v)=>{let g={relativePath:v===void 0?h.path||"":v,caseSensitive:h.caseSensitive===!0,childrenIndex:x,route:h};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(u)&&p)return;Je(g.relativePath.startsWith(u),`Absolute route path "${g.relativePath}" nested under path "${u}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(u.length)}let b=yl([u,g.relativePath]),E=r.concat(g);h.children&&h.children.length>0&&(Je(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${b}".`),bx(h.children,i,E,b,p)),!(h.path==null&&!h.index)&&i.push({path:b,score:pg(b,h.index),routesMeta:E})};return a.forEach((h,x)=>{var p;if(h.path===""||!((p=h.path)!=null&&p.includes("?")))m(h,x);else for(let v of gx(h.path))m(h,x,!0,v)}),i}function gx(a){let i=a.split("/");if(i.length===0)return[];let[r,...u]=i,d=r.endsWith("?"),m=r.replace(/\?$/,"");if(u.length===0)return d?[m,""]:[m];let h=gx(u.join("/")),x=[];return x.push(...h.map(p=>p===""?m:[m,p].join("/"))),d&&x.push(...h),x.map(p=>a.startsWith("/")&&p===""?"/":p)}function og(a){a.sort((i,r)=>i.score!==r.score?r.score-i.score:vg(i.routesMeta.map(u=>u.childrenIndex),r.routesMeta.map(u=>u.childrenIndex)))}var ug=/^:[\w-]+$/,cg=3,dg=2,fg=1,mg=10,hg=-2,Cv=a=>a==="*";function pg(a,i){let r=a.split("/"),u=r.length;return r.some(Cv)&&(u+=hg),i&&(u+=dg),r.filter(d=>!Cv(d)).reduce((d,m)=>d+(ug.test(m)?cg:m===""?fg:mg),u)}function vg(a,i){return a.length===i.length&&a.slice(0,-1).every((u,d)=>u===i[d])?a[a.length-1]-i[i.length-1]:0}function xg(a,i,r=!1){let{routesMeta:u}=a,d={},m="/",h=[];for(let x=0;x<u.length;++x){let p=u[x],v=x===u.length-1,g=m==="/"?i:i.slice(m.length)||"/",b=Qo({path:p.relativePath,caseSensitive:p.caseSensitive,end:v},g),E=p.route;if(!b&&v&&r&&!u[u.length-1].route.index&&(b=Qo({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},g)),!b)return null;Object.assign(d,b.params),h.push({params:d,pathname:yl([m,b.pathname]),pathnameBase:Ng(yl([m,b.pathnameBase])),route:E}),b.pathnameBase!=="/"&&(m=yl([m,b.pathnameBase]))}return h}function Qo(a,i){typeof a=="string"&&(a={path:a,caseSensitive:!1,end:!0});let[r,u]=yg(a.path,a.caseSensitive,a.end),d=i.match(r);if(!d)return null;let m=d[0],h=m.replace(/(.)\/+$/,"$1"),x=d.slice(1);return{params:u.reduce((v,{paramName:g,isOptional:b},E)=>{if(g==="*"){let A=x[E]||"";h=m.slice(0,m.length-A.length).replace(/(.)\/+$/,"$1")}const T=x[E];return b&&!T?v[g]=void 0:v[g]=(T||"").replace(/%2F/g,"/"),v},{}),pathname:m,pathnameBase:h,pattern:a}}function yg(a,i=!1,r=!0){Ol(a==="*"||!a.endsWith("*")||a.endsWith("/*"),`Route path "${a}" will be treated as if it were "${a.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${a.replace(/\*$/,"/*")}".`);let u=[],d="^"+a.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,x,p,v,g)=>{if(u.push({paramName:x,isOptional:p!=null}),p){let b=g.charAt(v+h.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return a.endsWith("*")?(u.push({paramName:"*"}),d+=a==="*"||a==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?d+="\\/*$":a!==""&&a!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,i?void 0:"i"),u]}function bg(a){try{return a.split("/").map(i=>decodeURIComponent(i).replace(/\//g,"%2F")).join("/")}catch(i){return Ol(!1,`The URL path "${a}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${i}).`),a}}function na(a,i){if(i==="/")return a;if(!a.toLowerCase().startsWith(i.toLowerCase()))return null;let r=i.endsWith("/")?i.length-1:i.length,u=a.charAt(r);return u&&u!=="/"?null:a.slice(r)||"/"}var gg=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function jg(a,i="/"){let{pathname:r,search:u="",hash:d=""}=typeof a=="string"?Li(a):a,m;return r?(r=Sx(r),r.startsWith("/")?m=Ev(r.substring(1),"/"):m=Ev(r,i)):m=i,{pathname:m,search:Mg(u),hash:wg(d)}}function Ev(a,i){let r=Yo(i).split("/");return a.split("/").forEach(d=>{d===".."?r.length>1&&r.pop():d!=="."&&r.push(d)}),r.length>1?r.join("/"):"/"}function wd(a,i,r,u){return`Cannot include a '${a}' character in a manually specified \`to.${i}\` field [${JSON.stringify(u)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Sg(a){return a.filter((i,r)=>r===0||i.route.path&&i.route.path.length>0)}function jx(a){let i=Sg(a);return i.map((r,u)=>u===i.length-1?r.pathname:r.pathnameBase)}function nf(a,i,r,u=!1){let d;typeof a=="string"?d=Li(a):(d={...a},Je(!d.pathname||!d.pathname.includes("?"),wd("?","pathname","search",d)),Je(!d.pathname||!d.pathname.includes("#"),wd("#","pathname","hash",d)),Je(!d.search||!d.search.includes("#"),wd("#","search","hash",d)));let m=a===""||d.pathname==="",h=m?"/":d.pathname,x;if(h==null)x=r;else{let b=i.length-1;if(!u&&h.startsWith("..")){let E=h.split("/");for(;E[0]==="..";)E.shift(),b-=1;d.pathname=E.join("/")}x=b>=0?i[b]:"/"}let p=jg(d,x),v=h&&h!=="/"&&h.endsWith("/"),g=(m||h===".")&&r.endsWith("/");return!p.pathname.endsWith("/")&&(v||g)&&(p.pathname+="/"),p}var Sx=a=>a.replace(/\/\/+/g,"/"),yl=a=>Sx(a.join("/")),Yo=a=>a.replace(/\/+$/,""),Ng=a=>Yo(a).replace(/^\/*/,"/"),Mg=a=>!a||a==="?"?"":a.startsWith("?")?a:"?"+a,wg=a=>!a||a==="#"?"":a.startsWith("#")?a:"#"+a,Tg=class{constructor(a,i,r,u=!1){this.status=a,this.statusText=i||"",this.internal=u,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function Cg(a){return a!=null&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.internal=="boolean"&&"data"in a}function Eg(a){let i=a.map(r=>r.route.path).filter(Boolean);return yl(i)||"/"}var Nx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Mx(a,i){let r=a;if(typeof r!="string"||!gg.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let u=r,d=!1;if(Nx)try{let m=new URL(window.location.href),h=r.startsWith("//")?new URL(m.protocol+r):new URL(r),x=na(h.pathname,i);h.origin===m.origin&&x!=null?r=x+h.search+h.hash:d=!0}catch{Ol(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:u,isExternal:d,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var wx=["POST","PUT","PATCH","DELETE"];new Set(wx);var Ag=["GET",...wx];new Set(Ag);var qi=j.createContext(null);qi.displayName="DataRouter";var Jo=j.createContext(null);Jo.displayName="DataRouterState";var Tx=j.createContext(!1);function zg(){return j.useContext(Tx)}var Cx=j.createContext({isTransitioning:!1});Cx.displayName="ViewTransition";var Rg=j.createContext(new Map);Rg.displayName="Fetchers";var Og=j.createContext(null);Og.displayName="Await";var ul=j.createContext(null);ul.displayName="Navigation";var ls=j.createContext(null);ls.displayName="Location";var ia=j.createContext({outlet:null,matches:[],isDataRoute:!1});ia.displayName="Route";var rf=j.createContext(null);rf.displayName="RouteError";var Ex="REACT_ROUTER_ERROR",kg="REDIRECT",_g="ROUTE_ERROR_RESPONSE";function Dg(a){if(a.startsWith(`${Ex}:${kg}:{`))try{let i=JSON.parse(a.slice(28));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.location=="string"&&typeof i.reloadDocument=="boolean"&&typeof i.replace=="boolean")return i}catch{}}function Ug(a){if(a.startsWith(`${Ex}:${_g}:{`))try{let i=JSON.parse(a.slice(40));if(typeof i=="object"&&i&&typeof i.status=="number"&&typeof i.statusText=="string")return new Tg(i.status,i.statusText,i.data)}catch{}}function Bg(a,{relative:i}={}){Je(as(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:u}=j.useContext(ul),{hash:d,pathname:m,search:h}=ns(a,{relative:i}),x=m;return r!=="/"&&(x=m==="/"?r:yl([r,m])),u.createHref({pathname:x,search:h,hash:d})}function as(){return j.useContext(ls)!=null}function ra(){return Je(as(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(ls).location}var Ax="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function zx(a){j.useContext(ul).static||j.useLayoutEffect(a)}function Hg(){let{isDataRoute:a}=j.useContext(ia);return a?Pg():Lg()}function Lg(){Je(as(),"useNavigate() may be used only in the context of a <Router> component.");let a=j.useContext(qi),{basename:i,navigator:r}=j.useContext(ul),{matches:u}=j.useContext(ia),{pathname:d}=ra(),m=JSON.stringify(jx(u)),h=j.useRef(!1);return zx(()=>{h.current=!0}),j.useCallback((p,v={})=>{if(Ol(h.current,Ax),!h.current)return;if(typeof p=="number"){r.go(p);return}let g=nf(p,JSON.parse(m),d,v.relative==="path");a==null&&i!=="/"&&(g.pathname=g.pathname==="/"?i:yl([i,g.pathname])),(v.replace?r.replace:r.push)(g,v.state,v)},[i,r,m,d,a])}j.createContext(null);function ns(a,{relative:i}={}){let{matches:r}=j.useContext(ia),{pathname:u}=ra(),d=JSON.stringify(jx(r));return j.useMemo(()=>nf(a,JSON.parse(d),u,i==="path"),[a,d,u,i])}function qg(a,i){return Rx(a,i)}function Rx(a,i,r){var Q;Je(as(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=j.useContext(ul),{matches:d}=j.useContext(ia),m=d[d.length-1],h=m?m.params:{},x=m?m.pathname:"/",p=m?m.pathnameBase:"/",v=m&&m.route;{let U=v&&v.path||"";kx(x,!v||U.endsWith("*")||U.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${x}" (under <Route path="${U}">) 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.
59
+
60
+ Please change the parent <Route path="${U}"> to <Route path="${U==="/"?"*":`${U}/*`}">.`)}let g=ra(),b;if(i){let U=typeof i=="string"?Li(i):i;Je(p==="/"||((Q=U.pathname)==null?void 0:Q.startsWith(p)),`When overriding the location using \`<Routes location>\` 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 "${p}" but pathname "${U.pathname}" was given in the \`location\` prop.`),b=U}else b=g;let E=b.pathname||"/",T=E;if(p!=="/"){let U=p.replace(/^\//,"").split("/");T="/"+E.replace(/^\//,"").split("/").slice(U.length).join("/")}let A=r&&r.state.matches.length?r.state.matches.map(U=>Object.assign(U,{route:r.manifest[U.route.id]||U.route})):yx(a,{pathname:T});Ol(v||A!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Ol(A==null||A[A.length-1].route.element!==void 0||A[A.length-1].route.Component!==void 0||A[A.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let z=Xg(A&&A.map(U=>Object.assign({},U,{params:Object.assign({},h,U.params),pathname:yl([p,u.encodeLocation?u.encodeLocation(U.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:U.pathname]),pathnameBase:U.pathnameBase==="/"?p:yl([p,u.encodeLocation?u.encodeLocation(U.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:U.pathnameBase])})),d,r);return i&&z?j.createElement(ls.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...b},navigationType:"POP"}},z):z}function Qg(){let a=Fg(),i=Cg(a)?`${a.status} ${a.statusText}`:a instanceof Error?a.message:JSON.stringify(a),r=a instanceof Error?a.stack:null,u="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:u},m={padding:"2px 4px",backgroundColor:u},h=null;return console.error("Error handled by React Router default ErrorBoundary:",a),h=j.createElement(j.Fragment,null,j.createElement("p",null,"💿 Hey developer 👋"),j.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",j.createElement("code",{style:m},"ErrorBoundary")," or"," ",j.createElement("code",{style:m},"errorElement")," prop on your route.")),j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},i),r?j.createElement("pre",{style:d},r):null,h)}var Yg=j.createElement(Qg,null),Ox=class extends j.Component{constructor(a){super(a),this.state={location:a.location,revalidation:a.revalidation,error:a.error}}static getDerivedStateFromError(a){return{error:a}}static getDerivedStateFromProps(a,i){return i.location!==a.location||i.revalidation!=="idle"&&a.revalidation==="idle"?{error:a.error,location:a.location,revalidation:a.revalidation}:{error:a.error!==void 0?a.error:i.error,location:i.location,revalidation:a.revalidation||i.revalidation}}componentDidCatch(a,i){this.props.onError?this.props.onError(a,i):console.error("React Router caught the following error during render",a)}render(){let a=this.state.error;if(this.context&&typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){const r=Ug(a.digest);r&&(a=r)}let i=a!==void 0?j.createElement(ia.Provider,{value:this.props.routeContext},j.createElement(rf.Provider,{value:a,children:this.props.component})):this.props.children;return this.context?j.createElement(Gg,{error:a},i):i}};Ox.contextType=Tx;var Td=new WeakMap;function Gg({children:a,error:i}){let{basename:r}=j.useContext(ul);if(typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){let u=Dg(i.digest);if(u){let d=Td.get(i);if(d)throw d;let m=Mx(u.location,r);if(Nx&&!Td.get(i))if(m.isExternal||u.reloadDocument)window.location.href=m.absoluteURL||m.to;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(m.to,{replace:u.replace}));throw Td.set(i,h),h}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${m.absoluteURL||m.to}`})}}return a}function Kg({routeContext:a,match:i,children:r}){let u=j.useContext(qi);return u&&u.static&&u.staticContext&&(i.route.errorElement||i.route.ErrorBoundary)&&(u.staticContext._deepestRenderedBoundaryId=i.route.id),j.createElement(ia.Provider,{value:a},r)}function Xg(a,i=[],r){let u=r==null?void 0:r.state;if(a==null){if(!u)return null;if(u.errors)a=u.matches;else if(i.length===0&&!u.initialized&&u.matches.length>0)a=u.matches;else return null}let d=a,m=u==null?void 0:u.errors;if(m!=null){let g=d.findIndex(b=>b.route.id&&(m==null?void 0:m[b.route.id])!==void 0);Je(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(m).join(",")}`),d=d.slice(0,Math.min(d.length,g+1))}let h=!1,x=-1;if(r&&u){h=u.renderFallback;for(let g=0;g<d.length;g++){let b=d[g];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(x=g),b.route.id){let{loaderData:E,errors:T}=u,A=b.route.loader&&!E.hasOwnProperty(b.route.id)&&(!T||T[b.route.id]===void 0);if(b.route.lazy||A){r.isStatic&&(h=!0),x>=0?d=d.slice(0,x+1):d=[d[0]];break}}}}let p=r==null?void 0:r.onError,v=u&&p?(g,b)=>{var E,T;p(g,{location:u.location,params:((T=(E=u.matches)==null?void 0:E[0])==null?void 0:T.params)??{},pattern:Eg(u.matches),errorInfo:b})}:void 0;return d.reduceRight((g,b,E)=>{let T,A=!1,z=null,Q=null;u&&(T=m&&b.route.id?m[b.route.id]:void 0,z=b.route.errorElement||Yg,h&&(x<0&&E===0?(kx("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),A=!0,Q=null):x===E&&(A=!0,Q=b.route.hydrateFallbackElement||null)));let U=i.concat(d.slice(0,E+1)),L=()=>{let K;return T?K=z:A?K=Q:b.route.Component?K=j.createElement(b.route.Component,null):b.route.element?K=b.route.element:K=g,j.createElement(Kg,{match:b,routeContext:{outlet:g,matches:U,isDataRoute:u!=null},children:K})};return u&&(b.route.ErrorBoundary||b.route.errorElement||E===0)?j.createElement(Ox,{location:u.location,revalidation:u.revalidation,component:z,error:T,children:L(),routeContext:{outlet:null,matches:U,isDataRoute:!0},onError:v}):L()},null)}function sf(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Vg(a){let i=j.useContext(qi);return Je(i,sf(a)),i}function Zg(a){let i=j.useContext(Jo);return Je(i,sf(a)),i}function $g(a){let i=j.useContext(ia);return Je(i,sf(a)),i}function of(a){let i=$g(a),r=i.matches[i.matches.length-1];return Je(r.route.id,`${a} can only be used on routes that contain a unique "id"`),r.route.id}function Jg(){return of("useRouteId")}function Fg(){var u;let a=j.useContext(rf),i=Zg("useRouteError"),r=of("useRouteError");return a!==void 0?a:(u=i.errors)==null?void 0:u[r]}function Pg(){let{router:a}=Vg("useNavigate"),i=of("useNavigate"),r=j.useRef(!1);return zx(()=>{r.current=!0}),j.useCallback(async(d,m={})=>{Ol(r.current,Ax),r.current&&(typeof d=="number"?await a.navigate(d):await a.navigate(d,{fromRouteId:i,...m}))},[a,i])}var Av={};function kx(a,i,r){!i&&!Av[a]&&(Av[a]=!0,Ol(!1,r))}j.memo(Wg);function Wg({routes:a,manifest:i,future:r,state:u,isStatic:d,onError:m}){return Rx(a,void 0,{manifest:i,state:u,isStatic:d,onError:m})}function Ni(a){Je(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function Ig({basename:a="/",children:i=null,location:r,navigationType:u="POP",navigator:d,static:m=!1,useTransitions:h}){Je(!as(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let x=a.replace(/^\/*/,"/"),p=j.useMemo(()=>({basename:x,navigator:d,static:m,useTransitions:h,future:{}}),[x,d,m,h]);typeof r=="string"&&(r=Li(r));let{pathname:v="/",search:g="",hash:b="",state:E=null,key:T="default",mask:A}=r,z=j.useMemo(()=>{let Q=na(v,x);return Q==null?null:{location:{pathname:Q,search:g,hash:b,state:E,key:T,mask:A},navigationType:u}},[x,v,g,b,E,T,u,A]);return Ol(z!=null,`<Router basename="${x}"> is not able to match the URL "${v}${g}${b}" because it does not start with the basename, so the <Router> won't render anything.`),z==null?null:j.createElement(ul.Provider,{value:p},j.createElement(ls.Provider,{children:i,value:z}))}function e1({children:a,location:i}){return qg(_d(a),i)}function _d(a,i=[]){let r=[];return j.Children.forEach(a,(u,d)=>{if(!j.isValidElement(u))return;let m=[...i,d];if(u.type===j.Fragment){r.push.apply(r,_d(u.props.children,m));return}Je(u.type===Ni,`[${typeof u.type=="string"?u.type:u.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Je(!u.props.index||!u.props.children,"An index route cannot have child routes.");let h={id:u.props.id||m.join("-"),caseSensitive:u.props.caseSensitive,element:u.props.element,Component:u.props.Component,index:u.props.index,path:u.props.path,middleware:u.props.middleware,loader:u.props.loader,action:u.props.action,hydrateFallbackElement:u.props.hydrateFallbackElement,HydrateFallback:u.props.HydrateFallback,errorElement:u.props.errorElement,ErrorBoundary:u.props.ErrorBoundary,hasErrorBoundary:u.props.hasErrorBoundary===!0||u.props.ErrorBoundary!=null||u.props.errorElement!=null,shouldRevalidate:u.props.shouldRevalidate,handle:u.props.handle,lazy:u.props.lazy};u.props.children&&(h.children=_d(u.props.children,m)),r.push(h)}),r}var Uo="get",Bo="application/x-www-form-urlencoded";function Fo(a){return typeof HTMLElement<"u"&&a instanceof HTMLElement}function t1(a){return Fo(a)&&a.tagName.toLowerCase()==="button"}function l1(a){return Fo(a)&&a.tagName.toLowerCase()==="form"}function a1(a){return Fo(a)&&a.tagName.toLowerCase()==="input"}function n1(a){return!!(a.metaKey||a.altKey||a.ctrlKey||a.shiftKey)}function i1(a,i){return a.button===0&&(!i||i==="_self")&&!n1(a)}var Ro=null;function r1(){if(Ro===null)try{new FormData(document.createElement("form"),0),Ro=!1}catch{Ro=!0}return Ro}var s1=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Cd(a){return a!=null&&!s1.has(a)?(Ol(!1,`"${a}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Bo}"`),null):a}function o1(a,i){let r,u,d,m,h;if(l1(a)){let x=a.getAttribute("action");u=x?na(x,i):null,r=a.getAttribute("method")||Uo,d=Cd(a.getAttribute("enctype"))||Bo,m=new FormData(a)}else if(t1(a)||a1(a)&&(a.type==="submit"||a.type==="image")){let x=a.form;if(x==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=a.getAttribute("formaction")||x.getAttribute("action");if(u=p?na(p,i):null,r=a.getAttribute("formmethod")||x.getAttribute("method")||Uo,d=Cd(a.getAttribute("formenctype"))||Cd(x.getAttribute("enctype"))||Bo,m=new FormData(x,a),!r1()){let{name:v,type:g,value:b}=a;if(g==="image"){let E=v?`${v}.`:"";m.append(`${E}x`,"0"),m.append(`${E}y`,"0")}else v&&m.append(v,b)}}else{if(Fo(a))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=Uo,u=null,d=Bo,h=a}return m&&d==="text/plain"&&(h=m,m=void 0),{action:u,method:r.toLowerCase(),encType:d,formData:m,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function uf(a,i){if(a===!1||a===null||typeof a>"u")throw new Error(i)}function _x(a,i,r,u){let d=typeof a=="string"?new URL(a,typeof window>"u"?"server://singlefetch/":window.location.origin):a;return r?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${u}`:d.pathname=`${d.pathname}.${u}`:d.pathname==="/"?d.pathname=`_root.${u}`:i&&na(d.pathname,i)==="/"?d.pathname=`${Yo(i)}/_root.${u}`:d.pathname=`${Yo(d.pathname)}.${u}`,d}async function u1(a,i){if(a.id in i)return i[a.id];try{let r=await import(a.module);return i[a.id]=r,r}catch(r){return console.error(`Error loading route module \`${a.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function c1(a){return a==null?!1:a.href==null?a.rel==="preload"&&typeof a.imageSrcSet=="string"&&typeof a.imageSizes=="string":typeof a.rel=="string"&&typeof a.href=="string"}async function d1(a,i,r){let u=await Promise.all(a.map(async d=>{let m=i.routes[d.route.id];if(m){let h=await u1(m,r);return h.links?h.links():[]}return[]}));return p1(u.flat(1).filter(c1).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function zv(a,i,r,u,d,m){let h=(p,v)=>r[v]?p.route.id!==r[v].route.id:!0,x=(p,v)=>{var g;return r[v].pathname!==p.pathname||((g=r[v].route.path)==null?void 0:g.endsWith("*"))&&r[v].params["*"]!==p.params["*"]};return m==="assets"?i.filter((p,v)=>h(p,v)||x(p,v)):m==="data"?i.filter((p,v)=>{var b;let g=u.routes[p.route.id];if(!g||!g.hasLoader)return!1;if(h(p,v)||x(p,v))return!0;if(p.route.shouldRevalidate){let E=p.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:((b=r[0])==null?void 0:b.params)||{},nextUrl:new URL(a,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof E=="boolean")return E}return!0}):[]}function f1(a,i,{includeHydrateFallback:r}={}){return m1(a.map(u=>{let d=i.routes[u.route.id];if(!d)return[];let m=[d.module];return d.clientActionModule&&(m=m.concat(d.clientActionModule)),d.clientLoaderModule&&(m=m.concat(d.clientLoaderModule)),r&&d.hydrateFallbackModule&&(m=m.concat(d.hydrateFallbackModule)),d.imports&&(m=m.concat(d.imports)),m}).flat(1))}function m1(a){return[...new Set(a)]}function h1(a){let i={},r=Object.keys(a).sort();for(let u of r)i[u]=a[u];return i}function p1(a,i){let r=new Set;return new Set(i),a.reduce((u,d)=>{let m=JSON.stringify(h1(d));return r.has(m)||(r.add(m),u.push({key:m,link:d})),u},[])}function cf(){let a=j.useContext(qi);return uf(a,"You must render this element inside a <DataRouterContext.Provider> element"),a}function v1(){let a=j.useContext(Jo);return uf(a,"You must render this element inside a <DataRouterStateContext.Provider> element"),a}var df=j.createContext(void 0);df.displayName="FrameworkContext";function ff(){let a=j.useContext(df);return uf(a,"You must render this element inside a <HydratedRouter> element"),a}function x1(a,i){let r=j.useContext(df),[u,d]=j.useState(!1),[m,h]=j.useState(!1),{onFocus:x,onBlur:p,onMouseEnter:v,onMouseLeave:g,onTouchStart:b}=i,E=j.useRef(null);j.useEffect(()=>{if(a==="render"&&h(!0),a==="viewport"){let z=U=>{U.forEach(L=>{h(L.isIntersecting)})},Q=new IntersectionObserver(z,{threshold:.5});return E.current&&Q.observe(E.current),()=>{Q.disconnect()}}},[a]),j.useEffect(()=>{if(u){let z=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(z)}}},[u]);let T=()=>{d(!0)},A=()=>{d(!1),h(!1)};return r?a!=="intent"?[m,E,{}]:[m,E,{onFocus:Hr(x,T),onBlur:Hr(p,A),onMouseEnter:Hr(v,T),onMouseLeave:Hr(g,A),onTouchStart:Hr(b,T)}]:[!1,E,{}]}function Hr(a,i){return r=>{a&&a(r),r.defaultPrevented||i(r)}}function y1({page:a,...i}){let r=zg(),{router:u}=cf(),d=j.useMemo(()=>yx(u.routes,a,u.basename),[u.routes,a,u.basename]);return d?r?j.createElement(g1,{page:a,matches:d,...i}):j.createElement(j1,{page:a,matches:d,...i}):null}function b1(a){let{manifest:i,routeModules:r}=ff(),[u,d]=j.useState([]);return j.useEffect(()=>{let m=!1;return d1(a,i,r).then(h=>{m||d(h)}),()=>{m=!0}},[a,i,r]),u}function g1({page:a,matches:i,...r}){let u=ra(),{future:d}=ff(),{basename:m}=cf(),h=j.useMemo(()=>{if(a===u.pathname+u.search+u.hash)return[];let x=_x(a,m,d.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,v=[];for(let g of i)typeof g.route.shouldRevalidate=="function"?p=!0:v.push(g.route.id);return p&&v.length>0&&x.searchParams.set("_routes",v.join(",")),[x.pathname+x.search]},[m,d.v8_trailingSlashAwareDataRequests,a,u,i]);return j.createElement(j.Fragment,null,h.map(x=>j.createElement("link",{key:x,rel:"prefetch",as:"fetch",href:x,...r})))}function j1({page:a,matches:i,...r}){let u=ra(),{future:d,manifest:m,routeModules:h}=ff(),{basename:x}=cf(),{loaderData:p,matches:v}=v1(),g=j.useMemo(()=>zv(a,i,v,m,u,"data"),[a,i,v,m,u]),b=j.useMemo(()=>zv(a,i,v,m,u,"assets"),[a,i,v,m,u]),E=j.useMemo(()=>{if(a===u.pathname+u.search+u.hash)return[];let z=new Set,Q=!1;if(i.forEach(L=>{var B;let K=m.routes[L.route.id];!K||!K.hasLoader||(!g.some(V=>V.route.id===L.route.id)&&L.route.id in p&&((B=h[L.route.id])!=null&&B.shouldRevalidate)||K.hasClientLoader?Q=!0:z.add(L.route.id))}),z.size===0)return[];let U=_x(a,x,d.v8_trailingSlashAwareDataRequests,"data");return Q&&z.size>0&&U.searchParams.set("_routes",i.filter(L=>z.has(L.route.id)).map(L=>L.route.id).join(",")),[U.pathname+U.search]},[x,d.v8_trailingSlashAwareDataRequests,p,u,m,g,i,a,h]),T=j.useMemo(()=>f1(b,m),[b,m]),A=b1(b);return j.createElement(j.Fragment,null,E.map(z=>j.createElement("link",{key:z,rel:"prefetch",as:"fetch",href:z,...r})),T.map(z=>j.createElement("link",{key:z,rel:"modulepreload",href:z,...r})),A.map(({key:z,link:Q})=>j.createElement("link",{key:z,nonce:r.nonce,...Q,crossOrigin:Q.crossOrigin??r.crossOrigin})))}function S1(...a){return i=>{a.forEach(r=>{typeof r=="function"?r(i):r!=null&&(r.current=i)})}}var N1=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{N1&&(window.__reactRouterVersion="7.17.0")}catch{}function M1({basename:a,children:i,useTransitions:r,window:u}){let d=j.useRef();d.current==null&&(d.current=lg({window:u,v5Compat:!0}));let m=d.current,[h,x]=j.useState({action:m.action,location:m.location}),p=j.useCallback(v=>{r===!1?x(v):j.startTransition(()=>x(v))},[r]);return j.useLayoutEffect(()=>m.listen(p),[m,p]),j.createElement(Ig,{basename:a,children:i,location:h.location,navigationType:h.action,navigator:m,useTransitions:r})}var Dx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,is=j.forwardRef(function({onClick:i,discover:r="render",prefetch:u="none",relative:d,reloadDocument:m,replace:h,mask:x,state:p,target:v,to:g,preventScrollReset:b,viewTransition:E,defaultShouldRevalidate:T,...A},z){let{basename:Q,navigator:U,useTransitions:L}=j.useContext(ul),K=typeof g=="string"&&Dx.test(g),B=Mx(g,Q);g=B.to;let V=Bg(g,{relative:d}),P=ra(),J=null;if(x){let me=nf(x,[],P.mask?P.mask.pathname:"/",!0);Q!=="/"&&(me.pathname=me.pathname==="/"?Q:yl([Q,me.pathname])),J=U.createHref(me)}let[I,te,se]=x1(u,A),F=C1(g,{replace:h,mask:x,state:p,target:v,preventScrollReset:b,relative:d,viewTransition:E,defaultShouldRevalidate:T,useTransitions:L});function fe(me){i&&i(me),me.defaultPrevented||F(me)}let pe=!(B.isExternal||m),Ae=j.createElement("a",{...A,...se,href:(pe?J:void 0)||B.absoluteURL||V,onClick:pe?fe:i,ref:S1(z,te),target:v,"data-discover":!K&&r==="render"?"true":void 0});return I&&!K?j.createElement(j.Fragment,null,Ae,j.createElement(y1,{page:V})):Ae});is.displayName="Link";var mf=j.forwardRef(function({"aria-current":i="page",caseSensitive:r=!1,className:u="",end:d=!1,style:m,to:h,viewTransition:x,children:p,...v},g){let b=ns(h,{relative:v.relative}),E=ra(),T=j.useContext(Jo),{navigator:A,basename:z}=j.useContext(ul),Q=T!=null&&O1(b)&&x===!0,U=A.encodeLocation?A.encodeLocation(b).pathname:b.pathname,L=E.pathname,K=T&&T.navigation&&T.navigation.location?T.navigation.location.pathname:null;r||(L=L.toLowerCase(),K=K?K.toLowerCase():null,U=U.toLowerCase()),K&&z&&(K=na(K,z)||K);const B=U!=="/"&&U.endsWith("/")?U.length-1:U.length;let V=L===U||!d&&L.startsWith(U)&&L.charAt(B)==="/",P=K!=null&&(K===U||!d&&K.startsWith(U)&&K.charAt(U.length)==="/"),J={isActive:V,isPending:P,isTransitioning:Q},I=V?i:void 0,te;typeof u=="function"?te=u(J):te=[u,V?"active":null,P?"pending":null,Q?"transitioning":null].filter(Boolean).join(" ");let se=typeof m=="function"?m(J):m;return j.createElement(is,{...v,"aria-current":I,className:te,ref:g,style:se,to:h,viewTransition:x},typeof p=="function"?p(J):p)});mf.displayName="NavLink";var w1=j.forwardRef(({discover:a="render",fetcherKey:i,navigate:r,reloadDocument:u,replace:d,state:m,method:h=Uo,action:x,onSubmit:p,relative:v,preventScrollReset:g,viewTransition:b,defaultShouldRevalidate:E,...T},A)=>{let{useTransitions:z}=j.useContext(ul),Q=z1(),U=R1(x,{relative:v}),L=h.toLowerCase()==="get"?"get":"post",K=typeof x=="string"&&Dx.test(x),B=V=>{if(p&&p(V),V.defaultPrevented)return;V.preventDefault();let P=V.nativeEvent.submitter,J=(P==null?void 0:P.getAttribute("formmethod"))||h,I=()=>Q(P||V.currentTarget,{fetcherKey:i,method:J,navigate:r,replace:d,state:m,relative:v,preventScrollReset:g,viewTransition:b,defaultShouldRevalidate:E});z&&r!==!1?j.startTransition(()=>I()):I()};return j.createElement("form",{ref:A,method:L,action:U,onSubmit:u?p:B,...T,"data-discover":!K&&a==="render"?"true":void 0})});w1.displayName="Form";function T1(a){return`${a} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ux(a){let i=j.useContext(qi);return Je(i,T1(a)),i}function C1(a,{target:i,replace:r,mask:u,state:d,preventScrollReset:m,relative:h,viewTransition:x,defaultShouldRevalidate:p,useTransitions:v}={}){let g=Hg(),b=ra(),E=ns(a,{relative:h});return j.useCallback(T=>{if(i1(T,i)){T.preventDefault();let A=r!==void 0?r:Kr(b)===Kr(E),z=()=>g(a,{replace:A,mask:u,state:d,preventScrollReset:m,relative:h,viewTransition:x,defaultShouldRevalidate:p});v?j.startTransition(()=>z()):z()}},[b,g,E,r,u,d,i,a,m,h,x,p,v])}var E1=0,A1=()=>`__${String(++E1)}__`;function z1(){let{router:a}=Ux("useSubmit"),{basename:i}=j.useContext(ul),r=Jg(),u=a.fetch,d=a.navigate;return j.useCallback(async(m,h={})=>{let{action:x,method:p,encType:v,formData:g,body:b}=o1(m,i);if(h.navigate===!1){let E=h.fetcherKey||A1();await u(E,r,h.action||x,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:g,body:b,formMethod:h.method||p,formEncType:h.encType||v,flushSync:h.flushSync})}else await d(h.action||x,{defaultShouldRevalidate:h.defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:g,body:b,formMethod:h.method||p,formEncType:h.encType||v,replace:h.replace,state:h.state,fromRouteId:r,flushSync:h.flushSync,viewTransition:h.viewTransition})},[u,d,i,r])}function R1(a,{relative:i}={}){let{basename:r}=j.useContext(ul),u=j.useContext(ia);Je(u,"useFormAction must be used inside a RouteContext");let[d]=u.matches.slice(-1),m={...ns(a||".",{relative:i})},h=ra();if(a==null){m.search=h.search;let x=new URLSearchParams(m.search),p=x.getAll("index");if(p.some(g=>g==="")){x.delete("index"),p.filter(b=>b).forEach(b=>x.append("index",b));let g=x.toString();m.search=g?`?${g}`:""}}return(!a||a===".")&&d.route.index&&(m.search=m.search?m.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(m.pathname=m.pathname==="/"?r:yl([r,m.pathname])),Kr(m)}function O1(a,{relative:i}={}){let r=j.useContext(Cx);Je(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:u}=Ux("useViewTransitionState"),d=ns(a,{relative:i});if(!r.isTransitioning)return!1;let m=na(r.currentLocation.pathname,u)||r.currentLocation.pathname,h=na(r.nextLocation.pathname,u)||r.nextLocation.pathname;return Qo(d.pathname,h)!=null||Qo(d.pathname,m)!=null}var Qi=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(a){return this.listeners.add(a),this.onSubscribe(),()=>{this.listeners.delete(a),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},yn,Da,wi,sx,k1=(sx=class extends Qi{constructor(){super();ue(this,yn);ue(this,Da);ue(this,wi);ee(this,wi,i=>{if(typeof window<"u"&&window.addEventListener){const r=()=>i();return window.addEventListener("visibilitychange",r,!1),()=>{window.removeEventListener("visibilitychange",r)}}})}onSubscribe(){N(this,Da)||this.setEventListener(N(this,wi))}onUnsubscribe(){var i;this.hasListeners()||((i=N(this,Da))==null||i.call(this),ee(this,Da,void 0))}setEventListener(i){var r;ee(this,wi,i),(r=N(this,Da))==null||r.call(this),ee(this,Da,i(u=>{typeof u=="boolean"?this.setFocused(u):this.onFocus()}))}setFocused(i){N(this,yn)!==i&&(ee(this,yn,i),this.onFocus())}onFocus(){const i=this.isFocused();this.listeners.forEach(r=>{r(i)})}isFocused(){var i;return typeof N(this,yn)=="boolean"?N(this,yn):((i=globalThis.document)==null?void 0:i.visibilityState)!=="hidden"}},yn=new WeakMap,Da=new WeakMap,wi=new WeakMap,sx),hf=new k1,_1={setTimeout:(a,i)=>setTimeout(a,i),clearTimeout:a=>clearTimeout(a),setInterval:(a,i)=>setInterval(a,i),clearInterval:a=>clearInterval(a)},Ua,lf,ox,D1=(ox=class{constructor(){ue(this,Ua,_1);ue(this,lf,!1)}setTimeoutProvider(a){ee(this,Ua,a)}setTimeout(a,i){return N(this,Ua).setTimeout(a,i)}clearTimeout(a){N(this,Ua).clearTimeout(a)}setInterval(a,i){return N(this,Ua).setInterval(a,i)}clearInterval(a){N(this,Ua).clearInterval(a)}},Ua=new WeakMap,lf=new WeakMap,ox),xn=new D1;function U1(a){setTimeout(a,0)}var B1=typeof window>"u"||"Deno"in globalThis;function Et(){}function H1(a,i){return typeof a=="function"?a(i):a}function Dd(a){return typeof a=="number"&&a>=0&&a!==1/0}function Bx(a,i){return Math.max(a+(i||0)-Date.now(),0)}function Ka(a,i){return typeof a=="function"?a(i):a}function Ft(a,i){return typeof a=="function"?a(i):a}function Rv(a,i){const{type:r="all",exact:u,fetchStatus:d,predicate:m,queryKey:h,stale:x}=a;if(h){if(u){if(i.queryHash!==pf(h,i.options))return!1}else if(!Xr(i.queryKey,h))return!1}if(r!=="all"){const p=i.isActive();if(r==="active"&&!p||r==="inactive"&&p)return!1}return!(typeof x=="boolean"&&i.isStale()!==x||d&&d!==i.state.fetchStatus||m&&!m(i))}function Ov(a,i){const{exact:r,status:u,predicate:d,mutationKey:m}=a;if(m){if(!i.options.mutationKey)return!1;if(r){if(Cn(i.options.mutationKey)!==Cn(m))return!1}else if(!Xr(i.options.mutationKey,m))return!1}return!(u&&i.state.status!==u||d&&!d(i))}function pf(a,i){return((i==null?void 0:i.queryKeyHashFn)||Cn)(a)}function Cn(a){return JSON.stringify(a,(i,r)=>Ud(r)?Object.keys(r).sort().reduce((u,d)=>(u[d]=r[d],u),{}):r)}function Xr(a,i){return a===i?!0:typeof a!=typeof i?!1:a&&i&&typeof a=="object"&&typeof i=="object"?Object.keys(i).every(r=>Xr(a[r],i[r])):!1}var L1=Object.prototype.hasOwnProperty;function Hx(a,i,r=0){if(a===i)return a;if(r>500)return i;const u=kv(a)&&kv(i);if(!u&&!(Ud(a)&&Ud(i)))return i;const m=(u?a:Object.keys(a)).length,h=u?i:Object.keys(i),x=h.length,p=u?new Array(x):{};let v=0;for(let g=0;g<x;g++){const b=u?g:h[g],E=a[b],T=i[b];if(E===T){p[b]=E,(u?g<m:L1.call(a,b))&&v++;continue}if(E===null||T===null||typeof E!="object"||typeof T!="object"){p[b]=T;continue}const A=Hx(E,T,r+1);p[b]=A,A===E&&v++}return m===x&&v===m?a:p}function Go(a,i){if(!i||Object.keys(a).length!==Object.keys(i).length)return!1;for(const r in a)if(a[r]!==i[r])return!1;return!0}function kv(a){return Array.isArray(a)&&a.length===Object.keys(a).length}function Ud(a){if(!_v(a))return!1;const i=a.constructor;if(i===void 0)return!0;const r=i.prototype;return!(!_v(r)||!r.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(a)!==Object.prototype)}function _v(a){return Object.prototype.toString.call(a)==="[object Object]"}function q1(a){return new Promise(i=>{xn.setTimeout(i,a)})}function Bd(a,i,r){return typeof r.structuralSharing=="function"?r.structuralSharing(a,i):r.structuralSharing!==!1?Hx(a,i):i}function Q1(a,i,r=0){const u=[...a,i];return r&&u.length>r?u.slice(1):u}function Y1(a,i,r=0){const u=[i,...a];return r&&u.length>r?u.slice(0,-1):u}var vf=Symbol();function Lx(a,i){return!a.queryFn&&(i!=null&&i.initialPromise)?()=>i.initialPromise:!a.queryFn||a.queryFn===vf?()=>Promise.reject(new Error(`Missing queryFn: '${a.queryHash}'`)):a.queryFn}function xf(a,i){return typeof a=="function"?a(...i):!!a}function G1(a,i,r){let u=!1,d;return Object.defineProperty(a,"signal",{enumerable:!0,get:()=>(d??(d=i()),u||(u=!0,d.aborted?r():d.addEventListener("abort",r,{once:!0})),d)}),a}var Vr=(()=>{let a=()=>B1;return{isServer(){return a()},setIsServer(i){a=i}}})();function Hd(){let a,i;const r=new Promise((d,m)=>{a=d,i=m});r.status="pending",r.catch(()=>{});function u(d){Object.assign(r,d),delete r.resolve,delete r.reject}return r.resolve=d=>{u({status:"fulfilled",value:d}),a(d)},r.reject=d=>{u({status:"rejected",reason:d}),i(d)},r}var K1=U1;function X1(){let a=[],i=0,r=x=>{x()},u=x=>{x()},d=K1;const m=x=>{i?a.push(x):d(()=>{r(x)})},h=()=>{const x=a;a=[],x.length&&d(()=>{u(()=>{x.forEach(p=>{r(p)})})})};return{batch:x=>{let p;i++;try{p=x()}finally{i--,i||h()}return p},batchCalls:x=>(...p)=>{m(()=>{x(...p)})},schedule:m,setNotifyFunction:x=>{r=x},setBatchNotifyFunction:x=>{u=x},setScheduler:x=>{d=x}}}var st=X1(),Ti,Ba,Ci,ux,V1=(ux=class extends Qi{constructor(){super();ue(this,Ti,!0);ue(this,Ba);ue(this,Ci);ee(this,Ci,i=>{if(typeof window<"u"&&window.addEventListener){const r=()=>i(!0),u=()=>i(!1);return window.addEventListener("online",r,!1),window.addEventListener("offline",u,!1),()=>{window.removeEventListener("online",r),window.removeEventListener("offline",u)}}})}onSubscribe(){N(this,Ba)||this.setEventListener(N(this,Ci))}onUnsubscribe(){var i;this.hasListeners()||((i=N(this,Ba))==null||i.call(this),ee(this,Ba,void 0))}setEventListener(i){var r;ee(this,Ci,i),(r=N(this,Ba))==null||r.call(this),ee(this,Ba,i(this.setOnline.bind(this)))}setOnline(i){N(this,Ti)!==i&&(ee(this,Ti,i),this.listeners.forEach(u=>{u(i)}))}isOnline(){return N(this,Ti)}},Ti=new WeakMap,Ba=new WeakMap,Ci=new WeakMap,ux),Ko=new V1;function Z1(a){return Math.min(1e3*2**a,3e4)}function qx(a){return(a??"online")==="online"?Ko.isOnline():!0}var Ld=class extends Error{constructor(a){super("CancelledError"),this.revert=a==null?void 0:a.revert,this.silent=a==null?void 0:a.silent}};function Qx(a){let i=!1,r=0,u;const d=Hd(),m=()=>d.status!=="pending",h=z=>{var Q;if(!m()){const U=new Ld(z);E(U),(Q=a.onCancel)==null||Q.call(a,U)}},x=()=>{i=!0},p=()=>{i=!1},v=()=>hf.isFocused()&&(a.networkMode==="always"||Ko.isOnline())&&a.canRun(),g=()=>qx(a.networkMode)&&a.canRun(),b=z=>{m()||(u==null||u(),d.resolve(z))},E=z=>{m()||(u==null||u(),d.reject(z))},T=()=>new Promise(z=>{var Q;u=U=>{(m()||v())&&z(U)},(Q=a.onPause)==null||Q.call(a)}).then(()=>{var z;u=void 0,m()||(z=a.onContinue)==null||z.call(a)}),A=()=>{if(m())return;let z;const Q=r===0?a.initialPromise:void 0;try{z=Q??a.fn()}catch(U){z=Promise.reject(U)}Promise.resolve(z).then(b).catch(U=>{var P;if(m())return;const L=a.retry??(Vr.isServer()?0:3),K=a.retryDelay??Z1,B=typeof K=="function"?K(r,U):K,V=L===!0||typeof L=="number"&&r<L||typeof L=="function"&&L(r,U);if(i||!V){E(U);return}r++,(P=a.onFail)==null||P.call(a,r,U),q1(B).then(()=>v()?void 0:T()).then(()=>{i?E(U):A()})})};return{promise:d,status:()=>d.status,cancel:h,continue:()=>(u==null||u(),d),cancelRetry:x,continueRetry:p,canStart:g,start:()=>(g()?A():T().then(A),d)}}var bn,cx,Yx=(cx=class{constructor(){ue(this,bn)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Dd(this.gcTime)&&ee(this,bn,xn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(a){this.gcTime=Math.max(this.gcTime||0,a??(Vr.isServer()?1/0:300*1e3))}clearGcTimeout(){N(this,bn)!==void 0&&(xn.clearTimeout(N(this,bn)),ee(this,bn,void 0))}},bn=new WeakMap,cx);function $1(a){return{onFetch:(i,r)=>{var g,b,E,T,A;const u=i.options,d=(E=(b=(g=i.fetchOptions)==null?void 0:g.meta)==null?void 0:b.fetchMore)==null?void 0:E.direction,m=((T=i.state.data)==null?void 0:T.pages)||[],h=((A=i.state.data)==null?void 0:A.pageParams)||[];let x={pages:[],pageParams:[]},p=0;const v=async()=>{let z=!1;const Q=K=>{G1(K,()=>i.signal,()=>z=!0)},U=Lx(i.options,i.fetchOptions),L=async(K,B,V)=>{if(z)return Promise.reject(i.signal.reason);if(B==null&&K.pages.length)return Promise.resolve(K);const J=(()=>{const F={client:i.client,queryKey:i.queryKey,pageParam:B,direction:V?"backward":"forward",meta:i.options.meta};return Q(F),F})(),I=await U(J),{maxPages:te}=i.options,se=V?Y1:Q1;return{pages:se(K.pages,I,te),pageParams:se(K.pageParams,B,te)}};if(d&&m.length){const K=d==="backward",B=K?J1:Dv,V={pages:m,pageParams:h},P=B(u,V);x=await L(V,P,K)}else{const K=a??m.length;do{const B=p===0?h[0]??u.initialPageParam:Dv(u,x);if(p>0&&B==null)break;x=await L(x,B),p++}while(p<K)}return x};i.options.persister?i.fetchFn=()=>{var z,Q;return(Q=(z=i.options).persister)==null?void 0:Q.call(z,v,{client:i.client,queryKey:i.queryKey,meta:i.options.meta,signal:i.signal},r)}:i.fetchFn=v}}}function Dv(a,{pages:i,pageParams:r}){const u=i.length-1;return i.length>0?a.getNextPageParam(i[u],i,r[u],r):void 0}function J1(a,{pages:i,pageParams:r}){var u;return i.length>0?(u=a.getPreviousPageParam)==null?void 0:u.call(a,i[0],i,r[0],r):void 0}var Ei,gn,Ai,ol,jn,ft,Pr,Sn,Jt,Gx,Wl,dx,F1=(dx=class extends Yx{constructor(i){super();ue(this,Jt);ue(this,Ei);ue(this,gn);ue(this,Ai);ue(this,ol);ue(this,jn);ue(this,ft);ue(this,Pr);ue(this,Sn);ee(this,Sn,!1),ee(this,Pr,i.defaultOptions),this.setOptions(i.options),this.observers=[],ee(this,jn,i.client),ee(this,ol,N(this,jn).getQueryCache()),this.queryKey=i.queryKey,this.queryHash=i.queryHash,ee(this,gn,Bv(this.options)),this.state=i.state??N(this,gn),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return N(this,Ei)}get promise(){var i;return(i=N(this,ft))==null?void 0:i.promise}setOptions(i){if(this.options={...N(this,Pr),...i},i!=null&&i._type&&ee(this,Ei,i._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=Bv(this.options);r.data!==void 0&&(this.setState(Uv(r.data,r.dataUpdatedAt)),ee(this,gn,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&N(this,ol).remove(this)}setData(i,r){const u=Bd(this.state.data,i,this.options);return ye(this,Jt,Wl).call(this,{data:u,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),u}setState(i){ye(this,Jt,Wl).call(this,{type:"setState",state:i})}cancel(i){var u,d;const r=(u=N(this,ft))==null?void 0:u.promise;return(d=N(this,ft))==null||d.cancel(i),r?r.then(Et).catch(Et):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return N(this,gn)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(i=>Ft(i.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===vf||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(i=>Ka(i.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(i=>i.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(i=0){return this.state.data===void 0?!0:i==="static"?!1:this.state.isInvalidated?!0:!Bx(this.state.dataUpdatedAt,i)}onFocus(){var r;const i=this.observers.find(u=>u.shouldFetchOnWindowFocus());i==null||i.refetch({cancelRefetch:!1}),(r=N(this,ft))==null||r.continue()}onOnline(){var r;const i=this.observers.find(u=>u.shouldFetchOnReconnect());i==null||i.refetch({cancelRefetch:!1}),(r=N(this,ft))==null||r.continue()}addObserver(i){this.observers.includes(i)||(this.observers.push(i),this.clearGcTimeout(),N(this,ol).notify({type:"observerAdded",query:this,observer:i}))}removeObserver(i){this.observers.includes(i)&&(this.observers=this.observers.filter(r=>r!==i),this.observers.length||(N(this,ft)&&(N(this,Sn)||ye(this,Jt,Gx).call(this)?N(this,ft).cancel({revert:!0}):N(this,ft).cancelRetry()),this.scheduleGc()),N(this,ol).notify({type:"observerRemoved",query:this,observer:i}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ye(this,Jt,Wl).call(this,{type:"invalidate"})}async fetch(i,r){var v,g,b,E,T,A,z,Q,U,L,K;if(this.state.fetchStatus!=="idle"&&((v=N(this,ft))==null?void 0:v.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(N(this,ft))return N(this,ft).continueRetry(),N(this,ft).promise}if(i&&this.setOptions(i),!this.options.queryFn){const B=this.observers.find(V=>V.options.queryFn);B&&this.setOptions(B.options)}const u=new AbortController,d=B=>{Object.defineProperty(B,"signal",{enumerable:!0,get:()=>(ee(this,Sn,!0),u.signal)})},m=()=>{const B=Lx(this.options,r),P=(()=>{const J={client:N(this,jn),queryKey:this.queryKey,meta:this.meta};return d(J),J})();return ee(this,Sn,!1),this.options.persister?this.options.persister(B,P,this):B(P)},x=(()=>{const B={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:N(this,jn),state:this.state,fetchFn:m};return d(B),B})(),p=N(this,Ei)==="infinite"?$1(this.options.pages):this.options.behavior;p==null||p.onFetch(x,this),ee(this,Ai,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=x.fetchOptions)==null?void 0:g.meta))&&ye(this,Jt,Wl).call(this,{type:"fetch",meta:(b=x.fetchOptions)==null?void 0:b.meta}),ee(this,ft,Qx({initialPromise:r==null?void 0:r.initialPromise,fn:x.fetchFn,onCancel:B=>{B instanceof Ld&&B.revert&&this.setState({...N(this,Ai),fetchStatus:"idle"}),u.abort()},onFail:(B,V)=>{ye(this,Jt,Wl).call(this,{type:"failed",failureCount:B,error:V})},onPause:()=>{ye(this,Jt,Wl).call(this,{type:"pause"})},onContinue:()=>{ye(this,Jt,Wl).call(this,{type:"continue"})},retry:x.options.retry,retryDelay:x.options.retryDelay,networkMode:x.options.networkMode,canRun:()=>!0}));try{const B=await N(this,ft).start();if(B===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(B),(T=(E=N(this,ol).config).onSuccess)==null||T.call(E,B,this),(z=(A=N(this,ol).config).onSettled)==null||z.call(A,B,this.state.error,this),B}catch(B){if(B instanceof Ld){if(B.silent)return N(this,ft).promise;if(B.revert){if(this.state.data===void 0)throw B;return this.state.data}}throw ye(this,Jt,Wl).call(this,{type:"error",error:B}),(U=(Q=N(this,ol).config).onError)==null||U.call(Q,B,this),(K=(L=N(this,ol).config).onSettled)==null||K.call(L,this.state.data,B,this),B}finally{this.scheduleGc()}}},Ei=new WeakMap,gn=new WeakMap,Ai=new WeakMap,ol=new WeakMap,jn=new WeakMap,ft=new WeakMap,Pr=new WeakMap,Sn=new WeakMap,Jt=new WeakSet,Gx=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Wl=function(i){const r=u=>{switch(i.type){case"failed":return{...u,fetchFailureCount:i.failureCount,fetchFailureReason:i.error};case"pause":return{...u,fetchStatus:"paused"};case"continue":return{...u,fetchStatus:"fetching"};case"fetch":return{...u,...Kx(u.data,this.options),fetchMeta:i.meta??null};case"success":const d={...u,...Uv(i.data,i.dataUpdatedAt),dataUpdateCount:u.dataUpdateCount+1,...!i.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ee(this,Ai,i.manual?d:void 0),d;case"error":const m=i.error;return{...u,error:m,errorUpdateCount:u.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:u.fetchFailureCount+1,fetchFailureReason:m,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...u,isInvalidated:!0};case"setState":return{...u,...i.state}}};this.state=r(this.state),st.batch(()=>{this.observers.forEach(u=>{u.onQueryUpdate()}),N(this,ol).notify({query:this,type:"updated",action:i})})},dx);function Kx(a,i){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:qx(i.networkMode)?"fetching":"paused",...a===void 0&&{error:null,status:"pending"}}}function Uv(a,i){return{data:a,dataUpdatedAt:i??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Bv(a){const i=typeof a.initialData=="function"?a.initialData():a.initialData,r=i!==void 0,u=r?typeof a.initialDataUpdatedAt=="function"?a.initialDataUpdatedAt():a.initialDataUpdatedAt:0;return{data:i,dataUpdateCount:0,dataUpdatedAt:r?u??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:r?"success":"pending",fetchStatus:"idle"}}var Bt,Ee,Wr,Ct,Nn,zi,Il,Ha,Ir,Ri,Oi,Mn,wn,La,ki,_e,Yr,qd,Qd,Yd,Gd,Kd,Xd,Vd,Xx,fx,P1=(fx=class extends Qi{constructor(i,r){super();ue(this,_e);ue(this,Bt);ue(this,Ee);ue(this,Wr);ue(this,Ct);ue(this,Nn);ue(this,zi);ue(this,Il);ue(this,Ha);ue(this,Ir);ue(this,Ri);ue(this,Oi);ue(this,Mn);ue(this,wn);ue(this,La);ue(this,ki,new Set);this.options=r,ee(this,Bt,i),ee(this,Ha,null),ee(this,Il,Hd()),this.bindMethods(),this.setOptions(r)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(N(this,Ee).addObserver(this),Hv(N(this,Ee),this.options)?ye(this,_e,Yr).call(this):this.updateResult(),ye(this,_e,Gd).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Zd(N(this,Ee),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Zd(N(this,Ee),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ye(this,_e,Kd).call(this),ye(this,_e,Xd).call(this),N(this,Ee).removeObserver(this)}setOptions(i){const r=this.options,u=N(this,Ee);if(this.options=N(this,Bt).defaultQueryOptions(i),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Ft(this.options.enabled,N(this,Ee))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ye(this,_e,Vd).call(this),N(this,Ee).setOptions(this.options),r._defaulted&&!Go(this.options,r)&&N(this,Bt).getQueryCache().notify({type:"observerOptionsUpdated",query:N(this,Ee),observer:this});const d=this.hasListeners();d&&Lv(N(this,Ee),u,this.options,r)&&ye(this,_e,Yr).call(this),this.updateResult(),d&&(N(this,Ee)!==u||Ft(this.options.enabled,N(this,Ee))!==Ft(r.enabled,N(this,Ee))||Ka(this.options.staleTime,N(this,Ee))!==Ka(r.staleTime,N(this,Ee)))&&ye(this,_e,qd).call(this);const m=ye(this,_e,Qd).call(this);d&&(N(this,Ee)!==u||Ft(this.options.enabled,N(this,Ee))!==Ft(r.enabled,N(this,Ee))||m!==N(this,La))&&ye(this,_e,Yd).call(this,m)}getOptimisticResult(i){const r=N(this,Bt).getQueryCache().build(N(this,Bt),i),u=this.createResult(r,i);return I1(this,u)&&(ee(this,Ct,u),ee(this,zi,this.options),ee(this,Nn,N(this,Ee).state)),u}getCurrentResult(){return N(this,Ct)}trackResult(i,r){return new Proxy(i,{get:(u,d)=>(this.trackProp(d),r==null||r(d),d==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&N(this,Il).status==="pending"&&N(this,Il).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(u,d))})}trackProp(i){N(this,ki).add(i)}getCurrentQuery(){return N(this,Ee)}refetch({...i}={}){return this.fetch({...i})}fetchOptimistic(i){const r=N(this,Bt).defaultQueryOptions(i),u=N(this,Bt).getQueryCache().build(N(this,Bt),r);return u.fetch().then(()=>this.createResult(u,r))}fetch(i){return ye(this,_e,Yr).call(this,{...i,cancelRefetch:i.cancelRefetch??!0}).then(()=>(this.updateResult(),N(this,Ct)))}createResult(i,r){var te;const u=N(this,Ee),d=this.options,m=N(this,Ct),h=N(this,Nn),x=N(this,zi),v=i!==u?i.state:N(this,Wr),{state:g}=i;let b={...g},E=!1,T;if(r._optimisticResults){const se=this.hasListeners(),F=!se&&Hv(i,r),fe=se&&Lv(i,u,r,d);(F||fe)&&(b={...b,...Kx(g.data,i.options)}),r._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:A,errorUpdatedAt:z,status:Q}=b;T=b.data;let U=!1;if(r.placeholderData!==void 0&&T===void 0&&Q==="pending"){let se;m!=null&&m.isPlaceholderData&&r.placeholderData===(x==null?void 0:x.placeholderData)?(se=m.data,U=!0):se=typeof r.placeholderData=="function"?r.placeholderData((te=N(this,Oi))==null?void 0:te.state.data,N(this,Oi)):r.placeholderData,se!==void 0&&(Q="success",T=Bd(m==null?void 0:m.data,se,r),E=!0)}if(r.select&&T!==void 0&&!U)if(m&&T===(h==null?void 0:h.data)&&r.select===N(this,Ir))T=N(this,Ri);else try{ee(this,Ir,r.select),T=r.select(T),T=Bd(m==null?void 0:m.data,T,r),ee(this,Ri,T),ee(this,Ha,null)}catch(se){ee(this,Ha,se)}N(this,Ha)&&(A=N(this,Ha),T=N(this,Ri),z=Date.now(),Q="error");const L=b.fetchStatus==="fetching",K=Q==="pending",B=Q==="error",V=K&&L,P=T!==void 0,I={status:Q,fetchStatus:b.fetchStatus,isPending:K,isSuccess:Q==="success",isError:B,isInitialLoading:V,isLoading:V,data:T,dataUpdatedAt:b.dataUpdatedAt,error:A,errorUpdatedAt:z,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:i.isFetched(),isFetchedAfterMount:b.dataUpdateCount>v.dataUpdateCount||b.errorUpdateCount>v.errorUpdateCount,isFetching:L,isRefetching:L&&!K,isLoadingError:B&&!P,isPaused:b.fetchStatus==="paused",isPlaceholderData:E,isRefetchError:B&&P,isStale:yf(i,r),refetch:this.refetch,promise:N(this,Il),isEnabled:Ft(r.enabled,i)!==!1};if(this.options.experimental_prefetchInRender){const se=I.data!==void 0,F=I.status==="error"&&!se,fe=me=>{F?me.reject(I.error):se&&me.resolve(I.data)},pe=()=>{const me=ee(this,Il,I.promise=Hd());fe(me)},Ae=N(this,Il);switch(Ae.status){case"pending":i.queryHash===u.queryHash&&fe(Ae);break;case"fulfilled":(F||I.data!==Ae.value)&&pe();break;case"rejected":(!F||I.error!==Ae.reason)&&pe();break}}return I}updateResult(){const i=N(this,Ct),r=this.createResult(N(this,Ee),this.options);if(ee(this,Nn,N(this,Ee).state),ee(this,zi,this.options),N(this,Nn).data!==void 0&&ee(this,Oi,N(this,Ee)),Go(r,i))return;ee(this,Ct,r);const u=()=>{if(!i)return!0;const{notifyOnChangeProps:d}=this.options,m=typeof d=="function"?d():d;if(m==="all"||!m&&!N(this,ki).size)return!0;const h=new Set(m??N(this,ki));return this.options.throwOnError&&h.add("error"),Object.keys(N(this,Ct)).some(x=>{const p=x;return N(this,Ct)[p]!==i[p]&&h.has(p)})};ye(this,_e,Xx).call(this,{listeners:u()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ye(this,_e,Gd).call(this)}},Bt=new WeakMap,Ee=new WeakMap,Wr=new WeakMap,Ct=new WeakMap,Nn=new WeakMap,zi=new WeakMap,Il=new WeakMap,Ha=new WeakMap,Ir=new WeakMap,Ri=new WeakMap,Oi=new WeakMap,Mn=new WeakMap,wn=new WeakMap,La=new WeakMap,ki=new WeakMap,_e=new WeakSet,Yr=function(i){ye(this,_e,Vd).call(this);let r=N(this,Ee).fetch(this.options,i);return i!=null&&i.throwOnError||(r=r.catch(Et)),r},qd=function(){ye(this,_e,Kd).call(this);const i=Ka(this.options.staleTime,N(this,Ee));if(Vr.isServer()||N(this,Ct).isStale||!Dd(i))return;const u=Bx(N(this,Ct).dataUpdatedAt,i)+1;ee(this,Mn,xn.setTimeout(()=>{N(this,Ct).isStale||this.updateResult()},u))},Qd=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(N(this,Ee)):this.options.refetchInterval)??!1},Yd=function(i){ye(this,_e,Xd).call(this),ee(this,La,i),!(Vr.isServer()||Ft(this.options.enabled,N(this,Ee))===!1||!Dd(N(this,La))||N(this,La)===0)&&ee(this,wn,xn.setInterval(()=>{(this.options.refetchIntervalInBackground||hf.isFocused())&&ye(this,_e,Yr).call(this)},N(this,La)))},Gd=function(){ye(this,_e,qd).call(this),ye(this,_e,Yd).call(this,ye(this,_e,Qd).call(this))},Kd=function(){N(this,Mn)!==void 0&&(xn.clearTimeout(N(this,Mn)),ee(this,Mn,void 0))},Xd=function(){N(this,wn)!==void 0&&(xn.clearInterval(N(this,wn)),ee(this,wn,void 0))},Vd=function(){const i=N(this,Bt).getQueryCache().build(N(this,Bt),this.options);if(i===N(this,Ee))return;const r=N(this,Ee);ee(this,Ee,i),ee(this,Wr,i.state),this.hasListeners()&&(r==null||r.removeObserver(this),i.addObserver(this))},Xx=function(i){st.batch(()=>{i.listeners&&this.listeners.forEach(r=>{r(N(this,Ct))}),N(this,Bt).getQueryCache().notify({query:N(this,Ee),type:"observerResultsUpdated"})})},fx);function W1(a,i){return Ft(i.enabled,a)!==!1&&a.state.data===void 0&&!(a.state.status==="error"&&Ft(i.retryOnMount,a)===!1)}function Hv(a,i){return W1(a,i)||a.state.data!==void 0&&Zd(a,i,i.refetchOnMount)}function Zd(a,i,r){if(Ft(i.enabled,a)!==!1&&Ka(i.staleTime,a)!=="static"){const u=typeof r=="function"?r(a):r;return u==="always"||u!==!1&&yf(a,i)}return!1}function Lv(a,i,r,u){return(a!==i||Ft(u.enabled,a)===!1)&&(!r.suspense||a.state.status!=="error")&&yf(a,r)}function yf(a,i){return Ft(i.enabled,a)!==!1&&a.isStaleByTime(Ka(i.staleTime,a))}function I1(a,i){return!Go(a.getCurrentResult(),i)}var es,Al,gt,Tn,zl,_a,mx,e2=(mx=class extends Yx{constructor(i){super();ue(this,zl);ue(this,es);ue(this,Al);ue(this,gt);ue(this,Tn);ee(this,es,i.client),this.mutationId=i.mutationId,ee(this,gt,i.mutationCache),ee(this,Al,[]),this.state=i.state||Vx(),this.setOptions(i.options),this.scheduleGc()}setOptions(i){this.options=i,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(i){N(this,Al).includes(i)||(N(this,Al).push(i),this.clearGcTimeout(),N(this,gt).notify({type:"observerAdded",mutation:this,observer:i}))}removeObserver(i){ee(this,Al,N(this,Al).filter(r=>r!==i)),this.scheduleGc(),N(this,gt).notify({type:"observerRemoved",mutation:this,observer:i})}optionalRemove(){N(this,Al).length||(this.state.status==="pending"?this.scheduleGc():N(this,gt).remove(this))}continue(){var i;return((i=N(this,Tn))==null?void 0:i.continue())??this.execute(this.state.variables)}async execute(i){var h,x,p,v,g,b,E,T,A,z,Q,U,L,K,B,V,P,J;const r=()=>{ye(this,zl,_a).call(this,{type:"continue"})},u={client:N(this,es),meta:this.options.meta,mutationKey:this.options.mutationKey};ee(this,Tn,Qx({fn:()=>this.options.mutationFn?this.options.mutationFn(i,u):Promise.reject(new Error("No mutationFn found")),onFail:(I,te)=>{ye(this,zl,_a).call(this,{type:"failed",failureCount:I,error:te})},onPause:()=>{ye(this,zl,_a).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>N(this,gt).canRun(this)}));const d=this.state.status==="pending",m=!N(this,Tn).canStart();try{if(d)r();else{ye(this,zl,_a).call(this,{type:"pending",variables:i,isPaused:m}),N(this,gt).config.onMutate&&await N(this,gt).config.onMutate(i,this,u);const te=await((x=(h=this.options).onMutate)==null?void 0:x.call(h,i,u));te!==this.state.context&&ye(this,zl,_a).call(this,{type:"pending",context:te,variables:i,isPaused:m})}const I=await N(this,Tn).start();return await((v=(p=N(this,gt).config).onSuccess)==null?void 0:v.call(p,I,i,this.state.context,this,u)),await((b=(g=this.options).onSuccess)==null?void 0:b.call(g,I,i,this.state.context,u)),await((T=(E=N(this,gt).config).onSettled)==null?void 0:T.call(E,I,null,this.state.variables,this.state.context,this,u)),await((z=(A=this.options).onSettled)==null?void 0:z.call(A,I,null,i,this.state.context,u)),ye(this,zl,_a).call(this,{type:"success",data:I}),I}catch(I){try{await((U=(Q=N(this,gt).config).onError)==null?void 0:U.call(Q,I,i,this.state.context,this,u))}catch(te){Promise.reject(te)}try{await((K=(L=this.options).onError)==null?void 0:K.call(L,I,i,this.state.context,u))}catch(te){Promise.reject(te)}try{await((V=(B=N(this,gt).config).onSettled)==null?void 0:V.call(B,void 0,I,this.state.variables,this.state.context,this,u))}catch(te){Promise.reject(te)}try{await((J=(P=this.options).onSettled)==null?void 0:J.call(P,void 0,I,i,this.state.context,u))}catch(te){Promise.reject(te)}throw ye(this,zl,_a).call(this,{type:"error",error:I}),I}finally{N(this,gt).runNext(this)}}},es=new WeakMap,Al=new WeakMap,gt=new WeakMap,Tn=new WeakMap,zl=new WeakSet,_a=function(i){const r=u=>{switch(i.type){case"failed":return{...u,failureCount:i.failureCount,failureReason:i.error};case"pause":return{...u,isPaused:!0};case"continue":return{...u,isPaused:!1};case"pending":return{...u,context:i.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:i.isPaused,status:"pending",variables:i.variables,submittedAt:Date.now()};case"success":return{...u,data:i.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...u,data:void 0,error:i.error,failureCount:u.failureCount+1,failureReason:i.error,isPaused:!1,status:"error"}}};this.state=r(this.state),st.batch(()=>{N(this,Al).forEach(u=>{u.onMutationUpdate(i)}),N(this,gt).notify({mutation:this,type:"updated",action:i})})},mx);function Vx(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var ea,vl,ts,hx,t2=(hx=class extends Qi{constructor(i={}){super();ue(this,ea);ue(this,vl);ue(this,ts);this.config=i,ee(this,ea,new Set),ee(this,vl,new Map),ee(this,ts,0)}build(i,r,u){const d=new e2({client:i,mutationCache:this,mutationId:++zo(this,ts)._,options:i.defaultMutationOptions(r),state:u});return this.add(d),d}add(i){N(this,ea).add(i);const r=Oo(i);if(typeof r=="string"){const u=N(this,vl).get(r);u?u.push(i):N(this,vl).set(r,[i])}this.notify({type:"added",mutation:i})}remove(i){if(N(this,ea).delete(i)){const r=Oo(i);if(typeof r=="string"){const u=N(this,vl).get(r);if(u)if(u.length>1){const d=u.indexOf(i);d!==-1&&u.splice(d,1)}else u[0]===i&&N(this,vl).delete(r)}}this.notify({type:"removed",mutation:i})}canRun(i){const r=Oo(i);if(typeof r=="string"){const u=N(this,vl).get(r),d=u==null?void 0:u.find(m=>m.state.status==="pending");return!d||d===i}else return!0}runNext(i){var u;const r=Oo(i);if(typeof r=="string"){const d=(u=N(this,vl).get(r))==null?void 0:u.find(m=>m!==i&&m.state.isPaused);return(d==null?void 0:d.continue())??Promise.resolve()}else return Promise.resolve()}clear(){st.batch(()=>{N(this,ea).forEach(i=>{this.notify({type:"removed",mutation:i})}),N(this,ea).clear(),N(this,vl).clear()})}getAll(){return Array.from(N(this,ea))}find(i){const r={exact:!0,...i};return this.getAll().find(u=>Ov(r,u))}findAll(i={}){return this.getAll().filter(r=>Ov(i,r))}notify(i){st.batch(()=>{this.listeners.forEach(r=>{r(i)})})}resumePausedMutations(){const i=this.getAll().filter(r=>r.state.isPaused);return st.batch(()=>Promise.all(i.map(r=>r.continue().catch(Et))))}},ea=new WeakMap,vl=new WeakMap,ts=new WeakMap,hx);function Oo(a){var i;return(i=a.options.scope)==null?void 0:i.id}var ta,qa,Ht,la,aa,Ho,$d,px,l2=(px=class extends Qi{constructor(r,u){super();ue(this,aa);ue(this,ta);ue(this,qa);ue(this,Ht);ue(this,la);ee(this,ta,r),this.setOptions(u),this.bindMethods(),ye(this,aa,Ho).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(r){var d;const u=this.options;this.options=N(this,ta).defaultMutationOptions(r),Go(this.options,u)||N(this,ta).getMutationCache().notify({type:"observerOptionsUpdated",mutation:N(this,Ht),observer:this}),u!=null&&u.mutationKey&&this.options.mutationKey&&Cn(u.mutationKey)!==Cn(this.options.mutationKey)?this.reset():((d=N(this,Ht))==null?void 0:d.state.status)==="pending"&&N(this,Ht).setOptions(this.options)}onUnsubscribe(){var r;this.hasListeners()||(r=N(this,Ht))==null||r.removeObserver(this)}onMutationUpdate(r){ye(this,aa,Ho).call(this),ye(this,aa,$d).call(this,r)}getCurrentResult(){return N(this,qa)}reset(){var r;(r=N(this,Ht))==null||r.removeObserver(this),ee(this,Ht,void 0),ye(this,aa,Ho).call(this),ye(this,aa,$d).call(this)}mutate(r,u){var d;return ee(this,la,u),(d=N(this,Ht))==null||d.removeObserver(this),ee(this,Ht,N(this,ta).getMutationCache().build(N(this,ta),this.options)),N(this,Ht).addObserver(this),N(this,Ht).execute(r)}},ta=new WeakMap,qa=new WeakMap,Ht=new WeakMap,la=new WeakMap,aa=new WeakSet,Ho=function(){var u;const r=((u=N(this,Ht))==null?void 0:u.state)??Vx();ee(this,qa,{...r,isPending:r.status==="pending",isSuccess:r.status==="success",isError:r.status==="error",isIdle:r.status==="idle",mutate:this.mutate,reset:this.reset})},$d=function(r){st.batch(()=>{var u,d,m,h,x,p,v,g;if(N(this,la)&&this.hasListeners()){const b=N(this,qa).variables,E=N(this,qa).context,T={client:N(this,ta),meta:this.options.meta,mutationKey:this.options.mutationKey};if((r==null?void 0:r.type)==="success"){try{(d=(u=N(this,la)).onSuccess)==null||d.call(u,r.data,b,E,T)}catch(A){Promise.reject(A)}try{(h=(m=N(this,la)).onSettled)==null||h.call(m,r.data,null,b,E,T)}catch(A){Promise.reject(A)}}else if((r==null?void 0:r.type)==="error"){try{(p=(x=N(this,la)).onError)==null||p.call(x,r.error,b,E,T)}catch(A){Promise.reject(A)}try{(g=(v=N(this,la)).onSettled)==null||g.call(v,void 0,r.error,b,E,T)}catch(A){Promise.reject(A)}}}this.listeners.forEach(b=>{b(N(this,qa))})})},px),Rl,vx,a2=(vx=class extends Qi{constructor(i={}){super();ue(this,Rl);this.config=i,ee(this,Rl,new Map)}build(i,r,u){const d=r.queryKey,m=r.queryHash??pf(d,r);let h=this.get(m);return h||(h=new F1({client:i,queryKey:d,queryHash:m,options:i.defaultQueryOptions(r),state:u,defaultOptions:i.getQueryDefaults(d)}),this.add(h)),h}add(i){N(this,Rl).has(i.queryHash)||(N(this,Rl).set(i.queryHash,i),this.notify({type:"added",query:i}))}remove(i){const r=N(this,Rl).get(i.queryHash);r&&(i.destroy(),r===i&&N(this,Rl).delete(i.queryHash),this.notify({type:"removed",query:i}))}clear(){st.batch(()=>{this.getAll().forEach(i=>{this.remove(i)})})}get(i){return N(this,Rl).get(i)}getAll(){return[...N(this,Rl).values()]}find(i){const r={exact:!0,...i};return this.getAll().find(u=>Rv(r,u))}findAll(i={}){const r=this.getAll();return Object.keys(i).length>0?r.filter(u=>Rv(i,u)):r}notify(i){st.batch(()=>{this.listeners.forEach(r=>{r(i)})})}onFocus(){st.batch(()=>{this.getAll().forEach(i=>{i.onFocus()})})}onOnline(){st.batch(()=>{this.getAll().forEach(i=>{i.onOnline()})})}},Rl=new WeakMap,vx),We,Qa,Ya,_i,Di,Ga,Ui,Bi,xx,n2=(xx=class{constructor(a={}){ue(this,We);ue(this,Qa);ue(this,Ya);ue(this,_i);ue(this,Di);ue(this,Ga);ue(this,Ui);ue(this,Bi);ee(this,We,a.queryCache||new a2),ee(this,Qa,a.mutationCache||new t2),ee(this,Ya,a.defaultOptions||{}),ee(this,_i,new Map),ee(this,Di,new Map),ee(this,Ga,0)}mount(){zo(this,Ga)._++,N(this,Ga)===1&&(ee(this,Ui,hf.subscribe(async a=>{a&&(await this.resumePausedMutations(),N(this,We).onFocus())})),ee(this,Bi,Ko.subscribe(async a=>{a&&(await this.resumePausedMutations(),N(this,We).onOnline())})))}unmount(){var a,i;zo(this,Ga)._--,N(this,Ga)===0&&((a=N(this,Ui))==null||a.call(this),ee(this,Ui,void 0),(i=N(this,Bi))==null||i.call(this),ee(this,Bi,void 0))}isFetching(a){return N(this,We).findAll({...a,fetchStatus:"fetching"}).length}isMutating(a){return N(this,Qa).findAll({...a,status:"pending"}).length}getQueryData(a){var r;const i=this.defaultQueryOptions({queryKey:a});return(r=N(this,We).get(i.queryHash))==null?void 0:r.state.data}ensureQueryData(a){const i=this.defaultQueryOptions(a),r=N(this,We).build(this,i),u=r.state.data;return u===void 0?this.fetchQuery(a):(a.revalidateIfStale&&r.isStaleByTime(Ka(i.staleTime,r))&&this.prefetchQuery(i),Promise.resolve(u))}getQueriesData(a){return N(this,We).findAll(a).map(({queryKey:i,state:r})=>{const u=r.data;return[i,u]})}setQueryData(a,i,r){const u=this.defaultQueryOptions({queryKey:a}),d=N(this,We).get(u.queryHash),m=d==null?void 0:d.state.data,h=H1(i,m);if(h!==void 0)return N(this,We).build(this,u).setData(h,{...r,manual:!0})}setQueriesData(a,i,r){return st.batch(()=>N(this,We).findAll(a).map(({queryKey:u})=>[u,this.setQueryData(u,i,r)]))}getQueryState(a){var r;const i=this.defaultQueryOptions({queryKey:a});return(r=N(this,We).get(i.queryHash))==null?void 0:r.state}removeQueries(a){const i=N(this,We);st.batch(()=>{i.findAll(a).forEach(r=>{i.remove(r)})})}resetQueries(a,i){const r=N(this,We);return st.batch(()=>(r.findAll(a).forEach(u=>{u.reset()}),this.refetchQueries({type:"active",...a},i)))}cancelQueries(a,i={}){const r={revert:!0,...i},u=st.batch(()=>N(this,We).findAll(a).map(d=>d.cancel(r)));return Promise.all(u).then(Et).catch(Et)}invalidateQueries(a,i={}){return st.batch(()=>(N(this,We).findAll(a).forEach(r=>{r.invalidate()}),(a==null?void 0:a.refetchType)==="none"?Promise.resolve():this.refetchQueries({...a,type:(a==null?void 0:a.refetchType)??(a==null?void 0:a.type)??"active"},i)))}refetchQueries(a,i={}){const r={...i,cancelRefetch:i.cancelRefetch??!0},u=st.batch(()=>N(this,We).findAll(a).filter(d=>!d.isDisabled()&&!d.isStatic()).map(d=>{let m=d.fetch(void 0,r);return r.throwOnError||(m=m.catch(Et)),d.state.fetchStatus==="paused"?Promise.resolve():m}));return Promise.all(u).then(Et)}fetchQuery(a){const i=this.defaultQueryOptions(a);i.retry===void 0&&(i.retry=!1);const r=N(this,We).build(this,i);return r.isStaleByTime(Ka(i.staleTime,r))?r.fetch(i):Promise.resolve(r.state.data)}prefetchQuery(a){return this.fetchQuery(a).then(Et).catch(Et)}fetchInfiniteQuery(a){return a._type="infinite",this.fetchQuery(a)}prefetchInfiniteQuery(a){return this.fetchInfiniteQuery(a).then(Et).catch(Et)}ensureInfiniteQueryData(a){return a._type="infinite",this.ensureQueryData(a)}resumePausedMutations(){return Ko.isOnline()?N(this,Qa).resumePausedMutations():Promise.resolve()}getQueryCache(){return N(this,We)}getMutationCache(){return N(this,Qa)}getDefaultOptions(){return N(this,Ya)}setDefaultOptions(a){ee(this,Ya,a)}setQueryDefaults(a,i){N(this,_i).set(Cn(a),{queryKey:a,defaultOptions:i})}getQueryDefaults(a){const i=[...N(this,_i).values()],r={};return i.forEach(u=>{Xr(a,u.queryKey)&&Object.assign(r,u.defaultOptions)}),r}setMutationDefaults(a,i){N(this,Di).set(Cn(a),{mutationKey:a,defaultOptions:i})}getMutationDefaults(a){const i=[...N(this,Di).values()],r={};return i.forEach(u=>{Xr(a,u.mutationKey)&&Object.assign(r,u.defaultOptions)}),r}defaultQueryOptions(a){if(a._defaulted)return a;const i={...N(this,Ya).queries,...this.getQueryDefaults(a.queryKey),...a,_defaulted:!0};return i.queryHash||(i.queryHash=pf(i.queryKey,i)),i.refetchOnReconnect===void 0&&(i.refetchOnReconnect=i.networkMode!=="always"),i.throwOnError===void 0&&(i.throwOnError=!!i.suspense),!i.networkMode&&i.persister&&(i.networkMode="offlineFirst"),i.queryFn===vf&&(i.enabled=!1),i}defaultMutationOptions(a){return a!=null&&a._defaulted?a:{...N(this,Ya).mutations,...(a==null?void 0:a.mutationKey)&&this.getMutationDefaults(a.mutationKey),...a,_defaulted:!0}}clear(){N(this,We).clear(),N(this,Qa).clear()}},We=new WeakMap,Qa=new WeakMap,Ya=new WeakMap,_i=new WeakMap,Di=new WeakMap,Ga=new WeakMap,Ui=new WeakMap,Bi=new WeakMap,xx),Zx=j.createContext(void 0),rs=a=>{const i=j.useContext(Zx);if(!i)throw new Error("No QueryClient set, use QueryClientProvider to set one");return i},i2=({client:a,children:i})=>(j.useEffect(()=>(a.mount(),()=>{a.unmount()}),[a]),s.jsx(Zx.Provider,{value:a,children:i})),$x=j.createContext(!1),r2=()=>j.useContext($x);$x.Provider;function s2(){let a=!1;return{clearReset:()=>{a=!1},reset:()=>{a=!0},isReset:()=>a}}var o2=j.createContext(s2()),u2=()=>j.useContext(o2),c2=(a,i,r)=>{const u=r!=null&&r.state.error&&typeof a.throwOnError=="function"?xf(a.throwOnError,[r.state.error,r]):a.throwOnError;(a.suspense||a.experimental_prefetchInRender||u)&&(i.isReset()||(a.retryOnMount=!1))},d2=a=>{j.useEffect(()=>{a.clearReset()},[a])},f2=({result:a,errorResetBoundary:i,throwOnError:r,query:u,suspense:d})=>a.isError&&!i.isReset()&&!a.isFetching&&u&&(d&&a.data===void 0||xf(r,[a.error,u])),m2=a=>{if(a.suspense){const r=d=>d==="static"?d:Math.max(d??1e3,1e3),u=a.staleTime;a.staleTime=typeof u=="function"?(...d)=>r(u(...d)):r(u),typeof a.gcTime=="number"&&(a.gcTime=Math.max(a.gcTime,1e3))}},h2=(a,i)=>a.isLoading&&a.isFetching&&!i,p2=(a,i)=>(a==null?void 0:a.suspense)&&i.isPending,qv=(a,i,r)=>i.fetchOptimistic(a).catch(()=>{r.clearReset()});function v2(a,i,r){var T,A,z,Q;const u=r2(),d=u2(),m=rs(),h=m.defaultQueryOptions(a);(A=(T=m.getDefaultOptions().queries)==null?void 0:T._experimental_beforeQuery)==null||A.call(T,h);const x=m.getQueryCache().get(h.queryHash),p=a.subscribed!==!1;h._optimisticResults=u?"isRestoring":p?"optimistic":void 0,m2(h),c2(h,d,x),d2(d);const v=!m.getQueryCache().get(h.queryHash),[g]=j.useState(()=>new i(m,h)),b=g.getOptimisticResult(h),E=!u&&p;if(j.useSyncExternalStore(j.useCallback(U=>{const L=E?g.subscribe(st.batchCalls(U)):Et;return g.updateResult(),L},[g,E]),()=>g.getCurrentResult(),()=>g.getCurrentResult()),j.useEffect(()=>{g.setOptions(h)},[h,g]),p2(h,b))throw qv(h,g,d);if(f2({result:b,errorResetBoundary:d,throwOnError:h.throwOnError,query:x,suspense:h.suspense}))throw b.error;if((Q=(z=m.getDefaultOptions().queries)==null?void 0:z._experimental_afterQuery)==null||Q.call(z,h,b),h.experimental_prefetchInRender&&!Vr.isServer()&&h2(b,u)){const U=v?qv(h,g,d):x==null?void 0:x.promise;U==null||U.catch(Et).finally(()=>{g.updateResult()})}return h.notifyOnChangeProps?b:g.trackResult(b)}function cl(a,i){return v2(a,P1)}function En(a,i){const r=rs(),[u]=j.useState(()=>new l2(r,a));j.useEffect(()=>{u.setOptions(a)},[u,a]);const d=j.useSyncExternalStore(j.useCallback(h=>u.subscribe(st.batchCalls(h)),[u]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),m=j.useCallback((h,x)=>{u.mutate(h,x).catch(Et)},[u]);if(d.error&&xf(u.options.throwOnError,[d.error]))throw d.error;return{...d,mutate:m,mutateAsync:d.mutate}}/**
61
+ * @license lucide-react v1.17.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const Jx=(...a)=>a.filter((i,r,u)=>!!i&&i.trim()!==""&&u.indexOf(i)===r).join(" ").trim();/**
66
+ * @license lucide-react v1.17.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */const x2=a=>a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
71
+ * @license lucide-react v1.17.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const y2=a=>a.replace(/^([A-Z])|[\s-_]+(\w)/g,(i,r,u)=>u?u.toUpperCase():r.toLowerCase());/**
76
+ * @license lucide-react v1.17.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const Qv=a=>{const i=y2(a);return i.charAt(0).toUpperCase()+i.slice(1)};/**
81
+ * @license lucide-react v1.17.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */var Ed={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
86
+ * @license lucide-react v1.17.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const b2=a=>{for(const i in a)if(i.startsWith("aria-")||i==="role"||i==="title")return!0;return!1},g2=j.createContext({}),j2=()=>j.useContext(g2),S2=j.forwardRef(({color:a,size:i,strokeWidth:r,absoluteStrokeWidth:u,className:d="",children:m,iconNode:h,...x},p)=>{const{size:v=24,strokeWidth:g=2,absoluteStrokeWidth:b=!1,color:E="currentColor",className:T=""}=j2()??{},A=u??b?Number(r??g)*24/Number(i??v):r??g;return j.createElement("svg",{ref:p,...Ed,width:i??v??Ed.width,height:i??v??Ed.height,stroke:a??E,strokeWidth:A,className:Jx("lucide",T,d),...!m&&!b2(x)&&{"aria-hidden":"true"},...x},[...h.map(([z,Q])=>j.createElement(z,Q)),...Array.isArray(m)?m:[m]])});/**
91
+ * @license lucide-react v1.17.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const Qe=(a,i)=>{const r=j.forwardRef(({className:u,...d},m)=>j.createElement(S2,{ref:m,iconNode:i,className:Jx(`lucide-${x2(Qv(a))}`,`lucide-${a}`,u),...d}));return r.displayName=Qv(a),r};/**
96
+ * @license lucide-react v1.17.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const N2=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Yv=Qe("activity",N2);/**
101
+ * @license lucide-react v1.17.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const M2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Po=Qe("arrow-right",M2);/**
106
+ * @license lucide-react v1.17.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const w2=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],Gv=Qe("boxes",w2);/**
111
+ * @license lucide-react v1.17.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const T2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Pt=Qe("check",T2);/**
116
+ * @license lucide-react v1.17.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const C2=[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]],Jd=Qe("circle-dashed",C2);/**
121
+ * @license lucide-react v1.17.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const E2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 6v6h4",key:"135r8i"}]],A2=Qe("clock-3",E2);/**
126
+ * @license lucide-react v1.17.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const z2=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],R2=Qe("copy",z2);/**
131
+ * @license lucide-react v1.17.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const O2=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],k2=Qe("cpu",O2);/**
136
+ * @license lucide-react v1.17.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const _2=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Hi=Qe("credit-card",_2);/**
141
+ * @license lucide-react v1.17.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const D2=[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]],U2=Qe("database",D2);/**
146
+ * @license lucide-react v1.17.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const B2=[["path",{d:"M15 6a9 9 0 0 0-9 9V3",key:"1cii5b"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}]],Fx=Qe("git-branch",B2);/**
151
+ * @license lucide-react v1.17.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const H2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],L2=Qe("globe",H2);/**
156
+ * @license lucide-react v1.17.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const q2=[["path",{d:"M10 18v-7",key:"wt116b"}],["path",{d:"M11.119 2.205a2 2 0 0 1 1.762 0l7.84 3.846A.5.5 0 0 1 20.5 7h-17a.5.5 0 0 1-.22-.949z",key:"yxxwt6"}],["path",{d:"M14 18v-7",key:"vav6t3"}],["path",{d:"M18 18v-7",key:"aexdmj"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M6 18v-7",key:"1ivflk"}]],Q2=Qe("landmark",q2);/**
161
+ * @license lucide-react v1.17.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const Y2=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],At=Qe("loader-circle",Y2);/**
166
+ * @license lucide-react v1.17.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const G2=[["circle",{cx:"12",cy:"16",r:"1",key:"1au0dj"}],["rect",{x:"3",y:"10",width:"18",height:"12",rx:"2",key:"6s8ecr"}],["path",{d:"M7 10V7a5 5 0 0 1 10 0v3",key:"1pqi11"}]],K2=Qe("lock-keyhole",G2);/**
171
+ * @license lucide-react v1.17.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const X2=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],V2=Qe("network",X2);/**
176
+ * @license lucide-react v1.17.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const Z2=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Xo=Qe("plus",Z2);/**
181
+ * @license lucide-react v1.17.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const $2=[["path",{d:"M13 16H8",key:"wsln4y"}],["path",{d:"M14 8H8",key:"1l3xfs"}],["path",{d:"M16 12H8",key:"1fr5h0"}],["path",{d:"M4 3a1 1 0 0 1 1-1 1.3 1.3 0 0 1 .7.2l.933.6a1.3 1.3 0 0 0 1.4 0l.934-.6a1.3 1.3 0 0 1 1.4 0l.933.6a1.3 1.3 0 0 0 1.4 0l.933-.6a1.3 1.3 0 0 1 1.4 0l.934.6a1.3 1.3 0 0 0 1.4 0l.933-.6A1.3 1.3 0 0 1 19 2a1 1 0 0 1 1 1v18a1 1 0 0 1-1 1 1.3 1.3 0 0 1-.7-.2l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.934.6a1.3 1.3 0 0 1-1.4 0l-.933-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-1.4 0l-.934-.6a1.3 1.3 0 0 0-1.4 0l-.933.6a1.3 1.3 0 0 1-.7.2 1 1 0 0 1-1-1z",key:"ycz6yz"}]],J2=Qe("receipt-text",$2);/**
186
+ * @license lucide-react v1.17.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const F2=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],Fd=Qe("refresh-cw",F2);/**
191
+ * @license lucide-react v1.17.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const P2=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Wo=Qe("search",P2);/**
196
+ * @license lucide-react v1.17.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const W2=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],I2=Qe("settings-2",W2);/**
201
+ * @license lucide-react v1.17.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const ej=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],tj=Qe("shield-check",ej);/**
206
+ * @license lucide-react v1.17.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const lj=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],aj=Qe("smartphone",lj);/**
211
+ * @license lucide-react v1.17.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const nj=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],Px=Qe("timer",nj);/**
216
+ * @license lucide-react v1.17.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const ij=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Wx=Qe("trash-2",ij);/**
221
+ * @license lucide-react v1.17.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const rj=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],sj=Qe("trending-up",rj);/**
226
+ * @license lucide-react v1.17.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const oj=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2",key:"4125el"}],["path",{d:"M3 11h3c.8 0 1.6.3 2.1.9l1.1.9c1.6 1.6 4.1 1.6 5.7 0l1.1-.9c.5-.5 1.3-.9 2.1-.9H21",key:"1dpki6"}]],Gr=Qe("wallet-cards",oj);/**
231
+ * @license lucide-react v1.17.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const uj=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Zr=Qe("x",uj);class Ix extends Error{constructor(r,u,d){super(r);xd(this,"status");xd(this,"code");this.status=u,this.code=d}}async function dl(a){var r,u;const i=await fetch(a);if(!i.ok){const d=await i.json().catch(()=>({}));throw new Ix(((r=d.error)==null?void 0:r.message)??`${a} returned ${i.status}`,i.status,(u=d.error)==null?void 0:u.code)}return i.json()}async function sa(a,i,r){var d,m;const u=await fetch(i,{method:a,headers:r?{"content-type":"application/json"}:void 0,body:r?JSON.stringify(r):void 0});if(!u.ok){const h=await u.json().catch(()=>({}));throw new Ix(((d=h.error)==null?void 0:d.message)??`${a} ${i} returned ${u.status}`,u.status,(m=h.error)==null?void 0:m.code)}return u.json()}function Io(){return cl({queryKey:["ledger","inferences"],queryFn:()=>dl("/ledger/inferences"),refetchInterval:1e4})}function cj(){return cl({queryKey:["ledger","purchases"],queryFn:()=>dl("/ledger/purchases"),refetchInterval:1e4})}function e0(){return cl({queryKey:["payments"],queryFn:()=>dl("/payments"),refetchInterval:1e4})}function t0(){const a=rs();return En({mutationFn:()=>sa("POST","/payments/clawtip/activate"),onSuccess:()=>{a.invalidateQueries({queryKey:["payments"]})}})}function l0(){return En({mutationFn:()=>sa("POST","/payments/clawtip/recharge")})}function a0(){return cl({queryKey:["routing","strategy"],queryFn:()=>dl("/routing/strategy")})}function n0(){const a=rs();return En({mutationFn:i=>sa("PUT","/routing/strategy",i),onSuccess:()=>{a.invalidateQueries({queryKey:["routing","strategy"]})}})}function dj(a){const i=new URLSearchParams;for(const[r,u]of Object.entries(a))u!=null&&u!==""&&i.set(r,fj(u));return cl({queryKey:["routing","preview",i.toString()],queryFn:()=>dl(`/routing/preview?${i.toString()}`),enabled:!1})}function fj(a){return Array.isArray(a)?a.join(","):typeof a=="object"&&a!==null?Object.entries(a).map(([i,r])=>`${i}:${r}`).join(","):String(a)}function i0(){return cl({queryKey:["sellers"],queryFn:()=>dl("/sellers"),refetchInterval:3e4})}function bf(){return cl({queryKey:["models"],queryFn:()=>dl("/models"),refetchInterval:3e4})}function mj(){return cl({queryKey:["prewarm","focus-set"],queryFn:()=>dl("/v1.2/prewarm").then(a=>({ok:!0,focusSet:a.focusSet??[],source:"historical"}))})}async function Lo(a){const i=Array.isArray(a)?{models:a}:a;return sa("PUT","/prewarm/focus-set",i)}function r0(){return cl({queryKey:["status"],queryFn:()=>dl("/status"),refetchInterval:5e3})}function hj(){return cl({queryKey:["update","status"],queryFn:()=>dl("/update/status"),refetchInterval:3600*1e3})}function pj(){return En({mutationFn:()=>sa("POST","/update/run")})}function St({children:a,className:i=""}){return s.jsx("div",{className:["rounded-[var(--radius-xl)] border border-[var(--color-line-2)] bg-white shadow-[var(--shadow-panel)]",i].join(" "),children:a})}function ss({tone:a="lavender",children:i}){const r={lavender:"bg-[var(--color-lavender)] text-[var(--color-primary)]",green:"bg-[var(--color-success-soft)] text-[var(--color-success)]",amber:"bg-[var(--color-warning-soft)] text-[var(--color-warning)]",red:"bg-[var(--color-danger-soft)] text-[var(--color-danger)]",blue:"bg-[var(--color-tokens-soft)] text-[var(--color-tokens)]",gray:"bg-slate-100 text-slate-600"};return s.jsxs("span",{className:["inline-flex items-center gap-1.5 text-[0.78rem] font-medium px-2.5 py-0.5 rounded-[var(--radius-pill)]",r[a]??r.lavender].join(" "),children:[s.jsx("span",{className:"size-1.5 rounded-full bg-current"}),i]})}const we="—",Lt=a=>a<10?`0${a}`:`${a}`;function gl(a,i={}){if(!Number.isFinite(a))return we;const r=a;return i.compact===!1||r<1e4?Math.round(r).toLocaleString("en-US"):r<1e6?`${(r/1e3).toFixed(1)}K`:r<1e9?`${(r/1e6).toFixed(1)}M`:`${(r/1e9).toFixed(2)}B`}function $r(a,i,r={}){const u=r.separator??" / ";return`In ${gl(a,r)}${u}Out ${gl(i,r)}`}function vj(a,i){return!Number.isFinite(a)&&!Number.isFinite(i)?we:`Input ${Ze(a)} / Output ${Ze(i)}`}function gf(a){return Number.isFinite(a)?`${a.toFixed(1)} tok/s`:we}function Ze(a){return Number.isFinite(a)?Math.round(a).toLocaleString("en-US"):we}function ot(a,i={}){if(!Number.isFinite(a))return we;const r=Math.abs(a/1e6),u=i.digits??(i.ledger&&r<.01?6:4),d=`$${(a/1e6).toFixed(u)}`;return i.signed&&a>=0?`+${d}`:d}function xj(a,i,r={}){return!Number.isFinite(a)&&!Number.isFinite(i)?we:`${ot(a,r)} / ${ot(i,r)}`}function mt(a){if(!Number.isFinite(a))return we;const i=Math.max(0,Math.round(a));return i<1e3?`${i}ms`:`${(i/1e3).toFixed(2)}s`}function s0(a){return Number.isFinite(a)?`${Math.round(a*100)}%`:we}function jf(a){if(!Number.isFinite(a))return we;const i=Math.max(0,a);return i===0?"免费":Math.abs(i-1)<1e-4?"原价":`${yj(i*10)}折`}function Jr(a,i){return xj(a,i,{digits:4})}function yj(a){const i=Math.round(a*10)/10;return Number.isInteger(i)?String(i):i.toFixed(1)}function kl(a){return a?a.trim().toLowerCase().replaceAll("_"," "):we}function Xa(a){const i=kl(a);return i==="ok"||i==="online"||i==="configured"||i==="settled"||i==="completed"||i==="success"||i==="active"||i==="healthy"?"green":i==="fallback"||i==="pending"||i==="degraded"||i==="preview"?"amber":i==="failed"||i==="error"||i==="canceled"||i==="unhealthy"||i==="offline"?"red":i==="running"?"blue":"gray"}function Fr(a,i=32){return a?a.length>i?`${a.slice(0,i)}...`:a:we}function bj(a){return a?a.startsWith("tbs-")&&a.length>10?a.slice(0,10):a.length<=12?a:a.slice(0,12):we}function o0(a){if(!a)return we;const i=new Date(a);if(Number.isNaN(i.getTime()))return we;const r=new Date,u=i.getFullYear()===r.getFullYear()&&i.getMonth()===r.getMonth()&&i.getDate()===r.getDate(),d=`${Lt(i.getHours())}:${Lt(i.getMinutes())}`;return u?d:`${Lt(i.getMonth()+1)}/${Lt(i.getDate())} ${d}`}function jl(a){if(!a)return we;const i=new Date(a);return Number.isNaN(i.getTime())?we:`${i.getFullYear()}-${Lt(i.getMonth()+1)}-${Lt(i.getDate())} ${Lt(i.getHours())}:${Lt(i.getMinutes())}:${Lt(i.getSeconds())}`}function u0(a){if(!a)return we;const i=new Date(a);return Number.isNaN(i.getTime())?we:`${i.getFullYear()}/${Lt(i.getMonth()+1)}/${Lt(i.getDate())} ${Lt(i.getHours())}:${Lt(i.getMinutes())}:${Lt(i.getSeconds())}`}function gj(a){return o0(a)}function c0({inferences:a,modelsResponse:i,sellersResponse:r,previewPlan:u,activeModelId:d}){const m=Nj(i,r),h=[...a].sort(Cj),x=new Map,p=new Map;let v=0,g=0,b=0;for(const T of h){const A=T.modelId||we,z=T.sellerKey||we,Q=xl(T.promptTokens)??0,U=xl(T.completionTokens)??0,L=Q+U,K=xl(T.billedMicros)??0;v+=1,g+=L,b+=K;const B=x.get(A)??Mj(A);B.entries.push(T),B.requestCount+=1,B.inputTokens+=Q,B.outputTokens+=U,B.totalSpendMicros+=K,B.touchedSellers.add(z),B.sellerCounts.set(z,(B.sellerCounts.get(z)??0)+1),B.fallbackCount+=xl(T.fallbackCount)??0;const V=xl(T.ttftMs);V!==void 0&&(B.ttftTotal+=V,B.ttftCount+=1);const P=xl(T.durationMs);P!==void 0&&(B.durationTotal+=P,B.durationCount+=1),x.set(A,B);const J=p.get(z)??{requestCount:0,totalTokens:0};J.requestCount+=1,J.totalTokens+=L,p.set(z,J)}const E=Array.from(x.values()).map(T=>jj(T,p,m)).sort(Ej);if(E.length===0){const T=Sj(d,u,m);T&&E.push(T)}return{rows:E,totalRequests:v,totalTokens:g,totalSpendMicros:b}}function jj(a,i,r){const u=a.entries[a.entries.length-1],d=(u==null?void 0:u.sellerKey)||we,m=d0(d,r),h=a.sellerCounts.get(d)??0,x=i.get(d),p=r.modelsBySellerAndModel.get(`${d}\0${a.modelId}`);return{source:"ledger",modelId:a.modelId,currentSellerId:d,currentSellerName:m.name,currentSellerUrl:m.url,currentSellerStatus:m.status,currentSellerPaymentMethods:m.paymentMethods,sellerDiscount:m.discount,sellerServiceFee:m.serviceFee,sellerModelCount:m.modelCount,requestCount:a.requestCount,currentSellerModelRequests:h,currentSellerRequests:(x==null?void 0:x.requestCount)??h,inputTokens:a.inputTokens,outputTokens:a.outputTokens,totalTokens:a.inputTokens+a.outputTokens,currentSellerTokens:(x==null?void 0:x.totalTokens)??0,totalSpendMicros:a.totalSpendMicros,avgTtftMs:Kv(a.ttftTotal,a.ttftCount),avgDurationMs:Kv(a.durationTotal,a.durationCount),lastTtftMs:xl(u==null?void 0:u.ttftMs),lastDurationMs:xl(u==null?void 0:u.durationMs),selectedAt:wj(a.entries,d),lastSellerSwitchAt:Tj(a.entries),lastAccessAt:u==null?void 0:u.createdAt,lastRequestId:u==null?void 0:u.requestId,lastStatus:u==null?void 0:u.status,routeReason:u==null?void 0:u.routeReason,upstreamStatus:u==null?void 0:u.upstreamStatus,fallbackCount:a.fallbackCount,falloverChain:(u==null?void 0:u.falloverChain)??[],touchedSellerCount:a.touchedSellers.size,inputPriceMicrosPer1m:p==null?void 0:p.inputPriceMicrosPer1m,outputPriceMicrosPer1m:p==null?void 0:p.outputPriceMicrosPer1m}}function Sj(a,i,r){var p,v,g;const u=(p=i==null?void 0:i.routes)==null?void 0:p[0];if(!u||!a)return;const d=d0(u.seller.id,r,u),m=xl(u.metrics.ttftMs)??xl(u.metrics.avgLatencyMs),h=xl(u.metrics.avgInferenceMs),x=r.modelsBySellerAndModel.get(`${u.seller.id}\0${a}`);return{source:"preview",modelId:a,currentSellerId:u.seller.id,currentSellerName:d.name,currentSellerUrl:d.url,currentSellerStatus:d.status,currentSellerPaymentMethods:d.paymentMethods,sellerDiscount:d.discount,sellerServiceFee:d.serviceFee,sellerModelCount:d.modelCount,requestCount:0,currentSellerModelRequests:0,currentSellerRequests:0,inputTokens:0,outputTokens:0,totalTokens:0,currentSellerTokens:0,totalSpendMicros:0,avgTtftMs:m,avgDurationMs:h,lastTtftMs:m,lastDurationMs:h,routeReason:i.reason??i.sourceReason??"Preview route",fallbackCount:0,falloverChain:((v=i.routes)==null?void 0:v.map(b=>b.seller.id))??[],touchedSellerCount:((g=i.routes)==null?void 0:g.length)??1,inputPriceMicrosPer1m:x==null?void 0:x.inputPriceMicrosPer1m,outputPriceMicrosPer1m:x==null?void 0:x.outputPriceMicrosPer1m}}function Nj(a,i){const r=new Map;for(const u of(a==null?void 0:a.data)??[]){const d=r.get(u.sellerId)??new Set;d.add(u.id),r.set(u.sellerId,d)}return{registryById:new Map(((i==null?void 0:i.sellers)??[]).map(u=>[u.id,u])),catalogById:new Map(((a==null?void 0:a.sellers)??[]).map(u=>[u.id,u])),modelsBySellerAndModel:new Map(((a==null?void 0:a.data)??[]).map(u=>[`${u.sellerId}\0${u.id}`,u])),modelCountsBySellerId:new Map(Array.from(r.entries()).map(([u,d])=>[u,d.size]))}}function Mj(a){return{modelId:a,entries:[],sellerCounts:new Map,touchedSellers:new Set,requestCount:0,inputTokens:0,outputTokens:0,totalSpendMicros:0,ttftTotal:0,ttftCount:0,durationTotal:0,durationCount:0,fallbackCount:0}}function wj(a,i){var r;for(let u=a.length-1;u>=0;u-=1){const d=a[u];if(d.sellerKey!==i)return(r=a[u+1])==null?void 0:r.createdAt;if(u===0)return d.createdAt}}function Tj(a){let i;for(let r=1;r<a.length;r+=1)a[r].sellerKey!==a[r-1].sellerKey&&(i=a[r].createdAt);return i}function d0(a,i,r){const u=i.catalogById.get(a),d=i.registryById.get(a),m=(r==null?void 0:r.metrics.discountRatio)??(u==null?void 0:u.discountRatio);return{name:Aj((r==null?void 0:r.seller.name)??(u==null?void 0:u.name)??(d==null?void 0:d.name)??a),url:(r==null?void 0:r.seller.url)??(u==null?void 0:u.url)??(d==null?void 0:d.url),status:(u==null?void 0:u.status)??(d==null?void 0:d.status)??we,paymentMethods:(u==null?void 0:u.paymentMethods)??(d==null?void 0:d.paymentMethods)??(r==null?void 0:r.seller.paymentMethods)??[],discount:jf(m),serviceFee:s0(u==null?void 0:u.serviceFeeRatio),modelCount:(u==null?void 0:u.modelCount)??i.modelCountsBySellerId.get(a)}}function Cj(a,i){return Vo(a.createdAt)-Vo(i.createdAt)}function Ej(a,i){return Vo(i.lastAccessAt)-Vo(a.lastAccessAt)}function Vo(a){if(!a)return 0;const i=new Date(a).getTime();return Number.isNaN(i)?0:i}function Kv(a,i){return i>0?a/i:void 0}function xl(a){return Number.isFinite(a)?a:void 0}function Aj(a){var i;return((i=a.split("(")[0])==null?void 0:i.trim())||a}function Xv(){var fe,pe,Ae,me,_,$,ne,be,ge,M,k,Z,W,X,le,re,Te,ze,qt,fl;const[a,i]=j.useState(null),r=r0(),u=a0(),d=e0(),m=t0(),h=l0(),x=d.refetch,p=m.reset,v=Io(),g=i0(),b=bf(),E=hj(),T=pj(),A=((fe=v.data)==null?void 0:fe.inferences)??[],z=((pe=d.data)==null?void 0:pe.payments)??[],Q=new Set((((Ae=b.data)==null?void 0:Ae.data)??[]).map(De=>De.id)).size,U=((me=g.data)==null?void 0:me.sellers.length)??(($=(_=b.data)==null?void 0:_.sellers)==null?void 0:$.length)??0,L=j.useMemo(()=>Yj(A),[A]),K=j.useMemo(()=>Gj(z,A),[A,z]),B=j.useMemo(()=>c0({inferences:A,modelsResponse:b.data,sellersResponse:g.data}),[A,b.data,g.data]),P=z.some(De=>bl(De.method)==="clawtip"&&(De.enabled||h0(De.config,"walletConfigPresent")))||((ne=m.data)==null?void 0:ne.walletConfigPresent)===!0,J=((be=r.data)==null?void 0:be.status)==="running"&&!r.isError,I=new Date().toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",second:"2-digit"}),te=((ge=u.data)==null?void 0:ge.strategy.mode)??((M=r.data)==null?void 0:M.sellerRoutingMode)??we,se=((k=u.data)==null?void 0:k.strategy.scorer)??((Z=r.data)==null?void 0:Z.sellerRoutingScorer)??we,F=()=>{i(null),m.reset(),h.reset()};return j.useEffect(()=>{if((a==null?void 0:a.kind)!=="activate"||bl(a.method)!=="clawtip"||P)return;const De=window.setInterval(()=>{x()},1500);return()=>window.clearInterval(De)},[P,a==null?void 0:a.kind,a==null?void 0:a.method,x]),j.useEffect(()=>{(a==null?void 0:a.kind)==="activate"&&bl(a.method)==="clawtip"&&P&&(i(null),p())},[P,a==null?void 0:a.kind,a==null?void 0:a.method,p]),s.jsxs("div",{className:"min-w-0 overflow-x-hidden space-y-3",children:[s.jsx(zj,{currentVersion:(W=E.data)==null?void 0:W.currentVersion,latestVersion:(X=E.data)==null?void 0:X.latestVersion,updateAvailable:(le=E.data)==null?void 0:le.updateAvailable,running:T.isPending,result:T.data,error:T.error,onUpdate:()=>T.mutate()}),s.jsxs("section",{className:"grid grid-cols-2 gap-2.5 md:grid-cols-3 xl:grid-cols-6",children:[s.jsx(gi,{to:"/routing",icon:s.jsx(Fx,{className:"size-4"}),label:"Router",value:te,note:`${se} scorer`,tone:"router"}),s.jsx(gi,{to:"/ledger",icon:s.jsx(Yv,{className:"size-4"}),label:"Today requests",value:Ze(L.todayRequestCount),note:`${Ze(L.totalRequestCount)} total`,tone:"requests"}),s.jsx(gi,{to:"/ledger",icon:s.jsx(Hi,{className:"size-4"}),label:"Spend today",value:ot(L.todaySpendMicros,{digits:4}),note:`${ot(L.totalSpendMicros,{digits:4})} total`,tone:"spend"}),s.jsx(gi,{to:"/ledger",icon:s.jsx(Gv,{className:"size-4"}),label:"Today tokens",value:gl(L.todayInputTokens+L.todayOutputTokens),note:$r(L.todayInputTokens,L.todayOutputTokens),tone:"tokens"}),s.jsx(gi,{to:"/ledger",icon:s.jsx(Yv,{className:"size-4"}),label:"Total tokens",value:gl(L.inputTokens+L.outputTokens),note:$r(L.inputTokens,L.outputTokens),tone:"tokens"}),s.jsx(gi,{to:"/routing",icon:s.jsx(Gv,{className:"size-4"}),label:"Models / Sellers",value:`${Q}`,note:`${U} sellers`,tone:"inventory"})]}),s.jsx("section",{className:"grid min-w-0 gap-3",children:s.jsxs("div",{className:"min-w-0 space-y-3",children:[s.jsx(Rj,{rows:B.rows,totalRequests:B.totalRequests,totalTokens:B.totalTokens}),s.jsxs(St,{className:"p-3.5",children:[s.jsx("div",{className:"flex items-start justify-between gap-4",children:s.jsx("div",{children:s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h2",{className:"text-[1rem] font-semibold text-[var(--color-ink)]",children:"Payment management"}),s.jsx(ss,{tone:z.some(De=>De.enabled)?"green":"amber",children:z.some(De=>De.enabled)?"configured":"not configured"})]})})}),s.jsx("div",{className:"mt-2 min-w-0 overflow-hidden rounded-[10px] border border-[var(--color-line-2)] bg-white",children:K.map(De=>s.jsx(kj,{...De,onActivate:()=>{i({kind:"activate",method:De.method}),De.method==="clawtip"&&m.mutate()},onRecharge:()=>{i({kind:"recharge",method:De.method}),De.method==="clawtip"&&h.mutate()}},De.method))})]}),s.jsxs(St,{className:"p-3",children:[s.jsxs("div",{className:"mb-2 flex min-w-0 flex-col gap-2",children:[s.jsx("div",{className:"flex min-w-0 flex-wrap items-center justify-between gap-2",children:s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx(sj,{className:"size-4 shrink-0 text-[var(--color-purple)]"}),s.jsx("h2",{className:"truncate text-[1rem] font-semibold text-[var(--color-ink)]",children:"TokenUsage"})]})}),s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-x-2.5 gap-y-1 text-[0.7rem] text-[var(--color-muted)]",children:[L.modelUsage.map(De=>s.jsx(Lj,{model:De.model,color:De.color},De.model)),s.jsx(Vv,{label:"in"}),s.jsx(Vv,{label:"out",dashed:!0})]})]}),s.jsxs("div",{className:"grid min-w-0 gap-3 sm:grid-cols-[minmax(0,1fr)_190px]",children:[s.jsx(Uj,{days:L.days,series:L.modelUsage}),s.jsxs("div",{className:"grid gap-3",children:[s.jsx(Bj,{days:L.days,values:L.cost,total:ot(L.weeklySpendMicros)}),s.jsx(Hj,{values:L.thirtyDaySpend,total:ot(L.totalSpendMicros)})]})]})]})]})}),s.jsx(qj,{checkedAt:I,healthy:J,pid:(re=r.data)==null?void 0:re.pid,status:(Te=r.data)==null?void 0:Te.status,proxyPort:(ze=r.data)==null?void 0:ze.proxyPort,controlPort:(qt=r.data)==null?void 0:qt.controlPort,registryUrl:(fl=r.data)==null?void 0:fl.sellerRegistryUrl}),a?s.jsx(Dj,{modal:a,methods:K,qr:a.kind==="activate"?m.data:h.data,loading:a.kind==="activate"?m.isPending:h.isPending,error:a.kind==="activate"?m.error:h.error,onClose:F}):null]})}function zj({currentVersion:a,latestVersion:i,updateAvailable:r,running:u,result:d,error:m,onUpdate:h}){if(!r&&!u&&!d&&!m)return null;const x=d?d.install.succeeded?d.restart.scheduled||d.restart.restarted?"Installed. tb-proxyd restart is in progress.":d.restart.error??"Installed. Restart needs attention.":d.install.error??"Update failed.":void 0,p=(m==null?void 0:m.message)??x??(a&&i?`TokenBuddy ${a} -> ${i}`:"TokenBuddy update available"),v=!!(m||(d==null?void 0:d.install.succeeded)===!1||d!=null&&d.restart.error);return s.jsxs("section",{className:["flex min-w-0 flex-col gap-2 rounded-[var(--radius-xl)] border px-3 py-2.5 shadow-[var(--shadow-chip)] sm:flex-row sm:items-center sm:justify-between",v?"border-[var(--color-danger)]/30 bg-[var(--color-danger-soft)]":"border-[var(--color-lavender-2)] bg-[var(--color-lavender)]"].join(" "),children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx("span",{className:["grid size-7 shrink-0 place-items-center rounded-[var(--radius-md)] bg-white",v?"text-[var(--color-danger)]":"text-[var(--color-purple)]"].join(" "),children:s.jsx(Fd,{className:["size-4",u?"animate-spin":""].join(" ")})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-[0.82rem] font-semibold text-[var(--color-ink)]",children:"TokenBuddy update"}),s.jsx("div",{className:"truncate text-[0.74rem] text-[var(--color-muted)]",children:p})]})]}),r?s.jsxs("button",{type:"button",onClick:h,disabled:u,className:"inline-flex h-8 shrink-0 items-center justify-center gap-1.5 rounded-[var(--radius-md)] border border-[var(--color-lavender-2)] bg-white px-3 text-[0.76rem] font-semibold text-[var(--color-purple)] transition hover:border-[var(--color-purple)] hover:bg-[var(--color-page)] disabled:cursor-wait disabled:opacity-70",children:[s.jsx(Fd,{className:["size-3.5",u?"animate-spin":""].join(" ")}),u?"Updating":"Update"]}):null]})}function Rj({rows:a,totalRequests:i,totalTokens:r}){var d;const u=a.slice(0,3);return s.jsxs(St,{className:"overflow-hidden",children:[s.jsxs("div",{className:"flex items-center justify-between gap-3 border-b border-[var(--color-line-2)] px-3.5 py-3",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx(Fx,{className:"size-4 shrink-0 text-[var(--color-purple)]"}),s.jsx("h2",{className:"truncate text-[1rem] font-semibold text-[var(--color-ink)]",children:"Recent model routes"})]}),s.jsx(is,{to:"/routing",className:"shrink-0 rounded-[8px] border border-[var(--color-lavender-2)] bg-[var(--color-lavender)] px-2.5 py-1.5 text-[0.72rem] font-semibold text-[var(--color-purple)] transition hover:bg-white",children:"Details"})]}),s.jsxs("div",{className:"grid grid-cols-2 gap-2 border-b border-[var(--color-line-2)] bg-[var(--color-page)]/55 px-3.5 py-2 sm:grid-cols-4",children:[s.jsx(ko,{label:"Req",value:Ze(i)}),s.jsx(ko,{label:"Token",value:gl(r)}),s.jsx(ko,{label:"Models",value:Ze(a.length)}),s.jsx(ko,{label:"Latest",value:o0((d=a[0])==null?void 0:d.lastAccessAt)})]}),u.length>0?s.jsx("div",{className:"divide-y divide-[var(--color-line-2)]",children:u.map(m=>s.jsx(Oj,{row:m},`${m.modelId}-${m.currentSellerId}`))}):s.jsx("div",{className:"px-3.5 py-7 text-center text-[0.82rem] text-[var(--color-muted)]",children:"No model traffic yet."})]})}function ko({label:a,value:i}){return s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-[0.65rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:a}),s.jsx("div",{className:"mt-0.5 truncate font-mono text-[0.88rem] font-semibold text-[var(--color-ink)]",children:i})]})}function Oj({row:a}){const i=a.lastSellerSwitchAt??a.selectedAt;return s.jsxs("div",{className:"grid min-w-0 gap-3 px-3.5 py-3 lg:grid-cols-[minmax(0,1.05fr)_minmax(0,2fr)] lg:items-center",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",title:a.modelId,children:a.modelId}),s.jsxs("div",{className:"mt-0.5 flex min-w-0 flex-wrap items-center gap-x-2 gap-y-1 text-[0.72rem] text-[var(--color-muted)]",children:[s.jsx("span",{className:"truncate",children:a.currentSellerName}),s.jsx("span",{className:"font-mono",children:a.currentSellerStatus})]})]}),s.jsxs("div",{className:"grid min-w-0 grid-cols-2 gap-1.5 sm:grid-cols-3 lg:grid-cols-6",children:[s.jsx(bi,{label:"In",value:gl(a.inputTokens),tone:"tokens",title:`Input tokens: ${Ze(a.inputTokens)}`}),s.jsx(bi,{label:"Out",value:gl(a.outputTokens),tone:"success",title:`Output tokens: ${Ze(a.outputTokens)}`}),s.jsx(bi,{label:"TTFT",value:mt(a.lastTtftMs??a.avgTtftMs),tone:"router",title:`Time to first token: ${mt(a.lastTtftMs??a.avgTtftMs)}`}),s.jsx(bi,{label:"Total",value:mt(a.lastDurationMs??a.avgDurationMs),tone:"slate",title:`Total inference duration: ${mt(a.lastDurationMs??a.avgDurationMs)}`}),s.jsx(bi,{label:"Disc",value:a.sellerDiscount,tone:"success",title:`Seller discount: ${a.sellerDiscount}`}),s.jsx(bi,{label:"Switch",value:gj(i),tone:"slate",title:`Last seller switch: ${jl(i)}`})]})]})}function bi({label:a,value:i,tone:r,title:u}){const d={router:"bg-[var(--color-lavender)] text-[var(--color-router)]",success:"bg-[var(--color-success-soft)] text-[var(--color-success)]",warning:"bg-[var(--color-warning-soft)] text-[var(--color-warning)]",tokens:"bg-[var(--color-tokens-soft)] text-[var(--color-tokens)]",slate:"bg-slate-50 text-slate-700"}[r];return s.jsxs("div",{className:["min-w-0 rounded-[var(--radius-md)] px-2 py-1",d].join(" "),title:u??`${a}: ${i}`,children:[s.jsx("div",{className:"text-[0.58rem] font-semibold uppercase tracking-wider opacity-70",children:a}),s.jsx("div",{className:"truncate font-mono text-[0.76rem] font-semibold",children:i})]})}function gi({to:a,icon:i,label:r,value:u,note:d,tone:m}){const h={router:{card:"border border-[var(--color-hairline-strong)] bg-white shadow-[var(--shadow-panel-strong)] hover:border-[var(--color-primary)] before:bg-[var(--color-router)]",icon:"bg-[var(--color-lavender)] text-[var(--color-router)]",label:"text-[var(--color-router)]",value:"text-[var(--color-ink)]",note:"text-[var(--color-muted)]"},requests:{card:"border border-[var(--color-hairline)] bg-white shadow-[var(--shadow-panel)] hover:border-[var(--color-success)] before:bg-[var(--color-success)]",icon:"bg-[var(--color-success-soft)] text-[var(--color-success)]",label:"text-[var(--color-success)]",value:"text-[var(--color-ink)]",note:"text-[var(--color-muted)]"},spend:{card:"border border-[var(--color-spend-border)] bg-[var(--color-spend-soft)] shadow-[var(--shadow-panel)] hover:border-[var(--color-spend)] before:bg-[var(--color-spend)]",icon:"bg-white text-[var(--color-spend)]",label:"text-[var(--color-spend)]",value:"text-[var(--color-ink)]",note:"text-[var(--color-spend)]"},tokens:{card:"border border-[var(--color-tokens-border)] bg-[var(--color-tokens-soft)] shadow-[var(--shadow-panel)] hover:border-[var(--color-tokens)] before:bg-[var(--color-tokens)]",icon:"bg-white text-[var(--color-tokens)]",label:"text-[var(--color-tokens)]",value:"text-[var(--color-ink)]",note:"text-[var(--color-tokens)]"},inventory:{card:"border border-[var(--color-inventory-border)] bg-[var(--color-inventory-soft)] shadow-[var(--shadow-panel)] hover:border-[var(--color-inventory)] before:bg-[var(--color-inventory)]",icon:"bg-white text-[var(--color-inventory)]",label:"text-[var(--color-inventory)]",value:"text-[var(--color-ink)]",note:"text-[var(--color-inventory)]"}}[m];return s.jsxs(is,{to:a,"aria-label":`Open ${r}`,className:["relative block min-h-[94px] overflow-hidden rounded-[var(--radius-xl)] p-3 transition before:absolute before:inset-y-0 before:left-0 before:w-1 hover:-translate-y-0.5 focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)]",h.card].join(" "),children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("div",{className:`grid size-7 place-items-center rounded-[var(--radius-md)] ${h.icon}`,children:i}),s.jsx("span",{className:["text-right text-[0.66rem] font-semibold uppercase leading-3 tracking-[0.08em]",h.label].join(" "),children:r})]}),s.jsx("div",{className:["mt-2 text-[1.25rem] font-semibold leading-none tracking-tight",h.value].join(" "),children:u}),s.jsx("div",{className:["mt-1.5 truncate text-[0.72rem] font-medium",h.note].join(" "),children:d})]})}function kj({name:a,method:i,balance:r,status:u,note:d,action:m,icon:h,balanceHidden:x,onActivate:p,onRecharge:v}){const g=u==="Bound",b=g&&x&&bl(i)==="clawtip";return s.jsxs("div",{className:"grid grid-cols-[minmax(0,1fr)_74px_82px] items-center gap-2 border-b border-[var(--color-line-2)] px-2 py-2.5 last:border-b-0 sm:grid-cols-[minmax(0,1fr)_96px_92px] sm:gap-3 sm:px-3",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[s.jsx(_j,{method:i,icon:h,bound:g}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate font-semibold text-[var(--color-ink)]",children:a}),d?s.jsx("div",{className:"mt-0.5 truncate text-[0.74rem] text-[var(--color-muted)]",children:d}):null]})})]}),b?s.jsxs("button",{type:"button",className:"inline-flex w-fit items-center gap-1 rounded-[7px] border border-[var(--color-lavender-2)] bg-[var(--color-lavender)] px-2 py-1 font-mono text-[0.82rem] font-semibold text-[var(--color-purple)] transition hover:border-[var(--color-purple)] hover:bg-white active:translate-y-px",onClick:v,"aria-label":"Scan with JD app to view ClawTip wallet balance",title:"Scan with JD app to view wallet balance",children:[s.jsx(K2,{className:"size-3.5"}),"••••"]}):s.jsx("div",{className:"font-mono text-[0.9rem] font-semibold text-[var(--color-ink)]",children:r}),s.jsx("button",{className:"rounded-[8px] bg-[var(--color-purple)] px-2.5 py-1.5 text-[0.76rem] font-semibold text-white shadow-[0_8px_18px_rgba(124,61,240,0.16)] transition hover:bg-[#6e32dc] active:translate-y-px",onClick:g?v:p,"aria-label":m,title:`${m} ${a}`,children:m})]})}function _j({method:a,icon:i,bound:r}){return bl(a)==="clawtip"?s.jsx("div",{className:"grid size-8 shrink-0 place-items-center rounded-[8px] border border-red-100 bg-[#e1251b] font-mono text-[0.72rem] font-black uppercase tracking-tight text-white shadow-[0_8px_18px_rgba(225,37,27,0.16)]","aria-label":"JD wallet",title:"JD wallet",children:"JD"}):s.jsx("div",{className:["grid size-8 shrink-0 place-items-center rounded-[8px] text-[0.8rem] font-bold",r?"bg-[var(--color-lavender)] text-[var(--color-purple)]":"bg-[var(--color-page)] text-[var(--color-muted)]"].join(" "),children:i})}function Dj({modal:a,methods:i,qr:r,loading:u,error:d,onClose:m}){const h=a.kind==="recharge",x=i.find(z=>z.method===a.method),p=h&&bl(a.method)==="clawtip",v=Ad(x==null?void 0:x.config,"resourceUrl"),g=Ad(x==null?void 0:x.config,"walletConfigPath"),b=Ad(x==null?void 0:x.config,"orderNo"),E=(r==null?void 0:r.walletConfigPresent)===!0||h0(x==null?void 0:x.config,"walletConfigPresent"),T=!h&&!!(r!=null&&r.qrImageUrl)&&!E&&!d,A=(x==null?void 0:x.name)??f0(a.method);return s.jsx("div",{className:"fixed inset-0 z-30 grid place-items-center overflow-y-auto bg-[rgba(32,26,56,0.28)] px-4 py-6",children:s.jsxs("div",{className:"w-full max-w-[820px] rounded-[14px] bg-white p-5 shadow-[0_20px_56px_rgba(32,26,56,0.20)] sm:p-6",children:[s.jsxs("div",{className:"flex items-start justify-between gap-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-[1.05rem] font-semibold text-[var(--color-ink)]",children:p?"ClawTip wallet QR":h?`Recharge ${A}`:`Activate ${A}`}),s.jsx("p",{className:"mt-1 text-[0.82rem] leading-5 text-[var(--color-muted)]",children:p?"Scan with JD app to view wallet balance or recharge.":h?"Load the fixed ClawTip recharge QR from static assets.":"Reuse the tb init ClawTip flow and wait for wallet binding."})]}),s.jsx("button",{className:"rounded-[7px] p-1.5 text-[var(--color-muted)] transition hover:bg-[var(--color-page)]",onClick:m,"aria-label":"Close payment modal",children:s.jsx(Zr,{className:"size-4"})})]}),s.jsxs("div",{className:"mt-5 flex flex-col gap-4",children:[s.jsx("div",{className:"mx-auto grid min-h-[320px] w-full max-w-[720px] place-items-center overflow-hidden rounded-[12px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-3 sm:min-h-[560px] sm:p-4",children:r!=null&&r.qrImageUrl?s.jsx("img",{className:"max-h-[72vh] w-full object-contain",src:r.qrImageUrl,alt:`${A} ${h?"recharge":"activation"} QR code`}):s.jsxs("div",{className:"flex flex-col items-center gap-2 px-3 text-center text-[0.78rem] leading-5 text-[var(--color-muted)]",children:[u?s.jsx(At,{className:"size-5 animate-spin text-[var(--color-purple)]"}):null,s.jsx("span",{children:u?"Generating ClawTip QR...":"QR image unavailable"})]})}),s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"grid gap-2 sm:grid-cols-2",children:[s.jsx(Lr,{label:"Method",value:A}),s.jsx(Lr,{label:"Wallet",value:E?"bound":"waiting",warn:!E}),r!=null&&r.orderNo||b?s.jsx(Lr,{label:"Order",value:(r==null?void 0:r.orderNo)??b??""}):null,r!=null&&r.walletConfigPath||g?s.jsx(Lr,{label:"Config",value:Xj((r==null?void 0:r.walletConfigPath)??g??"")}):null,r!=null&&r.clawtipId?s.jsx(Lr,{label:"Device",value:r.clawtipId}):null]}),d?s.jsx("div",{className:"rounded-[8px] border border-rose-100 bg-rose-50 px-3 py-2 text-[0.78rem] leading-5 text-rose-700",children:d instanceof Error?d.message:String(d)}):null,r!=null&&r.qrImageUrl?s.jsx("div",{className:"rounded-[8px] border border-emerald-100 bg-emerald-50 px-3 py-2 text-[0.78rem] leading-5 text-emerald-800",children:h?"Scan with JD app to view wallet balance or recharge.":s.jsxs("span",{className:"flex items-start gap-2",children:[T?s.jsx(At,{className:"mt-0.5 size-4 shrink-0 animate-spin"}):null,s.jsx("span",{children:E?"Wallet bound. Closing...":"Scan with JD app. TokenBuddy is waiting for the local wallet config."})]})}):null,r!=null&&r.resourceUrl||v?s.jsx("a",{className:"block rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 py-2 font-mono text-[0.75rem] text-[var(--color-purple)] transition hover:bg-[var(--color-lavender)]",href:(r==null?void 0:r.resourceUrl)??v,target:"_blank",rel:"noreferrer",children:m0((r==null?void 0:r.resourceUrl)??v??"")}):!(r!=null&&r.qrImageUrl)&&!u&&!d?s.jsxs("div",{className:"rounded-[8px] border border-amber-100 bg-amber-50 px-3 py-2 text-[0.78rem] leading-5 text-amber-800",children:["No recharge link is available from the daemon. Run ",s.jsx("span",{className:"font-mono",children:"tb init"})," to bind this payment method."]}):null]})]})]})})}function Uj({days:a,series:i}){const d={top:14,right:18,bottom:26,left:26},m=i.flatMap(v=>[...v.input,...v.output]),h=Math.max(1,...m),x=v=>d.left+v*(680-d.left-d.right)/Math.max(1,a.length-1),p=v=>d.top+(1-v/h)*(150-d.top-d.bottom);return s.jsx("div",{className:"rounded-[var(--radius-lg)] border border-[var(--color-line-2)] bg-white px-3 py-1.5",children:s.jsxs("svg",{className:"h-[160px] w-full",viewBox:"0 0 680 150",role:"img","aria-label":"Daily model input and output usage lines",children:[[.25,.5,.75,1].map(v=>s.jsx("line",{x1:d.left,x2:680-d.right,y1:d.top+(1-v)*(150-d.top-d.bottom),y2:d.top+(1-v)*(150-d.top-d.bottom),stroke:"var(--color-chart-grid)",strokeWidth:"1"},v)),a.map((v,g)=>s.jsx("text",{x:x(g),y:143,textAnchor:"middle",className:"fill-[var(--color-muted)] text-[10px]",children:v},v)),i.map(v=>s.jsxs("g",{children:[s.jsx("path",{d:Pd(v.input.map((g,b)=>[x(b),p(g)])),fill:"none",stroke:v.color,strokeWidth:"3",strokeLinecap:"round",strokeLinejoin:"round"}),s.jsx("path",{d:Pd(v.output.map((g,b)=>[x(b),p(g)])),fill:"none",stroke:v.color,strokeWidth:"2.4",strokeDasharray:"5 5",strokeLinecap:"round",strokeLinejoin:"round",opacity:"0.75"}),v.input.map((g,b)=>s.jsx("circle",{cx:x(b),cy:p(g),r:"2.7",fill:v.color},`${v.model}-input-${b}`)),v.output.map((g,b)=>s.jsx("circle",{cx:x(b),cy:p(g),r:"2.2",fill:"#fff",stroke:v.color,strokeWidth:"1.8"},`${v.model}-output-${b}`))]},v.model)),i.length===0?s.jsx("text",{x:680/2,y:150/2,textAnchor:"middle",className:"fill-[var(--color-muted)] text-[12px]",children:"No token usage yet"}):null]})})}function Bj({days:a,values:i,total:r}){const m={top:10,right:8,bottom:16,left:8},h=Math.max(1,...i),x=v=>m.left+v*(190-m.left-m.right)/Math.max(1,i.length-1),p=v=>m.top+(1-v/h)*(72-m.top-m.bottom);return s.jsxs("div",{className:"rounded-[var(--radius-lg)] border border-[var(--color-line-2)] bg-white px-3 py-1.5",children:[s.jsxs("div",{className:"mb-1 flex items-center justify-between",children:[s.jsx("span",{className:"text-[0.74rem] font-semibold text-[var(--color-ink)]",children:"Cost curve"}),s.jsx("span",{className:"font-mono text-[0.74rem] text-[var(--color-muted)]",children:r})]}),s.jsxs("svg",{className:"h-[66px] w-full",viewBox:"0 0 190 72",role:"img","aria-label":"Daily cost curve",children:[s.jsx("path",{d:Pd(i.map((v,g)=>[x(g),p(v)])),fill:"none",stroke:"var(--color-chart-cost)",strokeWidth:"3",strokeLinecap:"round"}),i.map((v,g)=>s.jsx("circle",{cx:x(g),cy:p(v),r:"2.4",fill:"var(--color-chart-cost)"},a[g]))]})]})}function Hj({values:a,total:i}){const r=Math.max(1,...a);return s.jsxs("div",{className:"rounded-[var(--radius-lg)] border border-[var(--color-line-2)] bg-white px-3 py-1.5",children:[s.jsxs("div",{className:"mb-2 flex items-center justify-between",children:[s.jsx("span",{className:"text-[0.74rem] font-semibold text-[var(--color-ink)]",children:"30 day spend"}),s.jsx("span",{className:"font-mono text-[0.74rem] text-[var(--color-muted)]",children:i})]}),s.jsx("div",{className:"flex h-[60px] items-end gap-1",children:a.map((u,d)=>s.jsx("span",{className:"flex-1 rounded-t-[3px] bg-[var(--color-tokens)]/75",style:{height:`${Math.max(8,u/r*100)}%`}},d))})]})}function Pd(a){return a.length===0?"":a.length===1?`M ${a[0][0]} ${a[0][1]}`:a.reduce((i,r,u)=>{if(u===0)return`M ${r[0]} ${r[1]}`;const d=a[u-1],m=(d[0]+r[0])/2;return`${i} C ${m} ${d[1]}, ${m} ${r[1]}, ${r[0]} ${r[1]}`},"")}function Lj({model:a,color:i}){return s.jsxs("span",{className:"inline-flex min-w-0 max-w-[9rem] items-center gap-1.5 rounded-[7px] border border-[var(--color-line-2)] bg-white px-1.5 py-0.5",title:a,children:[s.jsx("span",{className:"size-2 shrink-0 rounded-full",style:{backgroundColor:i}}),s.jsx("span",{className:"truncate font-mono text-[0.68rem]",children:a})]})}function Vv({label:a,dashed:i=!1}){return s.jsxs("span",{className:"inline-flex items-center gap-1 rounded-[7px] border border-[var(--color-line-2)] bg-white px-1.5 py-0.5",children:[s.jsx("span",{className:["h-px w-4 border-t border-[var(--color-ink)]",i?"border-dashed":""].join(" ")}),s.jsx("span",{className:"font-mono text-[0.68rem]",children:a})]})}function Lr({label:a,value:i,warn:r=!1}){return s.jsxs("div",{className:"flex items-center justify-between gap-3",children:[s.jsx("div",{className:"text-[0.78rem] text-[var(--color-muted)]",children:a}),s.jsx("div",{className:["font-mono text-[0.94rem] font-semibold",r?"text-amber-700":"text-[var(--color-ink)]"].join(" "),children:i})]})}function qj({checkedAt:a,healthy:i,pid:r,status:u,proxyPort:d,controlPort:m,registryUrl:h}){const x=[{icon:s.jsx(k2,{className:"size-3"}),label:"Daemon",value:r?`pid ${r}`:u??we,tone:i?"green":"amber"},{icon:s.jsx(V2,{className:"size-3"}),label:"Proxy",value:d?`:${d}`:we,tone:"blue"},{icon:s.jsx(I2,{className:"size-3"}),label:"Control",value:m?`:${m}`:we,tone:"router"},{icon:s.jsx(L2,{className:"size-3"}),label:"Registry",value:h?m0(h):we,tone:"spend"}];return s.jsxs("div",{className:"flex min-w-0 flex-wrap items-center gap-2 rounded-[var(--radius-xl)] border border-[var(--color-line-2)] bg-white px-3 py-2 shadow-[var(--shadow-chip)]",children:[s.jsxs("span",{className:"inline-flex items-center gap-1.5 rounded-[var(--radius-md)] border border-[var(--color-line-2)] bg-white px-2.5 py-1 text-[0.72rem] font-medium text-[var(--color-muted)]",children:[s.jsx(Fd,{className:"size-3.5"}),a]}),x.map(p=>s.jsx(Qj,{...p},p.label))]})}function Qj({icon:a,label:i,value:r,tone:u}){const d={green:"bg-[var(--color-success-soft)] text-[var(--color-success)]",blue:"bg-[var(--color-tokens-soft)] text-[var(--color-tokens)]",router:"bg-[var(--color-lavender)] text-[var(--color-router)]",spend:"bg-[var(--color-spend-soft)] text-[var(--color-spend)]",amber:"bg-[var(--color-warning-soft)] text-[var(--color-warning)]"}[u];return s.jsxs("div",{className:"inline-flex min-w-0 max-w-full items-center gap-2 rounded-[var(--radius-md)] border border-[var(--color-line-2)] bg-white px-2.5 py-1",children:[s.jsx("span",{className:["grid size-5 shrink-0 place-items-center rounded-[var(--radius-sm)]",d].join(" "),children:a}),s.jsx("span",{className:"text-[0.72rem] font-semibold text-[var(--color-ink)]",children:i}),s.jsx("span",{className:"min-w-0 truncate font-mono text-[0.72rem] text-[var(--color-muted)]",children:r})]})}function Yj(a){const i=Zv(7),r=Zv(30),u=Wd(new Date),d=new Set(i.map(B=>B.key)),m=new Map(r.map((B,V)=>[B.key,V])),h=["var(--color-chart-input)","var(--color-spend)","var(--color-chart-cost)","var(--color-inventory)"],x=new Map,p=i.map(()=>0),v=r.map(()=>0);let g=0,b=0,E=0,T=0,A=0,z=0,Q=0,U=0,L=0;for(const B of a){const V=Wd(new Date(B.createdAt)),P=B.billedMicros??0,J=B.promptTokens??0,I=B.completionTokens??0;L+=1,b+=P,T+=J,A+=I,V===u&&(U+=1,g+=P,z+=J,Q+=I);const te=i.findIndex(F=>F.key===V);if(te>=0){E+=P,p[te]+=P/1e6;const F=x.get(B.modelId)??{input:i.map(()=>0),output:i.map(()=>0),total:0};F.input[te]+=J,F.output[te]+=I,F.total+=J+I,x.set(B.modelId,F)}else d.has(V)&&(E+=P);const se=m.get(V);se!==void 0&&(v[se]+=P/1e6)}const K=Array.from(x.entries()).sort((B,V)=>V[1].total-B[1].total).slice(0,4).map(([B,V],P)=>({model:B,color:h[P%h.length],input:V.input,output:V.output}));return{days:i.map(B=>B.label),modelUsage:K,cost:p,thirtyDaySpend:v,todaySpendMicros:g,totalSpendMicros:b,weeklySpendMicros:E,inputTokens:T,outputTokens:A,todayInputTokens:z,todayOutputTokens:Q,todayRequestCount:U,totalRequestCount:L}}function Gj(a,i){const r=new Map;for(const u of[...i].sort((d,m)=>d.createdAt.localeCompare(m.createdAt)))!u.paymentMethod||u.balanceSnapshotMicros===void 0||r.set(bl(u.paymentMethod),u.balanceSnapshotMicros);return[...a].filter(u=>bl(u.method)!=="mock").sort((u,d)=>Number(d.isDefault)-Number(u.isDefault)||u.method.localeCompare(d.method)).map(u=>{const d=bl(u.method),m=u.enabled||!!(u.config&&Object.keys(u.config).length>0),h=r.get(d),x=d==="clawtip";return{name:f0(u.method),method:u.method,balance:x?"••••":ot(h),status:u.enabled?"Bound":"Available",note:m?u.isDefault?"Default wallet":"Configured":"Not bound",action:u.enabled?"Recharge":"Activate",icon:Kj(u.method),balanceHidden:x,config:u.config}})}function Zv(a){const i=[],r=new Intl.DateTimeFormat("en",{weekday:"short"});for(let u=a-1;u>=0;u-=1){const d=new Date;d.setHours(0,0,0,0),d.setDate(d.getDate()-u),i.push({key:Wd(d),label:r.format(d)})}return i}function Wd(a){if(Number.isNaN(a.getTime()))return"";const i=a.getFullYear(),r=String(a.getMonth()+1).padStart(2,"0"),u=String(a.getDate()).padStart(2,"0");return`${i}-${r}-${u}`}function f0(a){const i=bl(a);return i==="clawtip"?"ClawTip":i==="alipay-agent"?"Alipay Agent Payment":i==="wechat-pay"?"WeChat Pay":i==="coinbase-smart-wallet"?"Coinbase Smart Wallet":a.split(/[-_\s]+/).filter(Boolean).map(r=>r.charAt(0).toUpperCase()+r.slice(1)).join(" ")}function Kj(a){const i=bl(a);return i==="clawtip"?"C":i==="wechat-pay"?"W":i==="alipay-agent"?"A":i.charAt(0).toUpperCase()||"P"}function bl(a){return a.trim().toLowerCase()}function m0(a){try{const i=new URL(a),r=i.pathname==="/"?"":i.pathname;return`${i.host}${r}`.slice(0,34)}catch{return a.length>34?`${a.slice(0,31)}...`:a}}function Xj(a){const i=a.split("/");return i.length<=3?a:`.../${i.slice(-2).join("/")}`}function Ad(a,i){const r=a==null?void 0:a[i];return typeof r=="string"&&r.length>0?r:void 0}function h0(a,i){return(a==null?void 0:a[i])===!0}const Vj=[{value:"fullAuto",label:"Full auto",help:"Choose from all compatible sellers for each model."},{value:"fixedSet",label:"Fixed set",help:"Choose automatically within your selected seller set."},{value:"fixed",label:"Fixed",help:"Pin one fixed seller for each model."}],Zj=[{value:"balanced",label:"Balanced",help:"Balance reliability, speed, and cost."},{value:"speed",label:"Speed first",help:"Prioritize low TTFT and high throughput."},{value:"discount",label:"Cost first",help:"Prioritize discount and available balance."}];function $j(){var ge,M,k,Z,W;const a=a0(),i=n0(),r=i0(),u=bf(),d=mj(),m=Io(),[h,x]=j.useState({mode:"fullAuto",scorer:"balanced"}),[p,v]=j.useState([]),[g,b]=j.useState(""),[E,T]=j.useState(null),[A,z]=j.useState(null),Q=dj({...h,modelId:g}),U=u.data,L=((ge=r.data)==null?void 0:ge.sellers)??[],K=((M=d.data)==null?void 0:M.focusSet)??[],B=j.useMemo(()=>rS((U==null?void 0:U.data)??[],K),[K,U==null?void 0:U.data]),V=oS(Q.data),P=j.useMemo(()=>sS(L,U,(V==null?void 0:V.routes)??[]),[U,V==null?void 0:V.routes,L]),J=j.useMemo(()=>p.map(X=>B.find(le=>le.id===X)).filter(b0),[B,p]),I=h.sellerIds??[],te=h.fixedByModel??{},se=J.length,F=J.filter(X=>h.mode==="fixed"?!!te[X.id]:h.mode==="fixedSet"?I.length>0:!0).length,fe=j.useMemo(()=>{var X;return c0({inferences:((X=m.data)==null?void 0:X.inferences)??[],modelsResponse:U,sellersResponse:r.data,previewPlan:V,activeModelId:g})},[g,(k=m.data)==null?void 0:k.inferences,U,V,r.data]);j.useEffect(()=>{var X;(X=a.data)!=null&&X.strategy&&x(a.data.strategy)},[(Z=a.data)==null?void 0:Z.strategy]),j.useEffect(()=>{if(p.length>0||B.length===0)return;const X=K.filter(re=>B.some(Te=>Te.id===re)),le=X.length>0?X:B.slice(0,2).map(re=>re.id);v(le),b(le[0]??"")},[K,B,p.length]),j.useEffect(()=>{!g||p.includes(g)||b(p[0]??"")},[g,p]),j.useEffect(()=>{g&&Q.refetch()},[g,h.mode,h.scorer,h.sellerId,(W=h.sellerIds)==null?void 0:W.join(","),mS(h.fixedByModel)]);async function pe(X){x(X),T(null);try{await i.mutateAsync(X)}catch(le){T(le instanceof Error?le.message:String(le))}}function Ae(X){v(le=>{if(le.includes(X)){const Te=le.filter(ze=>ze!==X);return g===X&&b(Te[0]??""),Lo(Te).catch(()=>{}),Te}b(X);const re=[...le,X];return Lo(re).catch(()=>{}),re})}function me(X){v(le=>{const re=le.filter(Te=>Te!==X);return g===X&&b(re[0]??""),Lo(re).catch(()=>{}),re})}function _(X){const le=uS({...h,mode:X},P,g);pe(le)}function $(X){pe({...h,scorer:X})}function ne(X,le){const re=h.sellerIds??[],Te=re.includes(le)?re.filter(ze=>ze!==le):[...re,le];pe({...h,mode:"fixedSet",sellerIds:Te,sellerId:void 0})}function be(X,le){const re={...h.fixedByModel??{},[X]:le};pe({...h,mode:"fixed",fixedByModel:re,sellerId:void 0,sellerIds:void 0}),b(X),z(null)}return s.jsxs("div",{className:"space-y-5",children:[s.jsx("section",{children:s.jsxs(St,{className:"p-4",children:[s.jsxs("div",{className:"flex items-center gap-2 border-b border-[var(--color-line-2)] px-4 py-3",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsx("div",{className:"text-[0.78rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Models"})}),s.jsxs("button",{type:"button",onClick:()=>z({kind:"models"}),className:"inline-flex items-center gap-1.5 rounded-[8px] bg-[var(--color-purple)] px-3 py-1.5 text-[0.78rem] font-semibold text-white hover:bg-[var(--color-purple-2)]","aria-label":"Add",title:"Add models","data-testid":"routing-add-models",children:[s.jsx(Xo,{size:14}),"Add"]})]}),s.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[J.map(X=>{const le=g===X.id,re=X.sellerCount>0;return s.jsxs("div",{className:["inline-flex min-h-9 items-center gap-2 rounded-[9px] border px-3 py-1.5 transition-colors",re?"border-[var(--color-lavender-2)] bg-[var(--color-lavender)] text-[var(--color-purple)] hover:border-[var(--color-purple)] hover:bg-white":"border-rose-200 bg-rose-50 text-rose-700 hover:bg-white",le?"ring-2 ring-[var(--color-lavender-2)] ring-offset-1 ring-offset-white":""].join(" "),children:[s.jsx("button",{type:"button",onClick:()=>b(X.id),className:"flex items-center text-left",children:s.jsx("span",{className:["font-mono text-[0.82rem] font-semibold",re?"text-[var(--color-purple)]":"text-rose-700"].join(" "),children:X.id})}),s.jsx("button",{type:"button",onClick:()=>me(X.id),className:["inline-flex size-5 items-center justify-center rounded-[6px]",re?"text-[var(--color-purple)]/70 hover:bg-white hover:text-[var(--color-purple)]":"text-rose-700/70 hover:bg-white hover:text-rose-700"].join(" "),"aria-label":`Remove ${X.id}`,children:s.jsx(Wx,{size:12})})]},X.id)}),J.length===0?s.jsx("div",{className:"px-4 py-8 text-center text-[0.88rem] text-[var(--color-muted)]",children:"No models yet. Click Add to add common models."}):null,d.isError?s.jsx("div",{className:"px-3 py-2 text-[0.82rem] text-amber-700",children:"Focus models could not be saved."}):null]})]})}),s.jsx("section",{children:s.jsx(St,{className:"overflow-hidden",children:s.jsxs("div",{className:"p-5",children:[s.jsxs("div",{className:"mb-4 flex items-center justify-between gap-3",children:[s.jsx("div",{className:"text-[0.78rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Strategy"}),s.jsxs("div",{className:"text-[0.78rem] text-[var(--color-muted)]",children:[F,"/",Math.max(se,1)," configured"]})]}),a.isLoading||r.isLoading||u.isLoading?s.jsx("div",{className:"mb-3 rounded-[10px] border border-[var(--color-line-2)] bg-white px-3 py-2 text-[0.82rem] text-[var(--color-muted)]",children:"Loading routing data..."}):null,a.isError||r.isError||u.isError?s.jsx("div",{className:"mb-3 rounded-[10px] border border-rose-100 bg-rose-50 px-3 py-2 text-[0.82rem] text-rose-700",children:"Some routing data could not be loaded. Check that tb-proxyd is running."}):null,E?s.jsx("div",{className:"mb-3 rounded-[10px] border border-rose-100 bg-rose-50 px-3 py-2 text-[0.82rem] text-rose-700",children:E}):null,s.jsx("div",{className:"mb-5 grid grid-cols-1 gap-2 md:grid-cols-3",children:Vj.map(X=>s.jsx(aS,{active:h.mode===X.value,title:X.label,description:X.help,onClick:()=>_(X.value)},X.value))}),s.jsx("div",{className:"rounded-[14px] border border-[var(--color-line-2)] bg-white p-4",children:s.jsx(Jj,{mode:h.mode,scorer:h.scorer,selectedModels:J,fixedSetSellers:I,fixedByModel:te,sellers:P,activeModelId:g,onScorerChange:$,onOpenSellerPicker:z,onToggleFixedSetSeller:ne})})]})})}),s.jsx(Fj,{summary:fe}),(A==null?void 0:A.kind)==="models"?s.jsx(tS,{models:B,selectedModelIds:p,onClose:()=>z(null),onToggle:Ae}):null,(A==null?void 0:A.kind)==="sellers"?s.jsx(lS,{modelId:A.modelId,selection:A.selection,selectedSellerIds:A.selection==="single"?te[A.modelId]?[te[A.modelId]]:[]:I,scorer:h.scorer,sellers:P,onClose:()=>z(null),onToggle:X=>{A.selection==="single"?be(A.modelId,X):ne(A.modelId,X)}}):null]})}function Jj({mode:a,scorer:i,selectedModels:r,fixedSetSellers:u,fixedByModel:d,sellers:m,activeModelId:h,onScorerChange:x,onOpenSellerPicker:p,onToggleFixedSetSeller:v}){var E;const g=pS(r,h),b=(E=g[0])==null?void 0:E.id;return a==="fullAuto"?s.jsx("div",{children:s.jsx($v,{scorer:i,onChange:x})}):a==="fixedSet"?s.jsxs("div",{className:"space-y-3",children:[s.jsx($v,{scorer:i,onChange:x}),s.jsx(Ij,{modelId:b,sellers:m,sellerIds:u,onChoose:T=>p({kind:"sellers",modelId:T,selection:"multi"}),onRemove:T=>{b&&v(b,T)}})]}):s.jsx("div",{className:"space-y-3",children:s.jsx(eS,{selectedModels:g,activeModelId:h,resolveValue:T=>fS(d[T],m),onChoose:T=>p({kind:"sellers",modelId:T,selection:"single"})})})}function Fj({summary:a}){return s.jsx("section",{children:s.jsxs(St,{className:"overflow-hidden",children:[s.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 border-b border-[var(--color-line-2)] px-4 py-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-[0.78rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Model route activity"}),s.jsxs("div",{className:"mt-0.5 font-mono text-[0.74rem] text-[var(--color-muted)]",children:[Ze(a.totalRequests)," requests · ",gl(a.totalTokens)," tokens · ",ot(a.totalSpendMicros,{digits:4})]})]}),s.jsxs("div",{className:"rounded-[8px] border border-[var(--color-line-2)] bg-white px-2.5 py-1.5 font-mono text-[0.74rem] text-[var(--color-muted)]",children:[Ze(a.rows.length)," models"]})]}),s.jsxs("div",{className:"divide-y divide-[var(--color-line-2)] bg-white xl:hidden",children:[a.rows.map(i=>s.jsx(Pj,{row:i},`${i.source}-${i.modelId}-${i.currentSellerId}`)),a.rows.length===0?s.jsx("div",{className:"px-4 py-8 text-center text-[var(--color-muted)]",children:"No model traffic yet."}):null]}),s.jsx("div",{className:"hidden min-w-0 max-w-full overflow-x-auto xl:block",children:s.jsxs("table",{className:"w-full min-w-[1180px] border-collapse text-left text-[0.82rem]",children:[s.jsx("thead",{className:"bg-white/70 text-[0.68rem] uppercase tracking-wider text-[var(--color-muted)]",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"MODEL"}),s.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"NODE"}),s.jsx("th",{className:"px-4 py-2.5 text-right font-semibold",children:"REQ"}),s.jsx("th",{className:"px-4 py-2.5 text-right font-semibold",children:"DISC"}),s.jsx("th",{className:"px-4 py-2.5 text-right font-semibold",children:"TTFT"}),s.jsx("th",{className:"px-4 py-2.5 text-right font-semibold",children:"TOKENS"}),s.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"SWITCH"}),s.jsx("th",{className:"px-4 py-2.5 font-semibold",children:"TIME"})]})}),s.jsxs("tbody",{className:"divide-y divide-[var(--color-line-2)] bg-white",children:[a.rows.map(i=>s.jsx(Wj,{row:i},`${i.source}-${i.modelId}-${i.currentSellerId}`)),a.rows.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:8,className:"px-4 py-8 text-center text-[var(--color-muted)]",children:"No model traffic yet."})}):null]})]})})]})})}function Pj({row:a}){return s.jsxs("article",{className:"px-4 py-3",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-start justify-between gap-3",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate font-mono text-[0.92rem] font-semibold text-[var(--color-ink)]",title:a.modelId,children:a.modelId}),s.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[s.jsx(Mi,{tone:a.source==="ledger"?"green":"amber",children:a.source}),a.lastStatus?s.jsx(Mi,{tone:Xa(a.lastStatus),children:kl(a.lastStatus)}):null,a.upstreamStatus?s.jsx(Mi,{tone:Xa(a.upstreamStatus),children:kl(a.upstreamStatus)}):null]}),a.routeReason?s.jsx("div",{className:"mt-1 truncate text-[0.72rem] text-[var(--color-muted)]",title:a.routeReason,children:a.routeReason}):null]}),s.jsxs("div",{className:"min-w-0 text-right",children:[s.jsx("div",{className:"truncate font-semibold text-[var(--color-purple)]",title:a.currentSellerId,children:a.currentSellerName}),s.jsx("div",{className:"mt-0.5 truncate font-mono text-[0.72rem] text-[var(--color-muted)]",title:a.currentSellerId,children:a.currentSellerId}),s.jsx("div",{className:"mt-1 text-[0.72rem] text-[var(--color-muted)]",children:a.currentSellerPaymentMethods.length>0?a.currentSellerPaymentMethods.join(", "):we})]})]}),s.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 sm:grid-cols-3",children:[s.jsx(ji,{label:"Node stats",value:Ze(a.currentSellerRequests),detail:`${Ze(a.sellerModelCount)} models · ${Ze(a.touchedSellerCount)} nodes`}),s.jsx(ji,{label:"Discount",value:a.sellerDiscount,detail:`fee ${a.sellerServiceFee} · ${Jr(a.inputPriceMicrosPer1m,a.outputPriceMicrosPer1m)}`,tone:"green"}),s.jsx(ji,{label:"Speed",value:mt(a.lastTtftMs??a.avgTtftMs),detail:`${mt(a.lastDurationMs??a.avgDurationMs)} total`}),s.jsx(ji,{label:"Tokens",value:gl(a.totalTokens),detail:`${$r(a.inputTokens,a.outputTokens)} · ${ot(a.totalSpendMicros,{digits:4})}`}),s.jsx(ji,{label:"Switch",value:jl(a.selectedAt),compact:!0}),s.jsx(ji,{label:"Last access",value:jl(a.lastAccessAt),detail:a.lastRequestId??void 0,compact:!0})]})]})}function ji({label:a,value:i,detail:r,tone:u="default",compact:d=!1}){return s.jsxs("div",{className:"min-w-0 rounded-[9px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-2.5 py-2",children:[s.jsx("div",{className:"text-[0.62rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:a}),s.jsx("div",{className:["mt-1 min-w-0 truncate font-mono font-semibold",d?"text-[0.72rem]":"text-[0.88rem]",u==="green"?"text-emerald-700":"text-[var(--color-ink)]"].join(" "),title:i,children:i}),r?s.jsx("div",{className:"mt-0.5 truncate text-[0.68rem] text-[var(--color-muted)]",title:r,children:r}):null]})}function Wj({row:a}){return s.jsxs("tr",{className:"align-top transition hover:bg-[var(--color-lavender)]/25",children:[s.jsxs("td",{className:"px-4 py-3",children:[s.jsx("div",{className:"max-w-[230px] truncate font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",title:a.modelId,children:a.modelId}),s.jsxs("div",{className:"mt-1 flex flex-wrap items-center gap-1.5",children:[s.jsx(Mi,{tone:a.source==="ledger"?"green":"amber",children:a.source}),a.lastStatus?s.jsx(Mi,{tone:Xa(a.lastStatus),children:kl(a.lastStatus)}):null,a.upstreamStatus?s.jsx(Mi,{tone:Xa(a.upstreamStatus),children:kl(a.upstreamStatus)}):null]}),a.routeReason?s.jsx("div",{className:"mt-1 max-w-[240px] truncate text-[0.72rem] text-[var(--color-muted)]",title:a.routeReason,children:a.routeReason}):null]}),s.jsxs("td",{className:"px-4 py-3",children:[s.jsx("div",{className:"max-w-[210px] truncate font-semibold text-[var(--color-purple)]",title:a.currentSellerId,children:a.currentSellerName}),s.jsx("div",{className:"mt-0.5 max-w-[210px] truncate font-mono text-[0.72rem] text-[var(--color-muted)]",title:a.currentSellerId,children:bj(a.currentSellerId)}),s.jsx("div",{className:"mt-1 text-[0.72rem] text-[var(--color-muted)]",children:a.currentSellerPaymentMethods.length>0?a.currentSellerPaymentMethods.join(", "):we})]}),s.jsxs("td",{className:"px-4 py-3 text-right",children:[s.jsx("div",{className:"font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",children:Ze(a.currentSellerRequests)}),s.jsx("div",{className:"mt-0.5 text-[0.72rem] text-[var(--color-muted)]",children:"node requests"}),s.jsxs("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:[Ze(a.sellerModelCount)," models · ",Ze(a.touchedSellerCount)," nodes"]})]}),s.jsxs("td",{className:"px-4 py-3 text-right",children:[s.jsx("div",{className:"font-mono text-[0.84rem] font-semibold text-emerald-700",children:a.sellerDiscount}),s.jsxs("div",{className:"mt-0.5 text-[0.72rem] text-[var(--color-muted)]",children:["fee ",a.sellerServiceFee]}),s.jsx("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:Jr(a.inputPriceMicrosPer1m,a.outputPriceMicrosPer1m)})]}),s.jsxs("td",{className:"px-4 py-3 text-right",children:[s.jsx("div",{className:"font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",children:mt(a.lastTtftMs??a.avgTtftMs)}),s.jsx("div",{className:"mt-0.5 text-[0.72rem] text-[var(--color-muted)]",children:"TTFT"}),s.jsxs("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:[mt(a.lastDurationMs??a.avgDurationMs)," total"]})]}),s.jsxs("td",{className:"px-4 py-3 text-right",children:[s.jsx("div",{className:"font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",children:gl(a.totalTokens)}),s.jsx("div",{className:"mt-0.5 text-[0.72rem] text-[var(--color-muted)]",children:$r(a.inputTokens,a.outputTokens)}),s.jsx("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:ot(a.totalSpendMicros,{digits:4})})]}),s.jsx("td",{className:"whitespace-nowrap px-4 py-3 font-mono text-[0.74rem] text-[var(--color-muted)]",children:jl(a.selectedAt)}),s.jsxs("td",{className:"whitespace-nowrap px-4 py-3",children:[s.jsx("div",{className:"font-mono text-[0.74rem] text-[var(--color-muted)]",children:jl(a.lastAccessAt)}),a.lastRequestId?s.jsx("div",{className:"mt-1 max-w-[160px] truncate font-mono text-[0.68rem] text-[var(--color-faint)]",title:a.lastRequestId,children:a.lastRequestId}):null]})]})}function Mi({tone:a,children:i}){const r={green:"bg-emerald-50 text-emerald-700",amber:"bg-amber-50 text-amber-700",red:"bg-rose-50 text-rose-700",blue:"bg-blue-50 text-blue-700",gray:"bg-slate-100 text-slate-600"}[a];return s.jsx("span",{className:["rounded-full px-2 py-0.5 text-[0.66rem] font-semibold uppercase",r].join(" "),children:i})}function $v({scorer:a,onChange:i}){return s.jsx("div",{className:"rounded-[12px] border border-[var(--color-line-2)] bg-white p-1.5",children:s.jsx("div",{className:"grid grid-cols-1 gap-1.5 md:grid-cols-3",children:Zj.map(r=>s.jsxs("button",{type:"button",onClick:()=>i(r.value),"aria-label":`Routing scorer: ${r.label}`,className:["flex min-h-14 items-center gap-2 rounded-[9px] px-3 py-2 text-left transition-colors",a===r.value?"bg-[var(--color-lavender)] text-[var(--color-ink)]":"text-[var(--color-muted)] hover:bg-[var(--color-lavender)]/40"].join(" "),children:[s.jsx(eu,{active:a===r.value,fixed:!0}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block text-[0.86rem] font-semibold",children:r.label}),s.jsx("span",{className:"block truncate text-[0.72rem] text-[var(--color-muted)]",children:r.help})]})]},r.value))})})}function Ij({modelId:a,sellers:i,sellerIds:r,onChoose:u,onRemove:d}){if(!a)return s.jsx("div",{className:"rounded-[12px] border border-[var(--color-line-2)] bg-white px-3 py-4 text-[0.86rem] text-[var(--color-muted)]",children:"Add models before configuring a seller set."});const m=r.map(h=>i.find(x=>x.id===h)).filter(b0);return s.jsxs("div",{className:"overflow-hidden rounded-[12px] border border-[var(--color-line-2)] bg-white",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-b border-[var(--color-line-2)] bg-white/70 px-3 py-2.5",children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsx("div",{className:"text-[0.78rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Sellers"})}),s.jsx("button",{type:"button",onClick:()=>u(a),className:"rounded-[8px] border border-[var(--color-lavender-2)] bg-[var(--color-lavender)] px-3 py-1.5 text-[0.78rem] font-semibold text-[var(--color-purple)] hover:bg-white","aria-label":`Add sellers to fixed set for ${a}`,children:"Add sellers"})]}),m.length>0?s.jsx("div",{className:"min-w-0 max-w-full overflow-x-auto",children:s.jsxs("table",{className:"w-full border-collapse text-left text-[0.82rem]",children:[s.jsx("thead",{className:"bg-white/70 text-[0.68rem] uppercase tracking-wider text-[var(--color-muted)]",children:s.jsxs("tr",{children:[s.jsx("th",{className:"px-3 py-2 font-semibold",children:"Seller"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Discount"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Markup fee"}),s.jsx("th",{className:"px-3 py-2 font-semibold",children:"Payment"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"TTFT"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Tok/s"}),s.jsx("th",{className:"w-10 px-3 py-2 font-semibold"})]})}),s.jsx("tbody",{className:"divide-y divide-[var(--color-line-2)] bg-white",children:m.map(h=>s.jsxs("tr",{children:[s.jsx("td",{className:"px-3 py-2.5 font-semibold text-[var(--color-ink)]",children:h.name}),s.jsxs("td",{className:"whitespace-nowrap px-3 py-2.5 text-right",children:[s.jsx("div",{className:"font-mono font-semibold text-[var(--color-purple)]",children:h.discount}),s.jsx("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:v0(h,a)})]}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:h.markupFee}),s.jsx("td",{className:"px-3 py-2.5 text-[var(--color-muted)]",children:h.paymentMethods.join(", ")}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:mt(h.latencyMs)}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:gf(h.tokensPerSecond)}),s.jsx("td",{className:"px-3 py-2.5 text-right",children:s.jsx("button",{type:"button",onClick:()=>d(h.id),className:"inline-flex size-7 items-center justify-center rounded-[7px] text-[var(--color-muted)] hover:bg-rose-50 hover:text-rose-700","aria-label":`Remove ${h.name}`,children:s.jsx(Wx,{size:14})})})]},h.id))})]})}):s.jsx("div",{className:"px-3 py-8 text-center text-[0.86rem] text-[var(--color-muted)]",children:"No sellers yet. Click Add sellers to build the fixed set."})]})}function eS({selectedModels:a,activeModelId:i,resolveValue:r,onChoose:u}){return a.length===0?s.jsx("div",{className:"rounded-[12px] border border-[var(--color-line-2)] bg-white px-3 py-4 text-[0.86rem] text-[var(--color-muted)]",children:"Add models before configuring sellers."}):s.jsx("div",{className:"divide-y divide-[var(--color-line-2)] rounded-[12px] border border-[var(--color-line-2)] bg-white",children:a.map(d=>s.jsxs("div",{className:["flex flex-wrap items-center gap-3 px-3 py-3",i===d.id?"bg-[var(--color-lavender)]/55":""].join(" "),children:[s.jsx("div",{className:"min-w-0 flex-1",children:s.jsx("div",{className:"truncate font-mono text-[0.88rem] font-semibold text-[var(--color-ink)]",children:d.id})}),s.jsxs("div",{className:"min-w-0 flex items-center gap-2",children:[s.jsx("button",{type:"button",onClick:()=>u(d.id),className:"max-w-[240px] truncate rounded-[8px] border border-[var(--color-lavender-2)] bg-[var(--color-lavender)] px-3 py-1.5 text-[0.78rem] font-semibold text-[var(--color-purple)] hover:bg-white","aria-label":`Choose seller for ${d.id}`,children:r(d.id)}),s.jsx("button",{type:"button",onClick:()=>u(d.id),className:"rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 py-1.5 text-[0.78rem] font-semibold text-[var(--color-muted)] hover:border-[var(--color-lavender-2)] hover:text-[var(--color-purple)]","aria-label":`Reselect seller for ${d.id}`,children:"Reselect"})]})]},d.id))})}function tS({models:a,selectedModelIds:i,onClose:r,onToggle:u}){const[d,m]=j.useState(""),h=a.filter(x=>y0(d,[x.id,x.paymentMethod,x.enabled?"enabled":"not enabled"]));return s.jsxs(p0,{title:"Add models",onClose:r,children:[s.jsx(x0,{value:d,onChange:m,placeholder:"Search models or payment"}),s.jsx("div",{className:"mt-3 overflow-hidden rounded-[12px] border border-[var(--color-line-2)]",children:s.jsxs("table",{className:"w-full border-collapse text-left text-[0.84rem]",children:[s.jsx("thead",{className:"bg-white/70 text-[0.7rem] uppercase tracking-wider text-[var(--color-muted)]",children:s.jsxs("tr",{children:[s.jsx("th",{className:"w-10 px-3 py-2 font-semibold"}),s.jsx("th",{className:"px-3 py-2 font-semibold",children:"Model"}),s.jsx("th",{className:"px-3 py-2 font-semibold",children:"Payment"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Sellers"})]})}),s.jsxs("tbody",{className:"divide-y divide-[var(--color-line-2)] bg-white",children:[h.map(x=>{const p=i.includes(x.id);return s.jsxs("tr",{onClick:()=>u(x.id),className:["cursor-pointer",p?"bg-[var(--color-lavender)]/70":"hover:bg-[var(--color-lavender)]/35",x.enabled?"":"opacity-60"].join(" "),children:[s.jsx("td",{className:"px-3 py-2.5",children:s.jsx(eu,{active:p,fixed:!1})}),s.jsx("td",{className:"px-3 py-2.5 font-mono font-semibold text-[var(--color-ink)]",children:x.id}),s.jsx("td",{className:"px-3 py-2.5",children:s.jsx(nS,{enabled:x.enabled,paymentMethod:x.paymentMethod})}),s.jsx("td",{className:"px-3 py-2.5 text-right text-[var(--color-muted)]",children:x.sellerCount})]},x.id)}),h.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:4,className:"px-3 py-8 text-center text-[var(--color-muted)]",children:"No models found."})}):null]})]})}),s.jsx("div",{className:"mt-3 flex items-center justify-end border-t border-[var(--color-line-2)] pt-3",children:s.jsx("button",{type:"button",onClick:r,"aria-label":"Done","data-testid":"routing-model-picker-done",className:"inline-flex h-9 items-center justify-center rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)]",children:"Done"})})]})}function lS({modelId:a,selection:i,selectedSellerIds:r,scorer:u,sellers:d,onClose:m,onToggle:h}){const[x,p]=j.useState(""),g=iS(d.filter(b=>b.coverageModelIds.includes(a)),[a],u).filter(b=>y0(x,[b.name,b.id,b.paymentMethods.join(" "),b.health,b.notes.join(" ")]));return s.jsxs(p0,{title:`Choose seller · ${a}`,onClose:m,children:[s.jsx(x0,{value:x,onChange:p,placeholder:"Search sellers, payment, notes"}),s.jsx("div",{className:"mt-3 overflow-hidden rounded-[12px] border border-[var(--color-line-2)]",children:s.jsxs("table",{className:"w-full border-collapse text-left text-[0.82rem]",children:[s.jsx("thead",{className:"bg-white/70 text-[0.7rem] uppercase tracking-wider text-[var(--color-muted)]",children:s.jsxs("tr",{children:[s.jsx("th",{className:"w-10 px-3 py-2 font-semibold"}),s.jsx("th",{className:"px-3 py-2 font-semibold",children:"Seller"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Discount"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Markup fee"}),s.jsx("th",{className:"px-3 py-2 font-semibold",children:"Payment"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"TTFT"}),s.jsx("th",{className:"px-3 py-2 text-right font-semibold",children:"Tok/s"})]})}),s.jsxs("tbody",{className:"divide-y divide-[var(--color-line-2)] bg-white",children:[g.map(b=>{const E=r.includes(b.id);return s.jsxs("tr",{onClick:()=>h(b.id),className:["cursor-pointer",E?"bg-[var(--color-lavender)]/70":"hover:bg-[var(--color-lavender)]/35"].join(" "),children:[s.jsx("td",{className:"px-3 py-2.5",children:s.jsx(eu,{active:E,fixed:i==="single"})}),s.jsx("td",{className:"px-3 py-2.5 font-semibold text-[var(--color-ink)]",children:b.name}),s.jsxs("td",{className:"whitespace-nowrap px-3 py-2.5 text-right",children:[s.jsx("div",{className:"font-mono font-semibold text-[var(--color-purple)]",children:b.discount}),s.jsx("div",{className:"mt-0.5 font-mono text-[0.72rem] text-[var(--color-muted)]",children:v0(b,a)})]}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:b.markupFee}),s.jsx("td",{className:"px-3 py-2.5 text-[var(--color-muted)]",children:b.paymentMethods.join(", ")}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:mt(b.latencyMs)}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:gf(b.tokensPerSecond)})]},b.id)}),g.length===0?s.jsx("tr",{children:s.jsx("td",{colSpan:7,className:"px-3 py-8 text-center text-[var(--color-muted)]",children:"No sellers found."})}):null]})]})})]})}function p0({title:a,children:i,onClose:r}){return s.jsx("div",{className:"fixed inset-0 z-30 flex items-center justify-center bg-[#201a38]/35 px-4 py-6 backdrop-blur-sm",children:s.jsxs("div",{className:"max-h-[86dvh] w-full max-w-[820px] overflow-hidden rounded-[14px] border border-[var(--color-line-2)] bg-white shadow-[0_24px_70px_rgba(32,26,56,0.22)]",children:[s.jsxs("div",{className:"flex items-center gap-3 border-b border-[var(--color-line-2)] px-5 py-4",children:[s.jsx("div",{className:"min-w-0 flex-1 truncate text-[1rem] font-semibold text-[var(--color-ink)]",children:a}),s.jsx("button",{type:"button",onClick:r,className:"inline-flex size-8 items-center justify-center rounded-[8px] text-[var(--color-muted)] hover:bg-[var(--color-lavender)] hover:text-[var(--color-purple)]","aria-label":"Close",children:s.jsx(Zr,{size:16})})]}),s.jsx("div",{className:"max-h-[calc(86dvh-65px)] overflow-auto p-4",children:i})]})})}function aS({active:a,title:i,description:r,onClick:u}){return s.jsxs("button",{type:"button",onClick:u,"aria-label":`Set ${i} routing mode`,className:["min-h-[86px] rounded-[12px] border px-3 py-2.5 text-left transition-all",a?"border-[var(--color-lavender-2)] bg-[var(--color-lavender)] text-[var(--color-ink)]":"border-[var(--color-line-2)] bg-white text-[var(--color-muted)] hover:border-[var(--color-line)]"].join(" "),children:[s.jsxs("span",{className:"flex items-center gap-2 font-mono text-[0.86rem] font-semibold",children:[s.jsx(eu,{active:a,fixed:!0}),i]}),s.jsx("span",{className:"mt-1.5 block text-[0.74rem] leading-snug text-[var(--color-muted)]",children:r})]})}function nS({enabled:a,paymentMethod:i}){return s.jsxs("span",{className:["inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[0.72rem] ring-1",a?"bg-emerald-50 text-emerald-700 ring-emerald-100":"bg-slate-100 text-slate-500 ring-slate-200"].join(" "),children:[a?s.jsx(tj,{size:12}):s.jsx(Jd,{size:12}),i," ",a?"enabled":"not enabled"]})}function eu({active:a,fixed:i}){return s.jsx("span",{className:["inline-flex size-5 shrink-0 items-center justify-center border",i?"rounded-full":"rounded-[6px]",a?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line)] bg-white text-transparent"].join(" "),children:s.jsx(Pt,{size:13,strokeWidth:2.4})})}function iS(a,i,r){return[...a].sort((u,d)=>{const m=Fv(u,i),h=Fv(d,i);return m!==h?h-m:r==="speed"?Id(u.latencyMs,d.latencyMs)||dS(u.tokensPerSecond,d.tokensPerSecond):r==="discount"?Id(u.discountRatio,d.discountRatio):d.healthScore-u.healthScore})}function rS(a,i){const r=new Map;for(const d of a){const m=r.get(d.id)??{sellerIds:new Set,paymentMethods:new Set};m.sellerIds.add(d.sellerId);for(const h of d.paymentMethods)m.paymentMethods.add(h);r.set(d.id,m)}const u=new Map(i.map((d,m)=>[d,m]));return Array.from(r.entries()).map(([d,m])=>({id:d,paymentMethod:Array.from(m.paymentMethods)[0]??we,enabled:m.sellerIds.size>0,sellerCount:m.sellerIds.size})).sort((d,m)=>{const h=u.get(d.id),x=u.get(m.id);return h!==void 0||x!==void 0?(h??9999)-(x??9999):d.id.localeCompare(m.id)})}function sS(a,i,r){const u=(i==null?void 0:i.data)??[],d=new Map(((i==null?void 0:i.sellers)??[]).map(h=>[h.id,h])),m=new Map(r.map(h=>[h.seller.id,h]));return a.map((h,x)=>{var K;const p=m.get(h.id),v=d.get(h.id),g=u.filter(B=>B.sellerId===h.id),b=Array.from(new Set(g.map(B=>B.id))),E=Jv(g.map(B=>B.inputPriceMicrosPer1m)),T=Jv(g.map(B=>B.outputPriceMicrosPer1m)),A=Object.fromEntries(g.map(B=>[B.id,Jr(B.inputPriceMicrosPer1m,B.outputPriceMicrosPer1m)])),z=(p==null?void 0:p.metrics.ttftMs)??(v==null?void 0:v.ttftMs)??(p==null?void 0:p.metrics.avgLatencyMs),Q=(p==null?void 0:p.metrics.avgTokensPerSecond)??(v==null?void 0:v.avgTokensPerSecond)??0,U=p==null?void 0:p.metrics.healthScore,L=(p==null?void 0:p.metrics.discountRatio)??(v==null?void 0:v.discountRatio);return{id:h.id,name:hS(h.name??(v==null?void 0:v.name)??h.id),endpoint:h.url,health:(v==null?void 0:v.status)==="error"||(v==null?void 0:v.status)==="manifest_unavailable"||h.status==="failed"?"offline":h.status==="degraded"?"degraded":"online",healthScore:Number.isFinite(U)?Math.round(U):0,coverageModelIds:b,paymentMethods:(v==null?void 0:v.paymentMethods)??h.paymentMethods??[],discountRatio:L,discount:jf(L),markupFee:s0(v==null?void 0:v.serviceFeeRatio),price:Jr(E,T),priceByModelId:A,inputPriceMicrosPer1m:E,outputPriceMicrosPer1m:T,latencyMs:Number.isFinite(z)?Math.round(z):void 0,tokensPerSecond:Q,notes:[((K=h.supportedProtocols)==null?void 0:K.join(", "))||"no protocols",`registry #${x+1}`]}})}function v0(a,i){return a.priceByModelId[i]??a.price}function Jv(a){const i=a.filter(r=>Number.isFinite(r));if(i.length!==0)return Math.min(...i)}function oS(a){if(a)return a.plan??{routes:a.routes,mode:a.mode,scorer:a.scorer,reason:a.reason}}function uS(a,i,r){var u,d;if(a.mode==="fixed"){const m={...a.fixedByModel??{}},h=((u=cS(i,r))==null?void 0:u.id)||((d=i[0])==null?void 0:d.id);return r&&!m[r]&&h&&(m[r]=h),{mode:"fixed",scorer:a.scorer,fixedByModel:m}}if(a.mode==="fixedSet"){const m=a.sellerIds&&a.sellerIds.length>0?a.sellerIds:i.filter(h=>!r||h.coverageModelIds.includes(r)).slice(0,2).map(h=>h.id);return{mode:"fixedSet",scorer:a.scorer,sellerIds:m}}return{mode:"fullAuto",scorer:a.scorer}}function cS(a,i){return a.find(r=>!i||r.coverageModelIds.includes(i))}function Fv(a,i){return i.length===0?a.coverageModelIds.length:i.filter(r=>a.coverageModelIds.includes(r)).length}function Id(a,i){const r=Number.isFinite(a),u=Number.isFinite(i);return r&&u?a-i:r?-1:u?1:0}function dS(a,i){return Id(i,a)}function fS(a,i){var r;return a?((r=i.find(u=>u.id===a))==null?void 0:r.name)??a:"Not selected"}function mS(a){return Object.entries(a??{}).sort(([i],[r])=>i.localeCompare(r)).map(([i,r])=>`${i}:${r}`).join(",")}function hS(a){var i;return((i=a.split("(")[0])==null?void 0:i.trim())||a}function x0({value:a,onChange:i,placeholder:r}){return s.jsxs("label",{className:"flex items-center gap-2 rounded-[12px] border border-[var(--color-line-2)] bg-white px-3 py-2 text-[0.84rem] text-[var(--color-muted)]",children:[s.jsx(Wo,{size:15}),s.jsx("input",{name:"routing-search",value:a,onChange:u=>i(u.target.value),placeholder:r,className:"min-w-0 flex-1 bg-transparent font-mono text-[0.84rem] text-[var(--color-ink)] outline-none placeholder:text-[var(--color-faint)]"})]})}function y0(a,i){const r=a.trim().toLowerCase();return r?i.some(u=>u.toLowerCase().includes(r)):!0}function pS(a,i){return i?[...a].sort((r,u)=>r.id===i?-1:u.id===i?1:0):a}function b0(a){return a!==void 0}function g0({totalItems:a,pageSize:i,page:r,onPageChange:u,onPageSizeChange:d,pageSizeOptions:m=[25,50,100]}){const h=Math.max(1,Math.ceil(a/i)),x=j.useMemo(()=>vS(r,h),[r,h]);if(a===0)return null;const p=(r-1)*i+1,v=Math.min(r*i,a);return s.jsxs("div",{className:"flex flex-col gap-3 border-t border-[var(--color-line-2)] bg-[var(--color-page)]/60 px-4 py-3 text-[0.85rem] lg:flex-row lg:items-center lg:justify-between",children:[s.jsxs("div",{className:"text-[var(--color-muted)]",children:["Showing ",s.jsx("span",{className:"font-mono font-semibold text-[var(--color-ink)]",children:p}),"-",s.jsx("span",{className:"font-mono font-semibold text-[var(--color-ink)]",children:v})," of"," ",s.jsx("span",{className:"font-mono font-semibold text-[var(--color-ink)]",children:a})]}),s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("label",{className:"text-[0.78rem] text-[var(--color-muted)]",children:"Rows"}),s.jsx("select",{className:"bg-[var(--color-card)] border border-[var(--color-line-2)] rounded px-1.5 py-0.5 text-[0.85rem] text-[var(--color-ink)] focus:outline-none focus:border-[var(--color-purple)]",value:i,onChange:g=>{const b=Math.max(1,Number(g.target.value)||25);d==null||d(b),u(1)},children:m.map(g=>s.jsx("option",{value:g,children:g},g))}),s.jsxs("div",{className:"ml-2 flex items-center gap-1",children:[s.jsx("button",{type:"button",disabled:r<=1,onClick:()=>u(1),className:"px-2 py-0.5 rounded border border-[var(--color-line-2)] text-[var(--color-ink)] disabled:opacity-40 disabled:cursor-not-allowed hover:bg-[var(--color-lavender)]/40",title:"First page","aria-label":"First page",children:"«"}),s.jsx("button",{type:"button",disabled:r<=1,onClick:()=>u(r-1),className:"px-2 py-0.5 rounded border border-[var(--color-line-2)] text-[var(--color-ink)] disabled:opacity-40 disabled:cursor-not-allowed hover:bg-[var(--color-lavender)]/40",title:"Previous page","aria-label":"Previous page",children:"‹"}),x.map((g,b)=>g==="…"?s.jsx("span",{className:"px-1.5 text-[var(--color-muted)]",children:"…"},`gap-${b}`):s.jsx("button",{type:"button",onClick:()=>u(g),"aria-label":`Page ${g}`,"aria-current":g===r?"page":void 0,className:g===r?"px-2.5 py-0.5 rounded bg-[var(--color-purple)] text-white font-medium":"px-2.5 py-0.5 rounded border border-[var(--color-line-2)] text-[var(--color-ink)] hover:bg-[var(--color-lavender)]/40",children:g},g)),s.jsx("button",{type:"button",disabled:r>=h,onClick:()=>u(r+1),className:"px-2 py-0.5 rounded border border-[var(--color-line-2)] text-[var(--color-ink)] disabled:opacity-40 disabled:cursor-not-allowed hover:bg-[var(--color-lavender)]/40",title:"Next page","aria-label":"Next page",children:"›"}),s.jsx("button",{type:"button",disabled:r>=h,onClick:()=>u(h),className:"px-2 py-0.5 rounded border border-[var(--color-line-2)] text-[var(--color-ink)] disabled:opacity-40 disabled:cursor-not-allowed hover:bg-[var(--color-lavender)]/40",title:"Last page","aria-label":"Last page",children:"»"}),s.jsx("span",{className:"ml-2 text-[0.78rem] text-[var(--color-muted)]",children:"Go to"}),s.jsx("input",{type:"number",min:1,max:h,defaultValue:r,"aria-label":"Go to page",onKeyDown:g=>{if(g.key==="Enter"){const b=Math.max(1,Math.min(h,Number(g.target.value)||1));u(b)}},className:"w-14 bg-[var(--color-card)] border border-[var(--color-line-2)] rounded px-1.5 py-0.5 text-[0.85rem] text-[var(--color-ink)] text-center focus:outline-none focus:border-[var(--color-purple)]"}),s.jsx("span",{className:"text-[0.78rem] text-[var(--color-muted)]",children:"page"})]})]})]})}function vS(a,i){if(i<=7)return Array.from({length:i},(d,m)=>m+1);const r=[],u=d=>{r[r.length-1]!==d&&r.push(d)};u(1),a>4&&u("…");for(let d=Math.max(2,a-1);d<=Math.min(i-1,a+1);d++)u(d);return a<i-3&&u("…"),u(i),r}function xS(){var ge,M;const a=Io(),i=cj(),[r,u]=j.useState("inferences"),[d,m]=j.useState(""),[h,x]=j.useState("all"),[p,v]=j.useState("all"),[g,b]=j.useState("all"),[E,T]=j.useState("all"),[A,z]=j.useState(1),[Q,U]=j.useState(1),[L,K]=j.useState(25),[B,V]=j.useState(null),[P,J]=j.useState(null),I=a.isLoading||i.isLoading,te=((ge=a.data)==null?void 0:ge.inferences)??[],se=((M=i.data)==null?void 0:M.purchases)??[],F=d.trim().toLowerCase(),fe=j.useMemo(()=>NS(te,se),[te,se]),pe=j.useMemo(()=>MS(te),[te]),Ae=j.useMemo(()=>wS(se),[se]),me=j.useMemo(()=>te.filter(k=>h!=="all"&&k.status!==h||p!=="all"&&k.modelId!==p?!1:TS(k,F)).sort((k,Z)=>Z.createdAt.localeCompare(k.createdAt)),[te,p,h,F]),_=j.useMemo(()=>se.filter(k=>g!=="all"&&k.status!==g||E!=="all"&&k.paymentMethod!==E?!1:CS(k,F)).sort((k,Z)=>Z.createdAt.localeCompare(k.createdAt)),[se,E,g,F]),$=j.useMemo(()=>Wv(me,A,L),[me,A,L]),ne=j.useMemo(()=>Wv(_,Q,L),[_,Q,L]),be=a.isError||i.isError;return j.useEffect(()=>{const k=Math.max(1,Math.ceil(me.length/L));A>k&&z(k)},[me.length,A,L]),j.useEffect(()=>{const k=Math.max(1,Math.ceil(_.length/L));Q>k&&U(k)},[_.length,L,Q]),s.jsxs("div",{className:"space-y-4",children:[s.jsxs("section",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[s.jsx(_o,{icon:s.jsx(J2,{className:"size-5"}),label:"Inference spend",value:ot(fe.inferenceSpendMicros,{digits:4}),detail:`${Ze(fe.inferenceCount)} requests`,tone:"spend"}),s.jsx(_o,{icon:s.jsx(U2,{className:"size-5"}),label:"Token usage",value:gl(fe.inputTokens+fe.outputTokens),detail:$r(fe.inputTokens,fe.outputTokens),tone:"tokens"}),s.jsx(_o,{icon:s.jsx(Gr,{className:"size-5"}),label:"Purchase credit",value:ot(fe.purchaseCreditMicros,{digits:4}),detail:`${Ze(fe.settledPurchases)} settled`,tone:"credit"}),s.jsx(_o,{icon:s.jsx(A2,{className:"size-5"}),label:"Average response",value:mt(fe.averageDurationMs),detail:"Completed inference time",tone:"latency"})]}),s.jsxs(St,{className:"overflow-hidden p-0",children:[s.jsxs("div",{className:"border-b border-[var(--color-line-2)] bg-white px-4 py-3",children:[s.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between",children:[s.jsx("div",{children:s.jsx("h1",{className:"text-[1.05rem] font-semibold text-[var(--color-ink)]",children:"Usage details"})}),s.jsxs("div",{className:"grid grid-cols-2 overflow-hidden rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-1",children:[s.jsx(Pv,{label:"Inferences",active:r==="inferences",count:me.length,onClick:()=>u("inferences"),children:"Inferences"}),s.jsx(Pv,{label:"Purchases",active:r==="purchases",count:_.length,onClick:()=>u("purchases"),children:"Purchases"})]})]}),s.jsxs("div",{className:"mt-3 grid gap-2 lg:grid-cols-[minmax(220px,1fr)_160px_200px]",children:[s.jsxs("label",{className:"relative block",children:[s.jsx(Wo,{className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-[var(--color-muted)]"}),s.jsx("input",{className:"h-9 w-full rounded-[8px] border border-[var(--color-line-2)] bg-white pl-9 pr-3 text-[0.86rem] text-[var(--color-ink)] outline-none transition placeholder:text-[var(--color-muted)] focus:border-[var(--color-purple)]",value:d,placeholder:r==="inferences"?"Search request, model, seller...":"Search purchase, method, seller...",onChange:k=>{m(k.target.value),z(1),U(1)}})]}),r==="inferences"?s.jsxs(s.Fragment,{children:[s.jsx(Do,{label:"Status",value:h,options:pe.statuses,onChange:k=>{x(k),z(1)}}),s.jsx(Do,{label:"Model",value:p,options:pe.models,onChange:k=>{v(k),z(1)}})]}):s.jsxs(s.Fragment,{children:[s.jsx(Do,{label:"Status",value:g,options:Ae.statuses,onChange:k=>{b(k),U(1)}}),s.jsx(Do,{label:"Method",value:E,options:Ae.methods,onChange:k=>{T(k),U(1)}})]})]})]}),be?s.jsx("div",{className:"border-b border-rose-100 bg-rose-50 px-4 py-3 text-[0.86rem] text-rose-700",children:"Ledger data could not be loaded. The local daemon may be offline or missing ledger endpoints."}):null,I?s.jsx(SS,{}):r==="inferences"?s.jsx(yS,{entries:$,total:me.length,page:A,pageSize:L,openId:B,onToggle:k=>V(B===k?null:k),onPageChange:z,onPageSizeChange:k=>{K(k),z(1),U(1)}}):s.jsx(bS,{entries:ne,total:_.length,page:Q,pageSize:L,openId:P,onToggle:k=>J(P===k?null:k),onPageChange:U,onPageSizeChange:k=>{K(k),z(1),U(1)}})]})]})}function _o({icon:a,label:i,value:r,detail:u,tone:d}){const m={spend:{card:"border-[#cceee6] bg-[#e8fbf7]",icon:"bg-white text-[#0f766e]",label:"text-[#0f766e]",value:"text-[#201a38]",accent:"bg-[#0f766e]"},tokens:{card:"border-[#d9e7ff] bg-[#eaf2ff]",icon:"bg-white text-[#2563eb]",label:"text-[#2563eb]",value:"text-[#201a38]",accent:"bg-[#2563eb]"},credit:{card:"border-[#dff8ec] bg-[#e8fff6]",icon:"bg-white text-emerald-700",label:"text-emerald-700",value:"text-[#201a38]",accent:"bg-emerald-500"},latency:{card:"border-[#f8d5de] bg-[#fff0f3]",icon:"bg-white text-[#ef5b78]",label:"text-[#ef5b78]",value:"text-[#201a38]",accent:"bg-[#ef5b78]"}}[d];return s.jsxs(St,{className:["relative flex min-h-[7rem] items-center gap-4 overflow-hidden px-4 py-4",m.card].join(" "),children:[s.jsx("div",{className:["absolute inset-y-0 left-0 w-1",m.accent].join(" ")}),s.jsx("div",{className:["grid size-11 shrink-0 place-items-center rounded-[10px] shadow-sm",m.icon].join(" "),children:a}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:["text-[0.72rem] font-bold uppercase tracking-[0.08em]",m.label].join(" "),children:i}),s.jsx("div",{className:["mt-1 truncate font-mono text-[1.55rem] font-bold leading-none tracking-normal",m.value].join(" "),children:r}),s.jsx("div",{className:"mt-2 truncate text-[0.76rem] font-medium text-[var(--color-muted)]",children:u})]})]})}function Pv({label:a,active:i,count:r,onClick:u,children:d}){return s.jsxs("button",{type:"button",onClick:u,"aria-label":`${a} ledger records, ${Ze(r)} records`,className:["inline-flex h-8 items-center justify-center gap-2 rounded-[8px] px-3 text-[0.82rem] font-semibold transition",i?"bg-white text-[var(--color-ink)] shadow-sm":"text-[var(--color-muted)] hover:text-[var(--color-ink)]"].join(" "),children:[s.jsx("span",{children:d}),s.jsx("span",{className:"font-mono text-[0.76rem]",children:Ze(r)})]})}function Do({label:a,value:i,options:r,onChange:u}){return s.jsxs("label",{className:"grid gap-1",children:[s.jsx("span",{className:"sr-only",children:a}),s.jsxs("select",{"aria-label":a,className:"h-9 rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.86rem] text-[var(--color-ink)] outline-none transition focus:border-[var(--color-purple)]",value:i,onChange:d=>u(d.target.value),children:[s.jsxs("option",{value:"all",children:["All ",a.toLowerCase()]}),r.map(d=>s.jsx("option",{value:d,children:d},d))]})]})}function yS({entries:a,total:i,page:r,pageSize:u,openId:d,onToggle:m,onPageChange:h,onPageSizeChange:x}){return i===0?s.jsx(M0,{label:"inference records"}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"divide-y divide-[var(--color-line-2)] bg-white xl:hidden",children:a.map(p=>s.jsx(gS,{entry:p,open:d===p.requestId,onToggle:()=>m(p.requestId)},p.requestId))}),s.jsx("div",{className:"hidden min-w-0 max-w-full overflow-x-auto xl:block",children:s.jsxs("table",{className:"w-full min-w-[1080px] text-[0.86rem]",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-[var(--color-page)]/70 text-left text-[0.7rem] font-semibold uppercase tracking-[0.08em] text-[var(--color-muted)]",children:[s.jsx("th",{className:"px-4 py-2.5",children:"TIME"}),s.jsx("th",{className:"px-4 py-2.5",children:"REQ"}),s.jsx("th",{className:"px-4 py-2.5",children:"MODEL"}),s.jsx("th",{className:"px-4 py-2.5",children:"SELLER"}),s.jsx("th",{className:"px-4 py-2.5 text-right",children:"TOKENS"}),s.jsx("th",{className:"px-4 py-2.5 text-right",children:"COST"}),s.jsx("th",{className:"px-4 py-2.5 text-right",children:"TTFT"}),s.jsx("th",{className:"px-4 py-2.5 text-right",children:"TOTAL"}),s.jsx("th",{className:"px-4 py-2.5",children:"STATUS"})]})}),a.map(p=>s.jsxs("tbody",{children:[s.jsxs("tr",{onClick:()=>m(p.requestId),className:"cursor-pointer border-t border-[var(--color-line-2)] transition hover:bg-[var(--color-lavender)]/25",children:[s.jsx("td",{className:"whitespace-nowrap px-4 py-3 font-mono text-[0.76rem] text-[var(--color-muted)]",children:u0(p.createdAt)}),s.jsx("td",{className:"px-4 py-3",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(tu,{tone:"purple",children:s.jsx(Px,{className:"size-4"})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"max-w-[180px] truncate font-mono text-[0.78rem] font-semibold text-[var(--color-ink)]",children:p.requestId}),s.jsx("div",{className:"mt-0.5 max-w-[180px] truncate text-[0.72rem] text-[var(--color-muted)]",children:p.endpoint})]})]})}),s.jsx("td",{className:"max-w-[190px] truncate px-4 py-3 text-[var(--color-ink)]",children:p.modelId}),s.jsx("td",{className:"px-4 py-3 font-mono text-[0.78rem] text-[var(--color-text)]",children:p.sellerKey}),s.jsxs("td",{className:"px-4 py-3 text-right font-mono text-[0.82rem]",children:[s.jsxs("div",{children:["In ",Ze(p.promptTokens)]}),s.jsxs("div",{className:"text-[0.72rem] text-[var(--color-muted)]",children:["Out ",Ze(p.completionTokens)]})]}),s.jsx("td",{className:"px-4 py-3 text-right font-mono text-[0.82rem] font-semibold text-[var(--color-ink)]",children:ot(p.billedMicros,{ledger:!0})}),s.jsx("td",{className:"px-4 py-3 text-right font-mono text-[0.82rem] text-[var(--color-muted)]",children:mt(p.ttftMs)}),s.jsx("td",{className:"px-4 py-3 text-right font-mono text-[0.82rem] text-[var(--color-muted)]",children:mt(p.durationMs)}),s.jsx("td",{className:"px-4 py-3",children:s.jsx(ss,{tone:Xa(p.status),children:kl(p.status)})})]}),d===p.requestId?s.jsx("tr",{children:s.jsx("td",{colSpan:9,className:"border-t border-[var(--color-line-2)] bg-[var(--color-page)]/70 px-5 py-4",children:s.jsx(j0,{entry:p})})}):null]},p.requestId))]})}),s.jsx(g0,{totalItems:i,pageSize:u,page:r,onPageChange:h,onPageSizeChange:x})]})}function bS({entries:a,total:i,page:r,pageSize:u,openId:d,onToggle:m,onPageChange:h,onPageSizeChange:x}){return i===0?s.jsx(M0,{label:"purchase records"}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"divide-y divide-[var(--color-line-2)] bg-white xl:hidden",children:a.map(p=>s.jsx(jS,{entry:p,open:d===p.purchaseId,onToggle:()=>m(p.purchaseId)},p.purchaseId))}),s.jsx("div",{className:"hidden min-w-0 max-w-full overflow-x-auto xl:block",children:s.jsxs("table",{className:"w-full min-w-[980px] text-[0.86rem]",children:[s.jsx("thead",{children:s.jsxs("tr",{className:"bg-[var(--color-page)]/70 text-left text-[0.7rem] font-semibold uppercase tracking-[0.08em] text-[var(--color-muted)]",children:[s.jsx("th",{className:"px-4 py-2.5",children:"When"}),s.jsx("th",{className:"px-4 py-2.5",children:"Purchase"}),s.jsx("th",{className:"px-4 py-2.5",children:"Payment method"}),s.jsx("th",{className:"px-4 py-2.5",children:"Model"}),s.jsx("th",{className:"px-4 py-2.5",children:"Seller"}),s.jsx("th",{className:"px-4 py-2.5 text-right",children:"Credit"}),s.jsx("th",{className:"px-4 py-2.5",children:"Status"})]})}),a.map(p=>s.jsxs("tbody",{children:[s.jsxs("tr",{onClick:()=>m(p.purchaseId),className:"cursor-pointer border-t border-[var(--color-line-2)] transition hover:bg-[var(--color-lavender)]/25",children:[s.jsx("td",{className:"whitespace-nowrap px-4 py-3 font-mono text-[0.76rem] text-[var(--color-muted)]",children:u0(p.createdAt)}),s.jsx("td",{className:"px-4 py-3",children:s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(tu,{tone:"green",children:s.jsx(Hi,{className:"size-4"})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"max-w-[210px] truncate font-mono text-[0.78rem] font-semibold text-[var(--color-ink)]",children:p.purchaseId}),s.jsx("div",{className:"mt-0.5 max-w-[210px] truncate text-[0.72rem] text-[var(--color-muted)]",children:Fr(p.paymentReferenceHash)})]})]})}),s.jsx("td",{className:"px-4 py-3 text-[var(--color-ink)]",children:p.paymentMethod}),s.jsx("td",{className:"max-w-[180px] truncate px-4 py-3 text-[var(--color-ink)]",children:p.modelId}),s.jsx("td",{className:"px-4 py-3 font-mono text-[0.78rem] text-[var(--color-text)]",children:p.sellerKey}),s.jsx("td",{className:"px-4 py-3 text-right font-mono text-[0.82rem] font-semibold text-emerald-700",children:ot(p.creditMicros,{digits:4,signed:!0})}),s.jsx("td",{className:"px-4 py-3",children:s.jsx(ss,{tone:Xa(p.status),children:kl(p.status)})})]}),d===p.purchaseId?s.jsx("tr",{children:s.jsx("td",{colSpan:7,className:"border-t border-[var(--color-line-2)] bg-[var(--color-page)]/70 px-5 py-4",children:s.jsx(S0,{entry:p})})}):null]},p.purchaseId))]})}),s.jsx(g0,{totalItems:i,pageSize:u,page:r,onPageChange:h,onPageSizeChange:x})]})}function gS({entry:a,open:i,onToggle:r}){return s.jsxs("article",{className:"px-4 py-3",children:[s.jsx("button",{type:"button",onClick:r,"aria-expanded":i,"aria-label":`Inference ${a.requestId}`,className:"block w-full text-left",children:s.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[s.jsx(tu,{tone:"purple",children:s.jsx(Px,{className:"size-4"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",title:a.requestId,children:a.requestId}),s.jsx("div",{className:"mt-0.5 truncate text-[0.72rem] text-[var(--color-muted)]",title:a.endpoint,children:a.endpoint})]}),s.jsx(ss,{tone:Xa(a.status),children:kl(a.status)})]}),s.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 sm:grid-cols-4",children:[s.jsx(jt,{label:"Time",value:jl(a.createdAt),compact:!0}),s.jsx(jt,{label:"Model",value:a.modelId}),s.jsx(jt,{label:"Seller",value:a.sellerKey}),s.jsx(jt,{label:"Cost",value:ot(a.billedMicros,{ledger:!0}),tone:"strong"}),s.jsx(jt,{label:"In",value:Ze(a.promptTokens)}),s.jsx(jt,{label:"Out",value:Ze(a.completionTokens)}),s.jsx(jt,{label:"TTFT",value:mt(a.ttftMs)}),s.jsx(jt,{label:"Total",value:mt(a.durationMs)}),s.jsx(jt,{label:"Route",value:a.routeReason??we})]})]})]})}),i?s.jsx("div",{className:"mt-3 rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-3",children:s.jsx(j0,{entry:a})}):null]})}function jS({entry:a,open:i,onToggle:r}){return s.jsxs("article",{className:"px-4 py-3",children:[s.jsx("button",{type:"button",onClick:r,"aria-expanded":i,"aria-label":`Purchase ${a.purchaseId}`,className:"block w-full text-left",children:s.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[s.jsx(tu,{tone:"green",children:s.jsx(Hi,{className:"size-4"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex min-w-0 flex-wrap items-start justify-between gap-2",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"truncate font-mono text-[0.84rem] font-semibold text-[var(--color-ink)]",title:a.purchaseId,children:a.purchaseId}),s.jsx("div",{className:"mt-0.5 truncate text-[0.72rem] text-[var(--color-muted)]",title:a.paymentReferenceHash??void 0,children:Fr(a.paymentReferenceHash)})]}),s.jsx(ss,{tone:Xa(a.status),children:kl(a.status)})]}),s.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-2 sm:grid-cols-4",children:[s.jsx(jt,{label:"Time",value:jl(a.createdAt),compact:!0}),s.jsx(jt,{label:"Method",value:a.paymentMethod}),s.jsx(jt,{label:"Model",value:a.modelId}),s.jsx(jt,{label:"Seller",value:a.sellerKey}),s.jsx(jt,{label:"Credit",value:ot(a.creditMicros,{digits:4,signed:!0}),tone:"green"}),s.jsx(jt,{label:"Currency",value:a.currency}),s.jsx(jt,{label:"Completed",value:jl(a.completedAt),compact:!0})]})]})]})}),i?s.jsx("div",{className:"mt-3 rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-3",children:s.jsx(S0,{entry:a})}):null]})}function jt({label:a,value:i,tone:r="default",compact:u=!1}){return s.jsxs("div",{className:"min-w-0 rounded-[9px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-2.5 py-2",children:[s.jsx("div",{className:"text-[0.62rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:a}),s.jsx("div",{className:["mt-1 truncate font-mono font-semibold",u?"text-[0.7rem]":"text-[0.84rem]",r==="green"?"text-emerald-700":r==="strong"?"text-[var(--color-ink)]":"text-[var(--color-text)]"].join(" "),title:i,children:i})]})}function tu({tone:a,children:i}){return s.jsx("div",{className:["grid size-9 shrink-0 place-items-center rounded-lg border",a==="purple"?"border-[var(--color-lavender-2)] bg-[var(--color-lavender)] text-[var(--color-purple)]":"border-emerald-100 bg-emerald-50 text-emerald-700"].join(" "),children:i})}function j0({entry:a}){return s.jsx(N0,{rows:[["Request ID",a.requestId],["Created",jl(a.createdAt)],["Endpoint",a.endpoint],["Payment method",a.paymentMethod??we],["Route",`${a.routeReason??we} -> ${a.sellerKey}`],["Fallback chain",a.falloverChain&&a.falloverChain.length>0?a.falloverChain.join(" -> "):we],["Upstream status",kl(a.upstreamStatus)],["TTFT / total",`${mt(a.ttftMs)} / ${mt(a.durationMs)}`],["Input / output tokens",vj(a.promptTokens,a.completionTokens)],["Billed",ot(a.billedMicros,{ledger:!0})],["Balance after",ot(a.balanceSnapshotMicros,{digits:4})],["Prompt hash",Fr(a.promptHash)],["Response hash",Fr(a.responseHash)],["Price version",a.priceVersion??we]]})}function S0({entry:a}){return s.jsx(N0,{rows:[["Purchase ID",a.purchaseId],["Created",jl(a.createdAt)],["Completed",jl(a.completedAt)],["Payment method",a.paymentMethod],["Payment reference",Fr(a.paymentReferenceHash)],["Credit",ot(a.creditMicros,{digits:4})],["Credit micros",Ze(a.creditMicros)],["Currency",a.currency],["Seller",a.sellerKey],["Model",a.modelId]]})}function N0({rows:a}){return s.jsx("div",{className:"grid gap-x-4 gap-y-2 text-[0.84rem] sm:grid-cols-[150px_minmax(0,1fr)]",children:a.map(([i,r])=>s.jsxs("div",{className:"contents",children:[s.jsx("div",{className:"text-[var(--color-muted)]",children:i}),s.jsx("div",{className:"min-w-0 break-all font-mono text-[0.8rem] text-[var(--color-ink)]",children:r})]},i))})}function SS(){return s.jsx("div",{className:"space-y-2 px-4 py-4",children:Array.from({length:7},(a,i)=>s.jsx("div",{className:"h-12 rounded-lg bg-[var(--color-lavender)]/35"},i))})}function M0({label:a}){return s.jsxs("div",{className:"flex min-h-[220px] flex-col items-center justify-center px-6 py-10 text-center",children:[s.jsx("div",{className:"grid size-12 place-items-center rounded-xl border border-[var(--color-line-2)] bg-[var(--color-page)] text-[var(--color-purple)]",children:s.jsx(Wo,{className:"size-5"})}),s.jsxs("div",{className:"mt-4 font-semibold text-[var(--color-ink)]",children:["No matching ",a]}),s.jsx("div",{className:"mt-1 max-w-[360px] text-[0.86rem] text-[var(--color-muted)]",children:"Adjust the query or filters to inspect another slice of the local ledger."})]})}function NS(a,i){const r=a.reduce((p,v)=>p+(v.billedMicros??0),0),u=i.reduce((p,v)=>p+v.creditMicros,0),d=a.reduce((p,v)=>p+(v.promptTokens??0),0),m=a.reduce((p,v)=>p+(v.completionTokens??0),0),h=a.map(p=>p.durationMs).filter(p=>p!==void 0),x=h.length===0?void 0:h.reduce((p,v)=>p+v,0)/h.length;return{inferenceCount:a.length,inferenceSpendMicros:r,purchaseCreditMicros:u,inputTokens:d,outputTokens:m,settledPurchases:i.filter(p=>ES(p.status)).length,averageDurationMs:x}}function MS(a){return{statuses:Zo(a.map(i=>i.status)),models:Zo(a.map(i=>i.modelId))}}function wS(a){return{statuses:Zo(a.map(i=>i.status)),methods:Zo(a.map(i=>i.paymentMethod))}}function Zo(a){return Array.from(new Set(a.filter(Boolean))).sort((i,r)=>i.localeCompare(r))}function TS(a,i){return i?[a.requestId,a.sellerKey,a.modelId,a.endpoint,a.status,a.paymentMethod,a.routeReason,a.upstreamStatus].some(r=>r==null?void 0:r.toLowerCase().includes(i)):!0}function CS(a,i){return i?[a.purchaseId,a.sellerKey,a.modelId,a.paymentMethod,a.status,a.currency,a.paymentReferenceHash].some(r=>r==null?void 0:r.toLowerCase().includes(i)):!0}function Wv(a,i,r){const u=(i-1)*r;return a.slice(u,u+r)}function ES(a){return a==="settled"||a==="active"||a==="completed"||a==="success"}function AS(){return cl({queryKey:["init","state"],queryFn:()=>dl("/init/state"),refetchInterval:1e4})}async function zS(a){return sa("POST","/init/complete",void 0)}function RS(){return En({mutationFn:()=>sa("POST","/init/doctor/run")})}function OS(){return cl({queryKey:["providers","status"],queryFn:()=>dl("/providers/status"),refetchInterval:1e4})}function kS(){return En({mutationFn:a=>sa("POST","/providers/install/preview",a)})}function _S(){const a=rs();return En({mutationFn:i=>sa("POST","/providers/install/apply",i),onSuccess:()=>{a.invalidateQueries({queryKey:["providers","status"]}),a.invalidateQueries({queryKey:["init","state"]})}})}const DS=[{value:"fullAuto",title:"全自动",body:"自动选择可用供应商。"},{value:"fixedSet",title:"固定供应商组",body:"在指定供应商组内切换。"},{value:"fixed",title:"固定供应商",body:"始终使用指定供应商。"}],US=[{value:"balanced",title:"平衡模式",body:"综合速度、价格、健康度、余额。"},{value:"speed",title:"速度优先",body:"优先选择更快、吞吐量更高供应商。"},{value:"discount",title:"成本优先",body:"优先选择更低成本供应商。"}],Iv=[{index:1,label:"选择模型",value:"默认模型"},{index:2,label:"绑定钱包",value:"支付方式"},{index:3,label:"配置策略",value:"路由规则"},{index:4,label:"配置工具",value:"终端接入"}],BS=[{method:"wechat-pay",name:"WeChat Pay",detail:"微信支付入口预留"},{method:"alipay-agent",name:"Alipay Agent Payment",detail:"代理支付入口预留"},{method:"coinbase-smart-wallet",name:"Coinbase Smart Wallet",detail:"USDC 钱包入口预留"}],HS=["GPT","Claude","Gemini","DeepSeek","Kimi","Qwen","MiniMax","GLM","Doubao","Grok"];function LS(a){const i=new URLSearchParams(a);return i.has("verifyPaymentMethods")?2:(i.has("verifyPickerDom")||i.has("verifyNoIntro")||i.has("verifyCompact"),1)}function qS(){var ms,hs,ps,Ja,Fa,Pa,Ml,Wa,ua,vs,Gi,On;const[a,i]=j.useState(()=>LS(typeof window>"u"?"":window.location.search)),[r,u]=j.useState([]),[d,m]=j.useState(!1),[h,x]=j.useState(),[p,v]=j.useState(!1),[g,b]=j.useState(!1),[E,T]=j.useState("fullAuto"),[A,z]=j.useState("balanced"),[Q,U]=j.useState(""),[L,K]=j.useState([]),[B,V]=j.useState(),[P,J]=j.useState(""),[I,te]=j.useState([]),[se,F]=j.useState({}),[fe,pe]=j.useState(),[Ae,me]=j.useState(),[_,$]=j.useState(!1),[ne,be]=j.useState(null),[ge,M]=j.useState(!1),[k,Z]=j.useState(),W=AS(),X=r0(),le=n0(),re=e0(),Te=OS(),ze=t0(),qt=l0(),fl=kS(),De=_S(),zt=RS(),ht=bf(),An=Io(),oa=j.useMemo(()=>{var oe;return KS(((oe=ht.data)==null?void 0:oe.data)??[])},[(ms=ht.data)==null?void 0:ms.data]),au=j.useMemo(()=>{var oe,Ye,Qt;return rN(((oe=ht.data)==null?void 0:oe.sellers)??[],((Ye=ht.data)==null?void 0:Ye.data)??[],((Qt=An.data)==null?void 0:Qt.inferences)??[])},[(hs=An.data)==null?void 0:hs.inferences,(ps=ht.data)==null?void 0:ps.data,(Ja=ht.data)==null?void 0:Ja.sellers]),zn=j.useMemo(()=>{var oe;return XS(oa,r,((oe=W.data)==null?void 0:oe.recommendedModels)??[])},[(Fa=W.data)==null?void 0:Fa.recommendedModels,oa,r]),Sl=j.useMemo(()=>r.length>0?r:zn.map(oe=>oe.id),[zn,r]),Va=`http://127.0.0.1:${((Pa=X.data)==null?void 0:Pa.proxyPort)??((Ml=W.data)==null?void 0:Ml.runtime.proxyPort)??17821}`,Za=j.useMemo(()=>{var oe;return(((oe=Te.data)==null?void 0:oe.clients)??[]).filter(Ye=>Ye.id!=="custom"&&Ye.detected)},[(Wa=Te.data)==null?void 0:Wa.clients]),os=((ua=re.data)==null?void 0:ua.payments.filter(oe=>oe.enabled&&lu(oe.method)!=="mock"))??[],us=j.useMemo(()=>dN(E,A,Q,L),[Q,L,E,A]),Nt=fN({serviceReady:((vs=X.data)==null?void 0:vs.status)==="running",modelCount:oa.length,routingMode:E,paymentReady:os.length>0,configuredTools:((Gi=Te.data)==null?void 0:Gi.summary.configuredCount)??0}),nu=((On=zt.data)==null?void 0:On.checks.map(mN))??Nt;j.useEffect(()=>{p||!W.data||(u(W.data.focusSet),v(!0))},[W.data,p]),j.useEffect(()=>{P||r.length===0||J(r[0])},[P,r]),j.useEffect(()=>{g||Za.length===0||b(!0)},[g,Za]),j.useEffect(()=>{a!==5||zt.data||zt.error||zt.isPending||zt.mutate()},[a,zt]),j.useEffect(()=>{var Qt;const oe=ca=>{ca.preventDefault(),be(ca),Z("浏览器已经允许直接安装 TokenBuddy。")},Ye=()=>{M(!0),be(null),Z("TokenBuddy 桌面应用已安装。")};return window.addEventListener("beforeinstallprompt",oe),window.addEventListener("appinstalled",Ye),(Qt=window.matchMedia)!=null&&Qt.call(window,"(display-mode: standalone)").matches&&M(!0),()=>{window.removeEventListener("beforeinstallprompt",oe),window.removeEventListener("appinstalled",Ye)}},[]);const cs=oe=>{x(void 0),u(Ye=>Ye.includes(oe)?Ye.filter(Qt=>Qt!==oe):[...Ye,oe])},ds=async()=>{m(!0),x(void 0);try{await Lo(r),x("关注模型已保存。后续工具配置会优先参考这些模型。")}catch(oe){x(`保存失败:${oe instanceof Error?oe.message:String(oe)}`)}finally{m(!1)}},Rn=async()=>{if(V(void 0),!us){V(E==="fixed"?"请选择一个固定供应商。":"请至少选择一个供应商。");return}try{await le.mutateAsync(us),V("供应商路由策略已保存。"),i(4)}catch(oe){V(`保存失败:${oe instanceof Error?oe.message:String(oe)}`)}},iu=async()=>{try{await ze.mutateAsync()}catch{}},fs=async()=>{try{await qt.mutateAsync()}catch{}},ru=async()=>{pe(void 0);const oe=P||Sl[0];if(!oe){pe("请先选择一个默认模型。");return}if(I.length===0){pe("请选择至少一个要写入 TokenBuddy 配置的终端工具。");return}try{await fl.mutateAsync({providers:I,proxyUrl:Va,model:oe,providerSelections:ix(I,se,Sl,oe)}),pe("已生成写入预览。确认无误后可以写入配置。")}catch(Ye){pe(`预览失败:${Ye instanceof Error?Ye.message:String(Ye)}`)}},su=async()=>{pe(void 0);const oe=P||Sl[0];if(!oe){pe("请先选择一个默认模型。");return}if(I.length===0){pe("请选择至少一个要写入 TokenBuddy 配置的终端工具。");return}try{const Ye=await De.mutateAsync({providers:I,proxyUrl:Va,model:oe,providerSelections:ix(I,se,Sl,oe)});pe(`已写入 ${Ye.applied.length} 个配置文件。`),i(5)}catch(Ye){pe(`写入失败:${Ye instanceof Error?Ye.message:String(Ye)}`)}},$a=()=>{X.refetch(),W.refetch(),re.refetch(),Te.refetch(),ht.refetch(),zt.mutate()},Mt=async()=>{me(void 0),$(!0);try{await zS(),me("初始化已标记完成。你可以把 TokenBuddy 安装成桌面应用,之后从系统应用入口打开。"),W.refetch()}catch(oe){me(`完成失败:${oe instanceof Error?oe.message:String(oe)}`)}finally{$(!1)}},Nl=async()=>{if(!ne){Z("请在浏览器地址栏右侧或菜单里选择“安装应用”。");return}try{Z(void 0),await ne.prompt();const oe=await ne.userChoice;if(be(null),oe.outcome==="accepted"){M(!0),Z("TokenBuddy 桌面应用已安装。");return}Z("你可以稍后继续使用浏览器安装入口。")}catch(oe){Z(`安装未完成:${oe instanceof Error?oe.message:String(oe)}`)}},wt=(()=>{var oe,Ye,Qt,ca,Ki,kn,_n,Xi,Vi;return a<=1?s.jsx(YS,{commonModels:zn,allModels:oa,loading:ht.isLoading,error:ht.error,selectedModels:r,saving:d,saveMessage:h,onToggleModel:cs,onSave:ds,onContinue:()=>i(2)}):a===2?s.jsx(eN,{payments:((oe=re.data)==null?void 0:oe.payments)??[],enabledPaymentCount:os.length,loading:re.isLoading,qrUrl:(Ye=ze.data)==null?void 0:Ye.qrImageUrl,rechargeQrUrl:(Qt=qt.data)==null?void 0:Qt.qrImageUrl,walletConfigPresent:(ca=ze.data)==null?void 0:ca.walletConfigPresent,error:ze.error,rechargeError:qt.error,binding:ze.isPending,rechargeLoading:qt.isPending,onBind:iu,onLoadRecharge:fs,onRefreshPayments:()=>{re.refetch()},onBack:()=>i(1),onContinue:()=>i(3)}):a===3?s.jsx(WS,{mode:E,scorer:A,sellers:au,fixedSellerId:Q,fixedSetSellerIds:L,saving:le.isPending,message:B,onModeChange:T,onScorerChange:z,onFixedSellerChange:U,onToggleFixedSetSeller:ut=>{K(Ge=>Ge.includes(ut)?Ge.filter(tt=>tt!==ut):[...Ge,ut])},onSave:Rn,onBack:()=>i(2)}):a===4?s.jsx(lN,{clients:((Ki=Te.data)==null?void 0:Ki.clients)??[],candidates:Za,loading:Te.isLoading,selectedProviders:I,selectedModel:P||Sl[0]||"",modelOptions:Sl,providerSelections:se,proxyUrl:Va,previewChanges:(kn=fl.data)==null?void 0:kn.changes,applying:De.isPending,previewing:fl.isPending,message:fe,onToggleProvider:ut=>{te(Ge=>Ge.includes(ut)?Ge.filter(tt=>tt!==ut):[...Ge,ut])},onModelChange:J,onProviderSelectionChange:(ut,Ge)=>{F(tt=>({...tt,[ut]:Ge}))},onPreview:ru,onInstall:su,onBack:()=>i(3)}):a===5?s.jsx(nN,{items:nu,status:(_n=zt.data)==null?void 0:_n.status,generatedAt:(Xi=zt.data)==null?void 0:Xi.generatedAt,running:zt.isPending,error:zt.error,onRefresh:$a,onBack:()=>i(4),onContinue:()=>i(6)}):s.jsx(iN,{complete:((Vi=W.data)==null?void 0:Vi.setup.status)==="completed",message:Ae,installMessage:k,canInstall:!!ne,installed:ge,saving:_,onBack:()=>i(5),onComplete:Mt,onInstall:Nl})})();return s.jsxs("div",{className:"min-w-0 space-y-3",children:[s.jsx(QS,{activeStep:a,onSelect:i}),s.jsx("div",{className:"min-w-0",children:wt})]})}function QS({activeStep:a,onSelect:i}){return s.jsx("nav",{"aria-label":"初始化步骤",className:"rounded-[12px] border border-[var(--color-line-2)] bg-white p-2.5 shadow-[0_8px_22px_rgba(60,41,112,0.045)]",children:s.jsx("div",{className:"flex items-stretch gap-2 overflow-x-auto",children:Iv.map(r=>{const u=a===r.index,d=a>r.index;return s.jsxs(j.Fragment,{children:[s.jsxs("button",{type:"button",onClick:()=>i(r.index),"aria-current":u?"step":void 0,className:["relative flex min-w-[190px] flex-1 items-center gap-2 rounded-[8px] px-3 py-2 text-left transition",u?"bg-[var(--color-lavender)] ring-1 ring-[var(--color-lavender-2)]":"hover:bg-[var(--color-page)]"].join(" "),children:[s.jsx("span",{className:["grid size-6 shrink-0 place-items-center rounded-full border bg-white",u?"border-[var(--color-purple)] text-[var(--color-purple)] shadow-[0_0_0_3px_rgba(124,61,240,0.1)]":"",d?"border-emerald-200 bg-emerald-50 text-emerald-700":"",!u&&!d?"border-[var(--color-line-2)] text-[var(--color-muted)]":""].join(" "),children:d?s.jsx(Pt,{className:"size-3.5"}):s.jsx("span",{className:"size-1.5 rounded-full bg-current"})}),s.jsxs("span",{className:"min-w-0",children:[s.jsxs("span",{className:["block font-mono text-[0.62rem] font-black uppercase tracking-[0.08em]",u?"text-[var(--color-purple)]":"text-[var(--color-muted)]"].join(" "),children:["STEP ",r.index,":"]}),s.jsx("span",{className:["mt-0.5 block text-[0.82rem] font-semibold",u?"text-[var(--color-purple)]":"text-[var(--color-ink)]"].join(" "),children:r.label}),s.jsx("span",{className:"block truncate text-[0.7rem] text-[var(--color-muted)]",children:r.value})]})]}),r.index<Iv.length?s.jsx("div",{className:"hidden min-w-8 items-center justify-center text-[var(--color-purple)]/70 sm:flex",children:s.jsx(Po,{className:"size-5",strokeWidth:2.6})}):null]},r.index)})})})}function Yi({index:a,title:i,detail:r,meta:u,action:d}){return s.jsxs("div",{className:"flex flex-col gap-2.5 border-b border-[var(--color-line-2)] pb-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("div",{className:"min-w-0",children:s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("span",{className:"rounded-[7px] bg-[var(--color-lavender)] px-2 py-0.5 font-mono text-[0.68rem] font-semibold text-[var(--color-purple)]",children:String(a).padStart(2,"0")}),s.jsx("div",{className:"text-[0.92rem] font-semibold text-[var(--color-ink)]",children:i}),r?s.jsx("span",{className:"text-[0.74rem] text-[var(--color-muted)]",children:r}):null,u?s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5 font-mono text-[0.68rem] text-[var(--color-muted)]",children:u}):null]})}),d?s.jsx("div",{className:"shrink-0",children:d}):null]})}function YS({commonModels:a,allModels:i,loading:r,error:u,selectedModels:d,saving:m,saveMessage:h,onToggleModel:x,onSave:p,onContinue:v}){const[g,b]=j.useState(!1),E=d.map(T=>i.find(A=>A.id===T)??{id:T,sellerCount:0,protocols:[],paymentMethods:[]});return s.jsxs("div",{className:"space-y-3",children:[s.jsxs(St,{className:"p-3",children:[s.jsx(Yi,{index:1,title:"模型访问",detail:"默认和高频模型",meta:`${d.length} selected`,action:s.jsxs("button",{type:"button",disabled:r||!!u,onClick:()=>b(!0),className:"inline-flex h-8 shrink-0 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-purple)] px-2.5 text-[0.78rem] font-semibold text-white transition hover:bg-[var(--color-purple-2)] disabled:cursor-not-allowed disabled:opacity-45",children:[s.jsx(Xo,{className:"size-3.5"}),"添加模型"]})}),u?s.jsxs("div",{className:"mt-3 rounded-[10px] bg-rose-50 px-3 py-2 text-[0.84rem] leading-6 text-rose-700",children:["模型目录加载失败:",u instanceof Error?u.message:String(u)]}):null,E.length===0?s.jsxs("button",{type:"button",disabled:r||!!u,onClick:()=>b(!0),className:"mt-3 flex min-h-[72px] w-full items-center gap-3 rounded-[10px] border border-dashed border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-3 text-left transition hover:border-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[s.jsx("span",{className:"grid size-8 shrink-0 place-items-center rounded-[8px] bg-white text-[var(--color-purple)]",children:s.jsx(Xo,{className:"size-4"})}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block text-[0.86rem] font-semibold text-[var(--color-ink)]",children:"添加可能使用到的模型"}),s.jsx("span",{className:"mt-0.5 block text-[0.76rem] text-[var(--color-muted)]",children:"至少选择一个模型后才能保存并继续。"})]})]}):s.jsx("div",{className:"mt-3 flex flex-wrap gap-2",children:E.map(T=>s.jsxs("div",{className:"inline-flex min-h-9 max-w-full items-center gap-2 rounded-[9px] border border-[var(--color-lavender-2)] bg-[var(--color-lavender)] px-3 py-1.5",children:[s.jsx("span",{className:"truncate font-mono text-[0.82rem] font-semibold text-[var(--color-purple)]",children:T.id}),s.jsx("span",{className:"rounded-full bg-white/70 px-2 py-0.5 text-[0.68rem] font-semibold text-emerald-700",children:"可用"}),s.jsx("button",{type:"button",onClick:()=>x(T.id),className:"inline-flex size-5 items-center justify-center rounded-[6px] text-[var(--color-purple)]/70 hover:bg-white hover:text-[var(--color-purple)]","aria-label":`Remove ${T.id}`,children:s.jsx(Zr,{className:"size-3"})})]},T.id))}),s.jsxs("div",{className:"mt-3 flex flex-col gap-2.5 border-t border-[var(--color-line-2)] pt-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{className:"min-h-5 text-[0.8rem] leading-5 text-[var(--color-muted)]",children:[r?s.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[s.jsx(At,{className:"size-3.5 animate-spin text-[var(--color-purple)]"})," loading catalog"]}):null,!r&&!u&&d.length===0?s.jsx("span",{children:"请选择至少一个可能使用的模型。"}):null,h?s.jsx("div",{className:"mt-1 font-medium text-[var(--color-ink)]",children:h}):null]}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsxs("button",{type:"button",disabled:m||d.length===0,onClick:p,className:"inline-flex h-9 shrink-0 items-center justify-center gap-2 rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[m?s.jsx(At,{className:"size-3.5 animate-spin"}):null,"保存"]}),s.jsxs("button",{type:"button",disabled:d.length===0,onClick:v,className:"inline-flex h-9 shrink-0 items-center justify-center gap-1.5 rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.82rem] font-semibold text-[var(--color-ink)] transition hover:border-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:["下一步",s.jsx(Po,{className:"size-3.5"})]})]})]})]}),g?s.jsx(GS,{models:a,allModels:i,selectedModelIds:d,onToggle:x,onClose:()=>b(!1)}):null]})}function GS({models:a,allModels:i,selectedModelIds:r,onToggle:u,onClose:d}){const[m,h]=j.useState("common"),[x,p]=j.useState(""),v=x.trim(),g=m==="common"?a:v?$S(i,v):[],b=m==="common"?"没有可用的推荐模型。":"输入关键词搜索全部可用模型。",E=[{id:"common",label:"推荐模型",hint:"直接勾选"},{id:"all",label:"搜索添加",hint:"全部模型"}];return s.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-[rgba(32,26,56,0.22)] px-3 py-6 backdrop-blur-sm",children:s.jsxs("div",{className:"flex max-h-full w-full max-w-[720px] flex-col overflow-hidden rounded-[14px] border border-[var(--color-line-2)] bg-white shadow-[0_24px_80px_rgba(32,26,56,0.22)]",children:[s.jsxs("div",{className:"flex items-start gap-3 border-b border-[var(--color-line-2)] px-4 py-3",children:[s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsx("div",{className:"text-[0.72rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"Select models"}),s.jsx("h2",{className:"mt-0.5 text-[1rem] font-semibold text-[var(--color-ink)]",children:"选择可能使用到的模型"}),s.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:"推荐模型直接勾选;搜索添加用于查找平台全部模型。"})]}),s.jsxs("div",{className:"mt-0.5 rounded-full bg-[var(--color-lavender)] px-2.5 py-1 font-mono text-[0.72rem] font-semibold text-[var(--color-purple)]",children:[r.length," selected"]}),s.jsx("button",{type:"button",onClick:d,className:"inline-flex size-8 items-center justify-center rounded-[8px] border border-[var(--color-line-2)] text-[var(--color-muted)] hover:text-[var(--color-ink)]","aria-label":"Close model picker",children:s.jsx(Zr,{className:"size-4"})})]}),s.jsxs("div",{className:"border-b border-[var(--color-line-2)] px-4 py-2.5",children:[s.jsx("div",{className:"mb-2 text-[0.72rem] font-semibold uppercase tracking-wider text-[var(--color-muted)]",children:"已选模型"}),r.length===0?s.jsx("div",{className:"rounded-[9px] border border-dashed border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-2 text-[0.78rem] text-[var(--color-muted)]",children:"还没有选择模型。"}):s.jsx("div",{className:"flex max-h-[92px] flex-wrap gap-1.5 overflow-y-auto pr-1",children:r.map(T=>s.jsxs("span",{className:"inline-flex max-w-full items-center gap-1.5 rounded-[8px] border border-[var(--color-lavender-2)] bg-[var(--color-lavender)] px-2 py-1",children:[s.jsx("span",{className:"max-w-[220px] truncate font-mono text-[0.72rem] font-semibold text-[var(--color-purple)]",children:T}),s.jsx("button",{type:"button",onClick:()=>u(T),className:"inline-flex size-4 items-center justify-center rounded-[5px] text-[var(--color-purple)]/70 hover:bg-white hover:text-[var(--color-purple)]","aria-label":`Remove ${T}`,children:s.jsx(Zr,{className:"size-3"})})]},T))})]}),s.jsxs("div",{className:"border-b border-[var(--color-line-2)] p-3",children:[s.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:E.map(T=>{const A=m===T.id;return s.jsxs("button",{type:"button",onClick:()=>h(T.id),className:["rounded-[9px] border px-3 py-2 text-left transition",A?"border-[var(--color-purple)] bg-[var(--color-lavender)]":"border-[var(--color-line-2)] bg-white hover:border-[var(--color-lavender-2)]"].join(" "),children:[s.jsx("span",{className:["block text-[0.84rem] font-semibold",A?"text-[var(--color-purple)]":"text-[var(--color-ink)]"].join(" "),children:T.label}),s.jsx("span",{className:"mt-0.5 block text-[0.72rem] text-[var(--color-muted)]",children:T.hint})]},T.id)})}),m==="all"?s.jsxs("label",{className:"relative mt-3 block",children:[s.jsx(Wo,{className:"pointer-events-none absolute left-3 top-1/2 size-4 -translate-y-1/2 text-[var(--color-muted)]"}),s.jsx("input",{value:x,onChange:T=>p(T.target.value),placeholder:"搜索平台全部模型...",className:"h-10 w-full rounded-[9px] border border-[var(--color-line-2)] bg-white pl-9 pr-3 text-[0.88rem] text-[var(--color-ink)] outline-none transition placeholder:text-[var(--color-muted)] focus:border-[var(--color-purple)]"})]}):null]}),s.jsx("div",{className:"min-h-0 max-h-[320px] overflow-y-auto p-3",children:g.length===0?s.jsx("div",{className:"rounded-[12px] border border-dashed border-[var(--color-line-2)] bg-[var(--color-page)] px-4 py-8 text-center text-[0.86rem] text-[var(--color-muted)]",children:b}):s.jsx("div",{className:"grid gap-2",children:g.map(T=>{const A=r.includes(T.id);return s.jsxs("button",{type:"button",onClick:()=>u(T.id),"aria-pressed":A,className:["flex items-center gap-3 rounded-[10px] border px-3 py-2 text-left transition",A?"border-[var(--color-purple)] bg-[var(--color-lavender)]":"border-[var(--color-line-2)] bg-white hover:border-[var(--color-lavender-2)]"].join(" "),children:[s.jsx("span",{className:["grid size-6 shrink-0 place-items-center rounded-[7px] border",A?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line-2)] bg-white text-transparent"].join(" "),children:s.jsx(Pt,{className:"size-3.5"})}),s.jsxs("span",{className:"min-w-0 flex-1",children:[s.jsx("span",{className:"block truncate font-mono text-[0.88rem] font-semibold text-[var(--color-ink)]",children:T.id}),s.jsxs("span",{className:"mt-1 flex flex-wrap gap-1.5 text-[0.72rem] text-[var(--color-muted)]",children:[s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:Sf(T.id)}),s.jsx("span",{className:"rounded-full bg-emerald-50 px-2 py-0.5 font-semibold text-emerald-700",children:"可用"}),ef(T.paymentMethods)?s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:ef(T.paymentMethods)}):null]})]}),s.jsx("span",{className:["rounded-[7px] px-2 py-1 text-[0.72rem] font-semibold",A?"bg-[var(--color-purple)] text-white":"bg-[var(--color-page)] text-[var(--color-muted)]"].join(" "),children:A?"已选择":"选择"})]},T.id)})})}),s.jsxs("div",{className:"flex flex-col gap-2 border-t border-[var(--color-line-2)] bg-white px-4 py-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsxs("div",{className:"text-[0.8rem] leading-5 text-[var(--color-muted)]",children:["已选择 ",s.jsx("span",{className:"font-mono font-semibold text-[var(--color-ink)]",children:r.length})," 个模型"]}),s.jsxs("button",{type:"button",onClick:d,"aria-label":"Done",title:"Done selecting models",className:"inline-flex h-9 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)]",children:["完成选择",s.jsx(Pt,{className:"size-3.5"})]})]})]})})}function KS(a){const i=new Map;for(const r of a){const u=i.get(r.id)??{sellers:new Set,protocols:new Set,paymentMethods:new Set};u.sellers.add(r.sellerId);for(const d of r.supportedProtocols)u.protocols.add(d);for(const d of r.paymentMethods)u.paymentMethods.add(d);i.set(r.id,u)}return Array.from(i.entries()).map(([r,u])=>({id:r,sellerCount:u.sellers.size,protocols:Array.from(u.protocols).sort(),paymentMethods:Array.from(u.paymentMethods).sort()})).sort((r,u)=>u.sellerCount!==r.sellerCount?u.sellerCount-r.sellerCount:r.id.localeCompare(u.id))}function XS(a,i,r){const u=VS(a,r);if(u.length>0)return u.slice(0,14);const d=new Set(i),m=new Map;for(const p of i){const v=a.find(g=>g.id===p);v&&m.set(v.id,v)}const h=a.map(p=>({model:p,rank:JS(p.id)})).filter(p=>p.rank<100).sort((p,v)=>p.rank!==v.rank?p.rank-v.rank:v.model.sellerCount!==p.model.sellerCount?v.model.sellerCount-p.model.sellerCount:p.model.id.localeCompare(v.model.id)),x=new Map;for(const p of h){const v=Sf(p.model.id),g=x.get(v)??[];g.push(p),x.set(v,g)}for(const p of HS){const v=p==="GPT"?3:p==="Claude"||p==="Gemini"?2:1;for(const g of(x.get(p)??[]).slice(0,v))m.set(g.model.id,g.model)}for(const p of h){if(m.size>=14)break;d.has(p.model.id)||m.set(p.model.id,p.model)}return Array.from(m.values()).slice(0,14)}function VS(a,i){const r=new Map;for(const u of i){const d=ZS(a,u,r);d&&r.set(d.id,d)}return Array.from(r.values())}function ZS(a,i,r){const u=zd(i);if(!u)return;const d=a.find(m=>zd(m.id)===u&&!r.has(m.id));return d||a.find(m=>{if(r.has(m.id))return!1;const h=zd(m.id);return h.includes(u)||u.includes(h)})}function zd(a){return a.trim().toLowerCase().replace(/_/g,"-")}function $S(a,i){const r=i.trim().toLowerCase();return r?a.filter(u=>[u.id,Sf(u.id),...u.paymentMethods].some(d=>d.toLowerCase().includes(r))):a}function JS(a){const i=a.toLowerCase();return i.includes("gpt-5.5")||i.includes("gpt-5-5")||i.includes("gpt-5_5")?0:i.includes("gpt-5.4")||i.includes("gpt-5-4")||i.includes("gpt-5_4")?1:i.includes("gpt-5")||i.includes("gpt-latest")||i.includes("openai/gpt")?2:i.includes("claude")&&(i.includes("4.8")||i.includes("4-8"))?3:i.includes("claude")&&i.includes("opus")?4:i.includes("claude")&&i.includes("sonnet")?5:i.includes("claude")?6:i.includes("gemini")&&(i.includes("3.1")||i.includes("3-1"))?7:i.includes("gemini")&&i.includes("pro")?8:i.includes("gemini")?9:i.includes("deepseek")?10:i.includes("kimi")||i.includes("moonshot")?11:i.includes("qwen")||i.includes("tongyi")?12:i.includes("minimax")?13:i.includes("glm")||i.includes("zhipu")?14:i.includes("doubao")||i.includes("bytedance")?15:i.includes("grok")?16:100}function Sf(a){const i=a.toLowerCase();return i.includes("gpt")||i.includes("openai")?"GPT":i.includes("claude")||i.includes("anthropic")?"Claude":i.includes("gemini")||i.includes("google")?"Gemini":i.includes("deepseek")?"DeepSeek":i.includes("kimi")||i.includes("moonshot")?"Kimi":i.includes("qwen")||i.includes("tongyi")?"Qwen":i.includes("minimax")?"MiniMax":i.includes("glm")||i.includes("zhipu")?"GLM":i.includes("doubao")||i.includes("bytedance")?"Doubao":i.includes("grok")?"Grok":"Common"}function ef(a){return a.length===0?"":`${FS(a.map(PS)).join("、")}`}function FS(a){return Array.from(new Set(a))}function PS(a){const i=lu(a);return i.includes("x402")?"X402":i.includes("clawtip")?"ClawTip":i.includes("wallet")?"钱包":i.includes("mock")||i.includes("test")?"测试":"其它"}function lu(a){return a.trim().toLowerCase()}function WS({mode:a,scorer:i,sellers:r,fixedSellerId:u,fixedSetSellerIds:d,saving:m,message:h,onModeChange:x,onScorerChange:p,onFixedSellerChange:v,onToggleFixedSetSeller:g,onSave:b,onBack:E}){const T=a!=="fullAuto";return s.jsxs("div",{className:"space-y-3",children:[s.jsxs(St,{className:"p-3",children:[s.jsx(Yi,{index:3,title:"配置策略",detail:"路由规则",meta:`${R0(a)} / ${yN(i)}`}),s.jsxs("div",{className:"mt-3 grid gap-3 xl:grid-cols-2",children:[s.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-2.5",children:[s.jsx("div",{className:"mb-2 text-[0.78rem] font-semibold text-[var(--color-ink)]",children:"路由模式"}),s.jsx("div",{className:"grid gap-2",children:DS.map(A=>s.jsxs("button",{type:"button",onClick:()=>x(A.value),className:["rounded-[9px] border bg-white p-2.5 text-left transition",a===A.value?"border-[var(--color-purple)] bg-[var(--color-lavender)]":"border-[var(--color-line-2)] bg-white hover:border-[var(--color-lavender-2)]"].join(" "),children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:["grid size-5 place-items-center rounded-full border",a===A.value?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line-2)] text-transparent"].join(" "),children:s.jsx(Pt,{className:"size-3"})}),s.jsx("span",{className:"text-[0.84rem] font-semibold text-[var(--color-ink)]",children:A.title})]}),s.jsx("p",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:A.body})]},A.value))})]}),s.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-2.5",children:[s.jsx("div",{className:"mb-2 text-[0.78rem] font-semibold text-[var(--color-ink)]",children:"优化目标"}),s.jsx("div",{className:"grid gap-2",children:US.map(A=>s.jsxs("button",{type:"button",onClick:()=>p(A.value),className:["rounded-[9px] border bg-white p-2.5 text-left transition",i===A.value?"border-[var(--color-purple)] bg-[var(--color-lavender)]":"border-[var(--color-line-2)] bg-white hover:border-[var(--color-lavender-2)]"].join(" "),children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:["grid size-5 place-items-center rounded-full border",i===A.value?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line-2)] text-transparent"].join(" "),children:s.jsx(Pt,{className:"size-3"})}),s.jsx("span",{className:"text-[0.84rem] font-semibold text-[var(--color-ink)]",children:A.title})]}),s.jsx("p",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:A.body})]},A.value))})]})]}),T?s.jsxs("div",{className:"mt-3 rounded-[10px] border border-[var(--color-line-2)] bg-white p-3",children:[s.jsxs("div",{className:"flex flex-col gap-2 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("div",{className:"text-[0.8rem] font-semibold text-[var(--color-ink)]",children:"选择供应商"}),s.jsx("div",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5 text-[0.72rem] text-[var(--color-muted)]",children:a==="fixed"?u?"已选择 1 个":"尚未选择":`已选择 ${d.length} 个`})]}),r.length===0?s.jsx("div",{className:"mt-2 rounded-[9px] border border-dashed border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-3 text-[0.8rem] leading-5 text-[var(--color-muted)]",children:"正在等待供应商目录。你也可以先返回上一步确认模型目录是否已经加载完成。"}):s.jsx(IS,{mode:a,sellers:r,fixedSellerId:u,fixedSetSellerIds:d,onFixedSellerChange:v,onToggleFixedSetSeller:g})]}):s.jsx("div",{className:"mt-3 rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-2 text-[0.8rem] leading-5 text-[var(--color-muted)]",children:"当前是全自动模式,TokenBuddy 会根据模型、供应商健康度、速度、价格和余额状态自动规划调用路径。"})]}),s.jsx(w0,{backLabel:"上一步:绑定钱包",nextLabel:"下一步:配置工具",saving:m,message:h,onBack:E,onNext:b})]})}function IS({mode:a,sellers:i,fixedSellerId:r,fixedSetSellerIds:u,onFixedSellerChange:d,onToggleFixedSetSeller:m}){const[h,x]=j.useState({key:"status",direction:"asc"}),p=j.useMemo(()=>T0(i,h),[i,h]),v=b=>{x(E=>({key:b,direction:E.key===b&&E.direction==="asc"?"desc":"asc"}))},g=b=>{if(a==="fixed"){d(b);return}m(b)};return s.jsx("div",{className:"mt-2 overflow-hidden rounded-[9px] border border-[var(--color-line-2)]",children:s.jsx("div",{className:"max-h-[300px] overflow-auto",children:s.jsxs("table",{className:"min-w-[760px] w-full border-collapse text-left text-[0.78rem]",children:[s.jsx("thead",{className:"sticky top-0 z-10 border-b border-[var(--color-line-2)] bg-[var(--color-page)] text-[0.68rem] uppercase tracking-wider text-[var(--color-muted)]",children:s.jsxs("tr",{children:[s.jsx("th",{className:"w-12 px-2 py-2 font-semibold",children:"选"}),s.jsx(Si,{label:"供应商",sortKey:"name",sort:h,onSort:v}),s.jsx(Si,{label:"状态",sortKey:"status",sort:h,onSort:v}),s.jsx(Si,{label:"模型",sortKey:"models",sort:h,onSort:v,align:"right"}),s.jsx(Si,{label:"价格",sortKey:"price",sort:h,onSort:v}),s.jsx(Si,{label:"折扣",sortKey:"discount",sort:h,onSort:v,align:"right"}),s.jsx(Si,{label:"响应",sortKey:"speed",sort:h,onSort:v,align:"right"}),s.jsx("th",{className:"px-3 py-2 font-semibold",children:"支付"})]})}),s.jsx("tbody",{className:"divide-y divide-[var(--color-line-2)] bg-white",children:p.map(b=>{const E=a==="fixed"?r===b.id:u.includes(b.id);return s.jsxs("tr",{onClick:()=>g(b.id),className:["cursor-pointer transition hover:bg-[var(--color-lavender)]/45",E?"bg-[var(--color-lavender)]/70":"bg-white"].join(" "),children:[s.jsx("td",{className:"px-2 py-2.5",children:s.jsx("span",{className:["grid size-5 place-items-center rounded-full border",E?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line-2)] text-transparent"].join(" "),children:s.jsx(Pt,{className:"size-3"})})}),s.jsxs("td",{className:"max-w-[210px] px-3 py-2.5",children:[s.jsx("div",{className:"truncate font-semibold text-[var(--color-ink)]",children:b.name}),s.jsx("div",{className:"mt-0.5 truncate font-mono text-[0.68rem] text-[var(--color-muted)]",children:b.id})]}),s.jsx("td",{className:"px-3 py-2.5",children:s.jsx("span",{className:["inline-flex whitespace-nowrap rounded-full px-2 py-0.5 text-[0.7rem] font-semibold",gN(b.status)].join(" "),children:bN(b.status)})}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono font-semibold text-[var(--color-ink)]",children:b.modelCount}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 font-mono text-[0.72rem] text-[var(--color-ink)]",children:Jr(b.minInputPriceMicrosPer1m,b.minOutputPriceMicrosPer1m)}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono font-semibold text-[var(--color-purple)]",children:jf(b.discountRatio)}),s.jsx("td",{className:"whitespace-nowrap px-3 py-2.5 text-right font-mono text-[var(--color-ink)]",children:uN(b.avgTtftMs,b.avgTokensPerSecond)}),s.jsx("td",{className:"max-w-[150px] px-3 py-2.5",children:s.jsx("div",{className:"truncate text-[0.72rem] text-[var(--color-muted)]",children:ef(b.paymentMethods)||"—"})})]},b.id)})})]})})})}function Si({label:a,sortKey:i,sort:r,align:u="left",onSort:d}){const m=r.key===i,h=m?r.direction==="asc"?"↑":"↓":"↕";return s.jsx("th",{className:["px-3 py-2 font-semibold",u==="right"?"text-right":"text-left"].join(" "),children:s.jsxs("button",{type:"button",onClick:()=>d(i),className:["inline-flex items-center gap-1 rounded-[6px] px-1.5 py-1 transition hover:bg-white",u==="right"?"justify-end":"justify-start",m?"text-[var(--color-purple)]":"text-[var(--color-muted)]"].join(" "),children:[s.jsx("span",{children:a}),s.jsx("span",{className:"font-mono text-[0.66rem]",children:h})]})})}function eN({payments:a,enabledPaymentCount:i,loading:r,qrUrl:u,rechargeQrUrl:d,walletConfigPresent:m,error:h,rechargeError:x,binding:p,rechargeLoading:v,onBind:g,onLoadRecharge:b,onRefreshPayments:E,onBack:T,onContinue:A}){const[z,Q]=j.useState("clawtip"),[U,L]=j.useState(!1),[K,B]=j.useState(!1),V=a.find(_=>lu(_.method)==="clawtip"),P=!!(V!=null&&V.enabled||m||tN(V==null?void 0:V.config,"walletConfigPresent")),J=U&&P,I=[{method:"clawtip",name:"ClawTip",detail:"JD App 扫码 / 微支付",status:P?"已绑定":"可绑定",available:!0},...BS.map(_=>({..._,status:"Coming soon",available:!1}))],te=I.find(_=>_.method===z)??I[0],se=te.method==="clawtip",F=se&&P&&!J,fe=J||F||U,pe=se?fe:!0,Ae=()=>{L(!0),g()},me=()=>{B(!0),b()};return j.useEffect(()=>{if(!se||!U||P)return;const _=window.setInterval(E,1500);return()=>window.clearInterval(_)},[U,P,E,se]),j.useEffect(()=>{!F||d||v||K||(B(!0),b())},[b,v,d,K,F]),s.jsxs("div",{className:"space-y-3",children:[s.jsxs(St,{className:"p-3",children:[s.jsx(Yi,{index:2,title:"选择支付方式",detail:"钱包和充值通道",meta:r?"checking":`${i} active`,action:se&&F?s.jsxs("button",{type:"button",disabled:v,onClick:me,className:"inline-flex h-8 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-2.5 text-[0.78rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[v?s.jsx(At,{className:"size-3.5 animate-spin"}):s.jsx(Hi,{className:"size-3.5"}),"刷新充值码"]}):se&&U&&!P?s.jsxs("button",{type:"button",disabled:p,onClick:Ae,className:"inline-flex h-8 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-2.5 text-[0.78rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[p?s.jsx(At,{className:"size-3.5 animate-spin"}):s.jsx(Gr,{className:"size-3.5"}),"重新生成"]}):se&&!U&&!P?s.jsxs("button",{type:"button",disabled:p,onClick:Ae,className:"inline-flex h-8 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-2.5 text-[0.78rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[p?s.jsx(At,{className:"size-3.5 animate-spin"}):s.jsx(Gr,{className:"size-3.5"}),"开始绑定"]}):se?null:s.jsx("span",{className:"inline-flex h-8 items-center rounded-[8px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-2.5 font-mono text-[0.72rem] font-semibold text-[var(--color-muted)]",children:"Coming soon"})}),s.jsxs("div",{className:["mt-3 grid gap-3",pe?"lg:grid-cols-[minmax(0,300px)_minmax(0,1fr)]":"lg:max-w-[360px]"].join(" "),children:[s.jsx("div",{className:"grid content-start gap-2",children:I.map(_=>{const $=_.method===te.method;return s.jsxs("button",{type:"button",onClick:()=>Q(_.method),"aria-pressed":$,className:["grid min-h-[64px] grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-3 rounded-[10px] border px-3 py-2 text-left transition",$?"border-[var(--color-purple)] bg-[var(--color-lavender)] shadow-[0_8px_22px_rgba(124,61,240,0.08)]":"border-[var(--color-line-2)] bg-white hover:bg-[var(--color-page)]"].join(" "),children:[s.jsx("span",{className:["grid size-9 shrink-0 place-items-center rounded-[9px] border",$?"border-[var(--color-lavender-2)] bg-white text-[var(--color-purple)]":"border-[var(--color-line-2)] bg-[var(--color-page)] text-[var(--color-muted)]"].join(" "),children:ex(_.method)}),s.jsxs("span",{className:"min-w-0",children:[s.jsx("span",{className:"block truncate text-[0.86rem] font-semibold text-[var(--color-ink)]",children:_.name}),s.jsx("span",{className:"mt-0.5 block truncate text-[0.73rem] text-[var(--color-muted)]",children:_.detail})]}),s.jsx("span",{className:["rounded-full px-2 py-0.5 text-[0.68rem] font-semibold",_.available?"bg-emerald-50 text-emerald-700":"bg-[var(--color-page)] text-[var(--color-muted)]"].join(" "),children:_.status})]},_.method)})}),se?fe?s.jsx("div",{className:"flex min-h-[360px] items-center justify-center rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-4",children:J?s.jsx("div",{className:"grid size-full min-h-[320px] place-items-center rounded-[10px] border border-emerald-100 bg-emerald-50 px-4 py-5 text-center",children:s.jsxs("div",{children:[s.jsx(Pt,{className:"mx-auto size-8 text-emerald-700"}),s.jsx("div",{className:"mt-3 text-[0.92rem] font-semibold text-emerald-900",children:"绑定成功"}),s.jsx("div",{className:"mt-1 text-[0.78rem] leading-5 text-emerald-800",children:"ClawTip 钱包已经写入本机配置,可以继续配置路由策略。"})]})}):F?d?s.jsx("img",{src:d,alt:"ClawTip 充值二维码",className:"max-h-[340px] w-full max-w-[340px] rounded-[10px] border border-[var(--color-line-2)] bg-white p-3 object-contain shadow-[0_12px_28px_rgba(15,23,42,0.1)]"}):s.jsx("div",{className:"grid size-full min-h-[320px] place-items-center rounded-[10px] border border-dashed border-[var(--color-line-2)] bg-white px-3 py-4 text-center",children:s.jsxs("div",{children:[v?s.jsx(At,{className:"mx-auto size-6 animate-spin text-[var(--color-purple)]"}):s.jsx(Hi,{className:"mx-auto size-6 text-[var(--color-purple)]"}),s.jsx("div",{className:"mt-2 text-[0.84rem] font-semibold text-[var(--color-ink)]",children:v?"正在加载充值码":"充值码未加载"}),s.jsx("button",{type:"button",disabled:v,onClick:me,className:"mt-3 inline-flex h-8 items-center justify-center rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.78rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:"重新加载"})]})}):U&&u?s.jsx("img",{src:u,alt:"ClawTip 钱包绑定二维码",className:"max-h-[340px] w-full max-w-[340px] rounded-[10px] border border-[var(--color-line-2)] bg-white p-3 object-contain shadow-[0_12px_28px_rgba(15,23,42,0.1)]"}):U?s.jsx("div",{className:"grid size-full min-h-[320px] place-items-center rounded-[10px] border border-dashed border-[var(--color-line-2)] bg-white px-3 py-4 text-center",children:s.jsxs("div",{children:[p?s.jsx(At,{className:"mx-auto size-6 animate-spin text-[var(--color-purple)]"}):s.jsx(Gr,{className:"mx-auto size-6 text-[var(--color-purple)]"}),s.jsx("div",{className:"mt-2 text-[0.84rem] font-semibold text-[var(--color-ink)]",children:p?"正在生成二维码":"等待二维码"}),s.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:"生成后使用京东 App 扫码绑定。"})]})}):null}):null:s.jsx("div",{className:"grid min-h-[220px] place-items-center rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-4 text-center",children:s.jsxs("div",{className:"max-w-[360px]",children:[s.jsx("span",{className:"mx-auto grid size-11 place-items-center rounded-[12px] border border-[var(--color-line-2)] bg-white text-[var(--color-purple)]",children:ex(te.method)}),s.jsx("div",{className:"mt-3 text-[0.92rem] font-semibold text-[var(--color-ink)]",children:te.name}),s.jsxs("div",{className:"mt-1 text-[0.78rem] leading-5 text-[var(--color-muted)]",children:[te.detail,"。当前版本先通过 ClawTip 完成钱包绑定,后续会在这里接入更多支付流程。"]}),s.jsx("div",{className:"mt-3 inline-flex rounded-full bg-white px-3 py-1 font-mono text-[0.7rem] font-semibold text-[var(--color-muted)]",children:"Coming soon"})]})})]}),se&&!P&&U&&h?s.jsxs("div",{className:"mt-3 rounded-[10px] bg-rose-50 px-3 py-2 text-[0.84rem] leading-6 text-rose-700",children:["生成二维码失败:",h instanceof Error?h.message:String(h)]}):null,se&&F&&x?s.jsxs("div",{className:"mt-3 rounded-[10px] bg-rose-50 px-3 py-2 text-[0.84rem] leading-6 text-rose-700",children:["加载充值二维码失败:",x instanceof Error?x.message:String(x)]}):null]}),s.jsx(w0,{backLabel:"上一步:模型访问",nextLabel:"下一步:配置策略",message:i>0?"支付方式已可用,可以继续配置路由策略。":"如果你暂时跳过绑定,后续首次购买模型额度时仍需要完成支付配置。",onBack:T,onNext:A})]})}function ex(a){const i=lu(a);return i==="wechat-pay"?s.jsx(aj,{className:"size-4"}):i==="alipay-agent"?s.jsx(Q2,{className:"size-4"}):i==="coinbase-smart-wallet"?s.jsx(Hi,{className:"size-4"}):s.jsx(Gr,{className:"size-4"})}function tN(a,i){const r=a==null?void 0:a[i];return r===!0||r==="true"||r===1||r==="1"}function lN({clients:a,candidates:i,loading:r,selectedProviders:u,selectedModel:d,modelOptions:m,providerSelections:h,proxyUrl:x,previewChanges:p,applying:v,previewing:g,message:b,onToggleProvider:E,onModelChange:T,onProviderSelectionChange:A,onPreview:z,onInstall:Q,onBack:U}){var se;const L=new Set(i.map(F=>F.id)),K=i.length,B=a.find(F=>F.id==="custom")??A0(x),V=[...a.filter(F=>F.id!=="custom"),{...B,name:"其他工具"}],P=((se=V[0])==null?void 0:se.id)??"custom",[J,I]=j.useState(P),te=V.find(F=>F.id===J)??V[0]??B;return j.useEffect(()=>{var F;V.some(fe=>fe.id===J)||I(((F=V[0])==null?void 0:F.id)??"custom")},[J,V]),s.jsxs("div",{className:"space-y-3",children:[s.jsxs(St,{className:"p-3",children:[s.jsx(Yi,{index:4,title:"配置工具",detail:"终端接入",meta:`${u.length} 本次写入 / ${K} 已安装`,action:r?s.jsx(At,{className:"size-4 animate-spin text-[var(--color-purple)]"}):null}),s.jsxs("div",{className:"mt-3 grid gap-3 xl:grid-cols-[minmax(0,320px)_minmax(0,1fr)]",children:[s.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-2.5",children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("div",{className:"text-[0.8rem] font-semibold text-[var(--color-ink)]",children:"工具"}),s.jsxs("div",{className:"rounded-full bg-white px-2 py-0.5 text-[0.72rem] text-[var(--color-muted)]",children:[a.length," tools"]})]}),s.jsx("div",{className:"mt-2 grid max-h-[380px] gap-2 overflow-y-auto pr-1",children:V.map(F=>{const fe=F.id!=="custom"&&L.has(F.id),pe=u.includes(F.id),Ae=te.id===F.id;return s.jsxs("div",{className:["rounded-[10px] border p-2.5 text-left transition",Ae?"border-[var(--color-purple)] bg-white shadow-[0_10px_24px_rgba(60,41,112,0.08)]":"border-[var(--color-line-2)] bg-white/70 hover:border-[var(--color-lavender-2)]"].join(" "),children:[s.jsxs("div",{className:"flex items-start gap-2.5",children:[s.jsx("span",{className:["mt-0.5 grid size-6 shrink-0 place-items-center rounded-[8px] border text-[0.72rem] font-semibold",Ae?"border-[var(--color-purple)] bg-[var(--color-lavender)] text-[var(--color-purple)]":"border-[var(--color-line-2)] bg-white text-[var(--color-muted)]"].join(" "),children:cN(F.name)}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[s.jsx("div",{className:"truncate text-[0.84rem] font-semibold text-[var(--color-ink)]",children:F.name}),pe?s.jsx("span",{className:"rounded-full bg-[var(--color-lavender)] px-1.5 py-0.5 text-[0.66rem] font-semibold text-[var(--color-purple)]",children:"本次写入"}):null]}),s.jsxs("div",{className:"mt-1 flex flex-wrap gap-1.5 text-[0.68rem] text-[var(--color-muted)]",children:[s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:O0(F)}),F.commandName?s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:F.commandName}):null,F.id==="custom"?s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:"复制配置"}):null]})]}),F.id!=="custom"?s.jsx("button",{type:"button",disabled:!fe,className:["mt-0.5 grid size-5 shrink-0 place-items-center rounded-full border",pe?"border-[var(--color-purple)] bg-[var(--color-purple)] text-white":"border-[var(--color-line-2)] bg-white text-transparent",fe?"":"opacity-45"].join(" "),"aria-label":pe?`移出 ${F.name} 本次写入`:`写入 ${F.name} 的 TokenBuddy 配置`,"aria-pressed":pe,title:pe?"移出本次写入":"加入本次写入",onClick:()=>E(F.id),children:s.jsx(Pt,{className:"size-3"})}):null]}),s.jsx("button",{type:"button",onClick:()=>I(F.id),className:["mt-2 inline-flex h-7 items-center justify-center rounded-[7px] px-2 text-[0.72rem] font-semibold transition",Ae?"bg-[var(--color-lavender)] text-[var(--color-purple)]":"border border-[var(--color-line-2)] bg-white text-[var(--color-muted)] hover:border-[var(--color-purple)] hover:text-[var(--color-ink)]"].join(" "),children:"查看配置"})]},F.id)})})]}),s.jsx("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-white p-3",children:s.jsx(aN,{client:te,selected:u.includes(te.id),installable:te.id!=="custom"&&L.has(te.id),selectedModel:d,modelOptions:m,providerSelections:h,proxyUrl:x,onToggleInstall:()=>E(te.id),onModelChange:T,onProviderSelectionChange:A})})]}),p?s.jsxs("div",{className:"mt-3 rounded-[10px] border border-[var(--color-line-2)] bg-white p-3",children:[s.jsx("div",{className:"text-[0.8rem] font-semibold text-[var(--color-ink)]",children:"配置文件变更"}),p.length===0?s.jsx("div",{className:"mt-2 rounded-[9px] border border-dashed border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-3 text-[0.8rem] text-[var(--color-muted)]",children:"没有需要写入的配置变更。"}):s.jsx("div",{className:"mt-2 grid max-h-[180px] gap-2 overflow-y-auto pr-1",children:p.map(F=>s.jsxs("div",{className:"rounded-[9px] border border-[var(--color-line-2)] bg-white p-2.5",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2 text-[0.78rem] font-semibold text-[var(--color-ink)]",children:[s.jsx("span",{className:"rounded-full bg-[var(--color-page)] px-2 py-0.5",children:jN(F.action)}),s.jsx("span",{children:F.providerId})]}),s.jsx("div",{className:"mt-1 truncate font-mono text-[0.72rem] text-[var(--color-muted)]",children:F.path}),s.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:F.summary})]},`${F.providerId}:${F.path}:${F.summary}`))})]}):null]}),s.jsxs(St,{className:"flex flex-col gap-3 p-3 lg:flex-row lg:items-center lg:justify-between",children:[s.jsx("div",{className:"text-[0.84rem] leading-6 text-[var(--color-muted)]",children:b?s.jsx("div",{className:"mt-1 font-medium text-[var(--color-ink)]",children:b}):null}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx("button",{type:"button",onClick:U,className:"inline-flex h-9 items-center justify-center rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.82rem] font-semibold text-[var(--color-muted)] transition hover:text-[var(--color-ink)]",children:"上一步:配置策略"}),s.jsxs("button",{type:"button",disabled:g||u.length===0,onClick:z,className:"inline-flex h-9 items-center justify-center gap-2 rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.82rem] font-semibold text-[var(--color-ink)] transition hover:border-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[g?s.jsx(At,{className:"size-4 animate-spin"}):null,"预览写入"]}),s.jsxs("button",{type:"button",disabled:v||u.length===0,onClick:Q,className:"inline-flex h-9 items-center justify-center gap-2 rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[v?s.jsx(At,{className:"size-4 animate-spin"}):null,"写入 TokenBuddy 配置"]})]})]})]})}function aN({client:a,selected:i,installable:r,selectedModel:u,modelOptions:d,providerSelections:m,proxyUrl:h,onToggleInstall:x,onModelChange:p,onProviderSelectionChange:v}){var E,T,A;if(a.id==="custom"){const z=a.manualConfig??A0(h).manualConfig;return s.jsxs("div",{className:"space-y-3",children:[s.jsx(Rd,{client:a,selected:!1,installable:!1}),s.jsxs("div",{className:"grid gap-2",children:[s.jsx(Qr,{label:"OpenAI base URL",value:(z==null?void 0:z.openaiBaseUrl)??z0(h)}),s.jsx(Qr,{label:"Anthropic base URL",value:(z==null?void 0:z.anthropicBaseUrl)??h}),s.jsx(Qr,{label:"API key",value:(z==null?void 0:z.apiKey)??"TOKENBUDDY_PROXY"})]}),s.jsx("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-2 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:"其他工具只需要填入本地推理服务接口和 key,不会写入本机配置文件。"})]})}if(a.id==="claude-code"){const z=E0(m[a.id],d,u),Q=(L,K)=>{v(a.id,{...z,fallbackModel:z.fallbackModel||K||u,roles:{...z.roles,[L]:K?{upstreamModel:K,displayName:K}:void 0}})},U=L=>{v(a.id,{...z,fallbackModel:L}),p(L)};return s.jsxs("div",{className:"space-y-3",children:[s.jsx(Rd,{client:a,selected:i,installable:r,onToggleInstall:x}),s.jsxs("div",{className:"grid gap-2 lg:grid-cols-2",children:[s.jsx(qr,{label:"Fallback",value:z.fallbackModel??u,modelOptions:d,onChange:U}),s.jsx(qr,{label:"Haiku",value:((E=z.roles.haiku)==null?void 0:E.upstreamModel)??"",modelOptions:d,onChange:L=>Q("haiku",L)}),s.jsx(qr,{label:"Sonnet",value:((T=z.roles.sonnet)==null?void 0:T.upstreamModel)??"",modelOptions:d,onChange:L=>Q("sonnet",L)}),s.jsx(qr,{label:"Opus",value:((A=z.roles.opus)==null?void 0:A.upstreamModel)??"",modelOptions:d,onChange:L=>Q("opus",L)})]}),s.jsx("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-2 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:"Claude Code 会把 Haiku、Sonnet、Opus 三种客户端模型映射到你选择的上游模型。"})]})}const g=C0(a.id,m[a.id],u),b=z=>{p(z),v(a.id,{selectionKind:"single-model",protocolPreference:tf(a.id),defaultModel:z})};return s.jsxs("div",{className:"space-y-3",children:[s.jsx(Rd,{client:a,selected:i,installable:r,onToggleInstall:x}),s.jsx(qr,{label:"模型",value:g.defaultModel,modelOptions:d,onChange:b}),s.jsxs("div",{className:"grid gap-2 lg:grid-cols-2",children:[s.jsx(Qr,{label:"Proxy URL",value:h,compact:!0}),s.jsx(Qr,{label:"API key",value:"TOKENBUDDY_PROXY",compact:!0})]}),a.configPath?s.jsx("div",{className:"truncate rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-3 py-2 font-mono text-[0.72rem] text-[var(--color-muted)]",children:a.configPath}):null]})}function Rd({client:a,selected:i,installable:r,onToggleInstall:u}){return s.jsxs("div",{className:"flex flex-col gap-2 border-b border-[var(--color-line-2)] pb-3 sm:flex-row sm:items-start sm:justify-between",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[s.jsx("div",{className:"text-[0.9rem] font-semibold text-[var(--color-ink)]",children:a.name}),s.jsx("span",{className:["rounded-full px-2 py-0.5 text-[0.7rem] font-semibold",a.configured?"bg-emerald-50 text-emerald-700":a.status==="installed"?"bg-[var(--color-lavender)] text-[var(--color-purple)]":"bg-[var(--color-page)] text-[var(--color-muted)]"].join(" "),children:O0(a)})]}),s.jsx("div",{className:"mt-1 text-[0.74rem] leading-5 text-[var(--color-muted)]",children:a.reason})]}),a.id!=="custom"?s.jsxs("button",{type:"button",disabled:!r,onClick:u,className:["inline-flex h-8 shrink-0 items-center justify-center gap-1.5 rounded-[8px] px-2.5 text-[0.78rem] font-semibold transition disabled:cursor-not-allowed disabled:opacity-45",i?"border border-[var(--color-purple)] bg-white text-[var(--color-purple)] hover:bg-[var(--color-lavender)]":"bg-[var(--color-purple)] text-white hover:bg-[var(--color-purple-2)]"].join(" "),children:[i?s.jsx(Pt,{className:"size-3.5"}):s.jsx(Xo,{className:"size-3.5"}),i?"已加入本次写入":"写入 TokenBuddy 配置"]}):null]})}function qr({label:a,value:i,modelOptions:r,onChange:u}){return s.jsxs("label",{className:"block",children:[s.jsx("span",{className:"text-[0.74rem] font-semibold text-[var(--color-muted)]",children:a}),s.jsxs("select",{value:i,onChange:d=>u(d.target.value),className:"mt-1 h-9 w-full rounded-[8px] border border-[var(--color-line-2)] bg-white px-2.5 text-[0.82rem] text-[var(--color-ink)] outline-none focus:border-[var(--color-purple)]",children:[s.jsx("option",{value:"",children:"请选择模型"}),r.map(d=>s.jsx("option",{value:d,children:d},d))]})]})}function Qr({label:a,value:i,compact:r=!1}){const[u,d]=j.useState(!1),m=async()=>{try{await navigator.clipboard.writeText(i),d(!0),window.setTimeout(()=>d(!1),1200)}catch{d(!1)}};return s.jsxs("div",{className:["rounded-[10px] border border-[var(--color-line-2)] bg-white px-3 py-2",r?"min-w-0":""].join(" "),children:[s.jsxs("div",{className:"flex items-center justify-between gap-2",children:[s.jsx("div",{className:"text-[0.72rem] font-semibold text-[var(--color-muted)]",children:a}),s.jsxs("button",{type:"button",onClick:m,className:"inline-flex h-7 items-center justify-center gap-1 rounded-[7px] border border-[var(--color-line-2)] bg-[var(--color-page)] px-2 text-[0.7rem] font-semibold text-[var(--color-ink)] transition hover:border-[var(--color-purple)]",children:[s.jsx(R2,{className:"size-3"}),u?"已复制":"复制"]})]}),s.jsx("div",{className:"mt-1 truncate font-mono text-[0.76rem] text-[var(--color-ink)]",children:i})]})}function nN({items:a,status:i,generatedAt:r,running:u,error:d,onRefresh:m,onBack:h,onContinue:x}){return s.jsx("div",{className:"space-y-3",children:s.jsxs(St,{className:"p-3",children:[s.jsx(Yi,{index:5,title:"验证网关",detail:"本机状态",meta:u?"checking":rx(i),action:s.jsxs("button",{type:"button",disabled:u,onClick:m,className:"inline-flex h-8 items-center justify-center gap-1.5 rounded-[8px] border border-[var(--color-line-2)] bg-white px-2.5 text-[0.78rem] font-semibold text-[var(--color-ink)] transition hover:border-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[u?s.jsx(At,{className:"size-3.5 animate-spin"}):s.jsx(Jd,{className:"size-3.5"}),"刷新"]})}),s.jsxs("div",{className:"mt-3 flex flex-wrap items-center gap-2 text-[0.76rem] text-[var(--color-muted)]",children:[s.jsx("span",{className:["rounded-full px-2 py-0.5 font-semibold",hN(i)].join(" "),children:u?"正在检查":rx(i)}),r?s.jsxs("span",{children:["检查时间:",new Date(r).toLocaleString()]}):s.jsx("span",{children:"等待后端检查。"})]}),d?s.jsxs("div",{className:"mt-3 rounded-[10px] bg-rose-50 px-3 py-2 text-[0.82rem] leading-6 text-rose-700",children:["检查失败:",d instanceof Error?d.message:String(d)]}):null,s.jsx("div",{className:"mt-3 grid gap-2 xl:grid-cols-2",children:a.map(p=>s.jsxs("div",{className:"flex gap-2.5 rounded-[10px] border border-[var(--color-line-2)] bg-white p-2.5",children:[s.jsx("span",{className:["mt-0.5 grid size-6 shrink-0 place-items-center rounded-full",vN(p.status)].join(" "),children:p.ok?s.jsx(Pt,{className:"size-3.5"}):s.jsx(Jd,{className:"size-3.5"})}),s.jsxs("div",{className:"min-w-0 flex-1",children:[s.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 text-[0.82rem] font-semibold text-[var(--color-ink)]",children:[p.title,s.jsx("span",{className:["rounded-full px-1.5 py-0.5 text-[0.68rem]",xN(p.status)].join(" "),children:pN(p.status)})]}),s.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:p.body})]})]},p.title))}),s.jsxs("div",{className:"mt-3 flex flex-col gap-2 border-t border-[var(--color-line-2)] pt-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("div",{className:"text-[0.78rem] leading-5 text-[var(--color-muted)]",children:"发现异常时返回对应步骤补齐配置。"}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx("button",{type:"button",onClick:h,className:"inline-flex h-9 items-center justify-center rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.82rem] font-semibold text-[var(--color-muted)] transition hover:text-[var(--color-ink)]",children:"上一步"}),s.jsxs("button",{type:"button",onClick:x,className:"inline-flex h-9 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)]",children:["下一步",s.jsx(Po,{className:"size-3.5"})]})]})]})]})})}function iN({complete:a,message:i,installMessage:r,canInstall:u,installed:d,saving:m,onBack:h,onComplete:x,onInstall:p}){return s.jsx("div",{className:"space-y-3",children:s.jsxs(St,{className:"p-3",children:[s.jsx(Yi,{index:6,title:a?"初始化完成":"桌面应用",detail:d?"已安装":"可选安装",meta:a?"complete":d?"installed":"optional",action:s.jsxs("button",{type:"button",disabled:d,onClick:p,className:"inline-flex h-8 shrink-0 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-2.5 text-[0.78rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[s.jsx(Pt,{className:"size-3.5"}),d?"已安装":"安装应用"]})}),s.jsxs("div",{className:"mt-3 grid gap-3 xl:grid-cols-[minmax(0,290px)_minmax(0,1fr)]",children:[s.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-[var(--color-page)] p-3",children:[s.jsx("div",{className:"text-[0.84rem] font-semibold text-[var(--color-ink)]",children:d?"TokenBuddy 桌面应用已安装":u?"浏览器支持直接安装":"可从浏览器菜单安装"}),s.jsx("div",{className:"mt-1 text-[0.76rem] leading-5 text-[var(--color-muted)]",children:d?"你可以从系统应用入口打开 TokenBuddy。":u?"点击右上角安装按钮并确认浏览器弹窗。":"在地址栏右侧或浏览器菜单中找到安装应用入口。"}),r?s.jsx("div",{className:"mt-2 text-[0.78rem] font-medium text-[var(--color-ink)]",children:r}):null]}),s.jsx("div",{className:"grid gap-2 lg:grid-cols-3",children:[{title:"安装入口",body:"地址栏或浏览器菜单。"},{title:"应用名称",body:"TokenBuddy。"},{title:"本地服务",body:"继续由 tb-proxyd 提供。"}].map((v,g)=>s.jsxs("div",{className:"rounded-[10px] border border-[var(--color-line-2)] bg-white p-2.5",children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"grid size-5 place-items-center rounded-full bg-[var(--color-lavender)] font-mono text-[0.68rem] font-semibold text-[var(--color-purple)]",children:g+1}),s.jsx("span",{className:"text-[0.8rem] font-semibold text-[var(--color-ink)]",children:v.title})]}),s.jsx("div",{className:"mt-1 text-[0.74rem] leading-5 text-[var(--color-muted)]",children:v.body})]},v.title))})]}),s.jsxs("div",{className:"mt-3 flex flex-col gap-2 border-t border-[var(--color-line-2)] pt-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("div",{className:"text-[0.78rem] leading-5 text-[var(--color-muted)]",children:i?s.jsx("span",{className:"font-medium text-[var(--color-ink)]",children:i}):"完成后可以进入控制台。"}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx("button",{type:"button",onClick:h,className:"inline-flex h-9 items-center justify-center rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.82rem] font-semibold text-[var(--color-muted)] transition hover:text-[var(--color-ink)]",children:"上一步"}),s.jsxs("button",{type:"button",disabled:m||a,onClick:x,className:"inline-flex h-9 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[m?s.jsx(At,{className:"size-3.5 animate-spin"}):s.jsx(Pt,{className:"size-3.5"}),a?"已完成":"完成初始化"]}),s.jsx(is,{to:"/overview",className:"inline-flex h-9 items-center justify-center rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.82rem] font-semibold text-[var(--color-ink)] transition hover:border-[var(--color-purple)]",children:"进入控制台"})]})]})]})})}function w0({backLabel:a,nextLabel:i,saving:r=!1,message:u,onBack:d,onNext:m}){return s.jsxs(St,{className:"flex flex-col gap-2.5 p-3 sm:flex-row sm:items-center sm:justify-between",children:[s.jsx("div",{className:"text-[0.78rem] leading-5 text-[var(--color-muted)]",children:u??"配置完成后继续下一步。"}),s.jsxs("div",{className:"flex flex-wrap gap-2",children:[s.jsx("button",{type:"button",onClick:d,className:"inline-flex h-9 items-center justify-center rounded-[8px] border border-[var(--color-line-2)] bg-white px-3 text-[0.82rem] font-semibold text-[var(--color-muted)] transition hover:text-[var(--color-ink)]",children:a}),s.jsxs("button",{type:"button",disabled:r,onClick:m,className:"inline-flex h-9 items-center justify-center gap-1.5 rounded-[8px] bg-[var(--color-ink)] px-3 text-[0.82rem] font-semibold text-white transition hover:bg-[var(--color-purple)] disabled:cursor-not-allowed disabled:opacity-45",children:[r?s.jsx(At,{className:"size-3.5 animate-spin"}):null,i,r?null:s.jsx(Po,{className:"size-3.5"})]})]})]})}function rN(a,i,r){const u=new Map;for(const h of i){const x=u.get(h.sellerId)??{modelIds:new Set,protocols:new Set,paymentMethods:new Set,ttftMsSamples:[]};x.modelIds.add(h.id);for(const p of h.supportedProtocols)x.protocols.add(p);for(const p of h.paymentMethods)x.paymentMethods.add(p);x.minInputPriceMicrosPer1m=lx(x.minInputPriceMicrosPer1m,h.inputPriceMicrosPer1m),x.minOutputPriceMicrosPer1m=lx(x.minOutputPriceMicrosPer1m,h.outputPriceMicrosPer1m),u.set(h.sellerId,x)}for(const h of r){const x=h.sellerKey;if(!x)continue;const p=u.get(x)??{modelIds:new Set,protocols:new Set,paymentMethods:new Set,ttftMsSamples:[]};Number.isFinite(h.ttftMs)&&p.ttftMsSamples.push(h.ttftMs),u.set(x,p)}const d=a.map(h=>{const x=u.get(h.id);return{id:h.id,name:nx(h.name??h.manifestSellerId??h.id),status:h.status,modelCount:h.modelCount??(x==null?void 0:x.modelIds.size)??0,protocols:h.supportedProtocols??Array.from((x==null?void 0:x.protocols)??[]),paymentMethods:h.paymentMethods??Array.from((x==null?void 0:x.paymentMethods)??[]),discountRatio:h.discountRatio,serviceFeeRatio:h.serviceFeeRatio,minInputPriceMicrosPer1m:x==null?void 0:x.minInputPriceMicrosPer1m,minOutputPriceMicrosPer1m:x==null?void 0:x.minOutputPriceMicrosPer1m,avgTtftMs:h.ttftMs??ax((x==null?void 0:x.ttftMsSamples)??[]),avgTokensPerSecond:h.avgTokensPerSecond??0}}),m=new Set(d.map(h=>h.id));for(const[h,x]of u.entries()){if(m.has(h))continue;const p=i.find(v=>v.sellerId===h);d.push({id:h,name:nx((p==null?void 0:p.sellerName)??h),status:"unknown",modelCount:x.modelIds.size,protocols:Array.from(x.protocols).sort(),paymentMethods:Array.from(x.paymentMethods).sort(),minInputPriceMicrosPer1m:x.minInputPriceMicrosPer1m,minOutputPriceMicrosPer1m:x.minOutputPriceMicrosPer1m,avgTtftMs:ax(x.ttftMsSamples),avgTokensPerSecond:0})}return T0(d,{key:"status",direction:"asc"})}function T0(a,i){const r=i.direction==="asc"?1:-1;return[...a].sort((u,d)=>{const m=sN(u,d,i.key);if(m!==0)return m*r;const h=$o(u.status)-$o(d.status);return h!==0?h:d.modelCount!==u.modelCount?d.modelCount-u.modelCount:u.name.localeCompare(d.name)})}function sN(a,i,r){return r==="status"?$o(a.status)-$o(i.status):r==="name"?a.name.localeCompare(i.name):r==="models"?a.modelCount-i.modelCount:r==="price"?qo(tx(a),tx(i)):r==="discount"?qo(a.discountRatio,i.discountRatio):qo(a.avgTtftMs,i.avgTtftMs)||oN(a.avgTokensPerSecond,i.avgTokensPerSecond)}function tx(a){if(!(!Number.isFinite(a.minInputPriceMicrosPer1m)&&!Number.isFinite(a.minOutputPriceMicrosPer1m)))return(a.minInputPriceMicrosPer1m??0)+(a.minOutputPriceMicrosPer1m??0)}function lx(a,i){const r=Number.isFinite(a),u=Number.isFinite(i);if(r&&u)return Math.min(a,i);if(r)return a;if(u)return i}function ax(a){const i=a.filter(r=>Number.isFinite(r));if(i.length!==0)return i.reduce((r,u)=>r+u,0)/i.length}function qo(a,i){const r=Number.isFinite(a),u=Number.isFinite(i);return r&&u?a-i:r?-1:u?1:0}function oN(a,i){return qo(i,a)}function nx(a){var i;return((i=a.split("(")[0])==null?void 0:i.trim())||a}function uN(a,i){return`${mt(a)} / ${gf(i??0)}`}function ix(a,i,r,u){const d=u||r[0]||"",m={};for(const h of a)h!=="custom"&&(m[h]=h==="claude-code"?E0(i[h],r,d):C0(h,i[h],d));return m}function C0(a,i,r){return(i==null?void 0:i.selectionKind)==="single-model"?{...i,protocolPreference:i.protocolPreference??tf(a),defaultModel:i.defaultModel||r}:{selectionKind:"single-model",protocolPreference:tf(a),defaultModel:r}}function E0(a,i,r){var m;const u=(a==null?void 0:a.selectionKind)==="claude-role-mapping"?(m=a.roles.sonnet)==null?void 0:m.upstreamModel:void 0,d=r||u||i[0]||"";return(a==null?void 0:a.selectionKind)==="claude-role-mapping"?{...a,protocolPreference:"messages",fallbackModel:a.fallbackModel||d,roles:{...a.roles,sonnet:a.roles.sonnet??(d?{upstreamModel:d,displayName:d}:void 0)}}:{selectionKind:"claude-role-mapping",protocolPreference:"messages",fallbackModel:d,roles:{sonnet:d?{upstreamModel:d,displayName:d}:void 0}}}function tf(a){if(a==="codex")return"responses";if(a==="claude-code"||a==="claude-desktop")return"messages";if(["openclaw","opencode","hermes"].includes(a))return"chat_completions"}function A0(a){return{id:"custom",name:"其他工具",status:"manual",detected:!0,configured:!1,reason:"复制本地推理服务接口到任意 OpenAI 或 Anthropic 兼容客户端。",manualConfig:{openaiBaseUrl:z0(a),anthropicBaseUrl:a,apiKey:"TOKENBUDDY_PROXY"}}}function z0(a){const i=a.replace(/\/+$/,"");return i.endsWith("/v1")?i:`${i}/v1`}function cN(a){const i=a.trim();return i?i.slice(0,1).toUpperCase():"?"}function dN(a,i,r,u){if(a==="fixed"){const d=r.trim();return d?{mode:a,scorer:i,sellerId:d}:void 0}if(a==="fixedSet"){const d=Array.from(new Set(u.map(m=>m.trim()).filter(Boolean)));return d.length===0?void 0:{mode:a,scorer:i,sellerIds:d}}return{mode:a,scorer:i}}function fN({serviceReady:a,modelCount:i,routingMode:r,paymentReady:u,configuredTools:d}){return[{title:a?"本地网关正在运行":"本地网关尚未就绪",body:a?"控制台服务和本地代理已经响应。":"请确认 tb-proxyd 已启动,并等待控制台刷新状态。",ok:a,status:a?"passed":"failed",details:[]},{title:i>0?"模型目录已加载":"模型目录尚未加载",body:i>0?`已发现 ${i} 个可用模型。`:"请检查供应商注册表或网络连接。",ok:i>0,status:i>0?"passed":"failed",details:[]},{title:"路由策略已选择",body:`当前策略为${R0(r)},TokenBuddy 会按这个策略规划供应商。`,ok:!!r,status:r?"passed":"failed",details:[]},{title:u?"支付方式可用":"支付方式尚未可用",body:u?"已经检测到至少一个可用支付方式。":"请完成 ClawTip 绑定,或稍后在支付页面补充配置。",ok:u,status:u?"passed":"warning",details:[]},{title:d>0?"终端工具已接入":"终端工具尚未接入",body:d>0?`已经写入 ${d} 个终端工具配置。`:"如果你还没有安装终端工具,可以稍后再执行接入。",ok:d>0,status:d>0?"passed":"warning",details:[]}]}function mN(a){return{title:a.label,body:a.message,ok:a.status==="passed"||a.status==="skipped",status:a.status,details:a.details}}function rx(a){return a==="passed"?"全部通过":a==="warning"?"存在警告":a==="failed"?"需要修复":"等待检查"}function hN(a){return a==="passed"?"bg-emerald-50 text-emerald-700":a==="warning"?"bg-amber-50 text-amber-700":a==="failed"?"bg-rose-50 text-rose-700":"bg-[var(--color-page)] text-[var(--color-muted)]"}function pN(a){return a==="passed"?"通过":a==="warning"?"警告":a==="failed"?"失败":"已跳过"}function vN(a){return a==="passed"?"bg-emerald-50 text-emerald-700":a==="failed"?"bg-rose-50 text-rose-700":a==="skipped"?"bg-slate-100 text-slate-600":"bg-amber-50 text-amber-700"}function xN(a){return a==="passed"?"bg-emerald-50 text-emerald-700":a==="failed"?"bg-rose-50 text-rose-700":a==="skipped"?"bg-slate-100 text-slate-600":"bg-amber-50 text-amber-700"}function R0(a){return a==="fixed"?"固定供应商":a==="fixedSet"?"固定供应商组":"全自动"}function yN(a){return a==="speed"?"速度优先":a==="discount"?"成本优先":"平衡模式"}function bN(a){const i=a.toLowerCase();return["ok","healthy","active","available"].includes(i)?"状态正常":["error","failed","unavailable"].includes(i)?"状态异常":["unknown","pending"].includes(i)?"等待检测":`状态:${a}`}function gN(a){const i=a.toLowerCase();return["ok","healthy","active","available"].includes(i)?"bg-emerald-50 text-emerald-700":["error","failed","unavailable"].includes(i)?"bg-rose-50 text-rose-700":"bg-amber-50 text-amber-700"}function $o(a){const i=a.toLowerCase();return["ok","healthy","active","available"].includes(i)?0:["unknown","pending"].includes(i)?1:2}function O0(a){return a.configured?"已配置":a.status==="installed"?"已安装":a.status==="manual"?"需要手动配置":a.detected?"已检测到":"未检测到"}function jN(a){return a==="create"?"创建":"更新"}function SN(){return s.jsxs("div",{className:"min-h-full",children:[s.jsxs("nav",{"aria-label":"Primary",className:"sticky top-0 z-10 flex h-12 items-center gap-2 border-b border-[var(--color-line-2)] bg-[var(--color-page)]/95 px-3 backdrop-blur sm:gap-5 sm:px-6",children:[s.jsxs(mf,{to:"/overview","aria-label":"TokenBuddy home",className:"group inline-flex shrink-0 items-center rounded-[var(--radius-md)] px-1 py-1.5 focus:outline-none focus:ring-2 focus:ring-[var(--color-primary)]",children:[s.jsx("span",{className:"font-mono text-[0.86rem] font-bold uppercase tracking-[0.14em] text-[var(--color-ink)]",children:"tokenbuddy"}),s.jsx("span",{className:"ml-1.5 inline-block size-1.5 rounded-full bg-[var(--color-primary)] shadow-[0_0_0_3px_rgba(124,61,240,0.18)]","aria-hidden":!0})]}),s.jsxs("div",{className:"ml-auto flex min-w-0 gap-0.5 sm:gap-1",children:[s.jsx(Od,{to:"/overview",children:"Overview"}),s.jsx(Od,{to:"/routing",children:"Routing"}),s.jsx(Od,{to:"/ledger",children:"Ledger"})]})]}),s.jsx("main",{className:"mx-auto max-w-[1180px] px-3 py-5 sm:px-6 sm:py-7",children:s.jsxs(e1,{children:[s.jsx(Ni,{path:"/",element:s.jsx(Xv,{})}),s.jsx(Ni,{path:"/overview",element:s.jsx(Xv,{})}),s.jsx(Ni,{path:"/init",element:s.jsx(qS,{})}),s.jsx(Ni,{path:"/routing",element:s.jsx($j,{})}),s.jsx(Ni,{path:"/ledger",element:s.jsx(xS,{})})]})})]})}function Od({to:a,children:i}){return s.jsx(mf,{to:a,className:({isActive:r})=>["rounded-[var(--radius-md)] px-2 py-1.5 text-[0.82rem] font-medium transition-colors sm:px-3.5 sm:text-[0.92rem]",r?"font-semibold text-[var(--color-ink)] underline decoration-[var(--color-primary)] decoration-2 underline-offset-[10px]":"text-[var(--color-muted)] hover:text-[var(--color-ink)]"].join(" "),children:i})}function NN(){!("serviceWorker"in navigator)||window.location.port==="5173"||window.addEventListener("load",()=>{navigator.serviceWorker.register("/sw.js").catch(()=>{})})}const MN=new n2({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1,retry:1}}});tg.createRoot(document.getElementById("root")).render(s.jsx(j.StrictMode,{children:s.jsx(i2,{client:MN,children:s.jsx(M1,{children:s.jsx(SN,{})})})}));NN();
236
+ //# sourceMappingURL=index-DEDEl8o2.js.map