function CH(e,t){for(var n=0;nr[a]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();var tp=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function ft(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $x={exports:{}},Hu={};var RC;function RH(){if(RC)return Hu;RC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,o){var l=null;if(o!==void 0&&(l=""+o),a.key!==void 0&&(l=""+a.key),"key"in a){o={};for(var u in a)u!=="key"&&(o[u]=a[u])}else o=a;return a=o.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:o}}return Hu.Fragment=t,Hu.jsx=n,Hu.jsxs=n,Hu}var PC;function PH(){return PC||(PC=1,$x.exports=RH()),$x.exports}var c=PH(),Ix={exports:{}},qe={};var kC;function kH(){if(kC)return qe;kC=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),g=Symbol.iterator;function y(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var j={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,w={};function A(I,B,Y){this.props=I,this.context=B,this.refs=w,this.updater=Y||j}A.prototype.isReactComponent={},A.prototype.setState=function(I,B){if(typeof I!="object"&&typeof I!="function"&&I!=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,I,B,"setState")},A.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function O(){}O.prototype=A.prototype;function N(I,B,Y){this.props=I,this.context=B,this.refs=w,this.updater=Y||j}var T=N.prototype=new O;T.constructor=N,b(T,A.prototype),T.isPureReactComponent=!0;var E=Array.isArray;function C(){}var R={H:null,A:null,T:null,S:null},k=Object.prototype.hasOwnProperty;function M(I,B,Y){var te=Y.ref;return{$$typeof:e,type:I,key:B,ref:te!==void 0?te:null,props:Y}}function U(I,B){return M(I.type,B,I.props)}function $(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function z(I){var B={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(Y){return B[Y]})}var V=/\/+/g;function F(I,B){return typeof I=="object"&&I!==null&&I.key!=null?z(""+I.key):B.toString(36)}function G(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(C,C):(I.status="pending",I.then(function(B){I.status==="pending"&&(I.status="fulfilled",I.value=B)},function(B){I.status==="pending"&&(I.status="rejected",I.reason=B)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function L(I,B,Y,te,le){var xe=typeof I;(xe==="undefined"||xe==="boolean")&&(I=null);var Q=!1;if(I===null)Q=!0;else switch(xe){case"bigint":case"string":case"number":Q=!0;break;case"object":switch(I.$$typeof){case e:case t:Q=!0;break;case p:return Q=I._init,L(Q(I._payload),B,Y,te,le)}}if(Q)return le=le(I),Q=te===""?"."+F(I,0):te,E(le)?(Y="",Q!=null&&(Y=Q.replace(V,"$&/")+"/"),L(le,B,Y,"",function(de){return de})):le!=null&&($(le)&&(le=U(le,Y+(le.key==null||I&&I.key===le.key?"":(""+le.key).replace(V,"$&/")+"/")+Q)),B.push(le)),1;Q=0;var ne=te===""?".":te+":";if(E(I))for(var X=0;X>>1,ve=L[ee];if(0>>1;eea(Y,H))tea(le,Y)?(L[ee]=le,L[te]=H,ee=te):(L[ee]=Y,L[B]=H,ee=B);else if(tea(le,H))L[ee]=le,L[te]=H,ee=te;else break e}}return q}function a(L,q){var H=L.sortIndex-q.sortIndex;return H!==0?H:L.id-q.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();e.unstable_now=function(){return l.now()-u}}var d=[],h=[],p=1,v=null,g=3,y=!1,j=!1,b=!1,w=!1,A=typeof setTimeout=="function"?setTimeout:null,O=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function T(L){for(var q=n(h);q!==null;){if(q.callback===null)r(h);else if(q.startTime<=L)r(h),q.sortIndex=q.expirationTime,t(d,q);else break;q=n(h)}}function E(L){if(b=!1,T(L),!j)if(n(d)!==null)j=!0,C||(C=!0,z());else{var q=n(h);q!==null&&G(E,q.startTime-L)}}var C=!1,R=-1,k=5,M=-1;function U(){return w?!0:!(e.unstable_now()-ML&&U());){var ee=v.callback;if(typeof ee=="function"){v.callback=null,g=v.priorityLevel;var ve=ee(v.expirationTime<=L);if(L=e.unstable_now(),typeof ve=="function"){v.callback=ve,T(L),q=!0;break t}v===n(d)&&r(d),T(L)}else r(d);v=n(d)}if(v!==null)q=!0;else{var I=n(h);I!==null&&G(E,I.startTime-L),q=!1}}break e}finally{v=null,g=H,y=!1}q=void 0}}finally{q?z():C=!1}}}var z;if(typeof N=="function")z=function(){N($)};else if(typeof MessageChannel<"u"){var V=new MessageChannel,F=V.port2;V.port1.onmessage=$,z=function(){F.postMessage(null)}}else z=function(){A($,0)};function G(L,q){R=A(function(){L(e.unstable_now())},q)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(L){L.callback=null},e.unstable_forceFrameRate=function(L){0>L||125ee?(L.sortIndex=H,t(h,L),n(d)===null&&L===n(h)&&(b?(O(R),R=-1):b=!0,G(E,H-ee))):(L.sortIndex=ve,t(d,L),j||y||(j=!0,C||(C=!0,z()))),L},e.unstable_shouldYield=U,e.unstable_wrapCallback=function(L){var q=g;return function(){var H=g;g=q;try{return L.apply(this,arguments)}finally{g=H}}}})(qx)),qx}var LC;function DH(){return LC||(LC=1,Bx.exports=MH()),Bx.exports}var Ux={exports:{}},kn={};var $C;function LH(){if($C)return kn;$C=1;var e=hd();function t(d){var h="https://react.dev/errors/"+d;if(1"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ux.exports=LH(),Ux.exports}var zC;function $H(){if(zC)return Vu;zC=1;var e=DH(),t=hd(),n=f$();function r(i){var s="https://react.dev/errors/"+i;if(1ve||(i.current=ee[ve],ee[ve]=null,ve--)}function Y(i,s){ve++,ee[ve]=i.current,i.current=s}var te=I(null),le=I(null),xe=I(null),Q=I(null);function ne(i,s){switch(Y(xe,s),Y(le,i),Y(te,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?eC(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=eC(s),i=tC(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}B(te),Y(te,i)}function X(){B(te),B(le),B(xe)}function de(i){i.memoizedState!==null&&Y(Q,i);var s=te.current,f=tC(s,i.type);s!==f&&(Y(le,i),Y(te,f))}function be(i){le.current===i&&(B(te),B(le)),Q.current===i&&(B(Q),Bu._currentValue=H)}var oe,Pe;function Se(i){if(oe===void 0)try{throw Error()}catch(f){var s=f.stack.trim().match(/\n( *(at )?)/);oe=s&&s[1]||"",Pe=-1)":-1x||W[m]!==ie[x]){var pe=` `+W[m].replace(" at new "," at ");return i.displayName&&pe.includes("")&&(pe=pe.replace("",i.displayName)),pe}while(1<=m&&0<=x);break}}}finally{fe=!1,Error.prepareStackTrace=f}return(f=i?i.displayName||i.name:"")?Se(f):""}function $e(i,s){switch(i.tag){case 26:case 27:case 5:return Se(i.type);case 16:return Se("Lazy");case 13:return i.child!==s&&s!==null?Se("Suspense Fallback"):Se("Suspense");case 19:return Se("SuspenseList");case 0:case 15:return he(i.type,!1);case 11:return he(i.type.render,!1);case 1:return he(i.type,!0);case 31:return Se("Activity");default:return""}}function Ot(i){try{var s="",f=null;do s+=$e(i,f),f=i,i=i.return;while(i);return s}catch(m){return` Error generating stack: `+m.message+` `+m.stack}}var _n=Object.prototype.hasOwnProperty,fr=e.unstable_scheduleCallback,Kn=e.unstable_cancelCallback,Dr=e.unstable_shouldYield,rt=e.unstable_requestPaint,nt=e.unstable_now,Pn=e.unstable_getCurrentPriorityLevel,Zc=e.unstable_ImmediatePriority,kO=e.unstable_UserBlockingPriority,Id=e.unstable_NormalPriority,fU=e.unstable_LowPriority,MO=e.unstable_IdlePriority,dU=e.log,hU=e.unstable_setDisableYieldValue,Qc=null,dr=null;function Mi(i){if(typeof dU=="function"&&hU(i),dr&&typeof dr.setStrictMode=="function")try{dr.setStrictMode(Qc,i)}catch{}}var hr=Math.clz32?Math.clz32:vU,pU=Math.log,mU=Math.LN2;function vU(i){return i>>>=0,i===0?32:31-(pU(i)/mU|0)|0}var zd=256,Bd=262144,qd=4194304;function To(i){var s=i&42;if(s!==0)return s;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Ud(i,s,f){var m=i.pendingLanes;if(m===0)return 0;var x=0,_=i.suspendedLanes,P=i.pingedLanes;i=i.warmLanes;var D=m&134217727;return D!==0?(m=D&~_,m!==0?x=To(m):(P&=D,P!==0?x=To(P):f||(f=D&~i,f!==0&&(x=To(f))))):(D=m&~_,D!==0?x=To(D):P!==0?x=To(P):f||(f=m&~i,f!==0&&(x=To(f)))),x===0?0:s!==0&&s!==x&&(s&_)===0&&(_=x&-x,f=s&-s,_>=f||_===32&&(f&4194048)!==0)?s:x}function Jc(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function gU(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 DO(){var i=qd;return qd<<=1,(qd&62914560)===0&&(qd=4194304),i}function Ag(i){for(var s=[],f=0;31>f;f++)s.push(i);return s}function eu(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function yU(i,s,f,m,x,_){var P=i.pendingLanes;i.pendingLanes=f,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=f,i.entangledLanes&=f,i.errorRecoveryDisabledLanes&=f,i.shellSuspendCounter=0;var D=i.entanglements,W=i.expirationTimes,ie=i.hiddenUpdates;for(f=P&~f;0"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var _U=/[\n"\\]/g;function $r(i){return i.replace(_U,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Rg(i,s,f,m,x,_,P,D){i.name="",P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"?i.type=P:i.removeAttribute("type"),s!=null?P==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+Lr(s)):i.value!==""+Lr(s)&&(i.value=""+Lr(s)):P!=="submit"&&P!=="reset"||i.removeAttribute("value"),s!=null?Pg(i,P,Lr(s)):f!=null?Pg(i,P,Lr(f)):m!=null&&i.removeAttribute("value"),x==null&&_!=null&&(i.defaultChecked=!!_),x!=null&&(i.checked=x&&typeof x!="function"&&typeof x!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?i.name=""+Lr(D):i.removeAttribute("name")}function WO(i,s,f,m,x,_,P,D){if(_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"&&(i.type=_),s!=null||f!=null){if(!(_!=="submit"&&_!=="reset"||s!=null)){Cg(i);return}f=f!=null?""+Lr(f):"",s=s!=null?""+Lr(s):f,D||s===i.value||(i.value=s),i.defaultValue=s}m=m??x,m=typeof m!="function"&&typeof m!="symbol"&&!!m,i.checked=D?i.checked:!!m,i.defaultChecked=!!m,P!=null&&typeof P!="function"&&typeof P!="symbol"&&typeof P!="boolean"&&(i.name=P),Cg(i)}function Pg(i,s,f){s==="number"&&Vd(i.ownerDocument)===i||i.defaultValue===""+f||(i.defaultValue=""+f)}function Us(i,s,f,m){if(i=i.options,s){s={};for(var x=0;x"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),$g=!1;if(Ya)try{var au={};Object.defineProperty(au,"passive",{get:function(){$g=!0}}),window.addEventListener("test",au,au),window.removeEventListener("test",au,au)}catch{$g=!1}var Li=null,Ig=null,Kd=null;function tN(){if(Kd)return Kd;var i,s=Ig,f=s.length,m,x="value"in Li?Li.value:Li.textContent,_=x.length;for(i=0;i=su),sN=" ",lN=!1;function cN(i,s){switch(i){case"keyup":return QU.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function uN(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Gs=!1;function eF(i,s){switch(i){case"compositionend":return uN(s);case"keypress":return s.which!==32?null:(lN=!0,sN);case"textInput":return i=s.data,i===sN&&lN?null:i;default:return null}}function tF(i,s){if(Gs)return i==="compositionend"||!Fg&&cN(i,s)?(i=tN(),Kd=Ig=Li=null,Gs=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1=s)return{node:f,offset:s-i};i=m}e:{for(;f;){if(f.nextSibling){f=f.nextSibling;break e}f=f.parentNode}f=void 0}f=yN(f)}}function bN(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?bN(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function wN(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=Vd(i.document);s instanceof i.HTMLIFrameElement;){try{var f=typeof s.contentWindow.location.href=="string"}catch{f=!1}if(f)i=s.contentWindow;else break;s=Vd(i.document)}return s}function Gg(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var cF=Ya&&"documentMode"in document&&11>=document.documentMode,Ks=null,Kg=null,fu=null,Wg=!1;function SN(i,s,f){var m=f.window===f?f.document:f.nodeType===9?f:f.ownerDocument;Wg||Ks==null||Ks!==Vd(m)||(m=Ks,"selectionStart"in m&&Gg(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),fu&&uu(fu,m)||(fu=m,m=Bh(Kg,"onSelect"),0>=P,x-=P,ja=1<<32-hr(s)+x|f<We?(Je=Re,Re=null):Je=Re.sibling;var it=se(J,Re,ae[We],ge);if(it===null){Re===null&&(Re=Je);break}i&&Re&&it.alternate===null&&s(J,Re),Z=_(it,Z,We),at===null?Me=it:at.sibling=it,at=it,Re=Je}if(We===ae.length)return f(J,Re),tt&&Za(J,We),Me;if(Re===null){for(;WeWe?(Je=Re,Re=null):Je=Re.sibling;var ao=se(J,Re,it.value,ge);if(ao===null){Re===null&&(Re=Je);break}i&&Re&&ao.alternate===null&&s(J,Re),Z=_(ao,Z,We),at===null?Me=ao:at.sibling=ao,at=ao,Re=Je}if(it.done)return f(J,Re),tt&&Za(J,We),Me;if(Re===null){for(;!it.done;We++,it=ae.next())it=ye(J,it.value,ge),it!==null&&(Z=_(it,Z,We),at===null?Me=it:at.sibling=it,at=it);return tt&&Za(J,We),Me}for(Re=m(Re);!it.done;We++,it=ae.next())it=ue(Re,J,We,it.value,ge),it!==null&&(i&&it.alternate!==null&&Re.delete(it.key===null?We:it.key),Z=_(it,Z,We),at===null?Me=it:at.sibling=it,at=it);return i&&Re.forEach(function(TH){return s(J,TH)}),tt&&Za(J,We),Me}function gt(J,Z,ae,ge){if(typeof ae=="object"&&ae!==null&&ae.type===b&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case y:e:{for(var Me=ae.key;Z!==null;){if(Z.key===Me){if(Me=ae.type,Me===b){if(Z.tag===7){f(J,Z.sibling),ge=x(Z,ae.props.children),ge.return=J,J=ge;break e}}else if(Z.elementType===Me||typeof Me=="object"&&Me!==null&&Me.$$typeof===k&&Bo(Me)===Z.type){f(J,Z.sibling),ge=x(Z,ae.props),gu(ge,ae),ge.return=J,J=ge;break e}f(J,Z);break}else s(J,Z);Z=Z.sibling}ae.type===b?(ge=Do(ae.props.children,J.mode,ge,ae.key),ge.return=J,J=ge):(ge=rh(ae.type,ae.key,ae.props,null,J.mode,ge),gu(ge,ae),ge.return=J,J=ge)}return P(J);case j:e:{for(Me=ae.key;Z!==null;){if(Z.key===Me)if(Z.tag===4&&Z.stateNode.containerInfo===ae.containerInfo&&Z.stateNode.implementation===ae.implementation){f(J,Z.sibling),ge=x(Z,ae.children||[]),ge.return=J,J=ge;break e}else{f(J,Z);break}else s(J,Z);Z=Z.sibling}ge=ty(ae,J.mode,ge),ge.return=J,J=ge}return P(J);case k:return ae=Bo(ae),gt(J,Z,ae,ge)}if(G(ae))return Ee(J,Z,ae,ge);if(z(ae)){if(Me=z(ae),typeof Me!="function")throw Error(r(150));return ae=Me.call(ae),Ie(J,Z,ae,ge)}if(typeof ae.then=="function")return gt(J,Z,uh(ae),ge);if(ae.$$typeof===N)return gt(J,Z,oh(J,ae),ge);fh(J,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,Z!==null&&Z.tag===6?(f(J,Z.sibling),ge=x(Z,ae),ge.return=J,J=ge):(f(J,Z),ge=ey(ae,J.mode,ge),ge.return=J,J=ge),P(J)):f(J,Z)}return function(J,Z,ae,ge){try{vu=0;var Me=gt(J,Z,ae,ge);return al=null,Me}catch(Re){if(Re===rl||Re===lh)throw Re;var at=mr(29,Re,null,J.mode);return at.lanes=ge,at.return=J,at}finally{}}}var Uo=VN(!0),GN=VN(!1),qi=!1;function hy(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function py(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function Ui(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Fi(i,s,f){var m=i.updateQueue;if(m===null)return null;if(m=m.shared,(lt&2)!==0){var x=m.pending;return x===null?s.next=s:(s.next=x.next,x.next=s),m.pending=s,s=nh(i),TN(i,null,f),s}return th(i,m,s,f),nh(i)}function yu(i,s,f){if(s=s.updateQueue,s!==null&&(s=s.shared,(f&4194048)!==0)){var m=s.lanes;m&=i.pendingLanes,f|=m,s.lanes=f,$O(i,f)}}function my(i,s){var f=i.updateQueue,m=i.alternate;if(m!==null&&(m=m.updateQueue,f===m)){var x=null,_=null;if(f=f.firstBaseUpdate,f!==null){do{var P={lane:f.lane,tag:f.tag,payload:f.payload,callback:null,next:null};_===null?x=_=P:_=_.next=P,f=f.next}while(f!==null);_===null?x=_=s:_=_.next=s}else x=_=s;f={baseState:m.baseState,firstBaseUpdate:x,lastBaseUpdate:_,shared:m.shared,callbacks:m.callbacks},i.updateQueue=f;return}i=f.lastBaseUpdate,i===null?f.firstBaseUpdate=s:i.next=s,f.lastBaseUpdate=s}var vy=!1;function xu(){if(vy){var i=nl;if(i!==null)throw i}}function bu(i,s,f,m){vy=!1;var x=i.updateQueue;qi=!1;var _=x.firstBaseUpdate,P=x.lastBaseUpdate,D=x.shared.pending;if(D!==null){x.shared.pending=null;var W=D,ie=W.next;W.next=null,P===null?_=ie:P.next=ie,P=W;var pe=i.alternate;pe!==null&&(pe=pe.updateQueue,D=pe.lastBaseUpdate,D!==P&&(D===null?pe.firstBaseUpdate=ie:D.next=ie,pe.lastBaseUpdate=W))}if(_!==null){var ye=x.baseState;P=0,pe=ie=W=null,D=_;do{var se=D.lane&-536870913,ue=se!==D.lane;if(ue?(Qe&se)===se:(m&se)===se){se!==0&&se===tl&&(vy=!0),pe!==null&&(pe=pe.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var Ee=i,Ie=D;se=s;var gt=f;switch(Ie.tag){case 1:if(Ee=Ie.payload,typeof Ee=="function"){ye=Ee.call(gt,ye,se);break e}ye=Ee;break e;case 3:Ee.flags=Ee.flags&-65537|128;case 0:if(Ee=Ie.payload,se=typeof Ee=="function"?Ee.call(gt,ye,se):Ee,se==null)break e;ye=v({},ye,se);break e;case 2:qi=!0}}se=D.callback,se!==null&&(i.flags|=64,ue&&(i.flags|=8192),ue=x.callbacks,ue===null?x.callbacks=[se]:ue.push(se))}else ue={lane:se,tag:D.tag,payload:D.payload,callback:D.callback,next:null},pe===null?(ie=pe=ue,W=ye):pe=pe.next=ue,P|=se;if(D=D.next,D===null){if(D=x.shared.pending,D===null)break;ue=D,D=ue.next,ue.next=null,x.lastBaseUpdate=ue,x.shared.pending=null}}while(!0);pe===null&&(W=ye),x.baseState=W,x.firstBaseUpdate=ie,x.lastBaseUpdate=pe,_===null&&(x.shared.lanes=0),Wi|=P,i.lanes=P,i.memoizedState=ye}}function KN(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function WN(i,s){var f=i.callbacks;if(f!==null)for(i.callbacks=null,i=0;i_?_:8;var P=L.T,D={};L.T=D,Dy(i,!1,s,f);try{var W=x(),ie=L.S;if(ie!==null&&ie(D,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var pe=yF(W,m);ju(i,s,pe,br(i))}else ju(i,s,m,br(i))}catch(ye){ju(i,s,{then:function(){},status:"rejected",reason:ye},br())}finally{q.p=_,P!==null&&D.types!==null&&(P.types=D.types),L.T=P}}function _F(){}function ky(i,s,f,m){if(i.tag!==5)throw Error(r(476));var x=OE(i).queue;AE(i,x,s,H,f===null?_F:function(){return NE(i),f(m)})}function OE(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:H,baseState:H,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ti,lastRenderedState:H},next:null};var f={};return s.next={memoizedState:f,baseState:f,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ti,lastRenderedState:f},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function NE(i){var s=OE(i);s.next===null&&(s=i.alternate.memoizedState),ju(i,s.next.queue,{},br())}function My(){return Nn(Bu)}function EE(){return qt().memoizedState}function TE(){return qt().memoizedState}function AF(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var f=br();i=Ui(f);var m=Fi(s,i,f);m!==null&&(er(m,s,f),yu(m,s,f)),s={cache:cy()},i.payload=s;return}s=s.return}}function OF(i,s,f){var m=br();f={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},wh(i)?RE(s,f):(f=Qg(i,s,f,m),f!==null&&(er(f,i,m),PE(f,s,m)))}function CE(i,s,f){var m=br();ju(i,s,f,m)}function ju(i,s,f,m){var x={lane:m,revertLane:0,gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null};if(wh(i))RE(s,x);else{var _=i.alternate;if(i.lanes===0&&(_===null||_.lanes===0)&&(_=s.lastRenderedReducer,_!==null))try{var P=s.lastRenderedState,D=_(P,f);if(x.hasEagerState=!0,x.eagerState=D,pr(D,P))return th(i,s,x,0),bt===null&&eh(),!1}catch{}finally{}if(f=Qg(i,s,x,m),f!==null)return er(f,i,m),PE(f,s,m),!0}return!1}function Dy(i,s,f,m){if(m={lane:2,revertLane:hx(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},wh(i)){if(s)throw Error(r(479))}else s=Qg(i,f,m,2),s!==null&&er(s,i,2)}function wh(i){var s=i.alternate;return i===Ge||s!==null&&s===Ge}function RE(i,s){ol=ph=!0;var f=i.pending;f===null?s.next=s:(s.next=f.next,f.next=s),i.pending=s}function PE(i,s,f){if((f&4194048)!==0){var m=s.lanes;m&=i.pendingLanes,f|=m,s.lanes=f,$O(i,f)}}var _u={readContext:Nn,use:gh,useCallback:kt,useContext:kt,useEffect:kt,useImperativeHandle:kt,useLayoutEffect:kt,useInsertionEffect:kt,useMemo:kt,useReducer:kt,useRef:kt,useState:kt,useDebugValue:kt,useDeferredValue:kt,useTransition:kt,useSyncExternalStore:kt,useId:kt,useHostTransitionStatus:kt,useFormState:kt,useActionState:kt,useOptimistic:kt,useMemoCache:kt,useCacheRefresh:kt};_u.useEffectEvent=kt;var kE={readContext:Nn,use:gh,useCallback:function(i,s){return zn().memoizedState=[i,s===void 0?null:s],i},useContext:Nn,useEffect:vE,useImperativeHandle:function(i,s,f){f=f!=null?f.concat([i]):null,xh(4194308,4,bE.bind(null,s,i),f)},useLayoutEffect:function(i,s){return xh(4194308,4,i,s)},useInsertionEffect:function(i,s){xh(4,2,i,s)},useMemo:function(i,s){var f=zn();s=s===void 0?null:s;var m=i();if(Fo){Mi(!0);try{i()}finally{Mi(!1)}}return f.memoizedState=[m,s],m},useReducer:function(i,s,f){var m=zn();if(f!==void 0){var x=f(s);if(Fo){Mi(!0);try{f(s)}finally{Mi(!1)}}}else x=s;return m.memoizedState=m.baseState=x,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:x},m.queue=i,i=i.dispatch=OF.bind(null,Ge,i),[m.memoizedState,i]},useRef:function(i){var s=zn();return i={current:i},s.memoizedState=i},useState:function(i){i=Ey(i);var s=i.queue,f=CE.bind(null,Ge,s);return s.dispatch=f,[i.memoizedState,f]},useDebugValue:Ry,useDeferredValue:function(i,s){var f=zn();return Py(f,i,s)},useTransition:function(){var i=Ey(!1);return i=AE.bind(null,Ge,i.queue,!0,!1),zn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,f){var m=Ge,x=zn();if(tt){if(f===void 0)throw Error(r(407));f=f()}else{if(f=s(),bt===null)throw Error(r(349));(Qe&127)!==0||eE(m,s,f)}x.memoizedState=f;var _={value:f,getSnapshot:s};return x.queue=_,vE(nE.bind(null,m,_,i),[i]),m.flags|=2048,ll(9,{destroy:void 0},tE.bind(null,m,_,f,s),null),f},useId:function(){var i=zn(),s=bt.identifierPrefix;if(tt){var f=_a,m=ja;f=(m&~(1<<32-hr(m)-1)).toString(32)+f,s="_"+s+"R_"+f,f=mh++,0<\/script>",_=_.removeChild(_.firstChild);break;case"select":_=typeof m.is=="string"?P.createElement("select",{is:m.is}):P.createElement("select"),m.multiple?_.multiple=!0:m.size&&(_.size=m.size);break;default:_=typeof m.is=="string"?P.createElement(x,{is:m.is}):P.createElement(x)}}_[An]=s,_[Wn]=m;e:for(P=s.child;P!==null;){if(P.tag===5||P.tag===6)_.appendChild(P.stateNode);else if(P.tag!==4&&P.tag!==27&&P.child!==null){P.child.return=P,P=P.child;continue}if(P===s)break e;for(;P.sibling===null;){if(P.return===null||P.return===s)break e;P=P.return}P.sibling.return=P.return,P=P.sibling}s.stateNode=_;e:switch(Tn(_,x,m),x){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&ri(s)}}return Et(s),Yy(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,f),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==m&&ri(s);else{if(typeof m!="string"&&s.stateNode===null)throw Error(r(166));if(i=xe.current,Js(s)){if(i=s.stateNode,f=s.memoizedProps,m=null,x=On,x!==null)switch(x.tag){case 27:case 5:m=x.memoizedProps}i[An]=s,i=!!(i.nodeValue===f||m!==null&&m.suppressHydrationWarning===!0||QT(i.nodeValue,f)),i||zi(s,!0)}else i=qh(i).createTextNode(m),i[An]=s,s.stateNode=i}return Et(s),null;case 31:if(f=s.memoizedState,i===null||i.memoizedState!==null){if(m=Js(s),f!==null){if(i===null){if(!m)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[An]=s}else Lo(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Et(s),i=!1}else f=iy(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=f),i=!0;if(!i)return s.flags&256?(gr(s),s):(gr(s),null);if((s.flags&128)!==0)throw Error(r(558))}return Et(s),null;case 13:if(m=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(x=Js(s),m!==null&&m.dehydrated!==null){if(i===null){if(!x)throw Error(r(318));if(x=s.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));x[An]=s}else Lo(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Et(s),x=!1}else x=iy(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=x),x=!0;if(!x)return s.flags&256?(gr(s),s):(gr(s),null)}return gr(s),(s.flags&128)!==0?(s.lanes=f,s):(f=m!==null,i=i!==null&&i.memoizedState!==null,f&&(m=s.child,x=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(x=m.alternate.memoizedState.cachePool.pool),_=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(_=m.memoizedState.cachePool.pool),_!==x&&(m.flags|=2048)),f!==i&&f&&(s.child.flags|=8192),Oh(s,s.updateQueue),Et(s),null);case 4:return X(),i===null&&gx(s.stateNode.containerInfo),Et(s),null;case 10:return Ja(s.type),Et(s),null;case 19:if(B(Bt),m=s.memoizedState,m===null)return Et(s),null;if(x=(s.flags&128)!==0,_=m.rendering,_===null)if(x)Ou(m,!1);else{if(Mt!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(_=hh(i),_!==null){for(s.flags|=128,Ou(m,!1),i=_.updateQueue,s.updateQueue=i,Oh(s,i),s.subtreeFlags=0,i=f,f=s.child;f!==null;)CN(f,i),f=f.sibling;return Y(Bt,Bt.current&1|2),tt&&Za(s,m.treeForkCount),s.child}i=i.sibling}m.tail!==null&&nt()>Rh&&(s.flags|=128,x=!0,Ou(m,!1),s.lanes=4194304)}else{if(!x)if(i=hh(_),i!==null){if(s.flags|=128,x=!0,i=i.updateQueue,s.updateQueue=i,Oh(s,i),Ou(m,!0),m.tail===null&&m.tailMode==="hidden"&&!_.alternate&&!tt)return Et(s),null}else 2*nt()-m.renderingStartTime>Rh&&f!==536870912&&(s.flags|=128,x=!0,Ou(m,!1),s.lanes=4194304);m.isBackwards?(_.sibling=s.child,s.child=_):(i=m.last,i!==null?i.sibling=_:s.child=_,m.last=_)}return m.tail!==null?(i=m.tail,m.rendering=i,m.tail=i.sibling,m.renderingStartTime=nt(),i.sibling=null,f=Bt.current,Y(Bt,x?f&1|2:f&1),tt&&Za(s,m.treeForkCount),i):(Et(s),null);case 22:case 23:return gr(s),yy(),m=s.memoizedState!==null,i!==null?i.memoizedState!==null!==m&&(s.flags|=8192):m&&(s.flags|=8192),m?(f&536870912)!==0&&(s.flags&128)===0&&(Et(s),s.subtreeFlags&6&&(s.flags|=8192)):Et(s),f=s.updateQueue,f!==null&&Oh(s,f.retryQueue),f=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),m=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(m=s.memoizedState.cachePool.pool),m!==f&&(s.flags|=2048),i!==null&&B(zo),null;case 24:return f=null,i!==null&&(f=i.memoizedState.cache),s.memoizedState.cache!==f&&(s.flags|=2048),Ja(Ft),Et(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function RF(i,s){switch(ry(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Ja(Ft),X(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return be(s),null;case 31:if(s.memoizedState!==null){if(gr(s),s.alternate===null)throw Error(r(340));Lo()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(gr(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Lo()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return B(Bt),null;case 4:return X(),null;case 10:return Ja(s.type),null;case 22:case 23:return gr(s),yy(),i!==null&&B(zo),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return Ja(Ft),null;case 25:return null;default:return null}}function rT(i,s){switch(ry(s),s.tag){case 3:Ja(Ft),X();break;case 26:case 27:case 5:be(s);break;case 4:X();break;case 31:s.memoizedState!==null&&gr(s);break;case 13:gr(s);break;case 19:B(Bt);break;case 10:Ja(s.type);break;case 22:case 23:gr(s),yy(),i!==null&&B(zo);break;case 24:Ja(Ft)}}function Nu(i,s){try{var f=s.updateQueue,m=f!==null?f.lastEffect:null;if(m!==null){var x=m.next;f=x;do{if((f.tag&i)===i){m=void 0;var _=f.create,P=f.inst;m=_(),P.destroy=m}f=f.next}while(f!==x)}}catch(D){ht(s,s.return,D)}}function Gi(i,s,f){try{var m=s.updateQueue,x=m!==null?m.lastEffect:null;if(x!==null){var _=x.next;m=_;do{if((m.tag&i)===i){var P=m.inst,D=P.destroy;if(D!==void 0){P.destroy=void 0,x=s;var W=f,ie=D;try{ie()}catch(pe){ht(x,W,pe)}}}m=m.next}while(m!==_)}}catch(pe){ht(s,s.return,pe)}}function aT(i){var s=i.updateQueue;if(s!==null){var f=i.stateNode;try{WN(s,f)}catch(m){ht(i,i.return,m)}}}function iT(i,s,f){f.props=Ho(i.type,i.memoizedProps),f.state=i.memoizedState;try{f.componentWillUnmount()}catch(m){ht(i,s,m)}}function Eu(i,s){try{var f=i.ref;if(f!==null){switch(i.tag){case 26:case 27:case 5:var m=i.stateNode;break;case 30:m=i.stateNode;break;default:m=i.stateNode}typeof f=="function"?i.refCleanup=f(m):f.current=m}}catch(x){ht(i,s,x)}}function Aa(i,s){var f=i.ref,m=i.refCleanup;if(f!==null)if(typeof m=="function")try{m()}catch(x){ht(i,s,x)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof f=="function")try{f(null)}catch(x){ht(i,s,x)}else f.current=null}function oT(i){var s=i.type,f=i.memoizedProps,m=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":f.autoFocus&&m.focus();break e;case"img":f.src?m.src=f.src:f.srcSet&&(m.srcset=f.srcSet)}}catch(x){ht(i,i.return,x)}}function Xy(i,s,f){try{var m=i.stateNode;JF(m,i.type,f,s),m[Wn]=s}catch(x){ht(i,i.return,x)}}function sT(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Ji(i.type)||i.tag===4}function Zy(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||sT(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Ji(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function Qy(i,s,f){var m=i.tag;if(m===5||m===6)i=i.stateNode,s?(f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f).insertBefore(i,s):(s=f.nodeType===9?f.body:f.nodeName==="HTML"?f.ownerDocument.body:f,s.appendChild(i),f=f._reactRootContainer,f!=null||s.onclick!==null||(s.onclick=Wa));else if(m!==4&&(m===27&&Ji(i.type)&&(f=i.stateNode,s=null),i=i.child,i!==null))for(Qy(i,s,f),i=i.sibling;i!==null;)Qy(i,s,f),i=i.sibling}function Nh(i,s,f){var m=i.tag;if(m===5||m===6)i=i.stateNode,s?f.insertBefore(i,s):f.appendChild(i);else if(m!==4&&(m===27&&Ji(i.type)&&(f=i.stateNode),i=i.child,i!==null))for(Nh(i,s,f),i=i.sibling;i!==null;)Nh(i,s,f),i=i.sibling}function lT(i){var s=i.stateNode,f=i.memoizedProps;try{for(var m=i.type,x=s.attributes;x.length;)s.removeAttributeNode(x[0]);Tn(s,m,f),s[An]=i,s[Wn]=f}catch(_){ht(i,i.return,_)}}var ai=!1,Gt=!1,Jy=!1,cT=typeof WeakSet=="function"?WeakSet:Set,ln=null;function PF(i,s){if(i=i.containerInfo,bx=Wh,i=wN(i),Gg(i)){if("selectionStart"in i)var f={start:i.selectionStart,end:i.selectionEnd};else e:{f=(f=i.ownerDocument)&&f.defaultView||window;var m=f.getSelection&&f.getSelection();if(m&&m.rangeCount!==0){f=m.anchorNode;var x=m.anchorOffset,_=m.focusNode;m=m.focusOffset;try{f.nodeType,_.nodeType}catch{f=null;break e}var P=0,D=-1,W=-1,ie=0,pe=0,ye=i,se=null;t:for(;;){for(var ue;ye!==f||x!==0&&ye.nodeType!==3||(D=P+x),ye!==_||m!==0&&ye.nodeType!==3||(W=P+m),ye.nodeType===3&&(P+=ye.nodeValue.length),(ue=ye.firstChild)!==null;)se=ye,ye=ue;for(;;){if(ye===i)break t;if(se===f&&++ie===x&&(D=P),se===_&&++pe===m&&(W=P),(ue=ye.nextSibling)!==null)break;ye=se,se=ye.parentNode}ye=ue}f=D===-1||W===-1?null:{start:D,end:W}}else f=null}f=f||{start:0,end:0}}else f=null;for(wx={focusedElem:i,selectionRange:f},Wh=!1,ln=s;ln!==null;)if(s=ln,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,ln=i;else for(;ln!==null;){switch(s=ln,_=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(f=0;f title"))),Tn(_,m,f),_[An]=i,sn(_),m=_;break e;case"link":var P=mC("link","href",x).get(m+(f.href||""));if(P){for(var D=0;Dgt&&(P=gt,gt=Ie,Ie=P);var J=xN(D,Ie),Z=xN(D,gt);if(J&&Z&&(ue.rangeCount!==1||ue.anchorNode!==J.node||ue.anchorOffset!==J.offset||ue.focusNode!==Z.node||ue.focusOffset!==Z.offset)){var ae=ye.createRange();ae.setStart(J.node,J.offset),ue.removeAllRanges(),Ie>gt?(ue.addRange(ae),ue.extend(Z.node,Z.offset)):(ae.setEnd(Z.node,Z.offset),ue.addRange(ae))}}}}for(ye=[],ue=D;ue=ue.parentNode;)ue.nodeType===1&&ye.push({element:ue,left:ue.scrollLeft,top:ue.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;Df?32:f,L.T=null,f=ox,ox=null;var _=Xi,P=ci;if(Xt=0,hl=Xi=null,ci=0,(lt&6)!==0)throw Error(r(331));var D=lt;if(lt|=4,bT(_.current),gT(_,_.current,P,f),lt=D,Mu(0,!1),dr&&typeof dr.onPostCommitFiberRoot=="function")try{dr.onPostCommitFiberRoot(Qc,_)}catch{}return!0}finally{q.p=x,L.T=m,IT(i,s)}}function BT(i,s,f){s=zr(f,s),s=zy(i.stateNode,s,2),i=Fi(i,s,2),i!==null&&(eu(i,2),Oa(i))}function ht(i,s,f){if(i.tag===3)BT(i,i,f);else for(;s!==null;){if(s.tag===3){BT(s,i,f);break}else if(s.tag===1){var m=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Yi===null||!Yi.has(m))){i=zr(f,i),f=qE(2),m=Fi(s,f,2),m!==null&&(UE(f,m,s,i),eu(m,2),Oa(m));break}}s=s.return}}function ux(i,s,f){var m=i.pingCache;if(m===null){m=i.pingCache=new DF;var x=new Set;m.set(s,x)}else x=m.get(s),x===void 0&&(x=new Set,m.set(s,x));x.has(f)||(nx=!0,x.add(f),i=BF.bind(null,i,s,f),s.then(i,i))}function BF(i,s,f){var m=i.pingCache;m!==null&&m.delete(s),i.pingedLanes|=i.suspendedLanes&f,i.warmLanes&=~f,bt===i&&(Qe&f)===f&&(Mt===4||Mt===3&&(Qe&62914560)===Qe&&300>nt()-Ch?(lt&2)===0&&pl(i,0):rx|=f,dl===Qe&&(dl=0)),Oa(i)}function qT(i,s){s===0&&(s=DO()),i=Mo(i,s),i!==null&&(eu(i,s),Oa(i))}function qF(i){var s=i.memoizedState,f=0;s!==null&&(f=s.retryLane),qT(i,f)}function UF(i,s){var f=0;switch(i.tag){case 31:case 13:var m=i.stateNode,x=i.memoizedState;x!==null&&(f=x.retryLane);break;case 19:m=i.stateNode;break;case 22:m=i.stateNode._retryCache;break;default:throw Error(r(314))}m!==null&&m.delete(s),qT(i,f)}function FF(i,s){return fr(i,s)}var $h=null,vl=null,fx=!1,Ih=!1,dx=!1,Qi=0;function Oa(i){i!==vl&&i.next===null&&(vl===null?$h=vl=i:vl=vl.next=i),Ih=!0,fx||(fx=!0,VF())}function Mu(i,s){if(!dx&&Ih){dx=!0;do for(var f=!1,m=$h;m!==null;){if(i!==0){var x=m.pendingLanes;if(x===0)var _=0;else{var P=m.suspendedLanes,D=m.pingedLanes;_=(1<<31-hr(42|i)+1)-1,_&=x&~(P&~D),_=_&201326741?_&201326741|1:_?_|2:0}_!==0&&(f=!0,VT(m,_))}else _=Qe,_=Ud(m,m===bt?_:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(_&3)===0||Jc(m,_)||(f=!0,VT(m,_));m=m.next}while(f);dx=!1}}function HF(){UT()}function UT(){Ih=fx=!1;var i=0;Qi!==0&&tH()&&(i=Qi);for(var s=nt(),f=null,m=$h;m!==null;){var x=m.next,_=FT(m,s);_===0?(m.next=null,f===null?$h=x:f.next=x,x===null&&(vl=f)):(f=m,(i!==0||(_&3)!==0)&&(Ih=!0)),m=x}Xt!==0&&Xt!==5||Mu(i),Qi!==0&&(Qi=0)}function FT(i,s){for(var f=i.suspendedLanes,m=i.pingedLanes,x=i.expirationTimes,_=i.pendingLanes&-62914561;0<_;){var P=31-hr(_),D=1<D)break;var pe=W.transferSize,ye=W.initiatorType;pe&&JT(ye)&&(W=W.responseEnd,P+=pe*(W"u"?null:document;function fC(i,s,f){var m=gl;if(m&&typeof s=="string"&&s){var x=$r(s);x='link[rel="'+i+'"][href="'+x+'"]',typeof f=="string"&&(x+='[crossorigin="'+f+'"]'),uC.has(x)||(uC.add(x),i={rel:i,crossOrigin:f,href:s},m.querySelector(x)===null&&(s=m.createElement("link"),Tn(s,"link",i),sn(s),m.head.appendChild(s)))}}function uH(i){ui.D(i),fC("dns-prefetch",i,null)}function fH(i,s){ui.C(i,s),fC("preconnect",i,s)}function dH(i,s,f){ui.L(i,s,f);var m=gl;if(m&&i&&s){var x='link[rel="preload"][as="'+$r(s)+'"]';s==="image"&&f&&f.imageSrcSet?(x+='[imagesrcset="'+$r(f.imageSrcSet)+'"]',typeof f.imageSizes=="string"&&(x+='[imagesizes="'+$r(f.imageSizes)+'"]')):x+='[href="'+$r(i)+'"]';var _=x;switch(s){case"style":_=yl(i);break;case"script":_=xl(i)}Vr.has(_)||(i=v({rel:"preload",href:s==="image"&&f&&f.imageSrcSet?void 0:i,as:s},f),Vr.set(_,i),m.querySelector(x)!==null||s==="style"&&m.querySelector(Iu(_))||s==="script"&&m.querySelector(zu(_))||(s=m.createElement("link"),Tn(s,"link",i),sn(s),m.head.appendChild(s)))}}function hH(i,s){ui.m(i,s);var f=gl;if(f&&i){var m=s&&typeof s.as=="string"?s.as:"script",x='link[rel="modulepreload"][as="'+$r(m)+'"][href="'+$r(i)+'"]',_=x;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":_=xl(i)}if(!Vr.has(_)&&(i=v({rel:"modulepreload",href:i},s),Vr.set(_,i),f.querySelector(x)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(f.querySelector(zu(_)))return}m=f.createElement("link"),Tn(m,"link",i),sn(m),f.head.appendChild(m)}}}function pH(i,s,f){ui.S(i,s,f);var m=gl;if(m&&i){var x=Bs(m).hoistableStyles,_=yl(i);s=s||"default";var P=x.get(_);if(!P){var D={loading:0,preload:null};if(P=m.querySelector(Iu(_)))D.loading=5;else{i=v({rel:"stylesheet",href:i,"data-precedence":s},f),(f=Vr.get(_))&&Ex(i,f);var W=P=m.createElement("link");sn(W),Tn(W,"link",i),W._p=new Promise(function(ie,pe){W.onload=ie,W.onerror=pe}),W.addEventListener("load",function(){D.loading|=1}),W.addEventListener("error",function(){D.loading|=2}),D.loading|=4,Fh(P,s,m)}P={type:"stylesheet",instance:P,count:1,state:D},x.set(_,P)}}}function mH(i,s){ui.X(i,s);var f=gl;if(f&&i){var m=Bs(f).hoistableScripts,x=xl(i),_=m.get(x);_||(_=f.querySelector(zu(x)),_||(i=v({src:i,async:!0},s),(s=Vr.get(x))&&Tx(i,s),_=f.createElement("script"),sn(_),Tn(_,"link",i),f.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},m.set(x,_))}}function vH(i,s){ui.M(i,s);var f=gl;if(f&&i){var m=Bs(f).hoistableScripts,x=xl(i),_=m.get(x);_||(_=f.querySelector(zu(x)),_||(i=v({src:i,async:!0,type:"module"},s),(s=Vr.get(x))&&Tx(i,s),_=f.createElement("script"),sn(_),Tn(_,"link",i),f.head.appendChild(_)),_={type:"script",instance:_,count:1,state:null},m.set(x,_))}}function dC(i,s,f,m){var x=(x=xe.current)?Uh(x):null;if(!x)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof f.precedence=="string"&&typeof f.href=="string"?(s=yl(f.href),f=Bs(x).hoistableStyles,m=f.get(s),m||(m={type:"style",instance:null,count:0,state:null},f.set(s,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(f.rel==="stylesheet"&&typeof f.href=="string"&&typeof f.precedence=="string"){i=yl(f.href);var _=Bs(x).hoistableStyles,P=_.get(i);if(P||(x=x.ownerDocument||x,P={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},_.set(i,P),(_=x.querySelector(Iu(i)))&&!_._p&&(P.instance=_,P.state.loading=5),Vr.has(i)||(f={rel:"preload",as:"style",href:f.href,crossOrigin:f.crossOrigin,integrity:f.integrity,media:f.media,hrefLang:f.hrefLang,referrerPolicy:f.referrerPolicy},Vr.set(i,f),_||gH(x,i,f,P.state))),s&&m===null)throw Error(r(528,""));return P}if(s&&m!==null)throw Error(r(529,""));return null;case"script":return s=f.async,f=f.src,typeof f=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=xl(f),f=Bs(x).hoistableScripts,m=f.get(s),m||(m={type:"script",instance:null,count:0,state:null},f.set(s,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function yl(i){return'href="'+$r(i)+'"'}function Iu(i){return'link[rel="stylesheet"]['+i+"]"}function hC(i){return v({},i,{"data-precedence":i.precedence,precedence:null})}function gH(i,s,f,m){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?m.loading=1:(s=i.createElement("link"),m.preload=s,s.addEventListener("load",function(){return m.loading|=1}),s.addEventListener("error",function(){return m.loading|=2}),Tn(s,"link",f),sn(s),i.head.appendChild(s))}function xl(i){return'[src="'+$r(i)+'"]'}function zu(i){return"script[async]"+i}function pC(i,s,f){if(s.count++,s.instance===null)switch(s.type){case"style":var m=i.querySelector('style[data-href~="'+$r(f.href)+'"]');if(m)return s.instance=m,sn(m),m;var x=v({},f,{"data-href":f.href,"data-precedence":f.precedence,href:null,precedence:null});return m=(i.ownerDocument||i).createElement("style"),sn(m),Tn(m,"style",x),Fh(m,f.precedence,i),s.instance=m;case"stylesheet":x=yl(f.href);var _=i.querySelector(Iu(x));if(_)return s.state.loading|=4,s.instance=_,sn(_),_;m=hC(f),(x=Vr.get(x))&&Ex(m,x),_=(i.ownerDocument||i).createElement("link"),sn(_);var P=_;return P._p=new Promise(function(D,W){P.onload=D,P.onerror=W}),Tn(_,"link",m),s.state.loading|=4,Fh(_,f.precedence,i),s.instance=_;case"script":return _=xl(f.src),(x=i.querySelector(zu(_)))?(s.instance=x,sn(x),x):(m=f,(x=Vr.get(_))&&(m=v({},f),Tx(m,x)),i=i.ownerDocument||i,x=i.createElement("script"),sn(x),Tn(x,"link",m),i.head.appendChild(x),s.instance=x);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(m=s.instance,s.state.loading|=4,Fh(m,f.precedence,i));return s.instance}function Fh(i,s,f){for(var m=f.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=m.length?m[m.length-1]:null,_=x,P=0;P title"):null)}function yH(i,s,f){if(f===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return i=s.disabled,typeof s.precedence=="string"&&i==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function gC(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function xH(i,s,f,m){if(f.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&(f.state.loading&4)===0){if(f.instance===null){var x=yl(m.href),_=s.querySelector(Iu(x));if(_){s=_._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=Vh.bind(i),s.then(i,i)),f.state.loading|=4,f.instance=_,sn(_);return}_=s.ownerDocument||s,m=hC(m),(x=Vr.get(x))&&Ex(m,x),_=_.createElement("link"),sn(_);var P=_;P._p=new Promise(function(D,W){P.onload=D,P.onerror=W}),Tn(_,"link",m),f.instance=_}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(f,s),(s=f.state.preload)&&(f.state.loading&3)===0&&(i.count++,f=Vh.bind(i),s.addEventListener("load",f),s.addEventListener("error",f))}}var Cx=0;function bH(i,s){return i.stylesheets&&i.count===0&&Kh(i,i.stylesheets),0Cx?50:800)+s);return i.unsuspend=f,function(){i.unsuspend=null,clearTimeout(m),clearTimeout(x)}}:null}function Vh(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Kh(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var Gh=null;function Kh(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,Gh=new Map,s.forEach(wH,i),Gh=null,Vh.call(i))}function wH(i,s){if(!(s.state.loading&4)){var f=Gh.get(i);if(f)var m=f.get(null);else{f=new Map,Gh.set(i,f);for(var x=i.querySelectorAll("link[data-precedence],style[data-precedence]"),_=0;_"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),zx.exports=$H(),zx.exports}var zH=IH();const j1=new WeakMap,BH=new WeakMap,Bp={current:[]};let Fx=!1,vf=0;const uf=new Set,np=new Map;function d$(e){for(const t of e){if(Bp.current.includes(t))continue;Bp.current.push(t),t.recompute();const n=BH.get(t);if(n)for(const r of n){const a=j1.get(r);a?.length&&d$(a)}}}function qH(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function UH(e){const t={prevVal:e.prevState,currentVal:e.state};for(const n of e.listeners)n(t)}function h$(e){if(vf>0&&!np.has(e)&&np.set(e,e.prevState),uf.add(e),!(vf>0)&&!Fx)try{for(Fx=!0;uf.size>0;){const t=Array.from(uf);uf.clear();for(const n of t){const r=np.get(n)??n.prevState;n.prevState=r,qH(n)}for(const n of t){const r=j1.get(n);r&&(Bp.current.push(n),d$(r))}for(const n of t){const r=j1.get(n);if(r)for(const a of r)UH(a)}}}finally{Fx=!1,Bp.current=[],np.clear()}}function gf(e){vf++;try{e()}finally{if(vf--,vf===0){const t=uf.values().next().value;t&&h$(t)}}}function FH(e){return typeof e=="function"}class HH{constructor(t,n){this.listeners=new Set,this.subscribe=r=>{var a,o;this.listeners.add(r);const l=(o=(a=this.options)==null?void 0:a.onSubscribe)==null?void 0:o.call(a,r,this);return()=>{this.listeners.delete(r),l?.()}},this.prevState=t,this.state=t,this.options=n}setState(t){var n,r,a;this.prevState=this.state,(n=this.options)!=null&&n.updateFn?this.state=this.options.updateFn(this.prevState)(t):FH(t)?this.state=t(this.prevState):this.state=t,(a=(r=this.options)==null?void 0:r.onUpdate)==null||a.call(r),h$(this)}}const ho="__TSR_index",qC="popstate",UC="beforeunload";function VH(e){let t=e.getLocation();const n=new Set,r=l=>{t=e.getLocation(),n.forEach(u=>u({location:t,action:l}))},a=l=>{e.notifyOnIndexChange??!0?r(l):t=e.getLocation()},o=async({task:l,navigateOpts:u,...d})=>{if(u?.ignoreBlocker??!1){l();return}const p=e.getBlockers?.()??[],v=d.type==="PUSH"||d.type==="REPLACE";if(typeof document<"u"&&p.length&&v)for(const g of p){const y=qp(d.path,d.state);if(await g.blockerFn({currentLocation:t,nextLocation:y,action:d.type})){e.onBlocked?.();return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,u,d)=>{const h=t.state[ho];u=FC(h+1,u),o({task:()=>{e.pushState(l,u),r({type:"PUSH"})},navigateOpts:d,type:"PUSH",path:l,state:u})},replace:(l,u,d)=>{const h=t.state[ho];u=FC(h,u),o({task:()=>{e.replaceState(l,u),r({type:"REPLACE"})},navigateOpts:d,type:"REPLACE",path:l,state:u})},go:(l,u)=>{o({task:()=>{e.go(l),a({type:"GO",index:l})},navigateOpts:u,type:"GO"})},back:l=>{o({task:()=>{e.back(l?.ignoreBlocker??!1),a({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{o({task:()=>{e.forward(l?.ignoreBlocker??!1),a({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[ho]!==0,createHref:l=>e.createHref(l),block:l=>{if(!e.setBlockers)return()=>{};const u=e.getBlockers?.()??[];return e.setBlockers([...u,l]),()=>{const d=e.getBlockers?.()??[];e.setBlockers?.(d.filter(h=>h!==l))}},flush:()=>e.flush?.(),destroy:()=>e.destroy?.(),notify:r}}function FC(e,t){t||(t={});const n=O_();return{...t,key:n,__TSR_key:n,[ho]:e}}function GH(e){const t=typeof document<"u"?window:void 0,n=t.history.pushState,r=t.history.replaceState;let a=[];const o=()=>a,l=k=>a=k,u=(k=>k),d=(()=>qp(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!t.history.state?.__TSR_key&&!t.history.state?.key){const k=O_();t.history.replaceState({[ho]:0,key:k,__TSR_key:k},"")}let h=d(),p,v=!1,g=!1,y=!1,j=!1;const b=()=>h;let w,A;const O=()=>{w&&(R._ignoreSubscribers=!0,(w.isPush?t.history.pushState:t.history.replaceState)(w.state,"",w.href),R._ignoreSubscribers=!1,w=void 0,A=void 0,p=void 0)},N=(k,M,U)=>{const $=u(M);A||(p=h),h=qp(M,U),w={href:$,state:U,isPush:w?.isPush||k==="push"},A||(A=Promise.resolve().then(()=>O()))},T=k=>{h=d(),R.notify({type:k})},E=async()=>{if(g){g=!1;return}const k=d(),M=k.state[ho]-h.state[ho],U=M===1,$=M===-1,z=!U&&!$||v;v=!1;const V=z?"GO":$?"BACK":"FORWARD",F=z?{type:"GO",index:M}:{type:$?"BACK":"FORWARD"};if(y)y=!1;else{const G=o();if(typeof document<"u"&&G.length){for(const L of G)if(await L.blockerFn({currentLocation:h,nextLocation:k,action:V})){g=!0,t.history.go(1),R.notify(F);return}}}h=d(),R.notify(F)},C=k=>{if(j){j=!1;return}let M=!1;const U=o();if(typeof document<"u"&&U.length)for(const $ of U){const z=$.enableBeforeUnload??!0;if(z===!0){M=!0;break}if(typeof z=="function"&&z()===!0){M=!0;break}}if(M)return k.preventDefault(),k.returnValue=""},R=VH({getLocation:b,getLength:()=>t.history.length,pushState:(k,M)=>N("push",k,M),replaceState:(k,M)=>N("replace",k,M),back:k=>(k&&(y=!0),j=!0,t.history.back()),forward:k=>{k&&(y=!0),j=!0,t.history.forward()},go:k=>{v=!0,t.history.go(k)},createHref:k=>u(k),flush:O,destroy:()=>{t.history.pushState=n,t.history.replaceState=r,t.removeEventListener(UC,C,{capture:!0}),t.removeEventListener(qC,E)},onBlocked:()=>{p&&h!==p&&(h=p)},getBlockers:o,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(UC,C,{capture:!0}),t.addEventListener(qC,E),t.history.pushState=function(...k){const M=n.apply(t.history,k);return R._ignoreSubscribers||T("PUSH"),M},t.history.replaceState=function(...k){const M=r.apply(t.history,k);return R._ignoreSubscribers||T("REPLACE"),M},R}function qp(e,t){const n=e.indexOf("#"),r=e.indexOf("?"),a=O_();return{href:e,pathname:e.substring(0,n>0?r>0?Math.min(n,r):n:r>0?r:e.length),hash:n>-1?e.substring(n):"",search:r>-1?e.slice(r,n===-1?void 0:n):"",state:t||{[ho]:0,key:a,__TSR_key:a}}}function O_(){return(Math.random()+1).toString(36).substring(7)}function _1(e){return e[e.length-1]}function KH(e){return typeof e=="function"}function is(e,t){return KH(e)?e(t):e}const WH=Object.prototype.hasOwnProperty;function Yr(e,t){if(e===t)return e;const n=t,r=GC(e)&&GC(n);if(!r&&!(Up(e)&&Up(n)))return n;const a=r?e:HC(e);if(!a)return n;const o=r?n:HC(n);if(!o)return n;const l=a.length,u=o.length,d=r?new Array(u):{};let h=0;for(let p=0;p"u")return!0;const n=t.prototype;return!(!VC(n)||!n.hasOwnProperty("isPrototypeOf"))}function VC(e){return Object.prototype.toString.call(e)==="[object Object]"}function GC(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function os(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let r=0,a=e.length;ra||!os(e[l],t[l],n)))return!1;return a===o}return!1}function Kl(e){let t,n;const r=new Promise((a,o)=>{t=a,n=o});return r.status="pending",r.resolve=a=>{r.status="resolved",r.value=a,t(a),e?.(a)},r.reject=a=>{r.status="rejected",n(a)},r}function po(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}const YH=Array.from(new Map([["%","%25"],["\\","%5C"]]).values());function KC(e,t=YH){function n(a,o,l=0){for(let u=l;u{try{return decodeURI(u)}catch{return u}})}}if(e===""||!/%[0-9A-Fa-f]{2}/g.test(e))return e;const r=e.replaceAll(/%[0-9a-f]{2}/g,a=>a.toUpperCase());return n(r,t)}var XH="Invariant failed";function In(e,t){if(!e)throw new Error(XH)}const Ma=0,hs=1,Wl=2,Yl=3;function xi(e){return N_(e.filter(t=>t!==void 0).join("/"))}function N_(e){return e.replace(/\/{2,}/g,"/")}function E_(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function mo(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function Tp(e){return mo(E_(e))}function Fp(e,t){return e?.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function ZH(e,t,n){return Fp(e,n)===Fp(t,n)}function QH(e){const{type:t,value:n}=e;if(t===Ma)return n;const{prefixSegment:r,suffixSegment:a}=e;if(t===hs){const o=n.substring(1);if(r&&a)return`${r}{$${o}}${a}`;if(r)return`${r}{$${o}}`;if(a)return`{$${o}}${a}`}if(t===Yl){const o=n.substring(1);return r&&a?`${r}{-$${o}}${a}`:r?`${r}{-$${o}}`:a?`{-$${o}}${a}`:`{-$${o}}`}if(t===Wl){if(r&&a)return`${r}{$}${a}`;if(r)return`${r}{$}`;if(a)return`{$}${a}`}return n}function JH({base:e,to:t,trailingSlash:n="never",parseCache:r}){let a=Xl(e,r).slice();const o=Xl(t,r);a.length>1&&_1(a)?.value==="/"&&a.pop();for(let d=0,h=o.length;d1&&(_1(a).value==="/"?n==="never"&&a.pop():n==="always"&&a.push({type:Ma,value:"/"}));const l=a.map(QH);return xi(l)}const Xl=(e,t)=>{if(!e)return[];const n=t?.get(e);if(n)return n;const r=i9(e);return t?.set(e,r),r},e9=/^\$.{1,}$/,t9=/^(.*?)\{(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,n9=/^(.*?)\{-(\$[a-zA-Z_$][a-zA-Z0-9_$]*)\}(.*)$/,r9=/^\$$/,a9=/^(.*?)\{\$\}(.*)$/;function i9(e){e=N_(e);const t=[];if(e.slice(0,1)==="/"&&(e=e.substring(1),t.push({type:Ma,value:"/"})),!e)return t;const n=e.split("/").filter(Boolean);return t.push(...n.map(r=>{const a=r.match(a9);if(a){const u=a[1],d=a[2];return{type:Wl,value:"$",prefixSegment:u||void 0,suffixSegment:d||void 0}}const o=r.match(n9);if(o){const u=o[1],d=o[2],h=o[3];return{type:Yl,value:d,prefixSegment:u||void 0,suffixSegment:h||void 0}}const l=r.match(t9);if(l){const u=l[1],d=l[2],h=l[3];return{type:hs,value:""+d,prefixSegment:u||void 0,suffixSegment:h||void 0}}if(e9.test(r)){const u=r.substring(1);return{type:hs,value:"$"+u,prefixSegment:void 0,suffixSegment:void 0}}return r9.test(r)?{type:Wl,value:"$",prefixSegment:void 0,suffixSegment:void 0}:{type:Ma,value:r}})),e.slice(-1)==="/"&&(e=e.substring(1),t.push({type:Ma,value:"/"})),t}function Hx({path:e,params:t,decodeCharMap:n,parseCache:r}){const a=Xl(e,r);function o(h){const p=t[h],v=typeof p=="string";return h==="*"||h==="_splat"?v?encodeURI(p):p:v?o9(p,n):p}let l=!1;const u={},d=xi(a.map(h=>{if(h.type===Ma)return h.value;if(h.type===Wl){u._splat=t._splat,u["*"]=t._splat;const p=h.prefixSegment||"",v=h.suffixSegment||"";if(!t._splat)return l=!0,p||v?`${p}${v}`:void 0;const g=o("_splat");return`${p}${g}${v}`}if(h.type===hs){const p=h.value.substring(1);!l&&!(p in t)&&(l=!0),u[p]=t[p];const v=h.prefixSegment||"",g=h.suffixSegment||"";return`${v}${o(p)??"undefined"}${g}`}if(h.type===Yl){const p=h.value.substring(1),v=h.prefixSegment||"",g=h.suffixSegment||"";return!(p in t)||t[p]==null?v||g?`${v}${g}`:void 0:(u[p]=t[p],`${v}${o(p)??""}${g}`)}return h.value}));return{usedParams:u,interpolatedPath:d,isMissingParams:l}}function o9(e,t){let n=encodeURIComponent(e);if(t)for(const[r,a]of t)n=n.replaceAll(r,a);return n}function A1(e,t,n){const r=s9(e,t,n);if(!(t.to&&!r))return r??{}}function s9(e,{to:t,fuzzy:n,caseSensitive:r},a){const o=t,l=Xl(e.startsWith("/")?e:`/${e}`,a),u=Xl(o.startsWith("/")?o:`/${o}`,a),d={};return l9(l,u,d,n,r)?d:void 0}function l9(e,t,n,r,a){let o=0,l=0;for(;ob.value)));v&&j.startsWith(v)&&(j=j.slice(v.length)),g&&j.endsWith(g)&&(j=j.slice(0,j.length-g.length)),p=j}else p=decodeURI(xi(h.map(v=>v.value)));return n["*"]=p,n._splat=p,!0}if(d.type===Ma){if(d.value==="/"&&!u?.value){l++;continue}if(u){if(a){if(d.value!==u.value)return!1}else if(d.value.toLowerCase()!==u.value.toLowerCase())return!1;o++,l++;continue}else return!1}if(d.type===hs){if(!u||u.value==="/")return!1;let h="",p=!1;if(d.prefixSegment||d.suffixSegment){const v=d.prefixSegment||"",g=d.suffixSegment||"",y=u.value;if(v&&!y.startsWith(v)||g&&!y.endsWith(g))return!1;let j=y;v&&j.startsWith(v)&&(j=j.slice(v.length)),g&&j.endsWith(g)&&(j=j.slice(0,j.length-g.length)),h=decodeURIComponent(j),p=!0}else h=decodeURIComponent(u.value),p=!0;p&&(n[d.value.substring(1)]=h,o++),l++;continue}if(d.type===Yl){if(!u){l++;continue}if(u.value==="/"){l++;continue}let h="",p=!1;if(d.prefixSegment||d.suffixSegment){const v=d.prefixSegment||"",g=d.suffixSegment||"",y=u.value;if((!v||y.startsWith(v))&&(!g||y.endsWith(g))){let j=y;v&&j.startsWith(v)&&(j=j.slice(v.length)),g&&j.endsWith(g)&&(j=j.slice(0,j.length-g.length)),h=decodeURIComponent(j),p=!0}}else{let v=!0;for(let g=l+1;g=t.length)return n["**"]=xi(e.slice(o).map(h=>h.value)),!!r&&t[t.length-1]?.value!=="/";if(l=e.length){for(let h=l;h{if(r.isRoot||!r.path)return;const o=E_(r.fullPath);let l=Xl(o),u=0;for(;l.length>u+1&&l[u]?.value==="/";)u++;u>0&&(l=l.slice(u));let d=0,h=!1;const p=l.map((v,g)=>{if(v.value==="/")return c9;if(v.type===Ma)return u9;let y;v.type===hs?y=f9:v.type===Yl?(y=d9,d++):y=h9;for(let j=g+1;j{const o=Math.min(r.scores.length,a.scores.length);for(let l=0;la.parsed[l].value?1:-1;return r.index-a.index}).map((r,a)=>(r.child.rank=a,r.child))}function x9({routeTree:e,initRoute:t}){const n={},r={},a=l=>{l.forEach((u,d)=>{t?.(u,d);const h=n[u.id];if(In(!h,`Duplicate routes found with id: ${String(u.id)}`),n[u.id]=u,!u.isRoot&&u.path){const v=mo(u.fullPath);(!r[v]||u.fullPath.endsWith("/"))&&(r[v]=u)}const p=u.children;p?.length&&a(p)})};a([e]);const o=y9(Object.values(n));return{routesById:n,routesByPath:r,flatRoutes:o}}function va(e){return!!e?.isNotFound}function b9(){try{if(typeof window<"u"&&typeof window.sessionStorage=="object")return window.sessionStorage}catch{}}const Hp="tsr-scroll-restoration-v1_3",w9=(e,t)=>{let n;return(...r)=>{n||(n=setTimeout(()=>{e(...r),n=null},t))}};function S9(){const e=b9();if(!e)return null;const t=e.getItem(Hp);let n=t?JSON.parse(t):{};return{state:n,set:r=>(n=is(r,n)||n,e.setItem(Hp,JSON.stringify(n)))}}const rp=S9(),O1=e=>e.state.__TSR_key||e.href;function j9(e){const t=[];let n;for(;n=e.parentNode;)t.push(`${e.tagName}:nth-child(${Array.prototype.indexOf.call(n.children,e)+1})`),e=n;return`${t.reverse().join(" > ")}`.toLowerCase()}let Vp=!1;function p$({storageKey:e,key:t,behavior:n,shouldScrollRestoration:r,scrollToTopSelectors:a,location:o}){let l;try{l=JSON.parse(sessionStorage.getItem(e)||"{}")}catch(h){console.error(h);return}const u=t||window.history.state?.__TSR_key,d=l[u];Vp=!0;e:{if(r&&d&&Object.keys(d).length>0){for(const v in d){const g=d[v];if(v==="window")window.scrollTo({top:g.scrollY,left:g.scrollX,behavior:n});else if(v){const y=document.querySelector(v);y&&(y.scrollLeft=g.scrollX,y.scrollTop=g.scrollY)}}break e}const h=(o??window.location).hash.split("#",2)[1];if(h){const v=window.history.state?.__hashScrollIntoViewOptions??!0;if(v){const g=document.getElementById(h);g&&g.scrollIntoView(v)}break e}const p={top:0,left:0,behavior:n};if(window.scrollTo(p),a)for(const v of a){if(v==="window")continue;const g=typeof v=="function"?v():document.querySelector(v);g&&g.scrollTo(p)}}Vp=!1}function _9(e,t){if(!rp&&!e.isServer||((e.options.scrollRestoration??!1)&&(e.isScrollRestoring=!0),e.isServer||e.isScrollRestorationSetup||!rp))return;e.isScrollRestorationSetup=!0,Vp=!1;const r=e.options.getScrollRestorationKey||O1;window.history.scrollRestoration="manual";const a=o=>{if(Vp||!e.isScrollRestoring)return;let l="";if(o.target===document||o.target===window)l="window";else{const d=o.target.getAttribute("data-scroll-restoration-id");d?l=`[data-scroll-restoration-id="${d}"]`:l=j9(o.target)}const u=r(e.state.location);rp.set(d=>{const h=d[u]||={},p=h[l]||={};if(l==="window")p.scrollX=window.scrollX||0,p.scrollY=window.scrollY||0;else if(l){const v=document.querySelector(l);v&&(p.scrollX=v.scrollLeft||0,p.scrollY=v.scrollTop||0)}return d})};typeof document<"u"&&document.addEventListener("scroll",w9(a,100),!0),e.subscribe("onRendered",o=>{const l=r(o.toLocation);if(!e.resetNextScroll){e.resetNextScroll=!0;return}typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation})||(p$({storageKey:Hp,key:l,behavior:e.options.scrollRestorationBehavior,shouldScrollRestoration:e.isScrollRestoring,scrollToTopSelectors:e.options.scrollToTopSelectors,location:e.history.location}),e.isScrollRestoring&&rp.set(u=>(u[l]||={},u)))})}function A9(e){if(typeof document<"u"&&document.querySelector){const t=e.state.location.state.__hashScrollIntoViewOptions??!0;if(t&&e.state.location.hash!==""){const n=document.getElementById(e.state.location.hash);n&&n.scrollIntoView(t)}}}function O9(e,t=String){const n=new URLSearchParams;for(const r in e){const a=e[r];a!==void 0&&n.set(r,t(a))}return n.toString()}function Vx(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function N9(e){const t=new URLSearchParams(e),n={};for(const[r,a]of t.entries()){const o=n[r];o==null?n[r]=Vx(a):Array.isArray(o)?o.push(Vx(a)):n[r]=[o,Vx(a)]}return n}const E9=C9(JSON.parse),T9=R9(JSON.stringify,JSON.parse);function C9(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=N9(t);for(const r in n){const a=n[r];if(typeof a=="string")try{n[r]=e(a)}catch{}}return n}}function R9(e,t){const n=typeof t=="function";function r(a){if(typeof a=="object"&&a!==null)try{return e(a)}catch{}else if(n&&typeof a=="string")try{return t(a),e(a)}catch{}return a}return a=>{const o=O9(a,r);return o?`?${o}`:""}}const _r="__root__";function m$(e){if(e.statusCode=e.statusCode||e.code||307,!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function Ca(e){return e instanceof Response&&!!e.options}function P9(e){const t=new Map;let n,r;const a=o=>{o.next&&(o.prev?(o.prev.next=o.next,o.next.prev=o.prev,o.next=void 0,r&&(r.next=o,o.prev=r)):(o.next.prev=void 0,n=o.next,o.next=void 0,r&&(o.prev=r,r.next=o)),r=o)};return{get(o){const l=t.get(o);if(l)return a(l),l.value},set(o,l){if(t.size>=e&&n){const d=n;t.delete(d.key),d.next&&(n=d.next,d.next.prev=void 0),d===r&&(r=void 0)}const u=t.get(o);if(u)u.value=l,a(u);else{const d={key:o,value:l,prev:r};r&&(r.next=d),r=d,n||(n=d),t.set(o,d)}}}}const Cp=e=>{if(!e.rendered)return e.rendered=!0,e.onReady?.()},iv=(e,t)=>!!(e.preload&&!e.router.state.matches.some(n=>n.id===t)),v$=(e,t)=>{const n=e.router.routesById[t.routeId??""]??e.router.routeTree;!n.options.notFoundComponent&&e.router.options?.defaultNotFoundComponent&&(n.options.notFoundComponent=e.router.options.defaultNotFoundComponent),In(n.options.notFoundComponent);const r=e.matches.find(a=>a.routeId===n.id);In(r,"Could not find match for route: "+n.id),e.updateMatch(r.id,a=>({...a,status:"notFound",error:t,isFetching:!1})),t.routerCode==="BEFORE_LOAD"&&n.parentRoute&&(t.routeId=n.parentRoute.id,v$(e,t))},co=(e,t,n)=>{if(!(!Ca(n)&&!va(n))){if(Ca(n)&&n.redirectHandled&&!n.options.reloadDocument)throw n;if(t){t._nonReactive.beforeLoadPromise?.resolve(),t._nonReactive.loaderPromise?.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0;const r=Ca(n)?"redirected":"notFound";t._nonReactive.error=n,e.updateMatch(t.id,a=>({...a,status:r,isFetching:!1,error:n})),va(n)&&!n.routeId&&(n.routeId=t.routeId),t._nonReactive.loadPromise?.resolve()}throw Ca(n)?(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n),n):(v$(e,n),n)}},g$=(e,t)=>{const n=e.router.getMatch(t);return!!(!e.router.isServer&&n._nonReactive.dehydrated||e.router.isServer&&n.ssr===!1)},Gu=(e,t,n,r)=>{const{id:a,routeId:o}=e.matches[t],l=e.router.looseRoutesById[o];if(n instanceof Promise)throw n;n.routerCode=r,e.firstBadMatchIndex??=t,co(e,e.router.getMatch(a),n);try{l.options.onError?.(n)}catch(u){n=u,co(e,e.router.getMatch(a),n)}e.updateMatch(a,u=>(u._nonReactive.beforeLoadPromise?.resolve(),u._nonReactive.beforeLoadPromise=void 0,u._nonReactive.loadPromise?.resolve(),{...u,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}))},k9=(e,t,n,r)=>{const a=e.router.getMatch(t),o=e.matches[n-1]?.id,l=o?e.router.getMatch(o):void 0;if(e.router.isShell()){a.ssr=r.id===_r;return}if(l?.ssr===!1){a.ssr=!1;return}const u=y=>y===!0&&l?.ssr==="data-only"?"data-only":y,d=e.router.options.defaultSsr??!0;if(r.options.ssr===void 0){a.ssr=u(d);return}if(typeof r.options.ssr!="function"){a.ssr=u(r.options.ssr);return}const{search:h,params:p}=a,v={search:ap(h,a.searchError),params:ap(p,a.paramsError),location:e.location,matches:e.matches.map(y=>({index:y.index,pathname:y.pathname,fullPath:y.fullPath,staticData:y.staticData,id:y.id,routeId:y.routeId,search:ap(y.search,y.searchError),params:ap(y.params,y.paramsError),ssr:y.ssr}))},g=r.options.ssr(v);if(po(g))return g.then(y=>{a.ssr=u(y??d)});a.ssr=u(g??d)},y$=(e,t,n,r)=>{if(r._nonReactive.pendingTimeout!==void 0)return;const a=n.options.pendingMs??e.router.options.defaultPendingMs;if(!!(e.onReady&&!e.router.isServer&&!iv(e,t)&&(n.options.loader||n.options.beforeLoad||w$(n))&&typeof a=="number"&&a!==1/0&&(n.options.pendingComponent??e.router.options?.defaultPendingComponent))){const l=setTimeout(()=>{Cp(e)},a);r._nonReactive.pendingTimeout=l}},M9=(e,t,n)=>{const r=e.router.getMatch(t);if(!r._nonReactive.beforeLoadPromise&&!r._nonReactive.loaderPromise)return;y$(e,t,n,r);const a=()=>{const o=e.router.getMatch(t);o.preload&&(o.status==="redirected"||o.status==="notFound")&&co(e,o,o.error)};return r._nonReactive.beforeLoadPromise?r._nonReactive.beforeLoadPromise.then(a):a()},D9=(e,t,n,r)=>{const a=e.router.getMatch(t),o=a._nonReactive.loadPromise;a._nonReactive.loadPromise=Kl(()=>{o?.resolve()});const{paramsError:l,searchError:u}=a;l&&Gu(e,n,l,"PARSE_PARAMS"),u&&Gu(e,n,u,"VALIDATE_SEARCH"),y$(e,t,r,a);const d=new AbortController,h=e.matches[n-1]?.id,g={...(h?e.router.getMatch(h):void 0)?.context??e.router.options.context??void 0,...a.__routeContext};let y=!1;const j=()=>{y||(y=!0,e.updateMatch(t,R=>({...R,isFetching:"beforeLoad",fetchCount:R.fetchCount+1,abortController:d,context:g})))},b=()=>{a._nonReactive.beforeLoadPromise?.resolve(),a._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,R=>({...R,isFetching:!1}))};if(!r.options.beforeLoad){gf(()=>{j(),b()});return}a._nonReactive.beforeLoadPromise=Kl();const{search:w,params:A,cause:O}=a,N=iv(e,t),T={search:w,abortController:d,params:A,preload:N,context:g,location:e.location,navigate:R=>e.router.navigate({...R,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:N?"preload":O,matches:e.matches,...e.router.options.additionalContext},E=R=>{if(R===void 0){gf(()=>{j(),b()});return}(Ca(R)||va(R))&&(j(),Gu(e,n,R,"BEFORE_LOAD")),gf(()=>{j(),e.updateMatch(t,k=>({...k,__beforeLoadContext:R,context:{...k.context,...R}})),b()})};let C;try{if(C=r.options.beforeLoad(T),po(C))return j(),C.catch(R=>{Gu(e,n,R,"BEFORE_LOAD")}).then(E)}catch(R){j(),Gu(e,n,R,"BEFORE_LOAD")}E(C)},L9=(e,t)=>{const{id:n,routeId:r}=e.matches[t],a=e.router.looseRoutesById[r],o=()=>{if(e.router.isServer){const d=k9(e,n,t,a);if(po(d))return d.then(u)}return u()},l=()=>D9(e,n,t,a),u=()=>{if(g$(e,n))return;const d=M9(e,n,a);return po(d)?d.then(l):l()};return o()},yf=(e,t,n)=>{const r=e.router.getMatch(t);if(!r||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const a={matches:e.matches,match:r,params:r.params,loaderData:r.loaderData};return Promise.all([n.options.head?.(a),n.options.scripts?.(a),n.options.headers?.(a)]).then(([o,l,u])=>{const d=o?.meta,h=o?.links,p=o?.scripts,v=o?.styles;return{meta:d,links:h,headScripts:p,headers:u,scripts:l,styles:v}})},x$=(e,t,n,r)=>{const a=e.matchPromises[n-1],{params:o,loaderDeps:l,abortController:u,cause:d}=e.router.getMatch(t);let h=e.router.options.context??{};for(let v=0;v<=n;v++){const g=e.matches[v];if(!g)continue;const y=e.router.getMatch(g.id);y&&(h={...h,...y.__routeContext??{},...y.__beforeLoadContext??{}})}const p=iv(e,t);return{params:o,deps:l,preload:!!p,parentMatchPromise:a,abortController:u,context:h,location:e.location,navigate:v=>e.router.navigate({...v,_fromLocation:e.location}),cause:p?"preload":d,route:r,...e.router.options.additionalContext}},ZC=async(e,t,n,r)=>{try{const a=e.router.getMatch(t);try{(!e.router.isServer||a.ssr===!0)&&b$(r);const o=r.options.loader?.(x$(e,t,n,r)),l=r.options.loader&&po(o);if(!!(l||r._lazyPromise||r._componentsPromise||r.options.head||r.options.scripts||r.options.headers||a._nonReactive.minPendingPromise)&&e.updateMatch(t,v=>({...v,isFetching:"loader"})),r.options.loader){const v=l?await o:o;co(e,e.router.getMatch(t),v),v!==void 0&&e.updateMatch(t,g=>({...g,loaderData:v}))}r._lazyPromise&&await r._lazyPromise;const d=yf(e,t,r),h=d?await d:void 0,p=a._nonReactive.minPendingPromise;p&&await p,r._componentsPromise&&await r._componentsPromise,e.updateMatch(t,v=>({...v,error:void 0,status:"success",isFetching:!1,updatedAt:Date.now(),...h}))}catch(o){let l=o;const u=a._nonReactive.minPendingPromise;u&&await u,va(o)&&await r.options.notFoundComponent?.preload?.(),co(e,e.router.getMatch(t),o);try{r.options.onError?.(o)}catch(p){l=p,co(e,e.router.getMatch(t),p)}const d=yf(e,t,r),h=d?await d:void 0;e.updateMatch(t,p=>({...p,error:l,status:"error",isFetching:!1,...h}))}}catch(a){const o=e.router.getMatch(t);if(o){const l=yf(e,t,r);if(l){const u=await l;e.updateMatch(t,d=>({...d,...u}))}o._nonReactive.loaderPromise=void 0}co(e,o,a)}},$9=async(e,t)=>{const{id:n,routeId:r}=e.matches[t];let a=!1,o=!1;const l=e.router.looseRoutesById[r];if(g$(e,n)){if(e.router.isServer){const h=yf(e,n,l);if(h){const p=await h;e.updateMatch(n,v=>({...v,...p}))}return e.router.getMatch(n)}}else{const h=e.router.getMatch(n);if(h._nonReactive.loaderPromise){if(h.status==="success"&&!e.sync&&!h.preload)return h;await h._nonReactive.loaderPromise;const p=e.router.getMatch(n),v=p._nonReactive.error||p.error;v&&co(e,p,v)}else{const p=Date.now()-h.updatedAt,v=iv(e,n),g=v?l.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:l.options.staleTime??e.router.options.defaultStaleTime??0,y=l.options.shouldReload,j=typeof y=="function"?y(x$(e,n,t,l)):y,b=!!v&&!e.router.state.matches.some(N=>N.id===n),w=e.router.getMatch(n);w._nonReactive.loaderPromise=Kl(),b!==w.preload&&e.updateMatch(n,N=>({...N,preload:b}));const{status:A,invalid:O}=w;if(a=A==="success"&&(O||(j??p>g)),!(v&&l.options.preload===!1))if(a&&!e.sync)o=!0,(async()=>{try{await ZC(e,n,t,l);const N=e.router.getMatch(n);N._nonReactive.loaderPromise?.resolve(),N._nonReactive.loadPromise?.resolve(),N._nonReactive.loaderPromise=void 0}catch(N){Ca(N)&&await e.router.navigate(N.options)}})();else if(A!=="success"||a&&e.sync)await ZC(e,n,t,l);else{const N=yf(e,n,l);if(N){const T=await N;e.updateMatch(n,E=>({...E,...T}))}}}}const u=e.router.getMatch(n);o||(u._nonReactive.loaderPromise?.resolve(),u._nonReactive.loadPromise?.resolve()),clearTimeout(u._nonReactive.pendingTimeout),u._nonReactive.pendingTimeout=void 0,o||(u._nonReactive.loaderPromise=void 0),u._nonReactive.dehydrated=void 0;const d=o?u.isFetching:!1;return d!==u.isFetching||u.invalid!==!1?(e.updateMatch(n,h=>({...h,isFetching:d,invalid:!1})),e.router.getMatch(n)):u};async function QC(e){const t=Object.assign(e,{matchPromises:[]});!t.router.isServer&&t.router.state.matches.some(n=>n._forcePending)&&Cp(t);try{for(let a=0;a{const{id:n,...r}=t.options;Object.assign(e.options,r),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0),!e._componentsLoaded&&e._componentsPromise===void 0){const t=()=>{const n=[];for(const r of S$){const a=e.options[r]?.preload;a&&n.push(a())}if(n.length)return Promise.all(n).then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0});e._componentsLoaded=!0,e._componentsPromise=void 0};e._componentsPromise=e._lazyPromise?e._lazyPromise.then(t):t()}return e._componentsPromise}function ap(e,t){return t?{status:"error",error:t}:{status:"success",value:e}}function w$(e){for(const t of S$)if(e.options[t]?.preload)return!0;return!1}const S$=["component","errorComponent","pendingComponent","notFoundComponent"];function I9(e){return{input:({url:t})=>{for(const n of e)t=j$(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=_$(e[n],t);return t}}}function z9(e){const t=Tp(e.basepath),n=`/${t}`,r=`${n}/`,a=e.caseSensitive?n:n.toLowerCase(),o=e.caseSensitive?r:r.toLowerCase();return{input:({url:l})=>{const u=e.caseSensitive?l.pathname:l.pathname.toLowerCase();return u===a?l.pathname="/":u.startsWith(o)&&(l.pathname=l.pathname.slice(n.length)),l},output:({url:l})=>(l.pathname=xi(["/",t,l.pathname]),l)}}function j$(e,t){const n=e?.input?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function _$(e,t){const n=e?.output?.({url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function ss(e){const t=e.resolvedLocation,n=e.location,r=t?.pathname!==n.pathname,a=t?.href!==n.href,o=t?.hash!==n.hash;return{fromLocation:t,toLocation:n,pathChanged:r,hrefChanged:a,hashChanged:o}}class B9{constructor(t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this.resetNextScroll=!0,this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.isScrollRestoring=!1,this.isScrollRestorationSetup=!1,this.startTransition=n=>n(),this.update=n=>{n.notFoundRoute&&console.warn("The notFoundRoute API is deprecated and will be removed in the next major version. See https://tanstack.com/router/v1/docs/framework/react/guide/not-found-errors#migrating-from-notfoundroute for more info.");const r=this.options,a=this.basepath??r?.basepath??"/",o=this.basepath===void 0,l=r?.rewrite;this.options={...r,...n},this.isServer=this.options.isServer??typeof document>"u",this.pathParamsDecodeCharMap=this.options.pathParamsAllowedCharacters?new Map(this.options.pathParamsAllowedCharacters.map(g=>[encodeURIComponent(g),g])):void 0,(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.isServer||(this.history=GH())),this.origin=this.options.origin,this.origin||(!this.isServer&&window?.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree&&(this.routeTree=this.options.routeTree,this.buildRouteTree()),!this.__store&&this.latestLocation&&(this.__store=new HH(U9(this.latestLocation),{onUpdate:()=>{this.__store.state={...this.state,cachedMatches:this.state.cachedMatches.filter(g=>!["redirected"].includes(g.status))}}}),_9(this));let u=!1;const d=this.options.basepath??"/",h=this.options.rewrite;if(o||a!==d||l!==h){this.basepath=d;const g=[];Tp(d)!==""&&g.push(z9({basepath:d})),h&&g.push(h),this.rewrite=g.length===0?void 0:g.length===1?g[0]:I9(g),this.history&&this.updateLatestLocation(),u=!0}u&&this.__store&&(this.__store.state={...this.state,location:this.latestLocation}),typeof window<"u"&&"CSS"in window&&typeof window.CSS?.supports=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a)"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const{routesById:n,routesByPath:r,flatRoutes:a}=x9({routeTree:this.routeTree,initRoute:(l,u)=>{l.init({originalIndex:u})}});this.routesById=n,this.routesByPath=r,this.flatRoutes=a;const o=this.options.notFoundRoute;o&&(o.init({originalIndex:99999999999}),this.routesById[o.id]=o)},this.subscribe=(n,r)=>{const a={eventType:n,fn:r};return this.subscribers.add(a),()=>{this.subscribers.delete(a)}},this.emit=n=>{this.subscribers.forEach(r=>{r.eventType===n.type&&r.fn(n)})},this.parseLocation=(n,r)=>{const a=({href:d,state:h})=>{const p=new URL(d,this.origin),v=j$(this.rewrite,p),g=this.options.parseSearch(v.search),y=this.options.stringifySearch(g);v.search=y;const j=v.href.replace(v.origin,""),{pathname:b,hash:w}=v;return{href:j,publicHref:d,url:v.href,pathname:KC(b),searchStr:y,search:Yr(r?.search,g),hash:w.split("#").reverse()[0]??"",state:Yr(r?.state,h)}},o=a(n),{__tempLocation:l,__tempKey:u}=o.state;if(l&&(!u||u===this.tempLocationKey)){const d=a(l);return d.state.key=o.state.key,d.state.__TSR_key=o.state.__TSR_key,delete d.state.__tempLocation,{...d,maskedLocation:o}}return o},this.resolvePathWithBase=(n,r)=>JH({base:n,to:N_(r),trailingSlash:this.options.trailingSlash,parseCache:this.parsePathnameCache}),this.matchRoutes=(n,r,a)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:r},a):this.matchRoutesInternal(n,r),this.parsePathnameCache=P9(1e3),this.getMatchedRoutes=(n,r)=>F9({pathname:n,routePathname:r,caseSensitive:this.options.caseSensitive,routesByPath:this.routesByPath,routesById:this.routesById,flatRoutes:this.flatRoutes,parseCache:this.parsePathnameCache}),this.cancelMatch=n=>{const r=this.getMatch(n);r&&(r.abortController.abort(),clearTimeout(r._nonReactive.pendingTimeout),r._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{const n=this.state.matches.filter(o=>o.status==="pending"),r=this.state.matches.filter(o=>o.isFetching==="loader");new Set([...this.state.pendingMatches??[],...n,...r]).forEach(o=>{this.cancelMatch(o.id)})},this.buildLocation=n=>{const r=(o={})=>{const l=o._fromLocation||this.pendingBuiltLocation||this.latestLocation,u=this.matchRoutes(l,{_buildLocation:!0}),d=_1(u);o.from;const h=o.unsafeRelative==="path"?l.pathname:o.from??d.fullPath,p=this.resolvePathWithBase(h,"."),v=d.search,g={...d.params},y=o.to?this.resolvePathWithBase(p,`${o.to}`):this.resolvePathWithBase(p,"."),j=o.params===!1||o.params===null?{}:(o.params??!0)===!0?g:Object.assign(g,is(o.params,g)),b=Hx({path:y,params:j,parseCache:this.parsePathnameCache}).interpolatedPath,w=this.matchRoutes(b,void 0,{_buildLocation:!0}).map(U=>this.looseRoutesById[U.routeId]);if(Object.keys(j).length>0)for(const U of w){const $=U.options.params?.stringify??U.options.stringifyParams;$&&Object.assign(j,$(j))}const A=n.leaveParams?y:KC(Hx({path:y,params:j,decodeCharMap:this.pathParamsDecodeCharMap,parseCache:this.parsePathnameCache}).interpolatedPath);let O=v;if(n._includeValidateSearch&&this.options.search?.strict){const U={};w.forEach($=>{if($.options.validateSearch)try{Object.assign(U,N1($.options.validateSearch,{...U,...O}))}catch{}}),O=U}O=H9({search:O,dest:o,destRoutes:w,_includeValidateSearch:n._includeValidateSearch}),O=Yr(v,O);const N=this.options.stringifySearch(O),T=o.hash===!0?l.hash:o.hash?is(o.hash,l.hash):void 0,E=T?`#${T}`:"";let C=o.state===!0?l.state:o.state?is(o.state,l.state):{};C=Yr(l.state,C);const R=`${A}${N}${E}`,k=new URL(R,this.origin),M=_$(this.rewrite,k);return{publicHref:M.pathname+M.search+M.hash,href:R,url:M.href,pathname:A,search:O,searchStr:N,state:C,hash:T??"",unmaskOnReload:o.unmaskOnReload}},a=(o={},l)=>{const u=r(o);let d=l?r(l):void 0;if(!d){let h={};const p=this.options.routeMasks?.find(v=>{const g=A1(u.pathname,{to:v.from,caseSensitive:!1,fuzzy:!1},this.parsePathnameCache);return g?(h=g,!0):!1});if(p){const{from:v,...g}=p;l={from:n.from,...g,params:h},d=r(l)}}return d&&(u.maskedLocation=d),u};return n.mask?a(n,{from:n.from,...n.mask}):a(n)},this.commitLocation=({viewTransition:n,ignoreBlocker:r,...a})=>{const o=()=>{const d=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];d.forEach(p=>{a.state[p]=this.latestLocation.state[p]});const h=os(a.state,this.latestLocation.state);return d.forEach(p=>{delete a.state[p]}),h},l=mo(this.latestLocation.href)===mo(a.href),u=this.commitLocationPromise;if(this.commitLocationPromise=Kl(()=>{u?.resolve()}),l&&o())this.load();else{let{maskedLocation:d,hashScrollIntoView:h,...p}=a;d&&(p={...d,state:{...d.state,__tempKey:void 0,__tempLocation:{...p,search:p.searchStr,state:{...p.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(p.unmaskOnReload??this.options.unmaskOnReload??!1)&&(p.state.__tempKey=this.tempLocationKey)),p.state.__hashScrollIntoViewOptions=h??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,this.history[a.replace?"replace":"push"](p.publicHref,p.state,{ignoreBlocker:r})}return this.resetNextScroll=a.resetScroll??!0,this.history.subscribers.size||this.load(),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:r,hashScrollIntoView:a,viewTransition:o,ignoreBlocker:l,href:u,...d}={})=>{if(u){const v=this.history.location.state.__TSR_index,g=qp(u,{__TSR_index:n?v:v+1});d.to=g.pathname,d.search=this.options.parseSearch(g.search),d.hash=g.hash.slice(1)}const h=this.buildLocation({...d,_includeValidateSearch:!0});this.pendingBuiltLocation=h;const p=this.commitLocation({...h,viewTransition:o,replace:n,resetScroll:r,hashScrollIntoView:a,ignoreBlocker:l});return Promise.resolve().then(()=>{this.pendingBuiltLocation===h&&(this.pendingBuiltLocation=void 0)}),p},this.navigate=({to:n,reloadDocument:r,href:a,...o})=>{if(!r&&a)try{new URL(`${a}`),r=!0}catch{}return r?(a||(a=this.buildLocation({to:n,...o}).url),o.replace?window.location.replace(a):window.location.href=a,Promise.resolve()):this.buildAndCommitLocation({...o,href:a,to:n,_isNavigate:!0})},this.beforeLoad=()=>{if(this.cancelMatches(),this.updateLatestLocation(),this.isServer){const r=this.buildLocation({to:this.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0}),a=o=>{try{return encodeURI(decodeURI(o))}catch{return o}};if(Tp(a(this.latestLocation.href))!==Tp(a(r.href))){let o=r.url;throw this.origin&&o.startsWith(this.origin)&&(o=o.replace(this.origin,"")||"/"),m$({href:o})}}const n=this.matchRoutes(this.latestLocation);this.__store.setState(r=>({...r,status:"pending",statusCode:200,isLoading:!0,location:this.latestLocation,pendingMatches:n,cachedMatches:r.cachedMatches.filter(a=>!n.some(o=>o.id===a.id))}))},this.load=async n=>{let r,a,o;for(o=new Promise(u=>{this.startTransition(async()=>{try{this.beforeLoad();const d=this.latestLocation,h=this.state.resolvedLocation;this.state.redirect||this.emit({type:"onBeforeNavigate",...ss({resolvedLocation:h,location:d})}),this.emit({type:"onBeforeLoad",...ss({resolvedLocation:h,location:d})}),await QC({router:this,sync:n?.sync,matches:this.state.pendingMatches,location:d,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{let p=[],v=[],g=[];gf(()=>{this.__store.setState(y=>{const j=y.matches,b=y.pendingMatches||y.matches;return p=j.filter(w=>!b.some(A=>A.id===w.id)),v=b.filter(w=>!j.some(A=>A.id===w.id)),g=b.filter(w=>j.some(A=>A.id===w.id)),{...y,isLoading:!1,loadedAt:Date.now(),matches:b,pendingMatches:void 0,cachedMatches:[...y.cachedMatches,...p.filter(w=>w.status!=="error")]}}),this.clearExpiredCache()}),[[p,"onLeave"],[v,"onEnter"],[g,"onStay"]].forEach(([y,j])=>{y.forEach(b=>{this.looseRoutesById[b.routeId].options[j]?.(b)})})})})}})}catch(d){Ca(d)?(r=d,this.isServer||this.navigate({...r.options,replace:!0,ignoreBlocker:!0})):va(d)&&(a=d),this.__store.setState(h=>({...h,statusCode:r?r.status:a?404:h.matches.some(p=>p.status==="error")?500:200,redirect:r}))}this.latestLoadPromise===o&&(this.commitLocationPromise?.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),u()})}),this.latestLoadPromise=o,await o;this.latestLoadPromise&&o!==this.latestLoadPromise;)await this.latestLoadPromise;let l;this.hasNotFoundMatch()?l=404:this.__store.state.matches.some(u=>u.status==="error")&&(l=500),l!==void 0&&this.__store.setState(u=>({...u,statusCode:l}))},this.startViewTransition=n=>{const r=this.shouldViewTransition??this.options.defaultViewTransition;if(delete this.shouldViewTransition,r&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let a;if(typeof r=="object"&&this.isViewTransitionTypesSupported){const o=this.latestLocation,l=this.state.resolvedLocation,u=typeof r.types=="function"?r.types(ss({resolvedLocation:l,location:o})):r.types;if(u===!1){n();return}a={update:n,types:u}}else a=n;document.startViewTransition(a)}else n()},this.updateMatch=(n,r)=>{this.startTransition(()=>{const a=this.state.pendingMatches?.some(o=>o.id===n)?"pendingMatches":this.state.matches.some(o=>o.id===n)?"matches":this.state.cachedMatches.some(o=>o.id===n)?"cachedMatches":"";a&&this.__store.setState(o=>({...o,[a]:o[a]?.map(l=>l.id===n?r(l):l)}))})},this.getMatch=n=>{const r=a=>a.id===n;return this.state.cachedMatches.find(r)??this.state.pendingMatches?.find(r)??this.state.matches.find(r)},this.invalidate=n=>{const r=a=>n?.filter?.(a)??!0?{...a,invalid:!0,...n?.forcePending||a.status==="error"?{status:"pending",error:void 0}:void 0}:a;return this.__store.setState(a=>({...a,matches:a.matches.map(r),cachedMatches:a.cachedMatches.map(r),pendingMatches:a.pendingMatches?.map(r)})),this.shouldViewTransition=!1,this.load({sync:n?.sync})},this.resolveRedirect=n=>{if(!n.options.href){const r=this.buildLocation(n.options);let a=r.url;this.origin&&a.startsWith(this.origin)&&(a=a.replace(this.origin,"")||"/"),n.options.href=r.href,n.headers.set("Location",a)}return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const r=n?.filter;r!==void 0?this.__store.setState(a=>({...a,cachedMatches:a.cachedMatches.filter(o=>!r(o))})):this.__store.setState(a=>({...a,cachedMatches:[]}))},this.clearExpiredCache=()=>{const n=r=>{const a=this.looseRoutesById[r.routeId];if(!a.options.loader)return!0;const o=(r.preload?a.options.preloadGcTime??this.options.defaultPreloadGcTime:a.options.gcTime??this.options.defaultGcTime)??300*1e3;return r.status==="error"?!0:Date.now()-r.updatedAt>=o};this.clearCache({filter:n})},this.loadRouteChunk=b$,this.preloadRoute=async n=>{const r=this.buildLocation(n);let a=this.matchRoutes(r,{throwOnError:!0,preload:!0,dest:n});const o=new Set([...this.state.matches,...this.state.pendingMatches??[]].map(u=>u.id)),l=new Set([...o,...this.state.cachedMatches.map(u=>u.id)]);gf(()=>{a.forEach(u=>{l.has(u.id)||this.__store.setState(d=>({...d,cachedMatches:[...d.cachedMatches,u]}))})});try{return a=await QC({router:this,matches:a,location:r,preload:!0,updateMatch:(u,d)=>{o.has(u)?a=a.map(h=>h.id===u?d(h):h):this.updateMatch(u,d)}}),a}catch(u){if(Ca(u))return u.options.reloadDocument?void 0:await this.preloadRoute({...u.options,_fromLocation:r});va(u)||console.error(u);return}},this.matchRoute=(n,r)=>{const a={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},o=this.buildLocation(a);if(r?.pending&&this.state.status!=="pending")return!1;const u=(r?.pending===void 0?!this.state.isLoading:r.pending)?this.latestLocation:this.state.resolvedLocation||this.state.location,d=A1(u.pathname,{...r,to:o.pathname},this.parsePathnameCache);return!d||n.params&&!os(d,n.params,{partial:!0})?!1:d&&(r?.includeSearch??!0)?os(u.search,o.search,{partial:!0})?d:!1:d},this.hasNotFoundMatch=()=>this.__store.state.matches.some(n=>n.status==="notFound"||n.globalNotFound),this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...t,caseSensitive:t.caseSensitive??!1,notFoundMode:t.notFoundMode??"fuzzy",stringifySearch:t.stringifySearch??T9,parseSearch:t.parseSearch??E9}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.__store.state}get looseRoutesById(){return this.routesById}matchRoutesInternal(t,n){const{foundRoute:r,matchedRoutes:a,routeParams:o}=this.getMatchedRoutes(t.pathname,n?.dest?.to);let l=!1;(r?r.path!=="/"&&o["**"]:mo(t.pathname))&&(this.options.notFoundRoute?a.push(this.options.notFoundRoute):l=!0);const u=(()=>{if(l){if(this.options.notFoundMode!=="root")for(let p=a.length-1;p>=0;p--){const v=a[p];if(v.children)return v.id}return _r}})(),d=[],h=p=>p?.id?p.context??this.options.context??void 0:this.options.context??void 0;return a.forEach((p,v)=>{const g=d[v-1],[y,j,b]=(()=>{const z=g?.search??t.search,V=g?._strictSearch??void 0;try{const F=N1(p.options.validateSearch,{...z})??void 0;return[{...z,...F},{...V,...F},void 0]}catch(F){let G=F;if(F instanceof Gp||(G=new Gp(F.message,{cause:F})),n?.throwOnError)throw G;return[z,{},G]}})(),w=p.options.loaderDeps?.({search:y})??"",A=w?JSON.stringify(w):"",{interpolatedPath:O,usedParams:N}=Hx({path:p.fullPath,params:o,decodeCharMap:this.pathParamsDecodeCharMap}),T=p.id+O+A,E=this.getMatch(T),C=this.state.matches.find(z=>z.routeId===p.id),R=E?._strictParams??N;let k;if(!E){const z=p.options.params?.parse??p.options.parseParams;if(z)try{Object.assign(R,z(R))}catch(V){if(k=new q9(V.message,{cause:V}),n?.throwOnError)throw k}}Object.assign(o,R);const M=C?"stay":"enter";let U;if(E)U={...E,cause:M,params:C?Yr(C.params,o):o,_strictParams:R,search:Yr(C?C.search:E.search,y),_strictSearch:j};else{const z=p.options.loader||p.options.beforeLoad||p.lazyFn||w$(p)?"pending":"success";U={id:T,index:v,routeId:p.id,params:C?Yr(C.params,o):o,_strictParams:R,pathname:O,updatedAt:Date.now(),search:C?Yr(C.search,y):y,_strictSearch:j,searchError:void 0,status:z,isFetching:!1,error:void 0,paramsError:k,__routeContext:void 0,_nonReactive:{loadPromise:Kl()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:M,loaderDeps:C?Yr(C.loaderDeps,w):w,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:p.options.staticData||{},fullPath:p.fullPath}}n?.preload||(U.globalNotFound=u===p.id),U.searchError=b;const $=h(g);U.context={...$,...U.__routeContext,...U.__beforeLoadContext},d.push(U)}),d.forEach((p,v)=>{const g=this.looseRoutesById[p.routeId];if(!this.getMatch(p.id)&&n?._buildLocation!==!0){const j=d[v-1],b=h(j);if(g.options.context){const w={deps:p.loaderDeps,params:p.params,context:b??{},location:t,navigate:A=>this.navigate({...A,_fromLocation:t}),buildLocation:this.buildLocation,cause:p.cause,abortController:p.abortController,preload:!!p.preload,matches:d};p.__routeContext=g.options.context(w)??void 0}p.context={...b,...p.__routeContext,...p.__beforeLoadContext}}}),d}}class Gp extends Error{}class q9 extends Error{}function U9(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],pendingMatches:[],cachedMatches:[],statusCode:200}}function N1(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new Gp("Async validation not supported");if(n.issues)throw new Gp(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function F9({pathname:e,routePathname:t,caseSensitive:n,routesByPath:r,routesById:a,flatRoutes:o,parseCache:l}){let u={};const d=mo(e),h=y=>A1(d,{to:y.fullPath,caseSensitive:y.options?.caseSensitive??n,fuzzy:!0},l);let p=t!==void 0?r[t]:void 0;if(p)u=h(p);else{let y;for(const j of o){const b=h(j);if(b)if(j.path!=="/"&&b["**"])y||(y={foundRoute:j,routeParams:b});else{p=j,u=b;break}}!p&&y&&(p=y.foundRoute,u=y.routeParams)}let v=p||a[_r];const g=[v];for(;v.parentRoute;)v=v.parentRoute,g.push(v);return g.reverse(),{matchedRoutes:g,routeParams:u,foundRoute:p}}function H9({search:e,dest:t,destRoutes:n,_includeValidateSearch:r}){const a=n.reduce((u,d)=>{const h=[];if("search"in d.options)d.options.search?.middlewares&&h.push(...d.options.search.middlewares);else if(d.options.preSearchFilters||d.options.postSearchFilters){const p=({search:v,next:g})=>{let y=v;"preSearchFilters"in d.options&&d.options.preSearchFilters&&(y=d.options.preSearchFilters.reduce((b,w)=>w(b),v));const j=g(y);return"postSearchFilters"in d.options&&d.options.postSearchFilters?d.options.postSearchFilters.reduce((b,w)=>w(b),j):j};h.push(p)}if(r&&d.options.validateSearch){const p=({search:v,next:g})=>{const y=g(v);try{return{...y,...N1(d.options.validateSearch,y)??void 0}}catch{return y}};h.push(p)}return u.concat(h)},[])??[],o=({search:u})=>t.search?t.search===!0?u:is(t.search,u):{};a.push(o);const l=(u,d)=>{if(u>=a.length)return d;const h=a[u];return h({search:d,next:v=>l(u+1,v)})};return l(0,e)}const V9="Error preloading route! ☝️";class A${constructor(t){if(this.init=n=>{this.originalIndex=n.originalIndex;const r=this.options,a=!r?.path&&!r?.id;this.parentRoute=this.options.getParentRoute?.(),a?this._path=_r:this.parentRoute||In(!1);let o=a?_r:r?.path;o&&o!=="/"&&(o=E_(o));const l=r?.id||o;let u=a?_r:xi([this.parentRoute.id===_r?"":this.parentRoute.id,l]);o===_r&&(o="/"),u!==_r&&(u=xi(["/",u]));const d=u===_r?"/":xi([this.parentRoute.fullPath,o]);this._path=o,this._id=u,this._fullPath=d,this._to=d},this.addChildren=n=>this._addFileChildren(n),this._addFileChildren=n=>(Array.isArray(n)&&(this.children=n),typeof n=="object"&&n!==null&&(this.children=Object.values(n)),this),this._addFileTypes=()=>this,this.updateLoader=n=>(Object.assign(this.options,n),this),this.update=n=>(Object.assign(this.options,n),this),this.lazy=n=>(this.lazyFn=n,this),this.options=t||{},this.isRoot=!t?.getParentRoute,t?.id&&t?.path)throw new Error("Route cannot have both an 'id' and a 'path' option.")}get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}}class G9 extends A${constructor(t){super(t)}}function T_(e){const t=e.errorComponent??ov;return c.jsx(K9,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:r})=>n?S.createElement(t,{error:n,reset:r}):e.children})}class K9 extends S.Component{constructor(){super(...arguments),this.state={error:null}}static getDerivedStateFromProps(t){return{resetKey:t.getResetKey()}}static getDerivedStateFromError(t){return{error:t}}reset(){this.setState({error:null})}componentDidUpdate(t,n){n.error&&n.resetKey!==this.state.resetKey&&this.reset()}componentDidCatch(t,n){this.props.onCatch&&this.props.onCatch(t,n)}render(){return this.props.children({error:this.state.resetKey!==this.props.getResetKey()?null:this.state.error,reset:()=>{this.reset()}})}}function ov({error:e}){const[t,n]=S.useState(!1);return c.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[c.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[c.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),c.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(r=>!r),children:t?"Hide Error":"Show Error"})]}),c.jsx("div",{style:{height:".25rem"}}),t?c.jsx("div",{children:c.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?c.jsx("code",{children:e.message}):null})}):null]})}function W9({children:e,fallback:t=null}){return Y9()?c.jsx(K.Fragment,{children:e}):c.jsx(K.Fragment,{children:t})}function Y9(){return K.useSyncExternalStore(X9,()=>!0,()=>!1)}function X9(){return()=>{}}var Gx={exports:{}},Kx={},Wx={exports:{}},Yx={};var JC;function Z9(){if(JC)return Yx;JC=1;var e=hd();function t(v,g){return v===g&&(v!==0||1/v===1/g)||v!==v&&g!==g}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function u(v,g){var y=g(),j=r({inst:{value:y,getSnapshot:g}}),b=j[0].inst,w=j[1];return o(function(){b.value=y,b.getSnapshot=g,d(b)&&w({inst:b})},[v,y,g]),a(function(){return d(b)&&w({inst:b}),v(function(){d(b)&&w({inst:b})})},[v]),l(y),y}function d(v){var g=v.getSnapshot;v=v.value;try{var y=g();return!n(v,y)}catch{return!0}}function h(v,g){return g()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:u;return Yx.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,Yx}var e2;function Q9(){return e2||(e2=1,Wx.exports=Z9()),Wx.exports}var t2;function J9(){if(t2)return Kx;t2=1;var e=hd(),t=Q9();function n(h,p){return h===p&&(h!==0||1/h===1/p)||h!==h&&p!==p}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,o=e.useRef,l=e.useEffect,u=e.useMemo,d=e.useDebugValue;return Kx.useSyncExternalStoreWithSelector=function(h,p,v,g,y){var j=o(null);if(j.current===null){var b={hasValue:!1,value:null};j.current=b}else b=j.current;j=u(function(){function A(C){if(!O){if(O=!0,N=C,C=g(C),y!==void 0&&b.hasValue){var R=b.value;if(y(R,C))return T=R}return T=C}if(R=T,r(N,C))return R;var k=g(C);return y!==void 0&&y(R,k)?(N=C,R):(N=C,T=k)}var O=!1,N,T,E=v===void 0?null:v;return[function(){return A(p())},E===null?void 0:function(){return A(E())}]},[p,v,g,y]);var w=a(h,j[0],j[1]);return l(function(){b.hasValue=!0,b.value=w},[w]),d(w),w},Kx}var n2;function e7(){return n2||(n2=1,Gx.exports=J9()),Gx.exports}var t7=e7();function n7(e,t=r=>r,n={}){const r=n.equal??r7;return t7.useSyncExternalStoreWithSelector(e.subscribe,()=>e.state,()=>e.state,t,r)}function r7(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,a]of e)if(!t.has(r)||!Object.is(a,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();const n=r2(e);if(n.length!==r2(t).length)return!1;for(let r=0;r"u"?Xx:window.__TSR_ROUTER_CONTEXT__?window.__TSR_ROUTER_CONTEXT__:(window.__TSR_ROUTER_CONTEXT__=Xx,Xx)}function ir(e){const t=S.useContext(O$());return e?.warn,t}function Hn(e){const t=ir({warn:e?.router===void 0}),n=e?.router||t,r=S.useRef(void 0);return n7(n.__store,a=>{if(e?.select){if(e.structuralSharing??n.options.defaultStructuralSharing){const o=Yr(r.current,e.select(a));return r.current=o,o}return e.select(a)}return a})}const sv=S.createContext(void 0),a7=S.createContext(void 0);function Ia(e){const t=S.useContext(e.from?a7:sv);return Hn({select:r=>{const a=r.matches.find(o=>e.from?e.from===o.routeId:o.id===t);if(In(!((e.shouldThrow??!0)&&!a),`Could not find ${e.from?`an active match from "${e.from}"`:"a nearest match!"}`),a!==void 0)return e.select?e.select(a):a},structuralSharing:e.structuralSharing})}function C_(e){return Ia({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function R_(e){const{select:t,...n}=e;return Ia({...n,select:r=>t?t(r.loaderDeps):r.loaderDeps})}function P_(e){return Ia({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function k_(e){return Ia({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Ns(e){const t=ir();return S.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}var Es=f$();const i7=ft(Es),ip=typeof window<"u"?S.useLayoutEffect:S.useEffect;function Zx(e){const t=S.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function o7(e,t,n={},r={}){S.useEffect(()=>{if(!e.current||r.disabled||typeof IntersectionObserver!="function")return;const a=new IntersectionObserver(([o])=>{t(o)},n);return a.observe(e.current),()=>{a.disconnect()}},[t,n,r.disabled,e])}function s7(e){const t=S.useRef(null);return S.useImperativeHandle(e,()=>t.current,[]),t}function l7(e,t){const n=ir(),[r,a]=S.useState(!1),o=S.useRef(!1),l=s7(t),{activeProps:u,inactiveProps:d,activeOptions:h,to:p,preload:v,preloadDelay:g,hashScrollIntoView:y,replace:j,startTransition:b,resetScroll:w,viewTransition:A,children:O,target:N,disabled:T,style:E,className:C,onClick:R,onFocus:k,onMouseEnter:M,onMouseLeave:U,onTouchStart:$,ignoreBlocker:z,params:V,search:F,hash:G,state:L,mask:q,reloadDocument:H,unsafeRelative:ee,from:ve,_fromLocation:I,...B}=e,Y=Hn({select:rt=>rt.location.search,structuralSharing:!0}),te=e.from,le=S.useMemo(()=>({...e,from:te}),[n,Y,te,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),xe=S.useMemo(()=>n.buildLocation({...le}),[n,le]),Q=S.useMemo(()=>{if(T)return;let rt=xe.maskedLocation?xe.maskedLocation.url:xe.url,nt=!1;return n.origin&&(rt.startsWith(n.origin)?rt=n.history.createHref(rt.replace(n.origin,""))||"/":nt=!0),{href:rt,external:nt}},[T,xe.maskedLocation,xe.url,n.origin,n.history]),ne=S.useMemo(()=>{if(Q?.external)return Q.href;try{return new URL(p),p}catch{}},[p,Q]),X=e.reloadDocument||ne?!1:v??n.options.defaultPreload,de=g??n.options.defaultPreloadDelay??0,be=Hn({select:rt=>{if(ne)return!1;if(h?.exact){if(!ZH(rt.location.pathname,xe.pathname,n.basepath))return!1}else{const nt=Fp(rt.location.pathname,n.basepath),Pn=Fp(xe.pathname,n.basepath);if(!(nt.startsWith(Pn)&&(nt.length===Pn.length||nt[Pn.length]==="/")))return!1}return(h?.includeSearch??!0)&&!os(rt.location.search,xe.search,{partial:!h?.exact,ignoreUndefined:!h?.explicitUndefined})?!1:h?.includeHash?rt.location.hash===xe.hash:!0}}),oe=S.useCallback(()=>{n.preloadRoute({...le}).catch(rt=>{console.warn(rt),console.warn(V9)})},[n,le]),Pe=S.useCallback(rt=>{rt?.isIntersecting&&oe()},[oe]);o7(l,Pe,h7,{disabled:!!T||X!=="viewport"}),S.useEffect(()=>{o.current||!T&&X==="render"&&(oe(),o.current=!0)},[T,oe,X]);const Se=rt=>{const nt=rt.currentTarget.getAttribute("target"),Pn=N!==void 0?N:nt;if(!T&&!p7(rt)&&!rt.defaultPrevented&&(!Pn||Pn==="_self")&&rt.button===0){rt.preventDefault(),Es.flushSync(()=>{a(!0)});const Zc=n.subscribe("onResolved",()=>{Zc(),a(!1)});n.navigate({...le,replace:j,resetScroll:w,hashScrollIntoView:y,startTransition:b,viewTransition:A,ignoreBlocker:z})}};if(ne)return{...B,ref:l,href:ne,...O&&{children:O},...N&&{target:N},...T&&{disabled:T},...E&&{style:E},...C&&{className:C},...R&&{onClick:R},...k&&{onFocus:k},...M&&{onMouseEnter:M},...U&&{onMouseLeave:U},...$&&{onTouchStart:$}};const fe=rt=>{T||X&&oe()},he=fe,$e=rt=>{if(!(T||!X))if(!de)oe();else{const nt=rt.target;if(Ku.has(nt))return;const Pn=setTimeout(()=>{Ku.delete(nt),oe()},de);Ku.set(nt,Pn)}},Ot=rt=>{if(T||!X||!de)return;const nt=rt.target,Pn=Ku.get(nt);Pn&&(clearTimeout(Pn),Ku.delete(nt))},_n=be?is(u,{})??c7:Qx,fr=be?Qx:is(d,{})??Qx,Kn=[C,_n.className,fr.className].filter(Boolean).join(" "),Dr=(E||_n.style||fr.style)&&{...E,..._n.style,...fr.style};return{...B,..._n,...fr,href:Q?.href,ref:l,onClick:Wu([R,Se]),onFocus:Wu([k,fe]),onMouseEnter:Wu([M,$e]),onMouseLeave:Wu([U,Ot]),onTouchStart:Wu([$,he]),disabled:!!T,target:N,...Dr&&{style:Dr},...Kn&&{className:Kn},...T&&u7,...be&&f7,...r&&d7}}const Qx={},c7={className:"active"},u7={role:"link","aria-disabled":!0},f7={"data-status":"active","aria-current":"page"},d7={"data-transitioning":"transitioning"},Ku=new WeakMap,h7={rootMargin:"100px"},Wu=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}},M_=S.forwardRef((e,t)=>{const{_asChild:n,...r}=e,{type:a,ref:o,...l}=l7(r,t),u=typeof r.children=="function"?r.children({isActive:l["data-status"]==="active"}):r.children;return n===void 0&&delete l.disabled,S.createElement(n||"a",{...l,ref:o},u)});function p7(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}class m7 extends A${constructor(t){super(t),this.useMatch=n=>Ia({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ia({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>k_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>P_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>R_({...n,from:this.id}),this.useLoaderData=n=>C_({...n,from:this.id}),this.useNavigate=()=>Ns({from:this.fullPath}),this.Link=K.forwardRef((n,r)=>c.jsx(M_,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function Gn(e){return new m7(e)}class v7 extends G9{constructor(t){super(t),this.useMatch=n=>Ia({select:n?.select,from:this.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ia({...n,from:this.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>k_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useParams=n=>P_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.id}),this.useLoaderDeps=n=>R_({...n,from:this.id}),this.useLoaderData=n=>C_({...n,from:this.id}),this.useNavigate=()=>Ns({from:this.fullPath}),this.Link=K.forwardRef((n,r)=>c.jsx(M_,{ref:r,from:this.fullPath,...n})),this.$$typeof=Symbol.for("react.memo")}}function g7(e){return new v7(e)}function a2(e){return typeof e=="object"?new i2(e,{silent:!0}).createRoute(e):new i2(e,{silent:!0}).createRoute}class i2{constructor(t,n){this.path=t,this.createRoute=r=>{this.silent;const a=Gn(r);return a.isRoot=!1,a},this.silent=n?.silent}}class o2{constructor(t){this.useMatch=n=>Ia({select:n?.select,from:this.options.id,structuralSharing:n?.structuralSharing}),this.useRouteContext=n=>Ia({from:this.options.id,select:r=>n?.select?n.select(r.context):r.context}),this.useSearch=n=>k_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useParams=n=>P_({select:n?.select,structuralSharing:n?.structuralSharing,from:this.options.id}),this.useLoaderDeps=n=>R_({...n,from:this.options.id}),this.useLoaderData=n=>C_({...n,from:this.options.id}),this.useNavigate=()=>{const n=ir();return Ns({from:n.routesById[this.options.id].fullPath})},this.options=t,this.$$typeof=Symbol.for("react.memo")}}function s2(e){return typeof e=="object"?new o2(e):t=>new o2({id:e,...t})}function y7(){const e=ir(),t=S.useRef({router:e,mounted:!1}),[n,r]=S.useState(!1),{hasPendingMatches:a,isLoading:o}=Hn({select:v=>({isLoading:v.isLoading,hasPendingMatches:v.matches.some(g=>g.status==="pending")}),structuralSharing:!0}),l=Zx(o),u=o||n||a,d=Zx(u),h=o||a,p=Zx(h);return e.startTransition=v=>{r(!0),S.startTransition(()=>{v(),r(!1)})},S.useEffect(()=>{const v=e.history.subscribe(e.load),g=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return mo(e.latestLocation.href)!==mo(g.href)&&e.commitLocation({...g,replace:!0}),()=>{v()}},[e,e.history]),ip(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(g){console.error(g)}})()},[e]),ip(()=>{l&&!o&&e.emit({type:"onLoad",...ss(e.state)})},[l,e,o]),ip(()=>{p&&!h&&e.emit({type:"onBeforeRouteMount",...ss(e.state)})},[h,p,e]),ip(()=>{d&&!u&&(e.emit({type:"onResolved",...ss(e.state)}),e.__store.setState(v=>({...v,status:"idle",resolvedLocation:v.location})),A9(e))},[u,d,e]),null}function x7(e){const t=Hn({select:n=>`not-found-${n.location.pathname}-${n.status}`});return c.jsx(T_,{getResetKey:()=>t,onCatch:(n,r)=>{if(va(n))e.onCatch?.(n,r);else throw n},errorComponent:({error:n})=>{if(va(n))return e.fallback?.(n);throw n},children:e.children})}function b7(){return c.jsx("p",{children:"Not Found"})}function Cl(e){return c.jsx(c.Fragment,{children:e.children})}function N$(e,t,n){return t.options.notFoundComponent?c.jsx(t.options.notFoundComponent,{data:n}):e.options.defaultNotFoundComponent?c.jsx(e.options.defaultNotFoundComponent,{data:n}):c.jsx(b7,{})}function w7({children:e}){const t=ir();return t.isServer?c.jsx("script",{nonce:t.options.ssr?.nonce,className:"$tsr",dangerouslySetInnerHTML:{__html:[e].filter(Boolean).join(` `)+";$_TSR.c()"}}):null}function S7(){const e=ir();if(!e.isScrollRestoring||!e.isServer||typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return null;const n=(e.options.getScrollRestorationKey||O1)(e.latestLocation),r=n!==O1(e.latestLocation)?n:void 0,a={storageKey:Hp,shouldScrollRestoration:!0};return r&&(a.key=r),c.jsx(w7,{children:`(${p$.toString()})(${JSON.stringify(a)})`})}const E$=S.memo(function({matchId:t}){const n=ir(),r=Hn({select:A=>{const O=A.matches.find(N=>N.id===t);return In(O),{routeId:O.routeId,ssr:O.ssr,_displayPending:O._displayPending}},structuralSharing:!0}),a=n.routesById[r.routeId],o=a.options.pendingComponent??n.options.defaultPendingComponent,l=o?c.jsx(o,{}):null,u=a.options.errorComponent??n.options.defaultErrorComponent,d=a.options.onCatch??n.options.defaultOnCatch,h=a.isRoot?a.options.notFoundComponent??n.options.notFoundRoute?.options.component:a.options.notFoundComponent,p=r.ssr===!1||r.ssr==="data-only",v=(!a.isRoot||a.options.wrapInSuspense||p)&&(a.options.wrapInSuspense??o??(a.options.errorComponent?.preload||p))?S.Suspense:Cl,g=u?T_:Cl,y=h?x7:Cl,j=Hn({select:A=>A.loadedAt}),b=Hn({select:A=>{const O=A.matches.findIndex(N=>N.id===t);return A.matches[O-1]?.routeId}}),w=a.isRoot?a.options.shellComponent??Cl:Cl;return c.jsxs(w,{children:[c.jsx(sv.Provider,{value:t,children:c.jsx(v,{fallback:l,children:c.jsx(g,{getResetKey:()=>j,errorComponent:u||ov,onCatch:(A,O)=>{if(va(A))throw A;d?.(A,O)},children:c.jsx(y,{fallback:A=>{if(!h||A.routeId&&A.routeId!==r.routeId||!A.routeId&&!a.isRoot)throw A;return S.createElement(h,A)},children:p||r._displayPending?c.jsx(W9,{fallback:l,children:c.jsx(l2,{matchId:t})}):c.jsx(l2,{matchId:t})})})})}),b===_r&&n.options.scrollRestoration?c.jsxs(c.Fragment,{children:[c.jsx(j7,{}),c.jsx(S7,{})]}):null]})});function j7(){const e=ir(),t=S.useRef(void 0);return c.jsx("script",{suppressHydrationWarning:!0,ref:n=>{n&&(t.current===void 0||t.current.href!==e.latestLocation.href)&&(e.emit({type:"onRendered",...ss(e.state)}),t.current=e.latestLocation)}},e.latestLocation.state.__TSR_key)}const l2=S.memo(function({matchId:t}){const n=ir(),{match:r,key:a,routeId:o}=Hn({select:d=>{const h=d.matches.find(j=>j.id===t),p=h.routeId,g=(n.routesById[p].options.remountDeps??n.options.defaultRemountDeps)?.({routeId:p,loaderDeps:h.loaderDeps,params:h._strictParams,search:h._strictSearch});return{key:g?JSON.stringify(g):void 0,routeId:p,match:{id:h.id,status:h.status,error:h.error,_forcePending:h._forcePending,_displayPending:h._displayPending}}},structuralSharing:!0}),l=n.routesById[o],u=S.useMemo(()=>{const d=l.options.component??n.options.defaultComponent;return d?c.jsx(d,{},a):c.jsx(D_,{})},[a,l.options.component,n.options.defaultComponent]);if(r._displayPending)throw n.getMatch(r.id)?._nonReactive.displayPendingPromise;if(r._forcePending)throw n.getMatch(r.id)?._nonReactive.minPendingPromise;if(r.status==="pending"){const d=l.options.pendingMinMs??n.options.defaultPendingMinMs;if(d){const h=n.getMatch(r.id);if(h&&!h._nonReactive.minPendingPromise&&!n.isServer){const p=Kl();h._nonReactive.minPendingPromise=p,setTimeout(()=>{p.resolve(),h._nonReactive.minPendingPromise=void 0},d)}}throw n.getMatch(r.id)?._nonReactive.loadPromise}if(r.status==="notFound")return In(va(r.error)),N$(n,l,r.error);if(r.status==="redirected")throw In(Ca(r.error)),n.getMatch(r.id)?._nonReactive.loadPromise;if(r.status==="error"){if(n.isServer){const d=(l.options.errorComponent??n.options.defaultErrorComponent)||ov;return c.jsx(d,{error:r.error,reset:void 0,info:{componentStack:""}})}throw r.error}return u}),D_=S.memo(function(){const t=ir(),n=S.useContext(sv),r=Hn({select:h=>h.matches.find(p=>p.id===n)?.routeId}),a=t.routesById[r],o=Hn({select:h=>{const v=h.matches.find(g=>g.id===n);return In(v),v.globalNotFound}}),l=Hn({select:h=>{const p=h.matches,v=p.findIndex(g=>g.id===n);return p[v+1]?.id}}),u=t.options.defaultPendingComponent?c.jsx(t.options.defaultPendingComponent,{}):null;if(o)return N$(t,a,void 0);if(!l)return null;const d=c.jsx(E$,{matchId:l});return r===_r?c.jsx(S.Suspense,{fallback:u,children:d}):d});function _7(){const e=ir(),n=e.routesById[_r].options.pendingComponent??e.options.defaultPendingComponent,r=n?c.jsx(n,{}):null,a=e.isServer||typeof document<"u"&&e.ssr?Cl:S.Suspense,o=c.jsxs(a,{fallback:r,children:[!e.isServer&&c.jsx(y7,{}),c.jsx(A7,{})]});return e.options.InnerWrap?c.jsx(e.options.InnerWrap,{children:o}):o}function A7(){const e=ir(),t=Hn({select:a=>a.matches[0]?.id}),n=Hn({select:a=>a.loadedAt}),r=t?c.jsx(E$,{matchId:t}):null;return c.jsx(sv.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?r:c.jsx(T_,{getResetKey:()=>n,errorComponent:ov,onCatch:a=>{a.message||a.toString()},children:r})})}function O7(){const e=ir();return Hn({select:t=>[t.location.href,t.resolvedLocation?.href,t.status],structuralSharing:!0}),S.useCallback(t=>{const{pending:n,caseSensitive:r,fuzzy:a,includeSearch:o,...l}=t;return e.matchRoute(l,{pending:n,caseSensitive:r,fuzzy:a,includeSearch:o})},[e])}const N7=e=>new E7(e);class E7 extends B9{constructor(t){super(t)}}typeof globalThis<"u"?(globalThis.createFileRoute=a2,globalThis.createLazyFileRoute=s2):typeof window<"u"&&(window.createFileRoute=a2,window.createLazyFileRoute=s2);function T7({router:e,children:t,...n}){Object.keys(n).length>0&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const r=O$(),a=c.jsx(r.Provider,{value:e,children:t});return e.options.Wrap?c.jsx(e.options.Wrap,{children:a}):a}function C7({router:e,...t}){return c.jsx(T7,{router:e,...t,children:c.jsx(_7,{})})}function T$(e,t){return function(){return e.apply(t,arguments)}}const{toString:R7}=Object.prototype,{getPrototypeOf:L_}=Object,{iterator:lv,toStringTag:C$}=Symbol,cv=(e=>t=>{const n=R7.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),xa=e=>(e=e.toLowerCase(),t=>cv(t)===e),uv=e=>t=>typeof t===e,{isArray:Tc}=Array,Zl=uv("undefined");function pd(e){return e!==null&&!Zl(e)&&e.constructor!==null&&!Zl(e.constructor)&&rr(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const R$=xa("ArrayBuffer");function P7(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&R$(e.buffer),t}const k7=uv("string"),rr=uv("function"),P$=uv("number"),md=e=>e!==null&&typeof e=="object",M7=e=>e===!0||e===!1,Rp=e=>{if(cv(e)!=="object")return!1;const t=L_(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(C$ in e)&&!(lv in e)},D7=e=>{if(!md(e)||pd(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},L7=xa("Date"),$7=xa("File"),I7=xa("Blob"),z7=xa("FileList"),B7=e=>md(e)&&rr(e.pipe),q7=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||rr(e.append)&&((t=cv(e))==="formdata"||t==="object"&&rr(e.toString)&&e.toString()==="[object FormData]"))},U7=xa("URLSearchParams"),[F7,H7,V7,G7]=["ReadableStream","Request","Response","Headers"].map(xa),K7=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function vd(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,a;if(typeof e!="object"&&(e=[e]),Tc(e))for(r=0,a=e.length;r0;)if(a=n[r],t===a.toLowerCase())return a;return null}const es=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,M$=e=>!Zl(e)&&e!==es;function E1(){const{caseless:e,skipUndefined:t}=M$(this)&&this||{},n={},r=(a,o)=>{const l=e&&k$(n,o)||o;Rp(n[l])&&Rp(a)?n[l]=E1(n[l],a):Rp(a)?n[l]=E1({},a):Tc(a)?n[l]=a.slice():(!t||!Zl(a))&&(n[l]=a)};for(let a=0,o=arguments.length;a(vd(t,(a,o)=>{n&&rr(a)?e[o]=T$(a,n):e[o]=a},{allOwnKeys:r}),e),Y7=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),X7=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},Z7=(e,t,n,r)=>{let a,o,l;const u={};if(t=t||{},e==null)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)l=a[o],(!r||r(l,e,t))&&!u[l]&&(t[l]=e[l],u[l]=!0);e=n!==!1&&L_(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},Q7=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},J7=e=>{if(!e)return null;if(Tc(e))return e;let t=e.length;if(!P$(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},eV=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&L_(Uint8Array)),tV=(e,t)=>{const r=(e&&e[lv]).call(e);let a;for(;(a=r.next())&&!a.done;){const o=a.value;t.call(e,o[0],o[1])}},nV=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},rV=xa("HTMLFormElement"),aV=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,a){return r.toUpperCase()+a}),c2=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),iV=xa("RegExp"),D$=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};vd(n,(a,o)=>{let l;(l=t(a,o,e))!==!1&&(r[o]=l||a)}),Object.defineProperties(e,r)},oV=e=>{D$(e,(t,n)=>{if(rr(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(rr(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},sV=(e,t)=>{const n={},r=a=>{a.forEach(o=>{n[o]=!0})};return Tc(e)?r(e):r(String(e).split(t)),n},lV=()=>{},cV=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function uV(e){return!!(e&&rr(e.append)&&e[C$]==="FormData"&&e[lv])}const fV=e=>{const t=new Array(10),n=(r,a)=>{if(md(r)){if(t.indexOf(r)>=0)return;if(pd(r))return r;if(!("toJSON"in r)){t[a]=r;const o=Tc(r)?[]:{};return vd(r,(l,u)=>{const d=n(l,a+1);!Zl(d)&&(o[u]=d)}),t[a]=void 0,o}}return r};return n(e,0)},dV=xa("AsyncFunction"),hV=e=>e&&(md(e)||rr(e))&&rr(e.then)&&rr(e.catch),L$=((e,t)=>e?setImmediate:t?((n,r)=>(es.addEventListener("message",({source:a,data:o})=>{a===es&&o===n&&r.length&&r.shift()()},!1),a=>{r.push(a),es.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",rr(es.postMessage)),pV=typeof queueMicrotask<"u"?queueMicrotask.bind(es):typeof process<"u"&&process.nextTick||L$,mV=e=>e!=null&&rr(e[lv]),ce={isArray:Tc,isArrayBuffer:R$,isBuffer:pd,isFormData:q7,isArrayBufferView:P7,isString:k7,isNumber:P$,isBoolean:M7,isObject:md,isPlainObject:Rp,isEmptyObject:D7,isReadableStream:F7,isRequest:H7,isResponse:V7,isHeaders:G7,isUndefined:Zl,isDate:L7,isFile:$7,isBlob:I7,isRegExp:iV,isFunction:rr,isStream:B7,isURLSearchParams:U7,isTypedArray:eV,isFileList:z7,forEach:vd,merge:E1,extend:W7,trim:K7,stripBOM:Y7,inherits:X7,toFlatObject:Z7,kindOf:cv,kindOfTest:xa,endsWith:Q7,toArray:J7,forEachEntry:tV,matchAll:nV,isHTMLForm:rV,hasOwnProperty:c2,hasOwnProp:c2,reduceDescriptors:D$,freezeMethods:oV,toObjectSet:sV,toCamelCase:aV,noop:lV,toFiniteNumber:cV,findKey:k$,global:es,isContextDefined:M$,isSpecCompliantForm:uV,toJSONObject:fV,isAsyncFn:dV,isThenable:hV,setImmediate:L$,asap:pV,isIterable:mV};function Ke(e,t,n,r,a){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),a&&(this.response=a,this.status=a.status?a.status:null)}ce.inherits(Ke,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:ce.toJSONObject(this.config),code:this.code,status:this.status}}});const $$=Ke.prototype,I$={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{I$[e]={value:e}});Object.defineProperties(Ke,I$);Object.defineProperty($$,"isAxiosError",{value:!0});Ke.from=(e,t,n,r,a,o)=>{const l=Object.create($$);ce.toFlatObject(e,l,function(p){return p!==Error.prototype},h=>h!=="isAxiosError");const u=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return Ke.call(l,u,d,n,r,a),e&&l.cause==null&&Object.defineProperty(l,"cause",{value:e,configurable:!0}),l.name=e&&e.name||"Error",o&&Object.assign(l,o),l};const vV=null;function T1(e){return ce.isPlainObject(e)||ce.isArray(e)}function z$(e){return ce.endsWith(e,"[]")?e.slice(0,-2):e}function u2(e,t,n){return e?e.concat(t).map(function(a,o){return a=z$(a),!n&&o?"["+a+"]":a}).join(n?".":""):t}function gV(e){return ce.isArray(e)&&!e.some(T1)}const yV=ce.toFlatObject(ce,{},null,function(t){return/^is[A-Z]/.test(t)});function fv(e,t,n){if(!ce.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=ce.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(b,w){return!ce.isUndefined(w[b])});const r=n.metaTokens,a=n.visitor||p,o=n.dots,l=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&ce.isSpecCompliantForm(t);if(!ce.isFunction(a))throw new TypeError("visitor must be a function");function h(j){if(j===null)return"";if(ce.isDate(j))return j.toISOString();if(ce.isBoolean(j))return j.toString();if(!d&&ce.isBlob(j))throw new Ke("Blob is not supported. Use a Buffer instead.");return ce.isArrayBuffer(j)||ce.isTypedArray(j)?d&&typeof Blob=="function"?new Blob([j]):Buffer.from(j):j}function p(j,b,w){let A=j;if(j&&!w&&typeof j=="object"){if(ce.endsWith(b,"{}"))b=r?b:b.slice(0,-2),j=JSON.stringify(j);else if(ce.isArray(j)&&gV(j)||(ce.isFileList(j)||ce.endsWith(b,"[]"))&&(A=ce.toArray(j)))return b=z$(b),A.forEach(function(N,T){!(ce.isUndefined(N)||N===null)&&t.append(l===!0?u2([b],T,o):l===null?b:b+"[]",h(N))}),!1}return T1(j)?!0:(t.append(u2(w,b,o),h(j)),!1)}const v=[],g=Object.assign(yV,{defaultVisitor:p,convertValue:h,isVisitable:T1});function y(j,b){if(!ce.isUndefined(j)){if(v.indexOf(j)!==-1)throw Error("Circular reference detected in "+b.join("."));v.push(j),ce.forEach(j,function(A,O){(!(ce.isUndefined(A)||A===null)&&a.call(t,A,ce.isString(O)?O.trim():O,b,g))===!0&&y(A,b?b.concat(O):[O])}),v.pop()}}if(!ce.isObject(e))throw new TypeError("data must be an object");return y(e),t}function f2(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function $_(e,t){this._pairs=[],e&&fv(e,this,t)}const B$=$_.prototype;B$.append=function(t,n){this._pairs.push([t,n])};B$.toString=function(t){const n=t?function(r){return t.call(this,r,f2)}:f2;return this._pairs.map(function(a){return n(a[0])+"="+n(a[1])},"").join("&")};function xV(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function q$(e,t,n){if(!t)return e;const r=n&&n.encode||xV;ce.isFunction(n)&&(n={serialize:n});const a=n&&n.serialize;let o;if(a?o=a(t,n):o=ce.isURLSearchParams(t)?t.toString():new $_(t,n).toString(r),o){const l=e.indexOf("#");l!==-1&&(e=e.slice(0,l)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class d2{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){ce.forEach(this.handlers,function(r){r!==null&&t(r)})}}const U$={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},bV=typeof URLSearchParams<"u"?URLSearchParams:$_,wV=typeof FormData<"u"?FormData:null,SV=typeof Blob<"u"?Blob:null,jV={isBrowser:!0,classes:{URLSearchParams:bV,FormData:wV,Blob:SV},protocols:["http","https","file","blob","url","data"]},I_=typeof window<"u"&&typeof document<"u",C1=typeof navigator=="object"&&navigator||void 0,_V=I_&&(!C1||["ReactNative","NativeScript","NS"].indexOf(C1.product)<0),AV=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",OV=I_&&window.location.href||"http://localhost",NV=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:I_,hasStandardBrowserEnv:_V,hasStandardBrowserWebWorkerEnv:AV,navigator:C1,origin:OV},Symbol.toStringTag,{value:"Module"})),Ln={...NV,...jV};function EV(e,t){return fv(e,new Ln.classes.URLSearchParams,{visitor:function(n,r,a,o){return Ln.isNode&&ce.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function TV(e){return ce.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function CV(e){const t={},n=Object.keys(e);let r;const a=n.length;let o;for(r=0;r=n.length;return l=!l&&ce.isArray(a)?a.length:l,d?(ce.hasOwnProp(a,l)?a[l]=[a[l],r]:a[l]=r,!u):((!a[l]||!ce.isObject(a[l]))&&(a[l]=[]),t(n,r,a[l],o)&&ce.isArray(a[l])&&(a[l]=CV(a[l])),!u)}if(ce.isFormData(e)&&ce.isFunction(e.entries)){const n={};return ce.forEachEntry(e,(r,a)=>{t(TV(r),a,n,0)}),n}return null}function RV(e,t,n){if(ce.isString(e))try{return(t||JSON.parse)(e),ce.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const gd={transitional:U$,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",a=r.indexOf("application/json")>-1,o=ce.isObject(t);if(o&&ce.isHTMLForm(t)&&(t=new FormData(t)),ce.isFormData(t))return a?JSON.stringify(F$(t)):t;if(ce.isArrayBuffer(t)||ce.isBuffer(t)||ce.isStream(t)||ce.isFile(t)||ce.isBlob(t)||ce.isReadableStream(t))return t;if(ce.isArrayBufferView(t))return t.buffer;if(ce.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let u;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return EV(t,this.formSerializer).toString();if((u=ce.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return fv(u?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||a?(n.setContentType("application/json",!1),RV(t)):t}],transformResponse:[function(t){const n=this.transitional||gd.transitional,r=n&&n.forcedJSONParsing,a=this.responseType==="json";if(ce.isResponse(t)||ce.isReadableStream(t))return t;if(t&&ce.isString(t)&&(r&&!this.responseType||a)){const l=!(n&&n.silentJSONParsing)&&a;try{return JSON.parse(t,this.parseReviver)}catch(u){if(l)throw u.name==="SyntaxError"?Ke.from(u,Ke.ERR_BAD_RESPONSE,this,null,this.response):u}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Ln.classes.FormData,Blob:Ln.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};ce.forEach(["delete","get","head","post","put","patch"],e=>{gd.headers[e]={}});const PV=ce.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),kV=e=>{const t={};let n,r,a;return e&&e.split(` `).forEach(function(l){a=l.indexOf(":"),n=l.substring(0,a).trim().toLowerCase(),r=l.substring(a+1).trim(),!(!n||t[n]&&PV[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},h2=Symbol("internals");function Yu(e){return e&&String(e).trim().toLowerCase()}function Pp(e){return e===!1||e==null?e:ce.isArray(e)?e.map(Pp):String(e)}function MV(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const DV=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function Jx(e,t,n,r,a){if(ce.isFunction(r))return r.call(this,t,n);if(a&&(t=n),!!ce.isString(t)){if(ce.isString(r))return t.indexOf(r)!==-1;if(ce.isRegExp(r))return r.test(t)}}function LV(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function $V(e,t){const n=ce.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(a,o,l){return this[r].call(this,t,a,o,l)},configurable:!0})})}let ar=class{constructor(t){t&&this.set(t)}set(t,n,r){const a=this;function o(u,d,h){const p=Yu(d);if(!p)throw new Error("header name must be a non-empty string");const v=ce.findKey(a,p);(!v||a[v]===void 0||h===!0||h===void 0&&a[v]!==!1)&&(a[v||d]=Pp(u))}const l=(u,d)=>ce.forEach(u,(h,p)=>o(h,p,d));if(ce.isPlainObject(t)||t instanceof this.constructor)l(t,n);else if(ce.isString(t)&&(t=t.trim())&&!DV(t))l(kV(t),n);else if(ce.isObject(t)&&ce.isIterable(t)){let u={},d,h;for(const p of t){if(!ce.isArray(p))throw TypeError("Object iterator must return a key-value pair");u[h=p[0]]=(d=u[h])?ce.isArray(d)?[...d,p[1]]:[d,p[1]]:p[1]}l(u,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=Yu(t),t){const r=ce.findKey(this,t);if(r){const a=this[r];if(!n)return a;if(n===!0)return MV(a);if(ce.isFunction(n))return n.call(this,a,r);if(ce.isRegExp(n))return n.exec(a);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Yu(t),t){const r=ce.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||Jx(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let a=!1;function o(l){if(l=Yu(l),l){const u=ce.findKey(r,l);u&&(!n||Jx(r,r[u],u,n))&&(delete r[u],a=!0)}}return ce.isArray(t)?t.forEach(o):o(t),a}clear(t){const n=Object.keys(this);let r=n.length,a=!1;for(;r--;){const o=n[r];(!t||Jx(this,this[o],o,t,!0))&&(delete this[o],a=!0)}return a}normalize(t){const n=this,r={};return ce.forEach(this,(a,o)=>{const l=ce.findKey(r,o);if(l){n[l]=Pp(a),delete n[o];return}const u=t?LV(o):String(o).trim();u!==o&&delete n[o],n[u]=Pp(a),r[u]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return ce.forEach(this,(r,a)=>{r!=null&&r!==!1&&(n[a]=t&&ce.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(` `)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(a=>r.set(a)),r}static accessor(t){const r=(this[h2]=this[h2]={accessors:{}}).accessors,a=this.prototype;function o(l){const u=Yu(l);r[u]||($V(a,l),r[u]=!0)}return ce.isArray(t)?t.forEach(o):o(t),this}};ar.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);ce.reduceDescriptors(ar.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});ce.freezeMethods(ar);function eb(e,t){const n=this||gd,r=t||n,a=ar.from(r.headers);let o=r.data;return ce.forEach(e,function(u){o=u.call(n,o,a.normalize(),t?t.status:void 0)}),a.normalize(),o}function H$(e){return!!(e&&e.__CANCEL__)}function Cc(e,t,n){Ke.call(this,e??"canceled",Ke.ERR_CANCELED,t,n),this.name="CanceledError"}ce.inherits(Cc,Ke,{__CANCEL__:!0});function V$(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new Ke("Request failed with status code "+n.status,[Ke.ERR_BAD_REQUEST,Ke.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function IV(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function zV(e,t){e=e||10;const n=new Array(e),r=new Array(e);let a=0,o=0,l;return t=t!==void 0?t:1e3,function(d){const h=Date.now(),p=r[o];l||(l=h),n[a]=d,r[a]=h;let v=o,g=0;for(;v!==a;)g+=n[v++],v=v%e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),h-l{n=p,a=null,o&&(clearTimeout(o),o=null),e(...h)};return[(...h)=>{const p=Date.now(),v=p-n;v>=r?l(h,p):(a=h,o||(o=setTimeout(()=>{o=null,l(a)},r-v)))},()=>a&&l(a)]}const Kp=(e,t,n=3)=>{let r=0;const a=zV(50,250);return BV(o=>{const l=o.loaded,u=o.lengthComputable?o.total:void 0,d=l-r,h=a(d),p=l<=u;r=l;const v={loaded:l,total:u,progress:u?l/u:void 0,bytes:d,rate:h||void 0,estimated:h&&u&&p?(u-l)/h:void 0,event:o,lengthComputable:u!=null,[t?"download":"upload"]:!0};e(v)},n)},p2=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},m2=e=>(...t)=>ce.asap(()=>e(...t)),qV=Ln.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Ln.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Ln.origin),Ln.navigator&&/(msie|trident)/i.test(Ln.navigator.userAgent)):()=>!0,UV=Ln.hasStandardBrowserEnv?{write(e,t,n,r,a,o,l){if(typeof document>"u")return;const u=[`${e}=${encodeURIComponent(t)}`];ce.isNumber(n)&&u.push(`expires=${new Date(n).toUTCString()}`),ce.isString(r)&&u.push(`path=${r}`),ce.isString(a)&&u.push(`domain=${a}`),o===!0&&u.push("secure"),ce.isString(l)&&u.push(`SameSite=${l}`),document.cookie=u.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function FV(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function HV(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function G$(e,t,n){let r=!FV(t);return e&&(r||n==!1)?HV(e,t):t}const v2=e=>e instanceof ar?{...e}:e;function ps(e,t){t=t||{};const n={};function r(h,p,v,g){return ce.isPlainObject(h)&&ce.isPlainObject(p)?ce.merge.call({caseless:g},h,p):ce.isPlainObject(p)?ce.merge({},p):ce.isArray(p)?p.slice():p}function a(h,p,v,g){if(ce.isUndefined(p)){if(!ce.isUndefined(h))return r(void 0,h,v,g)}else return r(h,p,v,g)}function o(h,p){if(!ce.isUndefined(p))return r(void 0,p)}function l(h,p){if(ce.isUndefined(p)){if(!ce.isUndefined(h))return r(void 0,h)}else return r(void 0,p)}function u(h,p,v){if(v in t)return r(h,p);if(v in e)return r(void 0,h)}const d={url:o,method:o,data:o,baseURL:l,transformRequest:l,transformResponse:l,paramsSerializer:l,timeout:l,timeoutMessage:l,withCredentials:l,withXSRFToken:l,adapter:l,responseType:l,xsrfCookieName:l,xsrfHeaderName:l,onUploadProgress:l,onDownloadProgress:l,decompress:l,maxContentLength:l,maxBodyLength:l,beforeRedirect:l,transport:l,httpAgent:l,httpsAgent:l,cancelToken:l,socketPath:l,responseEncoding:l,validateStatus:u,headers:(h,p,v)=>a(v2(h),v2(p),v,!0)};return ce.forEach(Object.keys({...e,...t}),function(p){const v=d[p]||a,g=v(e[p],t[p],p);ce.isUndefined(g)&&v!==u||(n[p]=g)}),n}const K$=e=>{const t=ps({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:a,xsrfCookieName:o,headers:l,auth:u}=t;if(t.headers=l=ar.from(l),t.url=q$(G$(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),u&&l.set("Authorization","Basic "+btoa((u.username||"")+":"+(u.password?unescape(encodeURIComponent(u.password)):""))),ce.isFormData(n)){if(Ln.hasStandardBrowserEnv||Ln.hasStandardBrowserWebWorkerEnv)l.setContentType(void 0);else if(ce.isFunction(n.getHeaders)){const d=n.getHeaders(),h=["content-type","content-length"];Object.entries(d).forEach(([p,v])=>{h.includes(p.toLowerCase())&&l.set(p,v)})}}if(Ln.hasStandardBrowserEnv&&(r&&ce.isFunction(r)&&(r=r(t)),r||r!==!1&&qV(t.url))){const d=a&&o&&UV.read(o);d&&l.set(a,d)}return t},VV=typeof XMLHttpRequest<"u",GV=VV&&function(e){return new Promise(function(n,r){const a=K$(e);let o=a.data;const l=ar.from(a.headers).normalize();let{responseType:u,onUploadProgress:d,onDownloadProgress:h}=a,p,v,g,y,j;function b(){y&&y(),j&&j(),a.cancelToken&&a.cancelToken.unsubscribe(p),a.signal&&a.signal.removeEventListener("abort",p)}let w=new XMLHttpRequest;w.open(a.method.toUpperCase(),a.url,!0),w.timeout=a.timeout;function A(){if(!w)return;const N=ar.from("getAllResponseHeaders"in w&&w.getAllResponseHeaders()),E={data:!u||u==="text"||u==="json"?w.responseText:w.response,status:w.status,statusText:w.statusText,headers:N,config:e,request:w};V$(function(R){n(R),b()},function(R){r(R),b()},E),w=null}"onloadend"in w?w.onloadend=A:w.onreadystatechange=function(){!w||w.readyState!==4||w.status===0&&!(w.responseURL&&w.responseURL.indexOf("file:")===0)||setTimeout(A)},w.onabort=function(){w&&(r(new Ke("Request aborted",Ke.ECONNABORTED,e,w)),w=null)},w.onerror=function(T){const E=T&&T.message?T.message:"Network Error",C=new Ke(E,Ke.ERR_NETWORK,e,w);C.event=T||null,r(C),w=null},w.ontimeout=function(){let T=a.timeout?"timeout of "+a.timeout+"ms exceeded":"timeout exceeded";const E=a.transitional||U$;a.timeoutErrorMessage&&(T=a.timeoutErrorMessage),r(new Ke(T,E.clarifyTimeoutError?Ke.ETIMEDOUT:Ke.ECONNABORTED,e,w)),w=null},o===void 0&&l.setContentType(null),"setRequestHeader"in w&&ce.forEach(l.toJSON(),function(T,E){w.setRequestHeader(E,T)}),ce.isUndefined(a.withCredentials)||(w.withCredentials=!!a.withCredentials),u&&u!=="json"&&(w.responseType=a.responseType),h&&([g,j]=Kp(h,!0),w.addEventListener("progress",g)),d&&w.upload&&([v,y]=Kp(d),w.upload.addEventListener("progress",v),w.upload.addEventListener("loadend",y)),(a.cancelToken||a.signal)&&(p=N=>{w&&(r(!N||N.type?new Cc(null,e,w):N),w.abort(),w=null)},a.cancelToken&&a.cancelToken.subscribe(p),a.signal&&(a.signal.aborted?p():a.signal.addEventListener("abort",p)));const O=IV(a.url);if(O&&Ln.protocols.indexOf(O)===-1){r(new Ke("Unsupported protocol "+O+":",Ke.ERR_BAD_REQUEST,e));return}w.send(o||null)})},KV=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,a;const o=function(h){if(!a){a=!0,u();const p=h instanceof Error?h:this.reason;r.abort(p instanceof Ke?p:new Cc(p instanceof Error?p.message:p))}};let l=t&&setTimeout(()=>{l=null,o(new Ke(`timeout ${t} of ms exceeded`,Ke.ETIMEDOUT))},t);const u=()=>{e&&(l&&clearTimeout(l),l=null,e.forEach(h=>{h.unsubscribe?h.unsubscribe(o):h.removeEventListener("abort",o)}),e=null)};e.forEach(h=>h.addEventListener("abort",o));const{signal:d}=r;return d.unsubscribe=()=>ce.asap(u),d}},WV=function*(e,t){let n=e.byteLength;if(n{const a=YV(e,t);let o=0,l,u=d=>{l||(l=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:h,value:p}=await a.next();if(h){u(),d.close();return}let v=p.byteLength;if(n){let g=o+=v;n(g)}d.enqueue(new Uint8Array(p))}catch(h){throw u(h),h}},cancel(d){return u(d),a.return()}},{highWaterMark:2})},y2=64*1024,{isFunction:op}=ce,ZV=(({Request:e,Response:t})=>({Request:e,Response:t}))(ce.global),{ReadableStream:x2,TextEncoder:b2}=ce.global,w2=(e,...t)=>{try{return!!e(...t)}catch{return!1}},QV=e=>{e=ce.merge.call({skipUndefined:!0},ZV,e);const{fetch:t,Request:n,Response:r}=e,a=t?op(t):typeof fetch=="function",o=op(n),l=op(r);if(!a)return!1;const u=a&&op(x2),d=a&&(typeof b2=="function"?(j=>b=>j.encode(b))(new b2):async j=>new Uint8Array(await new n(j).arrayBuffer())),h=o&&u&&w2(()=>{let j=!1;const b=new n(Ln.origin,{body:new x2,method:"POST",get duplex(){return j=!0,"half"}}).headers.has("Content-Type");return j&&!b}),p=l&&u&&w2(()=>ce.isReadableStream(new r("").body)),v={stream:p&&(j=>j.body)};a&&["text","arrayBuffer","blob","formData","stream"].forEach(j=>{!v[j]&&(v[j]=(b,w)=>{let A=b&&b[j];if(A)return A.call(b);throw new Ke(`Response type '${j}' is not supported`,Ke.ERR_NOT_SUPPORT,w)})});const g=async j=>{if(j==null)return 0;if(ce.isBlob(j))return j.size;if(ce.isSpecCompliantForm(j))return(await new n(Ln.origin,{method:"POST",body:j}).arrayBuffer()).byteLength;if(ce.isArrayBufferView(j)||ce.isArrayBuffer(j))return j.byteLength;if(ce.isURLSearchParams(j)&&(j=j+""),ce.isString(j))return(await d(j)).byteLength},y=async(j,b)=>{const w=ce.toFiniteNumber(j.getContentLength());return w??g(b)};return async j=>{let{url:b,method:w,data:A,signal:O,cancelToken:N,timeout:T,onDownloadProgress:E,onUploadProgress:C,responseType:R,headers:k,withCredentials:M="same-origin",fetchOptions:U}=K$(j),$=t||fetch;R=R?(R+"").toLowerCase():"text";let z=KV([O,N&&N.toAbortSignal()],T),V=null;const F=z&&z.unsubscribe&&(()=>{z.unsubscribe()});let G;try{if(C&&h&&w!=="get"&&w!=="head"&&(G=await y(k,A))!==0){let I=new n(b,{method:"POST",body:A,duplex:"half"}),B;if(ce.isFormData(A)&&(B=I.headers.get("content-type"))&&k.setContentType(B),I.body){const[Y,te]=p2(G,Kp(m2(C)));A=g2(I.body,y2,Y,te)}}ce.isString(M)||(M=M?"include":"omit");const L=o&&"credentials"in n.prototype,q={...U,signal:z,method:w.toUpperCase(),headers:k.normalize().toJSON(),body:A,duplex:"half",credentials:L?M:void 0};V=o&&new n(b,q);let H=await(o?$(V,U):$(b,q));const ee=p&&(R==="stream"||R==="response");if(p&&(E||ee&&F)){const I={};["status","statusText","headers"].forEach(le=>{I[le]=H[le]});const B=ce.toFiniteNumber(H.headers.get("content-length")),[Y,te]=E&&p2(B,Kp(m2(E),!0))||[];H=new r(g2(H.body,y2,Y,()=>{te&&te(),F&&F()}),I)}R=R||"text";let ve=await v[ce.findKey(v,R)||"text"](H,j);return!ee&&F&&F(),await new Promise((I,B)=>{V$(I,B,{data:ve,headers:ar.from(H.headers),status:H.status,statusText:H.statusText,config:j,request:V})})}catch(L){throw F&&F(),L&&L.name==="TypeError"&&/Load failed|fetch/i.test(L.message)?Object.assign(new Ke("Network Error",Ke.ERR_NETWORK,j,V),{cause:L.cause||L}):Ke.from(L,L&&L.code,j,V)}}},JV=new Map,W$=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:a}=t,o=[r,a,n];let l=o.length,u=l,d,h,p=JV;for(;u--;)d=o[u],h=p.get(d),h===void 0&&p.set(d,h=u?new Map:QV(t)),p=h;return h};W$();const z_={http:vV,xhr:GV,fetch:{get:W$}};ce.forEach(z_,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const S2=e=>`- ${e}`,eG=e=>ce.isFunction(e)||e===null||e===!1;function tG(e,t){e=ce.isArray(e)?e:[e];const{length:n}=e;let r,a;const o={};for(let l=0;l`adapter ${d} `+(h===!1?"is not supported by the environment":"is not available in the build"));let u=n?l.length>1?`since : `+l.map(S2).join(` `):" "+S2(l[0]):"as no adapter specified";throw new Ke("There is no suitable adapter to dispatch the request "+u,"ERR_NOT_SUPPORT")}return a}const Y$={getAdapter:tG,adapters:z_};function tb(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Cc(null,e)}function j2(e){return tb(e),e.headers=ar.from(e.headers),e.data=eb.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Y$.getAdapter(e.adapter||gd.adapter,e)(e).then(function(r){return tb(e),r.data=eb.call(e,e.transformResponse,r),r.headers=ar.from(r.headers),r},function(r){return H$(r)||(tb(e),r&&r.response&&(r.response.data=eb.call(e,e.transformResponse,r.response),r.response.headers=ar.from(r.response.headers))),Promise.reject(r)})}const X$="1.13.2",dv={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{dv[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const _2={};dv.transitional=function(t,n,r){function a(o,l){return"[Axios v"+X$+"] Transitional option '"+o+"'"+l+(r?". "+r:"")}return(o,l,u)=>{if(t===!1)throw new Ke(a(l," has been removed"+(n?" in "+n:"")),Ke.ERR_DEPRECATED);return n&&!_2[l]&&(_2[l]=!0,console.warn(a(l," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,l,u):!0}};dv.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function nG(e,t,n){if(typeof e!="object")throw new Ke("options must be an object",Ke.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let a=r.length;for(;a-- >0;){const o=r[a],l=t[o];if(l){const u=e[o],d=u===void 0||l(u,o,e);if(d!==!0)throw new Ke("option "+o+" must be "+d,Ke.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new Ke("Unknown option "+o,Ke.ERR_BAD_OPTION)}}const kp={assertOptions:nG,validators:dv},Na=kp.validators;let ls=class{constructor(t){this.defaults=t||{},this.interceptors={request:new d2,response:new d2}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let a={};Error.captureStackTrace?Error.captureStackTrace(a):a=new Error;const o=a.stack?a.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=` `+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=ps(this.defaults,n);const{transitional:r,paramsSerializer:a,headers:o}=n;r!==void 0&&kp.assertOptions(r,{silentJSONParsing:Na.transitional(Na.boolean),forcedJSONParsing:Na.transitional(Na.boolean),clarifyTimeoutError:Na.transitional(Na.boolean)},!1),a!=null&&(ce.isFunction(a)?n.paramsSerializer={serialize:a}:kp.assertOptions(a,{encode:Na.function,serialize:Na.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),kp.assertOptions(n,{baseUrl:Na.spelling("baseURL"),withXsrfToken:Na.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let l=o&&ce.merge(o.common,o[n.method]);o&&ce.forEach(["delete","get","head","post","put","patch","common"],j=>{delete o[j]}),n.headers=ar.concat(l,o);const u=[];let d=!0;this.interceptors.request.forEach(function(b){typeof b.runWhen=="function"&&b.runWhen(n)===!1||(d=d&&b.synchronous,u.unshift(b.fulfilled,b.rejected))});const h=[];this.interceptors.response.forEach(function(b){h.push(b.fulfilled,b.rejected)});let p,v=0,g;if(!d){const j=[j2.bind(this),void 0];for(j.unshift(...u),j.push(...h),g=j.length,p=Promise.resolve(n);v{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](a);r._listeners=null}),this.promise.then=a=>{let o;const l=new Promise(u=>{r.subscribe(u),o=u}).then(a);return l.cancel=function(){r.unsubscribe(o)},l},t(function(o,l,u){r.reason||(r.reason=new Cc(o,l,u),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new Z$(function(a){t=a}),cancel:t}}};function aG(e){return function(n){return e.apply(null,n)}}function iG(e){return ce.isObject(e)&&e.isAxiosError===!0}const R1={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(R1).forEach(([e,t])=>{R1[t]=e});function Q$(e){const t=new ls(e),n=T$(ls.prototype.request,t);return ce.extend(n,ls.prototype,t,{allOwnKeys:!0}),ce.extend(n,t,null,{allOwnKeys:!0}),n.create=function(a){return Q$(ps(e,a))},n}const Ut=Q$(gd);Ut.Axios=ls;Ut.CanceledError=Cc;Ut.CancelToken=rG;Ut.isCancel=H$;Ut.VERSION=X$;Ut.toFormData=fv;Ut.AxiosError=Ke;Ut.Cancel=Ut.CanceledError;Ut.all=function(t){return Promise.all(t)};Ut.spread=aG;Ut.isAxiosError=iG;Ut.mergeConfig=ps;Ut.AxiosHeaders=ar;Ut.formToJSON=e=>F$(ce.isHTMLForm(e)?new FormData(e):e);Ut.getAdapter=Y$.getAdapter;Ut.HttpStatusCode=R1;Ut.default=Ut;const{Axios:Ebe,AxiosError:Tbe,CanceledError:Cbe,isCancel:Rbe,CancelToken:Pbe,VERSION:kbe,all:Mbe,Cancel:Dbe,isAxiosError:Lbe,spread:$be,toFormData:Ibe,AxiosHeaders:zbe,HttpStatusCode:Bbe,formToJSON:qbe,getAdapter:Ube,mergeConfig:Fbe}=Ut;function J$(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var a=e.length;for(t=0;t{const n=new Array(e.length+t.length);for(let r=0;r({classGroupId:e,validator:t}),e3=(e=new Map,t=null,n)=>({nextPart:e,validators:t,classGroupId:n}),Wp="-",A2=[],lG="arbitrary..",cG=e=>{const t=fG(e),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=e;return{getClassGroupId:l=>{if(l.startsWith("[")&&l.endsWith("]"))return uG(l);const u=l.split(Wp),d=u[0]===""&&u.length>1?1:0;return t3(u,d,t)},getConflictingClassGroupIds:(l,u)=>{if(u){const d=r[l],h=n[l];return d?h?oG(h,d):d:h||A2}return n[l]||A2}}},t3=(e,t,n)=>{if(e.length-t===0)return n.classGroupId;const a=e[t],o=n.nextPart.get(a);if(o){const h=t3(e,t+1,o);if(h)return h}const l=n.validators;if(l===null)return;const u=t===0?e.join(Wp):e.slice(t).join(Wp),d=l.length;for(let h=0;he.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const t=e.slice(1,-1),n=t.indexOf(":"),r=t.slice(0,n);return r?lG+r:void 0})(),fG=e=>{const{theme:t,classGroups:n}=e;return dG(n,t)},dG=(e,t)=>{const n=e3();for(const r in e){const a=e[r];B_(a,n,r,t)}return n},B_=(e,t,n,r)=>{const a=e.length;for(let o=0;o{if(typeof e=="string"){pG(e,t,n);return}if(typeof e=="function"){mG(e,t,n,r);return}vG(e,t,n,r)},pG=(e,t,n)=>{const r=e===""?t:n3(t,e);r.classGroupId=n},mG=(e,t,n,r)=>{if(gG(e)){B_(e(r),t,n,r);return}t.validators===null&&(t.validators=[]),t.validators.push(sG(n,e))},vG=(e,t,n,r)=>{const a=Object.entries(e),o=a.length;for(let l=0;l{let n=e;const r=t.split(Wp),a=r.length;for(let o=0;o"isThemeGetter"in e&&e.isThemeGetter===!0,yG=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,n=Object.create(null),r=Object.create(null);const a=(o,l)=>{n[o]=l,t++,t>e&&(t=0,r=n,n=Object.create(null))};return{get(o){let l=n[o];if(l!==void 0)return l;if((l=r[o])!==void 0)return a(o,l),l},set(o,l){o in n?n[o]=l:a(o,l)}}},P1="!",O2=":",xG=[],N2=(e,t,n,r,a)=>({modifiers:e,hasImportantModifier:t,baseClassName:n,maybePostfixModifierPosition:r,isExternal:a}),bG=e=>{const{prefix:t,experimentalParseClassName:n}=e;let r=a=>{const o=[];let l=0,u=0,d=0,h;const p=a.length;for(let b=0;bd?h-d:void 0;return N2(o,y,g,j)};if(t){const a=t+O2,o=r;r=l=>l.startsWith(a)?o(l.slice(a.length)):N2(xG,!1,l,void 0,!0)}if(n){const a=r;r=o=>n({className:o,parseClassName:a})}return r},wG=e=>{const t=new Map;return e.orderSensitiveModifiers.forEach((n,r)=>{t.set(n,1e6+r)}),n=>{const r=[];let a=[];for(let o=0;o0&&(a.sort(),r.push(...a),a=[]),r.push(l)):a.push(l)}return a.length>0&&(a.sort(),r.push(...a)),r}},SG=e=>({cache:yG(e.cacheSize),parseClassName:bG(e),sortModifiers:wG(e),...cG(e)}),jG=/\s+/,_G=(e,t)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:a,sortModifiers:o}=t,l=[],u=e.trim().split(jG);let d="";for(let h=u.length-1;h>=0;h-=1){const p=u[h],{isExternal:v,modifiers:g,hasImportantModifier:y,baseClassName:j,maybePostfixModifierPosition:b}=n(p);if(v){d=p+(d.length>0?" "+d:d);continue}let w=!!b,A=r(w?j.substring(0,b):j);if(!A){if(!w){d=p+(d.length>0?" "+d:d);continue}if(A=r(j),!A){d=p+(d.length>0?" "+d:d);continue}w=!1}const O=g.length===0?"":g.length===1?g[0]:o(g).join(":"),N=y?O+P1:O,T=N+A;if(l.indexOf(T)>-1)continue;l.push(T);const E=a(A,w);for(let C=0;C0?" "+d:d)}return d},AG=(...e)=>{let t=0,n,r,a="";for(;t{if(typeof e=="string")return e;let t,n="";for(let r=0;r{let n,r,a,o;const l=d=>{const h=t.reduce((p,v)=>v(p),e());return n=SG(h),r=n.cache.get,a=n.cache.set,o=u,u(d)},u=d=>{const h=r(d);if(h)return h;const p=_G(d,n);return a(d,p),p};return o=l,(...d)=>o(AG(...d))},NG=[],Zt=e=>{const t=n=>n[e]||NG;return t.isThemeGetter=!0,t},a3=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,i3=/^\((?:(\w[\w-]*):)?(.+)\)$/i,EG=/^\d+\/\d+$/,TG=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,CG=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,RG=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,PG=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,kG=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,wl=e=>EG.test(e),Ye=e=>!!e&&!Number.isNaN(Number(e)),io=e=>!!e&&Number.isInteger(Number(e)),nb=e=>e.endsWith("%")&&Ye(e.slice(0,-1)),fi=e=>TG.test(e),MG=()=>!0,DG=e=>CG.test(e)&&!RG.test(e),o3=()=>!1,LG=e=>PG.test(e),$G=e=>kG.test(e),IG=e=>!Te(e)&&!Ce(e),zG=e=>Rc(e,c3,o3),Te=e=>a3.test(e),Ko=e=>Rc(e,u3,DG),rb=e=>Rc(e,HG,Ye),E2=e=>Rc(e,s3,o3),BG=e=>Rc(e,l3,$G),sp=e=>Rc(e,f3,LG),Ce=e=>i3.test(e),Xu=e=>Pc(e,u3),qG=e=>Pc(e,VG),T2=e=>Pc(e,s3),UG=e=>Pc(e,c3),FG=e=>Pc(e,l3),lp=e=>Pc(e,f3,!0),Rc=(e,t,n)=>{const r=a3.exec(e);return r?r[1]?t(r[1]):n(r[2]):!1},Pc=(e,t,n=!1)=>{const r=i3.exec(e);return r?r[1]?t(r[1]):n:!1},s3=e=>e==="position"||e==="percentage",l3=e=>e==="image"||e==="url",c3=e=>e==="length"||e==="size"||e==="bg-size",u3=e=>e==="length",HG=e=>e==="number",VG=e=>e==="family-name",f3=e=>e==="shadow",GG=()=>{const e=Zt("color"),t=Zt("font"),n=Zt("text"),r=Zt("font-weight"),a=Zt("tracking"),o=Zt("leading"),l=Zt("breakpoint"),u=Zt("container"),d=Zt("spacing"),h=Zt("radius"),p=Zt("shadow"),v=Zt("inset-shadow"),g=Zt("text-shadow"),y=Zt("drop-shadow"),j=Zt("blur"),b=Zt("perspective"),w=Zt("aspect"),A=Zt("ease"),O=Zt("animate"),N=()=>["auto","avoid","all","avoid-page","page","left","right","column"],T=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],E=()=>[...T(),Ce,Te],C=()=>["auto","hidden","clip","visible","scroll"],R=()=>["auto","contain","none"],k=()=>[Ce,Te,d],M=()=>[wl,"full","auto",...k()],U=()=>[io,"none","subgrid",Ce,Te],$=()=>["auto",{span:["full",io,Ce,Te]},io,Ce,Te],z=()=>[io,"auto",Ce,Te],V=()=>["auto","min","max","fr",Ce,Te],F=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],G=()=>["start","end","center","stretch","center-safe","end-safe"],L=()=>["auto",...k()],q=()=>[wl,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...k()],H=()=>[e,Ce,Te],ee=()=>[...T(),T2,E2,{position:[Ce,Te]}],ve=()=>["no-repeat",{repeat:["","x","y","space","round"]}],I=()=>["auto","cover","contain",UG,zG,{size:[Ce,Te]}],B=()=>[nb,Xu,Ko],Y=()=>["","none","full",h,Ce,Te],te=()=>["",Ye,Xu,Ko],le=()=>["solid","dashed","dotted","double"],xe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],Q=()=>[Ye,nb,T2,E2],ne=()=>["","none",j,Ce,Te],X=()=>["none",Ye,Ce,Te],de=()=>["none",Ye,Ce,Te],be=()=>[Ye,Ce,Te],oe=()=>[wl,"full",...k()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[fi],breakpoint:[fi],color:[MG],container:[fi],"drop-shadow":[fi],ease:["in","out","in-out"],font:[IG],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[fi],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[fi],shadow:[fi],spacing:["px",Ye],text:[fi],"text-shadow":[fi],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",wl,Te,Ce,w]}],container:["container"],columns:[{columns:[Ye,Te,Ce,u]}],"break-after":[{"break-after":N()}],"break-before":[{"break-before":N()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:E()}],overflow:[{overflow:C()}],"overflow-x":[{"overflow-x":C()}],"overflow-y":[{"overflow-y":C()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:M()}],"inset-x":[{"inset-x":M()}],"inset-y":[{"inset-y":M()}],start:[{start:M()}],end:[{end:M()}],top:[{top:M()}],right:[{right:M()}],bottom:[{bottom:M()}],left:[{left:M()}],visibility:["visible","invisible","collapse"],z:[{z:[io,"auto",Ce,Te]}],basis:[{basis:[wl,"full","auto",u,...k()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ye,wl,"auto","initial","none",Te]}],grow:[{grow:["",Ye,Ce,Te]}],shrink:[{shrink:["",Ye,Ce,Te]}],order:[{order:[io,"first","last","none",Ce,Te]}],"grid-cols":[{"grid-cols":U()}],"col-start-end":[{col:$()}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":U()}],"row-start-end":[{row:$()}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":V()}],"auto-rows":[{"auto-rows":V()}],gap:[{gap:k()}],"gap-x":[{"gap-x":k()}],"gap-y":[{"gap-y":k()}],"justify-content":[{justify:[...F(),"normal"]}],"justify-items":[{"justify-items":[...G(),"normal"]}],"justify-self":[{"justify-self":["auto",...G()]}],"align-content":[{content:["normal",...F()]}],"align-items":[{items:[...G(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...G(),{baseline:["","last"]}]}],"place-content":[{"place-content":F()}],"place-items":[{"place-items":[...G(),"baseline"]}],"place-self":[{"place-self":["auto",...G()]}],p:[{p:k()}],px:[{px:k()}],py:[{py:k()}],ps:[{ps:k()}],pe:[{pe:k()}],pt:[{pt:k()}],pr:[{pr:k()}],pb:[{pb:k()}],pl:[{pl:k()}],m:[{m:L()}],mx:[{mx:L()}],my:[{my:L()}],ms:[{ms:L()}],me:[{me:L()}],mt:[{mt:L()}],mr:[{mr:L()}],mb:[{mb:L()}],ml:[{ml:L()}],"space-x":[{"space-x":k()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":k()}],"space-y-reverse":["space-y-reverse"],size:[{size:q()}],w:[{w:[u,"screen",...q()]}],"min-w":[{"min-w":[u,"screen","none",...q()]}],"max-w":[{"max-w":[u,"screen","none","prose",{screen:[l]},...q()]}],h:[{h:["screen","lh",...q()]}],"min-h":[{"min-h":["screen","lh","none",...q()]}],"max-h":[{"max-h":["screen","lh",...q()]}],"font-size":[{text:["base",n,Xu,Ko]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[r,Ce,rb]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",nb,Te]}],"font-family":[{font:[qG,Te,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[a,Ce,Te]}],"line-clamp":[{"line-clamp":[Ye,"none",Ce,rb]}],leading:[{leading:[o,...k()]}],"list-image":[{"list-image":["none",Ce,Te]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ce,Te]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:H()}],"text-color":[{text:H()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...le(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ye,"from-font","auto",Ce,Ko]}],"text-decoration-color":[{decoration:H()}],"underline-offset":[{"underline-offset":[Ye,"auto",Ce,Te]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:k()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ce,Te]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ce,Te]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:ee()}],"bg-repeat":[{bg:ve()}],"bg-size":[{bg:I()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},io,Ce,Te],radial:["",Ce,Te],conic:[io,Ce,Te]},FG,BG]}],"bg-color":[{bg:H()}],"gradient-from-pos":[{from:B()}],"gradient-via-pos":[{via:B()}],"gradient-to-pos":[{to:B()}],"gradient-from":[{from:H()}],"gradient-via":[{via:H()}],"gradient-to":[{to:H()}],rounded:[{rounded:Y()}],"rounded-s":[{"rounded-s":Y()}],"rounded-e":[{"rounded-e":Y()}],"rounded-t":[{"rounded-t":Y()}],"rounded-r":[{"rounded-r":Y()}],"rounded-b":[{"rounded-b":Y()}],"rounded-l":[{"rounded-l":Y()}],"rounded-ss":[{"rounded-ss":Y()}],"rounded-se":[{"rounded-se":Y()}],"rounded-ee":[{"rounded-ee":Y()}],"rounded-es":[{"rounded-es":Y()}],"rounded-tl":[{"rounded-tl":Y()}],"rounded-tr":[{"rounded-tr":Y()}],"rounded-br":[{"rounded-br":Y()}],"rounded-bl":[{"rounded-bl":Y()}],"border-w":[{border:te()}],"border-w-x":[{"border-x":te()}],"border-w-y":[{"border-y":te()}],"border-w-s":[{"border-s":te()}],"border-w-e":[{"border-e":te()}],"border-w-t":[{"border-t":te()}],"border-w-r":[{"border-r":te()}],"border-w-b":[{"border-b":te()}],"border-w-l":[{"border-l":te()}],"divide-x":[{"divide-x":te()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":te()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...le(),"hidden","none"]}],"divide-style":[{divide:[...le(),"hidden","none"]}],"border-color":[{border:H()}],"border-color-x":[{"border-x":H()}],"border-color-y":[{"border-y":H()}],"border-color-s":[{"border-s":H()}],"border-color-e":[{"border-e":H()}],"border-color-t":[{"border-t":H()}],"border-color-r":[{"border-r":H()}],"border-color-b":[{"border-b":H()}],"border-color-l":[{"border-l":H()}],"divide-color":[{divide:H()}],"outline-style":[{outline:[...le(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ye,Ce,Te]}],"outline-w":[{outline:["",Ye,Xu,Ko]}],"outline-color":[{outline:H()}],shadow:[{shadow:["","none",p,lp,sp]}],"shadow-color":[{shadow:H()}],"inset-shadow":[{"inset-shadow":["none",v,lp,sp]}],"inset-shadow-color":[{"inset-shadow":H()}],"ring-w":[{ring:te()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:H()}],"ring-offset-w":[{"ring-offset":[Ye,Ko]}],"ring-offset-color":[{"ring-offset":H()}],"inset-ring-w":[{"inset-ring":te()}],"inset-ring-color":[{"inset-ring":H()}],"text-shadow":[{"text-shadow":["none",g,lp,sp]}],"text-shadow-color":[{"text-shadow":H()}],opacity:[{opacity:[Ye,Ce,Te]}],"mix-blend":[{"mix-blend":[...xe(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":xe()}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Ye]}],"mask-image-linear-from-pos":[{"mask-linear-from":Q()}],"mask-image-linear-to-pos":[{"mask-linear-to":Q()}],"mask-image-linear-from-color":[{"mask-linear-from":H()}],"mask-image-linear-to-color":[{"mask-linear-to":H()}],"mask-image-t-from-pos":[{"mask-t-from":Q()}],"mask-image-t-to-pos":[{"mask-t-to":Q()}],"mask-image-t-from-color":[{"mask-t-from":H()}],"mask-image-t-to-color":[{"mask-t-to":H()}],"mask-image-r-from-pos":[{"mask-r-from":Q()}],"mask-image-r-to-pos":[{"mask-r-to":Q()}],"mask-image-r-from-color":[{"mask-r-from":H()}],"mask-image-r-to-color":[{"mask-r-to":H()}],"mask-image-b-from-pos":[{"mask-b-from":Q()}],"mask-image-b-to-pos":[{"mask-b-to":Q()}],"mask-image-b-from-color":[{"mask-b-from":H()}],"mask-image-b-to-color":[{"mask-b-to":H()}],"mask-image-l-from-pos":[{"mask-l-from":Q()}],"mask-image-l-to-pos":[{"mask-l-to":Q()}],"mask-image-l-from-color":[{"mask-l-from":H()}],"mask-image-l-to-color":[{"mask-l-to":H()}],"mask-image-x-from-pos":[{"mask-x-from":Q()}],"mask-image-x-to-pos":[{"mask-x-to":Q()}],"mask-image-x-from-color":[{"mask-x-from":H()}],"mask-image-x-to-color":[{"mask-x-to":H()}],"mask-image-y-from-pos":[{"mask-y-from":Q()}],"mask-image-y-to-pos":[{"mask-y-to":Q()}],"mask-image-y-from-color":[{"mask-y-from":H()}],"mask-image-y-to-color":[{"mask-y-to":H()}],"mask-image-radial":[{"mask-radial":[Ce,Te]}],"mask-image-radial-from-pos":[{"mask-radial-from":Q()}],"mask-image-radial-to-pos":[{"mask-radial-to":Q()}],"mask-image-radial-from-color":[{"mask-radial-from":H()}],"mask-image-radial-to-color":[{"mask-radial-to":H()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":T()}],"mask-image-conic-pos":[{"mask-conic":[Ye]}],"mask-image-conic-from-pos":[{"mask-conic-from":Q()}],"mask-image-conic-to-pos":[{"mask-conic-to":Q()}],"mask-image-conic-from-color":[{"mask-conic-from":H()}],"mask-image-conic-to-color":[{"mask-conic-to":H()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:ee()}],"mask-repeat":[{mask:ve()}],"mask-size":[{mask:I()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ce,Te]}],filter:[{filter:["","none",Ce,Te]}],blur:[{blur:ne()}],brightness:[{brightness:[Ye,Ce,Te]}],contrast:[{contrast:[Ye,Ce,Te]}],"drop-shadow":[{"drop-shadow":["","none",y,lp,sp]}],"drop-shadow-color":[{"drop-shadow":H()}],grayscale:[{grayscale:["",Ye,Ce,Te]}],"hue-rotate":[{"hue-rotate":[Ye,Ce,Te]}],invert:[{invert:["",Ye,Ce,Te]}],saturate:[{saturate:[Ye,Ce,Te]}],sepia:[{sepia:["",Ye,Ce,Te]}],"backdrop-filter":[{"backdrop-filter":["","none",Ce,Te]}],"backdrop-blur":[{"backdrop-blur":ne()}],"backdrop-brightness":[{"backdrop-brightness":[Ye,Ce,Te]}],"backdrop-contrast":[{"backdrop-contrast":[Ye,Ce,Te]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ye,Ce,Te]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ye,Ce,Te]}],"backdrop-invert":[{"backdrop-invert":["",Ye,Ce,Te]}],"backdrop-opacity":[{"backdrop-opacity":[Ye,Ce,Te]}],"backdrop-saturate":[{"backdrop-saturate":[Ye,Ce,Te]}],"backdrop-sepia":[{"backdrop-sepia":["",Ye,Ce,Te]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":k()}],"border-spacing-x":[{"border-spacing-x":k()}],"border-spacing-y":[{"border-spacing-y":k()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ce,Te]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Ye,"initial",Ce,Te]}],ease:[{ease:["linear","initial",A,Ce,Te]}],delay:[{delay:[Ye,Ce,Te]}],animate:[{animate:["none",O,Ce,Te]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[b,Ce,Te]}],"perspective-origin":[{"perspective-origin":E()}],rotate:[{rotate:X()}],"rotate-x":[{"rotate-x":X()}],"rotate-y":[{"rotate-y":X()}],"rotate-z":[{"rotate-z":X()}],scale:[{scale:de()}],"scale-x":[{"scale-x":de()}],"scale-y":[{"scale-y":de()}],"scale-z":[{"scale-z":de()}],"scale-3d":["scale-3d"],skew:[{skew:be()}],"skew-x":[{"skew-x":be()}],"skew-y":[{"skew-y":be()}],transform:[{transform:[Ce,Te,"","none","gpu","cpu"]}],"transform-origin":[{origin:E()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:oe()}],"translate-x":[{"translate-x":oe()}],"translate-y":[{"translate-y":oe()}],"translate-z":[{"translate-z":oe()}],"translate-none":["translate-none"],accent:[{accent:H()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:H()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ce,Te]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":k()}],"scroll-mx":[{"scroll-mx":k()}],"scroll-my":[{"scroll-my":k()}],"scroll-ms":[{"scroll-ms":k()}],"scroll-me":[{"scroll-me":k()}],"scroll-mt":[{"scroll-mt":k()}],"scroll-mr":[{"scroll-mr":k()}],"scroll-mb":[{"scroll-mb":k()}],"scroll-ml":[{"scroll-ml":k()}],"scroll-p":[{"scroll-p":k()}],"scroll-px":[{"scroll-px":k()}],"scroll-py":[{"scroll-py":k()}],"scroll-ps":[{"scroll-ps":k()}],"scroll-pe":[{"scroll-pe":k()}],"scroll-pt":[{"scroll-pt":k()}],"scroll-pr":[{"scroll-pr":k()}],"scroll-pb":[{"scroll-pb":k()}],"scroll-pl":[{"scroll-pl":k()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ce,Te]}],fill:[{fill:["none",...H()]}],"stroke-w":[{stroke:[Ye,Xu,Ko,rb]}],stroke:[{stroke:["none",...H()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}},KG=OG(GG);function je(...e){return KG(Ve(e))}const Dt=S.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:je("rounded-xl border bg-card text-card-foreground shadow",e),...t}));Dt.displayName="Card";const Lt=S.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:je("flex flex-col space-y-1.5 p-6",e),...t}));Lt.displayName="CardHeader";const $t=S.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:je("font-semibold leading-none tracking-tight",e),...t}));$t.displayName="CardTitle";const tr=S.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:je("text-sm text-muted-foreground",e),...t}));tr.displayName="CardDescription";const cn=S.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:je("p-6 pt-0",e),...t}));cn.displayName="CardContent";const WG=S.forwardRef(({className:e,...t},n)=>c.jsx("div",{ref:n,className:je("flex items-center p-6 pt-0",e),...t}));WG.displayName="CardFooter";function Oe(e,t,{checkForDefaultPrevented:n=!0}={}){return function(a){if(e?.(a),n===!1||!a.defaultPrevented)return t?.(a)}}function YG(e,t){const n=S.createContext(t),r=o=>{const{children:l,...u}=o,d=S.useMemo(()=>u,Object.values(u));return c.jsx(n.Provider,{value:d,children:l})};r.displayName=e+"Provider";function a(o){const l=S.useContext(n);if(l)return l;if(t!==void 0)return t;throw new Error(`\`${o}\` must be used within \`${e}\``)}return[r,a]}function Rr(e,t=[]){let n=[];function r(o,l){const u=S.createContext(l),d=n.length;n=[...n,l];const h=v=>{const{scope:g,children:y,...j}=v,b=g?.[e]?.[d]||u,w=S.useMemo(()=>j,Object.values(j));return c.jsx(b.Provider,{value:w,children:y})};h.displayName=o+"Provider";function p(v,g){const y=g?.[e]?.[d]||u,j=S.useContext(y);if(j)return j;if(l!==void 0)return l;throw new Error(`\`${v}\` must be used within \`${o}\``)}return[h,p]}const a=()=>{const o=n.map(l=>S.createContext(l));return function(u){const d=u?.[e]||o;return S.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return a.scopeName=e,[r,XG(a,...t)]}function XG(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(a=>({useScope:a(),scopeName:a.scopeName}));return function(o){const l=r.reduce((u,{useScope:d,scopeName:h})=>{const v=d(o)[`__scope${h}`];return{...u,...v}},{});return S.useMemo(()=>({[`__scope${t.scopeName}`]:l}),[l])}};return n.scopeName=t.scopeName,n}function C2(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function Qr(...e){return t=>{let n=!1;const r=e.map(a=>{const o=C2(a,t);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let a=0;a{const{children:o,...l}=r,u=S.Children.toArray(o),d=u.find(JG);if(d){const h=d.props.children,p=u.map(v=>v===d?S.Children.count(h)>1?S.Children.only(null):S.isValidElement(h)?h.props.children:null:v);return c.jsx(t,{...l,ref:a,children:S.isValidElement(h)?S.cloneElement(h,void 0,p):null})}return c.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function ZG(e){const t=S.forwardRef((n,r)=>{const{children:a,...o}=n;if(S.isValidElement(a)){const l=tK(a),u=eK(o,a.props);return a.type!==S.Fragment&&(u.ref=r?Qr(r,l):l),S.cloneElement(a,u)}return S.Children.count(a)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var QG=Symbol("radix.slottable");function JG(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===QG}function eK(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function tK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}function hv(e){const t=e+"CollectionProvider",[n,r]=Rr(t),[a,o]=n(t,{collectionRef:{current:null},itemMap:new Map}),l=b=>{const{scope:w,children:A}=b,O=K.useRef(null),N=K.useRef(new Map).current;return c.jsx(a,{scope:w,itemMap:N,collectionRef:O,children:A})};l.displayName=t;const u=e+"CollectionSlot",d=R2(u),h=K.forwardRef((b,w)=>{const{scope:A,children:O}=b,N=o(u,A),T=Fe(w,N.collectionRef);return c.jsx(d,{ref:T,children:O})});h.displayName=u;const p=e+"CollectionItemSlot",v="data-radix-collection-item",g=R2(p),y=K.forwardRef((b,w)=>{const{scope:A,children:O,...N}=b,T=K.useRef(null),E=Fe(w,T),C=o(p,A);return K.useEffect(()=>(C.itemMap.set(T,{ref:T,...N}),()=>void C.itemMap.delete(T))),c.jsx(g,{[v]:"",ref:E,children:O})});y.displayName=p;function j(b){const w=o(e+"CollectionConsumer",b);return K.useCallback(()=>{const O=w.collectionRef.current;if(!O)return[];const N=Array.from(O.querySelectorAll(`[${v}]`));return Array.from(w.itemMap.values()).sort((C,R)=>N.indexOf(C.ref.current)-N.indexOf(R.ref.current))},[w.collectionRef,w.itemMap])}return[{Provider:l,Slot:h,ItemSlot:y},j,r]}var Sn=globalThis?.document?S.useLayoutEffect:()=>{},nK=A_[" useId ".trim().toString()]||(()=>{}),rK=0;function Vn(e){const[t,n]=S.useState(nK());return Sn(()=>{n(r=>r??String(rK++))},[e]),t?`radix-${t}`:""}function aK(e){const t=iK(e),n=S.forwardRef((r,a)=>{const{children:o,...l}=r,u=S.Children.toArray(o),d=u.find(sK);if(d){const h=d.props.children,p=u.map(v=>v===d?S.Children.count(h)>1?S.Children.only(null):S.isValidElement(h)?h.props.children:null:v);return c.jsx(t,{...l,ref:a,children:S.isValidElement(h)?S.cloneElement(h,void 0,p):null})}return c.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function iK(e){const t=S.forwardRef((n,r)=>{const{children:a,...o}=n;if(S.isValidElement(a)){const l=cK(a),u=lK(o,a.props);return a.type!==S.Fragment&&(u.ref=r?Qr(r,l):l),S.cloneElement(a,u)}return S.Children.count(a)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var oK=Symbol("radix.slottable");function sK(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===oK}function lK(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function cK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var uK=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],De=uK.reduce((e,t)=>{const n=aK(`Primitive.${t}`),r=S.forwardRef((a,o)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function d3(e,t){e&&Es.flushSync(()=>e.dispatchEvent(t))}function nn(e){const t=S.useRef(e);return S.useEffect(()=>{t.current=e}),S.useMemo(()=>(...n)=>t.current?.(...n),[])}var fK=A_[" useInsertionEffect ".trim().toString()]||Sn;function za({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[a,o,l]=dK({defaultProp:t,onChange:n}),u=e!==void 0,d=u?e:a;{const p=S.useRef(e!==void 0);S.useEffect(()=>{const v=p.current;v!==u&&console.warn(`${r} is changing from ${v?"controlled":"uncontrolled"} to ${u?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),p.current=u},[u,r])}const h=S.useCallback(p=>{if(u){const v=hK(p)?p(e):p;v!==e&&l.current?.(v)}else o(p)},[u,e,o,l]);return[d,h]}function dK({defaultProp:e,onChange:t}){const[n,r]=S.useState(e),a=S.useRef(n),o=S.useRef(t);return fK(()=>{o.current=t},[t]),S.useEffect(()=>{a.current!==n&&(o.current?.(n),a.current=n)},[n,a]),[n,r,o]}function hK(e){return typeof e=="function"}var pK=S.createContext(void 0);function yd(e){const t=S.useContext(pK);return e||t||"ltr"}var ab="rovingFocusGroup.onEntryFocus",mK={bubbles:!1,cancelable:!0},xd="RovingFocusGroup",[k1,h3,vK]=hv(xd),[gK,p3]=Rr(xd,[vK]),[yK,xK]=gK(xd),m3=S.forwardRef((e,t)=>c.jsx(k1.Provider,{scope:e.__scopeRovingFocusGroup,children:c.jsx(k1.Slot,{scope:e.__scopeRovingFocusGroup,children:c.jsx(bK,{...e,ref:t})})}));m3.displayName=xd;var bK=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,orientation:r,loop:a=!1,dir:o,currentTabStopId:l,defaultCurrentTabStopId:u,onCurrentTabStopIdChange:d,onEntryFocus:h,preventScrollOnEntryFocus:p=!1,...v}=e,g=S.useRef(null),y=Fe(t,g),j=yd(o),[b,w]=za({prop:l,defaultProp:u??null,onChange:d,caller:xd}),[A,O]=S.useState(!1),N=nn(h),T=h3(n),E=S.useRef(!1),[C,R]=S.useState(0);return S.useEffect(()=>{const k=g.current;if(k)return k.addEventListener(ab,N),()=>k.removeEventListener(ab,N)},[N]),c.jsx(yK,{scope:n,orientation:r,dir:j,loop:a,currentTabStopId:b,onItemFocus:S.useCallback(k=>w(k),[w]),onItemShiftTab:S.useCallback(()=>O(!0),[]),onFocusableItemAdd:S.useCallback(()=>R(k=>k+1),[]),onFocusableItemRemove:S.useCallback(()=>R(k=>k-1),[]),children:c.jsx(De.div,{tabIndex:A||C===0?-1:0,"data-orientation":r,...v,ref:y,style:{outline:"none",...e.style},onMouseDown:Oe(e.onMouseDown,()=>{E.current=!0}),onFocus:Oe(e.onFocus,k=>{const M=!E.current;if(k.target===k.currentTarget&&M&&!A){const U=new CustomEvent(ab,mK);if(k.currentTarget.dispatchEvent(U),!U.defaultPrevented){const $=T().filter(L=>L.focusable),z=$.find(L=>L.active),V=$.find(L=>L.id===b),G=[z,V,...$].filter(Boolean).map(L=>L.ref.current);y3(G,p)}}E.current=!1}),onBlur:Oe(e.onBlur,()=>O(!1))})})}),v3="RovingFocusGroupItem",g3=S.forwardRef((e,t)=>{const{__scopeRovingFocusGroup:n,focusable:r=!0,active:a=!1,tabStopId:o,children:l,...u}=e,d=Vn(),h=o||d,p=xK(v3,n),v=p.currentTabStopId===h,g=h3(n),{onFocusableItemAdd:y,onFocusableItemRemove:j,currentTabStopId:b}=p;return S.useEffect(()=>{if(r)return y(),()=>j()},[r,y,j]),c.jsx(k1.ItemSlot,{scope:n,id:h,focusable:r,active:a,children:c.jsx(De.span,{tabIndex:v?0:-1,"data-orientation":p.orientation,...u,ref:t,onMouseDown:Oe(e.onMouseDown,w=>{r?p.onItemFocus(h):w.preventDefault()}),onFocus:Oe(e.onFocus,()=>p.onItemFocus(h)),onKeyDown:Oe(e.onKeyDown,w=>{if(w.key==="Tab"&&w.shiftKey){p.onItemShiftTab();return}if(w.target!==w.currentTarget)return;const A=jK(w,p.orientation,p.dir);if(A!==void 0){if(w.metaKey||w.ctrlKey||w.altKey||w.shiftKey)return;w.preventDefault();let N=g().filter(T=>T.focusable).map(T=>T.ref.current);if(A==="last")N.reverse();else if(A==="prev"||A==="next"){A==="prev"&&N.reverse();const T=N.indexOf(w.currentTarget);N=p.loop?_K(N,T+1):N.slice(T+1)}setTimeout(()=>y3(N))}}),children:typeof l=="function"?l({isCurrentTabStop:v,hasTabStop:b!=null}):l})})});g3.displayName=v3;var wK={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function SK(e,t){return t!=="rtl"?e:e==="ArrowLeft"?"ArrowRight":e==="ArrowRight"?"ArrowLeft":e}function jK(e,t,n){const r=SK(e.key,n);if(!(t==="vertical"&&["ArrowLeft","ArrowRight"].includes(r))&&!(t==="horizontal"&&["ArrowUp","ArrowDown"].includes(r)))return wK[r]}function y3(e,t=!1){const n=document.activeElement;for(const r of e)if(r===n||(r.focus({preventScroll:t}),document.activeElement!==n))return}function _K(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var AK=m3,OK=g3;function NK(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var Pr=e=>{const{present:t,children:n}=e,r=EK(t),a=typeof n=="function"?n({present:r.isPresent}):S.Children.only(n),o=Fe(r.ref,TK(a));return typeof n=="function"||r.isPresent?S.cloneElement(a,{ref:o}):null};Pr.displayName="Presence";function EK(e){const[t,n]=S.useState(),r=S.useRef(null),a=S.useRef(e),o=S.useRef("none"),l=e?"mounted":"unmounted",[u,d]=NK(l,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return S.useEffect(()=>{const h=cp(r.current);o.current=u==="mounted"?h:"none"},[u]),Sn(()=>{const h=r.current,p=a.current;if(p!==e){const g=o.current,y=cp(h);e?d("MOUNT"):y==="none"||h?.display==="none"?d("UNMOUNT"):d(p&&g!==y?"ANIMATION_OUT":"UNMOUNT"),a.current=e}},[e,d]),Sn(()=>{if(t){let h;const p=t.ownerDocument.defaultView??window,v=y=>{const b=cp(r.current).includes(CSS.escape(y.animationName));if(y.target===t&&b&&(d("ANIMATION_END"),!a.current)){const w=t.style.animationFillMode;t.style.animationFillMode="forwards",h=p.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=w)})}},g=y=>{y.target===t&&(o.current=cp(r.current))};return t.addEventListener("animationstart",g),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{p.clearTimeout(h),t.removeEventListener("animationstart",g),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:S.useCallback(h=>{r.current=h?getComputedStyle(h):null,n(h)},[])}}function cp(e){return e?.animationName||"none"}function TK(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var pv="Tabs",[CK]=Rr(pv,[p3]),x3=p3(),[RK,q_]=CK(pv),b3=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,onValueChange:a,defaultValue:o,orientation:l="horizontal",dir:u,activationMode:d="automatic",...h}=e,p=yd(u),[v,g]=za({prop:r,onChange:a,defaultProp:o??"",caller:pv});return c.jsx(RK,{scope:n,baseId:Vn(),value:v,onValueChange:g,orientation:l,dir:p,activationMode:d,children:c.jsx(De.div,{dir:p,"data-orientation":l,...h,ref:t})})});b3.displayName=pv;var w3="TabsList",S3=S.forwardRef((e,t)=>{const{__scopeTabs:n,loop:r=!0,...a}=e,o=q_(w3,n),l=x3(n);return c.jsx(AK,{asChild:!0,...l,orientation:o.orientation,dir:o.dir,loop:r,children:c.jsx(De.div,{role:"tablist","aria-orientation":o.orientation,...a,ref:t})})});S3.displayName=w3;var j3="TabsTrigger",_3=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,disabled:a=!1,...o}=e,l=q_(j3,n),u=x3(n),d=N3(l.baseId,r),h=E3(l.baseId,r),p=r===l.value;return c.jsx(OK,{asChild:!0,...u,focusable:!a,active:p,children:c.jsx(De.button,{type:"button",role:"tab","aria-selected":p,"aria-controls":h,"data-state":p?"active":"inactive","data-disabled":a?"":void 0,disabled:a,id:d,...o,ref:t,onMouseDown:Oe(e.onMouseDown,v=>{!a&&v.button===0&&v.ctrlKey===!1?l.onValueChange(r):v.preventDefault()}),onKeyDown:Oe(e.onKeyDown,v=>{[" ","Enter"].includes(v.key)&&l.onValueChange(r)}),onFocus:Oe(e.onFocus,()=>{const v=l.activationMode!=="manual";!p&&!a&&v&&l.onValueChange(r)})})})});_3.displayName=j3;var A3="TabsContent",O3=S.forwardRef((e,t)=>{const{__scopeTabs:n,value:r,forceMount:a,children:o,...l}=e,u=q_(A3,n),d=N3(u.baseId,r),h=E3(u.baseId,r),p=r===u.value,v=S.useRef(p);return S.useEffect(()=>{const g=requestAnimationFrame(()=>v.current=!1);return()=>cancelAnimationFrame(g)},[]),c.jsx(Pr,{present:a||p,children:({present:g})=>c.jsx(De.div,{"data-state":p?"active":"inactive","data-orientation":u.orientation,role:"tabpanel","aria-labelledby":d,hidden:!g,id:h,tabIndex:0,...l,ref:t,style:{...e.style,animationDuration:v.current?"0s":void 0},children:g&&o})})});O3.displayName=A3;function N3(e,t){return`${e}-trigger-${t}`}function E3(e,t){return`${e}-content-${t}`}var PK=b3,T3=S3,C3=_3,R3=O3;const Ql=PK,ms=S.forwardRef(({className:e,...t},n)=>c.jsx(T3,{ref:n,className:je("inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",e),...t}));ms.displayName=T3.displayName;const _t=S.forwardRef(({className:e,...t},n)=>c.jsx(C3,{ref:n,className:je("inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all duration-300 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",e),...t}));_t.displayName=C3.displayName;const Pt=S.forwardRef(({className:e,...t},n)=>c.jsx(R3,{ref:n,className:je("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 data-[state=active]:animate-in data-[state=active]:fade-in data-[state=active]:duration-300",e),...t}));Pt.displayName=R3.displayName;function Ef(e,[t,n]){return Math.min(n,Math.max(t,e))}function kK(e,t){return S.useReducer((n,r)=>t[n][r]??n,e)}var U_="ScrollArea",[P3]=Rr(U_),[MK,ea]=P3(U_),k3=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:a,scrollHideDelay:o=600,...l}=e,[u,d]=S.useState(null),[h,p]=S.useState(null),[v,g]=S.useState(null),[y,j]=S.useState(null),[b,w]=S.useState(null),[A,O]=S.useState(0),[N,T]=S.useState(0),[E,C]=S.useState(!1),[R,k]=S.useState(!1),M=Fe(t,$=>d($)),U=yd(a);return c.jsx(MK,{scope:n,type:r,dir:U,scrollHideDelay:o,scrollArea:u,viewport:h,onViewportChange:p,content:v,onContentChange:g,scrollbarX:y,onScrollbarXChange:j,scrollbarXEnabled:E,onScrollbarXEnabledChange:C,scrollbarY:b,onScrollbarYChange:w,scrollbarYEnabled:R,onScrollbarYEnabledChange:k,onCornerWidthChange:O,onCornerHeightChange:T,children:c.jsx(De.div,{dir:U,...l,ref:M,style:{position:"relative","--radix-scroll-area-corner-width":A+"px","--radix-scroll-area-corner-height":N+"px",...e.style}})})});k3.displayName=U_;var M3="ScrollAreaViewport",D3=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:a,...o}=e,l=ea(M3,n),u=S.useRef(null),d=Fe(t,u,l.onViewportChange);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:a}),c.jsx(De.div,{"data-radix-scroll-area-viewport":"",...o,ref:d,style:{overflowX:l.scrollbarXEnabled?"scroll":"hidden",overflowY:l.scrollbarYEnabled?"scroll":"hidden",...e.style},children:c.jsx("div",{ref:l.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});D3.displayName=M3;var Fa="ScrollAreaScrollbar",F_=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=ea(Fa,e.__scopeScrollArea),{onScrollbarXEnabledChange:o,onScrollbarYEnabledChange:l}=a,u=e.orientation==="horizontal";return S.useEffect(()=>(u?o(!0):l(!0),()=>{u?o(!1):l(!1)}),[u,o,l]),a.type==="hover"?c.jsx(DK,{...r,ref:t,forceMount:n}):a.type==="scroll"?c.jsx(LK,{...r,ref:t,forceMount:n}):a.type==="auto"?c.jsx(L3,{...r,ref:t,forceMount:n}):a.type==="always"?c.jsx(H_,{...r,ref:t}):null});F_.displayName=Fa;var DK=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=ea(Fa,e.__scopeScrollArea),[o,l]=S.useState(!1);return S.useEffect(()=>{const u=a.scrollArea;let d=0;if(u){const h=()=>{window.clearTimeout(d),l(!0)},p=()=>{d=window.setTimeout(()=>l(!1),a.scrollHideDelay)};return u.addEventListener("pointerenter",h),u.addEventListener("pointerleave",p),()=>{window.clearTimeout(d),u.removeEventListener("pointerenter",h),u.removeEventListener("pointerleave",p)}}},[a.scrollArea,a.scrollHideDelay]),c.jsx(Pr,{present:n||o,children:c.jsx(L3,{"data-state":o?"visible":"hidden",...r,ref:t})})}),LK=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=ea(Fa,e.__scopeScrollArea),o=e.orientation==="horizontal",l=vv(()=>d("SCROLL_END"),100),[u,d]=kK("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return S.useEffect(()=>{if(u==="idle"){const h=window.setTimeout(()=>d("HIDE"),a.scrollHideDelay);return()=>window.clearTimeout(h)}},[u,a.scrollHideDelay,d]),S.useEffect(()=>{const h=a.viewport,p=o?"scrollLeft":"scrollTop";if(h){let v=h[p];const g=()=>{const y=h[p];v!==y&&(d("SCROLL"),l()),v=y};return h.addEventListener("scroll",g),()=>h.removeEventListener("scroll",g)}},[a.viewport,o,d,l]),c.jsx(Pr,{present:n||u!=="hidden",children:c.jsx(H_,{"data-state":u==="hidden"?"hidden":"visible",...r,ref:t,onPointerEnter:Oe(e.onPointerEnter,()=>d("POINTER_ENTER")),onPointerLeave:Oe(e.onPointerLeave,()=>d("POINTER_LEAVE"))})})}),L3=S.forwardRef((e,t)=>{const n=ea(Fa,e.__scopeScrollArea),{forceMount:r,...a}=e,[o,l]=S.useState(!1),u=e.orientation==="horizontal",d=vv(()=>{if(n.viewport){const h=n.viewport.offsetWidth{const{orientation:n="vertical",...r}=e,a=ea(Fa,e.__scopeScrollArea),o=S.useRef(null),l=S.useRef(0),[u,d]=S.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),h=q3(u.viewport,u.content),p={...r,sizes:u,onSizesChange:d,hasThumb:h>0&&h<1,onThumbChange:g=>o.current=g,onThumbPointerUp:()=>l.current=0,onThumbPointerDown:g=>l.current=g};function v(g,y){return UK(g,l.current,u,y)}return n==="horizontal"?c.jsx($K,{...p,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const g=a.viewport.scrollLeft,y=P2(g,u,a.dir);o.current.style.transform=`translate3d(${y}px, 0, 0)`}},onWheelScroll:g=>{a.viewport&&(a.viewport.scrollLeft=g)},onDragScroll:g=>{a.viewport&&(a.viewport.scrollLeft=v(g,a.dir))}}):n==="vertical"?c.jsx(IK,{...p,ref:t,onThumbPositionChange:()=>{if(a.viewport&&o.current){const g=a.viewport.scrollTop,y=P2(g,u);o.current.style.transform=`translate3d(0, ${y}px, 0)`}},onWheelScroll:g=>{a.viewport&&(a.viewport.scrollTop=g)},onDragScroll:g=>{a.viewport&&(a.viewport.scrollTop=v(g))}}):null}),$K=S.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,o=ea(Fa,e.__scopeScrollArea),[l,u]=S.useState(),d=S.useRef(null),h=Fe(t,d,o.onScrollbarXChange);return S.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),c.jsx(I3,{"data-orientation":"horizontal",...a,ref:h,sizes:n,style:{bottom:0,left:o.dir==="rtl"?"var(--radix-scroll-area-corner-width)":0,right:o.dir==="ltr"?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":mv(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.x),onDragScroll:p=>e.onDragScroll(p.x),onWheelScroll:(p,v)=>{if(o.viewport){const g=o.viewport.scrollLeft+p.deltaX;e.onWheelScroll(g),F3(g,v)&&p.preventDefault()}},onResize:()=>{d.current&&o.viewport&&l&&r({content:o.viewport.scrollWidth,viewport:o.viewport.offsetWidth,scrollbar:{size:d.current.clientWidth,paddingStart:Xp(l.paddingLeft),paddingEnd:Xp(l.paddingRight)}})}})}),IK=S.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...a}=e,o=ea(Fa,e.__scopeScrollArea),[l,u]=S.useState(),d=S.useRef(null),h=Fe(t,d,o.onScrollbarYChange);return S.useEffect(()=>{d.current&&u(getComputedStyle(d.current))},[d]),c.jsx(I3,{"data-orientation":"vertical",...a,ref:h,sizes:n,style:{top:0,right:o.dir==="ltr"?0:void 0,left:o.dir==="rtl"?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":mv(n)+"px",...e.style},onThumbPointerDown:p=>e.onThumbPointerDown(p.y),onDragScroll:p=>e.onDragScroll(p.y),onWheelScroll:(p,v)=>{if(o.viewport){const g=o.viewport.scrollTop+p.deltaY;e.onWheelScroll(g),F3(g,v)&&p.preventDefault()}},onResize:()=>{d.current&&o.viewport&&l&&r({content:o.viewport.scrollHeight,viewport:o.viewport.offsetHeight,scrollbar:{size:d.current.clientHeight,paddingStart:Xp(l.paddingTop),paddingEnd:Xp(l.paddingBottom)}})}})}),[zK,$3]=P3(Fa),I3=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:a,onThumbChange:o,onThumbPointerUp:l,onThumbPointerDown:u,onThumbPositionChange:d,onDragScroll:h,onWheelScroll:p,onResize:v,...g}=e,y=ea(Fa,n),[j,b]=S.useState(null),w=Fe(t,M=>b(M)),A=S.useRef(null),O=S.useRef(""),N=y.viewport,T=r.content-r.viewport,E=nn(p),C=nn(d),R=vv(v,10);function k(M){if(A.current){const U=M.clientX-A.current.left,$=M.clientY-A.current.top;h({x:U,y:$})}}return S.useEffect(()=>{const M=U=>{const $=U.target;j?.contains($)&&E(U,T)};return document.addEventListener("wheel",M,{passive:!1}),()=>document.removeEventListener("wheel",M,{passive:!1})},[N,j,T,E]),S.useEffect(C,[r,C]),Jl(j,R),Jl(y.content,R),c.jsx(zK,{scope:n,scrollbar:j,hasThumb:a,onThumbChange:nn(o),onThumbPointerUp:nn(l),onThumbPositionChange:C,onThumbPointerDown:nn(u),children:c.jsx(De.div,{...g,ref:w,style:{position:"absolute",...g.style},onPointerDown:Oe(e.onPointerDown,M=>{M.button===0&&(M.target.setPointerCapture(M.pointerId),A.current=j.getBoundingClientRect(),O.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",y.viewport&&(y.viewport.style.scrollBehavior="auto"),k(M))}),onPointerMove:Oe(e.onPointerMove,k),onPointerUp:Oe(e.onPointerUp,M=>{const U=M.target;U.hasPointerCapture(M.pointerId)&&U.releasePointerCapture(M.pointerId),document.body.style.webkitUserSelect=O.current,y.viewport&&(y.viewport.style.scrollBehavior=""),A.current=null})})})}),Yp="ScrollAreaThumb",z3=S.forwardRef((e,t)=>{const{forceMount:n,...r}=e,a=$3(Yp,e.__scopeScrollArea);return c.jsx(Pr,{present:n||a.hasThumb,children:c.jsx(BK,{ref:t,...r})})}),BK=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...a}=e,o=ea(Yp,n),l=$3(Yp,n),{onThumbPositionChange:u}=l,d=Fe(t,v=>l.onThumbChange(v)),h=S.useRef(void 0),p=vv(()=>{h.current&&(h.current(),h.current=void 0)},100);return S.useEffect(()=>{const v=o.viewport;if(v){const g=()=>{if(p(),!h.current){const y=FK(v,u);h.current=y,u()}};return u(),v.addEventListener("scroll",g),()=>v.removeEventListener("scroll",g)}},[o.viewport,p,u]),c.jsx(De.div,{"data-state":l.hasThumb?"visible":"hidden",...a,ref:d,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:Oe(e.onPointerDownCapture,v=>{const y=v.target.getBoundingClientRect(),j=v.clientX-y.left,b=v.clientY-y.top;l.onThumbPointerDown({x:j,y:b})}),onPointerUp:Oe(e.onPointerUp,l.onThumbPointerUp)})});z3.displayName=Yp;var V_="ScrollAreaCorner",B3=S.forwardRef((e,t)=>{const n=ea(V_,e.__scopeScrollArea),r=!!(n.scrollbarX&&n.scrollbarY);return n.type!=="scroll"&&r?c.jsx(qK,{...e,ref:t}):null});B3.displayName=V_;var qK=S.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,a=ea(V_,n),[o,l]=S.useState(0),[u,d]=S.useState(0),h=!!(o&&u);return Jl(a.scrollbarX,()=>{const p=a.scrollbarX?.offsetHeight||0;a.onCornerHeightChange(p),d(p)}),Jl(a.scrollbarY,()=>{const p=a.scrollbarY?.offsetWidth||0;a.onCornerWidthChange(p),l(p)}),h?c.jsx(De.div,{...r,ref:t,style:{width:o,height:u,position:"absolute",right:a.dir==="ltr"?0:void 0,left:a.dir==="rtl"?0:void 0,bottom:0,...e.style}}):null});function Xp(e){return e?parseInt(e,10):0}function q3(e,t){const n=e/t;return isNaN(n)?0:n}function mv(e){const t=q3(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function UK(e,t,n,r="ltr"){const a=mv(n),o=a/2,l=t||o,u=a-l,d=n.scrollbar.paddingStart+l,h=n.scrollbar.size-n.scrollbar.paddingEnd-u,p=n.content-n.viewport,v=r==="ltr"?[0,p]:[p*-1,0];return U3([d,h],v)(e)}function P2(e,t,n="ltr"){const r=mv(t),a=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,o=t.scrollbar.size-a,l=t.content-t.viewport,u=o-r,d=n==="ltr"?[0,l]:[l*-1,0],h=Ef(e,d);return U3([0,l],[0,u])(h)}function U3(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function F3(e,t){return e>0&&e{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return(function a(){const o={left:e.scrollLeft,top:e.scrollTop},l=n.left!==o.left,u=n.top!==o.top;(l||u)&&t(),n=o,r=window.requestAnimationFrame(a)})(),()=>window.cancelAnimationFrame(r)};function vv(e,t){const n=nn(e),r=S.useRef(0);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),S.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function Jl(e,t){const n=nn(t);Sn(()=>{let r=0;if(e){const a=new ResizeObserver(()=>{cancelAnimationFrame(r),r=window.requestAnimationFrame(n)});return a.observe(e),()=>{window.cancelAnimationFrame(r),a.unobserve(e)}}},[e,n])}var H3=k3,HK=D3,VK=B3;const Bn=S.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(H3,{ref:r,className:je("relative overflow-hidden",e),...n,children:[c.jsx(HK,{className:"h-full w-full rounded-[inherit]",children:t}),c.jsx(V3,{}),c.jsx(VK,{})]}));Bn.displayName=H3.displayName;const V3=S.forwardRef(({className:e,orientation:t="vertical",...n},r)=>c.jsx(F_,{ref:r,orientation:t,className:je("flex touch-none select-none transition-colors",t==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",t==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:c.jsx(z3,{className:"relative flex-1 rounded-full bg-border"})}));V3.displayName=F_.displayName;var ib,k2;function or(){if(k2)return ib;k2=1;var e=Array.isArray;return ib=e,ib}var ob,M2;function G3(){if(M2)return ob;M2=1;var e=typeof tp=="object"&&tp&&tp.Object===Object&&tp;return ob=e,ob}var sb,D2;function Ha(){if(D2)return sb;D2=1;var e=G3(),t=typeof self=="object"&&self&&self.Object===Object&&self,n=e||t||Function("return this")();return sb=n,sb}var lb,L2;function bd(){if(L2)return lb;L2=1;var e=Ha(),t=e.Symbol;return lb=t,lb}var cb,$2;function GK(){if($2)return cb;$2=1;var e=bd(),t=Object.prototype,n=t.hasOwnProperty,r=t.toString,a=e?e.toStringTag:void 0;function o(l){var u=n.call(l,a),d=l[a];try{l[a]=void 0;var h=!0}catch{}var p=r.call(l);return h&&(u?l[a]=d:delete l[a]),p}return cb=o,cb}var ub,I2;function KK(){if(I2)return ub;I2=1;var e=Object.prototype,t=e.toString;function n(r){return t.call(r)}return ub=n,ub}var fb,z2;function Ti(){if(z2)return fb;z2=1;var e=bd(),t=GK(),n=KK(),r="[object Null]",a="[object Undefined]",o=e?e.toStringTag:void 0;function l(u){return u==null?u===void 0?a:r:o&&o in Object(u)?t(u):n(u)}return fb=l,fb}var db,B2;function Ci(){if(B2)return db;B2=1;function e(t){return t!=null&&typeof t=="object"}return db=e,db}var hb,q2;function kc(){if(q2)return hb;q2=1;var e=Ti(),t=Ci(),n="[object Symbol]";function r(a){return typeof a=="symbol"||t(a)&&e(a)==n}return hb=r,hb}var pb,U2;function G_(){if(U2)return pb;U2=1;var e=or(),t=kc(),n=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,r=/^\w*$/;function a(o,l){if(e(o))return!1;var u=typeof o;return u=="number"||u=="symbol"||u=="boolean"||o==null||t(o)?!0:r.test(o)||!n.test(o)||l!=null&&o in Object(l)}return pb=a,pb}var mb,F2;function wo(){if(F2)return mb;F2=1;function e(t){var n=typeof t;return t!=null&&(n=="object"||n=="function")}return mb=e,mb}var vb,H2;function K_(){if(H2)return vb;H2=1;var e=Ti(),t=wo(),n="[object AsyncFunction]",r="[object Function]",a="[object GeneratorFunction]",o="[object Proxy]";function l(u){if(!t(u))return!1;var d=e(u);return d==r||d==a||d==n||d==o}return vb=l,vb}var gb,V2;function WK(){if(V2)return gb;V2=1;var e=Ha(),t=e["__core-js_shared__"];return gb=t,gb}var yb,G2;function YK(){if(G2)return yb;G2=1;var e=WK(),t=(function(){var r=/[^.]+$/.exec(e&&e.keys&&e.keys.IE_PROTO||"");return r?"Symbol(src)_1."+r:""})();function n(r){return!!t&&t in r}return yb=n,yb}var xb,K2;function K3(){if(K2)return xb;K2=1;var e=Function.prototype,t=e.toString;function n(r){if(r!=null){try{return t.call(r)}catch{}try{return r+""}catch{}}return""}return xb=n,xb}var bb,W2;function XK(){if(W2)return bb;W2=1;var e=K_(),t=YK(),n=wo(),r=K3(),a=/[\\^$.*+?()[\]{}|]/g,o=/^\[object .+?Constructor\]$/,l=Function.prototype,u=Object.prototype,d=l.toString,h=u.hasOwnProperty,p=RegExp("^"+d.call(h).replace(a,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function v(g){if(!n(g)||t(g))return!1;var y=e(g)?p:o;return y.test(r(g))}return bb=v,bb}var wb,Y2;function ZK(){if(Y2)return wb;Y2=1;function e(t,n){return t?.[n]}return wb=e,wb}var Sb,X2;function Ts(){if(X2)return Sb;X2=1;var e=XK(),t=ZK();function n(r,a){var o=t(r,a);return e(o)?o:void 0}return Sb=n,Sb}var jb,Z2;function gv(){if(Z2)return jb;Z2=1;var e=Ts(),t=e(Object,"create");return jb=t,jb}var _b,Q2;function QK(){if(Q2)return _b;Q2=1;var e=gv();function t(){this.__data__=e?e(null):{},this.size=0}return _b=t,_b}var Ab,J2;function JK(){if(J2)return Ab;J2=1;function e(t){var n=this.has(t)&&delete this.__data__[t];return this.size-=n?1:0,n}return Ab=e,Ab}var Ob,eR;function eW(){if(eR)return Ob;eR=1;var e=gv(),t="__lodash_hash_undefined__",n=Object.prototype,r=n.hasOwnProperty;function a(o){var l=this.__data__;if(e){var u=l[o];return u===t?void 0:u}return r.call(l,o)?l[o]:void 0}return Ob=a,Ob}var Nb,tR;function tW(){if(tR)return Nb;tR=1;var e=gv(),t=Object.prototype,n=t.hasOwnProperty;function r(a){var o=this.__data__;return e?o[a]!==void 0:n.call(o,a)}return Nb=r,Nb}var Eb,nR;function nW(){if(nR)return Eb;nR=1;var e=gv(),t="__lodash_hash_undefined__";function n(r,a){var o=this.__data__;return this.size+=this.has(r)?0:1,o[r]=e&&a===void 0?t:a,this}return Eb=n,Eb}var Tb,rR;function rW(){if(rR)return Tb;rR=1;var e=QK(),t=JK(),n=eW(),r=tW(),a=nW();function o(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u-1}return Db=t,Db}var Lb,uR;function lW(){if(uR)return Lb;uR=1;var e=yv();function t(n,r){var a=this.__data__,o=e(a,n);return o<0?(++this.size,a.push([n,r])):a[o][1]=r,this}return Lb=t,Lb}var $b,fR;function xv(){if(fR)return $b;fR=1;var e=aW(),t=iW(),n=oW(),r=sW(),a=lW();function o(l){var u=-1,d=l==null?0:l.length;for(this.clear();++u0?1:-1},ts=function(t){return vs(t)&&t.indexOf("%")===t.length-1},_e=function(t){return RW(t)&&!wd(t)},PW=function(t){return Ue(t)},an=function(t){return _e(t)||vs(t)},kW=0,Dc=function(t){var n=++kW;return"".concat(t||"").concat(n)},Un=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!_e(t)&&!vs(t))return r;var o;if(ts(t)){var l=t.indexOf("%");o=n*parseFloat(t.slice(0,l))/100}else o=+t;return wd(o)&&(o=r),a&&o>n&&(o=n),o},lo=function(t){if(!t)return null;var n=Object.keys(t);return n&&n.length?t[n[0]]:null},MW=function(t){if(!Array.isArray(t))return!1;for(var n=t.length,r={},a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function qW(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function D1(e){"@babel/helpers - typeof";return D1=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},D1(e)}var zR={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},bi=function(t){return typeof t=="string"?t:t?t.displayName||t.name||"Component":""},BR=null,c0=null,eA=function e(t){if(t===BR&&Array.isArray(c0))return c0;var n=[];return S.Children.forEach(t,function(r){Ue(r)||(NW.isFragment(r)?n=n.concat(e(r.props.children)):n.push(r))}),c0=n,BR=t,n};function Tr(e,t){var n=[],r=[];return Array.isArray(t)?r=t.map(function(a){return bi(a)}):r=[bi(t)],eA(e).forEach(function(a){var o=Er(a,"type.displayName")||Er(a,"type.name");r.indexOf(o)!==-1&&n.push(a)}),n}function jr(e,t){var n=Tr(e,t);return n&&n[0]}var qR=function(t){if(!t||!t.props)return!1;var n=t.props,r=n.width,a=n.height;return!(!_e(r)||r<=0||!_e(a)||a<=0)},UW=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],FW=function(t){return t&&t.type&&vs(t.type)&&UW.indexOf(t.type)>=0},HW=function(t){return t&&D1(t)==="object"&&"clipDot"in t},VW=function(t,n,r,a){var o,l=(o=l0?.[a])!==null&&o!==void 0?o:[];return n.startsWith("data-")||!Be(t)&&(a&&l.includes(n)||$W.includes(n))||r&&J_.includes(n)},Le=function(t,n,r){if(!t||typeof t=="function"||typeof t=="boolean")return null;var a=t;if(S.isValidElement(t)&&(a=t.props),!Mc(a))return null;var o={};return Object.keys(a).forEach(function(l){var u;VW((u=a)===null||u===void 0?void 0:u[l],l,n,r)&&(o[l]=a[l])}),o},L1=function e(t,n){if(t===n)return!0;var r=S.Children.count(t);if(r!==S.Children.count(n))return!1;if(r===0)return!0;if(r===1)return UR(Array.isArray(t)?t[0]:t,Array.isArray(n)?n[0]:n);for(var a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function XW(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function I1(e){var t=e.children,n=e.width,r=e.height,a=e.viewBox,o=e.className,l=e.style,u=e.title,d=e.desc,h=YW(e,WW),p=a||{width:n,height:r,x:0,y:0},v=Ve("recharts-surface",o);return K.createElement("svg",$1({},Le(h,!0,"svg"),{className:v,width:n,height:r,style:l,viewBox:"".concat(p.x," ").concat(p.y," ").concat(p.width," ").concat(p.height)}),K.createElement("title",null,u),K.createElement("desc",null,d),t)}var ZW=["children","className"];function z1(){return z1=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function JW(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var ot=K.forwardRef(function(e,t){var n=e.children,r=e.className,a=QW(e,ZW),o=Ve("recharts-layer",r);return K.createElement("g",z1({className:o},Le(a,!0),{ref:t}),n)}),pa=function(t,n){for(var r=arguments.length,a=new Array(r>2?r-2:0),o=2;oo?0:o+n),r=r>o?o:r,r<0&&(r+=o),o=n>r?0:r-n>>>0,n>>>=0;for(var l=Array(o);++a=o?n:e(n,r,a)}return f0=t,f0}var d0,GR;function J3(){if(GR)return d0;GR=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",a=t+n+r,o="\\ufe0e\\ufe0f",l="\\u200d",u=RegExp("["+l+e+a+o+"]");function d(h){return u.test(h)}return d0=d,d0}var h0,KR;function nY(){if(KR)return h0;KR=1;function e(t){return t.split("")}return h0=e,h0}var p0,WR;function rY(){if(WR)return p0;WR=1;var e="\\ud800-\\udfff",t="\\u0300-\\u036f",n="\\ufe20-\\ufe2f",r="\\u20d0-\\u20ff",a=t+n+r,o="\\ufe0e\\ufe0f",l="["+e+"]",u="["+a+"]",d="\\ud83c[\\udffb-\\udfff]",h="(?:"+u+"|"+d+")",p="[^"+e+"]",v="(?:\\ud83c[\\udde6-\\uddff]){2}",g="[\\ud800-\\udbff][\\udc00-\\udfff]",y="\\u200d",j=h+"?",b="["+o+"]?",w="(?:"+y+"(?:"+[p,v,g].join("|")+")"+b+j+")*",A=b+j+w,O="(?:"+[p+u+"?",u,v,g,l].join("|")+")",N=RegExp(d+"(?="+d+")|"+O+A,"g");function T(E){return E.match(N)||[]}return p0=T,p0}var m0,YR;function aY(){if(YR)return m0;YR=1;var e=nY(),t=J3(),n=rY();function r(a){return t(a)?n(a):e(a)}return m0=r,m0}var v0,XR;function iY(){if(XR)return v0;XR=1;var e=tY(),t=J3(),n=aY(),r=Y3();function a(o){return function(l){l=r(l);var u=t(l)?n(l):void 0,d=u?u[0]:l.charAt(0),h=u?e(u,1).join(""):l.slice(1);return d[o]()+h}}return v0=a,v0}var g0,ZR;function oY(){if(ZR)return g0;ZR=1;var e=iY(),t=e("toUpperCase");return g0=t,g0}var sY=oY();const Sv=ft(sY);function jt(e){return function(){return e}}const eI=Math.cos,Jp=Math.sin,ba=Math.sqrt,em=Math.PI,jv=2*em,B1=Math.PI,q1=2*B1,Zo=1e-6,lY=q1-Zo;function tI(e){this._+=e[0];for(let t=1,n=e.length;t=0))throw new Error(`invalid digits: ${e}`);if(t>15)return tI;const n=10**t;return function(r){this._+=r[0];for(let a=1,o=r.length;aZo)if(!(Math.abs(v*d-h*p)>Zo)||!o)this._append`L${this._x1=t},${this._y1=n}`;else{let y=r-l,j=a-u,b=d*d+h*h,w=y*y+j*j,A=Math.sqrt(b),O=Math.sqrt(g),N=o*Math.tan((B1-Math.acos((b+g-w)/(2*A*O)))/2),T=N/O,E=N/A;Math.abs(T-1)>Zo&&this._append`L${t+T*p},${n+T*v}`,this._append`A${o},${o},0,0,${+(v*y>p*j)},${this._x1=t+E*d},${this._y1=n+E*h}`}}arc(t,n,r,a,o,l){if(t=+t,n=+n,r=+r,l=!!l,r<0)throw new Error(`negative radius: ${r}`);let u=r*Math.cos(a),d=r*Math.sin(a),h=t+u,p=n+d,v=1^l,g=l?a-o:o-a;this._x1===null?this._append`M${h},${p}`:(Math.abs(this._x1-h)>Zo||Math.abs(this._y1-p)>Zo)&&this._append`L${h},${p}`,r&&(g<0&&(g=g%q1+q1),g>lY?this._append`A${r},${r},0,1,${v},${t-u},${n-d}A${r},${r},0,1,${v},${this._x1=h},${this._y1=p}`:g>Zo&&this._append`A${r},${r},0,${+(g>=B1)},${v},${this._x1=t+r*Math.cos(o)},${this._y1=n+r*Math.sin(o)}`)}rect(t,n,r,a){this._append`M${this._x0=this._x1=+t},${this._y0=this._y1=+n}h${r=+r}v${+a}h${-r}Z`}toString(){return this._}}function tA(e){let t=3;return e.digits=function(n){if(!arguments.length)return t;if(n==null)t=null;else{const r=Math.floor(n);if(!(r>=0))throw new RangeError(`invalid digits: ${n}`);t=r}return e},()=>new uY(t)}function nA(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function nI(e){this._context=e}nI.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:this._context.lineTo(e,t);break}}};function _v(e){return new nI(e)}function rI(e){return e[0]}function aI(e){return e[1]}function iI(e,t){var n=jt(!0),r=null,a=_v,o=null,l=tA(u);e=typeof e=="function"?e:e===void 0?rI:jt(e),t=typeof t=="function"?t:t===void 0?aI:jt(t);function u(d){var h,p=(d=nA(d)).length,v,g=!1,y;for(r==null&&(o=a(y=l())),h=0;h<=p;++h)!(h=y;--j)u.point(N[j],T[j]);u.lineEnd(),u.areaEnd()}A&&(N[g]=+e(w,g,v),T[g]=+t(w,g,v),u.point(r?+r(w,g,v):N[g],n?+n(w,g,v):T[g]))}if(O)return u=null,O+""||null}function p(){return iI().defined(a).curve(l).context(o)}return h.x=function(v){return arguments.length?(e=typeof v=="function"?v:jt(+v),r=null,h):e},h.x0=function(v){return arguments.length?(e=typeof v=="function"?v:jt(+v),h):e},h.x1=function(v){return arguments.length?(r=v==null?null:typeof v=="function"?v:jt(+v),h):r},h.y=function(v){return arguments.length?(t=typeof v=="function"?v:jt(+v),n=null,h):t},h.y0=function(v){return arguments.length?(t=typeof v=="function"?v:jt(+v),h):t},h.y1=function(v){return arguments.length?(n=v==null?null:typeof v=="function"?v:jt(+v),h):n},h.lineX0=h.lineY0=function(){return p().x(e).y(t)},h.lineY1=function(){return p().x(e).y(n)},h.lineX1=function(){return p().x(r).y(t)},h.defined=function(v){return arguments.length?(a=typeof v=="function"?v:jt(!!v),h):a},h.curve=function(v){return arguments.length?(l=v,o!=null&&(u=l(o)),h):l},h.context=function(v){return arguments.length?(v==null?o=u=null:u=l(o=v),h):o},h}class oI{constructor(t,n){this._context=t,this._x=n}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(t,n){switch(t=+t,n=+n,this._point){case 0:{this._point=1,this._line?this._context.lineTo(t,n):this._context.moveTo(t,n);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+t)/2,this._y0,this._x0,n,t,n):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+n)/2,t,this._y0,t,n);break}}this._x0=t,this._y0=n}}function fY(e){return new oI(e,!0)}function dY(e){return new oI(e,!1)}const rA={draw(e,t){const n=ba(t/em);e.moveTo(n,0),e.arc(0,0,n,0,jv)}},hY={draw(e,t){const n=ba(t/5)/2;e.moveTo(-3*n,-n),e.lineTo(-n,-n),e.lineTo(-n,-3*n),e.lineTo(n,-3*n),e.lineTo(n,-n),e.lineTo(3*n,-n),e.lineTo(3*n,n),e.lineTo(n,n),e.lineTo(n,3*n),e.lineTo(-n,3*n),e.lineTo(-n,n),e.lineTo(-3*n,n),e.closePath()}},sI=ba(1/3),pY=sI*2,mY={draw(e,t){const n=ba(t/pY),r=n*sI;e.moveTo(0,-n),e.lineTo(r,0),e.lineTo(0,n),e.lineTo(-r,0),e.closePath()}},vY={draw(e,t){const n=ba(t),r=-n/2;e.rect(r,r,n,n)}},gY=.8908130915292852,lI=Jp(em/10)/Jp(7*em/10),yY=Jp(jv/10)*lI,xY=-eI(jv/10)*lI,bY={draw(e,t){const n=ba(t*gY),r=yY*n,a=xY*n;e.moveTo(0,-n),e.lineTo(r,a);for(let o=1;o<5;++o){const l=jv*o/5,u=eI(l),d=Jp(l);e.lineTo(d*n,-u*n),e.lineTo(u*r-d*a,d*r+u*a)}e.closePath()}},y0=ba(3),wY={draw(e,t){const n=-ba(t/(y0*3));e.moveTo(0,n*2),e.lineTo(-y0*n,-n),e.lineTo(y0*n,-n),e.closePath()}},Gr=-.5,Kr=ba(3)/2,U1=1/ba(12),SY=(U1/2+1)*3,jY={draw(e,t){const n=ba(t/SY),r=n/2,a=n*U1,o=r,l=n*U1+n,u=-o,d=l;e.moveTo(r,a),e.lineTo(o,l),e.lineTo(u,d),e.lineTo(Gr*r-Kr*a,Kr*r+Gr*a),e.lineTo(Gr*o-Kr*l,Kr*o+Gr*l),e.lineTo(Gr*u-Kr*d,Kr*u+Gr*d),e.lineTo(Gr*r+Kr*a,Gr*a-Kr*r),e.lineTo(Gr*o+Kr*l,Gr*l-Kr*o),e.lineTo(Gr*u+Kr*d,Gr*d-Kr*u),e.closePath()}};function _Y(e,t){let n=null,r=tA(a);e=typeof e=="function"?e:jt(e||rA),t=typeof t=="function"?t:jt(t===void 0?64:+t);function a(){let o;if(n||(n=o=r()),e.apply(this,arguments).draw(n,+t.apply(this,arguments)),o)return n=null,o+""||null}return a.type=function(o){return arguments.length?(e=typeof o=="function"?o:jt(o),a):e},a.size=function(o){return arguments.length?(t=typeof o=="function"?o:jt(+o),a):t},a.context=function(o){return arguments.length?(n=o??null,a):n},a}function tm(){}function nm(e,t,n){e._context.bezierCurveTo((2*e._x0+e._x1)/3,(2*e._y0+e._y1)/3,(e._x0+2*e._x1)/3,(e._y0+2*e._y1)/3,(e._x0+4*e._x1+t)/6,(e._y0+4*e._y1+n)/6)}function cI(e){this._context=e}cI.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:nm(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:nm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function AY(e){return new cI(e)}function uI(e){this._context=e}uI.prototype={areaStart:tm,areaEnd:tm,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._x2=e,this._y2=t;break;case 1:this._point=2,this._x3=e,this._y3=t;break;case 2:this._point=3,this._x4=e,this._y4=t,this._context.moveTo((this._x0+4*this._x1+e)/6,(this._y0+4*this._y1+t)/6);break;default:nm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function OY(e){return new uI(e)}function fI(e){this._context=e}fI.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var n=(this._x0+4*this._x1+e)/6,r=(this._y0+4*this._y1+t)/6;this._line?this._context.lineTo(n,r):this._context.moveTo(n,r);break;case 3:this._point=4;default:nm(this,e,t);break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t}};function NY(e){return new fI(e)}function dI(e){this._context=e}dI.prototype={areaStart:tm,areaEnd:tm,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(e,t){e=+e,t=+t,this._point?this._context.lineTo(e,t):(this._point=1,this._context.moveTo(e,t))}};function EY(e){return new dI(e)}function QR(e){return e<0?-1:1}function JR(e,t,n){var r=e._x1-e._x0,a=t-e._x1,o=(e._y1-e._y0)/(r||a<0&&-0),l=(n-e._y1)/(a||r<0&&-0),u=(o*a+l*r)/(r+a);return(QR(o)+QR(l))*Math.min(Math.abs(o),Math.abs(l),.5*Math.abs(u))||0}function eP(e,t){var n=e._x1-e._x0;return n?(3*(e._y1-e._y0)/n-t)/2:t}function x0(e,t,n){var r=e._x0,a=e._y0,o=e._x1,l=e._y1,u=(o-r)/3;e._context.bezierCurveTo(r+u,a+u*t,o-u,l-u*n,o,l)}function rm(e){this._context=e}rm.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:x0(this,this._t0,eP(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(e,t){var n=NaN;if(e=+e,t=+t,!(e===this._x1&&t===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;break;case 2:this._point=3,x0(this,eP(this,n=JR(this,e,t)),n);break;default:x0(this,this._t0,n=JR(this,e,t));break}this._x0=this._x1,this._x1=e,this._y0=this._y1,this._y1=t,this._t0=n}}};function hI(e){this._context=new pI(e)}(hI.prototype=Object.create(rm.prototype)).point=function(e,t){rm.prototype.point.call(this,t,e)};function pI(e){this._context=e}pI.prototype={moveTo:function(e,t){this._context.moveTo(t,e)},closePath:function(){this._context.closePath()},lineTo:function(e,t){this._context.lineTo(t,e)},bezierCurveTo:function(e,t,n,r,a,o){this._context.bezierCurveTo(t,e,r,n,o,a)}};function TY(e){return new rm(e)}function CY(e){return new hI(e)}function mI(e){this._context=e}mI.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var e=this._x,t=this._y,n=e.length;if(n)if(this._line?this._context.lineTo(e[0],t[0]):this._context.moveTo(e[0],t[0]),n===2)this._context.lineTo(e[1],t[1]);else for(var r=tP(e),a=tP(t),o=0,l=1;l=0;--t)a[t]=(l[t]-a[t+1])/o[t];for(o[n-1]=(e[n]+a[n-1])/2,t=0;t=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(e,t){switch(e=+e,t=+t,this._point){case 0:this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,t),this._context.lineTo(e,t);else{var n=this._x*(1-this._t)+e*this._t;this._context.lineTo(n,this._y),this._context.lineTo(n,t)}break}}this._x=e,this._y=t}};function PY(e){return new Av(e,.5)}function kY(e){return new Av(e,0)}function MY(e){return new Av(e,1)}function ec(e,t){if((l=e.length)>1)for(var n=1,r,a,o=e[t[0]],l,u=o.length;n=0;)n[t]=t;return n}function DY(e,t){return e[t]}function LY(e){const t=[];return t.key=e,t}function $Y(){var e=jt([]),t=F1,n=ec,r=DY;function a(o){var l=Array.from(e.apply(this,arguments),LY),u,d=l.length,h=-1,p;for(const v of o)for(u=0,++h;u0){for(var n,r,a=0,o=e[0].length,l;a0){for(var n=0,r=e[t[0]],a,o=r.length;n0)||!((o=(a=e[t[0]]).length)>0))){for(var n=0,r=1,a,o,l;r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function GY(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var vI={symbolCircle:rA,symbolCross:hY,symbolDiamond:mY,symbolSquare:vY,symbolStar:bY,symbolTriangle:wY,symbolWye:jY},KY=Math.PI/180,WY=function(t){var n="symbol".concat(Sv(t));return vI[n]||rA},YY=function(t,n,r){if(n==="area")return t;switch(r){case"cross":return 5*t*t/9;case"diamond":return .5*t*t/Math.sqrt(3);case"square":return t*t;case"star":{var a=18*KY;return 1.25*t*t*(Math.tan(a)-Math.tan(a*2)*Math.pow(Math.tan(a),2))}case"triangle":return Math.sqrt(3)*t*t/4;case"wye":return(21-10*Math.sqrt(3))*t*t/8;default:return Math.PI*t*t/4}},XY=function(t,n){vI["symbol".concat(Sv(t))]=n},aA=function(t){var n=t.type,r=n===void 0?"circle":n,a=t.size,o=a===void 0?64:a,l=t.sizeType,u=l===void 0?"area":l,d=VY(t,qY),h=rP(rP({},d),{},{type:r,size:o,sizeType:u}),p=function(){var w=WY(r),A=_Y().type(w).size(YY(o,u,r));return A()},v=h.className,g=h.cx,y=h.cy,j=Le(h,!0);return g===+g&&y===+y&&o===+o?K.createElement("path",H1({},j,{className:Ve("recharts-symbols",v),transform:"translate(".concat(g,", ").concat(y,")"),d:p()})):null};aA.registerSymbol=XY;function tc(e){"@babel/helpers - typeof";return tc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},tc(e)}function V1(){return V1=Object.assign?Object.assign.bind():function(e){for(var t=1;t`);var O=y.inactive?h:y.color;return K.createElement("li",V1({className:w,style:v,key:"legend-item-".concat(j)},gs(r.props,y,j)),K.createElement(I1,{width:l,height:l,viewBox:p,style:g},r.renderIcon(y)),K.createElement("span",{className:"recharts-legend-item-text",style:{color:O}},b?b(A,y,j):A))})}},{key:"render",value:function(){var r=this.props,a=r.payload,o=r.layout,l=r.align;if(!a||!a.length)return null;var u={padding:0,margin:0,textAlign:o==="horizontal"?l:"left"};return K.createElement("ul",{className:"recharts-default-legend",style:u},this.renderItems())}}])})(S.PureComponent);Cf(iA,"displayName","Legend");Cf(iA,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var b0,iP;function oX(){if(iP)return b0;iP=1;var e=xv();function t(){this.__data__=new e,this.size=0}return b0=t,b0}var w0,oP;function sX(){if(oP)return w0;oP=1;function e(t){var n=this.__data__,r=n.delete(t);return this.size=n.size,r}return w0=e,w0}var S0,sP;function lX(){if(sP)return S0;sP=1;function e(t){return this.__data__.get(t)}return S0=e,S0}var j0,lP;function cX(){if(lP)return j0;lP=1;function e(t){return this.__data__.has(t)}return j0=e,j0}var _0,cP;function uX(){if(cP)return _0;cP=1;var e=xv(),t=Y_(),n=X_(),r=200;function a(o,l){var u=this.__data__;if(u instanceof e){var d=u.__data__;if(!t||d.lengthy))return!1;var b=v.get(l),w=v.get(u);if(b&&w)return b==u&&w==l;var A=-1,O=!0,N=d&a?new e:void 0;for(v.set(l,u),v.set(u,l);++A-1&&r%1==0&&r-1&&n%1==0&&n<=e}return G0=t,G0}var K0,kP;function jX(){if(kP)return K0;kP=1;var e=Ti(),t=cA(),n=Ci(),r="[object Arguments]",a="[object Array]",o="[object Boolean]",l="[object Date]",u="[object Error]",d="[object Function]",h="[object Map]",p="[object Number]",v="[object Object]",g="[object RegExp]",y="[object Set]",j="[object String]",b="[object WeakMap]",w="[object ArrayBuffer]",A="[object DataView]",O="[object Float32Array]",N="[object Float64Array]",T="[object Int8Array]",E="[object Int16Array]",C="[object Int32Array]",R="[object Uint8Array]",k="[object Uint8ClampedArray]",M="[object Uint16Array]",U="[object Uint32Array]",$={};$[O]=$[N]=$[T]=$[E]=$[C]=$[R]=$[k]=$[M]=$[U]=!0,$[r]=$[a]=$[w]=$[o]=$[A]=$[l]=$[u]=$[d]=$[h]=$[p]=$[v]=$[g]=$[y]=$[j]=$[b]=!1;function z(V){return n(V)&&t(V.length)&&!!$[e(V)]}return K0=z,K0}var W0,MP;function OI(){if(MP)return W0;MP=1;function e(t){return function(n){return t(n)}}return W0=e,W0}var df={exports:{}};df.exports;var DP;function _X(){return DP||(DP=1,(function(e,t){var n=G3(),r=t&&!t.nodeType&&t,a=r&&!0&&e&&!e.nodeType&&e,o=a&&a.exports===r,l=o&&n.process,u=(function(){try{var d=a&&a.require&&a.require("util").types;return d||l&&l.binding&&l.binding("util")}catch{}})();e.exports=u})(df,df.exports)),df.exports}var Y0,LP;function NI(){if(LP)return Y0;LP=1;var e=jX(),t=OI(),n=_X(),r=n&&n.isTypedArray,a=r?t(r):e;return Y0=a,Y0}var X0,$P;function AX(){if($P)return X0;$P=1;var e=bX(),t=sA(),n=or(),r=AI(),a=lA(),o=NI(),l=Object.prototype,u=l.hasOwnProperty;function d(h,p){var v=n(h),g=!v&&t(h),y=!v&&!g&&r(h),j=!v&&!g&&!y&&o(h),b=v||g||y||j,w=b?e(h.length,String):[],A=w.length;for(var O in h)(p||u.call(h,O))&&!(b&&(O=="length"||y&&(O=="offset"||O=="parent")||j&&(O=="buffer"||O=="byteLength"||O=="byteOffset")||a(O,A)))&&w.push(O);return w}return X0=d,X0}var Z0,IP;function OX(){if(IP)return Z0;IP=1;var e=Object.prototype;function t(n){var r=n&&n.constructor,a=typeof r=="function"&&r.prototype||e;return n===a}return Z0=t,Z0}var Q0,zP;function EI(){if(zP)return Q0;zP=1;function e(t,n){return function(r){return t(n(r))}}return Q0=e,Q0}var J0,BP;function NX(){if(BP)return J0;BP=1;var e=EI(),t=e(Object.keys,Object);return J0=t,J0}var ew,qP;function EX(){if(qP)return ew;qP=1;var e=OX(),t=NX(),n=Object.prototype,r=n.hasOwnProperty;function a(o){if(!e(o))return t(o);var l=[];for(var u in Object(o))r.call(o,u)&&u!="constructor"&&l.push(u);return l}return ew=a,ew}var tw,UP;function Sd(){if(UP)return tw;UP=1;var e=K_(),t=cA();function n(r){return r!=null&&t(r.length)&&!e(r)}return tw=n,tw}var nw,FP;function Ov(){if(FP)return nw;FP=1;var e=AX(),t=EX(),n=Sd();function r(a){return n(a)?e(a):t(a)}return nw=r,nw}var rw,HP;function TX(){if(HP)return rw;HP=1;var e=vX(),t=xX(),n=Ov();function r(a){return e(a,n,t)}return rw=r,rw}var aw,VP;function CX(){if(VP)return aw;VP=1;var e=TX(),t=1,n=Object.prototype,r=n.hasOwnProperty;function a(o,l,u,d,h,p){var v=u&t,g=e(o),y=g.length,j=e(l),b=j.length;if(y!=b&&!v)return!1;for(var w=y;w--;){var A=g[w];if(!(v?A in l:r.call(l,A)))return!1}var O=p.get(o),N=p.get(l);if(O&&N)return O==l&&N==o;var T=!0;p.set(o,l),p.set(l,o);for(var E=v;++w-1}return Cw=t,Cw}var Rw,yk;function XX(){if(yk)return Rw;yk=1;function e(t,n,r){for(var a=-1,o=t==null?0:t.length;++a=l){var A=h?null:a(d);if(A)return o(A);j=!1,g=r,w=new e}else w=h?[]:b;e:for(;++v=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function fZ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function dZ(e){return e.value}function hZ(e,t){if(K.isValidElement(e))return K.cloneElement(e,t);if(typeof e=="function")return K.createElement(e,t);t.ref;var n=uZ(t,nZ);return K.createElement(iA,n)}var Ok=1,cs=(function(e){function t(){var n;rZ(this,t);for(var r=arguments.length,a=new Array(r),o=0;oOk||Math.abs(a.height-this.lastBoundingBox.height)>Ok)&&(this.lastBoundingBox.width=a.width,this.lastBoundingBox.height=a.height,r&&r(a)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,r&&r(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?di({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(r){var a=this.props,o=a.layout,l=a.align,u=a.verticalAlign,d=a.margin,h=a.chartWidth,p=a.chartHeight,v,g;if(!r||(r.left===void 0||r.left===null)&&(r.right===void 0||r.right===null))if(l==="center"&&o==="vertical"){var y=this.getBBoxSnapshot();v={left:((h||0)-y.width)/2}}else v=l==="right"?{right:d&&d.right||0}:{left:d&&d.left||0};if(!r||(r.top===void 0||r.top===null)&&(r.bottom===void 0||r.bottom===null))if(u==="middle"){var j=this.getBBoxSnapshot();g={top:((p||0)-j.height)/2}}else g=u==="bottom"?{bottom:d&&d.bottom||0}:{top:d&&d.top||0};return di(di({},v),g)}},{key:"render",value:function(){var r=this,a=this.props,o=a.content,l=a.width,u=a.height,d=a.wrapperStyle,h=a.payloadUniqBy,p=a.payload,v=di(di({position:"absolute",width:l||"auto",height:u||"auto"},this.getDefaultPosition(d)),d);return K.createElement("div",{className:"recharts-legend-wrapper",style:v,ref:function(y){r.wrapperNode=y}},hZ(o,di(di({},this.props),{},{payload:kI(p,h,dZ)})))}}],[{key:"getWithHeight",value:function(r,a){var o=di(di({},this.defaultProps),r.props),l=o.layout;return l==="vertical"&&_e(r.props.height)?{height:r.props.height}:l==="horizontal"?{width:r.props.width||a}:null}}])})(S.PureComponent);Nv(cs,"displayName","Legend");Nv(cs,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var Lw,Nk;function pZ(){if(Nk)return Lw;Nk=1;var e=bd(),t=sA(),n=or(),r=e?e.isConcatSpreadable:void 0;function a(o){return n(o)||t(o)||!!(r&&o&&o[r])}return Lw=a,Lw}var $w,Ek;function LI(){if(Ek)return $w;Ek=1;var e=_I(),t=pZ();function n(r,a,o,l,u){var d=-1,h=r.length;for(o||(o=t),u||(u=[]);++d0&&o(p)?a>1?n(p,a-1,o,l,u):e(u,p):l||(u[u.length]=p)}return u}return $w=n,$w}var Iw,Tk;function mZ(){if(Tk)return Iw;Tk=1;function e(t){return function(n,r,a){for(var o=-1,l=Object(n),u=a(n),d=u.length;d--;){var h=u[t?d:++o];if(r(l[h],h,l)===!1)break}return n}}return Iw=e,Iw}var zw,Ck;function vZ(){if(Ck)return zw;Ck=1;var e=mZ(),t=e();return zw=t,zw}var Bw,Rk;function $I(){if(Rk)return Bw;Rk=1;var e=vZ(),t=Ov();function n(r,a){return r&&e(r,a,t)}return Bw=n,Bw}var qw,Pk;function gZ(){if(Pk)return qw;Pk=1;var e=Sd();function t(n,r){return function(a,o){if(a==null)return a;if(!e(a))return n(a,o);for(var l=a.length,u=r?l:-1,d=Object(a);(r?u--:++ur||u&&d&&p&&!h&&!v||o&&d&&p||!a&&p||!l)return 1;if(!o&&!u&&!v&&n=h)return p;var v=a[o];return p*(v=="desc"?-1:1)}}return n.index-r.index}return Gw=t,Gw}var Kw,Ik;function wZ(){if(Ik)return Kw;Ik=1;var e=Z_(),t=Q_(),n=Va(),r=II(),a=yZ(),o=OI(),l=bZ(),u=Lc(),d=or();function h(p,v,g){v.length?v=e(v,function(b){return d(b)?function(w){return t(w,b.length===1?b[0]:b)}:b}):v=[u];var y=-1;v=e(v,o(n));var j=r(p,function(b,w,A){var O=e(v,function(N){return N(b)});return{criteria:O,index:++y,value:b}});return a(j,function(b,w){return l(b,w,g)})}return Kw=h,Kw}var Ww,zk;function SZ(){if(zk)return Ww;zk=1;function e(t,n,r){switch(r.length){case 0:return t.call(n);case 1:return t.call(n,r[0]);case 2:return t.call(n,r[0],r[1]);case 3:return t.call(n,r[0],r[1],r[2])}return t.apply(n,r)}return Ww=e,Ww}var Yw,Bk;function jZ(){if(Bk)return Yw;Bk=1;var e=SZ(),t=Math.max;function n(r,a,o){return a=t(a===void 0?r.length-1:a,0),function(){for(var l=arguments,u=-1,d=t(l.length-a,0),h=Array(d);++u0){if(++o>=e)return arguments[0]}else o=0;return a.apply(void 0,arguments)}}return Jw=r,Jw}var eS,Vk;function NZ(){if(Vk)return eS;Vk=1;var e=AZ(),t=OZ(),n=t(e);return eS=n,eS}var tS,Gk;function EZ(){if(Gk)return tS;Gk=1;var e=Lc(),t=jZ(),n=NZ();function r(a,o){return n(t(a,o,e),a+"")}return tS=r,tS}var nS,Kk;function Ev(){if(Kk)return nS;Kk=1;var e=W_(),t=Sd(),n=lA(),r=wo();function a(o,l,u){if(!r(u))return!1;var d=typeof l;return(d=="number"?t(u)&&n(l,u.length):d=="string"&&l in u)?e(u[l],o):!1}return nS=a,nS}var rS,Wk;function TZ(){if(Wk)return rS;Wk=1;var e=LI(),t=wZ(),n=EZ(),r=Ev(),a=n(function(o,l){if(o==null)return[];var u=l.length;return u>1&&r(o,l[0],l[1])?l=[]:u>2&&r(l[0],l[1],l[2])&&(l=[l[0]]),t(o,e(l,1),[])});return rS=a,rS}var CZ=TZ();const dA=ft(CZ);function Rf(e){"@babel/helpers - typeof";return Rf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Rf(e)}function W1(){return W1=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t.x),"".concat(Zu,"-left"),_e(n)&&t&&_e(t.x)&&n=t.y),"".concat(Zu,"-top"),_e(r)&&t&&_e(t.y)&&rb?Math.max(p,d[r]):Math.max(v,d[r])}function VZ(e){var t=e.translateX,n=e.translateY,r=e.useTranslate3d;return{transform:r?"translate3d(".concat(t,"px, ").concat(n,"px, 0)"):"translate(".concat(t,"px, ").concat(n,"px)")}}function GZ(e){var t=e.allowEscapeViewBox,n=e.coordinate,r=e.offsetTopLeft,a=e.position,o=e.reverseDirection,l=e.tooltipBox,u=e.useTranslate3d,d=e.viewBox,h,p,v;return l.height>0&&l.width>0&&n?(p=Zk({allowEscapeViewBox:t,coordinate:n,key:"x",offsetTopLeft:r,position:a,reverseDirection:o,tooltipDimension:l.width,viewBox:d,viewBoxDimension:d.width}),v=Zk({allowEscapeViewBox:t,coordinate:n,key:"y",offsetTopLeft:r,position:a,reverseDirection:o,tooltipDimension:l.height,viewBox:d,viewBoxDimension:d.height}),h=VZ({translateX:p,translateY:v,useTranslate3d:u})):h=FZ,{cssProperties:h,cssClasses:HZ({translateX:p,translateY:v,coordinate:n})}}function rc(e){"@babel/helpers - typeof";return rc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},rc(e)}function Qk(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Jk(e){for(var t=1;teM||Math.abs(r.height-this.state.lastBoundingBox.height)>eM)&&this.setState({lastBoundingBox:{width:r.width,height:r.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var r,a;this.props.active&&this.updateBBox(),this.state.dismissed&&(((r=this.props.coordinate)===null||r===void 0?void 0:r.x)!==this.state.dismissedAtCoordinate.x||((a=this.props.coordinate)===null||a===void 0?void 0:a.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var r=this,a=this.props,o=a.active,l=a.allowEscapeViewBox,u=a.animationDuration,d=a.animationEasing,h=a.children,p=a.coordinate,v=a.hasPayload,g=a.isAnimationActive,y=a.offset,j=a.position,b=a.reverseDirection,w=a.useTranslate3d,A=a.viewBox,O=a.wrapperStyle,N=GZ({allowEscapeViewBox:l,coordinate:p,offsetTopLeft:y,position:j,reverseDirection:b,tooltipBox:this.state.lastBoundingBox,useTranslate3d:w,viewBox:A}),T=N.cssClasses,E=N.cssProperties,C=Jk(Jk({transition:g&&o?"transform ".concat(u,"ms ").concat(d):void 0},E),{},{pointerEvents:"none",visibility:!this.state.dismissed&&o&&v?"visible":"hidden",position:"absolute",top:0,left:0},O);return K.createElement("div",{tabIndex:-1,className:T,style:C,ref:function(k){r.wrapperNode=k}},h)}}])})(S.PureComponent),nQ=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Cs={isSsr:nQ()};function ac(e){"@babel/helpers - typeof";return ac=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},ac(e)}function tM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function nM(e){for(var t=1;t0;return K.createElement(tQ,{allowEscapeViewBox:l,animationDuration:u,animationEasing:d,isAnimationActive:g,active:o,coordinate:p,hasPayload:C,offset:y,position:w,reverseDirection:A,useTranslate3d:O,viewBox:N,wrapperStyle:T},dQ(h,nM(nM({},this.props),{},{payload:E})))}}])})(S.PureComponent);hA(Ea,"displayName","Tooltip");hA(Ea,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Cs.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var iS,rM;function hQ(){if(rM)return iS;rM=1;var e=Ha(),t=function(){return e.Date.now()};return iS=t,iS}var oS,aM;function pQ(){if(aM)return oS;aM=1;var e=/\s/;function t(n){for(var r=n.length;r--&&e.test(n.charAt(r)););return r}return oS=t,oS}var sS,iM;function mQ(){if(iM)return sS;iM=1;var e=pQ(),t=/^\s+/;function n(r){return r&&r.slice(0,e(r)+1).replace(t,"")}return sS=n,sS}var lS,oM;function HI(){if(oM)return lS;oM=1;var e=mQ(),t=wo(),n=kc(),r=NaN,a=/^[-+]0x[0-9a-f]+$/i,o=/^0b[01]+$/i,l=/^0o[0-7]+$/i,u=parseInt;function d(h){if(typeof h=="number")return h;if(n(h))return r;if(t(h)){var p=typeof h.valueOf=="function"?h.valueOf():h;h=t(p)?p+"":p}if(typeof h!="string")return h===0?h:+h;h=e(h);var v=o.test(h);return v||l.test(h)?u(h.slice(2),v?2:8):a.test(h)?r:+h}return lS=d,lS}var cS,sM;function vQ(){if(sM)return cS;sM=1;var e=wo(),t=hQ(),n=HI(),r="Expected a function",a=Math.max,o=Math.min;function l(u,d,h){var p,v,g,y,j,b,w=0,A=!1,O=!1,N=!0;if(typeof u!="function")throw new TypeError(r);d=n(d)||0,e(h)&&(A=!!h.leading,O="maxWait"in h,g=O?a(n(h.maxWait)||0,d):g,N="trailing"in h?!!h.trailing:N);function T(V){var F=p,G=v;return p=v=void 0,w=V,y=u.apply(G,F),y}function E(V){return w=V,j=setTimeout(k,d),A?T(V):y}function C(V){var F=V-b,G=V-w,L=d-F;return O?o(L,g-G):L}function R(V){var F=V-b,G=V-w;return b===void 0||F>=d||F<0||O&&G>=g}function k(){var V=t();if(R(V))return M(V);j=setTimeout(k,C(V))}function M(V){return j=void 0,N&&p?T(V):(p=v=void 0,y)}function U(){j!==void 0&&clearTimeout(j),w=0,p=b=v=j=void 0}function $(){return j===void 0?y:M(t())}function z(){var V=t(),F=R(V);if(p=arguments,v=this,b=V,F){if(j===void 0)return E(b);if(O)return clearTimeout(j),j=setTimeout(k,d),T(b)}return j===void 0&&(j=setTimeout(k,d)),y}return z.cancel=U,z.flush=$,z}return cS=l,cS}var uS,lM;function gQ(){if(lM)return uS;lM=1;var e=vQ(),t=wo(),n="Expected a function";function r(a,o,l){var u=!0,d=!0;if(typeof a!="function")throw new TypeError(n);return t(l)&&(u="leading"in l?!!l.leading:u,d="trailing"in l?!!l.trailing:d),e(a,o,{leading:u,maxWait:o,trailing:d})}return uS=r,uS}var yQ=gQ();const VI=ft(yQ);function kf(e){"@babel/helpers - typeof";return kf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},kf(e)}function cM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function dp(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&(V=VI(V,b,{trailing:!0,leading:!1}));var F=new ResizeObserver(V),G=E.current.getBoundingClientRect(),L=G.width,q=G.height;return $(L,q),F.observe(E.current),function(){F.disconnect()}},[$,b]);var z=S.useMemo(function(){var V=M.containerWidth,F=M.containerHeight;if(V<0||F<0)return null;pa(ts(l)||ts(d),`The width(%s) and height(%s) are both fixed numbers, maybe you don't need to use a ResponsiveContainer.`,l,d),pa(!n||n>0,"The aspect(%s) must be greater than zero.",n);var G=ts(l)?V:l,L=ts(d)?F:d;n&&n>0&&(G?L=G/n:L&&(G=L*n),g&&L>g&&(L=g)),pa(G>0||L>0,`The width(%s) and height(%s) of chart should be greater than 0, please check the style of container, or the props width(%s) and height(%s), or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the height and width.`,G,L,l,d,p,v,n);var q=!Array.isArray(y)&&bi(y.type).endsWith("Chart");return K.Children.map(y,function(H){return K.isValidElement(H)?S.cloneElement(H,dp({width:G,height:L},q?{style:dp({height:"100%",width:"100%",maxHeight:L,maxWidth:G},H.props.style)}:{})):H})},[n,y,d,g,v,p,M,l]);return K.createElement("div",{id:w?"".concat(w):void 0,className:Ve("recharts-responsive-container",A),style:dp(dp({},T),{},{width:l,height:d,minWidth:p,minHeight:v,maxHeight:g}),ref:E},z)}),Tv=function(t){return null};Tv.displayName="Cell";function Mf(e){"@babel/helpers - typeof";return Mf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Mf(e)}function fM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Q1(e){for(var t=1;t1&&arguments[1]!==void 0?arguments[1]:{};if(t==null||Cs.isSsr)return{width:0,height:0};var r=kQ(n),a=JSON.stringify({text:t,copyStyle:r});if(Sl.widthCache[a])return Sl.widthCache[a];try{var o=document.getElementById(dM);o||(o=document.createElement("span"),o.setAttribute("id",dM),o.setAttribute("aria-hidden","true"),document.body.appendChild(o));var l=Q1(Q1({},PQ),r);Object.assign(o.style,l),o.textContent="".concat(t);var u=o.getBoundingClientRect(),d={width:u.width,height:u.height};return Sl.widthCache[a]=d,++Sl.cacheCount>RQ&&(Sl.cacheCount=0,Sl.widthCache={}),d}catch{return{width:0,height:0}}},MQ=function(t){return{top:t.top+window.scrollY-document.documentElement.clientTop,left:t.left+window.scrollX-document.documentElement.clientLeft}};function Df(e){"@babel/helpers - typeof";return Df=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Df(e)}function lm(e,t){return IQ(e)||$Q(e,t)||LQ(e,t)||DQ()}function DQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LQ(e,t){if(e){if(typeof e=="string")return hM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return hM(e,t)}}function hM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function QQ(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function xM(e,t){return nJ(e)||tJ(e,t)||eJ(e,t)||JQ()}function JQ(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eJ(e,t){if(e){if(typeof e=="string")return bM(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return bM(e,t)}}function bM(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[];return G.reduce(function(L,q){var H=q.word,ee=q.width,ve=L[L.length-1];if(ve&&(a==null||o||ve.width+ee+rq.width?L:q})};if(!p)return y;for(var b="…",w=function(G){var L=v.slice(0,G),q=YI({breakAll:h,style:d,children:L+b}).wordsWithComputedWidth,H=g(q),ee=H.length>l||j(H).width>Number(a);return[ee,H]},A=0,O=v.length-1,N=0,T;A<=O&&N<=v.length-1;){var E=Math.floor((A+O)/2),C=E-1,R=w(C),k=xM(R,2),M=k[0],U=k[1],$=w(E),z=xM($,1),V=z[0];if(!M&&!V&&(A=E+1),M&&V&&(O=E-1),!M&&V){T=U;break}N++}return T||y},wM=function(t){var n=Ue(t)?[]:t.toString().split(WI);return[{words:n}]},aJ=function(t){var n=t.width,r=t.scaleToFit,a=t.children,o=t.style,l=t.breakAll,u=t.maxLines;if((n||r)&&!Cs.isSsr){var d,h,p=YI({breakAll:l,children:a,style:o});if(p){var v=p.wordsWithComputedWidth,g=p.spaceWidth;d=v,h=g}else return wM(a);return rJ({breakAll:l,children:a,maxLines:u,style:o},d,h,n,r)}return wM(a)},SM="#808080",ys=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,o=a===void 0?0:a,l=t.lineHeight,u=l===void 0?"1em":l,d=t.capHeight,h=d===void 0?"0.71em":d,p=t.scaleToFit,v=p===void 0?!1:p,g=t.textAnchor,y=g===void 0?"start":g,j=t.verticalAnchor,b=j===void 0?"end":j,w=t.fill,A=w===void 0?SM:w,O=yM(t,XQ),N=S.useMemo(function(){return aJ({breakAll:O.breakAll,children:O.children,maxLines:O.maxLines,scaleToFit:v,style:O.style,width:O.width})},[O.breakAll,O.children,O.maxLines,v,O.style,O.width]),T=O.dx,E=O.dy,C=O.angle,R=O.className,k=O.breakAll,M=yM(O,ZQ);if(!an(r)||!an(o))return null;var U=r+(_e(T)?T:0),$=o+(_e(E)?E:0),z;switch(b){case"start":z=fS("calc(".concat(h,")"));break;case"middle":z=fS("calc(".concat((N.length-1)/2," * -").concat(u," + (").concat(h," / 2))"));break;default:z=fS("calc(".concat(N.length-1," * -").concat(u,")"));break}var V=[];if(v){var F=N[0].width,G=O.width;V.push("scale(".concat((_e(G)?G/F:1)/F,")"))}return C&&V.push("rotate(".concat(C,", ").concat(U,", ").concat($,")")),V.length&&(M.transform=V.join(" ")),K.createElement("text",J1({},Le(M,!0),{x:U,y:$,className:Ve("recharts-text",R),textAnchor:y,fill:A.includes("url")?SM:A}),N.map(function(L,q){var H=L.words.join(k?"":" ");return K.createElement("tspan",{x:U,dy:q===0?z:u,key:"".concat(H,"-").concat(q)},H)}))};function vo(e,t){return e==null||t==null?NaN:et?1:e>=t?0:NaN}function iJ(e,t){return e==null||t==null?NaN:te?1:t>=e?0:NaN}function pA(e){let t,n,r;e.length!==2?(t=vo,n=(u,d)=>vo(e(u),d),r=(u,d)=>e(u)-d):(t=e===vo||e===iJ?e:oJ,n=e,r=e);function a(u,d,h=0,p=u.length){if(h>>1;n(u[v],d)<0?h=v+1:p=v}while(h>>1;n(u[v],d)<=0?h=v+1:p=v}while(hh&&r(u[v-1],d)>-r(u[v],d)?v-1:v}return{left:a,center:l,right:o}}function oJ(){return 0}function XI(e){return e===null?NaN:+e}function*sJ(e,t){for(let n of e)n!=null&&(n=+n)>=n&&(yield n)}const lJ=pA(vo),jd=lJ.right;pA(XI).center;class jM extends Map{constructor(t,n=fJ){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:n}}),t!=null)for(const[r,a]of t)this.set(r,a)}get(t){return super.get(_M(this,t))}has(t){return super.has(_M(this,t))}set(t,n){return super.set(cJ(this,t),n)}delete(t){return super.delete(uJ(this,t))}}function _M({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):n}function cJ({_intern:e,_key:t},n){const r=t(n);return e.has(r)?e.get(r):(e.set(r,n),n)}function uJ({_intern:e,_key:t},n){const r=t(n);return e.has(r)&&(n=e.get(r),e.delete(r)),n}function fJ(e){return e!==null&&typeof e=="object"?e.valueOf():e}function dJ(e=vo){if(e===vo)return ZI;if(typeof e!="function")throw new TypeError("compare is not a function");return(t,n)=>{const r=e(t,n);return r||r===0?r:(e(n,n)===0)-(e(t,t)===0)}}function ZI(e,t){return(e==null||!(e>=e))-(t==null||!(t>=t))||(et?1:0)}const hJ=Math.sqrt(50),pJ=Math.sqrt(10),mJ=Math.sqrt(2);function cm(e,t,n){const r=(t-e)/Math.max(0,n),a=Math.floor(Math.log10(r)),o=r/Math.pow(10,a),l=o>=hJ?10:o>=pJ?5:o>=mJ?2:1;let u,d,h;return a<0?(h=Math.pow(10,-a)/l,u=Math.round(e*h),d=Math.round(t*h),u/ht&&--d,h=-h):(h=Math.pow(10,a)*l,u=Math.round(e/h),d=Math.round(t/h),u*ht&&--d),d0))return[];if(e===t)return[e];const r=t=a))return[];const u=o-a+1,d=new Array(u);if(r)if(l<0)for(let h=0;h=r)&&(n=r);return n}function OM(e,t){let n;for(const r of e)r!=null&&(n>r||n===void 0&&r>=r)&&(n=r);return n}function QI(e,t,n=0,r=1/0,a){if(t=Math.floor(t),n=Math.floor(Math.max(0,n)),r=Math.floor(Math.min(e.length-1,r)),!(n<=t&&t<=r))return e;for(a=a===void 0?ZI:dJ(a);r>n;){if(r-n>600){const d=r-n+1,h=t-n+1,p=Math.log(d),v=.5*Math.exp(2*p/3),g=.5*Math.sqrt(p*v*(d-v)/d)*(h-d/2<0?-1:1),y=Math.max(n,Math.floor(t-h*v/d+g)),j=Math.min(r,Math.floor(t+(d-h)*v/d+g));QI(e,t,y,j,a)}const o=e[t];let l=n,u=r;for(Qu(e,n,t),a(e[r],o)>0&&Qu(e,n,r);l0;)--u}a(e[n],o)===0?Qu(e,n,u):(++u,Qu(e,u,r)),u<=t&&(n=u+1),t<=u&&(r=u-1)}return e}function Qu(e,t,n){const r=e[t];e[t]=e[n],e[n]=r}function vJ(e,t,n){if(e=Float64Array.from(sJ(e)),!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return OM(e);if(t>=1)return AM(e);var r,a=(r-1)*t,o=Math.floor(a),l=AM(QI(e,o).subarray(0,o+1)),u=OM(e.subarray(o+1));return l+(u-l)*(a-o)}}function gJ(e,t,n=XI){if(!(!(r=e.length)||isNaN(t=+t))){if(t<=0||r<2)return+n(e[0],0,e);if(t>=1)return+n(e[r-1],r-1,e);var r,a=(r-1)*t,o=Math.floor(a),l=+n(e[o],o,e),u=+n(e[o+1],o+1,e);return l+(u-l)*(a-o)}}function yJ(e,t,n){e=+e,t=+t,n=(a=arguments.length)<2?(t=e,e=0,1):a<3?1:+n;for(var r=-1,a=Math.max(0,Math.ceil((t-e)/n))|0,o=new Array(a);++r>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?pp(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?pp(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=bJ.exec(e))?new nr(t[1],t[2],t[3],1):(t=wJ.exec(e))?new nr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=SJ.exec(e))?pp(t[1],t[2],t[3],t[4]):(t=jJ.exec(e))?pp(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=_J.exec(e))?kM(t[1],t[2]/100,t[3]/100,1):(t=AJ.exec(e))?kM(t[1],t[2]/100,t[3]/100,t[4]):NM.hasOwnProperty(e)?CM(NM[e]):e==="transparent"?new nr(NaN,NaN,NaN,0):null}function CM(e){return new nr(e>>16&255,e>>8&255,e&255,1)}function pp(e,t,n,r){return r<=0&&(e=t=n=NaN),new nr(e,t,n,r)}function EJ(e){return e instanceof _d||(e=zf(e)),e?(e=e.rgb(),new nr(e.r,e.g,e.b,e.opacity)):new nr}function aj(e,t,n,r){return arguments.length===1?EJ(e):new nr(e,t,n,r??1)}function nr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}vA(nr,aj,ez(_d,{brighter(e){return e=e==null?um:Math.pow(um,e),new nr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?$f:Math.pow($f,e),new nr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new nr(us(this.r),us(this.g),us(this.b),fm(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:RM,formatHex:RM,formatHex8:TJ,formatRgb:PM,toString:PM}));function RM(){return`#${ns(this.r)}${ns(this.g)}${ns(this.b)}`}function TJ(){return`#${ns(this.r)}${ns(this.g)}${ns(this.b)}${ns((isNaN(this.opacity)?1:this.opacity)*255)}`}function PM(){const e=fm(this.opacity);return`${e===1?"rgb(":"rgba("}${us(this.r)}, ${us(this.g)}, ${us(this.b)}${e===1?")":`, ${e})`}`}function fm(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function us(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function ns(e){return e=us(e),(e<16?"0":"")+e.toString(16)}function kM(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new da(e,t,n,r)}function tz(e){if(e instanceof da)return new da(e.h,e.s,e.l,e.opacity);if(e instanceof _d||(e=zf(e)),!e)return new da;if(e instanceof da)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),o=Math.max(t,n,r),l=NaN,u=o-a,d=(o+a)/2;return u?(t===o?l=(n-r)/u+(n0&&d<1?0:l,new da(l,u,d,e.opacity)}function CJ(e,t,n,r){return arguments.length===1?tz(e):new da(e,t,n,r??1)}function da(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}vA(da,CJ,ez(_d,{brighter(e){return e=e==null?um:Math.pow(um,e),new da(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?$f:Math.pow($f,e),new da(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new nr(dS(e>=240?e-240:e+120,a,r),dS(e,a,r),dS(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new da(MM(this.h),mp(this.s),mp(this.l),fm(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=fm(this.opacity);return`${e===1?"hsl(":"hsla("}${MM(this.h)}, ${mp(this.s)*100}%, ${mp(this.l)*100}%${e===1?")":`, ${e})`}`}}));function MM(e){return e=(e||0)%360,e<0?e+360:e}function mp(e){return Math.max(0,Math.min(1,e||0))}function dS(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const gA=e=>()=>e;function RJ(e,t){return function(n){return e+n*t}}function PJ(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function kJ(e){return(e=+e)==1?nz:function(t,n){return n-t?PJ(t,n,e):gA(isNaN(t)?n:t)}}function nz(e,t){var n=t-e;return n?RJ(e,n):gA(isNaN(e)?t:e)}const DM=(function e(t){var n=kJ(t);function r(a,o){var l=n((a=aj(a)).r,(o=aj(o)).r),u=n(a.g,o.g),d=n(a.b,o.b),h=nz(a.opacity,o.opacity);return function(p){return a.r=l(p),a.g=u(p),a.b=d(p),a.opacity=h(p),a+""}}return r.gamma=e,r})(1);function MJ(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(o){for(a=0;an&&(o=t.slice(n,o),u[l]?u[l]+=o:u[++l]=o),(r=r[0])===(a=a[0])?u[l]?u[l]+=a:u[++l]=a:(u[++l]=null,d.push({i:l,x:dm(r,a)})),n=hS.lastIndex;return nt&&(n=e,e=t,t=n),function(r){return Math.max(e,Math.min(t,r))}}function VJ(e,t,n){var r=e[0],a=e[1],o=t[0],l=t[1];return a2?GJ:VJ,d=h=null,v}function v(g){return g==null||isNaN(g=+g)?o:(d||(d=u(e.map(r),t,n)))(r(l(g)))}return v.invert=function(g){return l(a((h||(h=u(t,e.map(r),dm)))(g)))},v.domain=function(g){return arguments.length?(e=Array.from(g,hm),p()):e.slice()},v.range=function(g){return arguments.length?(t=Array.from(g),p()):t.slice()},v.rangeRound=function(g){return t=Array.from(g),n=yA,p()},v.clamp=function(g){return arguments.length?(l=g?!0:Fn,p()):l!==Fn},v.interpolate=function(g){return arguments.length?(n=g,p()):n},v.unknown=function(g){return arguments.length?(o=g,v):o},function(g,y){return r=g,a=y,p()}}function xA(){return Cv()(Fn,Fn)}function KJ(e){return Math.abs(e=Math.round(e))>=1e21?e.toLocaleString("en").replace(/,/g,""):e.toString(10)}function pm(e,t){if((n=(e=t?e.toExponential(t-1):e.toExponential()).indexOf("e"))<0)return null;var n,r=e.slice(0,n);return[r.length>1?r[0]+r.slice(2):r,+e.slice(n+1)]}function ic(e){return e=pm(Math.abs(e)),e?e[1]:NaN}function WJ(e,t){return function(n,r){for(var a=n.length,o=[],l=0,u=e[0],d=0;a>0&&u>0&&(d+u+1>r&&(u=Math.max(1,r-d)),o.push(n.substring(a-=u,a+u)),!((d+=u+1)>r));)u=e[l=(l+1)%e.length];return o.reverse().join(t)}}function YJ(e){return function(t){return t.replace(/[0-9]/g,function(n){return e[+n]})}}var XJ=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Bf(e){if(!(t=XJ.exec(e)))throw new Error("invalid format: "+e);var t;return new bA({fill:t[1],align:t[2],sign:t[3],symbol:t[4],zero:t[5],width:t[6],comma:t[7],precision:t[8]&&t[8].slice(1),trim:t[9],type:t[10]})}Bf.prototype=bA.prototype;function bA(e){this.fill=e.fill===void 0?" ":e.fill+"",this.align=e.align===void 0?">":e.align+"",this.sign=e.sign===void 0?"-":e.sign+"",this.symbol=e.symbol===void 0?"":e.symbol+"",this.zero=!!e.zero,this.width=e.width===void 0?void 0:+e.width,this.comma=!!e.comma,this.precision=e.precision===void 0?void 0:+e.precision,this.trim=!!e.trim,this.type=e.type===void 0?"":e.type+""}bA.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function ZJ(e){e:for(var t=e.length,n=1,r=-1,a;n0&&(r=0);break}return r>0?e.slice(0,r)+e.slice(a+1):e}var rz;function QJ(e,t){var n=pm(e,t);if(!n)return e+"";var r=n[0],a=n[1],o=a-(rz=Math.max(-8,Math.min(8,Math.floor(a/3)))*3)+1,l=r.length;return o===l?r:o>l?r+new Array(o-l+1).join("0"):o>0?r.slice(0,o)+"."+r.slice(o):"0."+new Array(1-o).join("0")+pm(e,Math.max(0,t+o-1))[0]}function $M(e,t){var n=pm(e,t);if(!n)return e+"";var r=n[0],a=n[1];return a<0?"0."+new Array(-a).join("0")+r:r.length>a+1?r.slice(0,a+1)+"."+r.slice(a+1):r+new Array(a-r.length+2).join("0")}const IM={"%":(e,t)=>(e*100).toFixed(t),b:e=>Math.round(e).toString(2),c:e=>e+"",d:KJ,e:(e,t)=>e.toExponential(t),f:(e,t)=>e.toFixed(t),g:(e,t)=>e.toPrecision(t),o:e=>Math.round(e).toString(8),p:(e,t)=>$M(e*100,t),r:$M,s:QJ,X:e=>Math.round(e).toString(16).toUpperCase(),x:e=>Math.round(e).toString(16)};function zM(e){return e}var BM=Array.prototype.map,qM=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function JJ(e){var t=e.grouping===void 0||e.thousands===void 0?zM:WJ(BM.call(e.grouping,Number),e.thousands+""),n=e.currency===void 0?"":e.currency[0]+"",r=e.currency===void 0?"":e.currency[1]+"",a=e.decimal===void 0?".":e.decimal+"",o=e.numerals===void 0?zM:YJ(BM.call(e.numerals,String)),l=e.percent===void 0?"%":e.percent+"",u=e.minus===void 0?"−":e.minus+"",d=e.nan===void 0?"NaN":e.nan+"";function h(v){v=Bf(v);var g=v.fill,y=v.align,j=v.sign,b=v.symbol,w=v.zero,A=v.width,O=v.comma,N=v.precision,T=v.trim,E=v.type;E==="n"?(O=!0,E="g"):IM[E]||(N===void 0&&(N=12),T=!0,E="g"),(w||g==="0"&&y==="=")&&(w=!0,g="0",y="=");var C=b==="$"?n:b==="#"&&/[boxX]/.test(E)?"0"+E.toLowerCase():"",R=b==="$"?r:/[%p]/.test(E)?l:"",k=IM[E],M=/[defgprs%]/.test(E);N=N===void 0?6:/[gprs]/.test(E)?Math.max(1,Math.min(21,N)):Math.max(0,Math.min(20,N));function U($){var z=C,V=R,F,G,L;if(E==="c")V=k($)+V,$="";else{$=+$;var q=$<0||1/$<0;if($=isNaN($)?d:k(Math.abs($),N),T&&($=ZJ($)),q&&+$==0&&j!=="+"&&(q=!1),z=(q?j==="("?j:u:j==="-"||j==="("?"":j)+z,V=(E==="s"?qM[8+rz/3]:"")+V+(q&&j==="("?")":""),M){for(F=-1,G=$.length;++FL||L>57){V=(L===46?a+$.slice(F+1):$.slice(F))+V,$=$.slice(0,F);break}}}O&&!w&&($=t($,1/0));var H=z.length+$.length+V.length,ee=H>1)+z+$+V+ee.slice(H);break;default:$=ee+z+$+V;break}return o($)}return U.toString=function(){return v+""},U}function p(v,g){var y=h((v=Bf(v),v.type="f",v)),j=Math.max(-8,Math.min(8,Math.floor(ic(g)/3)))*3,b=Math.pow(10,-j),w=qM[8+j/3];return function(A){return y(b*A)+w}}return{format:h,formatPrefix:p}}var vp,wA,az;eee({thousands:",",grouping:[3],currency:["$",""]});function eee(e){return vp=JJ(e),wA=vp.format,az=vp.formatPrefix,vp}function tee(e){return Math.max(0,-ic(Math.abs(e)))}function nee(e,t){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(ic(t)/3)))*3-ic(Math.abs(e)))}function ree(e,t){return e=Math.abs(e),t=Math.abs(t)-e,Math.max(0,ic(t)-ic(e))+1}function iz(e,t,n,r){var a=nj(e,t,n),o;switch(r=Bf(r??",f"),r.type){case"s":{var l=Math.max(Math.abs(e),Math.abs(t));return r.precision==null&&!isNaN(o=nee(a,l))&&(r.precision=o),az(r,l)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(o=ree(a,Math.max(Math.abs(e),Math.abs(t))))&&(r.precision=o-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(o=tee(a))&&(r.precision=o-(r.type==="%")*2);break}}return wA(r)}function So(e){var t=e.domain;return e.ticks=function(n){var r=t();return ej(r[0],r[r.length-1],n??10)},e.tickFormat=function(n,r){var a=t();return iz(a[0],a[a.length-1],n??10,r)},e.nice=function(n){n==null&&(n=10);var r=t(),a=0,o=r.length-1,l=r[a],u=r[o],d,h,p=10;for(u0;){if(h=tj(l,u,n),h===d)return r[a]=l,r[o]=u,t(r);if(h>0)l=Math.floor(l/h)*h,u=Math.ceil(u/h)*h;else if(h<0)l=Math.ceil(l*h)/h,u=Math.floor(u*h)/h;else break;d=h}return e},e}function mm(){var e=xA();return e.copy=function(){return Ad(e,mm())},ta.apply(e,arguments),So(e)}function oz(e){var t;function n(r){return r==null||isNaN(r=+r)?t:r}return n.invert=n,n.domain=n.range=function(r){return arguments.length?(e=Array.from(r,hm),n):e.slice()},n.unknown=function(r){return arguments.length?(t=r,n):t},n.copy=function(){return oz(e).unknown(t)},e=arguments.length?Array.from(e,hm):[0,1],So(n)}function sz(e,t){e=e.slice();var n=0,r=e.length-1,a=e[n],o=e[r],l;return oMath.pow(e,t)}function lee(e){return e===Math.E?Math.log:e===10&&Math.log10||e===2&&Math.log2||(e=Math.log(e),t=>Math.log(t)/e)}function HM(e){return(t,n)=>-e(-t,n)}function SA(e){const t=e(UM,FM),n=t.domain;let r=10,a,o;function l(){return a=lee(r),o=see(r),n()[0]<0?(a=HM(a),o=HM(o),e(aee,iee)):e(UM,FM),t}return t.base=function(u){return arguments.length?(r=+u,l()):r},t.domain=function(u){return arguments.length?(n(u),l()):n()},t.ticks=u=>{const d=n();let h=d[0],p=d[d.length-1];const v=p0){for(;g<=y;++g)for(j=1;jp)break;A.push(b)}}else for(;g<=y;++g)for(j=r-1;j>=1;--j)if(b=g>0?j/o(-g):j*o(g),!(bp)break;A.push(b)}A.length*2{if(u==null&&(u=10),d==null&&(d=r===10?"s":","),typeof d!="function"&&(!(r%1)&&(d=Bf(d)).precision==null&&(d.trim=!0),d=wA(d)),u===1/0)return d;const h=Math.max(1,r*u/t.ticks().length);return p=>{let v=p/o(Math.round(a(p)));return v*rn(sz(n(),{floor:u=>o(Math.floor(a(u))),ceil:u=>o(Math.ceil(a(u)))})),t}function lz(){const e=SA(Cv()).domain([1,10]);return e.copy=()=>Ad(e,lz()).base(e.base()),ta.apply(e,arguments),e}function VM(e){return function(t){return Math.sign(t)*Math.log1p(Math.abs(t/e))}}function GM(e){return function(t){return Math.sign(t)*Math.expm1(Math.abs(t))*e}}function jA(e){var t=1,n=e(VM(t),GM(t));return n.constant=function(r){return arguments.length?e(VM(t=+r),GM(t)):t},So(n)}function cz(){var e=jA(Cv());return e.copy=function(){return Ad(e,cz()).constant(e.constant())},ta.apply(e,arguments)}function KM(e){return function(t){return t<0?-Math.pow(-t,e):Math.pow(t,e)}}function cee(e){return e<0?-Math.sqrt(-e):Math.sqrt(e)}function uee(e){return e<0?-e*e:e*e}function _A(e){var t=e(Fn,Fn),n=1;function r(){return n===1?e(Fn,Fn):n===.5?e(cee,uee):e(KM(n),KM(1/n))}return t.exponent=function(a){return arguments.length?(n=+a,r()):n},So(t)}function AA(){var e=_A(Cv());return e.copy=function(){return Ad(e,AA()).exponent(e.exponent())},ta.apply(e,arguments),e}function fee(){return AA.apply(null,arguments).exponent(.5)}function WM(e){return Math.sign(e)*e*e}function dee(e){return Math.sign(e)*Math.sqrt(Math.abs(e))}function uz(){var e=xA(),t=[0,1],n=!1,r;function a(o){var l=dee(e(o));return isNaN(l)?r:n?Math.round(l):l}return a.invert=function(o){return e.invert(WM(o))},a.domain=function(o){return arguments.length?(e.domain(o),a):e.domain()},a.range=function(o){return arguments.length?(e.range((t=Array.from(o,hm)).map(WM)),a):t.slice()},a.rangeRound=function(o){return a.range(o).round(!0)},a.round=function(o){return arguments.length?(n=!!o,a):n},a.clamp=function(o){return arguments.length?(e.clamp(o),a):e.clamp()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.copy=function(){return uz(e.domain(),t).round(n).clamp(e.clamp()).unknown(r)},ta.apply(a,arguments),So(a)}function fz(){var e=[],t=[],n=[],r;function a(){var l=0,u=Math.max(1,t.length);for(n=new Array(u-1);++l0?n[u-1]:e[0],u=n?[r[n-1],t]:[r[h-1],r[h]]},l.unknown=function(d){return arguments.length&&(o=d),l},l.thresholds=function(){return r.slice()},l.copy=function(){return dz().domain([e,t]).range(a).unknown(o)},ta.apply(So(l),arguments)}function hz(){var e=[.5],t=[0,1],n,r=1;function a(o){return o!=null&&o<=o?t[jd(e,o,0,r)]:n}return a.domain=function(o){return arguments.length?(e=Array.from(o),r=Math.min(e.length,t.length-1),a):e.slice()},a.range=function(o){return arguments.length?(t=Array.from(o),r=Math.min(e.length,t.length-1),a):t.slice()},a.invertExtent=function(o){var l=t.indexOf(o);return[e[l-1],e[l]]},a.unknown=function(o){return arguments.length?(n=o,a):n},a.copy=function(){return hz().domain(e).range(t).unknown(n)},ta.apply(a,arguments)}const pS=new Date,mS=new Date;function on(e,t,n,r){function a(o){return e(o=arguments.length===0?new Date:new Date(+o)),o}return a.floor=o=>(e(o=new Date(+o)),o),a.ceil=o=>(e(o=new Date(o-1)),t(o,1),e(o),o),a.round=o=>{const l=a(o),u=a.ceil(o);return o-l(t(o=new Date(+o),l==null?1:Math.floor(l)),o),a.range=(o,l,u)=>{const d=[];if(o=a.ceil(o),u=u==null?1:Math.floor(u),!(o0))return d;let h;do d.push(h=new Date(+o)),t(o,u),e(o);while(hon(l=>{if(l>=l)for(;e(l),!o(l);)l.setTime(l-1)},(l,u)=>{if(l>=l)if(u<0)for(;++u<=0;)for(;t(l,-1),!o(l););else for(;--u>=0;)for(;t(l,1),!o(l););}),n&&(a.count=(o,l)=>(pS.setTime(+o),mS.setTime(+l),e(pS),e(mS),Math.floor(n(pS,mS))),a.every=o=>(o=Math.floor(o),!isFinite(o)||!(o>0)?null:o>1?a.filter(r?l=>r(l)%o===0:l=>a.count(0,l)%o===0):a)),a}const vm=on(()=>{},(e,t)=>{e.setTime(+e+t)},(e,t)=>t-e);vm.every=e=>(e=Math.floor(e),!isFinite(e)||!(e>0)?null:e>1?on(t=>{t.setTime(Math.floor(t/e)*e)},(t,n)=>{t.setTime(+t+n*e)},(t,n)=>(n-t)/e):vm);vm.range;const vi=1e3,Zr=vi*60,gi=Zr*60,ji=gi*24,OA=ji*7,YM=ji*30,vS=ji*365,rs=on(e=>{e.setTime(e-e.getMilliseconds())},(e,t)=>{e.setTime(+e+t*vi)},(e,t)=>(t-e)/vi,e=>e.getUTCSeconds());rs.range;const NA=on(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*vi)},(e,t)=>{e.setTime(+e+t*Zr)},(e,t)=>(t-e)/Zr,e=>e.getMinutes());NA.range;const EA=on(e=>{e.setUTCSeconds(0,0)},(e,t)=>{e.setTime(+e+t*Zr)},(e,t)=>(t-e)/Zr,e=>e.getUTCMinutes());EA.range;const TA=on(e=>{e.setTime(e-e.getMilliseconds()-e.getSeconds()*vi-e.getMinutes()*Zr)},(e,t)=>{e.setTime(+e+t*gi)},(e,t)=>(t-e)/gi,e=>e.getHours());TA.range;const CA=on(e=>{e.setUTCMinutes(0,0,0)},(e,t)=>{e.setTime(+e+t*gi)},(e,t)=>(t-e)/gi,e=>e.getUTCHours());CA.range;const Od=on(e=>e.setHours(0,0,0,0),(e,t)=>e.setDate(e.getDate()+t),(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Zr)/ji,e=>e.getDate()-1);Od.range;const Rv=on(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ji,e=>e.getUTCDate()-1);Rv.range;const pz=on(e=>{e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t)},(e,t)=>(t-e)/ji,e=>Math.floor(e/ji));pz.range;function Rs(e){return on(t=>{t.setDate(t.getDate()-(t.getDay()+7-e)%7),t.setHours(0,0,0,0)},(t,n)=>{t.setDate(t.getDate()+n*7)},(t,n)=>(n-t-(n.getTimezoneOffset()-t.getTimezoneOffset())*Zr)/OA)}const Pv=Rs(0),gm=Rs(1),hee=Rs(2),pee=Rs(3),oc=Rs(4),mee=Rs(5),vee=Rs(6);Pv.range;gm.range;hee.range;pee.range;oc.range;mee.range;vee.range;function Ps(e){return on(t=>{t.setUTCDate(t.getUTCDate()-(t.getUTCDay()+7-e)%7),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCDate(t.getUTCDate()+n*7)},(t,n)=>(n-t)/OA)}const kv=Ps(0),ym=Ps(1),gee=Ps(2),yee=Ps(3),sc=Ps(4),xee=Ps(5),bee=Ps(6);kv.range;ym.range;gee.range;yee.range;sc.range;xee.range;bee.range;const RA=on(e=>{e.setDate(1),e.setHours(0,0,0,0)},(e,t)=>{e.setMonth(e.getMonth()+t)},(e,t)=>t.getMonth()-e.getMonth()+(t.getFullYear()-e.getFullYear())*12,e=>e.getMonth());RA.range;const PA=on(e=>{e.setUTCDate(1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCMonth(e.getUTCMonth()+t)},(e,t)=>t.getUTCMonth()-e.getUTCMonth()+(t.getUTCFullYear()-e.getUTCFullYear())*12,e=>e.getUTCMonth());PA.range;const _i=on(e=>{e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t)},(e,t)=>t.getFullYear()-e.getFullYear(),e=>e.getFullYear());_i.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:on(t=>{t.setFullYear(Math.floor(t.getFullYear()/e)*e),t.setMonth(0,1),t.setHours(0,0,0,0)},(t,n)=>{t.setFullYear(t.getFullYear()+n*e)});_i.range;const Ai=on(e=>{e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t)},(e,t)=>t.getUTCFullYear()-e.getUTCFullYear(),e=>e.getUTCFullYear());Ai.every=e=>!isFinite(e=Math.floor(e))||!(e>0)?null:on(t=>{t.setUTCFullYear(Math.floor(t.getUTCFullYear()/e)*e),t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,n)=>{t.setUTCFullYear(t.getUTCFullYear()+n*e)});Ai.range;function mz(e,t,n,r,a,o){const l=[[rs,1,vi],[rs,5,5*vi],[rs,15,15*vi],[rs,30,30*vi],[o,1,Zr],[o,5,5*Zr],[o,15,15*Zr],[o,30,30*Zr],[a,1,gi],[a,3,3*gi],[a,6,6*gi],[a,12,12*gi],[r,1,ji],[r,2,2*ji],[n,1,OA],[t,1,YM],[t,3,3*YM],[e,1,vS]];function u(h,p,v){const g=pw).right(l,g);if(y===l.length)return e.every(nj(h/vS,p/vS,v));if(y===0)return vm.every(Math.max(nj(h,p,v),1));const[j,b]=l[g/l[y-1][2]53)return null;"w"in oe||(oe.w=1),"Z"in oe?(Se=yS(Ju(oe.y,0,1)),fe=Se.getUTCDay(),Se=fe>4||fe===0?ym.ceil(Se):ym(Se),Se=Rv.offset(Se,(oe.V-1)*7),oe.y=Se.getUTCFullYear(),oe.m=Se.getUTCMonth(),oe.d=Se.getUTCDate()+(oe.w+6)%7):(Se=gS(Ju(oe.y,0,1)),fe=Se.getDay(),Se=fe>4||fe===0?gm.ceil(Se):gm(Se),Se=Od.offset(Se,(oe.V-1)*7),oe.y=Se.getFullYear(),oe.m=Se.getMonth(),oe.d=Se.getDate()+(oe.w+6)%7)}else("W"in oe||"U"in oe)&&("w"in oe||(oe.w="u"in oe?oe.u%7:"W"in oe?1:0),fe="Z"in oe?yS(Ju(oe.y,0,1)).getUTCDay():gS(Ju(oe.y,0,1)).getDay(),oe.m=0,oe.d="W"in oe?(oe.w+6)%7+oe.W*7-(fe+5)%7:oe.w+oe.U*7-(fe+6)%7);return"Z"in oe?(oe.H+=oe.Z/100|0,oe.M+=oe.Z%100,yS(oe)):gS(oe)}}function k(X,de,be,oe){for(var Pe=0,Se=de.length,fe=be.length,he,$e;Pe=fe)return-1;if(he=de.charCodeAt(Pe++),he===37){if(he=de.charAt(Pe++),$e=E[he in XM?de.charAt(Pe++):he],!$e||(oe=$e(X,be,oe))<0)return-1}else if(he!=be.charCodeAt(oe++))return-1}return oe}function M(X,de,be){var oe=h.exec(de.slice(be));return oe?(X.p=p.get(oe[0].toLowerCase()),be+oe[0].length):-1}function U(X,de,be){var oe=y.exec(de.slice(be));return oe?(X.w=j.get(oe[0].toLowerCase()),be+oe[0].length):-1}function $(X,de,be){var oe=v.exec(de.slice(be));return oe?(X.w=g.get(oe[0].toLowerCase()),be+oe[0].length):-1}function z(X,de,be){var oe=A.exec(de.slice(be));return oe?(X.m=O.get(oe[0].toLowerCase()),be+oe[0].length):-1}function V(X,de,be){var oe=b.exec(de.slice(be));return oe?(X.m=w.get(oe[0].toLowerCase()),be+oe[0].length):-1}function F(X,de,be){return k(X,t,de,be)}function G(X,de,be){return k(X,n,de,be)}function L(X,de,be){return k(X,r,de,be)}function q(X){return l[X.getDay()]}function H(X){return o[X.getDay()]}function ee(X){return d[X.getMonth()]}function ve(X){return u[X.getMonth()]}function I(X){return a[+(X.getHours()>=12)]}function B(X){return 1+~~(X.getMonth()/3)}function Y(X){return l[X.getUTCDay()]}function te(X){return o[X.getUTCDay()]}function le(X){return d[X.getUTCMonth()]}function xe(X){return u[X.getUTCMonth()]}function Q(X){return a[+(X.getUTCHours()>=12)]}function ne(X){return 1+~~(X.getUTCMonth()/3)}return{format:function(X){var de=C(X+="",N);return de.toString=function(){return X},de},parse:function(X){var de=R(X+="",!1);return de.toString=function(){return X},de},utcFormat:function(X){var de=C(X+="",T);return de.toString=function(){return X},de},utcParse:function(X){var de=R(X+="",!0);return de.toString=function(){return X},de}}}var XM={"-":"",_:" ",0:"0"},jn=/^\s*\d+/,Oee=/^%/,Nee=/[\\^$*+?|[\]().{}]/g;function st(e,t,n){var r=e<0?"-":"",a=(r?-e:e)+"",o=a.length;return r+(o[t.toLowerCase(),n]))}function Tee(e,t,n){var r=jn.exec(t.slice(n,n+1));return r?(e.w=+r[0],n+r[0].length):-1}function Cee(e,t,n){var r=jn.exec(t.slice(n,n+1));return r?(e.u=+r[0],n+r[0].length):-1}function Ree(e,t,n){var r=jn.exec(t.slice(n,n+2));return r?(e.U=+r[0],n+r[0].length):-1}function Pee(e,t,n){var r=jn.exec(t.slice(n,n+2));return r?(e.V=+r[0],n+r[0].length):-1}function kee(e,t,n){var r=jn.exec(t.slice(n,n+2));return r?(e.W=+r[0],n+r[0].length):-1}function ZM(e,t,n){var r=jn.exec(t.slice(n,n+4));return r?(e.y=+r[0],n+r[0].length):-1}function QM(e,t,n){var r=jn.exec(t.slice(n,n+2));return r?(e.y=+r[0]+(+r[0]>68?1900:2e3),n+r[0].length):-1}function Mee(e,t,n){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(t.slice(n,n+6));return r?(e.Z=r[1]?0:-(r[2]+(r[3]||"00")),n+r[0].length):-1}function Dee(e,t,n){var r=jn.exec(t.slice(n,n+1));return r?(e.q=r[0]*3-3,n+r[0].length):-1}function Lee(e,t,n){var r=jn.exec(t.slice(n,n+2));return r?(e.m=r[0]-1,n+r[0].length):-1}function JM(e,t,n){var r=jn.exec(t.slice(n,n+2));return r?(e.d=+r[0],n+r[0].length):-1}function $ee(e,t,n){var r=jn.exec(t.slice(n,n+3));return r?(e.m=0,e.d=+r[0],n+r[0].length):-1}function eD(e,t,n){var r=jn.exec(t.slice(n,n+2));return r?(e.H=+r[0],n+r[0].length):-1}function Iee(e,t,n){var r=jn.exec(t.slice(n,n+2));return r?(e.M=+r[0],n+r[0].length):-1}function zee(e,t,n){var r=jn.exec(t.slice(n,n+2));return r?(e.S=+r[0],n+r[0].length):-1}function Bee(e,t,n){var r=jn.exec(t.slice(n,n+3));return r?(e.L=+r[0],n+r[0].length):-1}function qee(e,t,n){var r=jn.exec(t.slice(n,n+6));return r?(e.L=Math.floor(r[0]/1e3),n+r[0].length):-1}function Uee(e,t,n){var r=Oee.exec(t.slice(n,n+1));return r?n+r[0].length:-1}function Fee(e,t,n){var r=jn.exec(t.slice(n));return r?(e.Q=+r[0],n+r[0].length):-1}function Hee(e,t,n){var r=jn.exec(t.slice(n));return r?(e.s=+r[0],n+r[0].length):-1}function tD(e,t){return st(e.getDate(),t,2)}function Vee(e,t){return st(e.getHours(),t,2)}function Gee(e,t){return st(e.getHours()%12||12,t,2)}function Kee(e,t){return st(1+Od.count(_i(e),e),t,3)}function vz(e,t){return st(e.getMilliseconds(),t,3)}function Wee(e,t){return vz(e,t)+"000"}function Yee(e,t){return st(e.getMonth()+1,t,2)}function Xee(e,t){return st(e.getMinutes(),t,2)}function Zee(e,t){return st(e.getSeconds(),t,2)}function Qee(e){var t=e.getDay();return t===0?7:t}function Jee(e,t){return st(Pv.count(_i(e)-1,e),t,2)}function gz(e){var t=e.getDay();return t>=4||t===0?oc(e):oc.ceil(e)}function ete(e,t){return e=gz(e),st(oc.count(_i(e),e)+(_i(e).getDay()===4),t,2)}function tte(e){return e.getDay()}function nte(e,t){return st(gm.count(_i(e)-1,e),t,2)}function rte(e,t){return st(e.getFullYear()%100,t,2)}function ate(e,t){return e=gz(e),st(e.getFullYear()%100,t,2)}function ite(e,t){return st(e.getFullYear()%1e4,t,4)}function ote(e,t){var n=e.getDay();return e=n>=4||n===0?oc(e):oc.ceil(e),st(e.getFullYear()%1e4,t,4)}function ste(e){var t=e.getTimezoneOffset();return(t>0?"-":(t*=-1,"+"))+st(t/60|0,"0",2)+st(t%60,"0",2)}function nD(e,t){return st(e.getUTCDate(),t,2)}function lte(e,t){return st(e.getUTCHours(),t,2)}function cte(e,t){return st(e.getUTCHours()%12||12,t,2)}function ute(e,t){return st(1+Rv.count(Ai(e),e),t,3)}function yz(e,t){return st(e.getUTCMilliseconds(),t,3)}function fte(e,t){return yz(e,t)+"000"}function dte(e,t){return st(e.getUTCMonth()+1,t,2)}function hte(e,t){return st(e.getUTCMinutes(),t,2)}function pte(e,t){return st(e.getUTCSeconds(),t,2)}function mte(e){var t=e.getUTCDay();return t===0?7:t}function vte(e,t){return st(kv.count(Ai(e)-1,e),t,2)}function xz(e){var t=e.getUTCDay();return t>=4||t===0?sc(e):sc.ceil(e)}function gte(e,t){return e=xz(e),st(sc.count(Ai(e),e)+(Ai(e).getUTCDay()===4),t,2)}function yte(e){return e.getUTCDay()}function xte(e,t){return st(ym.count(Ai(e)-1,e),t,2)}function bte(e,t){return st(e.getUTCFullYear()%100,t,2)}function wte(e,t){return e=xz(e),st(e.getUTCFullYear()%100,t,2)}function Ste(e,t){return st(e.getUTCFullYear()%1e4,t,4)}function jte(e,t){var n=e.getUTCDay();return e=n>=4||n===0?sc(e):sc.ceil(e),st(e.getUTCFullYear()%1e4,t,4)}function _te(){return"+0000"}function rD(){return"%"}function aD(e){return+e}function iD(e){return Math.floor(+e/1e3)}var jl,bz,wz;Ate({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function Ate(e){return jl=Aee(e),bz=jl.format,jl.parse,wz=jl.utcFormat,jl.utcParse,jl}function Ote(e){return new Date(e)}function Nte(e){return e instanceof Date?+e:+new Date(+e)}function kA(e,t,n,r,a,o,l,u,d,h){var p=xA(),v=p.invert,g=p.domain,y=h(".%L"),j=h(":%S"),b=h("%I:%M"),w=h("%I %p"),A=h("%a %d"),O=h("%b %d"),N=h("%B"),T=h("%Y");function E(C){return(d(C)t(a/(e.length-1)))},n.quantiles=function(r){return Array.from({length:r+1},(a,o)=>vJ(e,o/r))},n.copy=function(){return Az(t).domain(e)},Ri.apply(n,arguments)}function Dv(){var e=0,t=.5,n=1,r=1,a,o,l,u,d,h=Fn,p,v=!1,g;function y(b){return isNaN(b=+b)?g:(b=.5+((b=+p(b))-o)*(r*bn}return bS=e,bS}var wS,cD;function Pte(){if(cD)return wS;cD=1;var e=Lv(),t=Tz(),n=Lc();function r(a){return a&&a.length?e(a,n,t):void 0}return wS=r,wS}var kte=Pte();const $v=ft(kte);var SS,uD;function Cz(){if(uD)return SS;uD=1;function e(t,n){return te.e^o.s<0?1:-1;for(r=o.d.length,a=e.d.length,t=0,n=re.d[t]^o.s<0?1:-1;return r===a?0:r>a^o.s<0?1:-1};Ne.decimalPlaces=Ne.dp=function(){var e=this,t=e.d.length-1,n=(t-e.e)*Tt;if(t=e.d[t],t)for(;t%10==0;t/=10)n--;return n<0?0:n};Ne.dividedBy=Ne.div=function(e){return wi(this,new this.constructor(e))};Ne.dividedToIntegerBy=Ne.idiv=function(e){var t=this,n=t.constructor;return wt(wi(t,new n(e),0,1),n.precision)};Ne.equals=Ne.eq=function(e){return!this.cmp(e)};Ne.exponent=function(){return Yt(this)};Ne.greaterThan=Ne.gt=function(e){return this.cmp(e)>0};Ne.greaterThanOrEqualTo=Ne.gte=function(e){return this.cmp(e)>=0};Ne.isInteger=Ne.isint=function(){return this.e>this.d.length-2};Ne.isNegative=Ne.isneg=function(){return this.s<0};Ne.isPositive=Ne.ispos=function(){return this.s>0};Ne.isZero=function(){return this.s===0};Ne.lessThan=Ne.lt=function(e){return this.cmp(e)<0};Ne.lessThanOrEqualTo=Ne.lte=function(e){return this.cmp(e)<1};Ne.logarithm=Ne.log=function(e){var t,n=this,r=n.constructor,a=r.precision,o=a+5;if(e===void 0)e=new r(10);else if(e=new r(e),e.s<1||e.eq(Nr))throw Error(Jr+"NaN");if(n.s<1)throw Error(Jr+(n.s?"NaN":"-Infinity"));return n.eq(Nr)?new r(0):(Rt=!1,t=wi(qf(n,o),qf(e,o),o),Rt=!0,wt(t,a))};Ne.minus=Ne.sub=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Mz(t,e):Pz(t,(e.s=-e.s,e))};Ne.modulo=Ne.mod=function(e){var t,n=this,r=n.constructor,a=r.precision;if(e=new r(e),!e.s)throw Error(Jr+"NaN");return n.s?(Rt=!1,t=wi(n,e,0,1).times(e),Rt=!0,n.minus(t)):wt(new r(n),a)};Ne.naturalExponential=Ne.exp=function(){return kz(this)};Ne.naturalLogarithm=Ne.ln=function(){return qf(this)};Ne.negated=Ne.neg=function(){var e=new this.constructor(this);return e.s=-e.s||0,e};Ne.plus=Ne.add=function(e){var t=this;return e=new t.constructor(e),t.s==e.s?Pz(t,e):Mz(t,(e.s=-e.s,e))};Ne.precision=Ne.sd=function(e){var t,n,r,a=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(fs+e);if(t=Yt(a)+1,r=a.d.length-1,n=r*Tt+1,r=a.d[r],r){for(;r%10==0;r/=10)n--;for(r=a.d[0];r>=10;r/=10)n++}return e&&t>n?t:n};Ne.squareRoot=Ne.sqrt=function(){var e,t,n,r,a,o,l,u=this,d=u.constructor;if(u.s<1){if(!u.s)return new d(0);throw Error(Jr+"NaN")}for(e=Yt(u),Rt=!1,a=Math.sqrt(+u),a==0||a==1/0?(t=Ra(u.d),(t.length+e)%2==0&&(t+="0"),a=Math.sqrt(t),e=zc((e+1)/2)-(e<0||e%2),a==1/0?t="5e"+e:(t=a.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),r=new d(t)):r=new d(a.toString()),n=d.precision,a=l=n+3;;)if(o=r,r=o.plus(wi(u,o,l+2)).times(.5),Ra(o.d).slice(0,l)===(t=Ra(r.d)).slice(0,l)){if(t=t.slice(l-3,l+1),a==l&&t=="4999"){if(wt(o,n+1,0),o.times(o).eq(u)){r=o;break}}else if(t!="9999")break;l+=4}return Rt=!0,wt(r,n)};Ne.times=Ne.mul=function(e){var t,n,r,a,o,l,u,d,h,p=this,v=p.constructor,g=p.d,y=(e=new v(e)).d;if(!p.s||!e.s)return new v(0);for(e.s*=p.s,n=p.e+e.e,d=g.length,h=y.length,d=0;){for(t=0,a=d+r;a>r;)u=o[a]+y[r]*g[a-r-1]+t,o[a--]=u%un|0,t=u/un|0;o[a]=(o[a]+t)%un|0}for(;!o[--l];)o.pop();return t?++n:o.shift(),e.d=o,e.e=n,Rt?wt(e,v.precision):e};Ne.toDecimalPlaces=Ne.todp=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(Ba(e,0,Ic),t===void 0?t=r.rounding:Ba(t,0,8),wt(n,e+Yt(n)+1,t))};Ne.toExponential=function(e,t){var n,r=this,a=r.constructor;return e===void 0?n=xs(r,!0):(Ba(e,0,Ic),t===void 0?t=a.rounding:Ba(t,0,8),r=wt(new a(r),e+1,t),n=xs(r,!0,e+1)),n};Ne.toFixed=function(e,t){var n,r,a=this,o=a.constructor;return e===void 0?xs(a):(Ba(e,0,Ic),t===void 0?t=o.rounding:Ba(t,0,8),r=wt(new o(a),e+Yt(a)+1,t),n=xs(r.abs(),!1,e+Yt(r)+1),a.isneg()&&!a.isZero()?"-"+n:n)};Ne.toInteger=Ne.toint=function(){var e=this,t=e.constructor;return wt(new t(e),Yt(e)+1,t.rounding)};Ne.toNumber=function(){return+this};Ne.toPower=Ne.pow=function(e){var t,n,r,a,o,l,u=this,d=u.constructor,h=12,p=+(e=new d(e));if(!e.s)return new d(Nr);if(u=new d(u),!u.s){if(e.s<1)throw Error(Jr+"Infinity");return u}if(u.eq(Nr))return u;if(r=d.precision,e.eq(Nr))return wt(u,r);if(t=e.e,n=e.d.length-1,l=t>=n,o=u.s,l){if((n=p<0?-p:p)<=Rz){for(a=new d(Nr),t=Math.ceil(r/Tt+4),Rt=!1;n%2&&(a=a.times(u),vD(a.d,t)),n=zc(n/2),n!==0;)u=u.times(u),vD(u.d,t);return Rt=!0,e.s<0?new d(Nr).div(a):wt(a,r)}}else if(o<0)throw Error(Jr+"NaN");return o=o<0&&e.d[Math.max(t,n)]&1?-1:1,u.s=1,Rt=!1,a=e.times(qf(u,r+h)),Rt=!0,a=kz(a),a.s=o,a};Ne.toPrecision=function(e,t){var n,r,a=this,o=a.constructor;return e===void 0?(n=Yt(a),r=xs(a,n<=o.toExpNeg||n>=o.toExpPos)):(Ba(e,1,Ic),t===void 0?t=o.rounding:Ba(t,0,8),a=wt(new o(a),e,t),n=Yt(a),r=xs(a,e<=n||n<=o.toExpNeg,e)),r};Ne.toSignificantDigits=Ne.tosd=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(Ba(e,1,Ic),t===void 0?t=r.rounding:Ba(t,0,8)),wt(new r(n),e,t)};Ne.toString=Ne.valueOf=Ne.val=Ne.toJSON=Ne[Symbol.for("nodejs.util.inspect.custom")]=function(){var e=this,t=Yt(e),n=e.constructor;return xs(e,t<=n.toExpNeg||t>=n.toExpPos)};function Pz(e,t){var n,r,a,o,l,u,d,h,p=e.constructor,v=p.precision;if(!e.s||!t.s)return t.s||(t=new p(e)),Rt?wt(t,v):t;if(d=e.d,h=t.d,l=e.e,a=t.e,d=d.slice(),o=l-a,o){for(o<0?(r=d,o=-o,u=h.length):(r=h,a=l,u=d.length),l=Math.ceil(v/Tt),u=l>u?l+1:u+1,o>u&&(o=u,r.length=1),r.reverse();o--;)r.push(0);r.reverse()}for(u=d.length,o=h.length,u-o<0&&(o=u,r=h,h=d,d=r),n=0;o;)n=(d[--o]=d[o]+h[o]+n)/un|0,d[o]%=un;for(n&&(d.unshift(n),++a),u=d.length;d[--u]==0;)d.pop();return t.d=d,t.e=a,Rt?wt(t,v):t}function Ba(e,t,n){if(e!==~~e||en)throw Error(fs+e)}function Ra(e){var t,n,r,a=e.length-1,o="",l=e[0];if(a>0){for(o+=l,t=1;tl?1:-1;else for(u=d=0;ua[u]?1:-1;break}return d}function n(r,a,o){for(var l=0;o--;)r[o]-=l,l=r[o]1;)r.shift()}return function(r,a,o,l){var u,d,h,p,v,g,y,j,b,w,A,O,N,T,E,C,R,k,M=r.constructor,U=r.s==a.s?1:-1,$=r.d,z=a.d;if(!r.s)return new M(r);if(!a.s)throw Error(Jr+"Division by zero");for(d=r.e-a.e,R=z.length,E=$.length,y=new M(U),j=y.d=[],h=0;z[h]==($[h]||0);)++h;if(z[h]>($[h]||0)&&--d,o==null?O=o=M.precision:l?O=o+(Yt(r)-Yt(a))+1:O=o,O<0)return new M(0);if(O=O/Tt+2|0,h=0,R==1)for(p=0,z=z[0],O++;(h1&&(z=e(z,p),$=e($,p),R=z.length,E=$.length),T=R,b=$.slice(0,R),w=b.length;w=un/2&&++C;do p=0,u=t(z,b,R,w),u<0?(A=b[0],R!=w&&(A=A*un+(b[1]||0)),p=A/C|0,p>1?(p>=un&&(p=un-1),v=e(z,p),g=v.length,w=b.length,u=t(v,b,g,w),u==1&&(p--,n(v,R16)throw Error(LA+Yt(e));if(!e.s)return new p(Nr);for(Rt=!1,u=v,l=new p(.03125);e.abs().gte(.1);)e=e.times(l),h+=5;for(r=Math.log(Qo(2,h))/Math.LN10*2+5|0,u+=r,n=a=o=new p(Nr),p.precision=u;;){if(a=wt(a.times(e),u),n=n.times(++d),l=o.plus(wi(a,n,u)),Ra(l.d).slice(0,u)===Ra(o.d).slice(0,u)){for(;h--;)o=wt(o.times(o),u);return p.precision=v,t==null?(Rt=!0,wt(o,v)):o}o=l}}function Yt(e){for(var t=e.e*Tt,n=e.d[0];n>=10;n/=10)t++;return t}function NS(e,t,n){if(t>e.LN10.sd())throw Rt=!0,n&&(e.precision=n),Error(Jr+"LN10 precision limit exceeded");return wt(new e(e.LN10),t)}function so(e){for(var t="";e--;)t+="0";return t}function qf(e,t){var n,r,a,o,l,u,d,h,p,v=1,g=10,y=e,j=y.d,b=y.constructor,w=b.precision;if(y.s<1)throw Error(Jr+(y.s?"NaN":"-Infinity"));if(y.eq(Nr))return new b(0);if(t==null?(Rt=!1,h=w):h=t,y.eq(10))return t==null&&(Rt=!0),NS(b,h);if(h+=g,b.precision=h,n=Ra(j),r=n.charAt(0),o=Yt(y),Math.abs(o)<15e14){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)y=y.times(e),n=Ra(y.d),r=n.charAt(0),v++;o=Yt(y),r>1?(y=new b("0."+n),o++):y=new b(r+"."+n.slice(1))}else return d=NS(b,h+2,w).times(o+""),y=qf(new b(r+"."+n.slice(1)),h-g).plus(d),b.precision=w,t==null?(Rt=!0,wt(y,w)):y;for(u=l=y=wi(y.minus(Nr),y.plus(Nr),h),p=wt(y.times(y),h),a=3;;){if(l=wt(l.times(p),h),d=u.plus(wi(l,new b(a),h)),Ra(d.d).slice(0,h)===Ra(u.d).slice(0,h))return u=u.times(2),o!==0&&(u=u.plus(NS(b,h+2,w).times(o+""))),u=wi(u,new b(v),h),b.precision=w,t==null?(Rt=!0,wt(u,w)):u;u=d,a+=2}}function mD(e,t){var n,r,a;for((n=t.indexOf("."))>-1&&(t=t.replace(".","")),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;)++r;for(a=t.length;t.charCodeAt(a-1)===48;)--a;if(t=t.slice(r,a),t){if(a-=r,n=n-r-1,e.e=zc(n/Tt),e.d=[],r=(n+1)%Tt,n<0&&(r+=Tt),rxm||e.e<-xm))throw Error(LA+n)}else e.s=0,e.e=0,e.d=[0];return e}function wt(e,t,n){var r,a,o,l,u,d,h,p,v=e.d;for(l=1,o=v[0];o>=10;o/=10)l++;if(r=t-l,r<0)r+=Tt,a=t,h=v[p=0];else{if(p=Math.ceil((r+1)/Tt),o=v.length,p>=o)return e;for(h=o=v[p],l=1;o>=10;o/=10)l++;r%=Tt,a=r-Tt+l}if(n!==void 0&&(o=Qo(10,l-a-1),u=h/o%10|0,d=t<0||v[p+1]!==void 0||h%o,d=n<4?(u||d)&&(n==0||n==(e.s<0?3:2)):u>5||u==5&&(n==4||d||n==6&&(r>0?a>0?h/Qo(10,l-a):0:v[p-1])%10&1||n==(e.s<0?8:7))),t<1||!v[0])return d?(o=Yt(e),v.length=1,t=t-o-1,v[0]=Qo(10,(Tt-t%Tt)%Tt),e.e=zc(-t/Tt)||0):(v.length=1,v[0]=e.e=e.s=0),e;if(r==0?(v.length=p,o=1,p--):(v.length=p+1,o=Qo(10,Tt-r),v[p]=a>0?(h/Qo(10,l-a)%Qo(10,a)|0)*o:0),d)for(;;)if(p==0){(v[0]+=o)==un&&(v[0]=1,++e.e);break}else{if(v[p]+=o,v[p]!=un)break;v[p--]=0,o=1}for(r=v.length;v[--r]===0;)v.pop();if(Rt&&(e.e>xm||e.e<-xm))throw Error(LA+Yt(e));return e}function Mz(e,t){var n,r,a,o,l,u,d,h,p,v,g=e.constructor,y=g.precision;if(!e.s||!t.s)return t.s?t.s=-t.s:t=new g(e),Rt?wt(t,y):t;if(d=e.d,v=t.d,r=t.e,h=e.e,d=d.slice(),l=h-r,l){for(p=l<0,p?(n=d,l=-l,u=v.length):(n=v,r=h,u=d.length),a=Math.max(Math.ceil(y/Tt),u)+2,l>a&&(l=a,n.length=1),n.reverse(),a=l;a--;)n.push(0);n.reverse()}else{for(a=d.length,u=v.length,p=a0;--a)d[u++]=0;for(a=v.length;a>l;){if(d[--a]0?o=o.charAt(0)+"."+o.slice(1)+so(r):l>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(a<0?"e":"e+")+a):a<0?(o="0."+so(-a-1)+o,n&&(r=n-l)>0&&(o+=so(r))):a>=l?(o+=so(a+1-l),n&&(r=n-a-1)>0&&(o=o+"."+so(r))):((r=a+1)0&&(a+1===l&&(o+="."),o+=so(r))),e.s<0?"-"+o:o}function vD(e,t){if(e.length>t)return e.length=t,!0}function Dz(e){var t,n,r;function a(o){var l=this;if(!(l instanceof a))return new a(o);if(l.constructor=a,o instanceof a){l.s=o.s,l.e=o.e,l.d=(o=o.d)?o.slice():o;return}if(typeof o=="number"){if(o*0!==0)throw Error(fs+o);if(o>0)l.s=1;else if(o<0)o=-o,l.s=-1;else{l.s=0,l.e=0,l.d=[0];return}if(o===~~o&&o<1e7){l.e=0,l.d=[o];return}return mD(l,o.toString())}else if(typeof o!="string")throw Error(fs+o);if(o.charCodeAt(0)===45?(o=o.slice(1),l.s=-1):l.s=1,Fte.test(o))mD(l,o);else throw Error(fs+o)}if(a.prototype=Ne,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.clone=Dz,a.config=a.set=Hte,e===void 0&&(e={}),e)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],t=0;t=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(fs+n+": "+r);if((r=e[n="LN10"])!==void 0)if(r==Math.LN10)this[n]=new this(r);else throw Error(fs+n+": "+r);return this}var $A=Dz(Ute);Nr=new $A(1);const yt=$A;function Vte(e){return Yte(e)||Wte(e)||Kte(e)||Gte()}function Gte(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Kte(e,t){if(e){if(typeof e=="string")return sj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return sj(e,t)}}function Wte(e){if(typeof Symbol<"u"&&Symbol.iterator in Object(e))return Array.from(e)}function Yte(e){if(Array.isArray(e))return sj(e)}function sj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=t?n.apply(void 0,a):e(t-l,gD(function(){for(var u=arguments.length,d=new Array(u),h=0;he.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!(Symbol.iterator in Object(e)))){var n=[],r=!0,a=!1,o=void 0;try{for(var l=e[Symbol.iterator](),u;!(r=(u=l.next()).done)&&(n.push(u.value),!(t&&n.length===t));r=!0);}catch(d){a=!0,o=d}finally{try{!r&&l.return!=null&&l.return()}finally{if(a)throw o}}return n}}function une(e){if(Array.isArray(e))return e}function Bz(e){var t=Uf(e,2),n=t[0],r=t[1],a=n,o=r;return n>r&&(a=r,o=n),[a,o]}function qz(e,t,n){if(e.lte(0))return new yt(0);var r=Bv.getDigitCount(e.toNumber()),a=new yt(10).pow(r),o=e.div(a),l=r!==1?.05:.1,u=new yt(Math.ceil(o.div(l).toNumber())).add(n).mul(l),d=u.mul(a);return t?d:new yt(Math.ceil(d))}function fne(e,t,n){var r=1,a=new yt(e);if(!a.isint()&&n){var o=Math.abs(e);o<1?(r=new yt(10).pow(Bv.getDigitCount(e)-1),a=new yt(Math.floor(a.div(r).toNumber())).mul(r)):o>1&&(a=new yt(Math.floor(e)))}else e===0?a=new yt(Math.floor((t-1)/2)):n||(a=new yt(Math.floor(e)));var l=Math.floor((t-1)/2),u=Jte(Qte(function(d){return a.add(new yt(d-l).mul(r)).toNumber()}),lj);return u(0,t)}function Uz(e,t,n,r){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((t-e)/(n-1)))return{step:new yt(0),tickMin:new yt(0),tickMax:new yt(0)};var o=qz(new yt(t).sub(e).div(n-1),r,a),l;e<=0&&t>=0?l=new yt(0):(l=new yt(e).add(t).div(2),l=l.sub(new yt(l).mod(o)));var u=Math.ceil(l.sub(e).div(o).toNumber()),d=Math.ceil(new yt(t).sub(l).div(o).toNumber()),h=u+d+1;return h>n?Uz(e,t,n,r,a+1):(h0?d+(n-h):d,u=t>0?u:u+(n-h)),{step:o,tickMin:l.sub(new yt(u).mul(o)),tickMax:l.add(new yt(d).mul(o))})}function dne(e){var t=Uf(e,2),n=t[0],r=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=Math.max(a,2),u=Bz([n,r]),d=Uf(u,2),h=d[0],p=d[1];if(h===-1/0||p===1/0){var v=p===1/0?[h].concat(uj(lj(0,a-1).map(function(){return 1/0}))):[].concat(uj(lj(0,a-1).map(function(){return-1/0})),[p]);return n>r?cj(v):v}if(h===p)return fne(h,a,o);var g=Uz(h,p,l,o),y=g.step,j=g.tickMin,b=g.tickMax,w=Bv.rangeStep(j,b.add(new yt(.1).mul(y)),y);return n>r?cj(w):w}function hne(e,t){var n=Uf(e,2),r=n[0],a=n[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=Bz([r,a]),u=Uf(l,2),d=u[0],h=u[1];if(d===-1/0||h===1/0)return[r,a];if(d===h)return[d];var p=Math.max(t,2),v=qz(new yt(h).sub(d).div(p-1),o,0),g=[].concat(uj(Bv.rangeStep(new yt(d),new yt(h).sub(new yt(.99).mul(v)),v)),[h]);return r>a?cj(g):g}var pne=Iz(dne),mne=Iz(hne),vne=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function lc(e){"@babel/helpers - typeof";return lc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},lc(e)}function bm(){return bm=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function jne(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function _ne(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ane(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1&&arguments[1]!==void 0?arguments[1]:[],a=arguments.length>2?arguments[2]:void 0,o=arguments.length>3?arguments[3]:void 0,l=-1,u=(n=r?.length)!==null&&n!==void 0?n:0;if(u<=1)return 0;if(o&&o.axisType==="angleAxis"&&Math.abs(Math.abs(o.range[1]-o.range[0])-360)<=1e-6)for(var d=o.range,h=0;h0?a[h-1].coordinate:a[u-1].coordinate,v=a[h].coordinate,g=h>=u-1?a[0].coordinate:a[h+1].coordinate,y=void 0;if(qn(v-p)!==qn(g-v)){var j=[];if(qn(g-v)===qn(d[1]-d[0])){y=g;var b=v+d[1]-d[0];j[0]=Math.min(b,(b+p)/2),j[1]=Math.max(b,(b+p)/2)}else{y=p;var w=g+d[1]-d[0];j[0]=Math.min(v,(w+v)/2),j[1]=Math.max(v,(w+v)/2)}var A=[Math.min(v,(y+v)/2),Math.max(v,(y+v)/2)];if(t>A[0]&&t<=A[1]||t>=j[0]&&t<=j[1]){l=a[h].index;break}}else{var O=Math.min(p,g),N=Math.max(p,g);if(t>(O+v)/2&&t<=(N+v)/2){l=a[h].index;break}}}else for(var T=0;T0&&T(r[T].coordinate+r[T-1].coordinate)/2&&t<=(r[T].coordinate+r[T+1].coordinate)/2||T===u-1&&t>(r[T].coordinate+r[T-1].coordinate)/2){l=r[T].index;break}return l},IA=function(t){var n,r=t,a=r.type.displayName,o=(n=t.type)!==null&&n!==void 0&&n.defaultProps?It(It({},t.type.defaultProps),t.props):t.props,l=o.stroke,u=o.fill,d;switch(a){case"Line":d=l;break;case"Area":case"Radar":d=l&&l!=="none"?l:u;break;default:d=u;break}return d},Une=function(t){var n=t.barSize,r=t.totalSize,a=t.stackGroups,o=a===void 0?{}:a;if(!o)return{};for(var l={},u=Object.keys(o),d=0,h=u.length;d=0});if(A&&A.length){var O=A[0].type.defaultProps,N=O!==void 0?It(It({},O),A[0].props):A[0].props,T=N.barSize,E=N[w];l[E]||(l[E]=[]);var C=Ue(T)?n:T;l[E].push({item:A[0],stackList:A.slice(1),barSize:Ue(C)?void 0:Un(C,r,0)})}}return l},Fne=function(t){var n=t.barGap,r=t.barCategoryGap,a=t.bandSize,o=t.sizeList,l=o===void 0?[]:o,u=t.maxBarSize,d=l.length;if(d<1)return null;var h=Un(n,a,0,!0),p,v=[];if(l[0].barSize===+l[0].barSize){var g=!1,y=a/d,j=l.reduce(function(T,E){return T+E.barSize||0},0);j+=(d-1)*h,j>=a&&(j-=(d-1)*h,h=0),j>=a&&y>0&&(g=!0,y*=.9,j=d*y);var b=(a-j)/2>>0,w={offset:b-h,size:0};p=l.reduce(function(T,E){var C={item:E.item,position:{offset:w.offset+w.size+h,size:g?y:E.barSize}},R=[].concat(bD(T),[C]);return w=R[R.length-1].position,E.stackList&&E.stackList.length&&E.stackList.forEach(function(k){R.push({item:k,position:w})}),R},v)}else{var A=Un(r,a,0,!0);a-2*A-(d-1)*h<=0&&(h=0);var O=(a-2*A-(d-1)*h)/d;O>1&&(O>>=0);var N=u===+u?Math.min(O,u):O;p=l.reduce(function(T,E,C){var R=[].concat(bD(T),[{item:E.item,position:{offset:A+(O+h)*C+(O-N)/2,size:N}}]);return E.stackList&&E.stackList.length&&E.stackList.forEach(function(k){R.push({item:k,position:R[R.length-1].position})}),R},v)}return p},Hne=function(t,n,r,a){var o=r.children,l=r.width,u=r.margin,d=l-(u.left||0)-(u.right||0),h=Gz({children:o,legendWidth:d});if(h){var p=a||{},v=p.width,g=p.height,y=h.align,j=h.verticalAlign,b=h.layout;if((b==="vertical"||b==="horizontal"&&j==="middle")&&y!=="center"&&_e(t[y]))return It(It({},t),{},Ul({},y,t[y]+(v||0)));if((b==="horizontal"||b==="vertical"&&y==="center")&&j!=="middle"&&_e(t[j]))return It(It({},t),{},Ul({},j,t[j]+(g||0)))}return t},Vne=function(t,n,r){return Ue(n)?!0:t==="horizontal"?n==="yAxis":t==="vertical"||r==="x"?n==="xAxis":r==="y"?n==="yAxis":!0},Kz=function(t,n,r,a,o){var l=n.props.children,u=Tr(l,Ed).filter(function(h){return Vne(a,o,h.props.direction)});if(u&&u.length){var d=u.map(function(h){return h.props.dataKey});return t.reduce(function(h,p){var v=rn(p,r);if(Ue(v))return h;var g=Array.isArray(v)?[Iv(v),$v(v)]:[v,v],y=d.reduce(function(j,b){var w=rn(p,b,0),A=g[0]-Math.abs(Array.isArray(w)?w[0]:w),O=g[1]+Math.abs(Array.isArray(w)?w[1]:w);return[Math.min(A,j[0]),Math.max(O,j[1])]},[1/0,-1/0]);return[Math.min(y[0],h[0]),Math.max(y[1],h[1])]},[1/0,-1/0])}return null},Gne=function(t,n,r,a,o){var l=n.map(function(u){return Kz(t,u,r,o,a)}).filter(function(u){return!Ue(u)});return l&&l.length?l.reduce(function(u,d){return[Math.min(u[0],d[0]),Math.max(u[1],d[1])]},[1/0,-1/0]):null},Wz=function(t,n,r,a,o){var l=n.map(function(d){var h=d.props.dataKey;return r==="number"&&h&&Kz(t,d,h,a)||wf(t,h,r,o)});if(r==="number")return l.reduce(function(d,h){return[Math.min(d[0],h[0]),Math.max(d[1],h[1])]},[1/0,-1/0]);var u={};return l.reduce(function(d,h){for(var p=0,v=h.length;p=2?qn(u[0]-u[1])*2*h:h,n&&(t.ticks||t.niceTicks)){var p=(t.ticks||t.niceTicks).map(function(v){var g=o?o.indexOf(v):v;return{coordinate:a(g)+h,value:v,offset:h}});return p.filter(function(v){return!wd(v.coordinate)})}return t.isCategorical&&t.categoricalDomain?t.categoricalDomain.map(function(v,g){return{coordinate:a(v)+h,value:v,index:g,offset:h}}):a.ticks&&!r?a.ticks(t.tickCount).map(function(v){return{coordinate:a(v)+h,value:v,offset:h}}):a.domain().map(function(v,g){return{coordinate:a(v)+h,value:o?o[v]:v,index:g,offset:h}})},ES=new WeakMap,gp=function(t,n){if(typeof n!="function")return t;ES.has(t)||ES.set(t,new WeakMap);var r=ES.get(t);if(r.has(n))return r.get(n);var a=function(){t.apply(void 0,arguments),n.apply(void 0,arguments)};return r.set(n,a),a},Zz=function(t,n,r){var a=t.scale,o=t.type,l=t.layout,u=t.axisType;if(a==="auto")return l==="radial"&&u==="radiusAxis"?{scale:Lf(),realScaleType:"band"}:l==="radial"&&u==="angleAxis"?{scale:mm(),realScaleType:"linear"}:o==="category"&&n&&(n.indexOf("LineChart")>=0||n.indexOf("AreaChart")>=0||n.indexOf("ComposedChart")>=0&&!r)?{scale:bf(),realScaleType:"point"}:o==="category"?{scale:Lf(),realScaleType:"band"}:{scale:mm(),realScaleType:"linear"};if(vs(a)){var d="scale".concat(Sv(a));return{scale:(oD[d]||bf)(),realScaleType:oD[d]?d:"point"}}return Be(a)?{scale:a}:{scale:bf(),realScaleType:"point"}},SD=1e-4,Qz=function(t){var n=t.domain();if(!(!n||n.length<=2)){var r=n.length,a=t.range(),o=Math.min(a[0],a[1])-SD,l=Math.max(a[0],a[1])+SD,u=t(n[0]),d=t(n[r-1]);(ul||dl)&&t.domain([n[0],n[r-1]])}},Kne=function(t,n){if(!t)return null;for(var r=0,a=t.length;ra)&&(o[1]=a),o[0]>a&&(o[0]=a),o[1]=0?(t[u][r][0]=o,t[u][r][1]=o+d,o=t[u][r][1]):(t[u][r][0]=l,t[u][r][1]=l+d,l=t[u][r][1])}},Xne=function(t){var n=t.length;if(!(n<=0))for(var r=0,a=t[0].length;r=0?(t[l][r][0]=o,t[l][r][1]=o+u,o=t[l][r][1]):(t[l][r][0]=0,t[l][r][1]=0)}},Zne={sign:Yne,expand:IY,none:ec,silhouette:zY,wiggle:BY,positive:Xne},Qne=function(t,n,r){var a=n.map(function(u){return u.props.dataKey}),o=Zne[r],l=$Y().keys(a).value(function(u,d){return+rn(u,d,0)}).order(F1).offset(o);return l(t)},Jne=function(t,n,r,a,o,l){if(!t)return null;var u=l?n.reverse():n,d={},h=u.reduce(function(v,g){var y,j=(y=g.type)!==null&&y!==void 0&&y.defaultProps?It(It({},g.type.defaultProps),g.props):g.props,b=j.stackId,w=j.hide;if(w)return v;var A=j[r],O=v[A]||{hasStack:!1,stackGroups:{}};if(an(b)){var N=O.stackGroups[b]||{numericAxisId:r,cateAxisId:a,items:[]};N.items.push(g),O.hasStack=!0,O.stackGroups[b]=N}else O.stackGroups[Dc("_stackId_")]={numericAxisId:r,cateAxisId:a,items:[g]};return It(It({},v),{},Ul({},A,O))},d),p={};return Object.keys(h).reduce(function(v,g){var y=h[g];if(y.hasStack){var j={};y.stackGroups=Object.keys(y.stackGroups).reduce(function(b,w){var A=y.stackGroups[w];return It(It({},b),{},Ul({},w,{numericAxisId:r,cateAxisId:a,items:A.items,stackedData:Qne(t,A.items,o)}))},j)}return It(It({},v),{},Ul({},g,y))},p)},Jz=function(t,n){var r=n.realScaleType,a=n.type,o=n.tickCount,l=n.originalDomain,u=n.allowDecimals,d=r||n.scale;if(d!=="auto"&&d!=="linear")return null;if(o&&a==="number"&&l&&(l[0]==="auto"||l[1]==="auto")){var h=t.domain();if(!h.length)return null;var p=pne(h,o,u);return t.domain([Iv(p),$v(p)]),{niceTicks:p}}if(o&&a==="number"){var v=t.domain(),g=mne(v,o,u);return{niceTicks:g}}return null};function jD(e){var t=e.axis,n=e.ticks,r=e.bandSize,a=e.entry,o=e.index,l=e.dataKey;if(t.type==="category"){if(!t.allowDuplicatedCategory&&t.dataKey&&!Ue(a[t.dataKey])){var u=Zp(n,"value",a[t.dataKey]);if(u)return u.coordinate+r/2}return n[o]?n[o].coordinate+r/2:null}var d=rn(a,Ue(l)?t.dataKey:l);return Ue(d)?null:t.scale(d)}var _D=function(t){var n=t.axis,r=t.ticks,a=t.offset,o=t.bandSize,l=t.entry,u=t.index;if(n.type==="category")return r[u]?r[u].coordinate+a:null;var d=rn(l,n.dataKey,n.domain[u]);return Ue(d)?null:n.scale(d)-o/2+a},ere=function(t){var n=t.numericAxis,r=n.scale.domain();if(n.type==="number"){var a=Math.min(r[0],r[1]),o=Math.max(r[0],r[1]);return a<=0&&o>=0?0:o<0?o:a}return r[0]},tre=function(t,n){var r,a=(r=t.type)!==null&&r!==void 0&&r.defaultProps?It(It({},t.type.defaultProps),t.props):t.props,o=a.stackId;if(an(o)){var l=n[o];if(l){var u=l.items.indexOf(t);return u>=0?l.stackedData[u]:null}}return null},nre=function(t){return t.reduce(function(n,r){return[Iv(r.concat([n[0]]).filter(_e)),$v(r.concat([n[1]]).filter(_e))]},[1/0,-1/0])},eB=function(t,n,r){return Object.keys(t).reduce(function(a,o){var l=t[o],u=l.stackedData,d=u.reduce(function(h,p){var v=nre(p.slice(n,r+1));return[Math.min(h[0],v[0]),Math.max(h[1],v[1])]},[1/0,-1/0]);return[Math.min(d[0],a[0]),Math.max(d[1],a[1])]},[1/0,-1/0]).map(function(a){return a===1/0||a===-1/0?0:a})},AD=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,OD=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,pj=function(t,n,r){if(Be(t))return t(n,r);if(!Array.isArray(t))return n;var a=[];if(_e(t[0]))a[0]=r?t[0]:Math.min(t[0],n[0]);else if(AD.test(t[0])){var o=+AD.exec(t[0])[1];a[0]=n[0]-o}else Be(t[0])?a[0]=t[0](n[0]):a[0]=n[0];if(_e(t[1]))a[1]=r?t[1]:Math.max(t[1],n[1]);else if(OD.test(t[1])){var l=+OD.exec(t[1])[1];a[1]=n[1]+l}else Be(t[1])?a[1]=t[1](n[1]):a[1]=n[1];return a},Sm=function(t,n,r){if(t&&t.scale&&t.scale.bandwidth){var a=t.scale.bandwidth();if(!r||a>0)return a}if(t&&n&&n.length>=2){for(var o=dA(n,function(v){return v.coordinate}),l=1/0,u=1,d=o.length;ue.length)&&(t=e.length);for(var n=0,r=new Array(t);n2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(t-(r.left||0)-(r.right||0)),Math.abs(n-(r.top||0)-(r.bottom||0)))/2},fre=function(t,n,r,a,o){var l=t.width,u=t.height,d=t.startAngle,h=t.endAngle,p=Un(t.cx,l,l/2),v=Un(t.cy,u,u/2),g=rB(l,u,r),y=Un(t.innerRadius,g,0),j=Un(t.outerRadius,g,g*.8),b=Object.keys(n);return b.reduce(function(w,A){var O=n[A],N=O.domain,T=O.reversed,E;if(Ue(O.range))a==="angleAxis"?E=[d,h]:a==="radiusAxis"&&(E=[y,j]),T&&(E=[E[1],E[0]]);else{E=O.range;var C=E,R=ire(C,2);d=R[0],h=R[1]}var k=Zz(O,o),M=k.realScaleType,U=k.scale;U.domain(N).range(E),Qz(U);var $=Jz(U,pi(pi({},O),{},{realScaleType:M})),z=pi(pi(pi({},O),$),{},{range:E,radius:j,realScaleType:M,scale:U,cx:p,cy:v,innerRadius:y,outerRadius:j,startAngle:d,endAngle:h});return pi(pi({},w),{},nB({},A,z))},{})},dre=function(t,n){var r=t.x,a=t.y,o=n.x,l=n.y;return Math.sqrt(Math.pow(r-o,2)+Math.pow(a-l,2))},hre=function(t,n){var r=t.x,a=t.y,o=n.cx,l=n.cy,u=dre({x:r,y:a},{x:o,y:l});if(u<=0)return{radius:u};var d=(r-o)/u,h=Math.acos(d);return a>l&&(h=2*Math.PI-h),{radius:u,angle:ure(h),angleInRadian:h}},pre=function(t){var n=t.startAngle,r=t.endAngle,a=Math.floor(n/360),o=Math.floor(r/360),l=Math.min(a,o);return{startAngle:n-l*360,endAngle:r-l*360}},mre=function(t,n){var r=n.startAngle,a=n.endAngle,o=Math.floor(r/360),l=Math.floor(a/360),u=Math.min(o,l);return t+u*360},CD=function(t,n){var r=t.x,a=t.y,o=hre({x:r,y:a},n),l=o.radius,u=o.angle,d=n.innerRadius,h=n.outerRadius;if(lh)return!1;if(l===0)return!0;var p=pre(n),v=p.startAngle,g=p.endAngle,y=u,j;if(v<=g){for(;y>g;)y-=360;for(;y=v&&y<=g}else{for(;y>v;)y-=360;for(;y=g&&y<=v}return j?pi(pi({},n),{},{radius:l,angle:mre(y,n)}):null},aB=function(t){return!S.isValidElement(t)&&!Be(t)&&typeof t!="boolean"?t.className:""};function Gf(e){"@babel/helpers - typeof";return Gf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Gf(e)}var vre=["offset"];function gre(e){return wre(e)||bre(e)||xre(e)||yre()}function yre(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function xre(e,t){if(e){if(typeof e=="string")return mj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return mj(e,t)}}function bre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function wre(e){if(Array.isArray(e))return mj(e)}function mj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function jre(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function RD(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Jt(e){for(var t=1;t=0?1:-1,N,T;a==="insideStart"?(N=y+O*l,T=b):a==="insideEnd"?(N=j-O*l,T=!b):a==="end"&&(N=j+O*l,T=b),T=A<=0?T:!T;var E=At(h,p,w,N),C=At(h,p,w,N+(T?1:-1)*359),R="M".concat(E.x,",").concat(E.y,` A`).concat(w,",").concat(w,",0,1,").concat(T?0:1,`, `).concat(C.x,",").concat(C.y),k=Ue(t.id)?Dc("recharts-radial-line-"):t.id;return K.createElement("text",Kf({},r,{dominantBaseline:"central",className:Ve("recharts-radial-bar-label",u)}),K.createElement("defs",null,K.createElement("path",{id:k,d:R})),K.createElement("textPath",{xlinkHref:"#".concat(k)},n))},Cre=function(t){var n=t.viewBox,r=t.offset,a=t.position,o=n,l=o.cx,u=o.cy,d=o.innerRadius,h=o.outerRadius,p=o.startAngle,v=o.endAngle,g=(p+v)/2;if(a==="outside"){var y=At(l,u,h+r,g),j=y.x,b=y.y;return{x:j,y:b,textAnchor:j>=l?"start":"end",verticalAnchor:"middle"}}if(a==="center")return{x:l,y:u,textAnchor:"middle",verticalAnchor:"middle"};if(a==="centerTop")return{x:l,y:u,textAnchor:"middle",verticalAnchor:"start"};if(a==="centerBottom")return{x:l,y:u,textAnchor:"middle",verticalAnchor:"end"};var w=(d+h)/2,A=At(l,u,w,g),O=A.x,N=A.y;return{x:O,y:N,textAnchor:"middle",verticalAnchor:"middle"}},Rre=function(t){var n=t.viewBox,r=t.parentViewBox,a=t.offset,o=t.position,l=n,u=l.x,d=l.y,h=l.width,p=l.height,v=p>=0?1:-1,g=v*a,y=v>0?"end":"start",j=v>0?"start":"end",b=h>=0?1:-1,w=b*a,A=b>0?"end":"start",O=b>0?"start":"end";if(o==="top"){var N={x:u+h/2,y:d-v*a,textAnchor:"middle",verticalAnchor:y};return Jt(Jt({},N),r?{height:Math.max(d-r.y,0),width:h}:{})}if(o==="bottom"){var T={x:u+h/2,y:d+p+g,textAnchor:"middle",verticalAnchor:j};return Jt(Jt({},T),r?{height:Math.max(r.y+r.height-(d+p),0),width:h}:{})}if(o==="left"){var E={x:u-w,y:d+p/2,textAnchor:A,verticalAnchor:"middle"};return Jt(Jt({},E),r?{width:Math.max(E.x-r.x,0),height:p}:{})}if(o==="right"){var C={x:u+h+w,y:d+p/2,textAnchor:O,verticalAnchor:"middle"};return Jt(Jt({},C),r?{width:Math.max(r.x+r.width-C.x,0),height:p}:{})}var R=r?{width:h,height:p}:{};return o==="insideLeft"?Jt({x:u+w,y:d+p/2,textAnchor:O,verticalAnchor:"middle"},R):o==="insideRight"?Jt({x:u+h-w,y:d+p/2,textAnchor:A,verticalAnchor:"middle"},R):o==="insideTop"?Jt({x:u+h/2,y:d+g,textAnchor:"middle",verticalAnchor:j},R):o==="insideBottom"?Jt({x:u+h/2,y:d+p-g,textAnchor:"middle",verticalAnchor:y},R):o==="insideTopLeft"?Jt({x:u+w,y:d+g,textAnchor:O,verticalAnchor:j},R):o==="insideTopRight"?Jt({x:u+h-w,y:d+g,textAnchor:A,verticalAnchor:j},R):o==="insideBottomLeft"?Jt({x:u+w,y:d+p-g,textAnchor:O,verticalAnchor:y},R):o==="insideBottomRight"?Jt({x:u+h-w,y:d+p-g,textAnchor:A,verticalAnchor:y},R):Mc(o)&&(_e(o.x)||ts(o.x))&&(_e(o.y)||ts(o.y))?Jt({x:u+Un(o.x,h),y:d+Un(o.y,p),textAnchor:"end",verticalAnchor:"end"},R):Jt({x:u+h/2,y:d+p/2,textAnchor:"middle",verticalAnchor:"middle"},R)},Pre=function(t){return"cx"in t&&_e(t.cx)};function fn(e){var t=e.offset,n=t===void 0?5:t,r=Sre(e,vre),a=Jt({offset:n},r),o=a.viewBox,l=a.position,u=a.value,d=a.children,h=a.content,p=a.className,v=p===void 0?"":p,g=a.textBreakAll;if(!o||Ue(u)&&Ue(d)&&!S.isValidElement(h)&&!Be(h))return null;if(S.isValidElement(h))return S.cloneElement(h,a);var y;if(Be(h)){if(y=S.createElement(h,a),S.isValidElement(y))return y}else y=Nre(a);var j=Pre(o),b=Le(a,!0);if(j&&(l==="insideStart"||l==="insideEnd"||l==="end"))return Tre(a,y,b);var w=j?Cre(a):Rre(a);return K.createElement(ys,Kf({className:Ve("recharts-label",v)},b,w,{breakAll:g}),y)}fn.displayName="Label";var iB=function(t){var n=t.cx,r=t.cy,a=t.angle,o=t.startAngle,l=t.endAngle,u=t.r,d=t.radius,h=t.innerRadius,p=t.outerRadius,v=t.x,g=t.y,y=t.top,j=t.left,b=t.width,w=t.height,A=t.clockWise,O=t.labelViewBox;if(O)return O;if(_e(b)&&_e(w)){if(_e(v)&&_e(g))return{x:v,y:g,width:b,height:w};if(_e(y)&&_e(j))return{x:y,y:j,width:b,height:w}}return _e(v)&&_e(g)?{x:v,y:g,width:0,height:0}:_e(n)&&_e(r)?{cx:n,cy:r,startAngle:o||a||0,endAngle:l||a||0,innerRadius:h||0,outerRadius:p||d||u||0,clockWise:A}:t.viewBox?t.viewBox:{}},kre=function(t,n){return t?t===!0?K.createElement(fn,{key:"label-implicit",viewBox:n}):an(t)?K.createElement(fn,{key:"label-implicit",viewBox:n,value:t}):S.isValidElement(t)?t.type===fn?S.cloneElement(t,{key:"label-implicit",viewBox:n}):K.createElement(fn,{key:"label-implicit",content:t,viewBox:n}):Be(t)?K.createElement(fn,{key:"label-implicit",content:t,viewBox:n}):Mc(t)?K.createElement(fn,Kf({viewBox:n},t,{key:"label-implicit"})):null:null},Mre=function(t,n){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var a=t.children,o=iB(t),l=Tr(a,fn).map(function(d,h){return S.cloneElement(d,{viewBox:n||o,key:"label-".concat(h)})});if(!r)return l;var u=kre(t.label,n||o);return[u].concat(gre(l))};fn.parseViewBox=iB;fn.renderCallByParent=Mre;var TS,PD;function Dre(){if(PD)return TS;PD=1;function e(t){var n=t==null?0:t.length;return n?t[n-1]:void 0}return TS=e,TS}var Lre=Dre();const $re=ft(Lre);function Wf(e){"@babel/helpers - typeof";return Wf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Wf(e)}var Ire=["valueAccessor"],zre=["data","dataKey","clockWise","id","textBreakAll"];function Bre(e){return Hre(e)||Fre(e)||Ure(e)||qre()}function qre(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ure(e,t){if(e){if(typeof e=="string")return vj(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return vj(e,t)}}function Fre(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Hre(e){if(Array.isArray(e))return vj(e)}function vj(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Wre(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Yre=function(t){return Array.isArray(t.value)?$re(t.value):t.value};function Si(e){var t=e.valueAccessor,n=t===void 0?Yre:t,r=DD(e,Ire),a=r.data,o=r.dataKey,l=r.clockWise,u=r.id,d=r.textBreakAll,h=DD(r,zre);return!a||!a.length?null:K.createElement(ot,{className:"recharts-label-list"},a.map(function(p,v){var g=Ue(o)?n(p,v):rn(p&&p.payload,o),y=Ue(u)?{}:{id:"".concat(u,"-").concat(v)};return K.createElement(fn,_m({},Le(p,!0),h,y,{parentViewBox:p.parentViewBox,value:g,textBreakAll:d,viewBox:fn.parseViewBox(Ue(l)?p:MD(MD({},p),{},{clockWise:l})),key:"label-".concat(v),index:v}))}))}Si.displayName="LabelList";function Xre(e,t){return e?e===!0?K.createElement(Si,{key:"labelList-implicit",data:t}):K.isValidElement(e)||Be(e)?K.createElement(Si,{key:"labelList-implicit",data:t,content:e}):Mc(e)?K.createElement(Si,_m({data:t},e,{key:"labelList-implicit"})):null:null}function Zre(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var r=e.children,a=Tr(r,Si).map(function(l,u){return S.cloneElement(l,{data:t,key:"labelList-".concat(u)})});if(!n)return a;var o=Xre(e.label,t);return[o].concat(Bre(a))}Si.renderCallByParent=Zre;function Yf(e){"@babel/helpers - typeof";return Yf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Yf(e)}function gj(){return gj=Object.assign?Object.assign.bind():function(e){for(var t=1;t180),",").concat(+(l>h),`, `).concat(v.x,",").concat(v.y,` `);if(a>0){var y=At(n,r,a,l),j=At(n,r,a,h);g+="L ".concat(j.x,",").concat(j.y,` A `).concat(a,",").concat(a,`,0, `).concat(+(Math.abs(d)>180),",").concat(+(l<=h),`, `).concat(y.x,",").concat(y.y," Z")}else g+="L ".concat(n,",").concat(r," Z");return g},nae=function(t){var n=t.cx,r=t.cy,a=t.innerRadius,o=t.outerRadius,l=t.cornerRadius,u=t.forceCornerRadius,d=t.cornerIsExternal,h=t.startAngle,p=t.endAngle,v=qn(p-h),g=yp({cx:n,cy:r,radius:o,angle:h,sign:v,cornerRadius:l,cornerIsExternal:d}),y=g.circleTangency,j=g.lineTangency,b=g.theta,w=yp({cx:n,cy:r,radius:o,angle:p,sign:-v,cornerRadius:l,cornerIsExternal:d}),A=w.circleTangency,O=w.lineTangency,N=w.theta,T=d?Math.abs(h-p):Math.abs(h-p)-b-N;if(T<0)return u?"M ".concat(j.x,",").concat(j.y,` a`).concat(l,",").concat(l,",0,0,1,").concat(l*2,`,0 a`).concat(l,",").concat(l,",0,0,1,").concat(-l*2,`,0 `):oB({cx:n,cy:r,innerRadius:a,outerRadius:o,startAngle:h,endAngle:p});var E="M ".concat(j.x,",").concat(j.y,` A`).concat(l,",").concat(l,",0,0,").concat(+(v<0),",").concat(y.x,",").concat(y.y,` A`).concat(o,",").concat(o,",0,").concat(+(T>180),",").concat(+(v<0),",").concat(A.x,",").concat(A.y,` A`).concat(l,",").concat(l,",0,0,").concat(+(v<0),",").concat(O.x,",").concat(O.y,` `);if(a>0){var C=yp({cx:n,cy:r,radius:a,angle:h,sign:v,isExternal:!0,cornerRadius:l,cornerIsExternal:d}),R=C.circleTangency,k=C.lineTangency,M=C.theta,U=yp({cx:n,cy:r,radius:a,angle:p,sign:-v,isExternal:!0,cornerRadius:l,cornerIsExternal:d}),$=U.circleTangency,z=U.lineTangency,V=U.theta,F=d?Math.abs(h-p):Math.abs(h-p)-M-V;if(F<0&&l===0)return"".concat(E,"L").concat(n,",").concat(r,"Z");E+="L".concat(z.x,",").concat(z.y,` A`).concat(l,",").concat(l,",0,0,").concat(+(v<0),",").concat($.x,",").concat($.y,` A`).concat(a,",").concat(a,",0,").concat(+(F>180),",").concat(+(v>0),",").concat(R.x,",").concat(R.y,` A`).concat(l,",").concat(l,",0,0,").concat(+(v<0),",").concat(k.x,",").concat(k.y,"Z")}else E+="L".concat(n,",").concat(r,"Z");return E},rae={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},sB=function(t){var n=$D($D({},rae),t),r=n.cx,a=n.cy,o=n.innerRadius,l=n.outerRadius,u=n.cornerRadius,d=n.forceCornerRadius,h=n.cornerIsExternal,p=n.startAngle,v=n.endAngle,g=n.className;if(l0&&Math.abs(p-v)<360?w=nae({cx:r,cy:a,innerRadius:o,outerRadius:l,cornerRadius:Math.min(b,j/2),forceCornerRadius:d,cornerIsExternal:h,startAngle:p,endAngle:v}):w=oB({cx:r,cy:a,innerRadius:o,outerRadius:l,startAngle:p,endAngle:v}),K.createElement("path",gj({},Le(n,!0),{className:y,d:w,role:"img"}))};function Xf(e){"@babel/helpers - typeof";return Xf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Xf(e)}function yj(){return yj=Object.assign?Object.assign.bind():function(e){for(var t=1;t0;)if(!n.equals(e[r],t[r],r,r,e,t,n))return!1;return!0}function Sae(e,t){return ks(e.getTime(),t.getTime())}function jae(e,t){return e.name===t.name&&e.message===t.message&&e.cause===t.cause&&e.stack===t.stack}function _ae(e,t){return e===t}function WD(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var a=new Array(r),o=e.entries(),l,u,d=0;(l=o.next())&&!l.done;){for(var h=t.entries(),p=!1,v=0;(u=h.next())&&!u.done;){if(a[v]){v++;continue}var g=l.value,y=u.value;if(n.equals(g[0],y[0],d,v,e,t,n)&&n.equals(g[1],y[1],g[0],y[0],e,t,n)){p=a[v]=!0;break}v++}if(!p)return!1;d++}return!0}var Aae=ks;function Oae(e,t,n){var r=KD(e),a=r.length;if(KD(t).length!==a)return!1;for(;a-- >0;)if(!lB(e,t,n,r[a]))return!1;return!0}function af(e,t,n){var r=VD(e),a=r.length;if(VD(t).length!==a)return!1;for(var o,l,u;a-- >0;)if(o=r[a],!lB(e,t,n,o)||(l=GD(e,o),u=GD(t,o),(l||u)&&(!l||!u||l.configurable!==u.configurable||l.enumerable!==u.enumerable||l.writable!==u.writable)))return!1;return!0}function Nae(e,t){return ks(e.valueOf(),t.valueOf())}function Eae(e,t){return e.source===t.source&&e.flags===t.flags}function YD(e,t,n){var r=e.size;if(r!==t.size)return!1;if(!r)return!0;for(var a=new Array(r),o=e.values(),l,u;(l=o.next())&&!l.done;){for(var d=t.values(),h=!1,p=0;(u=d.next())&&!u.done;){if(!a[p]&&n.equals(l.value,u.value,l.value,u.value,e,t,n)){h=a[p]=!0;break}p++}if(!h)return!1}return!0}function Tae(e,t){var n=e.length;if(t.length!==n)return!1;for(;n-- >0;)if(e[n]!==t[n])return!1;return!0}function Cae(e,t){return e.hostname===t.hostname&&e.pathname===t.pathname&&e.protocol===t.protocol&&e.port===t.port&&e.hash===t.hash&&e.username===t.username&&e.password===t.password}function lB(e,t,n,r){return(r===bae||r===xae||r===yae)&&(e.$$typeof||t.$$typeof)?!0:gae(t,r)&&n.equals(e[r],t[r],r,r,e,t,n)}var Rae="[object Arguments]",Pae="[object Boolean]",kae="[object Date]",Mae="[object Error]",Dae="[object Map]",Lae="[object Number]",$ae="[object Object]",Iae="[object RegExp]",zae="[object Set]",Bae="[object String]",qae="[object URL]",Uae=Array.isArray,XD=typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"?ArrayBuffer.isView:null,ZD=Object.assign,Fae=Object.prototype.toString.call.bind(Object.prototype.toString);function Hae(e){var t=e.areArraysEqual,n=e.areDatesEqual,r=e.areErrorsEqual,a=e.areFunctionsEqual,o=e.areMapsEqual,l=e.areNumbersEqual,u=e.areObjectsEqual,d=e.arePrimitiveWrappersEqual,h=e.areRegExpsEqual,p=e.areSetsEqual,v=e.areTypedArraysEqual,g=e.areUrlsEqual,y=e.unknownTagComparators;return function(b,w,A){if(b===w)return!0;if(b==null||w==null)return!1;var O=typeof b;if(O!==typeof w)return!1;if(O!=="object")return O==="number"?l(b,w,A):O==="function"?a(b,w,A):!1;var N=b.constructor;if(N!==w.constructor)return!1;if(N===Object)return u(b,w,A);if(Uae(b))return t(b,w,A);if(XD!=null&&XD(b))return v(b,w,A);if(N===Date)return n(b,w,A);if(N===RegExp)return h(b,w,A);if(N===Map)return o(b,w,A);if(N===Set)return p(b,w,A);var T=Fae(b);if(T===kae)return n(b,w,A);if(T===Iae)return h(b,w,A);if(T===Dae)return o(b,w,A);if(T===zae)return p(b,w,A);if(T===$ae)return typeof b.then!="function"&&typeof w.then!="function"&&u(b,w,A);if(T===qae)return g(b,w,A);if(T===Mae)return r(b,w,A);if(T===Rae)return u(b,w,A);if(T===Pae||T===Lae||T===Bae)return d(b,w,A);if(y){var E=y[T];if(!E){var C=vae(b);C&&(E=y[C])}if(E)return E(b,w,A)}return!1}}function Vae(e){var t=e.circular,n=e.createCustomConfig,r=e.strict,a={areArraysEqual:r?af:wae,areDatesEqual:Sae,areErrorsEqual:jae,areFunctionsEqual:_ae,areMapsEqual:r?HD(WD,af):WD,areNumbersEqual:Aae,areObjectsEqual:r?af:Oae,arePrimitiveWrappersEqual:Nae,areRegExpsEqual:Eae,areSetsEqual:r?HD(YD,af):YD,areTypedArraysEqual:r?af:Tae,areUrlsEqual:Cae,unknownTagComparators:void 0};if(n&&(a=ZD({},a,n(a))),t){var o=bp(a.areArraysEqual),l=bp(a.areMapsEqual),u=bp(a.areObjectsEqual),d=bp(a.areSetsEqual);a=ZD({},a,{areArraysEqual:o,areMapsEqual:l,areObjectsEqual:u,areSetsEqual:d})}return a}function Gae(e){return function(t,n,r,a,o,l,u){return e(t,n,u)}}function Kae(e){var t=e.circular,n=e.comparator,r=e.createState,a=e.equals,o=e.strict;if(r)return function(d,h){var p=r(),v=p.cache,g=v===void 0?t?new WeakMap:void 0:v,y=p.meta;return n(d,h,{cache:g,equals:a,meta:y,strict:o})};if(t)return function(d,h){return n(d,h,{cache:new WeakMap,equals:a,meta:void 0,strict:o})};var l={cache:void 0,equals:a,meta:void 0,strict:o};return function(d,h){return n(d,h,l)}}var Wae=_o();_o({strict:!0});_o({circular:!0});_o({circular:!0,strict:!0});_o({createInternalComparator:function(){return ks}});_o({strict:!0,createInternalComparator:function(){return ks}});_o({circular:!0,createInternalComparator:function(){return ks}});_o({circular:!0,createInternalComparator:function(){return ks},strict:!0});function _o(e){e===void 0&&(e={});var t=e.circular,n=t===void 0?!1:t,r=e.createInternalComparator,a=e.createState,o=e.strict,l=o===void 0?!1:o,u=Vae(e),d=Hae(u),h=r?r(d):Gae(d);return Kae({circular:n,comparator:d,createState:a,equals:h,strict:l})}function Yae(e){typeof requestAnimationFrame<"u"&&requestAnimationFrame(e)}function QD(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,n=-1,r=function a(o){n<0&&(n=o),o-n>t?(e(o),n=-1):Yae(a)};requestAnimationFrame(r)}function xj(e){"@babel/helpers - typeof";return xj=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xj(e)}function Xae(e){return eie(e)||Jae(e)||Qae(e)||Zae()}function Zae(){throw new TypeError(`Invalid attempt to destructure non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Qae(e,t){if(e){if(typeof e=="string")return JD(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return JD(e,t)}}function JD(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n1?1:A<0?0:A},b=function(A){for(var O=A>1?1:A,N=O,T=0;T<8;++T){var E=v(N)-O,C=y(N);if(Math.abs(E-O)0&&arguments[0]!==void 0?arguments[0]:{},n=t.stiff,r=n===void 0?100:n,a=t.damping,o=a===void 0?8:a,l=t.dt,u=l===void 0?17:l,d=function(p,v,g){var y=-(p-v)*r,j=g*o,b=g+(y-j)*u/1e3,w=g*u/1e3+p;return Math.abs(w-v)e.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Rie(e,t){if(e==null)return{};var n={},r=Object.keys(e),a,o;for(o=0;o=0)&&(n[a]=e[a]);return n}function kS(e){return Die(e)||Mie(e)||kie(e)||Pie()}function Pie(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kie(e,t){if(e){if(typeof e=="string")return _j(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _j(e,t)}}function Mie(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Die(e){if(Array.isArray(e))return _j(e)}function _j(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Em(e){return Em=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(n){return n.__proto__||Object.getPrototypeOf(n)},Em(e)}var qa=(function(e){Bie(n,e);var t=qie(n);function n(r,a){var o;Lie(this,n),o=t.call(this,r,a);var l=o.props,u=l.isActive,d=l.attributeName,h=l.from,p=l.to,v=l.steps,g=l.children,y=l.duration;if(o.handleStyleChange=o.handleStyleChange.bind(Nj(o)),o.changeStyle=o.changeStyle.bind(Nj(o)),!u||y<=0)return o.state={style:{}},typeof g=="function"&&(o.state={style:p}),Oj(o);if(v&&v.length)o.state={style:v[0].style};else if(h){if(typeof g=="function")return o.state={style:h},Oj(o);o.state={style:d?hf({},d,h):h}}else o.state={style:{}};return o}return Iie(n,[{key:"componentDidMount",value:function(){var a=this.props,o=a.isActive,l=a.canBegin;this.mounted=!0,!(!o||!l)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(a){var o=this.props,l=o.isActive,u=o.canBegin,d=o.attributeName,h=o.shouldReAnimate,p=o.to,v=o.from,g=this.state.style;if(u){if(!l){var y={style:d?hf({},d,p):p};this.state&&g&&(d&&g[d]!==p||!d&&g!==p)&&this.setState(y);return}if(!(Wae(a.to,p)&&a.canBegin&&a.isActive)){var j=!a.canBegin||!a.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var b=j||h?v:a.to;if(this.state&&g){var w={style:d?hf({},d,b):b};(d&&g[d]!==b||!d&&g!==b)&&this.setState(w)}this.runAnimation(sa(sa({},this.props),{},{from:b,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var a=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),a&&a()}},{key:"handleStyleChange",value:function(a){this.changeStyle(a)}},{key:"changeStyle",value:function(a){this.mounted&&this.setState({style:a})}},{key:"runJSAnimation",value:function(a){var o=this,l=a.from,u=a.to,d=a.duration,h=a.easing,p=a.begin,v=a.onAnimationEnd,g=a.onAnimationStart,y=Eie(l,u,gie(h),d,this.changeStyle),j=function(){o.stopJSAnimation=y()};this.manager.start([g,p,j,d,v])}},{key:"runStepAnimation",value:function(a){var o=this,l=a.steps,u=a.begin,d=a.onAnimationStart,h=l[0],p=h.style,v=h.duration,g=v===void 0?0:v,y=function(b,w,A){if(A===0)return b;var O=w.duration,N=w.easing,T=N===void 0?"ease":N,E=w.style,C=w.properties,R=w.onAnimationEnd,k=A>0?l[A-1]:w,M=C||Object.keys(E);if(typeof T=="function"||T==="spring")return[].concat(kS(b),[o.runJSAnimation.bind(o,{from:k.style,to:E,duration:O,easing:T}),O]);var U=n4(M,O,T),$=sa(sa(sa({},k.style),E),{},{transition:U});return[].concat(kS(b),[$,O,R]).filter(iie)};return this.manager.start([d].concat(kS(l.reduce(y,[p,Math.max(g,u)])),[a.onAnimationEnd]))}},{key:"runAnimation",value:function(a){this.manager||(this.manager=tie());var o=a.begin,l=a.duration,u=a.attributeName,d=a.to,h=a.easing,p=a.onAnimationStart,v=a.onAnimationEnd,g=a.steps,y=a.children,j=this.manager;if(this.unSubscribe=j.subscribe(this.handleStyleChange),typeof h=="function"||typeof y=="function"||h==="spring"){this.runJSAnimation(a);return}if(g.length>1){this.runStepAnimation(a);return}var b=u?hf({},u,d):d,w=n4(Object.keys(b),l,h);j.start([p,o,sa(sa({},b),{},{transition:w}),l,v])}},{key:"render",value:function(){var a=this.props,o=a.children;a.begin;var l=a.duration;a.attributeName,a.easing;var u=a.isActive;a.steps,a.from,a.to,a.canBegin,a.onAnimationEnd,a.shouldReAnimate,a.onAnimationReStart;var d=Cie(a,Tie),h=S.Children.count(o),p=this.state.style;if(typeof o=="function")return o(p);if(!u||h===0||l<=0)return o;var v=function(y){var j=y.props,b=j.style,w=b===void 0?{}:b,A=j.className,O=S.cloneElement(y,sa(sa({},d),{},{style:sa(sa({},w),p),className:A}));return O};return h===1?v(S.Children.only(o)):K.createElement("div",null,S.Children.map(o,function(g){return v(g)}))}}]),n})(S.PureComponent);qa.displayName="Animate";qa.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};qa.propTypes={from:ut.oneOfType([ut.object,ut.string]),to:ut.oneOfType([ut.object,ut.string]),attributeName:ut.string,duration:ut.number,begin:ut.number,easing:ut.oneOfType([ut.string,ut.func]),steps:ut.arrayOf(ut.shape({duration:ut.number.isRequired,style:ut.object.isRequired,easing:ut.oneOfType([ut.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),ut.func]),properties:ut.arrayOf("string"),onAnimationEnd:ut.func})),children:ut.oneOfType([ut.node,ut.func]),isActive:ut.bool,canBegin:ut.bool,onAnimationEnd:ut.func,shouldReAnimate:ut.bool,onAnimationStart:ut.func,onAnimationReStart:ut.func};function Jf(e){"@babel/helpers - typeof";return Jf=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},Jf(e)}function Tm(){return Tm=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0?1:-1,d=r>=0?1:-1,h=a>=0&&r>=0||a<0&&r<0?1:0,p;if(l>0&&o instanceof Array){for(var v=[0,0,0,0],g=0,y=4;gl?l:o[g];p="M".concat(t,",").concat(n+u*v[0]),v[0]>0&&(p+="A ".concat(v[0],",").concat(v[0],",0,0,").concat(h,",").concat(t+d*v[0],",").concat(n)),p+="L ".concat(t+r-d*v[1],",").concat(n),v[1]>0&&(p+="A ".concat(v[1],",").concat(v[1],",0,0,").concat(h,`, `).concat(t+r,",").concat(n+u*v[1])),p+="L ".concat(t+r,",").concat(n+a-u*v[2]),v[2]>0&&(p+="A ".concat(v[2],",").concat(v[2],",0,0,").concat(h,`, `).concat(t+r-d*v[2],",").concat(n+a)),p+="L ".concat(t+d*v[3],",").concat(n+a),v[3]>0&&(p+="A ".concat(v[3],",").concat(v[3],",0,0,").concat(h,`, `).concat(t,",").concat(n+a-u*v[3])),p+="Z"}else if(l>0&&o===+o&&o>0){var j=Math.min(l,o);p="M ".concat(t,",").concat(n+u*j,` A `).concat(j,",").concat(j,",0,0,").concat(h,",").concat(t+d*j,",").concat(n,` L `).concat(t+r-d*j,",").concat(n,` A `).concat(j,",").concat(j,",0,0,").concat(h,",").concat(t+r,",").concat(n+u*j,` L `).concat(t+r,",").concat(n+a-u*j,` A `).concat(j,",").concat(j,",0,0,").concat(h,",").concat(t+r-d*j,",").concat(n+a,` L `).concat(t+d*j,",").concat(n+a,` A `).concat(j,",").concat(j,",0,0,").concat(h,",").concat(t,",").concat(n+a-u*j," Z")}else p="M ".concat(t,",").concat(n," h ").concat(r," v ").concat(a," h ").concat(-r," Z");return p},Zie=function(t,n){if(!t||!n)return!1;var r=t.x,a=t.y,o=n.x,l=n.y,u=n.width,d=n.height;if(Math.abs(u)>0&&Math.abs(d)>0){var h=Math.min(o,o+u),p=Math.max(o,o+u),v=Math.min(l,l+d),g=Math.max(l,l+d);return r>=h&&r<=p&&a>=v&&a<=g}return!1},Qie={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},zA=function(t){var n=u4(u4({},Qie),t),r=S.useRef(),a=S.useState(-1),o=Fie(a,2),l=o[0],u=o[1];S.useEffect(function(){if(r.current&&r.current.getTotalLength)try{var T=r.current.getTotalLength();T&&u(T)}catch{}},[]);var d=n.x,h=n.y,p=n.width,v=n.height,g=n.radius,y=n.className,j=n.animationEasing,b=n.animationDuration,w=n.animationBegin,A=n.isAnimationActive,O=n.isUpdateAnimationActive;if(d!==+d||h!==+h||p!==+p||v!==+v||p===0||v===0)return null;var N=Ve("recharts-rectangle",y);return O?K.createElement(qa,{canBegin:l>0,from:{width:p,height:v,x:d,y:h},to:{width:p,height:v,x:d,y:h},duration:b,animationEasing:j,isActive:O},function(T){var E=T.width,C=T.height,R=T.x,k=T.y;return K.createElement(qa,{canBegin:l>0,from:"0px ".concat(l===-1?1:l,"px"),to:"".concat(l,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:b,isActive:A,easing:j},K.createElement("path",Tm({},Le(n,!0),{className:N,d:f4(R,k,E,C,g),ref:r})))}):K.createElement("path",Tm({},Le(n,!0),{className:N,d:f4(d,h,p,v,g)}))},Jie=["points","className","baseLinePoints","connectNulls"];function Ll(){return Ll=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function toe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function d4(e){return ioe(e)||aoe(e)||roe(e)||noe()}function noe(){throw new TypeError(`Invalid attempt to spread non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function roe(e,t){if(e){if(typeof e=="string")return Ej(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);if(n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set")return Array.from(e);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ej(e,t)}}function aoe(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function ioe(e){if(Array.isArray(e))return Ej(e)}function Ej(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n0&&arguments[0]!==void 0?arguments[0]:[],n=[[]];return t.forEach(function(r){h4(r)?n[n.length-1].push(r):n[n.length-1].length>0&&n.push([])}),h4(t[0])&&n[n.length-1].push(t[0]),n[n.length-1].length<=0&&(n=n.slice(0,-1)),n},jf=function(t,n){var r=ooe(t);n&&(r=[r.reduce(function(o,l){return[].concat(d4(o),d4(l))},[])]);var a=r.map(function(o){return o.reduce(function(l,u,d){return"".concat(l).concat(d===0?"M":"L").concat(u.x,",").concat(u.y)},"")}).join("");return r.length===1?"".concat(a,"Z"):a},soe=function(t,n,r){var a=jf(t,r);return"".concat(a.slice(-1)==="Z"?a.slice(0,-1):a,"L").concat(jf(n.reverse(),r).slice(1))},loe=function(t){var n=t.points,r=t.className,a=t.baseLinePoints,o=t.connectNulls,l=eoe(t,Jie);if(!n||!n.length)return null;var u=Ve("recharts-polygon",r);if(a&&a.length){var d=l.stroke&&l.stroke!=="none",h=soe(n,a,o);return K.createElement("g",{className:u},K.createElement("path",Ll({},Le(l,!0),{fill:h.slice(-1)==="Z"?l.fill:"none",stroke:"none",d:h})),d?K.createElement("path",Ll({},Le(l,!0),{fill:"none",d:jf(n,o)})):null,d?K.createElement("path",Ll({},Le(l,!0),{fill:"none",d:jf(a,o)})):null)}var p=jf(n,o);return K.createElement("path",Ll({},Le(l,!0),{fill:p.slice(-1)==="Z"?l.fill:"none",className:u,d:p}))};function Tj(){return Tj=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function moe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var voe=function(t,n,r,a,o,l){return"M".concat(t,",").concat(o,"v").concat(a,"M").concat(l,",").concat(n,"h").concat(r)},goe=function(t){var n=t.x,r=n===void 0?0:n,a=t.y,o=a===void 0?0:a,l=t.top,u=l===void 0?0:l,d=t.left,h=d===void 0?0:d,p=t.width,v=p===void 0?0:p,g=t.height,y=g===void 0?0:g,j=t.className,b=poe(t,coe),w=uoe({x:r,y:o,top:u,left:h,width:v,height:y},b);return!_e(r)||!_e(o)||!_e(v)||!_e(y)||!_e(u)||!_e(h)?null:K.createElement("path",Cj({},Le(w,!0),{className:Ve("recharts-cross",j),d:voe(r,o,v,y,u,h)}))},MS,m4;function yoe(){if(m4)return MS;m4=1;var e=Lv(),t=Tz(),n=Va();function r(a,o){return a&&a.length?e(a,n(o,2),t):void 0}return MS=r,MS}var xoe=yoe();const boe=ft(xoe);var DS,v4;function woe(){if(v4)return DS;v4=1;var e=Lv(),t=Va(),n=Cz();function r(a,o){return a&&a.length?e(a,t(o,2),n):void 0}return DS=r,DS}var Soe=woe();const joe=ft(Soe);var _oe=["cx","cy","angle","ticks","axisLine"],Aoe=["ticks","tick","angle","tickFormatter","stroke"];function uc(e){"@babel/helpers - typeof";return uc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},uc(e)}function _f(){return _f=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Ooe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Noe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function x4(e,t){for(var n=0;nS4?l=a==="outer"?"start":"end":o<-S4?l=a==="outer"?"end":"start":l="middle",l}},{key:"renderAxisLine",value:function(){var r=this.props,a=r.cx,o=r.cy,l=r.radius,u=r.axisLine,d=r.axisLineType,h=Xo(Xo({},Le(this.props,!1)),{},{fill:"none"},Le(u,!1));if(d==="circle")return K.createElement(qv,Jo({className:"recharts-polar-angle-axis-line"},h,{cx:a,cy:o,r:l}));var p=this.props.ticks,v=p.map(function(g){return At(a,o,l,g.coordinate)});return K.createElement(loe,Jo({className:"recharts-polar-angle-axis-line"},h,{points:v}))}},{key:"renderTicks",value:function(){var r=this,a=this.props,o=a.ticks,l=a.tick,u=a.tickLine,d=a.tickFormatter,h=a.stroke,p=Le(this.props,!1),v=Le(l,!1),g=Xo(Xo({},p),{},{fill:"none"},Le(u,!1)),y=o.map(function(j,b){var w=r.getTickLineCoord(j),A=r.getTickTextAnchor(j),O=Xo(Xo(Xo({textAnchor:A},p),{},{stroke:"none",fill:h},v),{},{index:b,payload:j,x:w.x2,y:w.y2});return K.createElement(ot,Jo({className:Ve("recharts-polar-angle-axis-tick",aB(l)),key:"tick-".concat(j.coordinate)},gs(r.props,j,b)),u&&K.createElement("line",Jo({className:"recharts-polar-angle-axis-tick-line"},g,w)),l&&t.renderTickItem(l,O,d?d(j.value,b):j.value))});return K.createElement(ot,{className:"recharts-polar-angle-axis-ticks"},y)}},{key:"render",value:function(){var r=this.props,a=r.ticks,o=r.radius,l=r.axisLine;return o<=0||!a||!a.length?null:K.createElement(ot,{className:Ve("recharts-polar-angle-axis",this.props.className)},l&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(r,a,o){var l;return K.isValidElement(r)?l=K.cloneElement(r,a):Be(r)?l=r(a):l=K.createElement(ys,Jo({},a,{className:"recharts-polar-angle-axis-tick-value"}),o),l}}])})(S.PureComponent);Hv(Vv,"displayName","PolarAngleAxis");Hv(Vv,"axisType","angleAxis");Hv(Vv,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var LS,j4;function Uoe(){if(j4)return LS;j4=1;var e=EI(),t=e(Object.getPrototypeOf,Object);return LS=t,LS}var $S,_4;function Foe(){if(_4)return $S;_4=1;var e=Ti(),t=Uoe(),n=Ci(),r="[object Object]",a=Function.prototype,o=Object.prototype,l=a.toString,u=o.hasOwnProperty,d=l.call(Object);function h(p){if(!n(p)||e(p)!=r)return!1;var v=t(p);if(v===null)return!0;var g=u.call(v,"constructor")&&v.constructor;return typeof g=="function"&&g instanceof g&&l.call(g)==d}return $S=h,$S}var Hoe=Foe();const Voe=ft(Hoe);var IS,A4;function Goe(){if(A4)return IS;A4=1;var e=Ti(),t=Ci(),n="[object Boolean]";function r(a){return a===!0||a===!1||t(a)&&e(a)==n}return IS=r,IS}var Koe=Goe();const Woe=ft(Koe);function td(e){"@babel/helpers - typeof";return td=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},td(e)}function Pm(){return Pm=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);n0,from:{upperWidth:0,lowerWidth:0,height:g,x:d,y:h},to:{upperWidth:p,lowerWidth:v,height:g,x:d,y:h},duration:b,animationEasing:j,isActive:A},function(N){var T=N.upperWidth,E=N.lowerWidth,C=N.height,R=N.x,k=N.y;return K.createElement(qa,{canBegin:l>0,from:"0px ".concat(l===-1?1:l,"px"),to:"".concat(l,"px 0px"),attributeName:"strokeDasharray",begin:w,duration:b,easing:j},K.createElement("path",Pm({},Le(n,!0),{className:O,d:T4(R,k,T,E,C),ref:r})))}):K.createElement("g",null,K.createElement("path",Pm({},Le(n,!0),{className:O,d:T4(d,h,p,v,g)})))},ise=["option","shapeType","propTransformer","activeClassName","isActive"];function nd(e){"@babel/helpers - typeof";return nd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},nd(e)}function ose(e,t){if(e==null)return{};var n=sse(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sse(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function C4(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function km(e){for(var t=1;t0?Er(N,"paddingAngle",0):0;if(E){var R=Ar(E.endAngle-E.startAngle,N.endAngle-N.startAngle),k=St(St({},N),{},{startAngle:O+C,endAngle:O+R(b)+C});w.push(k),O=k.endAngle}else{var M=N.endAngle,U=N.startAngle,$=Ar(0,M-U),z=$(b),V=St(St({},N),{},{startAngle:O+C,endAngle:O+z+C});w.push(V),O=V.endAngle}}),K.createElement(ot,null,r.renderSectorsStatically(w))})}},{key:"attachKeyboardHandlers",value:function(r){var a=this;r.onkeydown=function(o){if(!o.altKey)switch(o.key){case"ArrowLeft":{var l=++a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[l].focus(),a.setState({sectorToFocus:l});break}case"ArrowRight":{var u=--a.state.sectorToFocus<0?a.sectorRefs.length-1:a.state.sectorToFocus%a.sectorRefs.length;a.sectorRefs[u].focus(),a.setState({sectorToFocus:u});break}case"Escape":{a.sectorRefs[a.state.sectorToFocus].blur(),a.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var r=this.props,a=r.sectors,o=r.isAnimationActive,l=this.state.prevSectors;return o&&a&&a.length&&(!l||!Nd(l,a))?this.renderSectorsWithAnimation():this.renderSectorsStatically(a)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var r=this,a=this.props,o=a.hide,l=a.sectors,u=a.className,d=a.label,h=a.cx,p=a.cy,v=a.innerRadius,g=a.outerRadius,y=a.isAnimationActive,j=this.state.isAnimationFinished;if(o||!l||!l.length||!_e(h)||!_e(p)||!_e(v)||!_e(g))return null;var b=Ve("recharts-pie",u);return K.createElement(ot,{tabIndex:this.props.rootTabIndex,className:b,ref:function(A){r.pieRef=A}},this.renderSectors(),d&&this.renderLabels(l),fn.renderCallByParent(this.props,null,!1),(!y||j)&&Si.renderCallByParent(this.props,l,!1))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return a.prevIsAnimationActive!==r.isAnimationActive?{prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:[],isAnimationFinished:!0}:r.isAnimationActive&&r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curSectors:r.sectors,prevSectors:a.curSectors,isAnimationFinished:!0}:r.sectors!==a.curSectors?{curSectors:r.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(r,a){return r>a?"start":r=360?O:O-1)*d,T=w-O*y-N,E=a.reduce(function(k,M){var U=rn(M,A,0);return k+(_e(U)?U:0)},0),C;if(E>0){var R;C=a.map(function(k,M){var U=rn(k,A,0),$=rn(k,p,M),z=(_e(U)?U:0)/E,V;M?V=R.endAngle+qn(b)*d*(U!==0?1:0):V=l;var F=V+qn(b)*((U!==0?y:0)+z*T),G=(V+F)/2,L=(j.innerRadius+j.outerRadius)/2,q=[{name:$,value:U,payload:k,dataKey:A,type:g}],H=At(j.cx,j.cy,L,G);return R=St(St(St({percent:z,cornerRadius:o,name:$,tooltipPayload:q,midAngle:G,middleRadius:L,tooltipPosition:H},k),j),{},{value:rn(k,A),startAngle:V,endAngle:F,payload:k,paddingAngle:qn(b)*d}),R})}return St(St({},j),{},{sectors:C,data:a})});var zS,M4;function Ese(){if(M4)return zS;M4=1;var e=Math.ceil,t=Math.max;function n(r,a,o,l){for(var u=-1,d=t(e((a-r)/(o||1)),0),h=Array(d);d--;)h[l?d:++u]=r,r+=o;return h}return zS=n,zS}var BS,D4;function SB(){if(D4)return BS;D4=1;var e=HI(),t=1/0,n=17976931348623157e292;function r(a){if(!a)return a===0?a:0;if(a=e(a),a===t||a===-t){var o=a<0?-1:1;return o*n}return a===a?a:0}return BS=r,BS}var qS,L4;function Tse(){if(L4)return qS;L4=1;var e=Ese(),t=Ev(),n=SB();function r(a){return function(o,l,u){return u&&typeof u!="number"&&t(o,l,u)&&(l=u=void 0),o=n(o),l===void 0?(l=o,o=0):l=n(l),u=u===void 0?o0&&r.handleDrag(a.changedTouches[0])}),Sr(r,"handleDragEnd",function(){r.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var a=r.props,o=a.endIndex,l=a.onDragEnd,u=a.startIndex;l?.({endIndex:o,startIndex:u})}),r.detachDragEndListener()}),Sr(r,"handleLeaveWrapper",function(){(r.state.isTravellerMoving||r.state.isSlideMoving)&&(r.leaveTimer=window.setTimeout(r.handleDragEnd,r.props.leaveTimeOut))}),Sr(r,"handleEnterSlideOrTraveller",function(){r.setState({isTextActive:!0})}),Sr(r,"handleLeaveSlideOrTraveller",function(){r.setState({isTextActive:!1})}),Sr(r,"handleSlideDragStart",function(a){var o=U4(a)?a.changedTouches[0]:a;r.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:o.pageX}),r.attachDragEndListener()}),r.travellerDragStartHandlers={startX:r.handleTravellerDragStart.bind(r,"startX"),endX:r.handleTravellerDragStart.bind(r,"endX")},r.state={},r}return qse(t,e),$se(t,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(r){var a=r.startX,o=r.endX,l=this.state.scaleValues,u=this.props,d=u.gap,h=u.data,p=h.length-1,v=Math.min(a,o),g=Math.max(a,o),y=t.getIndexInRange(l,v),j=t.getIndexInRange(l,g);return{startIndex:y-y%d,endIndex:j===p?p:j-j%d}}},{key:"getTextOfTick",value:function(r){var a=this.props,o=a.data,l=a.tickFormatter,u=a.dataKey,d=rn(o[r],u,r);return Be(l)?l(d,r):d}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(r){var a=this.state,o=a.slideMoveStartX,l=a.startX,u=a.endX,d=this.props,h=d.x,p=d.width,v=d.travellerWidth,g=d.startIndex,y=d.endIndex,j=d.onChange,b=r.pageX-o;b>0?b=Math.min(b,h+p-v-u,h+p-v-l):b<0&&(b=Math.max(b,h-l,h-u));var w=this.getIndex({startX:l+b,endX:u+b});(w.startIndex!==g||w.endIndex!==y)&&j&&j(w),this.setState({startX:l+b,endX:u+b,slideMoveStartX:r.pageX})}},{key:"handleTravellerDragStart",value:function(r,a){var o=U4(a)?a.changedTouches[0]:a;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:r,brushMoveStartX:o.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(r){var a=this.state,o=a.brushMoveStartX,l=a.movingTravellerId,u=a.endX,d=a.startX,h=this.state[l],p=this.props,v=p.x,g=p.width,y=p.travellerWidth,j=p.onChange,b=p.gap,w=p.data,A={startX:this.state.startX,endX:this.state.endX},O=r.pageX-o;O>0?O=Math.min(O,v+g-y-h):O<0&&(O=Math.max(O,v-h)),A[l]=h+O;var N=this.getIndex(A),T=N.startIndex,E=N.endIndex,C=function(){var k=w.length-1;return l==="startX"&&(u>d?T%b===0:E%b===0)||ud?E%b===0:T%b===0)||u>d&&E===k};this.setState(Sr(Sr({},l,h+O),"brushMoveStartX",r.pageX),function(){j&&C()&&j(N)})}},{key:"handleTravellerMoveKeyboard",value:function(r,a){var o=this,l=this.state,u=l.scaleValues,d=l.startX,h=l.endX,p=this.state[a],v=u.indexOf(p);if(v!==-1){var g=v+r;if(!(g===-1||g>=u.length)){var y=u[g];a==="startX"&&y>=h||a==="endX"&&y<=d||this.setState(Sr({},a,y),function(){o.props.onChange(o.getIndex({startX:o.state.startX,endX:o.state.endX}))})}}}},{key:"renderBackground",value:function(){var r=this.props,a=r.x,o=r.y,l=r.width,u=r.height,d=r.fill,h=r.stroke;return K.createElement("rect",{stroke:h,fill:d,x:a,y:o,width:l,height:u})}},{key:"renderPanorama",value:function(){var r=this.props,a=r.x,o=r.y,l=r.width,u=r.height,d=r.data,h=r.children,p=r.padding,v=S.Children.only(h);return v?K.cloneElement(v,{x:a,y:o,width:l,height:u,margin:p,compact:!0,data:d}):null}},{key:"renderTravellerLayer",value:function(r,a){var o,l,u=this,d=this.props,h=d.y,p=d.travellerWidth,v=d.height,g=d.traveller,y=d.ariaLabel,j=d.data,b=d.startIndex,w=d.endIndex,A=Math.max(r,this.props.x),O=FS(FS({},Le(this.props,!1)),{},{x:A,y:h,width:p,height:v}),N=y||"Min value: ".concat((o=j[b])===null||o===void 0?void 0:o.name,", Max value: ").concat((l=j[w])===null||l===void 0?void 0:l.name);return K.createElement(ot,{tabIndex:0,role:"slider","aria-label":N,"aria-valuenow":r,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[a],onTouchStart:this.travellerDragStartHandlers[a],onKeyDown:function(E){["ArrowLeft","ArrowRight"].includes(E.key)&&(E.preventDefault(),E.stopPropagation(),u.handleTravellerMoveKeyboard(E.key==="ArrowRight"?1:-1,a))},onFocus:function(){u.setState({isTravellerFocused:!0})},onBlur:function(){u.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},t.renderTraveller(g,O))}},{key:"renderSlide",value:function(r,a){var o=this.props,l=o.y,u=o.height,d=o.stroke,h=o.travellerWidth,p=Math.min(r,a)+h,v=Math.max(Math.abs(a-r)-h,0);return K.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:d,fillOpacity:.2,x:p,y:l,width:v,height:u})}},{key:"renderText",value:function(){var r=this.props,a=r.startIndex,o=r.endIndex,l=r.y,u=r.height,d=r.travellerWidth,h=r.stroke,p=this.state,v=p.startX,g=p.endX,y=5,j={pointerEvents:"none",fill:h};return K.createElement(ot,{className:"recharts-brush-texts"},K.createElement(ys,Lm({textAnchor:"end",verticalAnchor:"middle",x:Math.min(v,g)-y,y:l+u/2},j),this.getTextOfTick(a)),K.createElement(ys,Lm({textAnchor:"start",verticalAnchor:"middle",x:Math.max(v,g)+d+y,y:l+u/2},j),this.getTextOfTick(o)))}},{key:"render",value:function(){var r=this.props,a=r.data,o=r.className,l=r.children,u=r.x,d=r.y,h=r.width,p=r.height,v=r.alwaysShowText,g=this.state,y=g.startX,j=g.endX,b=g.isTextActive,w=g.isSlideMoving,A=g.isTravellerMoving,O=g.isTravellerFocused;if(!a||!a.length||!_e(u)||!_e(d)||!_e(h)||!_e(p)||h<=0||p<=0)return null;var N=Ve("recharts-brush",o),T=K.Children.count(l)===1,E=Dse("userSelect","none");return K.createElement(ot,{className:N,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:E},this.renderBackground(),T&&this.renderPanorama(),this.renderSlide(y,j),this.renderTravellerLayer(y,"startX"),this.renderTravellerLayer(j,"endX"),(b||w||A||O||v)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(r){var a=r.x,o=r.y,l=r.width,u=r.height,d=r.stroke,h=Math.floor(o+u/2)-1;return K.createElement(K.Fragment,null,K.createElement("rect",{x:a,y:o,width:l,height:u,fill:d,stroke:"none"}),K.createElement("line",{x1:a+1,y1:h,x2:a+l-1,y2:h,fill:"none",stroke:"#fff"}),K.createElement("line",{x1:a+1,y1:h+2,x2:a+l-1,y2:h+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(r,a){var o;return K.isValidElement(r)?o=K.cloneElement(r,a):Be(r)?o=r(a):o=t.renderDefaultTraveller(a),o}},{key:"getDerivedStateFromProps",value:function(r,a){var o=r.data,l=r.width,u=r.x,d=r.travellerWidth,h=r.updateId,p=r.startIndex,v=r.endIndex;if(o!==a.prevData||h!==a.prevUpdateId)return FS({prevData:o,prevTravellerWidth:d,prevUpdateId:h,prevX:u,prevWidth:l},o&&o.length?Fse({data:o,width:l,x:u,travellerWidth:d,startIndex:p,endIndex:v}):{scale:null,scaleValues:null});if(a.scale&&(l!==a.prevWidth||u!==a.prevX||d!==a.prevTravellerWidth)){a.scale.range([u,u+l-d]);var g=a.scale.domain().map(function(y){return a.scale(y)});return{prevData:o,prevTravellerWidth:d,prevUpdateId:h,prevX:u,prevWidth:l,startX:a.scale(r.startIndex),endX:a.scale(r.endIndex),scaleValues:g}}return null}},{key:"getIndexInRange",value:function(r,a){for(var o=r.length,l=0,u=o-1;u-l>1;){var d=Math.floor((l+u)/2);r[d]>a?u=d:l=d}return a>=r[u]?u:l}}])})(S.PureComponent);Sr(pc,"displayName","Brush");Sr(pc,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var HS,F4;function Hse(){if(F4)return HS;F4=1;var e=fA();function t(n,r){var a;return e(n,function(o,l,u){return a=r(o,l,u),!a}),!!a}return HS=t,HS}var VS,H4;function Vse(){if(H4)return VS;H4=1;var e=wI(),t=Va(),n=Hse(),r=or(),a=Ev();function o(l,u,d){var h=r(l)?e:n;return d&&a(l,u,d)&&(u=void 0),h(l,t(u,3))}return VS=o,VS}var Gse=Vse();const Kse=ft(Gse);var La=function(t,n){var r=t.alwaysShow,a=t.ifOverflow;return r&&(a="extendDomain"),a===n},GS,V4;function Wse(){if(V4)return GS;V4=1;var e=zI();function t(n,r,a){r=="__proto__"&&e?e(n,r,{configurable:!0,enumerable:!0,value:a,writable:!0}):n[r]=a}return GS=t,GS}var KS,G4;function Yse(){if(G4)return KS;G4=1;var e=Wse(),t=$I(),n=Va();function r(a,o){var l={};return o=n(o,3),t(a,function(u,d,h){e(l,d,o(u,d,h))}),l}return KS=r,KS}var Xse=Yse();const Zse=ft(Xse);var WS,K4;function Qse(){if(K4)return WS;K4=1;function e(t,n){for(var r=-1,a=t==null?0:t.length;++r=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function sle(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function lle(e,t){var n=e.x,r=e.y,a=ole(e,nle),o="".concat(n),l=parseInt(o,10),u="".concat(r),d=parseInt(u,10),h="".concat(t.height||a.height),p=parseInt(h,10),v="".concat(t.width||a.width),g=parseInt(v,10);return of(of(of(of(of({},t),a),l?{x:l}:{}),d?{y:d}:{}),{},{height:p,width:g,name:t.name,radius:t.radius})}function Z4(e){return K.createElement(xB,Dj({shapeType:"rectangle",propTransformer:lle,activeClassName:"recharts-active-bar"},e))}var cle=function(t){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(r,a){if(typeof t=="number")return t;var o=_e(r)||PW(r);return o?t(r,a):(o||In(!1),n)}},ule=["value","background"],NB;function mc(e){"@babel/helpers - typeof";return mc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},mc(e)}function fle(e,t){if(e==null)return{};var n=dle(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function dle(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Im(){return Im=Object.assign?Object.assign.bind():function(e){for(var t=1;t0&&Math.abs(G)0&&Math.abs(F)0&&(V=Math.min((te||0)-(F[le-1]||0),V))}),Number.isFinite(V)){var G=V/z,L=b.layout==="vertical"?r.height:r.width;if(b.padding==="gap"&&(R=G*L/2),b.padding==="no-gap"){var q=Un(t.barCategoryGap,G*L),H=G*L/2;R=H-q-(H-q)/L*q}}}a==="xAxis"?k=[r.left+(N.left||0)+(R||0),r.left+r.width-(N.right||0)-(R||0)]:a==="yAxis"?k=d==="horizontal"?[r.top+r.height-(N.bottom||0),r.top+(N.top||0)]:[r.top+(N.top||0)+(R||0),r.top+r.height-(N.bottom||0)-(R||0)]:k=b.range,E&&(k=[k[1],k[0]]);var ee=Zz(b,o,g),ve=ee.scale,I=ee.realScaleType;ve.domain(A).range(k),Qz(ve);var B=Jz(ve,ua(ua({},b),{},{realScaleType:I}));a==="xAxis"?($=w==="top"&&!T||w==="bottom"&&T,M=r.left,U=v[C]-$*b.height):a==="yAxis"&&($=w==="left"&&!T||w==="right"&&T,M=v[C]-$*b.width,U=r.top);var Y=ua(ua(ua({},b),B),{},{realScaleType:I,x:M,y:U,scale:ve,width:a==="xAxis"?r.width:b.width,height:a==="yAxis"?r.height:b.height});return Y.bandSize=Sm(Y,B),!b.hide&&a==="xAxis"?v[C]+=($?-1:1)*Y.height:b.hide||(v[C]+=($?-1:1)*Y.width),ua(ua({},y),{},Wv({},j,Y))},{})},PB=function(t,n){var r=t.x,a=t.y,o=n.x,l=n.y;return{x:Math.min(r,o),y:Math.min(a,l),width:Math.abs(o-r),height:Math.abs(l-a)}},jle=function(t){var n=t.x1,r=t.y1,a=t.x2,o=t.y2;return PB({x:n,y:r},{x:a,y:o})},kB=(function(){function e(t){ble(this,e),this.scale=t}return wle(e,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},a=r.bandAware,o=r.position;if(n!==void 0){if(o)switch(o){case"start":return this.scale(n);case"middle":{var l=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+l}case"end":{var u=this.bandwidth?this.bandwidth():0;return this.scale(n)+u}default:return this.scale(n)}if(a){var d=this.bandwidth?this.bandwidth()/2:0;return this.scale(n)+d}return this.scale(n)}}},{key:"isInRange",value:function(n){var r=this.range(),a=r[0],o=r[r.length-1];return a<=o?n>=a&&n<=o:n>=o&&n<=a}}],[{key:"create",value:function(n){return new e(n)}}])})();Wv(kB,"EPS",1e-4);var BA=function(t){var n=Object.keys(t).reduce(function(r,a){return ua(ua({},r),{},Wv({},a,kB.create(t[a])))},{});return ua(ua({},n),{},{apply:function(a){var o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},l=o.bandAware,u=o.position;return Zse(a,function(d,h){return n[h].apply(d,{bandAware:l,position:u})})},isInRange:function(a){return OB(a,function(o,l){return n[l].isInRange(o)})}})};function _le(e){return(e%180+180)%180}var Ale=function(t){var n=t.width,r=t.height,a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,o=_le(a),l=o*Math.PI/180,u=Math.atan(r/n),d=l>u&&l-1?d[h?o[p]:p]:void 0}}return ZS=r,ZS}var QS,rL;function Nle(){if(rL)return QS;rL=1;var e=SB();function t(n){var r=e(n),a=r%1;return r===r?a?r-a:r:0}return QS=t,QS}var JS,aL;function Ele(){if(aL)return JS;aL=1;var e=PI(),t=Va(),n=Nle(),r=Math.max;function a(o,l,u){var d=o==null?0:o.length;if(!d)return-1;var h=u==null?0:n(u);return h<0&&(h=r(d+h,0)),e(o,t(l,3),h)}return JS=a,JS}var e1,iL;function Tle(){if(iL)return e1;iL=1;var e=Ole(),t=Ele(),n=e(t);return e1=n,e1}var Cle=Tle();const Rle=ft(Cle);var Ple=W3();const kle=ft(Ple);var Mle=kle(function(e){return{x:e.left,y:e.top,width:e.width,height:e.height}},function(e){return["l",e.left,"t",e.top,"w",e.width,"h",e.height].join("")}),qA=S.createContext(void 0),UA=S.createContext(void 0),MB=S.createContext(void 0),DB=S.createContext({}),LB=S.createContext(void 0),$B=S.createContext(0),IB=S.createContext(0),oL=function(t){var n=t.state,r=n.xAxisMap,a=n.yAxisMap,o=n.offset,l=t.clipPathId,u=t.children,d=t.width,h=t.height,p=Mle(o);return K.createElement(qA.Provider,{value:r},K.createElement(UA.Provider,{value:a},K.createElement(DB.Provider,{value:o},K.createElement(MB.Provider,{value:p},K.createElement(LB.Provider,{value:l},K.createElement($B.Provider,{value:h},K.createElement(IB.Provider,{value:d},u)))))))},Dle=function(){return S.useContext(LB)},zB=function(t){var n=S.useContext(qA);n==null&&In(!1);var r=n[t];return r==null&&In(!1),r},Lle=function(){var t=S.useContext(qA);return lo(t)},$le=function(){var t=S.useContext(UA),n=Rle(t,function(r){return OB(r.domain,Number.isFinite)});return n||lo(t)},BB=function(t){var n=S.useContext(UA);n==null&&In(!1);var r=n[t];return r==null&&In(!1),r},Ile=function(){var t=S.useContext(MB);return t},zle=function(){return S.useContext(DB)},FA=function(){return S.useContext(IB)},HA=function(){return S.useContext($B)};function vc(e){"@babel/helpers - typeof";return vc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vc(e)}function Ble(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function qle(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);ne*a)return!1;var o=n();return e*(t-e*o/2-r)>=0&&e*(t+e*o/2-a)<=0}function Sce(e,t){return KB(e,t+1)}function jce(e,t,n,r,a){for(var o=(r||[]).slice(),l=t.start,u=t.end,d=0,h=1,p=l,v=function(){var j=r?.[d];if(j===void 0)return{v:KB(r,h)};var b=d,w,A=function(){return w===void 0&&(w=n(j,b)),w},O=j.coordinate,N=d===0||Fm(e,O,A,p,u);N||(d=0,p=l,h+=1),N&&(p=O+e*(A()/2+a),d+=h)},g;h<=o.length;)if(g=v(),g)return g.v;return[]}function sd(e){"@babel/helpers - typeof";return sd=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},sd(e)}function pL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Mn(e){for(var t=1;t0?y.coordinate-w*e:y.coordinate})}else o[g]=y=Mn(Mn({},y),{},{tickCoord:y.coordinate});var A=Fm(e,y.tickCoord,b,u,d);A&&(d=y.tickCoord-e*(b()/2+a),o[g]=Mn(Mn({},y),{},{isShow:!0}))},p=l-1;p>=0;p--)h(p);return o}function Ece(e,t,n,r,a,o){var l=(r||[]).slice(),u=l.length,d=t.start,h=t.end;if(o){var p=r[u-1],v=n(p,u-1),g=e*(p.coordinate+e*v/2-h);l[u-1]=p=Mn(Mn({},p),{},{tickCoord:g>0?p.coordinate-g*e:p.coordinate});var y=Fm(e,p.tickCoord,function(){return v},d,h);y&&(h=p.tickCoord-e*(v/2+a),l[u-1]=Mn(Mn({},p),{},{isShow:!0}))}for(var j=o?u-1:u,b=function(O){var N=l[O],T,E=function(){return T===void 0&&(T=n(N,O)),T};if(O===0){var C=e*(N.coordinate-e*E()/2-d);l[O]=N=Mn(Mn({},N),{},{tickCoord:C<0?N.coordinate-C*e:N.coordinate})}else l[O]=N=Mn(Mn({},N),{},{tickCoord:N.coordinate});var R=Fm(e,N.tickCoord,E,d,h);R&&(d=N.tickCoord+e*(E()/2+a),l[O]=Mn(Mn({},N),{},{isShow:!0}))},w=0;w=2?qn(a[1].coordinate-a[0].coordinate):1,A=wce(o,w,y);return d==="equidistantPreserveStart"?jce(w,A,b,a,l):(d==="preserveStart"||d==="preserveStartEnd"?g=Ece(w,A,b,a,l,d==="preserveStartEnd"):g=Nce(w,A,b,a,l),g.filter(function(O){return O.isShow}))}var Tce=["viewBox"],Cce=["viewBox"],Rce=["ticks"];function xc(e){"@babel/helpers - typeof";return xc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xc(e)}function Il(){return Il=Object.assign?Object.assign.bind():function(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Pce(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function kce(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function vL(e,t){for(var n=0;n0?d(this.props):d(y)),l<=0||u<=0||!j||!j.length?null:K.createElement(ot,{className:Ve("recharts-cartesian-axis",h),ref:function(w){r.layerReference=w}},o&&this.renderAxisLine(),this.renderTicks(j,this.state.fontSize,this.state.letterSpacing),fn.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(r,a,o){var l,u=Ve(a.className,"recharts-cartesian-axis-tick-value");return K.isValidElement(r)?l=K.cloneElement(r,Qt(Qt({},a),{},{className:u})):Be(r)?l=r(Qt(Qt({},a),{},{className:u})):l=K.createElement(ys,Il({},a,{className:"recharts-cartesian-axis-tick-value"}),o),l}}])})(S.Component);WA(Bc,"displayName","CartesianAxis");WA(Bc,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var Bce=["x1","y1","x2","y2","key"],qce=["offset"];function bs(e){"@babel/helpers - typeof";return bs=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bs(e)}function gL(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),n.push.apply(n,r)}return n}function Dn(e){for(var t=1;t=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function Vce(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}var Gce=function(t){var n=t.fill;if(!n||n==="none")return null;var r=t.fillOpacity,a=t.x,o=t.y,l=t.width,u=t.height,d=t.ry;return K.createElement("rect",{x:a,y:o,ry:d,width:l,height:u,stroke:"none",fill:n,fillOpacity:r,className:"recharts-cartesian-grid-bg"})};function XB(e,t){var n;if(K.isValidElement(e))n=K.cloneElement(e,t);else if(Be(e))n=e(t);else{var r=t.x1,a=t.y1,o=t.x2,l=t.y2,u=t.key,d=yL(t,Bce),h=Le(d,!1);h.offset;var p=yL(h,qce);n=K.createElement("line",as({},p,{x1:r,y1:a,x2:o,y2:l,fill:"none",key:u}))}return n}function Kce(e){var t=e.x,n=e.width,r=e.horizontal,a=r===void 0?!0:r,o=e.horizontalPoints;if(!a||!o||!o.length)return null;var l=o.map(function(u,d){var h=Dn(Dn({},e),{},{x1:t,y1:u,x2:t+n,y2:u,key:"line-".concat(d),index:d});return XB(a,h)});return K.createElement("g",{className:"recharts-cartesian-grid-horizontal"},l)}function Wce(e){var t=e.y,n=e.height,r=e.vertical,a=r===void 0?!0:r,o=e.verticalPoints;if(!a||!o||!o.length)return null;var l=o.map(function(u,d){var h=Dn(Dn({},e),{},{x1:u,y1:t,x2:u,y2:t+n,key:"line-".concat(d),index:d});return XB(a,h)});return K.createElement("g",{className:"recharts-cartesian-grid-vertical"},l)}function Yce(e){var t=e.horizontalFill,n=e.fillOpacity,r=e.x,a=e.y,o=e.width,l=e.height,u=e.horizontalPoints,d=e.horizontal,h=d===void 0?!0:d;if(!h||!t||!t.length)return null;var p=u.map(function(g){return Math.round(g+a-a)}).sort(function(g,y){return g-y});a!==p[0]&&p.unshift(0);var v=p.map(function(g,y){var j=!p[y+1],b=j?a+l-g:p[y+1]-g;if(b<=0)return null;var w=y%t.length;return K.createElement("rect",{key:"react-".concat(y),y:g,x:r,height:b,width:o,stroke:"none",fill:t[w],fillOpacity:n,className:"recharts-cartesian-grid-bg"})});return K.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},v)}function Xce(e){var t=e.vertical,n=t===void 0?!0:t,r=e.verticalFill,a=e.fillOpacity,o=e.x,l=e.y,u=e.width,d=e.height,h=e.verticalPoints;if(!n||!r||!r.length)return null;var p=h.map(function(g){return Math.round(g+o-o)}).sort(function(g,y){return g-y});o!==p[0]&&p.unshift(0);var v=p.map(function(g,y){var j=!p[y+1],b=j?o+u-g:p[y+1]-g;if(b<=0)return null;var w=y%r.length;return K.createElement("rect",{key:"react-".concat(y),x:g,y:l,width:b,height:d,stroke:"none",fill:r[w],fillOpacity:a,className:"recharts-cartesian-grid-bg"})});return K.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},v)}var Zce=function(t,n){var r=t.xAxis,a=t.width,o=t.height,l=t.offset;return Xz(KA(Dn(Dn(Dn({},Bc.defaultProps),r),{},{ticks:yi(r,!0),viewBox:{x:0,y:0,width:a,height:o}})),l.left,l.left+l.width,n)},Qce=function(t,n){var r=t.yAxis,a=t.width,o=t.height,l=t.offset;return Xz(KA(Dn(Dn(Dn({},Bc.defaultProps),r),{},{ticks:yi(r,!0),viewBox:{x:0,y:0,width:a,height:o}})),l.top,l.top+l.height,n)},_l={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function pf(e){var t,n,r,a,o,l,u=FA(),d=HA(),h=zle(),p=Dn(Dn({},e),{},{stroke:(t=e.stroke)!==null&&t!==void 0?t:_l.stroke,fill:(n=e.fill)!==null&&n!==void 0?n:_l.fill,horizontal:(r=e.horizontal)!==null&&r!==void 0?r:_l.horizontal,horizontalFill:(a=e.horizontalFill)!==null&&a!==void 0?a:_l.horizontalFill,vertical:(o=e.vertical)!==null&&o!==void 0?o:_l.vertical,verticalFill:(l=e.verticalFill)!==null&&l!==void 0?l:_l.verticalFill,x:_e(e.x)?e.x:h.left,y:_e(e.y)?e.y:h.top,width:_e(e.width)?e.width:h.width,height:_e(e.height)?e.height:h.height}),v=p.x,g=p.y,y=p.width,j=p.height,b=p.syncWithTicks,w=p.horizontalValues,A=p.verticalValues,O=Lle(),N=$le();if(!_e(y)||y<=0||!_e(j)||j<=0||!_e(v)||v!==+v||!_e(g)||g!==+g)return null;var T=p.verticalCoordinatesGenerator||Zce,E=p.horizontalCoordinatesGenerator||Qce,C=p.horizontalPoints,R=p.verticalPoints;if((!C||!C.length)&&Be(E)){var k=w&&w.length,M=E({yAxis:N?Dn(Dn({},N),{},{ticks:k?w:N.ticks}):void 0,width:u,height:d,offset:h},k?!0:b);pa(Array.isArray(M),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(bs(M),"]")),Array.isArray(M)&&(C=M)}if((!R||!R.length)&&Be(T)){var U=A&&A.length,$=T({xAxis:O?Dn(Dn({},O),{},{ticks:U?A:O.ticks}):void 0,width:u,height:d,offset:h},U?!0:b);pa(Array.isArray($),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(bs($),"]")),Array.isArray($)&&(R=$)}return K.createElement("g",{className:"recharts-cartesian-grid"},K.createElement(Gce,{fill:p.fill,fillOpacity:p.fillOpacity,x:p.x,y:p.y,width:p.width,height:p.height,ry:p.ry}),K.createElement(Kce,as({},p,{offset:h,horizontalPoints:C,xAxis:O,yAxis:N})),K.createElement(Wce,as({},p,{offset:h,verticalPoints:R,xAxis:O,yAxis:N})),K.createElement(Yce,as({},p,{horizontalPoints:C})),K.createElement(Xce,as({},p,{verticalPoints:R})))}pf.displayName="CartesianGrid";var Jce=["type","layout","connectNulls","ref"],eue=["key"];function bc(e){"@babel/helpers - typeof";return bc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},bc(e)}function xL(e,t){if(e==null)return{};var n=tue(e,t),r,a;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(a=0;a=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tue(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function Af(){return Af=Object.assign?Object.assign.bind():function(e){for(var t=1;te.length)&&(t=e.length);for(var n=0,r=new Array(t);nv){y=[].concat(Al(d.slice(0,j)),[v-b]);break}var w=y.length%2===0?[0,g]:[g];return[].concat(Al(t.repeat(d,p)),Al(y),w).map(function(A){return"".concat(A,"px")}).join(", ")}),fa(n,"id",Dc("recharts-line-")),fa(n,"pathRef",function(l){n.mainCurve=l}),fa(n,"handleAnimationEnd",function(){n.setState({isAnimationFinished:!0}),n.props.onAnimationEnd&&n.props.onAnimationEnd()}),fa(n,"handleAnimationStart",function(){n.setState({isAnimationFinished:!1}),n.props.onAnimationStart&&n.props.onAnimationStart()}),n}return fue(t,e),sue(t,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();this.setState({totalLength:r})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var r=this.getTotalLength();r!==this.state.totalLength&&this.setState({totalLength:r})}}},{key:"getTotalLength",value:function(){var r=this.mainCurve;try{return r&&r.getTotalLength&&r.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(r,a){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var o=this.props,l=o.points,u=o.xAxis,d=o.yAxis,h=o.layout,p=o.children,v=Tr(p,Ed);if(!v)return null;var g=function(b,w){return{x:b.x,y:b.y,value:b.value,errorVal:rn(b.payload,w)}},y={clipPath:r?"url(#clipPath-".concat(a,")"):null};return K.createElement(ot,y,v.map(function(j){return K.cloneElement(j,{key:"bar-".concat(j.props.dataKey),data:l,xAxis:u,yAxis:d,layout:h,dataPointFormatter:g})}))}},{key:"renderDots",value:function(r,a,o){var l=this.props.isAnimationActive;if(l&&!this.state.isAnimationFinished)return null;var u=this.props,d=u.dot,h=u.points,p=u.dataKey,v=Le(this.props,!1),g=Le(d,!0),y=h.map(function(b,w){var A=wr(wr(wr({key:"dot-".concat(w),r:3},v),g),{},{index:w,cx:b.x,cy:b.y,value:b.value,dataKey:p,payload:b.payload,points:h});return t.renderDotItem(d,A)}),j={clipPath:r?"url(#clipPath-".concat(a?"":"dots-").concat(o,")"):null};return K.createElement(ot,Af({className:"recharts-line-dots",key:"dots"},j),y)}},{key:"renderCurveStatically",value:function(r,a,o,l){var u=this.props,d=u.type,h=u.layout,p=u.connectNulls;u.ref;var v=xL(u,Jce),g=wr(wr(wr({},Le(v,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:a?"url(#clipPath-".concat(o,")"):null,points:r},l),{},{type:d,layout:h,connectNulls:p});return K.createElement(Am,Af({},g,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(r,a){var o=this,l=this.props,u=l.points,d=l.strokeDasharray,h=l.isAnimationActive,p=l.animationBegin,v=l.animationDuration,g=l.animationEasing,y=l.animationId,j=l.animateNewValues,b=l.width,w=l.height,A=this.state,O=A.prevPoints,N=A.totalLength;return K.createElement(qa,{begin:p,duration:v,isActive:h,easing:g,from:{t:0},to:{t:1},key:"line-".concat(y),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(T){var E=T.t;if(O){var C=O.length/u.length,R=u.map(function(z,V){var F=Math.floor(V*C);if(O[F]){var G=O[F],L=Ar(G.x,z.x),q=Ar(G.y,z.y);return wr(wr({},z),{},{x:L(E),y:q(E)})}if(j){var H=Ar(b*2,z.x),ee=Ar(w/2,z.y);return wr(wr({},z),{},{x:H(E),y:ee(E)})}return wr(wr({},z),{},{x:z.x,y:z.y})});return o.renderCurveStatically(R,r,a)}var k=Ar(0,N),M=k(E),U;if(d){var $="".concat(d).split(/[,\s]+/gim).map(function(z){return parseFloat(z)});U=o.getStrokeDasharray(M,N,$)}else U=o.generateSimpleStrokeDasharray(N,M);return o.renderCurveStatically(u,r,a,{strokeDasharray:U})})}},{key:"renderCurve",value:function(r,a){var o=this.props,l=o.points,u=o.isAnimationActive,d=this.state,h=d.prevPoints,p=d.totalLength;return u&&l&&l.length&&(!h&&p>0||!Nd(h,l))?this.renderCurveWithAnimation(r,a):this.renderCurveStatically(l,r,a)}},{key:"render",value:function(){var r,a=this.props,o=a.hide,l=a.dot,u=a.points,d=a.className,h=a.xAxis,p=a.yAxis,v=a.top,g=a.left,y=a.width,j=a.height,b=a.isAnimationActive,w=a.id;if(o||!u||!u.length)return null;var A=this.state.isAnimationFinished,O=u.length===1,N=Ve("recharts-line",d),T=h&&h.allowDataOverflow,E=p&&p.allowDataOverflow,C=T||E,R=Ue(w)?this.id:w,k=(r=Le(l,!1))!==null&&r!==void 0?r:{r:3,strokeWidth:2},M=k.r,U=M===void 0?3:M,$=k.strokeWidth,z=$===void 0?2:$,V=HW(l)?l:{},F=V.clipDot,G=F===void 0?!0:F,L=U*2+z;return K.createElement(ot,{className:N},T||E?K.createElement("defs",null,K.createElement("clipPath",{id:"clipPath-".concat(R)},K.createElement("rect",{x:T?g:g-y/2,y:E?v:v-j/2,width:T?y:y*2,height:E?j:j*2})),!G&&K.createElement("clipPath",{id:"clipPath-dots-".concat(R)},K.createElement("rect",{x:g-L/2,y:v-L/2,width:y+L,height:j+L}))):null,!O&&this.renderCurve(C,R),this.renderErrorBar(C,R),(O||l)&&this.renderDots(C,G,R),(!b||A)&&Si.renderCallByParent(this.props,u))}}],[{key:"getDerivedStateFromProps",value:function(r,a){return r.animationId!==a.prevAnimationId?{prevAnimationId:r.animationId,curPoints:r.points,prevPoints:a.curPoints}:r.points!==a.curPoints?{curPoints:r.points}:null}},{key:"repeat",value:function(r,a){for(var o=r.length%2!==0?[].concat(Al(r),[0]):r,l=[],u=0;ue.length)&&(t=e.length);for(var n=0,r=new Array(t);n=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tfe(e,t){if(e==null)return{};var n={};for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(t.indexOf(r)>=0)continue;n[r]=e[r]}return n}function nfe(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function rfe(e,t){for(var n=0;ne.length)&&(t=e.length);for(var n=0,r=new Array(t);n0?l:t&&t.length&&_e(a)&&_e(o)?t.slice(a,o+1):[]};function f5(e){return e==="number"?[0,"auto"]:void 0}var e_=function(t,n,r,a){var o=t.graphicalItems,l=t.tooltipAxis,u=Jv(n,t);return r<0||!o||!o.length||r>=u.length?null:o.reduce(function(d,h){var p,v=(p=h.props.data)!==null&&p!==void 0?p:n;v&&t.dataStartIndex+t.dataEndIndex!==0&&t.dataEndIndex-t.dataStartIndex>=r&&(v=v.slice(t.dataStartIndex,t.dataEndIndex+1));var g;if(l.dataKey&&!l.allowDuplicatedCategory){var y=v===void 0?u:v;g=Zp(y,l.dataKey,a)}else g=v&&v[r]||u[r];return g?[].concat(_c(d),[tB(h,g)]):d},[])},EL=function(t,n,r,a){var o=a||{x:t.chartX,y:t.chartY},l=mfe(o,r),u=t.orderedTooltipTicks,d=t.tooltipAxis,h=t.tooltipTicks,p=qne(l,u,h,d);if(p>=0&&h){var v=h[p]&&h[p].value,g=e_(t,n,p,v),y=vfe(r,u,p,o);return{activeTooltipIndex:p,activeLabel:v,activePayload:g,activeCoordinate:y}}return null},gfe=function(t,n){var r=n.axes,a=n.graphicalItems,o=n.axisType,l=n.axisIdKey,u=n.stackGroups,d=n.dataStartIndex,h=n.dataEndIndex,p=t.layout,v=t.children,g=t.stackOffset,y=Yz(p,o);return r.reduce(function(j,b){var w,A=b.type.defaultProps!==void 0?me(me({},b.type.defaultProps),b.props):b.props,O=A.type,N=A.dataKey,T=A.allowDataOverflow,E=A.allowDuplicatedCategory,C=A.scale,R=A.ticks,k=A.includeHidden,M=A[l];if(j[M])return j;var U=Jv(t.data,{graphicalItems:a.filter(function(B){var Y,te=l in B.props?B.props[l]:(Y=B.type.defaultProps)===null||Y===void 0?void 0:Y[l];return te===M}),dataStartIndex:d,dataEndIndex:h}),$=U.length,z,V,F;Fue(A.domain,T,O)&&(z=pj(A.domain,null,T),y&&(O==="number"||C!=="auto")&&(F=wf(U,N,"category")));var G=f5(O);if(!z||z.length===0){var L,q=(L=A.domain)!==null&&L!==void 0?L:G;if(N){if(z=wf(U,N,O),O==="category"&&y){var H=MW(z);E&&H?(V=z,z=Dm(0,$)):E||(z=ND(q,z,b).reduce(function(B,Y){return B.indexOf(Y)>=0?B:[].concat(_c(B),[Y])},[]))}else if(O==="category")E?z=z.filter(function(B){return B!==""&&!Ue(B)}):z=ND(q,z,b).reduce(function(B,Y){return B.indexOf(Y)>=0||Y===""||Ue(Y)?B:[].concat(_c(B),[Y])},[]);else if(O==="number"){var ee=Gne(U,a.filter(function(B){var Y,te,le=l in B.props?B.props[l]:(Y=B.type.defaultProps)===null||Y===void 0?void 0:Y[l],xe="hide"in B.props?B.props.hide:(te=B.type.defaultProps)===null||te===void 0?void 0:te.hide;return le===M&&(k||!xe)}),N,o,p);ee&&(z=ee)}y&&(O==="number"||C!=="auto")&&(F=wf(U,N,"category"))}else y?z=Dm(0,$):u&&u[M]&&u[M].hasStack&&O==="number"?z=g==="expand"?[0,1]:eB(u[M].stackGroups,d,h):z=Wz(U,a.filter(function(B){var Y=l in B.props?B.props[l]:B.type.defaultProps[l],te="hide"in B.props?B.props.hide:B.type.defaultProps.hide;return Y===M&&(k||!te)}),O,p,!0);if(O==="number")z=Zj(v,z,M,o,R),q&&(z=pj(q,z,T));else if(O==="category"&&q){var ve=q,I=z.every(function(B){return ve.indexOf(B)>=0});I&&(z=ve)}}return me(me({},j),{},ze({},M,me(me({},A),{},{axisType:o,domain:z,categoricalDomain:F,duplicateDomain:V,originalDomain:(w=A.domain)!==null&&w!==void 0?w:G,isCategorical:y,layout:p})))},{})},yfe=function(t,n){var r=n.graphicalItems,a=n.Axis,o=n.axisType,l=n.axisIdKey,u=n.stackGroups,d=n.dataStartIndex,h=n.dataEndIndex,p=t.layout,v=t.children,g=Jv(t.data,{graphicalItems:r,dataStartIndex:d,dataEndIndex:h}),y=g.length,j=Yz(p,o),b=-1;return r.reduce(function(w,A){var O=A.type.defaultProps!==void 0?me(me({},A.type.defaultProps),A.props):A.props,N=O[l],T=f5("number");if(!w[N]){b++;var E;return j?E=Dm(0,y):u&&u[N]&&u[N].hasStack?(E=eB(u[N].stackGroups,d,h),E=Zj(v,E,N,o)):(E=pj(T,Wz(g,r.filter(function(C){var R,k,M=l in C.props?C.props[l]:(R=C.type.defaultProps)===null||R===void 0?void 0:R[l],U="hide"in C.props?C.props.hide:(k=C.type.defaultProps)===null||k===void 0?void 0:k.hide;return M===N&&!U}),"number",p),a.defaultProps.allowDataOverflow),E=Zj(v,E,N,o)),me(me({},w),{},ze({},N,me(me({axisType:o},a.defaultProps),{},{hide:!0,orientation:Er(hfe,"".concat(o,".").concat(b%2),null),domain:E,originalDomain:T,isCategorical:j,layout:p})))}return w},{})},xfe=function(t,n){var r=n.axisType,a=r===void 0?"xAxis":r,o=n.AxisComp,l=n.graphicalItems,u=n.stackGroups,d=n.dataStartIndex,h=n.dataEndIndex,p=t.children,v="".concat(a,"Id"),g=Tr(p,o),y={};return g&&g.length?y=gfe(t,{axes:g,graphicalItems:l,axisType:a,axisIdKey:v,stackGroups:u,dataStartIndex:d,dataEndIndex:h}):l&&l.length&&(y=yfe(t,{Axis:o,graphicalItems:l,axisType:a,axisIdKey:v,stackGroups:u,dataStartIndex:d,dataEndIndex:h})),y},bfe=function(t){var n=lo(t),r=yi(n,!1,!0);return{tooltipTicks:r,orderedTooltipTicks:dA(r,function(a){return a.coordinate}),tooltipAxis:n,tooltipAxisBandSize:Sm(n,r)}},TL=function(t){var n=t.children,r=t.defaultShowTooltip,a=jr(n,pc),o=0,l=0;return t.data&&t.data.length!==0&&(l=t.data.length-1),a&&a.props&&(a.props.startIndex>=0&&(o=a.props.startIndex),a.props.endIndex>=0&&(l=a.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:o,dataEndIndex:l,activeTooltipIndex:-1,isTooltipActive:!!r}},wfe=function(t){return!t||!t.length?!1:t.some(function(n){var r=bi(n&&n.type);return r&&r.indexOf("Bar")>=0})},CL=function(t){return t==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:t==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:t==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},Sfe=function(t,n){var r=t.props,a=t.graphicalItems,o=t.xAxisMap,l=o===void 0?{}:o,u=t.yAxisMap,d=u===void 0?{}:u,h=r.width,p=r.height,v=r.children,g=r.margin||{},y=jr(v,pc),j=jr(v,cs),b=Object.keys(d).reduce(function(E,C){var R=d[C],k=R.orientation;return!R.mirror&&!R.hide?me(me({},E),{},ze({},k,E[k]+R.width)):E},{left:g.left||0,right:g.right||0}),w=Object.keys(l).reduce(function(E,C){var R=l[C],k=R.orientation;return!R.mirror&&!R.hide?me(me({},E),{},ze({},k,Er(E,"".concat(k))+R.height)):E},{top:g.top||0,bottom:g.bottom||0}),A=me(me({},w),b),O=A.bottom;y&&(A.bottom+=y.props.height||pc.defaultProps.height),j&&n&&(A=Hne(A,a,r,n));var N=h-A.left-A.right,T=p-A.top-A.bottom;return me(me({brushBottom:O},A),{},{width:Math.max(N,0),height:Math.max(T,0)})},jfe=function(t,n){if(n==="xAxis")return t[n].width;if(n==="yAxis")return t[n].height},YA=function(t){var n=t.chartName,r=t.GraphicalChild,a=t.defaultTooltipEventType,o=a===void 0?"axis":a,l=t.validateTooltipEventTypes,u=l===void 0?["axis"]:l,d=t.axisComponents,h=t.legendContent,p=t.formatAxisMap,v=t.defaultProps,g=function(A,O){var N=O.graphicalItems,T=O.stackGroups,E=O.offset,C=O.updateId,R=O.dataStartIndex,k=O.dataEndIndex,M=A.barSize,U=A.layout,$=A.barGap,z=A.barCategoryGap,V=A.maxBarSize,F=CL(U),G=F.numericAxisName,L=F.cateAxisName,q=wfe(N),H=[];return N.forEach(function(ee,ve){var I=Jv(A.data,{graphicalItems:[ee],dataStartIndex:R,dataEndIndex:k}),B=ee.type.defaultProps!==void 0?me(me({},ee.type.defaultProps),ee.props):ee.props,Y=B.dataKey,te=B.maxBarSize,le=B["".concat(G,"Id")],xe=B["".concat(L,"Id")],Q={},ne=d.reduce(function(Kn,Dr){var rt=O["".concat(Dr.axisType,"Map")],nt=B["".concat(Dr.axisType,"Id")];rt&&rt[nt]||Dr.axisType==="zAxis"||In(!1);var Pn=rt[nt];return me(me({},Kn),{},ze(ze({},Dr.axisType,Pn),"".concat(Dr.axisType,"Ticks"),yi(Pn)))},Q),X=ne[L],de=ne["".concat(L,"Ticks")],be=T&&T[le]&&T[le].hasStack&&tre(ee,T[le].stackGroups),oe=bi(ee.type).indexOf("Bar")>=0,Pe=Sm(X,de),Se=[],fe=q&&Une({barSize:M,stackGroups:T,totalSize:jfe(ne,L)});if(oe){var he,$e,Ot=Ue(te)?V:te,_n=(he=($e=Sm(X,de,!0))!==null&&$e!==void 0?$e:Ot)!==null&&he!==void 0?he:0;Se=Fne({barGap:$,barCategoryGap:z,bandSize:_n!==Pe?_n:Pe,sizeList:fe[xe],maxBarSize:Ot}),_n!==Pe&&(Se=Se.map(function(Kn){return me(me({},Kn),{},{position:me(me({},Kn.position),{},{offset:Kn.position.offset-_n/2})})}))}var fr=ee&&ee.type&&ee.type.getComposedData;fr&&H.push({props:me(me({},fr(me(me({},ne),{},{displayedData:I,props:A,dataKey:Y,item:ee,bandSize:Pe,barPosition:Se,offset:E,stackedData:be,layout:U,dataStartIndex:R,dataEndIndex:k}))),{},ze(ze(ze({key:ee.key||"item-".concat(ve)},G,ne[G]),L,ne[L]),"animationId",C)),childIndex:KW(ee,A.children),item:ee})}),H},y=function(A,O){var N=A.props,T=A.dataStartIndex,E=A.dataEndIndex,C=A.updateId;if(!qR({props:N}))return null;var R=N.children,k=N.layout,M=N.stackOffset,U=N.data,$=N.reverseStackOrder,z=CL(k),V=z.numericAxisName,F=z.cateAxisName,G=Tr(R,r),L=Jne(U,G,"".concat(V,"Id"),"".concat(F,"Id"),M,$),q=d.reduce(function(B,Y){var te="".concat(Y.axisType,"Map");return me(me({},B),{},ze({},te,xfe(N,me(me({},Y),{},{graphicalItems:G,stackGroups:Y.axisType===V&&L,dataStartIndex:T,dataEndIndex:E}))))},{}),H=Sfe(me(me({},q),{},{props:N,graphicalItems:G}),O?.legendBBox);Object.keys(q).forEach(function(B){q[B]=p(N,q[B],H,B.replace("Map",""),n)});var ee=q["".concat(F,"Map")],ve=bfe(ee),I=g(N,me(me({},q),{},{dataStartIndex:T,dataEndIndex:E,updateId:C,graphicalItems:G,stackGroups:L,offset:H}));return me(me({formattedGraphicalItems:I,graphicalItems:G,offset:H,stackGroups:L},ve),q)},j=(function(w){function A(O){var N,T,E;return nfe(this,A),E=ife(this,A,[O]),ze(E,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),ze(E,"accessibilityManager",new Uue),ze(E,"handleLegendBBoxUpdate",function(C){if(C){var R=E.state,k=R.dataStartIndex,M=R.dataEndIndex,U=R.updateId;E.setState(me({legendBBox:C},y({props:E.props,dataStartIndex:k,dataEndIndex:M,updateId:U},me(me({},E.state),{},{legendBBox:C}))))}}),ze(E,"handleReceiveSyncEvent",function(C,R,k){if(E.props.syncId===C){if(k===E.eventEmitterSymbol&&typeof E.props.syncMethod!="function")return;E.applySyncEvent(R)}}),ze(E,"handleBrushChange",function(C){var R=C.startIndex,k=C.endIndex;if(R!==E.state.dataStartIndex||k!==E.state.dataEndIndex){var M=E.state.updateId;E.setState(function(){return me({dataStartIndex:R,dataEndIndex:k},y({props:E.props,dataStartIndex:R,dataEndIndex:k,updateId:M},E.state))}),E.triggerSyncEvent({dataStartIndex:R,dataEndIndex:k})}}),ze(E,"handleMouseEnter",function(C){var R=E.getMouseInfo(C);if(R){var k=me(me({},R),{},{isTooltipActive:!0});E.setState(k),E.triggerSyncEvent(k);var M=E.props.onMouseEnter;Be(M)&&M(k,C)}}),ze(E,"triggeredAfterMouseMove",function(C){var R=E.getMouseInfo(C),k=R?me(me({},R),{},{isTooltipActive:!0}):{isTooltipActive:!1};E.setState(k),E.triggerSyncEvent(k);var M=E.props.onMouseMove;Be(M)&&M(k,C)}),ze(E,"handleItemMouseEnter",function(C){E.setState(function(){return{isTooltipActive:!0,activeItem:C,activePayload:C.tooltipPayload,activeCoordinate:C.tooltipPosition||{x:C.cx,y:C.cy}}})}),ze(E,"handleItemMouseLeave",function(){E.setState(function(){return{isTooltipActive:!1}})}),ze(E,"handleMouseMove",function(C){C.persist(),E.throttleTriggeredAfterMouseMove(C)}),ze(E,"handleMouseLeave",function(C){E.throttleTriggeredAfterMouseMove.cancel();var R={isTooltipActive:!1};E.setState(R),E.triggerSyncEvent(R);var k=E.props.onMouseLeave;Be(k)&&k(R,C)}),ze(E,"handleOuterEvent",function(C){var R=GW(C),k=Er(E.props,"".concat(R));if(R&&Be(k)){var M,U;/.*touch.*/i.test(R)?U=E.getMouseInfo(C.changedTouches[0]):U=E.getMouseInfo(C),k((M=U)!==null&&M!==void 0?M:{},C)}}),ze(E,"handleClick",function(C){var R=E.getMouseInfo(C);if(R){var k=me(me({},R),{},{isTooltipActive:!0});E.setState(k),E.triggerSyncEvent(k);var M=E.props.onClick;Be(M)&&M(k,C)}}),ze(E,"handleMouseDown",function(C){var R=E.props.onMouseDown;if(Be(R)){var k=E.getMouseInfo(C);R(k,C)}}),ze(E,"handleMouseUp",function(C){var R=E.props.onMouseUp;if(Be(R)){var k=E.getMouseInfo(C);R(k,C)}}),ze(E,"handleTouchMove",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&E.throttleTriggeredAfterMouseMove(C.changedTouches[0])}),ze(E,"handleTouchStart",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&E.handleMouseDown(C.changedTouches[0])}),ze(E,"handleTouchEnd",function(C){C.changedTouches!=null&&C.changedTouches.length>0&&E.handleMouseUp(C.changedTouches[0])}),ze(E,"handleDoubleClick",function(C){var R=E.props.onDoubleClick;if(Be(R)){var k=E.getMouseInfo(C);R(k,C)}}),ze(E,"handleContextMenu",function(C){var R=E.props.onContextMenu;if(Be(R)){var k=E.getMouseInfo(C);R(k,C)}}),ze(E,"triggerSyncEvent",function(C){E.props.syncId!==void 0&&r1.emit(a1,E.props.syncId,C,E.eventEmitterSymbol)}),ze(E,"applySyncEvent",function(C){var R=E.props,k=R.layout,M=R.syncMethod,U=E.state.updateId,$=C.dataStartIndex,z=C.dataEndIndex;if(C.dataStartIndex!==void 0||C.dataEndIndex!==void 0)E.setState(me({dataStartIndex:$,dataEndIndex:z},y({props:E.props,dataStartIndex:$,dataEndIndex:z,updateId:U},E.state)));else if(C.activeTooltipIndex!==void 0){var V=C.chartX,F=C.chartY,G=C.activeTooltipIndex,L=E.state,q=L.offset,H=L.tooltipTicks;if(!q)return;if(typeof M=="function")G=M(H,C);else if(M==="value"){G=-1;for(var ee=0;ee=0){var be,oe;if(V.dataKey&&!V.allowDuplicatedCategory){var Pe=typeof V.dataKey=="function"?de:"payload.".concat(V.dataKey.toString());be=Zp(ee,Pe,G),oe=ve&&I&&Zp(I,Pe,G)}else be=ee?.[F],oe=ve&&I&&I[F];if(xe||le){var Se=C.props.activeIndex!==void 0?C.props.activeIndex:F;return[S.cloneElement(C,me(me(me({},M.props),ne),{},{activeIndex:Se})),null,null]}if(!Ue(be))return[X].concat(_c(E.renderActivePoints({item:M,activePoint:be,basePoint:oe,childIndex:F,isRange:ve})))}else{var fe,he=(fe=E.getItemByXY(E.state.activeCoordinate))!==null&&fe!==void 0?fe:{graphicalItem:X},$e=he.graphicalItem,Ot=$e.item,_n=Ot===void 0?C:Ot,fr=$e.childIndex,Kn=me(me(me({},M.props),ne),{},{activeIndex:fr});return[S.cloneElement(_n,Kn),null,null]}return ve?[X,null,null]:[X,null]}),ze(E,"renderCustomized",function(C,R,k){return S.cloneElement(C,me(me({key:"recharts-customized-".concat(k)},E.props),E.state))}),ze(E,"renderMap",{CartesianGrid:{handler:Sp,once:!0},ReferenceArea:{handler:E.renderReferenceElement},ReferenceLine:{handler:Sp},ReferenceDot:{handler:E.renderReferenceElement},XAxis:{handler:Sp},YAxis:{handler:Sp},Brush:{handler:E.renderBrush,once:!0},Bar:{handler:E.renderGraphicChild},Line:{handler:E.renderGraphicChild},Area:{handler:E.renderGraphicChild},Radar:{handler:E.renderGraphicChild},RadialBar:{handler:E.renderGraphicChild},Scatter:{handler:E.renderGraphicChild},Pie:{handler:E.renderGraphicChild},Funnel:{handler:E.renderGraphicChild},Tooltip:{handler:E.renderCursor,once:!0},PolarGrid:{handler:E.renderPolarGrid,once:!0},PolarAngleAxis:{handler:E.renderPolarAxis},PolarRadiusAxis:{handler:E.renderPolarAxis},Customized:{handler:E.renderCustomized}}),E.clipPathId="".concat((N=O.id)!==null&&N!==void 0?N:Dc("recharts"),"-clip"),E.throttleTriggeredAfterMouseMove=VI(E.triggeredAfterMouseMove,(T=O.throttleDelay)!==null&&T!==void 0?T:1e3/60),E.state={},E}return lfe(A,w),afe(A,[{key:"componentDidMount",value:function(){var N,T;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(N=this.props.margin.left)!==null&&N!==void 0?N:0,top:(T=this.props.margin.top)!==null&&T!==void 0?T:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var N=this.props,T=N.children,E=N.data,C=N.height,R=N.layout,k=jr(T,Ea);if(k){var M=k.props.defaultIndex;if(!(typeof M!="number"||M<0||M>this.state.tooltipTicks.length-1)){var U=this.state.tooltipTicks[M]&&this.state.tooltipTicks[M].value,$=e_(this.state,E,M,U),z=this.state.tooltipTicks[M].coordinate,V=(this.state.offset.top+C)/2,F=R==="horizontal",G=F?{x:z,y:V}:{y:z,x:V},L=this.state.formattedGraphicalItems.find(function(H){var ee=H.item;return ee.type.name==="Scatter"});L&&(G=me(me({},G),L.props.points[M].tooltipPosition),$=L.props.points[M].tooltipPayload);var q={activeTooltipIndex:M,isTooltipActive:!0,activeLabel:U,activePayload:$,activeCoordinate:G};this.setState(q),this.renderCursor(k),this.accessibilityManager.setIndex(M)}}}},{key:"getSnapshotBeforeUpdate",value:function(N,T){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==T.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==N.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==N.margin){var E,C;this.accessibilityManager.setDetails({offset:{left:(E=this.props.margin.left)!==null&&E!==void 0?E:0,top:(C=this.props.margin.top)!==null&&C!==void 0?C:0}})}return null}},{key:"componentDidUpdate",value:function(N){L1([jr(N.children,Ea)],[jr(this.props.children,Ea)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var N=jr(this.props.children,Ea);if(N&&typeof N.props.shared=="boolean"){var T=N.props.shared?"axis":"item";return u.indexOf(T)>=0?T:o}return o}},{key:"getMouseInfo",value:function(N){if(!this.container)return null;var T=this.container,E=T.getBoundingClientRect(),C=MQ(E),R={chartX:Math.round(N.pageX-C.left),chartY:Math.round(N.pageY-C.top)},k=E.width/T.offsetWidth||1,M=this.inRange(R.chartX,R.chartY,k);if(!M)return null;var U=this.state,$=U.xAxisMap,z=U.yAxisMap,V=this.getTooltipEventType(),F=EL(this.state,this.props.data,this.props.layout,M);if(V!=="axis"&&$&&z){var G=lo($).scale,L=lo(z).scale,q=G&&G.invert?G.invert(R.chartX):null,H=L&&L.invert?L.invert(R.chartY):null;return me(me({},R),{},{xValue:q,yValue:H},F)}return F?me(me({},R),F):null}},{key:"inRange",value:function(N,T){var E=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,C=this.props.layout,R=N/E,k=T/E;if(C==="horizontal"||C==="vertical"){var M=this.state.offset,U=R>=M.left&&R<=M.left+M.width&&k>=M.top&&k<=M.top+M.height;return U?{x:R,y:k}:null}var $=this.state,z=$.angleAxisMap,V=$.radiusAxisMap;if(z&&V){var F=lo(z);return CD({x:R,y:k},F)}return null}},{key:"parseEventsOfWrapper",value:function(){var N=this.props.children,T=this.getTooltipEventType(),E=jr(N,Ea),C={};E&&T==="axis"&&(E.props.trigger==="click"?C={onClick:this.handleClick}:C={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var R=Qp(this.props,this.handleOuterEvent);return me(me({},R),C)}},{key:"addListener",value:function(){r1.on(a1,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){r1.removeListener(a1,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(N,T,E){for(var C=this.state.formattedGraphicalItems,R=0,k=C.length;R");return e}const Rl=S.forwardRef(({id:e,className:t,children:n,config:r,...a},o)=>{const l=S.useId(),u=`chart-${e||l.replace(/:/g,"")}`;return c.jsx(d5.Provider,{value:{config:r},children:c.jsxs("div",{"data-chart":u,ref:o,className:je("flex aspect-video justify-center text-xs [&_.recharts-cartesian-axis-tick_text]:fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:stroke-border/50 [&_.recharts-curve.recharts-tooltip-cursor]:stroke-border [&_.recharts-dot[stroke='#fff']]:stroke-transparent [&_.recharts-layer]:outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:stroke-border [&_.recharts-radial-bar-background-sector]:fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:stroke-border [&_.recharts-sector[stroke='#fff']]:stroke-transparent [&_.recharts-sector]:outline-none [&_.recharts-surface]:outline-none",t),...a,children:[c.jsx(Nfe,{id:u,config:r}),c.jsx(NQ,{children:n})]})})});Rl.displayName="Chart";const Nfe=({id:e,config:t})=>{const n=Object.entries(t).filter(([,r])=>r.theme||r.color);return n.length?c.jsx("style",{dangerouslySetInnerHTML:{__html:Object.entries(Ofe).map(([r,a])=>` ${a} [data-chart=${e}] { ${n.map(([o,l])=>{const u=l.theme?.[r]||l.color;return u?` --color-${o}: ${u};`:null}).join(` `)} } `).join(` `)}}):null},sf=Ea,Pl=S.forwardRef(({active:e,payload:t,className:n,indicator:r="dot",hideLabel:a=!1,hideIndicator:o=!1,label:l,labelFormatter:u,labelClassName:d,formatter:h,color:p,nameKey:v,labelKey:g},y)=>{const{config:j}=h5(),b=S.useMemo(()=>{if(a||!t?.length)return null;const[A]=t,O=`${g||A?.dataKey||A?.name||"value"}`,N=t_(j,A,O),T=!g&&typeof l=="string"?j[l]?.label||l:N?.label;return u?c.jsx("div",{className:je("font-medium",d),children:u(T,t)}):T?c.jsx("div",{className:je("font-medium",d),children:T}):null},[l,u,t,a,d,j,g]);if(!e||!t?.length)return null;const w=t.length===1&&r!=="dot";return c.jsxs("div",{ref:y,className:je("grid min-w-[8rem] items-start gap-1.5 rounded-lg border border-border/50 bg-background px-2.5 py-1.5 text-xs shadow-xl",n),children:[w?null:b,c.jsx("div",{className:"grid gap-1.5",children:t.filter(A=>A.type!=="none").map((A,O)=>{const N=`${v||A.name||A.dataKey||"value"}`,T=t_(j,A,N),E=p||A.payload.fill||A.color;return c.jsx("div",{className:je("flex w-full flex-wrap items-stretch gap-2 [&>svg]:h-2.5 [&>svg]:w-2.5 [&>svg]:text-muted-foreground",r==="dot"&&"items-center"),children:h&&A?.value!==void 0&&A.name?h(A.value,A.name,A,O,A.payload):c.jsxs(c.Fragment,{children:[T?.icon?c.jsx(T.icon,{}):!o&&c.jsx("div",{className:je("shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]",{"h-2.5 w-2.5":r==="dot","w-1":r==="line","w-0 border-[1.5px] border-dashed bg-transparent":r==="dashed","my-0.5":w&&r==="dashed"}),style:{"--color-bg":E,"--color-border":E}}),c.jsxs("div",{className:je("flex flex-1 justify-between leading-none",w?"items-end":"items-center"),children:[c.jsxs("div",{className:"grid gap-1.5",children:[w?b:null,c.jsx("span",{className:"text-muted-foreground",children:T?.label||A.name})]}),A.value&&c.jsx("span",{className:"font-mono font-medium tabular-nums text-foreground",children:A.value.toLocaleString()})]})]})},A.dataKey)})})]})});Pl.displayName="ChartTooltip";const Efe=cs,p5=S.forwardRef(({className:e,hideIcon:t=!1,payload:n,verticalAlign:r="bottom",nameKey:a},o)=>{const{config:l}=h5();return n?.length?c.jsx("div",{ref:o,className:je("flex items-center justify-center gap-4",r==="top"?"pb-3":"pt-3",e),children:n.filter(u=>u.type!=="none").map(u=>{const d=`${a||u.dataKey||"value"}`,h=t_(l,u,d);return c.jsxs("div",{className:je("flex items-center gap-1.5 [&>svg]:h-3 [&>svg]:w-3 [&>svg]:text-muted-foreground"),children:[h?.icon&&!t?c.jsx(h.icon,{}):c.jsx("div",{className:"h-2 w-2 shrink-0 rounded-[2px]",style:{backgroundColor:u.color}}),h?.label]},u.value)})}):null});p5.displayName="ChartLegend";function t_(e,t,n){if(typeof t!="object"||t===null)return;const r="payload"in t&&typeof t.payload=="object"&&t.payload!==null?t.payload:void 0;let a=n;return n in t&&typeof t[n]=="string"?a=t[n]:r&&n in r&&typeof r[n]=="string"&&(a=r[n]),a in e?e[a]:e[n]}const Tfe=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Cfe=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),RL=e=>{const t=Cfe(e);return t.charAt(0).toUpperCase()+t.slice(1)},m5=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),Rfe=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};var Pfe={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"};const kfe=S.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:o,iconNode:l,...u},d)=>S.createElement("svg",{ref:d,...Pfe,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:m5("lucide",a),...!o&&!Rfe(u)&&{"aria-hidden":"true"},...u},[...l.map(([h,p])=>S.createElement(h,p)),...Array.isArray(o)?o:[o]]));const ke=(e,t)=>{const n=S.forwardRef(({className:r,...a},o)=>S.createElement(kfe,{ref:o,iconNode:t,className:m5(`lucide-${Tfe(RL(e))}`,`lucide-${e}`,r),...a}));return n.displayName=RL(e),n};const Mfe=[["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"}]],Dfe=ke("activity",Mfe);const Lfe=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],$fe=ke("arrow-left",Lfe);const Ife=[["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],zfe=ke("ban",Ife);const Bfe=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],qfe=ke("bell",Bfe);const Ufe=[["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"}]],Ffe=ke("boxes",Ufe);const Hfe=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],Vfe=ke("chart-column",Hfe);const Gfe=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Fl=ke("check",Gfe);const Kfe=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],v5=ke("chevron-down",Kfe);const Wfe=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],g5=ke("chevron-left",Wfe);const Yfe=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Xfe=ke("chevron-right",Yfe);const Zfe=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Qfe=ke("chevron-up",Zfe);const Jfe=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],ede=ke("chevrons-up-down",Jfe);const tde=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],PL=ke("circle-alert",tde);const nde=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],n_=ke("circle-check",nde);const rde=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],ade=ke("circle-question-mark",rde);const ide=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]],ode=ke("circle-user",ide);const sde=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],y5=ke("circle-x",sde);const lde=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ds=ke("clock",lde);const cde=[["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"}]],r_=ke("copy",cde);const ude=[["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"}]],fde=ke("database",ude);const dde=[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]],hde=ke("dollar-sign",dde);const pde=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],a_=ke("eye-off",pde);const mde=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],Oi=ke("eye",mde);const vde=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["circle",{cx:"11.5",cy:"14.5",r:"2.5",key:"1bq0ko"}],["path",{d:"M13.3 16.3 15 18",key:"2quom7"}]],x5=ke("file-search",vde);const gde=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],b5=ke("file-text",gde);const yde=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],xde=ke("funnel",yde);const bde=[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]],Ym=ke("hash",bde);const wde=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],w5=ke("house",wde);const Sde=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],jde=ke("image",Sde);const _de=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],S5=ke("info",_de);const Ade=[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]],Ode=ke("key",Ade);const Nde=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],kL=ke("lock",Nde);const Ede=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],Tde=ke("log-out",Ede);const Cde=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],Rde=ke("menu",Cde);const Pde=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],eg=ke("message-square",Pde);const kde=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],j5=ke("moon",kde);const Mde=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Dde=ke("package",Mde);const Lde=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],Xm=ke("pencil",Lde);const $de=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],$n=ke("plus",$de);const Ide=[["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"}]],Of=ke("refresh-cw",Ide);const zde=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],XA=ke("save",zde);const Bde=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Ms=ke("search",Bde);const qde=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Ude=ke("server",qde);const Fde=[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],_5=ke("settings",Fde);const Hde=[["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"}]],Vde=ke("shield",Hde);const Gde=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 14s1.5 2 4 2 4-2 4-2",key:"1y1vjs"}],["line",{x1:"9",x2:"9.01",y1:"9",y2:"9",key:"yxxnd0"}],["line",{x1:"15",x2:"15.01",y1:"9",y2:"9",key:"1p4y9e"}]],Kde=ke("smile",Gde);const Wde=[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]],ZA=ke("square-pen",Wde);const Yde=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],A5=ke("sun",Yde);const Xde=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Zde=ke("terminal",Xde);const Qde=[["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"}]],zt=ke("trash-2",Qde);const Jde=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],ehe=ke("trending-up",Jde);const the=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],ML=ke("triangle-alert",the);const nhe=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],rhe=ke("user",nhe);const ahe=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],ihe=ke("users",ahe);const ohe=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],QA=ke("x",ohe);const she=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],i_=ke("zap",she);var lhe=Symbol.for("react.lazy"),Zm=A_[" use ".trim().toString()];function che(e){return typeof e=="object"&&e!==null&&"then"in e}function O5(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===lhe&&"_payload"in e&&che(e._payload)}function JA(e){const t=fhe(e),n=S.forwardRef((r,a)=>{let{children:o,...l}=r;O5(o)&&typeof Zm=="function"&&(o=Zm(o._payload));const u=S.Children.toArray(o),d=u.find(hhe);if(d){const h=d.props.children,p=u.map(v=>v===d?S.Children.count(h)>1?S.Children.only(null):S.isValidElement(h)?h.props.children:null:v);return c.jsx(t,{...l,ref:a,children:S.isValidElement(h)?S.cloneElement(h,void 0,p):null})}return c.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}var uhe=JA("Slot");function fhe(e){const t=S.forwardRef((n,r)=>{let{children:a,...o}=n;if(O5(a)&&typeof Zm=="function"&&(a=Zm(a._payload)),S.isValidElement(a)){const l=mhe(a),u=phe(o,a.props);return a.type!==S.Fragment&&(u.ref=r?Qr(r,l):l),S.cloneElement(a,u)}return S.Children.count(a)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var dhe=Symbol("radix.slottable");function hhe(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===dhe}function phe(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function mhe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const DL=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,LL=Ve,tg=(e,t)=>n=>{var r;if(t?.variants==null)return LL(e,n?.class,n?.className);const{variants:a,defaultVariants:o}=t,l=Object.keys(a).map(h=>{const p=n?.[h],v=o?.[h];if(p===null)return null;const g=DL(p)||DL(v);return a[h][g]}),u=n&&Object.entries(n).reduce((h,p)=>{let[v,g]=p;return g===void 0||(h[v]=g),h},{}),d=t==null||(r=t.compoundVariants)===null||r===void 0?void 0:r.reduce((h,p)=>{let{class:v,className:g,...y}=p;return Object.entries(y).every(j=>{let[b,w]=j;return Array.isArray(w)?w.includes({...o,...u}[b]):{...o,...u}[b]===w})?[...h,v,g]:h},[]);return LL(e,l,d,n?.class,n?.className)},eO=tg("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground shadow hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",outline:"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),we=S.forwardRef(({className:e,variant:t,size:n,asChild:r=!1,...a},o)=>{const l=r?uhe:"button";return c.jsx(l,{className:je(eO({variant:t,size:n,className:e})),ref:o,...a})});we.displayName="Button";function vhe(){const[e,t]=S.useState(null),[n,r]=S.useState(!0),[a,o]=S.useState(24),[l,u]=S.useState(!0),d=S.useCallback(async()=>{try{const O=localStorage.getItem("token"),N=await Ut.get(`/api/webui/statistics/dashboard?hours=${a}`,{headers:{Authorization:`Bearer ${O}`}});t(N.data),r(!1)}catch(O){console.error("Failed to fetch dashboard data:",O),r(!1)}},[a]);if(S.useEffect(()=>{d()},[d]),S.useEffect(()=>{if(!l)return;const O=setInterval(()=>{d()},3e4);return()=>clearInterval(O)},[l,d]),n||!e)return c.jsx("div",{className:"flex items-center justify-center h-[calc(100vh-200px)]",children:c.jsxs("div",{className:"text-center space-y-4",children:[c.jsx(Of,{className:"h-12 w-12 animate-spin mx-auto text-muted-foreground"}),c.jsx("p",{className:"text-muted-foreground",children:"加载统计数据中..."})]})});const{summary:h,model_stats:p,hourly_data:v,daily_data:g,recent_activity:y}=e,j=O=>{const N=Math.floor(O/3600),T=Math.floor(O%3600/60);return`${N}小时${T}分钟`},b=O=>new Date(O).toLocaleString("zh-CN",{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"}),w=p.slice(0,6).map(O=>({name:O.model_name,value:O.request_count,fill:`hsl(var(--chart-${p.indexOf(O)%5+1}))`})),A={requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"},tokens:{label:"Tokens",color:"hsl(var(--chart-3))"}};return c.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"实时监控面板"}),c.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"麦麦运行状态和统计数据一览"})]}),c.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[c.jsx(Ql,{value:a.toString(),onValueChange:O=>o(Number(O)),children:c.jsxs(ms,{className:"grid grid-cols-3 w-full sm:w-auto",children:[c.jsx(_t,{value:"24",children:"24小时"}),c.jsx(_t,{value:"168",children:"7天"}),c.jsx(_t,{value:"720",children:"30天"})]})}),c.jsxs(we,{variant:l?"default":"outline",size:"sm",onClick:()=>u(!l),className:"gap-2",children:[c.jsx(Of,{className:`h-4 w-4 ${l?"animate-spin":""}`}),c.jsx("span",{className:"hidden sm:inline",children:"自动刷新"})]}),c.jsx(we,{variant:"outline",size:"sm",onClick:d,children:c.jsx(Of,{className:"h-4 w-4"})})]})]}),c.jsxs("div",{className:"grid gap-4 grid-cols-1 xs:grid-cols-2 lg:grid-cols-4",children:[c.jsxs(Dt,{children:[c.jsxs(Lt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[c.jsx($t,{className:"text-sm font-medium",children:"总请求数"}),c.jsx(Dfe,{className:"h-4 w-4 text-muted-foreground"})]}),c.jsxs(cn,{children:[c.jsx("div",{className:"text-2xl font-bold",children:h.total_requests.toLocaleString()}),c.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["最近",a<48?a+"小时":Math.floor(a/24)+"天"]})]})]}),c.jsxs(Dt,{children:[c.jsxs(Lt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[c.jsx($t,{className:"text-sm font-medium",children:"总花费"}),c.jsx(hde,{className:"h-4 w-4 text-muted-foreground"})]}),c.jsxs(cn,{children:[c.jsxs("div",{className:"text-2xl font-bold",children:["¥",h.total_cost.toFixed(2)]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:h.cost_per_hour>0?`¥${h.cost_per_hour.toFixed(2)}/小时`:"暂无数据"})]})]}),c.jsxs(Dt,{children:[c.jsxs(Lt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[c.jsx($t,{className:"text-sm font-medium",children:"Token消耗"}),c.jsx(fde,{className:"h-4 w-4 text-muted-foreground"})]}),c.jsxs(cn,{children:[c.jsxs("div",{className:"text-2xl font-bold",children:[(h.total_tokens/1e3).toFixed(1),"K"]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:h.tokens_per_hour>0?`${(h.tokens_per_hour/1e3).toFixed(1)}K/小时`:"暂无数据"})]})]}),c.jsxs(Dt,{children:[c.jsxs(Lt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[c.jsx($t,{className:"text-sm font-medium",children:"平均响应"}),c.jsx(i_,{className:"h-4 w-4 text-muted-foreground"})]}),c.jsxs(cn,{children:[c.jsxs("div",{className:"text-2xl font-bold",children:[h.avg_response_time.toFixed(2),"s"]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"API平均耗时"})]})]})]}),c.jsxs("div",{className:"grid gap-4 grid-cols-1 sm:grid-cols-3",children:[c.jsxs(Dt,{children:[c.jsxs(Lt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[c.jsx($t,{className:"text-sm font-medium",children:"在线时长"}),c.jsx(ds,{className:"h-4 w-4 text-muted-foreground"})]}),c.jsx(cn,{children:c.jsx("div",{className:"text-xl font-bold",children:j(h.online_time)})})]}),c.jsxs(Dt,{children:[c.jsxs(Lt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[c.jsx($t,{className:"text-sm font-medium",children:"消息处理"}),c.jsx(eg,{className:"h-4 w-4 text-muted-foreground"})]}),c.jsxs(cn,{children:[c.jsx("div",{className:"text-xl font-bold",children:h.total_messages.toLocaleString()}),c.jsxs("p",{className:"text-xs text-muted-foreground mt-1",children:["回复 ",h.total_replies.toLocaleString()," 条"]})]})]}),c.jsxs(Dt,{children:[c.jsxs(Lt,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[c.jsx($t,{className:"text-sm font-medium",children:"成本效率"}),c.jsx(ehe,{className:"h-4 w-4 text-muted-foreground"})]}),c.jsxs(cn,{children:[c.jsx("div",{className:"text-xl font-bold",children:h.total_messages>0?`¥${(h.total_cost/h.total_messages*100).toFixed(2)}`:"¥0.00"}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"每100条消息"})]})]})]}),c.jsxs(Ql,{defaultValue:"trends",className:"space-y-4",children:[c.jsxs(ms,{className:"grid w-full grid-cols-2 sm:grid-cols-4",children:[c.jsx(_t,{value:"trends",children:"趋势"}),c.jsx(_t,{value:"models",children:"模型"}),c.jsx(_t,{value:"activity",children:"活动"}),c.jsx(_t,{value:"daily",children:"日统计"})]}),c.jsxs(Pt,{value:"trends",className:"space-y-4",children:[c.jsxs(Dt,{children:[c.jsxs(Lt,{children:[c.jsx($t,{children:"请求趋势"}),c.jsxs(tr,{children:["最近",a,"小时的请求量变化"]})]}),c.jsx(cn,{children:c.jsx(Rl,{config:A,className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:c.jsxs(_fe,{data:v,children:[c.jsx(pf,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),c.jsx(fo,{dataKey:"timestamp",tickFormatter:O=>b(O),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),c.jsx(mi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),c.jsx(sf,{content:c.jsx(Pl,{labelFormatter:O=>b(O)})}),c.jsx(Td,{type:"monotone",dataKey:"requests",stroke:"var(--color-requests)",strokeWidth:2})]})})})]}),c.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[c.jsxs(Dt,{children:[c.jsxs(Lt,{children:[c.jsx($t,{children:"花费趋势"}),c.jsx(tr,{children:"API调用成本变化"})]}),c.jsx(cn,{children:c.jsx(Rl,{config:A,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:c.jsxs(o1,{data:v,children:[c.jsx(pf,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),c.jsx(fo,{dataKey:"timestamp",tickFormatter:O=>b(O),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),c.jsx(mi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),c.jsx(sf,{content:c.jsx(Pl,{labelFormatter:O=>b(O)})}),c.jsx(Pa,{dataKey:"cost",fill:"var(--color-cost)"})]})})})]}),c.jsxs(Dt,{children:[c.jsxs(Lt,{children:[c.jsx($t,{children:"Token消耗"}),c.jsx(tr,{children:"Token使用量变化"})]}),c.jsx(cn,{children:c.jsx(Rl,{config:A,className:"h-[250px] sm:h-[300px] w-full aspect-auto",children:c.jsxs(o1,{data:v,children:[c.jsx(pf,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),c.jsx(fo,{dataKey:"timestamp",tickFormatter:O=>b(O),angle:-45,textAnchor:"end",height:60,stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),c.jsx(mi,{stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),c.jsx(sf,{content:c.jsx(Pl,{labelFormatter:O=>b(O)})}),c.jsx(Pa,{dataKey:"tokens",fill:"var(--color-tokens)"})]})})})]})]})]}),c.jsx(Pt,{value:"models",className:"space-y-4",children:c.jsxs("div",{className:"grid gap-4 grid-cols-1 lg:grid-cols-2",children:[c.jsxs(Dt,{children:[c.jsxs(Lt,{children:[c.jsx($t,{children:"模型请求分布"}),c.jsx(tr,{children:"各模型使用占比"})]}),c.jsx(cn,{children:c.jsx(Rl,{config:Object.fromEntries(p.slice(0,6).map((O,N)=>[O.model_name,{label:O.model_name,color:`hsl(var(--chart-${N%5+1}))`}])),className:"h-[300px] sm:h-[400px] w-full aspect-auto",children:c.jsxs(Afe,{children:[c.jsx(sf,{content:c.jsx(Pl,{})}),c.jsx(Pi,{data:w,cx:"50%",cy:"50%",labelLine:!1,label:({name:O,percent:N})=>`${O} ${N?(N*100).toFixed(0):0}%`,outerRadius:100,dataKey:"value",children:w.map((O,N)=>c.jsx(Tv,{fill:O.fill},`cell-${N}`))})]})})})]}),c.jsxs(Dt,{children:[c.jsxs(Lt,{children:[c.jsx($t,{children:"模型详细统计"}),c.jsx(tr,{children:"请求数、花费和性能"})]}),c.jsx(cn,{children:c.jsx(Bn,{className:"h-[300px] sm:h-[400px]",children:c.jsx("div",{className:"space-y-3",children:p.map((O,N)=>c.jsxs("div",{className:"p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h4",{className:"font-semibold text-sm truncate flex-1 min-w-0",children:O.model_name}),c.jsx("div",{className:"w-3 h-3 rounded-full ml-2 flex-shrink-0",style:{backgroundColor:`hsl(var(--chart-${N%5+1}))`}})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground",children:"请求数:"}),c.jsx("span",{className:"ml-1 font-medium",children:O.request_count.toLocaleString()})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground",children:"花费:"}),c.jsxs("span",{className:"ml-1 font-medium",children:["¥",O.total_cost.toFixed(2)]})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),c.jsxs("span",{className:"ml-1 font-medium",children:[(O.total_tokens/1e3).toFixed(1),"K"]})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground",children:"平均耗时:"}),c.jsxs("span",{className:"ml-1 font-medium",children:[O.avg_response_time.toFixed(2),"s"]})]})]})]},N))})})})]})]})}),c.jsx(Pt,{value:"activity",children:c.jsxs(Dt,{children:[c.jsxs(Lt,{children:[c.jsx($t,{children:"最近活动"}),c.jsx(tr,{children:"最新的API调用记录"})]}),c.jsx(cn,{children:c.jsx(Bn,{className:"h-[400px] sm:h-[500px]",children:c.jsx("div",{className:"space-y-2",children:y.map((O,N)=>c.jsxs("div",{className:"p-3 sm:p-4 rounded-lg border bg-card hover:bg-accent/50 transition-colors",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-2",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("div",{className:"font-medium text-sm truncate",children:O.model}),c.jsx("div",{className:"text-xs text-muted-foreground",children:O.request_type})]}),c.jsx("div",{className:"text-xs text-muted-foreground flex-shrink-0",children:b(O.timestamp)})]}),c.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 text-xs",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground",children:"Tokens:"}),c.jsx("span",{className:"ml-1",children:O.tokens})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground",children:"花费:"}),c.jsxs("span",{className:"ml-1",children:["¥",O.cost.toFixed(4)]})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground",children:"耗时:"}),c.jsxs("span",{className:"ml-1",children:[O.time_cost.toFixed(2),"s"]})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground",children:"状态:"}),c.jsx("span",{className:`ml-1 ${O.status==="success"?"text-green-600":"text-red-600"}`,children:O.status})]})]})]},N))})})})]})}),c.jsx(Pt,{value:"daily",children:c.jsxs(Dt,{children:[c.jsxs(Lt,{children:[c.jsx($t,{children:"每日统计"}),c.jsx(tr,{children:"最近7天的数据汇总"})]}),c.jsx(cn,{children:c.jsx(Rl,{config:{requests:{label:"请求数",color:"hsl(var(--chart-1))"},cost:{label:"花费(¥)",color:"hsl(var(--chart-2))"}},className:"h-[400px] sm:h-[500px] w-full aspect-auto",children:c.jsxs(o1,{data:g,children:[c.jsx(pf,{strokeDasharray:"3 3",stroke:"hsl(var(--muted-foreground) / 0.2)"}),c.jsx(fo,{dataKey:"timestamp",tickFormatter:O=>{const N=new Date(O);return`${N.getMonth()+1}/${N.getDate()}`},stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),c.jsx(mi,{yAxisId:"left",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),c.jsx(mi,{yAxisId:"right",orientation:"right",stroke:"hsl(var(--muted-foreground))",tick:{fill:"hsl(var(--muted-foreground))"}}),c.jsx(sf,{content:c.jsx(Pl,{labelFormatter:O=>new Date(O).toLocaleDateString("zh-CN")})}),c.jsx(Efe,{content:c.jsx(p5,{})}),c.jsx(Pa,{yAxisId:"left",dataKey:"requests",fill:"var(--color-requests)"}),c.jsx(Pa,{yAxisId:"right",dataKey:"cost",fill:"var(--color-cost)"})]})})})]})})]})]})}const ghe={theme:"system",setTheme:()=>null},N5=S.createContext(ghe),tO=()=>{const e=S.useContext(N5);if(e===void 0)throw new Error("useTheme must be used within a ThemeProvider");return e},yhe=(e,t,n)=>{const r=document.documentElement.classList.contains("no-animations");if(!document.startViewTransition||r){t(e);return}const a=n.clientX,o=n.clientY,l=Math.hypot(Math.max(a,innerWidth-a),Math.max(o,innerHeight-o));document.startViewTransition(()=>{t(e)}).ready.then(()=>{document.documentElement.animate({clipPath:[`circle(0px at ${a}px ${o}px)`,`circle(${l}px at ${a}px ${o}px)`]},{duration:500,easing:"ease-in-out",pseudoElement:"::view-transition-new(root)"})})},E5=S.createContext(void 0),T5=()=>{const e=S.useContext(E5);if(e===void 0)throw new Error("useAnimation must be used within an AnimationProvider");return e};function ng(e){const t=S.useRef({value:e,previous:e});return S.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}function rg(e){const[t,n]=S.useState(void 0);return Sn(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(a=>{if(!Array.isArray(a)||!a.length)return;const o=a[0];let l,u;if("borderBoxSize"in o){const d=o.borderBoxSize,h=Array.isArray(d)?d[0]:d;l=h.inlineSize,u=h.blockSize}else l=e.offsetWidth,u=e.offsetHeight;n({width:l,height:u})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}var ag="Switch",[xhe]=Rr(ag),[bhe,whe]=xhe(ag),C5=S.forwardRef((e,t)=>{const{__scopeSwitch:n,name:r,checked:a,defaultChecked:o,required:l,disabled:u,value:d="on",onCheckedChange:h,form:p,...v}=e,[g,y]=S.useState(null),j=Fe(t,N=>y(N)),b=S.useRef(!1),w=g?p||!!g.closest("form"):!0,[A,O]=za({prop:a,defaultProp:o??!1,onChange:h,caller:ag});return c.jsxs(bhe,{scope:n,checked:A,disabled:u,children:[c.jsx(De.button,{type:"button",role:"switch","aria-checked":A,"aria-required":l,"data-state":M5(A),"data-disabled":u?"":void 0,disabled:u,value:d,...v,ref:j,onClick:Oe(e.onClick,N=>{O(T=>!T),w&&(b.current=N.isPropagationStopped(),b.current||N.stopPropagation())})}),w&&c.jsx(k5,{control:g,bubbles:!b.current,name:r,value:d,checked:A,required:l,disabled:u,form:p,style:{transform:"translateX(-100%)"}})]})});C5.displayName=ag;var R5="SwitchThumb",P5=S.forwardRef((e,t)=>{const{__scopeSwitch:n,...r}=e,a=whe(R5,n);return c.jsx(De.span,{"data-state":M5(a.checked),"data-disabled":a.disabled?"":void 0,...r,ref:t})});P5.displayName=R5;var She="SwitchBubbleInput",k5=S.forwardRef(({__scopeSwitch:e,control:t,checked:n,bubbles:r=!0,...a},o)=>{const l=S.useRef(null),u=Fe(l,o),d=ng(n),h=rg(t);return S.useEffect(()=>{const p=l.current;if(!p)return;const v=window.HTMLInputElement.prototype,y=Object.getOwnPropertyDescriptor(v,"checked").set;if(d!==n&&y){const j=new Event("click",{bubbles:r});y.call(p,n),p.dispatchEvent(j)}},[d,n,r]),c.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:n,...a,tabIndex:-1,ref:u,style:{...a.style,...h,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})});k5.displayName=She;function M5(e){return e?"checked":"unchecked"}var D5=C5,jhe=P5;const xt=S.forwardRef(({className:e,...t},n)=>c.jsx(D5,{className:je("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",e),...t,ref:n,children:c.jsx(jhe,{className:je("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})}));xt.displayName=D5.displayName;var _he=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Ahe=_he.reduce((e,t)=>{const n=JA(`Primitive.${t}`),r=S.forwardRef((a,o)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),Ohe="Label",L5=S.forwardRef((e,t)=>c.jsx(Ahe.label,{...e,ref:t,onMouseDown:n=>{n.target.closest("button, input, select, textarea")||(e.onMouseDown?.(n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));L5.displayName=Ohe;var $5=L5;const Nhe=tg("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),re=S.forwardRef(({className:e,...t},n)=>c.jsx($5,{ref:n,className:je(Nhe(),e),...t}));re.displayName=$5.displayName;const Ae=S.forwardRef(({className:e,type:t,...n},r)=>c.jsx("input",{type:t,className:je("flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:r,...n}));Ae.displayName="Input";const Ehe=1,The=1e6;let s1=0;function Che(){return s1=(s1+1)%Number.MAX_SAFE_INTEGER,s1.toString()}const l1=new Map,$L=e=>{if(l1.has(e))return;const t=setTimeout(()=>{l1.delete(e),Nf({type:"REMOVE_TOAST",toastId:e})},The);l1.set(e,t)},Rhe=(e,t)=>{switch(t.type){case"ADD_TOAST":return{...e,toasts:[t.toast,...e.toasts].slice(0,Ehe)};case"UPDATE_TOAST":return{...e,toasts:e.toasts.map(n=>n.id===t.toast.id?{...n,...t.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=t;return n?$L(n):e.toasts.forEach(r=>{$L(r.id)}),{...e,toasts:e.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(n=>n.id!==t.toastId)}}},Dp=[];let Lp={toasts:[]};function Nf(e){Lp=Rhe(Lp,e),Dp.forEach(t=>{t(Lp)})}function Phe({...e}){const t=Che(),n=a=>Nf({type:"UPDATE_TOAST",toast:{...a,id:t}}),r=()=>Nf({type:"DISMISS_TOAST",toastId:t});return Nf({type:"ADD_TOAST",toast:{...e,id:t,open:!0,onOpenChange:a=>{a||r()}}}),{id:t,dismiss:r,update:n}}function na(){const[e,t]=S.useState(Lp);return S.useEffect(()=>(Dp.push(t),()=>{const n=Dp.indexOf(t);n>-1&&Dp.splice(n,1)}),[e]),{...e,toast:Phe,dismiss:n=>Nf({type:"DISMISS_TOAST",toastId:n})}}const khe=[{id:"minLength",label:"长度至少 10 位",description:"Token 长度必须大于等于 10 个字符",validate:e=>e.length>=10},{id:"hasUppercase",label:"包含大写字母",description:"至少包含一个大写字母 (A-Z)",validate:e=>/[A-Z]/.test(e)},{id:"hasLowercase",label:"包含小写字母",description:"至少包含一个小写字母 (a-z)",validate:e=>/[a-z]/.test(e)},{id:"hasSpecialChar",label:"包含特殊符号",description:"至少包含一个特殊符号 (!@#$%^&*()_+-=[]{}|;:,.<>?/)",validate:e=>/[!@#$%^&*()_+\-=[\]{}|;:,.<>?/]/.test(e)}];function Mhe(e){const t=khe.map(r=>({id:r.id,label:r.label,description:r.description,passed:r.validate(e)}));return{isValid:t.every(r=>r.passed),rules:t}}const nO="0.2.0 Beta",I5="MaiBot Dashboard",Dhe=`${I5} v${nO}`,Lhe=(e="v")=>`${e}${nO}`;function $he(e,t=globalThis?.document){const n=nn(e);S.useEffect(()=>{const r=a=>{a.key==="Escape"&&n(a)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var Ihe="DismissableLayer",o_="dismissableLayer.update",zhe="dismissableLayer.pointerDownOutside",Bhe="dismissableLayer.focusOutside",IL,z5=S.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Cd=S.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:a,onFocusOutside:o,onInteractOutside:l,onDismiss:u,...d}=e,h=S.useContext(z5),[p,v]=S.useState(null),g=p?.ownerDocument??globalThis?.document,[,y]=S.useState({}),j=Fe(t,R=>v(R)),b=Array.from(h.layers),[w]=[...h.layersWithOutsidePointerEventsDisabled].slice(-1),A=b.indexOf(w),O=p?b.indexOf(p):-1,N=h.layersWithOutsidePointerEventsDisabled.size>0,T=O>=A,E=Uhe(R=>{const k=R.target,M=[...h.branches].some(U=>U.contains(k));!T||M||(a?.(R),l?.(R),R.defaultPrevented||u?.())},g),C=Fhe(R=>{const k=R.target;[...h.branches].some(U=>U.contains(k))||(o?.(R),l?.(R),R.defaultPrevented||u?.())},g);return $he(R=>{O===h.layers.size-1&&(r?.(R),!R.defaultPrevented&&u&&(R.preventDefault(),u()))},g),S.useEffect(()=>{if(p)return n&&(h.layersWithOutsidePointerEventsDisabled.size===0&&(IL=g.body.style.pointerEvents,g.body.style.pointerEvents="none"),h.layersWithOutsidePointerEventsDisabled.add(p)),h.layers.add(p),zL(),()=>{n&&h.layersWithOutsidePointerEventsDisabled.size===1&&(g.body.style.pointerEvents=IL)}},[p,g,n,h]),S.useEffect(()=>()=>{p&&(h.layers.delete(p),h.layersWithOutsidePointerEventsDisabled.delete(p),zL())},[p,h]),S.useEffect(()=>{const R=()=>y({});return document.addEventListener(o_,R),()=>document.removeEventListener(o_,R)},[]),c.jsx(De.div,{...d,ref:j,style:{pointerEvents:N?T?"auto":"none":void 0,...e.style},onFocusCapture:Oe(e.onFocusCapture,C.onFocusCapture),onBlurCapture:Oe(e.onBlurCapture,C.onBlurCapture),onPointerDownCapture:Oe(e.onPointerDownCapture,E.onPointerDownCapture)})});Cd.displayName=Ihe;var qhe="DismissableLayerBranch",B5=S.forwardRef((e,t)=>{const n=S.useContext(z5),r=S.useRef(null),a=Fe(t,r);return S.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),c.jsx(De.div,{...e,ref:a})});B5.displayName=qhe;function Uhe(e,t=globalThis?.document){const n=nn(e),r=S.useRef(!1),a=S.useRef(()=>{});return S.useEffect(()=>{const o=u=>{if(u.target&&!r.current){let d=function(){q5(zhe,n,h,{discrete:!0})};const h={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",a.current),a.current=d,t.addEventListener("click",a.current,{once:!0})):d()}else t.removeEventListener("click",a.current);r.current=!1},l=window.setTimeout(()=>{t.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(l),t.removeEventListener("pointerdown",o),t.removeEventListener("click",a.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function Fhe(e,t=globalThis?.document){const n=nn(e),r=S.useRef(!1);return S.useEffect(()=>{const a=o=>{o.target&&!r.current&&q5(Bhe,n,{originalEvent:o},{discrete:!1})};return t.addEventListener("focusin",a),()=>t.removeEventListener("focusin",a)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function zL(){const e=new CustomEvent(o_);document.dispatchEvent(e)}function q5(e,t,n,{discrete:r}){const a=n.originalEvent.target,o=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?d3(a,o):a.dispatchEvent(o)}var Hhe=Cd,Vhe=B5,c1="focusScope.autoFocusOnMount",u1="focusScope.autoFocusOnUnmount",BL={bubbles:!1,cancelable:!0},Ghe="FocusScope",ig=S.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:a,onUnmountAutoFocus:o,...l}=e,[u,d]=S.useState(null),h=nn(a),p=nn(o),v=S.useRef(null),g=Fe(t,b=>d(b)),y=S.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;S.useEffect(()=>{if(r){let b=function(N){if(y.paused||!u)return;const T=N.target;u.contains(T)?v.current=T:oo(v.current,{select:!0})},w=function(N){if(y.paused||!u)return;const T=N.relatedTarget;T!==null&&(u.contains(T)||oo(v.current,{select:!0}))},A=function(N){if(document.activeElement===document.body)for(const E of N)E.removedNodes.length>0&&oo(u)};document.addEventListener("focusin",b),document.addEventListener("focusout",w);const O=new MutationObserver(A);return u&&O.observe(u,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",b),document.removeEventListener("focusout",w),O.disconnect()}}},[r,u,y.paused]),S.useEffect(()=>{if(u){UL.add(y);const b=document.activeElement;if(!u.contains(b)){const A=new CustomEvent(c1,BL);u.addEventListener(c1,h),u.dispatchEvent(A),A.defaultPrevented||(Khe(Qhe(U5(u)),{select:!0}),document.activeElement===b&&oo(u))}return()=>{u.removeEventListener(c1,h),setTimeout(()=>{const A=new CustomEvent(u1,BL);u.addEventListener(u1,p),u.dispatchEvent(A),A.defaultPrevented||oo(b??document.body,{select:!0}),u.removeEventListener(u1,p),UL.remove(y)},0)}}},[u,h,p,y]);const j=S.useCallback(b=>{if(!n&&!r||y.paused)return;const w=b.key==="Tab"&&!b.altKey&&!b.ctrlKey&&!b.metaKey,A=document.activeElement;if(w&&A){const O=b.currentTarget,[N,T]=Whe(O);N&&T?!b.shiftKey&&A===T?(b.preventDefault(),n&&oo(N,{select:!0})):b.shiftKey&&A===N&&(b.preventDefault(),n&&oo(T,{select:!0})):A===O&&b.preventDefault()}},[n,r,y.paused]);return c.jsx(De.div,{tabIndex:-1,...l,ref:g,onKeyDown:j})});ig.displayName=Ghe;function Khe(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(oo(r,{select:t}),document.activeElement!==n)return}function Whe(e){const t=U5(e),n=qL(t,e),r=qL(t.reverse(),e);return[n,r]}function U5(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function qL(e,t){for(const n of e)if(!Yhe(n,{upTo:t}))return n}function Yhe(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function Xhe(e){return e instanceof HTMLInputElement&&"select"in e}function oo(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&Xhe(e)&&t&&e.select()}}var UL=Zhe();function Zhe(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=FL(e,t),e.unshift(t)},remove(t){e=FL(e,t),e[0]?.resume()}}}function FL(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Qhe(e){return e.filter(t=>t.tagName!=="A")}var Jhe="Portal",Rd=S.forwardRef((e,t)=>{const{container:n,...r}=e,[a,o]=S.useState(!1);Sn(()=>o(!0),[]);const l=n||a&&globalThis?.document?.body;return l?i7.createPortal(c.jsx(De.div,{...r,ref:t}),l):null});Rd.displayName=Jhe;var f1=0;function rO(){S.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??HL()),document.body.insertAdjacentElement("beforeend",e[1]??HL()),f1++,()=>{f1===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),f1--}},[])}function HL(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var Ta=function(){return Ta=Object.assign||function(t){for(var n,r=1,a=arguments.length;r"u")return vpe;var t=gpe(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},xpe=G5(),Hl="data-scroll-locked",bpe=function(e,t,n,r){var a=e.left,o=e.top,l=e.right,u=e.gap;return n===void 0&&(n="margin"),` .`.concat(tpe,` { overflow: hidden `).concat(r,`; padding-right: `).concat(u,"px ").concat(r,`; } body[`).concat(Hl,`] { overflow: hidden `).concat(r,`; overscroll-behavior: contain; `).concat([t&&"position: relative ".concat(r,";"),n==="margin"&&` padding-left: `.concat(a,`px; padding-top: `).concat(o,`px; padding-right: `).concat(l,`px; margin-left:0; margin-top:0; margin-right: `).concat(u,"px ").concat(r,`; `),n==="padding"&&"padding-right: ".concat(u,"px ").concat(r,";")].filter(Boolean).join(""),` } .`).concat($p,` { right: `).concat(u,"px ").concat(r,`; } .`).concat(Ip,` { margin-right: `).concat(u,"px ").concat(r,`; } .`).concat($p," .").concat($p,` { right: 0 `).concat(r,`; } .`).concat(Ip," .").concat(Ip,` { margin-right: 0 `).concat(r,`; } body[`).concat(Hl,`] { `).concat(npe,": ").concat(u,`px; } `)},GL=function(){var e=parseInt(document.body.getAttribute(Hl)||"0",10);return isFinite(e)?e:0},wpe=function(){S.useEffect(function(){return document.body.setAttribute(Hl,(GL()+1).toString()),function(){var e=GL()-1;e<=0?document.body.removeAttribute(Hl):document.body.setAttribute(Hl,e.toString())}},[])},Spe=function(e){var t=e.noRelative,n=e.noImportant,r=e.gapMode,a=r===void 0?"margin":r;wpe();var o=S.useMemo(function(){return ype(a)},[a]);return S.createElement(xpe,{styles:bpe(o,!t,a,n?"":"!important")})},s_=!1;if(typeof window<"u")try{var jp=Object.defineProperty({},"passive",{get:function(){return s_=!0,!0}});window.addEventListener("test",jp,jp),window.removeEventListener("test",jp,jp)}catch{s_=!1}var Ol=s_?{passive:!1}:!1,jpe=function(e){return e.tagName==="TEXTAREA"},K5=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!jpe(e)&&n[t]==="visible")},_pe=function(e){return K5(e,"overflowY")},Ape=function(e){return K5(e,"overflowX")},KL=function(e,t){var n=t.ownerDocument,r=t;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var a=W5(e,r);if(a){var o=Y5(e,r),l=o[1],u=o[2];if(l>u)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},Ope=function(e){var t=e.scrollTop,n=e.scrollHeight,r=e.clientHeight;return[t,n,r]},Npe=function(e){var t=e.scrollLeft,n=e.scrollWidth,r=e.clientWidth;return[t,n,r]},W5=function(e,t){return e==="v"?_pe(t):Ape(t)},Y5=function(e,t){return e==="v"?Ope(t):Npe(t)},Epe=function(e,t){return e==="h"&&t==="rtl"?-1:1},Tpe=function(e,t,n,r,a){var o=Epe(e,window.getComputedStyle(t).direction),l=o*r,u=n.target,d=t.contains(u),h=!1,p=l>0,v=0,g=0;do{if(!u)break;var y=Y5(e,u),j=y[0],b=y[1],w=y[2],A=b-w-o*j;(j||A)&&W5(e,u)&&(v+=A,g+=j);var O=u.parentNode;u=O&&O.nodeType===Node.DOCUMENT_FRAGMENT_NODE?O.host:O}while(!d&&u!==document.body||d&&(t.contains(u)||t===u));return(p&&Math.abs(v)<1||!p&&Math.abs(g)<1)&&(h=!0),h},_p=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},WL=function(e){return[e.deltaX,e.deltaY]},YL=function(e){return e&&"current"in e?e.current:e},Cpe=function(e,t){return e[0]===t[0]&&e[1]===t[1]},Rpe=function(e){return` .block-interactivity-`.concat(e,` {pointer-events: none;} .allow-interactivity-`).concat(e,` {pointer-events: all;} `)},Ppe=0,Nl=[];function kpe(e){var t=S.useRef([]),n=S.useRef([0,0]),r=S.useRef(),a=S.useState(Ppe++)[0],o=S.useState(G5)[0],l=S.useRef(e);S.useEffect(function(){l.current=e},[e]),S.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(a));var b=epe([e.lockRef.current],(e.shards||[]).map(YL),!0).filter(Boolean);return b.forEach(function(w){return w.classList.add("allow-interactivity-".concat(a))}),function(){document.body.classList.remove("block-interactivity-".concat(a)),b.forEach(function(w){return w.classList.remove("allow-interactivity-".concat(a))})}}},[e.inert,e.lockRef.current,e.shards]);var u=S.useCallback(function(b,w){if("touches"in b&&b.touches.length===2||b.type==="wheel"&&b.ctrlKey)return!l.current.allowPinchZoom;var A=_p(b),O=n.current,N="deltaX"in b?b.deltaX:O[0]-A[0],T="deltaY"in b?b.deltaY:O[1]-A[1],E,C=b.target,R=Math.abs(N)>Math.abs(T)?"h":"v";if("touches"in b&&R==="h"&&C.type==="range")return!1;var k=KL(R,C);if(!k)return!0;if(k?E=R:(E=R==="v"?"h":"v",k=KL(R,C)),!k)return!1;if(!r.current&&"changedTouches"in b&&(N||T)&&(r.current=E),!E)return!0;var M=r.current||E;return Tpe(M,w,b,M==="h"?N:T)},[]),d=S.useCallback(function(b){var w=b;if(!(!Nl.length||Nl[Nl.length-1]!==o)){var A="deltaY"in w?WL(w):_p(w),O=t.current.filter(function(E){return E.name===w.type&&(E.target===w.target||w.target===E.shadowParent)&&Cpe(E.delta,A)})[0];if(O&&O.should){w.cancelable&&w.preventDefault();return}if(!O){var N=(l.current.shards||[]).map(YL).filter(Boolean).filter(function(E){return E.contains(w.target)}),T=N.length>0?u(w,N[0]):!l.current.noIsolation;T&&w.cancelable&&w.preventDefault()}}},[]),h=S.useCallback(function(b,w,A,O){var N={name:b,delta:w,target:A,should:O,shadowParent:Mpe(A)};t.current.push(N),setTimeout(function(){t.current=t.current.filter(function(T){return T!==N})},1)},[]),p=S.useCallback(function(b){n.current=_p(b),r.current=void 0},[]),v=S.useCallback(function(b){h(b.type,WL(b),b.target,u(b,e.lockRef.current))},[]),g=S.useCallback(function(b){h(b.type,_p(b),b.target,u(b,e.lockRef.current))},[]);S.useEffect(function(){return Nl.push(o),e.setCallbacks({onScrollCapture:v,onWheelCapture:v,onTouchMoveCapture:g}),document.addEventListener("wheel",d,Ol),document.addEventListener("touchmove",d,Ol),document.addEventListener("touchstart",p,Ol),function(){Nl=Nl.filter(function(b){return b!==o}),document.removeEventListener("wheel",d,Ol),document.removeEventListener("touchmove",d,Ol),document.removeEventListener("touchstart",p,Ol)}},[]);var y=e.removeScrollBar,j=e.inert;return S.createElement(S.Fragment,null,j?S.createElement(o,{styles:Rpe(a)}):null,y?S.createElement(Spe,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function Mpe(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const Dpe=cpe(V5,kpe);var sg=S.forwardRef(function(e,t){return S.createElement(og,Ta({},e,{ref:t,sideCar:Dpe}))});sg.classNames=og.classNames;var Lpe=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},El=new WeakMap,Ap=new WeakMap,Op={},m1=0,X5=function(e){return e&&(e.host||X5(e.parentNode))},$pe=function(e,t){return t.map(function(n){if(e.contains(n))return n;var r=X5(n);return r&&e.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},Ipe=function(e,t,n,r){var a=$pe(t,Array.isArray(e)?e:[e]);Op[n]||(Op[n]=new WeakMap);var o=Op[n],l=[],u=new Set,d=new Set(a),h=function(v){!v||u.has(v)||(u.add(v),h(v.parentNode))};a.forEach(h);var p=function(v){!v||d.has(v)||Array.prototype.forEach.call(v.children,function(g){if(u.has(g))p(g);else try{var y=g.getAttribute(r),j=y!==null&&y!=="false",b=(El.get(g)||0)+1,w=(o.get(g)||0)+1;El.set(g,b),o.set(g,w),l.push(g),b===1&&j&&Ap.set(g,!0),w===1&&g.setAttribute(n,"true"),j||g.setAttribute(r,"true")}catch(A){console.error("aria-hidden: cannot operate on ",g,A)}})};return p(t),u.clear(),m1++,function(){l.forEach(function(v){var g=El.get(v)-1,y=o.get(v)-1;El.set(v,g),o.set(v,y),g||(Ap.has(v)||v.removeAttribute(r),Ap.delete(v)),y||v.removeAttribute(n)}),m1--,m1||(El=new WeakMap,El=new WeakMap,Ap=new WeakMap,Op={})}},aO=function(e,t,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(e)?e:[e]),a=Lpe(e);return a?(r.push.apply(r,Array.from(a.querySelectorAll("[aria-live], script"))),Ipe(r,a,n,"aria-hidden")):function(){return null}};function zpe(e){const t=Bpe(e),n=S.forwardRef((r,a)=>{const{children:o,...l}=r,u=S.Children.toArray(o),d=u.find(Upe);if(d){const h=d.props.children,p=u.map(v=>v===d?S.Children.count(h)>1?S.Children.only(null):S.isValidElement(h)?h.props.children:null:v);return c.jsx(t,{...l,ref:a,children:S.isValidElement(h)?S.cloneElement(h,void 0,p):null})}return c.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function Bpe(e){const t=S.forwardRef((n,r)=>{const{children:a,...o}=n;if(S.isValidElement(a)){const l=Hpe(a),u=Fpe(o,a.props);return a.type!==S.Fragment&&(u.ref=r?Qr(r,l):l),S.cloneElement(a,u)}return S.Children.count(a)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var qpe=Symbol("radix.slottable");function Upe(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===qpe}function Fpe(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function Hpe(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var lg="Dialog",[Z5,Q5]=Rr(lg),[Vpe,wa]=Z5(lg),J5=e=>{const{__scopeDialog:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:l=!0}=e,u=S.useRef(null),d=S.useRef(null),[h,p]=za({prop:r,defaultProp:a??!1,onChange:o,caller:lg});return c.jsx(Vpe,{scope:t,triggerRef:u,contentRef:d,contentId:Vn(),titleId:Vn(),descriptionId:Vn(),open:h,onOpenChange:p,onOpenToggle:S.useCallback(()=>p(v=>!v),[p]),modal:l,children:n})};J5.displayName=lg;var eq="DialogTrigger",tq=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=wa(eq,n),o=Fe(t,a.triggerRef);return c.jsx(De.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":sO(a.open),...r,ref:o,onClick:Oe(e.onClick,a.onOpenToggle)})});tq.displayName=eq;var iO="DialogPortal",[Gpe,nq]=Z5(iO,{forceMount:void 0}),rq=e=>{const{__scopeDialog:t,forceMount:n,children:r,container:a}=e,o=wa(iO,t);return c.jsx(Gpe,{scope:t,forceMount:n,children:S.Children.map(r,l=>c.jsx(Pr,{present:n||o.open,children:c.jsx(Rd,{asChild:!0,container:a,children:l})}))})};rq.displayName=iO;var Qm="DialogOverlay",aq=S.forwardRef((e,t)=>{const n=nq(Qm,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=wa(Qm,e.__scopeDialog);return o.modal?c.jsx(Pr,{present:r||o.open,children:c.jsx(Wpe,{...a,ref:t})}):null});aq.displayName=Qm;var Kpe=zpe("DialogOverlay.RemoveScroll"),Wpe=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=wa(Qm,n);return c.jsx(sg,{as:Kpe,allowPinchZoom:!0,shards:[a.contentRef],children:c.jsx(De.div,{"data-state":sO(a.open),...r,ref:t,style:{pointerEvents:"auto",...r.style}})})}),ws="DialogContent",iq=S.forwardRef((e,t)=>{const n=nq(ws,e.__scopeDialog),{forceMount:r=n.forceMount,...a}=e,o=wa(ws,e.__scopeDialog);return c.jsx(Pr,{present:r||o.open,children:o.modal?c.jsx(Ype,{...a,ref:t}):c.jsx(Xpe,{...a,ref:t})})});iq.displayName=ws;var Ype=S.forwardRef((e,t)=>{const n=wa(ws,e.__scopeDialog),r=S.useRef(null),a=Fe(t,n.contentRef,r);return S.useEffect(()=>{const o=r.current;if(o)return aO(o)},[]),c.jsx(oq,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oe(e.onCloseAutoFocus,o=>{o.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:Oe(e.onPointerDownOutside,o=>{const l=o.detail.originalEvent,u=l.button===0&&l.ctrlKey===!0;(l.button===2||u)&&o.preventDefault()}),onFocusOutside:Oe(e.onFocusOutside,o=>o.preventDefault())})}),Xpe=S.forwardRef((e,t)=>{const n=wa(ws,e.__scopeDialog),r=S.useRef(!1),a=S.useRef(!1);return c.jsx(oq,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=o.target;n.triggerRef.current?.contains(l)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),oq=S.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,...l}=e,u=wa(ws,n),d=S.useRef(null),h=Fe(t,d);return rO(),c.jsxs(c.Fragment,{children:[c.jsx(ig,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:c.jsx(Cd,{role:"dialog",id:u.contentId,"aria-describedby":u.descriptionId,"aria-labelledby":u.titleId,"data-state":sO(u.open),...l,ref:h,onDismiss:()=>u.onOpenChange(!1)})}),c.jsxs(c.Fragment,{children:[c.jsx(Qpe,{titleId:u.titleId}),c.jsx(eme,{contentRef:d,descriptionId:u.descriptionId})]})]})}),oO="DialogTitle",sq=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=wa(oO,n);return c.jsx(De.h2,{id:a.titleId,...r,ref:t})});sq.displayName=oO;var lq="DialogDescription",cq=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=wa(lq,n);return c.jsx(De.p,{id:a.descriptionId,...r,ref:t})});cq.displayName=lq;var uq="DialogClose",fq=S.forwardRef((e,t)=>{const{__scopeDialog:n,...r}=e,a=wa(uq,n);return c.jsx(De.button,{type:"button",...r,ref:t,onClick:Oe(e.onClick,()=>a.onOpenChange(!1))})});fq.displayName=uq;function sO(e){return e?"open":"closed"}var dq="DialogTitleWarning",[Zpe,hq]=YG(dq,{contentName:ws,titleName:oO,docsSlug:"dialog"}),Qpe=({titleId:e})=>{const t=hq(dq),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users. If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component. For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return S.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},Jpe="DialogDescriptionWarning",eme=({contentRef:e,descriptionId:t})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${hq(Jpe).contentName}}.`;return S.useEffect(()=>{const a=e.current?.getAttribute("aria-describedby");t&&a&&(document.getElementById(t)||console.warn(r))},[r,e,t]),null},lO=J5,pq=tq,cO=rq,cg=aq,ug=iq,uO=sq,fO=cq,dO=fq;const kr=lO,mq=pq,tme=cO,vq=S.forwardRef(({className:e,...t},n)=>c.jsx(cg,{ref:n,className:je("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));vq.displayName=cg.displayName;const sr=S.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(tme,{children:[c.jsx(vq,{}),c.jsxs(ug,{ref:r,className:je("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...n,children:[t,c.jsxs(dO,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[c.jsx(QA,{className:"h-4 w-4"}),c.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));sr.displayName=ug.displayName;const lr=({className:e,...t})=>c.jsx("div",{className:je("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});lr.displayName="DialogHeader";const Sa=({className:e,...t})=>c.jsx("div",{className:je("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});Sa.displayName="DialogFooter";const cr=S.forwardRef(({className:e,...t},n)=>c.jsx(uO,{ref:n,className:je("text-lg font-semibold leading-none tracking-tight",e),...t}));cr.displayName=uO.displayName;const Mr=S.forwardRef(({className:e,...t},n)=>c.jsx(fO,{ref:n,className:je("text-sm text-muted-foreground",e),...t}));Mr.displayName=fO.displayName;var nme=Symbol("radix.slottable");function rme(e){const t=({children:n})=>c.jsx(c.Fragment,{children:n});return t.displayName=`${e}.Slottable`,t.__radixId=nme,t}var gq="AlertDialog",[ame]=Rr(gq,[Q5]),ki=Q5(),yq=e=>{const{__scopeAlertDialog:t,...n}=e,r=ki(t);return c.jsx(lO,{...r,...n,modal:!0})};yq.displayName=gq;var ime="AlertDialogTrigger",xq=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ki(n);return c.jsx(pq,{...a,...r,ref:t})});xq.displayName=ime;var ome="AlertDialogPortal",bq=e=>{const{__scopeAlertDialog:t,...n}=e,r=ki(t);return c.jsx(cO,{...r,...n})};bq.displayName=ome;var sme="AlertDialogOverlay",wq=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ki(n);return c.jsx(cg,{...a,...r,ref:t})});wq.displayName=sme;var Vl="AlertDialogContent",[lme,cme]=ame(Vl),ume=rme("AlertDialogContent"),Sq=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,children:r,...a}=e,o=ki(n),l=S.useRef(null),u=Fe(t,l),d=S.useRef(null);return c.jsx(Zpe,{contentName:Vl,titleName:jq,docsSlug:"alert-dialog",children:c.jsx(lme,{scope:n,cancelRef:d,children:c.jsxs(ug,{role:"alertdialog",...o,...a,ref:u,onOpenAutoFocus:Oe(a.onOpenAutoFocus,h=>{h.preventDefault(),d.current?.focus({preventScroll:!0})}),onPointerDownOutside:h=>h.preventDefault(),onInteractOutside:h=>h.preventDefault(),children:[c.jsx(ume,{children:r}),c.jsx(dme,{contentRef:l})]})})})});Sq.displayName=Vl;var jq="AlertDialogTitle",_q=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ki(n);return c.jsx(uO,{...a,...r,ref:t})});_q.displayName=jq;var Aq="AlertDialogDescription",Oq=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ki(n);return c.jsx(fO,{...a,...r,ref:t})});Oq.displayName=Aq;var fme="AlertDialogAction",Nq=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,a=ki(n);return c.jsx(dO,{...a,...r,ref:t})});Nq.displayName=fme;var Eq="AlertDialogCancel",Tq=S.forwardRef((e,t)=>{const{__scopeAlertDialog:n,...r}=e,{cancelRef:a}=cme(Eq,n),o=ki(n),l=Fe(t,a);return c.jsx(dO,{...o,...r,ref:l})});Tq.displayName=Eq;var dme=({contentRef:e})=>{const t=`\`${Vl}\` requires a description for the component to be accessible for screen reader users. You can add a description to the \`${Vl}\` by passing a \`${Aq}\` component as a child, which also benefits sighted users by adding visible context to the dialog. Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${Vl}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component. For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return S.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(t)},[t,e]),null},hme=yq,pme=xq,mme=bq,Cq=wq,Rq=Sq,Pq=Nq,kq=Tq,Mq=_q,Dq=Oq;const Rn=hme,ma=pme,vme=mme,Lq=S.forwardRef(({className:e,...t},n)=>c.jsx(Cq,{className:je("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t,ref:n}));Lq.displayName=Cq.displayName;const mn=S.forwardRef(({className:e,...t},n)=>c.jsxs(vme,{children:[c.jsx(Lq,{}),c.jsx(Rq,{ref:n,className:je("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",e),...t})]}));mn.displayName=Rq.displayName;const vn=({className:e,...t})=>c.jsx("div",{className:je("flex flex-col space-y-2 text-center sm:text-left",e),...t});vn.displayName="AlertDialogHeader";const gn=({className:e,...t})=>c.jsx("div",{className:je("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});gn.displayName="AlertDialogFooter";const yn=S.forwardRef(({className:e,...t},n)=>c.jsx(Mq,{ref:n,className:je("text-lg font-semibold",e),...t}));yn.displayName=Mq.displayName;const xn=S.forwardRef(({className:e,...t},n)=>c.jsx(Dq,{ref:n,className:je("text-sm text-muted-foreground",e),...t}));xn.displayName=Dq.displayName;const bn=S.forwardRef(({className:e,...t},n)=>c.jsx(Pq,{ref:n,className:je(eO(),e),...t}));bn.displayName=Pq.displayName;const wn=S.forwardRef(({className:e,...t},n)=>c.jsx(kq,{ref:n,className:je(eO({variant:"outline"}),"mt-2 sm:mt-0",e),...t}));wn.displayName=kq.displayName;function gme(){return c.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[c.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"系统设置"}),c.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理您的应用偏好设置"})]})}),c.jsxs(Ql,{defaultValue:"appearance",className:"w-full",children:[c.jsxs(ms,{className:"grid w-full max-w-full sm:max-w-2xl grid-cols-4",children:[c.jsxs(_t,{value:"appearance",className:"gap-2",children:[c.jsx(_5,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"外观"]}),c.jsxs(_t,{value:"notifications",className:"gap-2",children:[c.jsx(qfe,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"通知"]}),c.jsxs(_t,{value:"security",className:"gap-2",children:[c.jsx(Vde,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"安全"]}),c.jsxs(_t,{value:"about",className:"gap-2",children:[c.jsx(S5,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"关于"]})]}),c.jsxs(Bn,{className:"h-[calc(100vh-280px)] mt-6",children:[c.jsx(Pt,{value:"appearance",className:"mt-0",children:c.jsx(yme,{})}),c.jsx(Pt,{value:"notifications",className:"mt-0",children:c.jsx(xme,{})}),c.jsx(Pt,{value:"security",className:"mt-0",children:c.jsx(bme,{})}),c.jsx(Pt,{value:"about",className:"mt-0",children:c.jsx(wme,{})})]})]})]})}function yme(){const{theme:e,setTheme:t}=tO(),{enableAnimations:n,setEnableAnimations:r,enableWavesBackground:a,setEnableWavesBackground:o}=T5(),[l,u]=S.useState(()=>localStorage.getItem("accent-color")||"blue"),d=h=>{u(h),localStorage.setItem("accent-color",h);const p=document.documentElement,g={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%"},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%"},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%"},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%"},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%"}}[h];g&&p.style.setProperty("--primary",g.hsl)};return c.jsxs("div",{className:"space-y-8",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold mb-4",children:"主题模式"}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[c.jsx(v1,{value:"light",current:e,onChange:t,label:"浅色",description:"始终使用浅色主题"}),c.jsx(v1,{value:"dark",current:e,onChange:t,label:"深色",description:"始终使用深色主题"}),c.jsx(v1,{value:"system",current:e,onChange:t,label:"跟随系统",description:"根据系统设置自动切换"})]})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold mb-4",children:"主题色"}),c.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-5 gap-4",children:[c.jsx(lf,{value:"blue",current:l,onChange:d,label:"蓝色",colorClass:"bg-blue-500"}),c.jsx(lf,{value:"purple",current:l,onChange:d,label:"紫色",colorClass:"bg-purple-500"}),c.jsx(lf,{value:"green",current:l,onChange:d,label:"绿色",colorClass:"bg-green-500"}),c.jsx(lf,{value:"orange",current:l,onChange:d,label:"橙色",colorClass:"bg-orange-500"}),c.jsx(lf,{value:"pink",current:l,onChange:d,label:"粉色",colorClass:"bg-pink-500"})]})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold mb-4",children:"动画效果"}),c.jsxs("div",{className:"space-y-3",children:[c.jsx("div",{className:"rounded-lg border bg-card p-4",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"space-y-0.5 flex-1",children:[c.jsx(re,{htmlFor:"animations",className:"text-base font-medium cursor-pointer",children:"启用动画效果"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后将禁用所有过渡动画和特效,提升性能"})]}),c.jsx(xt,{id:"animations",checked:n,onCheckedChange:r})]})}),c.jsx("div",{className:"rounded-lg border bg-card p-4",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"space-y-0.5 flex-1",children:[c.jsx(re,{htmlFor:"waves-background",className:"text-base font-medium cursor-pointer",children:"登录页波浪背景"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭后登录页将使用纯色背景,适合低性能设备"})]}),c.jsx(xt,{id:"waves-background",checked:a,onCheckedChange:o})]})})]})]})]})}function xme(){return c.jsx("div",{className:"space-y-6",children:c.jsxs("div",{className:"rounded-lg border bg-card p-6",children:[c.jsx("h3",{className:"text-lg font-semibold mb-2",children:"通知设置"}),c.jsx("p",{className:"text-muted-foreground",children:"通知功能正在开发中..."})]})})}function bme(){const[e,t]=S.useState(""),[n,r]=S.useState(""),[a,o]=S.useState(!1),[l,u]=S.useState(!1),[d,h]=S.useState(!1),[p,v]=S.useState(!1),[g,y]=S.useState(!1),[j,b]=S.useState(!1),[w,A]=S.useState(""),[O,N]=S.useState(!1),{toast:T}=na(),E=S.useMemo(()=>Mhe(n),[n]),C=()=>localStorage.getItem("access-token")||"",R=async z=>{try{await navigator.clipboard.writeText(z),y(!0),T({title:"复制成功",description:"Token 已复制到剪贴板"}),setTimeout(()=>y(!1),2e3)}catch{T({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},k=async()=>{if(!n.trim()){T({title:"输入错误",description:"请输入新的 Token",variant:"destructive"});return}if(!E.isValid){const z=E.rules.filter(V=>!V.passed).map(V=>V.label).join(", ");T({title:"格式错误",description:`Token 不符合要求: ${z}`,variant:"destructive"});return}h(!0);try{const z=C(),V=await fetch("/api/webui/auth/update",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${z}`},body:JSON.stringify({new_token:n.trim()})}),F=await V.json();V.ok&&F.success?(localStorage.setItem("access-token",n.trim()),r(""),e&&t(n.trim()),T({title:"更新成功",description:"Access Token 已更新"})):T({title:"更新失败",description:F.message||"无法更新 Token",variant:"destructive"})}catch(z){console.error("更新 Token 错误:",z),T({title:"更新失败",description:"连接服务器失败",variant:"destructive"})}finally{h(!1)}},M=async()=>{v(!0);try{const z=C(),V=await fetch("/api/webui/auth/regenerate",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${z}`}}),F=await V.json();V.ok&&F.success?(localStorage.setItem("access-token",F.token),A(F.token),b(!0),N(!1),T({title:"生成成功",description:"新的 Access Token 已生成,请及时保存"})):T({title:"生成失败",description:F.message||"无法生成新 Token",variant:"destructive"})}catch(z){console.error("生成 Token 错误:",z),T({title:"生成失败",description:"连接服务器失败",variant:"destructive"})}finally{v(!1)}},U=async()=>{try{await navigator.clipboard.writeText(w),N(!0),T({title:"复制成功",description:"Token 已复制到剪贴板"})}catch{T({title:"复制失败",description:"请手动复制 Token",variant:"destructive"})}},$=()=>{b(!1),setTimeout(()=>{A(""),N(!1)},300)};return c.jsxs("div",{className:"space-y-6",children:[c.jsx(kr,{open:j,onOpenChange:b,children:c.jsxs(sr,{className:"sm:max-w-md",children:[c.jsxs(lr,{children:[c.jsxs(cr,{className:"flex items-center gap-2",children:[c.jsx(ML,{className:"h-5 w-5 text-yellow-500"}),"新的 Access Token"]}),c.jsx(Mr,{children:"这是您的新 Token,请立即保存。关闭此窗口后将无法再次查看。"})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"rounded-lg border-2 border-primary/20 bg-primary/5 p-4",children:[c.jsx(re,{className:"text-xs text-muted-foreground mb-2 block",children:"您的新 Token (64位安全令牌)"}),c.jsx("div",{className:"font-mono text-sm break-all select-all bg-background p-3 rounded border",children:w})]}),c.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:c.jsxs("div",{className:"flex gap-2",children:[c.jsx(ML,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5"}),c.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[c.jsx("p",{className:"font-semibold",children:"重要提示"}),c.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[c.jsx("li",{children:"此 Token 仅显示一次,关闭后无法再查看"}),c.jsx("li",{children:"请立即复制并保存到安全的位置"}),c.jsx("li",{children:"旧的 Token 已失效,请使用新 Token 登录"})]})]})]})})]}),c.jsxs(Sa,{className:"gap-2 sm:gap-0",children:[c.jsx(we,{variant:"outline",onClick:U,className:"gap-2",children:O?c.jsxs(c.Fragment,{children:[c.jsx(Fl,{className:"h-4 w-4 text-green-500"}),"已复制"]}):c.jsxs(c.Fragment,{children:[c.jsx(r_,{className:"h-4 w-4"}),"复制 Token"]})}),c.jsx(we,{onClick:$,children:"我已保存,关闭"})]})]})}),c.jsxs("div",{className:"rounded-lg border bg-card p-6",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4",children:"当前 Access Token"}),c.jsx("div",{className:"space-y-4",children:c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{htmlFor:"current-token",children:"您的访问令牌"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs("div",{className:"relative flex-1",children:[c.jsx(Ae,{id:"current-token",type:a?"text":"password",value:e||C(),readOnly:!0,className:"pr-10 font-mono text-sm",placeholder:"点击查看按钮显示 Token"}),c.jsx("button",{onClick:()=>{e||t(C()),o(!a)},className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:a?"隐藏":"显示",children:a?c.jsx(a_,{className:"h-4 w-4 text-muted-foreground"}):c.jsx(Oi,{className:"h-4 w-4 text-muted-foreground"})})]}),c.jsx(we,{variant:"outline",size:"icon",onClick:()=>R(C()),title:"复制到剪贴板",children:g?c.jsx(Fl,{className:"h-4 w-4 text-green-500"}):c.jsx(r_,{className:"h-4 w-4"})}),c.jsxs(Rn,{children:[c.jsx(ma,{asChild:!0,children:c.jsxs(we,{variant:"outline",disabled:p,className:"gap-2",children:[c.jsx(Of,{className:je("h-4 w-4",p&&"animate-spin")}),"重新生成"]})}),c.jsxs(mn,{children:[c.jsxs(vn,{children:[c.jsx(yn,{children:"确认重新生成 Token"}),c.jsx(xn,{children:"这将生成一个新的 64 位安全令牌,并使当前 Token 立即失效。 您需要使用新 Token 重新登录系统。此操作不可撤销,确定要继续吗?"})]}),c.jsxs(gn,{children:[c.jsx(wn,{children:"取消"}),c.jsx(bn,{onClick:M,children:"确认生成"})]})]})]})]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"请妥善保管您的 Access Token,不要泄露给他人"})]})})]}),c.jsxs("div",{className:"rounded-lg border bg-card p-6",children:[c.jsx("h3",{className:"text-lg font-semibold mb-4",children:"自定义 Access Token"}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{htmlFor:"new-token",children:"新的访问令牌"}),c.jsxs("div",{className:"relative",children:[c.jsx(Ae,{id:"new-token",type:l?"text":"password",value:n,onChange:z=>r(z.target.value),className:"pr-10 font-mono text-sm",placeholder:"输入自定义 Token"}),c.jsx("button",{onClick:()=>u(!l),className:"absolute right-2 top-1/2 -translate-y-1/2 p-1.5 hover:bg-accent rounded",title:l?"隐藏":"显示",children:l?c.jsx(a_,{className:"h-4 w-4 text-muted-foreground"}):c.jsx(Oi,{className:"h-4 w-4 text-muted-foreground"})})]}),n&&c.jsxs("div",{className:"mt-3 space-y-2 p-3 rounded-lg bg-muted/50",children:[c.jsx("p",{className:"text-sm font-medium text-foreground",children:"Token 安全要求:"}),c.jsx("div",{className:"space-y-1.5",children:E.rules.map(z=>c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[z.passed?c.jsx(n_,{className:"h-4 w-4 text-green-500 flex-shrink-0"}):c.jsx(y5,{className:"h-4 w-4 text-muted-foreground flex-shrink-0"}),c.jsx("span",{className:je(z.passed?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:z.label})]},z.id))}),E.isValid&&c.jsx("div",{className:"mt-2 pt-2 border-t border-border",children:c.jsxs("div",{className:"flex items-center gap-2 text-sm text-green-600 dark:text-green-400",children:[c.jsx(Fl,{className:"h-4 w-4"}),c.jsx("span",{className:"font-medium",children:"Token 格式正确,可以使用"})]})})]})]}),c.jsx(we,{onClick:k,disabled:d||!E.isValid||!n,className:"w-full sm:w-auto",children:d?"更新中...":"更新自定义 Token"})]})]}),c.jsxs("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-4",children:[c.jsx("h4",{className:"font-semibold text-yellow-900 dark:text-yellow-200 mb-2",children:"安全提示"}),c.jsxs("ul",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1 list-disc list-inside",children:[c.jsx("li",{children:"重新生成 Token 会创建系统随机生成的 64 位安全令牌"}),c.jsx("li",{children:"自定义 Token 必须满足所有安全要求才能使用"}),c.jsx("li",{children:"更新 Token 后,旧的 Token 将立即失效"}),c.jsx("li",{children:"请在安全的环境下查看和复制 Token"}),c.jsx("li",{children:"如果怀疑 Token 泄露,请立即重新生成或更新"}),c.jsx("li",{children:"建议使用系统生成的 Token 以获得最高安全性"})]})]})]})}function wme(){return c.jsx("div",{className:"space-y-6",children:c.jsxs("div",{className:"rounded-lg border bg-card p-6",children:[c.jsxs("h3",{className:"text-lg font-semibold mb-4",children:["关于 ",I5]}),c.jsxs("div",{className:"space-y-2 text-sm text-muted-foreground",children:[c.jsxs("p",{children:["版本: ",nO]}),c.jsx("p",{children:"基于 React 19 + Vite + TanStack Router"})]})]})})}function v1({value:e,current:t,onChange:n,label:r,description:a}){const o=t===e;return c.jsxs("button",{onClick:()=>n(e),className:je("relative rounded-lg border-2 p-4 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",o?"border-primary bg-accent":"border-border"),children:[o&&c.jsx("div",{className:"absolute top-3 right-3 h-2 w-2 rounded-full bg-primary"}),c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"font-medium",children:r}),c.jsx("div",{className:"text-xs text-muted-foreground",children:a})]}),c.jsxs("div",{className:"mt-3 flex gap-1",children:[e==="light"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-200"}),c.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-300"}),c.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-400"})]}),e==="dark"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-700"}),c.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-800"}),c.jsx("div",{className:"h-2 w-2 rounded-full bg-slate-900"})]}),e==="system"&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-200 to-slate-700"}),c.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-300 to-slate-800"}),c.jsx("div",{className:"h-2 w-2 rounded-full bg-gradient-to-r from-slate-400 to-slate-900"})]})]})]})}function lf({value:e,current:t,onChange:n,label:r,colorClass:a}){const o=t===e;return c.jsxs("button",{onClick:()=>n(e),className:je("relative rounded-lg border-2 p-4 text-left transition-all","hover:border-primary/50 hover:bg-accent/50",o?"border-primary bg-accent":"border-border"),children:[o&&c.jsx("div",{className:"absolute top-2 right-2 h-2 w-2 rounded-full bg-primary"}),c.jsxs("div",{className:"flex flex-col items-center gap-3",children:[c.jsx("div",{className:je("h-12 w-12 rounded-full",a)}),c.jsx("div",{className:"text-sm font-medium",children:r})]})]})}class Sme{grad3;p;perm;constructor(t=0){this.grad3=[[1,1,0],[-1,1,0],[1,-1,0],[-1,-1,0],[1,0,1],[-1,0,1],[1,0,-1],[-1,0,-1],[0,1,1],[0,-1,1],[0,1,-1],[0,-1,-1]],this.p=[];for(let n=0;n<256;n++)this.p[n]=Math.floor(Math.random()*256);this.perm=[];for(let n=0;n<512;n++)this.perm[n]=this.p[n&255]}dot(t,n,r){return t[0]*n+t[1]*r}mix(t,n,r){return(1-r)*t+r*n}fade(t){return t*t*t*(t*(t*6-15)+10)}perlin2(t,n){const r=Math.floor(t)&255,a=Math.floor(n)&255;t-=Math.floor(t),n-=Math.floor(n);const o=this.fade(t),l=this.fade(n),u=this.perm[r]+a,d=this.perm[u],h=this.perm[u+1],p=this.perm[r+1]+a,v=this.perm[p],g=this.perm[p+1];return this.mix(this.mix(this.dot(this.grad3[d%12],t,n),this.dot(this.grad3[v%12],t-1,n),o),this.mix(this.dot(this.grad3[h%12],t,n-1),this.dot(this.grad3[g%12],t-1,n-1),o),l)}}function jme(){const e=S.useRef(null),t=S.useRef(null),n=S.useRef(void 0),r=S.useRef({mouse:{x:-10,y:0,lx:0,ly:0,sx:0,sy:0,v:0,vs:0,a:0,set:!1},lines:[],paths:[],noise:new Sme(Math.random()),bounding:null});return S.useEffect(()=>{const a=t.current,o=e.current;if(!a||!o)return;const l=r.current,u=()=>{const b=a.getBoundingClientRect();l.bounding=b,o.style.width=`${b.width}px`,o.style.height=`${b.height}px`},d=()=>{if(!l.bounding)return;const{width:b,height:w}=l.bounding;l.lines=[],l.paths.forEach(M=>M.remove()),l.paths=[];const A=10,O=32,N=b+200,T=w+30,E=Math.ceil(N/A),C=Math.ceil(T/O),R=(b-A*E)/2,k=(w-O*C)/2;for(let M=0;M<=E;M++){const U=[];for(let z=0;z<=C;z++){const V={x:R+A*M,y:k+O*z,wave:{x:0,y:0},cursor:{x:0,y:0,vx:0,vy:0}};U.push(V)}const $=document.createElementNS("http://www.w3.org/2000/svg","path");o.appendChild($),l.paths.push($),l.lines.push(U)}},h=b=>{const{lines:w,mouse:A,noise:O}=l;w.forEach(N=>{N.forEach(T=>{const E=O.perlin2((T.x+b*.0125)*.002,(T.y+b*.005)*.0015)*12;T.wave.x=Math.cos(E)*32,T.wave.y=Math.sin(E)*16;const C=T.x-A.sx,R=T.y-A.sy,k=Math.hypot(C,R),M=Math.max(175,A.vs);if(k{const A={x:b.x+b.wave.x+(w?b.cursor.x:0),y:b.y+b.wave.y+(w?b.cursor.y:0)};return A.x=Math.round(A.x*10)/10,A.y=Math.round(A.y*10)/10,A},v=()=>{const{lines:b,paths:w}=l;b.forEach((A,O)=>{let N=p(A[0],!1),T=`M ${N.x} ${N.y}`;A.forEach((E,C)=>{const R=C===A.length-1;N=p(E,!R),T+=`L ${N.x} ${N.y}`}),w[O].setAttribute("d",T)})},g=b=>{const{mouse:w}=l;w.sx+=(w.x-w.sx)*.1,w.sy+=(w.y-w.sy)*.1;const A=w.x-w.lx,O=w.y-w.ly,N=Math.hypot(A,O);w.v=N,w.vs+=(N-w.vs)*.1,w.vs=Math.min(100,w.vs),w.lx=w.x,w.ly=w.y,w.a=Math.atan2(O,A),a&&(a.style.setProperty("--x",`${w.sx}px`),a.style.setProperty("--y",`${w.sy}px`)),h(b),v(),n.current=requestAnimationFrame(g)},y=b=>{if(!l.bounding)return;const{mouse:w}=l;w.x=b.pageX-l.bounding.left,w.y=b.pageY-l.bounding.top+window.scrollY,w.set||(w.sx=w.x,w.sy=w.y,w.lx=w.x,w.ly=w.y,w.set=!0)},j=()=>{u(),d()};return u(),d(),window.addEventListener("resize",j),window.addEventListener("mousemove",y),n.current=requestAnimationFrame(g),()=>{window.removeEventListener("resize",j),window.removeEventListener("mousemove",y),n.current&&cancelAnimationFrame(n.current)}},[]),c.jsxs("div",{ref:t,className:"waves-background",style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",overflow:"hidden",pointerEvents:"none"},children:[c.jsx("div",{className:"waves-cursor",style:{position:"absolute",top:0,left:0,width:"0.5rem",height:"0.5rem",background:"hsl(var(--primary) / 0.3)",borderRadius:"50%",transform:"translate3d(calc(var(--x, -0.5rem) - 50%), calc(var(--y, 50%) - 50%), 0)",willChange:"transform",pointerEvents:"none"}}),c.jsx("svg",{ref:e,style:{display:"block",width:"100%",height:"100%"},children:c.jsx("style",{children:` path { fill: none; stroke: hsl(var(--primary) / 0.20); stroke-width: 1px; } `})})]})}function _me(){const e=Ns();S.useEffect(()=>{localStorage.getItem("access-token")||e({to:"/auth"})},[e])}function $q(){return!!localStorage.getItem("access-token")}function Ame(){const[e,t]=S.useState(""),[n,r]=S.useState(!1),[a,o]=S.useState(""),l=Ns(),{enableWavesBackground:u,setEnableWavesBackground:d}=T5(),{theme:h,setTheme:p}=tO();S.useEffect(()=>{$q()&&l({to:"/"})},[l]);const g=h==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":h,y=()=>{p(g==="dark"?"light":"dark")},j=async b=>{if(b.preventDefault(),o(""),!e.trim()){o("请输入 Access Token");return}r(!0);try{const w=await fetch("/api/webui/auth/verify",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({token:e.trim()})}),A=await w.json();w.ok&&A.valid?(localStorage.setItem("access-token",e.trim()),l({to:"/"})):o(A.message||"Token 验证失败,请检查后重试")}catch(w){console.error("Token 验证错误:",w),o("连接服务器失败,请检查网络连接")}finally{r(!1)}};return c.jsxs("div",{className:"relative flex min-h-screen items-center justify-center overflow-hidden bg-background p-4",children:[u&&c.jsx(jme,{}),c.jsxs(Dt,{className:"relative z-10 w-full max-w-md shadow-2xl backdrop-blur-xl bg-card/80 border-border/50",children:[c.jsx("button",{onClick:y,className:"absolute right-4 top-4 rounded-lg p-2 hover:bg-accent transition-colors z-10 text-foreground",title:g==="dark"?"切换到浅色模式":"切换到深色模式",children:g==="dark"?c.jsx(A5,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"}):c.jsx(j5,{className:"h-5 w-5",strokeWidth:2.5,fill:"none"})}),c.jsxs(Lt,{className:"space-y-4 text-center",children:[c.jsx("div",{className:"mx-auto flex h-16 w-16 items-center justify-center rounded-2xl bg-primary/10",children:c.jsx(kL,{className:"h-8 w-8 text-primary",strokeWidth:2,fill:"none"})}),c.jsxs("div",{className:"space-y-2",children:[c.jsx($t,{className:"text-2xl font-bold",children:"欢迎使用 MaiBot"}),c.jsx(tr,{className:"text-base",children:"请输入您的 Access Token 以继续访问系统"})]})]}),c.jsx(cn,{children:c.jsxs("form",{onSubmit:j,className:"space-y-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{htmlFor:"token",className:"text-sm font-medium",children:"Access Token"}),c.jsxs("div",{className:"relative",children:[c.jsx(Ode,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground",strokeWidth:2,fill:"none"}),c.jsx(Ae,{id:"token",type:"password",placeholder:"请输入您的 Access Token",value:e,onChange:b=>t(b.target.value),className:je("pl-10",a&&"border-red-500 focus-visible:ring-red-500"),disabled:n,autoFocus:!0,autoComplete:"off"})]})]}),a&&c.jsxs("div",{className:"flex items-center gap-2 rounded-md bg-red-50 p-3 text-sm text-red-600 dark:bg-red-950/50 dark:text-red-400",children:[c.jsx(PL,{className:"h-4 w-4 flex-shrink-0",strokeWidth:2,fill:"none"}),c.jsx("span",{children:a})]}),c.jsx(we,{type:"submit",className:"w-full",disabled:n,children:n?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"mr-2 h-4 w-4 animate-spin rounded-full border-2 border-current border-t-transparent"}),"验证中..."]}):"验证并进入"}),c.jsxs(kr,{children:[c.jsx(mq,{asChild:!0,children:c.jsxs("button",{className:"w-full text-center text-sm text-primary hover:text-primary/80 transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[c.jsx(ade,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我没有 Token,我该去哪里获得 Token?"]})}),c.jsxs(sr,{className:"sm:max-w-md",children:[c.jsxs(lr,{children:[c.jsxs(cr,{className:"flex items-center gap-2",children:[c.jsx(kL,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"如何获取 Access Token"]}),c.jsx(Mr,{children:"Access Token 是访问 MaiBot WebUI 的唯一凭证,请按以下方式获取"})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(Zde,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),c.jsxs("div",{className:"flex-1 space-y-2",children:[c.jsx("h4",{className:"font-semibold text-sm",children:"方式一:查看启动日志"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"在 MaiBot 启动时,控制台会显示 WebUI Access Token。"}),c.jsxs("div",{className:"rounded bg-background p-2 font-mono text-xs",children:[c.jsx("p",{className:"text-muted-foreground",children:"🔑 WebUI Access Token: abc123..."}),c.jsx("p",{className:"text-muted-foreground",children:"💡 请使用此 Token 登录 WebUI"})]})]})]})}),c.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:c.jsxs("div",{className:"flex items-start gap-3",children:[c.jsx(b5,{className:"h-5 w-5 text-primary flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),c.jsxs("div",{className:"flex-1 space-y-2",children:[c.jsx("h4",{className:"font-semibold text-sm",children:"方式二:查看配置文件"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"Token 保存在项目根目录的配置文件中:"}),c.jsx("div",{className:"rounded bg-background p-2 font-mono text-xs break-all",children:c.jsx("code",{className:"text-primary",children:"data/webui.json"})}),c.jsxs("p",{className:"text-xs text-muted-foreground",children:["打开此文件,复制 ",c.jsx("code",{className:"px-1 py-0.5 bg-background rounded",children:"access_token"})," 字段的值"]})]})]})}),c.jsx("div",{className:"rounded-lg border border-yellow-200 dark:border-yellow-900 bg-yellow-50 dark:bg-yellow-950/30 p-3",children:c.jsxs("div",{className:"flex gap-2",children:[c.jsx(PL,{className:"h-4 w-4 text-yellow-600 dark:text-yellow-500 flex-shrink-0 mt-0.5",strokeWidth:2,fill:"none"}),c.jsxs("div",{className:"text-sm text-yellow-800 dark:text-yellow-300 space-y-1",children:[c.jsx("p",{className:"font-semibold",children:"安全提示"}),c.jsxs("ul",{className:"list-disc list-inside space-y-0.5 text-xs",children:[c.jsx("li",{children:"请妥善保管您的 Token,不要泄露给他人"}),c.jsx("li",{children:"如需重置 Token,请在登录后前往系统设置"})]})]})]})})]})]})]}),c.jsxs(Rn,{children:[c.jsx(ma,{asChild:!0,children:c.jsxs("button",{className:"w-full text-center text-sm text-muted-foreground hover:text-foreground transition-colors underline-offset-4 hover:underline flex items-center justify-center gap-1",children:[c.jsx(i_,{className:"h-4 w-4",strokeWidth:2,fill:"none"}),"我觉得这个界面很卡怎么办?"]})}),c.jsxs(mn,{children:[c.jsxs(vn,{children:[c.jsxs(yn,{className:"flex items-center gap-2",children:[c.jsx(i_,{className:"h-5 w-5 text-primary",strokeWidth:2,fill:"none"}),"关闭背景动画"]}),c.jsx(xn,{children:"背景动画可能会在低性能设备上造成卡顿。关闭动画可以显著提升界面流畅度。"})]}),c.jsx("div",{className:"rounded-lg border bg-muted/50 p-4 space-y-2",children:c.jsx("p",{className:"text-sm text-muted-foreground",children:"关闭动画后,背景将变为纯色,但不影响任何功能的使用。您可以随时在系统设置中重新开启动画。"})}),c.jsxs(gn,{children:[c.jsx(wn,{children:"取消"}),c.jsx(bn,{onClick:()=>d(!1),children:"关闭动画"})]})]})]})]})})]}),c.jsx("div",{className:"absolute bottom-4 left-0 right-0 text-center text-xs text-muted-foreground",children:c.jsx("p",{children:Dhe})})]})}function Iq(){const e=Ns();return c.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:c.jsxs("div",{className:"w-full max-w-2xl text-center",children:[c.jsxs("div",{className:"relative mb-8",children:[c.jsx("h1",{className:"text-[150px] font-black leading-none text-primary/10 select-none sm:text-[200px]",children:"404"}),c.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:c.jsx(Ms,{className:"h-20 w-20 text-primary/30 sm:h-24 sm:w-24"})})]}),c.jsxs("div",{className:"space-y-4 mb-8",children:[c.jsx("h2",{className:"text-2xl font-bold text-foreground sm:text-3xl",children:"页面未找到"}),c.jsx("p",{className:"text-base text-muted-foreground sm:text-lg max-w-md mx-auto",children:"抱歉,您访问的页面不存在或已被移除。请检查 URL 是否正确,或返回首页继续浏览。"})]}),c.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4",children:[c.jsxs(we,{size:"lg",onClick:()=>e({to:"/"}),className:"gap-2 w-full sm:w-auto",children:[c.jsx(w5,{className:"h-4 w-4"}),"返回首页"]}),c.jsxs(we,{size:"lg",variant:"outline",onClick:()=>window.history.back(),className:"gap-2 w-full sm:w-auto",children:[c.jsx($fe,{className:"h-4 w-4"}),"返回上一页"]})]}),c.jsx("div",{className:"mt-12 pt-8 border-t border-border",children:c.jsx("p",{className:"text-sm text-muted-foreground",children:"如果您认为这是一个错误,请联系系统管理员"})})]})})}const Wt=S.forwardRef(({className:e,...t},n)=>c.jsx("textarea",{className:je("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));Wt.displayName="Textarea";var zq=["PageUp","PageDown"],Bq=["ArrowUp","ArrowDown","ArrowLeft","ArrowRight"],qq={"from-left":["Home","PageDown","ArrowDown","ArrowLeft"],"from-right":["Home","PageDown","ArrowDown","ArrowRight"],"from-bottom":["Home","PageDown","ArrowDown","ArrowLeft"],"from-top":["Home","PageDown","ArrowUp","ArrowLeft"]},qc="Slider",[l_,Ome,Nme]=hv(qc),[Uq]=Rr(qc,[Nme]),[Eme,fg]=Uq(qc),Fq=S.forwardRef((e,t)=>{const{name:n,min:r=0,max:a=100,step:o=1,orientation:l="horizontal",disabled:u=!1,minStepsBetweenThumbs:d=0,defaultValue:h=[r],value:p,onValueChange:v=()=>{},onValueCommit:g=()=>{},inverted:y=!1,form:j,...b}=e,w=S.useRef(new Set),A=S.useRef(0),N=l==="horizontal"?Tme:Cme,[T=[],E]=za({prop:p,defaultProp:h,onChange:$=>{[...w.current][A.current]?.focus(),v($)}}),C=S.useRef(T);function R($){const z=Dme(T,$);U($,z)}function k($){U($,A.current)}function M(){const $=C.current[A.current];T[A.current]!==$&&g(T)}function U($,z,{commit:V}={commit:!1}){const F=zme(o),G=Bme(Math.round(($-r)/o)*o+r,F),L=Ef(G,[r,a]);E((q=[])=>{const H=kme(q,L,z);if(Ime(H,d*o)){A.current=H.indexOf(L);const ee=String(H)!==String(q);return ee&&V&&g(H),ee?H:q}else return q})}return c.jsx(Eme,{scope:e.__scopeSlider,name:n,disabled:u,min:r,max:a,valueIndexToChangeRef:A,thumbs:w.current,values:T,orientation:l,form:j,children:c.jsx(l_.Provider,{scope:e.__scopeSlider,children:c.jsx(l_.Slot,{scope:e.__scopeSlider,children:c.jsx(N,{"aria-disabled":u,"data-disabled":u?"":void 0,...b,ref:t,onPointerDown:Oe(b.onPointerDown,()=>{u||(C.current=T)}),min:r,max:a,inverted:y,onSlideStart:u?void 0:R,onSlideMove:u?void 0:k,onSlideEnd:u?void 0:M,onHomeKeyDown:()=>!u&&U(r,0,{commit:!0}),onEndKeyDown:()=>!u&&U(a,T.length-1,{commit:!0}),onStepKeyDown:({event:$,direction:z})=>{if(!u){const G=zq.includes($.key)||$.shiftKey&&Bq.includes($.key)?10:1,L=A.current,q=T[L],H=o*G*z;U(q+H,L,{commit:!0})}}})})})})});Fq.displayName=qc;var[Hq,Vq]=Uq(qc,{startEdge:"left",endEdge:"right",size:"width",direction:1}),Tme=S.forwardRef((e,t)=>{const{min:n,max:r,dir:a,inverted:o,onSlideStart:l,onSlideMove:u,onSlideEnd:d,onStepKeyDown:h,...p}=e,[v,g]=S.useState(null),y=Fe(t,N=>g(N)),j=S.useRef(void 0),b=yd(a),w=b==="ltr",A=w&&!o||!w&&o;function O(N){const T=j.current||v.getBoundingClientRect(),E=[0,T.width],R=hO(E,A?[n,r]:[r,n]);return j.current=T,R(N-T.left)}return c.jsx(Hq,{scope:e.__scopeSlider,startEdge:A?"left":"right",endEdge:A?"right":"left",direction:A?1:-1,size:"width",children:c.jsx(Gq,{dir:b,"data-orientation":"horizontal",...p,ref:y,style:{...p.style,"--radix-slider-thumb-transform":"translateX(-50%)"},onSlideStart:N=>{const T=O(N.clientX);l?.(T)},onSlideMove:N=>{const T=O(N.clientX);u?.(T)},onSlideEnd:()=>{j.current=void 0,d?.()},onStepKeyDown:N=>{const E=qq[A?"from-left":"from-right"].includes(N.key);h?.({event:N,direction:E?-1:1})}})})}),Cme=S.forwardRef((e,t)=>{const{min:n,max:r,inverted:a,onSlideStart:o,onSlideMove:l,onSlideEnd:u,onStepKeyDown:d,...h}=e,p=S.useRef(null),v=Fe(t,p),g=S.useRef(void 0),y=!a;function j(b){const w=g.current||p.current.getBoundingClientRect(),A=[0,w.height],N=hO(A,y?[r,n]:[n,r]);return g.current=w,N(b-w.top)}return c.jsx(Hq,{scope:e.__scopeSlider,startEdge:y?"bottom":"top",endEdge:y?"top":"bottom",size:"height",direction:y?1:-1,children:c.jsx(Gq,{"data-orientation":"vertical",...h,ref:v,style:{...h.style,"--radix-slider-thumb-transform":"translateY(50%)"},onSlideStart:b=>{const w=j(b.clientY);o?.(w)},onSlideMove:b=>{const w=j(b.clientY);l?.(w)},onSlideEnd:()=>{g.current=void 0,u?.()},onStepKeyDown:b=>{const A=qq[y?"from-bottom":"from-top"].includes(b.key);d?.({event:b,direction:A?-1:1})}})})}),Gq=S.forwardRef((e,t)=>{const{__scopeSlider:n,onSlideStart:r,onSlideMove:a,onSlideEnd:o,onHomeKeyDown:l,onEndKeyDown:u,onStepKeyDown:d,...h}=e,p=fg(qc,n);return c.jsx(De.span,{...h,ref:t,onKeyDown:Oe(e.onKeyDown,v=>{v.key==="Home"?(l(v),v.preventDefault()):v.key==="End"?(u(v),v.preventDefault()):zq.concat(Bq).includes(v.key)&&(d(v),v.preventDefault())}),onPointerDown:Oe(e.onPointerDown,v=>{const g=v.target;g.setPointerCapture(v.pointerId),v.preventDefault(),p.thumbs.has(g)?g.focus():r(v)}),onPointerMove:Oe(e.onPointerMove,v=>{v.target.hasPointerCapture(v.pointerId)&&a(v)}),onPointerUp:Oe(e.onPointerUp,v=>{const g=v.target;g.hasPointerCapture(v.pointerId)&&(g.releasePointerCapture(v.pointerId),o(v))})})}),Kq="SliderTrack",Wq=S.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=fg(Kq,n);return c.jsx(De.span,{"data-disabled":a.disabled?"":void 0,"data-orientation":a.orientation,...r,ref:t})});Wq.displayName=Kq;var c_="SliderRange",Yq=S.forwardRef((e,t)=>{const{__scopeSlider:n,...r}=e,a=fg(c_,n),o=Vq(c_,n),l=S.useRef(null),u=Fe(t,l),d=a.values.length,h=a.values.map(g=>Qq(g,a.min,a.max)),p=d>1?Math.min(...h):0,v=100-Math.max(...h);return c.jsx(De.span,{"data-orientation":a.orientation,"data-disabled":a.disabled?"":void 0,...r,ref:u,style:{...e.style,[o.startEdge]:p+"%",[o.endEdge]:v+"%"}})});Yq.displayName=c_;var u_="SliderThumb",Xq=S.forwardRef((e,t)=>{const n=Ome(e.__scopeSlider),[r,a]=S.useState(null),o=Fe(t,u=>a(u)),l=S.useMemo(()=>r?n().findIndex(u=>u.ref.current===r):-1,[n,r]);return c.jsx(Rme,{...e,ref:o,index:l})}),Rme=S.forwardRef((e,t)=>{const{__scopeSlider:n,index:r,name:a,...o}=e,l=fg(u_,n),u=Vq(u_,n),[d,h]=S.useState(null),p=Fe(t,O=>h(O)),v=d?l.form||!!d.closest("form"):!0,g=rg(d),y=l.values[r],j=y===void 0?0:Qq(y,l.min,l.max),b=Mme(r,l.values.length),w=g?.[u.size],A=w?Lme(w,j,u.direction):0;return S.useEffect(()=>{if(d)return l.thumbs.add(d),()=>{l.thumbs.delete(d)}},[d,l.thumbs]),c.jsxs("span",{style:{transform:"var(--radix-slider-thumb-transform)",position:"absolute",[u.startEdge]:`calc(${j}% + ${A}px)`},children:[c.jsx(l_.ItemSlot,{scope:e.__scopeSlider,children:c.jsx(De.span,{role:"slider","aria-label":e["aria-label"]||b,"aria-valuemin":l.min,"aria-valuenow":y,"aria-valuemax":l.max,"aria-orientation":l.orientation,"data-orientation":l.orientation,"data-disabled":l.disabled?"":void 0,tabIndex:l.disabled?void 0:0,...o,ref:p,style:y===void 0?{display:"none"}:e.style,onFocus:Oe(e.onFocus,()=>{l.valueIndexToChangeRef.current=r})})}),v&&c.jsx(Zq,{name:a??(l.name?l.name+(l.values.length>1?"[]":""):void 0),form:l.form,value:y},r)]})});Xq.displayName=u_;var Pme="RadioBubbleInput",Zq=S.forwardRef(({__scopeSlider:e,value:t,...n},r)=>{const a=S.useRef(null),o=Fe(a,r),l=ng(t);return S.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&p){const v=new Event("input",{bubbles:!0});p.call(u,t),u.dispatchEvent(v)}},[l,t]),c.jsx(De.input,{style:{display:"none"},...n,ref:o,defaultValue:t})});Zq.displayName=Pme;function kme(e=[],t,n){const r=[...e];return r[n]=t,r.sort((a,o)=>a-o)}function Qq(e,t,n){const o=100/(n-t)*(e-t);return Ef(o,[0,100])}function Mme(e,t){return t>2?`Value ${e+1} of ${t}`:t===2?["Minimum","Maximum"][e]:void 0}function Dme(e,t){if(e.length===1)return 0;const n=e.map(a=>Math.abs(a-t)),r=Math.min(...n);return n.indexOf(r)}function Lme(e,t,n){const r=e/2,o=hO([0,50],[0,r]);return(r-o(t)*n)*n}function $me(e){return e.slice(0,-1).map((t,n)=>e[n+1]-t)}function Ime(e,t){if(t>0){const n=$me(e);return Math.min(...n)>=t}return!0}function hO(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function zme(e){return(String(e).split(".")[1]||"").length}function Bme(e,t){const n=Math.pow(10,t);return Math.round(e*n)/n}var Jq=Fq,qme=Wq,Ume=Yq,Fme=Xq;const pO=S.forwardRef(({className:e,...t},n)=>c.jsxs(Jq,{ref:n,className:je("relative flex w-full touch-none select-none items-center",e),...t,children:[c.jsx(qme,{className:"relative h-1.5 w-full grow overflow-hidden rounded-full bg-primary/20",children:c.jsx(Ume,{className:"absolute h-full bg-primary"})}),c.jsx(Fme,{className:"block h-4 w-4 rounded-full border border-primary/50 bg-background shadow transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50"})]}));pO.displayName=Jq.displayName;const Hme=["top","right","bottom","left"],yo=Math.min,Or=Math.max,Jm=Math.round,Np=Math.floor,$a=e=>({x:e,y:e}),Vme={left:"right",right:"left",bottom:"top",top:"bottom"},Gme={start:"end",end:"start"};function f_(e,t,n){return Or(e,yo(t,n))}function Ni(e,t){return typeof e=="function"?e(t):e}function Ei(e){return e.split("-")[0]}function Uc(e){return e.split("-")[1]}function mO(e){return e==="x"?"y":"x"}function vO(e){return e==="y"?"height":"width"}const Kme=new Set(["top","bottom"]);function ka(e){return Kme.has(Ei(e))?"y":"x"}function gO(e){return mO(ka(e))}function Wme(e,t,n){n===void 0&&(n=!1);const r=Uc(e),a=gO(e),o=vO(a);let l=a==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return t.reference[o]>t.floating[o]&&(l=ev(l)),[l,ev(l)]}function Yme(e){const t=ev(e);return[d_(e),t,d_(t)]}function d_(e){return e.replace(/start|end/g,t=>Gme[t])}const XL=["left","right"],ZL=["right","left"],Xme=["top","bottom"],Zme=["bottom","top"];function Qme(e,t,n){switch(e){case"top":case"bottom":return n?t?ZL:XL:t?XL:ZL;case"left":case"right":return t?Xme:Zme;default:return[]}}function Jme(e,t,n,r){const a=Uc(e);let o=Qme(Ei(e),n==="start",r);return a&&(o=o.map(l=>l+"-"+a),t&&(o=o.concat(o.map(d_)))),o}function ev(e){return e.replace(/left|right|bottom|top/g,t=>Vme[t])}function eve(e){return{top:0,right:0,bottom:0,left:0,...e}}function e6(e){return typeof e!="number"?eve(e):{top:e,right:e,bottom:e,left:e}}function tv(e){const{x:t,y:n,width:r,height:a}=e;return{width:r,height:a,top:n,left:t,right:t+r,bottom:n+a,x:t,y:n}}function QL(e,t,n){let{reference:r,floating:a}=e;const o=ka(t),l=gO(t),u=vO(l),d=Ei(t),h=o==="y",p=r.x+r.width/2-a.width/2,v=r.y+r.height/2-a.height/2,g=r[u]/2-a[u]/2;let y;switch(d){case"top":y={x:p,y:r.y-a.height};break;case"bottom":y={x:p,y:r.y+r.height};break;case"right":y={x:r.x+r.width,y:v};break;case"left":y={x:r.x-a.width,y:v};break;default:y={x:r.x,y:r.y}}switch(Uc(t)){case"start":y[l]-=g*(n&&h?-1:1);break;case"end":y[l]+=g*(n&&h?-1:1);break}return y}const tve=async(e,t,n)=>{const{placement:r="bottom",strategy:a="absolute",middleware:o=[],platform:l}=n,u=o.filter(Boolean),d=await(l.isRTL==null?void 0:l.isRTL(t));let h=await l.getElementRects({reference:e,floating:t,strategy:a}),{x:p,y:v}=QL(h,r,d),g=r,y={},j=0;for(let b=0;b({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:a,rects:o,platform:l,elements:u,middlewareData:d}=t,{element:h,padding:p=0}=Ni(e,t)||{};if(h==null)return{};const v=e6(p),g={x:n,y:r},y=gO(a),j=vO(y),b=await l.getDimensions(h),w=y==="y",A=w?"top":"left",O=w?"bottom":"right",N=w?"clientHeight":"clientWidth",T=o.reference[j]+o.reference[y]-g[y]-o.floating[j],E=g[y]-o.reference[y],C=await(l.getOffsetParent==null?void 0:l.getOffsetParent(h));let R=C?C[N]:0;(!R||!await(l.isElement==null?void 0:l.isElement(C)))&&(R=u.floating[N]||o.floating[j]);const k=T/2-E/2,M=R/2-b[j]/2-1,U=yo(v[A],M),$=yo(v[O],M),z=U,V=R-b[j]-$,F=R/2-b[j]/2+k,G=f_(z,F,V),L=!d.arrow&&Uc(a)!=null&&F!==G&&o.reference[j]/2-(FF<=0)){var $,z;const F=((($=o.flip)==null?void 0:$.index)||0)+1,G=R[F];if(G&&(!(v==="alignment"?O!==ka(G):!1)||U.every(H=>ka(H.placement)===O?H.overflows[0]>0:!0)))return{data:{index:F,overflows:U},reset:{placement:G}};let L=(z=U.filter(q=>q.overflows[0]<=0).sort((q,H)=>q.overflows[1]-H.overflows[1])[0])==null?void 0:z.placement;if(!L)switch(y){case"bestFit":{var V;const q=(V=U.filter(H=>{if(C){const ee=ka(H.placement);return ee===O||ee==="y"}return!0}).map(H=>[H.placement,H.overflows.filter(ee=>ee>0).reduce((ee,ve)=>ee+ve,0)]).sort((H,ee)=>H[1]-ee[1])[0])==null?void 0:V[0];q&&(L=q);break}case"initialPlacement":L=u;break}if(a!==L)return{reset:{placement:L}}}return{}}}};function JL(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function e$(e){return Hme.some(t=>e[t]>=0)}const ave=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...a}=Ni(e,t);switch(r){case"referenceHidden":{const o=await ud(t,{...a,elementContext:"reference"}),l=JL(o,n.reference);return{data:{referenceHiddenOffsets:l,referenceHidden:e$(l)}}}case"escaped":{const o=await ud(t,{...a,altBoundary:!0}),l=JL(o,n.floating);return{data:{escapedOffsets:l,escaped:e$(l)}}}default:return{}}}}},t6=new Set(["left","top"]);async function ive(e,t){const{placement:n,platform:r,elements:a}=e,o=await(r.isRTL==null?void 0:r.isRTL(a.floating)),l=Ei(n),u=Uc(n),d=ka(n)==="y",h=t6.has(l)?-1:1,p=o&&d?-1:1,v=Ni(t,e);let{mainAxis:g,crossAxis:y,alignmentAxis:j}=typeof v=="number"?{mainAxis:v,crossAxis:0,alignmentAxis:null}:{mainAxis:v.mainAxis||0,crossAxis:v.crossAxis||0,alignmentAxis:v.alignmentAxis};return u&&typeof j=="number"&&(y=u==="end"?j*-1:j),d?{x:y*p,y:g*h}:{x:g*h,y:y*p}}const ove=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:a,y:o,placement:l,middlewareData:u}=t,d=await ive(t,e);return l===((n=u.offset)==null?void 0:n.placement)&&(r=u.arrow)!=null&&r.alignmentOffset?{}:{x:a+d.x,y:o+d.y,data:{...d,placement:l}}}}},sve=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:a}=t,{mainAxis:o=!0,crossAxis:l=!1,limiter:u={fn:w=>{let{x:A,y:O}=w;return{x:A,y:O}}},...d}=Ni(e,t),h={x:n,y:r},p=await ud(t,d),v=ka(Ei(a)),g=mO(v);let y=h[g],j=h[v];if(o){const w=g==="y"?"top":"left",A=g==="y"?"bottom":"right",O=y+p[w],N=y-p[A];y=f_(O,y,N)}if(l){const w=v==="y"?"top":"left",A=v==="y"?"bottom":"right",O=j+p[w],N=j-p[A];j=f_(O,j,N)}const b=u.fn({...t,[g]:y,[v]:j});return{...b,data:{x:b.x-n,y:b.y-r,enabled:{[g]:o,[v]:l}}}}}},lve=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:r,placement:a,rects:o,middlewareData:l}=t,{offset:u=0,mainAxis:d=!0,crossAxis:h=!0}=Ni(e,t),p={x:n,y:r},v=ka(a),g=mO(v);let y=p[g],j=p[v];const b=Ni(u,t),w=typeof b=="number"?{mainAxis:b,crossAxis:0}:{mainAxis:0,crossAxis:0,...b};if(d){const N=g==="y"?"height":"width",T=o.reference[g]-o.floating[N]+w.mainAxis,E=o.reference[g]+o.reference[N]-w.mainAxis;yE&&(y=E)}if(h){var A,O;const N=g==="y"?"width":"height",T=t6.has(Ei(a)),E=o.reference[v]-o.floating[N]+(T&&((A=l.offset)==null?void 0:A[v])||0)+(T?0:w.crossAxis),C=o.reference[v]+o.reference[N]+(T?0:((O=l.offset)==null?void 0:O[v])||0)-(T?w.crossAxis:0);jC&&(j=C)}return{[g]:y,[v]:j}}}},cve=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,r;const{placement:a,rects:o,platform:l,elements:u}=t,{apply:d=()=>{},...h}=Ni(e,t),p=await ud(t,h),v=Ei(a),g=Uc(a),y=ka(a)==="y",{width:j,height:b}=o.floating;let w,A;v==="top"||v==="bottom"?(w=v,A=g===(await(l.isRTL==null?void 0:l.isRTL(u.floating))?"start":"end")?"left":"right"):(A=v,w=g==="end"?"top":"bottom");const O=b-p.top-p.bottom,N=j-p.left-p.right,T=yo(b-p[w],O),E=yo(j-p[A],N),C=!t.middlewareData.shift;let R=T,k=E;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(k=N),(r=t.middlewareData.shift)!=null&&r.enabled.y&&(R=O),C&&!g){const U=Or(p.left,0),$=Or(p.right,0),z=Or(p.top,0),V=Or(p.bottom,0);y?k=j-2*(U!==0||$!==0?U+$:Or(p.left,p.right)):R=b-2*(z!==0||V!==0?z+V:Or(p.top,p.bottom))}await d({...t,availableWidth:k,availableHeight:R});const M=await l.getDimensions(u.floating);return j!==M.width||b!==M.height?{reset:{rects:!0}}:{}}}};function dg(){return typeof window<"u"}function Fc(e){return n6(e)?(e.nodeName||"").toLowerCase():"#document"}function Cr(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function Ga(e){var t;return(t=(n6(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function n6(e){return dg()?e instanceof Node||e instanceof Cr(e).Node:!1}function ga(e){return dg()?e instanceof Element||e instanceof Cr(e).Element:!1}function Ua(e){return dg()?e instanceof HTMLElement||e instanceof Cr(e).HTMLElement:!1}function t$(e){return!dg()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof Cr(e).ShadowRoot}const uve=new Set(["inline","contents"]);function Pd(e){const{overflow:t,overflowX:n,overflowY:r,display:a}=ya(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!uve.has(a)}const fve=new Set(["table","td","th"]);function dve(e){return fve.has(Fc(e))}const hve=[":popover-open",":modal"];function hg(e){return hve.some(t=>{try{return e.matches(t)}catch{return!1}})}const pve=["transform","translate","scale","rotate","perspective"],mve=["transform","translate","scale","rotate","perspective","filter"],vve=["paint","layout","strict","content"];function yO(e){const t=xO(),n=ga(e)?ya(e):e;return pve.some(r=>n[r]?n[r]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||mve.some(r=>(n.willChange||"").includes(r))||vve.some(r=>(n.contain||"").includes(r))}function gve(e){let t=xo(e);for(;Ua(t)&&!Ac(t);){if(yO(t))return t;if(hg(t))return null;t=xo(t)}return null}function xO(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const yve=new Set(["html","body","#document"]);function Ac(e){return yve.has(Fc(e))}function ya(e){return Cr(e).getComputedStyle(e)}function pg(e){return ga(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function xo(e){if(Fc(e)==="html")return e;const t=e.assignedSlot||e.parentNode||t$(e)&&e.host||Ga(e);return t$(t)?t.host:t}function r6(e){const t=xo(e);return Ac(t)?e.ownerDocument?e.ownerDocument.body:e.body:Ua(t)&&Pd(t)?t:r6(t)}function fd(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const a=r6(e),o=a===((r=e.ownerDocument)==null?void 0:r.body),l=Cr(a);if(o){const u=h_(l);return t.concat(l,l.visualViewport||[],Pd(a)?a:[],u&&n?fd(u):[])}return t.concat(a,fd(a,[],n))}function h_(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function a6(e){const t=ya(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const a=Ua(e),o=a?e.offsetWidth:n,l=a?e.offsetHeight:r,u=Jm(n)!==o||Jm(r)!==l;return u&&(n=o,r=l),{width:n,height:r,$:u}}function bO(e){return ga(e)?e:e.contextElement}function Gl(e){const t=bO(e);if(!Ua(t))return $a(1);const n=t.getBoundingClientRect(),{width:r,height:a,$:o}=a6(t);let l=(o?Jm(n.width):n.width)/r,u=(o?Jm(n.height):n.height)/a;return(!l||!Number.isFinite(l))&&(l=1),(!u||!Number.isFinite(u))&&(u=1),{x:l,y:u}}const xve=$a(0);function i6(e){const t=Cr(e);return!xO()||!t.visualViewport?xve:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function bve(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==Cr(e)?!1:t}function Ss(e,t,n,r){t===void 0&&(t=!1),n===void 0&&(n=!1);const a=e.getBoundingClientRect(),o=bO(e);let l=$a(1);t&&(r?ga(r)&&(l=Gl(r)):l=Gl(e));const u=bve(o,n,r)?i6(o):$a(0);let d=(a.left+u.x)/l.x,h=(a.top+u.y)/l.y,p=a.width/l.x,v=a.height/l.y;if(o){const g=Cr(o),y=r&&ga(r)?Cr(r):r;let j=g,b=h_(j);for(;b&&r&&y!==j;){const w=Gl(b),A=b.getBoundingClientRect(),O=ya(b),N=A.left+(b.clientLeft+parseFloat(O.paddingLeft))*w.x,T=A.top+(b.clientTop+parseFloat(O.paddingTop))*w.y;d*=w.x,h*=w.y,p*=w.x,v*=w.y,d+=N,h+=T,j=Cr(b),b=h_(j)}}return tv({width:p,height:v,x:d,y:h})}function mg(e,t){const n=pg(e).scrollLeft;return t?t.left+n:Ss(Ga(e)).left+n}function o6(e,t){const n=e.getBoundingClientRect(),r=n.left+t.scrollLeft-mg(e,n),a=n.top+t.scrollTop;return{x:r,y:a}}function wve(e){let{elements:t,rect:n,offsetParent:r,strategy:a}=e;const o=a==="fixed",l=Ga(r),u=t?hg(t.floating):!1;if(r===l||u&&o)return n;let d={scrollLeft:0,scrollTop:0},h=$a(1);const p=$a(0),v=Ua(r);if((v||!v&&!o)&&((Fc(r)!=="body"||Pd(l))&&(d=pg(r)),Ua(r))){const y=Ss(r);h=Gl(r),p.x=y.x+r.clientLeft,p.y=y.y+r.clientTop}const g=l&&!v&&!o?o6(l,d):$a(0);return{width:n.width*h.x,height:n.height*h.y,x:n.x*h.x-d.scrollLeft*h.x+p.x+g.x,y:n.y*h.y-d.scrollTop*h.y+p.y+g.y}}function Sve(e){return Array.from(e.getClientRects())}function jve(e){const t=Ga(e),n=pg(e),r=e.ownerDocument.body,a=Or(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),o=Or(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let l=-n.scrollLeft+mg(e);const u=-n.scrollTop;return ya(r).direction==="rtl"&&(l+=Or(t.clientWidth,r.clientWidth)-a),{width:a,height:o,x:l,y:u}}const n$=25;function _ve(e,t){const n=Cr(e),r=Ga(e),a=n.visualViewport;let o=r.clientWidth,l=r.clientHeight,u=0,d=0;if(a){o=a.width,l=a.height;const p=xO();(!p||p&&t==="fixed")&&(u=a.offsetLeft,d=a.offsetTop)}const h=mg(r);if(h<=0){const p=r.ownerDocument,v=p.body,g=getComputedStyle(v),y=p.compatMode==="CSS1Compat"&&parseFloat(g.marginLeft)+parseFloat(g.marginRight)||0,j=Math.abs(r.clientWidth-v.clientWidth-y);j<=n$&&(o-=j)}else h<=n$&&(o+=h);return{width:o,height:l,x:u,y:d}}const Ave=new Set(["absolute","fixed"]);function Ove(e,t){const n=Ss(e,!0,t==="fixed"),r=n.top+e.clientTop,a=n.left+e.clientLeft,o=Ua(e)?Gl(e):$a(1),l=e.clientWidth*o.x,u=e.clientHeight*o.y,d=a*o.x,h=r*o.y;return{width:l,height:u,x:d,y:h}}function r$(e,t,n){let r;if(t==="viewport")r=_ve(e,n);else if(t==="document")r=jve(Ga(e));else if(ga(t))r=Ove(t,n);else{const a=i6(e);r={x:t.x-a.x,y:t.y-a.y,width:t.width,height:t.height}}return tv(r)}function s6(e,t){const n=xo(e);return n===t||!ga(n)||Ac(n)?!1:ya(n).position==="fixed"||s6(n,t)}function Nve(e,t){const n=t.get(e);if(n)return n;let r=fd(e,[],!1).filter(u=>ga(u)&&Fc(u)!=="body"),a=null;const o=ya(e).position==="fixed";let l=o?xo(e):e;for(;ga(l)&&!Ac(l);){const u=ya(l),d=yO(l);!d&&u.position==="fixed"&&(a=null),(o?!d&&!a:!d&&u.position==="static"&&!!a&&Ave.has(a.position)||Pd(l)&&!d&&s6(e,l))?r=r.filter(p=>p!==l):a=u,l=xo(l)}return t.set(e,r),r}function Eve(e){let{element:t,boundary:n,rootBoundary:r,strategy:a}=e;const l=[...n==="clippingAncestors"?hg(t)?[]:Nve(t,this._c):[].concat(n),r],u=l[0],d=l.reduce((h,p)=>{const v=r$(t,p,a);return h.top=Or(v.top,h.top),h.right=yo(v.right,h.right),h.bottom=yo(v.bottom,h.bottom),h.left=Or(v.left,h.left),h},r$(t,u,a));return{width:d.right-d.left,height:d.bottom-d.top,x:d.left,y:d.top}}function Tve(e){const{width:t,height:n}=a6(e);return{width:t,height:n}}function Cve(e,t,n){const r=Ua(t),a=Ga(t),o=n==="fixed",l=Ss(e,!0,o,t);let u={scrollLeft:0,scrollTop:0};const d=$a(0);function h(){d.x=mg(a)}if(r||!r&&!o)if((Fc(t)!=="body"||Pd(a))&&(u=pg(t)),r){const y=Ss(t,!0,o,t);d.x=y.x+t.clientLeft,d.y=y.y+t.clientTop}else a&&h();o&&!r&&a&&h();const p=a&&!r&&!o?o6(a,u):$a(0),v=l.left+u.scrollLeft-d.x-p.x,g=l.top+u.scrollTop-d.y-p.y;return{x:v,y:g,width:l.width,height:l.height}}function g1(e){return ya(e).position==="static"}function a$(e,t){if(!Ua(e)||ya(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return Ga(e)===n&&(n=n.ownerDocument.body),n}function l6(e,t){const n=Cr(e);if(hg(e))return n;if(!Ua(e)){let a=xo(e);for(;a&&!Ac(a);){if(ga(a)&&!g1(a))return a;a=xo(a)}return n}let r=a$(e,t);for(;r&&dve(r)&&g1(r);)r=a$(r,t);return r&&Ac(r)&&g1(r)&&!yO(r)?n:r||gve(e)||n}const Rve=async function(e){const t=this.getOffsetParent||l6,n=this.getDimensions,r=await n(e.floating);return{reference:Cve(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function Pve(e){return ya(e).direction==="rtl"}const kve={convertOffsetParentRelativeRectToViewportRelativeRect:wve,getDocumentElement:Ga,getClippingRect:Eve,getOffsetParent:l6,getElementRects:Rve,getClientRects:Sve,getDimensions:Tve,getScale:Gl,isElement:ga,isRTL:Pve};function c6(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function Mve(e,t){let n=null,r;const a=Ga(e);function o(){var u;clearTimeout(r),(u=n)==null||u.disconnect(),n=null}function l(u,d){u===void 0&&(u=!1),d===void 0&&(d=1),o();const h=e.getBoundingClientRect(),{left:p,top:v,width:g,height:y}=h;if(u||t(),!g||!y)return;const j=Np(v),b=Np(a.clientWidth-(p+g)),w=Np(a.clientHeight-(v+y)),A=Np(p),N={rootMargin:-j+"px "+-b+"px "+-w+"px "+-A+"px",threshold:Or(0,yo(1,d))||1};let T=!0;function E(C){const R=C[0].intersectionRatio;if(R!==d){if(!T)return l();R?l(!1,R):r=setTimeout(()=>{l(!1,1e-7)},1e3)}R===1&&!c6(h,e.getBoundingClientRect())&&l(),T=!1}try{n=new IntersectionObserver(E,{...N,root:a.ownerDocument})}catch{n=new IntersectionObserver(E,N)}n.observe(e)}return l(!0),o}function Dve(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:a=!0,ancestorResize:o=!0,elementResize:l=typeof ResizeObserver=="function",layoutShift:u=typeof IntersectionObserver=="function",animationFrame:d=!1}=r,h=bO(e),p=a||o?[...h?fd(h):[],...fd(t)]:[];p.forEach(A=>{a&&A.addEventListener("scroll",n,{passive:!0}),o&&A.addEventListener("resize",n)});const v=h&&u?Mve(h,n):null;let g=-1,y=null;l&&(y=new ResizeObserver(A=>{let[O]=A;O&&O.target===h&&y&&(y.unobserve(t),cancelAnimationFrame(g),g=requestAnimationFrame(()=>{var N;(N=y)==null||N.observe(t)})),n()}),h&&!d&&y.observe(h),y.observe(t));let j,b=d?Ss(e):null;d&&w();function w(){const A=Ss(e);b&&!c6(b,A)&&n(),b=A,j=requestAnimationFrame(w)}return n(),()=>{var A;p.forEach(O=>{a&&O.removeEventListener("scroll",n),o&&O.removeEventListener("resize",n)}),v?.(),(A=y)==null||A.disconnect(),y=null,d&&cancelAnimationFrame(j)}}const Lve=ove,$ve=sve,Ive=rve,zve=cve,Bve=ave,i$=nve,qve=lve,Uve=(e,t,n)=>{const r=new Map,a={platform:kve,...n},o={...a.platform,_c:r};return tve(e,t,{...a,platform:o})};var Fve=typeof document<"u",Hve=function(){},zp=Fve?S.useLayoutEffect:Hve;function nv(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,r,a;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(r=n;r--!==0;)if(!nv(e[r],t[r]))return!1;return!0}if(a=Object.keys(e),n=a.length,n!==Object.keys(t).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(t,a[r]))return!1;for(r=n;r--!==0;){const o=a[r];if(!(o==="_owner"&&e.$$typeof)&&!nv(e[o],t[o]))return!1}return!0}return e!==e&&t!==t}function u6(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function o$(e,t){const n=u6(e);return Math.round(t*n)/n}function y1(e){const t=S.useRef(e);return zp(()=>{t.current=e}),t}function Vve(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:r=[],platform:a,elements:{reference:o,floating:l}={},transform:u=!0,whileElementsMounted:d,open:h}=e,[p,v]=S.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[g,y]=S.useState(r);nv(g,r)||y(r);const[j,b]=S.useState(null),[w,A]=S.useState(null),O=S.useCallback(H=>{H!==C.current&&(C.current=H,b(H))},[]),N=S.useCallback(H=>{H!==R.current&&(R.current=H,A(H))},[]),T=o||j,E=l||w,C=S.useRef(null),R=S.useRef(null),k=S.useRef(p),M=d!=null,U=y1(d),$=y1(a),z=y1(h),V=S.useCallback(()=>{if(!C.current||!R.current)return;const H={placement:t,strategy:n,middleware:g};$.current&&(H.platform=$.current),Uve(C.current,R.current,H).then(ee=>{const ve={...ee,isPositioned:z.current!==!1};F.current&&!nv(k.current,ve)&&(k.current=ve,Es.flushSync(()=>{v(ve)}))})},[g,t,n,$,z]);zp(()=>{h===!1&&k.current.isPositioned&&(k.current.isPositioned=!1,v(H=>({...H,isPositioned:!1})))},[h]);const F=S.useRef(!1);zp(()=>(F.current=!0,()=>{F.current=!1}),[]),zp(()=>{if(T&&(C.current=T),E&&(R.current=E),T&&E){if(U.current)return U.current(T,E,V);V()}},[T,E,V,U,M]);const G=S.useMemo(()=>({reference:C,floating:R,setReference:O,setFloating:N}),[O,N]),L=S.useMemo(()=>({reference:T,floating:E}),[T,E]),q=S.useMemo(()=>{const H={position:n,left:0,top:0};if(!L.floating)return H;const ee=o$(L.floating,p.x),ve=o$(L.floating,p.y);return u?{...H,transform:"translate("+ee+"px, "+ve+"px)",...u6(L.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:ee,top:ve}},[n,u,L.floating,p.x,p.y]);return S.useMemo(()=>({...p,update:V,refs:G,elements:L,floatingStyles:q}),[p,V,G,L,q])}const Gve=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:r,padding:a}=typeof e=="function"?e(n):e;return r&&t(r)?r.current!=null?i$({element:r.current,padding:a}).fn(n):{}:r?i$({element:r,padding:a}).fn(n):{}}}},Kve=(e,t)=>({...Lve(e),options:[e,t]}),Wve=(e,t)=>({...$ve(e),options:[e,t]}),Yve=(e,t)=>({...qve(e),options:[e,t]}),Xve=(e,t)=>({...Ive(e),options:[e,t]}),Zve=(e,t)=>({...zve(e),options:[e,t]}),Qve=(e,t)=>({...Bve(e),options:[e,t]}),Jve=(e,t)=>({...Gve(e),options:[e,t]});var ege="Arrow",f6=S.forwardRef((e,t)=>{const{children:n,width:r=10,height:a=5,...o}=e;return c.jsx(De.svg,{...o,ref:t,width:r,height:a,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:c.jsx("polygon",{points:"0,0 30,0 15,10"})})});f6.displayName=ege;var tge=f6,wO="Popper",[d6,vg]=Rr(wO),[nge,h6]=d6(wO),p6=e=>{const{__scopePopper:t,children:n}=e,[r,a]=S.useState(null);return c.jsx(nge,{scope:t,anchor:r,onAnchorChange:a,children:n})};p6.displayName=wO;var m6="PopperAnchor",v6=S.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:r,...a}=e,o=h6(m6,n),l=S.useRef(null),u=Fe(t,l),d=S.useRef(null);return S.useEffect(()=>{const h=d.current;d.current=r?.current||l.current,h!==d.current&&o.onAnchorChange(d.current)}),r?null:c.jsx(De.div,{...a,ref:u})});v6.displayName=m6;var SO="PopperContent",[rge,age]=d6(SO),g6=S.forwardRef((e,t)=>{const{__scopePopper:n,side:r="bottom",sideOffset:a=0,align:o="center",alignOffset:l=0,arrowPadding:u=0,avoidCollisions:d=!0,collisionBoundary:h=[],collisionPadding:p=0,sticky:v="partial",hideWhenDetached:g=!1,updatePositionStrategy:y="optimized",onPlaced:j,...b}=e,w=h6(SO,n),[A,O]=S.useState(null),N=Fe(t,Q=>O(Q)),[T,E]=S.useState(null),C=rg(T),R=C?.width??0,k=C?.height??0,M=r+(o!=="center"?"-"+o:""),U=typeof p=="number"?p:{top:0,right:0,bottom:0,left:0,...p},$=Array.isArray(h)?h:[h],z=$.length>0,V={padding:U,boundary:$.filter(oge),altBoundary:z},{refs:F,floatingStyles:G,placement:L,isPositioned:q,middlewareData:H}=Vve({strategy:"fixed",placement:M,whileElementsMounted:(...Q)=>Dve(...Q,{animationFrame:y==="always"}),elements:{reference:w.anchor},middleware:[Kve({mainAxis:a+k,alignmentAxis:l}),d&&Wve({mainAxis:!0,crossAxis:!1,limiter:v==="partial"?Yve():void 0,...V}),d&&Xve({...V}),Zve({...V,apply:({elements:Q,rects:ne,availableWidth:X,availableHeight:de})=>{const{width:be,height:oe}=ne.reference,Pe=Q.floating.style;Pe.setProperty("--radix-popper-available-width",`${X}px`),Pe.setProperty("--radix-popper-available-height",`${de}px`),Pe.setProperty("--radix-popper-anchor-width",`${be}px`),Pe.setProperty("--radix-popper-anchor-height",`${oe}px`)}}),T&&Jve({element:T,padding:u}),sge({arrowWidth:R,arrowHeight:k}),g&&Qve({strategy:"referenceHidden",...V})]}),[ee,ve]=b6(L),I=nn(j);Sn(()=>{q&&I?.()},[q,I]);const B=H.arrow?.x,Y=H.arrow?.y,te=H.arrow?.centerOffset!==0,[le,xe]=S.useState();return Sn(()=>{A&&xe(window.getComputedStyle(A).zIndex)},[A]),c.jsx("div",{ref:F.setFloating,"data-radix-popper-content-wrapper":"",style:{...G,transform:q?G.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:le,"--radix-popper-transform-origin":[H.transformOrigin?.x,H.transformOrigin?.y].join(" "),...H.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:c.jsx(rge,{scope:n,placedSide:ee,onArrowChange:E,arrowX:B,arrowY:Y,shouldHideArrow:te,children:c.jsx(De.div,{"data-side":ee,"data-align":ve,...b,ref:N,style:{...b.style,animation:q?void 0:"none"}})})})});g6.displayName=SO;var y6="PopperArrow",ige={top:"bottom",right:"left",bottom:"top",left:"right"},x6=S.forwardRef(function(t,n){const{__scopePopper:r,...a}=t,o=age(y6,r),l=ige[o.placedSide];return c.jsx("span",{ref:o.onArrowChange,style:{position:"absolute",left:o.arrowX,top:o.arrowY,[l]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[o.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[o.placedSide],visibility:o.shouldHideArrow?"hidden":void 0},children:c.jsx(tge,{...a,ref:n,style:{...a.style,display:"block"}})})});x6.displayName=y6;function oge(e){return e!==null}var sge=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:a}=t,l=a.arrow?.centerOffset!==0,u=l?0:e.arrowWidth,d=l?0:e.arrowHeight,[h,p]=b6(n),v={start:"0%",center:"50%",end:"100%"}[p],g=(a.arrow?.x??0)+u/2,y=(a.arrow?.y??0)+d/2;let j="",b="";return h==="bottom"?(j=l?v:`${g}px`,b=`${-d}px`):h==="top"?(j=l?v:`${g}px`,b=`${r.floating.height+d}px`):h==="right"?(j=`${-d}px`,b=l?v:`${y}px`):h==="left"&&(j=`${r.floating.width+d}px`,b=l?v:`${y}px`),{data:{x:j,y:b}}}});function b6(e){const[t,n="center"]=e.split("-");return[t,n]}var w6=p6,jO=v6,S6=g6,j6=x6;function lge(e){const t=cge(e),n=S.forwardRef((r,a)=>{const{children:o,...l}=r,u=S.Children.toArray(o),d=u.find(fge);if(d){const h=d.props.children,p=u.map(v=>v===d?S.Children.count(h)>1?S.Children.only(null):S.isValidElement(h)?h.props.children:null:v);return c.jsx(t,{...l,ref:a,children:S.isValidElement(h)?S.cloneElement(h,void 0,p):null})}return c.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function cge(e){const t=S.forwardRef((n,r)=>{const{children:a,...o}=n;if(S.isValidElement(a)){const l=hge(a),u=dge(o,a.props);return a.type!==S.Fragment&&(u.ref=r?Qr(r,l):l),S.cloneElement(a,u)}return S.Children.count(a)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var uge=Symbol("radix.slottable");function fge(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===uge}function dge(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function hge(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var _6=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),pge="VisuallyHidden",_O=S.forwardRef((e,t)=>c.jsx(De.span,{...e,ref:t,style:{..._6,...e.style}}));_O.displayName=pge;var mge=[" ","Enter","ArrowUp","ArrowDown"],vge=[" ","Enter"],js="Select",[gg,yg,gge]=hv(js),[Hc]=Rr(js,[gge,vg]),xg=vg(),[yge,Ao]=Hc(js),[xge,bge]=Hc(js),A6=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:a,onOpenChange:o,value:l,defaultValue:u,onValueChange:d,dir:h,name:p,autoComplete:v,disabled:g,required:y,form:j}=e,b=xg(t),[w,A]=S.useState(null),[O,N]=S.useState(null),[T,E]=S.useState(!1),C=yd(h),[R,k]=za({prop:r,defaultProp:a??!1,onChange:o,caller:js}),[M,U]=za({prop:l,defaultProp:u,onChange:d,caller:js}),$=S.useRef(null),z=w?j||!!w.closest("form"):!0,[V,F]=S.useState(new Set),G=Array.from(V).map(L=>L.props.value).join(";");return c.jsx(w6,{...b,children:c.jsxs(yge,{required:y,scope:t,trigger:w,onTriggerChange:A,valueNode:O,onValueNodeChange:N,valueNodeHasChildren:T,onValueNodeHasChildrenChange:E,contentId:Vn(),value:M,onValueChange:U,open:R,onOpenChange:k,dir:C,triggerPointerDownPosRef:$,disabled:g,children:[c.jsx(gg.Provider,{scope:t,children:c.jsx(xge,{scope:e.__scopeSelect,onNativeOptionAdd:S.useCallback(L=>{F(q=>new Set(q).add(L))},[]),onNativeOptionRemove:S.useCallback(L=>{F(q=>{const H=new Set(q);return H.delete(L),H})},[]),children:n})}),z?c.jsxs(Y6,{"aria-hidden":!0,required:y,tabIndex:-1,name:p,autoComplete:v,value:M,onChange:L=>U(L.target.value),disabled:g,form:j,children:[M===void 0?c.jsx("option",{value:""}):null,Array.from(V)]},G):null]})})};A6.displayName=js;var O6="SelectTrigger",N6=S.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...a}=e,o=xg(n),l=Ao(O6,n),u=l.disabled||r,d=Fe(t,l.onTriggerChange),h=yg(n),p=S.useRef("touch"),[v,g,y]=Z6(b=>{const w=h().filter(N=>!N.disabled),A=w.find(N=>N.value===l.value),O=Q6(w,b,A);O!==void 0&&l.onValueChange(O.value)}),j=b=>{u||(l.onOpenChange(!0),y()),b&&(l.triggerPointerDownPosRef.current={x:Math.round(b.pageX),y:Math.round(b.pageY)})};return c.jsx(jO,{asChild:!0,...o,children:c.jsx(De.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:u,"data-disabled":u?"":void 0,"data-placeholder":X6(l.value)?"":void 0,...a,ref:d,onClick:Oe(a.onClick,b=>{b.currentTarget.focus(),p.current!=="mouse"&&j(b)}),onPointerDown:Oe(a.onPointerDown,b=>{p.current=b.pointerType;const w=b.target;w.hasPointerCapture(b.pointerId)&&w.releasePointerCapture(b.pointerId),b.button===0&&b.ctrlKey===!1&&b.pointerType==="mouse"&&(j(b),b.preventDefault())}),onKeyDown:Oe(a.onKeyDown,b=>{const w=v.current!=="";!(b.ctrlKey||b.altKey||b.metaKey)&&b.key.length===1&&g(b.key),!(w&&b.key===" ")&&mge.includes(b.key)&&(j(),b.preventDefault())})})})});N6.displayName=O6;var E6="SelectValue",T6=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,children:o,placeholder:l="",...u}=e,d=Ao(E6,n),{onValueNodeHasChildrenChange:h}=d,p=o!==void 0,v=Fe(t,d.onValueNodeChange);return Sn(()=>{h(p)},[h,p]),c.jsx(De.span,{...u,ref:v,style:{pointerEvents:"none"},children:X6(d.value)?c.jsx(c.Fragment,{children:l}):o})});T6.displayName=E6;var wge="SelectIcon",C6=S.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...a}=e;return c.jsx(De.span,{"aria-hidden":!0,...a,ref:t,children:r||"▼"})});C6.displayName=wge;var Sge="SelectPortal",R6=e=>c.jsx(Rd,{asChild:!0,...e});R6.displayName=Sge;var _s="SelectContent",P6=S.forwardRef((e,t)=>{const n=Ao(_s,e.__scopeSelect),[r,a]=S.useState();if(Sn(()=>{a(new DocumentFragment)},[]),!n.open){const o=r;return o?Es.createPortal(c.jsx(k6,{scope:e.__scopeSelect,children:c.jsx(gg.Slot,{scope:e.__scopeSelect,children:c.jsx("div",{children:e.children})})}),o):null}return c.jsx(M6,{...e,ref:t})});P6.displayName=_s;var ca=10,[k6,Oo]=Hc(_s),jge="SelectContentImpl",_ge=lge("SelectContent.RemoveScroll"),M6=S.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:a,onEscapeKeyDown:o,onPointerDownOutside:l,side:u,sideOffset:d,align:h,alignOffset:p,arrowPadding:v,collisionBoundary:g,collisionPadding:y,sticky:j,hideWhenDetached:b,avoidCollisions:w,...A}=e,O=Ao(_s,n),[N,T]=S.useState(null),[E,C]=S.useState(null),R=Fe(t,Q=>T(Q)),[k,M]=S.useState(null),[U,$]=S.useState(null),z=yg(n),[V,F]=S.useState(!1),G=S.useRef(!1);S.useEffect(()=>{if(N)return aO(N)},[N]),rO();const L=S.useCallback(Q=>{const[ne,...X]=z().map(oe=>oe.ref.current),[de]=X.slice(-1),be=document.activeElement;for(const oe of Q)if(oe===be||(oe?.scrollIntoView({block:"nearest"}),oe===ne&&E&&(E.scrollTop=0),oe===de&&E&&(E.scrollTop=E.scrollHeight),oe?.focus(),document.activeElement!==be))return},[z,E]),q=S.useCallback(()=>L([k,N]),[L,k,N]);S.useEffect(()=>{V&&q()},[V,q]);const{onOpenChange:H,triggerPointerDownPosRef:ee}=O;S.useEffect(()=>{if(N){let Q={x:0,y:0};const ne=de=>{Q={x:Math.abs(Math.round(de.pageX)-(ee.current?.x??0)),y:Math.abs(Math.round(de.pageY)-(ee.current?.y??0))}},X=de=>{Q.x<=10&&Q.y<=10?de.preventDefault():N.contains(de.target)||H(!1),document.removeEventListener("pointermove",ne),ee.current=null};return ee.current!==null&&(document.addEventListener("pointermove",ne),document.addEventListener("pointerup",X,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",ne),document.removeEventListener("pointerup",X,{capture:!0})}}},[N,H,ee]),S.useEffect(()=>{const Q=()=>H(!1);return window.addEventListener("blur",Q),window.addEventListener("resize",Q),()=>{window.removeEventListener("blur",Q),window.removeEventListener("resize",Q)}},[H]);const[ve,I]=Z6(Q=>{const ne=z().filter(be=>!be.disabled),X=ne.find(be=>be.ref.current===document.activeElement),de=Q6(ne,Q,X);de&&setTimeout(()=>de.ref.current.focus())}),B=S.useCallback((Q,ne,X)=>{const de=!G.current&&!X;(O.value!==void 0&&O.value===ne||de)&&(M(Q),de&&(G.current=!0))},[O.value]),Y=S.useCallback(()=>N?.focus(),[N]),te=S.useCallback((Q,ne,X)=>{const de=!G.current&&!X;(O.value!==void 0&&O.value===ne||de)&&$(Q)},[O.value]),le=r==="popper"?p_:D6,xe=le===p_?{side:u,sideOffset:d,align:h,alignOffset:p,arrowPadding:v,collisionBoundary:g,collisionPadding:y,sticky:j,hideWhenDetached:b,avoidCollisions:w}:{};return c.jsx(k6,{scope:n,content:N,viewport:E,onViewportChange:C,itemRefCallback:B,selectedItem:k,onItemLeave:Y,itemTextRefCallback:te,focusSelectedItem:q,selectedItemText:U,position:r,isPositioned:V,searchRef:ve,children:c.jsx(sg,{as:_ge,allowPinchZoom:!0,children:c.jsx(ig,{asChild:!0,trapped:O.open,onMountAutoFocus:Q=>{Q.preventDefault()},onUnmountAutoFocus:Oe(a,Q=>{O.trigger?.focus({preventScroll:!0}),Q.preventDefault()}),children:c.jsx(Cd,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:o,onPointerDownOutside:l,onFocusOutside:Q=>Q.preventDefault(),onDismiss:()=>O.onOpenChange(!1),children:c.jsx(le,{role:"listbox",id:O.contentId,"data-state":O.open?"open":"closed",dir:O.dir,onContextMenu:Q=>Q.preventDefault(),...A,...xe,onPlaced:()=>F(!0),ref:R,style:{display:"flex",flexDirection:"column",outline:"none",...A.style},onKeyDown:Oe(A.onKeyDown,Q=>{const ne=Q.ctrlKey||Q.altKey||Q.metaKey;if(Q.key==="Tab"&&Q.preventDefault(),!ne&&Q.key.length===1&&I(Q.key),["ArrowUp","ArrowDown","Home","End"].includes(Q.key)){let de=z().filter(be=>!be.disabled).map(be=>be.ref.current);if(["ArrowUp","End"].includes(Q.key)&&(de=de.slice().reverse()),["ArrowUp","ArrowDown"].includes(Q.key)){const be=Q.target,oe=de.indexOf(be);de=de.slice(oe+1)}setTimeout(()=>L(de)),Q.preventDefault()}})})})})})})});M6.displayName=jge;var Age="SelectItemAlignedPosition",D6=S.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...a}=e,o=Ao(_s,n),l=Oo(_s,n),[u,d]=S.useState(null),[h,p]=S.useState(null),v=Fe(t,R=>p(R)),g=yg(n),y=S.useRef(!1),j=S.useRef(!0),{viewport:b,selectedItem:w,selectedItemText:A,focusSelectedItem:O}=l,N=S.useCallback(()=>{if(o.trigger&&o.valueNode&&u&&h&&b&&w&&A){const R=o.trigger.getBoundingClientRect(),k=h.getBoundingClientRect(),M=o.valueNode.getBoundingClientRect(),U=A.getBoundingClientRect();if(o.dir!=="rtl"){const be=U.left-k.left,oe=M.left-be,Pe=R.left-oe,Se=R.width+Pe,fe=Math.max(Se,k.width),he=window.innerWidth-ca,$e=Ef(oe,[ca,Math.max(ca,he-fe)]);u.style.minWidth=Se+"px",u.style.left=$e+"px"}else{const be=k.right-U.right,oe=window.innerWidth-M.right-be,Pe=window.innerWidth-R.right-oe,Se=R.width+Pe,fe=Math.max(Se,k.width),he=window.innerWidth-ca,$e=Ef(oe,[ca,Math.max(ca,he-fe)]);u.style.minWidth=Se+"px",u.style.right=$e+"px"}const $=g(),z=window.innerHeight-ca*2,V=b.scrollHeight,F=window.getComputedStyle(h),G=parseInt(F.borderTopWidth,10),L=parseInt(F.paddingTop,10),q=parseInt(F.borderBottomWidth,10),H=parseInt(F.paddingBottom,10),ee=G+L+V+H+q,ve=Math.min(w.offsetHeight*5,ee),I=window.getComputedStyle(b),B=parseInt(I.paddingTop,10),Y=parseInt(I.paddingBottom,10),te=R.top+R.height/2-ca,le=z-te,xe=w.offsetHeight/2,Q=w.offsetTop+xe,ne=G+L+Q,X=ee-ne;if(ne<=te){const be=$.length>0&&w===$[$.length-1].ref.current;u.style.bottom="0px";const oe=h.clientHeight-b.offsetTop-b.offsetHeight,Pe=Math.max(le,xe+(be?Y:0)+oe+q),Se=ne+Pe;u.style.height=Se+"px"}else{const be=$.length>0&&w===$[0].ref.current;u.style.top="0px";const Pe=Math.max(te,G+b.offsetTop+(be?B:0)+xe)+X;u.style.height=Pe+"px",b.scrollTop=ne-te+b.offsetTop}u.style.margin=`${ca}px 0`,u.style.minHeight=ve+"px",u.style.maxHeight=z+"px",r?.(),requestAnimationFrame(()=>y.current=!0)}},[g,o.trigger,o.valueNode,u,h,b,w,A,o.dir,r]);Sn(()=>N(),[N]);const[T,E]=S.useState();Sn(()=>{h&&E(window.getComputedStyle(h).zIndex)},[h]);const C=S.useCallback(R=>{R&&j.current===!0&&(N(),O?.(),j.current=!1)},[N,O]);return c.jsx(Nge,{scope:n,contentWrapper:u,shouldExpandOnScrollRef:y,onScrollButtonChange:C,children:c.jsx("div",{ref:d,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:T},children:c.jsx(De.div,{...a,ref:v,style:{boxSizing:"border-box",maxHeight:"100%",...a.style}})})})});D6.displayName=Age;var Oge="SelectPopperPosition",p_=S.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:a=ca,...o}=e,l=xg(n);return c.jsx(S6,{...l,...o,ref:t,align:r,collisionPadding:a,style:{boxSizing:"border-box",...o.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});p_.displayName=Oge;var[Nge,AO]=Hc(_s,{}),m_="SelectViewport",L6=S.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...a}=e,o=Oo(m_,n),l=AO(m_,n),u=Fe(t,o.onViewportChange),d=S.useRef(0);return c.jsxs(c.Fragment,{children:[c.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),c.jsx(gg.Slot,{scope:n,children:c.jsx(De.div,{"data-radix-select-viewport":"",role:"presentation",...a,ref:u,style:{position:"relative",flex:1,overflow:"hidden auto",...a.style},onScroll:Oe(a.onScroll,h=>{const p=h.currentTarget,{contentWrapper:v,shouldExpandOnScrollRef:g}=l;if(g?.current&&v){const y=Math.abs(d.current-p.scrollTop);if(y>0){const j=window.innerHeight-ca*2,b=parseFloat(v.style.minHeight),w=parseFloat(v.style.height),A=Math.max(b,w);if(A0?T:0,v.style.justifyContent="flex-end")}}}d.current=p.scrollTop})})})]})});L6.displayName=m_;var $6="SelectGroup",[Ege,Tge]=Hc($6),Cge=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Vn();return c.jsx(Ege,{scope:n,id:a,children:c.jsx(De.div,{role:"group","aria-labelledby":a,...r,ref:t})})});Cge.displayName=$6;var I6="SelectLabel",z6=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=Tge(I6,n);return c.jsx(De.div,{id:a.id,...r,ref:t})});z6.displayName=I6;var rv="SelectItem",[Rge,B6]=Hc(rv),q6=S.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:a=!1,textValue:o,...l}=e,u=Ao(rv,n),d=Oo(rv,n),h=u.value===r,[p,v]=S.useState(o??""),[g,y]=S.useState(!1),j=Fe(t,O=>d.itemRefCallback?.(O,r,a)),b=Vn(),w=S.useRef("touch"),A=()=>{a||(u.onValueChange(r),u.onOpenChange(!1))};if(r==="")throw new Error("A must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return c.jsx(Rge,{scope:n,value:r,disabled:a,textId:b,isSelected:h,onItemTextChange:S.useCallback(O=>{v(N=>N||(O?.textContent??"").trim())},[]),children:c.jsx(gg.ItemSlot,{scope:n,value:r,disabled:a,textValue:p,children:c.jsx(De.div,{role:"option","aria-labelledby":b,"data-highlighted":g?"":void 0,"aria-selected":h&&g,"data-state":h?"checked":"unchecked","aria-disabled":a||void 0,"data-disabled":a?"":void 0,tabIndex:a?void 0:-1,...l,ref:j,onFocus:Oe(l.onFocus,()=>y(!0)),onBlur:Oe(l.onBlur,()=>y(!1)),onClick:Oe(l.onClick,()=>{w.current!=="mouse"&&A()}),onPointerUp:Oe(l.onPointerUp,()=>{w.current==="mouse"&&A()}),onPointerDown:Oe(l.onPointerDown,O=>{w.current=O.pointerType}),onPointerMove:Oe(l.onPointerMove,O=>{w.current=O.pointerType,a?d.onItemLeave?.():w.current==="mouse"&&O.currentTarget.focus({preventScroll:!0})}),onPointerLeave:Oe(l.onPointerLeave,O=>{O.currentTarget===document.activeElement&&d.onItemLeave?.()}),onKeyDown:Oe(l.onKeyDown,O=>{d.searchRef?.current!==""&&O.key===" "||(vge.includes(O.key)&&A(),O.key===" "&&O.preventDefault())})})})})});q6.displayName=rv;var mf="SelectItemText",U6=S.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:a,...o}=e,l=Ao(mf,n),u=Oo(mf,n),d=B6(mf,n),h=bge(mf,n),[p,v]=S.useState(null),g=Fe(t,A=>v(A),d.onItemTextChange,A=>u.itemTextRefCallback?.(A,d.value,d.disabled)),y=p?.textContent,j=S.useMemo(()=>c.jsx("option",{value:d.value,disabled:d.disabled,children:y},d.value),[d.disabled,d.value,y]),{onNativeOptionAdd:b,onNativeOptionRemove:w}=h;return Sn(()=>(b(j),()=>w(j)),[b,w,j]),c.jsxs(c.Fragment,{children:[c.jsx(De.span,{id:d.textId,...o,ref:g}),d.isSelected&&l.valueNode&&!l.valueNodeHasChildren?Es.createPortal(o.children,l.valueNode):null]})});U6.displayName=mf;var F6="SelectItemIndicator",H6=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return B6(F6,n).isSelected?c.jsx(De.span,{"aria-hidden":!0,...r,ref:t}):null});H6.displayName=F6;var v_="SelectScrollUpButton",V6=S.forwardRef((e,t)=>{const n=Oo(v_,e.__scopeSelect),r=AO(v_,e.__scopeSelect),[a,o]=S.useState(!1),l=Fe(t,r.onScrollButtonChange);return Sn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const h=d.scrollTop>0;o(h)};const d=n.viewport;return u(),d.addEventListener("scroll",u),()=>d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),a?c.jsx(K6,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop-d.offsetHeight)}}):null});V6.displayName=v_;var g_="SelectScrollDownButton",G6=S.forwardRef((e,t)=>{const n=Oo(g_,e.__scopeSelect),r=AO(g_,e.__scopeSelect),[a,o]=S.useState(!1),l=Fe(t,r.onScrollButtonChange);return Sn(()=>{if(n.viewport&&n.isPositioned){let u=function(){const h=d.scrollHeight-d.clientHeight,p=Math.ceil(d.scrollTop)d.removeEventListener("scroll",u)}},[n.viewport,n.isPositioned]),a?c.jsx(K6,{...e,ref:l,onAutoScroll:()=>{const{viewport:u,selectedItem:d}=n;u&&d&&(u.scrollTop=u.scrollTop+d.offsetHeight)}}):null});G6.displayName=g_;var K6=S.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...a}=e,o=Oo("SelectScrollButton",n),l=S.useRef(null),u=yg(n),d=S.useCallback(()=>{l.current!==null&&(window.clearInterval(l.current),l.current=null)},[]);return S.useEffect(()=>()=>d(),[d]),Sn(()=>{u().find(p=>p.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[u]),c.jsx(De.div,{"aria-hidden":!0,...a,ref:t,style:{flexShrink:0,...a.style},onPointerDown:Oe(a.onPointerDown,()=>{l.current===null&&(l.current=window.setInterval(r,50))}),onPointerMove:Oe(a.onPointerMove,()=>{o.onItemLeave?.(),l.current===null&&(l.current=window.setInterval(r,50))}),onPointerLeave:Oe(a.onPointerLeave,()=>{d()})})}),Pge="SelectSeparator",W6=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return c.jsx(De.div,{"aria-hidden":!0,...r,ref:t})});W6.displayName=Pge;var y_="SelectArrow",kge=S.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,a=xg(n),o=Ao(y_,n),l=Oo(y_,n);return o.open&&l.position==="popper"?c.jsx(j6,{...a,...r,ref:t}):null});kge.displayName=y_;var Mge="SelectBubbleInput",Y6=S.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const a=S.useRef(null),o=Fe(r,a),l=ng(t);return S.useEffect(()=>{const u=a.current;if(!u)return;const d=window.HTMLSelectElement.prototype,p=Object.getOwnPropertyDescriptor(d,"value").set;if(l!==t&&p){const v=new Event("change",{bubbles:!0});p.call(u,t),u.dispatchEvent(v)}},[l,t]),c.jsx(De.select,{...n,style:{..._6,...n.style},ref:o,defaultValue:t})});Y6.displayName=Mge;function X6(e){return e===""||e===void 0}function Z6(e){const t=nn(e),n=S.useRef(""),r=S.useRef(0),a=S.useCallback(l=>{const u=n.current+l;t(u),(function d(h){n.current=h,window.clearTimeout(r.current),h!==""&&(r.current=window.setTimeout(()=>d(""),1e3))})(u)},[t]),o=S.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return S.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,a,o]}function Q6(e,t,n){const a=t.length>1&&Array.from(t).every(h=>h===t[0])?t[0]:t,o=n?e.indexOf(n):-1;let l=Dge(e,Math.max(o,0));a.length===1&&(l=l.filter(h=>h!==n));const d=l.find(h=>h.textValue.toLowerCase().startsWith(a.toLowerCase()));return d!==n?d:void 0}function Dge(e,t){return e.map((n,r)=>e[(t+r)%e.length])}var Lge=A6,J6=N6,$ge=T6,Ige=C6,zge=R6,e8=P6,Bge=L6,t8=z6,n8=q6,qge=U6,Uge=H6,r8=V6,a8=G6,i8=W6;const dn=Lge,hn=$ge,en=S.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(J6,{ref:r,className:je("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-transparent px-3 py-2 text-sm shadow-sm ring-offset-background data-[placeholder]:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...n,children:[t,c.jsx(Ige,{asChild:!0,children:c.jsx(v5,{className:"h-4 w-4 opacity-50"})})]}));en.displayName=J6.displayName;const o8=S.forwardRef(({className:e,...t},n)=>c.jsx(r8,{ref:n,className:je("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(Qfe,{className:"h-4 w-4"})}));o8.displayName=r8.displayName;const s8=S.forwardRef(({className:e,...t},n)=>c.jsx(a8,{ref:n,className:je("flex cursor-default items-center justify-center py-1",e),...t,children:c.jsx(v5,{className:"h-4 w-4"})}));s8.displayName=a8.displayName;const tn=S.forwardRef(({className:e,children:t,position:n="popper",...r},a)=>c.jsx(zge,{children:c.jsxs(e8,{ref:a,className:je("relative z-[100] max-h-[--radix-select-content-available-height] min-w-[8rem] overflow-hidden rounded-md border border-border bg-white dark:bg-gray-900 text-gray-900 dark:text-gray-100 shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-select-content-transform-origin]",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[c.jsx(o8,{}),c.jsx(Bge,{className:je("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),c.jsx(s8,{})]})}));tn.displayName=e8.displayName;const Fge=S.forwardRef(({className:e,...t},n)=>c.jsx(t8,{ref:n,className:je("px-2 py-1.5 text-sm font-semibold",e),...t}));Fge.displayName=t8.displayName;const pt=S.forwardRef(({className:e,children:t,...n},r)=>c.jsxs(n8,{ref:r,className:je("relative flex w-full cursor-default select-none items-center rounded-sm py-2 pl-2 pr-8 text-sm outline-none bg-white dark:bg-gray-900 hover:bg-gray-100 dark:hover:bg-gray-800 focus:bg-gray-100 dark:focus:bg-gray-800 data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...n,children:[c.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:c.jsx(Uge,{children:c.jsx(Fl,{className:"h-4 w-4"})})}),c.jsx(qge,{children:t})]}));pt.displayName=n8.displayName;const Hge=S.forwardRef(({className:e,...t},n)=>c.jsx(i8,{ref:n,className:je("-mx-1 my-1 h-px bg-muted",e),...t}));Hge.displayName=i8.displayName;function Vge(e){const t=Gge(e),n=S.forwardRef((r,a)=>{const{children:o,...l}=r,u=S.Children.toArray(o),d=u.find(Wge);if(d){const h=d.props.children,p=u.map(v=>v===d?S.Children.count(h)>1?S.Children.only(null):S.isValidElement(h)?h.props.children:null:v);return c.jsx(t,{...l,ref:a,children:S.isValidElement(h)?S.cloneElement(h,void 0,p):null})}return c.jsx(t,{...l,ref:a,children:o})});return n.displayName=`${e}.Slot`,n}function Gge(e){const t=S.forwardRef((n,r)=>{const{children:a,...o}=n;if(S.isValidElement(a)){const l=Xge(a),u=Yge(o,a.props);return a.type!==S.Fragment&&(u.ref=r?Qr(r,l):l),S.cloneElement(a,u)}return S.Children.count(a)>1?S.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var Kge=Symbol("radix.slottable");function Wge(e){return S.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===Kge}function Yge(e,t){const n={...t};for(const r in t){const a=e[r],o=t[r];/^on[A-Z]/.test(r)?a&&o?n[r]=(...u)=>{const d=o(...u);return a(...u),d}:a&&(n[r]=a):r==="style"?n[r]={...a,...o}:r==="className"&&(n[r]=[a,o].filter(Boolean).join(" "))}return{...e,...n}}function Xge(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var bg="Popover",[l8]=Rr(bg,[vg]),kd=vg(),[Zge,No]=l8(bg),c8=e=>{const{__scopePopover:t,children:n,open:r,defaultOpen:a,onOpenChange:o,modal:l=!1}=e,u=kd(t),d=S.useRef(null),[h,p]=S.useState(!1),[v,g]=za({prop:r,defaultProp:a??!1,onChange:o,caller:bg});return c.jsx(w6,{...u,children:c.jsx(Zge,{scope:t,contentId:Vn(),triggerRef:d,open:v,onOpenChange:g,onOpenToggle:S.useCallback(()=>g(y=>!y),[g]),hasCustomAnchor:h,onCustomAnchorAdd:S.useCallback(()=>p(!0),[]),onCustomAnchorRemove:S.useCallback(()=>p(!1),[]),modal:l,children:n})})};c8.displayName=bg;var u8="PopoverAnchor",Qge=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=No(u8,n),o=kd(n),{onCustomAnchorAdd:l,onCustomAnchorRemove:u}=a;return S.useEffect(()=>(l(),()=>u()),[l,u]),c.jsx(jO,{...o,...r,ref:t})});Qge.displayName=u8;var f8="PopoverTrigger",d8=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=No(f8,n),o=kd(n),l=Fe(t,a.triggerRef),u=c.jsx(De.button,{type:"button","aria-haspopup":"dialog","aria-expanded":a.open,"aria-controls":a.contentId,"data-state":g8(a.open),...r,ref:l,onClick:Oe(e.onClick,a.onOpenToggle)});return a.hasCustomAnchor?u:c.jsx(jO,{asChild:!0,...o,children:u})});d8.displayName=f8;var OO="PopoverPortal",[Jge,eye]=l8(OO,{forceMount:void 0}),h8=e=>{const{__scopePopover:t,forceMount:n,children:r,container:a}=e,o=No(OO,t);return c.jsx(Jge,{scope:t,forceMount:n,children:c.jsx(Pr,{present:n||o.open,children:c.jsx(Rd,{asChild:!0,container:a,children:r})})})};h8.displayName=OO;var Oc="PopoverContent",p8=S.forwardRef((e,t)=>{const n=eye(Oc,e.__scopePopover),{forceMount:r=n.forceMount,...a}=e,o=No(Oc,e.__scopePopover);return c.jsx(Pr,{present:r||o.open,children:o.modal?c.jsx(nye,{...a,ref:t}):c.jsx(rye,{...a,ref:t})})});p8.displayName=Oc;var tye=Vge("PopoverContent.RemoveScroll"),nye=S.forwardRef((e,t)=>{const n=No(Oc,e.__scopePopover),r=S.useRef(null),a=Fe(t,r),o=S.useRef(!1);return S.useEffect(()=>{const l=r.current;if(l)return aO(l)},[]),c.jsx(sg,{as:tye,allowPinchZoom:!0,children:c.jsx(m8,{...e,ref:a,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:Oe(e.onCloseAutoFocus,l=>{l.preventDefault(),o.current||n.triggerRef.current?.focus()}),onPointerDownOutside:Oe(e.onPointerDownOutside,l=>{const u=l.detail.originalEvent,d=u.button===0&&u.ctrlKey===!0,h=u.button===2||d;o.current=h},{checkForDefaultPrevented:!1}),onFocusOutside:Oe(e.onFocusOutside,l=>l.preventDefault(),{checkForDefaultPrevented:!1})})})}),rye=S.forwardRef((e,t)=>{const n=No(Oc,e.__scopePopover),r=S.useRef(!1),a=S.useRef(!1);return c.jsx(m8,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{e.onCloseAutoFocus?.(o),o.defaultPrevented||(r.current||n.triggerRef.current?.focus(),o.preventDefault()),r.current=!1,a.current=!1},onInteractOutside:o=>{e.onInteractOutside?.(o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(a.current=!0));const l=o.target;n.triggerRef.current?.contains(l)&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&a.current&&o.preventDefault()}})}),m8=S.forwardRef((e,t)=>{const{__scopePopover:n,trapFocus:r,onOpenAutoFocus:a,onCloseAutoFocus:o,disableOutsidePointerEvents:l,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onInteractOutside:p,...v}=e,g=No(Oc,n),y=kd(n);return rO(),c.jsx(ig,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:a,onUnmountAutoFocus:o,children:c.jsx(Cd,{asChild:!0,disableOutsidePointerEvents:l,onInteractOutside:p,onEscapeKeyDown:u,onPointerDownOutside:d,onFocusOutside:h,onDismiss:()=>g.onOpenChange(!1),children:c.jsx(S6,{"data-state":g8(g.open),role:"dialog",id:g.contentId,...y,...v,ref:t,style:{...v.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),v8="PopoverClose",aye=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=No(v8,n);return c.jsx(De.button,{type:"button",...r,ref:t,onClick:Oe(e.onClick,()=>a.onOpenChange(!1))})});aye.displayName=v8;var iye="PopoverArrow",oye=S.forwardRef((e,t)=>{const{__scopePopover:n,...r}=e,a=kd(n);return c.jsx(j6,{...a,...r,ref:t})});oye.displayName=iye;function g8(e){return e?"open":"closed"}var sye=c8,lye=d8,cye=h8,y8=p8;const Nc=sye,Ec=lye,As=S.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},a)=>c.jsx(cye,{children:c.jsx(y8,{ref:a,align:t,sideOffset:n,className:je("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 origin-[--radix-popover-content-transform-origin]",e),...r})}));As.displayName=y8.displayName;const Vc="/api/webui/config";async function uye(){const t=await(await fetch(`${Vc}/bot`)).json();if(!t.success)throw new Error("获取配置数据失败");return t.config}async function av(){const t=await(await fetch(`${Vc}/model`)).json();if(!t.success)throw new Error("获取模型配置数据失败");return t.config}async function fye(e){const t=localStorage.getItem("access-token"),r=await(await fetch(`${Vc}/bot`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(e)})).json();if(!r.success)throw new Error(r.message||"保存配置失败")}async function x8(e){const t=localStorage.getItem("access-token"),r=await(await fetch(`${Vc}/model`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${t}`},body:JSON.stringify(e)})).json();if(!r.success)throw new Error(r.message||"保存配置失败")}async function dye(e,t){const n=localStorage.getItem("access-token"),a=await(await fetch(`${Vc}/bot/section/${e}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(t)})).json();if(!a.success)throw new Error(a.message||`保存配置节 ${e} 失败`)}async function x_(e,t){const n=localStorage.getItem("access-token"),a=await(await fetch(`${Vc}/model/section/${e}`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${n}`},body:JSON.stringify(t)})).json();if(!a.success)throw new Error(a.message||`保存配置节 ${e} 失败`)}function hye(){const[e,t]=S.useState(!0),[n,r]=S.useState(!1),[a,o]=S.useState(!1),[l,u]=S.useState(!1),{toast:d}=na(),[h,p]=S.useState(null),[v,g]=S.useState(null),[y,j]=S.useState(null),[b,w]=S.useState(null),[A,O]=S.useState(null),[N,T]=S.useState(null),[E,C]=S.useState(null),[R,k]=S.useState(null),[M,U]=S.useState(null),[$,z]=S.useState(null),[V,F]=S.useState(null),[G,L]=S.useState(null),[q,H]=S.useState(null),[ee,ve]=S.useState(null),[I,B]=S.useState(null),[Y,te]=S.useState(null),[le,xe]=S.useState(null),[Q,ne]=S.useState(null),X=S.useRef(null),de=S.useRef(!0),be=S.useRef({}),oe=S.useCallback(async()=>{try{t(!0);const he=await uye();be.current=he,p(he.bot),g(he.personality);const $e=he.chat;$e.talk_value_rules||($e.talk_value_rules=[]),j($e),w(he.expression),O(he.emoji),T(he.memory),C(he.tool),k(he.mood),U(he.voice),z(he.lpmm_knowledge),F(he.keyword_reaction),L(he.response_post_process),H(he.chinese_typo),ve(he.response_splitter),B(he.log),te(he.debug),xe(he.maim_message),ne(he.telemetry),u(!1),de.current=!1}catch(he){console.error("加载配置失败:",he),d({title:"加载失败",description:"无法加载配置文件",variant:"destructive"})}finally{t(!1)}},[d]);S.useEffect(()=>{oe()},[oe]);const Pe=S.useCallback(async(he,$e)=>{if(!de.current)try{o(!0),await dye(he,$e),u(!1)}catch(Ot){console.error(`自动保存 ${he} 失败:`,Ot),u(!0)}finally{o(!1)}},[]),Se=S.useCallback((he,$e)=>{de.current||(u(!0),X.current&&clearTimeout(X.current),X.current=setTimeout(()=>{Pe(he,$e)},2e3))},[Pe]);S.useEffect(()=>{h&&!de.current&&Se("bot",h)},[h,Se]),S.useEffect(()=>{v&&!de.current&&Se("personality",v)},[v,Se]),S.useEffect(()=>{y&&!de.current&&Se("chat",y)},[y,Se]),S.useEffect(()=>{b&&!de.current&&Se("expression",b)},[b,Se]),S.useEffect(()=>{A&&!de.current&&Se("emoji",A)},[A,Se]),S.useEffect(()=>{N&&!de.current&&Se("memory",N)},[N,Se]),S.useEffect(()=>{E&&!de.current&&Se("tool",E)},[E,Se]),S.useEffect(()=>{R&&!de.current&&Se("mood",R)},[R,Se]),S.useEffect(()=>{M&&!de.current&&Se("voice",M)},[M,Se]),S.useEffect(()=>{$&&!de.current&&Se("lpmm_knowledge",$)},[$,Se]),S.useEffect(()=>{V&&!de.current&&Se("keyword_reaction",V)},[V,Se]),S.useEffect(()=>{G&&!de.current&&Se("response_post_process",G)},[G,Se]),S.useEffect(()=>{q&&!de.current&&Se("chinese_typo",q)},[q,Se]),S.useEffect(()=>{ee&&!de.current&&Se("response_splitter",ee)},[ee,Se]),S.useEffect(()=>{I&&!de.current&&Se("log",I)},[I,Se]),S.useEffect(()=>{Y&&!de.current&&Se("debug",Y)},[Y,Se]),S.useEffect(()=>{le&&!de.current&&Se("maim_message",le)},[le,Se]),S.useEffect(()=>{Q&&!de.current&&Se("telemetry",Q)},[Q,Se]);const fe=async()=>{try{r(!0),X.current&&clearTimeout(X.current);const he={...be.current,bot:h,personality:v,chat:y,expression:b,emoji:A,memory:N,tool:E,mood:R,voice:M,lpmm_knowledge:$,keyword_reaction:V,response_post_process:G,chinese_typo:q,response_splitter:ee,log:I,debug:Y,maim_message:le,telemetry:Q};await fye(he),u(!1),d({title:"保存成功",description:"麦麦主程序配置已保存"})}catch(he){console.error("保存配置失败:",he),d({title:"保存失败",description:he.message,variant:"destructive"})}finally{r(!1)}};return e?c.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:c.jsx("div",{className:"flex items-center justify-center h-64",children:c.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):c.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"麦麦主程序配置"}),c.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的核心功能和行为设置"})]}),c.jsxs(we,{onClick:fe,disabled:n||a||!l,size:"sm",className:"w-full sm:w-auto",children:[c.jsx(XA,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),n?"保存中...":a?"自动保存中...":l?"保存配置":"已保存"]})]}),c.jsxs(Ql,{defaultValue:"bot",className:"w-full",children:[c.jsx("div",{className:"overflow-x-auto -mx-4 px-4 sm:mx-0 sm:px-0",children:c.jsxs(ms,{className:"inline-flex w-auto min-w-full sm:grid sm:w-full sm:grid-cols-5 lg:grid-cols-10",children:[c.jsx(_t,{value:"bot",className:"flex-shrink-0",children:"基本信息"}),c.jsx(_t,{value:"personality",className:"flex-shrink-0",children:"人格"}),c.jsx(_t,{value:"chat",className:"flex-shrink-0",children:"聊天"}),c.jsx(_t,{value:"expression",className:"flex-shrink-0",children:"表达"}),c.jsx(_t,{value:"features",className:"flex-shrink-0",children:"功能"}),c.jsx(_t,{value:"processing",className:"flex-shrink-0",children:"处理"}),c.jsx(_t,{value:"mood",className:"flex-shrink-0",children:"情绪"}),c.jsx(_t,{value:"voice",className:"flex-shrink-0",children:"语音"}),c.jsx(_t,{value:"lpmm",className:"flex-shrink-0",children:"知识库"}),c.jsx(_t,{value:"other",className:"flex-shrink-0",children:"其他"})]})}),c.jsxs(Bn,{className:"h-[calc(100vh-320px)] sm:h-[calc(100vh-320px)]",children:[c.jsx(Pt,{value:"bot",className:"space-y-4",children:h&&c.jsx(pye,{config:h,onChange:p})}),c.jsx(Pt,{value:"personality",className:"space-y-4",children:v&&c.jsx(mye,{config:v,onChange:g})}),c.jsx(Pt,{value:"chat",className:"space-y-4",children:y&&c.jsx(vye,{config:y,onChange:j})}),c.jsx(Pt,{value:"expression",className:"space-y-4",children:b&&c.jsx(gye,{config:b,onChange:w})}),c.jsx(Pt,{value:"features",className:"space-y-4",children:A&&N&&E&&c.jsx(yye,{emojiConfig:A,memoryConfig:N,toolConfig:E,onEmojiChange:O,onMemoryChange:T,onToolChange:C})}),c.jsx(Pt,{value:"processing",className:"space-y-4",children:V&&G&&q&&ee&&c.jsx(xye,{keywordReactionConfig:V,responsePostProcessConfig:G,chineseTypoConfig:q,responseSplitterConfig:ee,onKeywordReactionChange:F,onResponsePostProcessChange:L,onChineseTypoChange:H,onResponseSplitterChange:ve})}),c.jsx(Pt,{value:"mood",className:"space-y-4",children:R&&c.jsx(bye,{config:R,onChange:k})}),c.jsx(Pt,{value:"voice",className:"space-y-4",children:M&&c.jsx(wye,{config:M,onChange:U})}),c.jsx(Pt,{value:"lpmm",className:"space-y-4",children:$&&c.jsx(Sye,{config:$,onChange:z})}),c.jsxs(Pt,{value:"other",className:"space-y-4",children:[I&&c.jsx(jye,{config:I,onChange:B}),Y&&c.jsx(_ye,{config:Y,onChange:te}),le&&c.jsx(Aye,{config:le,onChange:xe}),Q&&c.jsx(Oye,{config:Q,onChange:ne})]})]})]})]})}function pye({config:e,onChange:t}){const n=()=>{t({...e,platforms:[...e.platforms,""]})},r=d=>{t({...e,platforms:e.platforms.filter((h,p)=>p!==d)})},a=(d,h)=>{const p=[...e.platforms];p[d]=h,t({...e,platforms:p})},o=()=>{t({...e,alias_names:[...e.alias_names,""]})},l=d=>{t({...e,alias_names:e.alias_names.filter((h,p)=>p!==d)})},u=(d,h)=>{const p=[...e.alias_names];p[d]=h,t({...e,alias_names:p})};return c.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold mb-4",children:"基本信息"}),c.jsxs("div",{className:"grid gap-4",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"platform",children:"平台"}),c.jsx(Ae,{id:"platform",value:e.platform,onChange:d=>t({...e,platform:d.target.value}),placeholder:"qq"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"qq_account",children:"QQ账号"}),c.jsx(Ae,{id:"qq_account",value:e.qq_account,onChange:d=>t({...e,qq_account:d.target.value}),placeholder:"123456789"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"nickname",children:"昵称"}),c.jsx(Ae,{id:"nickname",value:e.nickname,onChange:d=>t({...e,nickname:d.target.value}),placeholder:"麦麦"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(re,{children:"其他平台账号"}),c.jsxs(we,{onClick:n,size:"sm",variant:"outline",children:[c.jsx($n,{className:"h-4 w-4 mr-1"}),"添加"]})]}),c.jsxs("div",{className:"space-y-2",children:[e.platforms.map((d,h)=>c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Ae,{value:d,onChange:p=>a(h,p.target.value),placeholder:"wx:114514"}),c.jsxs(Rn,{children:[c.jsx(ma,{asChild:!0,children:c.jsx(we,{size:"icon",variant:"outline",children:c.jsx(zt,{className:"h-4 w-4"})})}),c.jsxs(mn,{children:[c.jsxs(vn,{children:[c.jsx(yn,{children:"确认删除"}),c.jsxs(xn,{children:['确定要删除平台账号 "',d||"(空)",'" 吗?此操作无法撤销。']})]}),c.jsxs(gn,{children:[c.jsx(wn,{children:"取消"}),c.jsx(bn,{onClick:()=>r(h),children:"删除"})]})]})]})]},h)),e.platforms.length===0&&c.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无其他平台账号"})]})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(re,{children:"别名"}),c.jsxs(we,{onClick:o,size:"sm",variant:"outline",children:[c.jsx($n,{className:"h-4 w-4 mr-1"}),"添加"]})]}),c.jsxs("div",{className:"space-y-2",children:[e.alias_names.map((d,h)=>c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Ae,{value:d,onChange:p=>u(h,p.target.value),placeholder:"小麦"}),c.jsxs(Rn,{children:[c.jsx(ma,{asChild:!0,children:c.jsx(we,{size:"icon",variant:"outline",children:c.jsx(zt,{className:"h-4 w-4"})})}),c.jsxs(mn,{children:[c.jsxs(vn,{children:[c.jsx(yn,{children:"确认删除"}),c.jsxs(xn,{children:['确定要删除别名 "',d||"(空)",'" 吗?此操作无法撤销。']})]}),c.jsxs(gn,{children:[c.jsx(wn,{children:"取消"}),c.jsx(bn,{onClick:()=>l(h),children:"删除"})]})]})]})]},h)),e.alias_names.length===0&&c.jsx("p",{className:"text-sm text-muted-foreground",children:"暂无别名"})]})]})]})]})})}function mye({config:e,onChange:t}){const n=()=>{t({...e,states:[...e.states,""]})},r=o=>{t({...e,states:e.states.filter((l,u)=>u!==o)})},a=(o,l)=>{const u=[...e.states];u[o]=l,t({...e,states:u})};return c.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold mb-4",children:"人格设置"}),c.jsxs("div",{className:"grid gap-4",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"personality",children:"人格特质"}),c.jsx(Wt,{id:"personality",value:e.personality,onChange:o=>t({...e,personality:o.target.value}),placeholder:"描述人格特质和身份特征(建议120字以内)",rows:3}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"建议120字以内,描述人格特质和身份特征"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"reply_style",children:"表达风格"}),c.jsx(Wt,{id:"reply_style",value:e.reply_style,onChange:o=>t({...e,reply_style:o.target.value}),placeholder:"描述说话的表达风格和习惯",rows:3})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"interest",children:"兴趣"}),c.jsx(Wt,{id:"interest",value:e.interest,onChange:o=>t({...e,interest:o.target.value}),placeholder:"会影响麦麦对什么话题进行回复",rows:2})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"plan_style",children:"说话规则与行为风格"}),c.jsx(Wt,{id:"plan_style",value:e.plan_style,onChange:o=>t({...e,plan_style:o.target.value}),placeholder:"麦麦的说话规则和行为风格",rows:5})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"visual_style",children:"识图规则"}),c.jsx(Wt,{id:"visual_style",value:e.visual_style,onChange:o=>t({...e,visual_style:o.target.value}),placeholder:"识图时的处理规则",rows:3})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"private_plan_style",children:"私聊规则"}),c.jsx(Wt,{id:"private_plan_style",value:e.private_plan_style,onChange:o=>t({...e,private_plan_style:o.target.value}),placeholder:"私聊的说话规则和行为风格",rows:4})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(re,{children:"状态列表(人格多样性)"}),c.jsxs(we,{onClick:n,size:"sm",variant:"outline",children:[c.jsx($n,{className:"h-4 w-4 mr-1"}),"添加状态"]})]}),c.jsx("div",{className:"space-y-2",children:e.states.map((o,l)=>c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Wt,{value:o,onChange:u=>a(l,u.target.value),placeholder:"描述一个人格状态",rows:2}),c.jsxs(Rn,{children:[c.jsx(ma,{asChild:!0,children:c.jsx(we,{size:"icon",variant:"outline",children:c.jsx(zt,{className:"h-4 w-4"})})}),c.jsxs(mn,{children:[c.jsxs(vn,{children:[c.jsx(yn,{children:"确认删除"}),c.jsx(xn,{children:"确定要删除这个人格状态吗?此操作无法撤销。"})]}),c.jsxs(gn,{children:[c.jsx(wn,{children:"取消"}),c.jsx(bn,{onClick:()=>r(l),children:"删除"})]})]})]})]},l))})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"state_probability",children:"状态替换概率"}),c.jsx(Ae,{id:"state_probability",type:"number",step:"0.1",min:"0",max:"1",value:e.state_probability,onChange:o=>t({...e,state_probability:parseFloat(o.target.value)})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"每次构建人格时替换 personality 的概率(0.0-1.0)"})]})]})]})})}function vye({config:e,onChange:t}){const n=()=>{t({...e,talk_value_rules:[...e.talk_value_rules,{target:"",time:"00:00-23:59",value:1}]})},r=u=>{t({...e,talk_value_rules:e.talk_value_rules.filter((d,h)=>h!==u)})},a=(u,d,h)=>{const p=[...e.talk_value_rules];p[u]={...p[u],[d]:h},t({...e,talk_value_rules:p})},o=({value:u,onChange:d})=>{const[h,p]=S.useState("00"),[v,g]=S.useState("00"),[y,j]=S.useState("23"),[b,w]=S.useState("59");S.useEffect(()=>{const O=u.split("-");if(O.length===2){const[N,T]=O,[E,C]=N.split(":"),[R,k]=T.split(":");E&&p(E.padStart(2,"0")),C&&g(C.padStart(2,"0")),R&&j(R.padStart(2,"0")),k&&w(k.padStart(2,"0"))}},[u]);const A=(O,N,T,E)=>{const C=`${O}:${N}-${T}:${E}`;d(C)};return c.jsxs(Nc,{children:[c.jsx(Ec,{asChild:!0,children:c.jsxs(we,{variant:"outline",className:"w-full justify-start font-mono text-sm",children:[c.jsx(ds,{className:"h-4 w-4 mr-2"}),u||"选择时间段"]})}),c.jsx(As,{className:"w-80",children:c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"font-medium text-sm mb-3",children:"开始时间"}),c.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[c.jsxs("div",{children:[c.jsx(re,{className:"text-xs",children:"小时"}),c.jsxs(dn,{value:h,onValueChange:O=>{p(O),A(O,v,y,b)},children:[c.jsx(en,{children:c.jsx(hn,{})}),c.jsx(tn,{children:Array.from({length:24},(O,N)=>N).map(O=>c.jsx(pt,{value:O.toString().padStart(2,"0"),children:O.toString().padStart(2,"0")},O))})]})]}),c.jsxs("div",{children:[c.jsx(re,{className:"text-xs",children:"分钟"}),c.jsxs(dn,{value:v,onValueChange:O=>{g(O),A(h,O,y,b)},children:[c.jsx(en,{children:c.jsx(hn,{})}),c.jsx(tn,{children:Array.from({length:60},(O,N)=>N).map(O=>c.jsx(pt,{value:O.toString().padStart(2,"0"),children:O.toString().padStart(2,"0")},O))})]})]})]})]}),c.jsxs("div",{children:[c.jsx("h4",{className:"font-medium text-sm mb-3",children:"结束时间"}),c.jsxs("div",{className:"grid grid-cols-2 gap-2 sm:gap-3",children:[c.jsxs("div",{children:[c.jsx(re,{className:"text-xs",children:"小时"}),c.jsxs(dn,{value:y,onValueChange:O=>{j(O),A(h,v,O,b)},children:[c.jsx(en,{children:c.jsx(hn,{})}),c.jsx(tn,{children:Array.from({length:24},(O,N)=>N).map(O=>c.jsx(pt,{value:O.toString().padStart(2,"0"),children:O.toString().padStart(2,"0")},O))})]})]}),c.jsxs("div",{children:[c.jsx(re,{className:"text-xs",children:"分钟"}),c.jsxs(dn,{value:b,onValueChange:O=>{w(O),A(h,v,y,O)},children:[c.jsx(en,{children:c.jsx(hn,{})}),c.jsx(tn,{children:Array.from({length:60},(O,N)=>N).map(O=>c.jsx(pt,{value:O.toString().padStart(2,"0"),children:O.toString().padStart(2,"0")},O))})]})]})]})]})]})})]})},l=({rule:u})=>{const d=`{ target = "${u.target}", time = "${u.time}", value = ${u.value.toFixed(1)} }`;return c.jsxs(Nc,{children:[c.jsx(Ec,{asChild:!0,children:c.jsxs(we,{variant:"outline",size:"sm",children:[c.jsx(Oi,{className:"h-4 w-4 mr-1"}),"预览"]})}),c.jsx(As,{className:"w-96",children:c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),c.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:d}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return c.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold mb-4",children:"聊天设置"}),c.jsxs("div",{className:"grid gap-4",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"talk_value",children:"聊天频率(基础值)"}),c.jsx(Ae,{id:"talk_value",type:"number",step:"0.1",min:"0",max:"1",value:e.talk_value,onChange:u=>t({...e,talk_value:parseFloat(u.target.value)})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"越小越沉默,范围 0-1"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"mentioned_bot_reply",children:"提及回复增幅"}),c.jsx(Ae,{id:"mentioned_bot_reply",type:"number",step:"0.1",min:"0",max:"1",value:e.mentioned_bot_reply,onChange:u=>t({...e,mentioned_bot_reply:parseFloat(u.target.value)})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"提及时回复概率增幅,1 为 100% 回复"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"max_context_size",children:"上下文长度"}),c.jsx(Ae,{id:"max_context_size",type:"number",min:"1",value:e.max_context_size,onChange:u=>t({...e,max_context_size:parseInt(u.target.value)})})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"planner_smooth",children:"规划器平滑"}),c.jsx(Ae,{id:"planner_smooth",type:"number",step:"1",min:"0",value:e.planner_smooth,onChange:u=>t({...e,planner_smooth:parseFloat(u.target.value)})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"增大数值会减小 planner 负荷,推荐 1-5,0 为关闭"})]}),c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(xt,{id:"enable_talk_value_rules",checked:e.enable_talk_value_rules,onCheckedChange:u=>t({...e,enable_talk_value_rules:u})}),c.jsx(re,{htmlFor:"enable_talk_value_rules",className:"cursor-pointer",children:"启用动态发言频率规则"})]}),c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(xt,{id:"include_planner_reasoning",checked:e.include_planner_reasoning,onCheckedChange:u=>t({...e,include_planner_reasoning:u})}),c.jsx(re,{htmlFor:"include_planner_reasoning",className:"cursor-pointer",children:"将 planner 推理加入 replyer"})]})]})]}),e.enable_talk_value_rules&&c.jsxs("div",{className:"border-t pt-6",children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"text-base font-semibold",children:"动态发言频率规则"}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"按时段或聊天流ID调整发言频率,优先匹配具体聊天,再匹配全局规则"})]}),c.jsxs(we,{onClick:n,size:"sm",children:[c.jsx($n,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),e.talk_value_rules&&e.talk_value_rules.length>0?c.jsx("div",{className:"space-y-4",children:e.talk_value_rules.map((u,d)=>c.jsxs("div",{className:"rounded-lg border p-4 bg-muted/50 space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("span",{className:"text-sm font-medium text-muted-foreground",children:["规则 #",d+1]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(l,{rule:u}),c.jsxs(Rn,{children:[c.jsx(ma,{asChild:!0,children:c.jsx(we,{variant:"ghost",size:"sm",children:c.jsx(zt,{className:"h-4 w-4 text-destructive"})})}),c.jsxs(mn,{children:[c.jsxs(vn,{children:[c.jsx(yn,{children:"确认删除"}),c.jsxs(xn,{children:["确定要删除规则 #",d+1," 吗?此操作无法撤销。"]})]}),c.jsxs(gn,{children:[c.jsx(wn,{children:"取消"}),c.jsx(bn,{onClick:()=>r(d),children:"删除"})]})]})]})]})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:`rule-target-${d}`,className:"text-xs font-medium",children:"目标聊天流 (Target)"}),c.jsx(Ae,{id:`rule-target-${d}`,placeholder:'留空=全局,或填 "platform:id:type"',value:u.target,onChange:h=>a(d,"target",h.target.value),className:"font-mono text-sm"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"示例:qq:1919810:group 或 qq:114514:private"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{className:"text-xs font-medium",children:"时间段 (Time)"}),c.jsx(o,{value:u.time,onChange:h=>a(d,"time",h)}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"支持跨夜区间,例如 23:00-02:00"})]}),c.jsxs("div",{className:"grid gap-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(re,{htmlFor:`rule-value-${d}`,className:"text-xs font-medium",children:"发言频率值 (Value)"}),c.jsx(Ae,{id:`rule-value-${d}`,type:"number",step:"0.01",min:"0",max:"1",value:u.value,onChange:h=>{const p=parseFloat(h.target.value);isNaN(p)||a(d,"value",Math.max(0,Math.min(1,p)))},className:"w-20 h-8 text-xs"})]}),c.jsx(pO,{value:[u.value],onValueChange:h=>a(d,"value",h[0]),min:0,max:1,step:.01,className:"w-full"}),c.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[c.jsx("span",{children:"0 (完全沉默)"}),c.jsx("span",{children:"0.5"}),c.jsx("span",{children:"1.0 (正常)"})]})]})]})]},d))}):c.jsx("div",{className:"text-center py-8 text-muted-foreground",children:c.jsx("p",{className:"text-sm",children:'暂无规则,点击"添加规则"按钮创建'})}),c.jsxs("div",{className:"mt-4 p-4 bg-blue-50 dark:bg-blue-950/20 border border-blue-200 dark:border-blue-800 rounded-lg",children:[c.jsx("h5",{className:"text-sm font-semibold text-blue-900 dark:text-blue-100 mb-2",children:"📝 规则说明"}),c.jsxs("ul",{className:"text-xs text-blue-800 dark:text-blue-200 space-y-1",children:[c.jsxs("li",{children:["• ",c.jsx("strong",{children:"Target 为空"}),":全局规则,对所有聊天生效"]}),c.jsxs("li",{children:["• ",c.jsx("strong",{children:"Target 指定"}),":仅对特定聊天流生效(格式:platform:id:type)"]}),c.jsxs("li",{children:["• ",c.jsx("strong",{children:"优先级"}),":先匹配具体聊天流规则,再匹配全局规则"]}),c.jsxs("li",{children:["• ",c.jsx("strong",{children:"时间支持跨夜"}),":例如 23:00-02:00 表示晚上11点到次日凌晨2点"]}),c.jsxs("li",{children:["• ",c.jsx("strong",{children:"数值范围"}),":建议 0-1,0 表示完全沉默,1 表示正常发言"]})]})]})]})]})}function gye({config:e,onChange:t}){const n=()=>{t({...e,learning_list:[...e.learning_list,["","enable","enable","1.0"]]})},r=v=>{t({...e,learning_list:e.learning_list.filter((g,y)=>y!==v)})},a=(v,g,y)=>{const j=[...e.learning_list];j[v][g]=y,t({...e,learning_list:j})},o=({rule:v})=>{const g=`["${v[0]}", "${v[1]}", "${v[2]}", "${v[3]}"]`;return c.jsxs(Nc,{children:[c.jsx(Ec,{asChild:!0,children:c.jsxs(we,{variant:"outline",size:"sm",children:[c.jsx(Oi,{className:"h-4 w-4 mr-1"}),"预览"]})}),c.jsx(As,{className:"w-96",children:c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),c.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:g}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},l=()=>{t({...e,expression_groups:[...e.expression_groups,[]]})},u=v=>{t({...e,expression_groups:e.expression_groups.filter((g,y)=>y!==v)})},d=v=>{const g=[...e.expression_groups];g[v]=[...g[v],""],t({...e,expression_groups:g})},h=(v,g)=>{const y=[...e.expression_groups];y[v]=y[v].filter((j,b)=>b!==g),t({...e,expression_groups:y})},p=(v,g,y)=>{const j=[...e.expression_groups];j[v][g]=y,t({...e,expression_groups:j})};return c.jsxs("div",{className:"space-y-6",children:[c.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold",children:"表达学习配置"}),c.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置麦麦如何学习和使用表达方式"})]}),c.jsxs(we,{onClick:n,size:"sm",variant:"outline",children:[c.jsx($n,{className:"h-4 w-4 mr-1"}),"添加规则"]})]}),c.jsxs("div",{className:"space-y-4",children:[e.learning_list.map((v,g)=>c.jsxs("div",{className:"rounded-lg border p-4 space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("span",{className:"text-sm font-medium",children:["规则 ",g+1," ",v[0]===""&&"(全局配置)"]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(o,{rule:v}),c.jsxs(Rn,{children:[c.jsx(ma,{asChild:!0,children:c.jsx(we,{size:"sm",variant:"ghost",children:c.jsx(zt,{className:"h-4 w-4"})})}),c.jsxs(mn,{children:[c.jsxs(vn,{children:[c.jsx(yn,{children:"确认删除"}),c.jsxs(xn,{children:["确定要删除学习规则 ",g+1," 吗?此操作无法撤销。"]})]}),c.jsxs(gn,{children:[c.jsx(wn,{children:"取消"}),c.jsx(bn,{onClick:()=>r(g),children:"删除"})]})]})]})]})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{className:"text-xs font-medium",children:"聊天流 ID"}),c.jsx(Ae,{value:v[0],onChange:y=>a(g,0,y.target.value),placeholder:"留空表示全局配置,例如:qq:1919810:group",className:"font-mono text-sm"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"格式:platform:id:type(group/private)"})]}),c.jsx("div",{className:"grid gap-2",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(re,{className:"text-xs font-medium",children:"使用学到的表达"}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦使用从聊天中学到的表达方式"})]}),c.jsx(xt,{checked:v[1]==="enable",onCheckedChange:y=>a(g,1,y?"enable":"disable")})]})}),c.jsx("div",{className:"grid gap-2",children:c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx(re,{className:"text-xs font-medium",children:"学习表达"}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"允许麦麦从聊天中学习新的表达方式"})]}),c.jsx(xt,{checked:v[2]==="enable",onCheckedChange:y=>a(g,2,y?"enable":"disable")})]})}),c.jsxs("div",{className:"grid gap-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(re,{className:"text-xs font-medium",children:"学习强度"}),c.jsx(Ae,{type:"number",step:"0.1",min:"0",max:"5",value:v[3],onChange:y=>{const j=parseFloat(y.target.value);isNaN(j)||a(g,3,Math.max(0,Math.min(5,j)).toFixed(1))},className:"w-20 h-8 text-xs"})]}),c.jsx(pO,{value:[parseFloat(v[3])||1],onValueChange:y=>a(g,3,y[0].toFixed(1)),min:0,max:5,step:.1,className:"w-full"}),c.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[c.jsx("span",{children:"0 (不学习)"}),c.jsx("span",{children:"2.5"}),c.jsx("span",{children:"5.0 (快速学习)"})]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"影响学习频率,最短学习间隔 = 300/学习强度(秒)"})]})]})]},g)),e.learning_list.length===0&&c.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无学习规则,点击"添加规则"开始配置'})]})]})}),c.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-4",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold",children:"表达共享组配置"}),c.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"配置不同聊天流之间如何共享学到的表达方式"})]}),c.jsxs(we,{onClick:l,size:"sm",variant:"outline",children:[c.jsx($n,{className:"h-4 w-4 mr-1"}),"添加共享组"]})]}),c.jsxs("div",{className:"space-y-4",children:[e.expression_groups.map((v,g)=>c.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("span",{className:"text-sm font-medium",children:["共享组 ",g+1,v.length===1&&v[0]==="*"&&"(全局共享)"]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(we,{onClick:()=>d(g),size:"sm",variant:"outline",children:c.jsx($n,{className:"h-4 w-4"})}),c.jsxs(Rn,{children:[c.jsx(ma,{asChild:!0,children:c.jsx(we,{size:"sm",variant:"ghost",children:c.jsx(zt,{className:"h-4 w-4"})})}),c.jsxs(mn,{children:[c.jsxs(vn,{children:[c.jsx(yn,{children:"确认删除"}),c.jsxs(xn,{children:["确定要删除共享组 ",g+1," 吗?此操作无法撤销。"]})]}),c.jsxs(gn,{children:[c.jsx(wn,{children:"取消"}),c.jsx(bn,{onClick:()=>u(g),children:"删除"})]})]})]})]})]}),c.jsx("div",{className:"space-y-2",children:v.map((y,j)=>c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Ae,{value:y,onChange:b=>p(g,j,b.target.value),placeholder:'输入 "*" 表示全局共享,或 "qq:123456:group"'}),c.jsxs(Rn,{children:[c.jsx(ma,{asChild:!0,children:c.jsx(we,{size:"icon",variant:"outline",children:c.jsx(zt,{className:"h-4 w-4"})})}),c.jsxs(mn,{children:[c.jsxs(vn,{children:[c.jsx(yn,{children:"确认删除"}),c.jsxs(xn,{children:['确定要删除组成员 "',y||"(空)",'" 吗?此操作无法撤销。']})]}),c.jsxs(gn,{children:[c.jsx(wn,{children:"取消"}),c.jsx(bn,{onClick:()=>h(g,j),children:"删除"})]})]})]})]},j))}),c.jsx("p",{className:"text-xs text-muted-foreground",children:'提示:输入 "*" 启用全局共享;或输入具体 chat_id(如 qq:114514:private)组成互通组'})]},g)),e.expression_groups.length===0&&c.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无共享组,点击"添加共享组"开始配置'})]})]})})]})}function yye({emojiConfig:e,memoryConfig:t,toolConfig:n,onEmojiChange:r,onMemoryChange:a,onToolChange:o}){return c.jsxs("div",{className:"space-y-6",children:[c.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold mb-4",children:"工具设置"}),c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(xt,{id:"enable_tool",checked:n.enable_tool,onCheckedChange:l=>o({...n,enable_tool:l})}),c.jsx(re,{htmlFor:"enable_tool",className:"cursor-pointer",children:"启用工具系统"})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"允许麦麦使用各种工具来增强功能"})]})}),c.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold mb-4",children:"记忆设置"}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"max_agent_iterations",children:"记忆思考深度"}),c.jsx(Ae,{id:"max_agent_iterations",type:"number",min:"1",value:t.max_agent_iterations,onChange:l=>a({...t,max_agent_iterations:parseInt(l.target.value)})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"最低为 1(不深入思考)"})]})]})}),c.jsx("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold mb-4",children:"表情包设置"}),c.jsxs("div",{className:"grid gap-4",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"emoji_chance",children:"表情包激活概率"}),c.jsx(Ae,{id:"emoji_chance",type:"number",step:"0.1",min:"0",max:"1",value:e.emoji_chance,onChange:l=>r({...e,emoji_chance:parseFloat(l.target.value)})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"范围 0-1,越大越容易发送表情包"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"max_reg_num",children:"最大注册数量"}),c.jsx(Ae,{id:"max_reg_num",type:"number",min:"1",value:e.max_reg_num,onChange:l=>r({...e,max_reg_num:parseInt(l.target.value)})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"麦麦最多可以注册的表情包数量"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"check_interval",children:"检查间隔(分钟)"}),c.jsx(Ae,{id:"check_interval",type:"number",min:"1",value:e.check_interval,onChange:l=>r({...e,check_interval:parseInt(l.target.value)})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"检查表情包(注册、破损、删除)的时间间隔"})]}),c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(xt,{id:"do_replace",checked:e.do_replace,onCheckedChange:l=>r({...e,do_replace:l})}),c.jsx(re,{htmlFor:"do_replace",className:"cursor-pointer",children:"达到最大数量时替换表情包"})]}),c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(xt,{id:"steal_emoji",checked:e.steal_emoji,onCheckedChange:l=>r({...e,steal_emoji:l})}),c.jsx(re,{htmlFor:"steal_emoji",className:"cursor-pointer",children:"偷取表情包"})]}),c.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"允许麦麦将看到的表情包据为己有"}),c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(xt,{id:"content_filtration",checked:e.content_filtration,onCheckedChange:l=>r({...e,content_filtration:l})}),c.jsx(re,{htmlFor:"content_filtration",className:"cursor-pointer",children:"启用表情包过滤"})]}),e.content_filtration&&c.jsxs("div",{className:"grid gap-2 pl-6 border-l-2 border-primary/20",children:[c.jsx(re,{htmlFor:"filtration_prompt",children:"过滤要求"}),c.jsx(Ae,{id:"filtration_prompt",value:e.filtration_prompt,onChange:l=>r({...e,filtration_prompt:l.target.value}),placeholder:"符合公序良俗"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"只有符合此要求的表情包才会被保存"})]})]})]})})]})}function xye({keywordReactionConfig:e,responsePostProcessConfig:t,chineseTypoConfig:n,responseSplitterConfig:r,onKeywordReactionChange:a,onResponsePostProcessChange:o,onChineseTypoChange:l,onResponseSplitterChange:u}){const d=()=>{a({...e,regex_rules:[...e.regex_rules,{regex:[""],reaction:""}]})},h=T=>{a({...e,regex_rules:e.regex_rules.filter((E,C)=>C!==T)})},p=(T,E,C)=>{const R=[...e.regex_rules];E==="regex"&&typeof C=="string"?R[T]={...R[T],regex:[C]}:E==="reaction"&&typeof C=="string"&&(R[T]={...R[T],reaction:C}),a({...e,regex_rules:R})},v=({regex:T,reaction:E,onRegexChange:C,onReactionChange:R})=>{const[k,M]=S.useState(!1),[U,$]=S.useState(""),[z,V]=S.useState(null),[F,G]=S.useState(""),[L,q]=S.useState({}),[H,ee]=S.useState(""),ve=S.useRef(null),[I,B]=S.useState("build"),Y=Q=>Q.replace(/\(\?P<([^>]+)>/g,"(?<$1>"),te=(Q,ne=0)=>{const X=ve.current;if(!X)return;const de=X.selectionStart||0,be=X.selectionEnd||0,oe=T.substring(0,de)+Q+T.substring(be);C(oe),setTimeout(()=>{const Pe=de+Q.length+ne;X.setSelectionRange(Pe,Pe),X.focus()},0)};S.useEffect(()=>{if(!T||!U){V(null),q({}),ee(E),G("");return}try{const Q=Y(T),ne=new RegExp(Q,"g"),X=U.match(ne);V(X),G("");const be=new RegExp(Q).exec(U);if(be&&be.groups){q(be.groups);let oe=E;Object.entries(be.groups).forEach(([Pe,Se])=>{oe=oe.replace(new RegExp(`\\[${Pe}\\]`,"g"),Se||"")}),ee(oe)}else q({}),ee(E)}catch(Q){G(Q.message),V(null),q({}),ee(E)}},[T,U,E]);const le=()=>{if(!U||!z||z.length===0)return c.jsx("span",{className:"text-muted-foreground",children:U||"请输入测试文本"});try{const Q=Y(T),ne=new RegExp(Q,"g");let X=0;const de=[];let be;for(;(be=ne.exec(U))!==null;)be.index>X&&de.push(c.jsx("span",{children:U.substring(X,be.index)},`text-${X}`)),de.push(c.jsx("span",{className:"bg-yellow-200 dark:bg-yellow-900 font-semibold",children:be[0]},`match-${be.index}`)),X=be.index+be[0].length;return X)",desc:"Python风格命名捕获组",moveCursor:-1},{label:"非捕获组",pattern:"(?:)",desc:"分组但不保存匹配结果",moveCursor:-1}]},{category:"字符类",items:[{label:"字符集",pattern:"[]",desc:"匹配括号内的任意字符",moveCursor:-1},{label:"排除字符",pattern:"[^]",desc:"匹配不在括号内的字符",moveCursor:-1},{label:"范围",pattern:"[a-z]",desc:"匹配a到z的字符"},{label:"中文字符",pattern:"[\\u4e00-\\u9fa5]",desc:"匹配中文汉字"}]},{category:"常用模板",items:[{label:"捕获词语",pattern:"(?P\\S+)",desc:"捕获一个词语"},{label:"捕获句子",pattern:"(?P.+)",desc:"捕获整个句子"},{label:"捕获数字",pattern:"(?P\\d+)",desc:"捕获一个或多个数字"},{label:"可选词语",pattern:"(?:词语1|词语2)",desc:"匹配多个可选项之一"}]}];return c.jsxs(kr,{open:k,onOpenChange:M,children:[c.jsx(mq,{asChild:!0,children:c.jsxs(we,{variant:"outline",size:"sm",children:[c.jsx(x5,{className:"h-4 w-4 mr-1"}),"正则编辑器"]})}),c.jsxs(sr,{className:"max-w-[95vw] sm:max-w-[900px] max-h-[90vh]",children:[c.jsxs(lr,{children:[c.jsx(cr,{children:"正则表达式编辑器"}),c.jsx(Mr,{className:"text-sm",children:"使用可视化工具构建正则表达式,并实时测试效果"})]}),c.jsx(Bn,{className:"max-h-[calc(90vh-120px)]",children:c.jsxs(Ql,{value:I,onValueChange:Q=>B(Q),className:"w-full",children:[c.jsxs(ms,{className:"grid w-full grid-cols-2",children:[c.jsx(_t,{value:"build",children:"🔧 构建器"}),c.jsx(_t,{value:"test",children:"🧪 测试器"})]}),c.jsxs(Pt,{value:"build",className:"space-y-4 mt-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{className:"text-sm font-medium",children:"正则表达式"}),c.jsx(Ae,{ref:ve,value:T,onChange:Q=>C(Q.target.value),className:"font-mono text-sm",placeholder:"点击下方按钮构建正则表达式..."})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{className:"text-sm font-medium",children:"Reaction 内容"}),c.jsx(Wt,{value:E,onChange:Q=>R(Q.target.value),placeholder:"使用 [捕获组名] 引用捕获的内容...",rows:3,className:"text-sm"})]}),c.jsxs("div",{className:"space-y-4 border-t pt-4",children:[xe.map(Q=>c.jsxs("div",{className:"space-y-2",children:[c.jsx("h5",{className:"text-xs font-semibold text-primary",children:Q.category}),c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:Q.items.map(ne=>c.jsx(we,{variant:"outline",size:"sm",className:"justify-start h-auto py-2 px-3",onClick:()=>te(ne.pattern,ne.moveCursor||0),children:c.jsxs("div",{className:"flex flex-col items-start w-full",children:[c.jsxs("div",{className:"flex items-center gap-2 w-full",children:[c.jsx("span",{className:"text-xs font-medium",children:ne.label}),c.jsx("code",{className:"ml-auto text-xs bg-muted px-1.5 py-0.5 rounded font-mono",children:ne.pattern})]}),c.jsx("span",{className:"text-xs text-muted-foreground mt-0.5",children:ne.desc})]})},ne.label))})]},Q.category)),c.jsxs("div",{className:"space-y-2 border-t pt-4",children:[c.jsx("h5",{className:"text-xs font-semibold text-primary",children:"完整示例模板"}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(we,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>C("^(?P\\S{1,20})是这样的$"),children:c.jsxs("div",{className:"flex flex-col items-start w-full",children:[c.jsxs("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:["^(?P\\S","{1,20}",")是这样的$"]}),c.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「某事物是这样的」并捕获事物名称"})]})}),c.jsx(we,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>C("(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"),children:c.jsxs("div",{className:"flex flex-col items-start w-full",children:[c.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?:[^,。.\\s]+,\\s*)?我(?:也)?[没沒]要求你\\s*(?P.+?)[.。,,]?$"}),c.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"匹配「我没要求你做某事」并捕获具体行为"})]})}),c.jsx(we,{variant:"outline",size:"sm",className:"w-full justify-start h-auto py-2 px-3",onClick:()=>C("(?P.+?)(?:是|为什么|怎么)"),children:c.jsxs("div",{className:"flex flex-col items-start w-full",children:[c.jsx("code",{className:"text-xs font-mono bg-muted px-2 py-1 rounded w-full overflow-x-auto",children:"(?P.+?)(?:是|为什么|怎么)"}),c.jsx("span",{className:"text-xs text-muted-foreground mt-1",children:"捕获问题主题词"})]})})]})]})]}),c.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[c.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 使用提示"}),c.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[c.jsx("li",{children:"点击输入框设置光标位置,然后点击按钮插入模式"}),c.jsxs("li",{children:["命名捕获组格式:",c.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"(?P<名称>模式)"})]}),c.jsxs("li",{children:["在 reaction 中使用 ",c.jsx("code",{className:"bg-blue-100 dark:bg-blue-900 px-1 rounded",children:"[名称]"})," 引用捕获的内容"]}),c.jsx("li",{children:"切换到测试器标签页验证正则表达式效果"})]})]})]}),c.jsxs(Pt,{value:"test",className:"space-y-4 mt-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{className:"text-sm font-medium",children:"当前正则表达式"}),c.jsx("div",{className:"rounded-md bg-muted p-3 font-mono text-xs break-all",children:T||"(未设置)"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{htmlFor:"test-text",className:"text-sm font-medium",children:"测试文本"}),c.jsx(Wt,{id:"test-text",value:U,onChange:Q=>$(Q.target.value),placeholder:`在此输入要测试的文本... 例如:打游戏是这样的`,className:"min-h-[100px] text-sm"})]}),F&&c.jsxs("div",{className:"rounded-md bg-destructive/10 border border-destructive/20 p-3",children:[c.jsx("p",{className:"text-sm text-destructive font-medium",children:"正则表达式错误"}),c.jsx("p",{className:"text-xs text-destructive/80 mt-1",children:F})]}),!F&&U&&c.jsxs("div",{className:"space-y-3",children:[c.jsx("div",{className:"flex items-center gap-2",children:z&&z.length>0?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"h-2 w-2 rounded-full bg-green-500"}),c.jsxs("span",{className:"text-sm font-medium text-green-600 dark:text-green-400",children:["匹配成功 (",z.length," 处)"]})]}):c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"h-2 w-2 rounded-full bg-gray-400"}),c.jsx("span",{className:"text-sm font-medium text-muted-foreground",children:"无匹配"})]})}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{className:"text-sm font-medium",children:"匹配高亮"}),c.jsx(Bn,{className:"h-40 rounded-md bg-muted p-3",children:c.jsx("div",{className:"text-sm break-words",children:le()})})]}),Object.keys(L).length>0&&c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{className:"text-sm font-medium",children:"命名捕获组"}),c.jsx(Bn,{className:"h-32 rounded-md border p-3",children:c.jsx("div",{className:"space-y-2",children:Object.entries(L).map(([Q,ne])=>c.jsxs("div",{className:"flex items-start gap-2 text-sm",children:[c.jsxs("span",{className:"font-mono font-semibold text-primary min-w-[80px]",children:["[",Q,"]"]}),c.jsx("span",{className:"text-muted-foreground",children:"="}),c.jsx("span",{className:"font-mono bg-muted px-2 py-0.5 rounded",children:ne})]},Q))})})]}),Object.keys(L).length>0&&E&&c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{className:"text-sm font-medium",children:"Reaction 替换预览"}),c.jsx(Bn,{className:"h-48 rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3",children:c.jsx("div",{className:"text-sm break-words",children:H})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"reaction 中的 [name] 已被替换为对应的捕获组值"})]})]}),c.jsxs("div",{className:"rounded-md bg-blue-50 dark:bg-blue-950/30 border border-blue-200 dark:border-blue-800 p-3 space-y-1",children:[c.jsx("p",{className:"text-xs font-medium text-blue-900 dark:text-blue-100",children:"💡 测试说明"}),c.jsxs("ul",{className:"text-xs text-blue-700 dark:text-blue-300 space-y-1 list-disc list-inside",children:[c.jsx("li",{children:"匹配的文本会以黄色背景高亮显示"}),c.jsx("li",{children:"命名捕获组的值会显示在下方列表中"}),c.jsx("li",{children:"Reaction 替换预览显示最终生成的反应内容"}),c.jsx("li",{children:"如需修改正则,切换回构建器标签页"})]})]})]})]})})]})]})},g=()=>{a({...e,keyword_rules:[...e.keyword_rules,{keywords:[],reaction:""}]})},y=T=>{a({...e,keyword_rules:e.keyword_rules.filter((E,C)=>C!==T)})},j=(T,E,C)=>{const R=[...e.keyword_rules];typeof C=="string"&&(R[T]={...R[T],reaction:C}),a({...e,keyword_rules:R})},b=T=>{const E=[...e.keyword_rules];E[T]={...E[T],keywords:[...E[T].keywords||[],""]},a({...e,keyword_rules:E})},w=(T,E)=>{const C=[...e.keyword_rules];C[T]={...C[T],keywords:(C[T].keywords||[]).filter((R,k)=>k!==E)},a({...e,keyword_rules:C})},A=(T,E,C)=>{const R=[...e.keyword_rules],k=[...R[T].keywords||[]];k[E]=C,R[T]={...R[T],keywords:k},a({...e,keyword_rules:R})},O=({rule:T})=>{const E=`{ regex = [${(T.regex||[]).map(C=>`"${C}"`).join(", ")}], reaction = "${T.reaction}" }`;return c.jsxs(Nc,{children:[c.jsx(Ec,{asChild:!0,children:c.jsxs(we,{variant:"outline",size:"sm",children:[c.jsx(Oi,{className:"h-4 w-4 mr-1"}),"预览"]})}),c.jsx(As,{className:"w-[95vw] sm:w-[500px]",children:c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),c.jsx(Bn,{className:"h-60 rounded-md bg-muted p-3",children:c.jsx("pre",{className:"font-mono text-xs break-all",children:E})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})},N=({rule:T})=>{const E=`[[keyword_reaction.keyword_rules]] keywords = [${(T.keywords||[]).map(C=>`"${C}"`).join(", ")}] reaction = "${T.reaction}"`;return c.jsxs(Nc,{children:[c.jsx(Ec,{asChild:!0,children:c.jsxs(we,{variant:"outline",size:"sm",children:[c.jsx(Oi,{className:"h-4 w-4 mr-1"}),"预览"]})}),c.jsx(As,{className:"w-[95vw] sm:w-[500px]",children:c.jsxs("div",{className:"space-y-2",children:[c.jsx("h4",{className:"font-medium text-sm",children:"配置预览"}),c.jsx(Bn,{className:"h-60 rounded-md bg-muted p-3",children:c.jsx("pre",{className:"font-mono text-xs whitespace-pre-wrap break-all",children:E})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"这是保存到 bot_config.toml 文件中的格式"})]})})]})};return c.jsxs("div",{className:"space-y-6",children:[c.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold mb-2",children:"关键词反应配置"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"配置触发特定反应的关键词和正则表达式规则"})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"text-base font-semibold",children:"正则表达式规则"}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用正则表达式匹配消息内容"})]}),c.jsxs(we,{onClick:d,size:"sm",variant:"outline",children:[c.jsx($n,{className:"h-4 w-4 mr-1"}),"添加正则规则"]})]}),c.jsxs("div",{className:"space-y-3",children:[e.regex_rules.map((T,E)=>c.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("span",{className:"text-sm font-medium",children:["正则规则 ",E+1]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(v,{regex:T.regex&&T.regex[0]||"",reaction:T.reaction,onRegexChange:C=>p(E,"regex",C),onReactionChange:C=>p(E,"reaction",C)}),c.jsx(O,{rule:T}),c.jsxs(Rn,{children:[c.jsx(ma,{asChild:!0,children:c.jsx(we,{size:"sm",variant:"ghost",children:c.jsx(zt,{className:"h-4 w-4"})})}),c.jsxs(mn,{children:[c.jsxs(vn,{children:[c.jsx(yn,{children:"确认删除"}),c.jsxs(xn,{children:["确定要删除正则规则 ",E+1," 吗?此操作无法撤销。"]})]}),c.jsxs(gn,{children:[c.jsx(wn,{children:"取消"}),c.jsx(bn,{onClick:()=>h(E),children:"删除"})]})]})]})]})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{className:"text-xs font-medium",children:"正则表达式(Python 语法)"}),c.jsx(Ae,{value:T.regex&&T.regex[0]||"",onChange:C=>p(E,"regex",C.target.value),placeholder:"例如:^(?P\\\\S{1,20})是这样的$ (点击正则编辑器按钮可视化构建)",className:"font-mono text-sm"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:'支持命名捕获组 (?Ppattern),可在 reaction 中使用 [name] 引用。点击"正则编辑器"可视化构建和测试!'})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{className:"text-xs font-medium",children:"反应内容"}),c.jsx(Wt,{value:T.reaction,onChange:C=>p(E,"reaction",C.target.value),placeholder:`触发后麦麦的反应... 可以使用 [捕获组名] 来引用正则表达式中的内容`,rows:3,className:"text-sm"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"使用 [捕获组名] 引用正则表达式中的命名捕获组,例如 [n] 会被替换为捕获的内容"})]})]})]},E)),e.regex_rules.length===0&&c.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无正则规则,点击"添加正则规则"开始配置'})]})]}),c.jsxs("div",{className:"space-y-4 border-t pt-6",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"text-base font-semibold",children:"关键词规则"}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"使用关键词列表匹配消息内容"})]}),c.jsxs(we,{onClick:g,size:"sm",variant:"outline",children:[c.jsx($n,{className:"h-4 w-4 mr-1"}),"添加关键词规则"]})]}),c.jsxs("div",{className:"space-y-3",children:[e.keyword_rules.map((T,E)=>c.jsxs("div",{className:"rounded-lg border p-4 space-y-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("span",{className:"text-sm font-medium",children:["关键词规则 ",E+1]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(N,{rule:T}),c.jsxs(Rn,{children:[c.jsx(ma,{asChild:!0,children:c.jsx(we,{size:"sm",variant:"ghost",children:c.jsx(zt,{className:"h-4 w-4"})})}),c.jsxs(mn,{children:[c.jsxs(vn,{children:[c.jsx(yn,{children:"确认删除"}),c.jsxs(xn,{children:["确定要删除关键词规则 ",E+1," 吗?此操作无法撤销。"]})]}),c.jsxs(gn,{children:[c.jsx(wn,{children:"取消"}),c.jsx(bn,{onClick:()=>y(E),children:"删除"})]})]})]})]})]}),c.jsxs("div",{className:"space-y-3",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx(re,{className:"text-xs font-medium",children:"关键词列表"}),c.jsxs(we,{onClick:()=>b(E),size:"sm",variant:"ghost",children:[c.jsx($n,{className:"h-3 w-3 mr-1"}),"添加关键词"]})]}),c.jsxs("div",{className:"space-y-2",children:[(T.keywords||[]).map((C,R)=>c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Ae,{value:C,onChange:k=>A(E,R,k.target.value),placeholder:"关键词",className:"flex-1"}),c.jsx(we,{onClick:()=>w(E,R),size:"sm",variant:"ghost",children:c.jsx(zt,{className:"h-4 w-4"})})]},R)),(!T.keywords||T.keywords.length===0)&&c.jsx("p",{className:"text-xs text-muted-foreground text-center py-2",children:'暂无关键词,点击"添加关键词"开始配置'})]})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{className:"text-xs font-medium",children:"反应内容"}),c.jsx(Wt,{value:T.reaction,onChange:C=>j(E,"reaction",C.target.value),placeholder:"触发后麦麦的反应...",rows:3,className:"text-sm"})]})]})]},E)),e.keyword_rules.length===0&&c.jsx("div",{className:"text-center py-8 text-muted-foreground",children:'暂无关键词规则,点击"添加关键词规则"开始配置'})]})]})]}),c.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold mb-4",children:"回复后处理配置"}),c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(xt,{id:"enable_response_post_process",checked:t.enable_response_post_process,onCheckedChange:T=>o({...t,enable_response_post_process:T})}),c.jsx(re,{htmlFor:"enable_response_post_process",className:"cursor-pointer",children:"启用回复后处理"})]}),c.jsx("p",{className:"text-xs text-muted-foreground mt-2",children:"包括错别字生成器和回复分割器"})]}),t.enable_response_post_process&&c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"border-t pt-6 space-y-4",children:c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[c.jsx(xt,{id:"enable_chinese_typo",checked:n.enable,onCheckedChange:T=>l({...n,enable:T})}),c.jsx(re,{htmlFor:"enable_chinese_typo",className:"cursor-pointer font-semibold",children:"中文错别字生成器"})]}),c.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"为回复添加随机错别字,让麦麦的回复更自然"}),n.enable&&c.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"error_rate",className:"text-xs font-medium",children:"单字替换概率"}),c.jsx(Ae,{id:"error_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.error_rate,onChange:T=>l({...n,error_rate:parseFloat(T.target.value)})})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"min_freq",className:"text-xs font-medium",children:"最小字频阈值"}),c.jsx(Ae,{id:"min_freq",type:"number",min:"0",value:n.min_freq,onChange:T=>l({...n,min_freq:parseInt(T.target.value)})})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"tone_error_rate",className:"text-xs font-medium",children:"声调错误概率"}),c.jsx(Ae,{id:"tone_error_rate",type:"number",step:"0.01",min:"0",max:"1",value:n.tone_error_rate,onChange:T=>l({...n,tone_error_rate:parseFloat(T.target.value)})})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"word_replace_rate",className:"text-xs font-medium",children:"整词替换概率"}),c.jsx(Ae,{id:"word_replace_rate",type:"number",step:"0.001",min:"0",max:"1",value:n.word_replace_rate,onChange:T=>l({...n,word_replace_rate:parseFloat(T.target.value)})})]})]})]})}),c.jsx("div",{className:"border-t pt-6 space-y-4",children:c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center space-x-2 mb-4",children:[c.jsx(xt,{id:"enable_response_splitter",checked:r.enable,onCheckedChange:T=>u({...r,enable:T})}),c.jsx(re,{htmlFor:"enable_response_splitter",className:"cursor-pointer font-semibold",children:"回复分割器"})]}),c.jsx("p",{className:"text-xs text-muted-foreground mb-4",children:"控制回复的长度和句子数量"}),r.enable&&c.jsxs("div",{className:"grid gap-4 pl-6 border-l-2 border-primary/20",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"max_length",className:"text-xs font-medium",children:"最大长度"}),c.jsx(Ae,{id:"max_length",type:"number",min:"1",value:r.max_length,onChange:T=>u({...r,max_length:parseInt(T.target.value)})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大字符数"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"max_sentence_num",className:"text-xs font-medium",children:"最大句子数"}),c.jsx(Ae,{id:"max_sentence_num",type:"number",min:"1",value:r.max_sentence_num,onChange:T=>u({...r,max_sentence_num:parseInt(T.target.value)})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"回复允许的最大句子数量"})]}),c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(xt,{id:"enable_kaomoji_protection",checked:r.enable_kaomoji_protection,onCheckedChange:T=>u({...r,enable_kaomoji_protection:T})}),c.jsx(re,{htmlFor:"enable_kaomoji_protection",className:"cursor-pointer",children:"启用颜文字保护"})]}),c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(xt,{id:"enable_overflow_return_all",checked:r.enable_overflow_return_all,onCheckedChange:T=>u({...r,enable_overflow_return_all:T})}),c.jsx(re,{htmlFor:"enable_overflow_return_all",className:"cursor-pointer",children:"超出时一次性返回全部"})]}),c.jsx("p",{className:"text-xs text-muted-foreground -mt-2",children:"当句子数量超出限制时,合并后一次性返回所有内容"})]})]})})]})]})]})}function bye({config:e,onChange:t}){return c.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"情绪设置"}),c.jsxs("div",{className:"grid gap-4",children:[c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(xt,{checked:e.enable_mood,onCheckedChange:n=>t({...e,enable_mood:n})}),c.jsx(re,{className:"cursor-pointer",children:"启用情绪系统"})]}),e.enable_mood&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{children:"情绪更新阈值"}),c.jsx(Ae,{type:"number",min:"1",value:e.mood_update_threshold,onChange:n=>t({...e,mood_update_threshold:parseInt(n.target.value)})}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"越高,更新越慢"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{children:"情感特征"}),c.jsx(Wt,{value:e.emotion_style,onChange:n=>t({...e,emotion_style:n.target.value}),placeholder:"影响情绪的变化情况",rows:2})]})]})]})]})}function wye({config:e,onChange:t}){return c.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"语音设置"}),c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(xt,{checked:e.enable_asr,onCheckedChange:n=>t({...e,enable_asr:n})}),c.jsx(re,{className:"cursor-pointer",children:"启用语音识别"})]}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"启用后麦麦可以识别语音消息,需要配置语音识别模型"})]})}function Sye({config:e,onChange:t}){return c.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库设置"}),c.jsxs("div",{className:"grid gap-4",children:[c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(xt,{checked:e.enable,onCheckedChange:n=>t({...e,enable:n})}),c.jsx(re,{className:"cursor-pointer",children:"启用 LPMM 知识库"})]}),e.enable&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{children:"LPMM 模式"}),c.jsxs("select",{className:"flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-base shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring",value:e.lpmm_mode,onChange:n=>t({...e,lpmm_mode:n.target.value}),children:[c.jsx("option",{value:"classic",children:"经典模式"}),c.jsx("option",{value:"agent",children:"Agent 模式"})]})]}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{children:"同义词搜索 TopK"}),c.jsx(Ae,{type:"number",min:"1",value:e.rag_synonym_search_top_k,onChange:n=>t({...e,rag_synonym_search_top_k:parseInt(n.target.value)})})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{children:"同义词阈值"}),c.jsx(Ae,{type:"number",step:"0.1",min:"0",max:"1",value:e.rag_synonym_threshold,onChange:n=>t({...e,rag_synonym_threshold:parseFloat(n.target.value)})})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{children:"实体提取线程数"}),c.jsx(Ae,{type:"number",min:"1",value:e.info_extraction_workers,onChange:n=>t({...e,info_extraction_workers:parseInt(n.target.value)})})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{children:"嵌入向量维度"}),c.jsx(Ae,{type:"number",min:"1",value:e.embedding_dimension,onChange:n=>t({...e,embedding_dimension:parseInt(n.target.value)})})]})]})]})]})]})}function jye({config:e,onChange:t}){const[n,r]=S.useState(""),[a,o]=S.useState("WARNING"),l=()=>{n&&!e.suppress_libraries.includes(n)&&(t({...e,suppress_libraries:[...e.suppress_libraries,n]}),r(""))},u=y=>{t({...e,suppress_libraries:e.suppress_libraries.filter(j=>j!==y)})},d=()=>{n&&!e.library_log_levels[n]&&(t({...e,library_log_levels:{...e.library_log_levels,[n]:a}}),r(""),o("WARNING"))},h=y=>{const j={...e.library_log_levels};delete j[y],t({...e,library_log_levels:j})},p=["DEBUG","INFO","WARNING","ERROR","CRITICAL"],v=["FULL","compact","lite"],g=["none","title","full"];return c.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-6",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold mb-4",children:"日志配置"}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{children:"日期格式"}),c.jsx(Ae,{value:e.date_style,onChange:y=>t({...e,date_style:y.target.value}),placeholder:"例如: m-d H:i:s"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"m=月, d=日, H=时, i=分, s=秒"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{children:"日志级别样式"}),c.jsxs(dn,{value:e.log_level_style,onValueChange:y=>t({...e,log_level_style:y}),children:[c.jsx(en,{children:c.jsx(hn,{})}),c.jsx(tn,{children:v.map(y=>c.jsx(pt,{value:y,children:y},y))})]})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{children:"日志文本颜色"}),c.jsxs(dn,{value:e.color_text,onValueChange:y=>t({...e,color_text:y}),children:[c.jsx(en,{children:c.jsx(hn,{})}),c.jsx(tn,{children:g.map(y=>c.jsx(pt,{value:y,children:y},y))})]})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{children:"全局日志级别"}),c.jsxs(dn,{value:e.log_level,onValueChange:y=>t({...e,log_level:y}),children:[c.jsx(en,{children:c.jsx(hn,{})}),c.jsx(tn,{children:p.map(y=>c.jsx(pt,{value:y,children:y},y))})]})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{children:"控制台日志级别"}),c.jsxs(dn,{value:e.console_log_level,onValueChange:y=>t({...e,console_log_level:y}),children:[c.jsx(en,{children:c.jsx(hn,{})}),c.jsx(tn,{children:p.map(y=>c.jsx(pt,{value:y,children:y},y))})]})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{children:"文件日志级别"}),c.jsxs(dn,{value:e.file_log_level,onValueChange:y=>t({...e,file_log_level:y}),children:[c.jsx(en,{children:c.jsx(hn,{})}),c.jsx(tn,{children:p.map(y=>c.jsx(pt,{value:y,children:y},y))})]})]})]})]}),c.jsxs("div",{children:[c.jsx(re,{className:"mb-2 block",children:"完全屏蔽的库"}),c.jsxs("div",{className:"flex gap-2 mb-2",children:[c.jsx(Ae,{value:n,onChange:y=>r(y.target.value),placeholder:"输入库名",className:"flex-1",onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),l())}}),c.jsx(we,{onClick:l,size:"sm",className:"flex-shrink-0",children:c.jsx($n,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),c.jsx("div",{className:"flex flex-wrap gap-2",children:e.suppress_libraries.map(y=>c.jsxs("div",{className:"flex items-center gap-1 bg-secondary px-3 py-1 rounded-md",children:[c.jsx("span",{className:"text-sm",children:y}),c.jsx(we,{variant:"ghost",size:"sm",className:"h-5 w-5 p-0",onClick:()=>u(y),children:c.jsx(zt,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},y))})]}),c.jsxs("div",{children:[c.jsx(re,{className:"mb-2 block",children:"特定库的日志级别"}),c.jsxs("div",{className:"flex gap-2 mb-2",children:[c.jsx(Ae,{value:n,onChange:y=>r(y.target.value),placeholder:"输入库名",className:"flex-1"}),c.jsxs(dn,{value:a,onValueChange:o,children:[c.jsx(en,{className:"w-32",children:c.jsx(hn,{})}),c.jsx(tn,{children:p.map(y=>c.jsx(pt,{value:y,children:y},y))})]}),c.jsx(we,{onClick:d,size:"sm",children:c.jsx($n,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),c.jsx("div",{className:"space-y-2",children:Object.entries(e.library_log_levels).map(([y,j])=>c.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[c.jsx("span",{className:"text-sm font-medium",children:y}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"text-sm text-muted-foreground",children:j}),c.jsx(we,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>h(y),children:c.jsx(zt,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]})]},y))})]})]})}function _ye({config:e,onChange:t}){return c.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"调试配置"}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"space-y-0.5",children:[c.jsx(re,{children:"显示 Prompt"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"是否在日志中显示提示词"})]}),c.jsx(xt,{checked:e.show_prompt,onCheckedChange:n=>t({...e,show_prompt:n})})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"space-y-0.5",children:[c.jsx(re,{children:"显示回复器 Prompt"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的提示词"})]}),c.jsx(xt,{checked:e.show_replyer_prompt,onCheckedChange:n=>t({...e,show_replyer_prompt:n})})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"space-y-0.5",children:[c.jsx(re,{children:"显示回复器推理"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示回复器的推理过程"})]}),c.jsx(xt,{checked:e.show_replyer_reasoning,onCheckedChange:n=>t({...e,show_replyer_reasoning:n})})]}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"space-y-0.5",children:[c.jsx(re,{children:"显示 Jargon Prompt"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"是否显示术语相关的提示词"})]}),c.jsx(xt,{checked:e.show_jargon_prompt,onCheckedChange:n=>t({...e,show_jargon_prompt:n})})]})]})]})}function Aye({config:e,onChange:t}){const[n,r]=S.useState(""),a=()=>{n&&!e.auth_token.includes(n)&&(t({...e,auth_token:[...e.auth_token,n]}),r(""))},o=l=>{t({...e,auth_token:e.auth_token.filter((u,d)=>d!==l)})};return c.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-6",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"text-lg font-semibold mb-4",children:"MaimMessage 服务配置"}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"space-y-0.5",children:[c.jsx(re,{children:"启用自定义服务器"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"是否使用自定义的 MaimMessage 服务器"})]}),c.jsx(xt,{checked:e.use_custom,onCheckedChange:l=>t({...e,use_custom:l})})]}),e.use_custom&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{children:"主机地址"}),c.jsx(Ae,{value:e.host,onChange:l=>t({...e,host:l.target.value}),placeholder:"127.0.0.1"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{children:"端口号"}),c.jsx(Ae,{type:"number",value:e.port,onChange:l=>t({...e,port:parseInt(l.target.value)}),placeholder:"8090"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{children:"连接模式"}),c.jsxs(dn,{value:e.mode,onValueChange:l=>t({...e,mode:l}),children:[c.jsx(en,{children:c.jsx(hn,{})}),c.jsxs(tn,{children:[c.jsx(pt,{value:"ws",children:"WebSocket (ws)"}),c.jsx(pt,{value:"tcp",children:"TCP"})]})]})]}),c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(xt,{checked:e.use_wss,onCheckedChange:l=>t({...e,use_wss:l}),disabled:e.mode!=="ws"}),c.jsx(re,{children:"使用 WSS 安全连接"})]})]}),e.use_wss&&e.mode==="ws"&&c.jsxs("div",{className:"grid gap-4",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{children:"SSL 证书文件路径"}),c.jsx(Ae,{value:e.cert_file,onChange:l=>t({...e,cert_file:l.target.value}),placeholder:"cert.pem"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{children:"SSL 密钥文件路径"}),c.jsx(Ae,{value:e.key_file,onChange:l=>t({...e,key_file:l.target.value}),placeholder:"key.pem"})]})]})]})]})]}),c.jsxs("div",{children:[c.jsx(re,{className:"mb-2 block",children:"认证令牌"}),c.jsx("p",{className:"text-sm text-muted-foreground mb-2",children:"用于 API 验证,为空则不启用验证"}),c.jsxs("div",{className:"flex gap-2 mb-2",children:[c.jsx(Ae,{value:n,onChange:l=>r(l.target.value),placeholder:"输入认证令牌",onKeyDown:l=>{l.key==="Enter"&&(l.preventDefault(),a())}}),c.jsx(we,{onClick:a,size:"sm",children:c.jsx($n,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]}),c.jsx("div",{className:"space-y-2",children:e.auth_token.map((l,u)=>c.jsxs("div",{className:"flex items-center justify-between bg-secondary px-3 py-2 rounded-md",children:[c.jsx("span",{className:"text-sm font-mono",children:l}),c.jsx(we,{variant:"ghost",size:"sm",className:"h-6 w-6 p-0",onClick:()=>o(u),children:c.jsx(zt,{className:"h-3 w-3",strokeWidth:2,fill:"none"})})]},u))})]})]})}function Oye({config:e,onChange:t}){return c.jsxs("div",{className:"rounded-lg border bg-card p-6 space-y-4",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"统计信息"}),c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsxs("div",{className:"space-y-0.5",children:[c.jsx(re,{children:"启用统计信息发送"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"发送匿名统计信息,帮助我们了解全球有多少只麦麦在运行"})]}),c.jsx(xt,{checked:e.enable,onCheckedChange:n=>t({...e,enable:n})})]})]})}const Gc=S.forwardRef(({className:e,...t},n)=>c.jsx("div",{className:"relative w-full overflow-auto",children:c.jsx("table",{ref:n,className:je("w-full caption-bottom text-sm",e),...t})}));Gc.displayName="Table";const Kc=S.forwardRef(({className:e,...t},n)=>c.jsx("thead",{ref:n,className:je("[&_tr]:border-b",e),...t}));Kc.displayName="TableHeader";const Wc=S.forwardRef(({className:e,...t},n)=>c.jsx("tbody",{ref:n,className:je("[&_tr:last-child]:border-0",e),...t}));Wc.displayName="TableBody";const Nye=S.forwardRef(({className:e,...t},n)=>c.jsx("tfoot",{ref:n,className:je("border-t bg-muted/50 font-medium [&>tr]:last:border-b-0",e),...t}));Nye.displayName="TableFooter";const pn=S.forwardRef(({className:e,...t},n)=>c.jsx("tr",{ref:n,className:je("border-b transition-colors hover:bg-muted/50 data-[state=selected]:bg-muted",e),...t}));pn.displayName="TableRow";const et=S.forwardRef(({className:e,...t},n)=>c.jsx("th",{ref:n,className:je("h-12 px-4 text-left align-middle font-medium text-muted-foreground [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));et.displayName="TableHead";const He=S.forwardRef(({className:e,...t},n)=>c.jsx("td",{ref:n,className:je("px-4 py-3 align-middle [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",e),...t}));He.displayName="TableCell";const Eye=S.forwardRef(({className:e,...t},n)=>c.jsx("caption",{ref:n,className:je("mt-4 text-sm text-muted-foreground",e),...t}));Eye.displayName="TableCaption";var wg="Checkbox",[Tye]=Rr(wg),[Cye,NO]=Tye(wg);function Rye(e){const{__scopeCheckbox:t,checked:n,children:r,defaultChecked:a,disabled:o,form:l,name:u,onCheckedChange:d,required:h,value:p="on",internal_do_not_use_render:v}=e,[g,y]=za({prop:n,defaultProp:a??!1,onChange:d,caller:wg}),[j,b]=S.useState(null),[w,A]=S.useState(null),O=S.useRef(!1),N=j?!!l||!!j.closest("form"):!0,T={checked:g,disabled:o,setChecked:y,control:j,setControl:b,name:u,form:l,value:p,hasConsumerStoppedPropagationRef:O,required:h,defaultChecked:go(a)?!1:a,isFormControl:N,bubbleInput:w,setBubbleInput:A};return c.jsx(Cye,{scope:t,...T,children:Pye(v)?v(T):r})}var b8="CheckboxTrigger",w8=S.forwardRef(({__scopeCheckbox:e,onKeyDown:t,onClick:n,...r},a)=>{const{control:o,value:l,disabled:u,checked:d,required:h,setControl:p,setChecked:v,hasConsumerStoppedPropagationRef:g,isFormControl:y,bubbleInput:j}=NO(b8,e),b=Fe(a,p),w=S.useRef(d);return S.useEffect(()=>{const A=o?.form;if(A){const O=()=>v(w.current);return A.addEventListener("reset",O),()=>A.removeEventListener("reset",O)}},[o,v]),c.jsx(De.button,{type:"button",role:"checkbox","aria-checked":go(d)?"mixed":d,"aria-required":h,"data-state":O8(d),"data-disabled":u?"":void 0,disabled:u,value:l,...r,ref:b,onKeyDown:Oe(t,A=>{A.key==="Enter"&&A.preventDefault()}),onClick:Oe(n,A=>{v(O=>go(O)?!0:!O),j&&y&&(g.current=A.isPropagationStopped(),g.current||A.stopPropagation())})})});w8.displayName=b8;var EO=S.forwardRef((e,t)=>{const{__scopeCheckbox:n,name:r,checked:a,defaultChecked:o,required:l,disabled:u,value:d,onCheckedChange:h,form:p,...v}=e;return c.jsx(Rye,{__scopeCheckbox:n,checked:a,defaultChecked:o,disabled:u,required:l,onCheckedChange:h,name:r,form:p,value:d,internal_do_not_use_render:({isFormControl:g})=>c.jsxs(c.Fragment,{children:[c.jsx(w8,{...v,ref:t,__scopeCheckbox:n}),g&&c.jsx(A8,{__scopeCheckbox:n})]})})});EO.displayName=wg;var S8="CheckboxIndicator",j8=S.forwardRef((e,t)=>{const{__scopeCheckbox:n,forceMount:r,...a}=e,o=NO(S8,n);return c.jsx(Pr,{present:r||go(o.checked)||o.checked===!0,children:c.jsx(De.span,{"data-state":O8(o.checked),"data-disabled":o.disabled?"":void 0,...a,ref:t,style:{pointerEvents:"none",...e.style}})})});j8.displayName=S8;var _8="CheckboxBubbleInput",A8=S.forwardRef(({__scopeCheckbox:e,...t},n)=>{const{control:r,hasConsumerStoppedPropagationRef:a,checked:o,defaultChecked:l,required:u,disabled:d,name:h,value:p,form:v,bubbleInput:g,setBubbleInput:y}=NO(_8,e),j=Fe(n,y),b=ng(o),w=rg(r);S.useEffect(()=>{const O=g;if(!O)return;const N=window.HTMLInputElement.prototype,E=Object.getOwnPropertyDescriptor(N,"checked").set,C=!a.current;if(b!==o&&E){const R=new Event("click",{bubbles:C});O.indeterminate=go(o),E.call(O,go(o)?!1:o),O.dispatchEvent(R)}},[g,b,o,a]);const A=S.useRef(go(o)?!1:o);return c.jsx(De.input,{type:"checkbox","aria-hidden":!0,defaultChecked:l??A.current,required:u,disabled:d,name:h,value:p,form:v,...t,tabIndex:-1,ref:j,style:{...t.style,...w,position:"absolute",pointerEvents:"none",opacity:0,margin:0,transform:"translateX(-100%)"}})});A8.displayName=_8;function Pye(e){return typeof e=="function"}function go(e){return e==="indeterminate"}function O8(e){return go(e)?"indeterminate":e?"checked":"unchecked"}const dd=S.forwardRef(({className:e,...t},n)=>c.jsx(EO,{ref:n,className:je("grid place-content-center peer h-4 w-4 shrink-0 rounded-sm border border-primary shadow focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",e),...t,children:c.jsx(j8,{className:je("grid place-content-center text-current"),children:c.jsx(Fl,{className:"h-4 w-4"})})}));dd.displayName=EO.displayName;function kye(){const[e,t]=S.useState([]),[n,r]=S.useState(!0),[a,o]=S.useState(!1),[l,u]=S.useState(!1),[d,h]=S.useState(!1),[p,v]=S.useState(!1),[g,y]=S.useState(null),[j,b]=S.useState(null),[w,A]=S.useState(!1),[O,N]=S.useState(null),[T,E]=S.useState(!1),[C,R]=S.useState(""),[k,M]=S.useState(new Set),[U,$]=S.useState(!1),{toast:z}=na(),V=S.useRef(null),F=S.useRef(!0);S.useEffect(()=>{G()},[]);const G=async()=>{try{r(!0);const ne=await av();t(ne.api_providers||[]),h(!1),F.current=!1}catch(ne){console.error("加载配置失败:",ne)}finally{r(!1)}},L=S.useCallback(async ne=>{if(!F.current)try{u(!0),await x_("api_providers",ne),h(!1)}catch(X){console.error("自动保存失败:",X),h(!0)}finally{u(!1)}},[]);S.useEffect(()=>{if(!F.current)return h(!0),V.current&&clearTimeout(V.current),V.current=setTimeout(()=>{L(e)},2e3),()=>{V.current&&clearTimeout(V.current)}},[e,L]);const q=async()=>{try{o(!0),V.current&&clearTimeout(V.current);const ne=await av();ne.api_providers=e,await x8(ne),h(!1),z({title:"保存成功",description:"模型提供商配置已保存"})}catch(ne){console.error("保存配置失败:",ne),z({title:"保存失败",description:ne.message,variant:"destructive"})}finally{o(!1)}},H=(ne,X)=>{y(ne||{name:"",base_url:"",api_key:"",client_type:"openai",max_retry:2,timeout:30,retry_interval:10}),b(X),E(!1),v(!0)},ee=async()=>{if(g?.api_key)try{await navigator.clipboard.writeText(g.api_key),z({title:"复制成功",description:"API Key 已复制到剪贴板"})}catch{z({title:"复制失败",description:"无法访问剪贴板",variant:"destructive"})}},ve=()=>{if(g){if(j!==null){const ne=[...e];ne[j]=g,t(ne)}else t([...e,g]);v(!1),y(null),b(null)}},I=ne=>{N(ne),A(!0)},B=()=>{if(O!==null){const ne=e.filter((X,de)=>de!==O);t(ne),z({title:"删除成功",description:"提供商已从列表中移除"})}A(!1),N(null)},Y=ne=>{const X=new Set(k);X.has(ne)?X.delete(ne):X.add(ne),M(X)},te=()=>{if(k.size===Q.length)M(new Set);else{const ne=Q.map((X,de)=>e.findIndex(be=>be===Q[de]));M(new Set(ne))}},le=()=>{if(k.size===0){z({title:"提示",description:"请先选择要删除的提供商",variant:"default"});return}$(!0)},xe=()=>{const ne=e.filter((X,de)=>!k.has(de));t(ne),M(new Set),$(!1),z({title:"批量删除成功",description:`已删除 ${k.size} 个提供商`})},Q=e.filter(ne=>{if(!C)return!0;const X=C.toLowerCase();return ne.name.toLowerCase().includes(X)||ne.base_url.toLowerCase().includes(X)||ne.client_type.toLowerCase().includes(X)});return n?c.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:c.jsx("div",{className:"flex items-center justify-center h-64",children:c.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):c.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型提供商配置"}),c.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理 API 提供商配置"})]}),c.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[k.size>0&&c.jsxs(we,{onClick:le,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[c.jsx(zt,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",k.size,")"]}),c.jsxs(we,{onClick:()=>H(null,null),size:"sm",className:"w-full sm:w-auto",children:[c.jsx($n,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加提供商"]}),c.jsxs(we,{onClick:q,disabled:a||l||!d,size:"sm",variant:"default",className:"w-full sm:w-auto",children:[c.jsx(XA,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),a?"保存中...":l?"自动保存中...":d?"保存配置":"已保存"]})]})]}),c.jsxs(Bn,{className:"h-[calc(100vh-260px)]",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2 mb-4",children:[c.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[c.jsx(Ms,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),c.jsx(Ae,{placeholder:"搜索提供商名称、URL 或类型...",value:C,onChange:ne=>R(ne.target.value),className:"pl-9"})]}),C&&c.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",Q.length," 个结果"]})]}),c.jsx("div",{className:"md:hidden space-y-3",children:Q.length===0?c.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:C?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'}):Q.map((ne,X)=>c.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsx("h3",{className:"font-semibold text-base truncate",children:ne.name}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1 break-all",children:ne.base_url})]}),c.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[c.jsx(we,{variant:"ghost",size:"sm",onClick:()=>H(ne,X),children:c.jsx(Xm,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),c.jsx(we,{variant:"ghost",size:"sm",onClick:()=>I(X),children:c.jsx(zt,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground text-xs",children:"客户端类型"}),c.jsx("p",{className:"font-medium",children:ne.client_type})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground text-xs",children:"最大重试"}),c.jsx("p",{className:"font-medium",children:ne.max_retry})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground text-xs",children:"超时(秒)"}),c.jsx("p",{className:"font-medium",children:ne.timeout})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground text-xs",children:"重试间隔(秒)"}),c.jsx("p",{className:"font-medium",children:ne.retry_interval})]})]})]},X))}),c.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:c.jsxs(Gc,{children:[c.jsx(Kc,{children:c.jsxs(pn,{children:[c.jsx(et,{className:"w-12",children:c.jsx(dd,{checked:k.size===Q.length&&Q.length>0,onCheckedChange:te})}),c.jsx(et,{children:"名称"}),c.jsx(et,{children:"基础URL"}),c.jsx(et,{children:"客户端类型"}),c.jsx(et,{className:"text-right",children:"最大重试"}),c.jsx(et,{className:"text-right",children:"超时(秒)"}),c.jsx(et,{className:"text-right",children:"重试间隔(秒)"}),c.jsx(et,{className:"text-right",children:"操作"})]})}),c.jsx(Wc,{children:Q.length===0?c.jsx(pn,{children:c.jsx(He,{colSpan:8,className:"text-center text-muted-foreground py-8",children:C?"未找到匹配的提供商":'暂无提供商配置,点击"添加提供商"开始配置'})}):Q.map((ne,X)=>{const de=e.findIndex(be=>be===ne);return c.jsxs(pn,{children:[c.jsx(He,{children:c.jsx(dd,{checked:k.has(de),onCheckedChange:()=>Y(de)})}),c.jsx(He,{className:"font-medium",children:ne.name}),c.jsx(He,{className:"max-w-xs truncate",title:ne.base_url,children:ne.base_url}),c.jsx(He,{children:ne.client_type}),c.jsx(He,{className:"text-right",children:ne.max_retry}),c.jsx(He,{className:"text-right",children:ne.timeout}),c.jsx(He,{className:"text-right",children:ne.retry_interval}),c.jsx(He,{className:"text-right",children:c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx(we,{variant:"ghost",size:"sm",onClick:()=>H(ne,de),children:c.jsx(Xm,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),c.jsx(we,{variant:"ghost",size:"sm",onClick:()=>I(de),children:c.jsx(zt,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})})]},X)})})]})})]}),c.jsx(kr,{open:p,onOpenChange:v,children:c.jsxs(sr,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[c.jsxs(lr,{children:[c.jsx(cr,{children:j!==null?"编辑提供商":"添加提供商"}),c.jsx(Mr,{children:"配置 API 提供商的连接信息和参数"})]}),c.jsxs("div",{className:"grid gap-4 py-4",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"name",children:"名称 *"}),c.jsx(Ae,{id:"name",value:g?.name||"",onChange:ne=>y(X=>X?{...X,name:ne.target.value}:null),placeholder:"例如: DeepSeek, SiliconFlow"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"base_url",children:"基础 URL *"}),c.jsx(Ae,{id:"base_url",value:g?.base_url||"",onChange:ne=>y(X=>X?{...X,base_url:ne.target.value}:null),placeholder:"https://api.example.com/v1"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"api_key",children:"API Key *"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(Ae,{id:"api_key",type:T?"text":"password",value:g?.api_key||"",onChange:ne=>y(X=>X?{...X,api_key:ne.target.value}:null),placeholder:"sk-...",className:"flex-1"}),c.jsx(we,{type:"button",variant:"outline",size:"icon",onClick:()=>E(!T),title:T?"隐藏密钥":"显示密钥",children:T?c.jsx(a_,{className:"h-4 w-4"}):c.jsx(Oi,{className:"h-4 w-4"})}),c.jsx(we,{type:"button",variant:"outline",size:"icon",onClick:ee,title:"复制密钥",children:c.jsx(r_,{className:"h-4 w-4"})})]})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"client_type",children:"客户端类型"}),c.jsxs(dn,{value:g?.client_type||"openai",onValueChange:ne=>y(X=>X?{...X,client_type:ne}:null),children:[c.jsx(en,{id:"client_type",children:c.jsx(hn,{placeholder:"选择客户端类型"})}),c.jsxs(tn,{children:[c.jsx(pt,{value:"openai",children:"OpenAI"}),c.jsx(pt,{value:"gemini",children:"Gemini"})]})]})]}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"max_retry",children:"最大重试"}),c.jsx(Ae,{id:"max_retry",type:"number",min:"0",value:g?.max_retry||2,onChange:ne=>y(X=>X?{...X,max_retry:parseInt(ne.target.value)}:null)})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"timeout",children:"超时(秒)"}),c.jsx(Ae,{id:"timeout",type:"number",min:"1",value:g?.timeout||30,onChange:ne=>y(X=>X?{...X,timeout:parseInt(ne.target.value)}:null)})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"retry_interval",children:"重试间隔(秒)"}),c.jsx(Ae,{id:"retry_interval",type:"number",min:"1",value:g?.retry_interval||10,onChange:ne=>y(X=>X?{...X,retry_interval:parseInt(ne.target.value)}:null)})]})]})]}),c.jsxs(Sa,{children:[c.jsx(we,{variant:"outline",onClick:()=>v(!1),children:"取消"}),c.jsx(we,{onClick:ve,children:"保存"})]})]})}),c.jsx(Rn,{open:w,onOpenChange:A,children:c.jsxs(mn,{children:[c.jsxs(vn,{children:[c.jsx(yn,{children:"确认删除"}),c.jsxs(xn,{children:['确定要删除提供商 "',O!==null?e[O]?.name:"",'" 吗? 此操作无法撤销。']})]}),c.jsxs(gn,{children:[c.jsx(wn,{children:"取消"}),c.jsx(bn,{onClick:B,children:"删除"})]})]})}),c.jsx(Rn,{open:U,onOpenChange:$,children:c.jsxs(mn,{children:[c.jsxs(vn,{children:[c.jsx(yn,{children:"确认批量删除"}),c.jsxs(xn,{children:["确定要删除选中的 ",k.size," 个提供商吗? 此操作无法撤销。"]})]}),c.jsxs(gn,{children:[c.jsx(wn,{children:"取消"}),c.jsx(bn,{onClick:xe,className:"bg-destructive hover:bg-destructive/90",children:"批量删除"})]})]})})]})}const Mye=tg("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function ha({className:e,variant:t,...n}){return c.jsx("div",{className:je(Mye({variant:t}),e),...n})}var s$=1,Dye=.9,Lye=.8,$ye=.17,x1=.1,b1=.999,Iye=.9999,zye=.99,Bye=/[\\\/_+.#"@\[\(\{&]/,qye=/[\\\/_+.#"@\[\(\{&]/g,Uye=/[\s-]/,N8=/[\s-]/g;function b_(e,t,n,r,a,o,l){if(o===t.length)return a===e.length?s$:zye;var u=`${a},${o}`;if(l[u]!==void 0)return l[u];for(var d=r.charAt(o),h=n.indexOf(d,a),p=0,v,g,y,j;h>=0;)v=b_(e,t,n,r,h+1,o+1,l),v>p&&(h===a?v*=s$:Bye.test(e.charAt(h-1))?(v*=Lye,y=e.slice(a,h-1).match(qye),y&&a>0&&(v*=Math.pow(b1,y.length))):Uye.test(e.charAt(h-1))?(v*=Dye,j=e.slice(a,h-1).match(N8),j&&a>0&&(v*=Math.pow(b1,j.length))):(v*=$ye,a>0&&(v*=Math.pow(b1,h-a))),e.charAt(h)!==t.charAt(o)&&(v*=Iye)),(vv&&(v=g*x1)),v>p&&(p=v),h=n.indexOf(d,h+1);return l[u]=p,p}function l$(e){return e.toLowerCase().replace(N8," ")}function Fye(e,t,n){return e=n&&n.length>0?`${e+" "+n.join(" ")}`:e,b_(e,t,l$(e),l$(t),0,0,{})}var Hye=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],Eo=Hye.reduce((e,t)=>{const n=JA(`Primitive.${t}`),r=S.forwardRef((a,o)=>{const{asChild:l,...u}=a,d=l?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),c.jsx(d,{...u,ref:o})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{}),cf='[cmdk-group=""]',w1='[cmdk-group-items=""]',Vye='[cmdk-group-heading=""]',E8='[cmdk-item=""]',c$=`${E8}:not([aria-disabled="true"])`,w_="cmdk-item-select",kl="data-value",Gye=(e,t,n)=>Fye(e,t,n),T8=S.createContext(void 0),Md=()=>S.useContext(T8),C8=S.createContext(void 0),TO=()=>S.useContext(C8),R8=S.createContext(void 0),P8=S.forwardRef((e,t)=>{let n=Ml(()=>{var B,Y;return{search:"",value:(Y=(B=e.value)!=null?B:e.defaultValue)!=null?Y:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),r=Ml(()=>new Set),a=Ml(()=>new Map),o=Ml(()=>new Map),l=Ml(()=>new Set),u=k8(e),{label:d,children:h,value:p,onValueChange:v,filter:g,shouldFilter:y,loop:j,disablePointerSelection:b=!1,vimBindings:w=!0,...A}=e,O=Vn(),N=Vn(),T=Vn(),E=S.useRef(null),C=rxe();Os(()=>{if(p!==void 0){let B=p.trim();n.current.value=B,R.emit()}},[p]),Os(()=>{C(6,V)},[]);let R=S.useMemo(()=>({subscribe:B=>(l.current.add(B),()=>l.current.delete(B)),snapshot:()=>n.current,setState:(B,Y,te)=>{var le,xe,Q,ne;if(!Object.is(n.current[B],Y)){if(n.current[B]=Y,B==="search")z(),U(),C(1,$);else if(B==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let X=document.getElementById(T);X?X.focus():(le=document.getElementById(O))==null||le.focus()}if(C(7,()=>{var X;n.current.selectedItemId=(X=F())==null?void 0:X.id,R.emit()}),te||C(5,V),((xe=u.current)==null?void 0:xe.value)!==void 0){let X=Y??"";(ne=(Q=u.current).onValueChange)==null||ne.call(Q,X);return}}R.emit()}},emit:()=>{l.current.forEach(B=>B())}}),[]),k=S.useMemo(()=>({value:(B,Y,te)=>{var le;Y!==((le=o.current.get(B))==null?void 0:le.value)&&(o.current.set(B,{value:Y,keywords:te}),n.current.filtered.items.set(B,M(Y,te)),C(2,()=>{U(),R.emit()}))},item:(B,Y)=>(r.current.add(B),Y&&(a.current.has(Y)?a.current.get(Y).add(B):a.current.set(Y,new Set([B]))),C(3,()=>{z(),U(),n.current.value||$(),R.emit()}),()=>{o.current.delete(B),r.current.delete(B),n.current.filtered.items.delete(B);let te=F();C(4,()=>{z(),te?.getAttribute("id")===B&&$(),R.emit()})}),group:B=>(a.current.has(B)||a.current.set(B,new Set),()=>{o.current.delete(B),a.current.delete(B)}),filter:()=>u.current.shouldFilter,label:d||e["aria-label"],getDisablePointerSelection:()=>u.current.disablePointerSelection,listId:O,inputId:T,labelId:N,listInnerRef:E}),[]);function M(B,Y){var te,le;let xe=(le=(te=u.current)==null?void 0:te.filter)!=null?le:Gye;return B?xe(B,n.current.search,Y):0}function U(){if(!n.current.search||u.current.shouldFilter===!1)return;let B=n.current.filtered.items,Y=[];n.current.filtered.groups.forEach(le=>{let xe=a.current.get(le),Q=0;xe.forEach(ne=>{let X=B.get(ne);Q=Math.max(X,Q)}),Y.push([le,Q])});let te=E.current;G().sort((le,xe)=>{var Q,ne;let X=le.getAttribute("id"),de=xe.getAttribute("id");return((Q=B.get(de))!=null?Q:0)-((ne=B.get(X))!=null?ne:0)}).forEach(le=>{let xe=le.closest(w1);xe?xe.appendChild(le.parentElement===xe?le:le.closest(`${w1} > *`)):te.appendChild(le.parentElement===te?le:le.closest(`${w1} > *`))}),Y.sort((le,xe)=>xe[1]-le[1]).forEach(le=>{var xe;let Q=(xe=E.current)==null?void 0:xe.querySelector(`${cf}[${kl}="${encodeURIComponent(le[0])}"]`);Q?.parentElement.appendChild(Q)})}function $(){let B=G().find(te=>te.getAttribute("aria-disabled")!=="true"),Y=B?.getAttribute(kl);R.setState("value",Y||void 0)}function z(){var B,Y,te,le;if(!n.current.search||u.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let xe=0;for(let Q of r.current){let ne=(Y=(B=o.current.get(Q))==null?void 0:B.value)!=null?Y:"",X=(le=(te=o.current.get(Q))==null?void 0:te.keywords)!=null?le:[],de=M(ne,X);n.current.filtered.items.set(Q,de),de>0&&xe++}for(let[Q,ne]of a.current)for(let X of ne)if(n.current.filtered.items.get(X)>0){n.current.filtered.groups.add(Q);break}n.current.filtered.count=xe}function V(){var B,Y,te;let le=F();le&&(((B=le.parentElement)==null?void 0:B.firstChild)===le&&((te=(Y=le.closest(cf))==null?void 0:Y.querySelector(Vye))==null||te.scrollIntoView({block:"nearest"})),le.scrollIntoView({block:"nearest"}))}function F(){var B;return(B=E.current)==null?void 0:B.querySelector(`${E8}[aria-selected="true"]`)}function G(){var B;return Array.from(((B=E.current)==null?void 0:B.querySelectorAll(c$))||[])}function L(B){let Y=G()[B];Y&&R.setState("value",Y.getAttribute(kl))}function q(B){var Y;let te=F(),le=G(),xe=le.findIndex(ne=>ne===te),Q=le[xe+B];(Y=u.current)!=null&&Y.loop&&(Q=xe+B<0?le[le.length-1]:xe+B===le.length?le[0]:le[xe+B]),Q&&R.setState("value",Q.getAttribute(kl))}function H(B){let Y=F(),te=Y?.closest(cf),le;for(;te&&!le;)te=B>0?txe(te,cf):nxe(te,cf),le=te?.querySelector(c$);le?R.setState("value",le.getAttribute(kl)):q(B)}let ee=()=>L(G().length-1),ve=B=>{B.preventDefault(),B.metaKey?ee():B.altKey?H(1):q(1)},I=B=>{B.preventDefault(),B.metaKey?L(0):B.altKey?H(-1):q(-1)};return S.createElement(Eo.div,{ref:t,tabIndex:-1,...A,"cmdk-root":"",onKeyDown:B=>{var Y;(Y=A.onKeyDown)==null||Y.call(A,B);let te=B.nativeEvent.isComposing||B.keyCode===229;if(!(B.defaultPrevented||te))switch(B.key){case"n":case"j":{w&&B.ctrlKey&&ve(B);break}case"ArrowDown":{ve(B);break}case"p":case"k":{w&&B.ctrlKey&&I(B);break}case"ArrowUp":{I(B);break}case"Home":{B.preventDefault(),L(0);break}case"End":{B.preventDefault(),ee();break}case"Enter":{B.preventDefault();let le=F();if(le){let xe=new Event(w_);le.dispatchEvent(xe)}}}}},S.createElement("label",{"cmdk-label":"",htmlFor:k.inputId,id:k.labelId,style:ixe},d),Sg(e,B=>S.createElement(C8.Provider,{value:R},S.createElement(T8.Provider,{value:k},B))))}),Kye=S.forwardRef((e,t)=>{var n,r;let a=Vn(),o=S.useRef(null),l=S.useContext(R8),u=Md(),d=k8(e),h=(r=(n=d.current)==null?void 0:n.forceMount)!=null?r:l?.forceMount;Os(()=>{if(!h)return u.item(a,l?.id)},[h]);let p=M8(a,o,[e.value,e.children,o],e.keywords),v=TO(),g=bo(C=>C.value&&C.value===p.current),y=bo(C=>h||u.filter()===!1?!0:C.search?C.filtered.items.get(a)>0:!0);S.useEffect(()=>{let C=o.current;if(!(!C||e.disabled))return C.addEventListener(w_,j),()=>C.removeEventListener(w_,j)},[y,e.onSelect,e.disabled]);function j(){var C,R;b(),(R=(C=d.current).onSelect)==null||R.call(C,p.current)}function b(){v.setState("value",p.current,!0)}if(!y)return null;let{disabled:w,value:A,onSelect:O,forceMount:N,keywords:T,...E}=e;return S.createElement(Eo.div,{ref:Qr(o,t),...E,id:a,"cmdk-item":"",role:"option","aria-disabled":!!w,"aria-selected":!!g,"data-disabled":!!w,"data-selected":!!g,onPointerMove:w||u.getDisablePointerSelection()?void 0:b,onClick:w?void 0:j},e.children)}),Wye=S.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:a,...o}=e,l=Vn(),u=S.useRef(null),d=S.useRef(null),h=Vn(),p=Md(),v=bo(y=>a||p.filter()===!1?!0:y.search?y.filtered.groups.has(l):!0);Os(()=>p.group(l),[]),M8(l,u,[e.value,e.heading,d]);let g=S.useMemo(()=>({id:l,forceMount:a}),[a]);return S.createElement(Eo.div,{ref:Qr(u,t),...o,"cmdk-group":"",role:"presentation",hidden:v?void 0:!0},n&&S.createElement("div",{ref:d,"cmdk-group-heading":"","aria-hidden":!0,id:h},n),Sg(e,y=>S.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?h:void 0},S.createElement(R8.Provider,{value:g},y))))}),Yye=S.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,a=S.useRef(null),o=bo(l=>!l.search);return!n&&!o?null:S.createElement(Eo.div,{ref:Qr(a,t),...r,"cmdk-separator":"",role:"separator"})}),Xye=S.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,a=e.value!=null,o=TO(),l=bo(h=>h.search),u=bo(h=>h.selectedItemId),d=Md();return S.useEffect(()=>{e.value!=null&&o.setState("search",e.value)},[e.value]),S.createElement(Eo.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":d.listId,"aria-labelledby":d.labelId,"aria-activedescendant":u,id:d.inputId,type:"text",value:a?e.value:l,onChange:h=>{a||o.setState("search",h.target.value),n?.(h.target.value)}})}),Zye=S.forwardRef((e,t)=>{let{children:n,label:r="Suggestions",...a}=e,o=S.useRef(null),l=S.useRef(null),u=bo(h=>h.selectedItemId),d=Md();return S.useEffect(()=>{if(l.current&&o.current){let h=l.current,p=o.current,v,g=new ResizeObserver(()=>{v=requestAnimationFrame(()=>{let y=h.offsetHeight;p.style.setProperty("--cmdk-list-height",y.toFixed(1)+"px")})});return g.observe(h),()=>{cancelAnimationFrame(v),g.unobserve(h)}}},[]),S.createElement(Eo.div,{ref:Qr(o,t),...a,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":u,"aria-label":r,id:d.listId},Sg(e,h=>S.createElement("div",{ref:Qr(l,d.listInnerRef),"cmdk-list-sizer":""},h)))}),Qye=S.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:a,contentClassName:o,container:l,...u}=e;return S.createElement(lO,{open:n,onOpenChange:r},S.createElement(cO,{container:l},S.createElement(cg,{"cmdk-overlay":"",className:a}),S.createElement(ug,{"aria-label":e.label,"cmdk-dialog":"",className:o},S.createElement(P8,{ref:t,...u}))))}),Jye=S.forwardRef((e,t)=>bo(n=>n.filtered.count===0)?S.createElement(Eo.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null),exe=S.forwardRef((e,t)=>{let{progress:n,children:r,label:a="Loading...",...o}=e;return S.createElement(Eo.div,{ref:t,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":a},Sg(e,l=>S.createElement("div",{"aria-hidden":!0},l)))}),ur=Object.assign(P8,{List:Zye,Item:Kye,Input:Xye,Group:Wye,Separator:Yye,Dialog:Qye,Empty:Jye,Loading:exe});function txe(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function nxe(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function k8(e){let t=S.useRef(e);return Os(()=>{t.current=e}),t}var Os=typeof window>"u"?S.useEffect:S.useLayoutEffect;function Ml(e){let t=S.useRef();return t.current===void 0&&(t.current=e()),t}function bo(e){let t=TO(),n=()=>e(t.snapshot());return S.useSyncExternalStore(t.subscribe,n,n)}function M8(e,t,n,r=[]){let a=S.useRef(),o=Md();return Os(()=>{var l;let u=(()=>{var h;for(let p of n){if(typeof p=="string")return p.trim();if(typeof p=="object"&&"current"in p)return p.current?(h=p.current.textContent)==null?void 0:h.trim():a.current}})(),d=r.map(h=>h.trim());o.value(e,u,d),(l=t.current)==null||l.setAttribute(kl,u),a.current=u}),a}var rxe=()=>{let[e,t]=S.useState(),n=Ml(()=>new Map);return Os(()=>{n.current.forEach(r=>r()),n.current=new Map},[e]),(r,a)=>{n.current.set(r,a),t({})}};function axe(e){let t=e.type;return typeof t=="function"?t(e.props):"render"in t?t.render(e.props):e}function Sg({asChild:e,children:t},n){return e&&S.isValidElement(t)?S.cloneElement(axe(t),{ref:t.ref},n(t.props.children)):n(t)}var ixe={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const D8=S.forwardRef(({className:e,...t},n)=>c.jsx(ur,{ref:n,className:je("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...t}));D8.displayName=ur.displayName;const L8=S.forwardRef(({className:e,...t},n)=>c.jsxs("div",{className:"flex items-center border-b px-3","cmdk-input-wrapper":"",children:[c.jsx(Ms,{className:"mr-2 h-4 w-4 shrink-0 opacity-50"}),c.jsx(ur.Input,{ref:n,className:je("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...t})]}));L8.displayName=ur.Input.displayName;const $8=S.forwardRef(({className:e,...t},n)=>c.jsx(ur.List,{ref:n,className:je("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...t}));$8.displayName=ur.List.displayName;const I8=S.forwardRef((e,t)=>c.jsx(ur.Empty,{ref:t,className:"py-6 text-center text-sm",...e}));I8.displayName=ur.Empty.displayName;const z8=S.forwardRef(({className:e,...t},n)=>c.jsx(ur.Group,{ref:n,className:je("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...t}));z8.displayName=ur.Group.displayName;const oxe=S.forwardRef(({className:e,...t},n)=>c.jsx(ur.Separator,{ref:n,className:je("-mx-1 h-px bg-border",e),...t}));oxe.displayName=ur.Separator.displayName;const B8=S.forwardRef(({className:e,...t},n)=>c.jsx(ur.Item,{ref:n,className:je("relative flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...t}));B8.displayName=ur.Item.displayName;function sxe({options:e,selected:t,onChange:n,placeholder:r="选择选项...",emptyText:a="未找到选项",className:o}){const[l,u]=S.useState(!1),d=p=>{t.includes(p)?n(t.filter(v=>v!==p)):n([...t,p])},h=p=>{n(t.filter(v=>v!==p))};return c.jsxs(Nc,{open:l,onOpenChange:u,children:[c.jsx(Ec,{asChild:!0,children:c.jsxs(we,{variant:"outline",role:"combobox","aria-expanded":l,className:je("w-full justify-between min-h-10 h-auto",o),children:[c.jsx("div",{className:"flex gap-1 flex-wrap flex-1",children:t.length===0?c.jsx("span",{className:"text-muted-foreground",children:r}):t.map(p=>{const v=e.find(g=>g.value===p);return c.jsxs(ha,{variant:"secondary",className:"cursor-pointer hover:bg-secondary/80",onClick:g=>{g.stopPropagation(),h(p)},children:[v?.label||p,c.jsx(QA,{className:"ml-1 h-3 w-3",strokeWidth:2,fill:"none"})]},p)})}),c.jsx(ede,{className:"ml-2 h-4 w-4 shrink-0 opacity-50",strokeWidth:2,fill:"none"})]})}),c.jsx(As,{className:"w-full p-0",align:"start",children:c.jsxs(D8,{children:[c.jsx(L8,{placeholder:"搜索...",className:"h-9"}),c.jsxs($8,{children:[c.jsx(I8,{children:a}),c.jsx(z8,{children:e.map(p=>{const v=t.includes(p.value);return c.jsxs(B8,{value:p.value,onSelect:()=>d(p.value),children:[c.jsx("div",{className:je("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",v?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:c.jsx(Fl,{className:"h-3 w-3",strokeWidth:2,fill:"none"})}),c.jsx("span",{children:p.label})]},p.value)})})]})]})})]})}function lxe(){const[e,t]=S.useState([]),[n,r]=S.useState([]),[a,o]=S.useState([]),[l,u]=S.useState(null),[d,h]=S.useState(!0),[p,v]=S.useState(!1),[g,y]=S.useState(!1),[j,b]=S.useState(!1),[w,A]=S.useState(!1),[O,N]=S.useState(null),[T,E]=S.useState(null),[C,R]=S.useState(!1),[k,M]=S.useState(null),[U,$]=S.useState(""),[z,V]=S.useState(new Set),[F,G]=S.useState(!1),{toast:L}=na(),q=S.useRef(null),H=S.useRef(null),ee=S.useRef(!0);S.useEffect(()=>{ve()},[]);const ve=async()=>{try{h(!0);const fe=await av(),he=fe.models||[];t(he),o(he.map(Ot=>Ot.name));const $e=fe.api_providers||[];r($e.map(Ot=>Ot.name)),u(fe.model_task_config||null),b(!1),ee.current=!1}catch(fe){console.error("加载配置失败:",fe)}finally{h(!1)}},I=S.useCallback(async fe=>{if(!ee.current)try{y(!0),await x_("models",fe),b(!1)}catch(he){console.error("自动保存模型列表失败:",he),b(!0)}finally{y(!1)}},[]),B=S.useCallback(async fe=>{if(!ee.current)try{y(!0),await x_("model_task_config",fe),b(!1)}catch(he){console.error("自动保存任务配置失败:",he),b(!0)}finally{y(!1)}},[]);S.useEffect(()=>{if(!ee.current)return b(!0),q.current&&clearTimeout(q.current),q.current=setTimeout(()=>{I(e)},2e3),()=>{q.current&&clearTimeout(q.current)}},[e,I]),S.useEffect(()=>{if(!(ee.current||!l))return b(!0),H.current&&clearTimeout(H.current),H.current=setTimeout(()=>{B(l)},2e3),()=>{H.current&&clearTimeout(H.current)}},[l,B]);const Y=async()=>{try{v(!0),q.current&&clearTimeout(q.current),H.current&&clearTimeout(H.current);const fe=await av();fe.models=e,fe.model_task_config=l,await x8(fe),b(!1),L({title:"保存成功",description:"模型配置已保存"}),await ve()}catch(fe){console.error("保存配置失败:",fe),L({title:"保存失败",description:fe.message,variant:"destructive"})}finally{v(!1)}},te=(fe,he)=>{N(fe||{model_identifier:"",name:"",api_provider:n[0]||"",price_in:0,price_out:0,force_stream_mode:!1,extra_params:{}}),E(he),A(!0)},le=()=>{if(O){if(T!==null){const fe=[...e];fe[T]=O,t(fe)}else t([...e,O]);A(!1),N(null),E(null)}},xe=fe=>{M(fe),R(!0)},Q=()=>{if(k!==null){const fe=e.filter((he,$e)=>$e!==k);t(fe),L({title:"删除成功",description:"模型已从列表中移除"})}R(!1),M(null)},ne=fe=>{const he=new Set(z);he.has(fe)?he.delete(fe):he.add(fe),V(he)},X=()=>{if(z.size===Pe.length)V(new Set);else{const fe=Pe.map((he,$e)=>e.findIndex(Ot=>Ot===Pe[$e]));V(new Set(fe))}},de=()=>{if(z.size===0){L({title:"提示",description:"请先选择要删除的模型",variant:"default"});return}G(!0)},be=()=>{const fe=e.filter((he,$e)=>!z.has($e));t(fe),V(new Set),G(!1),L({title:"批量删除成功",description:`已删除 ${z.size} 个模型`})},oe=(fe,he,$e)=>{l&&u({...l,[fe]:{...l[fe],[he]:$e}})},Pe=e.filter(fe=>{if(!U)return!0;const he=U.toLowerCase();return fe.name.toLowerCase().includes(he)||fe.model_identifier.toLowerCase().includes(he)||fe.api_provider.toLowerCase().includes(he)}),Se=fe=>l?[l.utils?.model_list||[],l.utils_small?.model_list||[],l.tool_use?.model_list||[],l.replyer?.model_list||[],l.planner?.model_list||[],l.vlm?.model_list||[],l.voice?.model_list||[],l.embedding?.model_list||[],l.lpmm_entity_extract?.model_list||[],l.lpmm_rdf_build?.model_list||[],l.lpmm_qa?.model_list||[]].some($e=>$e.includes(fe)):!1;return d?c.jsx("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:c.jsx("div",{className:"flex items-center justify-center h-64",children:c.jsx("p",{className:"text-muted-foreground",children:"加载中..."})})}):c.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"模型配置"}),c.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理模型和任务配置"})]}),c.jsxs(we,{onClick:Y,disabled:p||g||!j,size:"sm",className:"w-full sm:w-auto",children:[c.jsx(XA,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),p?"保存中...":g?"自动保存中...":j?"保存配置":"已保存"]})]}),c.jsxs(Ql,{defaultValue:"models",className:"w-full",children:[c.jsxs(ms,{className:"grid w-full max-w-full sm:max-w-md grid-cols-2",children:[c.jsx(_t,{value:"models",children:"模型配置"}),c.jsx(_t,{value:"tasks",children:"模型任务配置"})]}),c.jsxs(Bn,{className:"h-[calc(100vh-320px)]",children:[c.jsxs(Pt,{value:"models",className:"space-y-4 mt-0",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-2",children:[c.jsx("p",{className:"text-sm text-muted-foreground",children:"配置可用的模型列表"}),c.jsxs("div",{className:"flex gap-2 w-full sm:w-auto",children:[z.size>0&&c.jsxs(we,{onClick:de,size:"sm",variant:"destructive",className:"w-full sm:w-auto",children:[c.jsx(zt,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"批量删除 (",z.size,")"]}),c.jsxs(we,{onClick:()=>te(null,null),size:"sm",variant:"outline",className:"w-full sm:w-auto",children:[c.jsx($n,{className:"mr-2 h-4 w-4",strokeWidth:2,fill:"none"}),"添加模型"]})]})]}),c.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center gap-2",children:[c.jsxs("div",{className:"relative w-full sm:flex-1 sm:max-w-sm",children:[c.jsx(Ms,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),c.jsx(Ae,{placeholder:"搜索模型名称、标识符或提供商...",value:U,onChange:fe=>$(fe.target.value),className:"pl-9"})]}),U&&c.jsxs("p",{className:"text-sm text-muted-foreground whitespace-nowrap",children:["找到 ",Pe.length," 个结果"]})]}),c.jsx("div",{className:"md:hidden space-y-3",children:Pe.length===0?c.jsx("div",{className:"text-center text-muted-foreground py-8 rounded-lg border bg-card",children:U?"未找到匹配的模型":"暂无模型配置"}):Pe.map((fe,he)=>{const $e=Se(fe.name);return c.jsxs("div",{className:"rounded-lg border bg-card p-4 space-y-3",children:[c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx("h3",{className:"font-semibold text-base",children:fe.name}),c.jsx(ha,{variant:$e?"default":"secondary",className:$e?"bg-green-600 hover:bg-green-700":"",children:$e?"已使用":"未使用"})]}),c.jsx("p",{className:"text-xs text-muted-foreground break-all",title:fe.model_identifier,children:fe.model_identifier})]}),c.jsxs("div",{className:"flex gap-1 flex-shrink-0",children:[c.jsx(we,{variant:"ghost",size:"sm",onClick:()=>te(fe,he),children:c.jsx(Xm,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),c.jsx(we,{variant:"ghost",size:"sm",onClick:()=>xe(he),children:c.jsx(zt,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-2 text-sm",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground text-xs",children:"提供商"}),c.jsx("p",{className:"font-medium",children:fe.api_provider})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground text-xs",children:"强制流式"}),c.jsx("p",{className:"font-medium",children:fe.force_stream_mode?"是":"否"})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground text-xs",children:"输入价格"}),c.jsxs("p",{className:"font-medium",children:["¥",fe.price_in,"/M"]})]}),c.jsxs("div",{children:[c.jsx("span",{className:"text-muted-foreground text-xs",children:"输出价格"}),c.jsxs("p",{className:"font-medium",children:["¥",fe.price_out,"/M"]})]})]})]},he)})}),c.jsx("div",{className:"hidden md:block rounded-lg border bg-card overflow-hidden",children:c.jsxs(Gc,{children:[c.jsx(Kc,{children:c.jsxs(pn,{children:[c.jsx(et,{className:"w-12",children:c.jsx(dd,{checked:z.size===Pe.length&&Pe.length>0,onCheckedChange:X})}),c.jsx(et,{className:"w-24",children:"使用状态"}),c.jsx(et,{children:"模型名称"}),c.jsx(et,{children:"模型标识符"}),c.jsx(et,{children:"提供商"}),c.jsx(et,{className:"text-right",children:"输入价格"}),c.jsx(et,{className:"text-right",children:"输出价格"}),c.jsx(et,{className:"text-center",children:"强制流式"}),c.jsx(et,{className:"text-right",children:"操作"})]})}),c.jsx(Wc,{children:Pe.length===0?c.jsx(pn,{children:c.jsx(He,{colSpan:9,className:"text-center text-muted-foreground py-8",children:U?"未找到匹配的模型":"暂无模型配置"})}):Pe.map((fe,he)=>{const $e=e.findIndex(_n=>_n===fe),Ot=Se(fe.name);return c.jsxs(pn,{children:[c.jsx(He,{children:c.jsx(dd,{checked:z.has($e),onCheckedChange:()=>ne($e)})}),c.jsx(He,{children:c.jsx(ha,{variant:Ot?"default":"secondary",className:Ot?"bg-green-600 hover:bg-green-700":"",children:Ot?"已使用":"未使用"})}),c.jsx(He,{className:"font-medium",children:fe.name}),c.jsx(He,{className:"max-w-xs truncate",title:fe.model_identifier,children:fe.model_identifier}),c.jsx(He,{children:fe.api_provider}),c.jsxs(He,{className:"text-right",children:["¥",fe.price_in,"/M"]}),c.jsxs(He,{className:"text-right",children:["¥",fe.price_out,"/M"]}),c.jsx(He,{className:"text-center",children:fe.force_stream_mode?"是":"否"}),c.jsx(He,{className:"text-right",children:c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx(we,{variant:"ghost",size:"sm",onClick:()=>te(fe,$e),children:c.jsx(Xm,{className:"h-4 w-4",strokeWidth:2,fill:"none"})}),c.jsx(we,{variant:"ghost",size:"sm",onClick:()=>xe($e),children:c.jsx(zt,{className:"h-4 w-4",strokeWidth:2,fill:"none"})})]})})]},he)})})]})})]}),c.jsxs(Pt,{value:"tasks",className:"space-y-6 mt-0",children:[c.jsx("p",{className:"text-sm text-muted-foreground",children:"为不同的任务配置使用的模型和参数"}),l&&c.jsxs("div",{className:"grid gap-4 sm:gap-6",children:[c.jsx(la,{title:"组件模型 (utils)",description:"用于表情包、取名、关系、情绪变化等组件",taskConfig:l.utils,modelNames:a,onChange:(fe,he)=>oe("utils",fe,he)}),c.jsx(la,{title:"组件小模型 (utils_small)",description:"消耗量较大的组件,建议使用速度较快的小模型",taskConfig:l.utils_small,modelNames:a,onChange:(fe,he)=>oe("utils_small",fe,he)}),c.jsx(la,{title:"工具调用模型 (tool_use)",description:"需要使用支持工具调用的模型",taskConfig:l.tool_use,modelNames:a,onChange:(fe,he)=>oe("tool_use",fe,he)}),c.jsx(la,{title:"首要回复模型 (replyer)",description:"用于表达器和表达方式学习",taskConfig:l.replyer,modelNames:a,onChange:(fe,he)=>oe("replyer",fe,he)}),c.jsx(la,{title:"决策模型 (planner)",description:"负责决定麦麦该什么时候回复",taskConfig:l.planner,modelNames:a,onChange:(fe,he)=>oe("planner",fe,he)}),c.jsx(la,{title:"图像识别模型 (vlm)",description:"视觉语言模型",taskConfig:l.vlm,modelNames:a,onChange:(fe,he)=>oe("vlm",fe,he),hideTemperature:!0}),c.jsx(la,{title:"语音识别模型 (voice)",description:"语音转文字",taskConfig:l.voice,modelNames:a,onChange:(fe,he)=>oe("voice",fe,he),hideTemperature:!0,hideMaxTokens:!0}),c.jsx(la,{title:"嵌入模型 (embedding)",description:"用于向量化",taskConfig:l.embedding,modelNames:a,onChange:(fe,he)=>oe("embedding",fe,he),hideTemperature:!0,hideMaxTokens:!0}),c.jsxs("div",{className:"space-y-4",children:[c.jsx("h3",{className:"text-lg font-semibold",children:"LPMM 知识库模型"}),c.jsx(la,{title:"实体提取模型 (lpmm_entity_extract)",description:"从文本中提取实体",taskConfig:l.lpmm_entity_extract,modelNames:a,onChange:(fe,he)=>oe("lpmm_entity_extract",fe,he)}),c.jsx(la,{title:"RDF 构建模型 (lpmm_rdf_build)",description:"构建知识图谱",taskConfig:l.lpmm_rdf_build,modelNames:a,onChange:(fe,he)=>oe("lpmm_rdf_build",fe,he)}),c.jsx(la,{title:"问答模型 (lpmm_qa)",description:"知识库问答",taskConfig:l.lpmm_qa,modelNames:a,onChange:(fe,he)=>oe("lpmm_qa",fe,he)})]})]})]})]})]}),c.jsx(kr,{open:w,onOpenChange:A,children:c.jsxs(sr,{className:"max-w-[95vw] sm:max-w-2xl max-h-[90vh] overflow-y-auto",children:[c.jsxs(lr,{children:[c.jsx(cr,{children:T!==null?"编辑模型":"添加模型"}),c.jsx(Mr,{children:"配置模型的基本信息和参数"})]}),c.jsxs("div",{className:"grid gap-4 py-4",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"model_name",children:"模型名称 *"}),c.jsx(Ae,{id:"model_name",value:O?.name||"",onChange:fe=>N(he=>he?{...he,name:fe.target.value}:null),placeholder:"例如: qwen3-30b"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"用于在任务配置中引用此模型"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"model_identifier",children:"模型标识符 *"}),c.jsx(Ae,{id:"model_identifier",value:O?.model_identifier||"",onChange:fe=>N(he=>he?{...he,model_identifier:fe.target.value}:null),placeholder:"Qwen/Qwen3-30B-A3B-Instruct-2507"}),c.jsx("p",{className:"text-xs text-muted-foreground",children:"API 提供商提供的模型 ID"})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"api_provider",children:"API 提供商 *"}),c.jsxs(dn,{value:O?.api_provider||"",onValueChange:fe=>N(he=>he?{...he,api_provider:fe}:null),children:[c.jsx(en,{id:"api_provider",children:c.jsx(hn,{placeholder:"选择提供商"})}),c.jsx(tn,{children:n.map(fe=>c.jsx(pt,{value:fe,children:fe},fe))})]})]}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"price_in",children:"输入价格 (¥/M token)"}),c.jsx(Ae,{id:"price_in",type:"number",step:"0.1",min:"0",value:O?.price_in||0,onChange:fe=>N(he=>he?{...he,price_in:parseFloat(fe.target.value)}:null)})]}),c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{htmlFor:"price_out",children:"输出价格 (¥/M token)"}),c.jsx(Ae,{id:"price_out",type:"number",step:"0.1",min:"0",value:O?.price_out||0,onChange:fe=>N(he=>he?{...he,price_out:parseFloat(fe.target.value)}:null)})]})]}),c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx(xt,{id:"force_stream_mode",checked:O?.force_stream_mode||!1,onCheckedChange:fe=>N(he=>he?{...he,force_stream_mode:fe}:null)}),c.jsx(re,{htmlFor:"force_stream_mode",className:"cursor-pointer",children:"强制流式输出模式"})]})]}),c.jsxs(Sa,{children:[c.jsx(we,{variant:"outline",onClick:()=>A(!1),children:"取消"}),c.jsx(we,{onClick:le,children:"保存"})]})]})}),c.jsx(Rn,{open:C,onOpenChange:R,children:c.jsxs(mn,{children:[c.jsxs(vn,{children:[c.jsx(yn,{children:"确认删除"}),c.jsxs(xn,{children:['确定要删除模型 "',k!==null?e[k]?.name:"",'" 吗? 此操作无法撤销。']})]}),c.jsxs(gn,{children:[c.jsx(wn,{children:"取消"}),c.jsx(bn,{onClick:Q,children:"删除"})]})]})}),c.jsx(Rn,{open:F,onOpenChange:G,children:c.jsxs(mn,{children:[c.jsxs(vn,{children:[c.jsx(yn,{children:"确认批量删除"}),c.jsxs(xn,{children:["确定要删除选中的 ",z.size," 个模型吗? 此操作无法撤销。"]})]}),c.jsxs(gn,{children:[c.jsx(wn,{children:"取消"}),c.jsx(bn,{onClick:be,className:"bg-destructive hover:bg-destructive/90",children:"批量删除"})]})]})})]})}function la({title:e,description:t,taskConfig:n,modelNames:r,onChange:a,hideTemperature:o=!1,hideMaxTokens:l=!1}){const u=d=>{a("model_list",d)};return c.jsxs("div",{className:"rounded-lg border bg-card p-4 sm:p-6 space-y-4",children:[c.jsxs("div",{children:[c.jsx("h4",{className:"font-semibold text-base sm:text-lg",children:e}),c.jsx("p",{className:"text-xs sm:text-sm text-muted-foreground mt-1",children:t})]}),c.jsxs("div",{className:"grid gap-4",children:[c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{children:"模型列表"}),c.jsx(sxe,{options:r.map(d=>({label:d,value:d})),selected:n.model_list||[],onChange:u,placeholder:"选择模型...",emptyText:"暂无可用模型"})]}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[!o&&c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{children:"温度"}),c.jsx(Ae,{type:"number",step:"0.1",min:"0",max:"2",value:n.temperature||.3,onChange:d=>a("temperature",parseFloat(d.target.value))})]}),!l&&c.jsxs("div",{className:"grid gap-2",children:[c.jsx(re,{children:"最大 Token"}),c.jsx(Ae,{type:"number",step:"1",min:"1",value:n.max_tokens||1024,onChange:d=>a("max_tokens",parseInt(d.target.value))})]})]})]})]})}const Ds="/api/webui/emoji";function Ls(){return{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("access-token")}`}}async function cxe(e){const t=new URLSearchParams;e.page&&t.append("page",e.page.toString()),e.page_size&&t.append("page_size",e.page_size.toString()),e.search&&t.append("search",e.search),e.is_registered!==void 0&&t.append("is_registered",e.is_registered.toString()),e.is_banned!==void 0&&t.append("is_banned",e.is_banned.toString()),e.format&&t.append("format",e.format),e.sort_by&&t.append("sort_by",e.sort_by),e.sort_order&&t.append("sort_order",e.sort_order);const n=await fetch(`${Ds}/list?${t}`,{headers:Ls()});if(!n.ok)throw new Error(`获取表情包列表失败: ${n.statusText}`);return n.json()}async function uxe(e){const t=await fetch(`${Ds}/${e}`,{headers:Ls()});if(!t.ok)throw new Error(`获取表情包详情失败: ${t.statusText}`);return t.json()}async function fxe(e,t){const n=await fetch(`${Ds}/${e}`,{method:"PATCH",headers:Ls(),body:JSON.stringify(t)});if(!n.ok)throw new Error(`更新表情包失败: ${n.statusText}`);return n.json()}async function dxe(e){const t=await fetch(`${Ds}/${e}`,{method:"DELETE",headers:Ls()});if(!t.ok)throw new Error(`删除表情包失败: ${t.statusText}`);return t.json()}async function hxe(){const e=await fetch(`${Ds}/stats/summary`,{headers:Ls()});if(!e.ok)throw new Error(`获取统计数据失败: ${e.statusText}`);return e.json()}async function pxe(e){const t=await fetch(`${Ds}/${e}/register`,{method:"POST",headers:Ls()});if(!t.ok)throw new Error(`注册表情包失败: ${t.statusText}`);return t.json()}async function mxe(e){const t=await fetch(`${Ds}/${e}/ban`,{method:"POST",headers:Ls()});if(!t.ok)throw new Error(`封禁表情包失败: ${t.statusText}`);return t.json()}function vxe(){const[e,t]=S.useState([]),[n,r]=S.useState(null),[a,o]=S.useState(!1),[l,u]=S.useState(1),[d,h]=S.useState(0),[p]=S.useState(20),[v,g]=S.useState(""),[y,j]=S.useState("all"),[b,w]=S.useState("all"),[A,O]=S.useState("all"),[N,T]=S.useState(null),[E,C]=S.useState(!1),[R,k]=S.useState(!1),[M,U]=S.useState(!1),{toast:$}=na(),z=S.useCallback(async()=>{try{o(!0);const I=await cxe({page:l,page_size:p,search:v||void 0,is_registered:y==="all"?void 0:y==="registered",is_banned:b==="all"?void 0:b==="banned",format:A==="all"?void 0:A,sort_by:"usage_count",sort_order:"desc"});t(I.data),h(I.total)}catch(I){const B=I instanceof Error?I.message:"加载表情包列表失败";$({title:"错误",description:B,variant:"destructive"})}finally{o(!1)}},[l,p,v,y,b,A,$]),V=async()=>{try{const I=await hxe();r(I.data)}catch(I){console.error("加载统计数据失败:",I)}};S.useEffect(()=>{z()},[z]),S.useEffect(()=>{V()},[]);const F=async I=>{try{const B=await uxe(I.id);T(B.data),C(!0)}catch(B){const Y=B instanceof Error?B.message:"加载详情失败";$({title:"错误",description:Y,variant:"destructive"})}},G=I=>{T(I),k(!0)},L=I=>{T(I),U(!0)},q=async()=>{if(N)try{await dxe(N.id),$({title:"成功",description:"表情包已删除"}),U(!1),T(null),z(),V()}catch(I){const B=I instanceof Error?I.message:"删除失败";$({title:"错误",description:B,variant:"destructive"})}},H=async I=>{try{await pxe(I.id),$({title:"成功",description:"表情包已注册"}),z(),V()}catch(B){const Y=B instanceof Error?B.message:"注册失败";$({title:"错误",description:Y,variant:"destructive"})}},ee=async I=>{try{await mxe(I.id),$({title:"成功",description:"表情包已封禁"}),z(),V()}catch(B){const Y=B instanceof Error?B.message:"封禁失败";$({title:"错误",description:Y,variant:"destructive"})}},ve=n?.formats?Object.keys(n.formats):[];return c.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"表情包管理"}),c.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"管理麦麦的表情包资源"})]}),n&&c.jsxs("div",{className:"grid gap-4 grid-cols-2 lg:grid-cols-4",children:[c.jsx(Dt,{children:c.jsxs(Lt,{className:"pb-2",children:[c.jsx(tr,{children:"总数"}),c.jsx($t,{className:"text-2xl",children:n.total})]})}),c.jsx(Dt,{children:c.jsxs(Lt,{className:"pb-2",children:[c.jsx(tr,{children:"已注册"}),c.jsx($t,{className:"text-2xl text-green-600",children:n.registered})]})}),c.jsx(Dt,{children:c.jsxs(Lt,{className:"pb-2",children:[c.jsx(tr,{children:"已封禁"}),c.jsx($t,{className:"text-2xl text-red-600",children:n.banned})]})}),c.jsx(Dt,{children:c.jsxs(Lt,{className:"pb-2",children:[c.jsx(tr,{children:"未注册"}),c.jsx($t,{className:"text-2xl text-gray-600",children:n.unregistered})]})})]}),c.jsxs(Dt,{children:[c.jsx(Lt,{children:c.jsxs($t,{className:"flex items-center gap-2",children:[c.jsx(xde,{className:"h-5 w-5"}),"搜索和筛选"]})}),c.jsxs(cn,{className:"space-y-4",children:[c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2 lg:grid-cols-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{children:"搜索"}),c.jsxs("div",{className:"relative",children:[c.jsx(Ms,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),c.jsx(Ae,{placeholder:"描述或哈希值...",value:v,onChange:I=>{g(I.target.value),u(1)},className:"pl-8"})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{children:"注册状态"}),c.jsxs(dn,{value:y,onValueChange:I=>{j(I),u(1)},children:[c.jsx(en,{children:c.jsx(hn,{})}),c.jsxs(tn,{children:[c.jsx(pt,{value:"all",children:"全部"}),c.jsx(pt,{value:"registered",children:"已注册"}),c.jsx(pt,{value:"unregistered",children:"未注册"})]})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{children:"封禁状态"}),c.jsxs(dn,{value:b,onValueChange:I=>{w(I),u(1)},children:[c.jsx(en,{children:c.jsx(hn,{})}),c.jsxs(tn,{children:[c.jsx(pt,{value:"all",children:"全部"}),c.jsx(pt,{value:"banned",children:"已封禁"}),c.jsx(pt,{value:"unbanned",children:"未封禁"})]})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{children:"格式"}),c.jsxs(dn,{value:A,onValueChange:I=>{O(I),u(1)},children:[c.jsx(en,{children:c.jsx(hn,{})}),c.jsxs(tn,{children:[c.jsx(pt,{value:"all",children:"全部"}),ve.map(I=>c.jsxs(pt,{value:I,children:[I.toUpperCase()," (",n?.formats[I],")"]},I))]})]})]})]}),c.jsx("div",{className:"flex justify-end",children:c.jsxs(we,{variant:"outline",size:"sm",onClick:z,disabled:a,children:[c.jsx(Of,{className:`h-4 w-4 mr-2 ${a?"animate-spin":""}`}),"刷新"]})})]})]}),c.jsxs(Dt,{children:[c.jsxs(Lt,{children:[c.jsx($t,{children:"表情包列表"}),c.jsxs(tr,{children:["共 ",d," 个表情包,当前第 ",l," 页"]})]}),c.jsxs(cn,{children:[c.jsx("div",{className:"rounded-md border",children:c.jsxs(Gc,{children:[c.jsx(Kc,{children:c.jsxs(pn,{children:[c.jsx(et,{className:"w-16",children:"预览"}),c.jsx(et,{children:"描述"}),c.jsx(et,{children:"格式"}),c.jsx(et,{className:"text-center",children:"状态"}),c.jsx(et,{className:"text-right",children:"使用次数"}),c.jsx(et,{className:"text-right",children:"操作"})]})}),c.jsx(Wc,{children:e.length===0?c.jsx(pn,{children:c.jsx(He,{colSpan:6,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map(I=>c.jsxs(pn,{children:[c.jsx(He,{children:c.jsx("div",{className:"w-12 h-12 bg-muted rounded flex items-center justify-center",children:c.jsx(jde,{className:"h-6 w-6 text-muted-foreground"})})}),c.jsx(He,{children:c.jsxs("div",{className:"space-y-1",children:[c.jsx("div",{className:"font-medium",children:I.description||"无描述"}),c.jsxs("div",{className:"text-xs text-muted-foreground font-mono",children:[I.emoji_hash.slice(0,16),"..."]})]})}),c.jsx(He,{children:c.jsx(ha,{variant:"outline",children:I.format.toUpperCase()})}),c.jsx(He,{children:c.jsxs("div",{className:"flex gap-2 justify-center",children:[I.is_registered&&c.jsxs(ha,{variant:"default",className:"bg-green-600",children:[c.jsx(n_,{className:"h-3 w-3 mr-1"}),"已注册"]}),I.is_banned&&c.jsxs(ha,{variant:"destructive",children:[c.jsx(y5,{className:"h-3 w-3 mr-1"}),"已封禁"]})]})}),c.jsx(He,{className:"text-right font-mono",children:I.usage_count}),c.jsx(He,{children:c.jsxs("div",{className:"flex items-center justify-end gap-2",children:[c.jsx(we,{variant:"ghost",size:"sm",onClick:()=>F(I),children:c.jsx(S5,{className:"h-4 w-4"})}),c.jsx(we,{variant:"ghost",size:"sm",onClick:()=>G(I),children:c.jsx(ZA,{className:"h-4 w-4"})}),!I.is_registered&&c.jsx(we,{variant:"ghost",size:"sm",onClick:()=>H(I),className:"text-green-600 hover:text-green-700",children:c.jsx(n_,{className:"h-4 w-4"})}),!I.is_banned&&c.jsx(we,{variant:"ghost",size:"sm",onClick:()=>ee(I),className:"text-orange-600 hover:text-orange-700",children:c.jsx(zfe,{className:"h-4 w-4"})}),c.jsx(we,{variant:"ghost",size:"sm",onClick:()=>L(I),className:"text-red-600 hover:text-red-700",children:c.jsx(zt,{className:"h-4 w-4"})})]})})]},I.id))})]})}),d>p&&c.jsxs("div",{className:"flex items-center justify-between mt-4",children:[c.jsxs("div",{className:"text-sm text-muted-foreground",children:["显示 ",(l-1)*p+1," 到"," ",Math.min(l*p,d)," 条,共 ",d," 条"]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsxs(we,{variant:"outline",size:"sm",onClick:()=>u(I=>Math.max(1,I-1)),disabled:l===1,children:[c.jsx(g5,{className:"h-4 w-4"}),"上一页"]}),c.jsxs("div",{className:"text-sm",children:["第 ",l," / ",Math.ceil(d/p)," 页"]}),c.jsxs(we,{variant:"outline",size:"sm",onClick:()=>u(I=>I+1),disabled:l>=Math.ceil(d/p),children:["下一页",c.jsx(Xfe,{className:"h-4 w-4"})]})]})]})]})]}),c.jsx(gxe,{emoji:N,open:E,onOpenChange:C}),c.jsx(yxe,{emoji:N,open:R,onOpenChange:k,onSuccess:()=>{z(),V()}}),c.jsx(kr,{open:M,onOpenChange:U,children:c.jsxs(sr,{children:[c.jsxs(lr,{children:[c.jsx(cr,{children:"确认删除"}),c.jsx(Mr,{children:"确定要删除这个表情包吗?此操作无法撤销。"})]}),c.jsxs(Sa,{children:[c.jsx(we,{variant:"outline",onClick:()=>U(!1),children:"取消"}),c.jsx(we,{variant:"destructive",onClick:q,children:"删除"})]})]})})]})}function gxe({emoji:e,open:t,onOpenChange:n}){if(!e)return null;const r=a=>a?new Date(a*1e3).toLocaleString("zh-CN"):"-";return c.jsx(kr,{open:t,onOpenChange:n,children:c.jsxs(sr,{className:"max-w-2xl",children:[c.jsx(lr,{children:c.jsx(cr,{children:"表情包详情"})}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[c.jsxs("div",{children:[c.jsx(re,{className:"text-muted-foreground",children:"ID"}),c.jsx("div",{className:"mt-1 font-mono",children:e.id})]}),c.jsxs("div",{children:[c.jsx(re,{className:"text-muted-foreground",children:"格式"}),c.jsx("div",{className:"mt-1",children:c.jsx(ha,{variant:"outline",children:e.format.toUpperCase()})})]})]}),c.jsxs("div",{children:[c.jsx(re,{className:"text-muted-foreground",children:"文件路径"}),c.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:e.full_path})]}),c.jsxs("div",{children:[c.jsx(re,{className:"text-muted-foreground",children:"哈希值"}),c.jsx("div",{className:"mt-1 font-mono text-sm break-all bg-muted p-2 rounded",children:e.emoji_hash})]}),c.jsxs("div",{children:[c.jsx(re,{className:"text-muted-foreground",children:"描述"}),c.jsx("div",{className:"mt-1",children:e.description||"-"})]}),c.jsxs("div",{children:[c.jsx(re,{className:"text-muted-foreground",children:"情绪标签"}),c.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:e.emotion&&e.emotion.length>0?e.emotion.map((a,o)=>c.jsx(ha,{variant:"secondary",children:a},o)):c.jsx("span",{className:"text-sm text-muted-foreground",children:"无"})})]}),c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[c.jsxs("div",{children:[c.jsx(re,{className:"text-muted-foreground",children:"状态"}),c.jsxs("div",{className:"mt-2 flex gap-2",children:[e.is_registered&&c.jsx(ha,{variant:"default",className:"bg-green-600",children:"已注册"}),e.is_banned&&c.jsx(ha,{variant:"destructive",children:"已封禁"}),!e.is_registered&&!e.is_banned&&c.jsx(ha,{variant:"outline",children:"未注册"})]})]}),c.jsxs("div",{children:[c.jsx(re,{className:"text-muted-foreground",children:"使用次数"}),c.jsx("div",{className:"mt-1 font-mono text-lg",children:e.usage_count})]})]}),c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[c.jsxs("div",{children:[c.jsx(re,{className:"text-muted-foreground",children:"记录时间"}),c.jsx("div",{className:"mt-1 text-sm",children:r(e.record_time)})]}),c.jsxs("div",{children:[c.jsx(re,{className:"text-muted-foreground",children:"注册时间"}),c.jsx("div",{className:"mt-1 text-sm",children:r(e.register_time)})]})]}),c.jsxs("div",{children:[c.jsx(re,{className:"text-muted-foreground",children:"最后使用"}),c.jsx("div",{className:"mt-1 text-sm",children:r(e.last_used_time)})]})]})]})})}function yxe({emoji:e,open:t,onOpenChange:n,onSuccess:r}){const[a,o]=S.useState(""),[l,u]=S.useState(""),[d,h]=S.useState(!1),[p,v]=S.useState(!1),[g,y]=S.useState(!1),{toast:j}=na();S.useEffect(()=>{e&&(o(e.description||""),u(e.emotion?e.emotion.join(", "):""),h(e.is_registered),v(e.is_banned))},[e]);const b=async()=>{if(e)try{y(!0);const w=l.split(",").map(A=>A.trim()).filter(Boolean);await fxe(e.id,{description:a||void 0,emotion:w.length>0?w:void 0,is_registered:d,is_banned:p}),j({title:"成功",description:"表情包信息已更新"}),n(!1),r()}catch(w){const A=w instanceof Error?w.message:"保存失败";j({title:"错误",description:A,variant:"destructive"})}finally{y(!1)}};return e?c.jsx(kr,{open:t,onOpenChange:n,children:c.jsxs(sr,{className:"max-w-2xl",children:[c.jsxs(lr,{children:[c.jsx(cr,{children:"编辑表情包"}),c.jsx(Mr,{children:"修改表情包的描述和标签信息"})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{children:[c.jsx(re,{children:"描述"}),c.jsx(Wt,{value:a,onChange:w=>o(w.target.value),placeholder:"输入表情包描述...",rows:3,className:"mt-1"})]}),c.jsxs("div",{children:[c.jsx(re,{children:"情绪标签"}),c.jsx(Ae,{value:l,onChange:w=>u(w.target.value),placeholder:"使用逗号分隔多个标签,如:开心, 微笑, 快乐",className:"mt-1"}),c.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"输入多个标签时使用逗号分隔"})]}),c.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("input",{type:"checkbox",id:"is_registered",checked:d,onChange:w=>h(w.target.checked),className:"rounded border-gray-300"}),c.jsx(re,{htmlFor:"is_registered",className:"cursor-pointer",children:"已注册"})]}),c.jsxs("div",{className:"flex items-center space-x-2",children:[c.jsx("input",{type:"checkbox",id:"is_banned",checked:p,onChange:w=>v(w.target.checked),className:"rounded border-gray-300"}),c.jsx(re,{htmlFor:"is_banned",className:"cursor-pointer",children:"已封禁"})]})]})]}),c.jsxs(Sa,{children:[c.jsx(we,{variant:"outline",onClick:()=>n(!1),children:"取消"}),c.jsx(we,{onClick:b,disabled:g,children:g?"保存中...":"保存"})]})]})}):null}const Yc="/api/webui/expression";function Xc(){return{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("access-token")}`}}async function xxe(e){const t=new URLSearchParams;e.page&&t.append("page",e.page.toString()),e.page_size&&t.append("page_size",e.page_size.toString()),e.search&&t.append("search",e.search),e.chat_id&&t.append("chat_id",e.chat_id);const n=await fetch(`${Yc}/list?${t}`,{headers:Xc()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取表达方式列表失败")}return n.json()}async function bxe(e){const t=await fetch(`${Yc}/${e}`,{headers:Xc()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"获取表达方式详情失败")}return t.json()}async function wxe(e){const t=await fetch(`${Yc}/`,{method:"POST",headers:Xc(),body:JSON.stringify(e)});if(!t.ok){const n=await t.json();throw new Error(n.detail||"创建表达方式失败")}return t.json()}async function Sxe(e,t){const n=await fetch(`${Yc}/${e}`,{method:"PATCH",headers:Xc(),body:JSON.stringify(t)});if(!n.ok){const r=await n.json();throw new Error(r.detail||"更新表达方式失败")}return n.json()}async function jxe(e){const t=await fetch(`${Yc}/${e}`,{method:"DELETE",headers:Xc()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"删除表达方式失败")}return t.json()}async function _xe(){const e=await fetch(`${Yc}/stats/summary`,{headers:Xc()});if(!e.ok){const t=await e.json();throw new Error(t.detail||"获取统计数据失败")}return e.json()}function Axe(){const[e,t]=S.useState([]),[n,r]=S.useState(!0),[a,o]=S.useState(0),[l,u]=S.useState(1),[d]=S.useState(20),[h,p]=S.useState(""),[v,g]=S.useState(null),[y,j]=S.useState(!1),[b,w]=S.useState(!1),[A,O]=S.useState(!1),[N,T]=S.useState(null),[E,C]=S.useState({total:0,recent_7days:0,chat_count:0,top_chats:{}}),{toast:R}=na(),k=async()=>{try{r(!0);const F=await xxe({page:l,page_size:d,search:h||void 0});t(F.data),o(F.total)}catch(F){R({title:"加载失败",description:F instanceof Error?F.message:"无法加载表达方式",variant:"destructive"})}finally{r(!1)}},M=async()=>{try{const F=await _xe();C(F.data)}catch(F){console.error("加载统计数据失败:",F)}};S.useEffect(()=>{k(),M()},[l,d,h]);const U=async F=>{try{const G=await bxe(F.id);g(G.data),j(!0)}catch(G){R({title:"加载详情失败",description:G instanceof Error?G.message:"无法加载表达方式详情",variant:"destructive"})}},$=F=>{g(F),w(!0)},z=async F=>{try{await jxe(F.id),R({title:"删除成功",description:`已删除表达方式: ${F.situation}`}),T(null),k(),M()}catch(G){R({title:"删除失败",description:G instanceof Error?G.message:"无法删除表达方式",variant:"destructive"})}},V=F=>F?new Date(F*1e3).toLocaleString("zh-CN"):"-";return c.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[c.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[c.jsxs("div",{children:[c.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[c.jsx(eg,{className:"h-8 w-8",strokeWidth:2}),"表达方式管理"]}),c.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦的表达方式和话术模板"})]}),c.jsxs(we,{onClick:()=>O(!0),className:"gap-2",children:[c.jsx($n,{className:"h-4 w-4"}),"新增表达方式"]})]}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[c.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[c.jsx("div",{className:"text-sm text-muted-foreground",children:"总数量"}),c.jsx("div",{className:"text-2xl font-bold mt-1",children:E.total})]}),c.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[c.jsx("div",{className:"text-sm text-muted-foreground",children:"近7天新增"}),c.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:E.recent_7days})]}),c.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[c.jsx("div",{className:"text-sm text-muted-foreground",children:"关联聊天数"}),c.jsx("div",{className:"text-2xl font-bold mt-1 text-blue-600",children:E.chat_count})]})]}),c.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[c.jsx(re,{htmlFor:"search",children:"搜索"}),c.jsxs("div",{className:"relative mt-1.5",children:[c.jsx(Ms,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),c.jsx(Ae,{id:"search",placeholder:"搜索情境、风格或上下文...",value:h,onChange:F=>p(F.target.value),className:"pl-9"})]})]}),c.jsxs("div",{className:"rounded-lg border bg-card",children:[c.jsx(Bn,{className:"h-[calc(100vh-500px)]",children:c.jsxs(Gc,{children:[c.jsx(Kc,{children:c.jsxs(pn,{children:[c.jsx(et,{children:"情境"}),c.jsx(et,{children:"风格"}),c.jsx(et,{children:"聊天ID"}),c.jsx(et,{children:"最后活跃"}),c.jsx(et,{className:"text-right",children:"操作"})]})}),c.jsx(Wc,{children:n?c.jsx(pn,{children:c.jsx(He,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):e.length===0?c.jsx(pn,{children:c.jsx(He,{colSpan:5,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map(F=>c.jsxs(pn,{children:[c.jsx(He,{className:"font-medium max-w-xs truncate",children:F.situation}),c.jsx(He,{className:"max-w-xs truncate",children:F.style}),c.jsx(He,{className:"font-mono text-sm",children:F.chat_id}),c.jsx(He,{className:"text-sm text-muted-foreground",children:V(F.last_active_time)}),c.jsx(He,{className:"text-right",children:c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx(we,{variant:"ghost",size:"sm",onClick:()=>U(F),children:c.jsx(Oi,{className:"h-4 w-4"})}),c.jsx(we,{variant:"ghost",size:"sm",onClick:()=>$(F),children:c.jsx(ZA,{className:"h-4 w-4"})}),c.jsx(we,{variant:"ghost",size:"sm",onClick:()=>T(F),children:c.jsx(zt,{className:"h-4 w-4 text-destructive"})})]})})]},F.id))})]})}),a>d&&c.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t",children:[c.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",a," 条记录,第 ",l," / ",Math.ceil(a/d)," 页"]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(we,{variant:"outline",size:"sm",onClick:()=>u(l-1),disabled:l===1,children:"上一页"}),c.jsx(we,{variant:"outline",size:"sm",onClick:()=>u(l+1),disabled:l>=Math.ceil(a/d),children:"下一页"})]})]})]}),c.jsx(Oxe,{expression:v,open:y,onOpenChange:j}),c.jsx(Nxe,{open:A,onOpenChange:O,onSuccess:()=>{k(),M(),O(!1)}}),c.jsx(Exe,{expression:v,open:b,onOpenChange:w,onSuccess:()=>{k(),M(),w(!1)}}),c.jsx(Rn,{open:!!N,onOpenChange:()=>T(null),children:c.jsxs(mn,{children:[c.jsxs(vn,{children:[c.jsx(yn,{children:"确认删除"}),c.jsxs(xn,{children:['确定要删除表达方式 "',N?.situation,'" 吗? 此操作不可撤销。']})]}),c.jsxs(gn,{children:[c.jsx(wn,{children:"取消"}),c.jsx(bn,{onClick:()=>N&&z(N),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})})]})}function Oxe({expression:e,open:t,onOpenChange:n}){if(!e)return null;const r=a=>a?new Date(a*1e3).toLocaleString("zh-CN"):"-";return c.jsx(kr,{open:t,onOpenChange:n,children:c.jsxs(sr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[c.jsxs(lr,{children:[c.jsx(cr,{children:"表达方式详情"}),c.jsx(Mr,{children:"查看表达方式的完整信息"})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(Tl,{label:"情境",value:e.situation}),c.jsx(Tl,{label:"风格",value:e.style}),c.jsx(Tl,{icon:Ym,label:"聊天ID",value:e.chat_id,mono:!0}),c.jsx(Tl,{icon:Ym,label:"记录ID",value:e.id.toString(),mono:!0})]}),e.context&&c.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[c.jsx(re,{className:"text-xs text-muted-foreground",children:"上下文"}),c.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.context})]}),e.up_content&&c.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[c.jsx(re,{className:"text-xs text-muted-foreground",children:"上文内容"}),c.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.up_content})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(Tl,{icon:ds,label:"最后活跃",value:r(e.last_active_time)}),c.jsx(Tl,{icon:ds,label:"创建时间",value:r(e.create_date)})]})]}),c.jsx(Sa,{children:c.jsx(we,{onClick:()=>n(!1),children:"关闭"})})]})})}function Tl({icon:e,label:t,value:n,mono:r=!1}){return c.jsxs("div",{className:"space-y-1",children:[c.jsxs(re,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e&&c.jsx(e,{className:"h-3 w-3"}),t]}),c.jsx("div",{className:je("text-sm",r&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function Nxe({open:e,onOpenChange:t,onSuccess:n}){const[r,a]=S.useState({situation:"",style:"",context:"",up_content:"",chat_id:""}),[o,l]=S.useState(!1),{toast:u}=na(),d=async()=>{if(!r.situation||!r.style||!r.chat_id){u({title:"验证失败",description:"请填写必填字段:情境、风格和聊天ID",variant:"destructive"});return}try{l(!0),await wxe(r),u({title:"创建成功",description:"表达方式已创建"}),a({situation:"",style:"",context:"",up_content:"",chat_id:""}),n()}catch(h){u({title:"创建失败",description:h instanceof Error?h.message:"无法创建表达方式",variant:"destructive"})}finally{l(!1)}};return c.jsx(kr,{open:e,onOpenChange:t,children:c.jsxs(sr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[c.jsxs(lr,{children:[c.jsx(cr,{children:"新增表达方式"}),c.jsx(Mr,{children:"创建新的表达方式记录"})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsxs(re,{htmlFor:"situation",children:["情境 ",c.jsx("span",{className:"text-destructive",children:"*"})]}),c.jsx(Ae,{id:"situation",value:r.situation,onChange:h=>a({...r,situation:h.target.value}),placeholder:"描述使用场景"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs(re,{htmlFor:"style",children:["风格 ",c.jsx("span",{className:"text-destructive",children:"*"})]}),c.jsx(Ae,{id:"style",value:r.style,onChange:h=>a({...r,style:h.target.value}),placeholder:"描述表达风格"})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsxs(re,{htmlFor:"chat_id",children:["聊天ID ",c.jsx("span",{className:"text-destructive",children:"*"})]}),c.jsx(Ae,{id:"chat_id",value:r.chat_id,onChange:h=>a({...r,chat_id:h.target.value}),placeholder:"关联的聊天ID"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{htmlFor:"context",children:"上下文"}),c.jsx(Wt,{id:"context",value:r.context,onChange:h=>a({...r,context:h.target.value}),placeholder:"上下文信息(可选)",rows:3})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{htmlFor:"up_content",children:"上文内容"}),c.jsx(Wt,{id:"up_content",value:r.up_content,onChange:h=>a({...r,up_content:h.target.value}),placeholder:"上文内容(可选)",rows:3})]})]}),c.jsxs(Sa,{children:[c.jsx(we,{variant:"outline",onClick:()=>t(!1),children:"取消"}),c.jsx(we,{onClick:d,disabled:o,children:o?"创建中...":"创建"})]})]})})}function Exe({expression:e,open:t,onOpenChange:n,onSuccess:r}){const[a,o]=S.useState({}),[l,u]=S.useState(!1),{toast:d}=na();S.useEffect(()=>{e&&o({situation:e.situation,style:e.style,context:e.context||"",up_content:e.up_content||"",chat_id:e.chat_id})},[e]);const h=async()=>{if(e)try{u(!0),await Sxe(e.id,a),d({title:"保存成功",description:"表达方式已更新"}),r()}catch(p){d({title:"保存失败",description:p instanceof Error?p.message:"无法更新表达方式",variant:"destructive"})}finally{u(!1)}};return e?c.jsx(kr,{open:t,onOpenChange:n,children:c.jsxs(sr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[c.jsxs(lr,{children:[c.jsx(cr,{children:"编辑表达方式"}),c.jsx(Mr,{children:"修改表达方式的信息"})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{htmlFor:"edit_situation",children:"情境"}),c.jsx(Ae,{id:"edit_situation",value:a.situation||"",onChange:p=>o({...a,situation:p.target.value}),placeholder:"描述使用场景"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{htmlFor:"edit_style",children:"风格"}),c.jsx(Ae,{id:"edit_style",value:a.style||"",onChange:p=>o({...a,style:p.target.value}),placeholder:"描述表达风格"})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{htmlFor:"edit_chat_id",children:"聊天ID"}),c.jsx(Ae,{id:"edit_chat_id",value:a.chat_id||"",onChange:p=>o({...a,chat_id:p.target.value}),placeholder:"关联的聊天ID"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{htmlFor:"edit_context",children:"上下文"}),c.jsx(Wt,{id:"edit_context",value:a.context||"",onChange:p=>o({...a,context:p.target.value}),placeholder:"上下文信息",rows:3})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{htmlFor:"edit_up_content",children:"上文内容"}),c.jsx(Wt,{id:"edit_up_content",value:a.up_content||"",onChange:p=>o({...a,up_content:p.target.value}),placeholder:"上文内容",rows:3})]})]}),c.jsxs(Sa,{children:[c.jsx(we,{variant:"outline",onClick:()=>n(!1),children:"取消"}),c.jsx(we,{onClick:h,disabled:l,children:l?"保存中...":"保存"})]})]})}):null}const Dd="/api/webui/person";function Ld(){return{"Content-Type":"application/json",Authorization:`Bearer ${localStorage.getItem("access-token")}`}}async function Txe(e){const t=new URLSearchParams;e.page&&t.append("page",e.page.toString()),e.page_size&&t.append("page_size",e.page_size.toString()),e.search&&t.append("search",e.search),e.is_known!==void 0&&t.append("is_known",e.is_known.toString()),e.platform&&t.append("platform",e.platform);const n=await fetch(`${Dd}/list?${t}`,{headers:Ld()});if(!n.ok){const r=await n.json();throw new Error(r.detail||"获取人物列表失败")}return n.json()}async function Cxe(e){const t=await fetch(`${Dd}/${e}`,{headers:Ld()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"获取人物详情失败")}return t.json()}async function Rxe(e,t){const n=await fetch(`${Dd}/${e}`,{method:"PATCH",headers:Ld(),body:JSON.stringify(t)});if(!n.ok){const r=await n.json();throw new Error(r.detail||"更新人物信息失败")}return n.json()}async function Pxe(e){const t=await fetch(`${Dd}/${e}`,{method:"DELETE",headers:Ld()});if(!t.ok){const n=await t.json();throw new Error(n.detail||"删除人物信息失败")}return t.json()}async function kxe(){const e=await fetch(`${Dd}/stats/summary`,{headers:Ld()});if(!e.ok){const t=await e.json();throw new Error(t.detail||"获取统计数据失败")}return e.json()}function Mxe(){const[e,t]=S.useState([]),[n,r]=S.useState(!0),[a,o]=S.useState(0),[l,u]=S.useState(1),[d]=S.useState(20),[h,p]=S.useState(""),[v,g]=S.useState(void 0),[y,j]=S.useState(void 0),[b,w]=S.useState(null),[A,O]=S.useState(!1),[N,T]=S.useState(!1),[E,C]=S.useState(null),[R,k]=S.useState({total:0,known:0,unknown:0,platforms:{}}),{toast:M}=na(),U=async()=>{try{r(!0);const q=await Txe({page:l,page_size:d,search:h||void 0,is_known:v,platform:y});t(q.data),o(q.total)}catch(q){M({title:"加载失败",description:q instanceof Error?q.message:"无法加载人物信息",variant:"destructive"})}finally{r(!1)}},$=async()=>{try{const q=await kxe();k(q.data)}catch(q){console.error("加载统计数据失败:",q)}};S.useEffect(()=>{U(),$()},[l,d,h,v,y]);const z=async q=>{try{const H=await Cxe(q.person_id);w(H.data),O(!0)}catch(H){M({title:"加载详情失败",description:H instanceof Error?H.message:"无法加载人物详情",variant:"destructive"})}},V=q=>{w(q),T(!0)},F=async q=>{try{await Pxe(q.person_id),M({title:"删除成功",description:`已删除人物信息: ${q.person_name||q.nickname||q.user_id}`}),C(null),U(),$()}catch(H){M({title:"删除失败",description:H instanceof Error?H.message:"无法删除人物信息",variant:"destructive"})}},G=S.useMemo(()=>Object.keys(R.platforms),[R.platforms]),L=q=>q?new Date(q*1e3).toLocaleString("zh-CN"):"-";return c.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[c.jsx("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:c.jsxs("div",{children:[c.jsxs("h1",{className:"text-2xl sm:text-3xl font-bold flex items-center gap-2",children:[c.jsx(ihe,{className:"h-8 w-8",strokeWidth:2}),"人物信息管理"]}),c.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"管理麦麦认识的所有人物信息"})]})}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[c.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[c.jsx("div",{className:"text-sm text-muted-foreground",children:"总人数"}),c.jsx("div",{className:"text-2xl font-bold mt-1",children:R.total})]}),c.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[c.jsx("div",{className:"text-sm text-muted-foreground",children:"已认识"}),c.jsx("div",{className:"text-2xl font-bold mt-1 text-green-600",children:R.known})]}),c.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[c.jsx("div",{className:"text-sm text-muted-foreground",children:"未认识"}),c.jsx("div",{className:"text-2xl font-bold mt-1 text-muted-foreground",children:R.unknown})]})]}),c.jsx("div",{className:"rounded-lg border bg-card p-4",children:c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-4",children:[c.jsxs("div",{className:"sm:col-span-2",children:[c.jsx(re,{htmlFor:"search",children:"搜索"}),c.jsxs("div",{className:"relative mt-1.5",children:[c.jsx(Ms,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),c.jsx(Ae,{id:"search",placeholder:"搜索名称、昵称或用户ID...",value:h,onChange:q=>p(q.target.value),className:"pl-9"})]})]}),c.jsxs("div",{children:[c.jsx(re,{htmlFor:"filter-known",children:"认识状态"}),c.jsxs(dn,{value:v===void 0?"all":v.toString(),onValueChange:q=>{g(q==="all"?void 0:q==="true"),u(1)},children:[c.jsx(en,{id:"filter-known",className:"mt-1.5",children:c.jsx(hn,{})}),c.jsxs(tn,{children:[c.jsx(pt,{value:"all",children:"全部"}),c.jsx(pt,{value:"true",children:"已认识"}),c.jsx(pt,{value:"false",children:"未认识"})]})]})]}),c.jsxs("div",{children:[c.jsx(re,{htmlFor:"filter-platform",children:"平台"}),c.jsxs(dn,{value:y||"all",onValueChange:q=>{j(q==="all"?void 0:q),u(1)},children:[c.jsx(en,{id:"filter-platform",className:"mt-1.5",children:c.jsx(hn,{})}),c.jsxs(tn,{children:[c.jsx(pt,{value:"all",children:"全部平台"}),G.map(q=>c.jsxs(pt,{value:q,children:[q," (",R.platforms[q],")"]},q))]})]})]})]})}),c.jsxs("div",{className:"rounded-lg border bg-card",children:[c.jsx(Bn,{className:"h-[calc(100vh-500px)]",children:c.jsxs(Gc,{children:[c.jsx(Kc,{children:c.jsxs(pn,{children:[c.jsx(et,{children:"状态"}),c.jsx(et,{children:"名称"}),c.jsx(et,{children:"昵称"}),c.jsx(et,{children:"平台"}),c.jsx(et,{children:"用户ID"}),c.jsx(et,{children:"最后更新"}),c.jsx(et,{className:"text-right",children:"操作"})]})}),c.jsx(Wc,{children:n?c.jsx(pn,{children:c.jsx(He,{colSpan:7,className:"text-center py-8 text-muted-foreground",children:"加载中..."})}):e.length===0?c.jsx(pn,{children:c.jsx(He,{colSpan:7,className:"text-center py-8 text-muted-foreground",children:"暂无数据"})}):e.map(q=>c.jsxs(pn,{children:[c.jsx(He,{children:c.jsx("div",{className:je("inline-flex items-center gap-1 px-2 py-1 rounded-full text-xs font-medium",q.is_known?"bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400":"bg-gray-100 text-gray-700 dark:bg-gray-800 dark:text-gray-400"),children:q.is_known?"已认识":"未认识"})}),c.jsx(He,{className:"font-medium",children:q.person_name||c.jsx("span",{className:"text-muted-foreground",children:"-"})}),c.jsx(He,{children:q.nickname||"-"}),c.jsx(He,{children:q.platform}),c.jsx(He,{className:"font-mono text-sm",children:q.user_id}),c.jsx(He,{className:"text-sm text-muted-foreground",children:L(q.last_know)}),c.jsx(He,{className:"text-right",children:c.jsxs("div",{className:"flex justify-end gap-2",children:[c.jsx(we,{variant:"ghost",size:"sm",onClick:()=>z(q),children:c.jsx(Oi,{className:"h-4 w-4"})}),c.jsx(we,{variant:"ghost",size:"sm",onClick:()=>V(q),children:c.jsx(ZA,{className:"h-4 w-4"})}),c.jsx(we,{variant:"ghost",size:"sm",onClick:()=>C(q),children:c.jsx(zt,{className:"h-4 w-4 text-destructive"})})]})})]},q.id))})]})}),a>d&&c.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-t",children:[c.jsxs("div",{className:"text-sm text-muted-foreground",children:["共 ",a," 条记录,第 ",l," / ",Math.ceil(a/d)," 页"]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx(we,{variant:"outline",size:"sm",onClick:()=>u(l-1),disabled:l===1,children:"上一页"}),c.jsx(we,{variant:"outline",size:"sm",onClick:()=>u(l+1),disabled:l>=Math.ceil(a/d),children:"下一页"})]})]})]}),c.jsx(Dxe,{person:b,open:A,onOpenChange:O}),c.jsx(Lxe,{person:b,open:N,onOpenChange:T,onSuccess:()=>{U(),$(),T(!1)}}),c.jsx(Rn,{open:!!E,onOpenChange:()=>C(null),children:c.jsxs(mn,{children:[c.jsxs(vn,{children:[c.jsx(yn,{children:"确认删除"}),c.jsxs(xn,{children:['确定要删除人物信息 "',E?.person_name||E?.nickname||E?.user_id,'" 吗? 此操作不可撤销。']})]}),c.jsxs(gn,{children:[c.jsx(wn,{children:"取消"}),c.jsx(bn,{onClick:()=>E&&F(E),className:"bg-destructive text-destructive-foreground hover:bg-destructive/90",children:"删除"})]})]})})]})}function Dxe({person:e,open:t,onOpenChange:n}){if(!e)return null;const r=a=>a?new Date(a*1e3).toLocaleString("zh-CN"):"-";return c.jsx(kr,{open:t,onOpenChange:n,children:c.jsxs(sr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[c.jsxs(lr,{children:[c.jsx(cr,{children:"人物详情"}),c.jsxs(Mr,{children:["查看 ",e.person_name||e.nickname||e.user_id," 的完整信息"]})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsx(hi,{icon:rhe,label:"人物名称",value:e.person_name}),c.jsx(hi,{icon:eg,label:"昵称",value:e.nickname}),c.jsx(hi,{icon:Ym,label:"用户ID",value:e.user_id,mono:!0}),c.jsx(hi,{icon:Ym,label:"人物ID",value:e.person_id,mono:!0}),c.jsx(hi,{label:"平台",value:e.platform}),c.jsx(hi,{label:"状态",value:e.is_known?"已认识":"未认识"})]}),e.name_reason&&c.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[c.jsx(re,{className:"text-xs text-muted-foreground",children:"名称设定原因"}),c.jsx("p",{className:"mt-1 text-sm",children:e.name_reason})]}),e.memory_points&&c.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[c.jsx(re,{className:"text-xs text-muted-foreground",children:"个人印象"}),c.jsx("p",{className:"mt-1 text-sm whitespace-pre-wrap",children:e.memory_points})]}),e.group_nick_name&&e.group_nick_name.length>0&&c.jsxs("div",{className:"rounded-lg border bg-muted/50 p-3",children:[c.jsx(re,{className:"text-xs text-muted-foreground",children:"群昵称"}),c.jsx("div",{className:"mt-2 space-y-1",children:e.group_nick_name.map((a,o)=>c.jsxs("div",{className:"text-sm flex items-center gap-2",children:[c.jsx("span",{className:"font-mono text-xs text-muted-foreground",children:a.group_id}),c.jsx("span",{children:"→"}),c.jsx("span",{children:a.group_nick_name})]},o))})]}),c.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[c.jsx(hi,{icon:ds,label:"认识时间",value:r(e.know_times)}),c.jsx(hi,{icon:ds,label:"首次记录",value:r(e.know_since)}),c.jsx(hi,{icon:ds,label:"最后更新",value:r(e.last_know)})]})]}),c.jsx(Sa,{children:c.jsx(we,{onClick:()=>n(!1),children:"关闭"})})]})})}function hi({icon:e,label:t,value:n,mono:r=!1}){return c.jsxs("div",{className:"space-y-1",children:[c.jsxs(re,{className:"text-xs text-muted-foreground flex items-center gap-1",children:[e&&c.jsx(e,{className:"h-3 w-3"}),t]}),c.jsx("div",{className:je("text-sm",r&&"font-mono",!n&&"text-muted-foreground"),children:n||"-"})]})}function Lxe({person:e,open:t,onOpenChange:n,onSuccess:r}){const[a,o]=S.useState({}),[l,u]=S.useState(!1),{toast:d}=na();S.useEffect(()=>{e&&o({person_name:e.person_name||"",name_reason:e.name_reason||"",nickname:e.nickname||"",memory_points:e.memory_points||"",is_known:e.is_known})},[e]);const h=async()=>{if(e)try{u(!0),await Rxe(e.person_id,a),d({title:"保存成功",description:"人物信息已更新"}),r()}catch(p){d({title:"保存失败",description:p instanceof Error?p.message:"无法更新人物信息",variant:"destructive"})}finally{u(!1)}};return e?c.jsx(kr,{open:t,onOpenChange:n,children:c.jsxs(sr,{className:"max-w-2xl max-h-[80vh] overflow-y-auto",children:[c.jsxs(lr,{children:[c.jsx(cr,{children:"编辑人物信息"}),c.jsxs(Mr,{children:["修改 ",e.person_name||e.nickname||e.user_id," 的信息"]})]}),c.jsxs("div",{className:"space-y-4",children:[c.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{htmlFor:"person_name",children:"人物名称"}),c.jsx(Ae,{id:"person_name",value:a.person_name||"",onChange:p=>o({...a,person_name:p.target.value}),placeholder:"为这个人设置一个名称"})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{htmlFor:"nickname",children:"昵称"}),c.jsx(Ae,{id:"nickname",value:a.nickname||"",onChange:p=>o({...a,nickname:p.target.value}),placeholder:"昵称"})]})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{htmlFor:"name_reason",children:"名称设定原因"}),c.jsx(Wt,{id:"name_reason",value:a.name_reason||"",onChange:p=>o({...a,name_reason:p.target.value}),placeholder:"为什么这样称呼这个人?",rows:2})]}),c.jsxs("div",{className:"space-y-2",children:[c.jsx(re,{htmlFor:"memory_points",children:"个人印象"}),c.jsx(Wt,{id:"memory_points",value:a.memory_points||"",onChange:p=>o({...a,memory_points:p.target.value}),placeholder:"对这个人的印象和记忆点...",rows:4})]}),c.jsxs("div",{className:"flex items-center justify-between rounded-lg border p-3",children:[c.jsxs("div",{children:[c.jsx(re,{htmlFor:"is_known",className:"text-base font-medium",children:"已认识"}),c.jsx("p",{className:"text-sm text-muted-foreground",children:"标记是否已经认识这个人"})]}),c.jsx(xt,{id:"is_known",checked:a.is_known,onCheckedChange:p=>o({...a,is_known:p})})]})]}),c.jsxs(Sa,{children:[c.jsx(we,{variant:"outline",onClick:()=>n(!1),children:"取消"}),c.jsx(we,{onClick:h,disabled:l,children:l?"保存中...":"保存"})]})]})}):null}function $xe(){return c.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"日志查看器"}),c.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"实时查看和分析麦麦运行日志"})]}),c.jsx("div",{className:"rounded-lg border bg-card p-6 sm:p-8",children:c.jsx("p",{className:"text-muted-foreground text-center",children:"日志查看器功能开发中..."})})]})}function Ixe(){return c.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"统计信息"}),c.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"查看详细的统计数据和分析"})]}),c.jsx("div",{className:"rounded-lg border bg-card p-6",children:c.jsx("p",{className:"text-muted-foreground",children:"功能开发中..."})})]})}function zxe(){return c.jsxs("div",{className:"space-y-4 sm:space-y-6 p-4 sm:p-6",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"text-2xl sm:text-3xl font-bold",children:"插件市场"}),c.jsx("p",{className:"text-muted-foreground mt-1 sm:mt-2 text-sm sm:text-base",children:"浏览和管理麦麦的插件"})]}),c.jsx("div",{className:"rounded-lg border bg-card p-6",children:c.jsx("p",{className:"text-muted-foreground",children:"功能开发中..."})})]})}function Bxe({children:e}){_me();const[t,n]=S.useState(!0),[r,a]=S.useState(!1),{theme:o,setTheme:l}=tO(),u=O7(),d=Ns(),h=[{title:"概览",items:[{icon:w5,label:"首页",path:"/"}]},{title:"麦麦配置编辑",items:[{icon:b5,label:"麦麦主程序配置",path:"/config/bot"},{icon:Ude,label:"麦麦模型提供商配置",path:"/config/modelProvider"},{icon:Ffe,label:"麦麦模型配置",path:"/config/model"}]},{title:"麦麦资源管理",items:[{icon:Kde,label:"表情包管理",path:"/resource/emoji"},{icon:eg,label:"表达方式管理",path:"/resource/expression"},{icon:ode,label:"人物信息管理",path:"/resource/person"}]},{title:"扩展与监控",items:[{icon:Vfe,label:"统计信息",path:"/statistics"},{icon:Dde,label:"插件市场",path:"/plugins"},{icon:x5,label:"日志查看器",path:"/logs"}]},{title:"系统",items:[{icon:_5,label:"系统设置",path:"/settings"}]}],v=o==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":o,g=()=>{localStorage.removeItem("access-token"),d({to:"/auth"})};return c.jsxs("div",{className:"flex h-screen overflow-hidden",children:[c.jsxs("aside",{className:je("fixed inset-y-0 left-0 z-50 flex flex-col border-r bg-card transition-all duration-300 lg:relative lg:z-0","w-64 lg:w-auto",t?"lg:w-64":"lg:w-16",r?"translate-x-0":"-translate-x-full lg:translate-x-0"),children:[c.jsxs("div",{className:"flex h-16 items-center border-b px-4",children:[c.jsxs("div",{className:je("relative flex items-center justify-center flex-1 transition-all overflow-hidden","lg:flex-1",!t&&"lg:flex-none lg:w-8"),children:[c.jsxs("div",{className:je("relative inline-block",!t&&"lg:hidden"),children:[c.jsx("span",{className:"font-bold text-2xl text-primary whitespace-nowrap",children:"MaiBot"}),c.jsx("span",{className:"absolute -top-1 -right-10 text-[10px] font-medium text-muted-foreground whitespace-nowrap",children:Lhe()})]}),!t&&c.jsx("span",{className:"hidden lg:block font-bold text-primary text-2xl",children:"M"})]}),c.jsx("button",{onClick:()=>n(!t),className:"hidden rounded-lg p-2 hover:bg-accent lg:block flex-shrink-0 ml-2",children:c.jsx(g5,{className:je("h-4 w-4 transition-transform",!t&&"rotate-180")})})]}),c.jsx("nav",{className:"flex-1 overflow-y-auto p-4",children:c.jsx("ul",{className:je("space-y-6",!t&&"lg:space-y-3"),children:h.map((y,j)=>c.jsxs("li",{children:[c.jsx("div",{className:je("px-3 h-[1.25rem]","mb-2",!t&&"lg:mb-1 lg:invisible"),children:c.jsx("h3",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground/60 whitespace-nowrap",children:y.title})}),!t&&j>0&&c.jsx("div",{className:"hidden lg:block mb-2 border-t border-border"}),c.jsx("ul",{className:"space-y-1",children:y.items.map(b=>{const w=u({to:b.path}),A=b.icon;return c.jsx("li",{className:"relative",children:c.jsxs(M_,{to:b.path,className:je("relative flex items-center gap-3 rounded-lg px-3 py-2 transition-colors","hover:bg-accent hover:text-accent-foreground",w?"bg-accent text-foreground":"text-muted-foreground hover:text-foreground",!t&&"lg:justify-center lg:px-0"),onClick:()=>a(!1),children:[w&&c.jsx("div",{className:"absolute left-0 top-1/2 h-8 w-1 -translate-y-1/2 rounded-r-full bg-primary"}),c.jsx(A,{className:je("h-5 w-5 flex-shrink-0",!t&&"lg:mx-auto",w&&"text-primary"),strokeWidth:2,fill:"none"}),c.jsx("span",{className:je("text-sm font-medium whitespace-nowrap animate-in fade-in duration-300 delay-200",w&&"font-semibold",!t&&"lg:hidden"),children:b.label})]})},b.path)})})]},y.title))})})]}),r&&c.jsx("div",{className:"fixed inset-0 z-40 bg-black/50 lg:hidden",onClick:()=>a(!1)}),c.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[c.jsxs("header",{className:"flex h-16 items-center justify-between border-b bg-card px-4",children:[c.jsx("div",{className:"flex items-center gap-4",children:c.jsx("button",{onClick:()=>a(!r),className:"rounded-lg p-2 hover:bg-accent lg:hidden",children:c.jsx(Rde,{className:"h-5 w-5"})})}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("button",{onClick:y=>{yhe(v==="dark"?"light":"dark",l,y)},className:"rounded-lg p-2 hover:bg-accent",title:v==="dark"?"切换到浅色模式":"切换到深色模式",children:v==="dark"?c.jsx(A5,{className:"h-5 w-5"}):c.jsx(j5,{className:"h-5 w-5"})}),c.jsx("div",{className:"h-6 w-px bg-border"}),c.jsxs(we,{variant:"ghost",size:"sm",onClick:g,className:"gap-2",title:"登出系统",children:[c.jsx(Tde,{className:"h-4 w-4"}),c.jsx("span",{className:"hidden sm:inline",children:"登出"})]})]})]}),c.jsx("main",{className:"flex-1 overflow-y-auto bg-background p-6",children:e})]})]})}const jg=g7({component:()=>c.jsxs(c.Fragment,{children:[c.jsx(D_,{}),!1]}),beforeLoad:()=>{if(window.location.pathname==="/"&&!$q())throw m$({to:"/auth"})}}),qxe=Gn({getParentRoute:()=>jg,path:"/auth",component:Ame}),ra=Gn({getParentRoute:()=>jg,id:"protected",component:()=>c.jsx(Bxe,{children:c.jsx(D_,{})})}),Uxe=Gn({getParentRoute:()=>ra,path:"/",component:vhe}),Fxe=Gn({getParentRoute:()=>ra,path:"/config/bot",component:hye}),Hxe=Gn({getParentRoute:()=>ra,path:"/config/modelProvider",component:kye}),Vxe=Gn({getParentRoute:()=>ra,path:"/config/model",component:lxe}),Gxe=Gn({getParentRoute:()=>ra,path:"/resource/emoji",component:vxe}),Kxe=Gn({getParentRoute:()=>ra,path:"/resource/expression",component:Axe}),Wxe=Gn({getParentRoute:()=>ra,path:"/resource/person",component:Mxe}),Yxe=Gn({getParentRoute:()=>ra,path:"/logs",component:$xe}),Xxe=Gn({getParentRoute:()=>ra,path:"/statistics",component:Ixe}),Zxe=Gn({getParentRoute:()=>ra,path:"/plugins",component:zxe}),Qxe=Gn({getParentRoute:()=>ra,path:"/settings",component:gme}),Jxe=Gn({getParentRoute:()=>jg,path:"*",component:Iq}),ebe=jg.addChildren([qxe,ra.addChildren([Uxe,Fxe,Hxe,Vxe,Gxe,Kxe,Wxe,Xxe,Zxe,Yxe,Qxe]),Jxe]),tbe=N7({routeTree:ebe,defaultNotFoundComponent:Iq});function nbe({children:e,defaultTheme:t="system",storageKey:n="ui-theme",...r}){const[a,o]=S.useState(()=>localStorage.getItem(n)||t);S.useEffect(()=>{const u=window.document.documentElement;if(u.classList.remove("light","dark"),a==="system"){const d=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";u.classList.add(d);return}u.classList.add(a)},[a]),S.useEffect(()=>{const u=localStorage.getItem("accent-color");if(u){const d=document.documentElement,p={blue:{hsl:"221.2 83.2% 53.3%",darkHsl:"217.2 91.2% 59.8%"},purple:{hsl:"271 91% 65%",darkHsl:"270 95% 75%"},green:{hsl:"142 71% 45%",darkHsl:"142 76% 36%"},orange:{hsl:"25 95% 53%",darkHsl:"20 90% 48%"},pink:{hsl:"330 81% 60%",darkHsl:"330 85% 70%"}}[u];p&&d.style.setProperty("--primary",p.hsl)}},[]);const l={theme:a,setTheme:u=>{localStorage.setItem(n,u),o(u)}};return c.jsx(N5.Provider,{...r,value:l,children:e})}function rbe({children:e,defaultEnabled:t=!0,defaultWavesEnabled:n=!0,storageKey:r="enable-animations",wavesStorageKey:a="enable-waves-background"}){const[o,l]=S.useState(()=>{const p=localStorage.getItem(r);return p!==null?p==="true":t}),[u,d]=S.useState(()=>{const p=localStorage.getItem(a);return p!==null?p==="true":n});S.useEffect(()=>{const p=document.documentElement;o?p.classList.remove("no-animations"):p.classList.add("no-animations"),localStorage.setItem(r,String(o))},[o,r]),S.useEffect(()=>{localStorage.setItem(a,String(u))},[u,a]);const h={enableAnimations:o,setEnableAnimations:l,enableWavesBackground:u,setEnableWavesBackground:d};return c.jsx(E5.Provider,{value:h,children:e})}var CO="ToastProvider",[RO,abe,ibe]=hv("Toast"),[q8]=Rr("Toast",[ibe]),[obe,_g]=q8(CO),U8=e=>{const{__scopeToast:t,label:n="Notification",duration:r=5e3,swipeDirection:a="right",swipeThreshold:o=50,children:l}=e,[u,d]=S.useState(null),[h,p]=S.useState(0),v=S.useRef(!1),g=S.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${CO}\`. Expected non-empty \`string\`.`),c.jsx(RO.Provider,{scope:t,children:c.jsx(obe,{scope:t,label:n,duration:r,swipeDirection:a,swipeThreshold:o,toastCount:h,viewport:u,onViewportChange:d,onToastAdd:S.useCallback(()=>p(y=>y+1),[]),onToastRemove:S.useCallback(()=>p(y=>y-1),[]),isFocusedToastEscapeKeyDownRef:v,isClosePausedRef:g,children:l})})};U8.displayName=CO;var F8="ToastViewport",sbe=["F8"],S_="toast.viewportPause",j_="toast.viewportResume",H8=S.forwardRef((e,t)=>{const{__scopeToast:n,hotkey:r=sbe,label:a="Notifications ({hotkey})",...o}=e,l=_g(F8,n),u=abe(n),d=S.useRef(null),h=S.useRef(null),p=S.useRef(null),v=S.useRef(null),g=Fe(t,v,l.onViewportChange),y=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),j=l.toastCount>0;S.useEffect(()=>{const w=A=>{r.length!==0&&r.every(N=>A[N]||A.code===N)&&v.current?.focus()};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[r]),S.useEffect(()=>{const w=d.current,A=v.current;if(j&&w&&A){const O=()=>{if(!l.isClosePausedRef.current){const C=new CustomEvent(S_);A.dispatchEvent(C),l.isClosePausedRef.current=!0}},N=()=>{if(l.isClosePausedRef.current){const C=new CustomEvent(j_);A.dispatchEvent(C),l.isClosePausedRef.current=!1}},T=C=>{!w.contains(C.relatedTarget)&&N()},E=()=>{w.contains(document.activeElement)||N()};return w.addEventListener("focusin",O),w.addEventListener("focusout",T),w.addEventListener("pointermove",O),w.addEventListener("pointerleave",E),window.addEventListener("blur",O),window.addEventListener("focus",N),()=>{w.removeEventListener("focusin",O),w.removeEventListener("focusout",T),w.removeEventListener("pointermove",O),w.removeEventListener("pointerleave",E),window.removeEventListener("blur",O),window.removeEventListener("focus",N)}}},[j,l.isClosePausedRef]);const b=S.useCallback(({tabbingDirection:w})=>{const O=u().map(N=>{const T=N.ref.current,E=[T,...bbe(T)];return w==="forwards"?E:E.reverse()});return(w==="forwards"?O.reverse():O).flat()},[u]);return S.useEffect(()=>{const w=v.current;if(w){const A=O=>{const N=O.altKey||O.ctrlKey||O.metaKey;if(O.key==="Tab"&&!N){const E=document.activeElement,C=O.shiftKey;if(O.target===w&&C){h.current?.focus();return}const M=b({tabbingDirection:C?"backwards":"forwards"}),U=M.findIndex($=>$===E);S1(M.slice(U+1))?O.preventDefault():C?h.current?.focus():p.current?.focus()}};return w.addEventListener("keydown",A),()=>w.removeEventListener("keydown",A)}},[u,b]),c.jsxs(Vhe,{ref:d,role:"region","aria-label":a.replace("{hotkey}",y),tabIndex:-1,style:{pointerEvents:j?void 0:"none"},children:[j&&c.jsx(__,{ref:h,onFocusFromOutsideViewport:()=>{const w=b({tabbingDirection:"forwards"});S1(w)}}),c.jsx(RO.Slot,{scope:n,children:c.jsx(De.ol,{tabIndex:-1,...o,ref:g})}),j&&c.jsx(__,{ref:p,onFocusFromOutsideViewport:()=>{const w=b({tabbingDirection:"backwards"});S1(w)}})]})});H8.displayName=F8;var V8="ToastFocusProxy",__=S.forwardRef((e,t)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...a}=e,o=_g(V8,n);return c.jsx(_O,{tabIndex:0,...a,ref:t,style:{position:"fixed"},onFocus:l=>{const u=l.relatedTarget;!o.viewport?.contains(u)&&r()}})});__.displayName=V8;var $d="Toast",lbe="toast.swipeStart",cbe="toast.swipeMove",ube="toast.swipeCancel",fbe="toast.swipeEnd",G8=S.forwardRef((e,t)=>{const{forceMount:n,open:r,defaultOpen:a,onOpenChange:o,...l}=e,[u,d]=za({prop:r,defaultProp:a??!0,onChange:o,caller:$d});return c.jsx(Pr,{present:n||u,children:c.jsx(pbe,{open:u,...l,ref:t,onClose:()=>d(!1),onPause:nn(e.onPause),onResume:nn(e.onResume),onSwipeStart:Oe(e.onSwipeStart,h=>{h.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:Oe(e.onSwipeMove,h=>{const{x:p,y:v}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","move"),h.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${p}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${v}px`)}),onSwipeCancel:Oe(e.onSwipeCancel,h=>{h.currentTarget.setAttribute("data-swipe","cancel"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:Oe(e.onSwipeEnd,h=>{const{x:p,y:v}=h.detail.delta;h.currentTarget.setAttribute("data-swipe","end"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),h.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),h.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${p}px`),h.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${v}px`),d(!1)})})})});G8.displayName=$d;var[dbe,hbe]=q8($d,{onClose(){}}),pbe=S.forwardRef((e,t)=>{const{__scopeToast:n,type:r="foreground",duration:a,open:o,onClose:l,onEscapeKeyDown:u,onPause:d,onResume:h,onSwipeStart:p,onSwipeMove:v,onSwipeCancel:g,onSwipeEnd:y,...j}=e,b=_g($d,n),[w,A]=S.useState(null),O=Fe(t,F=>A(F)),N=S.useRef(null),T=S.useRef(null),E=a||b.duration,C=S.useRef(0),R=S.useRef(E),k=S.useRef(0),{onToastAdd:M,onToastRemove:U}=b,$=nn(()=>{w?.contains(document.activeElement)&&b.viewport?.focus(),l()}),z=S.useCallback(F=>{!F||F===1/0||(window.clearTimeout(k.current),C.current=new Date().getTime(),k.current=window.setTimeout($,F))},[$]);S.useEffect(()=>{const F=b.viewport;if(F){const G=()=>{z(R.current),h?.()},L=()=>{const q=new Date().getTime()-C.current;R.current=R.current-q,window.clearTimeout(k.current),d?.()};return F.addEventListener(S_,L),F.addEventListener(j_,G),()=>{F.removeEventListener(S_,L),F.removeEventListener(j_,G)}}},[b.viewport,E,d,h,z]),S.useEffect(()=>{o&&!b.isClosePausedRef.current&&z(E)},[o,E,b.isClosePausedRef,z]),S.useEffect(()=>(M(),()=>U()),[M,U]);const V=S.useMemo(()=>w?J8(w):null,[w]);return b.viewport?c.jsxs(c.Fragment,{children:[V&&c.jsx(mbe,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite",children:V}),c.jsx(dbe,{scope:n,onClose:$,children:Es.createPortal(c.jsx(RO.ItemSlot,{scope:n,children:c.jsx(Hhe,{asChild:!0,onEscapeKeyDown:Oe(u,()=>{b.isFocusedToastEscapeKeyDownRef.current||$(),b.isFocusedToastEscapeKeyDownRef.current=!1}),children:c.jsx(De.li,{tabIndex:0,"data-state":o?"open":"closed","data-swipe-direction":b.swipeDirection,...j,ref:O,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:Oe(e.onKeyDown,F=>{F.key==="Escape"&&(u?.(F.nativeEvent),F.nativeEvent.defaultPrevented||(b.isFocusedToastEscapeKeyDownRef.current=!0,$()))}),onPointerDown:Oe(e.onPointerDown,F=>{F.button===0&&(N.current={x:F.clientX,y:F.clientY})}),onPointerMove:Oe(e.onPointerMove,F=>{if(!N.current)return;const G=F.clientX-N.current.x,L=F.clientY-N.current.y,q=!!T.current,H=["left","right"].includes(b.swipeDirection),ee=["left","up"].includes(b.swipeDirection)?Math.min:Math.max,ve=H?ee(0,G):0,I=H?0:ee(0,L),B=F.pointerType==="touch"?10:2,Y={x:ve,y:I},te={originalEvent:F,delta:Y};q?(T.current=Y,Ep(cbe,v,te,{discrete:!1})):u$(Y,b.swipeDirection,B)?(T.current=Y,Ep(lbe,p,te,{discrete:!1}),F.target.setPointerCapture(F.pointerId)):(Math.abs(G)>B||Math.abs(L)>B)&&(N.current=null)}),onPointerUp:Oe(e.onPointerUp,F=>{const G=T.current,L=F.target;if(L.hasPointerCapture(F.pointerId)&&L.releasePointerCapture(F.pointerId),T.current=null,N.current=null,G){const q=F.currentTarget,H={originalEvent:F,delta:G};u$(G,b.swipeDirection,b.swipeThreshold)?Ep(fbe,y,H,{discrete:!0}):Ep(ube,g,H,{discrete:!0}),q.addEventListener("click",ee=>ee.preventDefault(),{once:!0})}})})})}),b.viewport)})]}):null}),mbe=e=>{const{__scopeToast:t,children:n,...r}=e,a=_g($d,t),[o,l]=S.useState(!1),[u,d]=S.useState(!1);return ybe(()=>l(!0)),S.useEffect(()=>{const h=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(h)},[]),u?null:c.jsx(Rd,{asChild:!0,children:c.jsx(_O,{...r,children:o&&c.jsxs(c.Fragment,{children:[a.label," ",n]})})})},vbe="ToastTitle",K8=S.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return c.jsx(De.div,{...r,ref:t})});K8.displayName=vbe;var gbe="ToastDescription",W8=S.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e;return c.jsx(De.div,{...r,ref:t})});W8.displayName=gbe;var Y8="ToastAction",X8=S.forwardRef((e,t)=>{const{altText:n,...r}=e;return n.trim()?c.jsx(Q8,{altText:n,asChild:!0,children:c.jsx(PO,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Y8}\`. Expected non-empty \`string\`.`),null)});X8.displayName=Y8;var Z8="ToastClose",PO=S.forwardRef((e,t)=>{const{__scopeToast:n,...r}=e,a=hbe(Z8,n);return c.jsx(Q8,{asChild:!0,children:c.jsx(De.button,{type:"button",...r,ref:t,onClick:Oe(e.onClick,a.onClose)})})});PO.displayName=Z8;var Q8=S.forwardRef((e,t)=>{const{__scopeToast:n,altText:r,...a}=e;return c.jsx(De.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...a,ref:t})});function J8(e){const t=[];return Array.from(e.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&t.push(r.textContent),xbe(r)){const a=r.ariaHidden||r.hidden||r.style.display==="none",o=r.dataset.radixToastAnnounceExclude==="";if(!a)if(o){const l=r.dataset.radixToastAnnounceAlt;l&&t.push(l)}else t.push(...J8(r))}}),t}function Ep(e,t,n,{discrete:r}){const a=n.originalEvent.currentTarget,o=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&a.addEventListener(e,t,{once:!0}),r?d3(a,o):a.dispatchEvent(o)}var u$=(e,t,n=0)=>{const r=Math.abs(e.x),a=Math.abs(e.y),o=r>a;return t==="left"||t==="right"?o&&r>n:!o&&a>n};function ybe(e=()=>{}){const t=nn(e);Sn(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[t])}function xbe(e){return e.nodeType===e.ELEMENT_NODE}function bbe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const a=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||a?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function S1(e){const t=document.activeElement;return e.some(n=>n===t?!0:(n.focus(),document.activeElement!==t))}var wbe=U8,eU=H8,tU=G8,nU=K8,rU=W8,aU=X8,iU=PO;const Sbe=wbe,oU=S.forwardRef(({className:e,...t},n)=>c.jsx(eU,{ref:n,className:je("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",e),...t}));oU.displayName=eU.displayName;const jbe=tg("group pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-md border p-4 pr-6 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),sU=S.forwardRef(({className:e,variant:t,...n},r)=>c.jsx(tU,{ref:r,className:je(jbe({variant:t}),e),...n}));sU.displayName=tU.displayName;const _be=S.forwardRef(({className:e,...t},n)=>c.jsx(aU,{ref:n,className:je("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium transition-colors hover:bg-secondary focus:outline-none focus:ring-1 focus:ring-ring disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",e),...t}));_be.displayName=aU.displayName;const lU=S.forwardRef(({className:e,...t},n)=>c.jsx(iU,{ref:n,className:je("absolute right-1 top-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-1 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",e),"toast-close":"",...t,children:c.jsx(QA,{className:"h-4 w-4"})}));lU.displayName=iU.displayName;const cU=S.forwardRef(({className:e,...t},n)=>c.jsx(nU,{ref:n,className:je("text-sm font-semibold [&+div]:text-xs",e),...t}));cU.displayName=nU.displayName;const uU=S.forwardRef(({className:e,...t},n)=>c.jsx(rU,{ref:n,className:je("text-sm opacity-90",e),...t}));uU.displayName=rU.displayName;function Abe(){const{toasts:e}=na();return c.jsxs(Sbe,{children:[e.map(function({id:t,title:n,description:r,action:a,...o}){return c.jsxs(sU,{...o,children:[c.jsxs("div",{className:"grid gap-1",children:[n&&c.jsx(cU,{children:n}),r&&c.jsx(uU,{children:r})]}),a,c.jsx(lU,{})]},t)}),c.jsx(oU,{})]})}zH.createRoot(document.getElementById("root")).render(c.jsx(S.StrictMode,{children:c.jsx(nbe,{defaultTheme:"system",children:c.jsxs(rbe,{children:[c.jsx(C7,{router:tbe}),c.jsx(Abe,{})]})})}));