@kaitranntt/ccs 7.5.1-dev.2 → 7.5.1-dev.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cliproxy/auth/oauth-process.d.ts.map +1 -1
- package/dist/cliproxy/auth/oauth-process.js +84 -12
- package/dist/cliproxy/auth/oauth-process.js.map +1 -1
- package/dist/cliproxy/device-code-handler.d.ts +28 -0
- package/dist/cliproxy/device-code-handler.d.ts.map +1 -0
- package/dist/cliproxy/device-code-handler.js +22 -0
- package/dist/cliproxy/device-code-handler.js.map +1 -0
- package/dist/ui/assets/{accounts-CtHoujzN.js → accounts-aD3ar9cM.js} +1 -1
- package/dist/ui/assets/{api-BgRcDdEY.js → api-Dc9JX5dn.js} +1 -1
- package/dist/ui/assets/{card-B-B2DgVt.js → card-CfbpiPgZ.js} +1 -1
- package/dist/ui/assets/{cliproxy-control-panel-BQdbegqA.js → cliproxy-control-panel-DqwBL_cO.js} +1 -1
- package/dist/ui/assets/{cliproxy-DSIqB4Kc.js → cliproxy-j1dekKPD.js} +1 -1
- package/dist/ui/assets/{confirm-dialog-cDuBPIIs.js → confirm-dialog-CbU1b1dF.js} +1 -1
- package/dist/ui/assets/{copilot-6gXCaKKj.js → copilot-CV5W8I2b.js} +3 -3
- package/dist/ui/assets/{globalenv-section-CRSV4042.js → globalenv-section-BD-Z41zV.js} +1 -1
- package/dist/ui/assets/{health-xBbBsgEt.js → health-DLMVq9vP.js} +1 -1
- package/dist/ui/assets/icons-B9mnOvwW.js +1 -0
- package/dist/ui/assets/{index-_cwEsFjm.js → index-BYJzZId9.js} +1 -1
- package/dist/ui/assets/index-CMv3XJ3a.css +1 -0
- package/dist/ui/assets/{index-BlJMdTol.js → index-CRwxNrlp.js} +1 -1
- package/dist/ui/assets/{index-CzA8ALA7.js → index-DTR-v1v5.js} +1 -1
- package/dist/ui/assets/index-PsnnKb2L.js +47 -0
- package/dist/ui/assets/{shared-DjYeuzbT.js → shared-BSfovmYC.js} +1 -1
- package/dist/ui/assets/{switch-DrBe8HmQ.js → switch-I-rTblpG.js} +1 -1
- package/dist/ui/index.html +3 -3
- package/dist/web-server/websocket.d.ts.map +1 -1
- package/dist/web-server/websocket.js +44 -0
- package/dist/web-server/websocket.js.map +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/icons-ChQ4a4K4.js +0 -1
- package/dist/ui/assets/index-DAT_KnOX.css +0 -1
- package/dist/ui/assets/index-DtFSv99a.js +0 -47
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-CRwxNrlp.js","assets/radix-ui-CrW4rUOS.js","assets/react-vendor-B_CU-WTZ.js","assets/switch-I-rTblpG.js","assets/icons-B9mnOvwW.js","assets/tanstack-Dbfprw6o.js","assets/notifications-dJQY2-U6.js","assets/utils-CzKF5WmX.js","assets/form-utils-kUVlZZAO.js","assets/code-highlight-DKN39ySy.js","assets/globalenv-section-BD-Z41zV.js","assets/index-BYJzZId9.js","assets/index-DTR-v1v5.js","assets/card-CfbpiPgZ.js","assets/charts-CJC4bH8P.js","assets/api-Dc9JX5dn.js","assets/confirm-dialog-CbU1b1dF.js","assets/cliproxy-j1dekKPD.js","assets/cliproxy-control-panel-DqwBL_cO.js","assets/copilot-CV5W8I2b.js","assets/accounts-aD3ar9cM.js","assets/health-DLMVq9vP.js","assets/shared-BSfovmYC.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as o,S as Bo,R as kp,C as Rp,a as Up,T as Bp,D as Hp,P as qp,O as Lp,b as Mx,c as zx,d as Tx,e as Ox,f as Ax,A as Dx,g as _x,h as kx,i as Rx,k as Yp,V as Ux,l as Bx,m as Gp,n as Hx,L as Kp,o as Vp,p as Qp,q as qx,r as Lx,s as Xp,I as Yx,t as Zp,u as Wp,v as Gx,w as Jp,x as Kx,y as $p,z as Fp,B as Vx,E as Qx,F as Ip,G as Xx,H as Zx,J as Wx,K as Jx,M as Pp,N as $x,Q as Fx,U as Ix}from"./radix-ui-CrW4rUOS.js";import{e as eg,f as Px,r as v,u as e0,L as wc,O as t0,R as n0,h as a0,g as l0,i as s0,c as P,B as i0,j as o0,k as bn}from"./react-vendor-B_CU-WTZ.js";import{Q as r0,u as an,a as Ot,b as Cn,c as u0}from"./tanstack-Dbfprw6o.js";import{t as Ae,T as c0}from"./notifications-dJQY2-U6.js";import{t as d0,c as f0,a as Ho,e as Fs,f as ei,b as m0,d as h0,g as p0,h as g0,i as y0,j as v0,k as x0,l as b0,m as S0,n as N0,o as j0,p as C0,q as E0,r as w0,s as M0,u as z0,v as T0,w as O0,x as A0,y as D0,z as _0,A as k0,B as R0,C as U0,D as B0,E as H0,F as q0,G as L0,H as Y0,I as G0,J as K0}from"./utils-CzKF5WmX.js";import{X as ui,P as V0,H as Q0,C as X0,K as tg,G as Z0,Z as ng,a as ag,F as lg,U as sg,A as si,S as W0,b as qo,c as J0,M as $0,E as Lo,d as Yo,B as F0,W as I0,e as Xh,f as P0,g as eb,h as Zh,i as Wh,L as ci,j as es,k as tb,l as _o,m as ig,n as Go,o as Ac,p as Ko,R as nb,q as ab,r as lb,s as og,I as Vo,T as sb,t as ib,u as ob,v as rb,w as Dc,x as ub,y as cb,z as _c,D as Qo,J as kc,N as Jh,O as db,Q as fb,V as mb,Y as hb,_ as $h,$ as Fh,a0 as pb}from"./icons-B9mnOvwW.js";import{o as Ih,s as Ph,p as gb,a as yb,$ as vb,b as rg,c as xb,d as ll,u as bb,e as Sb}from"./form-utils-kUVlZZAO.js";import{H as Nb,t as ep}from"./code-highlight-DKN39ySy.js";(function(){const s=document.createElement("link").relList;if(s&&s.supports&&s.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))c(d);new MutationObserver(d=>{for(const m of d)if(m.type==="childList")for(const h of m.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&c(h)}).observe(document,{childList:!0,subtree:!0});function r(d){const m={};return d.integrity&&(m.integrity=d.integrity),d.referrerPolicy&&(m.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?m.credentials="include":d.crossOrigin==="anonymous"?m.credentials="omit":m.credentials="same-origin",m}function c(d){if(d.ep)return;d.ep=!0;const m=r(d);fetch(d.href,m)}})();var fc={exports:{}},Is={},mc={exports:{}},hc={};var tp;function jb(){return tp||(tp=1,(function(l){function s(D,J){var le=D.length;D.push(J);e:for(;0<le;){var ve=le-1>>>1,xe=D[ve];if(0<d(xe,J))D[ve]=J,D[le]=xe,le=ve;else break e}}function r(D){return D.length===0?null:D[0]}function c(D){if(D.length===0)return null;var J=D[0],le=D.pop();if(le!==J){D[0]=le;e:for(var ve=0,xe=D.length,Te=xe>>>1;ve<Te;){var de=2*(ve+1)-1,X=D[de],F=de+1,ae=D[F];if(0>d(X,le))F<xe&&0>d(ae,X)?(D[ve]=ae,D[F]=le,ve=F):(D[ve]=X,D[de]=le,ve=de);else if(F<xe&&0>d(ae,le))D[ve]=ae,D[F]=le,ve=F;else break e}}return J}function d(D,J){var le=D.sortIndex-J.sortIndex;return le!==0?le:D.id-J.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var m=performance;l.unstable_now=function(){return m.now()}}else{var h=Date,p=h.now();l.unstable_now=function(){return h.now()-p}}var y=[],N=[],E=1,x=null,b=3,_=!1,O=!1,k=!1,U=!1,M=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,G=typeof setImmediate<"u"?setImmediate:null;function q(D){for(var J=r(N);J!==null;){if(J.callback===null)c(N);else if(J.startTime<=D)c(N),J.sortIndex=J.expirationTime,s(y,J);else break;J=r(N)}}function B(D){if(k=!1,q(D),!O)if(r(y)!==null)O=!0,j||(j=!0,re());else{var J=r(N);J!==null&&ie(B,J.startTime-D)}}var j=!1,L=-1,W=5,ee=-1;function he(){return U?!0:!(l.unstable_now()-ee<W)}function be(){if(U=!1,j){var D=l.unstable_now();ee=D;var J=!0;try{e:{O=!1,k&&(k=!1,V(L),L=-1),_=!0;var le=b;try{t:{for(q(D),x=r(y);x!==null&&!(x.expirationTime>D&&he());){var ve=x.callback;if(typeof ve=="function"){x.callback=null,b=x.priorityLevel;var xe=ve(x.expirationTime<=D);if(D=l.unstable_now(),typeof xe=="function"){x.callback=xe,q(D),J=!0;break t}x===r(y)&&c(y),q(D)}else c(y);x=r(y)}if(x!==null)J=!0;else{var Te=r(N);Te!==null&&ie(B,Te.startTime-D),J=!1}}break e}finally{x=null,b=le,_=!1}J=void 0}}finally{J?re():j=!1}}}var re;if(typeof G=="function")re=function(){G(be)};else if(typeof MessageChannel<"u"){var Ye=new MessageChannel,$=Ye.port2;Ye.port1.onmessage=be,re=function(){$.postMessage(null)}}else re=function(){M(be,0)};function ie(D,J){L=M(function(){D(l.unstable_now())},J)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(D){D.callback=null},l.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):W=0<D?Math.floor(1e3/D):5},l.unstable_getCurrentPriorityLevel=function(){return b},l.unstable_next=function(D){switch(b){case 1:case 2:case 3:var J=3;break;default:J=b}var le=b;b=J;try{return D()}finally{b=le}},l.unstable_requestPaint=function(){U=!0},l.unstable_runWithPriority=function(D,J){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var le=b;b=D;try{return J()}finally{b=le}},l.unstable_scheduleCallback=function(D,J,le){var ve=l.unstable_now();switch(typeof le=="object"&&le!==null?(le=le.delay,le=typeof le=="number"&&0<le?ve+le:ve):le=ve,D){case 1:var xe=-1;break;case 2:xe=250;break;case 5:xe=1073741823;break;case 4:xe=1e4;break;default:xe=5e3}return xe=le+xe,D={id:E++,callback:J,priorityLevel:D,startTime:le,expirationTime:xe,sortIndex:-1},le>ve?(D.sortIndex=le,s(N,D),r(y)===null&&D===r(N)&&(k?(V(L),L=-1):k=!0,ie(B,le-ve))):(D.sortIndex=xe,s(y,D),O||_||(O=!0,j||(j=!0,re()))),D},l.unstable_shouldYield=he,l.unstable_wrapCallback=function(D){var J=b;return function(){var le=b;b=J;try{return D.apply(this,arguments)}finally{b=le}}}})(hc)),hc}var np;function Cb(){return np||(np=1,mc.exports=jb()),mc.exports}var ap;function Eb(){if(ap)return Is;ap=1;var l=Cb(),s=eg(),r=Px();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function m(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function h(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(m(e)!==e)throw Error(c(188))}function N(e){var t=e.alternate;if(!t){if(t=m(e),t===null)throw Error(c(188));return t!==e?null:e}for(var n=e,a=t;;){var i=n.return;if(i===null)break;var u=i.alternate;if(u===null){if(a=i.return,a!==null){n=a;continue}break}if(i.child===u.child){for(u=i.child;u;){if(u===n)return y(i),e;if(u===a)return y(i),t;u=u.sibling}throw Error(c(188))}if(n.return!==a.return)n=i,a=u;else{for(var f=!1,g=i.child;g;){if(g===n){f=!0,n=i,a=u;break}if(g===a){f=!0,a=i,n=u;break}g=g.sibling}if(!f){for(g=u.child;g;){if(g===n){f=!0,n=u,a=i;break}if(g===a){f=!0,a=u,n=i;break}g=g.sibling}if(!f)throw Error(c(189))}}if(n.alternate!==a)throw Error(c(190))}if(n.tag!==3)throw Error(c(188));return n.stateNode.current===n?e:t}function E(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=E(e),t!==null)return t;e=e.sibling}return null}var x=Object.assign,b=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),O=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),U=Symbol.for("react.strict_mode"),M=Symbol.for("react.profiler"),V=Symbol.for("react.consumer"),G=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),j=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),W=Symbol.for("react.lazy"),ee=Symbol.for("react.activity"),he=Symbol.for("react.memo_cache_sentinel"),be=Symbol.iterator;function re(e){return e===null||typeof e!="object"?null:(e=be&&e[be]||e["@@iterator"],typeof e=="function"?e:null)}var Ye=Symbol.for("react.client.reference");function $(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ye?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case k:return"Fragment";case M:return"Profiler";case U:return"StrictMode";case B:return"Suspense";case j:return"SuspenseList";case ee:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case O:return"Portal";case G:return e.displayName||"Context";case V:return(e._context.displayName||"Context")+".Consumer";case q:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case L:return t=e.displayName||null,t!==null?t:$(e.type)||"Memo";case W:t=e._payload,e=e._init;try{return $(e(t))}catch{}}return null}var ie=Array.isArray,D=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,J=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},ve=[],xe=-1;function Te(e){return{current:e}}function de(e){0>xe||(e.current=ve[xe],ve[xe]=null,xe--)}function X(e,t){xe++,ve[xe]=e.current,e.current=t}var F=Te(null),ae=Te(null),I=Te(null),ne=Te(null);function ye(e,t){switch(X(I,t),X(ae,e),X(F,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?ph(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=ph(t),e=gh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}de(F),X(F,e)}function Oe(){de(F),de(ae),de(I)}function Ge(e){e.memoizedState!==null&&X(ne,e);var t=F.current,n=gh(t,e.type);t!==n&&(X(ae,e),X(F,n))}function ht(e){ae.current===e&&(de(F),de(ae)),ne.current===e&&(de(ne),Zs._currentValue=le)}var pt,Ve;function et(e){if(pt===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);pt=t&&t[1]||"",Ve=-1<n.stack.indexOf(`
|
|
3
|
+
at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
+
`+pt+e+Ve}var At=!1;function Gt(e,t){if(!e||At)return"";At=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var a={DetermineComponentFrameRoot:function(){try{if(t){var K=function(){throw Error()};if(Object.defineProperty(K.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(K,[])}catch(R){var A=R}Reflect.construct(e,[],K)}else{try{K.call()}catch(R){A=R}e.call(K.prototype)}}else{try{throw Error()}catch(R){A=R}(K=e())&&typeof K.catch=="function"&&K.catch(function(){})}}catch(R){if(R&&A&&typeof R.stack=="string")return[R.stack,A.stack]}return[null,null]}};a.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(a.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(a.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var u=a.DetermineComponentFrameRoot(),f=u[0],g=u[1];if(f&&g){var S=f.split(`
|
|
5
|
+
`),T=g.split(`
|
|
6
|
+
`);for(i=a=0;a<S.length&&!S[a].includes("DetermineComponentFrameRoot");)a++;for(;i<T.length&&!T[i].includes("DetermineComponentFrameRoot");)i++;if(a===S.length||i===T.length)for(a=S.length-1,i=T.length-1;1<=a&&0<=i&&S[a]!==T[i];)i--;for(;1<=a&&0<=i;a--,i--)if(S[a]!==T[i]){if(a!==1||i!==1)do if(a--,i--,0>i||S[a]!==T[i]){var H=`
|
|
7
|
+
`+S[a].replace(" at new "," at ");return e.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",e.displayName)),H}while(1<=a&&0<=i);break}}}finally{At=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?et(n):""}function Un(e,t){switch(e.tag){case 26:case 27:case 5:return et(e.type);case 16:return et("Lazy");case 13:return e.child!==t&&t!==null?et("Suspense Fallback"):et("Suspense");case 19:return et("SuspenseList");case 0:case 15:return Gt(e.type,!1);case 11:return Gt(e.type.render,!1);case 1:return Gt(e.type,!0);case 31:return et("Activity");default:return""}}function Ne(e){try{var t="",n=null;do t+=Un(e,n),n=e,e=e.return;while(e);return t}catch(a){return`
|
|
8
|
+
Error generating stack: `+a.message+`
|
|
9
|
+
`+a.stack}}var Kt=Object.prototype.hasOwnProperty,En=l.unstable_scheduleCallback,Vt=l.unstable_cancelCallback,ca=l.unstable_shouldYield,Bn=l.unstable_requestPaint,ot=l.unstable_now,Qt=l.unstable_getCurrentPriorityLevel,Hn=l.unstable_ImmediatePriority,qa=l.unstable_UserBlockingPriority,wn=l.unstable_NormalPriority,Mn=l.unstable_LowPriority,ul=l.unstable_IdlePriority,ns=l.log,as=l.unstable_setDisableYieldValue,qn=null,Z=null;function Ee(e){if(typeof ns=="function"&&as(e),Z&&typeof Z.setStrictMode=="function")try{Z.setStrictMode(qn,e)}catch{}}var fe=Math.clz32?Math.clz32:oe,we=Math.log,tt=Math.LN2;function oe(e){return e>>>=0,e===0?32:31-(we(e)/tt|0)|0}var Se=256,me=262144,Me=4194304;function Fe(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ge(e,t,n){var a=e.pendingLanes;if(a===0)return 0;var i=0,u=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var g=a&134217727;return g!==0?(a=g&~u,a!==0?i=Fe(a):(f&=g,f!==0?i=Fe(f):n||(n=g&~e,n!==0&&(i=Fe(n))))):(g=a&~u,g!==0?i=Fe(g):f!==0?i=Fe(f):n||(n=a&~e,n!==0&&(i=Fe(n)))),i===0?0:t!==0&&t!==i&&(t&u)===0&&(u=i&-i,n=t&-t,u>=n||u===32&&(n&4194048)!==0)?t:i}function zt(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ln(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function yt(){var e=Me;return Me<<=1,(Me&62914560)===0&&(Me=4194304),e}function Xt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function gn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ls(e,t,n,a,i,u){var f=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var g=e.entanglements,S=e.expirationTimes,T=e.hiddenUpdates;for(n=f&~n;0<n;){var H=31-fe(n),K=1<<H;g[H]=0,S[H]=-1;var A=T[H];if(A!==null)for(T[H]=null,H=0;H<A.length;H++){var R=A[H];R!==null&&(R.lane&=-536870913)}n&=~K}a!==0&&La(e,a,0),u!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=u&~(f&~t))}function La(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var a=31-fe(t);e.entangledLanes|=t,e.entanglements[a]=e.entanglements[a]|1073741824|n&261930}function ss(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var a=31-fe(n),i=1<<a;i&t|e[a]&t&&(e[a]|=t),n&=~i}}function ln(e,t){var n=t&-t;return n=(n&42)!==0?1:Yn(n),(n&(e.suspendedLanes|t))!==0?0:n}function Yn(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function cl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function is(){var e=J.p;return e!==0?e:(e=window.event,e===void 0?32:qh(e.type))}function os(e,t){var n=J.p;try{return J.p=e,t()}finally{J.p=n}}var da=Math.random().toString(36).slice(2),Nt="__reactFiber$"+da,Dt="__reactProps$"+da,dl="__reactContainer$"+da,ar="__reactEvents$"+da,gy="__reactListeners$"+da,yy="__reactHandles$"+da,td="__reactResources$"+da,rs="__reactMarker$"+da;function lr(e){delete e[Nt],delete e[Dt],delete e[ar],delete e[gy],delete e[yy]}function fl(e){var t=e[Nt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[dl]||n[Nt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=jh(e);e!==null;){if(n=e[Nt])return n;e=jh(e)}return t}e=n,n=e.parentNode}return null}function ml(e){if(e=e[Nt]||e[dl]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function us(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function hl(e){var t=e[td];return t||(t=e[td]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function vt(e){e[rs]=!0}var nd=new Set,ad={};function Ya(e,t){pl(e,t),pl(e+"Capture",t)}function pl(e,t){for(ad[e]=t,e=0;e<t.length;e++)nd.add(t[e])}var vy=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),ld={},sd={};function xy(e){return Kt.call(sd,e)?!0:Kt.call(ld,e)?!1:vy.test(e)?sd[e]=!0:(ld[e]=!0,!1)}function mi(e,t,n){if(xy(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var a=t.toLowerCase().slice(0,5);if(a!=="data-"&&a!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+n)}}function hi(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+n)}}function Gn(e,t,n,a){if(a===null)e.removeAttribute(n);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,""+a)}}function sn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function id(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function by(e,t,n){var a=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var i=a.get,u=a.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(f){n=""+f,u.call(this,f)}}),Object.defineProperty(e,t,{enumerable:a.enumerable}),{getValue:function(){return n},setValue:function(f){n=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function sr(e){if(!e._valueTracker){var t=id(e)?"checked":"value";e._valueTracker=by(e,t,""+e[t])}}function od(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),a="";return e&&(a=id(e)?e.checked?"true":"false":e.value),e=a,e!==n?(t.setValue(e),!0):!1}function pi(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Sy=/[\n"\\]/g;function on(e){return e.replace(Sy,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function ir(e,t,n,a,i,u,f,g){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+sn(t)):e.value!==""+sn(t)&&(e.value=""+sn(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?or(e,f,sn(t)):n!=null?or(e,f,sn(n)):a!=null&&e.removeAttribute("value"),i==null&&u!=null&&(e.defaultChecked=!!u),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.name=""+sn(g):e.removeAttribute("name")}function rd(e,t,n,a,i,u,f,g){if(u!=null&&typeof u!="function"&&typeof u!="symbol"&&typeof u!="boolean"&&(e.type=u),t!=null||n!=null){if(!(u!=="submit"&&u!=="reset"||t!=null)){sr(e);return}n=n!=null?""+sn(n):"",t=t!=null?""+sn(t):n,g||t===e.value||(e.value=t),e.defaultValue=t}a=a??i,a=typeof a!="function"&&typeof a!="symbol"&&!!a,e.checked=g?e.checked:!!a,e.defaultChecked=!!a,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),sr(e)}function or(e,t,n){t==="number"&&pi(e.ownerDocument)===e||e.defaultValue===""+n||(e.defaultValue=""+n)}function gl(e,t,n,a){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&a&&(e[n].defaultSelected=!0)}else{for(n=""+sn(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,a&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function ud(e,t,n){if(t!=null&&(t=""+sn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+sn(n):""}function cd(e,t,n,a){if(t==null){if(a!=null){if(n!=null)throw Error(c(92));if(ie(a)){if(1<a.length)throw Error(c(93));a=a[0]}n=a}n==null&&(n=""),t=n}n=sn(t),e.defaultValue=n,a=e.textContent,a===n&&a!==""&&a!==null&&(e.value=a),sr(e)}function yl(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Ny=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function dd(e,t,n){var a=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?a?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":a?e.setProperty(t,n):typeof n!="number"||n===0||Ny.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function fd(e,t,n){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,n!=null){for(var a in n)!n.hasOwnProperty(a)||t!=null&&t.hasOwnProperty(a)||(a.indexOf("--")===0?e.setProperty(a,""):a==="float"?e.cssFloat="":e[a]="");for(var i in t)a=t[i],t.hasOwnProperty(i)&&n[i]!==a&&dd(e,i,a)}else for(var u in t)t.hasOwnProperty(u)&&dd(e,u,t[u])}function rr(e){if(e.indexOf("-")===-1)return!1;switch(e){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var jy=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Cy=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function gi(e){return Cy.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Kn(){}var ur=null;function cr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var vl=null,xl=null;function md(e){var t=ml(e);if(t&&(e=t.stateNode)){var n=e[Dt]||null;e:switch(e=t.stateNode,t.type){case"input":if(ir(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+on(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var a=n[t];if(a!==e&&a.form===e.form){var i=a[Dt]||null;if(!i)throw Error(c(90));ir(a,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)a=n[t],a.form===e.form&&od(a)}break e;case"textarea":ud(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&gl(e,!!n.multiple,t,!1)}}}var dr=!1;function hd(e,t,n){if(dr)return e(t,n);dr=!0;try{var a=e(t);return a}finally{if(dr=!1,(vl!==null||xl!==null)&&(ao(),vl&&(t=vl,e=xl,xl=vl=null,md(t),e)))for(t=0;t<e.length;t++)md(e[t])}}function cs(e,t){var n=e.stateNode;if(n===null)return null;var a=n[Dt]||null;if(a===null)return null;n=a[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(a=!a.disabled)||(e=e.type,a=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!a;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(c(231,t,typeof n));return n}var Vn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),fr=!1;if(Vn)try{var ds={};Object.defineProperty(ds,"passive",{get:function(){fr=!0}}),window.addEventListener("test",ds,ds),window.removeEventListener("test",ds,ds)}catch{fr=!1}var fa=null,mr=null,yi=null;function pd(){if(yi)return yi;var e,t=mr,n=t.length,a,i="value"in fa?fa.value:fa.textContent,u=i.length;for(e=0;e<n&&t[e]===i[e];e++);var f=n-e;for(a=1;a<=f&&t[n-a]===i[u-a];a++);return yi=i.slice(e,1<a?1-a:void 0)}function vi(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function xi(){return!0}function gd(){return!1}function _t(e){function t(n,a,i,u,f){this._reactName=n,this._targetInst=i,this.type=a,this.nativeEvent=u,this.target=f,this.currentTarget=null;for(var g in e)e.hasOwnProperty(g)&&(n=e[g],this[g]=n?n(u):u[g]);return this.isDefaultPrevented=(u.defaultPrevented!=null?u.defaultPrevented:u.returnValue===!1)?xi:gd,this.isPropagationStopped=gd,this}return x(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=xi)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=xi)},persist:function(){},isPersistent:xi}),t}var Ga={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},bi=_t(Ga),fs=x({},Ga,{view:0,detail:0}),Ey=_t(fs),hr,pr,ms,Si=x({},fs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:yr,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ms&&(ms&&e.type==="mousemove"?(hr=e.screenX-ms.screenX,pr=e.screenY-ms.screenY):pr=hr=0,ms=e),hr)},movementY:function(e){return"movementY"in e?e.movementY:pr}}),yd=_t(Si),wy=x({},Si,{dataTransfer:0}),My=_t(wy),zy=x({},fs,{relatedTarget:0}),gr=_t(zy),Ty=x({},Ga,{animationName:0,elapsedTime:0,pseudoElement:0}),Oy=_t(Ty),Ay=x({},Ga,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Dy=_t(Ay),_y=x({},Ga,{data:0}),vd=_t(_y),ky={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ry={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Uy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function By(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Uy[e])?!!t[e]:!1}function yr(){return By}var Hy=x({},fs,{key:function(e){if(e.key){var t=ky[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=vi(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ry[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:yr,charCode:function(e){return e.type==="keypress"?vi(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?vi(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),qy=_t(Hy),Ly=x({},Si,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),xd=_t(Ly),Yy=x({},fs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:yr}),Gy=_t(Yy),Ky=x({},Ga,{propertyName:0,elapsedTime:0,pseudoElement:0}),Vy=_t(Ky),Qy=x({},Si,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Xy=_t(Qy),Zy=x({},Ga,{newState:0,oldState:0}),Wy=_t(Zy),Jy=[9,13,27,32],vr=Vn&&"CompositionEvent"in window,hs=null;Vn&&"documentMode"in document&&(hs=document.documentMode);var $y=Vn&&"TextEvent"in window&&!hs,bd=Vn&&(!vr||hs&&8<hs&&11>=hs),Sd=" ",Nd=!1;function jd(e,t){switch(e){case"keyup":return Jy.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Cd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var bl=!1;function Fy(e,t){switch(e){case"compositionend":return Cd(t);case"keypress":return t.which!==32?null:(Nd=!0,Sd);case"textInput":return e=t.data,e===Sd&&Nd?null:e;default:return null}}function Iy(e,t){if(bl)return e==="compositionend"||!vr&&jd(e,t)?(e=pd(),yi=mr=fa=null,bl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return bd&&t.locale!=="ko"?null:t.data;default:return null}}var Py={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function Ed(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Py[e.type]:t==="textarea"}function wd(e,t,n,a){vl?xl?xl.push(a):xl=[a]:vl=a,t=co(t,"onChange"),0<t.length&&(n=new bi("onChange","change",null,n,a),e.push({event:n,listeners:t}))}var ps=null,gs=null;function ev(e){uh(e,0)}function Ni(e){var t=us(e);if(od(t))return e}function Md(e,t){if(e==="change")return t}var zd=!1;if(Vn){var xr;if(Vn){var br="oninput"in document;if(!br){var Td=document.createElement("div");Td.setAttribute("oninput","return;"),br=typeof Td.oninput=="function"}xr=br}else xr=!1;zd=xr&&(!document.documentMode||9<document.documentMode)}function Od(){ps&&(ps.detachEvent("onpropertychange",Ad),gs=ps=null)}function Ad(e){if(e.propertyName==="value"&&Ni(gs)){var t=[];wd(t,gs,e,cr(e)),hd(ev,t)}}function tv(e,t,n){e==="focusin"?(Od(),ps=t,gs=n,ps.attachEvent("onpropertychange",Ad)):e==="focusout"&&Od()}function nv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ni(gs)}function av(e,t){if(e==="click")return Ni(t)}function lv(e,t){if(e==="input"||e==="change")return Ni(t)}function sv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Zt=typeof Object.is=="function"?Object.is:sv;function ys(e,t){if(Zt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),a=Object.keys(t);if(n.length!==a.length)return!1;for(a=0;a<n.length;a++){var i=n[a];if(!Kt.call(t,i)||!Zt(e[i],t[i]))return!1}return!0}function Dd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function _d(e,t){var n=Dd(e);e=0;for(var a;n;){if(n.nodeType===3){if(a=e+n.textContent.length,e<=t&&a>=t)return{node:n,offset:t-e};e=a}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=Dd(n)}}function kd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?kd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Rd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=pi(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=pi(e.document)}return t}function Sr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var iv=Vn&&"documentMode"in document&&11>=document.documentMode,Sl=null,Nr=null,vs=null,jr=!1;function Ud(e,t,n){var a=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;jr||Sl==null||Sl!==pi(a)||(a=Sl,"selectionStart"in a&&Sr(a)?a={start:a.selectionStart,end:a.selectionEnd}:(a=(a.ownerDocument&&a.ownerDocument.defaultView||window).getSelection(),a={anchorNode:a.anchorNode,anchorOffset:a.anchorOffset,focusNode:a.focusNode,focusOffset:a.focusOffset}),vs&&ys(vs,a)||(vs=a,a=co(Nr,"onSelect"),0<a.length&&(t=new bi("onSelect","select",null,t,n),e.push({event:t,listeners:a}),t.target=Sl)))}function Ka(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Nl={animationend:Ka("Animation","AnimationEnd"),animationiteration:Ka("Animation","AnimationIteration"),animationstart:Ka("Animation","AnimationStart"),transitionrun:Ka("Transition","TransitionRun"),transitionstart:Ka("Transition","TransitionStart"),transitioncancel:Ka("Transition","TransitionCancel"),transitionend:Ka("Transition","TransitionEnd")},Cr={},Bd={};Vn&&(Bd=document.createElement("div").style,"AnimationEvent"in window||(delete Nl.animationend.animation,delete Nl.animationiteration.animation,delete Nl.animationstart.animation),"TransitionEvent"in window||delete Nl.transitionend.transition);function Va(e){if(Cr[e])return Cr[e];if(!Nl[e])return e;var t=Nl[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Bd)return Cr[e]=t[n];return e}var Hd=Va("animationend"),qd=Va("animationiteration"),Ld=Va("animationstart"),ov=Va("transitionrun"),rv=Va("transitionstart"),uv=Va("transitioncancel"),Yd=Va("transitionend"),Gd=new Map,Er="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Er.push("scrollEnd");function yn(e,t){Gd.set(e,t),Ya(t,[e])}var ji=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},rn=[],jl=0,wr=0;function Ci(){for(var e=jl,t=wr=jl=0;t<e;){var n=rn[t];rn[t++]=null;var a=rn[t];rn[t++]=null;var i=rn[t];rn[t++]=null;var u=rn[t];if(rn[t++]=null,a!==null&&i!==null){var f=a.pending;f===null?i.next=i:(i.next=f.next,f.next=i),a.pending=i}u!==0&&Kd(n,i,u)}}function Ei(e,t,n,a){rn[jl++]=e,rn[jl++]=t,rn[jl++]=n,rn[jl++]=a,wr|=a,e.lanes|=a,e=e.alternate,e!==null&&(e.lanes|=a)}function Mr(e,t,n,a){return Ei(e,t,n,a),wi(e)}function Qa(e,t){return Ei(e,null,null,t),wi(e)}function Kd(e,t,n){e.lanes|=n;var a=e.alternate;a!==null&&(a.lanes|=n);for(var i=!1,u=e.return;u!==null;)u.childLanes|=n,a=u.alternate,a!==null&&(a.childLanes|=n),u.tag===22&&(e=u.stateNode,e===null||e._visibility&1||(i=!0)),e=u,u=u.return;return e.tag===3?(u=e.stateNode,i&&t!==null&&(i=31-fe(n),e=u.hiddenUpdates,a=e[i],a===null?e[i]=[t]:a.push(t),t.lane=n|536870912),u):null}function wi(e){if(50<Ls)throw Ls=0,Uu=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Cl={};function cv(e,t,n,a){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=a,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wt(e,t,n,a){return new cv(e,t,n,a)}function zr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Qn(e,t){var n=e.alternate;return n===null?(n=Wt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&65011712,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Vd(e,t){e.flags&=65011714;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Mi(e,t,n,a,i,u){var f=0;if(a=e,typeof e=="function")zr(e)&&(f=1);else if(typeof e=="string")f=px(e,n,F.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case ee:return e=Wt(31,n,t,i),e.elementType=ee,e.lanes=u,e;case k:return Xa(n.children,i,u,t);case U:f=8,i|=24;break;case M:return e=Wt(12,n,t,i|2),e.elementType=M,e.lanes=u,e;case B:return e=Wt(13,n,t,i),e.elementType=B,e.lanes=u,e;case j:return e=Wt(19,n,t,i),e.elementType=j,e.lanes=u,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case G:f=10;break e;case V:f=9;break e;case q:f=11;break e;case L:f=14;break e;case W:f=16,a=null;break e}f=29,n=Error(c(130,e===null?"null":typeof e,"")),a=null}return t=Wt(f,n,t,i),t.elementType=e,t.type=a,t.lanes=u,t}function Xa(e,t,n,a){return e=Wt(7,e,a,t),e.lanes=n,e}function Tr(e,t,n){return e=Wt(6,e,null,t),e.lanes=n,e}function Qd(e){var t=Wt(18,null,null,0);return t.stateNode=e,t}function Or(e,t,n){return t=Wt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Xd=new WeakMap;function un(e,t){if(typeof e=="object"&&e!==null){var n=Xd.get(e);return n!==void 0?n:(t={value:e,source:t,stack:Ne(t)},Xd.set(e,t),t)}return{value:e,source:t,stack:Ne(t)}}var El=[],wl=0,zi=null,xs=0,cn=[],dn=0,ma=null,zn=1,Tn="";function Xn(e,t){El[wl++]=xs,El[wl++]=zi,zi=e,xs=t}function Zd(e,t,n){cn[dn++]=zn,cn[dn++]=Tn,cn[dn++]=ma,ma=e;var a=zn;e=Tn;var i=32-fe(a)-1;a&=~(1<<i),n+=1;var u=32-fe(t)+i;if(30<u){var f=i-i%5;u=(a&(1<<f)-1).toString(32),a>>=f,i-=f,zn=1<<32-fe(t)+i|n<<i|a,Tn=u+e}else zn=1<<u|n<<i|a,Tn=e}function Ar(e){e.return!==null&&(Xn(e,1),Zd(e,1,0))}function Dr(e){for(;e===zi;)zi=El[--wl],El[wl]=null,xs=El[--wl],El[wl]=null;for(;e===ma;)ma=cn[--dn],cn[dn]=null,Tn=cn[--dn],cn[dn]=null,zn=cn[--dn],cn[dn]=null}function Wd(e,t){cn[dn++]=zn,cn[dn++]=Tn,cn[dn++]=ma,zn=t.id,Tn=t.overflow,ma=e}var jt=null,Ie=null,Be=!1,ha=null,fn=!1,_r=Error(c(519));function pa(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw bs(un(t,e)),_r}function Jd(e){var t=e.stateNode,n=e.type,a=e.memoizedProps;switch(t[Nt]=e,t[Dt]=a,n){case"dialog":_e("cancel",t),_e("close",t);break;case"iframe":case"object":case"embed":_e("load",t);break;case"video":case"audio":for(n=0;n<Gs.length;n++)_e(Gs[n],t);break;case"source":_e("error",t);break;case"img":case"image":case"link":_e("error",t),_e("load",t);break;case"details":_e("toggle",t);break;case"input":_e("invalid",t),rd(t,a.value,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name,!0);break;case"select":_e("invalid",t);break;case"textarea":_e("invalid",t),cd(t,a.value,a.defaultValue,a.children)}n=a.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||a.suppressHydrationWarning===!0||mh(t.textContent,n)?(a.popover!=null&&(_e("beforetoggle",t),_e("toggle",t)),a.onScroll!=null&&_e("scroll",t),a.onScrollEnd!=null&&_e("scrollend",t),a.onClick!=null&&(t.onclick=Kn),t=!0):t=!1,t||pa(e,!0)}function $d(e){for(jt=e.return;jt;)switch(jt.tag){case 5:case 31:case 13:fn=!1;return;case 27:case 3:fn=!0;return;default:jt=jt.return}}function Ml(e){if(e!==jt)return!1;if(!Be)return $d(e),Be=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||Fu(e.type,e.memoizedProps)),n=!n),n&&Ie&&pa(e),$d(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Ie=Nh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));Ie=Nh(e)}else t===27?(t=Ie,Ta(e.type)?(e=nc,nc=null,Ie=e):Ie=t):Ie=jt?hn(e.stateNode.nextSibling):null;return!0}function Za(){Ie=jt=null,Be=!1}function kr(){var e=ha;return e!==null&&(Bt===null?Bt=e:Bt.push.apply(Bt,e),ha=null),e}function bs(e){ha===null?ha=[e]:ha.push(e)}var Rr=Te(null),Wa=null,Zn=null;function ga(e,t,n){X(Rr,t._currentValue),t._currentValue=n}function Wn(e){e._currentValue=Rr.current,de(Rr)}function Ur(e,t,n){for(;e!==null;){var a=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,a!==null&&(a.childLanes|=t)):a!==null&&(a.childLanes&t)!==t&&(a.childLanes|=t),e===n)break;e=e.return}}function Br(e,t,n,a){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var u=i.dependencies;if(u!==null){var f=i.child;u=u.firstContext;e:for(;u!==null;){var g=u;u=i;for(var S=0;S<t.length;S++)if(g.context===t[S]){u.lanes|=n,g=u.alternate,g!==null&&(g.lanes|=n),Ur(u.return,n,e),a||(f=null);break e}u=g.next}}else if(i.tag===18){if(f=i.return,f===null)throw Error(c(341));f.lanes|=n,u=f.alternate,u!==null&&(u.lanes|=n),Ur(f,n,e),f=null}else f=i.child;if(f!==null)f.return=i;else for(f=i;f!==null;){if(f===e){f=null;break}if(i=f.sibling,i!==null){i.return=f.return,f=i;break}f=f.return}i=f}}function zl(e,t,n,a){e=null;for(var i=t,u=!1;i!==null;){if(!u){if((i.flags&524288)!==0)u=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var f=i.alternate;if(f===null)throw Error(c(387));if(f=f.memoizedProps,f!==null){var g=i.type;Zt(i.pendingProps.value,f.value)||(e!==null?e.push(g):e=[g])}}else if(i===ne.current){if(f=i.alternate,f===null)throw Error(c(387));f.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Zs):e=[Zs])}i=i.return}e!==null&&Br(t,e,n,a),t.flags|=262144}function Ti(e){for(e=e.firstContext;e!==null;){if(!Zt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Ja(e){Wa=e,Zn=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ct(e){return Fd(Wa,e)}function Oi(e,t){return Wa===null&&Ja(e),Fd(e,t)}function Fd(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},Zn===null){if(e===null)throw Error(c(308));Zn=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Zn=Zn.next=t;return n}var dv=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,a){e.push(a)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},fv=l.unstable_scheduleCallback,mv=l.unstable_NormalPriority,ct={$$typeof:G,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Hr(){return{controller:new dv,data:new Map,refCount:0}}function Ss(e){e.refCount--,e.refCount===0&&fv(mv,function(){e.controller.abort()})}var Ns=null,qr=0,Tl=0,Ol=null;function hv(e,t){if(Ns===null){var n=Ns=[];qr=0,Tl=Gu(),Ol={status:"pending",value:void 0,then:function(a){n.push(a)}}}return qr++,t.then(Id,Id),t}function Id(){if(--qr===0&&Ns!==null){Ol!==null&&(Ol.status="fulfilled");var e=Ns;Ns=null,Tl=0,Ol=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function pv(e,t){var n=[],a={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){a.status="fulfilled",a.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(a.status="rejected",a.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),a}var Pd=D.S;D.S=function(e,t){Bm=ot(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&hv(e,t),Pd!==null&&Pd(e,t)};var $a=Te(null);function Lr(){var e=$a.current;return e!==null?e:$e.pooledCache}function Ai(e,t){t===null?X($a,$a.current):X($a,t.pool)}function ef(){var e=Lr();return e===null?null:{parent:ct._currentValue,pool:e}}var Al=Error(c(460)),Yr=Error(c(474)),Di=Error(c(542)),_i={then:function(){}};function tf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function nf(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Kn,Kn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,lf(e),e;default:if(typeof t.status=="string")t.then(Kn,Kn);else{if(e=$e,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(a){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=a}},function(a){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=a}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,lf(e),e}throw Ia=t,Al}}function Fa(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Ia=n,Al):n}}var Ia=null;function af(){if(Ia===null)throw Error(c(459));var e=Ia;return Ia=null,e}function lf(e){if(e===Al||e===Di)throw Error(c(483))}var Dl=null,js=0;function ki(e){var t=js;return js+=1,Dl===null&&(Dl=[]),nf(Dl,e,t)}function Cs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Ri(e,t){throw t.$$typeof===b?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function sf(e){function t(w,C){if(e){var z=w.deletions;z===null?(w.deletions=[C],w.flags|=16):z.push(C)}}function n(w,C){if(!e)return null;for(;C!==null;)t(w,C),C=C.sibling;return null}function a(w){for(var C=new Map;w!==null;)w.key!==null?C.set(w.key,w):C.set(w.index,w),w=w.sibling;return C}function i(w,C){return w=Qn(w,C),w.index=0,w.sibling=null,w}function u(w,C,z){return w.index=z,e?(z=w.alternate,z!==null?(z=z.index,z<C?(w.flags|=67108866,C):z):(w.flags|=67108866,C)):(w.flags|=1048576,C)}function f(w){return e&&w.alternate===null&&(w.flags|=67108866),w}function g(w,C,z,Y){return C===null||C.tag!==6?(C=Tr(z,w.mode,Y),C.return=w,C):(C=i(C,z),C.return=w,C)}function S(w,C,z,Y){var ce=z.type;return ce===k?H(w,C,z.props.children,Y,z.key):C!==null&&(C.elementType===ce||typeof ce=="object"&&ce!==null&&ce.$$typeof===W&&Fa(ce)===C.type)?(C=i(C,z.props),Cs(C,z),C.return=w,C):(C=Mi(z.type,z.key,z.props,null,w.mode,Y),Cs(C,z),C.return=w,C)}function T(w,C,z,Y){return C===null||C.tag!==4||C.stateNode.containerInfo!==z.containerInfo||C.stateNode.implementation!==z.implementation?(C=Or(z,w.mode,Y),C.return=w,C):(C=i(C,z.children||[]),C.return=w,C)}function H(w,C,z,Y,ce){return C===null||C.tag!==7?(C=Xa(z,w.mode,Y,ce),C.return=w,C):(C=i(C,z),C.return=w,C)}function K(w,C,z){if(typeof C=="string"&&C!==""||typeof C=="number"||typeof C=="bigint")return C=Tr(""+C,w.mode,z),C.return=w,C;if(typeof C=="object"&&C!==null){switch(C.$$typeof){case _:return z=Mi(C.type,C.key,C.props,null,w.mode,z),Cs(z,C),z.return=w,z;case O:return C=Or(C,w.mode,z),C.return=w,C;case W:return C=Fa(C),K(w,C,z)}if(ie(C)||re(C))return C=Xa(C,w.mode,z,null),C.return=w,C;if(typeof C.then=="function")return K(w,ki(C),z);if(C.$$typeof===G)return K(w,Oi(w,C),z);Ri(w,C)}return null}function A(w,C,z,Y){var ce=C!==null?C.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return ce!==null?null:g(w,C,""+z,Y);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case _:return z.key===ce?S(w,C,z,Y):null;case O:return z.key===ce?T(w,C,z,Y):null;case W:return z=Fa(z),A(w,C,z,Y)}if(ie(z)||re(z))return ce!==null?null:H(w,C,z,Y,null);if(typeof z.then=="function")return A(w,C,ki(z),Y);if(z.$$typeof===G)return A(w,C,Oi(w,z),Y);Ri(w,z)}return null}function R(w,C,z,Y,ce){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return w=w.get(z)||null,g(C,w,""+Y,ce);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case _:return w=w.get(Y.key===null?z:Y.key)||null,S(C,w,Y,ce);case O:return w=w.get(Y.key===null?z:Y.key)||null,T(C,w,Y,ce);case W:return Y=Fa(Y),R(w,C,z,Y,ce)}if(ie(Y)||re(Y))return w=w.get(z)||null,H(C,w,Y,ce,null);if(typeof Y.then=="function")return R(w,C,z,ki(Y),ce);if(Y.$$typeof===G)return R(w,C,z,Oi(C,Y),ce);Ri(C,Y)}return null}function te(w,C,z,Y){for(var ce=null,He=null,se=C,Ce=C=0,Re=null;se!==null&&Ce<z.length;Ce++){se.index>Ce?(Re=se,se=null):Re=se.sibling;var qe=A(w,se,z[Ce],Y);if(qe===null){se===null&&(se=Re);break}e&&se&&qe.alternate===null&&t(w,se),C=u(qe,C,Ce),He===null?ce=qe:He.sibling=qe,He=qe,se=Re}if(Ce===z.length)return n(w,se),Be&&Xn(w,Ce),ce;if(se===null){for(;Ce<z.length;Ce++)se=K(w,z[Ce],Y),se!==null&&(C=u(se,C,Ce),He===null?ce=se:He.sibling=se,He=se);return Be&&Xn(w,Ce),ce}for(se=a(se);Ce<z.length;Ce++)Re=R(se,w,Ce,z[Ce],Y),Re!==null&&(e&&Re.alternate!==null&&se.delete(Re.key===null?Ce:Re.key),C=u(Re,C,Ce),He===null?ce=Re:He.sibling=Re,He=Re);return e&&se.forEach(function(ka){return t(w,ka)}),Be&&Xn(w,Ce),ce}function pe(w,C,z,Y){if(z==null)throw Error(c(151));for(var ce=null,He=null,se=C,Ce=C=0,Re=null,qe=z.next();se!==null&&!qe.done;Ce++,qe=z.next()){se.index>Ce?(Re=se,se=null):Re=se.sibling;var ka=A(w,se,qe.value,Y);if(ka===null){se===null&&(se=Re);break}e&&se&&ka.alternate===null&&t(w,se),C=u(ka,C,Ce),He===null?ce=ka:He.sibling=ka,He=ka,se=Re}if(qe.done)return n(w,se),Be&&Xn(w,Ce),ce;if(se===null){for(;!qe.done;Ce++,qe=z.next())qe=K(w,qe.value,Y),qe!==null&&(C=u(qe,C,Ce),He===null?ce=qe:He.sibling=qe,He=qe);return Be&&Xn(w,Ce),ce}for(se=a(se);!qe.done;Ce++,qe=z.next())qe=R(se,w,Ce,qe.value,Y),qe!==null&&(e&&qe.alternate!==null&&se.delete(qe.key===null?Ce:qe.key),C=u(qe,C,Ce),He===null?ce=qe:He.sibling=qe,He=qe);return e&&se.forEach(function(wx){return t(w,wx)}),Be&&Xn(w,Ce),ce}function Je(w,C,z,Y){if(typeof z=="object"&&z!==null&&z.type===k&&z.key===null&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case _:e:{for(var ce=z.key;C!==null;){if(C.key===ce){if(ce=z.type,ce===k){if(C.tag===7){n(w,C.sibling),Y=i(C,z.props.children),Y.return=w,w=Y;break e}}else if(C.elementType===ce||typeof ce=="object"&&ce!==null&&ce.$$typeof===W&&Fa(ce)===C.type){n(w,C.sibling),Y=i(C,z.props),Cs(Y,z),Y.return=w,w=Y;break e}n(w,C);break}else t(w,C);C=C.sibling}z.type===k?(Y=Xa(z.props.children,w.mode,Y,z.key),Y.return=w,w=Y):(Y=Mi(z.type,z.key,z.props,null,w.mode,Y),Cs(Y,z),Y.return=w,w=Y)}return f(w);case O:e:{for(ce=z.key;C!==null;){if(C.key===ce)if(C.tag===4&&C.stateNode.containerInfo===z.containerInfo&&C.stateNode.implementation===z.implementation){n(w,C.sibling),Y=i(C,z.children||[]),Y.return=w,w=Y;break e}else{n(w,C);break}else t(w,C);C=C.sibling}Y=Or(z,w.mode,Y),Y.return=w,w=Y}return f(w);case W:return z=Fa(z),Je(w,C,z,Y)}if(ie(z))return te(w,C,z,Y);if(re(z)){if(ce=re(z),typeof ce!="function")throw Error(c(150));return z=ce.call(z),pe(w,C,z,Y)}if(typeof z.then=="function")return Je(w,C,ki(z),Y);if(z.$$typeof===G)return Je(w,C,Oi(w,z),Y);Ri(w,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,C!==null&&C.tag===6?(n(w,C.sibling),Y=i(C,z),Y.return=w,w=Y):(n(w,C),Y=Tr(z,w.mode,Y),Y.return=w,w=Y),f(w)):n(w,C)}return function(w,C,z,Y){try{js=0;var ce=Je(w,C,z,Y);return Dl=null,ce}catch(se){if(se===Al||se===Di)throw se;var He=Wt(29,se,null,w.mode);return He.lanes=Y,He.return=w,He}finally{}}}var Pa=sf(!0),of=sf(!1),ya=!1;function Gr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kr(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function va(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function xa(e,t,n){var a=e.updateQueue;if(a===null)return null;if(a=a.shared,(Ke&2)!==0){var i=a.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),a.pending=t,t=wi(e),Kd(e,null,n),t}return Ei(e,a,t,n),wi(e)}function Es(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,ss(e,n)}}function Vr(e,t){var n=e.updateQueue,a=e.alternate;if(a!==null&&(a=a.updateQueue,n===a)){var i=null,u=null;if(n=n.firstBaseUpdate,n!==null){do{var f={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};u===null?i=u=f:u=u.next=f,n=n.next}while(n!==null);u===null?i=u=t:u=u.next=t}else i=u=t;n={baseState:a.baseState,firstBaseUpdate:i,lastBaseUpdate:u,shared:a.shared,callbacks:a.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var Qr=!1;function ws(){if(Qr){var e=Ol;if(e!==null)throw e}}function Ms(e,t,n,a){Qr=!1;var i=e.updateQueue;ya=!1;var u=i.firstBaseUpdate,f=i.lastBaseUpdate,g=i.shared.pending;if(g!==null){i.shared.pending=null;var S=g,T=S.next;S.next=null,f===null?u=T:f.next=T,f=S;var H=e.alternate;H!==null&&(H=H.updateQueue,g=H.lastBaseUpdate,g!==f&&(g===null?H.firstBaseUpdate=T:g.next=T,H.lastBaseUpdate=S))}if(u!==null){var K=i.baseState;f=0,H=T=S=null,g=u;do{var A=g.lane&-536870913,R=A!==g.lane;if(R?(ke&A)===A:(a&A)===A){A!==0&&A===Tl&&(Qr=!0),H!==null&&(H=H.next={lane:0,tag:g.tag,payload:g.payload,callback:null,next:null});e:{var te=e,pe=g;A=t;var Je=n;switch(pe.tag){case 1:if(te=pe.payload,typeof te=="function"){K=te.call(Je,K,A);break e}K=te;break e;case 3:te.flags=te.flags&-65537|128;case 0:if(te=pe.payload,A=typeof te=="function"?te.call(Je,K,A):te,A==null)break e;K=x({},K,A);break e;case 2:ya=!0}}A=g.callback,A!==null&&(e.flags|=64,R&&(e.flags|=8192),R=i.callbacks,R===null?i.callbacks=[A]:R.push(A))}else R={lane:A,tag:g.tag,payload:g.payload,callback:g.callback,next:null},H===null?(T=H=R,S=K):H=H.next=R,f|=A;if(g=g.next,g===null){if(g=i.shared.pending,g===null)break;R=g,g=R.next,R.next=null,i.lastBaseUpdate=R,i.shared.pending=null}}while(!0);H===null&&(S=K),i.baseState=S,i.firstBaseUpdate=T,i.lastBaseUpdate=H,u===null&&(i.shared.lanes=0),Ca|=f,e.lanes=f,e.memoizedState=K}}function rf(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function uf(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)rf(n[e],t)}var _l=Te(null),Ui=Te(0);function cf(e,t){e=aa,X(Ui,e),X(_l,t),aa=e|t.baseLanes}function Xr(){X(Ui,aa),X(_l,_l.current)}function Zr(){aa=Ui.current,de(_l),de(Ui)}var Jt=Te(null),mn=null;function ba(e){var t=e.alternate;X(rt,rt.current&1),X(Jt,e),mn===null&&(t===null||_l.current!==null||t.memoizedState!==null)&&(mn=e)}function Wr(e){X(rt,rt.current),X(Jt,e),mn===null&&(mn=e)}function df(e){e.tag===22?(X(rt,rt.current),X(Jt,e),mn===null&&(mn=e)):Sa()}function Sa(){X(rt,rt.current),X(Jt,Jt.current)}function $t(e){de(Jt),mn===e&&(mn=null),de(rt)}var rt=Te(0);function Bi(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||ec(n)||tc(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Jn=0,je=null,Ze=null,dt=null,Hi=!1,kl=!1,el=!1,qi=0,zs=0,Rl=null,gv=0;function lt(){throw Error(c(321))}function Jr(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Zt(e[n],t[n]))return!1;return!0}function $r(e,t,n,a,i,u){return Jn=u,je=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,D.H=e===null||e.memoizedState===null?Wf:du,el=!1,u=n(a,i),el=!1,kl&&(u=mf(t,n,a,i)),ff(e),u}function ff(e){D.H=As;var t=Ze!==null&&Ze.next!==null;if(Jn=0,dt=Ze=je=null,Hi=!1,zs=0,Rl=null,t)throw Error(c(300));e===null||ft||(e=e.dependencies,e!==null&&Ti(e)&&(ft=!0))}function mf(e,t,n,a){je=e;var i=0;do{if(kl&&(Rl=null),zs=0,kl=!1,25<=i)throw Error(c(301));if(i+=1,dt=Ze=null,e.updateQueue!=null){var u=e.updateQueue;u.lastEffect=null,u.events=null,u.stores=null,u.memoCache!=null&&(u.memoCache.index=0)}D.H=Jf,u=t(n,a)}while(kl);return u}function yv(){var e=D.H,t=e.useState()[0];return t=typeof t.then=="function"?Ts(t):t,e=e.useState()[0],(Ze!==null?Ze.memoizedState:null)!==e&&(je.flags|=1024),t}function Fr(){var e=qi!==0;return qi=0,e}function Ir(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Pr(e){if(Hi){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Hi=!1}Jn=0,dt=Ze=je=null,kl=!1,zs=qi=0,Rl=null}function Tt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return dt===null?je.memoizedState=dt=e:dt=dt.next=e,dt}function ut(){if(Ze===null){var e=je.alternate;e=e!==null?e.memoizedState:null}else e=Ze.next;var t=dt===null?je.memoizedState:dt.next;if(t!==null)dt=t,Ze=e;else{if(e===null)throw je.alternate===null?Error(c(467)):Error(c(310));Ze=e,e={memoizedState:Ze.memoizedState,baseState:Ze.baseState,baseQueue:Ze.baseQueue,queue:Ze.queue,next:null},dt===null?je.memoizedState=dt=e:dt=dt.next=e}return dt}function Li(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ts(e){var t=zs;return zs+=1,Rl===null&&(Rl=[]),e=nf(Rl,e,t),t=je,(dt===null?t.memoizedState:dt.next)===null&&(t=t.alternate,D.H=t===null||t.memoizedState===null?Wf:du),e}function Yi(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ts(e);if(e.$$typeof===G)return Ct(e)}throw Error(c(438,String(e)))}function eu(e){var t=null,n=je.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var a=je.alternate;a!==null&&(a=a.updateQueue,a!==null&&(a=a.memoCache,a!=null&&(t={data:a.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Li(),je.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),a=0;a<e;a++)n[a]=he;return t.index++,n}function $n(e,t){return typeof t=="function"?t(e):t}function Gi(e){var t=ut();return tu(t,Ze,e)}function tu(e,t,n){var a=e.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=n;var i=e.baseQueue,u=a.pending;if(u!==null){if(i!==null){var f=i.next;i.next=u.next,u.next=f}t.baseQueue=i=u,a.pending=null}if(u=e.baseState,i===null)e.memoizedState=u;else{t=i.next;var g=f=null,S=null,T=t,H=!1;do{var K=T.lane&-536870913;if(K!==T.lane?(ke&K)===K:(Jn&K)===K){var A=T.revertLane;if(A===0)S!==null&&(S=S.next={lane:0,revertLane:0,gesture:null,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null}),K===Tl&&(H=!0);else if((Jn&A)===A){T=T.next,A===Tl&&(H=!0);continue}else K={lane:0,revertLane:T.revertLane,gesture:null,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},S===null?(g=S=K,f=u):S=S.next=K,je.lanes|=A,Ca|=A;K=T.action,el&&n(u,K),u=T.hasEagerState?T.eagerState:n(u,K)}else A={lane:K,revertLane:T.revertLane,gesture:T.gesture,action:T.action,hasEagerState:T.hasEagerState,eagerState:T.eagerState,next:null},S===null?(g=S=A,f=u):S=S.next=A,je.lanes|=K,Ca|=K;T=T.next}while(T!==null&&T!==t);if(S===null?f=u:S.next=g,!Zt(u,e.memoizedState)&&(ft=!0,H&&(n=Ol,n!==null)))throw n;e.memoizedState=u,e.baseState=f,e.baseQueue=S,a.lastRenderedState=u}return i===null&&(a.lanes=0),[e.memoizedState,a.dispatch]}function nu(e){var t=ut(),n=t.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=e;var a=n.dispatch,i=n.pending,u=t.memoizedState;if(i!==null){n.pending=null;var f=i=i.next;do u=e(u,f.action),f=f.next;while(f!==i);Zt(u,t.memoizedState)||(ft=!0),t.memoizedState=u,t.baseQueue===null&&(t.baseState=u),n.lastRenderedState=u}return[u,a]}function hf(e,t,n){var a=je,i=ut(),u=Be;if(u){if(n===void 0)throw Error(c(407));n=n()}else n=t();var f=!Zt((Ze||i).memoizedState,n);if(f&&(i.memoizedState=n,ft=!0),i=i.queue,su(yf.bind(null,a,i,e),[e]),i.getSnapshot!==t||f||dt!==null&&dt.memoizedState.tag&1){if(a.flags|=2048,Ul(9,{destroy:void 0},gf.bind(null,a,i,n,t),null),$e===null)throw Error(c(349));u||(Jn&127)!==0||pf(a,t,n)}return n}function pf(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=je.updateQueue,t===null?(t=Li(),je.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function gf(e,t,n,a){t.value=n,t.getSnapshot=a,vf(t)&&xf(e)}function yf(e,t,n){return n(function(){vf(t)&&xf(e)})}function vf(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Zt(e,n)}catch{return!0}}function xf(e){var t=Qa(e,2);t!==null&&Ht(t,e,2)}function au(e){var t=Tt();if(typeof e=="function"){var n=e;if(e=n(),el){Ee(!0);try{n()}finally{Ee(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:$n,lastRenderedState:e},t}function bf(e,t,n,a){return e.baseState=n,tu(e,Ze,typeof a=="function"?a:$n)}function vv(e,t,n,a,i){if(Qi(e))throw Error(c(485));if(e=t.action,e!==null){var u={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){u.listeners.push(f)}};D.T!==null?n(!0):u.isTransition=!1,a(u),n=t.pending,n===null?(u.next=t.pending=u,Sf(t,u)):(u.next=n.next,t.pending=n.next=u)}}function Sf(e,t){var n=t.action,a=t.payload,i=e.state;if(t.isTransition){var u=D.T,f={};D.T=f;try{var g=n(i,a),S=D.S;S!==null&&S(f,g),Nf(e,t,g)}catch(T){lu(e,t,T)}finally{u!==null&&f.types!==null&&(u.types=f.types),D.T=u}}else try{u=n(i,a),Nf(e,t,u)}catch(T){lu(e,t,T)}}function Nf(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(a){jf(e,t,a)},function(a){return lu(e,t,a)}):jf(e,t,n)}function jf(e,t,n){t.status="fulfilled",t.value=n,Cf(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Sf(e,n)))}function lu(e,t,n){var a=e.pending;if(e.pending=null,a!==null){a=a.next;do t.status="rejected",t.reason=n,Cf(t),t=t.next;while(t!==a)}e.action=null}function Cf(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ef(e,t){return t}function wf(e,t){if(Be){var n=$e.formState;if(n!==null){e:{var a=je;if(Be){if(Ie){t:{for(var i=Ie,u=fn;i.nodeType!==8;){if(!u){i=null;break t}if(i=hn(i.nextSibling),i===null){i=null;break t}}u=i.data,i=u==="F!"||u==="F"?i:null}if(i){Ie=hn(i.nextSibling),a=i.data==="F!";break e}}pa(a)}a=!1}a&&(t=n[0])}}return n=Tt(),n.memoizedState=n.baseState=t,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ef,lastRenderedState:t},n.queue=a,n=Qf.bind(null,je,a),a.dispatch=n,a=au(!1),u=cu.bind(null,je,!1,a.queue),a=Tt(),i={state:t,dispatch:null,action:e,pending:null},a.queue=i,n=vv.bind(null,je,i,u,n),i.dispatch=n,a.memoizedState=e,[t,n,!1]}function Mf(e){var t=ut();return zf(t,Ze,e)}function zf(e,t,n){if(t=tu(e,t,Ef)[0],e=Gi($n)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var a=Ts(t)}catch(f){throw f===Al?Di:f}else a=t;t=ut();var i=t.queue,u=i.dispatch;return n!==t.memoizedState&&(je.flags|=2048,Ul(9,{destroy:void 0},xv.bind(null,i,n),null)),[a,u,e]}function xv(e,t){e.action=t}function Tf(e){var t=ut(),n=Ze;if(n!==null)return zf(t,n,e);ut(),t=t.memoizedState,n=ut();var a=n.queue.dispatch;return n.memoizedState=e,[t,a,!1]}function Ul(e,t,n,a){return e={tag:e,create:n,deps:a,inst:t,next:null},t=je.updateQueue,t===null&&(t=Li(),je.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(a=n.next,n.next=e,e.next=a,t.lastEffect=e),e}function Of(){return ut().memoizedState}function Ki(e,t,n,a){var i=Tt();je.flags|=e,i.memoizedState=Ul(1|t,{destroy:void 0},n,a===void 0?null:a)}function Vi(e,t,n,a){var i=ut();a=a===void 0?null:a;var u=i.memoizedState.inst;Ze!==null&&a!==null&&Jr(a,Ze.memoizedState.deps)?i.memoizedState=Ul(t,u,n,a):(je.flags|=e,i.memoizedState=Ul(1|t,u,n,a))}function Af(e,t){Ki(8390656,8,e,t)}function su(e,t){Vi(2048,8,e,t)}function bv(e){je.flags|=4;var t=je.updateQueue;if(t===null)t=Li(),je.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Df(e){var t=ut().memoizedState;return bv({ref:t,nextImpl:e}),function(){if((Ke&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function _f(e,t){return Vi(4,2,e,t)}function kf(e,t){return Vi(4,4,e,t)}function Rf(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Uf(e,t,n){n=n!=null?n.concat([e]):null,Vi(4,4,Rf.bind(null,t,e),n)}function iu(){}function Bf(e,t){var n=ut();t=t===void 0?null:t;var a=n.memoizedState;return t!==null&&Jr(t,a[1])?a[0]:(n.memoizedState=[e,t],e)}function Hf(e,t){var n=ut();t=t===void 0?null:t;var a=n.memoizedState;if(t!==null&&Jr(t,a[1]))return a[0];if(a=e(),el){Ee(!0);try{e()}finally{Ee(!1)}}return n.memoizedState=[a,t],a}function ou(e,t,n){return n===void 0||(Jn&1073741824)!==0&&(ke&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=qm(),je.lanes|=e,Ca|=e,n)}function qf(e,t,n,a){return Zt(n,t)?n:_l.current!==null?(e=ou(e,n,a),Zt(e,t)||(ft=!0),e):(Jn&42)===0||(Jn&1073741824)!==0&&(ke&261930)===0?(ft=!0,e.memoizedState=n):(e=qm(),je.lanes|=e,Ca|=e,t)}function Lf(e,t,n,a,i){var u=J.p;J.p=u!==0&&8>u?u:8;var f=D.T,g={};D.T=g,cu(e,!1,t,n);try{var S=i(),T=D.S;if(T!==null&&T(g,S),S!==null&&typeof S=="object"&&typeof S.then=="function"){var H=pv(S,a);Os(e,t,H,Pt(e))}else Os(e,t,a,Pt(e))}catch(K){Os(e,t,{then:function(){},status:"rejected",reason:K},Pt())}finally{J.p=u,f!==null&&g.types!==null&&(f.types=g.types),D.T=f}}function Sv(){}function ru(e,t,n,a){if(e.tag!==5)throw Error(c(476));var i=Yf(e).queue;Lf(e,i,t,le,n===null?Sv:function(){return Gf(e),n(a)})}function Yf(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$n,lastRenderedState:le},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:$n,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Gf(e){var t=Yf(e);t.next===null&&(t=e.alternate.memoizedState),Os(e,t.next.queue,{},Pt())}function uu(){return Ct(Zs)}function Kf(){return ut().memoizedState}function Vf(){return ut().memoizedState}function Nv(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Pt();e=va(n);var a=xa(t,e,n);a!==null&&(Ht(a,t,n),Es(a,t,n)),t={cache:Hr()},e.payload=t;return}t=t.return}}function jv(e,t,n){var a=Pt();n={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Qi(e)?Xf(t,n):(n=Mr(e,t,n,a),n!==null&&(Ht(n,e,a),Zf(n,t,a)))}function Qf(e,t,n){var a=Pt();Os(e,t,n,a)}function Os(e,t,n,a){var i={lane:a,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Qi(e))Xf(t,i);else{var u=e.alternate;if(e.lanes===0&&(u===null||u.lanes===0)&&(u=t.lastRenderedReducer,u!==null))try{var f=t.lastRenderedState,g=u(f,n);if(i.hasEagerState=!0,i.eagerState=g,Zt(g,f))return Ei(e,t,i,0),$e===null&&Ci(),!1}catch{}finally{}if(n=Mr(e,t,i,a),n!==null)return Ht(n,e,a),Zf(n,t,a),!0}return!1}function cu(e,t,n,a){if(a={lane:2,revertLane:Gu(),gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},Qi(e)){if(t)throw Error(c(479))}else t=Mr(e,n,a,2),t!==null&&Ht(t,e,2)}function Qi(e){var t=e.alternate;return e===je||t!==null&&t===je}function Xf(e,t){kl=Hi=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Zf(e,t,n){if((n&4194048)!==0){var a=t.lanes;a&=e.pendingLanes,n|=a,t.lanes=n,ss(e,n)}}var As={readContext:Ct,use:Yi,useCallback:lt,useContext:lt,useEffect:lt,useImperativeHandle:lt,useLayoutEffect:lt,useInsertionEffect:lt,useMemo:lt,useReducer:lt,useRef:lt,useState:lt,useDebugValue:lt,useDeferredValue:lt,useTransition:lt,useSyncExternalStore:lt,useId:lt,useHostTransitionStatus:lt,useFormState:lt,useActionState:lt,useOptimistic:lt,useMemoCache:lt,useCacheRefresh:lt};As.useEffectEvent=lt;var Wf={readContext:Ct,use:Yi,useCallback:function(e,t){return Tt().memoizedState=[e,t===void 0?null:t],e},useContext:Ct,useEffect:Af,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ki(4194308,4,Rf.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ki(4194308,4,e,t)},useInsertionEffect:function(e,t){Ki(4,2,e,t)},useMemo:function(e,t){var n=Tt();t=t===void 0?null:t;var a=e();if(el){Ee(!0);try{e()}finally{Ee(!1)}}return n.memoizedState=[a,t],a},useReducer:function(e,t,n){var a=Tt();if(n!==void 0){var i=n(t);if(el){Ee(!0);try{n(t)}finally{Ee(!1)}}}else i=t;return a.memoizedState=a.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},a.queue=e,e=e.dispatch=jv.bind(null,je,e),[a.memoizedState,e]},useRef:function(e){var t=Tt();return e={current:e},t.memoizedState=e},useState:function(e){e=au(e);var t=e.queue,n=Qf.bind(null,je,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:iu,useDeferredValue:function(e,t){var n=Tt();return ou(n,e,t)},useTransition:function(){var e=au(!1);return e=Lf.bind(null,je,e.queue,!0,!1),Tt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var a=je,i=Tt();if(Be){if(n===void 0)throw Error(c(407));n=n()}else{if(n=t(),$e===null)throw Error(c(349));(ke&127)!==0||pf(a,t,n)}i.memoizedState=n;var u={value:n,getSnapshot:t};return i.queue=u,Af(yf.bind(null,a,u,e),[e]),a.flags|=2048,Ul(9,{destroy:void 0},gf.bind(null,a,u,n,t),null),n},useId:function(){var e=Tt(),t=$e.identifierPrefix;if(Be){var n=Tn,a=zn;n=(a&~(1<<32-fe(a)-1)).toString(32)+n,t="_"+t+"R_"+n,n=qi++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=gv++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:uu,useFormState:wf,useActionState:wf,useOptimistic:function(e){var t=Tt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=cu.bind(null,je,!0,n),n.dispatch=t,[e,t]},useMemoCache:eu,useCacheRefresh:function(){return Tt().memoizedState=Nv.bind(null,je)},useEffectEvent:function(e){var t=Tt(),n={impl:e};return t.memoizedState=n,function(){if((Ke&2)!==0)throw Error(c(440));return n.impl.apply(void 0,arguments)}}},du={readContext:Ct,use:Yi,useCallback:Bf,useContext:Ct,useEffect:su,useImperativeHandle:Uf,useInsertionEffect:_f,useLayoutEffect:kf,useMemo:Hf,useReducer:Gi,useRef:Of,useState:function(){return Gi($n)},useDebugValue:iu,useDeferredValue:function(e,t){var n=ut();return qf(n,Ze.memoizedState,e,t)},useTransition:function(){var e=Gi($n)[0],t=ut().memoizedState;return[typeof e=="boolean"?e:Ts(e),t]},useSyncExternalStore:hf,useId:Kf,useHostTransitionStatus:uu,useFormState:Mf,useActionState:Mf,useOptimistic:function(e,t){var n=ut();return bf(n,Ze,e,t)},useMemoCache:eu,useCacheRefresh:Vf};du.useEffectEvent=Df;var Jf={readContext:Ct,use:Yi,useCallback:Bf,useContext:Ct,useEffect:su,useImperativeHandle:Uf,useInsertionEffect:_f,useLayoutEffect:kf,useMemo:Hf,useReducer:nu,useRef:Of,useState:function(){return nu($n)},useDebugValue:iu,useDeferredValue:function(e,t){var n=ut();return Ze===null?ou(n,e,t):qf(n,Ze.memoizedState,e,t)},useTransition:function(){var e=nu($n)[0],t=ut().memoizedState;return[typeof e=="boolean"?e:Ts(e),t]},useSyncExternalStore:hf,useId:Kf,useHostTransitionStatus:uu,useFormState:Tf,useActionState:Tf,useOptimistic:function(e,t){var n=ut();return Ze!==null?bf(n,Ze,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:eu,useCacheRefresh:Vf};Jf.useEffectEvent=Df;function fu(e,t,n,a){t=e.memoizedState,n=n(a,t),n=n==null?t:x({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var mu={enqueueSetState:function(e,t,n){e=e._reactInternals;var a=Pt(),i=va(a);i.payload=t,n!=null&&(i.callback=n),t=xa(e,i,a),t!==null&&(Ht(t,e,a),Es(t,e,a))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var a=Pt(),i=va(a);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=xa(e,i,a),t!==null&&(Ht(t,e,a),Es(t,e,a))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Pt(),a=va(n);a.tag=2,t!=null&&(a.callback=t),t=xa(e,a,n),t!==null&&(Ht(t,e,n),Es(t,e,n))}};function $f(e,t,n,a,i,u,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(a,u,f):t.prototype&&t.prototype.isPureReactComponent?!ys(n,a)||!ys(i,u):!0}function Ff(e,t,n,a){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,a),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,a),t.state!==e&&mu.enqueueReplaceState(t,t.state,null)}function tl(e,t){var n=t;if("ref"in t){n={};for(var a in t)a!=="ref"&&(n[a]=t[a])}if(e=e.defaultProps){n===t&&(n=x({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function If(e){ji(e)}function Pf(e){console.error(e)}function em(e){ji(e)}function Xi(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(a){setTimeout(function(){throw a})}}function tm(e,t,n){try{var a=e.onCaughtError;a(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function hu(e,t,n){return n=va(n),n.tag=3,n.payload={element:null},n.callback=function(){Xi(e,t)},n}function nm(e){return e=va(e),e.tag=3,e}function am(e,t,n,a){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var u=a.value;e.payload=function(){return i(u)},e.callback=function(){tm(t,n,a)}}var f=n.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){tm(t,n,a),typeof i!="function"&&(Ea===null?Ea=new Set([this]):Ea.add(this));var g=a.stack;this.componentDidCatch(a.value,{componentStack:g!==null?g:""})})}function Cv(e,t,n,a,i){if(n.flags|=32768,a!==null&&typeof a=="object"&&typeof a.then=="function"){if(t=n.alternate,t!==null&&zl(t,n,i,!0),n=Jt.current,n!==null){switch(n.tag){case 31:case 13:return mn===null?lo():n.alternate===null&&st===0&&(st=3),n.flags&=-257,n.flags|=65536,n.lanes=i,a===_i?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([a]):t.add(a),qu(e,a,i)),!1;case 22:return n.flags|=65536,a===_i?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([a])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([a]):n.add(a)),qu(e,a,i)),!1}throw Error(c(435,n.tag))}return qu(e,a,i),lo(),!1}if(Be)return t=Jt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,a!==_r&&(e=Error(c(422),{cause:a}),bs(un(e,n)))):(a!==_r&&(t=Error(c(423),{cause:a}),bs(un(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,a=un(a,n),i=hu(e.stateNode,a,i),Vr(e,i),st!==4&&(st=2)),!1;var u=Error(c(520),{cause:a});if(u=un(u,n),qs===null?qs=[u]:qs.push(u),st!==4&&(st=2),t===null)return!0;a=un(a,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=hu(n.stateNode,a,e),Vr(n,e),!1;case 1:if(t=n.type,u=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||u!==null&&typeof u.componentDidCatch=="function"&&(Ea===null||!Ea.has(u))))return n.flags|=65536,i&=-i,n.lanes|=i,i=nm(i),am(i,e,n,a),Vr(n,i),!1}n=n.return}while(n!==null);return!1}var pu=Error(c(461)),ft=!1;function Et(e,t,n,a){t.child=e===null?of(t,null,n,a):Pa(t,e.child,n,a)}function lm(e,t,n,a,i){n=n.render;var u=t.ref;if("ref"in a){var f={};for(var g in a)g!=="ref"&&(f[g]=a[g])}else f=a;return Ja(t),a=$r(e,t,n,f,u,i),g=Fr(),e!==null&&!ft?(Ir(e,t,i),Fn(e,t,i)):(Be&&g&&Ar(t),t.flags|=1,Et(e,t,a,i),t.child)}function sm(e,t,n,a,i){if(e===null){var u=n.type;return typeof u=="function"&&!zr(u)&&u.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=u,im(e,t,u,a,i)):(e=Mi(n.type,null,a,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(u=e.child,!ju(e,i)){var f=u.memoizedProps;if(n=n.compare,n=n!==null?n:ys,n(f,a)&&e.ref===t.ref)return Fn(e,t,i)}return t.flags|=1,e=Qn(u,a),e.ref=t.ref,e.return=t,t.child=e}function im(e,t,n,a,i){if(e!==null){var u=e.memoizedProps;if(ys(u,a)&&e.ref===t.ref)if(ft=!1,t.pendingProps=a=u,ju(e,i))(e.flags&131072)!==0&&(ft=!0);else return t.lanes=e.lanes,Fn(e,t,i)}return gu(e,t,n,a,i)}function om(e,t,n,a){var i=a.children,u=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),a.mode==="hidden"){if((t.flags&128)!==0){if(u=u!==null?u.baseLanes|n:n,e!==null){for(a=t.child=e.child,i=0;a!==null;)i=i|a.lanes|a.childLanes,a=a.sibling;a=i&~u}else a=0,t.child=null;return rm(e,t,u,n,a)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ai(t,u!==null?u.cachePool:null),u!==null?cf(t,u):Xr(),df(t);else return a=t.lanes=536870912,rm(e,t,u!==null?u.baseLanes|n:n,n,a)}else u!==null?(Ai(t,u.cachePool),cf(t,u),Sa(),t.memoizedState=null):(e!==null&&Ai(t,null),Xr(),Sa());return Et(e,t,i,n),t.child}function Ds(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function rm(e,t,n,a,i){var u=Lr();return u=u===null?null:{parent:ct._currentValue,pool:u},t.memoizedState={baseLanes:n,cachePool:u},e!==null&&Ai(t,null),Xr(),df(t),e!==null&&zl(e,t,a,!0),t.childLanes=i,null}function Zi(e,t){return t=Ji({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function um(e,t,n){return Pa(t,e.child,null,n),e=Zi(t,t.pendingProps),e.flags|=2,$t(t),t.memoizedState=null,e}function Ev(e,t,n){var a=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Be){if(a.mode==="hidden")return e=Zi(t,a),t.lanes=536870912,Ds(null,e);if(Wr(t),(e=Ie)?(e=Sh(e,fn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ma!==null?{id:zn,overflow:Tn}:null,retryLane:536870912,hydrationErrors:null},n=Qd(e),n.return=t,t.child=n,jt=t,Ie=null)):e=null,e===null)throw pa(t);return t.lanes=536870912,null}return Zi(t,a)}var u=e.memoizedState;if(u!==null){var f=u.dehydrated;if(Wr(t),i)if(t.flags&256)t.flags&=-257,t=um(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(ft||zl(e,t,n,!1),i=(n&e.childLanes)!==0,ft||i){if(a=$e,a!==null&&(f=ln(a,n),f!==0&&f!==u.retryLane))throw u.retryLane=f,Qa(e,f),Ht(a,e,f),pu;lo(),t=um(e,t,n)}else e=u.treeContext,Ie=hn(f.nextSibling),jt=t,Be=!0,ha=null,fn=!1,e!==null&&Wd(t,e),t=Zi(t,a),t.flags|=4096;return t}return e=Qn(e.child,{mode:a.mode,children:a.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Wi(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(c(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function gu(e,t,n,a,i){return Ja(t),n=$r(e,t,n,a,void 0,i),a=Fr(),e!==null&&!ft?(Ir(e,t,i),Fn(e,t,i)):(Be&&a&&Ar(t),t.flags|=1,Et(e,t,n,i),t.child)}function cm(e,t,n,a,i,u){return Ja(t),t.updateQueue=null,n=mf(t,a,n,i),ff(e),a=Fr(),e!==null&&!ft?(Ir(e,t,u),Fn(e,t,u)):(Be&&a&&Ar(t),t.flags|=1,Et(e,t,n,u),t.child)}function dm(e,t,n,a,i){if(Ja(t),t.stateNode===null){var u=Cl,f=n.contextType;typeof f=="object"&&f!==null&&(u=Ct(f)),u=new n(a,u),t.memoizedState=u.state!==null&&u.state!==void 0?u.state:null,u.updater=mu,t.stateNode=u,u._reactInternals=t,u=t.stateNode,u.props=a,u.state=t.memoizedState,u.refs={},Gr(t),f=n.contextType,u.context=typeof f=="object"&&f!==null?Ct(f):Cl,u.state=t.memoizedState,f=n.getDerivedStateFromProps,typeof f=="function"&&(fu(t,n,f,a),u.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof u.getSnapshotBeforeUpdate=="function"||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(f=u.state,typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount(),f!==u.state&&mu.enqueueReplaceState(u,u.state,null),Ms(t,a,u,i),ws(),u.state=t.memoizedState),typeof u.componentDidMount=="function"&&(t.flags|=4194308),a=!0}else if(e===null){u=t.stateNode;var g=t.memoizedProps,S=tl(n,g);u.props=S;var T=u.context,H=n.contextType;f=Cl,typeof H=="object"&&H!==null&&(f=Ct(H));var K=n.getDerivedStateFromProps;H=typeof K=="function"||typeof u.getSnapshotBeforeUpdate=="function",g=t.pendingProps!==g,H||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(g||T!==f)&&Ff(t,u,a,f),ya=!1;var A=t.memoizedState;u.state=A,Ms(t,a,u,i),ws(),T=t.memoizedState,g||A!==T||ya?(typeof K=="function"&&(fu(t,n,K,a),T=t.memoizedState),(S=ya||$f(t,n,S,a,A,T,f))?(H||typeof u.UNSAFE_componentWillMount!="function"&&typeof u.componentWillMount!="function"||(typeof u.componentWillMount=="function"&&u.componentWillMount(),typeof u.UNSAFE_componentWillMount=="function"&&u.UNSAFE_componentWillMount()),typeof u.componentDidMount=="function"&&(t.flags|=4194308)):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=a,t.memoizedState=T),u.props=a,u.state=T,u.context=f,a=S):(typeof u.componentDidMount=="function"&&(t.flags|=4194308),a=!1)}else{u=t.stateNode,Kr(e,t),f=t.memoizedProps,H=tl(n,f),u.props=H,K=t.pendingProps,A=u.context,T=n.contextType,S=Cl,typeof T=="object"&&T!==null&&(S=Ct(T)),g=n.getDerivedStateFromProps,(T=typeof g=="function"||typeof u.getSnapshotBeforeUpdate=="function")||typeof u.UNSAFE_componentWillReceiveProps!="function"&&typeof u.componentWillReceiveProps!="function"||(f!==K||A!==S)&&Ff(t,u,a,S),ya=!1,A=t.memoizedState,u.state=A,Ms(t,a,u,i),ws();var R=t.memoizedState;f!==K||A!==R||ya||e!==null&&e.dependencies!==null&&Ti(e.dependencies)?(typeof g=="function"&&(fu(t,n,g,a),R=t.memoizedState),(H=ya||$f(t,n,H,a,A,R,S)||e!==null&&e.dependencies!==null&&Ti(e.dependencies))?(T||typeof u.UNSAFE_componentWillUpdate!="function"&&typeof u.componentWillUpdate!="function"||(typeof u.componentWillUpdate=="function"&&u.componentWillUpdate(a,R,S),typeof u.UNSAFE_componentWillUpdate=="function"&&u.UNSAFE_componentWillUpdate(a,R,S)),typeof u.componentDidUpdate=="function"&&(t.flags|=4),typeof u.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof u.componentDidUpdate!="function"||f===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),t.memoizedProps=a,t.memoizedState=R),u.props=a,u.state=R,u.context=S,a=H):(typeof u.componentDidUpdate!="function"||f===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof u.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),a=!1)}return u=a,Wi(e,t),a=(t.flags&128)!==0,u||a?(u=t.stateNode,n=a&&typeof n.getDerivedStateFromError!="function"?null:u.render(),t.flags|=1,e!==null&&a?(t.child=Pa(t,e.child,null,i),t.child=Pa(t,null,n,i)):Et(e,t,n,i),t.memoizedState=u.state,e=t.child):e=Fn(e,t,i),e}function fm(e,t,n,a){return Za(),t.flags|=256,Et(e,t,n,a),t.child}var yu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vu(e){return{baseLanes:e,cachePool:ef()}}function xu(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=It),e}function mm(e,t,n){var a=t.pendingProps,i=!1,u=(t.flags&128)!==0,f;if((f=u)||(f=e!==null&&e.memoizedState===null?!1:(rt.current&2)!==0),f&&(i=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(Be){if(i?ba(t):Sa(),(e=Ie)?(e=Sh(e,fn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:ma!==null?{id:zn,overflow:Tn}:null,retryLane:536870912,hydrationErrors:null},n=Qd(e),n.return=t,t.child=n,jt=t,Ie=null)):e=null,e===null)throw pa(t);return tc(e)?t.lanes=32:t.lanes=536870912,null}var g=a.children;return a=a.fallback,i?(Sa(),i=t.mode,g=Ji({mode:"hidden",children:g},i),a=Xa(a,i,n,null),g.return=t,a.return=t,g.sibling=a,t.child=g,a=t.child,a.memoizedState=vu(n),a.childLanes=xu(e,f,n),t.memoizedState=yu,Ds(null,a)):(ba(t),bu(t,g))}var S=e.memoizedState;if(S!==null&&(g=S.dehydrated,g!==null)){if(u)t.flags&256?(ba(t),t.flags&=-257,t=Su(e,t,n)):t.memoizedState!==null?(Sa(),t.child=e.child,t.flags|=128,t=null):(Sa(),g=a.fallback,i=t.mode,a=Ji({mode:"visible",children:a.children},i),g=Xa(g,i,n,null),g.flags|=2,a.return=t,g.return=t,a.sibling=g,t.child=a,Pa(t,e.child,null,n),a=t.child,a.memoizedState=vu(n),a.childLanes=xu(e,f,n),t.memoizedState=yu,t=Ds(null,a));else if(ba(t),tc(g)){if(f=g.nextSibling&&g.nextSibling.dataset,f)var T=f.dgst;f=T,a=Error(c(419)),a.stack="",a.digest=f,bs({value:a,source:null,stack:null}),t=Su(e,t,n)}else if(ft||zl(e,t,n,!1),f=(n&e.childLanes)!==0,ft||f){if(f=$e,f!==null&&(a=ln(f,n),a!==0&&a!==S.retryLane))throw S.retryLane=a,Qa(e,a),Ht(f,e,a),pu;ec(g)||lo(),t=Su(e,t,n)}else ec(g)?(t.flags|=192,t.child=e.child,t=null):(e=S.treeContext,Ie=hn(g.nextSibling),jt=t,Be=!0,ha=null,fn=!1,e!==null&&Wd(t,e),t=bu(t,a.children),t.flags|=4096);return t}return i?(Sa(),g=a.fallback,i=t.mode,S=e.child,T=S.sibling,a=Qn(S,{mode:"hidden",children:a.children}),a.subtreeFlags=S.subtreeFlags&65011712,T!==null?g=Qn(T,g):(g=Xa(g,i,n,null),g.flags|=2),g.return=t,a.return=t,a.sibling=g,t.child=a,Ds(null,a),a=t.child,g=e.child.memoizedState,g===null?g=vu(n):(i=g.cachePool,i!==null?(S=ct._currentValue,i=i.parent!==S?{parent:S,pool:S}:i):i=ef(),g={baseLanes:g.baseLanes|n,cachePool:i}),a.memoizedState=g,a.childLanes=xu(e,f,n),t.memoizedState=yu,Ds(e.child,a)):(ba(t),n=e.child,e=n.sibling,n=Qn(n,{mode:"visible",children:a.children}),n.return=t,n.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=n,t.memoizedState=null,n)}function bu(e,t){return t=Ji({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ji(e,t){return e=Wt(22,e,null,t),e.lanes=0,e}function Su(e,t,n){return Pa(t,e.child,null,n),e=bu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function hm(e,t,n){e.lanes|=t;var a=e.alternate;a!==null&&(a.lanes|=t),Ur(e.return,t,n)}function Nu(e,t,n,a,i,u){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:a,tail:n,tailMode:i,treeForkCount:u}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=a,f.tail=n,f.tailMode=i,f.treeForkCount=u)}function pm(e,t,n){var a=t.pendingProps,i=a.revealOrder,u=a.tail;a=a.children;var f=rt.current,g=(f&2)!==0;if(g?(f=f&1|2,t.flags|=128):f&=1,X(rt,f),Et(e,t,a,n),a=Be?xs:0,!g&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&hm(e,n,t);else if(e.tag===19)hm(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Bi(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Nu(t,!1,i,n,u,a);break;case"backwards":case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Bi(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Nu(t,!0,n,null,u,a);break;case"together":Nu(t,!1,null,null,void 0,a);break;default:t.memoizedState=null}return t.child}function Fn(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ca|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(zl(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,n=Qn(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Qn(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function ju(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ti(e)))}function wv(e,t,n){switch(t.tag){case 3:ye(t,t.stateNode.containerInfo),ga(t,ct,e.memoizedState.cache),Za();break;case 27:case 5:Ge(t);break;case 4:ye(t,t.stateNode.containerInfo);break;case 10:ga(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Wr(t),null;break;case 13:var a=t.memoizedState;if(a!==null)return a.dehydrated!==null?(ba(t),t.flags|=128,null):(n&t.child.childLanes)!==0?mm(e,t,n):(ba(t),e=Fn(e,t,n),e!==null?e.sibling:null);ba(t);break;case 19:var i=(e.flags&128)!==0;if(a=(n&t.childLanes)!==0,a||(zl(e,t,n,!1),a=(n&t.childLanes)!==0),i){if(a)return pm(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),X(rt,rt.current),a)break;return null;case 22:return t.lanes=0,om(e,t,n,t.pendingProps);case 24:ga(t,ct,e.memoizedState.cache)}return Fn(e,t,n)}function gm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)ft=!0;else{if(!ju(e,n)&&(t.flags&128)===0)return ft=!1,wv(e,t,n);ft=(e.flags&131072)!==0}else ft=!1,Be&&(t.flags&1048576)!==0&&Zd(t,xs,t.index);switch(t.lanes=0,t.tag){case 16:e:{var a=t.pendingProps;if(e=Fa(t.elementType),t.type=e,typeof e=="function")zr(e)?(a=tl(e,a),t.tag=1,t=dm(null,t,e,a,n)):(t.tag=0,t=gu(null,t,e,a,n));else{if(e!=null){var i=e.$$typeof;if(i===q){t.tag=11,t=lm(null,t,e,a,n);break e}else if(i===L){t.tag=14,t=sm(null,t,e,a,n);break e}}throw t=$(e)||e,Error(c(306,t,""))}}return t;case 0:return gu(e,t,t.type,t.pendingProps,n);case 1:return a=t.type,i=tl(a,t.pendingProps),dm(e,t,a,i,n);case 3:e:{if(ye(t,t.stateNode.containerInfo),e===null)throw Error(c(387));a=t.pendingProps;var u=t.memoizedState;i=u.element,Kr(e,t),Ms(t,a,null,n);var f=t.memoizedState;if(a=f.cache,ga(t,ct,a),a!==u.cache&&Br(t,[ct],n,!0),ws(),a=f.element,u.isDehydrated)if(u={element:a,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=u,t.memoizedState=u,t.flags&256){t=fm(e,t,a,n);break e}else if(a!==i){i=un(Error(c(424)),t),bs(i),t=fm(e,t,a,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Ie=hn(e.firstChild),jt=t,Be=!0,ha=null,fn=!0,n=of(t,null,a,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Za(),a===i){t=Fn(e,t,n);break e}Et(e,t,a,n)}t=t.child}return t;case 26:return Wi(e,t),e===null?(n=Mh(t.type,null,t.pendingProps,null))?t.memoizedState=n:Be||(n=t.type,e=t.pendingProps,a=fo(I.current).createElement(n),a[Nt]=t,a[Dt]=e,wt(a,n,e),vt(a),t.stateNode=a):t.memoizedState=Mh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ge(t),e===null&&Be&&(a=t.stateNode=Ch(t.type,t.pendingProps,I.current),jt=t,fn=!0,i=Ie,Ta(t.type)?(nc=i,Ie=hn(a.firstChild)):Ie=i),Et(e,t,t.pendingProps.children,n),Wi(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Be&&((i=a=Ie)&&(a=nx(a,t.type,t.pendingProps,fn),a!==null?(t.stateNode=a,jt=t,Ie=hn(a.firstChild),fn=!1,i=!0):i=!1),i||pa(t)),Ge(t),i=t.type,u=t.pendingProps,f=e!==null?e.memoizedProps:null,a=u.children,Fu(i,u)?a=null:f!==null&&Fu(i,f)&&(t.flags|=32),t.memoizedState!==null&&(i=$r(e,t,yv,null,null,n),Zs._currentValue=i),Wi(e,t),Et(e,t,a,n),t.child;case 6:return e===null&&Be&&((e=n=Ie)&&(n=ax(n,t.pendingProps,fn),n!==null?(t.stateNode=n,jt=t,Ie=null,e=!0):e=!1),e||pa(t)),null;case 13:return mm(e,t,n);case 4:return ye(t,t.stateNode.containerInfo),a=t.pendingProps,e===null?t.child=Pa(t,null,a,n):Et(e,t,a,n),t.child;case 11:return lm(e,t,t.type,t.pendingProps,n);case 7:return Et(e,t,t.pendingProps,n),t.child;case 8:return Et(e,t,t.pendingProps.children,n),t.child;case 12:return Et(e,t,t.pendingProps.children,n),t.child;case 10:return a=t.pendingProps,ga(t,t.type,a.value),Et(e,t,a.children,n),t.child;case 9:return i=t.type._context,a=t.pendingProps.children,Ja(t),i=Ct(i),a=a(i),t.flags|=1,Et(e,t,a,n),t.child;case 14:return sm(e,t,t.type,t.pendingProps,n);case 15:return im(e,t,t.type,t.pendingProps,n);case 19:return pm(e,t,n);case 31:return Ev(e,t,n);case 22:return om(e,t,n,t.pendingProps);case 24:return Ja(t),a=Ct(ct),e===null?(i=Lr(),i===null&&(i=$e,u=Hr(),i.pooledCache=u,u.refCount++,u!==null&&(i.pooledCacheLanes|=n),i=u),t.memoizedState={parent:a,cache:i},Gr(t),ga(t,ct,i)):((e.lanes&n)!==0&&(Kr(e,t),Ms(t,null,null,n),ws()),i=e.memoizedState,u=t.memoizedState,i.parent!==a?(i={parent:a,cache:a},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),ga(t,ct,a)):(a=u.cache,ga(t,ct,a),a!==i.cache&&Br(t,[ct],n,!0))),Et(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function In(e){e.flags|=4}function Cu(e,t,n,a,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Km())e.flags|=8192;else throw Ia=_i,Yr}else e.flags&=-16777217}function ym(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Dh(t))if(Km())e.flags|=8192;else throw Ia=_i,Yr}function $i(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?yt():536870912,e.lanes|=t,Ll|=t)}function _s(e,t){if(!Be)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var a=null;n!==null;)n.alternate!==null&&(a=n),n=n.sibling;a===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:a.sibling=null}}function Pe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,a=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,a|=i.subtreeFlags&65011712,a|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,a|=i.subtreeFlags,a|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=a,e.childLanes=n,t}function Mv(e,t,n){var a=t.pendingProps;switch(Dr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pe(t),null;case 1:return Pe(t),null;case 3:return n=t.stateNode,a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Wn(ct),Oe(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Ml(t)?In(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,kr())),Pe(t),null;case 26:var i=t.type,u=t.memoizedState;return e===null?(In(t),u!==null?(Pe(t),ym(t,u)):(Pe(t),Cu(t,i,null,a,n))):u?u!==e.memoizedState?(In(t),Pe(t),ym(t,u)):(Pe(t),t.flags&=-16777217):(e=e.memoizedProps,e!==a&&In(t),Pe(t),Cu(t,i,e,a,n)),null;case 27:if(ht(t),n=I.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&In(t);else{if(!a){if(t.stateNode===null)throw Error(c(166));return Pe(t),null}e=F.current,Ml(t)?Jd(t):(e=Ch(i,a,n),t.stateNode=e,In(t))}return Pe(t),null;case 5:if(ht(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==a&&In(t);else{if(!a){if(t.stateNode===null)throw Error(c(166));return Pe(t),null}if(u=F.current,Ml(t))Jd(t);else{var f=fo(I.current);switch(u){case 1:u=f.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:u=f.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":u=f.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":u=f.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":u=f.createElement("div"),u.innerHTML="<script><\/script>",u=u.removeChild(u.firstChild);break;case"select":u=typeof a.is=="string"?f.createElement("select",{is:a.is}):f.createElement("select"),a.multiple?u.multiple=!0:a.size&&(u.size=a.size);break;default:u=typeof a.is=="string"?f.createElement(i,{is:a.is}):f.createElement(i)}}u[Nt]=t,u[Dt]=a;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)u.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=u;e:switch(wt(u,i,a),i){case"button":case"input":case"select":case"textarea":a=!!a.autoFocus;break e;case"img":a=!0;break e;default:a=!1}a&&In(t)}}return Pe(t),Cu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==a&&In(t);else{if(typeof a!="string"&&t.stateNode===null)throw Error(c(166));if(e=I.current,Ml(t)){if(e=t.stateNode,n=t.memoizedProps,a=null,i=jt,i!==null)switch(i.tag){case 27:case 5:a=i.memoizedProps}e[Nt]=t,e=!!(e.nodeValue===n||a!==null&&a.suppressHydrationWarning===!0||mh(e.nodeValue,n)),e||pa(t,!0)}else e=fo(e).createTextNode(a),e[Nt]=t,t.stateNode=e}return Pe(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(a=Ml(t),n!==null){if(e===null){if(!a)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[Nt]=t}else Za(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Pe(t),e=!1}else n=kr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?($t(t),t):($t(t),null);if((t.flags&128)!==0)throw Error(c(558))}return Pe(t),null;case 13:if(a=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Ml(t),a!==null&&a.dehydrated!==null){if(e===null){if(!i)throw Error(c(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(c(317));i[Nt]=t}else Za(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Pe(t),i=!1}else i=kr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?($t(t),t):($t(t),null)}return $t(t),(t.flags&128)!==0?(t.lanes=n,t):(n=a!==null,e=e!==null&&e.memoizedState!==null,n&&(a=t.child,i=null,a.alternate!==null&&a.alternate.memoizedState!==null&&a.alternate.memoizedState.cachePool!==null&&(i=a.alternate.memoizedState.cachePool.pool),u=null,a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),u!==i&&(a.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),$i(t,t.updateQueue),Pe(t),null);case 4:return Oe(),e===null&&Xu(t.stateNode.containerInfo),Pe(t),null;case 10:return Wn(t.type),Pe(t),null;case 19:if(de(rt),a=t.memoizedState,a===null)return Pe(t),null;if(i=(t.flags&128)!==0,u=a.rendering,u===null)if(i)_s(a,!1);else{if(st!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(u=Bi(e),u!==null){for(t.flags|=128,_s(a,!1),e=u.updateQueue,t.updateQueue=e,$i(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Vd(n,e),n=n.sibling;return X(rt,rt.current&1|2),Be&&Xn(t,a.treeForkCount),t.child}e=e.sibling}a.tail!==null&&ot()>to&&(t.flags|=128,i=!0,_s(a,!1),t.lanes=4194304)}else{if(!i)if(e=Bi(u),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,$i(t,e),_s(a,!0),a.tail===null&&a.tailMode==="hidden"&&!u.alternate&&!Be)return Pe(t),null}else 2*ot()-a.renderingStartTime>to&&n!==536870912&&(t.flags|=128,i=!0,_s(a,!1),t.lanes=4194304);a.isBackwards?(u.sibling=t.child,t.child=u):(e=a.last,e!==null?e.sibling=u:t.child=u,a.last=u)}return a.tail!==null?(e=a.tail,a.rendering=e,a.tail=e.sibling,a.renderingStartTime=ot(),e.sibling=null,n=rt.current,X(rt,i?n&1|2:n&1),Be&&Xn(t,a.treeForkCount),e):(Pe(t),null);case 22:case 23:return $t(t),Zr(),a=t.memoizedState!==null,e!==null?e.memoizedState!==null!==a&&(t.flags|=8192):a&&(t.flags|=8192),a?(n&536870912)!==0&&(t.flags&128)===0&&(Pe(t),t.subtreeFlags&6&&(t.flags|=8192)):Pe(t),n=t.updateQueue,n!==null&&$i(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),a=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),a!==n&&(t.flags|=2048),e!==null&&de($a),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Wn(ct),Pe(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function zv(e,t){switch(Dr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Wn(ct),Oe(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ht(t),null;case 31:if(t.memoizedState!==null){if($t(t),t.alternate===null)throw Error(c(340));Za()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if($t(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));Za()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return de(rt),null;case 4:return Oe(),null;case 10:return Wn(t.type),null;case 22:case 23:return $t(t),Zr(),e!==null&&de($a),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Wn(ct),null;case 25:return null;default:return null}}function vm(e,t){switch(Dr(t),t.tag){case 3:Wn(ct),Oe();break;case 26:case 27:case 5:ht(t);break;case 4:Oe();break;case 31:t.memoizedState!==null&&$t(t);break;case 13:$t(t);break;case 19:de(rt);break;case 10:Wn(t.type);break;case 22:case 23:$t(t),Zr(),e!==null&&de($a);break;case 24:Wn(ct)}}function ks(e,t){try{var n=t.updateQueue,a=n!==null?n.lastEffect:null;if(a!==null){var i=a.next;n=i;do{if((n.tag&e)===e){a=void 0;var u=n.create,f=n.inst;a=u(),f.destroy=a}n=n.next}while(n!==i)}}catch(g){Xe(t,t.return,g)}}function Na(e,t,n){try{var a=t.updateQueue,i=a!==null?a.lastEffect:null;if(i!==null){var u=i.next;a=u;do{if((a.tag&e)===e){var f=a.inst,g=f.destroy;if(g!==void 0){f.destroy=void 0,i=t;var S=n,T=g;try{T()}catch(H){Xe(i,S,H)}}}a=a.next}while(a!==u)}}catch(H){Xe(t,t.return,H)}}function xm(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{uf(t,n)}catch(a){Xe(e,e.return,a)}}}function bm(e,t,n){n.props=tl(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(a){Xe(e,t,a)}}function Rs(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var a=e.stateNode;break;case 30:a=e.stateNode;break;default:a=e.stateNode}typeof n=="function"?e.refCleanup=n(a):n.current=a}}catch(i){Xe(e,t,i)}}function On(e,t){var n=e.ref,a=e.refCleanup;if(n!==null)if(typeof a=="function")try{a()}catch(i){Xe(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){Xe(e,t,i)}else n.current=null}function Sm(e){var t=e.type,n=e.memoizedProps,a=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&a.focus();break e;case"img":n.src?a.src=n.src:n.srcSet&&(a.srcset=n.srcSet)}}catch(i){Xe(e,e.return,i)}}function Eu(e,t,n){try{var a=e.stateNode;$v(a,e.type,n,t),a[Dt]=t}catch(i){Xe(e,e.return,i)}}function Nm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ta(e.type)||e.tag===4}function wu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Nm(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Ta(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Mu(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Kn));else if(a!==4&&(a===27&&Ta(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(Mu(e,t,n),e=e.sibling;e!==null;)Mu(e,t,n),e=e.sibling}function Fi(e,t,n){var a=e.tag;if(a===5||a===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(a!==4&&(a===27&&Ta(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(Fi(e,t,n),e=e.sibling;e!==null;)Fi(e,t,n),e=e.sibling}function jm(e){var t=e.stateNode,n=e.memoizedProps;try{for(var a=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);wt(t,a,n),t[Nt]=e,t[Dt]=n}catch(u){Xe(e,e.return,u)}}var Pn=!1,mt=!1,zu=!1,Cm=typeof WeakSet=="function"?WeakSet:Set,xt=null;function Tv(e,t){if(e=e.containerInfo,Ju=xo,e=Rd(e),Sr(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var a=n.getSelection&&n.getSelection();if(a&&a.rangeCount!==0){n=a.anchorNode;var i=a.anchorOffset,u=a.focusNode;a=a.focusOffset;try{n.nodeType,u.nodeType}catch{n=null;break e}var f=0,g=-1,S=-1,T=0,H=0,K=e,A=null;t:for(;;){for(var R;K!==n||i!==0&&K.nodeType!==3||(g=f+i),K!==u||a!==0&&K.nodeType!==3||(S=f+a),K.nodeType===3&&(f+=K.nodeValue.length),(R=K.firstChild)!==null;)A=K,K=R;for(;;){if(K===e)break t;if(A===n&&++T===i&&(g=f),A===u&&++H===a&&(S=f),(R=K.nextSibling)!==null)break;K=A,A=K.parentNode}K=R}n=g===-1||S===-1?null:{start:g,end:S}}else n=null}n=n||{start:0,end:0}}else n=null;for($u={focusedElem:e,selectionRange:n},xo=!1,xt=t;xt!==null;)if(t=xt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,xt=e;else for(;xt!==null;){switch(t=xt,u=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(n=0;n<e.length;n++)i=e[n],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&u!==null){e=void 0,n=t,i=u.memoizedProps,u=u.memoizedState,a=n.stateNode;try{var te=tl(n.type,i);e=a.getSnapshotBeforeUpdate(te,u),a.__reactInternalSnapshotBeforeUpdate=e}catch(pe){Xe(n,n.return,pe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)Pu(e);else if(n===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Pu(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(c(163))}if(e=t.sibling,e!==null){e.return=t.return,xt=e;break}xt=t.return}}function Em(e,t,n){var a=n.flags;switch(n.tag){case 0:case 11:case 15:ta(e,n),a&4&&ks(5,n);break;case 1:if(ta(e,n),a&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(f){Xe(n,n.return,f)}else{var i=tl(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){Xe(n,n.return,f)}}a&64&&xm(n),a&512&&Rs(n,n.return);break;case 3:if(ta(e,n),a&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{uf(e,t)}catch(f){Xe(n,n.return,f)}}break;case 27:t===null&&a&4&&jm(n);case 26:case 5:ta(e,n),t===null&&a&4&&Sm(n),a&512&&Rs(n,n.return);break;case 12:ta(e,n);break;case 31:ta(e,n),a&4&&zm(e,n);break;case 13:ta(e,n),a&4&&Tm(e,n),a&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Hv.bind(null,n),lx(e,n))));break;case 22:if(a=n.memoizedState!==null||Pn,!a){t=t!==null&&t.memoizedState!==null||mt,i=Pn;var u=mt;Pn=a,(mt=t)&&!u?na(e,n,(n.subtreeFlags&8772)!==0):ta(e,n),Pn=i,mt=u}break;case 30:break;default:ta(e,n)}}function wm(e){var t=e.alternate;t!==null&&(e.alternate=null,wm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&lr(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var nt=null,kt=!1;function ea(e,t,n){for(n=n.child;n!==null;)Mm(e,t,n),n=n.sibling}function Mm(e,t,n){if(Z&&typeof Z.onCommitFiberUnmount=="function")try{Z.onCommitFiberUnmount(qn,n)}catch{}switch(n.tag){case 26:mt||On(n,t),ea(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:mt||On(n,t);var a=nt,i=kt;Ta(n.type)&&(nt=n.stateNode,kt=!1),ea(e,t,n),Vs(n.stateNode),nt=a,kt=i;break;case 5:mt||On(n,t);case 6:if(a=nt,i=kt,nt=null,ea(e,t,n),nt=a,kt=i,nt!==null)if(kt)try{(nt.nodeType===9?nt.body:nt.nodeName==="HTML"?nt.ownerDocument.body:nt).removeChild(n.stateNode)}catch(u){Xe(n,t,u)}else try{nt.removeChild(n.stateNode)}catch(u){Xe(n,t,u)}break;case 18:nt!==null&&(kt?(e=nt,xh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),Wl(e)):xh(nt,n.stateNode));break;case 4:a=nt,i=kt,nt=n.stateNode.containerInfo,kt=!0,ea(e,t,n),nt=a,kt=i;break;case 0:case 11:case 14:case 15:Na(2,n,t),mt||Na(4,n,t),ea(e,t,n);break;case 1:mt||(On(n,t),a=n.stateNode,typeof a.componentWillUnmount=="function"&&bm(n,t,a)),ea(e,t,n);break;case 21:ea(e,t,n);break;case 22:mt=(a=mt)||n.memoizedState!==null,ea(e,t,n),mt=a;break;default:ea(e,t,n)}}function zm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Wl(e)}catch(n){Xe(t,t.return,n)}}}function Tm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Wl(e)}catch(n){Xe(t,t.return,n)}}function Ov(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Cm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Cm),t;default:throw Error(c(435,e.tag))}}function Ii(e,t){var n=Ov(e);t.forEach(function(a){if(!n.has(a)){n.add(a);var i=qv.bind(null,e,a);a.then(i,i)}})}function Rt(e,t){var n=t.deletions;if(n!==null)for(var a=0;a<n.length;a++){var i=n[a],u=e,f=t,g=f;e:for(;g!==null;){switch(g.tag){case 27:if(Ta(g.type)){nt=g.stateNode,kt=!1;break e}break;case 5:nt=g.stateNode,kt=!1;break e;case 3:case 4:nt=g.stateNode.containerInfo,kt=!0;break e}g=g.return}if(nt===null)throw Error(c(160));Mm(u,f,i),nt=null,kt=!1,u=i.alternate,u!==null&&(u.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Om(t,e),t=t.sibling}var vn=null;function Om(e,t){var n=e.alternate,a=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Rt(t,e),Ut(e),a&4&&(Na(3,e,e.return),ks(3,e),Na(5,e,e.return));break;case 1:Rt(t,e),Ut(e),a&512&&(mt||n===null||On(n,n.return)),a&64&&Pn&&(e=e.updateQueue,e!==null&&(a=e.callbacks,a!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?a:n.concat(a))));break;case 26:var i=vn;if(Rt(t,e),Ut(e),a&512&&(mt||n===null||On(n,n.return)),a&4){var u=n!==null?n.memoizedState:null;if(a=e.memoizedState,n===null)if(a===null)if(e.stateNode===null){e:{a=e.type,n=e.memoizedProps,i=i.ownerDocument||i;t:switch(a){case"title":u=i.getElementsByTagName("title")[0],(!u||u[rs]||u[Nt]||u.namespaceURI==="http://www.w3.org/2000/svg"||u.hasAttribute("itemprop"))&&(u=i.createElement(a),i.head.insertBefore(u,i.querySelector("head > title"))),wt(u,a,n),u[Nt]=e,vt(u),a=u;break e;case"link":var f=Oh("link","href",i).get(a+(n.href||""));if(f){for(var g=0;g<f.length;g++)if(u=f[g],u.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&u.getAttribute("rel")===(n.rel==null?null:n.rel)&&u.getAttribute("title")===(n.title==null?null:n.title)&&u.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){f.splice(g,1);break t}}u=i.createElement(a),wt(u,a,n),i.head.appendChild(u);break;case"meta":if(f=Oh("meta","content",i).get(a+(n.content||""))){for(g=0;g<f.length;g++)if(u=f[g],u.getAttribute("content")===(n.content==null?null:""+n.content)&&u.getAttribute("name")===(n.name==null?null:n.name)&&u.getAttribute("property")===(n.property==null?null:n.property)&&u.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&u.getAttribute("charset")===(n.charSet==null?null:n.charSet)){f.splice(g,1);break t}}u=i.createElement(a),wt(u,a,n),i.head.appendChild(u);break;default:throw Error(c(468,a))}u[Nt]=e,vt(u),a=u}e.stateNode=a}else Ah(i,e.type,e.stateNode);else e.stateNode=Th(i,a,e.memoizedProps);else u!==a?(u===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):u.count--,a===null?Ah(i,e.type,e.stateNode):Th(i,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Eu(e,e.memoizedProps,n.memoizedProps)}break;case 27:Rt(t,e),Ut(e),a&512&&(mt||n===null||On(n,n.return)),n!==null&&a&4&&Eu(e,e.memoizedProps,n.memoizedProps);break;case 5:if(Rt(t,e),Ut(e),a&512&&(mt||n===null||On(n,n.return)),e.flags&32){i=e.stateNode;try{yl(i,"")}catch(te){Xe(e,e.return,te)}}a&4&&e.stateNode!=null&&(i=e.memoizedProps,Eu(e,i,n!==null?n.memoizedProps:i)),a&1024&&(zu=!0);break;case 6:if(Rt(t,e),Ut(e),a&4){if(e.stateNode===null)throw Error(c(162));a=e.memoizedProps,n=e.stateNode;try{n.nodeValue=a}catch(te){Xe(e,e.return,te)}}break;case 3:if(po=null,i=vn,vn=mo(t.containerInfo),Rt(t,e),vn=i,Ut(e),a&4&&n!==null&&n.memoizedState.isDehydrated)try{Wl(t.containerInfo)}catch(te){Xe(e,e.return,te)}zu&&(zu=!1,Am(e));break;case 4:a=vn,vn=mo(e.stateNode.containerInfo),Rt(t,e),Ut(e),vn=a;break;case 12:Rt(t,e),Ut(e);break;case 31:Rt(t,e),Ut(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Ii(e,a)));break;case 13:Rt(t,e),Ut(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(eo=ot()),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Ii(e,a)));break;case 22:i=e.memoizedState!==null;var S=n!==null&&n.memoizedState!==null,T=Pn,H=mt;if(Pn=T||i,mt=H||S,Rt(t,e),mt=H,Pn=T,Ut(e),a&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(n===null||S||Pn||mt||nl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){S=n=t;try{if(u=S.stateNode,i)f=u.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{g=S.stateNode;var K=S.memoizedProps.style,A=K!=null&&K.hasOwnProperty("display")?K.display:null;g.style.display=A==null||typeof A=="boolean"?"":(""+A).trim()}}catch(te){Xe(S,S.return,te)}}}else if(t.tag===6){if(n===null){S=t;try{S.stateNode.nodeValue=i?"":S.memoizedProps}catch(te){Xe(S,S.return,te)}}}else if(t.tag===18){if(n===null){S=t;try{var R=S.stateNode;i?bh(R,!0):bh(S.stateNode,!1)}catch(te){Xe(S,S.return,te)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}a&4&&(a=e.updateQueue,a!==null&&(n=a.retryQueue,n!==null&&(a.retryQueue=null,Ii(e,n))));break;case 19:Rt(t,e),Ut(e),a&4&&(a=e.updateQueue,a!==null&&(e.updateQueue=null,Ii(e,a)));break;case 30:break;case 21:break;default:Rt(t,e),Ut(e)}}function Ut(e){var t=e.flags;if(t&2){try{for(var n,a=e.return;a!==null;){if(Nm(a)){n=a;break}a=a.return}if(n==null)throw Error(c(160));switch(n.tag){case 27:var i=n.stateNode,u=wu(e);Fi(e,u,i);break;case 5:var f=n.stateNode;n.flags&32&&(yl(f,""),n.flags&=-33);var g=wu(e);Fi(e,g,f);break;case 3:case 4:var S=n.stateNode.containerInfo,T=wu(e);Mu(e,T,S);break;default:throw Error(c(161))}}catch(H){Xe(e,e.return,H)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Am(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Am(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function ta(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Em(e,t.alternate,t),t=t.sibling}function nl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Na(4,t,t.return),nl(t);break;case 1:On(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount=="function"&&bm(t,t.return,n),nl(t);break;case 27:Vs(t.stateNode);case 26:case 5:On(t,t.return),nl(t);break;case 22:t.memoizedState===null&&nl(t);break;case 30:nl(t);break;default:nl(t)}e=e.sibling}}function na(e,t,n){for(n=n&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var a=t.alternate,i=e,u=t,f=u.flags;switch(u.tag){case 0:case 11:case 15:na(i,u,n),ks(4,u);break;case 1:if(na(i,u,n),a=u,i=a.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(T){Xe(a,a.return,T)}if(a=u,i=a.updateQueue,i!==null){var g=a.stateNode;try{var S=i.shared.hiddenCallbacks;if(S!==null)for(i.shared.hiddenCallbacks=null,i=0;i<S.length;i++)rf(S[i],g)}catch(T){Xe(a,a.return,T)}}n&&f&64&&xm(u),Rs(u,u.return);break;case 27:jm(u);case 26:case 5:na(i,u,n),n&&a===null&&f&4&&Sm(u),Rs(u,u.return);break;case 12:na(i,u,n);break;case 31:na(i,u,n),n&&f&4&&zm(i,u);break;case 13:na(i,u,n),n&&f&4&&Tm(i,u);break;case 22:u.memoizedState===null&&na(i,u,n),Rs(u,u.return);break;case 30:break;default:na(i,u,n)}t=t.sibling}}function Tu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Ss(n))}function Ou(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ss(e))}function xn(e,t,n,a){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Dm(e,t,n,a),t=t.sibling}function Dm(e,t,n,a){var i=t.flags;switch(t.tag){case 0:case 11:case 15:xn(e,t,n,a),i&2048&&ks(9,t);break;case 1:xn(e,t,n,a);break;case 3:xn(e,t,n,a),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ss(e)));break;case 12:if(i&2048){xn(e,t,n,a),e=t.stateNode;try{var u=t.memoizedProps,f=u.id,g=u.onPostCommit;typeof g=="function"&&g(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(S){Xe(t,t.return,S)}}else xn(e,t,n,a);break;case 31:xn(e,t,n,a);break;case 13:xn(e,t,n,a);break;case 23:break;case 22:u=t.stateNode,f=t.alternate,t.memoizedState!==null?u._visibility&2?xn(e,t,n,a):Us(e,t):u._visibility&2?xn(e,t,n,a):(u._visibility|=2,Bl(e,t,n,a,(t.subtreeFlags&10256)!==0||!1)),i&2048&&Tu(f,t);break;case 24:xn(e,t,n,a),i&2048&&Ou(t.alternate,t);break;default:xn(e,t,n,a)}}function Bl(e,t,n,a,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var u=e,f=t,g=n,S=a,T=f.flags;switch(f.tag){case 0:case 11:case 15:Bl(u,f,g,S,i),ks(8,f);break;case 23:break;case 22:var H=f.stateNode;f.memoizedState!==null?H._visibility&2?Bl(u,f,g,S,i):Us(u,f):(H._visibility|=2,Bl(u,f,g,S,i)),i&&T&2048&&Tu(f.alternate,f);break;case 24:Bl(u,f,g,S,i),i&&T&2048&&Ou(f.alternate,f);break;default:Bl(u,f,g,S,i)}t=t.sibling}}function Us(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,a=t,i=a.flags;switch(a.tag){case 22:Us(n,a),i&2048&&Tu(a.alternate,a);break;case 24:Us(n,a),i&2048&&Ou(a.alternate,a);break;default:Us(n,a)}t=t.sibling}}var Bs=8192;function Hl(e,t,n){if(e.subtreeFlags&Bs)for(e=e.child;e!==null;)_m(e,t,n),e=e.sibling}function _m(e,t,n){switch(e.tag){case 26:Hl(e,t,n),e.flags&Bs&&e.memoizedState!==null&&gx(n,vn,e.memoizedState,e.memoizedProps);break;case 5:Hl(e,t,n);break;case 3:case 4:var a=vn;vn=mo(e.stateNode.containerInfo),Hl(e,t,n),vn=a;break;case 22:e.memoizedState===null&&(a=e.alternate,a!==null&&a.memoizedState!==null?(a=Bs,Bs=16777216,Hl(e,t,n),Bs=a):Hl(e,t,n));break;default:Hl(e,t,n)}}function km(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Hs(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];xt=a,Um(a,e)}km(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Rm(e),e=e.sibling}function Rm(e){switch(e.tag){case 0:case 11:case 15:Hs(e),e.flags&2048&&Na(9,e,e.return);break;case 3:Hs(e);break;case 12:Hs(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Pi(e)):Hs(e);break;default:Hs(e)}}function Pi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var a=t[n];xt=a,Um(a,e)}km(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Na(8,t,t.return),Pi(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Pi(t));break;default:Pi(t)}e=e.sibling}}function Um(e,t){for(;xt!==null;){var n=xt;switch(n.tag){case 0:case 11:case 15:Na(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var a=n.memoizedState.cachePool.pool;a!=null&&a.refCount++}break;case 24:Ss(n.memoizedState.cache)}if(a=n.child,a!==null)a.return=n,xt=a;else e:for(n=e;xt!==null;){a=xt;var i=a.sibling,u=a.return;if(wm(a),a===n){xt=null;break e}if(i!==null){i.return=u,xt=i;break e}xt=u}}}var Av={getCacheForType:function(e){var t=Ct(ct),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ct(ct).controller.signal}},Dv=typeof WeakMap=="function"?WeakMap:Map,Ke=0,$e=null,De=null,ke=0,Qe=0,Ft=null,ja=!1,ql=!1,Au=!1,aa=0,st=0,Ca=0,al=0,Du=0,It=0,Ll=0,qs=null,Bt=null,_u=!1,eo=0,Bm=0,to=1/0,no=null,Ea=null,gt=0,wa=null,Yl=null,la=0,ku=0,Ru=null,Hm=null,Ls=0,Uu=null;function Pt(){return(Ke&2)!==0&&ke!==0?ke&-ke:D.T!==null?Gu():is()}function qm(){if(It===0)if((ke&536870912)===0||Be){var e=me;me<<=1,(me&3932160)===0&&(me=262144),It=e}else It=536870912;return e=Jt.current,e!==null&&(e.flags|=32),It}function Ht(e,t,n){(e===$e&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)&&(Gl(e,0),Ma(e,ke,It,!1)),gn(e,n),((Ke&2)===0||e!==$e)&&(e===$e&&((Ke&2)===0&&(al|=n),st===4&&Ma(e,ke,It,!1)),An(e))}function Lm(e,t,n){if((Ke&6)!==0)throw Error(c(327));var a=!n&&(t&127)===0&&(t&e.expiredLanes)===0||zt(e,t),i=a?Rv(e,t):Hu(e,t,!0),u=a;do{if(i===0){ql&&!a&&Ma(e,t,0,!1);break}else{if(n=e.current.alternate,u&&!_v(n)){i=Hu(e,t,!1),u=!1;continue}if(i===2){if(u=t,e.errorRecoveryDisabledLanes&u)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var g=e;i=qs;var S=g.current.memoizedState.isDehydrated;if(S&&(Gl(g,f).flags|=256),f=Hu(g,f,!1),f!==2){if(Au&&!S){g.errorRecoveryDisabledLanes|=u,al|=u,i=4;break e}u=Bt,Bt=i,u!==null&&(Bt===null?Bt=u:Bt.push.apply(Bt,u))}i=f}if(u=!1,i!==2)continue}}if(i===1){Gl(e,0),Ma(e,t,0,!0);break}e:{switch(a=e,u=i,u){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:Ma(a,t,It,!ja);break e;case 2:Bt=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(i=eo+300-ot(),10<i)){if(Ma(a,t,It,!ja),ge(a,0,!0)!==0)break e;la=t,a.timeoutHandle=yh(Ym.bind(null,a,n,Bt,no,_u,t,It,al,Ll,ja,u,"Throttled",-0,0),i);break e}Ym(a,n,Bt,no,_u,t,It,al,Ll,ja,u,null,-0,0)}}break}while(!0);An(e)}function Ym(e,t,n,a,i,u,f,g,S,T,H,K,A,R){if(e.timeoutHandle=-1,K=t.subtreeFlags,K&8192||(K&16785408)===16785408){K={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Kn},_m(t,u,K);var te=(u&62914560)===u?eo-ot():(u&4194048)===u?Bm-ot():0;if(te=yx(K,te),te!==null){la=u,e.cancelPendingCommit=te(Jm.bind(null,e,t,u,n,a,i,f,g,S,H,K,null,A,R)),Ma(e,u,f,!T);return}}Jm(e,t,u,n,a,i,f,g,S)}function _v(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var a=0;a<n.length;a++){var i=n[a],u=i.getSnapshot;i=i.value;try{if(!Zt(u(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ma(e,t,n,a){t&=~Du,t&=~al,e.suspendedLanes|=t,e.pingedLanes&=~t,a&&(e.warmLanes|=t),a=e.expirationTimes;for(var i=t;0<i;){var u=31-fe(i),f=1<<u;a[u]=-1,i&=~f}n!==0&&La(e,n,t)}function ao(){return(Ke&6)===0?(Ys(0),!1):!0}function Bu(){if(De!==null){if(Qe===0)var e=De.return;else e=De,Zn=Wa=null,Pr(e),Dl=null,js=0,e=De;for(;e!==null;)vm(e.alternate,e),e=e.return;De=null}}function Gl(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Pv(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),la=0,Bu(),$e=e,De=n=Qn(e.current,null),ke=t,Qe=0,Ft=null,ja=!1,ql=zt(e,t),Au=!1,Ll=It=Du=al=Ca=st=0,Bt=qs=null,_u=!1,(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var i=31-fe(a),u=1<<i;t|=e[i],a&=~u}return aa=t,Ci(),n}function Gm(e,t){je=null,D.H=As,t===Al||t===Di?(t=af(),Qe=3):t===Yr?(t=af(),Qe=4):Qe=t===pu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Ft=t,De===null&&(st=1,Xi(e,un(t,e.current)))}function Km(){var e=Jt.current;return e===null?!0:(ke&4194048)===ke?mn===null:(ke&62914560)===ke||(ke&536870912)!==0?e===mn:!1}function Vm(){var e=D.H;return D.H=As,e===null?As:e}function Qm(){var e=D.A;return D.A=Av,e}function lo(){st=4,ja||(ke&4194048)!==ke&&Jt.current!==null||(ql=!0),(Ca&134217727)===0&&(al&134217727)===0||$e===null||Ma($e,ke,It,!1)}function Hu(e,t,n){var a=Ke;Ke|=2;var i=Vm(),u=Qm();($e!==e||ke!==t)&&(no=null,Gl(e,t)),t=!1;var f=st;e:do try{if(Qe!==0&&De!==null){var g=De,S=Ft;switch(Qe){case 8:Bu(),f=6;break e;case 3:case 2:case 9:case 6:Jt.current===null&&(t=!0);var T=Qe;if(Qe=0,Ft=null,Kl(e,g,S,T),n&&ql){f=0;break e}break;default:T=Qe,Qe=0,Ft=null,Kl(e,g,S,T)}}kv(),f=st;break}catch(H){Gm(e,H)}while(!0);return t&&e.shellSuspendCounter++,Zn=Wa=null,Ke=a,D.H=i,D.A=u,De===null&&($e=null,ke=0,Ci()),f}function kv(){for(;De!==null;)Xm(De)}function Rv(e,t){var n=Ke;Ke|=2;var a=Vm(),i=Qm();$e!==e||ke!==t?(no=null,to=ot()+500,Gl(e,t)):ql=zt(e,t);e:do try{if(Qe!==0&&De!==null){t=De;var u=Ft;t:switch(Qe){case 1:Qe=0,Ft=null,Kl(e,t,u,1);break;case 2:case 9:if(tf(u)){Qe=0,Ft=null,Zm(t);break}t=function(){Qe!==2&&Qe!==9||$e!==e||(Qe=7),An(e)},u.then(t,t);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:tf(u)?(Qe=0,Ft=null,Zm(t)):(Qe=0,Ft=null,Kl(e,t,u,7));break;case 5:var f=null;switch(De.tag){case 26:f=De.memoizedState;case 5:case 27:var g=De;if(f?Dh(f):g.stateNode.complete){Qe=0,Ft=null;var S=g.sibling;if(S!==null)De=S;else{var T=g.return;T!==null?(De=T,so(T)):De=null}break t}}Qe=0,Ft=null,Kl(e,t,u,5);break;case 6:Qe=0,Ft=null,Kl(e,t,u,6);break;case 8:Bu(),st=6;break e;default:throw Error(c(462))}}Uv();break}catch(H){Gm(e,H)}while(!0);return Zn=Wa=null,D.H=a,D.A=i,Ke=n,De!==null?0:($e=null,ke=0,Ci(),st)}function Uv(){for(;De!==null&&!ca();)Xm(De)}function Xm(e){var t=gm(e.alternate,e,aa);e.memoizedProps=e.pendingProps,t===null?so(e):De=t}function Zm(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=cm(n,t,t.pendingProps,t.type,void 0,ke);break;case 11:t=cm(n,t,t.pendingProps,t.type.render,t.ref,ke);break;case 5:Pr(t);default:vm(n,t),t=De=Vd(t,aa),t=gm(n,t,aa)}e.memoizedProps=e.pendingProps,t===null?so(e):De=t}function Kl(e,t,n,a){Zn=Wa=null,Pr(t),Dl=null,js=0;var i=t.return;try{if(Cv(e,i,t,n,ke)){st=1,Xi(e,un(n,e.current)),De=null;return}}catch(u){if(i!==null)throw De=i,u;st=1,Xi(e,un(n,e.current)),De=null;return}t.flags&32768?(Be||a===1?e=!0:ql||(ke&536870912)!==0?e=!1:(ja=e=!0,(a===2||a===9||a===3||a===6)&&(a=Jt.current,a!==null&&a.tag===13&&(a.flags|=16384))),Wm(t,e)):so(t)}function so(e){var t=e;do{if((t.flags&32768)!==0){Wm(t,ja);return}e=t.return;var n=Mv(t.alternate,t,aa);if(n!==null){De=n;return}if(t=t.sibling,t!==null){De=t;return}De=t=e}while(t!==null);st===0&&(st=5)}function Wm(e,t){do{var n=zv(e.alternate,e);if(n!==null){n.flags&=32767,De=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){De=e;return}De=e=n}while(e!==null);st=6,De=null}function Jm(e,t,n,a,i,u,f,g,S){e.cancelPendingCommit=null;do io();while(gt!==0);if((Ke&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(u=t.lanes|t.childLanes,u|=wr,ls(e,n,u,f,g,S),e===$e&&(De=$e=null,ke=0),Yl=t,wa=e,la=n,ku=u,Ru=i,Hm=a,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Lv(wn,function(){return eh(),null})):(e.callbackNode=null,e.callbackPriority=0),a=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||a){a=D.T,D.T=null,i=J.p,J.p=2,f=Ke,Ke|=4;try{Tv(e,t,n)}finally{Ke=f,J.p=i,D.T=a}}gt=1,$m(),Fm(),Im()}}function $m(){if(gt===1){gt=0;var e=wa,t=Yl,n=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||n){n=D.T,D.T=null;var a=J.p;J.p=2;var i=Ke;Ke|=4;try{Om(t,e);var u=$u,f=Rd(e.containerInfo),g=u.focusedElem,S=u.selectionRange;if(f!==g&&g&&g.ownerDocument&&kd(g.ownerDocument.documentElement,g)){if(S!==null&&Sr(g)){var T=S.start,H=S.end;if(H===void 0&&(H=T),"selectionStart"in g)g.selectionStart=T,g.selectionEnd=Math.min(H,g.value.length);else{var K=g.ownerDocument||document,A=K&&K.defaultView||window;if(A.getSelection){var R=A.getSelection(),te=g.textContent.length,pe=Math.min(S.start,te),Je=S.end===void 0?pe:Math.min(S.end,te);!R.extend&&pe>Je&&(f=Je,Je=pe,pe=f);var w=_d(g,pe),C=_d(g,Je);if(w&&C&&(R.rangeCount!==1||R.anchorNode!==w.node||R.anchorOffset!==w.offset||R.focusNode!==C.node||R.focusOffset!==C.offset)){var z=K.createRange();z.setStart(w.node,w.offset),R.removeAllRanges(),pe>Je?(R.addRange(z),R.extend(C.node,C.offset)):(z.setEnd(C.node,C.offset),R.addRange(z))}}}}for(K=[],R=g;R=R.parentNode;)R.nodeType===1&&K.push({element:R,left:R.scrollLeft,top:R.scrollTop});for(typeof g.focus=="function"&&g.focus(),g=0;g<K.length;g++){var Y=K[g];Y.element.scrollLeft=Y.left,Y.element.scrollTop=Y.top}}xo=!!Ju,$u=Ju=null}finally{Ke=i,J.p=a,D.T=n}}e.current=t,gt=2}}function Fm(){if(gt===2){gt=0;var e=wa,t=Yl,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=D.T,D.T=null;var a=J.p;J.p=2;var i=Ke;Ke|=4;try{Em(e,t.alternate,t)}finally{Ke=i,J.p=a,D.T=n}}gt=3}}function Im(){if(gt===4||gt===3){gt=0,Bn();var e=wa,t=Yl,n=la,a=Hm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?gt=5:(gt=0,Yl=wa=null,Pm(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(Ea=null),cl(n),t=t.stateNode,Z&&typeof Z.onCommitFiberRoot=="function")try{Z.onCommitFiberRoot(qn,t,void 0,(t.current.flags&128)===128)}catch{}if(a!==null){t=D.T,i=J.p,J.p=2,D.T=null;try{for(var u=e.onRecoverableError,f=0;f<a.length;f++){var g=a[f];u(g.value,{componentStack:g.stack})}}finally{D.T=t,J.p=i}}(la&3)!==0&&io(),An(e),i=e.pendingLanes,(n&261930)!==0&&(i&42)!==0?e===Uu?Ls++:(Ls=0,Uu=e):Ls=0,Ys(0)}}function Pm(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ss(t)))}function io(){return $m(),Fm(),Im(),eh()}function eh(){if(gt!==5)return!1;var e=wa,t=ku;ku=0;var n=cl(la),a=D.T,i=J.p;try{J.p=32>n?32:n,D.T=null,n=Ru,Ru=null;var u=wa,f=la;if(gt=0,Yl=wa=null,la=0,(Ke&6)!==0)throw Error(c(331));var g=Ke;if(Ke|=4,Rm(u.current),Dm(u,u.current,f,n),Ke=g,Ys(0,!1),Z&&typeof Z.onPostCommitFiberRoot=="function")try{Z.onPostCommitFiberRoot(qn,u)}catch{}return!0}finally{J.p=i,D.T=a,Pm(e,t)}}function th(e,t,n){t=un(n,t),t=hu(e.stateNode,t,2),e=xa(e,t,2),e!==null&&(gn(e,2),An(e))}function Xe(e,t,n){if(e.tag===3)th(e,e,n);else for(;t!==null;){if(t.tag===3){th(t,e,n);break}else if(t.tag===1){var a=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof a.componentDidCatch=="function"&&(Ea===null||!Ea.has(a))){e=un(n,e),n=nm(2),a=xa(t,n,2),a!==null&&(am(n,a,t,e),gn(a,2),An(a));break}}t=t.return}}function qu(e,t,n){var a=e.pingCache;if(a===null){a=e.pingCache=new Dv;var i=new Set;a.set(t,i)}else i=a.get(t),i===void 0&&(i=new Set,a.set(t,i));i.has(n)||(Au=!0,i.add(n),e=Bv.bind(null,e,t,n),t.then(e,e))}function Bv(e,t,n){var a=e.pingCache;a!==null&&a.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,$e===e&&(ke&n)===n&&(st===4||st===3&&(ke&62914560)===ke&&300>ot()-eo?(Ke&2)===0&&Gl(e,0):Du|=n,Ll===ke&&(Ll=0)),An(e)}function nh(e,t){t===0&&(t=yt()),e=Qa(e,t),e!==null&&(gn(e,t),An(e))}function Hv(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),nh(e,n)}function qv(e,t){var n=0;switch(e.tag){case 31:case 13:var a=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:a=e.stateNode;break;case 22:a=e.stateNode._retryCache;break;default:throw Error(c(314))}a!==null&&a.delete(t),nh(e,n)}function Lv(e,t){return En(e,t)}var oo=null,Vl=null,Lu=!1,ro=!1,Yu=!1,za=0;function An(e){e!==Vl&&e.next===null&&(Vl===null?oo=Vl=e:Vl=Vl.next=e),ro=!0,Lu||(Lu=!0,Gv())}function Ys(e,t){if(!Yu&&ro){Yu=!0;do for(var n=!1,a=oo;a!==null;){if(e!==0){var i=a.pendingLanes;if(i===0)var u=0;else{var f=a.suspendedLanes,g=a.pingedLanes;u=(1<<31-fe(42|e)+1)-1,u&=i&~(f&~g),u=u&201326741?u&201326741|1:u?u|2:0}u!==0&&(n=!0,ih(a,u))}else u=ke,u=ge(a,a===$e?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),(u&3)===0||zt(a,u)||(n=!0,ih(a,u));a=a.next}while(n);Yu=!1}}function Yv(){ah()}function ah(){ro=Lu=!1;var e=0;za!==0&&Iv()&&(e=za);for(var t=ot(),n=null,a=oo;a!==null;){var i=a.next,u=lh(a,t);u===0?(a.next=null,n===null?oo=i:n.next=i,i===null&&(Vl=n)):(n=a,(e!==0||(u&3)!==0)&&(ro=!0)),a=i}gt!==0&>!==5||Ys(e),za!==0&&(za=0)}function lh(e,t){for(var n=e.suspendedLanes,a=e.pingedLanes,i=e.expirationTimes,u=e.pendingLanes&-62914561;0<u;){var f=31-fe(u),g=1<<f,S=i[f];S===-1?((g&n)===0||(g&a)!==0)&&(i[f]=Ln(g,t)):S<=t&&(e.expiredLanes|=g),u&=~g}if(t=$e,n=ke,n=ge(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a=e.callbackNode,n===0||e===t&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)return a!==null&&a!==null&&Vt(a),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||zt(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(a!==null&&Vt(a),cl(n)){case 2:case 8:n=qa;break;case 32:n=wn;break;case 268435456:n=ul;break;default:n=wn}return a=sh.bind(null,e),n=En(n,a),e.callbackPriority=t,e.callbackNode=n,t}return a!==null&&a!==null&&Vt(a),e.callbackPriority=2,e.callbackNode=null,2}function sh(e,t){if(gt!==0&>!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(io()&&e.callbackNode!==n)return null;var a=ke;return a=ge(e,e===$e?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),a===0?null:(Lm(e,a,t),lh(e,ot()),e.callbackNode!=null&&e.callbackNode===n?sh.bind(null,e):null)}function ih(e,t){if(io())return null;Lm(e,t,!0)}function Gv(){ex(function(){(Ke&6)!==0?En(Hn,Yv):ah()})}function Gu(){if(za===0){var e=Tl;e===0&&(e=Se,Se<<=1,(Se&261888)===0&&(Se=256)),za=e}return za}function oh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:gi(""+e)}function rh(e,t){var n=t.ownerDocument.createElement("input");return n.name=t.name,n.value=t.value,e.id&&n.setAttribute("form",e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function Kv(e,t,n,a,i){if(t==="submit"&&n&&n.stateNode===i){var u=oh((i[Dt]||null).action),f=a.submitter;f&&(t=(t=f[Dt]||null)?oh(t.formAction):f.getAttribute("formAction"),t!==null&&(u=t,f=null));var g=new bi("action","action",null,a,i);e.push({event:g,listeners:[{instance:null,listener:function(){if(a.defaultPrevented){if(za!==0){var S=f?rh(i,f):new FormData(i);ru(n,{pending:!0,data:S,method:i.method,action:u},null,S)}}else typeof u=="function"&&(g.preventDefault(),S=f?rh(i,f):new FormData(i),ru(n,{pending:!0,data:S,method:i.method,action:u},u,S))},currentTarget:i}]})}}for(var Ku=0;Ku<Er.length;Ku++){var Vu=Er[Ku],Vv=Vu.toLowerCase(),Qv=Vu[0].toUpperCase()+Vu.slice(1);yn(Vv,"on"+Qv)}yn(Hd,"onAnimationEnd"),yn(qd,"onAnimationIteration"),yn(Ld,"onAnimationStart"),yn("dblclick","onDoubleClick"),yn("focusin","onFocus"),yn("focusout","onBlur"),yn(ov,"onTransitionRun"),yn(rv,"onTransitionStart"),yn(uv,"onTransitionCancel"),yn(Yd,"onTransitionEnd"),pl("onMouseEnter",["mouseout","mouseover"]),pl("onMouseLeave",["mouseout","mouseover"]),pl("onPointerEnter",["pointerout","pointerover"]),pl("onPointerLeave",["pointerout","pointerover"]),Ya("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ya("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ya("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ya("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ya("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ya("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Gs="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Xv=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Gs));function uh(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var a=e[n],i=a.event;a=a.listeners;e:{var u=void 0;if(t)for(var f=a.length-1;0<=f;f--){var g=a[f],S=g.instance,T=g.currentTarget;if(g=g.listener,S!==u&&i.isPropagationStopped())break e;u=g,i.currentTarget=T;try{u(i)}catch(H){ji(H)}i.currentTarget=null,u=S}else for(f=0;f<a.length;f++){if(g=a[f],S=g.instance,T=g.currentTarget,g=g.listener,S!==u&&i.isPropagationStopped())break e;u=g,i.currentTarget=T;try{u(i)}catch(H){ji(H)}i.currentTarget=null,u=S}}}}function _e(e,t){var n=t[ar];n===void 0&&(n=t[ar]=new Set);var a=e+"__bubble";n.has(a)||(ch(t,e,2,!1),n.add(a))}function Qu(e,t,n){var a=0;t&&(a|=4),ch(n,e,a,t)}var uo="_reactListening"+Math.random().toString(36).slice(2);function Xu(e){if(!e[uo]){e[uo]=!0,nd.forEach(function(n){n!=="selectionchange"&&(Xv.has(n)||Qu(n,!1,e),Qu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[uo]||(t[uo]=!0,Qu("selectionchange",!1,t))}}function ch(e,t,n,a){switch(qh(t)){case 2:var i=bx;break;case 8:i=Sx;break;default:i=oc}n=i.bind(null,t,n,e),i=void 0,!fr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),a?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function Zu(e,t,n,a,i){var u=a;if((t&1)===0&&(t&2)===0&&a!==null)e:for(;;){if(a===null)return;var f=a.tag;if(f===3||f===4){var g=a.stateNode.containerInfo;if(g===i)break;if(f===4)for(f=a.return;f!==null;){var S=f.tag;if((S===3||S===4)&&f.stateNode.containerInfo===i)return;f=f.return}for(;g!==null;){if(f=fl(g),f===null)return;if(S=f.tag,S===5||S===6||S===26||S===27){a=u=f;continue e}g=g.parentNode}}a=a.return}hd(function(){var T=u,H=cr(n),K=[];e:{var A=Gd.get(e);if(A!==void 0){var R=bi,te=e;switch(e){case"keypress":if(vi(n)===0)break e;case"keydown":case"keyup":R=qy;break;case"focusin":te="focus",R=gr;break;case"focusout":te="blur",R=gr;break;case"beforeblur":case"afterblur":R=gr;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":R=yd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":R=My;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":R=Gy;break;case Hd:case qd:case Ld:R=Oy;break;case Yd:R=Vy;break;case"scroll":case"scrollend":R=Ey;break;case"wheel":R=Xy;break;case"copy":case"cut":case"paste":R=Dy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":R=xd;break;case"toggle":case"beforetoggle":R=Wy}var pe=(t&4)!==0,Je=!pe&&(e==="scroll"||e==="scrollend"),w=pe?A!==null?A+"Capture":null:A;pe=[];for(var C=T,z;C!==null;){var Y=C;if(z=Y.stateNode,Y=Y.tag,Y!==5&&Y!==26&&Y!==27||z===null||w===null||(Y=cs(C,w),Y!=null&&pe.push(Ks(C,Y,z))),Je)break;C=C.return}0<pe.length&&(A=new R(A,te,null,n,H),K.push({event:A,listeners:pe}))}}if((t&7)===0){e:{if(A=e==="mouseover"||e==="pointerover",R=e==="mouseout"||e==="pointerout",A&&n!==ur&&(te=n.relatedTarget||n.fromElement)&&(fl(te)||te[dl]))break e;if((R||A)&&(A=H.window===H?H:(A=H.ownerDocument)?A.defaultView||A.parentWindow:window,R?(te=n.relatedTarget||n.toElement,R=T,te=te?fl(te):null,te!==null&&(Je=m(te),pe=te.tag,te!==Je||pe!==5&&pe!==27&&pe!==6)&&(te=null)):(R=null,te=T),R!==te)){if(pe=yd,Y="onMouseLeave",w="onMouseEnter",C="mouse",(e==="pointerout"||e==="pointerover")&&(pe=xd,Y="onPointerLeave",w="onPointerEnter",C="pointer"),Je=R==null?A:us(R),z=te==null?A:us(te),A=new pe(Y,C+"leave",R,n,H),A.target=Je,A.relatedTarget=z,Y=null,fl(H)===T&&(pe=new pe(w,C+"enter",te,n,H),pe.target=z,pe.relatedTarget=Je,Y=pe),Je=Y,R&&te)t:{for(pe=Zv,w=R,C=te,z=0,Y=w;Y;Y=pe(Y))z++;Y=0;for(var ce=C;ce;ce=pe(ce))Y++;for(;0<z-Y;)w=pe(w),z--;for(;0<Y-z;)C=pe(C),Y--;for(;z--;){if(w===C||C!==null&&w===C.alternate){pe=w;break t}w=pe(w),C=pe(C)}pe=null}else pe=null;R!==null&&dh(K,A,R,pe,!1),te!==null&&Je!==null&&dh(K,Je,te,pe,!0)}}e:{if(A=T?us(T):window,R=A.nodeName&&A.nodeName.toLowerCase(),R==="select"||R==="input"&&A.type==="file")var He=Md;else if(Ed(A))if(zd)He=lv;else{He=nv;var se=tv}else R=A.nodeName,!R||R.toLowerCase()!=="input"||A.type!=="checkbox"&&A.type!=="radio"?T&&rr(T.elementType)&&(He=Md):He=av;if(He&&(He=He(e,T))){wd(K,He,n,H);break e}se&&se(e,A,T),e==="focusout"&&T&&A.type==="number"&&T.memoizedProps.value!=null&&or(A,"number",A.value)}switch(se=T?us(T):window,e){case"focusin":(Ed(se)||se.contentEditable==="true")&&(Sl=se,Nr=T,vs=null);break;case"focusout":vs=Nr=Sl=null;break;case"mousedown":jr=!0;break;case"contextmenu":case"mouseup":case"dragend":jr=!1,Ud(K,n,H);break;case"selectionchange":if(iv)break;case"keydown":case"keyup":Ud(K,n,H)}var Ce;if(vr)e:{switch(e){case"compositionstart":var Re="onCompositionStart";break e;case"compositionend":Re="onCompositionEnd";break e;case"compositionupdate":Re="onCompositionUpdate";break e}Re=void 0}else bl?jd(e,n)&&(Re="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(Re="onCompositionStart");Re&&(bd&&n.locale!=="ko"&&(bl||Re!=="onCompositionStart"?Re==="onCompositionEnd"&&bl&&(Ce=pd()):(fa=H,mr="value"in fa?fa.value:fa.textContent,bl=!0)),se=co(T,Re),0<se.length&&(Re=new vd(Re,e,null,n,H),K.push({event:Re,listeners:se}),Ce?Re.data=Ce:(Ce=Cd(n),Ce!==null&&(Re.data=Ce)))),(Ce=$y?Fy(e,n):Iy(e,n))&&(Re=co(T,"onBeforeInput"),0<Re.length&&(se=new vd("onBeforeInput","beforeinput",null,n,H),K.push({event:se,listeners:Re}),se.data=Ce)),Kv(K,e,T,n,H)}uh(K,t)})}function Ks(e,t,n){return{instance:e,listener:t,currentTarget:n}}function co(e,t){for(var n=t+"Capture",a=[];e!==null;){var i=e,u=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||u===null||(i=cs(e,n),i!=null&&a.unshift(Ks(e,i,u)),i=cs(e,t),i!=null&&a.push(Ks(e,i,u))),e.tag===3)return a;e=e.return}return[]}function Zv(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function dh(e,t,n,a,i){for(var u=t._reactName,f=[];n!==null&&n!==a;){var g=n,S=g.alternate,T=g.stateNode;if(g=g.tag,S!==null&&S===a)break;g!==5&&g!==26&&g!==27||T===null||(S=T,i?(T=cs(n,u),T!=null&&f.unshift(Ks(n,T,S))):i||(T=cs(n,u),T!=null&&f.push(Ks(n,T,S)))),n=n.return}f.length!==0&&e.push({event:t,listeners:f})}var Wv=/\r\n?/g,Jv=/\u0000|\uFFFD/g;function fh(e){return(typeof e=="string"?e:""+e).replace(Wv,`
|
|
10
|
+
`).replace(Jv,"")}function mh(e,t){return t=fh(t),fh(e)===t}function We(e,t,n,a,i,u){switch(n){case"children":typeof a=="string"?t==="body"||t==="textarea"&&a===""||yl(e,a):(typeof a=="number"||typeof a=="bigint")&&t!=="body"&&yl(e,""+a);break;case"className":hi(e,"class",a);break;case"tabIndex":hi(e,"tabindex",a);break;case"dir":case"role":case"viewBox":case"width":case"height":hi(e,n,a);break;case"style":fd(e,a,u);break;case"data":if(t!=="object"){hi(e,"data",a);break}case"src":case"href":if(a===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(a==null||typeof a=="function"||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=gi(""+a),e.setAttribute(n,a);break;case"action":case"formAction":if(typeof a=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof u=="function"&&(n==="formAction"?(t!=="input"&&We(e,t,"name",i.name,i,null),We(e,t,"formEncType",i.formEncType,i,null),We(e,t,"formMethod",i.formMethod,i,null),We(e,t,"formTarget",i.formTarget,i,null)):(We(e,t,"encType",i.encType,i,null),We(e,t,"method",i.method,i,null),We(e,t,"target",i.target,i,null)));if(a==null||typeof a=="symbol"||typeof a=="boolean"){e.removeAttribute(n);break}a=gi(""+a),e.setAttribute(n,a);break;case"onClick":a!=null&&(e.onclick=Kn);break;case"onScroll":a!=null&&_e("scroll",e);break;case"onScrollEnd":a!=null&&_e("scrollend",e);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(c(61));if(n=a.__html,n!=null){if(i.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"multiple":e.multiple=a&&typeof a!="function"&&typeof a!="symbol";break;case"muted":e.muted=a&&typeof a!="function"&&typeof a!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(a==null||typeof a=="function"||typeof a=="boolean"||typeof a=="symbol"){e.removeAttribute("xlink:href");break}n=gi(""+a),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""+a):e.removeAttribute(n);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":a&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":a===!0?e.setAttribute(n,""):a!==!1&&a!=null&&typeof a!="function"&&typeof a!="symbol"?e.setAttribute(n,a):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":a!=null&&typeof a!="function"&&typeof a!="symbol"&&!isNaN(a)&&1<=a?e.setAttribute(n,a):e.removeAttribute(n);break;case"rowSpan":case"start":a==null||typeof a=="function"||typeof a=="symbol"||isNaN(a)?e.removeAttribute(n):e.setAttribute(n,a);break;case"popover":_e("beforetoggle",e),_e("toggle",e),mi(e,"popover",a);break;case"xlinkActuate":Gn(e,"http://www.w3.org/1999/xlink","xlink:actuate",a);break;case"xlinkArcrole":Gn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",a);break;case"xlinkRole":Gn(e,"http://www.w3.org/1999/xlink","xlink:role",a);break;case"xlinkShow":Gn(e,"http://www.w3.org/1999/xlink","xlink:show",a);break;case"xlinkTitle":Gn(e,"http://www.w3.org/1999/xlink","xlink:title",a);break;case"xlinkType":Gn(e,"http://www.w3.org/1999/xlink","xlink:type",a);break;case"xmlBase":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:base",a);break;case"xmlLang":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",a);break;case"xmlSpace":Gn(e,"http://www.w3.org/XML/1998/namespace","xml:space",a);break;case"is":mi(e,"is",a);break;case"innerText":case"textContent":break;default:(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")&&(n=jy.get(n)||n,mi(e,n,a))}}function Wu(e,t,n,a,i,u){switch(n){case"style":fd(e,a,u);break;case"dangerouslySetInnerHTML":if(a!=null){if(typeof a!="object"||!("__html"in a))throw Error(c(61));if(n=a.__html,n!=null){if(i.children!=null)throw Error(c(60));e.innerHTML=n}}break;case"children":typeof a=="string"?yl(e,a):(typeof a=="number"||typeof a=="bigint")&&yl(e,""+a);break;case"onScroll":a!=null&&_e("scroll",e);break;case"onScrollEnd":a!=null&&_e("scrollend",e);break;case"onClick":a!=null&&(e.onclick=Kn);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ad.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),t=n.slice(2,i?n.length-7:void 0),u=e[Dt]||null,u=u!=null?u[n]:null,typeof u=="function"&&e.removeEventListener(t,u,i),typeof a=="function")){typeof u!="function"&&u!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,a,i);break e}n in e?e[n]=a:a===!0?e.setAttribute(n,""):mi(e,n,a)}}}function wt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":_e("error",e),_e("load",e);var a=!1,i=!1,u;for(u in n)if(n.hasOwnProperty(u)){var f=n[u];if(f!=null)switch(u){case"src":a=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:We(e,t,u,f,n,null)}}i&&We(e,t,"srcSet",n.srcSet,n,null),a&&We(e,t,"src",n.src,n,null);return;case"input":_e("invalid",e);var g=u=f=i=null,S=null,T=null;for(a in n)if(n.hasOwnProperty(a)){var H=n[a];if(H!=null)switch(a){case"name":i=H;break;case"type":f=H;break;case"checked":S=H;break;case"defaultChecked":T=H;break;case"value":u=H;break;case"defaultValue":g=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(c(137,t));break;default:We(e,t,a,H,n,null)}}rd(e,u,g,S,T,f,i,!1);return;case"select":_e("invalid",e),a=f=u=null;for(i in n)if(n.hasOwnProperty(i)&&(g=n[i],g!=null))switch(i){case"value":u=g;break;case"defaultValue":f=g;break;case"multiple":a=g;default:We(e,t,i,g,n,null)}t=u,n=f,e.multiple=!!a,t!=null?gl(e,!!a,t,!1):n!=null&&gl(e,!!a,n,!0);return;case"textarea":_e("invalid",e),u=i=a=null;for(f in n)if(n.hasOwnProperty(f)&&(g=n[f],g!=null))switch(f){case"value":a=g;break;case"defaultValue":i=g;break;case"children":u=g;break;case"dangerouslySetInnerHTML":if(g!=null)throw Error(c(91));break;default:We(e,t,f,g,n,null)}cd(e,a,i,u);return;case"option":for(S in n)if(n.hasOwnProperty(S)&&(a=n[S],a!=null))switch(S){case"selected":e.selected=a&&typeof a!="function"&&typeof a!="symbol";break;default:We(e,t,S,a,n,null)}return;case"dialog":_e("beforetoggle",e),_e("toggle",e),_e("cancel",e),_e("close",e);break;case"iframe":case"object":_e("load",e);break;case"video":case"audio":for(a=0;a<Gs.length;a++)_e(Gs[a],e);break;case"image":_e("error",e),_e("load",e);break;case"details":_e("toggle",e);break;case"embed":case"source":case"link":_e("error",e),_e("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(T in n)if(n.hasOwnProperty(T)&&(a=n[T],a!=null))switch(T){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:We(e,t,T,a,n,null)}return;default:if(rr(t)){for(H in n)n.hasOwnProperty(H)&&(a=n[H],a!==void 0&&Wu(e,t,H,a,n,void 0));return}}for(g in n)n.hasOwnProperty(g)&&(a=n[g],a!=null&&We(e,t,g,a,n,null))}function $v(e,t,n,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,u=null,f=null,g=null,S=null,T=null,H=null;for(R in n){var K=n[R];if(n.hasOwnProperty(R)&&K!=null)switch(R){case"checked":break;case"value":break;case"defaultValue":S=K;default:a.hasOwnProperty(R)||We(e,t,R,null,a,K)}}for(var A in a){var R=a[A];if(K=n[A],a.hasOwnProperty(A)&&(R!=null||K!=null))switch(A){case"type":u=R;break;case"name":i=R;break;case"checked":T=R;break;case"defaultChecked":H=R;break;case"value":f=R;break;case"defaultValue":g=R;break;case"children":case"dangerouslySetInnerHTML":if(R!=null)throw Error(c(137,t));break;default:R!==K&&We(e,t,A,R,a,K)}}ir(e,f,g,S,T,H,u,i);return;case"select":R=f=g=A=null;for(u in n)if(S=n[u],n.hasOwnProperty(u)&&S!=null)switch(u){case"value":break;case"multiple":R=S;default:a.hasOwnProperty(u)||We(e,t,u,null,a,S)}for(i in a)if(u=a[i],S=n[i],a.hasOwnProperty(i)&&(u!=null||S!=null))switch(i){case"value":A=u;break;case"defaultValue":g=u;break;case"multiple":f=u;default:u!==S&&We(e,t,i,u,a,S)}t=g,n=f,a=R,A!=null?gl(e,!!n,A,!1):!!a!=!!n&&(t!=null?gl(e,!!n,t,!0):gl(e,!!n,n?[]:"",!1));return;case"textarea":R=A=null;for(g in n)if(i=n[g],n.hasOwnProperty(g)&&i!=null&&!a.hasOwnProperty(g))switch(g){case"value":break;case"children":break;default:We(e,t,g,null,a,i)}for(f in a)if(i=a[f],u=n[f],a.hasOwnProperty(f)&&(i!=null||u!=null))switch(f){case"value":A=i;break;case"defaultValue":R=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(c(91));break;default:i!==u&&We(e,t,f,i,a,u)}ud(e,A,R);return;case"option":for(var te in n)if(A=n[te],n.hasOwnProperty(te)&&A!=null&&!a.hasOwnProperty(te))switch(te){case"selected":e.selected=!1;break;default:We(e,t,te,null,a,A)}for(S in a)if(A=a[S],R=n[S],a.hasOwnProperty(S)&&A!==R&&(A!=null||R!=null))switch(S){case"selected":e.selected=A&&typeof A!="function"&&typeof A!="symbol";break;default:We(e,t,S,A,a,R)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var pe in n)A=n[pe],n.hasOwnProperty(pe)&&A!=null&&!a.hasOwnProperty(pe)&&We(e,t,pe,null,a,A);for(T in a)if(A=a[T],R=n[T],a.hasOwnProperty(T)&&A!==R&&(A!=null||R!=null))switch(T){case"children":case"dangerouslySetInnerHTML":if(A!=null)throw Error(c(137,t));break;default:We(e,t,T,A,a,R)}return;default:if(rr(t)){for(var Je in n)A=n[Je],n.hasOwnProperty(Je)&&A!==void 0&&!a.hasOwnProperty(Je)&&Wu(e,t,Je,void 0,a,A);for(H in a)A=a[H],R=n[H],!a.hasOwnProperty(H)||A===R||A===void 0&&R===void 0||Wu(e,t,H,A,a,R);return}}for(var w in n)A=n[w],n.hasOwnProperty(w)&&A!=null&&!a.hasOwnProperty(w)&&We(e,t,w,null,a,A);for(K in a)A=a[K],R=n[K],!a.hasOwnProperty(K)||A===R||A==null&&R==null||We(e,t,K,A,a,R)}function hh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Fv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),a=0;a<n.length;a++){var i=n[a],u=i.transferSize,f=i.initiatorType,g=i.duration;if(u&&g&&hh(f)){for(f=0,g=i.responseEnd,a+=1;a<n.length;a++){var S=n[a],T=S.startTime;if(T>g)break;var H=S.transferSize,K=S.initiatorType;H&&hh(K)&&(S=S.responseEnd,f+=H*(S<g?1:(g-T)/(S-T)))}if(--a,t+=8*(u+f)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Ju=null,$u=null;function fo(e){return e.nodeType===9?e:e.ownerDocument}function ph(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function gh(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Fu(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var Iu=null;function Iv(){var e=window.event;return e&&e.type==="popstate"?e===Iu?!1:(Iu=e,!0):(Iu=null,!1)}var yh=typeof setTimeout=="function"?setTimeout:void 0,Pv=typeof clearTimeout=="function"?clearTimeout:void 0,vh=typeof Promise=="function"?Promise:void 0,ex=typeof queueMicrotask=="function"?queueMicrotask:typeof vh<"u"?function(e){return vh.resolve(null).then(e).catch(tx)}:yh;function tx(e){setTimeout(function(){throw e})}function Ta(e){return e==="head"}function xh(e,t){var n=t,a=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(a===0){e.removeChild(i),Wl(t);return}a--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")a++;else if(n==="html")Vs(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,Vs(n);for(var u=n.firstChild;u;){var f=u.nextSibling,g=u.nodeName;u[rs]||g==="SCRIPT"||g==="STYLE"||g==="LINK"&&u.rel.toLowerCase()==="stylesheet"||n.removeChild(u),u=f}}else n==="body"&&Vs(e.ownerDocument.body);n=i}while(n);Wl(t)}function bh(e,t){var n=e;e=0;do{var a=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),a&&a.nodeType===8)if(n=a.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=a}while(n)}function Pu(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":Pu(n),lr(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function nx(e,t,n,a){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!a&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(a){if(!e[rs])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(u=e.getAttribute("rel"),u==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(u!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(u=e.getAttribute("src"),(u!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&u&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var u=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===u)return e}else return e;if(e=hn(e.nextSibling),e===null)break}return null}function ax(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=hn(e.nextSibling),e===null))return null;return e}function Sh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=hn(e.nextSibling),e===null))return null;return e}function ec(e){return e.data==="$?"||e.data==="$~"}function tc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function lx(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var a=function(){t(),n.removeEventListener("DOMContentLoaded",a)};n.addEventListener("DOMContentLoaded",a),e._reactRetry=a}}function hn(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var nc=null;function Nh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return hn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function jh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function Ch(e,t,n){switch(t=fo(n),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function Vs(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);lr(e)}var pn=new Map,Eh=new Set;function mo(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var sa=J.d;J.d={f:sx,r:ix,D:ox,C:rx,L:ux,m:cx,X:fx,S:dx,M:mx};function sx(){var e=sa.f(),t=ao();return e||t}function ix(e){var t=ml(e);t!==null&&t.tag===5&&t.type==="form"?Gf(t):sa.r(e)}var Ql=typeof document>"u"?null:document;function wh(e,t,n){var a=Ql;if(a&&typeof t=="string"&&t){var i=on(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),Eh.has(i)||(Eh.add(i),e={rel:e,crossOrigin:n,href:t},a.querySelector(i)===null&&(t=a.createElement("link"),wt(t,"link",e),vt(t),a.head.appendChild(t)))}}function ox(e){sa.D(e),wh("dns-prefetch",e,null)}function rx(e,t){sa.C(e,t),wh("preconnect",e,t)}function ux(e,t,n){sa.L(e,t,n);var a=Ql;if(a&&e&&t){var i='link[rel="preload"][as="'+on(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+on(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+on(n.imageSizes)+'"]')):i+='[href="'+on(e)+'"]';var u=i;switch(t){case"style":u=Xl(e);break;case"script":u=Zl(e)}pn.has(u)||(e=x({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),pn.set(u,e),a.querySelector(i)!==null||t==="style"&&a.querySelector(Qs(u))||t==="script"&&a.querySelector(Xs(u))||(t=a.createElement("link"),wt(t,"link",e),vt(t),a.head.appendChild(t)))}}function cx(e,t){sa.m(e,t);var n=Ql;if(n&&e){var a=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+on(a)+'"][href="'+on(e)+'"]',u=i;switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":u=Zl(e)}if(!pn.has(u)&&(e=x({rel:"modulepreload",href:e},t),pn.set(u,e),n.querySelector(i)===null)){switch(a){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Xs(u)))return}a=n.createElement("link"),wt(a,"link",e),vt(a),n.head.appendChild(a)}}}function dx(e,t,n){sa.S(e,t,n);var a=Ql;if(a&&e){var i=hl(a).hoistableStyles,u=Xl(e);t=t||"default";var f=i.get(u);if(!f){var g={loading:0,preload:null};if(f=a.querySelector(Qs(u)))g.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":t},n),(n=pn.get(u))&&ac(e,n);var S=f=a.createElement("link");vt(S),wt(S,"link",e),S._p=new Promise(function(T,H){S.onload=T,S.onerror=H}),S.addEventListener("load",function(){g.loading|=1}),S.addEventListener("error",function(){g.loading|=2}),g.loading|=4,ho(f,t,a)}f={type:"stylesheet",instance:f,count:1,state:g},i.set(u,f)}}}function fx(e,t){sa.X(e,t);var n=Ql;if(n&&e){var a=hl(n).hoistableScripts,i=Zl(e),u=a.get(i);u||(u=n.querySelector(Xs(i)),u||(e=x({src:e,async:!0},t),(t=pn.get(i))&&lc(e,t),u=n.createElement("script"),vt(u),wt(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(i,u))}}function mx(e,t){sa.M(e,t);var n=Ql;if(n&&e){var a=hl(n).hoistableScripts,i=Zl(e),u=a.get(i);u||(u=n.querySelector(Xs(i)),u||(e=x({src:e,async:!0,type:"module"},t),(t=pn.get(i))&&lc(e,t),u=n.createElement("script"),vt(u),wt(u,"link",e),n.head.appendChild(u)),u={type:"script",instance:u,count:1,state:null},a.set(i,u))}}function Mh(e,t,n,a){var i=(i=I.current)?mo(i):null;if(!i)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(t=Xl(n.href),n=hl(i).hoistableStyles,a=n.get(t),a||(a={type:"style",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Xl(n.href);var u=hl(i).hoistableStyles,f=u.get(e);if(f||(i=i.ownerDocument||i,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},u.set(e,f),(u=i.querySelector(Qs(e)))&&!u._p&&(f.instance=u,f.state.loading=5),pn.has(e)||(n={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},pn.set(e,n),u||hx(i,e,n,f.state))),t&&a===null)throw Error(c(528,""));return f}if(t&&a!==null)throw Error(c(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Zl(n),n=hl(i).hoistableScripts,a=n.get(t),a||(a={type:"script",instance:null,count:0,state:null},n.set(t,a)),a):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function Xl(e){return'href="'+on(e)+'"'}function Qs(e){return'link[rel="stylesheet"]['+e+"]"}function zh(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function hx(e,t,n,a){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?a.loading=1:(t=e.createElement("link"),a.preload=t,t.addEventListener("load",function(){return a.loading|=1}),t.addEventListener("error",function(){return a.loading|=2}),wt(t,"link",n),vt(t),e.head.appendChild(t))}function Zl(e){return'[src="'+on(e)+'"]'}function Xs(e){return"script[async]"+e}function Th(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var a=e.querySelector('style[data-href~="'+on(n.href)+'"]');if(a)return t.instance=a,vt(a),a;var i=x({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return a=(e.ownerDocument||e).createElement("style"),vt(a),wt(a,"style",i),ho(a,n.precedence,e),t.instance=a;case"stylesheet":i=Xl(n.href);var u=e.querySelector(Qs(i));if(u)return t.state.loading|=4,t.instance=u,vt(u),u;a=zh(n),(i=pn.get(i))&&ac(a,i),u=(e.ownerDocument||e).createElement("link"),vt(u);var f=u;return f._p=new Promise(function(g,S){f.onload=g,f.onerror=S}),wt(u,"link",a),t.state.loading|=4,ho(u,n.precedence,e),t.instance=u;case"script":return u=Zl(n.src),(i=e.querySelector(Xs(u)))?(t.instance=i,vt(i),i):(a=n,(i=pn.get(u))&&(a=x({},n),lc(a,i)),e=e.ownerDocument||e,i=e.createElement("script"),vt(i),wt(i,"link",a),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(a=t.instance,t.state.loading|=4,ho(a,n.precedence,e));return t.instance}function ho(e,t,n){for(var a=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=a.length?a[a.length-1]:null,u=i,f=0;f<a.length;f++){var g=a[f];if(g.dataset.precedence===t)u=g;else if(u!==i)break}u?u.parentNode.insertBefore(e,u.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function ac(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function lc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var po=null;function Oh(e,t,n){if(po===null){var a=new Map,i=po=new Map;i.set(n,a)}else i=po,a=i.get(n),a||(a=new Map,i.set(n,a));if(a.has(e))return a;for(a.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var u=n[i];if(!(u[rs]||u[Nt]||e==="link"&&u.getAttribute("rel")==="stylesheet")&&u.namespaceURI!=="http://www.w3.org/2000/svg"){var f=u.getAttribute(t)||"";f=e+f;var g=a.get(f);g?g.push(u):a.set(f,[u])}}return a}function Ah(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function px(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!0}case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function Dh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function gx(e,t,n,a){if(n.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var i=Xl(a.href),u=t.querySelector(Qs(i));if(u){t=u._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=go.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=u,vt(u);return}u=t.ownerDocument||t,a=zh(a),(i=pn.get(i))&&ac(a,i),u=u.createElement("link"),vt(u);var f=u;f._p=new Promise(function(g,S){f.onload=g,f.onerror=S}),wt(u,"link",a),n.instance=u}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=go.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var sc=0;function yx(e,t){return e.stylesheets&&e.count===0&&vo(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var a=setTimeout(function(){if(e.stylesheets&&vo(e,e.stylesheets),e.unsuspend){var u=e.unsuspend;e.unsuspend=null,u()}},6e4+t);0<e.imgBytes&&sc===0&&(sc=62500*Fv());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&vo(e,e.stylesheets),e.unsuspend)){var u=e.unsuspend;e.unsuspend=null,u()}},(e.imgBytes>sc?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(a),clearTimeout(i)}}:null}function go(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)vo(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var yo=null;function vo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,yo=new Map,t.forEach(vx,e),yo=null,go.call(e))}function vx(e,t){if(!(t.state.loading&4)){var n=yo.get(e);if(n)var a=n.get(null);else{n=new Map,yo.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),u=0;u<i.length;u++){var f=i[u];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(n.set(f.dataset.precedence,f),a=f)}a&&n.set(null,a)}i=t.instance,f=i.getAttribute("data-precedence"),u=n.get(f)||a,u===a&&n.set(null,i),n.set(f,i),this.count++,a=go.bind(this),i.addEventListener("load",a),i.addEventListener("error",a),u?u.parentNode.insertBefore(i,u.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Zs={$$typeof:G,Provider:null,Consumer:null,_currentValue:le,_currentValue2:le,_threadCount:0};function xx(e,t,n,a,i,u,f,g,S){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Xt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xt(0),this.hiddenUpdates=Xt(null),this.identifierPrefix=a,this.onUncaughtError=i,this.onCaughtError=u,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=S,this.incompleteTransitions=new Map}function _h(e,t,n,a,i,u,f,g,S,T,H,K){return e=new xx(e,t,n,f,S,T,H,K,g),t=1,u===!0&&(t|=24),u=Wt(3,null,null,t),e.current=u,u.stateNode=e,t=Hr(),t.refCount++,e.pooledCache=t,t.refCount++,u.memoizedState={element:a,isDehydrated:n,cache:t},Gr(u),e}function kh(e){return e?(e=Cl,e):Cl}function Rh(e,t,n,a,i,u){i=kh(i),a.context===null?a.context=i:a.pendingContext=i,a=va(t),a.payload={element:n},u=u===void 0?null:u,u!==null&&(a.callback=u),n=xa(e,a,t),n!==null&&(Ht(n,e,t),Es(n,e,t))}function Uh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ic(e,t){Uh(e,t),(e=e.alternate)&&Uh(e,t)}function Bh(e){if(e.tag===13||e.tag===31){var t=Qa(e,67108864);t!==null&&Ht(t,e,67108864),ic(e,67108864)}}function Hh(e){if(e.tag===13||e.tag===31){var t=Pt();t=Yn(t);var n=Qa(e,t);n!==null&&Ht(n,e,t),ic(e,t)}}var xo=!0;function bx(e,t,n,a){var i=D.T;D.T=null;var u=J.p;try{J.p=2,oc(e,t,n,a)}finally{J.p=u,D.T=i}}function Sx(e,t,n,a){var i=D.T;D.T=null;var u=J.p;try{J.p=8,oc(e,t,n,a)}finally{J.p=u,D.T=i}}function oc(e,t,n,a){if(xo){var i=rc(a);if(i===null)Zu(e,t,a,bo,n),Lh(e,a);else if(jx(i,e,t,n,a))a.stopPropagation();else if(Lh(e,a),t&4&&-1<Nx.indexOf(e)){for(;i!==null;){var u=ml(i);if(u!==null)switch(u.tag){case 3:if(u=u.stateNode,u.current.memoizedState.isDehydrated){var f=Fe(u.pendingLanes);if(f!==0){var g=u;for(g.pendingLanes|=2,g.entangledLanes|=2;f;){var S=1<<31-fe(f);g.entanglements[1]|=S,f&=~S}An(u),(Ke&6)===0&&(to=ot()+500,Ys(0))}}break;case 31:case 13:g=Qa(u,2),g!==null&&Ht(g,u,2),ao(),ic(u,2)}if(u=rc(a),u===null&&Zu(e,t,a,bo,n),u===i)break;i=u}i!==null&&a.stopPropagation()}else Zu(e,t,a,null,n)}}function rc(e){return e=cr(e),uc(e)}var bo=null;function uc(e){if(bo=null,e=fl(e),e!==null){var t=m(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=h(t),e!==null)return e;e=null}else if(n===31){if(e=p(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return bo=e,null}function qh(e){switch(e){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Qt()){case Hn:return 2;case qa:return 8;case wn:case Mn:return 32;case ul:return 268435456;default:return 32}default:return 32}}var cc=!1,Oa=null,Aa=null,Da=null,Ws=new Map,Js=new Map,_a=[],Nx="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Lh(e,t){switch(e){case"focusin":case"focusout":Oa=null;break;case"dragenter":case"dragleave":Aa=null;break;case"mouseover":case"mouseout":Da=null;break;case"pointerover":case"pointerout":Ws.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Js.delete(t.pointerId)}}function $s(e,t,n,a,i,u){return e===null||e.nativeEvent!==u?(e={blockedOn:t,domEventName:n,eventSystemFlags:a,nativeEvent:u,targetContainers:[i]},t!==null&&(t=ml(t),t!==null&&Bh(t)),e):(e.eventSystemFlags|=a,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function jx(e,t,n,a,i){switch(t){case"focusin":return Oa=$s(Oa,e,t,n,a,i),!0;case"dragenter":return Aa=$s(Aa,e,t,n,a,i),!0;case"mouseover":return Da=$s(Da,e,t,n,a,i),!0;case"pointerover":var u=i.pointerId;return Ws.set(u,$s(Ws.get(u)||null,e,t,n,a,i)),!0;case"gotpointercapture":return u=i.pointerId,Js.set(u,$s(Js.get(u)||null,e,t,n,a,i)),!0}return!1}function Yh(e){var t=fl(e.target);if(t!==null){var n=m(t);if(n!==null){if(t=n.tag,t===13){if(t=h(n),t!==null){e.blockedOn=t,os(e.priority,function(){Hh(n)});return}}else if(t===31){if(t=p(n),t!==null){e.blockedOn=t,os(e.priority,function(){Hh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function So(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=rc(e.nativeEvent);if(n===null){n=e.nativeEvent;var a=new n.constructor(n.type,n);ur=a,n.target.dispatchEvent(a),ur=null}else return t=ml(n),t!==null&&Bh(t),e.blockedOn=n,!1;t.shift()}return!0}function Gh(e,t,n){So(e)&&n.delete(t)}function Cx(){cc=!1,Oa!==null&&So(Oa)&&(Oa=null),Aa!==null&&So(Aa)&&(Aa=null),Da!==null&&So(Da)&&(Da=null),Ws.forEach(Gh),Js.forEach(Gh)}function No(e,t){e.blockedOn===t&&(e.blockedOn=null,cc||(cc=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,Cx)))}var jo=null;function Kh(e){jo!==e&&(jo=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){jo===e&&(jo=null);for(var t=0;t<e.length;t+=3){var n=e[t],a=e[t+1],i=e[t+2];if(typeof a!="function"){if(uc(a||n)===null)continue;break}var u=ml(n);u!==null&&(e.splice(t,3),t-=3,ru(u,{pending:!0,data:i,method:n.method,action:a},a,i))}}))}function Wl(e){function t(S){return No(S,e)}Oa!==null&&No(Oa,e),Aa!==null&&No(Aa,e),Da!==null&&No(Da,e),Ws.forEach(t),Js.forEach(t);for(var n=0;n<_a.length;n++){var a=_a[n];a.blockedOn===e&&(a.blockedOn=null)}for(;0<_a.length&&(n=_a[0],n.blockedOn===null);)Yh(n),n.blockedOn===null&&_a.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(a=0;a<n.length;a+=3){var i=n[a],u=n[a+1],f=i[Dt]||null;if(typeof u=="function")f||Kh(n);else if(f){var g=null;if(u&&u.hasAttribute("formAction")){if(i=u,f=u[Dt]||null)g=f.formAction;else if(uc(i)!==null)continue}else g=f.action;typeof g=="function"?n[a+1]=g:(n.splice(a,3),a-=3),Kh(n)}}}function Vh(){function e(u){u.canIntercept&&u.info==="react-transition"&&u.intercept({handler:function(){return new Promise(function(f){return i=f})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),a||setTimeout(n,20)}function n(){if(!a&&!navigation.transition){var u=navigation.currentEntry;u&&u.url!=null&&navigation.navigate(u.url,{state:u.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var a=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){a=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function dc(e){this._internalRoot=e}Co.prototype.render=dc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var n=t.current,a=Pt();Rh(n,a,e,t,null,null)},Co.prototype.unmount=dc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Rh(e.current,2,null,e,null,null),ao(),t[dl]=null}};function Co(e){this._internalRoot=e}Co.prototype.unstable_scheduleHydration=function(e){if(e){var t=is();e={blockedOn:null,target:e,priority:t};for(var n=0;n<_a.length&&t!==0&&t<_a[n].priority;n++);_a.splice(n,0,e),n===0&&Yh(e)}};var Qh=s.version;if(Qh!=="19.2.1")throw Error(c(527,Qh,"19.2.1"));J.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=N(t),e=e!==null?E(e):null,e=e===null?null:e.stateNode,e};var Ex={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:D,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Eo=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Eo.isDisabled&&Eo.supportsFiber)try{qn=Eo.inject(Ex),Z=Eo}catch{}}return Is.createRoot=function(e,t){if(!d(e))throw Error(c(299));var n=!1,a="",i=If,u=Pf,f=em;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(a=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(u=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=_h(e,1,!1,null,null,n,a,null,i,u,f,Vh),e[dl]=t.current,Xu(e),new dc(t)},Is.hydrateRoot=function(e,t,n){if(!d(e))throw Error(c(299));var a=!1,i="",u=If,f=Pf,g=em,S=null;return n!=null&&(n.unstable_strictMode===!0&&(a=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(u=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(g=n.onRecoverableError),n.formState!==void 0&&(S=n.formState)),t=_h(e,1,!0,t,n??null,a,i,S,u,f,g,Vh),t.context=kh(null),n=t.current,a=Pt(),a=Yn(a),i=va(a),i.callback=null,xa(n,i,a),n=a,t.current.lanes=n,gn(t,n),An(t),e[dl]=t.current,Xu(e),new Co(t)},Is.version="19.2.1",Is}var lp;function wb(){if(lp)return fc.exports;lp=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(s){console.error(s)}}return l(),fc.exports=Eb(),fc.exports}var Mb=wb();const zb="modulepreload",Tb=function(l){return"/"+l},sp={},Yt=function(s,r,c){let d=Promise.resolve();if(r&&r.length>0){let y=function(N){return Promise.all(N.map(E=>Promise.resolve(E).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const h=document.querySelector("meta[property=csp-nonce]"),p=h?.nonce||h?.getAttribute("nonce");d=y(r.map(N=>{if(N=Tb(N),N in sp)return;sp[N]=!0;const E=N.endsWith(".css"),x=E?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${N}"]${x}`))return;const b=document.createElement("link");if(b.rel=E?"stylesheet":zb,E||(b.as="script"),b.crossOrigin="",b.href=N,p&&b.setAttribute("nonce",p),document.head.appendChild(b),E)return new Promise((_,O)=>{b.addEventListener("load",_),b.addEventListener("error",()=>O(new Error(`Unable to preload CSS for ${N}`)))})}))}function m(h){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=h,window.dispatchEvent(p),!p.defaultPrevented)throw h}return d.then(h=>{for(const p of h||[])p.status==="rejected"&&m(p.reason);return s().catch(m)})},Ob=new r0({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1,retry:1},mutations:{retry:!1}}}),Ab={theme:"system",setTheme:()=>null,isDark:!1},ug=v.createContext(Ab);function Db({children:l,defaultTheme:s="system",storageKey:r="vite-ui-theme"}){const[c,d]=v.useState(()=>localStorage.getItem(r)||s),[m,h]=v.useState(()=>typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches:!1);v.useEffect(()=>{const N=window.matchMedia("(prefers-color-scheme: dark)"),E=x=>{h(x.matches)};return N.addEventListener("change",E),()=>N.removeEventListener("change",E)},[]);const p=c==="dark"||c==="system"&&m;v.useEffect(()=>{const N=window.document.documentElement;N.classList.remove("light","dark"),N.classList.add(p?"dark":"light")},[p]);const y={theme:c,setTheme:N=>{localStorage.setItem(r,N),d(N)},isDark:p};return o.jsx(ug.Provider,{value:y,children:l})}const cg=v.createContext(null),ip="ccs-privacy-mode";function _b({children:l}){const[s,r]=v.useState(()=>typeof window<"u"?localStorage.getItem(ip)==="true":!1);v.useEffect(()=>{localStorage.setItem(ip,String(s))},[s]);const c=v.useCallback(()=>r(m=>!m),[]),d=v.useMemo(()=>({privacyMode:s,togglePrivacyMode:c}),[s,c]);return o.jsx(cg.Provider,{value:d,children:l})}function Rc(){const l=v.useContext(cg);if(!l)throw new Error("usePrivacy must be used within a PrivacyProvider");return l}const dg="blur-[4px] select-none hover:blur-none transition-all duration-200",pc=768;function kb(){const[l,s]=v.useState(void 0);return v.useEffect(()=>{const r=window.matchMedia(`(max-width: ${pc-1}px)`),c=()=>{s(window.innerWidth<pc)};return r.addEventListener("change",c),s(window.innerWidth<pc),()=>r.removeEventListener("change",c)},[]),!!l}const fg=v.createContext(null);function Xo(){const l=v.useContext(fg);if(!l)throw new Error("useSidebar must be used within a SidebarProvider.");return l}function Q(...l){return d0(f0(l))}const op=["#f94144","#f3722c","#f8961e","#f9844a","#f9c74f","#90be6d","#43aa8b","#4d908e","#577590","#277da1"],Lt={success:"#15803d",degraded:"#b45309",failed:"#b91c1c"};function mC(l){let s=2166136261;for(let r=0;r<l.length;r++)s^=l.charCodeAt(r),s=Math.imul(s,16777619);return op[(s>>>0)%op.length]}const Oo=Ho("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:ring-1 focus-visible:ring-ring aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9","icon-sm":"size-8","icon-lg":"size-10"}},defaultVariants:{variant:"default",size:"default"}});function bt({className:l,variant:s,size:r,asChild:c=!1,...d}){const m=c?Bo:"button";return o.jsx(m,{"data-slot":"button",className:Q(Oo({variant:s,size:r,className:l})),...d})}function Ra({className:l,type:s,...r}){return o.jsx("input",{type:s,"data-slot":"input",className:Q("file:text-foreground placeholder:text-muted-foreground selection:bg-primary selection:text-primary-foreground dark:bg-input/30 border-input h-9 w-full min-w-0 rounded-md border bg-transparent px-3 py-1 text-base shadow-xs transition-[color,box-shadow] outline-none file:inline-flex file:h-7 file:border-0 file:bg-transparent file:text-sm file:font-medium disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50 md:text-sm","focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring","aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",l),...r})}function Rb({...l}){return o.jsx(kp,{"data-slot":"sheet",...l})}function Ub({...l}){return o.jsx(qp,{"data-slot":"sheet-portal",...l})}function Bb({className:l,...s}){return o.jsx(Lp,{"data-slot":"sheet-overlay",className:Q("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",l),...s})}function Hb({className:l,children:s,side:r="right",...c}){return o.jsxs(Ub,{children:[o.jsx(Bb,{}),o.jsxs(Rp,{"data-slot":"sheet-content",className:Q("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",r==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",r==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",r==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",r==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",l),...c,children:[s,o.jsxs(Up,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[o.jsx(ui,{className:"size-4"}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function qb({className:l,...s}){return o.jsx("div",{"data-slot":"sheet-header",className:Q("flex flex-col gap-1.5 p-4",l),...s})}function Lb({className:l,...s}){return o.jsx(Bp,{"data-slot":"sheet-title",className:Q("text-foreground font-semibold",l),...s})}function Yb({className:l,...s}){return o.jsx(Hp,{"data-slot":"sheet-description",className:Q("text-muted-foreground text-sm",l),...s})}function Le({className:l,...s}){return o.jsx("div",{"data-slot":"skeleton",className:Q("relative overflow-hidden bg-muted/50 before:absolute before:inset-0 before:-translate-x-full","before:bg-gradient-to-r before:from-transparent before:via-muted/30 before:to-transparent","before:animate-[shimmer_2s_infinite_ease-out] rounded-md",l),...s})}function Uc({delayDuration:l=0,...s}){return o.jsx(Mx,{"data-slot":"tooltip-provider",delayDuration:l,...s})}function Zo({...l}){return o.jsx(Uc,{children:o.jsx(zx,{"data-slot":"tooltip",...l})})}function Wo({...l}){return o.jsx(Tx,{"data-slot":"tooltip-trigger",...l})}function Jo({className:l,sideOffset:s=0,children:r,...c}){return o.jsx(Ox,{children:o.jsxs(Ax,{"data-slot":"tooltip-content",sideOffset:s,className:Q("bg-foreground text-background animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-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 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",l),...c,children:[r,o.jsx(Dx,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const Gb="sidebar_state",Kb=3600*24*7,Vb="16rem",Qb="18rem",Xb="3rem",Zb="b";function Wb({defaultOpen:l=!0,open:s,onOpenChange:r,className:c,style:d,children:m,...h}){const p=kb(),[y,N]=v.useState(!1),[E,x]=v.useState(l),b=s??E,_=v.useCallback(M=>{const V=typeof M=="function"?M(b):M;r?r(V):x(V),document.cookie=`${Gb}=${V}; path=/; max-age=${Kb}`},[r,b]),O=v.useCallback(()=>p?N(M=>!M):_(M=>!M),[p,_,N]);v.useEffect(()=>{const M=V=>{V.key===Zb&&(V.metaKey||V.ctrlKey)&&(V.preventDefault(),O())};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[O]);const k=b?"expanded":"collapsed",U=v.useMemo(()=>({state:k,open:b,setOpen:_,isMobile:p,openMobile:y,setOpenMobile:N,toggleSidebar:O}),[k,b,_,p,y,N,O]);return o.jsx(fg.Provider,{value:U,children:o.jsx(Uc,{delayDuration:0,children:o.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Vb,"--sidebar-width-icon":Xb,...d},className:Q("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",c),...h,children:m})})})}function Jb({side:l="left",variant:s="sidebar",collapsible:r="offcanvas",className:c,children:d,...m}){const{isMobile:h,state:p,openMobile:y,setOpenMobile:N}=Xo();return r==="none"?o.jsx("div",{"data-slot":"sidebar",className:Q("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",c),...m,children:d}):h?o.jsx(Rb,{open:y,onOpenChange:N,...m,children:o.jsxs(Hb,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":Qb},side:l,children:[o.jsxs(qb,{className:"sr-only",children:[o.jsx(Lb,{children:"Sidebar"}),o.jsx(Yb,{children:"Displays the mobile sidebar."})]}),o.jsx("div",{className:"flex h-full w-full flex-col",children:d})]})}):o.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":p,"data-collapsible":p==="collapsed"?r:"","data-variant":s,"data-side":l,"data-slot":"sidebar",children:[o.jsx("div",{"data-slot":"sidebar-gap",className:Q("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",s==="floating"||s==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),o.jsx("div",{"data-slot":"sidebar-container",className:Q("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",l==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",s==="floating"||s==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",c),...m,children:o.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:d})})]})}function $b({className:l,onClick:s,...r}){const{toggleSidebar:c}=Xo();return o.jsxs(bt,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:Q("size-7",l),onClick:d=>{s?.(d),c()},...r,children:[o.jsx(V0,{}),o.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Fb({className:l,...s}){return o.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:Q("flex flex-col gap-2 p-2",l),...s})}function Ib({className:l,...s}){return o.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:Q("flex flex-col gap-2 p-2",l),...s})}function Pb({className:l,...s}){return o.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:Q("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",l),...s})}function eS({className:l,...s}){return o.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:Q("relative flex w-full min-w-0 flex-col p-2",l),...s})}function tS({className:l,asChild:s=!1,...r}){const c=s?Bo:"div";return o.jsx(c,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:Q("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",l),...r})}function nS({className:l,...s}){return o.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:Q("w-full text-sm",l),...s})}function aS({className:l,...s}){return o.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:Q("flex w-full min-w-0 flex-col gap-1 group-data-[collapsible=icon]:items-center",l),...s})}function rp({className:l,...s}){return o.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:Q("group/menu-item relative",l),...s})}const lS=Ho("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0 group-data-[collapsible=icon]:justify-center",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function up({asChild:l=!1,isActive:s=!1,variant:r="default",size:c="default",tooltip:d,className:m,...h}){const p=l?Bo:"button",{isMobile:y,state:N}=Xo(),E=o.jsx(p,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":c,"data-active":s,className:Q(lS({variant:r,size:c}),m),...h});return d?(typeof d=="string"&&(d={children:d}),o.jsxs(Zo,{children:[o.jsx(Wo,{asChild:!0,children:E}),o.jsx(Jo,{side:"right",align:"center",hidden:N!=="collapsed"||y,...d})]})):E}function sS({className:l,...s}){return o.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:Q("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",l),...s})}function iS({className:l,...s}){return o.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:Q("group/menu-sub-item relative",l),...s})}function oS({asChild:l=!1,size:s="md",isActive:r=!1,className:c,...d}){const m=l?Bo:"a";return o.jsx(m,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":s,"data-active":r,className:Q("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",s==="sm"&&"text-xs",s==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",c),...d})}const rS={sm:24,md:32,lg:48};function mg({size:l="md",className:s,showText:r=!0}){const c=rS[l];return o.jsxs("div",{className:Q("flex items-center gap-2",s),children:[o.jsx("img",{src:"/logo/ccs-logo-256.png",alt:"CCS Logo",width:c,height:c,className:"rounded"}),r&&o.jsx("span",{className:"font-bold text-lg",children:"CCS Config"})]})}const uS=_x,cS=kx,dS=Rx,fS=[{title:"General",items:[{path:"/",icon:Q0,label:"Home"},{path:"/analytics",icon:X0,label:"Analytics"}]},{title:"Identity & Access",items:[{path:"/providers",icon:tg,label:"API Profiles",badge:{text:"OpenRouter",icon:"/icons/openrouter.svg"}},{path:"/cliproxy",icon:ng,label:"CLIProxy Plus",isCollapsible:!0,children:[{path:"/cliproxy",label:"Overview"},{path:"/cliproxy/control-panel",icon:Z0,label:"Control Panel"}]},{path:"/copilot",icon:ag,label:"GitHub Copilot"},{path:"/accounts",icon:sg,label:"Accounts",isCollapsible:!0,children:[{path:"/accounts",label:"All Accounts"},{path:"/shared",icon:lg,label:"Shared Data"}]}]},{title:"System",items:[{path:"/health",icon:si,label:"Health"},{path:"/settings",icon:W0,label:"Settings"}]}];function mS(){const l=e0(),{state:s}=Xo(),r=d=>l.pathname===d,c=d=>d.some(m=>r(m.path)||l.pathname.startsWith(m.path+"/"));return o.jsxs(Jb,{collapsible:"icon",children:[o.jsx(Fb,{className:"h-12 flex items-center justify-center",children:o.jsx(mg,{size:"sm",showText:s==="expanded"})}),o.jsx(Pb,{children:fS.map((d,m)=>o.jsxs(eS,{children:[d.title&&o.jsx(tS,{children:d.title}),o.jsx(nS,{children:o.jsx(aS,{children:d.items.map(h=>o.jsx(rp,{children:h.isCollapsible&&h.children?o.jsx(uS,{defaultOpen:c(h.children)||r(h.path),className:"group/collapsible",children:o.jsxs(rp,{children:[o.jsx(cS,{asChild:!0,children:o.jsxs(up,{tooltip:h.label,children:[h.icon&&o.jsx(h.icon,{className:"w-4 h-4"}),o.jsx("span",{className:"group-data-[collapsible=icon]:hidden",children:h.label}),o.jsx(qo,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90 group-data-[collapsible=icon]:hidden"})]})}),o.jsx(dS,{children:o.jsx(sS,{children:h.children.map(p=>o.jsx(iS,{children:o.jsx(oS,{asChild:!0,isActive:r(p.path),children:o.jsx(wc,{to:p.path,children:o.jsx("span",{children:p.label})})})},p.path))})})]})}):o.jsx(up,{asChild:!0,isActive:r(h.path),tooltip:h.label,children:o.jsxs(wc,{to:h.path,children:[h.icon&&o.jsx(h.icon,{className:"w-4 h-4"}),o.jsx("span",{className:"group-data-[collapsible=icon]:hidden flex-1",children:h.label}),h.badge&&o.jsxs(Zo,{children:[o.jsx(Wo,{asChild:!0,children:o.jsxs("span",{className:`group-data-[collapsible=icon]:hidden ml-auto flex items-center gap-1 px-1.5 py-0.5 text-[10px] font-medium rounded transition-colors ${r(h.path)?"bg-sidebar-accent-foreground/20 text-sidebar-accent-foreground border border-sidebar-accent-foreground/30":"bg-accent/15 text-accent border border-accent/30 group-hover/menu-item:bg-sidebar-accent-foreground/20 group-hover/menu-item:text-sidebar-accent-foreground group-hover/menu-item:border-sidebar-accent-foreground/30"}`,children:[o.jsx("img",{src:h.badge.icon,alt:"",className:"w-3 h-3"}),o.jsx("span",{className:"hidden sm:inline",children:h.badge.text})]})}),o.jsx(Jo,{side:"right",children:o.jsx("p",{children:"349+ models via OpenRouter"})})]})]})})},h.path))})})]},d.title||m))}),o.jsx(Ib,{className:"p-4 border-t flex items-center justify-center",children:o.jsx($b,{})})]})}const hg=()=>{const l=v.useContext(ug);if(l===void 0)throw new Error("useTheme must be used within a ThemeProvider");return l};function hS(){const{theme:l,setTheme:s}=hg();return o.jsxs(bt,{variant:"ghost",size:"icon",onClick:()=>s(l==="dark"?"light":"dark"),children:[o.jsx(J0,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),o.jsx($0,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),o.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}function pS(){const{privacyMode:l,togglePrivacyMode:s}=Rc();return o.jsxs(Zo,{children:[o.jsx(Wo,{asChild:!0,children:o.jsx(bt,{variant:"ghost",size:"icon",onClick:s,className:Q("h-8 w-8 transition-colors",l&&"text-amber-600 hover:text-amber-700 dark:text-amber-400"),children:l?o.jsx(Lo,{className:"h-4 w-4"}):o.jsx(Yo,{className:"h-4 w-4"})})}),o.jsx(Jo,{children:o.jsx("p",{children:l?"Privacy mode ON - Click to show data":"Privacy mode OFF - Click to hide data"})})]})}const gS="https://github.com/kaitranntt/ccs/issues";function yS(){return o.jsx(bt,{variant:"ghost",size:"icon",asChild:!0,title:"Report an issue on GitHub",children:o.jsx("a",{href:gS,target:"_blank",rel:"noopener noreferrer",children:o.jsx(ag,{className:"w-4 h-4"})})})}const vS="https://docs.ccs.kaitran.ca";function xS(){return o.jsx(bt,{variant:"ghost",size:"icon",asChild:!0,title:"View documentation",children:o.jsx("a",{href:vS,target:"_blank",rel:"noopener noreferrer",children:o.jsx(F0,{className:"w-4 h-4"})})})}function bS(){const[l,s]=v.useState("disconnected"),r=v.useRef(null),c=an(),d=v.useRef(0),m=5,h=v.useRef(null),p=v.useRef(()=>{}),y=v.useCallback(x=>{switch(x.type){case"connected":console.log("[WS] Server acknowledged connection");break;case"config-changed":c.invalidateQueries({queryKey:["profiles"]}),c.invalidateQueries({queryKey:["cliproxy"]}),Ae.info("Configuration updated externally");break;case"settings-changed":c.invalidateQueries({queryKey:["profiles"]}),Ae.info("Settings file updated");break;case"profiles-changed":c.invalidateQueries({queryKey:["accounts"]}),Ae.info("Accounts updated");break;case"proxy-status-changed":c.invalidateQueries({queryKey:["proxy-status"]});break;case"pong":break;default:console.log(`[WS] Unknown message: ${x.type}`)}},[c]),N=v.useCallback(()=>{if(r.current?.readyState===WebSocket.OPEN)return;s("connecting");const x=new WebSocket(`ws://${window.location.host}`);r.current=x,x.onopen=()=>{s("connected"),d.current=0,console.log("[WS] Connected")},x.onmessage=b=>{try{const _=JSON.parse(b.data);y(_),window.dispatchEvent(new CustomEvent("ws-message",{detail:_}))}catch{console.log("[WS] Invalid message")}},x.onclose=()=>{if(s("disconnected"),r.current=null,d.current<m){const b=Math.min(1e3*Math.pow(2,d.current),3e4);d.current++,console.log(`[WS] Reconnecting in ${b}ms (attempt ${d.current})`),h.current=setTimeout(()=>{p.current()},b)}},x.onerror=()=>{console.log("[WS] Connection error")}},[y]);p.current=N;const E=v.useCallback(()=>{d.current=m,h.current&&(clearTimeout(h.current),h.current=null),r.current?.close()},[]);return v.useEffect(()=>(p.current(),()=>E()),[]),v.useEffect(()=>{const x=setInterval(()=>{r.current?.readyState===WebSocket.OPEN&&r.current.send(JSON.stringify({type:"ping"}))},3e4);return()=>clearInterval(x)},[]),v.useMemo(()=>({status:l,connect:N,disconnect:E}),[l,N,E])}function SS(){const{status:l}=bS(),r={connected:{icon:Xh,color:"text-green-600",label:"Connected"},connecting:{icon:Xh,color:"text-yellow-500",label:"Connecting..."},disconnected:{icon:I0,color:"text-red-500",label:"Disconnected"}}[l],c=r.icon;return o.jsxs("div",{className:`flex items-center gap-1 text-sm ${r.color}`,children:[o.jsx(c,{className:"w-4 h-4"}),o.jsx("span",{className:"hidden sm:inline",children:r.label})]})}function NS(){const[l,s]=v.useState(!1);return l?null:o.jsx("div",{className:"w-full bg-yellow-50 dark:bg-yellow-900/20 border-t border-yellow-200 dark:border-yellow-800 px-4 py-2 transition-colors duration-200",children:o.jsxs("div",{className:"flex items-center justify-center gap-4",children:[o.jsxs("div",{className:"flex items-center gap-2 text-sm text-yellow-800 dark:text-yellow-200",children:[o.jsx(P0,{className:"w-4 h-4 flex-shrink-0"}),o.jsx("span",{className:"hidden sm:inline",children:"This dashboard runs locally. All data stays on your machine."}),o.jsx("span",{className:"sm:hidden",children:"Local dashboard - data stays on your device."})]}),o.jsx("button",{onClick:()=>s(!0),className:"text-yellow-600 hover:text-yellow-800 dark:text-yellow-400 flex-shrink-0 p-1 rounded hover:bg-yellow-100 dark:hover:bg-yellow-800/30 transition-colors","aria-label":"Dismiss disclaimer",children:o.jsx(ui,{className:"w-4 h-4"})})]})})}const jS="https://claudekit.cc?ref=HMNKXOHN";function CS(){return o.jsxs("a",{href:jS,target:"_blank",rel:"noopener noreferrer",className:Q("group inline-flex items-center gap-2 px-3 py-1.5 rounded-lg","bg-accent/10 border-2 border-accent/40","hover:bg-accent hover:border-accent","transition-all duration-200 shadow-sm hover:shadow-md"),title:"Powered by ClaudeKit Framework",children:[o.jsx("img",{src:"/logos/claudekit-logo.png",alt:"ClaudeKit",className:"w-5 h-5"}),o.jsxs("span",{className:"flex items-baseline gap-1.5 whitespace-nowrap",children:[o.jsx("span",{className:Q("text-[10px] font-medium uppercase tracking-wide","text-muted-foreground group-hover:text-accent-foreground/80","transition-colors"),children:"Powered by"}),o.jsx("span",{className:Q("text-xs font-bold text-foreground","group-hover:text-accent-foreground","transition-colors"),children:"ClaudeKit"})]})]})}const ES="https://github.com/sponsors/kaitranntt";function wS(){return o.jsxs("a",{href:ES,target:"_blank",rel:"noopener noreferrer",className:Q("group inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg","bg-pink-500/10 border-2 border-pink-500/40","hover:bg-pink-400 hover:border-pink-400","transition-all duration-200 shadow-sm hover:shadow-md"),title:"Sponsor this project on GitHub",children:[o.jsx(eb,{className:Q("w-4 h-4 text-pink-500","group-hover:text-white group-hover:fill-white","group-hover:animate-pulse","transition-colors")}),o.jsx("span",{className:Q("text-xs font-bold text-pink-600 dark:text-pink-300","group-hover:text-white dark:group-hover:text-white","transition-colors"),children:"Sponsor"})]})}function Bc({...l}){return o.jsx(kp,{"data-slot":"dialog",...l})}function MS({...l}){return o.jsx(qp,{"data-slot":"dialog-portal",...l})}function zS({className:l,...s}){return o.jsx(Lp,{"data-slot":"dialog-overlay",className:Q("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",l),...s})}function Hc({className:l,children:s,showCloseButton:r=!0,...c}){return o.jsxs(MS,{"data-slot":"dialog-portal",children:[o.jsx(zS,{}),o.jsxs(Rp,{"data-slot":"dialog-content",className:Q("bg-background 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 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",l),...c,children:[s,r&&o.jsxs(Up,{"data-slot":"dialog-close",className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[o.jsx(ui,{}),o.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function qc({className:l,...s}){return o.jsx("div",{"data-slot":"dialog-header",className:Q("flex flex-col gap-2 text-center sm:text-left",l),...s})}function TS({className:l,...s}){return o.jsx("div",{"data-slot":"dialog-footer",className:Q("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",l),...s})}function Lc({className:l,...s}){return o.jsx(Bp,{"data-slot":"dialog-title",className:Q("text-lg leading-none font-semibold",l),...s})}function Yc({className:l,...s}){return o.jsx(Hp,{"data-slot":"dialog-description",className:Q("text-muted-foreground text-sm",l),...s})}function OS({open:l,onClose:s,sessionId:r,provider:c,projects:d,defaultProjectId:m,supportsAll:h,onSelect:p,timeoutSeconds:y=30}){const[N,E]=v.useState(m),[x,b]=v.useState(!1),[_,O]=v.useState(y);v.useEffect(()=>{if(!l){O(y);return}const M=setInterval(()=>{O(V=>V<=1?(clearInterval(M),k(!0),0):V-1)},1e3);return()=>clearInterval(M)},[l,y]),v.useEffect(()=>{l&&(E(m),b(!1),O(y))},[l,m,y]);const k=async(M=!1)=>{if(!x){b(!0);try{await p(M?"":N),s()}catch(V){console.error("Failed to submit project selection:",V);try{await p("")}catch{}s()}}},U=c.charAt(0).toUpperCase()+c.slice(1);return o.jsx(Bc,{open:l,onOpenChange:M=>!M&&!x&&s(),children:o.jsxs(Hc,{className:"sm:max-w-lg",children:[o.jsxs(qc,{children:[o.jsxs(Lc,{className:"flex items-center gap-2",children:[o.jsx(lg,{className:"w-5 h-5"}),"Select Google Cloud Project"]}),o.jsxs(Yc,{children:["Choose which project to use for ",U," authentication.",_>0&&o.jsxs("span",{className:"text-muted-foreground ml-1",children:["(Auto-selecting default in ",_,"s)"]})]})]}),o.jsxs("div",{className:"space-y-4 py-4",children:[o.jsxs("div",{className:"space-y-2",children:[d.map(M=>o.jsxs("div",{className:`flex items-center space-x-3 p-3 rounded-lg border cursor-pointer transition-colors ${N===M.id?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>!x&&E(M.id),children:[N===M.id?o.jsx(Zh,{className:"w-5 h-5 text-primary"}):o.jsx(Wh,{className:"w-5 h-5 text-muted-foreground"}),o.jsxs("div",{className:"flex-1",children:[o.jsx("div",{className:"font-medium",children:M.name}),o.jsx("div",{className:"text-sm text-muted-foreground font-mono",children:M.id})]}),M.id===m&&o.jsx("span",{className:"text-xs px-2 py-1 bg-secondary rounded",children:"Default"})]},M.id)),h&&o.jsxs("div",{className:`flex items-center space-x-3 p-3 rounded-lg border cursor-pointer transition-colors ${N==="ALL"?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>!x&&E("ALL"),children:[N==="ALL"?o.jsx(Zh,{className:"w-5 h-5 text-primary"}):o.jsx(Wh,{className:"w-5 h-5 text-muted-foreground"}),o.jsxs("div",{className:"flex-1",children:[o.jsx("div",{className:"font-medium",children:"All Projects"}),o.jsxs("div",{className:"text-sm text-muted-foreground",children:["Onboard all ",d.length," listed projects"]})]})]})]}),o.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[o.jsx(bt,{variant:"ghost",onClick:()=>k(!0),disabled:x,children:"Use Default"}),o.jsx(bt,{onClick:()=>k(!1),disabled:x,children:x?o.jsxs(o.Fragment,{children:[o.jsx(ci,{className:"w-4 h-4 mr-2 animate-spin"}),"Selecting..."]}):o.jsxs(o.Fragment,{children:[o.jsx(es,{className:"w-4 h-4 mr-2"}),"Confirm Selection"]})})]})]})]})})}const AS={ghcp:"GitHub Copilot",qwen:"Qwen Code"},DS={ghcp:"Sign in with your GitHub account that has Copilot access.",qwen:"Sign in with your Qwen account to authorize access."};function _S({open:l,onClose:s,sessionId:r,provider:c,userCode:d,verificationUrl:m,expiresAt:h}){const[p,y]=v.useState(!1),[N,E]=v.useState(null);v.useEffect(()=>{if(!l)return;let M=null;const V=()=>{const G=Math.max(0,Math.floor((h-Date.now())/1e3));E(G),G===0&&M&&(clearInterval(M),M=null)};return V(),M=setInterval(V,1e3),()=>{M&&clearInterval(M)}},[l,h]);const x=v.useCallback(async()=>{try{await navigator.clipboard.writeText(d),y(!0),Ae.success("Code copied to clipboard"),setTimeout(()=>y(!1),2e3)}catch{Ae.error("Failed to copy code")}},[d]),b=v.useCallback(()=>{window.open(m,"_blank","noopener,noreferrer")},[m]),_=AS[c]||c,O=DS[c]||"Complete the authorization in your browser.",k=M=>{const V=Math.floor(M/60),G=M%60;return`${V}:${G.toString().padStart(2,"0")}`},U=N===0;return o.jsx(Bc,{open:l,onOpenChange:M=>!M&&s(),children:o.jsxs(Hc,{className:"sm:max-w-md","data-session-id":r,children:[o.jsxs(qc,{children:[o.jsxs(Lc,{className:"flex items-center gap-2",children:[o.jsx(tb,{className:"w-5 h-5"}),"Authorize ",_]}),o.jsxs(Yc,{children:["Enter the code below at the authorization page.",N!==null&&N>0&&o.jsxs("span",{className:"text-muted-foreground ml-1",children:["(Expires in ",k(N),")"]}),U&&o.jsx("span",{className:"text-destructive ml-1 font-medium",children:"(Code expired)"})]})]}),o.jsxs("div",{className:"space-y-6 py-4",children:[o.jsxs("div",{className:"relative",children:[o.jsx("div",{className:"bg-muted rounded-lg p-6 text-center",children:o.jsx("div",{className:"text-4xl font-mono font-bold tracking-[0.3em] text-foreground select-all",children:d})}),o.jsx(bt,{variant:"outline",size:"icon",className:"absolute top-2 right-2",onClick:x,"aria-label":p?"Code copied":"Copy verification code",children:p?o.jsx(es,{className:"h-4 w-4 text-green-500"}):o.jsx(_o,{className:"h-4 w-4"})})]}),o.jsx("div",{className:"text-sm text-muted-foreground text-center",children:o.jsx("p",{children:O})}),o.jsxs("div",{className:"flex flex-col gap-3",children:[o.jsxs(bt,{onClick:b,className:"w-full",children:[o.jsx(ig,{className:"w-4 h-4 mr-2"}),"Open ",_.split(" ")[0]]}),o.jsx(bt,{variant:"outline",onClick:x,className:"w-full",children:p?o.jsxs(o.Fragment,{children:[o.jsx(es,{className:"w-4 h-4 mr-2 text-green-500"}),"Copied!"]}):o.jsxs(o.Fragment,{children:[o.jsx(_o,{className:"w-4 h-4 mr-2"}),"Copy Code"]})})]}),o.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[o.jsx(ci,{className:"h-4 w-4 animate-spin"}),o.jsx("span",{children:"Waiting for authorization..."})]})]})]})})}function kS(){const[l,s]=v.useState({isOpen:!1,prompt:null});v.useEffect(()=>{const d=m=>{const h=m.detail;h.type==="projectSelectionRequired"?(console.log("[ProjectSelection] Received prompt:",h.sessionId),s({isOpen:!0,prompt:{sessionId:h.sessionId,provider:h.provider,projects:h.projects,defaultProjectId:h.defaultProjectId,supportsAll:h.supportsAll}})):h.type==="projectSelectionTimeout"?(console.log("[ProjectSelection] Timeout:",h.sessionId),s(p=>p.prompt?.sessionId===h.sessionId?{isOpen:!1,prompt:null}:p)):h.type==="projectSelectionSubmitted"&&(console.log("[ProjectSelection] Submitted:",h.sessionId),s(p=>p.prompt?.sessionId===h.sessionId?{isOpen:!1,prompt:null}:p))};return window.addEventListener("ws-message",d),()=>{window.removeEventListener("ws-message",d)}},[]);const r=v.useCallback(async d=>{if(!l.prompt)return;if(!(await fetch(`/api/cliproxy/auth/project-selection/${l.prompt.sessionId}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({selectedId:d})})).ok)throw new Error("Failed to submit project selection")},[l.prompt]),c=v.useCallback(()=>{s({isOpen:!1,prompt:null})},[]);return v.useMemo(()=>({isOpen:l.isOpen,prompt:l.prompt,onSelect:r,onClose:c}),[l.isOpen,l.prompt,r,c])}const gc={ghcp:"GitHub Copilot",qwen:"Qwen Code"};function RS(){const[l,s]=v.useState({isOpen:!1,prompt:null,error:null});v.useEffect(()=>{const m=h=>{const p=h.detail;if(p.type==="deviceCodeReceived"){console.log("[DeviceCode] Received prompt:",p.sessionId);const y=gc[p.provider]||p.provider;Ae.info(`${y} authorization required`),s({isOpen:!0,prompt:{sessionId:p.sessionId,provider:p.provider,userCode:p.userCode,verificationUrl:p.verificationUrl,expiresAt:p.expiresAt},error:null})}else p.type==="deviceCodeCompleted"?(console.log("[DeviceCode] Auth completed:",p.sessionId),s(y=>{if(y.prompt&&y.prompt.sessionId===p.sessionId){const N=gc[y.prompt.provider]||y.prompt.provider;return Ae.success(`${N} authentication successful!`),{isOpen:!1,prompt:null,error:null}}return y})):p.type==="deviceCodeFailed"?(console.log("[DeviceCode] Auth failed:",p.sessionId,p.error),s(y=>{if(y.prompt&&y.prompt.sessionId===p.sessionId){const N=gc[y.prompt.provider]||y.prompt.provider;return Ae.error(`${N} authentication failed`),{isOpen:!1,prompt:null,error:p.error}}return y})):p.type==="deviceCodeExpired"&&(console.log("[DeviceCode] Code expired:",p.sessionId),s(y=>y.prompt?.sessionId===p.sessionId?(Ae.error("Device code expired. Please try again."),{isOpen:!1,prompt:null,error:"Device code expired"}):y))};return window.addEventListener("ws-message",m),()=>{window.removeEventListener("ws-message",m)}},[]);const r=v.useCallback(()=>{s({isOpen:!1,prompt:null,error:null})},[]),c=v.useCallback(()=>{l.prompt?.verificationUrl&&window.open(l.prompt.verificationUrl,"_blank","noopener,noreferrer")},[l.prompt]),d=v.useCallback(async()=>{if(l.prompt?.userCode)try{await navigator.clipboard.writeText(l.prompt.userCode),Ae.success("Code copied to clipboard")}catch{Ae.error("Failed to copy code")}},[l.prompt]);return v.useMemo(()=>({isOpen:l.isOpen,prompt:l.prompt,error:l.error,onClose:r,onOpenUrl:c,onCopyCode:d}),[l.isOpen,l.prompt,l.error,r,c,d])}function US(){return o.jsxs("div",{className:"p-6 space-y-4",children:[o.jsx(Le,{className:"h-8 w-48"}),o.jsx(Le,{className:"h-64 w-full"})]})}function BS(){const{isOpen:l,prompt:s,onSelect:r,onClose:c}=kS(),d=RS();return o.jsxs(Wb,{children:[o.jsx(mS,{}),o.jsxs("main",{className:"flex-1 flex flex-col min-h-0 overflow-hidden bg-background",children:[o.jsxs("header",{className:"flex h-14 items-center justify-between px-6 border-b shrink-0 bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(CS,{}),o.jsx(wS,{})]}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(SS,{}),o.jsx(xS,{}),o.jsx(yS,{}),o.jsx(pS,{}),o.jsx(hS,{})]})]}),o.jsx("div",{className:"flex-1 overflow-auto min-h-0",children:o.jsx(v.Suspense,{fallback:o.jsx(US,{}),children:o.jsx(t0,{})})}),o.jsx(NS,{})]}),s&&o.jsx(OS,{open:l,onClose:c,sessionId:s.sessionId,provider:s.provider,projects:s.projects,defaultProjectId:s.defaultProjectId,supportsAll:s.supportsAll,onSelect:r}),d.prompt&&o.jsx(_S,{open:d.isOpen,onClose:d.onClose,sessionId:d.prompt.sessionId,provider:d.prompt.provider,userCode:d.prompt.userCode,verificationUrl:d.prompt.verificationUrl,expiresAt:d.prompt.expiresAt})]})}const HS=Ho("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:l,variant:s,...r}){return o.jsx("div",{className:Q(HS({variant:s}),l),...r})}function qS({version:l="5.0.0"}){return o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(mg,{size:"lg",showText:!1}),o.jsxs("div",{children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx("h1",{className:"text-2xl font-bold",children:"CCS Config"}),o.jsxs(Ha,{variant:"outline",className:"font-mono text-xs",children:["v",l]})]}),o.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Claude Code Switch Dashboard"})]})]})}const LS={gemini:"/assets/providers/gemini-color.svg",agy:"/assets/providers/agy.png",codex:"/assets/providers/openai.svg",qwen:"/assets/providers/qwen-color.svg",kiro:"/assets/providers/kiro.png",ghcp:"/assets/providers/copilot.svg"},ko={gemini:"#4285F4",agy:"#f3722c",codex:"#10a37f",vertex:"#4285F4",iflow:"#f94144",qwen:"#6236FF",kiro:"#4d908e",ghcp:"#43aa8b"},YS={gemini:"Gemini",agy:"Antigravity",codex:"Codex",vertex:"Vertex AI",iflow:"iFlow",qwen:"Qwen",kiro:"Kiro (AWS)",ghcp:"GitHub Copilot (OAuth)"};function GS(l){return YS[l.toLowerCase()]||l}const KS=100,cp=["#3b3c36","#568203","#8d4557","#da9100","#3c6c82","#c96907"];function VS(l){return cp[l%cp.length]}function pg(l){return l.replace(/@(gmail|yahoo|hotmail|outlook|icloud)\.com$/i,"")}function QS(l){const r=new Date().getTime()-l.getTime(),c=Math.floor(r/6e4);if(c<1)return"now";if(c<60)return`${c}m`;const d=Math.floor(c/60);return d<24?`${d}h`:`${Math.floor(d/24)}d`}function XS(l){const s=[];return l.forEach(r=>{const c=r.lastUsedAt?new Date(r.lastUsedAt):new Date,d=(m,h)=>{for(let p=0;p<m;p++){const y=Math.floor(Math.random()*24*60*60*1e3*(p/(m||1))),N=new Date(c.getTime()-y),E=Math.floor((Math.random()-.5)*10*60*1e3);N.setTime(N.getTime()+E);const x=new Date;N>x&&N.setTime(x.getTime()),s.push({id:`${r.id}-${h}-${p}`,timestamp:N,accountEmail:r.email,status:h,latencyMs:h==="success"?50+Math.floor(Math.random()*150):200+Math.floor(Math.random()*4800)})}};d(r.successCount,"success"),d(r.failureCount,"failed")}),s.sort((r,c)=>c.timestamp.getTime()-r.timestamp.getTime())}function ZS({containerRef:l,svgRef:s,accounts:r}){if(!l.current||!s.current)return[];const c=l.current,m=s.current.getBoundingClientRect(),h=c.querySelector("[data-provider-node]");if(!h)return[];const p=h.getBoundingClientRect(),y=[];return r.forEach((N,E)=>{const x=c.querySelector(`[data-account-index="${E}"]`);if(!x)return;const b=x.getBoundingClientRect(),_=x.getAttribute("data-zone")||"left";let O,k,U,M;switch(_){case"right":O=b.left-m.left,k=b.top+b.height/2-m.top,U=p.right-m.left,M=p.top+p.height/2-m.top;break;case"top":O=b.left+b.width/2-m.left,k=b.bottom-m.top,U=p.left+p.width/2-m.left,M=p.top-m.top;break;case"bottom":O=b.left+b.width/2-m.left,k=b.top-m.top,U=p.left+p.width/2-m.left,M=p.bottom-m.top;break;default:O=b.right-m.left,k=b.top+b.height/2-m.top,U=p.left-m.left,M=p.top+p.height/2-m.top}let V,G,q,B;_==="top"||_==="bottom"?(V=O,G=k+(M-k)*.5,q=U,B=M-(M-k)*.5):(V=O+(U-O)*.5,G=k,q=U-(U-O)*.5,B=M),y.push(`M ${O} ${k} C ${V} ${G}, ${q} ${B}, ${U} ${M}`)}),y}function WS(l){const s=l.length;if(s<=2)return{leftAccounts:l,rightAccounts:[],topAccounts:[],bottomAccounts:[]};if(s<=4){const c=Math.ceil(s/2);return{leftAccounts:l.slice(0,c),rightAccounts:l.slice(c),topAccounts:[],bottomAccounts:[]}}if(s<=8){const c=Math.ceil(s/3);return{leftAccounts:l.slice(0,c),rightAccounts:l.slice(c,c*2),topAccounts:l.slice(c*2),bottomAccounts:[]}}const r=Math.ceil(s/4);return{leftAccounts:l.slice(0,r),rightAccounts:l.slice(r,r*2),topAccounts:l.slice(r*2,r*3),bottomAccounts:l.slice(r*3)}}function JS(l){return l>=9?"w-64":l>=5?"w-60":l>=3?"w-56":"w-52"}function $S({storageKey:l,onDrag:s}){const[r,c]=v.useState(null),d=v.useRef(null),m=v.useRef(!1),h=v.useCallback(()=>{try{const O=localStorage.getItem(l);if(O)return JSON.parse(O)}catch{}return{}},[l]),[p,y]=v.useState(()=>h());v.useEffect(()=>{Object.keys(p).length>0&&localStorage.setItem(l,JSON.stringify(p))},[p,l]);const N=v.useCallback(()=>{y({}),localStorage.removeItem(l)},[l]),E=v.useCallback((O,k)=>{k.preventDefault(),k.stopPropagation(),k.target.setPointerCapture(k.pointerId);const U=p[O]||{x:0,y:0};d.current={x:k.clientX,y:k.clientY,offsetX:U.x,offsetY:U.y},m.current=!1,c(O)},[p]),x=v.useCallback(O=>{if(!r||!d.current)return;const k=d.current,U=O.clientX-k.x,M=O.clientY-k.y;(Math.abs(U)>3||Math.abs(M)>3)&&(m.current=!0),y(V=>({...V,[r]:{x:k.offsetX+U,y:k.offsetY+M}})),s&&requestAnimationFrame(s)},[r,s]),b=v.useCallback(()=>{c(null),d.current=null},[]);return{dragOffsets:p,draggingId:r,didDragRef:m,handlePointerDown:E,handlePointerMove:x,handlePointerUp:b,getOffset:O=>p[O]||{x:0,y:0},resetPositions:N,hasCustomPositions:Object.keys(p).length>0}}function FS(l){let s=0,r=0;return Object.values(l).forEach(c=>{s=Math.min(s,c.y),r=Math.max(r,c.y)}),{paddingTop:Math.max(0,-s),paddingBottom:Math.max(0,r),extraHeight:Math.max(0,Math.abs(s),Math.abs(r))*2}}function IS(l){const[s,r]=v.useState(new Set),c=v.useRef({});return v.useEffect(()=>{const d=new Set,m={};if(l.forEach(h=>{const p=h.successCount+h.failureCount;m[h.id]=p;const y=c.current[h.id];y!==void 0&&p>y&&d.add(h.id)}),c.current=m,d.size>0){r(d);const h=setTimeout(()=>r(new Set),2e3);return()=>clearTimeout(h)}},[l]),s}function PS({events:l,privacyMode:s}){return l.length===0?o.jsx("div",{className:"h-full flex items-center justify-center rounded-xl bg-muted/20 dark:bg-zinc-900/40 border border-border/30 dark:border-white/[0.05]",children:o.jsx("div",{className:"text-xs text-muted-foreground font-mono",children:"No recent connections"})}):o.jsxs("div",{className:"h-full flex flex-col",children:[o.jsxs("div",{className:"flex items-center gap-2 mb-3 px-2",children:[o.jsx(si,{className:"w-3.5 h-3.5 text-muted-foreground"}),o.jsx("span",{className:"text-[10px] text-muted-foreground font-medium uppercase tracking-wider",children:"Connection Timeline"})]}),o.jsx("div",{className:Q("flex-1 rounded-xl p-4 overflow-y-auto","bg-muted/20 dark:bg-zinc-900/40 backdrop-blur-sm","border border-border/30 dark:border-white/[0.05]"),children:o.jsxs("div",{className:"relative",children:[o.jsx("div",{className:"absolute left-[7px] top-2 bottom-2 w-px bg-border/50 dark:bg-white/[0.08]"}),o.jsx("div",{className:"space-y-3",children:l.map(r=>{const c=r.status==="success"?Lt.success:r.status==="failed"?Lt.failed:Lt.degraded;return o.jsxs("div",{className:"relative flex items-start gap-3 pl-1",children:[o.jsx("div",{className:Q("relative z-10 w-3.5 h-3.5 rounded-full flex-shrink-0 mt-0.5","ring-2 ring-background dark:ring-zinc-950"),style:{backgroundColor:c}}),o.jsxs("div",{className:"flex-1 min-w-0",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsx("span",{className:Q("text-[10px] font-mono text-foreground truncate",s&&dg),children:pg(r.accountEmail)}),o.jsx("span",{className:"text-[9px] text-muted-foreground font-mono flex-shrink-0",children:QS(r.timestamp)})]}),o.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[o.jsx("span",{className:"text-[9px] font-medium uppercase",style:{color:c},children:r.status}),r.latencyMs&&o.jsxs("span",{className:"text-[9px] text-muted-foreground font-mono",children:[r.latencyMs,"ms"]})]})]})]},r.id)})})]})})]})}function e1({success:l,failure:s,showDetails:r}){const c=l+s,d=c>0?l/c*100:100;return o.jsxs("div",{className:"mt-2 space-y-2",children:[o.jsxs("div",{className:"flex items-end justify-between px-0.5",children:[o.jsxs("div",{className:"flex flex-col",children:[o.jsx("span",{className:"text-[8px] text-muted-foreground/70 uppercase font-bold tracking-tight",children:"Success Rate"}),o.jsxs("span",{className:Q("text-sm font-mono font-bold leading-none mt-0.5",d===100?"text-emerald-600 dark:text-emerald-400":d>=90?"text-amber-500":"text-red-500"),children:[Math.round(d),"%"]})]}),o.jsxs("div",{className:"flex flex-col items-end",children:[o.jsx("span",{className:"text-[8px] text-muted-foreground/70 uppercase font-bold tracking-tight",children:"Volume"}),o.jsx("span",{className:"text-xs font-mono font-medium text-foreground/80 leading-none mt-0.5",children:c.toLocaleString()})]})]}),o.jsxs("div",{className:Q("grid grid-cols-2 gap-2 overflow-hidden transition-all duration-300 ease-in-out",r?"max-h-20 opacity-100 mt-2":"max-h-0 opacity-0 mt-0"),children:[o.jsxs("div",{className:"flex items-center gap-1.5 px-1.5 py-1 rounded-md bg-emerald-500/5 dark:bg-emerald-500/10 border border-emerald-500/10",children:[o.jsx(Go,{className:"w-2.5 h-2.5 text-emerald-600 dark:text-emerald-400"}),o.jsx("span",{className:"text-[10px] font-mono font-bold text-emerald-600 dark:text-emerald-400",children:l})]}),o.jsxs("div",{className:Q("flex items-center gap-1.5 px-1.5 py-1 rounded-md border",s>0?"bg-red-500/5 dark:bg-red-500/10 border-red-500/20":"bg-muted/10 border-transparent opacity-40"),children:[o.jsx(Ac,{className:Q("w-2.5 h-2.5",s>0?"text-red-500":"text-muted-foreground")}),o.jsx("span",{className:Q("text-[10px] font-mono font-bold",s>0?"text-red-500":"text-muted-foreground"),children:s})]})]})]})}const t1={left:"border-l-2",right:"border-r-2",top:"border-t-2",bottom:"border-b-2"},n1={left:"top-1/2 -right-1.5 -translate-y-1/2",right:"top-1/2 -left-1.5 -translate-y-1/2",top:"left-1/2 -bottom-1.5 -translate-x-1/2",bottom:"left-1/2 -top-1.5 -translate-x-1/2"};function a1(l,s){switch(l){case"left":return{borderLeftColor:s};case"right":return{borderRightColor:s};case"top":return{borderTopColor:s};case"bottom":return{borderBottomColor:s}}}function l1({account:l,zone:s,originalIndex:r,isHovered:c,isDragging:d,offset:m,showDetails:h,privacyMode:p,onMouseEnter:y,onMouseLeave:N,onPointerDown:E,onPointerMove:x,onPointerUp:b}){const _=t1[s],O=a1(s,l.color),k=n1[s];return o.jsxs("div",{"data-account-index":r,"data-zone":s,onMouseEnter:y,onMouseLeave:N,onPointerDown:E,onPointerMove:x,onPointerUp:b,onPointerCancel:b,className:Q("group/card relative rounded-lg p-3 w-44 cursor-grab transition-shadow duration-200","bg-muted/30 dark:bg-zinc-900/60 backdrop-blur-sm","border border-border/50 dark:border-white/[0.08]",_,"select-none touch-none",c&&"bg-muted/50 dark:bg-zinc-800/60",d&&"cursor-grabbing shadow-xl scale-105 z-50"),style:{...O,transform:`translate(${m.x}px, ${m.y}px)${d?" scale(1.05)":""}`},children:[o.jsx(Ko,{className:"absolute top-2 right-2 w-4 h-4 text-muted-foreground/40"}),o.jsx("div",{className:"flex justify-between items-start mb-1 mr-4",children:o.jsx("span",{className:Q("text-xs font-semibold text-foreground tracking-tight truncate max-w-[100px]",p&&dg),children:pg(l.email)})}),o.jsx(e1,{success:l.successCount,failure:l.failureCount,showDetails:h}),o.jsx("div",{className:Q("absolute w-3 h-3 rounded-full transform z-20 transition-colors border","bg-muted dark:bg-zinc-800 border-border dark:border-zinc-600",k,c&&"bg-foreground dark:bg-white border-transparent")})]})}function Gc({provider:l,className:s,size:r=18,withBackground:c=!1}){const d=l.toLowerCase(),m=LS[d],h=c?Math.floor(r*.65):r,p=m?o.jsx("img",{src:m,alt:`${l} icon`,width:h,height:h,className:"shrink-0 object-contain"}):o.jsx("span",{className:"font-bold",style:{color:ko[d]||"#6b7280",fontSize:h*.6},children:l.charAt(0).toUpperCase()});if(c)return o.jsx("div",{className:Q("shrink-0 rounded-full bg-white border border-border flex items-center justify-center shadow-sm",s),style:{width:r,height:r},children:p});if(m)return o.jsx("img",{src:m,alt:`${l} icon`,width:r,height:r,className:Q("shrink-0 rounded-sm object-contain",s)});const y=ko[d]||"#6b7280";return o.jsx("div",{className:Q("shrink-0 rounded-full flex items-center justify-center text-white font-bold",s),style:{width:r,height:r,backgroundColor:y,fontSize:r*.5},children:l.charAt(0).toUpperCase()})}function s1({providerData:l,providerColor:s,totalRequests:r,maxRequests:c,isDragging:d,offset:m,hoveredAccount:h,hasRightAccounts:p,hasTopAccounts:y,hasBottomAccounts:N,onPointerDown:E,onPointerMove:x,onPointerUp:b}){const{accounts:_}=l;return o.jsxs("div",{"data-provider-node":!0,onPointerDown:E,onPointerMove:x,onPointerUp:b,onPointerCancel:b,className:Q("group relative w-full rounded-xl p-4 cursor-grab transition-shadow duration-200","bg-muted/30 dark:bg-zinc-900/60 backdrop-blur-sm","border-2 border-border/50 dark:border-white/[0.08]",!d&&"animate-subtle-float animate-border-glow","select-none touch-none",h!==null&&"scale-[1.02]",d&&"cursor-grabbing shadow-2xl scale-105 z-50"),style:{"--glow-color":`${s}60`,borderColor:h!==null?`${s}80`:void 0,transform:`translate(${m.x}px, ${m.y}px)${d?" scale(1.05)":""}`},children:[o.jsx(Ko,{className:"absolute top-2 right-2 w-4 h-4 text-muted-foreground/40"}),o.jsx("div",{className:"absolute inset-0 rounded-xl animate-glow-pulse pointer-events-none",style:{"--glow-color":`${s}30`}}),o.jsx("div",{className:"absolute top-1/2 -left-1.5 w-3 h-3 rounded-full transform -translate-y-1/2",style:{backgroundColor:s,boxShadow:"0 0 0 4px var(--background)"}}),p&&o.jsx("div",{className:"absolute top-1/2 -right-1.5 w-3 h-3 rounded-full transform -translate-y-1/2",style:{backgroundColor:s,boxShadow:"0 0 0 4px var(--background)"}}),y&&o.jsx("div",{className:"absolute left-1/2 -top-1.5 w-3 h-3 rounded-full transform -translate-x-1/2",style:{backgroundColor:s,boxShadow:"0 0 0 4px var(--background)"}}),N&&o.jsx("div",{className:"absolute left-1/2 -bottom-1.5 w-3 h-3 rounded-full transform -translate-x-1/2",style:{backgroundColor:s,boxShadow:"0 0 0 4px var(--background)"}}),o.jsxs("div",{className:"flex items-center gap-3 mb-4 relative z-10",children:[o.jsx("div",{className:"animate-icon-breathe",children:o.jsx(Gc,{provider:l.provider,size:36,withBackground:!0})}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-sm font-semibold text-foreground tracking-tight",children:l.displayName}),o.jsx("p",{className:"text-[10px] text-muted-foreground font-medium uppercase",children:"Provider"})]})]}),o.jsxs("div",{className:"space-y-2 relative z-10",children:[o.jsxs("div",{className:"flex justify-between items-center text-xs",children:[o.jsx("span",{className:"text-muted-foreground",children:"Total Requests"}),o.jsx("span",{className:"text-foreground font-mono",children:r.toLocaleString()})]}),o.jsxs("div",{className:"flex justify-between items-center text-xs",children:[o.jsx("span",{className:"text-muted-foreground",children:"Accounts"}),o.jsx("span",{className:"text-foreground font-mono",children:_.length})]}),o.jsx("div",{className:"w-full bg-muted dark:bg-zinc-800/50 h-1 rounded-full mt-2 overflow-hidden",children:o.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.min(100,r/(c*_.length)*100)}%`,backgroundColor:s}})})]})]})}function i1({paths:l,accounts:s,maxRequests:r,hoveredAccount:c,pulsingAccounts:d}){return o.jsxs(o.Fragment,{children:[o.jsx("defs",{children:o.jsxs("filter",{id:"flow-glow",x:"-20%",y:"-20%",width:"140%",height:"140%",filterUnits:"userSpaceOnUse",children:[o.jsx("feGaussianBlur",{stdDeviation:"3",result:"blur"}),o.jsx("feComposite",{in:"SourceGraphic",in2:"blur",operator:"over"})]})}),l.map((m,h)=>{const p=s[h];if(!p)return null;const y=p.successCount+p.failureCount,N=Math.max(2,y/r*10),E=c===h,x=c!==null&&c!==h,b=d.has(p.id),_=VS(h);return o.jsxs("g",{children:[o.jsx("path",{d:m,fill:"none",stroke:_,strokeWidth:N,strokeOpacity:E?.8:x?.15:.4,strokeLinecap:"round",filter:E?"url(#flow-glow)":void 0,className:"transition-all duration-300"}),b&&o.jsxs(o.Fragment,{children:[o.jsx("path",{d:m,fill:"none",stroke:p.color,strokeWidth:N*2,strokeLinecap:"round",filter:"url(#flow-glow)",className:"animate-request-pulse"}),o.jsx("circle",{r:6,fill:p.color,filter:"url(#flow-glow)",style:{offsetPath:`path('${m}')`,offsetDistance:"0%",animation:"travel-dot 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards"}})]})]},h)})]})}function o1({onBack:l,showDetails:s,onToggleDetails:r,hasCustomPositions:c,onResetPositions:d}){return o.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5",children:[l?o.jsxs("button",{onClick:l,className:"group flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground transition-all duration-200 px-3 py-1.5 rounded-md hover:bg-muted/50 border border-transparent hover:border-border/50",children:[o.jsx(qo,{className:"w-3.5 h-3.5 rotate-180 transition-transform group-hover:-translate-x-0.5"}),o.jsx("span",{children:"Back to providers"})]}):o.jsx("div",{}),o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("button",{onClick:r,className:Q("flex items-center gap-1.5 text-xs font-medium transition-all duration-200 px-3 py-1.5 rounded-md border shadow-sm",s?"bg-primary text-primary-foreground border-primary hover:bg-primary/90":"bg-background text-muted-foreground hover:text-foreground border-border/60 hover:border-border hover:bg-muted/50"),children:[s?o.jsx(Lo,{className:"w-3.5 h-3.5"}):o.jsx(Yo,{className:"w-3.5 h-3.5"}),o.jsx("span",{children:s?"Hide Details":"Show Details"})]}),c&&o.jsxs("button",{onClick:d,className:"flex items-center gap-1.5 text-xs font-medium text-muted-foreground hover:text-foreground transition-all duration-200 px-3 py-1.5 rounded-md border border-border/60 hover:border-border bg-background hover:bg-muted/50 shadow-sm",children:[o.jsx(nb,{className:"w-3.5 h-3.5"}),o.jsx("span",{children:"Reset layout"})]})]})]})}function r1({providerData:l,onBack:s}){const r=v.useRef(null),c=v.useRef(null),[d,m]=v.useState(null),[h,p]=v.useState(!1),[y,N]=v.useState([]),{privacyMode:E}=Rc(),{accounts:x}=l,b=Math.max(...x.map(de=>de.successCount+de.failureCount),1),_=x.reduce((de,X)=>de+X.successCount+X.failureCount,0),O=v.useCallback(()=>{const de=ZS({containerRef:r,svgRef:c,accounts:x});de.length>0&&N(de)},[x]),k=`ccs-flow-positions-${l.provider}`,{dragOffsets:U,draggingId:M,handlePointerDown:V,handlePointerMove:G,handlePointerUp:q,getOffset:B,resetPositions:j,hasCustomPositions:L}=$S({storageKey:k,onDrag:O}),W=FS(U),ee=IS(x),he=v.useMemo(()=>XS(x).slice(0,KS),[x]);v.useEffect(()=>{const de=setTimeout(O,50);return window.addEventListener("resize",O),()=>{clearTimeout(de),window.removeEventListener("resize",O)}},[O]),v.useEffect(()=>{const de=setTimeout(O,10);return()=>clearTimeout(de)},[U,O]),v.useEffect(()=>{const de=Date.now(),X=350,F=()=>{O(),Date.now()-de<X&&requestAnimationFrame(F)};requestAnimationFrame(F)},[h,O]);const be=ko[l.provider.toLowerCase()]||"#6b7280",re=v.useMemo(()=>WS(x),[x]),{leftAccounts:Ye,rightAccounts:$,topAccounts:ie,bottomAccounts:D}=re,J=$.length>0,le=ie.length>0,ve=D.length>0,xe=v.useMemo(()=>JS(x.length),[x.length]),Te=(de,X)=>de.map(F=>{const ae=x.findIndex(I=>I.id===F.id);return o.jsx(l1,{account:F,zone:X,originalIndex:ae,isHovered:d===ae,isDragging:M===F.id,offset:B(F.id),showDetails:h,privacyMode:E,onMouseEnter:()=>m(ae),onMouseLeave:()=>m(null),onPointerDown:I=>V(F.id,I),onPointerMove:G,onPointerUp:q},F.id)});return o.jsxs("div",{className:"flex flex-col",ref:r,children:[o.jsx(o1,{onBack:s,showDetails:h,onToggleDetails:()=>p(!h),hasCustomPositions:L,onResetPositions:j}),o.jsxs("div",{className:"min-h-[320px] flex gap-4 px-4 py-6 self-stretch items-stretch transition-all duration-200",children:[o.jsxs("div",{className:"relative flex-1 flex flex-col items-stretch justify-center px-4",style:{paddingTop:`${24+W.paddingTop}px`,paddingBottom:`${24+W.paddingBottom}px`,minHeight:`${320+W.extraHeight}px`},children:[o.jsx("svg",{ref:c,className:"absolute inset-0 w-full h-full pointer-events-none z-0 overflow-visible",children:o.jsx(i1,{paths:y,accounts:x,maxRequests:b,hoveredAccount:d,pulsingAccounts:ee})}),le&&o.jsx("div",{className:"flex flex-row gap-3 z-10 justify-center flex-wrap mb-8",children:Te(ie,"top")}),o.jsxs("div",{className:"flex items-center justify-between gap-8 flex-1",children:[o.jsx("div",{className:"flex flex-col gap-3 z-10 w-48 justify-center flex-shrink-0",children:Te(Ye,"left")}),o.jsx("div",{className:Q("z-10 flex items-center flex-shrink-0",xe),children:o.jsx(s1,{providerData:l,providerColor:be,totalRequests:_,maxRequests:b,isDragging:M==="provider",offset:B("provider"),hoveredAccount:d,hasRightAccounts:J,hasTopAccounts:le,hasBottomAccounts:ve,onPointerDown:de=>V("provider",de),onPointerMove:G,onPointerUp:q})}),J&&o.jsx("div",{className:"flex flex-col gap-3 z-10 w-48 justify-center flex-shrink-0",children:Te($,"right")})]}),ve&&o.jsx("div",{className:"flex flex-row gap-3 z-10 justify-center flex-wrap mt-8",children:Te(D,"bottom")})]}),o.jsx("div",{className:"w-56 flex-shrink-0 self-stretch relative",children:o.jsx("div",{className:"absolute inset-0",children:o.jsx(PS,{events:he,privacyMode:E})})})]})]})}const ti="/api";async function Ue(l,s){const r=await fetch(`${ti}${l}`,{headers:{"Content-Type":"application/json"},...s});if(!r.ok){const c=await r.json().catch(()=>({error:"Unknown error"}));throw new Error(c.error||r.statusText)}return r.json()}const St={profiles:{list:()=>Ue("/profiles"),create:l=>Ue("/profiles",{method:"POST",body:JSON.stringify(l)}),update:(l,s)=>Ue(`/profiles/${l}`,{method:"PUT",body:JSON.stringify(s)}),delete:l=>Ue(`/profiles/${l}`,{method:"DELETE"})},cliproxy:{list:()=>Ue("/cliproxy"),getAuthStatus:()=>Ue("/cliproxy/auth"),create:l=>Ue("/cliproxy",{method:"POST",body:JSON.stringify(l)}),update:(l,s)=>Ue(`/cliproxy/${l}`,{method:"PUT",body:JSON.stringify(s)}),delete:l=>Ue(`/cliproxy/${l}`,{method:"DELETE"}),proxyStatus:()=>Ue("/cliproxy/proxy-status"),proxyStart:()=>Ue("/cliproxy/proxy-start",{method:"POST"}),proxyStop:()=>Ue("/cliproxy/proxy-stop",{method:"POST"}),updateCheck:()=>Ue("/cliproxy/update-check"),stats:()=>Ue("/cliproxy/usage"),models:()=>Ue("/cliproxy/models"),updateModel:(l,s)=>Ue(`/cliproxy/models/${l}`,{method:"PUT",body:JSON.stringify({model:s})}),getConfigYaml:async()=>{const l=await fetch(`${ti}/cliproxy/config.yaml`);if(!l.ok)throw new Error("Failed to load config");return l.text()},saveConfigYaml:async l=>{const s=await fetch(`${ti}/cliproxy/config.yaml`,{method:"PUT",headers:{"Content-Type":"application/yaml"},body:l});if(!s.ok){const r=await s.json().catch(()=>({error:"Failed to save config"}));throw new Error(r.error||"Failed to save config")}},getAuthFiles:()=>Ue("/cliproxy/auth-files"),getAuthFile:async l=>{const s=await fetch(`${ti}/cliproxy/auth-files/download?name=${encodeURIComponent(l)}`);if(!s.ok)throw new Error("Failed to load auth file");return s.text()},accounts:{list:()=>Ue("/cliproxy/auth/accounts"),listByProvider:l=>Ue(`/cliproxy/auth/accounts/${l}`),setDefault:(l,s)=>Ue(`/cliproxy/auth/accounts/${l}/default`,{method:"POST",body:JSON.stringify({accountId:s})}),remove:(l,s)=>Ue(`/cliproxy/auth/accounts/${l}/${s}`,{method:"DELETE"})},auth:{start:(l,s)=>Ue(`/cliproxy/auth/${l}/start`,{method:"POST",body:JSON.stringify({nickname:s})})},errorLogs:{list:()=>Ue("/cliproxy/error-logs"),getContent:async l=>{const s=await fetch(`${ti}/cliproxy/error-logs/${encodeURIComponent(l)}`);if(!s.ok)throw new Error("Failed to load error log");return s.text()}}},accounts:{list:()=>Ue("/accounts"),setDefault:l=>Ue("/accounts/default",{method:"POST",body:JSON.stringify({name:l})})},config:{format:()=>Ue("/config/format"),get:()=>Ue("/config"),update:l=>Ue("/config",{method:"PUT",body:JSON.stringify(l)}),migrate:(l=!1)=>Ue(`/config/migrate?dryRun=${l}`,{method:"POST"}),rollback:l=>Ue("/config/rollback",{method:"POST",body:JSON.stringify({backupPath:l})})},presets:{list:l=>Ue(`/settings/${l}/presets`),create:(l,s)=>Ue(`/settings/${l}/presets`,{method:"POST",body:JSON.stringify(s)}),delete:(l,s)=>Ue(`/settings/${l}/presets/${encodeURIComponent(s)}`,{method:"DELETE"})},cliproxyServer:{get:()=>Ue("/cliproxy-server"),update:l=>Ue("/cliproxy-server",{method:"PUT",body:JSON.stringify(l)}),test:l=>Ue("/cliproxy-server/test",{method:"POST",body:JSON.stringify(l)})}};function hC(){return Ot({queryKey:["cliproxy"],queryFn:()=>St.cliproxy.list()})}function u1(){return Ot({queryKey:["cliproxy-auth"],queryFn:()=>St.cliproxy.getAuthStatus()})}function pC(){const l=an();return Cn({mutationFn:s=>St.cliproxy.create(s),onSuccess:()=>{l.invalidateQueries({queryKey:["cliproxy"]}),Ae.success("Variant created successfully")},onError:s=>{Ae.error(s.message)}})}function gC(){const l=an();return Cn({mutationFn:s=>St.cliproxy.delete(s),onSuccess:()=>{l.invalidateQueries({queryKey:["cliproxy"]}),Ae.success("Variant deleted successfully")},onError:s=>{Ae.error(s.message)}})}function yC(){const l=an();return Cn({mutationFn:({provider:s,accountId:r})=>St.cliproxy.accounts.setDefault(s,r),onSuccess:()=>{l.invalidateQueries({queryKey:["cliproxy-accounts"]}),l.invalidateQueries({queryKey:["cliproxy-auth"]}),Ae.success("Default account updated")},onError:s=>{Ae.error(s.message)}})}function vC(){const l=an();return Cn({mutationFn:({provider:s,accountId:r})=>St.cliproxy.accounts.remove(s,r),onSuccess:()=>{l.invalidateQueries({queryKey:["cliproxy-accounts"]}),l.invalidateQueries({queryKey:["cliproxy-auth"]}),Ae.success("Account removed")},onError:s=>{Ae.error(s.message)}})}function xC(){const l=an();return Cn({mutationFn:({provider:s,nickname:r})=>St.cliproxy.auth.start(s,r),onSuccess:(s,r)=>{l.invalidateQueries({queryKey:["cliproxy-accounts"]}),l.invalidateQueries({queryKey:["cliproxy-auth"]}),Ae.success(`Account added for ${r.provider}`)},onError:s=>{Ae.error(s.message)}})}function bC(){return Ot({queryKey:["cliproxy-models"],queryFn:()=>St.cliproxy.models()})}function SC(l){return Ot({queryKey:["presets",l],queryFn:()=>St.presets.list(l),enabled:!!l})}function NC(){const l=an();return Cn({mutationFn:({profile:s,data:r})=>St.presets.create(s,r),onSuccess:(s,r)=>{l.invalidateQueries({queryKey:["presets",r.profile]}),Ae.success(`Preset "${r.data.name}" saved`)},onError:s=>{Ae.error(s.message)}})}function jC(){const l=an();return Cn({mutationFn:({profile:s,name:r})=>St.presets.delete(s,r),onSuccess:(s,r)=>{l.invalidateQueries({queryKey:["presets",r.profile]}),Ae.success("Preset deleted")},onError:s=>{Ae.error(s.message)}})}function CC(){return Ot({queryKey:["proxy-status"],queryFn:()=>St.cliproxy.proxyStatus(),refetchInterval:3e4})}function EC(){const l=an();return Cn({mutationFn:()=>St.cliproxy.proxyStart(),onSuccess:s=>{l.invalidateQueries({queryKey:["proxy-status"]}),s.alreadyRunning?Ae.info("CLIProxy was already running"):s.started?Ae.success("CLIProxy started successfully"):Ae.error(s.error||"Failed to start CLIProxy")},onError:s=>{Ae.error(s.message)}})}function wC(){const l=an();return Cn({mutationFn:()=>St.cliproxy.proxyStop(),onSuccess:s=>{l.invalidateQueries({queryKey:["proxy-status"]}),s.stopped?Ae.success(`CLIProxy stopped${s.sessionCount?` (${s.sessionCount} session(s) disconnected)`:""}`):Ae.error(s.error||"Failed to stop CLIProxy")},onError:s=>{Ae.error(s.message)}})}function MC(){return Ot({queryKey:["cliproxy-update-check"],queryFn:()=>St.cliproxy.updateCheck(),staleTime:3600*1e3,refetchInterval:3600*1e3,refetchOnWindowFocus:!1})}async function c1(){const l=await fetch("/api/cliproxy/stats");if(!l.ok){const s=await l.json();throw new Error(s.message||"Failed to fetch stats")}return l.json()}async function d1(){const l=await fetch("/api/cliproxy/status");if(!l.ok)throw new Error("Failed to fetch status");return l.json()}function f1(){return Ot({queryKey:["cliproxy-status"],queryFn:d1,refetchInterval:1e4,retry:1})}function m1(l=!0){return Ot({queryKey:["cliproxy-stats"],queryFn:c1,enabled:l,refetchInterval:5e3,retry:1,staleTime:3e3})}async function h1(){const l=await fetch("/api/cliproxy/error-logs");if(!l.ok){const r=await l.json();throw new Error(r.message||"Failed to fetch error logs")}return(await l.json()).files??[]}async function p1(l){const s=await fetch(`/api/cliproxy/error-logs/${encodeURIComponent(l)}`);if(!s.ok)throw new Error("Failed to fetch error log content");return s.text()}function g1(l=!0){return Ot({queryKey:["cliproxy-error-logs"],queryFn:h1,enabled:l,refetchInterval:3e4,retry:1,staleTime:1e4})}function y1(l){return Ot({queryKey:["cliproxy-error-log-content",l],queryFn:()=>l?p1(l):Promise.resolve(""),enabled:!!l,staleTime:6e4})}function v1(l,s){const r=l+s;return r===0?100:Math.round(l/r*100)}function x1(l){return l.replace(/@(gmail|yahoo|hotmail|outlook|icloud)\.com$/i,"")}const dp=["#1e6091","#2d8a6e","#d4a012","#c92a2d","#c45a1a","#6b9c4d","#3d5a73","#cc7614","#3a7371","#7c5fc4"];function b1(){const{data:l,isLoading:s,error:r}=u1(),{data:c,isLoading:d,dataUpdatedAt:m}=m1(),[h,p]=v.useState("");v.useEffect(()=>{if(!m)return;const k=()=>{const M=Math.floor((Date.now()-m)/1e3);M<60?p(`${M}s ago`):p(`${Math.floor(M/60)}m ago`)};k();const U=setInterval(k,1e3);return()=>clearInterval(U)},[m]);const y=v.useMemo(()=>c?.accountStats?new Map(Object.entries(c.accountStats)):new Map,[c?.accountStats]),{accounts:N,totalSuccess:E,totalFailure:x,totalRequests:b,providerStats:_}=v.useMemo(()=>{if(!l?.authStatus)return{accounts:[],totalSuccess:0,totalFailure:0,totalRequests:0,providerStats:[]};const k=[],U=new Map;let M=0,V=0,G=0;l.authStatus.forEach(B=>{const j=B.provider;U.has(j)||U.set(j,{success:0,failure:0,accounts:[]});const L=U.get(j);L&&B.accounts?.forEach(W=>{const ee=W.email||W.id,he=y.get(ee),be=he?.successCount??0,re=he?.failureCount??0;M+=be,V+=re,L.success+=be,L.failure+=re;const Ye={id:W.id,email:W.email||W.id,provider:B.provider,displayName:B.displayName,isDefault:W.isDefault,successCount:be,failureCount:re,lastUsedAt:he?.lastUsedAt??W.lastUsedAt,color:dp[G%dp.length]};k.push(Ye),L.accounts.push(Ye),G++})});const q=[];return U.forEach((B,j)=>{B.accounts.length!==0&&q.push({provider:j,displayName:GS(j),totalRequests:B.success+B.failure,successCount:B.success,failureCount:B.failure,accountCount:B.accounts.length,accounts:B.accounts})}),q.sort((B,j)=>j.totalRequests-B.totalRequests),{accounts:k,totalSuccess:M,totalFailure:V,totalRequests:M+V,providerStats:q}},[l?.authStatus,y]),O=b>0?Math.round(E/b*100):100;return{accounts:N,totalSuccess:E,totalFailure:x,totalRequests:b,providerStats:_,overallSuccessRate:O,isLoading:s||d,error:r??null,timeSinceUpdate:h}}function S1(){return o.jsxs("div",{className:"relative flex items-center justify-center w-5 h-5",children:[o.jsx("div",{className:"absolute w-4 h-4 rounded-full animate-ping opacity-20",style:{backgroundColor:Lt.success}}),o.jsx("div",{className:"absolute w-3 h-3 rounded-full animate-pulse opacity-40",style:{backgroundColor:Lt.success}}),o.jsx("div",{className:"relative w-2 h-2 rounded-full z-10",style:{backgroundColor:Lt.success}})]})}function N1({success:l,failure:s}){return l===0&&s===0?o.jsx("span",{className:"text-[9px] text-muted-foreground/50 font-mono",children:"no activity"}):o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsxs("div",{className:"flex items-center gap-0.5",children:[o.jsx(Go,{className:"w-3 h-3 text-emerald-700 dark:text-emerald-500"}),o.jsx("span",{className:"text-[10px] font-mono font-medium text-emerald-700 dark:text-emerald-500",children:l.toLocaleString()})]}),s>0&&o.jsxs("div",{className:"flex items-center gap-0.5",children:[o.jsx(Ac,{className:"w-3 h-3 text-red-700 dark:text-red-500"}),o.jsx("span",{className:"text-[10px] font-mono font-medium text-red-700 dark:text-red-500",children:s.toLocaleString()})]})]})}function j1({stats:l,isHovered:s,privacyMode:r,onSelect:c,onMouseEnter:d,onMouseLeave:m}){const h=v1(l.successCount,l.failureCount),p=ko[l.provider.toLowerCase()]||"#6b7280";return o.jsxs("button",{onClick:c,onMouseEnter:d,onMouseLeave:m,className:Q("group relative rounded-xl p-4 text-left transition-all duration-300","bg-muted/30 dark:bg-zinc-900/60 backdrop-blur-sm","border border-border/50 dark:border-white/[0.08]","hover:border-opacity-50 hover:scale-[1.02] hover:shadow-lg",s&&"ring-1"),style:{borderColor:s?p:void 0,"--ring-color":p},children:[o.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[o.jsx(Gc,{provider:l.provider,size:36,withBackground:!0}),o.jsxs("div",{children:[o.jsx("h3",{className:"text-sm font-semibold text-foreground tracking-tight",children:l.displayName}),o.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[l.accountCount," account",l.accountCount!==1?"s":""]})]}),o.jsx(qo,{className:Q("w-4 h-4 ml-auto text-muted-foreground transition-all",s?"opacity-100 translate-x-0":"opacity-0 -translate-x-2")})]}),o.jsxs("div",{className:"space-y-2",children:[o.jsxs("div",{className:"flex justify-between items-center text-xs",children:[o.jsx("span",{className:"text-muted-foreground",children:"Stats"}),o.jsx(N1,{success:l.successCount,failure:l.failureCount})]}),o.jsxs("div",{className:"flex justify-between text-xs",children:[o.jsx("span",{className:"text-muted-foreground",children:"Success Rate"}),o.jsxs("span",{className:"font-mono font-semibold",style:{color:h===100?Lt.success:h>=95?Lt.degraded:Lt.failed},children:[h,"%"]})]}),o.jsx("div",{className:"w-full bg-muted dark:bg-zinc-800/50 h-1 rounded-full overflow-hidden",children:o.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${h}%`,backgroundColor:p}})})]}),o.jsxs("div",{className:"flex gap-1 mt-3",children:[l.accounts.slice(0,5).map(y=>o.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:y.color},title:r?"••••••":x1(y.email)},y.id)),l.accounts.length>5&&o.jsxs("span",{className:"text-[10px] text-muted-foreground ml-1",children:["+",l.accounts.length-5]})]})]})}function wo({icon:l,label:s,value:r,color:c}){return o.jsxs("div",{className:"flex items-center gap-3 p-3 rounded-lg bg-card/50 dark:bg-zinc-900/50 border border-border/50 dark:border-white/[0.06]",children:[o.jsx("div",{className:"w-8 h-8 rounded-md flex items-center justify-center",style:{backgroundColor:c?`${c}15`:"var(--muted)",color:c||"var(--muted-foreground)"},children:l}),o.jsxs("div",{children:[o.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:s}),o.jsx("div",{className:"text-lg font-semibold font-mono leading-tight",style:{color:c||"var(--foreground)"},children:r})]})]})}function C1(){const{accounts:l,totalSuccess:s,totalFailure:r,totalRequests:c,providerStats:d,overallSuccessRate:m,isLoading:h,error:p,timeSinceUpdate:y}=b1(),{privacyMode:N}=Rc(),[E,x]=v.useState(null),[b,_]=v.useState(null),O=E?d.find(k=>k.provider===E):null;return h?o.jsxs("div",{className:"rounded-xl border border-border overflow-hidden font-mono text-[13px] bg-card/50 dark:bg-zinc-900/60 backdrop-blur-sm",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[o.jsx(Le,{className:"h-4 w-32"}),o.jsx(Le,{className:"h-4 w-20"})]}),o.jsxs("div",{className:"p-4 space-y-4",children:[o.jsx("div",{className:"flex gap-3",children:[1,2,3,4].map(k=>o.jsx(Le,{className:"h-16 flex-1 rounded-lg"},k))}),o.jsx(Le,{className:"h-48 w-full rounded-lg"})]})]}):p||l.length===0?null:o.jsxs("div",{className:"rounded-xl border border-border overflow-hidden font-mono text-[13px] text-foreground bg-card/50 dark:bg-zinc-900/60 backdrop-blur-sm",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 py-2.5 border-b border-border bg-gradient-to-r from-emerald-500/5 via-transparent to-transparent dark:from-emerald-500/10",children:[o.jsxs("div",{className:"flex items-center gap-2",children:[o.jsx(S1,{}),o.jsx("span",{className:"text-xs font-semibold tracking-tight text-foreground",children:"LIVE"}),o.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Account Monitor"})]}),o.jsxs("div",{className:"flex items-center gap-4 text-[10px] text-muted-foreground",children:[o.jsxs("div",{className:"flex items-center gap-1.5",children:[o.jsx(ab,{className:"w-3 h-3 animate-pulse"}),o.jsxs("span",{children:["Updated ",y||"now"]})]}),o.jsx("span",{className:"text-muted-foreground/50",children:"|"}),o.jsxs("span",{children:[l.length," accounts"]}),o.jsxs("span",{className:"font-mono",children:[c.toLocaleString()," req"]})]})]}),o.jsxs("div",{className:"grid grid-cols-4 gap-3 p-4 border-b border-border bg-muted/20 dark:bg-zinc-900/30",children:[o.jsx(wo,{icon:o.jsx(si,{className:"w-4 h-4"}),label:"Accounts",value:l.length,color:"var(--accent)"}),o.jsx(wo,{icon:o.jsx(Go,{className:"w-4 h-4"}),label:"Success",value:s.toLocaleString(),color:Lt.success}),o.jsx(wo,{icon:o.jsx(Ac,{className:"w-4 h-4"}),label:"Failed",value:r.toLocaleString(),color:r>0?Lt.failed:void 0}),o.jsx(wo,{icon:o.jsx(si,{className:"w-4 h-4"}),label:"Success Rate",value:`${m}%`,color:m===100?Lt.success:m>=95?Lt.degraded:Lt.failed})]}),o.jsx("div",{className:"relative overflow-hidden",children:O?o.jsx(r1,{providerData:O,onBack:()=>x(null)}):o.jsxs("div",{className:"p-6",children:[o.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-widest mb-4",children:"Request Distribution by Provider"}),o.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-4",children:d.map(k=>o.jsx(j1,{stats:k,isHovered:b===k.provider,privacyMode:N,onSelect:()=>x(k.provider),onMouseEnter:()=>_(k.provider),onMouseLeave:()=>_(null)},k.provider))})]})})]})}const $o=v.createContext(null);$o.displayName="PanelGroupContext";const it={group:"data-panel-group",groupDirection:"data-panel-group-direction",groupId:"data-panel-group-id",panel:"data-panel",panelCollapsible:"data-panel-collapsible",panelId:"data-panel-id",panelSize:"data-panel-size",resizeHandle:"data-resize-handle",resizeHandleActive:"data-resize-handle-active",resizeHandleEnabled:"data-panel-resize-handle-enabled",resizeHandleId:"data-panel-resize-handle-id",resizeHandleState:"data-resize-handle-state"},Kc=10,ol=v.useLayoutEffect,fp=n0.useId,E1=typeof fp=="function"?fp:()=>null;let w1=0;function Vc(l=null){const s=E1(),r=v.useRef(l||s||null);return r.current===null&&(r.current=""+w1++),l??r.current}function gg({children:l,className:s="",collapsedSize:r,collapsible:c,defaultSize:d,forwardedRef:m,id:h,maxSize:p,minSize:y,onCollapse:N,onExpand:E,onResize:x,order:b,style:_,tagName:O="div",...k}){const U=v.useContext($o);if(U===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:M,expandPanel:V,getPanelSize:G,getPanelStyle:q,groupId:B,isPanelCollapsed:j,reevaluatePanelConstraints:L,registerPanel:W,resizePanel:ee,unregisterPanel:he}=U,be=Vc(h),re=v.useRef({callbacks:{onCollapse:N,onExpand:E,onResize:x},constraints:{collapsedSize:r,collapsible:c,defaultSize:d,maxSize:p,minSize:y},id:be,idIsFromProps:h!==void 0,order:b});v.useRef({didLogMissingDefaultSizeWarning:!1}),ol(()=>{const{callbacks:$,constraints:ie}=re.current,D={...ie};re.current.id=be,re.current.idIsFromProps=h!==void 0,re.current.order=b,$.onCollapse=N,$.onExpand=E,$.onResize=x,ie.collapsedSize=r,ie.collapsible=c,ie.defaultSize=d,ie.maxSize=p,ie.minSize=y,(D.collapsedSize!==ie.collapsedSize||D.collapsible!==ie.collapsible||D.maxSize!==ie.maxSize||D.minSize!==ie.minSize)&&L(re.current,D)}),ol(()=>{const $=re.current;return W($),()=>{he($)}},[b,be,W,he]),v.useImperativeHandle(m,()=>({collapse:()=>{M(re.current)},expand:$=>{V(re.current,$)},getId(){return be},getSize(){return G(re.current)},isCollapsed(){return j(re.current)},isExpanded(){return!j(re.current)},resize:$=>{ee(re.current,$)}}),[M,V,G,j,be,ee]);const Ye=q(re.current,d);return v.createElement(O,{...k,children:l,className:s,id:be,style:{...Ye,..._},[it.groupId]:B,[it.panel]:"",[it.panelCollapsible]:c||void 0,[it.panelId]:be,[it.panelSize]:parseFloat(""+Ye.flexGrow).toFixed(1)})}const ii=v.forwardRef((l,s)=>v.createElement(gg,{...l,forwardedRef:s}));gg.displayName="Panel";ii.displayName="forwardRef(Panel)";let Mc=null,Ao=-1,Ua=null;function M1(l,s,r){const c=(s&Sg)!==0,d=(s&Ng)!==0,m=(s&jg)!==0,h=(s&Cg)!==0;if(s){if(c)return m?"se-resize":h?"ne-resize":"e-resize";if(d)return m?"sw-resize":h?"nw-resize":"w-resize";if(m)return"s-resize";if(h)return"n-resize"}switch(l){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function z1(){Ua!==null&&(document.head.removeChild(Ua),Mc=null,Ua=null,Ao=-1)}function yc(l,s,r){var c,d;const m=M1(l,s);if(Mc!==m){if(Mc=m,Ua===null&&(Ua=document.createElement("style"),document.head.appendChild(Ua)),Ao>=0){var h;(h=Ua.sheet)===null||h===void 0||h.removeRule(Ao)}Ao=(c=(d=Ua.sheet)===null||d===void 0?void 0:d.insertRule(`*{cursor: ${m} !important;}`))!==null&&c!==void 0?c:-1}}function yg(l){return l.type==="keydown"}function vg(l){return l.type.startsWith("pointer")}function xg(l){return l.type.startsWith("mouse")}function Fo(l){if(vg(l)){if(l.isPrimary)return{x:l.clientX,y:l.clientY}}else if(xg(l))return{x:l.clientX,y:l.clientY};return{x:1/0,y:1/0}}function T1(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function O1(l,s,r){return l.x<s.x+s.width&&l.x+l.width>s.x&&l.y<s.y+s.height&&l.y+l.height>s.y}function A1(l,s){if(l===s)throw new Error("Cannot compare node with itself");const r={a:pp(l),b:pp(s)};let c;for(;r.a.at(-1)===r.b.at(-1);)l=r.a.pop(),s=r.b.pop(),c=l;ze(c,"Stacking order can only be calculated for elements with a common ancestor");const d={a:hp(mp(r.a)),b:hp(mp(r.b))};if(d.a===d.b){const m=c.childNodes,h={a:r.a.at(-1),b:r.b.at(-1)};let p=m.length;for(;p--;){const y=m[p];if(y===h.a)return 1;if(y===h.b)return-1}}return Math.sign(d.a-d.b)}const D1=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function _1(l){var s;const r=getComputedStyle((s=bg(l))!==null&&s!==void 0?s:l).display;return r==="flex"||r==="inline-flex"}function k1(l){const s=getComputedStyle(l);return!!(s.position==="fixed"||s.zIndex!=="auto"&&(s.position!=="static"||_1(l))||+s.opacity<1||"transform"in s&&s.transform!=="none"||"webkitTransform"in s&&s.webkitTransform!=="none"||"mixBlendMode"in s&&s.mixBlendMode!=="normal"||"filter"in s&&s.filter!=="none"||"webkitFilter"in s&&s.webkitFilter!=="none"||"isolation"in s&&s.isolation==="isolate"||D1.test(s.willChange)||s.webkitOverflowScrolling==="touch")}function mp(l){let s=l.length;for(;s--;){const r=l[s];if(ze(r,"Missing node"),k1(r))return r}return null}function hp(l){return l&&Number(getComputedStyle(l).zIndex)||0}function pp(l){const s=[];for(;l;)s.push(l),l=bg(l);return s}function bg(l){const{parentNode:s}=l;return s&&s instanceof ShadowRoot?s.host:s}const Sg=1,Ng=2,jg=4,Cg=8,R1=T1()==="coarse";let jn=[],Il=!1,Ba=new Map,Io=new Map;const oi=new Set;function U1(l,s,r,c,d){var m;const{ownerDocument:h}=s,p={direction:r,element:s,hitAreaMargins:c,setResizeHandlerState:d},y=(m=Ba.get(h))!==null&&m!==void 0?m:0;return Ba.set(h,y+1),oi.add(p),Ro(),function(){var E;Io.delete(l),oi.delete(p);const x=(E=Ba.get(h))!==null&&E!==void 0?E:1;if(Ba.set(h,x-1),Ro(),x===1&&Ba.delete(h),jn.includes(p)){const b=jn.indexOf(p);b>=0&&jn.splice(b,1),Po(),d("up",!0,null)}}}function B1(l){const{target:s}=l,{x:r,y:c}=Fo(l);Il=!0,Qc({target:s,x:r,y:c}),Ro(),jn.length>0&&(Uo("down",l),Po(),l.preventDefault(),Eg(s)||l.stopImmediatePropagation())}function vc(l){const{x:s,y:r}=Fo(l);if(Il&&l.type!=="pointerleave"&&l.buttons===0&&(Il=!1,Uo("up",l)),!Il){const{target:c}=l;Qc({target:c,x:s,y:r})}Uo("move",l),Po(),jn.length>0&&l.preventDefault()}function xc(l){const{target:s}=l,{x:r,y:c}=Fo(l);Io.clear(),Il=!1,jn.length>0&&(l.preventDefault(),Eg(s)||l.stopImmediatePropagation()),Uo("up",l),Qc({target:s,x:r,y:c}),Po(),Ro()}function Eg(l){let s=l;for(;s;){if(s.hasAttribute(it.resizeHandle))return!0;s=s.parentElement}return!1}function Qc({target:l,x:s,y:r}){jn.splice(0);let c=null;(l instanceof HTMLElement||l instanceof SVGElement)&&(c=l),oi.forEach(d=>{const{element:m,hitAreaMargins:h}=d,p=m.getBoundingClientRect(),{bottom:y,left:N,right:E,top:x}=p,b=R1?h.coarse:h.fine;if(s>=N-b&&s<=E+b&&r>=x-b&&r<=y+b){if(c!==null&&document.contains(c)&&m!==c&&!m.contains(c)&&!c.contains(m)&&A1(c,m)>0){let O=c,k=!1;for(;O&&!O.contains(m);){if(O1(O.getBoundingClientRect(),p)){k=!0;break}O=O.parentElement}if(k)return}jn.push(d)}})}function bc(l,s){Io.set(l,s)}function Po(){let l=!1,s=!1;jn.forEach(c=>{const{direction:d}=c;d==="horizontal"?l=!0:s=!0});let r=0;Io.forEach(c=>{r|=c}),l&&s?yc("intersection",r):l?yc("horizontal",r):s?yc("vertical",r):z1()}let Sc;function Ro(){var l;(l=Sc)===null||l===void 0||l.abort(),Sc=new AbortController;const s={capture:!0,signal:Sc.signal};oi.size&&(Il?(jn.length>0&&Ba.forEach((r,c)=>{const{body:d}=c;r>0&&(d.addEventListener("contextmenu",xc,s),d.addEventListener("pointerleave",vc,s),d.addEventListener("pointermove",vc,s))}),Ba.forEach((r,c)=>{const{body:d}=c;d.addEventListener("pointerup",xc,s),d.addEventListener("pointercancel",xc,s)})):Ba.forEach((r,c)=>{const{body:d}=c;r>0&&(d.addEventListener("pointerdown",B1,s),d.addEventListener("pointermove",vc,s))}))}function Uo(l,s){oi.forEach(r=>{const{setResizeHandlerState:c}=r,d=jn.includes(r);c(l,d,s)})}function H1(){const[l,s]=v.useState(0);return v.useCallback(()=>s(r=>r+1),[])}function ze(l,s){if(!l)throw console.error(s),Error(s)}function rl(l,s,r=Kc){return l.toFixed(r)===s.toFixed(r)?0:l>s?1:-1}function ia(l,s,r=Kc){return rl(l,s,r)===0}function en(l,s,r){return rl(l,s,r)===0}function q1(l,s,r){if(l.length!==s.length)return!1;for(let c=0;c<l.length;c++){const d=l[c],m=s[c];if(!en(d,m,r))return!1}return!0}function Fl({panelConstraints:l,panelIndex:s,size:r}){const c=l[s];ze(c!=null,`Panel constraints not found for index ${s}`);let{collapsedSize:d=0,collapsible:m,maxSize:h=100,minSize:p=0}=c;if(rl(r,p)<0)if(m){const y=(d+p)/2;rl(r,y)<0?r=d:r=p}else r=p;return r=Math.min(h,r),r=parseFloat(r.toFixed(Kc)),r}function ni({delta:l,initialLayout:s,panelConstraints:r,pivotIndices:c,prevLayout:d,trigger:m}){if(en(l,0))return s;const h=[...s],[p,y]=c;ze(p!=null,"Invalid first pivot index"),ze(y!=null,"Invalid second pivot index");let N=0;if(m==="keyboard"){{const x=l<0?y:p,b=r[x];ze(b,`Panel constraints not found for index ${x}`);const{collapsedSize:_=0,collapsible:O,minSize:k=0}=b;if(O){const U=s[x];if(ze(U!=null,`Previous layout not found for panel index ${x}`),en(U,_)){const M=k-U;rl(M,Math.abs(l))>0&&(l=l<0?0-M:M)}}}{const x=l<0?p:y,b=r[x];ze(b,`No panel constraints found for index ${x}`);const{collapsedSize:_=0,collapsible:O,minSize:k=0}=b;if(O){const U=s[x];if(ze(U!=null,`Previous layout not found for panel index ${x}`),en(U,k)){const M=U-_;rl(M,Math.abs(l))>0&&(l=l<0?0-M:M)}}}}{const x=l<0?1:-1;let b=l<0?y:p,_=0;for(;;){const k=s[b];ze(k!=null,`Previous layout not found for panel index ${b}`);const M=Fl({panelConstraints:r,panelIndex:b,size:100})-k;if(_+=M,b+=x,b<0||b>=r.length)break}const O=Math.min(Math.abs(l),Math.abs(_));l=l<0?0-O:O}{let b=l<0?p:y;for(;b>=0&&b<r.length;){const _=Math.abs(l)-Math.abs(N),O=s[b];ze(O!=null,`Previous layout not found for panel index ${b}`);const k=O-_,U=Fl({panelConstraints:r,panelIndex:b,size:k});if(!en(O,U)&&(N+=O-U,h[b]=U,N.toFixed(3).localeCompare(Math.abs(l).toFixed(3),void 0,{numeric:!0})>=0))break;l<0?b--:b++}}if(q1(d,h))return d;{const x=l<0?y:p,b=s[x];ze(b!=null,`Previous layout not found for panel index ${x}`);const _=b+N,O=Fl({panelConstraints:r,panelIndex:x,size:_});if(h[x]=O,!en(O,_)){let k=_-O,M=l<0?y:p;for(;M>=0&&M<r.length;){const V=h[M];ze(V!=null,`Previous layout not found for panel index ${M}`);const G=V+k,q=Fl({panelConstraints:r,panelIndex:M,size:G});if(en(V,q)||(k-=q-V,h[M]=q),en(k,0))break;l>0?M--:M++}}}const E=h.reduce((x,b)=>b+x,0);return en(E,100)?h:d}function L1({layout:l,panelsArray:s,pivotIndices:r}){let c=0,d=100,m=0,h=0;const p=r[0];ze(p!=null,"No pivot index found"),s.forEach((x,b)=>{const{constraints:_}=x,{maxSize:O=100,minSize:k=0}=_;b===p?(c=k,d=O):(m+=k,h+=O)});const y=Math.min(d,100-m),N=Math.max(c,100-h),E=l[p];return{valueMax:y,valueMin:N,valueNow:E}}function ri(l,s=document){return Array.from(s.querySelectorAll(`[${it.resizeHandleId}][data-panel-group-id="${l}"]`))}function wg(l,s,r=document){const d=ri(l,r).findIndex(m=>m.getAttribute(it.resizeHandleId)===s);return d??null}function Mg(l,s,r){const c=wg(l,s,r);return c!=null?[c,c+1]:[-1,-1]}function Y1(l){return l instanceof HTMLElement?!0:typeof l=="object"&&l!==null&&"tagName"in l&&"getAttribute"in l}function zg(l,s=document){if(Y1(s)&&s.dataset.panelGroupId==l)return s;const r=s.querySelector(`[data-panel-group][data-panel-group-id="${l}"]`);return r||null}function er(l,s=document){const r=s.querySelector(`[${it.resizeHandleId}="${l}"]`);return r||null}function G1(l,s,r,c=document){var d,m,h,p;const y=er(s,c),N=ri(l,c),E=y?N.indexOf(y):-1,x=(d=(m=r[E])===null||m===void 0?void 0:m.id)!==null&&d!==void 0?d:null,b=(h=(p=r[E+1])===null||p===void 0?void 0:p.id)!==null&&h!==void 0?h:null;return[x,b]}function K1({committedValuesRef:l,eagerValuesRef:s,groupId:r,layout:c,panelDataArray:d,panelGroupElement:m,setLayout:h}){v.useRef({didWarnAboutMissingResizeHandle:!1}),ol(()=>{if(!m)return;const p=ri(r,m);for(let y=0;y<d.length-1;y++){const{valueMax:N,valueMin:E,valueNow:x}=L1({layout:c,panelsArray:d,pivotIndices:[y,y+1]}),b=p[y];if(b!=null){const _=d[y];ze(_,`No panel data found for index "${y}"`),b.setAttribute("aria-controls",_.id),b.setAttribute("aria-valuemax",""+Math.round(N)),b.setAttribute("aria-valuemin",""+Math.round(E)),b.setAttribute("aria-valuenow",x!=null?""+Math.round(x):"")}}return()=>{p.forEach((y,N)=>{y.removeAttribute("aria-controls"),y.removeAttribute("aria-valuemax"),y.removeAttribute("aria-valuemin"),y.removeAttribute("aria-valuenow")})}},[r,c,d,m]),v.useEffect(()=>{if(!m)return;const p=s.current;ze(p,"Eager values not found");const{panelDataArray:y}=p,N=zg(r,m);ze(N!=null,`No group found for id "${r}"`);const E=ri(r,m);ze(E,`No resize handles found for group id "${r}"`);const x=E.map(b=>{const _=b.getAttribute(it.resizeHandleId);ze(_,"Resize handle element has no handle id attribute");const[O,k]=G1(r,_,y,m);if(O==null||k==null)return()=>{};const U=M=>{if(!M.defaultPrevented)switch(M.key){case"Enter":{M.preventDefault();const V=y.findIndex(G=>G.id===O);if(V>=0){const G=y[V];ze(G,`No panel data found for index ${V}`);const q=c[V],{collapsedSize:B=0,collapsible:j,minSize:L=0}=G.constraints;if(q!=null&&j){const W=ni({delta:en(q,B)?L-B:B-q,initialLayout:c,panelConstraints:y.map(ee=>ee.constraints),pivotIndices:Mg(r,_,m),prevLayout:c,trigger:"keyboard"});c!==W&&h(W)}}break}}};return b.addEventListener("keydown",U),()=>{b.removeEventListener("keydown",U)}});return()=>{x.forEach(b=>b())}},[m,l,s,r,c,d,h])}function gp(l,s){if(l.length!==s.length)return!1;for(let r=0;r<l.length;r++)if(l[r]!==s[r])return!1;return!0}function Tg(l,s){const r=l==="horizontal",{x:c,y:d}=Fo(s);return r?c:d}function V1(l,s,r,c,d){const m=r==="horizontal",h=er(s,d);ze(h,`No resize handle element found for id "${s}"`);const p=h.getAttribute(it.groupId);ze(p,"Resize handle element has no group id attribute");let{initialCursorPosition:y}=c;const N=Tg(r,l),E=zg(p,d);ze(E,`No group element found for id "${p}"`);const x=E.getBoundingClientRect(),b=m?x.width:x.height;return(N-y)/b*100}function Q1(l,s,r,c,d,m){if(yg(l)){const h=r==="horizontal";let p=0;l.shiftKey?p=100:d!=null?p=d:p=10;let y=0;switch(l.key){case"ArrowDown":y=h?0:p;break;case"ArrowLeft":y=h?-p:0;break;case"ArrowRight":y=h?p:0;break;case"ArrowUp":y=h?0:-p;break;case"End":y=100;break;case"Home":y=-100;break}return y}else return c==null?0:V1(l,s,r,c,m)}function X1({panelDataArray:l}){const s=Array(l.length),r=l.map(m=>m.constraints);let c=0,d=100;for(let m=0;m<l.length;m++){const h=r[m];ze(h,`Panel constraints not found for index ${m}`);const{defaultSize:p}=h;p!=null&&(c++,s[m]=p,d-=p)}for(let m=0;m<l.length;m++){const h=r[m];ze(h,`Panel constraints not found for index ${m}`);const{defaultSize:p}=h;if(p!=null)continue;const y=l.length-c,N=d/y;c++,s[m]=N,d-=N}return s}function Jl(l,s,r){s.forEach((c,d)=>{const m=l[d];ze(m,`Panel data not found for index ${d}`);const{callbacks:h,constraints:p,id:y}=m,{collapsedSize:N=0,collapsible:E}=p,x=r[y];if(x==null||c!==x){r[y]=c;const{onCollapse:b,onExpand:_,onResize:O}=h;O&&O(c,x),E&&(b||_)&&(_&&(x==null||ia(x,N))&&!ia(c,N)&&_(),b&&(x==null||!ia(x,N))&&ia(c,N)&&b())}})}function Mo(l,s){if(l.length!==s.length)return!1;for(let r=0;r<l.length;r++)if(l[r]!=s[r])return!1;return!0}function Z1({defaultSize:l,dragState:s,layout:r,panelData:c,panelIndex:d,precision:m=3}){const h=r[d];let p;return h==null?p=l!=null?l.toFixed(m):"1":c.length===1?p="1":p=h.toFixed(m),{flexBasis:0,flexGrow:p,flexShrink:1,overflow:"hidden",pointerEvents:s!==null?"none":void 0}}function W1(l,s=10){let r=null;return(...d)=>{r!==null&&clearTimeout(r),r=setTimeout(()=>{l(...d)},s)}}function yp(l){try{if(typeof localStorage<"u")l.getItem=s=>localStorage.getItem(s),l.setItem=(s,r)=>{localStorage.setItem(s,r)};else throw new Error("localStorage not supported in this environment")}catch(s){console.error(s),l.getItem=()=>null,l.setItem=()=>{}}}function Og(l){return`react-resizable-panels:${l}`}function Ag(l){return l.map(s=>{const{constraints:r,id:c,idIsFromProps:d,order:m}=s;return d?c:m?`${m}:${JSON.stringify(r)}`:JSON.stringify(r)}).sort((s,r)=>s.localeCompare(r)).join(",")}function Dg(l,s){try{const r=Og(l),c=s.getItem(r);if(c){const d=JSON.parse(c);if(typeof d=="object"&&d!=null)return d}}catch{}return null}function J1(l,s,r){var c,d;const m=(c=Dg(l,r))!==null&&c!==void 0?c:{},h=Ag(s);return(d=m[h])!==null&&d!==void 0?d:null}function $1(l,s,r,c,d){var m;const h=Og(l),p=Ag(s),y=(m=Dg(l,d))!==null&&m!==void 0?m:{};y[p]={expandToSizes:Object.fromEntries(r.entries()),layout:c};try{d.setItem(h,JSON.stringify(y))}catch(N){console.error(N)}}function vp({layout:l,panelConstraints:s}){const r=[...l],c=r.reduce((m,h)=>m+h,0);if(r.length!==s.length)throw Error(`Invalid ${s.length} panel layout: ${r.map(m=>`${m}%`).join(", ")}`);if(!en(c,100)&&r.length>0)for(let m=0;m<s.length;m++){const h=r[m];ze(h!=null,`No layout data found for index ${m}`);const p=100/c*h;r[m]=p}let d=0;for(let m=0;m<s.length;m++){const h=r[m];ze(h!=null,`No layout data found for index ${m}`);const p=Fl({panelConstraints:s,panelIndex:m,size:h});h!=p&&(d+=h-p,r[m]=p)}if(!en(d,0))for(let m=0;m<s.length;m++){const h=r[m];ze(h!=null,`No layout data found for index ${m}`);const p=h+d,y=Fl({panelConstraints:s,panelIndex:m,size:p});if(h!==y&&(d-=y-h,r[m]=y,en(d,0)))break}return r}const F1=100,ai={getItem:l=>(yp(ai),ai.getItem(l)),setItem:(l,s)=>{yp(ai),ai.setItem(l,s)}},xp={};function _g({autoSaveId:l=null,children:s,className:r="",direction:c,forwardedRef:d,id:m=null,onLayout:h=null,keyboardResizeBy:p=null,storage:y=ai,style:N,tagName:E="div",...x}){const b=Vc(m),_=v.useRef(null),[O,k]=v.useState(null),[U,M]=v.useState([]),V=H1(),G=v.useRef({}),q=v.useRef(new Map),B=v.useRef(0),j=v.useRef({autoSaveId:l,direction:c,dragState:O,id:b,keyboardResizeBy:p,onLayout:h,storage:y}),L=v.useRef({layout:U,panelDataArray:[],panelDataArrayChanged:!1});v.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),v.useImperativeHandle(d,()=>({getId:()=>j.current.id,getLayout:()=>{const{layout:X}=L.current;return X},setLayout:X=>{const{onLayout:F}=j.current,{layout:ae,panelDataArray:I}=L.current,ne=vp({layout:X,panelConstraints:I.map(ye=>ye.constraints)});gp(ae,ne)||(M(ne),L.current.layout=ne,F&&F(ne),Jl(I,ne,G.current))}}),[]),ol(()=>{j.current.autoSaveId=l,j.current.direction=c,j.current.dragState=O,j.current.id=b,j.current.onLayout=h,j.current.storage=y}),K1({committedValuesRef:j,eagerValuesRef:L,groupId:b,layout:U,panelDataArray:L.current.panelDataArray,setLayout:M,panelGroupElement:_.current}),v.useEffect(()=>{const{panelDataArray:X}=L.current;if(l){if(U.length===0||U.length!==X.length)return;let F=xp[l];F==null&&(F=W1($1,F1),xp[l]=F);const ae=[...X],I=new Map(q.current);F(l,ae,I,U,y)}},[l,U,y]),v.useEffect(()=>{});const W=v.useCallback(X=>{const{onLayout:F}=j.current,{layout:ae,panelDataArray:I}=L.current;if(X.constraints.collapsible){const ne=I.map(ht=>ht.constraints),{collapsedSize:ye=0,panelSize:Oe,pivotIndices:Ge}=sl(I,X,ae);if(ze(Oe!=null,`Panel size not found for panel "${X.id}"`),!ia(Oe,ye)){q.current.set(X.id,Oe);const pt=$l(I,X)===I.length-1?Oe-ye:ye-Oe,Ve=ni({delta:pt,initialLayout:ae,panelConstraints:ne,pivotIndices:Ge,prevLayout:ae,trigger:"imperative-api"});Mo(ae,Ve)||(M(Ve),L.current.layout=Ve,F&&F(Ve),Jl(I,Ve,G.current))}}},[]),ee=v.useCallback((X,F)=>{const{onLayout:ae}=j.current,{layout:I,panelDataArray:ne}=L.current;if(X.constraints.collapsible){const ye=ne.map(et=>et.constraints),{collapsedSize:Oe=0,panelSize:Ge=0,minSize:ht=0,pivotIndices:pt}=sl(ne,X,I),Ve=F??ht;if(ia(Ge,Oe)){const et=q.current.get(X.id),At=et!=null&&et>=Ve?et:Ve,Un=$l(ne,X)===ne.length-1?Ge-At:At-Ge,Ne=ni({delta:Un,initialLayout:I,panelConstraints:ye,pivotIndices:pt,prevLayout:I,trigger:"imperative-api"});Mo(I,Ne)||(M(Ne),L.current.layout=Ne,ae&&ae(Ne),Jl(ne,Ne,G.current))}}},[]),he=v.useCallback(X=>{const{layout:F,panelDataArray:ae}=L.current,{panelSize:I}=sl(ae,X,F);return ze(I!=null,`Panel size not found for panel "${X.id}"`),I},[]),be=v.useCallback((X,F)=>{const{panelDataArray:ae}=L.current,I=$l(ae,X);return Z1({defaultSize:F,dragState:O,layout:U,panelData:ae,panelIndex:I})},[O,U]),re=v.useCallback(X=>{const{layout:F,panelDataArray:ae}=L.current,{collapsedSize:I=0,collapsible:ne,panelSize:ye}=sl(ae,X,F);return ze(ye!=null,`Panel size not found for panel "${X.id}"`),ne===!0&&ia(ye,I)},[]),Ye=v.useCallback(X=>{const{layout:F,panelDataArray:ae}=L.current,{collapsedSize:I=0,collapsible:ne,panelSize:ye}=sl(ae,X,F);return ze(ye!=null,`Panel size not found for panel "${X.id}"`),!ne||rl(ye,I)>0},[]),$=v.useCallback(X=>{const{panelDataArray:F}=L.current;F.push(X),F.sort((ae,I)=>{const ne=ae.order,ye=I.order;return ne==null&&ye==null?0:ne==null?-1:ye==null?1:ne-ye}),L.current.panelDataArrayChanged=!0,V()},[V]);ol(()=>{if(L.current.panelDataArrayChanged){L.current.panelDataArrayChanged=!1;const{autoSaveId:X,onLayout:F,storage:ae}=j.current,{layout:I,panelDataArray:ne}=L.current;let ye=null;if(X){const Ge=J1(X,ne,ae);Ge&&(q.current=new Map(Object.entries(Ge.expandToSizes)),ye=Ge.layout)}ye==null&&(ye=X1({panelDataArray:ne}));const Oe=vp({layout:ye,panelConstraints:ne.map(Ge=>Ge.constraints)});gp(I,Oe)||(M(Oe),L.current.layout=Oe,F&&F(Oe),Jl(ne,Oe,G.current))}}),ol(()=>{const X=L.current;return()=>{X.layout=[]}},[]);const ie=v.useCallback(X=>{let F=!1;const ae=_.current;return ae&&window.getComputedStyle(ae,null).getPropertyValue("direction")==="rtl"&&(F=!0),function(ne){ne.preventDefault();const ye=_.current;if(!ye)return()=>null;const{direction:Oe,dragState:Ge,id:ht,keyboardResizeBy:pt,onLayout:Ve}=j.current,{layout:et,panelDataArray:At}=L.current,{initialLayout:Gt}=Ge??{},Un=Mg(ht,X,ye);let Ne=Q1(ne,X,Oe,Ge,pt,ye);const Kt=Oe==="horizontal";Kt&&F&&(Ne=-Ne);const En=At.map(Bn=>Bn.constraints),Vt=ni({delta:Ne,initialLayout:Gt??et,panelConstraints:En,pivotIndices:Un,prevLayout:et,trigger:yg(ne)?"keyboard":"mouse-or-touch"}),ca=!Mo(et,Vt);(vg(ne)||xg(ne))&&B.current!=Ne&&(B.current=Ne,!ca&&Ne!==0?Kt?bc(X,Ne<0?Sg:Ng):bc(X,Ne<0?jg:Cg):bc(X,0)),ca&&(M(Vt),L.current.layout=Vt,Ve&&Ve(Vt),Jl(At,Vt,G.current))}},[]),D=v.useCallback((X,F)=>{const{onLayout:ae}=j.current,{layout:I,panelDataArray:ne}=L.current,ye=ne.map(et=>et.constraints),{panelSize:Oe,pivotIndices:Ge}=sl(ne,X,I);ze(Oe!=null,`Panel size not found for panel "${X.id}"`);const pt=$l(ne,X)===ne.length-1?Oe-F:F-Oe,Ve=ni({delta:pt,initialLayout:I,panelConstraints:ye,pivotIndices:Ge,prevLayout:I,trigger:"imperative-api"});Mo(I,Ve)||(M(Ve),L.current.layout=Ve,ae&&ae(Ve),Jl(ne,Ve,G.current))},[]),J=v.useCallback((X,F)=>{const{layout:ae,panelDataArray:I}=L.current,{collapsedSize:ne=0,collapsible:ye}=F,{collapsedSize:Oe=0,collapsible:Ge,maxSize:ht=100,minSize:pt=0}=X.constraints,{panelSize:Ve}=sl(I,X,ae);Ve!=null&&(ye&&Ge&&ia(Ve,ne)?ia(ne,Oe)||D(X,Oe):Ve<pt?D(X,pt):Ve>ht&&D(X,ht))},[D]),le=v.useCallback((X,F)=>{const{direction:ae}=j.current,{layout:I}=L.current;if(!_.current)return;const ne=er(X,_.current);ze(ne,`Drag handle element not found for id "${X}"`);const ye=Tg(ae,F);k({dragHandleId:X,dragHandleRect:ne.getBoundingClientRect(),initialCursorPosition:ye,initialLayout:I})},[]),ve=v.useCallback(()=>{k(null)},[]),xe=v.useCallback(X=>{const{panelDataArray:F}=L.current,ae=$l(F,X);ae>=0&&(F.splice(ae,1),delete G.current[X.id],L.current.panelDataArrayChanged=!0,V())},[V]),Te=v.useMemo(()=>({collapsePanel:W,direction:c,dragState:O,expandPanel:ee,getPanelSize:he,getPanelStyle:be,groupId:b,isPanelCollapsed:re,isPanelExpanded:Ye,reevaluatePanelConstraints:J,registerPanel:$,registerResizeHandle:ie,resizePanel:D,startDragging:le,stopDragging:ve,unregisterPanel:xe,panelGroupElement:_.current}),[W,O,c,ee,he,be,b,re,Ye,J,$,ie,D,le,ve,xe]),de={display:"flex",flexDirection:c==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return v.createElement($o.Provider,{value:Te},v.createElement(E,{...x,children:s,className:r,id:m,ref:_,style:{...de,...N},[it.group]:"",[it.groupDirection]:c,[it.groupId]:b}))}const Xc=v.forwardRef((l,s)=>v.createElement(_g,{...l,forwardedRef:s}));_g.displayName="PanelGroup";Xc.displayName="forwardRef(PanelGroup)";function $l(l,s){return l.findIndex(r=>r===s||r.id===s.id)}function sl(l,s,r){const c=$l(l,s),m=c===l.length-1?[c-1,c]:[c,c+1],h=r[c];return{...s.constraints,panelSize:h,pivotIndices:m}}function I1({disabled:l,handleId:s,resizeHandler:r,panelGroupElement:c}){v.useEffect(()=>{if(l||r==null||c==null)return;const d=er(s,c);if(d==null)return;const m=h=>{if(!h.defaultPrevented)switch(h.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{h.preventDefault(),r(h);break}case"F6":{h.preventDefault();const p=d.getAttribute(it.groupId);ze(p,`No group element found for id "${p}"`);const y=ri(p,c),N=wg(p,s,c);ze(N!==null,`No resize element found for id "${s}"`);const E=h.shiftKey?N>0?N-1:y.length-1:N+1<y.length?N+1:0;y[E].focus();break}}};return d.addEventListener("keydown",m),()=>{d.removeEventListener("keydown",m)}},[c,l,s,r])}function Zc({children:l=null,className:s="",disabled:r=!1,hitAreaMargins:c,id:d,onBlur:m,onClick:h,onDragging:p,onFocus:y,onPointerDown:N,onPointerUp:E,style:x={},tabIndex:b=0,tagName:_="div",...O}){var k,U;const M=v.useRef(null),V=v.useRef({onClick:h,onDragging:p,onPointerDown:N,onPointerUp:E});v.useEffect(()=>{V.current.onClick=h,V.current.onDragging=p,V.current.onPointerDown=N,V.current.onPointerUp=E});const G=v.useContext($o);if(G===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:q,groupId:B,registerResizeHandle:j,startDragging:L,stopDragging:W,panelGroupElement:ee}=G,he=Vc(d),[be,re]=v.useState("inactive"),[Ye,$]=v.useState(!1),[ie,D]=v.useState(null),J=v.useRef({state:be});ol(()=>{J.current.state=be}),v.useEffect(()=>{if(r)D(null);else{const Te=j(he);D(()=>Te)}},[r,he,j]);const le=(k=c?.coarse)!==null&&k!==void 0?k:15,ve=(U=c?.fine)!==null&&U!==void 0?U:5;v.useEffect(()=>{if(r||ie==null)return;const Te=M.current;ze(Te,"Element ref not attached");let de=!1;return U1(he,Te,q,{coarse:le,fine:ve},(F,ae,I)=>{if(!ae){re("inactive");return}switch(F){case"down":{re("drag"),de=!1,ze(I,'Expected event to be defined for "down" action'),L(he,I);const{onDragging:ne,onPointerDown:ye}=V.current;ne?.(!0),ye?.();break}case"move":{const{state:ne}=J.current;de=!0,ne!=="drag"&&re("hover"),ze(I,'Expected event to be defined for "move" action'),ie(I);break}case"up":{re("hover"),W();const{onClick:ne,onDragging:ye,onPointerUp:Oe}=V.current;ye?.(!1),Oe?.(),de||ne?.();break}}})},[le,q,r,ve,j,he,ie,L,W]),I1({disabled:r,handleId:he,resizeHandler:ie,panelGroupElement:ee});const xe={touchAction:"none",userSelect:"none"};return v.createElement(_,{...O,children:l,className:s,id:d,onBlur:()=>{$(!1),m?.()},onFocus:()=>{$(!0),y?.()},ref:M,role:"separator",style:{...xe,...x},tabIndex:b,[it.groupDirection]:q,[it.groupId]:B,[it.resizeHandle]:"",[it.resizeHandleActive]:be==="drag"?"pointer":Ye?"keyboard":void 0,[it.resizeHandleEnabled]:!r,[it.resizeHandleId]:he,[it.resizeHandleState]:be})}Zc.displayName="PanelResizeHandle";const ts=v.forwardRef(({className:l,children:s,...r},c)=>o.jsxs(Yp,{ref:c,className:Q("relative overflow-hidden",l),...r,children:[o.jsx(Ux,{className:"h-full w-full rounded-[inherit]",children:s}),o.jsx(kg,{}),o.jsx(Bx,{})]}));ts.displayName=Yp.displayName;const kg=v.forwardRef(({className:l,orientation:s="vertical",...r},c)=>o.jsx(Gp,{ref:c,orientation:s,className:Q("flex touch-none select-none transition-colors",s==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",s==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",l),...r,children:o.jsx(Hx,{className:"relative flex-1 rounded-full bg-border"})}));kg.displayName=Gp.displayName;function P1(l){const s={provider:"unknown",endpoint:"unknown",timestamp:new Date,raw:l},r=l.match(/error-api-provider-([^-]+)-/);r&&(s.provider=r[1]);const c=l.match(/-api-([a-z_]+(?:-[a-z_]+)*)-\d{4}-\d{2}-\d{2}T/i);c&&(s.endpoint=c[1].replace(/-/g,"/"));const d=l.match(/(\d{4}-\d{2}-\d{2}T\d{6})/);if(d){const m=d[1],h=`${m.slice(0,10)}T${m.slice(11,13)}:${m.slice(13,15)}:${m.slice(15,17)}`;s.timestamp=new Date(h)}return s}function eN(l){const s={version:"",url:"",method:"",timestamp:"",statusCode:0,statusText:"",requestHeaders:{},requestBody:"",responseHeaders:{},responseBody:"",provider:"",endpoint:"",isClientError:!1,isServerError:!1,errorType:"unknown"},r=l.split(/^===\s*(.+?)\s*===$/m);let c="";for(let d=0;d<r.length;d++){const m=r[d].trim();if(m==="REQUEST INFO"){c="request_info";continue}else if(m==="HEADERS"){c="headers";continue}else if(m==="REQUEST BODY"){c="request_body";continue}else if(m==="RESPONSE"){c="response";continue}switch(c){case"request_info":tN(m,s);break;case"headers":s.requestHeaders=nN(m);break;case"request_body":s.requestBody=m;break;case"response":aN(m,s);break}}return lN(s),s}function tN(l,s){const r=l.split(`
|
|
11
|
+
`);for(const c of r){const[d,...m]=c.split(":"),h=m.join(":").trim();switch(d?.trim()?.toLowerCase()){case"version":s.version=h;break;case"url":s.url=h;break;case"method":s.method=h;break;case"timestamp":s.timestamp=h;break}}}function nN(l){const s={},r=l.split(`
|
|
12
|
+
`);for(const c of r){const d=c.indexOf(":");if(d>0){const m=c.slice(0,d).trim(),h=c.slice(d+1).trim();m&&(s[m]=h)}}return s}function aN(l,s){const r=l.split(`
|
|
13
|
+
`);let c=!1;const d=[];for(const m of r){if(m.startsWith("Status:")){const p=m.replace("Status:","").trim().split(/\s+/);s.statusCode=parseInt(p[0],10)||0,s.statusText=p.slice(1).join(" ")||sN(s.statusCode);continue}if(m.trim()===""&&!c){c=!0;continue}if(c)d.push(m);else{const h=m.indexOf(":");if(h>0){const p=m.slice(0,h).trim(),y=m.slice(h+1).trim();p&&(s.responseHeaders[p]=y)}}}s.responseBody=d.join(`
|
|
14
|
+
`).trim()}function lN(l){const s=l.url.match(/\/api\/provider\/([^/]+)/);s&&(l.provider=s[1]);const r=l.url.match(/\/api\/provider\/[^/]+\/api\/(.+)/);r&&(l.endpoint=r[1]),l.isClientError=l.statusCode>=400&&l.statusCode<500,l.isServerError=l.statusCode>=500,l.statusCode===429?l.errorType="rate_limit":l.statusCode===401||l.statusCode===403?l.errorType="auth":l.statusCode===404?l.errorType="not_found":l.statusCode>=500?l.errorType="server":(l.statusCode===408||l.statusCode===504)&&(l.errorType="timeout")}function sN(l){return{400:"Bad Request",401:"Unauthorized",403:"Forbidden",404:"Not Found",408:"Request Timeout",429:"Too Many Requests",500:"Internal Server Error",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout"}[l]||""}function iN(l){const s=Date.now(),r=l*1e3,c=s-r,d=Math.floor(c/1e3),m=Math.floor(d/60),h=Math.floor(m/60),p=Math.floor(h/24);return d<60?"just now":m<60?`${m}m ago`:h<24?`${h}h ago`:p<7?`${p}d ago`:new Date(r).toLocaleDateString("en-US",{month:"short",day:"numeric"})}function oN(l){return l<1024?`${l} B`:l<1024*1024?`${(l/1024).toFixed(1)} KB`:`${(l/(1024*1024)).toFixed(1)} MB`}function rN(l){return l>=500?"text-red-500":l===429?"text-orange-500":l>=400?"text-yellow-500":"text-gray-500"}function uN(l){return{rate_limit:"Rate Limited",auth:"Auth Error",not_found:"Not Found",server:"Server Error",timeout:"Timeout",unknown:"Error"}[l]||"Error"}function cN({name:l,size:s,modified:r,isSelected:c,onClick:d}){const m=v.useMemo(()=>P1(l),[l]);return o.jsxs("button",{onClick:d,className:Q("w-full px-3 py-2.5 flex items-start gap-3 text-left transition-colors","hover:bg-muted/40 border-l-[3px]",c?"bg-muted/50 border-l-amber-500":"border-l-transparent"),children:[o.jsx(Gc,{provider:m.provider,size:24,withBackground:!0,className:"shrink-0 mt-0.5"}),o.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[o.jsxs("div",{className:"flex flex-col gap-0.5",children:[o.jsxs("div",{className:"flex items-center justify-between gap-2",children:[o.jsx("span",{className:"text-xs font-semibold text-foreground truncate",children:m.provider}),o.jsx("span",{className:Q("text-[9px] px-1 rounded border",c?"bg-amber-500/10 text-amber-600 border-amber-500/20":"bg-muted border-border text-muted-foreground"),children:"LOG"})]}),o.jsx("span",{className:"text-[11px] text-muted-foreground truncate font-medium",title:m.endpoint,children:m.endpoint})]}),o.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-muted-foreground/80 mt-1",children:[o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(lb,{className:"w-3 h-3"}),iN(r)]}),o.jsxs("span",{className:"flex items-center gap-1",children:[o.jsx(og,{className:"w-3 h-3"}),oN(s)]})]})]})]})}function bp({value:l,className:s,variant:r="outline",size:c="icon",label:d="Copy to clipboard"}){const[m,h]=v.useState(!1),p=()=>{navigator.clipboard.writeText(l),h(!0),setTimeout(()=>h(!1),2e3)};return o.jsx(Uc,{children:o.jsxs(Zo,{children:[o.jsx(Wo,{asChild:!0,children:o.jsxs(bt,{size:c,variant:r,className:Q("relative z-10 text-muted-foreground hover:text-foreground",s),onClick:y=>{y.stopPropagation(),p()},children:[m?o.jsx(es,{className:"h-3.5 w-3.5 text-green-500"}):o.jsx(_o,{className:"h-3.5 w-3.5"}),o.jsx("span",{className:"sr-only",children:d})]})}),o.jsx(Jo,{children:o.jsx("p",{children:m?"Copied!":d})})]})})}function Ps({active:l,onClick:s,children:r,icon:c}){return o.jsxs("button",{onClick:s,className:Q("px-2.5 py-1.5 text-xs font-medium rounded transition-colors flex items-center gap-1.5",l?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"),children:[c&&o.jsx(c,{className:"w-3.5 h-3.5"}),r]})}function Rg({code:l}){const s=rN(l);return o.jsx("span",{className:Q("inline-flex items-center justify-center min-w-[36px] px-2 py-0.5 rounded text-xs font-bold","bg-current/10 border border-current/20",s),children:l})}function dN({parsed:l}){return o.jsxs("div",{className:"p-4 space-y-4",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx(Rg,{code:l.statusCode}),o.jsx("span",{className:"text-sm font-medium",children:l.statusText}),o.jsx("span",{className:"text-xs text-muted-foreground px-2 py-0.5 rounded bg-muted/50",children:uN(l.errorType)})]}),o.jsxs("div",{className:"grid grid-cols-4 gap-3 text-xs",children:[o.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[o.jsx("div",{className:"text-muted-foreground mb-1",children:"Method"}),o.jsx("div",{className:"font-medium",children:l.method||"N/A"})]}),o.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[o.jsx("div",{className:"text-muted-foreground mb-1",children:"Provider"}),o.jsx("div",{className:"font-medium",children:l.provider||"N/A"})]}),o.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[o.jsx("div",{className:"text-muted-foreground mb-1",children:"Version"}),o.jsx("div",{className:"font-medium",children:l.version||"N/A"})]}),o.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[o.jsx("div",{className:"text-muted-foreground mb-1",children:"Endpoint"}),o.jsx("div",{className:"font-medium truncate",title:l.endpoint,children:l.endpoint||"N/A"})]})]}),o.jsxs("div",{className:"text-xs",children:[o.jsx("div",{className:"text-muted-foreground mb-1.5",children:"URL"}),o.jsx("div",{className:"font-mono p-2.5 rounded bg-muted/30 border border-border/50 break-all leading-relaxed",children:l.url||"N/A"})]}),o.jsxs("div",{className:"text-xs",children:[o.jsx("div",{className:"text-muted-foreground mb-1.5",children:"Timestamp"}),o.jsx("div",{className:"font-mono",children:l.timestamp||"N/A"})]}),l.errorType!=="unknown"&&o.jsxs("div",{className:"flex items-start gap-3 p-3 rounded bg-blue-500/10 border border-blue-500/20 text-xs",children:[o.jsx(Vo,{className:"w-4 h-4 mt-0.5 text-blue-500 shrink-0"}),o.jsxs("div",{className:"text-blue-500/90 leading-relaxed",children:[l.errorType==="rate_limit"&&"Rate limited. Consider using multiple accounts or reducing request frequency.",l.errorType==="auth"&&"Authentication failed. Check credentials or re-authenticate with the provider.",l.errorType==="not_found"&&"Endpoint not found. This endpoint may not exist on this provider.",l.errorType==="server"&&"Server error from upstream. Retry or check provider status.",l.errorType==="timeout"&&"Request timed out. Check network or increase timeout settings."]})]})]})}function fN({headers:l}){const s=Object.entries(l);return s.length===0?o.jsx("div",{className:"p-4 text-xs text-muted-foreground",children:"No headers available"}):o.jsx(ts,{className:"h-full",children:o.jsx("div",{className:"p-4 space-y-1",children:s.map(([r,c])=>o.jsxs("div",{className:"flex gap-3 text-xs font-mono py-1.5 border-b border-border/30 last:border-0",children:[o.jsxs("span",{className:"text-muted-foreground shrink-0 min-w-[140px]",children:[r,":"]}),o.jsx("span",{className:"break-all",children:c})]},r))})})}function Sp({content:l,label:s}){if(!l||l.trim()==="")return o.jsxs("div",{className:"p-4 text-xs text-muted-foreground",children:["No ",s.toLowerCase()," body"]});let r=l,c=!1;try{const d=JSON.parse(l);r=JSON.stringify(d,null,2),c=!0}catch{}return o.jsx(ts,{className:"h-full",children:o.jsx("pre",{className:Q("p-4 text-xs font-mono whitespace-pre-wrap break-all leading-relaxed",c?"text-emerald-700 dark:text-green-400":"text-zinc-700 dark:text-muted-foreground"),children:r})})}function mN({content:l}){return o.jsx(ts,{className:"h-full",children:o.jsx("pre",{className:"p-4 text-xs font-mono text-zinc-700 dark:text-muted-foreground whitespace-pre-wrap break-all leading-relaxed",children:l})})}function hN({name:l,absolutePath:s}){const[r,c]=v.useState("overview"),{data:d,isLoading:m,error:h}=y1(l),p=v.useMemo(()=>d?eN(d):null,[d]);return l?m?o.jsxs("div",{className:"flex-1 p-6 space-y-3",children:[o.jsx(Le,{className:"h-5 w-full"}),o.jsx(Le,{className:"h-5 w-3/4"}),o.jsx(Le,{className:"h-5 w-5/6"}),o.jsx(Le,{className:"h-5 w-2/3"})]}):h||!d||!p?o.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:o.jsx("p",{className:"text-sm",children:"Failed to load log content"})}):o.jsxs("div",{className:"flex-1 flex flex-col min-w-0 h-full",children:[o.jsxs("div",{className:"px-4 py-3 border-b border-border bg-muted/30 flex items-center justify-between gap-3 shrink-0",children:[o.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[o.jsx(Rg,{code:p.statusCode}),o.jsxs("span",{className:"text-xs font-semibold truncate text-foreground",children:[p.provider,"/",p.endpoint||"unknown"]}),l&&o.jsx(bp,{value:s||l,label:"Copy absolute path",size:"icon-sm",className:"ml-1 text-muted-foreground hover:text-foreground opacity-50 hover:opacity-100 transition-opacity"})]}),o.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[d&&o.jsx(bp,{value:d,label:"Copy raw log content",variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-foreground"}),o.jsx("span",{className:"text-[10px] text-muted-foreground font-mono bg-muted px-1.5 py-0.5 rounded border border-border/50",children:p.method})]})]}),o.jsxs("div",{className:"px-3 py-2 border-b border-border flex items-center gap-1 bg-muted/10 shrink-0 overflow-x-auto",children:[o.jsx(Ps,{active:r==="overview",onClick:()=>c("overview"),icon:Vo,children:"Overview"}),o.jsx(Ps,{active:r==="headers",onClick:()=>c("headers"),icon:ib,children:"Headers"}),o.jsx(Ps,{active:r==="request",onClick:()=>c("request"),icon:ob,children:"Request"}),o.jsx(Ps,{active:r==="response",onClick:()=>c("response"),icon:rb,children:"Response"}),o.jsx(Ps,{active:r==="raw",onClick:()=>c("raw"),icon:og,children:"Raw"})]}),o.jsxs("div",{className:"flex-1 overflow-hidden bg-card/30",children:[r==="overview"&&o.jsx(dN,{parsed:p}),r==="headers"&&o.jsx(fN,{headers:p.requestHeaders}),r==="request"&&o.jsx(Sp,{content:p.requestBody,label:"Request"}),r==="response"&&o.jsx(Sp,{content:p.responseBody,label:"Response"}),r==="raw"&&o.jsx(mN,{content:d})]})]}):o.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:o.jsxs("div",{className:"text-center space-y-3",children:[o.jsx(sb,{className:"w-10 h-10 mx-auto opacity-40"}),o.jsx("p",{className:"text-sm",children:"Select a log to view details"})]})})}function pN(){const{data:l,isLoading:s}=f1(),{data:r,isLoading:c,error:d}=g1(l?.running??!1),[m,h]=v.useState(500),[p,y]=v.useState(!1),N=v.useRef(null),E=v.useRef(null),x=()=>{E.current&&(clearInterval(E.current),E.current=null)};v.useEffect(()=>{if(!p)return;const G=B=>{const j=N.current;if(!j)return;const W=j.getBoundingClientRect().top+window.scrollY,ee=B.pageY-W;h(Math.max(300,ee));const be=window.innerHeight-B.clientY,re=15;x(),be<50?E.current=setInterval(()=>{window.scrollBy(0,re)},16):B.clientY<50&&(E.current=setInterval(()=>{window.scrollBy(0,-re)},16))},q=()=>{y(!1),x(),document.body.style.cursor="default",document.body.style.userSelect="auto"};return document.addEventListener("mousemove",G),document.addEventListener("mouseup",q),document.body.style.cursor="row-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",G),document.removeEventListener("mouseup",q),document.body.style.cursor="default",document.body.style.userSelect="auto",x()}},[p]);const b=G=>{G.preventDefault(),y(!0)},_=v.useMemo(()=>r?.[0]?.name??null,[r]),[O,k]=v.useState(null),U=O??_,M=v.useMemo(()=>!U||!r?void 0:r.find(q=>q.name===U)?.absolutePath,[U,r]);if(s||!l?.running)return null;if(c)return o.jsxs("div",{className:"rounded-xl border border-border overflow-hidden font-mono text-sm bg-card/50 dark:bg-zinc-900/60 backdrop-blur-sm h-[500px]",children:[o.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[o.jsx(Le,{className:"h-4 w-32"}),o.jsx(Le,{className:"h-4 w-20"})]}),o.jsx("div",{className:"p-4 space-y-3",children:[1,2,3].map(G=>o.jsx(Le,{className:"h-12 w-full rounded-lg"},G))})]});if(!r||r.length===0)return null;const V=r.length;return o.jsxs("div",{ref:N,className:"rounded-xl border border-border overflow-hidden font-mono text-sm text-foreground bg-card/50 dark:bg-zinc-900/60 backdrop-blur-sm flex flex-col shadow-sm transition-[height] duration-0 ease-linear relative group/container",style:{height:m},children:[o.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border bg-gradient-to-r from-amber-500/10 via-transparent to-transparent dark:from-amber-500/15 shrink-0",children:[o.jsxs("div",{className:"flex items-center gap-2.5",children:[o.jsx(Dc,{className:"w-4 h-4 text-amber-500"}),o.jsx("span",{className:"text-sm font-semibold tracking-tight",children:"Error Logs"}),o.jsxs("span",{className:"text-xs text-muted-foreground ml-1",children:[V," failed request",V!==1?"s":""]})]}),o.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[o.jsx(ub,{className:"w-3.5 h-3.5"}),o.jsx("span",{children:"CLIProxy Diagnostics"})]})]}),o.jsx("div",{className:"flex-1 min-h-0",children:o.jsxs(Xc,{direction:"horizontal",children:[o.jsx(ii,{defaultSize:30,minSize:20,maxSize:50,className:"flex flex-col min-w-0",children:o.jsxs(ts,{className:"h-full",children:[o.jsx("div",{className:"divide-y divide-border/50",children:r.slice(0,50).map(G=>o.jsx(cN,{name:G.name,size:G.size,modified:G.modified,isSelected:U===G.name,onClick:()=>k(G.name)},G.name))}),r.length>50&&o.jsxs("div",{className:"px-3 py-3 text-center text-[10px] text-muted-foreground border-t border-border/50",children:["Showing 50 of ",r.length," logs"]})]})}),o.jsxs(Zc,{className:"w-[1px] bg-border hover:bg-primary/50 transition-colors flex items-center justify-center group relative z-10 w-2 -ml-1 flex items-center justify-center outline-none",children:[o.jsx("div",{className:"w-[1px] h-full bg-border group-hover:bg-primary/50 transition-colors"}),o.jsx("div",{className:"absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-4 h-8 rounded-sm flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity bg-muted border border-border",children:o.jsx(Ko,{className:"h-4 w-4 text-muted-foreground"})})]}),o.jsx(ii,{className:"flex flex-col min-w-0 bg-background/50",children:o.jsx(hN,{name:U,absolutePath:M})})]})}),d?o.jsx("div",{className:"px-4 py-2 border-t border-border text-xs text-destructive bg-destructive/5 shrink-0",children:d.message}):o.jsx("div",{className:"h-2 bg-border/10 border-t border-border/30 hover:bg-primary/10 transition-colors cursor-row-resize flex items-center justify-center group/handle shrink-0",onMouseDown:b,children:o.jsx(cb,{className:"w-8 h-3 text-border group-hover:text-primary/50 transition-colors"})})]})}const gN=Ho("relative w-full rounded-lg border px-4 py-3 text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground [&>svg~*]:pl-7",{variants:{variant:{default:"bg-background text-foreground",destructive:"border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",warning:"border-yellow-200 bg-yellow-50 text-yellow-900 dark:border-yellow-900/50 dark:bg-yellow-900/20 dark:text-yellow-200 [&>svg]:text-yellow-600 dark:[&>svg]:text-yellow-500",info:"border-blue-200 bg-blue-50 text-blue-900 dark:border-blue-900/50 dark:bg-blue-900/20 dark:text-blue-200 [&>svg]:text-blue-600 dark:[&>svg]:text-blue-500",success:"border-green-200 bg-green-50 text-green-900 dark:border-green-900/50 dark:bg-green-900/20 dark:text-green-200 [&>svg]:text-green-600 dark:[&>svg]:text-green-500"}},defaultVariants:{variant:"default"}}),Ug=v.forwardRef(({className:l,variant:s,...r},c)=>o.jsx("div",{ref:c,role:"alert",className:Q(gN({variant:s}),l),...r}));Ug.displayName="Alert";const Bg=v.forwardRef(({className:l,...s},r)=>o.jsx("h5",{ref:r,className:Q("mb-1 font-medium leading-none tracking-tight",l),...s}));Bg.displayName="AlertTitle";const Hg=v.forwardRef(({className:l,...s},r)=>o.jsx("div",{ref:r,className:Q("text-sm [&_p]:leading-relaxed",l),...s}));Hg.displayName="AlertDescription";function yN(){return Ot({queryKey:["overview"],queryFn:async()=>(await fetch("/api/overview")).json()})}function vN(){return Ot({queryKey:["shared","summary"],queryFn:async()=>(await fetch("/api/shared/summary")).json()})}function zC(l){return Ot({queryKey:["shared",l],queryFn:async()=>(await fetch(`/api/shared/${l}`)).json()})}const xN={ok:"success",warning:"warning",error:"error"},bN={default:{iconBg:"bg-muted",iconColor:"text-muted-foreground"},success:{iconBg:"bg-green-600/15",iconColor:"text-green-700 dark:text-green-500"},warning:{iconBg:"bg-amber-500/15",iconColor:"text-amber-700 dark:text-amber-400"},error:{iconBg:"bg-red-600/15",iconColor:"text-red-700 dark:text-red-500"},accent:{iconBg:"bg-accent/15",iconColor:"text-accent"}};function zo({title:l,value:s,icon:r,variant:c="default",onClick:d}){const m=bN[c];return o.jsxs("button",{onClick:d,className:Q("flex items-center gap-3 px-4 py-2.5 rounded-lg border bg-card/50","transition-all hover:bg-card hover:shadow-sm hover:-translate-y-0.5","active:scale-[0.98]"),children:[o.jsx("div",{className:Q("flex items-center justify-center w-9 h-9 rounded-md",m.iconBg),children:o.jsx(r,{className:Q("w-4 h-4",m.iconColor)})}),o.jsxs("div",{className:"text-left",children:[o.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:l}),o.jsx("p",{className:Q("text-lg font-bold font-mono leading-tight",m.iconColor),children:s})]})]})}function SN(){const l=a0(),{data:s,isLoading:r}=yN(),{data:c,isLoading:d}=vN();if(r||d)return o.jsxs("div",{className:"p-6 space-y-6",children:[o.jsxs("div",{className:"rounded-xl border p-6 flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-4",children:[o.jsx(Le,{className:"h-12 w-12 rounded-lg"}),o.jsxs("div",{children:[o.jsx(Le,{className:"h-7 w-[180px] mb-2"}),o.jsx(Le,{className:"h-4 w-[220px]"})]})]}),o.jsx("div",{className:"flex items-center gap-3",children:[1,2,3,4].map(h=>o.jsx(Le,{className:"h-14 w-28 rounded-lg"},h))})]}),o.jsxs("div",{className:"border rounded-xl overflow-hidden",children:[o.jsxs("div",{className:"px-4 py-2.5 border-b flex items-center justify-between",children:[o.jsx(Le,{className:"h-4 w-32"}),o.jsx(Le,{className:"h-4 w-20"})]}),o.jsx("div",{className:"px-4 py-3 border-b",children:o.jsx(Le,{className:"h-2 w-full rounded-full"})}),[1,2,3].map(h=>o.jsxs("div",{className:"px-4 py-2.5 flex items-center gap-3 border-b last:border-b-0",children:[o.jsx(Le,{className:"w-2.5 h-2.5 rounded-full"}),o.jsx(Le,{className:"h-4 flex-1"}),o.jsx(Le,{className:"h-1.5 w-24 rounded-full"}),o.jsx(Le,{className:"h-4 w-16"})]},h))]})]});const m=s?.health?xN[s.health.status]:void 0;return o.jsxs("div",{className:"p-6 space-y-6",children:[o.jsxs("div",{className:"relative overflow-hidden rounded-xl border bg-gradient-to-br from-background via-background to-muted/30",children:[o.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",children:o.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0)",backgroundSize:"24px 24px"}})}),o.jsxs("div",{className:"relative p-6 flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4",children:[o.jsx(qS,{version:s?.version}),o.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[o.jsx(zo,{title:"Profiles",value:s?.profiles??0,icon:tg,variant:"accent",onClick:()=>l("/providers")}),o.jsx(zo,{title:"CLIProxy",value:s?.cliproxy??0,icon:ng,variant:"accent",onClick:()=>l("/cliproxy")}),o.jsx(zo,{title:"Accounts",value:s?.accounts??0,icon:sg,variant:"default",onClick:()=>l("/accounts")}),o.jsx(zo,{title:"Health",value:s?.health?`${s.health.passed}/${s.health.total}`:"-",icon:si,variant:m,onClick:()=>l("/health")})]})]})]}),c?.symlinkStatus&&!c.symlinkStatus.valid&&o.jsxs(Ug,{variant:"warning",children:[o.jsx(Dc,{className:"h-4 w-4"}),o.jsx(Bg,{children:"Configuration Required"}),o.jsx(Hg,{children:c.symlinkStatus.message})]}),o.jsx(C1,{}),o.jsx(pN,{})]})}const qg=qx,Wc=v.forwardRef(({className:l,...s},r)=>o.jsx(Kp,{ref:r,className:Q("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",l),...s}));Wc.displayName=Kp.displayName;const Pl=v.forwardRef(({className:l,...s},r)=>o.jsx(Vp,{ref:r,className:Q("inline-flex items-center justify-center whitespace-nowrap rounded-sm px-3 py-1.5 text-sm font-medium ring-offset-background transition-all 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-sm",l),...s}));Pl.displayName=Vp.displayName;const zc=v.forwardRef(({className:l,...s},r)=>o.jsx(Qp,{ref:r,className:Q("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",l),...s}));zc.displayName=Qp.displayName;function Dn({className:l,...s}){return o.jsx(Lx,{"data-slot":"label",className:Q("flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50",l),...s})}const Jc="ccs:openrouter-models",NN=1440*60*1e3,Lg="1";function Tc(l){const s=parseFloat(l);return isNaN(s)||s===0?0:s*1e6}function Np(l){const s=Tc(l);return s===0?"Free":s<.01?"<$0.01":s<1?`$${s.toFixed(2)}`:`$${s.toFixed(s<10?2:0)}`}function jN(l){const s=Np(l.prompt),r=Np(l.completion);return s==="Free"&&r==="Free"?"Free":`${s}/${r}`}function CN(l){const s=l.id.toLowerCase();return s.startsWith("anthropic/")?"anthropic":s.startsWith("openai/")?"openai":s.startsWith("google/")?"google":s.startsWith("meta-llama/")||s.startsWith("meta/")?"meta":s.startsWith("mistralai/")?"mistral":s.includes(":free")||s.includes("qwen")||s.includes("deepseek")?"opensource":"other"}function EN(l){return{...l,category:CN(l),pricePerMillionPrompt:Tc(l.pricing.prompt),pricePerMillionCompletion:Tc(l.pricing.completion),isFree:l.pricing.prompt==="0"&&l.pricing.completion==="0",isExacto:l.id.includes(":exacto")}}function wN(l,s,r){const c=s.toLowerCase().trim();return l.filter(d=>r?.category&&d.category!==r.category||r?.freeOnly&&!d.isFree||r?.minContext&&d.context_length<r.minContext?!1:c?d.id.toLowerCase().includes(c)||d.name.toLowerCase().includes(c)||d.description?.toLowerCase().includes(c):!0)}function TC(l){return[...l].sort((s,r)=>{if(s.isFree&&!r.isFree)return-1;if(!s.isFree&&r.isFree)return 1;if(!s.isFree&&!r.isFree){if(s.isExacto&&!r.isExacto)return-1;if(!s.isExacto&&r.isExacto)return 1}return s.name.localeCompare(r.name)})}function MN(){try{const l=localStorage.getItem(Jc);if(!l)return null;const s=JSON.parse(l);return s.version!==Lg||Date.now()-s.fetchedAt>NN?null:s.models}catch{return null}}function zN(l){try{localStorage.setItem(Jc,JSON.stringify({models:l,fetchedAt:Date.now(),version:Lg}))}catch{}}function TN(){localStorage.removeItem(Jc)}function OC(l,s){const[r]=l.split("/");if(!r)return{};const c=s.filter(h=>h.id.startsWith(`${r}/`));if(c.length===0)return{};const d=[...c].sort((h,p)=>p.pricePerMillionPrompt-h.pricePerMillionPrompt),m=Math.ceil(d.length/3);return{opus:d[0]?.id,sonnet:d[Math.min(m,d.length-1)]?.id,haiku:d[d.length-1]?.id}}function ON(l){return l>=1e6?`${(l/1e6).toFixed(1)}M`:l>=1e3?`${Math.round(l/1e3)}K`:String(l)}const AC={anthropic:"Anthropic (Claude)",openai:"OpenAI (GPT)",google:"Google (Gemini)",meta:"Meta (Llama)",mistral:"Mistral",opensource:"Open Source",other:"Other"},AN={anthropic:["anthropic/"],openai:["openai/"],google:["google/"],meta:["meta-llama/","meta/"],mistral:["mistralai/"],opensource:["deepseek/","qwen/","cohere/"],other:[]};function DN(l,s=2){const r=[],c=["anthropic","openai","google","meta","mistral","opensource"];for(const d of c){const m=AN[d];if(m.length===0)continue;const p=[...l.filter(y=>m.some(N=>y.id.toLowerCase().startsWith(N)))].sort((y,N)=>(N.created??0)-(y.created??0));r.push(...p.slice(0,s))}return r.sort((d,m)=>(m.created??0)-(d.created??0))}function _N(l){const r=Date.now()/1e3-l;return r<86400?"Today":r<172800?"Yesterday":r<604800?`${Math.floor(r/86400)}d ago`:r<2592e3?`${Math.floor(r/604800)}w ago`:r<31536e3?`${Math.floor(r/2592e3)}mo ago`:`${Math.floor(r/31536e3)}y ago`}const kN="https://openrouter.ai/api/v1/models",Yg=["openrouter-models"],jp=1440*60*1e3;async function RN(){const l=await fetch(kN);if(!l.ok)throw new Error(`Failed to fetch OpenRouter models: ${l.status}`);const r=(await l.json()).data;return zN(r),r}function Gg(){return Ot({queryKey:Yg,queryFn:RN,staleTime:jp,gcTime:jp,initialData:()=>MN()??void 0,refetchOnWindowFocus:!1})}function UN(){const l=Gg(),s=(l.data??[]).map(EN);return{...l,models:s}}function DC(){const l=an();return()=>(TN(),l.invalidateQueries({queryKey:Yg}))}function _C(){const{data:l,isLoading:s,isError:r}=Gg();return{isReady:!!l&&l.length>0,isLoading:s,isError:r,modelCount:l?.length??0}}function Kg({profileEnv:l={}}){const[s,r]=v.useState(null),[c,d]=v.useState(!0),[m,h]=v.useState(!1);v.useEffect(()=>{p()},[]);const p=async()=>{try{d(!0);const b=await fetch("/api/global-env");if(!b.ok)throw new Error("Failed to load");const _=await b.json();r(_)}catch{r(null)}finally{d(!1)}};if(c||!s?.enabled)return null;const y=s.env||{},N=Object.keys(y);if(N.length===0)return null;const E=N.filter(b=>!(b in l)),x=N.filter(b=>b in l);return o.jsxs("div",{className:"border-t bg-muted/20",children:[o.jsxs("button",{onClick:()=>h(!m),className:"w-full px-4 py-2 flex items-center gap-2 hover:bg-muted/30 transition-colors",children:[o.jsx(Vo,{className:"w-4 h-4 text-blue-500"}),o.jsxs("span",{className:"text-xs text-muted-foreground flex-1 text-left",children:[o.jsx("span",{className:"font-medium text-foreground",children:E.length})," global env var",E.length!==1?"s":""," will be injected at runtime",x.length>0&&o.jsxs("span",{className:"text-amber-600 dark:text-amber-400 ml-1",children:["(",x.length," overridden by profile)"]})]}),m?o.jsx(_c,{className:"w-4 h-4 text-muted-foreground"}):o.jsx(Qo,{className:"w-4 h-4 text-muted-foreground"})]}),m&&o.jsxs("div",{className:"px-4 pb-3 space-y-2",children:[E.length>0&&o.jsx("div",{className:"space-y-1",children:E.map(b=>o.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono bg-green-500/10 text-green-700 dark:text-green-400 px-2 py-1 rounded",children:[o.jsx("span",{className:"text-green-500",children:"+"}),o.jsxs("span",{className:"truncate",children:[b,"=",y[b]]})]},b))}),x.length>0&&o.jsxs("div",{className:"space-y-1",children:[o.jsx("p",{className:"text-xs text-muted-foreground",children:"Skipped (profile already defines):"}),x.map(b=>o.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono bg-amber-500/10 text-amber-700 dark:text-amber-400 px-2 py-1 rounded",children:[o.jsx("span",{className:"text-amber-500",children:"~"}),o.jsx("span",{className:"truncate",children:b})]},b))]}),o.jsx("div",{className:"pt-2 border-t border-border/50",children:o.jsx(bt,{variant:"ghost",size:"sm",asChild:!0,className:"h-7 text-xs gap-1.5 -ml-2",children:o.jsxs(wc,{to:"/settings?tab=globalenv",children:[o.jsx(kc,{className:"w-3.5 h-3.5"}),"Configure in Settings",o.jsx(ig,{className:"w-3 h-3 opacity-50"})]})})})]})]})}const BN=v.lazy(()=>Yt(()=>Promise.resolve().then(()=>Zg),void 0).then(l=>({default:l.CodeEditor})));function kC({rawJsonContent:l,isRawJsonValid:s,rawJsonEdits:r,settings:c,onChange:d}){return o.jsx(v.Suspense,{fallback:o.jsxs("div",{className:"flex items-center justify-center h-full",children:[o.jsx(ci,{className:"w-6 h-6 animate-spin text-muted-foreground"}),o.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading editor..."})]}),children:o.jsxs("div",{className:"h-full flex flex-col",children:[!s&&r!==null&&o.jsxs("div",{className:"mb-2 px-3 py-2 bg-destructive/10 text-destructive text-sm rounded-md flex items-center gap-2 mx-6 mt-4 shrink-0",children:[o.jsx(ui,{className:"w-4 h-4"}),"Invalid JSON syntax"]}),o.jsx("div",{className:"flex-1 overflow-hidden px-6 pb-4 pt-4",children:o.jsx("div",{className:"h-full border rounded-md overflow-hidden bg-background",children:o.jsx(BN,{value:l,onChange:d,language:"json",minHeight:"100%"})})}),o.jsx("div",{className:"mx-6 mb-4",children:o.jsx("div",{className:"border rounded-md overflow-hidden",children:o.jsx(Kg,{profileEnv:c?.env})})})]})})}function Cp(l,s){try{var r=l()}catch(c){return s(c)}return r&&r.then?r.then(void 0,s):r}function HN(l,s){for(var r={};l.length;){var c=l[0],d=c.code,m=c.message,h=c.path.join(".");if(!r[h])if("unionErrors"in c){var p=c.unionErrors[0].errors[0];r[h]={message:p.message,type:p.code}}else r[h]={message:m,type:d};if("unionErrors"in c&&c.unionErrors.forEach(function(E){return E.errors.forEach(function(x){return l.push(x)})}),s){var y=r[h].types,N=y&&y[c.code];r[h]=rg(h,s,r,d,N?[].concat(N,c.message):c.message)}l.shift()}return r}function qN(l,s){for(var r={};l.length;){var c=l[0],d=c.code,m=c.message,h=c.path.join(".");if(!r[h])if(c.code==="invalid_union"&&c.errors.length>0){var p=c.errors[0][0];r[h]={message:p.message,type:p.code}}else r[h]={message:m,type:d};if(c.code==="invalid_union"&&c.errors.forEach(function(E){return E.forEach(function(x){return l.push(x)})}),s){var y=r[h].types,N=y&&y[c.code];r[h]=rg(h,s,r,d,N?[].concat(N,c.message):c.message)}l.shift()}return r}function LN(l,s,r){if(r===void 0&&(r={}),(function(c){return"_def"in c&&typeof c._def=="object"&&"typeName"in c._def})(l))return function(c,d,m){try{return Promise.resolve(Cp(function(){return Promise.resolve(l[r.mode==="sync"?"parse":"parseAsync"](c,s)).then(function(h){return m.shouldUseNativeValidation&&Ih({},m),{errors:{},values:r.raw?Object.assign({},c):h}})},function(h){if((function(p){return Array.isArray(p?.issues)})(h))return{values:{},errors:Ph(HN(h.errors,!m.shouldUseNativeValidation&&m.criteriaMode==="all"),m)};throw h}))}catch(h){return Promise.reject(h)}};if((function(c){return"_zod"in c&&typeof c._zod=="object"})(l))return function(c,d,m){try{return Promise.resolve(Cp(function(){return Promise.resolve((r.mode==="sync"?gb:yb)(l,c,s)).then(function(h){return m.shouldUseNativeValidation&&Ih({},m),{errors:{},values:r.raw?Object.assign({},c):h}})},function(h){if((function(p){return p instanceof vb})(h))return{values:{},errors:Ph(qN(h.issues,!m.shouldUseNativeValidation&&m.criteriaMode==="all"),m)};throw h}))}catch(h){return Promise.reject(h)}};throw new Error("Invalid input: not a Zod schema")}function RC(){return Ot({queryKey:["profiles"],queryFn:()=>St.profiles.list()})}function YN(){const l=an();return Cn({mutationFn:s=>St.profiles.create(s),onSuccess:()=>{l.invalidateQueries({queryKey:["profiles"]}),Ae.success("Profile created successfully")},onError:s=>{Ae.error(s.message)}})}function UC(){const l=an();return Cn({mutationFn:s=>St.profiles.delete(s),onSuccess:()=>{l.invalidateQueries({queryKey:["profiles"]}),Ae.success("Profile deleted successfully")},onError:s=>{Ae.error(s.message)}})}const GN="https://openrouter.ai/api",Do=[{id:"openrouter",name:"OpenRouter",description:"349+ models from OpenAI, Anthropic, Google, Meta",baseUrl:GN,defaultProfileName:"openrouter",badge:"349+ models",featured:!0,icon:"/icons/openrouter.svg",defaultModel:"anthropic/claude-opus-4.5",requiresApiKey:!0,apiKeyPlaceholder:"sk-or-...",apiKeyHint:"Get your API key at openrouter.ai/keys",category:"recommended"},{id:"glm",name:"GLM",description:"Claude via Z.AI",baseUrl:"https://api.z.ai/api/anthropic",defaultProfileName:"glm",badge:"Z.AI",defaultModel:"glm-4.7",requiresApiKey:!0,apiKeyPlaceholder:"ghp_...",apiKeyHint:"Get your API key from Z.AI",category:"alternative"},{id:"glmt",name:"GLMT",description:"GLM with Thinking mode support",baseUrl:"https://api.z.ai/api/coding/paas/v4/chat/completions",defaultProfileName:"glmt",badge:"Thinking",defaultModel:"glm-4.7",requiresApiKey:!0,apiKeyPlaceholder:"ghp_...",apiKeyHint:"Same API key as GLM",category:"alternative"},{id:"kimi",name:"Kimi",description:"Moonshot AI - Fast reasoning model",baseUrl:"https://api.kimi.com/coding/",defaultProfileName:"kimi",badge:"Reasoning",defaultModel:"kimi-k2-thinking-turbo",requiresApiKey:!0,apiKeyPlaceholder:"sk-...",apiKeyHint:"Get your API key from Moonshot AI",category:"alternative"},{id:"foundry",name:"Azure Foundry",description:"Claude via Microsoft Azure AI Foundry",baseUrl:"https://<your-resource>.services.ai.azure.com/api/anthropic",defaultProfileName:"foundry",badge:"Azure",defaultModel:"claude-sonnet-4-5",requiresApiKey:!0,apiKeyPlaceholder:"YOUR_AZURE_API_KEY",apiKeyHint:"Create resource at ai.azure.com, get API key from Keys tab",category:"alternative"}];function To(l){return Do.filter(s=>s.category===l)}const KN=xb({name:ll().min(1,"Name is required").regex(/^[a-zA-Z][a-zA-Z0-9._-]*$/,"Must start with letter, only letters/numbers/.-_"),baseUrl:ll().url("Invalid URL format"),apiKey:ll().min(1,"API key is required"),model:ll().optional(),opusModel:ll().optional(),sonnetModel:ll().optional(),haikuModel:ll().optional()}),VN=["/chat/completions","/v1/messages","/messages","/completions"];function BC({open:l,onOpenChange:s,onSuccess:r}){const c=YN(),[d,m]=v.useState("basic"),[h,p]=v.useState(null),[y,N]=v.useState(!1),[E,x]=v.useState("openrouter"),[b,_]=v.useState(""),{models:O}=UN(),{register:k,handleSubmit:U,formState:{errors:M},control:V,reset:G,setValue:q}=bb({resolver:LN(KN),defaultValues:{name:"",baseUrl:"",apiKey:"",model:"",opusModel:"",sonnetModel:"",haikuModel:""}}),B=Sb({control:V,name:"baseUrl"}),j=v.useMemo(()=>!E||E==="custom"?null:Do.find($=>$.id===E),[E]),L=v.useMemo(()=>b.trim()?[...wN(O,b)].sort((ie,D)=>(D.created??0)-(ie.created??0)).slice(0,20):DN(O,2),[O,b]);v.useEffect(()=>{if(l){G(),m("basic"),p(null),N(!1),x("openrouter"),_("");const $=Do.find(ie=>ie.id==="openrouter");$&&setTimeout(()=>{q("name",$.defaultProfileName),q("baseUrl",$.baseUrl)},0)}},[l,G,q]);const W=$=>{x($);const ie=Do.find(D=>D.id===$);ie?(q("name",ie.defaultProfileName),q("baseUrl",ie.baseUrl),ie.defaultModel&&(q("model",ie.defaultModel),q("opusModel",ie.defaultModel),q("sonnetModel",ie.defaultModel),q("haikuModel",ie.defaultModel))):(q("name",""),q("baseUrl",""),q("model",""))},ee=$=>{q("model",$.id),q("opusModel",$.id),q("sonnetModel",$.id),q("haikuModel",$.id),_($.name),Ae.success(`Applied "${$.name}" to all model tiers`,{duration:2e3})};v.useEffect(()=>{if(B&&E==="custom"){const ie=B.toLowerCase();for(const D of VN)if(ie.endsWith(D)){const J=B.replace(new RegExp(D+"$","i"),"");p(`URL ends with "${D}" - Claude appends this automatically. You likely want: ${J}`);return}}p(null)},[B,E]);const he=async $=>{const ie={...$};try{await c.mutateAsync(ie),Ae.success(`Profile "${ie.name}" created`),r(ie.name),s(!1)}catch(D){Ae.error(D.message||"Failed to create profile")}},be=!!M.name||!!M.baseUrl||!!M.apiKey,re=!!M.model||!!M.opusModel||!!M.sonnetModel||!!M.haikuModel,Ye=E==="openrouter";return o.jsx(Bc,{open:l,onOpenChange:s,children:o.jsxs(Hc,{className:"sm:max-w-[700px] p-0 gap-0 overflow-hidden max-h-[90vh]",children:[o.jsxs(qc,{className:"p-6 pb-4 border-b",children:[o.jsxs(Lc,{className:"flex items-center gap-2",children:[o.jsx(Jh,{className:"w-5 h-5 text-primary"}),"Create API Profile"]}),o.jsx(Yc,{children:"Choose a provider or configure a custom API endpoint."})]}),o.jsxs("form",{onSubmit:U(he),className:"flex flex-col overflow-hidden",children:[o.jsxs("div",{className:"px-6 py-3 border-b bg-muted/30 space-y-2",children:[o.jsxs("div",{children:[o.jsx(Dn,{className:"text-xs text-muted-foreground mb-1.5 block",children:"Provider"}),o.jsxs("div",{className:"flex gap-2",children:[To("recommended").map($=>o.jsx(Ep,{preset:$,isSelected:E===$.id,onClick:()=>W($.id)},$.id)),o.jsxs("button",{type:"button",onClick:()=>W("custom"),className:Q("flex items-center gap-1.5 px-3 py-1.5 rounded-md border transition-all text-sm",E==="custom"||To("alternative").some($=>$.id===E)?"border-primary bg-primary/5 font-medium":"border-muted hover:border-muted-foreground/30"),children:[o.jsx(kc,{className:"w-3.5 h-3.5 text-muted-foreground"}),o.jsx("span",{children:"Custom"})]})]})]}),(E==="custom"||To("alternative").some($=>$.id===E))&&o.jsxs("div",{className:"pt-2 border-t border-dashed",children:[o.jsx(Dn,{className:"text-xs text-muted-foreground mb-1.5 block",children:"Quick Templates"}),o.jsx("div",{className:"flex gap-2 flex-wrap",children:To("alternative").map($=>o.jsx(Ep,{preset:$,isSelected:E===$.id,onClick:()=>W($.id)},$.id))})]})]}),o.jsxs(qg,{value:d,onValueChange:m,className:"flex flex-col flex-1 overflow-hidden",children:[o.jsx("div",{className:"px-6 pt-4",children:o.jsxs(Wc,{className:"grid w-full grid-cols-2",children:[o.jsxs(Pl,{value:"basic",className:"relative",children:["Basic Information",be&&o.jsx("span",{className:"absolute top-1 right-2 w-2 h-2 rounded-full bg-destructive animate-pulse"})]}),o.jsxs(Pl,{value:"models",className:"relative",children:["Model Configuration",re&&o.jsx("span",{className:"absolute top-1 right-2 w-2 h-2 rounded-full bg-destructive animate-pulse"})]})]})}),o.jsxs(ts,{className:"flex-1",children:[o.jsxs(zc,{value:"basic",className:"p-6 space-y-4 mt-0",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs(Dn,{htmlFor:"name",children:["Profile Name ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsx(Ra,{id:"name",...k("name"),placeholder:"my-api",className:"font-mono"}),M.name?o.jsx("p",{className:"text-xs text-destructive",children:M.name.message}):o.jsxs("p",{className:"text-xs text-muted-foreground",children:["Used in CLI:"," ",o.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:'ccs my-api "prompt"'})]})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs(Dn,{htmlFor:"baseUrl",children:["API Base URL ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsx(Ra,{id:"baseUrl",...k("baseUrl"),placeholder:"https://api.example.com/v1"}),M.baseUrl?o.jsx("p",{className:"text-xs text-destructive",children:M.baseUrl.message}):h?o.jsxs("div",{className:"flex items-start gap-2 text-xs text-yellow-600 bg-yellow-50 dark:bg-yellow-900/20 p-2 rounded",children:[o.jsx(Dc,{className:"w-4 h-4 shrink-0 mt-0.5"}),o.jsx("span",{children:h})]}):j?o.jsxs("p",{className:"text-xs text-muted-foreground",children:["Pre-filled from ",j.name,". You can customize if needed."]}):o.jsx("p",{className:"text-xs text-muted-foreground",children:"The endpoint that accepts OpenAI-compatible and Anthropic requests"})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs(Dn,{htmlFor:"apiKey",children:["API Key ",o.jsx("span",{className:"text-destructive",children:"*"})]}),o.jsxs("div",{className:"relative",children:[o.jsx(Ra,{id:"apiKey",type:y?"text":"password",...k("apiKey"),placeholder:j?.apiKeyPlaceholder??"sk-...",className:"pr-10"}),o.jsx(bt,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-9 w-9 text-muted-foreground hover:text-foreground",onClick:()=>N(!y),tabIndex:-1,children:y?o.jsx(Lo,{className:"h-4 w-4"}):o.jsx(Yo,{className:"h-4 w-4"})})]}),M.apiKey?o.jsx("p",{className:"text-xs text-destructive",children:M.apiKey.message}):j?.apiKeyHint&&o.jsx("p",{className:"text-xs text-muted-foreground",children:j.apiKeyHint})]})]}),o.jsxs(zc,{value:"models",className:"p-6 mt-0 space-y-4",children:[o.jsxs("div",{className:"flex items-start gap-3 p-3 bg-blue-50 dark:bg-blue-950/20 text-blue-800 dark:text-blue-300 rounded-md text-sm border border-blue-100 dark:border-blue-900/30",children:[o.jsx(Vo,{className:"w-5 h-5 shrink-0 mt-0.5"}),o.jsxs("div",{children:[o.jsx("p",{className:"font-medium mb-1",children:"Model Mapping"}),o.jsx("p",{className:"text-xs opacity-90",children:"Map Claude Code tiers (Opus/Sonnet/Haiku) to models supported by your provider."})]})]}),Ye&&o.jsxs("div",{className:"space-y-2",children:[o.jsx(Dn,{children:"Search Models"}),o.jsx(Ra,{value:b,onChange:$=>_($.target.value),placeholder:"Type to search (e.g., opus, sonnet, gpt-4o)...",onKeyDown:$=>{$.key==="Enter"&&L.length>0&&($.preventDefault(),ee(L[0]))}}),o.jsx("div",{className:"border rounded-md max-h-48 overflow-y-auto",children:L.length===0?o.jsx("p",{className:"text-sm text-muted-foreground p-3 text-center",children:b?`No models found for "${b}"`:"Loading models..."}):o.jsxs("div",{className:"p-1",children:[!b&&o.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 text-xs text-muted-foreground",children:[o.jsx(db,{className:"w-3 h-3 text-accent"}),o.jsx("span",{children:"Newest Models"})]}),L.map($=>o.jsx(QN,{model:$,onClick:()=>ee($),showAge:!b},$.id))]})})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs(Dn,{htmlFor:"model",children:["Default Model",o.jsx(Ha,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"ANTHROPIC_MODEL"})]}),o.jsx(Ra,{id:"model",...k("model"),placeholder:j?.defaultModel??"claude-sonnet-4",className:"font-mono text-sm"})]}),o.jsxs("div",{className:"grid gap-3 pt-2 border-t",children:[o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs(Dn,{htmlFor:"sonnetModel",className:"text-sm",children:["Sonnet Mapping",o.jsx(Ha,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"DEFAULT_SONNET"})]}),o.jsx(Ra,{id:"sonnetModel",...k("sonnetModel"),placeholder:"e.g. gpt-4o, claude-sonnet-4",className:"font-mono text-sm h-9"})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs(Dn,{htmlFor:"opusModel",className:"text-sm",children:["Opus Mapping",o.jsx(Ha,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"DEFAULT_OPUS"})]}),o.jsx(Ra,{id:"opusModel",...k("opusModel"),placeholder:"e.g. o1, claude-opus-4.5",className:"font-mono text-sm h-9"})]}),o.jsxs("div",{className:"space-y-1.5",children:[o.jsxs(Dn,{htmlFor:"haikuModel",className:"text-sm",children:["Haiku Mapping",o.jsx(Ha,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"DEFAULT_HAIKU"})]}),o.jsx(Ra,{id:"haikuModel",...k("haikuModel"),placeholder:"e.g. gpt-4o-mini, claude-3.5-haiku",className:"font-mono text-sm h-9"})]})]})]})]})]}),o.jsxs(TS,{className:"p-6 pt-4 border-t bg-muted/10",children:[o.jsx(bt,{type:"button",variant:"outline",onClick:()=>s(!1),children:"Cancel"}),o.jsx(bt,{type:"submit",disabled:c.isPending,className:Q(c.isPending&&"opacity-80"),children:c.isPending?o.jsxs(o.Fragment,{children:[o.jsx(ci,{className:"w-4 h-4 mr-2 animate-spin"}),"Creating..."]}):o.jsxs(o.Fragment,{children:[o.jsx(Jh,{className:"w-4 h-4 mr-2"}),"Create Profile"]})})]})]})]})]})})}function Ep({preset:l,isSelected:s,onClick:r}){return o.jsxs("button",{type:"button",onClick:r,className:Q("flex items-center gap-1.5 px-3 py-1.5 rounded-md border transition-all text-sm",s?l.featured?"border-accent bg-accent/10 dark:bg-accent/20 font-medium":"border-primary bg-primary/5 font-medium":"border-muted hover:border-muted-foreground/30"),children:[l.icon?o.jsx("img",{src:l.icon,alt:"",className:"w-3.5 h-3.5"}):o.jsx("div",{className:"w-3.5 h-3.5 rounded-full bg-muted flex items-center justify-center text-[8px] font-bold",children:l.name.charAt(0)}),o.jsx("span",{children:l.name}),l.badge&&o.jsx(Ha,{variant:"secondary",className:"text-[9px] px-1 py-0 ml-0.5",children:l.badge})]})}function QN({model:l,onClick:s,showAge:r}){return o.jsxs("button",{type:"button",onClick:s,className:"group flex w-full items-center justify-between rounded-sm px-2 py-1.5 text-left text-sm hover:bg-accent hover:text-accent-foreground",children:[o.jsx("span",{className:"flex-1 truncate",children:l.name}),o.jsxs("span",{className:"text-muted-foreground group-hover:text-accent-foreground/80 ml-2 flex items-center gap-2 text-xs",children:[r&&l.created&&o.jsx(Ha,{variant:"outline",className:"text-[10px] text-accent group-hover:text-accent-foreground/80 group-hover:border-accent-foreground/30",children:_N(l.created)}),l.isFree?o.jsx(Ha,{variant:"secondary",className:"text-xs group-hover:bg-accent-foreground/20 group-hover:text-accent-foreground",children:"Free"}):o.jsx("span",{children:jN(l.pricing)}),o.jsx("span",{children:ON(l.context_length)})]})]})}const HC=Xx,qC=Wx,LC=Zx,XN=v.forwardRef(({className:l,children:s,...r},c)=>o.jsxs(Xp,{ref:c,className:Q("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 placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",l),...r,children:[s,o.jsx(Yx,{asChild:!0,children:o.jsx(Qo,{className:"h-4 w-4 opacity-50"})})]}));XN.displayName=Xp.displayName;const Vg=v.forwardRef(({className:l,...s},r)=>o.jsx(Zp,{ref:r,className:Q("flex cursor-default items-center justify-center py-1",l),...s,children:o.jsx(_c,{className:"h-4 w-4"})}));Vg.displayName=Zp.displayName;const Qg=v.forwardRef(({className:l,...s},r)=>o.jsx(Wp,{ref:r,className:Q("flex cursor-default items-center justify-center py-1",l),...s,children:o.jsx(Qo,{className:"h-4 w-4"})}));Qg.displayName=Wp.displayName;const ZN=v.forwardRef(({className:l,children:s,position:r="popper",...c},d)=>o.jsx(Gx,{children:o.jsxs(Jp,{ref:d,className:Q("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground shadow-md 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",r==="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",l),position:r,...c,children:[o.jsx(Vg,{}),o.jsx(Kx,{className:Q("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:s}),o.jsx(Qg,{})]})}));ZN.displayName=Jp.displayName;const WN=v.forwardRef(({className:l,...s},r)=>o.jsx($p,{ref:r,className:Q("px-2 py-1.5 text-sm font-semibold",l),...s}));WN.displayName=$p.displayName;const JN=v.forwardRef(({className:l,children:s,...r},c)=>o.jsxs(Fp,{ref:c,className:Q("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",l),...r,children:[o.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:o.jsx(Vx,{children:o.jsx(es,{className:"h-4 w-4"})})}),o.jsx(Qx,{children:s})]}));JN.displayName=Fp.displayName;const $N=v.forwardRef(({className:l,...s},r)=>o.jsx(Ip,{ref:r,className:Q("-mx-1 my-1 h-px bg-muted",l),...s}));$N.displayName=Ip.displayName;const FN=v.lazy(()=>Yt(()=>Promise.resolve().then(()=>Zg),void 0).then(l=>({default:l.CodeEditor})));function YC({rawJsonContent:l,isRawJsonValid:s,rawJsonEdits:r,onRawJsonChange:c,profileEnv:d}){return o.jsx(v.Suspense,{fallback:o.jsxs("div",{className:"flex items-center justify-center h-full",children:[o.jsx(ci,{className:"w-6 h-6 animate-spin text-muted-foreground"}),o.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading editor..."})]}),children:o.jsxs("div",{className:"h-full flex flex-col",children:[!s&&r!==null&&o.jsxs("div",{className:"mb-2 px-3 py-2 bg-destructive/10 text-destructive text-sm rounded-md flex items-center gap-2 mx-6 mt-4 shrink-0",children:[o.jsx(ui,{className:"w-4 h-4"}),"Invalid JSON syntax"]}),o.jsx("div",{className:"flex-1 overflow-hidden px-6 pb-4 pt-4",children:o.jsx("div",{className:"h-full border rounded-md overflow-hidden bg-background",children:o.jsx(FN,{value:l,onChange:c,language:"json",minHeight:"100%"})})}),o.jsx("div",{className:"mx-6 mb-4",children:o.jsx("div",{className:"border rounded-md overflow-hidden",children:o.jsx(Kg,{profileEnv:d})})})]})})}var qt={},wp;function IN(){if(wp)return qt;wp=1;var l=qt&&qt.__assign||function(){return l=Object.assign||function(B){for(var j,L=1,W=arguments.length;L<W;L++){j=arguments[L];for(var ee in j)Object.prototype.hasOwnProperty.call(j,ee)&&(B[ee]=j[ee])}return B},l.apply(this,arguments)},s=qt&&qt.__createBinding||(Object.create?(function(B,j,L,W){W===void 0&&(W=L);var ee=Object.getOwnPropertyDescriptor(j,L);(!ee||("get"in ee?!j.__esModule:ee.writable||ee.configurable))&&(ee={enumerable:!0,get:function(){return j[L]}}),Object.defineProperty(B,W,ee)}):(function(B,j,L,W){W===void 0&&(W=L),B[W]=j[L]})),r=qt&&qt.__setModuleDefault||(Object.create?(function(B,j){Object.defineProperty(B,"default",{enumerable:!0,value:j})}):function(B,j){B.default=j}),c=qt&&qt.__importStar||function(B){if(B&&B.__esModule)return B;var j={};if(B!=null)for(var L in B)L!=="default"&&Object.prototype.hasOwnProperty.call(B,L)&&s(j,B,L);return r(j,B),j},d=qt&&qt.__rest||function(B,j){var L={};for(var W in B)Object.prototype.hasOwnProperty.call(B,W)&&j.indexOf(W)<0&&(L[W]=B[W]);if(B!=null&&typeof Object.getOwnPropertySymbols=="function")for(var ee=0,W=Object.getOwnPropertySymbols(B);ee<W.length;ee++)j.indexOf(W[ee])<0&&Object.prototype.propertyIsEnumerable.call(B,W[ee])&&(L[W[ee]]=B[W[ee]]);return L};Object.defineProperty(qt,"__esModule",{value:!0});var m=c(eg()),h=89,p=90,y=77,N=57,E=219,x=222,b=192,_=100,O=3e3,k=typeof window<"u"&&"navigator"in window&&/Win/i.test(navigator.platform),U=typeof window<"u"&&"navigator"in window&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),M="npm__react-simple-code-editor__textarea",V=`
|
|
15
|
+
/**
|
|
16
|
+
* Reset the text fill color so that placeholder is visible
|
|
17
|
+
*/
|
|
18
|
+
.`.concat(M,`:empty {
|
|
19
|
+
-webkit-text-fill-color: inherit !important;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Hack to apply on some CSS on IE10 and IE11
|
|
24
|
+
*/
|
|
25
|
+
@media all and (-ms-high-contrast: none), (-ms-high-contrast: active) {
|
|
26
|
+
/**
|
|
27
|
+
* IE doesn't support '-webkit-text-fill-color'
|
|
28
|
+
* So we use 'color: transparent' to make the text transparent on IE
|
|
29
|
+
* Unlike other browsers, it doesn't affect caret color in IE
|
|
30
|
+
*/
|
|
31
|
+
.`).concat(M,` {
|
|
32
|
+
color: transparent !important;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
.`).concat(M,`::selection {
|
|
36
|
+
background-color: #accef7 !important;
|
|
37
|
+
color: transparent !important;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
`),G=m.forwardRef(function(j,L){var W=j.autoFocus,ee=j.disabled,he=j.form,be=j.highlight,re=j.ignoreTabKey,Ye=re===void 0?!1:re,$=j.insertSpaces,ie=$===void 0?!0:$,D=j.maxLength,J=j.minLength,le=j.name,ve=j.onBlur,xe=j.onClick,Te=j.onFocus,de=j.onKeyDown,X=j.onKeyUp,F=j.onValueChange,ae=j.padding,I=ae===void 0?0:ae,ne=j.placeholder,ye=j.preClassName,Oe=j.readOnly,Ge=j.required,ht=j.style,pt=j.tabSize,Ve=pt===void 0?2:pt,et=j.textareaClassName,At=j.textareaId,Gt=j.value,Un=d(j,["autoFocus","disabled","form","highlight","ignoreTabKey","insertSpaces","maxLength","minLength","name","onBlur","onClick","onFocus","onKeyDown","onKeyUp","onValueChange","padding","placeholder","preClassName","readOnly","required","style","tabSize","textareaClassName","textareaId","value"]),Ne=m.useRef({stack:[],offset:-1}),Kt=m.useRef(null),En=m.useState(!0),Vt=En[0],ca=En[1],Bn={paddingTop:typeof I=="object"?I.top:I,paddingRight:typeof I=="object"?I.right:I,paddingBottom:typeof I=="object"?I.bottom:I,paddingLeft:typeof I=="object"?I.left:I},ot=be(Gt),Qt=function(Z,Ee){return Z.substring(0,Ee).split(`
|
|
41
|
+
`)},Hn=m.useCallback(function(Z,Ee){var fe,we,tt;Ee===void 0&&(Ee=!1);var oe=Ne.current,Se=oe.stack,me=oe.offset;if(Se.length&&me>-1){Ne.current.stack=Se.slice(0,me+1);var Me=Ne.current.stack.length;if(Me>_){var Fe=Me-_;Ne.current.stack=Se.slice(Fe,Me),Ne.current.offset=Math.max(Ne.current.offset-Fe,0)}}var ge=Date.now();if(Ee){var zt=Ne.current.stack[Ne.current.offset];if(zt&&ge-zt.timestamp<O){var Ln=/[^a-z0-9]([a-z0-9]+)$/i,yt=(fe=Qt(zt.value,zt.selectionStart).pop())===null||fe===void 0?void 0:fe.match(Ln),Xt=(we=Qt(Z.value,Z.selectionStart).pop())===null||we===void 0?void 0:we.match(Ln);if(yt?.[1]&&(!((tt=Xt?.[1])===null||tt===void 0)&&tt.startsWith(yt[1]))){Ne.current.stack[Ne.current.offset]=l(l({},Z),{timestamp:ge});return}}}Ne.current.stack.push(l(l({},Z),{timestamp:ge})),Ne.current.offset++},[]),qa=m.useCallback(function(){var Z=Kt.current;if(Z){var Ee=Z.value,fe=Z.selectionStart,we=Z.selectionEnd;Hn({value:Ee,selectionStart:fe,selectionEnd:we})}},[Hn]),wn=function(Z){var Ee=Kt.current;Ee&&(Ee.value=Z.value,Ee.selectionStart=Z.selectionStart,Ee.selectionEnd=Z.selectionEnd,F?.(Z.value))},Mn=function(Z){var Ee=Kt.current,fe=Ne.current.stack[Ne.current.offset];fe&&Ee&&(Ne.current.stack[Ne.current.offset]=l(l({},fe),{selectionStart:Ee.selectionStart,selectionEnd:Ee.selectionEnd})),Hn(Z),wn(Z)},ul=function(){var Z=Ne.current,Ee=Z.stack,fe=Z.offset,we=Ee[fe-1];we&&(wn(we),Ne.current.offset=Math.max(fe-1,0))},ns=function(){var Z=Ne.current,Ee=Z.stack,fe=Z.offset,we=Ee[fe+1];we&&(wn(we),Ne.current.offset=Math.min(fe+1,Ee.length-1))},as=function(Z){if(!(de&&(de(Z),Z.defaultPrevented))){Z.key==="Escape"&&Z.currentTarget.blur();var Ee=Z.currentTarget,fe=Ee.value,we=Ee.selectionStart,tt=Ee.selectionEnd,oe=(ie?" ":" ").repeat(Ve);if(Z.key==="Tab"&&!Ye&&Vt)if(Z.preventDefault(),Z.shiftKey){var Se=Qt(fe,we),me=Se.length-1,Me=Qt(fe,tt).length-1,Fe=fe.split(`
|
|
42
|
+
`).map(function(Yn,cl){return cl>=me&&cl<=Me&&Yn.startsWith(oe)?Yn.substring(oe.length):Yn}).join(`
|
|
43
|
+
`);if(fe!==Fe){var ge=Se[me];Mn({value:Fe,selectionStart:ge?.startsWith(oe)?we-oe.length:we,selectionEnd:tt-(fe.length-Fe.length)})}}else if(we!==tt){var Se=Qt(fe,we),zt=Se.length-1,Ln=Qt(fe,tt).length-1,ge=Se[zt];Mn({value:fe.split(`
|
|
44
|
+
`).map(function(is,os){return os>=zt&&os<=Ln?oe+is:is}).join(`
|
|
45
|
+
`),selectionStart:ge&&/\S/.test(ge)?we+oe.length:we,selectionEnd:tt+oe.length*(Ln-zt+1)})}else{var yt=we+oe.length;Mn({value:fe.substring(0,we)+oe+fe.substring(tt),selectionStart:yt,selectionEnd:yt})}else if(Z.key==="Backspace"){var Xt=we!==tt,gn=fe.substring(0,we);if(gn.endsWith(oe)&&!Xt){Z.preventDefault();var yt=we-oe.length;Mn({value:fe.substring(0,we-oe.length)+fe.substring(tt),selectionStart:yt,selectionEnd:yt})}}else if(Z.key==="Enter"){if(we===tt){var ls=Qt(fe,we).pop(),La=ls?.match(/^\s+/);if(La?.[0]){Z.preventDefault();var ss=`
|
|
46
|
+
`+La[0],yt=we+ss.length;Mn({value:fe.substring(0,we)+ss+fe.substring(tt),selectionStart:yt,selectionEnd:yt})}}}else if(Z.keyCode===N||Z.keyCode===E||Z.keyCode===x||Z.keyCode===b){var ln=void 0;Z.keyCode===N&&Z.shiftKey?ln=["(",")"]:Z.keyCode===E?Z.shiftKey?ln=["{","}"]:ln=["[","]"]:Z.keyCode===x?Z.shiftKey?ln=['"','"']:ln=["'","'"]:Z.keyCode===b&&!Z.shiftKey&&(ln=["`","`"]),we!==tt&&ln&&(Z.preventDefault(),Mn({value:fe.substring(0,we)+ln[0]+fe.substring(we,tt)+ln[1]+fe.substring(tt),selectionStart:we,selectionEnd:tt+2}))}else(U?Z.metaKey&&Z.keyCode===p:Z.ctrlKey&&Z.keyCode===p)&&!Z.shiftKey&&!Z.altKey?(Z.preventDefault(),ul()):(U?Z.metaKey&&Z.keyCode===p&&Z.shiftKey:k?Z.ctrlKey&&Z.keyCode===h:Z.ctrlKey&&Z.keyCode===p&&Z.shiftKey)&&!Z.altKey?(Z.preventDefault(),ns()):Z.keyCode===y&&Z.ctrlKey&&(!U||Z.shiftKey)&&(Z.preventDefault(),ca(function(Yn){return!Yn}))}},qn=function(Z){var Ee=Z.currentTarget,fe=Ee.value,we=Ee.selectionStart,tt=Ee.selectionEnd;Hn({value:fe,selectionStart:we,selectionEnd:tt},!0),F(fe)};return m.useEffect(function(){qa()},[qa]),m.useImperativeHandle(L,function(){return{get session(){return{history:Ne.current}},set session(Z){Ne.current=Z.history}}},[]),m.createElement("div",l({},Un,{style:l(l({},q.container),ht)}),m.createElement("pre",l({className:ye,"aria-hidden":"true",style:l(l(l({},q.editor),q.highlight),Bn)},typeof ot=="string"?{dangerouslySetInnerHTML:{__html:ot+"<br />"}}:{children:ot})),m.createElement("textarea",{ref:function(Z){return Kt.current=Z},style:l(l(l({},q.editor),q.textarea),Bn),className:M+(et?" ".concat(et):""),id:At,value:Gt,onChange:qn,onKeyDown:as,onClick:xe,onKeyUp:X,onFocus:Te,onBlur:ve,disabled:ee,form:he,maxLength:D,minLength:J,name:le,placeholder:ne,readOnly:Oe,required:Ge,autoFocus:W,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"data-gramm":!1}),m.createElement("style",{dangerouslySetInnerHTML:{__html:V}}))}),q={container:{position:"relative",textAlign:"left",boxSizing:"border-box",padding:0,overflow:"hidden"},textarea:{position:"absolute",top:0,left:0,height:"100%",width:"100%",resize:"none",color:"inherit",overflow:"hidden",MozOsxFontSmoothing:"grayscale",WebkitFontSmoothing:"antialiased",WebkitTextFillColor:"transparent"},highlight:{position:"relative",pointerEvents:"none"},editor:{margin:0,border:0,background:"none",boxSizing:"inherit",display:"inherit",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontVariantLigatures:"inherit",fontWeight:"inherit",letterSpacing:"inherit",lineHeight:"inherit",tabSize:"inherit",textIndent:"inherit",textRendering:"inherit",textTransform:"inherit",whiteSpace:"pre-wrap",wordBreak:"keep-all",overflowWrap:"break-word"}};return qt.default=G,qt}var PN=IN();const ej=l0(PN),tj=[/^ANTHROPIC_AUTH_TOKEN$/,/_API_KEY$/,/_AUTH_TOKEN$/,/_SECRET$/,/_SECRET_KEY$/,/^API_KEY$/,/^AUTH_TOKEN$/,/^SECRET$/,/_PASSWORD$/,/^PASSWORD$/,/_CREDENTIAL$/,/_PRIVATE_KEY$/];function nj(l){return tj.some(s=>s.test(l))}function aj(l){if(!l.trim())return{valid:!0};try{return JSON.parse(l),{valid:!0}}catch(s){const c=s.message,d=c.match(/position (\d+)/);if(d){const m=parseInt(d[1],10),h=l.substring(0,m).split(`
|
|
47
|
+
`);return{valid:!1,error:c,line:h.length}}return{valid:!1,error:c}}}function Xg({value:l,onChange:s,language:r="json",readonly:c=!1,className:d,minHeight:m="300px"}){const{isDark:h}=hg(),[p,y]=v.useState(!1),[N,E]=v.useState(!0),x=v.useMemo(()=>r==="json"?aj(l):{valid:!0},[l,r]),b=v.useCallback(_=>o.jsx(Nb,{theme:h?ep.nightOwl:ep.github,code:_,language:r,children:({tokens:O,getLineProps:k,getTokenProps:U})=>{let M=!1;return o.jsx(o.Fragment,{children:O.map((V,G)=>o.jsx("div",{...k({line:V}),className:Q(x.line===G+1&&"bg-destructive/20"),children:V.map((q,B)=>{let j=!1;if(q.types.includes("property")){const W=q.content.replace(/['"]/g,"");nj(W)?M=!0:M=!1}else(q.types.includes("string")||q.types.includes("number")||q.types.includes("boolean"))&&M?(j=!0,M=!1):q.types.includes("punctuation")&&q.content!==":"&&q.content!=="["&&q.content!=="{"&&(M=!1);const L=U({token:q});return j&&N&&(L.className=Q(L.className,"blur-[3px] select-none opacity-70 transition-all duration-200")),o.jsx("span",{...L},B)})},G))})}}),[h,r,x.line,N]);return o.jsxs("div",{className:Q("flex flex-col",d),children:[o.jsxs("div",{className:Q("relative rounded-md border overflow-hidden","bg-muted/30",p&&"ring-2 ring-ring ring-offset-2 ring-offset-background",c&&"opacity-70 cursor-not-allowed",!x.valid&&"border-destructive"),style:{minHeight:m},children:[o.jsx(ej,{value:l,onValueChange:c?()=>{}:s,highlight:b,padding:12,disabled:c,onFocus:()=>y(!0),onBlur:()=>y(!1),textareaClassName:Q("focus:outline-none font-mono text-sm",c&&"cursor-not-allowed"),preClassName:"font-mono text-sm",style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:"0.875rem",minHeight:m}},h?"dark-editor":"light-editor"),o.jsx("div",{className:"absolute top-2 right-2 z-10 opacity-50 hover:opacity-100 transition-opacity",children:o.jsx(bt,{variant:"ghost",size:"icon",className:"h-6 w-6 bg-background/50 hover:bg-background border shadow-sm rounded-full",onClick:()=>E(!N),title:N?"Reveal sensitive values":"Mask sensitive values",children:N?o.jsx(Yo,{className:"h-3 w-3"}):o.jsx(Lo,{className:"h-3 w-3"})})})]}),o.jsxs("div",{className:"flex items-center gap-2 mt-2 text-xs",children:[x.valid?o.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",children:[o.jsx(Go,{className:"w-3 h-3 text-green-500"}),"Valid ",r.toUpperCase()]}):o.jsxs("span",{className:"flex items-center gap-1 text-destructive",children:[o.jsx(fb,{className:"w-3 h-3"}),x.error,x.line&&` (line ${x.line})`]}),c&&o.jsx("span",{className:"ml-auto text-muted-foreground",children:"(Read-only)"})]})]})}const Zg=Object.freeze(Object.defineProperty({__proto__:null,CodeEditor:Xg},Symbol.toStringTag,{value:"Module"})),lj={webSearchConfig:null,webSearchStatus:null,webSearchLoading:!0,webSearchStatusLoading:!0,webSearchSaving:!1,webSearchError:null,webSearchSuccess:!1,globalEnvConfig:null,globalEnvLoading:!0,globalEnvSaving:!1,globalEnvError:null,globalEnvSuccess:!1,proxyConfig:null,proxyLoading:!0,proxySaving:!1,proxyError:null,proxySuccess:!1,proxyTestResult:null,proxyTesting:!1,rawConfig:null,rawConfigLoading:!1};function sj(l,s){switch(s.type){case"SET_WEBSEARCH_CONFIG":return{...l,webSearchConfig:s.payload};case"SET_WEBSEARCH_STATUS":return{...l,webSearchStatus:s.payload};case"SET_WEBSEARCH_LOADING":return{...l,webSearchLoading:s.payload};case"SET_WEBSEARCH_STATUS_LOADING":return{...l,webSearchStatusLoading:s.payload};case"SET_WEBSEARCH_SAVING":return{...l,webSearchSaving:s.payload};case"SET_WEBSEARCH_ERROR":return{...l,webSearchError:s.payload};case"SET_WEBSEARCH_SUCCESS":return{...l,webSearchSuccess:s.payload};case"SET_GLOBALENV_CONFIG":return{...l,globalEnvConfig:s.payload};case"SET_GLOBALENV_LOADING":return{...l,globalEnvLoading:s.payload};case"SET_GLOBALENV_SAVING":return{...l,globalEnvSaving:s.payload};case"SET_GLOBALENV_ERROR":return{...l,globalEnvError:s.payload};case"SET_GLOBALENV_SUCCESS":return{...l,globalEnvSuccess:s.payload};case"SET_PROXY_CONFIG":return{...l,proxyConfig:s.payload};case"SET_PROXY_LOADING":return{...l,proxyLoading:s.payload};case"SET_PROXY_SAVING":return{...l,proxySaving:s.payload};case"SET_PROXY_ERROR":return{...l,proxyError:s.payload};case"SET_PROXY_SUCCESS":return{...l,proxySuccess:s.payload};case"SET_PROXY_TEST_RESULT":return{...l,proxyTestResult:s.payload};case"SET_PROXY_TESTING":return{...l,proxyTesting:s.payload};case"SET_RAW_CONFIG":return{...l,rawConfig:s.payload};case"SET_RAW_CONFIG_LOADING":return{...l,rawConfigLoading:s.payload};default:return l}}const Wg=v.createContext(null);function ij({children:l}){const[s,r]=v.useReducer(sj,lj);return o.jsx(Wg.Provider,{value:{state:s,dispatch:r},children:l})}function Jg(){const l=v.useContext(Wg);if(!l)throw new Error("useSettingsContext must be used within a SettingsProvider");return l}function oj(){const{dispatch:l}=Jg(),s=v.useCallback(j=>l({type:"SET_WEBSEARCH_CONFIG",payload:j}),[l]),r=v.useCallback(j=>l({type:"SET_WEBSEARCH_STATUS",payload:j}),[l]),c=v.useCallback(j=>l({type:"SET_WEBSEARCH_LOADING",payload:j}),[l]),d=v.useCallback(j=>l({type:"SET_WEBSEARCH_STATUS_LOADING",payload:j}),[l]),m=v.useCallback(j=>l({type:"SET_WEBSEARCH_SAVING",payload:j}),[l]),h=v.useCallback(j=>l({type:"SET_WEBSEARCH_ERROR",payload:j}),[l]),p=v.useCallback(j=>l({type:"SET_WEBSEARCH_SUCCESS",payload:j}),[l]),y=v.useCallback(j=>l({type:"SET_GLOBALENV_CONFIG",payload:j}),[l]),N=v.useCallback(j=>l({type:"SET_GLOBALENV_LOADING",payload:j}),[l]),E=v.useCallback(j=>l({type:"SET_GLOBALENV_SAVING",payload:j}),[l]),x=v.useCallback(j=>l({type:"SET_GLOBALENV_ERROR",payload:j}),[l]),b=v.useCallback(j=>l({type:"SET_GLOBALENV_SUCCESS",payload:j}),[l]),_=v.useCallback(j=>l({type:"SET_PROXY_CONFIG",payload:j}),[l]),O=v.useCallback(j=>l({type:"SET_PROXY_LOADING",payload:j}),[l]),k=v.useCallback(j=>l({type:"SET_PROXY_SAVING",payload:j}),[l]),U=v.useCallback(j=>l({type:"SET_PROXY_ERROR",payload:j}),[l]),M=v.useCallback(j=>l({type:"SET_PROXY_SUCCESS",payload:j}),[l]),V=v.useCallback(j=>l({type:"SET_PROXY_TEST_RESULT",payload:j}),[l]),G=v.useCallback(j=>l({type:"SET_PROXY_TESTING",payload:j}),[l]),q=v.useCallback(j=>l({type:"SET_RAW_CONFIG",payload:j}),[l]),B=v.useCallback(j=>l({type:"SET_RAW_CONFIG_LOADING",payload:j}),[l]);return v.useMemo(()=>({setWebSearchConfig:s,setWebSearchStatus:r,setWebSearchLoading:c,setWebSearchStatusLoading:d,setWebSearchSaving:m,setWebSearchError:h,setWebSearchSuccess:p,setGlobalEnvConfig:y,setGlobalEnvLoading:N,setGlobalEnvSaving:E,setGlobalEnvError:x,setGlobalEnvSuccess:b,setProxyConfig:_,setProxyLoading:O,setProxySaving:k,setProxyError:U,setProxySuccess:M,setProxyTestResult:V,setProxyTesting:G,setRawConfig:q,setRawConfigLoading:B}),[s,r,c,d,m,h,p,y,N,E,x,b,_,O,k,U,M,V,G,q,B])}function rj(){const[l,s]=s0(),r=l.get("tab"),c=r==="globalenv"?"globalenv":r==="proxy"?"proxy":"websearch",d=v.useCallback(m=>{s({tab:m},{replace:!0})},[s]);return{activeTab:c,setActiveTab:d}}function uj(){const{state:l}=Jg(),s=oj(),[r,c]=v.useState(!1),d=v.useCallback(async()=>{try{s.setRawConfigLoading(!0);const h=await fetch("/api/config/raw");if(!h.ok){s.setRawConfig(null);return}const p=await h.text();s.setRawConfig(p)}catch{s.setRawConfig(null)}finally{s.setRawConfigLoading(!1)}},[s]),m=v.useCallback(async()=>{if(l.rawConfig)try{await navigator.clipboard.writeText(l.rawConfig),c(!0),setTimeout(()=>c(!1),2e3)}catch{}},[l.rawConfig]);return{rawConfig:l.rawConfig,loading:l.rawConfigLoading,copied:r,fetchRawConfig:d,copyToClipboard:m}}function cj({activeTab:l,onTabChange:s}){return o.jsx(qg,{value:l,onValueChange:r=>s(r),children:o.jsxs(Wc,{className:"w-full",children:[o.jsxs(Pl,{value:"websearch",className:"flex-1 gap-2",children:[o.jsx(mb,{className:"w-4 h-4"}),"WebSearch"]}),o.jsxs(Pl,{value:"globalenv",className:"flex-1 gap-2",children:[o.jsx(kc,{className:"w-4 h-4"}),"Global Env"]}),o.jsxs(Pl,{value:"proxy",className:"flex-1 gap-2",children:[o.jsx(hb,{className:"w-4 h-4"}),"Proxy"]})]})})}function dj(){return o.jsxs("div",{className:"flex-1 p-5 space-y-6",children:[o.jsx(Le,{className:"h-4 w-2/3"}),o.jsx("div",{className:"p-4 rounded-lg border",children:o.jsxs("div",{className:"flex items-center justify-between",children:[o.jsxs("div",{className:"space-y-2",children:[o.jsx(Le,{className:"h-5 w-32"}),o.jsx(Le,{className:"h-4 w-48"})]}),o.jsx(Le,{className:"h-6 w-10 rounded-full"})]})}),o.jsxs("div",{className:"space-y-3",children:[o.jsx(Le,{className:"h-5 w-24"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx(Le,{className:"h-20 w-full rounded-lg"}),o.jsx(Le,{className:"h-20 w-full rounded-lg"}),o.jsx(Le,{className:"h-20 w-full rounded-lg"})]})]})]})}const fj=v.lazy(()=>Yt(()=>import("./index-CRwxNrlp.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),mj=v.lazy(()=>Yt(()=>import("./globalenv-section-BD-Z41zV.js"),__vite__mapDeps([10,1,2,3,4,5,6,7,8,9]))),hj=v.lazy(()=>Yt(()=>import("./index-BYJzZId9.js"),__vite__mapDeps([11,1,2,3,4,5,6,7,8,9])));function pj(){const{activeTab:l,setActiveTab:s}=rj(),{rawConfig:r,loading:c,copied:d,fetchRawConfig:m,copyToClipboard:h}=uj();v.useEffect(()=>{m()},[m]);const p=y=>{v.startTransition(()=>{s(y)})};return o.jsx("div",{className:"h-[calc(100vh-100px)]",children:o.jsxs(Xc,{direction:"horizontal",className:"h-full",children:[o.jsx(ii,{defaultSize:40,minSize:30,maxSize:55,children:o.jsxs("div",{className:"h-full border-r flex flex-col bg-muted/30 relative",children:[o.jsx("div",{className:"p-5 border-b bg-background",children:o.jsx(cj,{activeTab:l,onTabChange:p})}),o.jsxs(v.Suspense,{fallback:o.jsx(dj,{}),children:[l==="websearch"&&o.jsx(fj,{}),l==="globalenv"&&o.jsx(mj,{}),l==="proxy"&&o.jsx(hj,{})]})]})}),o.jsx(Zc,{className:"w-2 bg-border hover:bg-primary/20 transition-colors cursor-col-resize flex items-center justify-center group",children:o.jsx(Ko,{className:"w-3 h-3 text-muted-foreground group-hover:text-primary"})}),o.jsx(ii,{defaultSize:60,minSize:35,children:o.jsxs("div",{className:"h-full flex flex-col",children:[o.jsxs("div",{className:"p-4 border-b bg-background flex items-center justify-between",children:[o.jsxs("div",{className:"flex items-center gap-3",children:[o.jsx($h,{className:"w-5 h-5 text-primary"}),o.jsxs("div",{children:[o.jsx("h2",{className:"font-semibold",children:"config.yaml"}),o.jsx("p",{className:"text-sm text-muted-foreground",children:"~/.ccs/config.yaml"})]})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx(bt,{variant:"outline",size:"sm",onClick:h,disabled:!r,children:d?o.jsxs(o.Fragment,{children:[o.jsx(es,{className:"w-4 h-4 mr-1"}),"Copied"]}):o.jsxs(o.Fragment,{children:[o.jsx(_o,{className:"w-4 h-4 mr-1"}),"Copy"]})}),o.jsx(bt,{variant:"outline",size:"sm",onClick:m,disabled:c,children:o.jsx(Fh,{className:`w-4 h-4 ${c?"animate-spin":""}`})})]})]}),o.jsx("div",{className:"flex-1 overflow-auto",children:c?o.jsxs("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:[o.jsx(Fh,{className:"w-5 h-5 animate-spin mr-2"}),"Loading..."]}):r?o.jsx(Xg,{value:r,onChange:()=>{},language:"yaml",readonly:!0,minHeight:"auto",className:"min-h-full"}):o.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:o.jsxs("div",{className:"text-center",children:[o.jsx($h,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),o.jsx("p",{children:"Config file not found"}),o.jsx("code",{className:"text-sm bg-muted px-2 py-1 rounded mt-2 inline-block",children:"ccs migrate"})]})})})]})})]})})}function gj(){return o.jsx(ij,{children:o.jsx(pj,{})})}const yj=Object.freeze(Object.defineProperty({__proto__:null,SettingsPage:gj},Symbol.toStringTag,{value:"Module"})),GC=$x,KC=Ix,VC=Fx,vj=v.forwardRef(({className:l,align:s="center",sideOffset:r=4,...c},d)=>o.jsx(Jx,{children:o.jsx(Pp,{ref:d,align:s,sideOffset:r,className:Q("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",l),...c})}));vj.displayName=Pp.displayName;function xj(l,s,r="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:l,timeZoneName:r}).format(s).split(/\s/g).slice(2).join(" ")}const bj={},li={};function il(l,s){try{const c=(bj[l]||=new Intl.DateTimeFormat("en-US",{timeZone:l,timeZoneName:"longOffset"}).format)(s).split("GMT")[1];return c in li?li[c]:Mp(c,c.split(":"))}catch{if(l in li)return li[l];const r=l?.match(Sj);return r?Mp(l,r.slice(1)):NaN}}const Sj=/([+-]\d\d):?(\d\d)?/;function Mp(l,s){const r=+(s[0]||0),c=+(s[1]||0),d=+(s[2]||0)/60;return li[l]=r*60+c>0?r*60+c+d:r*60-c-d}class kn extends Date{constructor(...s){super(),s.length>1&&typeof s[s.length-1]=="string"&&(this.timeZone=s.pop()),this.internal=new Date,isNaN(il(this.timeZone,this))?this.setTime(NaN):s.length?typeof s[0]=="number"&&(s.length===1||s.length===2&&typeof s[1]!="number")?this.setTime(s[0]):typeof s[0]=="string"?this.setTime(+new Date(s[0])):s[0]instanceof Date?this.setTime(+s[0]):(this.setTime(+new Date(...s)),$g(this),Oc(this)):this.setTime(Date.now())}static tz(s,...r){return r.length?new kn(...r,s):new kn(Date.now(),s)}withTimeZone(s){return new kn(+this,s)}getTimezoneOffset(){const s=-il(this.timeZone,this);return s>0?Math.floor(s):Math.ceil(s)}setTime(s){return Date.prototype.setTime.apply(this,arguments),Oc(this),+this}[Symbol.for("constructDateFrom")](s){return new kn(+new Date(s),this.timeZone)}}const zp=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(l=>{if(!zp.test(l))return;const s=l.replace(zp,"$1UTC");kn.prototype[s]&&(l.startsWith("get")?kn.prototype[l]=function(){return this.internal[s]()}:(kn.prototype[l]=function(){return Date.prototype[s].apply(this.internal,arguments),Nj(this),+this},kn.prototype[s]=function(){return Date.prototype[s].apply(this,arguments),Oc(this),+this}))});function Oc(l){l.internal.setTime(+l),l.internal.setUTCSeconds(l.internal.getUTCSeconds()-Math.round(-il(l.timeZone,l)*60))}function Nj(l){Date.prototype.setFullYear.call(l,l.internal.getUTCFullYear(),l.internal.getUTCMonth(),l.internal.getUTCDate()),Date.prototype.setHours.call(l,l.internal.getUTCHours(),l.internal.getUTCMinutes(),l.internal.getUTCSeconds(),l.internal.getUTCMilliseconds()),$g(l)}function $g(l){const s=il(l.timeZone,l),r=s>0?Math.floor(s):Math.ceil(s),c=new Date(+l);c.setUTCHours(c.getUTCHours()-1);const d=-new Date(+l).getTimezoneOffset(),m=-new Date(+c).getTimezoneOffset(),h=d-m,p=Date.prototype.getHours.apply(l)!==l.internal.getUTCHours();h&&p&&l.internal.setUTCMinutes(l.internal.getUTCMinutes()+h);const y=d-r;y&&Date.prototype.setUTCMinutes.call(l,Date.prototype.getUTCMinutes.call(l)+y);const N=new Date(+l);N.setUTCSeconds(0);const E=d>0?N.getSeconds():(N.getSeconds()-60)%60,x=Math.round(-(il(l.timeZone,l)*60))%60;(x||E)&&(l.internal.setUTCSeconds(l.internal.getUTCSeconds()+x),Date.prototype.setUTCSeconds.call(l,Date.prototype.getUTCSeconds.call(l)+x+E));const b=il(l.timeZone,l),_=b>0?Math.floor(b):Math.ceil(b),k=-new Date(+l).getTimezoneOffset()-_,U=_!==r,M=k-y;if(U&&M){Date.prototype.setUTCMinutes.call(l,Date.prototype.getUTCMinutes.call(l)+M);const V=il(l.timeZone,l),G=V>0?Math.floor(V):Math.ceil(V),q=_-G;q&&(l.internal.setUTCMinutes(l.internal.getUTCMinutes()+q),Date.prototype.setUTCMinutes.call(l,Date.prototype.getUTCMinutes.call(l)+q))}}class oa extends kn{static tz(s,...r){return r.length?new oa(...r,s):new oa(Date.now(),s)}toISOString(){const[s,r,c]=this.tzComponents(),d=`${s}${r}:${c}`;return this.internal.toISOString().slice(0,-1)+d}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[s,r,c,d]=this.internal.toUTCString().split(" ");return`${s?.slice(0,-1)} ${c} ${r} ${d}`}toTimeString(){const s=this.internal.toUTCString().split(" ")[4],[r,c,d]=this.tzComponents();return`${s} GMT${r}${c}${d} (${xj(this.timeZone,this)})`}toLocaleString(s,r){return Date.prototype.toLocaleString.call(this,s,{...r,timeZone:r?.timeZone||this.timeZone})}toLocaleDateString(s,r){return Date.prototype.toLocaleDateString.call(this,s,{...r,timeZone:r?.timeZone||this.timeZone})}toLocaleTimeString(s,r){return Date.prototype.toLocaleTimeString.call(this,s,{...r,timeZone:r?.timeZone||this.timeZone})}tzComponents(){const s=this.getTimezoneOffset(),r=s>0?"-":"+",c=String(Math.floor(Math.abs(s)/60)).padStart(2,"0"),d=String(Math.abs(s)%60).padStart(2,"0");return[r,c,d]}withTimeZone(s){return new oa(+this,s)}[Symbol.for("constructDateFrom")](s){return new oa(+new Date(s),this.timeZone)}}const Tp=5,jj=4;function Cj(l,s){const r=s.startOfMonth(l),c=r.getDay()>0?r.getDay():7,d=s.addDays(l,-c+1),m=s.addDays(d,Tp*7-1);return s.getMonth(l)===s.getMonth(m)?Tp:jj}function Fg(l,s){const r=s.startOfMonth(l),c=r.getDay();return c===1?r:c===0?s.addDays(r,-6):s.addDays(r,-1*(c-1))}function Ej(l,s){const r=Fg(l,s),c=Cj(l,s);return s.addDays(r,c*7-1)}const Ig={...Fs,labels:{labelDayButton:(l,s,r,c)=>{let d;c&&typeof c.format=="function"?d=c.format.bind(c):d=(h,p)=>ei(h,p,{locale:Fs,...r});let m=d(l,"PPPP");return s.today&&(m=`Today, ${m}`),s.selected&&(m=`${m}, selected`),m},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:l=>`Week ${l}`,labelYearDropdown:"Choose the Year",labelGrid:(l,s,r)=>{let c;return r&&typeof r.format=="function"?c=r.format.bind(r):c=(d,m)=>ei(d,m,{locale:Fs,...s}),c(l,"LLLL yyyy")},labelGridcell:(l,s,r,c)=>{let d;c&&typeof c.format=="function"?d=c.format.bind(c):d=(h,p)=>ei(h,p,{locale:Fs,...r});let m=d(l,"PPPP");return s?.today&&(m=`Today, ${m}`),m},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(l,s,r)=>{let c;return r&&typeof r.format=="function"?c=r.format.bind(r):c=(d,m)=>ei(d,m,{locale:Fs,...s}),c(l,"cccc")}}};class nn{constructor(s,r){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?oa.tz(this.options.timeZone):new this.Date,this.newDate=(c,d,m)=>this.overrides?.newDate?this.overrides.newDate(c,d,m):this.options.timeZone?new oa(c,d,m,this.options.timeZone):new Date(c,d,m),this.addDays=(c,d)=>this.overrides?.addDays?this.overrides.addDays(c,d):m0(c,d),this.addMonths=(c,d)=>this.overrides?.addMonths?this.overrides.addMonths(c,d):h0(c,d),this.addWeeks=(c,d)=>this.overrides?.addWeeks?this.overrides.addWeeks(c,d):p0(c,d),this.addYears=(c,d)=>this.overrides?.addYears?this.overrides.addYears(c,d):g0(c,d),this.differenceInCalendarDays=(c,d)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(c,d):y0(c,d),this.differenceInCalendarMonths=(c,d)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(c,d):v0(c,d),this.eachMonthOfInterval=c=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(c):x0(c),this.eachYearOfInterval=c=>{const d=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(c):b0(c),m=new Set(d.map(p=>this.getYear(p)));if(m.size===d.length)return d;const h=[];return m.forEach(p=>{h.push(new Date(p,0,1))}),h},this.endOfBroadcastWeek=c=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(c):Ej(c,this),this.endOfISOWeek=c=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(c):S0(c),this.endOfMonth=c=>this.overrides?.endOfMonth?this.overrides.endOfMonth(c):N0(c),this.endOfWeek=(c,d)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(c,d):j0(c,this.options),this.endOfYear=c=>this.overrides?.endOfYear?this.overrides.endOfYear(c):C0(c),this.format=(c,d,m)=>{const h=this.overrides?.format?this.overrides.format(c,d,this.options):ei(c,d,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(h):h},this.getISOWeek=c=>this.overrides?.getISOWeek?this.overrides.getISOWeek(c):E0(c),this.getMonth=(c,d)=>this.overrides?.getMonth?this.overrides.getMonth(c,this.options):w0(c,this.options),this.getYear=(c,d)=>this.overrides?.getYear?this.overrides.getYear(c,this.options):M0(c,this.options),this.getWeek=(c,d)=>this.overrides?.getWeek?this.overrides.getWeek(c,this.options):z0(c,this.options),this.isAfter=(c,d)=>this.overrides?.isAfter?this.overrides.isAfter(c,d):T0(c,d),this.isBefore=(c,d)=>this.overrides?.isBefore?this.overrides.isBefore(c,d):O0(c,d),this.isDate=c=>this.overrides?.isDate?this.overrides.isDate(c):A0(c),this.isSameDay=(c,d)=>this.overrides?.isSameDay?this.overrides.isSameDay(c,d):D0(c,d),this.isSameMonth=(c,d)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(c,d):_0(c,d),this.isSameYear=(c,d)=>this.overrides?.isSameYear?this.overrides.isSameYear(c,d):k0(c,d),this.max=c=>this.overrides?.max?this.overrides.max(c):R0(c),this.min=c=>this.overrides?.min?this.overrides.min(c):U0(c),this.setMonth=(c,d)=>this.overrides?.setMonth?this.overrides.setMonth(c,d):B0(c,d),this.setYear=(c,d)=>this.overrides?.setYear?this.overrides.setYear(c,d):H0(c,d),this.startOfBroadcastWeek=(c,d)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(c,this):Fg(c,this),this.startOfDay=c=>this.overrides?.startOfDay?this.overrides.startOfDay(c):q0(c),this.startOfISOWeek=c=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(c):L0(c),this.startOfMonth=c=>this.overrides?.startOfMonth?this.overrides.startOfMonth(c):Y0(c),this.startOfWeek=(c,d)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(c,this.options):G0(c,this.options),this.startOfYear=c=>this.overrides?.startOfYear?this.overrides.startOfYear(c):K0(c),this.options={locale:Ig,...s},this.overrides=r}getDigitMap(){const{numerals:s="latn"}=this.options,r=new Intl.NumberFormat("en-US",{numberingSystem:s}),c={};for(let d=0;d<10;d++)c[d.toString()]=r.format(d);return c}replaceDigits(s){const r=this.getDigitMap();return s.replace(/\d/g,c=>r[c]||c)}formatNumber(s){return this.replaceDigits(s.toString())}getMonthYearOrder(){const s=this.options.locale?.code;return s&&nn.yearFirstLocales.has(s)?"year-first":"month-first"}formatMonthYear(s){const{locale:r,timeZone:c,numerals:d}=this.options,m=r?.code;if(m&&nn.yearFirstLocales.has(m))try{return new Intl.DateTimeFormat(m,{month:"long",year:"numeric",timeZone:c,numberingSystem:d}).format(s)}catch{}const h=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(s,h)}}nn.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const Rn=new nn;class Pg{constructor(s,r,c=Rn){this.date=s,this.displayMonth=r,this.outside=!!(r&&!c.isSameMonth(s,r)),this.dateLib=c,this.isoDate=c.format(s,"yyyy-MM-dd"),this.displayMonthId=c.format(r,"yyyy-MM"),this.dateMonthId=c.format(s,"yyyy-MM")}isEqualTo(s){return this.dateLib.isSameDay(s.date,this.date)&&this.dateLib.isSameMonth(s.displayMonth,this.displayMonth)}}class wj{constructor(s,r){this.date=s,this.weeks=r}}class Mj{constructor(s,r){this.days=r,this.weekNumber=s}}function zj(l){return P.createElement("button",{...l})}function Tj(l){return P.createElement("span",{...l})}function Oj(l){const{size:s=24,orientation:r="left",className:c}=l;return P.createElement("svg",{className:c,width:s,height:s,viewBox:"0 0 24 24"},r==="up"&&P.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),r==="down"&&P.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),r==="left"&&P.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),r==="right"&&P.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function Aj(l){const{day:s,modifiers:r,...c}=l;return P.createElement("td",{...c})}function Dj(l){const{day:s,modifiers:r,...c}=l,d=P.useRef(null);return P.useEffect(()=>{r.focused&&d.current?.focus()},[r.focused]),P.createElement("button",{ref:d,...c})}var ue;(function(l){l.Root="root",l.Chevron="chevron",l.Day="day",l.DayButton="day_button",l.CaptionLabel="caption_label",l.Dropdowns="dropdowns",l.Dropdown="dropdown",l.DropdownRoot="dropdown_root",l.Footer="footer",l.MonthGrid="month_grid",l.MonthCaption="month_caption",l.MonthsDropdown="months_dropdown",l.Month="month",l.Months="months",l.Nav="nav",l.NextMonthButton="button_next",l.PreviousMonthButton="button_previous",l.Week="week",l.Weeks="weeks",l.Weekday="weekday",l.Weekdays="weekdays",l.WeekNumber="week_number",l.WeekNumberHeader="week_number_header",l.YearsDropdown="years_dropdown"})(ue||(ue={}));var at;(function(l){l.disabled="disabled",l.hidden="hidden",l.outside="outside",l.focused="focused",l.today="today"})(at||(at={}));var Nn;(function(l){l.range_end="range_end",l.range_middle="range_middle",l.range_start="range_start",l.selected="selected"})(Nn||(Nn={}));var tn;(function(l){l.weeks_before_enter="weeks_before_enter",l.weeks_before_exit="weeks_before_exit",l.weeks_after_enter="weeks_after_enter",l.weeks_after_exit="weeks_after_exit",l.caption_after_enter="caption_after_enter",l.caption_after_exit="caption_after_exit",l.caption_before_enter="caption_before_enter",l.caption_before_exit="caption_before_exit"})(tn||(tn={}));function _j(l){const{options:s,className:r,components:c,classNames:d,...m}=l,h=[d[ue.Dropdown],r].join(" "),p=s?.find(({value:y})=>y===m.value);return P.createElement("span",{"data-disabled":m.disabled,className:d[ue.DropdownRoot]},P.createElement(c.Select,{className:h,...m},s?.map(({value:y,label:N,disabled:E})=>P.createElement(c.Option,{key:y,value:y,disabled:E},N))),P.createElement("span",{className:d[ue.CaptionLabel],"aria-hidden":!0},p?.label,P.createElement(c.Chevron,{orientation:"down",size:18,className:d[ue.Chevron]})))}function kj(l){return P.createElement("div",{...l})}function Rj(l){return P.createElement("div",{...l})}function Uj(l){const{calendarMonth:s,displayIndex:r,...c}=l;return P.createElement("div",{...c},l.children)}function Bj(l){const{calendarMonth:s,displayIndex:r,...c}=l;return P.createElement("div",{...c})}function Hj(l){return P.createElement("table",{...l})}function qj(l){return P.createElement("div",{...l})}const ey=v.createContext(void 0);function di(){const l=v.useContext(ey);if(l===void 0)throw new Error("useDayPicker() must be used within a custom component.");return l}function Lj(l){const{components:s}=di();return P.createElement(s.Dropdown,{...l})}function Yj(l){const{onPreviousClick:s,onNextClick:r,previousMonth:c,nextMonth:d,...m}=l,{components:h,classNames:p,labels:{labelPrevious:y,labelNext:N}}=di(),E=v.useCallback(b=>{d&&r?.(b)},[d,r]),x=v.useCallback(b=>{c&&s?.(b)},[c,s]);return P.createElement("nav",{...m},P.createElement(h.PreviousMonthButton,{type:"button",className:p[ue.PreviousMonthButton],tabIndex:c?void 0:-1,"aria-disabled":c?void 0:!0,"aria-label":y(c),onClick:x},P.createElement(h.Chevron,{disabled:c?void 0:!0,className:p[ue.Chevron],orientation:"left"})),P.createElement(h.NextMonthButton,{type:"button",className:p[ue.NextMonthButton],tabIndex:d?void 0:-1,"aria-disabled":d?void 0:!0,"aria-label":N(d),onClick:E},P.createElement(h.Chevron,{disabled:d?void 0:!0,orientation:"right",className:p[ue.Chevron]})))}function Gj(l){const{components:s}=di();return P.createElement(s.Button,{...l})}function Kj(l){return P.createElement("option",{...l})}function Vj(l){const{components:s}=di();return P.createElement(s.Button,{...l})}function Qj(l){const{rootRef:s,...r}=l;return P.createElement("div",{...r,ref:s})}function Xj(l){return P.createElement("select",{...l})}function Zj(l){const{week:s,...r}=l;return P.createElement("tr",{...r})}function Wj(l){return P.createElement("th",{...l})}function Jj(l){return P.createElement("thead",{"aria-hidden":!0},P.createElement("tr",{...l}))}function $j(l){const{week:s,...r}=l;return P.createElement("th",{...r})}function Fj(l){return P.createElement("th",{...l})}function Ij(l){return P.createElement("tbody",{...l})}function Pj(l){const{components:s}=di();return P.createElement(s.Dropdown,{...l})}const e2=Object.freeze(Object.defineProperty({__proto__:null,Button:zj,CaptionLabel:Tj,Chevron:Oj,Day:Aj,DayButton:Dj,Dropdown:_j,DropdownNav:kj,Footer:Rj,Month:Uj,MonthCaption:Bj,MonthGrid:Hj,Months:qj,MonthsDropdown:Lj,Nav:Yj,NextMonthButton:Gj,Option:Kj,PreviousMonthButton:Vj,Root:Qj,Select:Xj,Week:Zj,WeekNumber:$j,WeekNumberHeader:Fj,Weekday:Wj,Weekdays:Jj,Weeks:Ij,YearsDropdown:Pj},Symbol.toStringTag,{value:"Module"}));function ra(l,s,r=!1,c=Rn){let{from:d,to:m}=l;const{differenceInCalendarDays:h,isSameDay:p}=c;return d&&m?(h(m,d)<0&&([d,m]=[m,d]),h(s,d)>=(r?1:0)&&h(m,s)>=(r?1:0)):!r&&m?p(m,s):!r&&d?p(d,s):!1}function $c(l){return!!(l&&typeof l=="object"&&"before"in l&&"after"in l)}function tr(l){return!!(l&&typeof l=="object"&&"from"in l)}function Fc(l){return!!(l&&typeof l=="object"&&"after"in l)}function Ic(l){return!!(l&&typeof l=="object"&&"before"in l)}function ty(l){return!!(l&&typeof l=="object"&&"dayOfWeek"in l)}function ny(l,s){return Array.isArray(l)&&l.every(s.isDate)}function ua(l,s,r=Rn){const c=Array.isArray(s)?s:[s],{isSameDay:d,differenceInCalendarDays:m,isAfter:h}=r;return c.some(p=>{if(typeof p=="boolean")return p;if(r.isDate(p))return d(l,p);if(ny(p,r))return p.some(y=>d(l,y));if(tr(p))return ra(p,l,!1,r);if(ty(p))return Array.isArray(p.dayOfWeek)?p.dayOfWeek.includes(l.getDay()):p.dayOfWeek===l.getDay();if($c(p)){const y=m(p.before,l),N=m(p.after,l),E=y>0,x=N<0;return h(p.before,p.after)?x&&E:E||x}return Fc(p)?m(l,p.after)>0:Ic(p)?m(p.before,l)>0:typeof p=="function"?p(l):!1})}function t2(l,s,r,c,d){const{disabled:m,hidden:h,modifiers:p,showOutsideDays:y,broadcastCalendar:N,today:E=d.today()}=s,{isSameDay:x,isSameMonth:b,startOfMonth:_,isBefore:O,endOfMonth:k,isAfter:U}=d,M=r&&_(r),V=c&&k(c),G={[at.focused]:[],[at.outside]:[],[at.disabled]:[],[at.hidden]:[],[at.today]:[]},q={};for(const B of l){const{date:j,displayMonth:L}=B,W=!!(L&&!b(j,L)),ee=!!(M&&O(j,M)),he=!!(V&&U(j,V)),be=!!(m&&ua(j,m,d)),re=!!(h&&ua(j,h,d))||ee||he||!N&&!y&&W||N&&y===!1&&W,Ye=x(j,E);W&&G.outside.push(B),be&&G.disabled.push(B),re&&G.hidden.push(B),Ye&&G.today.push(B),p&&Object.keys(p).forEach($=>{const ie=p?.[$];ie&&ua(j,ie,d)&&(q[$]?q[$].push(B):q[$]=[B])})}return B=>{const j={[at.focused]:!1,[at.disabled]:!1,[at.hidden]:!1,[at.outside]:!1,[at.today]:!1},L={};for(const W in G){const ee=G[W];j[W]=ee.some(he=>he===B)}for(const W in q)L[W]=q[W].some(ee=>ee===B);return{...j,...L}}}function n2(l,s,r={}){return Object.entries(l).filter(([,d])=>d===!0).reduce((d,[m])=>(r[m]?d.push(r[m]):s[at[m]]?d.push(s[at[m]]):s[Nn[m]]&&d.push(s[Nn[m]]),d),[s[ue.Day]])}function a2(l){return{...e2,...l}}function l2(l){const s={"data-mode":l.mode??void 0,"data-required":"required"in l?l.required:void 0,"data-multiple-months":l.numberOfMonths&&l.numberOfMonths>1||void 0,"data-week-numbers":l.showWeekNumber||void 0,"data-broadcast-calendar":l.broadcastCalendar||void 0,"data-nav-layout":l.navLayout||void 0};return Object.entries(l).forEach(([r,c])=>{r.startsWith("data-")&&(s[r]=c)}),s}function s2(){const l={};for(const s in ue)l[ue[s]]=`rdp-${ue[s]}`;for(const s in at)l[at[s]]=`rdp-${at[s]}`;for(const s in Nn)l[Nn[s]]=`rdp-${Nn[s]}`;for(const s in tn)l[tn[s]]=`rdp-${tn[s]}`;return l}function ay(l,s,r){return(r??new nn(s)).formatMonthYear(l)}const i2=ay;function o2(l,s,r){return(r??new nn(s)).format(l,"d")}function r2(l,s=Rn){return s.format(l,"LLLL")}function u2(l,s,r){return(r??new nn(s)).format(l,"cccccc")}function c2(l,s=Rn){return l<10?s.formatNumber(`0${l.toLocaleString()}`):s.formatNumber(`${l.toLocaleString()}`)}function d2(){return""}function ly(l,s=Rn){return s.format(l,"yyyy")}const f2=ly,m2=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:ay,formatDay:o2,formatMonthCaption:i2,formatMonthDropdown:r2,formatWeekNumber:c2,formatWeekNumberHeader:d2,formatWeekdayName:u2,formatYearCaption:f2,formatYearDropdown:ly},Symbol.toStringTag,{value:"Module"}));function h2(l){return l?.formatMonthCaption&&!l.formatCaption&&(l.formatCaption=l.formatMonthCaption),l?.formatYearCaption&&!l.formatYearDropdown&&(l.formatYearDropdown=l.formatYearCaption),{...m2,...l}}function Pc(l,s,r,c){let d=(c??new nn(r)).format(l,"PPPP");return s.today&&(d=`Today, ${d}`),s.selected&&(d=`${d}, selected`),d}const p2=Pc;function ed(l,s,r){return(r??new nn(s)).formatMonthYear(l)}const g2=ed;function sy(l,s,r,c){let d=(c??new nn(r)).format(l,"PPPP");return s?.today&&(d=`Today, ${d}`),d}function iy(l){return"Choose the Month"}function oy(){return""}const y2="Go to the Next Month";function ry(l,s){return y2}function uy(l){return"Go to the Previous Month"}function cy(l,s,r){return(r??new nn(s)).format(l,"cccc")}function dy(l,s){return`Week ${l}`}function fy(l){return"Week Number"}function my(l){return"Choose the Year"}const v2=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:g2,labelDay:p2,labelDayButton:Pc,labelGrid:ed,labelGridcell:sy,labelMonthDropdown:iy,labelNav:oy,labelNext:ry,labelPrevious:uy,labelWeekNumber:dy,labelWeekNumberHeader:fy,labelWeekday:cy,labelYearDropdown:my},Symbol.toStringTag,{value:"Module"})),Sn=(l,s,r)=>s||(r?typeof r=="function"?r:(...c)=>r:l);function x2(l,s){const r=s.locale?.labels??{};return{...v2,...l??{},labelDayButton:Sn(Pc,l?.labelDayButton,r.labelDayButton),labelMonthDropdown:Sn(iy,l?.labelMonthDropdown,r.labelMonthDropdown),labelNext:Sn(ry,l?.labelNext,r.labelNext),labelPrevious:Sn(uy,l?.labelPrevious,r.labelPrevious),labelWeekNumber:Sn(dy,l?.labelWeekNumber,r.labelWeekNumber),labelYearDropdown:Sn(my,l?.labelYearDropdown,r.labelYearDropdown),labelGrid:Sn(ed,l?.labelGrid,r.labelGrid),labelGridcell:Sn(sy,l?.labelGridcell,r.labelGridcell),labelNav:Sn(oy,l?.labelNav,r.labelNav),labelWeekNumberHeader:Sn(fy,l?.labelWeekNumberHeader,r.labelWeekNumberHeader),labelWeekday:Sn(cy,l?.labelWeekday,r.labelWeekday)}}function b2(l,s,r,c,d){const{startOfMonth:m,startOfYear:h,endOfYear:p,eachMonthOfInterval:y,getMonth:N}=d;return y({start:h(l),end:p(l)}).map(b=>{const _=c.formatMonthDropdown(b,d),O=N(b),k=s&&b<m(s)||r&&b>m(r)||!1;return{value:O,label:_,disabled:k}})}function S2(l,s={},r={}){let c={...s?.[ue.Day]};return Object.entries(l).filter(([,d])=>d===!0).forEach(([d])=>{c={...c,...r?.[d]}}),c}function N2(l,s,r,c){const d=c??l.today(),m=r?l.startOfBroadcastWeek(d,l):s?l.startOfISOWeek(d):l.startOfWeek(d),h=[];for(let p=0;p<7;p++){const y=l.addDays(m,p);h.push(y)}return h}function j2(l,s,r,c,d=!1){if(!l||!s)return;const{startOfYear:m,endOfYear:h,eachYearOfInterval:p,getYear:y}=c,N=m(l),E=h(s),x=p({start:N,end:E});return d&&x.reverse(),x.map(b=>{const _=r.formatYearDropdown(b,c);return{value:y(b),label:_,disabled:!1}})}const fi=l=>l instanceof HTMLElement?l:null,Nc=l=>[...l.querySelectorAll("[data-animated-month]")??[]],C2=l=>fi(l.querySelector("[data-animated-month]")),jc=l=>fi(l.querySelector("[data-animated-caption]")),Cc=l=>fi(l.querySelector("[data-animated-weeks]")),E2=l=>fi(l.querySelector("[data-animated-nav]")),w2=l=>fi(l.querySelector("[data-animated-weekdays]"));function M2(l,s,{classNames:r,months:c,focused:d,dateLib:m}){const h=v.useRef(null),p=v.useRef(c),y=v.useRef(!1);v.useLayoutEffect(()=>{const N=p.current;if(p.current=c,!s||!l.current||!(l.current instanceof HTMLElement)||c.length===0||N.length===0||c.length!==N.length)return;const E=m.isSameMonth(c[0].date,N[0].date),x=m.isAfter(c[0].date,N[0].date),b=x?r[tn.caption_after_enter]:r[tn.caption_before_enter],_=x?r[tn.weeks_after_enter]:r[tn.weeks_before_enter],O=h.current,k=l.current.cloneNode(!0);if(k instanceof HTMLElement?(Nc(k).forEach(G=>{if(!(G instanceof HTMLElement))return;const q=C2(G);q&&G.contains(q)&&G.removeChild(q);const B=jc(G);B&&B.classList.remove(b);const j=Cc(G);j&&j.classList.remove(_)}),h.current=k):h.current=null,y.current||E||d)return;const U=O instanceof HTMLElement?Nc(O):[],M=Nc(l.current);if(M?.every(V=>V instanceof HTMLElement)&&U&&U.every(V=>V instanceof HTMLElement)){y.current=!0,l.current.style.isolation="isolate";const V=E2(l.current);V&&(V.style.zIndex="1"),M.forEach((G,q)=>{const B=U[q];if(!B)return;G.style.position="relative",G.style.overflow="hidden";const j=jc(G);j&&j.classList.add(b);const L=Cc(G);L&&L.classList.add(_);const W=()=>{y.current=!1,l.current&&(l.current.style.isolation=""),V&&(V.style.zIndex=""),j&&j.classList.remove(b),L&&L.classList.remove(_),G.style.position="",G.style.overflow="",G.contains(B)&&G.removeChild(B)};B.style.pointerEvents="none",B.style.position="absolute",B.style.overflow="hidden",B.setAttribute("aria-hidden","true");const ee=w2(B);ee&&(ee.style.opacity="0");const he=jc(B);he&&(he.classList.add(x?r[tn.caption_before_exit]:r[tn.caption_after_exit]),he.addEventListener("animationend",W));const be=Cc(B);be&&be.classList.add(x?r[tn.weeks_before_exit]:r[tn.weeks_after_exit]),G.insertBefore(B,G.firstChild)})}})}function z2(l,s,r,c){const d=l[0],m=l[l.length-1],{ISOWeek:h,fixedWeeks:p,broadcastCalendar:y}=r??{},{addDays:N,differenceInCalendarDays:E,differenceInCalendarMonths:x,endOfBroadcastWeek:b,endOfISOWeek:_,endOfMonth:O,endOfWeek:k,isAfter:U,startOfBroadcastWeek:M,startOfISOWeek:V,startOfWeek:G}=c,q=y?M(d,c):h?V(d):G(d),B=y?b(m):h?_(O(m)):k(O(m)),j=s&&(y?b(s):h?_(s):k(s)),L=j&&U(B,j)?j:B,W=E(L,q),ee=x(m,d)+1,he=[];for(let Ye=0;Ye<=W;Ye++){const $=N(q,Ye);he.push($)}const re=(y?35:42)*ee;if(p&&he.length<re){const Ye=re-he.length;for(let $=0;$<Ye;$++){const ie=N(he[he.length-1],1);he.push(ie)}}return he}function T2(l){const s=[];return l.reduce((r,c)=>{const d=c.weeks.reduce((m,h)=>m.concat(h.days.slice()),s.slice());return r.concat(d.slice())},s.slice())}function O2(l,s,r,c){const{numberOfMonths:d=1}=r,m=[];for(let h=0;h<d;h++){const p=c.addMonths(l,h);if(s&&p>s)break;m.push(p)}return m}function Op(l,s,r,c){const{month:d,defaultMonth:m,today:h=c.today(),numberOfMonths:p=1}=l;let y=d||m||h;const{differenceInCalendarMonths:N,addMonths:E,startOfMonth:x}=c;if(r&&N(r,y)<p-1){const b=-1*(p-1);y=E(r,b)}return s&&N(y,s)<0&&(y=s),x(y)}function A2(l,s,r,c){const{addDays:d,endOfBroadcastWeek:m,endOfISOWeek:h,endOfMonth:p,endOfWeek:y,getISOWeek:N,getWeek:E,startOfBroadcastWeek:x,startOfISOWeek:b,startOfWeek:_}=c,O=l.reduce((k,U)=>{const M=r.broadcastCalendar?x(U,c):r.ISOWeek?b(U):_(U),V=r.broadcastCalendar?m(U):r.ISOWeek?h(p(U)):y(p(U)),G=s.filter(L=>L>=M&&L<=V),q=r.broadcastCalendar?35:42;if(r.fixedWeeks&&G.length<q){const L=s.filter(W=>{const ee=q-G.length;return W>V&&W<=d(V,ee)});G.push(...L)}const B=G.reduce((L,W)=>{const ee=r.ISOWeek?N(W):E(W),he=L.find(re=>re.weekNumber===ee),be=new Pg(W,U,c);return he?he.days.push(be):L.push(new Mj(ee,[be])),L},[]),j=new wj(U,B);return k.push(j),k},[]);return r.reverseMonths?O.reverse():O}function D2(l,s){let{startMonth:r,endMonth:c}=l;const{startOfYear:d,startOfDay:m,startOfMonth:h,endOfMonth:p,addYears:y,endOfYear:N,newDate:E,today:x}=s,{fromYear:b,toYear:_,fromMonth:O,toMonth:k}=l;!r&&O&&(r=O),!r&&b&&(r=s.newDate(b,0,1)),!c&&k&&(c=k),!c&&_&&(c=E(_,11,31));const U=l.captionLayout==="dropdown"||l.captionLayout==="dropdown-years";return r?r=h(r):b?r=E(b,0,1):!r&&U&&(r=d(y(l.today??x(),-100))),c?c=p(c):_?c=E(_,11,31):!c&&U&&(c=N(l.today??x())),[r&&m(r),c&&m(c)]}function _2(l,s,r,c){if(r.disableNavigation)return;const{pagedNavigation:d,numberOfMonths:m=1}=r,{startOfMonth:h,addMonths:p,differenceInCalendarMonths:y}=c,N=d?m:1,E=h(l);if(!s)return p(E,N);if(!(y(s,l)<m))return p(E,N)}function k2(l,s,r,c){if(r.disableNavigation)return;const{pagedNavigation:d,numberOfMonths:m}=r,{startOfMonth:h,addMonths:p,differenceInCalendarMonths:y}=c,N=d?m??1:1,E=h(l);if(!s)return p(E,-N);if(!(y(E,s)<=0))return p(E,-N)}function R2(l){const s=[];return l.reduce((r,c)=>r.concat(c.weeks.slice()),s.slice())}function nr(l,s){const[r,c]=v.useState(l);return[s===void 0?r:s,c]}function U2(l,s){const[r,c]=D2(l,s),{startOfMonth:d,endOfMonth:m}=s,h=Op(l,r,c,s),[p,y]=nr(h,l.month?h:void 0);v.useEffect(()=>{const q=Op(l,r,c,s);y(q)},[l.timeZone]);const{months:N,weeks:E,days:x,previousMonth:b,nextMonth:_}=v.useMemo(()=>{const q=O2(p,c,{numberOfMonths:l.numberOfMonths},s),B=z2(q,l.endMonth?m(l.endMonth):void 0,{ISOWeek:l.ISOWeek,fixedWeeks:l.fixedWeeks,broadcastCalendar:l.broadcastCalendar},s),j=A2(q,B,{broadcastCalendar:l.broadcastCalendar,fixedWeeks:l.fixedWeeks,ISOWeek:l.ISOWeek,reverseMonths:l.reverseMonths},s),L=R2(j),W=T2(j),ee=k2(p,r,l,s),he=_2(p,c,l,s);return{months:j,weeks:L,days:W,previousMonth:ee,nextMonth:he}},[s,p.getTime(),c?.getTime(),r?.getTime(),l.disableNavigation,l.broadcastCalendar,l.endMonth?.getTime(),l.fixedWeeks,l.ISOWeek,l.numberOfMonths,l.pagedNavigation,l.reverseMonths]),{disableNavigation:O,onMonthChange:k}=l,U=q=>E.some(B=>B.days.some(j=>j.isEqualTo(q))),M=q=>{if(O)return;let B=d(q);r&&B<d(r)&&(B=d(r)),c&&B>d(c)&&(B=d(c)),y(B),k?.(B)};return{months:N,weeks:E,days:x,navStart:r,navEnd:c,previousMonth:b,nextMonth:_,goToMonth:M,goToDay:q=>{U(q)||M(q.date)}}}var _n;(function(l){l[l.Today=0]="Today",l[l.Selected=1]="Selected",l[l.LastFocused=2]="LastFocused",l[l.FocusedModifier=3]="FocusedModifier"})(_n||(_n={}));function Ap(l){return!l[at.disabled]&&!l[at.hidden]&&!l[at.outside]}function B2(l,s,r,c){let d,m=-1;for(const h of l){const p=s(h);Ap(p)&&(p[at.focused]&&m<_n.FocusedModifier?(d=h,m=_n.FocusedModifier):c?.isEqualTo(h)&&m<_n.LastFocused?(d=h,m=_n.LastFocused):r(h.date)&&m<_n.Selected?(d=h,m=_n.Selected):p[at.today]&&m<_n.Today&&(d=h,m=_n.Today))}return d||(d=l.find(h=>Ap(s(h)))),d}function H2(l,s,r,c,d,m,h){const{ISOWeek:p,broadcastCalendar:y}=m,{addDays:N,addMonths:E,addWeeks:x,addYears:b,endOfBroadcastWeek:_,endOfISOWeek:O,endOfWeek:k,max:U,min:M,startOfBroadcastWeek:V,startOfISOWeek:G,startOfWeek:q}=h;let j={day:N,week:x,month:E,year:b,startOfWeek:L=>y?V(L,h):p?G(L):q(L),endOfWeek:L=>y?_(L):p?O(L):k(L)}[l](r,s==="after"?1:-1);return s==="before"&&c?j=U([c,j]):s==="after"&&d&&(j=M([d,j])),j}function hy(l,s,r,c,d,m,h,p=0){if(p>365)return;const y=H2(l,s,r.date,c,d,m,h),N=!!(m.disabled&&ua(y,m.disabled,h)),E=!!(m.hidden&&ua(y,m.hidden,h)),x=y,b=new Pg(y,x,h);return!N&&!E?b:hy(l,s,b,c,d,m,h,p+1)}function q2(l,s,r,c,d){const{autoFocus:m}=l,[h,p]=v.useState(),y=B2(s.days,r,c||(()=>!1),h),[N,E]=v.useState(m?y:void 0);return{isFocusTarget:k=>!!y?.isEqualTo(k),setFocused:E,focused:N,blur:()=>{p(N),E(void 0)},moveFocus:(k,U)=>{if(!N)return;const M=hy(k,U,N,s.navStart,s.navEnd,l,d);M&&(l.disableNavigation&&!s.days.some(G=>G.isEqualTo(M))||(s.goToDay(M),E(M)))}}}function L2(l,s){const{selected:r,required:c,onSelect:d}=l,[m,h]=nr(r,d?r:void 0),p=d?r:m,{isSameDay:y}=s,N=_=>p?.some(O=>y(O,_))??!1,{min:E,max:x}=l;return{selected:p,select:(_,O,k)=>{let U=[...p??[]];if(N(_)){if(p?.length===E||c&&p?.length===1)return;U=p?.filter(M=>!y(M,_))}else p?.length===x?U=[_]:U=[...U,_];return d||h(U),d?.(U,_,O,k),U},isSelected:N}}function Y2(l,s,r=0,c=0,d=!1,m=Rn){const{from:h,to:p}=s||{},{isSameDay:y,isAfter:N,isBefore:E}=m;let x;if(!h&&!p)x={from:l,to:r>0?void 0:l};else if(h&&!p)y(h,l)?r===0?x={from:h,to:l}:d?x={from:h,to:void 0}:x=void 0:E(l,h)?x={from:l,to:h}:x={from:h,to:l};else if(h&&p)if(y(h,l)&&y(p,l))d?x={from:h,to:p}:x=void 0;else if(y(h,l))x={from:h,to:r>0?void 0:l};else if(y(p,l))x={from:l,to:r>0?void 0:l};else if(E(l,h))x={from:l,to:p};else if(N(l,h))x={from:h,to:l};else if(N(l,p))x={from:h,to:l};else throw new Error("Invalid range");if(x?.from&&x?.to){const b=m.differenceInCalendarDays(x.to,x.from);c>0&&b>c?x={from:l,to:void 0}:r>1&&b<r&&(x={from:l,to:void 0})}return x}function G2(l,s,r=Rn){const c=Array.isArray(s)?s:[s];let d=l.from;const m=r.differenceInCalendarDays(l.to,l.from),h=Math.min(m,6);for(let p=0;p<=h;p++){if(c.includes(d.getDay()))return!0;d=r.addDays(d,1)}return!1}function Dp(l,s,r=Rn){return ra(l,s.from,!1,r)||ra(l,s.to,!1,r)||ra(s,l.from,!1,r)||ra(s,l.to,!1,r)}function K2(l,s,r=Rn){const c=Array.isArray(s)?s:[s];if(c.filter(p=>typeof p!="function").some(p=>typeof p=="boolean"?p:r.isDate(p)?ra(l,p,!1,r):ny(p,r)?p.some(y=>ra(l,y,!1,r)):tr(p)?p.from&&p.to?Dp(l,{from:p.from,to:p.to},r):!1:ty(p)?G2(l,p.dayOfWeek,r):$c(p)?r.isAfter(p.before,p.after)?Dp(l,{from:r.addDays(p.after,1),to:r.addDays(p.before,-1)},r):ua(l.from,p,r)||ua(l.to,p,r):Fc(p)||Ic(p)?ua(l.from,p,r)||ua(l.to,p,r):!1))return!0;const h=c.filter(p=>typeof p=="function");if(h.length){let p=l.from;const y=r.differenceInCalendarDays(l.to,l.from);for(let N=0;N<=y;N++){if(h.some(E=>E(p)))return!0;p=r.addDays(p,1)}}return!1}function V2(l,s){const{disabled:r,excludeDisabled:c,selected:d,required:m,onSelect:h}=l,[p,y]=nr(d,h?d:void 0),N=h?d:p;return{selected:N,select:(b,_,O)=>{const{min:k,max:U}=l,M=b?Y2(b,N,k,U,m,s):void 0;return c&&r&&M?.from&&M.to&&K2({from:M.from,to:M.to},r,s)&&(M.from=b,M.to=void 0),h||y(M),h?.(M,b,_,O),M},isSelected:b=>N&&ra(N,b,!1,s)}}function Q2(l,s){const{selected:r,required:c,onSelect:d}=l,[m,h]=nr(r,d?r:void 0),p=d?r:m,{isSameDay:y}=s;return{selected:p,select:(x,b,_)=>{let O=x;return!c&&p&&p&&y(x,p)&&(O=void 0),d||h(O),d?.(O,x,b,_),O},isSelected:x=>p?y(p,x):!1}}function X2(l,s){const r=Q2(l,s),c=L2(l,s),d=V2(l,s);switch(l.mode){case"single":return r;case"multiple":return c;case"range":return d;default:return}}function Mt(l,s){return l instanceof oa&&l.timeZone===s?l:new oa(l,s)}function _p(l,s){return typeof l=="boolean"||typeof l=="function"?l:l instanceof Date?Mt(l,s):Array.isArray(l)?l.map(r=>r instanceof Date?Mt(r,s):r):tr(l)?{...l,from:l.from?Mt(l.from,s):l.from,to:l.to?Mt(l.to,s):l.to}:$c(l)?{before:Mt(l.before,s),after:Mt(l.after,s)}:Fc(l)?{after:Mt(l.after,s)}:Ic(l)?{before:Mt(l.before,s)}:l}function Ec(l,s){return l&&(Array.isArray(l)?l.map(r=>_p(r,s)):_p(l,s))}function Z2(l){let s=l;const r=s.timeZone;if(r&&(s={...l,timeZone:r},s.today&&(s.today=Mt(s.today,r)),s.month&&(s.month=Mt(s.month,r)),s.defaultMonth&&(s.defaultMonth=Mt(s.defaultMonth,r)),s.startMonth&&(s.startMonth=Mt(s.startMonth,r)),s.endMonth&&(s.endMonth=Mt(s.endMonth,r)),s.mode==="single"&&s.selected?s.selected=Mt(s.selected,r):s.mode==="multiple"&&s.selected?s.selected=s.selected?.map(oe=>Mt(oe,r)):s.mode==="range"&&s.selected&&(s.selected={from:s.selected.from?Mt(s.selected.from,r):s.selected.from,to:s.selected.to?Mt(s.selected.to,r):s.selected.to}),s.disabled!==void 0&&(s.disabled=Ec(s.disabled,r)),s.hidden!==void 0&&(s.hidden=Ec(s.hidden,r)),s.modifiers)){const oe={};Object.keys(s.modifiers).forEach(Se=>{oe[Se]=Ec(s.modifiers?.[Se],r)}),s.modifiers=oe}const{components:c,formatters:d,labels:m,dateLib:h,locale:p,classNames:y}=v.useMemo(()=>{const oe={...Ig,...s.locale},Se=new nn({locale:oe,weekStartsOn:s.broadcastCalendar?1:s.weekStartsOn,firstWeekContainsDate:s.firstWeekContainsDate,useAdditionalWeekYearTokens:s.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:s.useAdditionalDayOfYearTokens,timeZone:s.timeZone,numerals:s.numerals},s.dateLib);return{dateLib:Se,components:a2(s.components),formatters:h2(s.formatters),labels:x2(s.labels,Se.options),locale:oe,classNames:{...s2(),...s.classNames}}},[s.locale,s.broadcastCalendar,s.weekStartsOn,s.firstWeekContainsDate,s.useAdditionalWeekYearTokens,s.useAdditionalDayOfYearTokens,s.timeZone,s.numerals,s.dateLib,s.components,s.formatters,s.labels,s.classNames]);s.today||(s={...s,today:h.today()});const{captionLayout:N,mode:E,navLayout:x,numberOfMonths:b=1,onDayBlur:_,onDayClick:O,onDayFocus:k,onDayKeyDown:U,onDayMouseEnter:M,onDayMouseLeave:V,onNextClick:G,onPrevClick:q,showWeekNumber:B,styles:j}=s,{formatCaption:L,formatDay:W,formatMonthDropdown:ee,formatWeekNumber:he,formatWeekNumberHeader:be,formatWeekdayName:re,formatYearDropdown:Ye}=d,$=U2(s,h),{days:ie,months:D,navStart:J,navEnd:le,previousMonth:ve,nextMonth:xe,goToMonth:Te}=$,de=t2(ie,s,J,le,h),{isSelected:X,select:F,selected:ae}=X2(s,h)??{},{blur:I,focused:ne,isFocusTarget:ye,moveFocus:Oe,setFocused:Ge}=q2(s,$,de,X??(()=>!1),h),{labelDayButton:ht,labelGridcell:pt,labelGrid:Ve,labelMonthDropdown:et,labelNav:At,labelPrevious:Gt,labelNext:Un,labelWeekday:Ne,labelWeekNumber:Kt,labelWeekNumberHeader:En,labelYearDropdown:Vt}=m,ca=v.useMemo(()=>N2(h,s.ISOWeek,s.broadcastCalendar,s.today),[h,s.ISOWeek,s.broadcastCalendar,s.today]),Bn=E!==void 0||O!==void 0,ot=v.useCallback(()=>{ve&&(Te(ve),q?.(ve))},[ve,Te,q]),Qt=v.useCallback(()=>{xe&&(Te(xe),G?.(xe))},[Te,xe,G]),Hn=v.useCallback((oe,Se)=>me=>{me.preventDefault(),me.stopPropagation(),Ge(oe),!Se.disabled&&(F?.(oe.date,Se,me),O?.(oe.date,Se,me))},[F,O,Ge]),qa=v.useCallback((oe,Se)=>me=>{Ge(oe),k?.(oe.date,Se,me)},[k,Ge]),wn=v.useCallback((oe,Se)=>me=>{I(),_?.(oe.date,Se,me)},[I,_]),Mn=v.useCallback((oe,Se)=>me=>{const Me={ArrowLeft:[me.shiftKey?"month":"day",s.dir==="rtl"?"after":"before"],ArrowRight:[me.shiftKey?"month":"day",s.dir==="rtl"?"before":"after"],ArrowDown:[me.shiftKey?"year":"week","after"],ArrowUp:[me.shiftKey?"year":"week","before"],PageUp:[me.shiftKey?"year":"month","before"],PageDown:[me.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Me[me.key]){me.preventDefault(),me.stopPropagation();const[Fe,ge]=Me[me.key];Oe(Fe,ge)}U?.(oe.date,Se,me)},[Oe,U,s.dir]),ul=v.useCallback((oe,Se)=>me=>{M?.(oe.date,Se,me)},[M]),ns=v.useCallback((oe,Se)=>me=>{V?.(oe.date,Se,me)},[V]),as=v.useCallback(oe=>Se=>{const me=Number(Se.target.value),Me=h.setMonth(h.startOfMonth(oe),me);Te(Me)},[h,Te]),qn=v.useCallback(oe=>Se=>{const me=Number(Se.target.value),Me=h.setYear(h.startOfMonth(oe),me);Te(Me)},[h,Te]),{className:Z,style:Ee}=v.useMemo(()=>({className:[y[ue.Root],s.className].filter(Boolean).join(" "),style:{...j?.[ue.Root],...s.style}}),[y,s.className,s.style,j]),fe=l2(s),we=v.useRef(null);M2(we,!!s.animate,{classNames:y,months:D,focused:ne,dateLib:h});const tt={dayPickerProps:s,selected:ae,select:F,isSelected:X,months:D,nextMonth:xe,previousMonth:ve,goToMonth:Te,getModifiers:de,components:c,classNames:y,styles:j,labels:m,formatters:d};return P.createElement(ey.Provider,{value:tt},P.createElement(c.Root,{rootRef:s.animate?we:void 0,className:Z,style:Ee,dir:s.dir,id:s.id,lang:s.lang,nonce:s.nonce,title:s.title,role:s.role,"aria-label":s["aria-label"],"aria-labelledby":s["aria-labelledby"],...fe},P.createElement(c.Months,{className:y[ue.Months],style:j?.[ue.Months]},!s.hideNavigation&&!x&&P.createElement(c.Nav,{"data-animated-nav":s.animate?"true":void 0,className:y[ue.Nav],style:j?.[ue.Nav],"aria-label":At(),onPreviousClick:ot,onNextClick:Qt,previousMonth:ve,nextMonth:xe}),D.map((oe,Se)=>P.createElement(c.Month,{"data-animated-month":s.animate?"true":void 0,className:y[ue.Month],style:j?.[ue.Month],key:Se,displayIndex:Se,calendarMonth:oe},x==="around"&&!s.hideNavigation&&Se===0&&P.createElement(c.PreviousMonthButton,{type:"button",className:y[ue.PreviousMonthButton],tabIndex:ve?void 0:-1,"aria-disabled":ve?void 0:!0,"aria-label":Gt(ve),onClick:ot,"data-animated-button":s.animate?"true":void 0},P.createElement(c.Chevron,{disabled:ve?void 0:!0,className:y[ue.Chevron],orientation:s.dir==="rtl"?"right":"left"})),P.createElement(c.MonthCaption,{"data-animated-caption":s.animate?"true":void 0,className:y[ue.MonthCaption],style:j?.[ue.MonthCaption],calendarMonth:oe,displayIndex:Se},N?.startsWith("dropdown")?P.createElement(c.DropdownNav,{className:y[ue.Dropdowns],style:j?.[ue.Dropdowns]},(()=>{const me=N==="dropdown"||N==="dropdown-months"?P.createElement(c.MonthsDropdown,{key:"month",className:y[ue.MonthsDropdown],"aria-label":et(),classNames:y,components:c,disabled:!!s.disableNavigation,onChange:as(oe.date),options:b2(oe.date,J,le,d,h),style:j?.[ue.Dropdown],value:h.getMonth(oe.date)}):P.createElement("span",{key:"month"},ee(oe.date,h)),Me=N==="dropdown"||N==="dropdown-years"?P.createElement(c.YearsDropdown,{key:"year",className:y[ue.YearsDropdown],"aria-label":Vt(h.options),classNames:y,components:c,disabled:!!s.disableNavigation,onChange:qn(oe.date),options:j2(J,le,d,h,!!s.reverseYears),style:j?.[ue.Dropdown],value:h.getYear(oe.date)}):P.createElement("span",{key:"year"},Ye(oe.date,h));return h.getMonthYearOrder()==="year-first"?[Me,me]:[me,Me]})(),P.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},L(oe.date,h.options,h))):P.createElement(c.CaptionLabel,{className:y[ue.CaptionLabel],role:"status","aria-live":"polite"},L(oe.date,h.options,h))),x==="around"&&!s.hideNavigation&&Se===b-1&&P.createElement(c.NextMonthButton,{type:"button",className:y[ue.NextMonthButton],tabIndex:xe?void 0:-1,"aria-disabled":xe?void 0:!0,"aria-label":Un(xe),onClick:Qt,"data-animated-button":s.animate?"true":void 0},P.createElement(c.Chevron,{disabled:xe?void 0:!0,className:y[ue.Chevron],orientation:s.dir==="rtl"?"left":"right"})),Se===b-1&&x==="after"&&!s.hideNavigation&&P.createElement(c.Nav,{"data-animated-nav":s.animate?"true":void 0,className:y[ue.Nav],style:j?.[ue.Nav],"aria-label":At(),onPreviousClick:ot,onNextClick:Qt,previousMonth:ve,nextMonth:xe}),P.createElement(c.MonthGrid,{role:"grid","aria-multiselectable":E==="multiple"||E==="range","aria-label":Ve(oe.date,h.options,h)||void 0,className:y[ue.MonthGrid],style:j?.[ue.MonthGrid]},!s.hideWeekdays&&P.createElement(c.Weekdays,{"data-animated-weekdays":s.animate?"true":void 0,className:y[ue.Weekdays],style:j?.[ue.Weekdays]},B&&P.createElement(c.WeekNumberHeader,{"aria-label":En(h.options),className:y[ue.WeekNumberHeader],style:j?.[ue.WeekNumberHeader],scope:"col"},be()),ca.map(me=>P.createElement(c.Weekday,{"aria-label":Ne(me,h.options,h),className:y[ue.Weekday],key:String(me),style:j?.[ue.Weekday],scope:"col"},re(me,h.options,h)))),P.createElement(c.Weeks,{"data-animated-weeks":s.animate?"true":void 0,className:y[ue.Weeks],style:j?.[ue.Weeks]},oe.weeks.map(me=>P.createElement(c.Week,{className:y[ue.Week],key:me.weekNumber,style:j?.[ue.Week],week:me},B&&P.createElement(c.WeekNumber,{week:me,style:j?.[ue.WeekNumber],"aria-label":Kt(me.weekNumber,{locale:p}),className:y[ue.WeekNumber],scope:"row",role:"rowheader"},he(me.weekNumber,h)),me.days.map(Me=>{const{date:Fe}=Me,ge=de(Me);if(ge[at.focused]=!ge.hidden&&!!ne?.isEqualTo(Me),ge[Nn.selected]=X?.(Fe)||ge.selected,tr(ae)){const{from:Xt,to:gn}=ae;ge[Nn.range_start]=!!(Xt&&gn&&h.isSameDay(Fe,Xt)),ge[Nn.range_end]=!!(Xt&&gn&&h.isSameDay(Fe,gn)),ge[Nn.range_middle]=ra(ae,Fe,!0,h)}const zt=S2(ge,j,s.modifiersStyles),Ln=n2(ge,y,s.modifiersClassNames),yt=!Bn&&!ge.hidden?pt(Fe,ge,h.options,h):void 0;return P.createElement(c.Day,{key:`${Me.isoDate}_${Me.displayMonthId}`,day:Me,modifiers:ge,className:Ln.join(" "),style:zt,role:"gridcell","aria-selected":ge.selected||void 0,"aria-label":yt,"data-day":Me.isoDate,"data-month":Me.outside?Me.dateMonthId:void 0,"data-selected":ge.selected||void 0,"data-disabled":ge.disabled||void 0,"data-hidden":ge.hidden||void 0,"data-outside":Me.outside||void 0,"data-focused":ge.focused||void 0,"data-today":ge.today||void 0},!ge.hidden&&Bn?P.createElement(c.DayButton,{className:y[ue.DayButton],style:j?.[ue.DayButton],type:"button",day:Me,modifiers:ge,disabled:!ge.focused&&ge.disabled||void 0,"aria-disabled":ge.focused&&ge.disabled||void 0,tabIndex:ye(Me)?0:-1,"aria-label":ht(Fe,ge,h.options,h),onClick:Hn(Me,ge),onBlur:wn(Me,ge),onFocus:qa(Me,ge),onKeyDown:Mn(Me,ge),onMouseEnter:ul(Me,ge),onMouseLeave:ns(Me,ge)},W(Fe,h.options,h)):!ge.hidden&&W(Me.date,h.options,h))})))))))),s.footer&&P.createElement(c.Footer,{className:y[ue.Footer],style:j?.[ue.Footer],role:"status","aria-live":"polite"},s.footer)))}function W2({className:l,classNames:s,showOutsideDays:r=!0,...c}){return o.jsx(Z2,{showOutsideDays:r,className:Q("p-2",l),classNames:{root:"relative",months:"flex flex-col sm:flex-row gap-2 sm:gap-4",month:"flex flex-col gap-2",month_caption:"flex justify-center pt-1 relative items-center h-8",caption_label:"text-sm font-medium",nav:"absolute inset-x-0 top-2 flex items-center justify-between px-1 z-10",button_previous:Q(Oo({variant:"ghost"}),"h-7 w-7 bg-transparent p-0 opacity-70 hover:opacity-100 hover:bg-accent rounded-md"),button_next:Q(Oo({variant:"ghost"}),"h-7 w-7 bg-transparent p-0 opacity-70 hover:opacity-100 hover:bg-accent rounded-md"),month_grid:"w-full border-collapse",weekdays:"flex w-full",weekday:"text-muted-foreground w-8 font-normal text-xs text-center",weeks:"flex flex-col",week:"flex w-full",day:Q("relative h-8 w-8 p-0 text-center text-xs font-normal focus-within:relative focus-within:z-20","hover:bg-accent hover:text-accent-foreground rounded-full select-none"),day_button:Q(Oo({variant:"ghost"}),"h-8 w-8 p-0 font-normal rounded-full text-xs","aria-selected:opacity-100"),range_start:Q("aria-selected:bg-primary aria-selected:text-primary-foreground","aria-selected:rounded-l-full aria-selected:rounded-r-none","aria-selected:hover:bg-primary aria-selected:hover:text-primary-foreground"),range_end:Q("aria-selected:bg-primary aria-selected:text-primary-foreground","aria-selected:rounded-r-full aria-selected:rounded-l-none","aria-selected:hover:bg-primary aria-selected:hover:text-primary-foreground"),range_middle:Q("aria-selected:bg-accent aria-selected:text-accent-foreground","aria-selected:rounded-none"),selected:Q("bg-primary text-primary-foreground rounded-full","hover:bg-primary hover:text-primary-foreground","focus:bg-primary focus:text-primary-foreground"),today:"bg-accent text-accent-foreground rounded-full",outside:"text-muted-foreground opacity-50 aria-selected:bg-accent/50 aria-selected:text-muted-foreground aria-selected:opacity-30",disabled:"text-muted-foreground opacity-50",hidden:"invisible",...s},components:{Chevron:({orientation:d,className:m,...h})=>{const p=d==="left"?pb:d==="right"?qo:d==="up"?_c:Qo;return o.jsx(p,{className:Q("h-4 w-4",m),...h})}},...c})}W2.displayName="Calendar";const J2=v.lazy(()=>Yt(()=>import("./index-DTR-v1v5.js"),__vite__mapDeps([12,1,2,13,4,5,7,14,6,8,9])).then(l=>({default:l.AnalyticsPage}))),$2=v.lazy(()=>Yt(()=>import("./api-Dc9JX5dn.js"),__vite__mapDeps([15,1,2,5,16,6,4,13,7,8,9])).then(l=>({default:l.ApiPage}))),F2=v.lazy(()=>Yt(()=>import("./cliproxy-j1dekKPD.js"),__vite__mapDeps([17,1,2,5,6,4,13,16,7,8,9])).then(l=>({default:l.CliproxyPage}))),I2=v.lazy(()=>Yt(()=>import("./cliproxy-control-panel-DqwBL_cO.js"),__vite__mapDeps([18,1,2,5,4,6,7,8,9])).then(l=>({default:l.CliproxyControlPanelPage}))),P2=v.lazy(()=>Yt(()=>import("./copilot-CV5W8I2b.js"),__vite__mapDeps([19,1,2,5,16,4,3,6,7,8,9])).then(l=>({default:l.CopilotPage}))),eC=v.lazy(()=>Yt(()=>import("./accounts-aD3ar9cM.js"),__vite__mapDeps([20,1,2,5,6,4,7,8,9])).then(l=>({default:l.AccountsPage}))),tC=v.lazy(()=>Yt(()=>Promise.resolve().then(()=>yj),void 0).then(l=>({default:l.SettingsPage}))),nC=v.lazy(()=>Yt(()=>import("./health-DLMVq9vP.js"),__vite__mapDeps([21,1,2,5,6,4,7,8,9])).then(l=>({default:l.HealthPage}))),aC=v.lazy(()=>Yt(()=>import("./shared-BSfovmYC.js"),__vite__mapDeps([22,1,2,13,4,5,6,7,8,9])).then(l=>({default:l.SharedPage})));function lC(){return o.jsx(u0,{client:Ob,children:o.jsx(Db,{defaultTheme:"system",storageKey:"vite-ui-theme",children:o.jsx(_b,{children:o.jsxs(i0,{children:[o.jsx(o0,{children:o.jsxs(bn,{element:o.jsx(BS,{}),children:[o.jsx(bn,{path:"/",element:o.jsx(SN,{})}),o.jsx(bn,{path:"/analytics",element:o.jsx(J2,{})}),o.jsx(bn,{path:"/providers",element:o.jsx($2,{})}),o.jsx(bn,{path:"/cliproxy",element:o.jsx(F2,{})}),o.jsx(bn,{path:"/cliproxy/control-panel",element:o.jsx(I2,{})}),o.jsx(bn,{path:"/copilot",element:o.jsx(P2,{})}),o.jsx(bn,{path:"/accounts",element:o.jsx(eC,{})}),o.jsx(bn,{path:"/settings",element:o.jsx(tC,{})}),o.jsx(bn,{path:"/health",element:o.jsx(nC,{})}),o.jsx(bn,{path:"/shared",element:o.jsx(aC,{})})]})}),o.jsx(c0,{position:"top-right"})]})})})})}const py=document.getElementById("root");if(!py)throw new Error("Root element not found. Failed to mount React application.");Mb.createRoot(py).render(o.jsx(v.StrictMode,{children:o.jsx(lC,{})}));export{Hc as $,dS as A,Ha as B,W2 as C,qg as D,Wc as E,Pl as F,zc as G,_C as H,Ra as I,RC as J,UC as K,Dn as L,Gg as M,BC as N,HC as O,dg as P,XN as Q,kC as R,Le as S,Zo as T,LC as U,ZN as V,JN as W,u1 as X,pC as Y,xC as Z,Bc as _,bt as a,qc as a0,Lc as a1,Yc as a2,qC as a3,WN as a4,TS as a5,bC as a6,SC as a7,NC as a8,jC as a9,YC as aa,CC as ab,MC as ac,EC as ad,wC as ae,St as af,hC as ag,yC as ah,vC as ai,gC as aj,Kg as ak,Yt as al,Oo as am,vN as an,zC as ao,Ug as ap,Bg as aq,Hg as ar,Jg as as,oj as at,uj as au,Zg as av,GC as b,Q as c,KC as d,vj as e,f1 as f,mC as g,m1 as h,ts as i,VC as j,Wo as k,Jo as l,bp as m,UN as n,DC as o,DN as p,TC as q,AC as r,wN as s,jN as t,Rc as u,ON as v,_N as w,OC as x,uS as y,cS as z};
|