@kaitranntt/ccs 7.65.0 → 7.65.2-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/ui/assets/{accounts-BHEYnq6b.js → accounts-Dh95PibK.js} +1 -1
  2. package/dist/ui/assets/{alert-dialog-D0EFRcfB.js → alert-dialog-C5RdUHi9.js} +1 -1
  3. package/dist/ui/assets/{api-DhM3BYXr.js → api-C0ROFLme.js} +1 -1
  4. package/dist/ui/assets/{auth-section-DVp8FQGm.js → auth-section-M2azTP3G.js} +1 -1
  5. package/dist/ui/assets/{backups-section-CRo0NZkA.js → backups-section-DIDUVa0t.js} +1 -1
  6. package/dist/ui/assets/{channels-uZ_9CBqO.js → channels-D_5uerEp.js} +1 -1
  7. package/dist/ui/assets/{checkbox-32DNqW_Q.js → checkbox-CgMg7fDH.js} +1 -1
  8. package/dist/ui/assets/{claude-extension-BfXlz5gV.js → claude-extension-DA9wMzPz.js} +1 -1
  9. package/dist/ui/assets/{cliproxy-DjNY9H-U.js → cliproxy-4yUL1fQw.js} +1 -1
  10. package/dist/ui/assets/{cliproxy-ai-providers-5SHLMHiy.js → cliproxy-ai-providers-DedMcdcc.js} +1 -1
  11. package/dist/ui/assets/{cliproxy-control-panel-Zax_m1AC.js → cliproxy-control-panel-B0kwxgNi.js} +1 -1
  12. package/dist/ui/assets/{codex-CRUSpjsu.js → codex-CAWw4ZNl.js} +1 -1
  13. package/dist/ui/assets/{confirm-dialog-DVf5ZmCZ.js → confirm-dialog-Ds0PYz2R.js} +1 -1
  14. package/dist/ui/assets/{copilot-BZrihl_Z.js → copilot-m6i00mFy.js} +1 -1
  15. package/dist/ui/assets/{cursor-BP4nbEk_.js → cursor-COeD0Dgq.js} +1 -1
  16. package/dist/ui/assets/{droid-BG92rdM2.js → droid-CznUyiRx.js} +1 -1
  17. package/dist/ui/assets/{globalenv-section-Cf6dKgSf.js → globalenv-section-FgK1eGWk.js} +1 -1
  18. package/dist/ui/assets/{health-BTy1UZs3.js → health-Cpu6bD6K.js} +1 -1
  19. package/dist/ui/assets/{index-DuRYaONg.js → index-Bhz6T039.js} +1 -1
  20. package/dist/ui/assets/{index-N2ZSJurX.js → index-C7sG68Mi.js} +1 -1
  21. package/dist/ui/assets/index-CcKb4PL_.js +69 -0
  22. package/dist/ui/assets/{index-wg7UtkFv.js → index-DampXntj.js} +1 -1
  23. package/dist/ui/assets/{index-BVeN0dIB.js → index-DgnxlKNk.js} +1 -1
  24. package/dist/ui/assets/{index-DHrTq-0n.js → index-rTSyskt3.js} +1 -1
  25. package/dist/ui/assets/{masked-input-DX9bedLy.js → masked-input-B_l4FMkE.js} +1 -1
  26. package/dist/ui/assets/{proxy-status-widget-DVDMuZK5.js → proxy-status-widget-C7wSbfPC.js} +1 -1
  27. package/dist/ui/assets/{raw-json-settings-editor-panel-Dkt5E6Z_.js → raw-json-settings-editor-panel-CViWFt6t.js} +1 -1
  28. package/dist/ui/assets/{searchable-select-BP3Q1-Yn.js → searchable-select-7-yJbbw2.js} +1 -1
  29. package/dist/ui/assets/{separator-BLGGUlh9.js → separator-DApM4Wa5.js} +1 -1
  30. package/dist/ui/assets/{shared-G0XRyLig.js → shared-Blmm7sMd.js} +1 -1
  31. package/dist/ui/assets/{table-B4lRrWC-.js → table-BwM4zncv.js} +1 -1
  32. package/dist/ui/assets/{updates--A2Sdo7N.js → updates-DJ0ofB67.js} +1 -1
  33. package/dist/ui/index.html +1 -1
  34. package/package.json +2 -1
  35. package/scripts/github/build-ai-review-packet.mjs +242 -0
  36. package/scripts/github/normalize-ai-review-output.mjs +380 -52
  37. package/scripts/github/prepare-ai-review-scope.mjs +18 -11
  38. package/scripts/github/run-ai-review-direct.mjs +349 -0
  39. package/dist/ui/assets/index-Corv1lSo.js +0 -69
@@ -1,69 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-N2ZSJurX.js","assets/radix-ui-C98W0NRG.js","assets/react-vendor-CNOkPC89.js","assets/masked-input-DX9bedLy.js","assets/icons-CeH5899d.js","assets/tanstack-CfKik0yL.js","assets/notifications-B2HqRBj7.js","assets/utils-CzKF5WmX.js","assets/form-utils-Bcoyqxpq.js","assets/code-highlight-BRUf_pqB.js","assets/index-BVeN0dIB.js","assets/channels-uZ_9CBqO.js","assets/globalenv-section-Cf6dKgSf.js","assets/index-wg7UtkFv.js","assets/index-DuRYaONg.js","assets/default-ports-1QQSffYX.js","assets/proxy-status-widget-DVDMuZK5.js","assets/alert-dialog-D0EFRcfB.js","assets/antigravity-responsibility-constants-Bvh4Ybz0.js","assets/auth-section-DVp8FQGm.js","assets/backups-section-CRo0NZkA.js","assets/index-DHrTq-0n.js","assets/charts-BBPXh0Ar.js","assets/api-DhM3BYXr.js","assets/confirm-dialog-DVf5ZmCZ.js","assets/cliproxy-DjNY9H-U.js","assets/checkbox-32DNqW_Q.js","assets/separator-BLGGUlh9.js","assets/searchable-select-BP3Q1-Yn.js","assets/cliproxy-ai-providers-5SHLMHiy.js","assets/cliproxy-control-panel-Zax_m1AC.js","assets/copilot-BZrihl_Z.js","assets/cursor-BP4nbEk_.js","assets/claude-extension-BfXlz5gV.js","assets/codex-CRUSpjsu.js","assets/table-B4lRrWC-.js","assets/raw-json-settings-editor-panel-Dkt5E6Z_.js","assets/droid-BG92rdM2.js","assets/accounts-BHEYnq6b.js","assets/health-BTy1UZs3.js","assets/shared-G0XRyLig.js","assets/updates--A2Sdo7N.js"])))=>i.map(i=>d[i]);
2
- import{j as l,S as Sl,R as ax,C as ix,a as ox,T as rx,D as sx,P as lx,O as cx,b as jC,c as TC,d as MC,e as EC,f as OC,A as PC,g as LC,h as RC,i as _C,k as zC,l as IC,m as UC,n as HC,I as BC,o as ux,p as KC,q as dx,r as fx,s as qC,t as hx,V as FC,L as px,u as mx,v as GC,w as VC,x as gx,y as YC,z as $C,B as yx,E as QC,F as WC,G as xx,H as XC,J as bx,K as vx,M as Cx,N as ZC,Q as JC,U as eS,W as tS,X as nS,Y as Sx,Z as aS,_ as iS,$ as oS}from"./radix-ui-C98W0NRG.js";import{e as Kd,f as rS,r as S,u as wl,O as Nd,N as sS,h as qd,L as pl,R as lS,g as wx,d as Tg,i as cS,c as se,B as uS,j as dS,k as At}from"./react-vendor-CNOkPC89.js";import{Q as fS,u as Tt,a as rt,b as nt,c as hS,d as pS}from"./tanstack-CfKik0yL.js";import{t as le,T as mS}from"./notifications-B2HqRBj7.js";import{L as On,X as No,P as gS,C as Nl,H as yS,a as xS,K as Ad,G as bS,Z as Nx,b as Ax,F as kx,U as Dx,c as vS,S as CS,A as Rr,d as SS,e as wS,M as NS,E as Al,f as kl,B as AS,R as _r,W as kS,g as DS,h as jS,i as TS,j as Mg,k as Eg,l as Co,m as Fd,n as ml,o as jx,p as Tx,q as MS,r as Br,s as Gd,t as Mx,u as So,T as Gn,v as Dl,w as Kr,x as Og,y as ES,z as Ex,D as Vd,I as OS,J as jl,N as PS,O as LS,Q as RS,V as Tl,Y as _S,_ as zS,$ as Ox,a0 as IS,a1 as US,a2 as HS,a3 as BS,a4 as Yd,a5 as Px,a6 as Pg,a7 as KS,a8 as qS,a9 as FS,aa as GS,ab as VS,ac as Lg,ad as YS,ae as $S}from"./icons-CeH5899d.js";import{t as QS,c as WS,a as Ml,e as Cr,f as Ar,b as XS,d as ZS,g as JS,h as ew,i as tw,j as nw,k as aw,l as iw,m as ow,n as rw,o as sw,p as lw,q as cw,r as uw,s as dw,u as fw,v as hw,w as pw,x as mw,y as gw,z as yw,A as xw,B as bw,C as vw,D as Cw,E as Sw,F as ww,G as Nw,H as Aw,I as kw,J as Dw}from"./utils-CzKF5WmX.js";import{o as Rg,s as _g,p as jw,a as Tw,$ as Mw,b as Lx,c as Za,d as Ew,_ as Ow,u as Pw,e as zg}from"./form-utils-Bcoyqxpq.js";import{H as Lw,t as Ig}from"./code-highlight-BRUf_pqB.js";(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const c of document.querySelectorAll('link[rel="modulepreload"]'))s(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&s(f)}).observe(document,{childList:!0,subtree:!0});function o(c){const d={};return c.integrity&&(d.integrity=c.integrity),c.referrerPolicy&&(d.referrerPolicy=c.referrerPolicy),c.crossOrigin==="use-credentials"?d.credentials="include":c.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function s(c){if(c.ep)return;c.ep=!0;const d=o(c);fetch(c.href,d)}})();var td={exports:{}},Sr={},nd={exports:{}},ad={};var Ug;function Rw(){return Ug||(Ug=1,(function(n){function a(I,X){var ee=I.length;I.push(X);e:for(;0<ee;){var re=ee-1>>>1,fe=I[re];if(0<c(fe,X))I[re]=X,I[ee]=fe,ee=re;else break e}}function o(I){return I.length===0?null:I[0]}function s(I){if(I.length===0)return null;var X=I[0],ee=I.pop();if(ee!==X){I[0]=ee;e:for(var re=0,fe=I.length,he=fe>>>1;re<he;){var de=2*(re+1)-1,H=I[de],Q=de+1,ie=I[Q];if(0>c(H,ee))Q<fe&&0>c(ie,H)?(I[re]=ie,I[Q]=ee,re=Q):(I[re]=H,I[de]=ee,re=de);else if(Q<fe&&0>c(ie,ee))I[re]=ie,I[Q]=ee,re=Q;else break e}}return X}function c(I,X){var ee=I.sortIndex-X.sortIndex;return ee!==0?ee:I.id-X.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;n.unstable_now=function(){return d.now()}}else{var f=Date,p=f.now();n.unstable_now=function(){return f.now()-p}}var m=[],y=[],C=1,x=null,b=3,A=!1,N=!1,E=!1,O=!1,R=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;function j(I){for(var X=o(y);X!==null;){if(X.callback===null)s(y);else if(X.startTime<=I)s(y),X.sortIndex=X.expirationTime,a(m,X);else break;X=o(y)}}function T(I){if(E=!1,j(I),!N)if(o(m)!==null)N=!0,w||(w=!0,Z());else{var X=o(y);X!==null&&be(T,X.startTime-I)}}var w=!1,P=-1,F=5,z=-1;function $(){return O?!0:!(n.unstable_now()-z<F)}function ne(){if(O=!1,w){var I=n.unstable_now();z=I;var X=!0;try{e:{N=!1,E&&(E=!1,k(P),P=-1),A=!0;var ee=b;try{t:{for(j(I),x=o(m);x!==null&&!(x.expirationTime>I&&$());){var re=x.callback;if(typeof re=="function"){x.callback=null,b=x.priorityLevel;var fe=re(x.expirationTime<=I);if(I=n.unstable_now(),typeof fe=="function"){x.callback=fe,j(I),X=!0;break t}x===o(m)&&s(m),j(I)}else s(m);x=o(m)}if(x!==null)X=!0;else{var he=o(y);he!==null&&be(T,he.startTime-I),X=!1}}break e}finally{x=null,b=ee,A=!1}X=void 0}}finally{X?Z():w=!1}}}var Z;if(typeof D=="function")Z=function(){D(ne)};else if(typeof MessageChannel<"u"){var xe=new MessageChannel,te=xe.port2;xe.port1.onmessage=ne,Z=function(){te.postMessage(null)}}else Z=function(){R(ne,0)};function be(I,X){P=R(function(){I(n.unstable_now())},X)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(I){I.callback=null},n.unstable_forceFrameRate=function(I){0>I||125<I?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):F=0<I?Math.floor(1e3/I):5},n.unstable_getCurrentPriorityLevel=function(){return b},n.unstable_next=function(I){switch(b){case 1:case 2:case 3:var X=3;break;default:X=b}var ee=b;b=X;try{return I()}finally{b=ee}},n.unstable_requestPaint=function(){O=!0},n.unstable_runWithPriority=function(I,X){switch(I){case 1:case 2:case 3:case 4:case 5:break;default:I=3}var ee=b;b=I;try{return X()}finally{b=ee}},n.unstable_scheduleCallback=function(I,X,ee){var re=n.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?re+ee:re):ee=re,I){case 1:var fe=-1;break;case 2:fe=250;break;case 5:fe=1073741823;break;case 4:fe=1e4;break;default:fe=5e3}return fe=ee+fe,I={id:C++,callback:X,priorityLevel:I,startTime:ee,expirationTime:fe,sortIndex:-1},ee>re?(I.sortIndex=ee,a(y,I),o(m)===null&&I===o(y)&&(E?(k(P),P=-1):E=!0,be(T,ee-re))):(I.sortIndex=fe,a(m,I),N||A||(N=!0,w||(w=!0,Z()))),I},n.unstable_shouldYield=$,n.unstable_wrapCallback=function(I){var X=b;return function(){var ee=b;b=X;try{return I.apply(this,arguments)}finally{b=ee}}}})(ad)),ad}var Hg;function _w(){return Hg||(Hg=1,nd.exports=Rw()),nd.exports}var Bg;function zw(){if(Bg)return Sr;Bg=1;var n=_w(),a=Kd(),o=rS();function s(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)t+="&args[]="+encodeURIComponent(arguments[i])}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 c(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,i=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(i=t.return),e=t.return;while(e)}return t.tag===3?i:null}function f(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 m(e){if(d(e)!==e)throw Error(s(188))}function y(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(s(188));return t!==e?null:e}for(var i=e,r=t;;){var u=i.return;if(u===null)break;var h=u.alternate;if(h===null){if(r=u.return,r!==null){i=r;continue}break}if(u.child===h.child){for(h=u.child;h;){if(h===i)return m(u),e;if(h===r)return m(u),t;h=h.sibling}throw Error(s(188))}if(i.return!==r.return)i=u,r=h;else{for(var g=!1,v=u.child;v;){if(v===i){g=!0,i=u,r=h;break}if(v===r){g=!0,r=u,i=h;break}v=v.sibling}if(!g){for(v=h.child;v;){if(v===i){g=!0,i=h,r=u;break}if(v===r){g=!0,r=h,i=u;break}v=v.sibling}if(!g)throw Error(s(189))}}if(i.alternate!==r)throw Error(s(190))}if(i.tag!==3)throw Error(s(188));return i.stateNode.current===i?e:t}function C(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=C(e),t!==null)return t;e=e.sibling}return null}var x=Object.assign,b=Symbol.for("react.element"),A=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),E=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),D=Symbol.for("react.context"),j=Symbol.for("react.forward_ref"),T=Symbol.for("react.suspense"),w=Symbol.for("react.suspense_list"),P=Symbol.for("react.memo"),F=Symbol.for("react.lazy"),z=Symbol.for("react.activity"),$=Symbol.for("react.memo_cache_sentinel"),ne=Symbol.iterator;function Z(e){return e===null||typeof e!="object"?null:(e=ne&&e[ne]||e["@@iterator"],typeof e=="function"?e:null)}var xe=Symbol.for("react.client.reference");function te(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===xe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case E:return"Fragment";case R:return"Profiler";case O:return"StrictMode";case T:return"Suspense";case w:return"SuspenseList";case z:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case D:return e.displayName||"Context";case k:return(e._context.displayName||"Context")+".Consumer";case j:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case P:return t=e.displayName||null,t!==null?t:te(e.type)||"Memo";case F:t=e._payload,e=e._init;try{return te(e(t))}catch{}}return null}var be=Array.isArray,I=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,X=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},re=[],fe=-1;function he(e){return{current:e}}function de(e){0>fe||(e.current=re[fe],re[fe]=null,fe--)}function H(e,t){fe++,re[fe]=e.current,e.current=t}var Q=he(null),ie=he(null),ae=he(null),oe=he(null);function ge(e,t){switch(H(ae,t),H(ie,e),H(Q,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Zm(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Zm(t),e=Jm(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}de(Q),H(Q,e)}function De(){de(Q),de(ie),de(ae)}function Ue(e){e.memoizedState!==null&&H(oe,e);var t=Q.current,i=Jm(t,e.type);t!==i&&(H(ie,e),H(Q,i))}function st(e){ie.current===e&&(de(Q),de(ie)),oe.current===e&&(de(oe),yr._currentValue=ee)}var gt,qe;function lt(e){if(gt===void 0)try{throw Error()}catch(i){var t=i.stack.trim().match(/\n( *(at )?)/);gt=t&&t[1]||"",qe=-1<i.stack.indexOf(`
3
- at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
4
- `+gt+e+qe}var Bt=!1;function Xt(e,t){if(!e||Bt)return"";Bt=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var W=function(){throw Error()};if(Object.defineProperty(W.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(W,[])}catch(G){var q=G}Reflect.construct(e,[],W)}else{try{W.call()}catch(G){q=G}e.call(W.prototype)}}else{try{throw Error()}catch(G){q=G}(W=e())&&typeof W.catch=="function"&&W.catch(function(){})}}catch(G){if(G&&q&&typeof G.stack=="string")return[G.stack,q.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=r.DetermineComponentFrameRoot(),g=h[0],v=h[1];if(g&&v){var M=g.split(`
5
- `),B=v.split(`
6
- `);for(u=r=0;r<M.length&&!M[r].includes("DetermineComponentFrameRoot");)r++;for(;u<B.length&&!B[u].includes("DetermineComponentFrameRoot");)u++;if(r===M.length||u===B.length)for(r=M.length-1,u=B.length-1;1<=r&&0<=u&&M[r]!==B[u];)u--;for(;1<=r&&0<=u;r--,u--)if(M[r]!==B[u]){if(r!==1||u!==1)do if(r--,u--,0>u||M[r]!==B[u]){var V=`
7
- `+M[r].replace(" at new "," at ");return e.displayName&&V.includes("<anonymous>")&&(V=V.replace("<anonymous>",e.displayName)),V}while(1<=r&&0<=u);break}}}finally{Bt=!1,Error.prepareStackTrace=i}return(i=e?e.displayName||e.name:"")?lt(i):""}function Yn(e,t){switch(e.tag){case 26:case 27:case 5:return lt(e.type);case 16:return lt("Lazy");case 13:return e.child!==t&&t!==null?lt("Suspense Fallback"):lt("Suspense");case 19:return lt("SuspenseList");case 0:case 15:return Xt(e.type,!1);case 11:return Xt(e.type.render,!1);case 1:return Xt(e.type,!0);case 31:return lt("Activity");default:return""}}function je(e){try{var t="",i=null;do t+=Yn(e,i),i=e,e=e.return;while(e);return t}catch(r){return`
8
- Error generating stack: `+r.message+`
9
- `+r.stack}}var Zt=Object.prototype.hasOwnProperty,Pn=n.unstable_scheduleCallback,Jt=n.unstable_cancelCallback,ka=n.unstable_shouldYield,$n=n.unstable_requestPaint,yt=n.unstable_now,en=n.unstable_getCurrentPriorityLevel,Qn=n.unstable_ImmediatePriority,ni=n.unstable_UserBlockingPriority,Ln=n.unstable_NormalPriority,Rn=n.unstable_LowPriority,Ti=n.unstable_IdlePriority,ko=n.log,Do=n.unstable_setDisableYieldValue,Wn=null,J=null;function Ee(e){if(typeof ko=="function"&&Do(e),J&&typeof J.setStrictMode=="function")try{J.setStrictMode(Wn,e)}catch{}}var Ce=Math.clz32?Math.clz32:me,Oe=Math.log,ct=Math.LN2;function me(e){return e>>>=0,e===0?32:31-(Oe(e)/ct|0)|0}var ke=256,Se=262144,Pe=4194304;function at(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 Ne(e,t,i){var r=e.pendingLanes;if(r===0)return 0;var u=0,h=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var v=r&134217727;return v!==0?(r=v&~h,r!==0?u=at(r):(g&=v,g!==0?u=at(g):i||(i=v&~e,i!==0&&(u=at(i))))):(v=r&~h,v!==0?u=at(v):g!==0?u=at(g):i||(i=r&~e,i!==0&&(u=at(i)))),u===0?0:t!==0&&t!==u&&(t&h)===0&&(h=u&-u,i=t&-t,h>=i||h===32&&(i&4194048)!==0)?t:u}function It(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Xn(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 kt(){var e=Pe;return Pe<<=1,(Pe&62914560)===0&&(Pe=4194304),e}function tn(e){for(var t=[],i=0;31>i;i++)t.push(e);return t}function An(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function jo(e,t,i,r,u,h){var g=e.pendingLanes;e.pendingLanes=i,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=i,e.entangledLanes&=i,e.errorRecoveryDisabledLanes&=i,e.shellSuspendCounter=0;var v=e.entanglements,M=e.expirationTimes,B=e.hiddenUpdates;for(i=g&~i;0<i;){var V=31-Ce(i),W=1<<V;v[V]=0,M[V]=-1;var q=B[V];if(q!==null)for(B[V]=null,V=0;V<q.length;V++){var G=q[V];G!==null&&(G.lane&=-536870913)}i&=~W}r!==0&&ai(e,r,0),h!==0&&u===0&&e.tag!==0&&(e.suspendedLanes|=h&~(g&~t))}function ai(e,t,i){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ce(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|i&261930}function To(e,t){var i=e.entangledLanes|=t;for(e=e.entanglements;i;){var r=31-Ce(i),u=1<<r;u&t|e[r]&t&&(e[r]|=t),i&=~u}}function pn(e,t){var i=t&-t;return i=(i&42)!==0?1:Zn(i),(i&(e.suspendedLanes|t))!==0?0:i}function Zn(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 Mi(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Mo(){var e=X.p;return e!==0?e:(e=window.event,e===void 0?32:Sg(e.type))}function Eo(e,t){var i=X.p;try{return X.p=e,t()}finally{X.p=i}}var Da=Math.random().toString(36).slice(2),Et="__reactFiber$"+Da,Kt="__reactProps$"+Da,Ei="__reactContainer$"+Da,Vl="__reactEvents$"+Da,yv="__reactListeners$"+Da,xv="__reactHandles$"+Da,Uf="__reactResources$"+Da,Oo="__reactMarker$"+Da;function Yl(e){delete e[Et],delete e[Kt],delete e[Vl],delete e[yv],delete e[xv]}function Oi(e){var t=e[Et];if(t)return t;for(var i=e.parentNode;i;){if(t=i[Ei]||i[Et]){if(i=t.alternate,t.child!==null||i!==null&&i.child!==null)for(e=rg(e);e!==null;){if(i=e[Et])return i;e=rg(e)}return t}e=i,i=e.parentNode}return null}function Pi(e){if(e=e[Et]||e[Ei]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Po(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(s(33))}function Li(e){var t=e[Uf];return t||(t=e[Uf]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Dt(e){e[Oo]=!0}var Hf=new Set,Bf={};function ii(e,t){Ri(e,t),Ri(e+"Capture",t)}function Ri(e,t){for(Bf[e]=t,e=0;e<t.length;e++)Hf.add(t[e])}var bv=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]*$"),Kf={},qf={};function vv(e){return Zt.call(qf,e)?!0:Zt.call(Kf,e)?!1:bv.test(e)?qf[e]=!0:(Kf[e]=!0,!1)}function Yr(e,t,i){if(vv(t))if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var r=t.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+i)}}function $r(e,t,i){if(i===null)e.removeAttribute(t);else{switch(typeof i){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+i)}}function Jn(e,t,i,r){if(r===null)e.removeAttribute(i);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttributeNS(t,i,""+r)}}function mn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Ff(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Cv(e,t,i){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var u=r.get,h=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return u.call(this)},set:function(g){i=""+g,h.call(this,g)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return i},setValue:function(g){i=""+g},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function $l(e){if(!e._valueTracker){var t=Ff(e)?"checked":"value";e._valueTracker=Cv(e,t,""+e[t])}}function Gf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var i=t.getValue(),r="";return e&&(r=Ff(e)?e.checked?"true":"false":e.value),e=r,e!==i?(t.setValue(e),!0):!1}function Qr(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 Sv=/[\n"\\]/g;function gn(e){return e.replace(Sv,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Ql(e,t,i,r,u,h,g,v){e.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.type=g:e.removeAttribute("type"),t!=null?g==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+mn(t)):e.value!==""+mn(t)&&(e.value=""+mn(t)):g!=="submit"&&g!=="reset"||e.removeAttribute("value"),t!=null?Wl(e,g,mn(t)):i!=null?Wl(e,g,mn(i)):r!=null&&e.removeAttribute("value"),u==null&&h!=null&&(e.defaultChecked=!!h),u!=null&&(e.checked=u&&typeof u!="function"&&typeof u!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.name=""+mn(v):e.removeAttribute("name")}function Vf(e,t,i,r,u,h,g,v){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),t!=null||i!=null){if(!(h!=="submit"&&h!=="reset"||t!=null)){$l(e);return}i=i!=null?""+mn(i):"",t=t!=null?""+mn(t):i,v||t===e.value||(e.value=t),e.defaultValue=t}r=r??u,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=v?e.checked:!!r,e.defaultChecked=!!r,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.name=g),$l(e)}function Wl(e,t,i){t==="number"&&Qr(e.ownerDocument)===e||e.defaultValue===""+i||(e.defaultValue=""+i)}function _i(e,t,i,r){if(e=e.options,t){t={};for(var u=0;u<i.length;u++)t["$"+i[u]]=!0;for(i=0;i<e.length;i++)u=t.hasOwnProperty("$"+e[i].value),e[i].selected!==u&&(e[i].selected=u),u&&r&&(e[i].defaultSelected=!0)}else{for(i=""+mn(i),t=null,u=0;u<e.length;u++){if(e[u].value===i){e[u].selected=!0,r&&(e[u].defaultSelected=!0);return}t!==null||e[u].disabled||(t=e[u])}t!==null&&(t.selected=!0)}}function Yf(e,t,i){if(t!=null&&(t=""+mn(t),t!==e.value&&(e.value=t),i==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=i!=null?""+mn(i):""}function $f(e,t,i,r){if(t==null){if(r!=null){if(i!=null)throw Error(s(92));if(be(r)){if(1<r.length)throw Error(s(93));r=r[0]}i=r}i==null&&(i=""),t=i}i=mn(t),e.defaultValue=i,r=e.textContent,r===i&&r!==""&&r!==null&&(e.value=r),$l(e)}function zi(e,t){if(t){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=t;return}}e.textContent=t}var wv=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 Qf(e,t,i){var r=t.indexOf("--")===0;i==null||typeof i=="boolean"||i===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,i):typeof i!="number"||i===0||wv.has(t)?t==="float"?e.cssFloat=i:e[t]=(""+i).trim():e[t]=i+"px"}function Wf(e,t,i){if(t!=null&&typeof t!="object")throw Error(s(62));if(e=e.style,i!=null){for(var r in i)!i.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var u in t)r=t[u],t.hasOwnProperty(u)&&i[u]!==r&&Qf(e,u,r)}else for(var h in t)t.hasOwnProperty(h)&&Qf(e,h,t[h])}function Xl(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 Nv=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"]]),Av=/^[\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 Wr(e){return Av.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ea(){}var Zl=null;function Jl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ii=null,Ui=null;function Xf(e){var t=Pi(e);if(t&&(e=t.stateNode)){var i=e[Kt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Ql(e,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name),t=i.name,i.type==="radio"&&t!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll('input[name="'+gn(""+t)+'"][type="radio"]'),t=0;t<i.length;t++){var r=i[t];if(r!==e&&r.form===e.form){var u=r[Kt]||null;if(!u)throw Error(s(90));Ql(r,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name)}}for(t=0;t<i.length;t++)r=i[t],r.form===e.form&&Gf(r)}break e;case"textarea":Yf(e,i.value,i.defaultValue);break e;case"select":t=i.value,t!=null&&_i(e,!!i.multiple,t,!1)}}}var ec=!1;function Zf(e,t,i){if(ec)return e(t,i);ec=!0;try{var r=e(t);return r}finally{if(ec=!1,(Ii!==null||Ui!==null)&&(zs(),Ii&&(t=Ii,e=Ui,Ui=Ii=null,Xf(t),e)))for(t=0;t<e.length;t++)Xf(e[t])}}function Lo(e,t){var i=e.stateNode;if(i===null)return null;var r=i[Kt]||null;if(r===null)return null;i=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(s(231,t,typeof i));return i}var ta=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),tc=!1;if(ta)try{var Ro={};Object.defineProperty(Ro,"passive",{get:function(){tc=!0}}),window.addEventListener("test",Ro,Ro),window.removeEventListener("test",Ro,Ro)}catch{tc=!1}var ja=null,nc=null,Xr=null;function Jf(){if(Xr)return Xr;var e,t=nc,i=t.length,r,u="value"in ja?ja.value:ja.textContent,h=u.length;for(e=0;e<i&&t[e]===u[e];e++);var g=i-e;for(r=1;r<=g&&t[i-r]===u[h-r];r++);return Xr=u.slice(e,1<r?1-r:void 0)}function Zr(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 Jr(){return!0}function eh(){return!1}function qt(e){function t(i,r,u,h,g){this._reactName=i,this._targetInst=u,this.type=r,this.nativeEvent=h,this.target=g,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(i=e[v],this[v]=i?i(h):h[v]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?Jr:eh,this.isPropagationStopped=eh,this}return x(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Jr)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Jr)},persist:function(){},isPersistent:Jr}),t}var oi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},es=qt(oi),_o=x({},oi,{view:0,detail:0}),kv=qt(_o),ac,ic,zo,ts=x({},_o,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rc,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!==zo&&(zo&&e.type==="mousemove"?(ac=e.screenX-zo.screenX,ic=e.screenY-zo.screenY):ic=ac=0,zo=e),ac)},movementY:function(e){return"movementY"in e?e.movementY:ic}}),th=qt(ts),Dv=x({},ts,{dataTransfer:0}),jv=qt(Dv),Tv=x({},_o,{relatedTarget:0}),oc=qt(Tv),Mv=x({},oi,{animationName:0,elapsedTime:0,pseudoElement:0}),Ev=qt(Mv),Ov=x({},oi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Pv=qt(Ov),Lv=x({},oi,{data:0}),nh=qt(Lv),Rv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},_v={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"},zv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Iv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=zv[e])?!!t[e]:!1}function rc(){return Iv}var Uv=x({},_o,{key:function(e){if(e.key){var t=Rv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Zr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?_v[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rc,charCode:function(e){return e.type==="keypress"?Zr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Zr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Hv=qt(Uv),Bv=x({},ts,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),ah=qt(Bv),Kv=x({},_o,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rc}),qv=qt(Kv),Fv=x({},oi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Gv=qt(Fv),Vv=x({},ts,{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}),Yv=qt(Vv),$v=x({},oi,{newState:0,oldState:0}),Qv=qt($v),Wv=[9,13,27,32],sc=ta&&"CompositionEvent"in window,Io=null;ta&&"documentMode"in document&&(Io=document.documentMode);var Xv=ta&&"TextEvent"in window&&!Io,ih=ta&&(!sc||Io&&8<Io&&11>=Io),oh=" ",rh=!1;function sh(e,t){switch(e){case"keyup":return Wv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function lh(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Hi=!1;function Zv(e,t){switch(e){case"compositionend":return lh(t);case"keypress":return t.which!==32?null:(rh=!0,oh);case"textInput":return e=t.data,e===oh&&rh?null:e;default:return null}}function Jv(e,t){if(Hi)return e==="compositionend"||!sc&&sh(e,t)?(e=Jf(),Xr=nc=ja=null,Hi=!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 ih&&t.locale!=="ko"?null:t.data;default:return null}}var e0={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 ch(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!e0[e.type]:t==="textarea"}function uh(e,t,i,r){Ii?Ui?Ui.push(r):Ui=[r]:Ii=r,t=Fs(t,"onChange"),0<t.length&&(i=new es("onChange","change",null,i,r),e.push({event:i,listeners:t}))}var Uo=null,Ho=null;function t0(e){Vm(e,0)}function ns(e){var t=Po(e);if(Gf(t))return e}function dh(e,t){if(e==="change")return t}var fh=!1;if(ta){var lc;if(ta){var cc="oninput"in document;if(!cc){var hh=document.createElement("div");hh.setAttribute("oninput","return;"),cc=typeof hh.oninput=="function"}lc=cc}else lc=!1;fh=lc&&(!document.documentMode||9<document.documentMode)}function ph(){Uo&&(Uo.detachEvent("onpropertychange",mh),Ho=Uo=null)}function mh(e){if(e.propertyName==="value"&&ns(Ho)){var t=[];uh(t,Ho,e,Jl(e)),Zf(t0,t)}}function n0(e,t,i){e==="focusin"?(ph(),Uo=t,Ho=i,Uo.attachEvent("onpropertychange",mh)):e==="focusout"&&ph()}function a0(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ns(Ho)}function i0(e,t){if(e==="click")return ns(t)}function o0(e,t){if(e==="input"||e==="change")return ns(t)}function r0(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var nn=typeof Object.is=="function"?Object.is:r0;function Bo(e,t){if(nn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var i=Object.keys(e),r=Object.keys(t);if(i.length!==r.length)return!1;for(r=0;r<i.length;r++){var u=i[r];if(!Zt.call(t,u)||!nn(e[u],t[u]))return!1}return!0}function gh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function yh(e,t){var i=gh(e);e=0;for(var r;i;){if(i.nodeType===3){if(r=e+i.textContent.length,e<=t&&r>=t)return{node:i,offset:t-e};e=r}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=gh(i)}}function xh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?xh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function bh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Qr(e.document);t instanceof e.HTMLIFrameElement;){try{var i=typeof t.contentWindow.location.href=="string"}catch{i=!1}if(i)e=t.contentWindow;else break;t=Qr(e.document)}return t}function uc(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 s0=ta&&"documentMode"in document&&11>=document.documentMode,Bi=null,dc=null,Ko=null,fc=!1;function vh(e,t,i){var r=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;fc||Bi==null||Bi!==Qr(r)||(r=Bi,"selectionStart"in r&&uc(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ko&&Bo(Ko,r)||(Ko=r,r=Fs(dc,"onSelect"),0<r.length&&(t=new es("onSelect","select",null,t,i),e.push({event:t,listeners:r}),t.target=Bi)))}function ri(e,t){var i={};return i[e.toLowerCase()]=t.toLowerCase(),i["Webkit"+e]="webkit"+t,i["Moz"+e]="moz"+t,i}var Ki={animationend:ri("Animation","AnimationEnd"),animationiteration:ri("Animation","AnimationIteration"),animationstart:ri("Animation","AnimationStart"),transitionrun:ri("Transition","TransitionRun"),transitionstart:ri("Transition","TransitionStart"),transitioncancel:ri("Transition","TransitionCancel"),transitionend:ri("Transition","TransitionEnd")},hc={},Ch={};ta&&(Ch=document.createElement("div").style,"AnimationEvent"in window||(delete Ki.animationend.animation,delete Ki.animationiteration.animation,delete Ki.animationstart.animation),"TransitionEvent"in window||delete Ki.transitionend.transition);function si(e){if(hc[e])return hc[e];if(!Ki[e])return e;var t=Ki[e],i;for(i in t)if(t.hasOwnProperty(i)&&i in Ch)return hc[e]=t[i];return e}var Sh=si("animationend"),wh=si("animationiteration"),Nh=si("animationstart"),l0=si("transitionrun"),c0=si("transitionstart"),u0=si("transitioncancel"),Ah=si("transitionend"),kh=new Map,pc="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(" ");pc.push("scrollEnd");function kn(e,t){kh.set(e,t),ii(t,[e])}var as=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)},yn=[],qi=0,mc=0;function is(){for(var e=qi,t=mc=qi=0;t<e;){var i=yn[t];yn[t++]=null;var r=yn[t];yn[t++]=null;var u=yn[t];yn[t++]=null;var h=yn[t];if(yn[t++]=null,r!==null&&u!==null){var g=r.pending;g===null?u.next=u:(u.next=g.next,g.next=u),r.pending=u}h!==0&&Dh(i,u,h)}}function os(e,t,i,r){yn[qi++]=e,yn[qi++]=t,yn[qi++]=i,yn[qi++]=r,mc|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function gc(e,t,i,r){return os(e,t,i,r),rs(e)}function li(e,t){return os(e,null,null,t),rs(e)}function Dh(e,t,i){e.lanes|=i;var r=e.alternate;r!==null&&(r.lanes|=i);for(var u=!1,h=e.return;h!==null;)h.childLanes|=i,r=h.alternate,r!==null&&(r.childLanes|=i),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(u=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,u&&t!==null&&(u=31-Ce(i),e=h.hiddenUpdates,r=e[u],r===null?e[u]=[t]:r.push(t),t.lane=i|536870912),h):null}function rs(e){if(50<ur)throw ur=0,Au=null,Error(s(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Fi={};function d0(e,t,i,r){this.tag=e,this.key=i,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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function an(e,t,i,r){return new d0(e,t,i,r)}function yc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function na(e,t){var i=e.alternate;return i===null?(i=an(e.tag,t,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=t,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&65011712,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,t=e.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i.refCleanup=e.refCleanup,i}function jh(e,t){e.flags&=65011714;var i=e.alternate;return i===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=i.childLanes,e.lanes=i.lanes,e.child=i.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=i.memoizedProps,e.memoizedState=i.memoizedState,e.updateQueue=i.updateQueue,e.type=i.type,t=i.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function ss(e,t,i,r,u,h){var g=0;if(r=e,typeof e=="function")yc(e)&&(g=1);else if(typeof e=="string")g=gC(e,i,Q.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case z:return e=an(31,i,t,u),e.elementType=z,e.lanes=h,e;case E:return ci(i.children,u,h,t);case O:g=8,u|=24;break;case R:return e=an(12,i,t,u|2),e.elementType=R,e.lanes=h,e;case T:return e=an(13,i,t,u),e.elementType=T,e.lanes=h,e;case w:return e=an(19,i,t,u),e.elementType=w,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case D:g=10;break e;case k:g=9;break e;case j:g=11;break e;case P:g=14;break e;case F:g=16,r=null;break e}g=29,i=Error(s(130,e===null?"null":typeof e,"")),r=null}return t=an(g,i,t,u),t.elementType=e,t.type=r,t.lanes=h,t}function ci(e,t,i,r){return e=an(7,e,r,t),e.lanes=i,e}function xc(e,t,i){return e=an(6,e,null,t),e.lanes=i,e}function Th(e){var t=an(18,null,null,0);return t.stateNode=e,t}function bc(e,t,i){return t=an(4,e.children!==null?e.children:[],e.key,t),t.lanes=i,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Mh=new WeakMap;function xn(e,t){if(typeof e=="object"&&e!==null){var i=Mh.get(e);return i!==void 0?i:(t={value:e,source:t,stack:je(t)},Mh.set(e,t),t)}return{value:e,source:t,stack:je(t)}}var Gi=[],Vi=0,ls=null,qo=0,bn=[],vn=0,Ta=null,_n=1,zn="";function aa(e,t){Gi[Vi++]=qo,Gi[Vi++]=ls,ls=e,qo=t}function Eh(e,t,i){bn[vn++]=_n,bn[vn++]=zn,bn[vn++]=Ta,Ta=e;var r=_n;e=zn;var u=32-Ce(r)-1;r&=~(1<<u),i+=1;var h=32-Ce(t)+u;if(30<h){var g=u-u%5;h=(r&(1<<g)-1).toString(32),r>>=g,u-=g,_n=1<<32-Ce(t)+u|i<<u|r,zn=h+e}else _n=1<<h|i<<u|r,zn=e}function vc(e){e.return!==null&&(aa(e,1),Eh(e,1,0))}function Cc(e){for(;e===ls;)ls=Gi[--Vi],Gi[Vi]=null,qo=Gi[--Vi],Gi[Vi]=null;for(;e===Ta;)Ta=bn[--vn],bn[vn]=null,zn=bn[--vn],bn[vn]=null,_n=bn[--vn],bn[vn]=null}function Oh(e,t){bn[vn++]=_n,bn[vn++]=zn,bn[vn++]=Ta,_n=t.id,zn=t.overflow,Ta=e}var Ot=null,it=null,He=!1,Ma=null,Cn=!1,Sc=Error(s(519));function Ea(e){var t=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Fo(xn(t,e)),Sc}function Ph(e){var t=e.stateNode,i=e.type,r=e.memoizedProps;switch(t[Et]=e,t[Kt]=r,i){case"dialog":_e("cancel",t),_e("close",t);break;case"iframe":case"object":case"embed":_e("load",t);break;case"video":case"audio":for(i=0;i<fr.length;i++)_e(fr[i],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),Vf(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":_e("invalid",t);break;case"textarea":_e("invalid",t),$f(t,r.value,r.defaultValue,r.children)}i=r.children,typeof i!="string"&&typeof i!="number"&&typeof i!="bigint"||t.textContent===""+i||r.suppressHydrationWarning===!0||Wm(t.textContent,i)?(r.popover!=null&&(_e("beforetoggle",t),_e("toggle",t)),r.onScroll!=null&&_e("scroll",t),r.onScrollEnd!=null&&_e("scrollend",t),r.onClick!=null&&(t.onclick=ea),t=!0):t=!1,t||Ea(e,!0)}function Lh(e){for(Ot=e.return;Ot;)switch(Ot.tag){case 5:case 31:case 13:Cn=!1;return;case 27:case 3:Cn=!0;return;default:Ot=Ot.return}}function Yi(e){if(e!==Ot)return!1;if(!He)return Lh(e),He=!0,!1;var t=e.tag,i;if((i=t!==3&&t!==27)&&((i=t===5)&&(i=e.type,i=!(i!=="form"&&i!=="button")||Hu(e.type,e.memoizedProps)),i=!i),i&&it&&Ea(e),Lh(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));it=og(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));it=og(e)}else t===27?(t=it,Ga(e.type)?(e=Gu,Gu=null,it=e):it=t):it=Ot?wn(e.stateNode.nextSibling):null;return!0}function ui(){it=Ot=null,He=!1}function wc(){var e=Ma;return e!==null&&(Yt===null?Yt=e:Yt.push.apply(Yt,e),Ma=null),e}function Fo(e){Ma===null?Ma=[e]:Ma.push(e)}var Nc=he(null),di=null,ia=null;function Oa(e,t,i){H(Nc,t._currentValue),t._currentValue=i}function oa(e){e._currentValue=Nc.current,de(Nc)}function Ac(e,t,i){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===i)break;e=e.return}}function kc(e,t,i,r){var u=e.child;for(u!==null&&(u.return=e);u!==null;){var h=u.dependencies;if(h!==null){var g=u.child;h=h.firstContext;e:for(;h!==null;){var v=h;h=u;for(var M=0;M<t.length;M++)if(v.context===t[M]){h.lanes|=i,v=h.alternate,v!==null&&(v.lanes|=i),Ac(h.return,i,e),r||(g=null);break e}h=v.next}}else if(u.tag===18){if(g=u.return,g===null)throw Error(s(341));g.lanes|=i,h=g.alternate,h!==null&&(h.lanes|=i),Ac(g,i,e),g=null}else g=u.child;if(g!==null)g.return=u;else for(g=u;g!==null;){if(g===e){g=null;break}if(u=g.sibling,u!==null){u.return=g.return,g=u;break}g=g.return}u=g}}function $i(e,t,i,r){e=null;for(var u=t,h=!1;u!==null;){if(!h){if((u.flags&524288)!==0)h=!0;else if((u.flags&262144)!==0)break}if(u.tag===10){var g=u.alternate;if(g===null)throw Error(s(387));if(g=g.memoizedProps,g!==null){var v=u.type;nn(u.pendingProps.value,g.value)||(e!==null?e.push(v):e=[v])}}else if(u===oe.current){if(g=u.alternate,g===null)throw Error(s(387));g.memoizedState.memoizedState!==u.memoizedState.memoizedState&&(e!==null?e.push(yr):e=[yr])}u=u.return}e!==null&&kc(t,e,i,r),t.flags|=262144}function cs(e){for(e=e.firstContext;e!==null;){if(!nn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function fi(e){di=e,ia=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Pt(e){return Rh(di,e)}function us(e,t){return di===null&&fi(e),Rh(e,t)}function Rh(e,t){var i=t._currentValue;if(t={context:t,memoizedValue:i,next:null},ia===null){if(e===null)throw Error(s(308));ia=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ia=ia.next=t;return i}var f0=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(i,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(i){return i()})}},h0=n.unstable_scheduleCallback,p0=n.unstable_NormalPriority,vt={$$typeof:D,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Dc(){return{controller:new f0,data:new Map,refCount:0}}function Go(e){e.refCount--,e.refCount===0&&h0(p0,function(){e.controller.abort()})}var Vo=null,jc=0,Qi=0,Wi=null;function m0(e,t){if(Vo===null){var i=Vo=[];jc=0,Qi=Eu(),Wi={status:"pending",value:void 0,then:function(r){i.push(r)}}}return jc++,t.then(_h,_h),t}function _h(){if(--jc===0&&Vo!==null){Wi!==null&&(Wi.status="fulfilled");var e=Vo;Vo=null,Qi=0,Wi=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function g0(e,t){var i=[],r={status:"pending",value:null,reason:null,then:function(u){i.push(u)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var u=0;u<i.length;u++)(0,i[u])(t)},function(u){for(r.status="rejected",r.reason=u,u=0;u<i.length;u++)(0,i[u])(void 0)}),r}var zh=I.S;I.S=function(e,t){vm=yt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&m0(e,t),zh!==null&&zh(e,t)};var hi=he(null);function Tc(){var e=hi.current;return e!==null?e:et.pooledCache}function ds(e,t){t===null?H(hi,hi.current):H(hi,t.pool)}function Ih(){var e=Tc();return e===null?null:{parent:vt._currentValue,pool:e}}var Xi=Error(s(460)),Mc=Error(s(474)),fs=Error(s(542)),hs={then:function(){}};function Uh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Hh(e,t,i){switch(i=e[i],i===void 0?e.push(t):i!==t&&(t.then(ea,ea),t=i),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Kh(e),e;default:if(typeof t.status=="string")t.then(ea,ea);else{if(e=et,e!==null&&100<e.shellSuspendCounter)throw Error(s(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var u=t;u.status="fulfilled",u.value=r}},function(r){if(t.status==="pending"){var u=t;u.status="rejected",u.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Kh(e),e}throw mi=t,Xi}}function pi(e){try{var t=e._init;return t(e._payload)}catch(i){throw i!==null&&typeof i=="object"&&typeof i.then=="function"?(mi=i,Xi):i}}var mi=null;function Bh(){if(mi===null)throw Error(s(459));var e=mi;return mi=null,e}function Kh(e){if(e===Xi||e===fs)throw Error(s(483))}var Zi=null,Yo=0;function ps(e){var t=Yo;return Yo+=1,Zi===null&&(Zi=[]),Hh(Zi,e,t)}function $o(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ms(e,t){throw t.$$typeof===b?Error(s(525)):(e=Object.prototype.toString.call(t),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function qh(e){function t(_,L){if(e){var U=_.deletions;U===null?(_.deletions=[L],_.flags|=16):U.push(L)}}function i(_,L){if(!e)return null;for(;L!==null;)t(_,L),L=L.sibling;return null}function r(_){for(var L=new Map;_!==null;)_.key!==null?L.set(_.key,_):L.set(_.index,_),_=_.sibling;return L}function u(_,L){return _=na(_,L),_.index=0,_.sibling=null,_}function h(_,L,U){return _.index=U,e?(U=_.alternate,U!==null?(U=U.index,U<L?(_.flags|=67108866,L):U):(_.flags|=67108866,L)):(_.flags|=1048576,L)}function g(_){return e&&_.alternate===null&&(_.flags|=67108866),_}function v(_,L,U,Y){return L===null||L.tag!==6?(L=xc(U,_.mode,Y),L.return=_,L):(L=u(L,U),L.return=_,L)}function M(_,L,U,Y){var ve=U.type;return ve===E?V(_,L,U.props.children,Y,U.key):L!==null&&(L.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===F&&pi(ve)===L.type)?(L=u(L,U.props),$o(L,U),L.return=_,L):(L=ss(U.type,U.key,U.props,null,_.mode,Y),$o(L,U),L.return=_,L)}function B(_,L,U,Y){return L===null||L.tag!==4||L.stateNode.containerInfo!==U.containerInfo||L.stateNode.implementation!==U.implementation?(L=bc(U,_.mode,Y),L.return=_,L):(L=u(L,U.children||[]),L.return=_,L)}function V(_,L,U,Y,ve){return L===null||L.tag!==7?(L=ci(U,_.mode,Y,ve),L.return=_,L):(L=u(L,U),L.return=_,L)}function W(_,L,U){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return L=xc(""+L,_.mode,U),L.return=_,L;if(typeof L=="object"&&L!==null){switch(L.$$typeof){case A:return U=ss(L.type,L.key,L.props,null,_.mode,U),$o(U,L),U.return=_,U;case N:return L=bc(L,_.mode,U),L.return=_,L;case F:return L=pi(L),W(_,L,U)}if(be(L)||Z(L))return L=ci(L,_.mode,U,null),L.return=_,L;if(typeof L.then=="function")return W(_,ps(L),U);if(L.$$typeof===D)return W(_,us(_,L),U);ms(_,L)}return null}function q(_,L,U,Y){var ve=L!==null?L.key:null;if(typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint")return ve!==null?null:v(_,L,""+U,Y);if(typeof U=="object"&&U!==null){switch(U.$$typeof){case A:return U.key===ve?M(_,L,U,Y):null;case N:return U.key===ve?B(_,L,U,Y):null;case F:return U=pi(U),q(_,L,U,Y)}if(be(U)||Z(U))return ve!==null?null:V(_,L,U,Y,null);if(typeof U.then=="function")return q(_,L,ps(U),Y);if(U.$$typeof===D)return q(_,L,us(_,U),Y);ms(_,U)}return null}function G(_,L,U,Y,ve){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return _=_.get(U)||null,v(L,_,""+Y,ve);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case A:return _=_.get(Y.key===null?U:Y.key)||null,M(L,_,Y,ve);case N:return _=_.get(Y.key===null?U:Y.key)||null,B(L,_,Y,ve);case F:return Y=pi(Y),G(_,L,U,Y,ve)}if(be(Y)||Z(Y))return _=_.get(U)||null,V(L,_,Y,ve,null);if(typeof Y.then=="function")return G(_,L,U,ps(Y),ve);if(Y.$$typeof===D)return G(_,L,U,us(L,Y),ve);ms(L,Y)}return null}function ue(_,L,U,Y){for(var ve=null,Ge=null,pe=L,Me=L=0,Ie=null;pe!==null&&Me<U.length;Me++){pe.index>Me?(Ie=pe,pe=null):Ie=pe.sibling;var Ve=q(_,pe,U[Me],Y);if(Ve===null){pe===null&&(pe=Ie);break}e&&pe&&Ve.alternate===null&&t(_,pe),L=h(Ve,L,Me),Ge===null?ve=Ve:Ge.sibling=Ve,Ge=Ve,pe=Ie}if(Me===U.length)return i(_,pe),He&&aa(_,Me),ve;if(pe===null){for(;Me<U.length;Me++)pe=W(_,U[Me],Y),pe!==null&&(L=h(pe,L,Me),Ge===null?ve=pe:Ge.sibling=pe,Ge=pe);return He&&aa(_,Me),ve}for(pe=r(pe);Me<U.length;Me++)Ie=G(pe,_,Me,U[Me],Y),Ie!==null&&(e&&Ie.alternate!==null&&pe.delete(Ie.key===null?Me:Ie.key),L=h(Ie,L,Me),Ge===null?ve=Ie:Ge.sibling=Ie,Ge=Ie);return e&&pe.forEach(function(Wa){return t(_,Wa)}),He&&aa(_,Me),ve}function we(_,L,U,Y){if(U==null)throw Error(s(151));for(var ve=null,Ge=null,pe=L,Me=L=0,Ie=null,Ve=U.next();pe!==null&&!Ve.done;Me++,Ve=U.next()){pe.index>Me?(Ie=pe,pe=null):Ie=pe.sibling;var Wa=q(_,pe,Ve.value,Y);if(Wa===null){pe===null&&(pe=Ie);break}e&&pe&&Wa.alternate===null&&t(_,pe),L=h(Wa,L,Me),Ge===null?ve=Wa:Ge.sibling=Wa,Ge=Wa,pe=Ie}if(Ve.done)return i(_,pe),He&&aa(_,Me),ve;if(pe===null){for(;!Ve.done;Me++,Ve=U.next())Ve=W(_,Ve.value,Y),Ve!==null&&(L=h(Ve,L,Me),Ge===null?ve=Ve:Ge.sibling=Ve,Ge=Ve);return He&&aa(_,Me),ve}for(pe=r(pe);!Ve.done;Me++,Ve=U.next())Ve=G(pe,_,Me,Ve.value,Y),Ve!==null&&(e&&Ve.alternate!==null&&pe.delete(Ve.key===null?Me:Ve.key),L=h(Ve,L,Me),Ge===null?ve=Ve:Ge.sibling=Ve,Ge=Ve);return e&&pe.forEach(function(DC){return t(_,DC)}),He&&aa(_,Me),ve}function Je(_,L,U,Y){if(typeof U=="object"&&U!==null&&U.type===E&&U.key===null&&(U=U.props.children),typeof U=="object"&&U!==null){switch(U.$$typeof){case A:e:{for(var ve=U.key;L!==null;){if(L.key===ve){if(ve=U.type,ve===E){if(L.tag===7){i(_,L.sibling),Y=u(L,U.props.children),Y.return=_,_=Y;break e}}else if(L.elementType===ve||typeof ve=="object"&&ve!==null&&ve.$$typeof===F&&pi(ve)===L.type){i(_,L.sibling),Y=u(L,U.props),$o(Y,U),Y.return=_,_=Y;break e}i(_,L);break}else t(_,L);L=L.sibling}U.type===E?(Y=ci(U.props.children,_.mode,Y,U.key),Y.return=_,_=Y):(Y=ss(U.type,U.key,U.props,null,_.mode,Y),$o(Y,U),Y.return=_,_=Y)}return g(_);case N:e:{for(ve=U.key;L!==null;){if(L.key===ve)if(L.tag===4&&L.stateNode.containerInfo===U.containerInfo&&L.stateNode.implementation===U.implementation){i(_,L.sibling),Y=u(L,U.children||[]),Y.return=_,_=Y;break e}else{i(_,L);break}else t(_,L);L=L.sibling}Y=bc(U,_.mode,Y),Y.return=_,_=Y}return g(_);case F:return U=pi(U),Je(_,L,U,Y)}if(be(U))return ue(_,L,U,Y);if(Z(U)){if(ve=Z(U),typeof ve!="function")throw Error(s(150));return U=ve.call(U),we(_,L,U,Y)}if(typeof U.then=="function")return Je(_,L,ps(U),Y);if(U.$$typeof===D)return Je(_,L,us(_,U),Y);ms(_,U)}return typeof U=="string"&&U!==""||typeof U=="number"||typeof U=="bigint"?(U=""+U,L!==null&&L.tag===6?(i(_,L.sibling),Y=u(L,U),Y.return=_,_=Y):(i(_,L),Y=xc(U,_.mode,Y),Y.return=_,_=Y),g(_)):i(_,L)}return function(_,L,U,Y){try{Yo=0;var ve=Je(_,L,U,Y);return Zi=null,ve}catch(pe){if(pe===Xi||pe===fs)throw pe;var Ge=an(29,pe,null,_.mode);return Ge.lanes=Y,Ge.return=_,Ge}finally{}}}var gi=qh(!0),Fh=qh(!1),Pa=!1;function Ec(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Oc(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function La(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ra(e,t,i){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,($e&2)!==0){var u=r.pending;return u===null?t.next=t:(t.next=u.next,u.next=t),r.pending=t,t=rs(e),Dh(e,null,i),t}return os(e,r,t,i),rs(e)}function Qo(e,t,i){if(t=t.updateQueue,t!==null&&(t=t.shared,(i&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,i|=r,t.lanes=i,To(e,i)}}function Pc(e,t){var i=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,i===r)){var u=null,h=null;if(i=i.firstBaseUpdate,i!==null){do{var g={lane:i.lane,tag:i.tag,payload:i.payload,callback:null,next:null};h===null?u=h=g:h=h.next=g,i=i.next}while(i!==null);h===null?u=h=t:h=h.next=t}else u=h=t;i={baseState:r.baseState,firstBaseUpdate:u,lastBaseUpdate:h,shared:r.shared,callbacks:r.callbacks},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=t:e.next=t,i.lastBaseUpdate=t}var Lc=!1;function Wo(){if(Lc){var e=Wi;if(e!==null)throw e}}function Xo(e,t,i,r){Lc=!1;var u=e.updateQueue;Pa=!1;var h=u.firstBaseUpdate,g=u.lastBaseUpdate,v=u.shared.pending;if(v!==null){u.shared.pending=null;var M=v,B=M.next;M.next=null,g===null?h=B:g.next=B,g=M;var V=e.alternate;V!==null&&(V=V.updateQueue,v=V.lastBaseUpdate,v!==g&&(v===null?V.firstBaseUpdate=B:v.next=B,V.lastBaseUpdate=M))}if(h!==null){var W=u.baseState;g=0,V=B=M=null,v=h;do{var q=v.lane&-536870913,G=q!==v.lane;if(G?(ze&q)===q:(r&q)===q){q!==0&&q===Qi&&(Lc=!0),V!==null&&(V=V.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});e:{var ue=e,we=v;q=t;var Je=i;switch(we.tag){case 1:if(ue=we.payload,typeof ue=="function"){W=ue.call(Je,W,q);break e}W=ue;break e;case 3:ue.flags=ue.flags&-65537|128;case 0:if(ue=we.payload,q=typeof ue=="function"?ue.call(Je,W,q):ue,q==null)break e;W=x({},W,q);break e;case 2:Pa=!0}}q=v.callback,q!==null&&(e.flags|=64,G&&(e.flags|=8192),G=u.callbacks,G===null?u.callbacks=[q]:G.push(q))}else G={lane:q,tag:v.tag,payload:v.payload,callback:v.callback,next:null},V===null?(B=V=G,M=W):V=V.next=G,g|=q;if(v=v.next,v===null){if(v=u.shared.pending,v===null)break;G=v,v=G.next,G.next=null,u.lastBaseUpdate=G,u.shared.pending=null}}while(!0);V===null&&(M=W),u.baseState=M,u.firstBaseUpdate=B,u.lastBaseUpdate=V,h===null&&(u.shared.lanes=0),Ha|=g,e.lanes=g,e.memoizedState=W}}function Gh(e,t){if(typeof e!="function")throw Error(s(191,e));e.call(t)}function Vh(e,t){var i=e.callbacks;if(i!==null)for(e.callbacks=null,e=0;e<i.length;e++)Gh(i[e],t)}var Ji=he(null),gs=he(0);function Yh(e,t){e=pa,H(gs,e),H(Ji,t),pa=e|t.baseLanes}function Rc(){H(gs,pa),H(Ji,Ji.current)}function _c(){pa=gs.current,de(Ji),de(gs)}var on=he(null),Sn=null;function _a(e){var t=e.alternate;H(xt,xt.current&1),H(on,e),Sn===null&&(t===null||Ji.current!==null||t.memoizedState!==null)&&(Sn=e)}function zc(e){H(xt,xt.current),H(on,e),Sn===null&&(Sn=e)}function $h(e){e.tag===22?(H(xt,xt.current),H(on,e),Sn===null&&(Sn=e)):za()}function za(){H(xt,xt.current),H(on,on.current)}function rn(e){de(on),Sn===e&&(Sn=null),de(xt)}var xt=he(0);function ys(e){for(var t=e;t!==null;){if(t.tag===13){var i=t.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||qu(i)||Fu(i)))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 ra=0,Te=null,Xe=null,Ct=null,xs=!1,eo=!1,yi=!1,bs=0,Zo=0,to=null,y0=0;function ht(){throw Error(s(321))}function Ic(e,t){if(t===null)return!1;for(var i=0;i<t.length&&i<e.length;i++)if(!nn(e[i],t[i]))return!1;return!0}function Uc(e,t,i,r,u,h){return ra=h,Te=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,I.H=e===null||e.memoizedState===null?Ep:eu,yi=!1,h=i(r,u),yi=!1,eo&&(h=Wh(t,i,r,u)),Qh(e),h}function Qh(e){I.H=tr;var t=Xe!==null&&Xe.next!==null;if(ra=0,Ct=Xe=Te=null,xs=!1,Zo=0,to=null,t)throw Error(s(300));e===null||St||(e=e.dependencies,e!==null&&cs(e)&&(St=!0))}function Wh(e,t,i,r){Te=e;var u=0;do{if(eo&&(to=null),Zo=0,eo=!1,25<=u)throw Error(s(301));if(u+=1,Ct=Xe=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}I.H=Op,h=t(i,r)}while(eo);return h}function x0(){var e=I.H,t=e.useState()[0];return t=typeof t.then=="function"?Jo(t):t,e=e.useState()[0],(Xe!==null?Xe.memoizedState:null)!==e&&(Te.flags|=1024),t}function Hc(){var e=bs!==0;return bs=0,e}function Bc(e,t,i){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i}function Kc(e){if(xs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}xs=!1}ra=0,Ct=Xe=Te=null,eo=!1,Zo=bs=0,to=null}function Ut(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Ct===null?Te.memoizedState=Ct=e:Ct=Ct.next=e,Ct}function bt(){if(Xe===null){var e=Te.alternate;e=e!==null?e.memoizedState:null}else e=Xe.next;var t=Ct===null?Te.memoizedState:Ct.next;if(t!==null)Ct=t,Xe=e;else{if(e===null)throw Te.alternate===null?Error(s(467)):Error(s(310));Xe=e,e={memoizedState:Xe.memoizedState,baseState:Xe.baseState,baseQueue:Xe.baseQueue,queue:Xe.queue,next:null},Ct===null?Te.memoizedState=Ct=e:Ct=Ct.next=e}return Ct}function vs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Jo(e){var t=Zo;return Zo+=1,to===null&&(to=[]),e=Hh(to,e,t),t=Te,(Ct===null?t.memoizedState:Ct.next)===null&&(t=t.alternate,I.H=t===null||t.memoizedState===null?Ep:eu),e}function Cs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Jo(e);if(e.$$typeof===D)return Pt(e)}throw Error(s(438,String(e)))}function qc(e){var t=null,i=Te.updateQueue;if(i!==null&&(t=i.memoCache),t==null){var r=Te.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(u){return u.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),i===null&&(i=vs(),Te.updateQueue=i),i.memoCache=t,i=t.data[t.index],i===void 0)for(i=t.data[t.index]=Array(e),r=0;r<e;r++)i[r]=$;return t.index++,i}function sa(e,t){return typeof t=="function"?t(e):t}function Ss(e){var t=bt();return Fc(t,Xe,e)}function Fc(e,t,i){var r=e.queue;if(r===null)throw Error(s(311));r.lastRenderedReducer=i;var u=e.baseQueue,h=r.pending;if(h!==null){if(u!==null){var g=u.next;u.next=h.next,h.next=g}t.baseQueue=u=h,r.pending=null}if(h=e.baseState,u===null)e.memoizedState=h;else{t=u.next;var v=g=null,M=null,B=t,V=!1;do{var W=B.lane&-536870913;if(W!==B.lane?(ze&W)===W:(ra&W)===W){var q=B.revertLane;if(q===0)M!==null&&(M=M.next={lane:0,revertLane:0,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null}),W===Qi&&(V=!0);else if((ra&q)===q){B=B.next,q===Qi&&(V=!0);continue}else W={lane:0,revertLane:B.revertLane,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},M===null?(v=M=W,g=h):M=M.next=W,Te.lanes|=q,Ha|=q;W=B.action,yi&&i(h,W),h=B.hasEagerState?B.eagerState:i(h,W)}else q={lane:W,revertLane:B.revertLane,gesture:B.gesture,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},M===null?(v=M=q,g=h):M=M.next=q,Te.lanes|=W,Ha|=W;B=B.next}while(B!==null&&B!==t);if(M===null?g=h:M.next=v,!nn(h,e.memoizedState)&&(St=!0,V&&(i=Wi,i!==null)))throw i;e.memoizedState=h,e.baseState=g,e.baseQueue=M,r.lastRenderedState=h}return u===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Gc(e){var t=bt(),i=t.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var r=i.dispatch,u=i.pending,h=t.memoizedState;if(u!==null){i.pending=null;var g=u=u.next;do h=e(h,g.action),g=g.next;while(g!==u);nn(h,t.memoizedState)||(St=!0),t.memoizedState=h,t.baseQueue===null&&(t.baseState=h),i.lastRenderedState=h}return[h,r]}function Xh(e,t,i){var r=Te,u=bt(),h=He;if(h){if(i===void 0)throw Error(s(407));i=i()}else i=t();var g=!nn((Xe||u).memoizedState,i);if(g&&(u.memoizedState=i,St=!0),u=u.queue,$c(ep.bind(null,r,u,e),[e]),u.getSnapshot!==t||g||Ct!==null&&Ct.memoizedState.tag&1){if(r.flags|=2048,no(9,{destroy:void 0},Jh.bind(null,r,u,i,t),null),et===null)throw Error(s(349));h||(ra&127)!==0||Zh(r,t,i)}return i}function Zh(e,t,i){e.flags|=16384,e={getSnapshot:t,value:i},t=Te.updateQueue,t===null?(t=vs(),Te.updateQueue=t,t.stores=[e]):(i=t.stores,i===null?t.stores=[e]:i.push(e))}function Jh(e,t,i,r){t.value=i,t.getSnapshot=r,tp(t)&&np(e)}function ep(e,t,i){return i(function(){tp(t)&&np(e)})}function tp(e){var t=e.getSnapshot;e=e.value;try{var i=t();return!nn(e,i)}catch{return!0}}function np(e){var t=li(e,2);t!==null&&$t(t,e,2)}function Vc(e){var t=Ut();if(typeof e=="function"){var i=e;if(e=i(),yi){Ee(!0);try{i()}finally{Ee(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:e},t}function ap(e,t,i,r){return e.baseState=i,Fc(e,Xe,typeof r=="function"?r:sa)}function b0(e,t,i,r,u){if(As(e))throw Error(s(485));if(e=t.action,e!==null){var h={payload:u,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(g){h.listeners.push(g)}};I.T!==null?i(!0):h.isTransition=!1,r(h),i=t.pending,i===null?(h.next=t.pending=h,ip(t,h)):(h.next=i.next,t.pending=i.next=h)}}function ip(e,t){var i=t.action,r=t.payload,u=e.state;if(t.isTransition){var h=I.T,g={};I.T=g;try{var v=i(u,r),M=I.S;M!==null&&M(g,v),op(e,t,v)}catch(B){Yc(e,t,B)}finally{h!==null&&g.types!==null&&(h.types=g.types),I.T=h}}else try{h=i(u,r),op(e,t,h)}catch(B){Yc(e,t,B)}}function op(e,t,i){i!==null&&typeof i=="object"&&typeof i.then=="function"?i.then(function(r){rp(e,t,r)},function(r){return Yc(e,t,r)}):rp(e,t,i)}function rp(e,t,i){t.status="fulfilled",t.value=i,sp(t),e.state=i,t=e.pending,t!==null&&(i=t.next,i===t?e.pending=null:(i=i.next,t.next=i,ip(e,i)))}function Yc(e,t,i){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=i,sp(t),t=t.next;while(t!==r)}e.action=null}function sp(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function lp(e,t){return t}function cp(e,t){if(He){var i=et.formState;if(i!==null){e:{var r=Te;if(He){if(it){t:{for(var u=it,h=Cn;u.nodeType!==8;){if(!h){u=null;break t}if(u=wn(u.nextSibling),u===null){u=null;break t}}h=u.data,u=h==="F!"||h==="F"?u:null}if(u){it=wn(u.nextSibling),r=u.data==="F!";break e}}Ea(r)}r=!1}r&&(t=i[0])}}return i=Ut(),i.memoizedState=i.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:lp,lastRenderedState:t},i.queue=r,i=jp.bind(null,Te,r),r.dispatch=i,r=Vc(!1),h=Jc.bind(null,Te,!1,r.queue),r=Ut(),u={state:t,dispatch:null,action:e,pending:null},r.queue=u,i=b0.bind(null,Te,u,h,i),u.dispatch=i,r.memoizedState=e,[t,i,!1]}function up(e){var t=bt();return dp(t,Xe,e)}function dp(e,t,i){if(t=Fc(e,t,lp)[0],e=Ss(sa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=Jo(t)}catch(g){throw g===Xi?fs:g}else r=t;t=bt();var u=t.queue,h=u.dispatch;return i!==t.memoizedState&&(Te.flags|=2048,no(9,{destroy:void 0},v0.bind(null,u,i),null)),[r,h,e]}function v0(e,t){e.action=t}function fp(e){var t=bt(),i=Xe;if(i!==null)return dp(t,i,e);bt(),t=t.memoizedState,i=bt();var r=i.queue.dispatch;return i.memoizedState=e,[t,r,!1]}function no(e,t,i,r){return e={tag:e,create:i,deps:r,inst:t,next:null},t=Te.updateQueue,t===null&&(t=vs(),Te.updateQueue=t),i=t.lastEffect,i===null?t.lastEffect=e.next=e:(r=i.next,i.next=e,e.next=r,t.lastEffect=e),e}function hp(){return bt().memoizedState}function ws(e,t,i,r){var u=Ut();Te.flags|=e,u.memoizedState=no(1|t,{destroy:void 0},i,r===void 0?null:r)}function Ns(e,t,i,r){var u=bt();r=r===void 0?null:r;var h=u.memoizedState.inst;Xe!==null&&r!==null&&Ic(r,Xe.memoizedState.deps)?u.memoizedState=no(t,h,i,r):(Te.flags|=e,u.memoizedState=no(1|t,h,i,r))}function pp(e,t){ws(8390656,8,e,t)}function $c(e,t){Ns(2048,8,e,t)}function C0(e){Te.flags|=4;var t=Te.updateQueue;if(t===null)t=vs(),Te.updateQueue=t,t.events=[e];else{var i=t.events;i===null?t.events=[e]:i.push(e)}}function mp(e){var t=bt().memoizedState;return C0({ref:t,nextImpl:e}),function(){if(($e&2)!==0)throw Error(s(440));return t.impl.apply(void 0,arguments)}}function gp(e,t){return Ns(4,2,e,t)}function yp(e,t){return Ns(4,4,e,t)}function xp(e,t){if(typeof t=="function"){e=e();var i=t(e);return function(){typeof i=="function"?i():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function bp(e,t,i){i=i!=null?i.concat([e]):null,Ns(4,4,xp.bind(null,t,e),i)}function Qc(){}function vp(e,t){var i=bt();t=t===void 0?null:t;var r=i.memoizedState;return t!==null&&Ic(t,r[1])?r[0]:(i.memoizedState=[e,t],e)}function Cp(e,t){var i=bt();t=t===void 0?null:t;var r=i.memoizedState;if(t!==null&&Ic(t,r[1]))return r[0];if(r=e(),yi){Ee(!0);try{e()}finally{Ee(!1)}}return i.memoizedState=[r,t],r}function Wc(e,t,i){return i===void 0||(ra&1073741824)!==0&&(ze&261930)===0?e.memoizedState=t:(e.memoizedState=i,e=Sm(),Te.lanes|=e,Ha|=e,i)}function Sp(e,t,i,r){return nn(i,t)?i:Ji.current!==null?(e=Wc(e,i,r),nn(e,t)||(St=!0),e):(ra&42)===0||(ra&1073741824)!==0&&(ze&261930)===0?(St=!0,e.memoizedState=i):(e=Sm(),Te.lanes|=e,Ha|=e,t)}function wp(e,t,i,r,u){var h=X.p;X.p=h!==0&&8>h?h:8;var g=I.T,v={};I.T=v,Jc(e,!1,t,i);try{var M=u(),B=I.S;if(B!==null&&B(v,M),M!==null&&typeof M=="object"&&typeof M.then=="function"){var V=g0(M,r);er(e,t,V,cn(e))}else er(e,t,r,cn(e))}catch(W){er(e,t,{then:function(){},status:"rejected",reason:W},cn())}finally{X.p=h,g!==null&&v.types!==null&&(g.types=v.types),I.T=g}}function S0(){}function Xc(e,t,i,r){if(e.tag!==5)throw Error(s(476));var u=Np(e).queue;wp(e,u,t,ee,i===null?S0:function(){return Ap(e),i(r)})}function Np(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:ee},next:null};var i={};return t.next={memoizedState:i,baseState:i,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:sa,lastRenderedState:i},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Ap(e){var t=Np(e);t.next===null&&(t=e.alternate.memoizedState),er(e,t.next.queue,{},cn())}function Zc(){return Pt(yr)}function kp(){return bt().memoizedState}function Dp(){return bt().memoizedState}function w0(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var i=cn();e=La(i);var r=Ra(t,e,i);r!==null&&($t(r,t,i),Qo(r,t,i)),t={cache:Dc()},e.payload=t;return}t=t.return}}function N0(e,t,i){var r=cn();i={lane:r,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null},As(e)?Tp(t,i):(i=gc(e,t,i,r),i!==null&&($t(i,e,r),Mp(i,t,r)))}function jp(e,t,i){var r=cn();er(e,t,i,r)}function er(e,t,i,r){var u={lane:r,revertLane:0,gesture:null,action:i,hasEagerState:!1,eagerState:null,next:null};if(As(e))Tp(t,u);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=t.lastRenderedReducer,h!==null))try{var g=t.lastRenderedState,v=h(g,i);if(u.hasEagerState=!0,u.eagerState=v,nn(v,g))return os(e,t,u,0),et===null&&is(),!1}catch{}finally{}if(i=gc(e,t,u,r),i!==null)return $t(i,e,r),Mp(i,t,r),!0}return!1}function Jc(e,t,i,r){if(r={lane:2,revertLane:Eu(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},As(e)){if(t)throw Error(s(479))}else t=gc(e,i,r,2),t!==null&&$t(t,e,2)}function As(e){var t=e.alternate;return e===Te||t!==null&&t===Te}function Tp(e,t){eo=xs=!0;var i=e.pending;i===null?t.next=t:(t.next=i.next,i.next=t),e.pending=t}function Mp(e,t,i){if((i&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,i|=r,t.lanes=i,To(e,i)}}var tr={readContext:Pt,use:Cs,useCallback:ht,useContext:ht,useEffect:ht,useImperativeHandle:ht,useLayoutEffect:ht,useInsertionEffect:ht,useMemo:ht,useReducer:ht,useRef:ht,useState:ht,useDebugValue:ht,useDeferredValue:ht,useTransition:ht,useSyncExternalStore:ht,useId:ht,useHostTransitionStatus:ht,useFormState:ht,useActionState:ht,useOptimistic:ht,useMemoCache:ht,useCacheRefresh:ht};tr.useEffectEvent=ht;var Ep={readContext:Pt,use:Cs,useCallback:function(e,t){return Ut().memoizedState=[e,t===void 0?null:t],e},useContext:Pt,useEffect:pp,useImperativeHandle:function(e,t,i){i=i!=null?i.concat([e]):null,ws(4194308,4,xp.bind(null,t,e),i)},useLayoutEffect:function(e,t){return ws(4194308,4,e,t)},useInsertionEffect:function(e,t){ws(4,2,e,t)},useMemo:function(e,t){var i=Ut();t=t===void 0?null:t;var r=e();if(yi){Ee(!0);try{e()}finally{Ee(!1)}}return i.memoizedState=[r,t],r},useReducer:function(e,t,i){var r=Ut();if(i!==void 0){var u=i(t);if(yi){Ee(!0);try{i(t)}finally{Ee(!1)}}}else u=t;return r.memoizedState=r.baseState=u,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:u},r.queue=e,e=e.dispatch=N0.bind(null,Te,e),[r.memoizedState,e]},useRef:function(e){var t=Ut();return e={current:e},t.memoizedState=e},useState:function(e){e=Vc(e);var t=e.queue,i=jp.bind(null,Te,t);return t.dispatch=i,[e.memoizedState,i]},useDebugValue:Qc,useDeferredValue:function(e,t){var i=Ut();return Wc(i,e,t)},useTransition:function(){var e=Vc(!1);return e=wp.bind(null,Te,e.queue,!0,!1),Ut().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,i){var r=Te,u=Ut();if(He){if(i===void 0)throw Error(s(407));i=i()}else{if(i=t(),et===null)throw Error(s(349));(ze&127)!==0||Zh(r,t,i)}u.memoizedState=i;var h={value:i,getSnapshot:t};return u.queue=h,pp(ep.bind(null,r,h,e),[e]),r.flags|=2048,no(9,{destroy:void 0},Jh.bind(null,r,h,i,t),null),i},useId:function(){var e=Ut(),t=et.identifierPrefix;if(He){var i=zn,r=_n;i=(r&~(1<<32-Ce(r)-1)).toString(32)+i,t="_"+t+"R_"+i,i=bs++,0<i&&(t+="H"+i.toString(32)),t+="_"}else i=y0++,t="_"+t+"r_"+i.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Zc,useFormState:cp,useActionState:cp,useOptimistic:function(e){var t=Ut();t.memoizedState=t.baseState=e;var i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=i,t=Jc.bind(null,Te,!0,i),i.dispatch=t,[e,t]},useMemoCache:qc,useCacheRefresh:function(){return Ut().memoizedState=w0.bind(null,Te)},useEffectEvent:function(e){var t=Ut(),i={impl:e};return t.memoizedState=i,function(){if(($e&2)!==0)throw Error(s(440));return i.impl.apply(void 0,arguments)}}},eu={readContext:Pt,use:Cs,useCallback:vp,useContext:Pt,useEffect:$c,useImperativeHandle:bp,useInsertionEffect:gp,useLayoutEffect:yp,useMemo:Cp,useReducer:Ss,useRef:hp,useState:function(){return Ss(sa)},useDebugValue:Qc,useDeferredValue:function(e,t){var i=bt();return Sp(i,Xe.memoizedState,e,t)},useTransition:function(){var e=Ss(sa)[0],t=bt().memoizedState;return[typeof e=="boolean"?e:Jo(e),t]},useSyncExternalStore:Xh,useId:kp,useHostTransitionStatus:Zc,useFormState:up,useActionState:up,useOptimistic:function(e,t){var i=bt();return ap(i,Xe,e,t)},useMemoCache:qc,useCacheRefresh:Dp};eu.useEffectEvent=mp;var Op={readContext:Pt,use:Cs,useCallback:vp,useContext:Pt,useEffect:$c,useImperativeHandle:bp,useInsertionEffect:gp,useLayoutEffect:yp,useMemo:Cp,useReducer:Gc,useRef:hp,useState:function(){return Gc(sa)},useDebugValue:Qc,useDeferredValue:function(e,t){var i=bt();return Xe===null?Wc(i,e,t):Sp(i,Xe.memoizedState,e,t)},useTransition:function(){var e=Gc(sa)[0],t=bt().memoizedState;return[typeof e=="boolean"?e:Jo(e),t]},useSyncExternalStore:Xh,useId:kp,useHostTransitionStatus:Zc,useFormState:fp,useActionState:fp,useOptimistic:function(e,t){var i=bt();return Xe!==null?ap(i,Xe,e,t):(i.baseState=e,[e,i.queue.dispatch])},useMemoCache:qc,useCacheRefresh:Dp};Op.useEffectEvent=mp;function tu(e,t,i,r){t=e.memoizedState,i=i(r,t),i=i==null?t:x({},t,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var nu={enqueueSetState:function(e,t,i){e=e._reactInternals;var r=cn(),u=La(r);u.payload=t,i!=null&&(u.callback=i),t=Ra(e,u,r),t!==null&&($t(t,e,r),Qo(t,e,r))},enqueueReplaceState:function(e,t,i){e=e._reactInternals;var r=cn(),u=La(r);u.tag=1,u.payload=t,i!=null&&(u.callback=i),t=Ra(e,u,r),t!==null&&($t(t,e,r),Qo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var i=cn(),r=La(i);r.tag=2,t!=null&&(r.callback=t),t=Ra(e,r,i),t!==null&&($t(t,e,i),Qo(t,e,i))}};function Pp(e,t,i,r,u,h,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,h,g):t.prototype&&t.prototype.isPureReactComponent?!Bo(i,r)||!Bo(u,h):!0}function Lp(e,t,i,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(i,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(i,r),t.state!==e&&nu.enqueueReplaceState(t,t.state,null)}function xi(e,t){var i=t;if("ref"in t){i={};for(var r in t)r!=="ref"&&(i[r]=t[r])}if(e=e.defaultProps){i===t&&(i=x({},i));for(var u in e)i[u]===void 0&&(i[u]=e[u])}return i}function Rp(e){as(e)}function _p(e){console.error(e)}function zp(e){as(e)}function ks(e,t){try{var i=e.onUncaughtError;i(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function Ip(e,t,i){try{var r=e.onCaughtError;r(i.value,{componentStack:i.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(u){setTimeout(function(){throw u})}}function au(e,t,i){return i=La(i),i.tag=3,i.payload={element:null},i.callback=function(){ks(e,t)},i}function Up(e){return e=La(e),e.tag=3,e}function Hp(e,t,i,r){var u=i.type.getDerivedStateFromError;if(typeof u=="function"){var h=r.value;e.payload=function(){return u(h)},e.callback=function(){Ip(t,i,r)}}var g=i.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(e.callback=function(){Ip(t,i,r),typeof u!="function"&&(Ba===null?Ba=new Set([this]):Ba.add(this));var v=r.stack;this.componentDidCatch(r.value,{componentStack:v!==null?v:""})})}function A0(e,t,i,r,u){if(i.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=i.alternate,t!==null&&$i(t,i,u,!0),i=on.current,i!==null){switch(i.tag){case 31:case 13:return Sn===null?Is():i.alternate===null&&pt===0&&(pt=3),i.flags&=-257,i.flags|=65536,i.lanes=u,r===hs?i.flags|=16384:(t=i.updateQueue,t===null?i.updateQueue=new Set([r]):t.add(r),ju(e,r,u)),!1;case 22:return i.flags|=65536,r===hs?i.flags|=16384:(t=i.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},i.updateQueue=t):(i=t.retryQueue,i===null?t.retryQueue=new Set([r]):i.add(r)),ju(e,r,u)),!1}throw Error(s(435,i.tag))}return ju(e,r,u),Is(),!1}if(He)return t=on.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=u,r!==Sc&&(e=Error(s(422),{cause:r}),Fo(xn(e,i)))):(r!==Sc&&(t=Error(s(423),{cause:r}),Fo(xn(t,i))),e=e.current.alternate,e.flags|=65536,u&=-u,e.lanes|=u,r=xn(r,i),u=au(e.stateNode,r,u),Pc(e,u),pt!==4&&(pt=2)),!1;var h=Error(s(520),{cause:r});if(h=xn(h,i),cr===null?cr=[h]:cr.push(h),pt!==4&&(pt=2),t===null)return!0;r=xn(r,i),i=t;do{switch(i.tag){case 3:return i.flags|=65536,e=u&-u,i.lanes|=e,e=au(i.stateNode,r,e),Pc(i,e),!1;case 1:if(t=i.type,h=i.stateNode,(i.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Ba===null||!Ba.has(h))))return i.flags|=65536,u&=-u,i.lanes|=u,u=Up(u),Hp(u,e,i,r),Pc(i,u),!1}i=i.return}while(i!==null);return!1}var iu=Error(s(461)),St=!1;function Lt(e,t,i,r){t.child=e===null?Fh(t,null,i,r):gi(t,e.child,i,r)}function Bp(e,t,i,r,u){i=i.render;var h=t.ref;if("ref"in r){var g={};for(var v in r)v!=="ref"&&(g[v]=r[v])}else g=r;return fi(t),r=Uc(e,t,i,g,h,u),v=Hc(),e!==null&&!St?(Bc(e,t,u),la(e,t,u)):(He&&v&&vc(t),t.flags|=1,Lt(e,t,r,u),t.child)}function Kp(e,t,i,r,u){if(e===null){var h=i.type;return typeof h=="function"&&!yc(h)&&h.defaultProps===void 0&&i.compare===null?(t.tag=15,t.type=h,qp(e,t,h,r,u)):(e=ss(i.type,null,r,t,t.mode,u),e.ref=t.ref,e.return=t,t.child=e)}if(h=e.child,!fu(e,u)){var g=h.memoizedProps;if(i=i.compare,i=i!==null?i:Bo,i(g,r)&&e.ref===t.ref)return la(e,t,u)}return t.flags|=1,e=na(h,r),e.ref=t.ref,e.return=t,t.child=e}function qp(e,t,i,r,u){if(e!==null){var h=e.memoizedProps;if(Bo(h,r)&&e.ref===t.ref)if(St=!1,t.pendingProps=r=h,fu(e,u))(e.flags&131072)!==0&&(St=!0);else return t.lanes=e.lanes,la(e,t,u)}return ou(e,t,i,r,u)}function Fp(e,t,i,r){var u=r.children,h=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(h=h!==null?h.baseLanes|i:i,e!==null){for(r=t.child=e.child,u=0;r!==null;)u=u|r.lanes|r.childLanes,r=r.sibling;r=u&~h}else r=0,t.child=null;return Gp(e,t,h,i,r)}if((i&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ds(t,h!==null?h.cachePool:null),h!==null?Yh(t,h):Rc(),$h(t);else return r=t.lanes=536870912,Gp(e,t,h!==null?h.baseLanes|i:i,i,r)}else h!==null?(ds(t,h.cachePool),Yh(t,h),za(),t.memoizedState=null):(e!==null&&ds(t,null),Rc(),za());return Lt(e,t,u,i),t.child}function nr(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Gp(e,t,i,r,u){var h=Tc();return h=h===null?null:{parent:vt._currentValue,pool:h},t.memoizedState={baseLanes:i,cachePool:h},e!==null&&ds(t,null),Rc(),$h(t),e!==null&&$i(e,t,r,!0),t.childLanes=u,null}function Ds(e,t){return t=Ts({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Vp(e,t,i){return gi(t,e.child,null,i),e=Ds(t,t.pendingProps),e.flags|=2,rn(t),t.memoizedState=null,e}function k0(e,t,i){var r=t.pendingProps,u=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(He){if(r.mode==="hidden")return e=Ds(t,r),t.lanes=536870912,nr(null,e);if(zc(t),(e=it)?(e=ig(e,Cn),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ta!==null?{id:_n,overflow:zn}:null,retryLane:536870912,hydrationErrors:null},i=Th(e),i.return=t,t.child=i,Ot=t,it=null)):e=null,e===null)throw Ea(t);return t.lanes=536870912,null}return Ds(t,r)}var h=e.memoizedState;if(h!==null){var g=h.dehydrated;if(zc(t),u)if(t.flags&256)t.flags&=-257,t=Vp(e,t,i);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(s(558));else if(St||$i(e,t,i,!1),u=(i&e.childLanes)!==0,St||u){if(r=et,r!==null&&(g=pn(r,i),g!==0&&g!==h.retryLane))throw h.retryLane=g,li(e,g),$t(r,e,g),iu;Is(),t=Vp(e,t,i)}else e=h.treeContext,it=wn(g.nextSibling),Ot=t,He=!0,Ma=null,Cn=!1,e!==null&&Oh(t,e),t=Ds(t,r),t.flags|=4096;return t}return e=na(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function js(e,t){var i=t.ref;if(i===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof i!="function"&&typeof i!="object")throw Error(s(284));(e===null||e.ref!==i)&&(t.flags|=4194816)}}function ou(e,t,i,r,u){return fi(t),i=Uc(e,t,i,r,void 0,u),r=Hc(),e!==null&&!St?(Bc(e,t,u),la(e,t,u)):(He&&r&&vc(t),t.flags|=1,Lt(e,t,i,u),t.child)}function Yp(e,t,i,r,u,h){return fi(t),t.updateQueue=null,i=Wh(t,r,i,u),Qh(e),r=Hc(),e!==null&&!St?(Bc(e,t,h),la(e,t,h)):(He&&r&&vc(t),t.flags|=1,Lt(e,t,i,h),t.child)}function $p(e,t,i,r,u){if(fi(t),t.stateNode===null){var h=Fi,g=i.contextType;typeof g=="object"&&g!==null&&(h=Pt(g)),h=new i(r,h),t.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=nu,t.stateNode=h,h._reactInternals=t,h=t.stateNode,h.props=r,h.state=t.memoizedState,h.refs={},Ec(t),g=i.contextType,h.context=typeof g=="object"&&g!==null?Pt(g):Fi,h.state=t.memoizedState,g=i.getDerivedStateFromProps,typeof g=="function"&&(tu(t,i,g,r),h.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(g=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),g!==h.state&&nu.enqueueReplaceState(h,h.state,null),Xo(t,r,h,u),Wo(),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){h=t.stateNode;var v=t.memoizedProps,M=xi(i,v);h.props=M;var B=h.context,V=i.contextType;g=Fi,typeof V=="object"&&V!==null&&(g=Pt(V));var W=i.getDerivedStateFromProps;V=typeof W=="function"||typeof h.getSnapshotBeforeUpdate=="function",v=t.pendingProps!==v,V||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(v||B!==g)&&Lp(t,h,r,g),Pa=!1;var q=t.memoizedState;h.state=q,Xo(t,r,h,u),Wo(),B=t.memoizedState,v||q!==B||Pa?(typeof W=="function"&&(tu(t,i,W,r),B=t.memoizedState),(M=Pa||Pp(t,i,M,r,q,B,g))?(V||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(t.flags|=4194308)):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=B),h.props=r,h.state=B,h.context=g,r=M):(typeof h.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{h=t.stateNode,Oc(e,t),g=t.memoizedProps,V=xi(i,g),h.props=V,W=t.pendingProps,q=h.context,B=i.contextType,M=Fi,typeof B=="object"&&B!==null&&(M=Pt(B)),v=i.getDerivedStateFromProps,(B=typeof v=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(g!==W||q!==M)&&Lp(t,h,r,M),Pa=!1,q=t.memoizedState,h.state=q,Xo(t,r,h,u),Wo();var G=t.memoizedState;g!==W||q!==G||Pa||e!==null&&e.dependencies!==null&&cs(e.dependencies)?(typeof v=="function"&&(tu(t,i,v,r),G=t.memoizedState),(V=Pa||Pp(t,i,V,r,q,G,M)||e!==null&&e.dependencies!==null&&cs(e.dependencies))?(B||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(r,G,M),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(r,G,M)),typeof h.componentDidUpdate=="function"&&(t.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof h.componentDidUpdate!="function"||g===e.memoizedProps&&q===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&q===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=G),h.props=r,h.state=G,h.context=M,r=V):(typeof h.componentDidUpdate!="function"||g===e.memoizedProps&&q===e.memoizedState||(t.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&q===e.memoizedState||(t.flags|=1024),r=!1)}return h=r,js(e,t),r=(t.flags&128)!==0,h||r?(h=t.stateNode,i=r&&typeof i.getDerivedStateFromError!="function"?null:h.render(),t.flags|=1,e!==null&&r?(t.child=gi(t,e.child,null,u),t.child=gi(t,null,i,u)):Lt(e,t,i,u),t.memoizedState=h.state,e=t.child):e=la(e,t,u),e}function Qp(e,t,i,r){return ui(),t.flags|=256,Lt(e,t,i,r),t.child}var ru={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function su(e){return{baseLanes:e,cachePool:Ih()}}function lu(e,t,i){return e=e!==null?e.childLanes&~i:0,t&&(e|=ln),e}function Wp(e,t,i){var r=t.pendingProps,u=!1,h=(t.flags&128)!==0,g;if((g=h)||(g=e!==null&&e.memoizedState===null?!1:(xt.current&2)!==0),g&&(u=!0,t.flags&=-129),g=(t.flags&32)!==0,t.flags&=-33,e===null){if(He){if(u?_a(t):za(),(e=it)?(e=ig(e,Cn),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ta!==null?{id:_n,overflow:zn}:null,retryLane:536870912,hydrationErrors:null},i=Th(e),i.return=t,t.child=i,Ot=t,it=null)):e=null,e===null)throw Ea(t);return Fu(e)?t.lanes=32:t.lanes=536870912,null}var v=r.children;return r=r.fallback,u?(za(),u=t.mode,v=Ts({mode:"hidden",children:v},u),r=ci(r,u,i,null),v.return=t,r.return=t,v.sibling=r,t.child=v,r=t.child,r.memoizedState=su(i),r.childLanes=lu(e,g,i),t.memoizedState=ru,nr(null,r)):(_a(t),cu(t,v))}var M=e.memoizedState;if(M!==null&&(v=M.dehydrated,v!==null)){if(h)t.flags&256?(_a(t),t.flags&=-257,t=uu(e,t,i)):t.memoizedState!==null?(za(),t.child=e.child,t.flags|=128,t=null):(za(),v=r.fallback,u=t.mode,r=Ts({mode:"visible",children:r.children},u),v=ci(v,u,i,null),v.flags|=2,r.return=t,v.return=t,r.sibling=v,t.child=r,gi(t,e.child,null,i),r=t.child,r.memoizedState=su(i),r.childLanes=lu(e,g,i),t.memoizedState=ru,t=nr(null,r));else if(_a(t),Fu(v)){if(g=v.nextSibling&&v.nextSibling.dataset,g)var B=g.dgst;g=B,r=Error(s(419)),r.stack="",r.digest=g,Fo({value:r,source:null,stack:null}),t=uu(e,t,i)}else if(St||$i(e,t,i,!1),g=(i&e.childLanes)!==0,St||g){if(g=et,g!==null&&(r=pn(g,i),r!==0&&r!==M.retryLane))throw M.retryLane=r,li(e,r),$t(g,e,r),iu;qu(v)||Is(),t=uu(e,t,i)}else qu(v)?(t.flags|=192,t.child=e.child,t=null):(e=M.treeContext,it=wn(v.nextSibling),Ot=t,He=!0,Ma=null,Cn=!1,e!==null&&Oh(t,e),t=cu(t,r.children),t.flags|=4096);return t}return u?(za(),v=r.fallback,u=t.mode,M=e.child,B=M.sibling,r=na(M,{mode:"hidden",children:r.children}),r.subtreeFlags=M.subtreeFlags&65011712,B!==null?v=na(B,v):(v=ci(v,u,i,null),v.flags|=2),v.return=t,r.return=t,r.sibling=v,t.child=r,nr(null,r),r=t.child,v=e.child.memoizedState,v===null?v=su(i):(u=v.cachePool,u!==null?(M=vt._currentValue,u=u.parent!==M?{parent:M,pool:M}:u):u=Ih(),v={baseLanes:v.baseLanes|i,cachePool:u}),r.memoizedState=v,r.childLanes=lu(e,g,i),t.memoizedState=ru,nr(e.child,r)):(_a(t),i=e.child,e=i.sibling,i=na(i,{mode:"visible",children:r.children}),i.return=t,i.sibling=null,e!==null&&(g=t.deletions,g===null?(t.deletions=[e],t.flags|=16):g.push(e)),t.child=i,t.memoizedState=null,i)}function cu(e,t){return t=Ts({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Ts(e,t){return e=an(22,e,null,t),e.lanes=0,e}function uu(e,t,i){return gi(t,e.child,null,i),e=cu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Xp(e,t,i){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Ac(e.return,t,i)}function du(e,t,i,r,u,h){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:i,tailMode:u,treeForkCount:h}:(g.isBackwards=t,g.rendering=null,g.renderingStartTime=0,g.last=r,g.tail=i,g.tailMode=u,g.treeForkCount=h)}function Zp(e,t,i){var r=t.pendingProps,u=r.revealOrder,h=r.tail;r=r.children;var g=xt.current,v=(g&2)!==0;if(v?(g=g&1|2,t.flags|=128):g&=1,H(xt,g),Lt(e,t,r,i),r=He?qo:0,!v&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Xp(e,i,t);else if(e.tag===19)Xp(e,i,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(u){case"forwards":for(i=t.child,u=null;i!==null;)e=i.alternate,e!==null&&ys(e)===null&&(u=i),i=i.sibling;i=u,i===null?(u=t.child,t.child=null):(u=i.sibling,i.sibling=null),du(t,!1,u,i,h,r);break;case"backwards":case"unstable_legacy-backwards":for(i=null,u=t.child,t.child=null;u!==null;){if(e=u.alternate,e!==null&&ys(e)===null){t.child=u;break}e=u.sibling,u.sibling=i,i=u,u=e}du(t,!0,i,null,h,r);break;case"together":du(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function la(e,t,i){if(e!==null&&(t.dependencies=e.dependencies),Ha|=t.lanes,(i&t.childLanes)===0)if(e!==null){if($i(e,t,i,!1),(i&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(s(153));if(t.child!==null){for(e=t.child,i=na(e,e.pendingProps),t.child=i,i.return=t;e.sibling!==null;)e=e.sibling,i=i.sibling=na(e,e.pendingProps),i.return=t;i.sibling=null}return t.child}function fu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&cs(e)))}function D0(e,t,i){switch(t.tag){case 3:ge(t,t.stateNode.containerInfo),Oa(t,vt,e.memoizedState.cache),ui();break;case 27:case 5:Ue(t);break;case 4:ge(t,t.stateNode.containerInfo);break;case 10:Oa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,zc(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(_a(t),t.flags|=128,null):(i&t.child.childLanes)!==0?Wp(e,t,i):(_a(t),e=la(e,t,i),e!==null?e.sibling:null);_a(t);break;case 19:var u=(e.flags&128)!==0;if(r=(i&t.childLanes)!==0,r||($i(e,t,i,!1),r=(i&t.childLanes)!==0),u){if(r)return Zp(e,t,i);t.flags|=128}if(u=t.memoizedState,u!==null&&(u.rendering=null,u.tail=null,u.lastEffect=null),H(xt,xt.current),r)break;return null;case 22:return t.lanes=0,Fp(e,t,i,t.pendingProps);case 24:Oa(t,vt,e.memoizedState.cache)}return la(e,t,i)}function Jp(e,t,i){if(e!==null)if(e.memoizedProps!==t.pendingProps)St=!0;else{if(!fu(e,i)&&(t.flags&128)===0)return St=!1,D0(e,t,i);St=(e.flags&131072)!==0}else St=!1,He&&(t.flags&1048576)!==0&&Eh(t,qo,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=pi(t.elementType),t.type=e,typeof e=="function")yc(e)?(r=xi(e,r),t.tag=1,t=$p(null,t,e,r,i)):(t.tag=0,t=ou(null,t,e,r,i));else{if(e!=null){var u=e.$$typeof;if(u===j){t.tag=11,t=Bp(null,t,e,r,i);break e}else if(u===P){t.tag=14,t=Kp(null,t,e,r,i);break e}}throw t=te(e)||e,Error(s(306,t,""))}}return t;case 0:return ou(e,t,t.type,t.pendingProps,i);case 1:return r=t.type,u=xi(r,t.pendingProps),$p(e,t,r,u,i);case 3:e:{if(ge(t,t.stateNode.containerInfo),e===null)throw Error(s(387));r=t.pendingProps;var h=t.memoizedState;u=h.element,Oc(e,t),Xo(t,r,null,i);var g=t.memoizedState;if(r=g.cache,Oa(t,vt,r),r!==h.cache&&kc(t,[vt],i,!0),Wo(),r=g.element,h.isDehydrated)if(h={element:r,isDehydrated:!1,cache:g.cache},t.updateQueue.baseState=h,t.memoizedState=h,t.flags&256){t=Qp(e,t,r,i);break e}else if(r!==u){u=xn(Error(s(424)),t),Fo(u),t=Qp(e,t,r,i);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(it=wn(e.firstChild),Ot=t,He=!0,Ma=null,Cn=!0,i=Fh(t,null,r,i),t.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling}else{if(ui(),r===u){t=la(e,t,i);break e}Lt(e,t,r,i)}t=t.child}return t;case 26:return js(e,t),e===null?(i=ug(t.type,null,t.pendingProps,null))?t.memoizedState=i:He||(i=t.type,e=t.pendingProps,r=Gs(ae.current).createElement(i),r[Et]=t,r[Kt]=e,Rt(r,i,e),Dt(r),t.stateNode=r):t.memoizedState=ug(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ue(t),e===null&&He&&(r=t.stateNode=sg(t.type,t.pendingProps,ae.current),Ot=t,Cn=!0,u=it,Ga(t.type)?(Gu=u,it=wn(r.firstChild)):it=u),Lt(e,t,t.pendingProps.children,i),js(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&He&&((u=r=it)&&(r=aC(r,t.type,t.pendingProps,Cn),r!==null?(t.stateNode=r,Ot=t,it=wn(r.firstChild),Cn=!1,u=!0):u=!1),u||Ea(t)),Ue(t),u=t.type,h=t.pendingProps,g=e!==null?e.memoizedProps:null,r=h.children,Hu(u,h)?r=null:g!==null&&Hu(u,g)&&(t.flags|=32),t.memoizedState!==null&&(u=Uc(e,t,x0,null,null,i),yr._currentValue=u),js(e,t),Lt(e,t,r,i),t.child;case 6:return e===null&&He&&((e=i=it)&&(i=iC(i,t.pendingProps,Cn),i!==null?(t.stateNode=i,Ot=t,it=null,e=!0):e=!1),e||Ea(t)),null;case 13:return Wp(e,t,i);case 4:return ge(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=gi(t,null,r,i):Lt(e,t,r,i),t.child;case 11:return Bp(e,t,t.type,t.pendingProps,i);case 7:return Lt(e,t,t.pendingProps,i),t.child;case 8:return Lt(e,t,t.pendingProps.children,i),t.child;case 12:return Lt(e,t,t.pendingProps.children,i),t.child;case 10:return r=t.pendingProps,Oa(t,t.type,r.value),Lt(e,t,r.children,i),t.child;case 9:return u=t.type._context,r=t.pendingProps.children,fi(t),u=Pt(u),r=r(u),t.flags|=1,Lt(e,t,r,i),t.child;case 14:return Kp(e,t,t.type,t.pendingProps,i);case 15:return qp(e,t,t.type,t.pendingProps,i);case 19:return Zp(e,t,i);case 31:return k0(e,t,i);case 22:return Fp(e,t,i,t.pendingProps);case 24:return fi(t),r=Pt(vt),e===null?(u=Tc(),u===null&&(u=et,h=Dc(),u.pooledCache=h,h.refCount++,h!==null&&(u.pooledCacheLanes|=i),u=h),t.memoizedState={parent:r,cache:u},Ec(t),Oa(t,vt,u)):((e.lanes&i)!==0&&(Oc(e,t),Xo(t,null,null,i),Wo()),u=e.memoizedState,h=t.memoizedState,u.parent!==r?(u={parent:r,cache:r},t.memoizedState=u,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=u),Oa(t,vt,r)):(r=h.cache,Oa(t,vt,r),r!==u.cache&&kc(t,[vt],i,!0))),Lt(e,t,t.pendingProps.children,i),t.child;case 29:throw t.pendingProps}throw Error(s(156,t.tag))}function ca(e){e.flags|=4}function hu(e,t,i,r,u){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(u&335544128)===u)if(e.stateNode.complete)e.flags|=8192;else if(km())e.flags|=8192;else throw mi=hs,Mc}else e.flags&=-16777217}function em(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!mg(t))if(km())e.flags|=8192;else throw mi=hs,Mc}function Ms(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?kt():536870912,e.lanes|=t,ro|=t)}function ar(e,t){if(!He)switch(e.tailMode){case"hidden":t=e.tail;for(var i=null;t!==null;)t.alternate!==null&&(i=t),t=t.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var r=null;i!==null;)i.alternate!==null&&(r=i),i=i.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function ot(e){var t=e.alternate!==null&&e.alternate.child===e.child,i=0,r=0;if(t)for(var u=e.child;u!==null;)i|=u.lanes|u.childLanes,r|=u.subtreeFlags&65011712,r|=u.flags&65011712,u.return=e,u=u.sibling;else for(u=e.child;u!==null;)i|=u.lanes|u.childLanes,r|=u.subtreeFlags,r|=u.flags,u.return=e,u=u.sibling;return e.subtreeFlags|=r,e.childLanes=i,t}function j0(e,t,i){var r=t.pendingProps;switch(Cc(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ot(t),null;case 1:return ot(t),null;case 3:return i=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),oa(vt),De(),i.pendingContext&&(i.context=i.pendingContext,i.pendingContext=null),(e===null||e.child===null)&&(Yi(t)?ca(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,wc())),ot(t),null;case 26:var u=t.type,h=t.memoizedState;return e===null?(ca(t),h!==null?(ot(t),em(t,h)):(ot(t),hu(t,u,null,r,i))):h?h!==e.memoizedState?(ca(t),ot(t),em(t,h)):(ot(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&ca(t),ot(t),hu(t,u,e,r,i)),null;case 27:if(st(t),i=ae.current,u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ca(t);else{if(!r){if(t.stateNode===null)throw Error(s(166));return ot(t),null}e=Q.current,Yi(t)?Ph(t):(e=sg(u,r,i),t.stateNode=e,ca(t))}return ot(t),null;case 5:if(st(t),u=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ca(t);else{if(!r){if(t.stateNode===null)throw Error(s(166));return ot(t),null}if(h=Q.current,Yi(t))Ph(t);else{var g=Gs(ae.current);switch(h){case 1:h=g.createElementNS("http://www.w3.org/2000/svg",u);break;case 2:h=g.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;default:switch(u){case"svg":h=g.createElementNS("http://www.w3.org/2000/svg",u);break;case"math":h=g.createElementNS("http://www.w3.org/1998/Math/MathML",u);break;case"script":h=g.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof r.is=="string"?g.createElement("select",{is:r.is}):g.createElement("select"),r.multiple?h.multiple=!0:r.size&&(h.size=r.size);break;default:h=typeof r.is=="string"?g.createElement(u,{is:r.is}):g.createElement(u)}}h[Et]=t,h[Kt]=r;e:for(g=t.child;g!==null;){if(g.tag===5||g.tag===6)h.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===t)break e;for(;g.sibling===null;){if(g.return===null||g.return===t)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}t.stateNode=h;e:switch(Rt(h,u,r),u){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&ca(t)}}return ot(t),hu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,i),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ca(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(s(166));if(e=ae.current,Yi(t)){if(e=t.stateNode,i=t.memoizedProps,r=null,u=Ot,u!==null)switch(u.tag){case 27:case 5:r=u.memoizedProps}e[Et]=t,e=!!(e.nodeValue===i||r!==null&&r.suppressHydrationWarning===!0||Wm(e.nodeValue,i)),e||Ea(t,!0)}else e=Gs(e).createTextNode(r),e[Et]=t,t.stateNode=e}return ot(t),null;case 31:if(i=t.memoizedState,e===null||e.memoizedState!==null){if(r=Yi(t),i!==null){if(e===null){if(!r)throw Error(s(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(557));e[Et]=t}else ui(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ot(t),e=!1}else i=wc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),e=!0;if(!e)return t.flags&256?(rn(t),t):(rn(t),null);if((t.flags&128)!==0)throw Error(s(558))}return ot(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(u=Yi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!u)throw Error(s(318));if(u=t.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(s(317));u[Et]=t}else ui(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;ot(t),u=!1}else u=wc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=u),u=!0;if(!u)return t.flags&256?(rn(t),t):(rn(t),null)}return rn(t),(t.flags&128)!==0?(t.lanes=i,t):(i=r!==null,e=e!==null&&e.memoizedState!==null,i&&(r=t.child,u=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(u=r.alternate.memoizedState.cachePool.pool),h=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(h=r.memoizedState.cachePool.pool),h!==u&&(r.flags|=2048)),i!==e&&i&&(t.child.flags|=8192),Ms(t,t.updateQueue),ot(t),null);case 4:return De(),e===null&&Ru(t.stateNode.containerInfo),ot(t),null;case 10:return oa(t.type),ot(t),null;case 19:if(de(xt),r=t.memoizedState,r===null)return ot(t),null;if(u=(t.flags&128)!==0,h=r.rendering,h===null)if(u)ar(r,!1);else{if(pt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(h=ys(e),h!==null){for(t.flags|=128,ar(r,!1),e=h.updateQueue,t.updateQueue=e,Ms(t,e),t.subtreeFlags=0,e=i,i=t.child;i!==null;)jh(i,e),i=i.sibling;return H(xt,xt.current&1|2),He&&aa(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&yt()>Rs&&(t.flags|=128,u=!0,ar(r,!1),t.lanes=4194304)}else{if(!u)if(e=ys(h),e!==null){if(t.flags|=128,u=!0,e=e.updateQueue,t.updateQueue=e,Ms(t,e),ar(r,!0),r.tail===null&&r.tailMode==="hidden"&&!h.alternate&&!He)return ot(t),null}else 2*yt()-r.renderingStartTime>Rs&&i!==536870912&&(t.flags|=128,u=!0,ar(r,!1),t.lanes=4194304);r.isBackwards?(h.sibling=t.child,t.child=h):(e=r.last,e!==null?e.sibling=h:t.child=h,r.last=h)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=yt(),e.sibling=null,i=xt.current,H(xt,u?i&1|2:i&1),He&&aa(t,r.treeForkCount),e):(ot(t),null);case 22:case 23:return rn(t),_c(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(i&536870912)!==0&&(t.flags&128)===0&&(ot(t),t.subtreeFlags&6&&(t.flags|=8192)):ot(t),i=t.updateQueue,i!==null&&Ms(t,i.retryQueue),i=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==i&&(t.flags|=2048),e!==null&&de(hi),null;case 24:return i=null,e!==null&&(i=e.memoizedState.cache),t.memoizedState.cache!==i&&(t.flags|=2048),oa(vt),ot(t),null;case 25:return null;case 30:return null}throw Error(s(156,t.tag))}function T0(e,t){switch(Cc(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return oa(vt),De(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return st(t),null;case 31:if(t.memoizedState!==null){if(rn(t),t.alternate===null)throw Error(s(340));ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(rn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(s(340));ui()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return de(xt),null;case 4:return De(),null;case 10:return oa(t.type),null;case 22:case 23:return rn(t),_c(),e!==null&&de(hi),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return oa(vt),null;case 25:return null;default:return null}}function tm(e,t){switch(Cc(t),t.tag){case 3:oa(vt),De();break;case 26:case 27:case 5:st(t);break;case 4:De();break;case 31:t.memoizedState!==null&&rn(t);break;case 13:rn(t);break;case 19:de(xt);break;case 10:oa(t.type);break;case 22:case 23:rn(t),_c(),e!==null&&de(hi);break;case 24:oa(vt)}}function ir(e,t){try{var i=t.updateQueue,r=i!==null?i.lastEffect:null;if(r!==null){var u=r.next;i=u;do{if((i.tag&e)===e){r=void 0;var h=i.create,g=i.inst;r=h(),g.destroy=r}i=i.next}while(i!==u)}}catch(v){We(t,t.return,v)}}function Ia(e,t,i){try{var r=t.updateQueue,u=r!==null?r.lastEffect:null;if(u!==null){var h=u.next;r=h;do{if((r.tag&e)===e){var g=r.inst,v=g.destroy;if(v!==void 0){g.destroy=void 0,u=t;var M=i,B=v;try{B()}catch(V){We(u,M,V)}}}r=r.next}while(r!==h)}}catch(V){We(t,t.return,V)}}function nm(e){var t=e.updateQueue;if(t!==null){var i=e.stateNode;try{Vh(t,i)}catch(r){We(e,e.return,r)}}}function am(e,t,i){i.props=xi(e.type,e.memoizedProps),i.state=e.memoizedState;try{i.componentWillUnmount()}catch(r){We(e,t,r)}}function or(e,t){try{var i=e.ref;if(i!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof i=="function"?e.refCleanup=i(r):i.current=r}}catch(u){We(e,t,u)}}function In(e,t){var i=e.ref,r=e.refCleanup;if(i!==null)if(typeof r=="function")try{r()}catch(u){We(e,t,u)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof i=="function")try{i(null)}catch(u){We(e,t,u)}else i.current=null}function im(e){var t=e.type,i=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":i.autoFocus&&r.focus();break e;case"img":i.src?r.src=i.src:i.srcSet&&(r.srcset=i.srcSet)}}catch(u){We(e,e.return,u)}}function pu(e,t,i){try{var r=e.stateNode;X0(r,e.type,i,t),r[Kt]=t}catch(u){We(e,e.return,u)}}function om(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ga(e.type)||e.tag===4}function mu(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||om(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&&Ga(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 gu(e,t,i){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i).insertBefore(e,t):(t=i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,t.appendChild(e),i=i._reactRootContainer,i!=null||t.onclick!==null||(t.onclick=ea));else if(r!==4&&(r===27&&Ga(e.type)&&(i=e.stateNode,t=null),e=e.child,e!==null))for(gu(e,t,i),e=e.sibling;e!==null;)gu(e,t,i),e=e.sibling}function Es(e,t,i){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?i.insertBefore(e,t):i.appendChild(e);else if(r!==4&&(r===27&&Ga(e.type)&&(i=e.stateNode),e=e.child,e!==null))for(Es(e,t,i),e=e.sibling;e!==null;)Es(e,t,i),e=e.sibling}function rm(e){var t=e.stateNode,i=e.memoizedProps;try{for(var r=e.type,u=t.attributes;u.length;)t.removeAttributeNode(u[0]);Rt(t,r,i),t[Et]=e,t[Kt]=i}catch(h){We(e,e.return,h)}}var ua=!1,wt=!1,yu=!1,sm=typeof WeakSet=="function"?WeakSet:Set,jt=null;function M0(e,t){if(e=e.containerInfo,Iu=Zs,e=bh(e),uc(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var r=i.getSelection&&i.getSelection();if(r&&r.rangeCount!==0){i=r.anchorNode;var u=r.anchorOffset,h=r.focusNode;r=r.focusOffset;try{i.nodeType,h.nodeType}catch{i=null;break e}var g=0,v=-1,M=-1,B=0,V=0,W=e,q=null;t:for(;;){for(var G;W!==i||u!==0&&W.nodeType!==3||(v=g+u),W!==h||r!==0&&W.nodeType!==3||(M=g+r),W.nodeType===3&&(g+=W.nodeValue.length),(G=W.firstChild)!==null;)q=W,W=G;for(;;){if(W===e)break t;if(q===i&&++B===u&&(v=g),q===h&&++V===r&&(M=g),(G=W.nextSibling)!==null)break;W=q,q=W.parentNode}W=G}i=v===-1||M===-1?null:{start:v,end:M}}else i=null}i=i||{start:0,end:0}}else i=null;for(Uu={focusedElem:e,selectionRange:i},Zs=!1,jt=t;jt!==null;)if(t=jt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,jt=e;else for(;jt!==null;){switch(t=jt,h=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(i=0;i<e.length;i++)u=e[i],u.ref.impl=u.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,i=t,u=h.memoizedProps,h=h.memoizedState,r=i.stateNode;try{var ue=xi(i.type,u);e=r.getSnapshotBeforeUpdate(ue,h),r.__reactInternalSnapshotBeforeUpdate=e}catch(we){We(i,i.return,we)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,i=e.nodeType,i===9)Ku(e);else if(i===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Ku(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(s(163))}if(e=t.sibling,e!==null){e.return=t.return,jt=e;break}jt=t.return}}function lm(e,t,i){var r=i.flags;switch(i.tag){case 0:case 11:case 15:fa(e,i),r&4&&ir(5,i);break;case 1:if(fa(e,i),r&4)if(e=i.stateNode,t===null)try{e.componentDidMount()}catch(g){We(i,i.return,g)}else{var u=xi(i.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(u,t,e.__reactInternalSnapshotBeforeUpdate)}catch(g){We(i,i.return,g)}}r&64&&nm(i),r&512&&or(i,i.return);break;case 3:if(fa(e,i),r&64&&(e=i.updateQueue,e!==null)){if(t=null,i.child!==null)switch(i.child.tag){case 27:case 5:t=i.child.stateNode;break;case 1:t=i.child.stateNode}try{Vh(e,t)}catch(g){We(i,i.return,g)}}break;case 27:t===null&&r&4&&rm(i);case 26:case 5:fa(e,i),t===null&&r&4&&im(i),r&512&&or(i,i.return);break;case 12:fa(e,i);break;case 31:fa(e,i),r&4&&dm(e,i);break;case 13:fa(e,i),r&4&&fm(e,i),r&64&&(e=i.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(i=U0.bind(null,i),oC(e,i))));break;case 22:if(r=i.memoizedState!==null||ua,!r){t=t!==null&&t.memoizedState!==null||wt,u=ua;var h=wt;ua=r,(wt=t)&&!h?ha(e,i,(i.subtreeFlags&8772)!==0):fa(e,i),ua=u,wt=h}break;case 30:break;default:fa(e,i)}}function cm(e){var t=e.alternate;t!==null&&(e.alternate=null,cm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Yl(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 ut=null,Ft=!1;function da(e,t,i){for(i=i.child;i!==null;)um(e,t,i),i=i.sibling}function um(e,t,i){if(J&&typeof J.onCommitFiberUnmount=="function")try{J.onCommitFiberUnmount(Wn,i)}catch{}switch(i.tag){case 26:wt||In(i,t),da(e,t,i),i.memoizedState?i.memoizedState.count--:i.stateNode&&(i=i.stateNode,i.parentNode.removeChild(i));break;case 27:wt||In(i,t);var r=ut,u=Ft;Ga(i.type)&&(ut=i.stateNode,Ft=!1),da(e,t,i),pr(i.stateNode),ut=r,Ft=u;break;case 5:wt||In(i,t);case 6:if(r=ut,u=Ft,ut=null,da(e,t,i),ut=r,Ft=u,ut!==null)if(Ft)try{(ut.nodeType===9?ut.body:ut.nodeName==="HTML"?ut.ownerDocument.body:ut).removeChild(i.stateNode)}catch(h){We(i,t,h)}else try{ut.removeChild(i.stateNode)}catch(h){We(i,t,h)}break;case 18:ut!==null&&(Ft?(e=ut,ng(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,i.stateNode),mo(e)):ng(ut,i.stateNode));break;case 4:r=ut,u=Ft,ut=i.stateNode.containerInfo,Ft=!0,da(e,t,i),ut=r,Ft=u;break;case 0:case 11:case 14:case 15:Ia(2,i,t),wt||Ia(4,i,t),da(e,t,i);break;case 1:wt||(In(i,t),r=i.stateNode,typeof r.componentWillUnmount=="function"&&am(i,t,r)),da(e,t,i);break;case 21:da(e,t,i);break;case 22:wt=(r=wt)||i.memoizedState!==null,da(e,t,i),wt=r;break;default:da(e,t,i)}}function dm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{mo(e)}catch(i){We(t,t.return,i)}}}function fm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{mo(e)}catch(i){We(t,t.return,i)}}function E0(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new sm),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new sm),t;default:throw Error(s(435,e.tag))}}function Os(e,t){var i=E0(e);t.forEach(function(r){if(!i.has(r)){i.add(r);var u=H0.bind(null,e,r);r.then(u,u)}})}function Gt(e,t){var i=t.deletions;if(i!==null)for(var r=0;r<i.length;r++){var u=i[r],h=e,g=t,v=g;e:for(;v!==null;){switch(v.tag){case 27:if(Ga(v.type)){ut=v.stateNode,Ft=!1;break e}break;case 5:ut=v.stateNode,Ft=!1;break e;case 3:case 4:ut=v.stateNode.containerInfo,Ft=!0;break e}v=v.return}if(ut===null)throw Error(s(160));um(h,g,u),ut=null,Ft=!1,h=u.alternate,h!==null&&(h.return=null),u.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)hm(t,e),t=t.sibling}var Dn=null;function hm(e,t){var i=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Gt(t,e),Vt(e),r&4&&(Ia(3,e,e.return),ir(3,e),Ia(5,e,e.return));break;case 1:Gt(t,e),Vt(e),r&512&&(wt||i===null||In(i,i.return)),r&64&&ua&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(i=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=i===null?r:i.concat(r))));break;case 26:var u=Dn;if(Gt(t,e),Vt(e),r&512&&(wt||i===null||In(i,i.return)),r&4){var h=i!==null?i.memoizedState:null;if(r=e.memoizedState,i===null)if(r===null)if(e.stateNode===null){e:{r=e.type,i=e.memoizedProps,u=u.ownerDocument||u;t:switch(r){case"title":h=u.getElementsByTagName("title")[0],(!h||h[Oo]||h[Et]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=u.createElement(r),u.head.insertBefore(h,u.querySelector("head > title"))),Rt(h,r,i),h[Et]=e,Dt(h),r=h;break e;case"link":var g=hg("link","href",u).get(r+(i.href||""));if(g){for(var v=0;v<g.length;v++)if(h=g[v],h.getAttribute("href")===(i.href==null||i.href===""?null:i.href)&&h.getAttribute("rel")===(i.rel==null?null:i.rel)&&h.getAttribute("title")===(i.title==null?null:i.title)&&h.getAttribute("crossorigin")===(i.crossOrigin==null?null:i.crossOrigin)){g.splice(v,1);break t}}h=u.createElement(r),Rt(h,r,i),u.head.appendChild(h);break;case"meta":if(g=hg("meta","content",u).get(r+(i.content||""))){for(v=0;v<g.length;v++)if(h=g[v],h.getAttribute("content")===(i.content==null?null:""+i.content)&&h.getAttribute("name")===(i.name==null?null:i.name)&&h.getAttribute("property")===(i.property==null?null:i.property)&&h.getAttribute("http-equiv")===(i.httpEquiv==null?null:i.httpEquiv)&&h.getAttribute("charset")===(i.charSet==null?null:i.charSet)){g.splice(v,1);break t}}h=u.createElement(r),Rt(h,r,i),u.head.appendChild(h);break;default:throw Error(s(468,r))}h[Et]=e,Dt(h),r=h}e.stateNode=r}else pg(u,e.type,e.stateNode);else e.stateNode=fg(u,r,e.memoizedProps);else h!==r?(h===null?i.stateNode!==null&&(i=i.stateNode,i.parentNode.removeChild(i)):h.count--,r===null?pg(u,e.type,e.stateNode):fg(u,r,e.memoizedProps)):r===null&&e.stateNode!==null&&pu(e,e.memoizedProps,i.memoizedProps)}break;case 27:Gt(t,e),Vt(e),r&512&&(wt||i===null||In(i,i.return)),i!==null&&r&4&&pu(e,e.memoizedProps,i.memoizedProps);break;case 5:if(Gt(t,e),Vt(e),r&512&&(wt||i===null||In(i,i.return)),e.flags&32){u=e.stateNode;try{zi(u,"")}catch(ue){We(e,e.return,ue)}}r&4&&e.stateNode!=null&&(u=e.memoizedProps,pu(e,u,i!==null?i.memoizedProps:u)),r&1024&&(yu=!0);break;case 6:if(Gt(t,e),Vt(e),r&4){if(e.stateNode===null)throw Error(s(162));r=e.memoizedProps,i=e.stateNode;try{i.nodeValue=r}catch(ue){We(e,e.return,ue)}}break;case 3:if($s=null,u=Dn,Dn=Vs(t.containerInfo),Gt(t,e),Dn=u,Vt(e),r&4&&i!==null&&i.memoizedState.isDehydrated)try{mo(t.containerInfo)}catch(ue){We(e,e.return,ue)}yu&&(yu=!1,pm(e));break;case 4:r=Dn,Dn=Vs(e.stateNode.containerInfo),Gt(t,e),Vt(e),Dn=r;break;case 12:Gt(t,e),Vt(e);break;case 31:Gt(t,e),Vt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Os(e,r)));break;case 13:Gt(t,e),Vt(e),e.child.flags&8192&&e.memoizedState!==null!=(i!==null&&i.memoizedState!==null)&&(Ls=yt()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Os(e,r)));break;case 22:u=e.memoizedState!==null;var M=i!==null&&i.memoizedState!==null,B=ua,V=wt;if(ua=B||u,wt=V||M,Gt(t,e),wt=V,ua=B,Vt(e),r&8192)e:for(t=e.stateNode,t._visibility=u?t._visibility&-2:t._visibility|1,u&&(i===null||M||ua||wt||bi(e)),i=null,t=e;;){if(t.tag===5||t.tag===26){if(i===null){M=i=t;try{if(h=M.stateNode,u)g=h.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{v=M.stateNode;var W=M.memoizedProps.style,q=W!=null&&W.hasOwnProperty("display")?W.display:null;v.style.display=q==null||typeof q=="boolean"?"":(""+q).trim()}}catch(ue){We(M,M.return,ue)}}}else if(t.tag===6){if(i===null){M=t;try{M.stateNode.nodeValue=u?"":M.memoizedProps}catch(ue){We(M,M.return,ue)}}}else if(t.tag===18){if(i===null){M=t;try{var G=M.stateNode;u?ag(G,!0):ag(M.stateNode,!1)}catch(ue){We(M,M.return,ue)}}}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;i===t&&(i=null),t=t.return}i===t&&(i=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(i=r.retryQueue,i!==null&&(r.retryQueue=null,Os(e,i))));break;case 19:Gt(t,e),Vt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,Os(e,r)));break;case 30:break;case 21:break;default:Gt(t,e),Vt(e)}}function Vt(e){var t=e.flags;if(t&2){try{for(var i,r=e.return;r!==null;){if(om(r)){i=r;break}r=r.return}if(i==null)throw Error(s(160));switch(i.tag){case 27:var u=i.stateNode,h=mu(e);Es(e,h,u);break;case 5:var g=i.stateNode;i.flags&32&&(zi(g,""),i.flags&=-33);var v=mu(e);Es(e,v,g);break;case 3:case 4:var M=i.stateNode.containerInfo,B=mu(e);gu(e,B,M);break;default:throw Error(s(161))}}catch(V){We(e,e.return,V)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function pm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;pm(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function fa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)lm(e,t.alternate,t),t=t.sibling}function bi(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Ia(4,t,t.return),bi(t);break;case 1:In(t,t.return);var i=t.stateNode;typeof i.componentWillUnmount=="function"&&am(t,t.return,i),bi(t);break;case 27:pr(t.stateNode);case 26:case 5:In(t,t.return),bi(t);break;case 22:t.memoizedState===null&&bi(t);break;case 30:bi(t);break;default:bi(t)}e=e.sibling}}function ha(e,t,i){for(i=i&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,u=e,h=t,g=h.flags;switch(h.tag){case 0:case 11:case 15:ha(u,h,i),ir(4,h);break;case 1:if(ha(u,h,i),r=h,u=r.stateNode,typeof u.componentDidMount=="function")try{u.componentDidMount()}catch(B){We(r,r.return,B)}if(r=h,u=r.updateQueue,u!==null){var v=r.stateNode;try{var M=u.shared.hiddenCallbacks;if(M!==null)for(u.shared.hiddenCallbacks=null,u=0;u<M.length;u++)Gh(M[u],v)}catch(B){We(r,r.return,B)}}i&&g&64&&nm(h),or(h,h.return);break;case 27:rm(h);case 26:case 5:ha(u,h,i),i&&r===null&&g&4&&im(h),or(h,h.return);break;case 12:ha(u,h,i);break;case 31:ha(u,h,i),i&&g&4&&dm(u,h);break;case 13:ha(u,h,i),i&&g&4&&fm(u,h);break;case 22:h.memoizedState===null&&ha(u,h,i),or(h,h.return);break;case 30:break;default:ha(u,h,i)}t=t.sibling}}function xu(e,t){var i=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(i=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==i&&(e!=null&&e.refCount++,i!=null&&Go(i))}function bu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Go(e))}function jn(e,t,i,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)mm(e,t,i,r),t=t.sibling}function mm(e,t,i,r){var u=t.flags;switch(t.tag){case 0:case 11:case 15:jn(e,t,i,r),u&2048&&ir(9,t);break;case 1:jn(e,t,i,r);break;case 3:jn(e,t,i,r),u&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Go(e)));break;case 12:if(u&2048){jn(e,t,i,r),e=t.stateNode;try{var h=t.memoizedProps,g=h.id,v=h.onPostCommit;typeof v=="function"&&v(g,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(M){We(t,t.return,M)}}else jn(e,t,i,r);break;case 31:jn(e,t,i,r);break;case 13:jn(e,t,i,r);break;case 23:break;case 22:h=t.stateNode,g=t.alternate,t.memoizedState!==null?h._visibility&2?jn(e,t,i,r):rr(e,t):h._visibility&2?jn(e,t,i,r):(h._visibility|=2,ao(e,t,i,r,(t.subtreeFlags&10256)!==0||!1)),u&2048&&xu(g,t);break;case 24:jn(e,t,i,r),u&2048&&bu(t.alternate,t);break;default:jn(e,t,i,r)}}function ao(e,t,i,r,u){for(u=u&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var h=e,g=t,v=i,M=r,B=g.flags;switch(g.tag){case 0:case 11:case 15:ao(h,g,v,M,u),ir(8,g);break;case 23:break;case 22:var V=g.stateNode;g.memoizedState!==null?V._visibility&2?ao(h,g,v,M,u):rr(h,g):(V._visibility|=2,ao(h,g,v,M,u)),u&&B&2048&&xu(g.alternate,g);break;case 24:ao(h,g,v,M,u),u&&B&2048&&bu(g.alternate,g);break;default:ao(h,g,v,M,u)}t=t.sibling}}function rr(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var i=e,r=t,u=r.flags;switch(r.tag){case 22:rr(i,r),u&2048&&xu(r.alternate,r);break;case 24:rr(i,r),u&2048&&bu(r.alternate,r);break;default:rr(i,r)}t=t.sibling}}var sr=8192;function io(e,t,i){if(e.subtreeFlags&sr)for(e=e.child;e!==null;)gm(e,t,i),e=e.sibling}function gm(e,t,i){switch(e.tag){case 26:io(e,t,i),e.flags&sr&&e.memoizedState!==null&&yC(i,Dn,e.memoizedState,e.memoizedProps);break;case 5:io(e,t,i);break;case 3:case 4:var r=Dn;Dn=Vs(e.stateNode.containerInfo),io(e,t,i),Dn=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=sr,sr=16777216,io(e,t,i),sr=r):io(e,t,i));break;default:io(e,t,i)}}function ym(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 lr(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var r=t[i];jt=r,bm(r,e)}ym(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)xm(e),e=e.sibling}function xm(e){switch(e.tag){case 0:case 11:case 15:lr(e),e.flags&2048&&Ia(9,e,e.return);break;case 3:lr(e);break;case 12:lr(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ps(e)):lr(e);break;default:lr(e)}}function Ps(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var i=0;i<t.length;i++){var r=t[i];jt=r,bm(r,e)}ym(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Ia(8,t,t.return),Ps(t);break;case 22:i=t.stateNode,i._visibility&2&&(i._visibility&=-3,Ps(t));break;default:Ps(t)}e=e.sibling}}function bm(e,t){for(;jt!==null;){var i=jt;switch(i.tag){case 0:case 11:case 15:Ia(8,i,t);break;case 23:case 22:if(i.memoizedState!==null&&i.memoizedState.cachePool!==null){var r=i.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Go(i.memoizedState.cache)}if(r=i.child,r!==null)r.return=i,jt=r;else e:for(i=e;jt!==null;){r=jt;var u=r.sibling,h=r.return;if(cm(r),r===i){jt=null;break e}if(u!==null){u.return=h,jt=u;break e}jt=h}}}var O0={getCacheForType:function(e){var t=Pt(vt),i=t.data.get(e);return i===void 0&&(i=e(),t.data.set(e,i)),i},cacheSignal:function(){return Pt(vt).controller.signal}},P0=typeof WeakMap=="function"?WeakMap:Map,$e=0,et=null,Re=null,ze=0,Qe=0,sn=null,Ua=!1,oo=!1,vu=!1,pa=0,pt=0,Ha=0,vi=0,Cu=0,ln=0,ro=0,cr=null,Yt=null,Su=!1,Ls=0,vm=0,Rs=1/0,_s=null,Ba=null,Nt=0,Ka=null,so=null,ma=0,wu=0,Nu=null,Cm=null,ur=0,Au=null;function cn(){return($e&2)!==0&&ze!==0?ze&-ze:I.T!==null?Eu():Mo()}function Sm(){if(ln===0)if((ze&536870912)===0||He){var e=Se;Se<<=1,(Se&3932160)===0&&(Se=262144),ln=e}else ln=536870912;return e=on.current,e!==null&&(e.flags|=32),ln}function $t(e,t,i){(e===et&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)&&(lo(e,0),qa(e,ze,ln,!1)),An(e,i),(($e&2)===0||e!==et)&&(e===et&&(($e&2)===0&&(vi|=i),pt===4&&qa(e,ze,ln,!1)),Un(e))}function wm(e,t,i){if(($e&6)!==0)throw Error(s(327));var r=!i&&(t&127)===0&&(t&e.expiredLanes)===0||It(e,t),u=r?_0(e,t):Du(e,t,!0),h=r;do{if(u===0){oo&&!r&&qa(e,t,0,!1);break}else{if(i=e.current.alternate,h&&!L0(i)){u=Du(e,t,!1),h=!1;continue}if(u===2){if(h=t,e.errorRecoveryDisabledLanes&h)var g=0;else g=e.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){t=g;e:{var v=e;u=cr;var M=v.current.memoizedState.isDehydrated;if(M&&(lo(v,g).flags|=256),g=Du(v,g,!1),g!==2){if(vu&&!M){v.errorRecoveryDisabledLanes|=h,vi|=h,u=4;break e}h=Yt,Yt=u,h!==null&&(Yt===null?Yt=h:Yt.push.apply(Yt,h))}u=g}if(h=!1,u!==2)continue}}if(u===1){lo(e,0),qa(e,t,0,!0);break}e:{switch(r=e,h=u,h){case 0:case 1:throw Error(s(345));case 4:if((t&4194048)!==t)break;case 6:qa(r,t,ln,!Ua);break e;case 2:Yt=null;break;case 3:case 5:break;default:throw Error(s(329))}if((t&62914560)===t&&(u=Ls+300-yt(),10<u)){if(qa(r,t,ln,!Ua),Ne(r,0,!0)!==0)break e;ma=t,r.timeoutHandle=eg(Nm.bind(null,r,i,Yt,_s,Su,t,ln,vi,ro,Ua,h,"Throttled",-0,0),u);break e}Nm(r,i,Yt,_s,Su,t,ln,vi,ro,Ua,h,null,-0,0)}}break}while(!0);Un(e)}function Nm(e,t,i,r,u,h,g,v,M,B,V,W,q,G){if(e.timeoutHandle=-1,W=t.subtreeFlags,W&8192||(W&16785408)===16785408){W={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ea},gm(t,h,W);var ue=(h&62914560)===h?Ls-yt():(h&4194048)===h?vm-yt():0;if(ue=xC(W,ue),ue!==null){ma=h,e.cancelPendingCommit=ue(Om.bind(null,e,t,h,i,r,u,g,v,M,V,W,null,q,G)),qa(e,h,g,!B);return}}Om(e,t,h,i,r,u,g,v,M)}function L0(e){for(var t=e;;){var i=t.tag;if((i===0||i===11||i===15)&&t.flags&16384&&(i=t.updateQueue,i!==null&&(i=i.stores,i!==null)))for(var r=0;r<i.length;r++){var u=i[r],h=u.getSnapshot;u=u.value;try{if(!nn(h(),u))return!1}catch{return!1}}if(i=t.child,t.subtreeFlags&16384&&i!==null)i.return=t,t=i;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 qa(e,t,i,r){t&=~Cu,t&=~vi,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var u=t;0<u;){var h=31-Ce(u),g=1<<h;r[h]=-1,u&=~g}i!==0&&ai(e,i,t)}function zs(){return($e&6)===0?(dr(0),!1):!0}function ku(){if(Re!==null){if(Qe===0)var e=Re.return;else e=Re,ia=di=null,Kc(e),Zi=null,Yo=0,e=Re;for(;e!==null;)tm(e.alternate,e),e=e.return;Re=null}}function lo(e,t){var i=e.timeoutHandle;i!==-1&&(e.timeoutHandle=-1,eC(i)),i=e.cancelPendingCommit,i!==null&&(e.cancelPendingCommit=null,i()),ma=0,ku(),et=e,Re=i=na(e.current,null),ze=t,Qe=0,sn=null,Ua=!1,oo=It(e,t),vu=!1,ro=ln=Cu=vi=Ha=pt=0,Yt=cr=null,Su=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var u=31-Ce(r),h=1<<u;t|=e[u],r&=~h}return pa=t,is(),i}function Am(e,t){Te=null,I.H=tr,t===Xi||t===fs?(t=Bh(),Qe=3):t===Mc?(t=Bh(),Qe=4):Qe=t===iu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,sn=t,Re===null&&(pt=1,ks(e,xn(t,e.current)))}function km(){var e=on.current;return e===null?!0:(ze&4194048)===ze?Sn===null:(ze&62914560)===ze||(ze&536870912)!==0?e===Sn:!1}function Dm(){var e=I.H;return I.H=tr,e===null?tr:e}function jm(){var e=I.A;return I.A=O0,e}function Is(){pt=4,Ua||(ze&4194048)!==ze&&on.current!==null||(oo=!0),(Ha&134217727)===0&&(vi&134217727)===0||et===null||qa(et,ze,ln,!1)}function Du(e,t,i){var r=$e;$e|=2;var u=Dm(),h=jm();(et!==e||ze!==t)&&(_s=null,lo(e,t)),t=!1;var g=pt;e:do try{if(Qe!==0&&Re!==null){var v=Re,M=sn;switch(Qe){case 8:ku(),g=6;break e;case 3:case 2:case 9:case 6:on.current===null&&(t=!0);var B=Qe;if(Qe=0,sn=null,co(e,v,M,B),i&&oo){g=0;break e}break;default:B=Qe,Qe=0,sn=null,co(e,v,M,B)}}R0(),g=pt;break}catch(V){Am(e,V)}while(!0);return t&&e.shellSuspendCounter++,ia=di=null,$e=r,I.H=u,I.A=h,Re===null&&(et=null,ze=0,is()),g}function R0(){for(;Re!==null;)Tm(Re)}function _0(e,t){var i=$e;$e|=2;var r=Dm(),u=jm();et!==e||ze!==t?(_s=null,Rs=yt()+500,lo(e,t)):oo=It(e,t);e:do try{if(Qe!==0&&Re!==null){t=Re;var h=sn;t:switch(Qe){case 1:Qe=0,sn=null,co(e,t,h,1);break;case 2:case 9:if(Uh(h)){Qe=0,sn=null,Mm(t);break}t=function(){Qe!==2&&Qe!==9||et!==e||(Qe=7),Un(e)},h.then(t,t);break e;case 3:Qe=7;break e;case 4:Qe=5;break e;case 7:Uh(h)?(Qe=0,sn=null,Mm(t)):(Qe=0,sn=null,co(e,t,h,7));break;case 5:var g=null;switch(Re.tag){case 26:g=Re.memoizedState;case 5:case 27:var v=Re;if(g?mg(g):v.stateNode.complete){Qe=0,sn=null;var M=v.sibling;if(M!==null)Re=M;else{var B=v.return;B!==null?(Re=B,Us(B)):Re=null}break t}}Qe=0,sn=null,co(e,t,h,5);break;case 6:Qe=0,sn=null,co(e,t,h,6);break;case 8:ku(),pt=6;break e;default:throw Error(s(462))}}z0();break}catch(V){Am(e,V)}while(!0);return ia=di=null,I.H=r,I.A=u,$e=i,Re!==null?0:(et=null,ze=0,is(),pt)}function z0(){for(;Re!==null&&!ka();)Tm(Re)}function Tm(e){var t=Jp(e.alternate,e,pa);e.memoizedProps=e.pendingProps,t===null?Us(e):Re=t}function Mm(e){var t=e,i=t.alternate;switch(t.tag){case 15:case 0:t=Yp(i,t,t.pendingProps,t.type,void 0,ze);break;case 11:t=Yp(i,t,t.pendingProps,t.type.render,t.ref,ze);break;case 5:Kc(t);default:tm(i,t),t=Re=jh(t,pa),t=Jp(i,t,pa)}e.memoizedProps=e.pendingProps,t===null?Us(e):Re=t}function co(e,t,i,r){ia=di=null,Kc(t),Zi=null,Yo=0;var u=t.return;try{if(A0(e,u,t,i,ze)){pt=1,ks(e,xn(i,e.current)),Re=null;return}}catch(h){if(u!==null)throw Re=u,h;pt=1,ks(e,xn(i,e.current)),Re=null;return}t.flags&32768?(He||r===1?e=!0:oo||(ze&536870912)!==0?e=!1:(Ua=e=!0,(r===2||r===9||r===3||r===6)&&(r=on.current,r!==null&&r.tag===13&&(r.flags|=16384))),Em(t,e)):Us(t)}function Us(e){var t=e;do{if((t.flags&32768)!==0){Em(t,Ua);return}e=t.return;var i=j0(t.alternate,t,pa);if(i!==null){Re=i;return}if(t=t.sibling,t!==null){Re=t;return}Re=t=e}while(t!==null);pt===0&&(pt=5)}function Em(e,t){do{var i=T0(e.alternate,e);if(i!==null){i.flags&=32767,Re=i;return}if(i=e.return,i!==null&&(i.flags|=32768,i.subtreeFlags=0,i.deletions=null),!t&&(e=e.sibling,e!==null)){Re=e;return}Re=e=i}while(e!==null);pt=6,Re=null}function Om(e,t,i,r,u,h,g,v,M){e.cancelPendingCommit=null;do Hs();while(Nt!==0);if(($e&6)!==0)throw Error(s(327));if(t!==null){if(t===e.current)throw Error(s(177));if(h=t.lanes|t.childLanes,h|=mc,jo(e,i,h,g,v,M),e===et&&(Re=et=null,ze=0),so=t,Ka=e,ma=i,wu=h,Nu=u,Cm=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,B0(Ln,function(){return zm(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=I.T,I.T=null,u=X.p,X.p=2,g=$e,$e|=4;try{M0(e,t,i)}finally{$e=g,X.p=u,I.T=r}}Nt=1,Pm(),Lm(),Rm()}}function Pm(){if(Nt===1){Nt=0;var e=Ka,t=so,i=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||i){i=I.T,I.T=null;var r=X.p;X.p=2;var u=$e;$e|=4;try{hm(t,e);var h=Uu,g=bh(e.containerInfo),v=h.focusedElem,M=h.selectionRange;if(g!==v&&v&&v.ownerDocument&&xh(v.ownerDocument.documentElement,v)){if(M!==null&&uc(v)){var B=M.start,V=M.end;if(V===void 0&&(V=B),"selectionStart"in v)v.selectionStart=B,v.selectionEnd=Math.min(V,v.value.length);else{var W=v.ownerDocument||document,q=W&&W.defaultView||window;if(q.getSelection){var G=q.getSelection(),ue=v.textContent.length,we=Math.min(M.start,ue),Je=M.end===void 0?we:Math.min(M.end,ue);!G.extend&&we>Je&&(g=Je,Je=we,we=g);var _=yh(v,we),L=yh(v,Je);if(_&&L&&(G.rangeCount!==1||G.anchorNode!==_.node||G.anchorOffset!==_.offset||G.focusNode!==L.node||G.focusOffset!==L.offset)){var U=W.createRange();U.setStart(_.node,_.offset),G.removeAllRanges(),we>Je?(G.addRange(U),G.extend(L.node,L.offset)):(U.setEnd(L.node,L.offset),G.addRange(U))}}}}for(W=[],G=v;G=G.parentNode;)G.nodeType===1&&W.push({element:G,left:G.scrollLeft,top:G.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<W.length;v++){var Y=W[v];Y.element.scrollLeft=Y.left,Y.element.scrollTop=Y.top}}Zs=!!Iu,Uu=Iu=null}finally{$e=u,X.p=r,I.T=i}}e.current=t,Nt=2}}function Lm(){if(Nt===2){Nt=0;var e=Ka,t=so,i=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||i){i=I.T,I.T=null;var r=X.p;X.p=2;var u=$e;$e|=4;try{lm(e,t.alternate,t)}finally{$e=u,X.p=r,I.T=i}}Nt=3}}function Rm(){if(Nt===4||Nt===3){Nt=0,$n();var e=Ka,t=so,i=ma,r=Cm;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Nt=5:(Nt=0,so=Ka=null,_m(e,e.pendingLanes));var u=e.pendingLanes;if(u===0&&(Ba=null),Mi(i),t=t.stateNode,J&&typeof J.onCommitFiberRoot=="function")try{J.onCommitFiberRoot(Wn,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=I.T,u=X.p,X.p=2,I.T=null;try{for(var h=e.onRecoverableError,g=0;g<r.length;g++){var v=r[g];h(v.value,{componentStack:v.stack})}}finally{I.T=t,X.p=u}}(ma&3)!==0&&Hs(),Un(e),u=e.pendingLanes,(i&261930)!==0&&(u&42)!==0?e===Au?ur++:(ur=0,Au=e):ur=0,dr(0)}}function _m(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Go(t)))}function Hs(){return Pm(),Lm(),Rm(),zm()}function zm(){if(Nt!==5)return!1;var e=Ka,t=wu;wu=0;var i=Mi(ma),r=I.T,u=X.p;try{X.p=32>i?32:i,I.T=null,i=Nu,Nu=null;var h=Ka,g=ma;if(Nt=0,so=Ka=null,ma=0,($e&6)!==0)throw Error(s(331));var v=$e;if($e|=4,xm(h.current),mm(h,h.current,g,i),$e=v,dr(0,!1),J&&typeof J.onPostCommitFiberRoot=="function")try{J.onPostCommitFiberRoot(Wn,h)}catch{}return!0}finally{X.p=u,I.T=r,_m(e,t)}}function Im(e,t,i){t=xn(i,t),t=au(e.stateNode,t,2),e=Ra(e,t,2),e!==null&&(An(e,2),Un(e))}function We(e,t,i){if(e.tag===3)Im(e,e,i);else for(;t!==null;){if(t.tag===3){Im(t,e,i);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ba===null||!Ba.has(r))){e=xn(i,e),i=Up(2),r=Ra(t,i,2),r!==null&&(Hp(i,r,t,e),An(r,2),Un(r));break}}t=t.return}}function ju(e,t,i){var r=e.pingCache;if(r===null){r=e.pingCache=new P0;var u=new Set;r.set(t,u)}else u=r.get(t),u===void 0&&(u=new Set,r.set(t,u));u.has(i)||(vu=!0,u.add(i),e=I0.bind(null,e,t,i),t.then(e,e))}function I0(e,t,i){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&i,e.warmLanes&=~i,et===e&&(ze&i)===i&&(pt===4||pt===3&&(ze&62914560)===ze&&300>yt()-Ls?($e&2)===0&&lo(e,0):Cu|=i,ro===ze&&(ro=0)),Un(e)}function Um(e,t){t===0&&(t=kt()),e=li(e,t),e!==null&&(An(e,t),Un(e))}function U0(e){var t=e.memoizedState,i=0;t!==null&&(i=t.retryLane),Um(e,i)}function H0(e,t){var i=0;switch(e.tag){case 31:case 13:var r=e.stateNode,u=e.memoizedState;u!==null&&(i=u.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(s(314))}r!==null&&r.delete(t),Um(e,i)}function B0(e,t){return Pn(e,t)}var Bs=null,uo=null,Tu=!1,Ks=!1,Mu=!1,Fa=0;function Un(e){e!==uo&&e.next===null&&(uo===null?Bs=uo=e:uo=uo.next=e),Ks=!0,Tu||(Tu=!0,q0())}function dr(e,t){if(!Mu&&Ks){Mu=!0;do for(var i=!1,r=Bs;r!==null;){if(e!==0){var u=r.pendingLanes;if(u===0)var h=0;else{var g=r.suspendedLanes,v=r.pingedLanes;h=(1<<31-Ce(42|e)+1)-1,h&=u&~(g&~v),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(i=!0,qm(r,h))}else h=ze,h=Ne(r,r===et?h:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(h&3)===0||It(r,h)||(i=!0,qm(r,h));r=r.next}while(i);Mu=!1}}function K0(){Hm()}function Hm(){Ks=Tu=!1;var e=0;Fa!==0&&J0()&&(e=Fa);for(var t=yt(),i=null,r=Bs;r!==null;){var u=r.next,h=Bm(r,t);h===0?(r.next=null,i===null?Bs=u:i.next=u,u===null&&(uo=i)):(i=r,(e!==0||(h&3)!==0)&&(Ks=!0)),r=u}Nt!==0&&Nt!==5||dr(e),Fa!==0&&(Fa=0)}function Bm(e,t){for(var i=e.suspendedLanes,r=e.pingedLanes,u=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var g=31-Ce(h),v=1<<g,M=u[g];M===-1?((v&i)===0||(v&r)!==0)&&(u[g]=Xn(v,t)):M<=t&&(e.expiredLanes|=v),h&=~v}if(t=et,i=ze,i=Ne(e,e===t?i:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,i===0||e===t&&(Qe===2||Qe===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Jt(r),e.callbackNode=null,e.callbackPriority=0;if((i&3)===0||It(e,i)){if(t=i&-i,t===e.callbackPriority)return t;switch(r!==null&&Jt(r),Mi(i)){case 2:case 8:i=ni;break;case 32:i=Ln;break;case 268435456:i=Ti;break;default:i=Ln}return r=Km.bind(null,e),i=Pn(i,r),e.callbackPriority=t,e.callbackNode=i,t}return r!==null&&r!==null&&Jt(r),e.callbackPriority=2,e.callbackNode=null,2}function Km(e,t){if(Nt!==0&&Nt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var i=e.callbackNode;if(Hs()&&e.callbackNode!==i)return null;var r=ze;return r=Ne(e,e===et?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(wm(e,r,t),Bm(e,yt()),e.callbackNode!=null&&e.callbackNode===i?Km.bind(null,e):null)}function qm(e,t){if(Hs())return null;wm(e,t,!0)}function q0(){tC(function(){($e&6)!==0?Pn(Qn,K0):Hm()})}function Eu(){if(Fa===0){var e=Qi;e===0&&(e=ke,ke<<=1,(ke&261888)===0&&(ke=256)),Fa=e}return Fa}function Fm(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Wr(""+e)}function Gm(e,t){var i=t.ownerDocument.createElement("input");return i.name=t.name,i.value=t.value,e.id&&i.setAttribute("form",e.id),t.parentNode.insertBefore(i,t),e=new FormData(e),i.parentNode.removeChild(i),e}function F0(e,t,i,r,u){if(t==="submit"&&i&&i.stateNode===u){var h=Fm((u[Kt]||null).action),g=r.submitter;g&&(t=(t=g[Kt]||null)?Fm(t.formAction):g.getAttribute("formAction"),t!==null&&(h=t,g=null));var v=new es("action","action",null,r,u);e.push({event:v,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Fa!==0){var M=g?Gm(u,g):new FormData(u);Xc(i,{pending:!0,data:M,method:u.method,action:h},null,M)}}else typeof h=="function"&&(v.preventDefault(),M=g?Gm(u,g):new FormData(u),Xc(i,{pending:!0,data:M,method:u.method,action:h},h,M))},currentTarget:u}]})}}for(var Ou=0;Ou<pc.length;Ou++){var Pu=pc[Ou],G0=Pu.toLowerCase(),V0=Pu[0].toUpperCase()+Pu.slice(1);kn(G0,"on"+V0)}kn(Sh,"onAnimationEnd"),kn(wh,"onAnimationIteration"),kn(Nh,"onAnimationStart"),kn("dblclick","onDoubleClick"),kn("focusin","onFocus"),kn("focusout","onBlur"),kn(l0,"onTransitionRun"),kn(c0,"onTransitionStart"),kn(u0,"onTransitionCancel"),kn(Ah,"onTransitionEnd"),Ri("onMouseEnter",["mouseout","mouseover"]),Ri("onMouseLeave",["mouseout","mouseover"]),Ri("onPointerEnter",["pointerout","pointerover"]),Ri("onPointerLeave",["pointerout","pointerover"]),ii("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ii("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ii("onBeforeInput",["compositionend","keypress","textInput","paste"]),ii("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ii("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ii("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var fr="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(" "),Y0=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(fr));function Vm(e,t){t=(t&4)!==0;for(var i=0;i<e.length;i++){var r=e[i],u=r.event;r=r.listeners;e:{var h=void 0;if(t)for(var g=r.length-1;0<=g;g--){var v=r[g],M=v.instance,B=v.currentTarget;if(v=v.listener,M!==h&&u.isPropagationStopped())break e;h=v,u.currentTarget=B;try{h(u)}catch(V){as(V)}u.currentTarget=null,h=M}else for(g=0;g<r.length;g++){if(v=r[g],M=v.instance,B=v.currentTarget,v=v.listener,M!==h&&u.isPropagationStopped())break e;h=v,u.currentTarget=B;try{h(u)}catch(V){as(V)}u.currentTarget=null,h=M}}}}function _e(e,t){var i=t[Vl];i===void 0&&(i=t[Vl]=new Set);var r=e+"__bubble";i.has(r)||(Ym(t,e,2,!1),i.add(r))}function Lu(e,t,i){var r=0;t&&(r|=4),Ym(i,e,r,t)}var qs="_reactListening"+Math.random().toString(36).slice(2);function Ru(e){if(!e[qs]){e[qs]=!0,Hf.forEach(function(i){i!=="selectionchange"&&(Y0.has(i)||Lu(i,!1,e),Lu(i,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[qs]||(t[qs]=!0,Lu("selectionchange",!1,t))}}function Ym(e,t,i,r){switch(Sg(t)){case 2:var u=CC;break;case 8:u=SC;break;default:u=Wu}i=u.bind(null,t,i,e),u=void 0,!tc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(u=!0),r?u!==void 0?e.addEventListener(t,i,{capture:!0,passive:u}):e.addEventListener(t,i,!0):u!==void 0?e.addEventListener(t,i,{passive:u}):e.addEventListener(t,i,!1)}function _u(e,t,i,r,u){var h=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var g=r.tag;if(g===3||g===4){var v=r.stateNode.containerInfo;if(v===u)break;if(g===4)for(g=r.return;g!==null;){var M=g.tag;if((M===3||M===4)&&g.stateNode.containerInfo===u)return;g=g.return}for(;v!==null;){if(g=Oi(v),g===null)return;if(M=g.tag,M===5||M===6||M===26||M===27){r=h=g;continue e}v=v.parentNode}}r=r.return}Zf(function(){var B=h,V=Jl(i),W=[];e:{var q=kh.get(e);if(q!==void 0){var G=es,ue=e;switch(e){case"keypress":if(Zr(i)===0)break e;case"keydown":case"keyup":G=Hv;break;case"focusin":ue="focus",G=oc;break;case"focusout":ue="blur",G=oc;break;case"beforeblur":case"afterblur":G=oc;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":G=th;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":G=jv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":G=qv;break;case Sh:case wh:case Nh:G=Ev;break;case Ah:G=Gv;break;case"scroll":case"scrollend":G=kv;break;case"wheel":G=Yv;break;case"copy":case"cut":case"paste":G=Pv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":G=ah;break;case"toggle":case"beforetoggle":G=Qv}var we=(t&4)!==0,Je=!we&&(e==="scroll"||e==="scrollend"),_=we?q!==null?q+"Capture":null:q;we=[];for(var L=B,U;L!==null;){var Y=L;if(U=Y.stateNode,Y=Y.tag,Y!==5&&Y!==26&&Y!==27||U===null||_===null||(Y=Lo(L,_),Y!=null&&we.push(hr(L,Y,U))),Je)break;L=L.return}0<we.length&&(q=new G(q,ue,null,i,V),W.push({event:q,listeners:we}))}}if((t&7)===0){e:{if(q=e==="mouseover"||e==="pointerover",G=e==="mouseout"||e==="pointerout",q&&i!==Zl&&(ue=i.relatedTarget||i.fromElement)&&(Oi(ue)||ue[Ei]))break e;if((G||q)&&(q=V.window===V?V:(q=V.ownerDocument)?q.defaultView||q.parentWindow:window,G?(ue=i.relatedTarget||i.toElement,G=B,ue=ue?Oi(ue):null,ue!==null&&(Je=d(ue),we=ue.tag,ue!==Je||we!==5&&we!==27&&we!==6)&&(ue=null)):(G=null,ue=B),G!==ue)){if(we=th,Y="onMouseLeave",_="onMouseEnter",L="mouse",(e==="pointerout"||e==="pointerover")&&(we=ah,Y="onPointerLeave",_="onPointerEnter",L="pointer"),Je=G==null?q:Po(G),U=ue==null?q:Po(ue),q=new we(Y,L+"leave",G,i,V),q.target=Je,q.relatedTarget=U,Y=null,Oi(V)===B&&(we=new we(_,L+"enter",ue,i,V),we.target=U,we.relatedTarget=Je,Y=we),Je=Y,G&&ue)t:{for(we=$0,_=G,L=ue,U=0,Y=_;Y;Y=we(Y))U++;Y=0;for(var ve=L;ve;ve=we(ve))Y++;for(;0<U-Y;)_=we(_),U--;for(;0<Y-U;)L=we(L),Y--;for(;U--;){if(_===L||L!==null&&_===L.alternate){we=_;break t}_=we(_),L=we(L)}we=null}else we=null;G!==null&&$m(W,q,G,we,!1),ue!==null&&Je!==null&&$m(W,Je,ue,we,!0)}}e:{if(q=B?Po(B):window,G=q.nodeName&&q.nodeName.toLowerCase(),G==="select"||G==="input"&&q.type==="file")var Ge=dh;else if(ch(q))if(fh)Ge=o0;else{Ge=a0;var pe=n0}else G=q.nodeName,!G||G.toLowerCase()!=="input"||q.type!=="checkbox"&&q.type!=="radio"?B&&Xl(B.elementType)&&(Ge=dh):Ge=i0;if(Ge&&(Ge=Ge(e,B))){uh(W,Ge,i,V);break e}pe&&pe(e,q,B),e==="focusout"&&B&&q.type==="number"&&B.memoizedProps.value!=null&&Wl(q,"number",q.value)}switch(pe=B?Po(B):window,e){case"focusin":(ch(pe)||pe.contentEditable==="true")&&(Bi=pe,dc=B,Ko=null);break;case"focusout":Ko=dc=Bi=null;break;case"mousedown":fc=!0;break;case"contextmenu":case"mouseup":case"dragend":fc=!1,vh(W,i,V);break;case"selectionchange":if(s0)break;case"keydown":case"keyup":vh(W,i,V)}var Me;if(sc)e:{switch(e){case"compositionstart":var Ie="onCompositionStart";break e;case"compositionend":Ie="onCompositionEnd";break e;case"compositionupdate":Ie="onCompositionUpdate";break e}Ie=void 0}else Hi?sh(e,i)&&(Ie="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Ie="onCompositionStart");Ie&&(ih&&i.locale!=="ko"&&(Hi||Ie!=="onCompositionStart"?Ie==="onCompositionEnd"&&Hi&&(Me=Jf()):(ja=V,nc="value"in ja?ja.value:ja.textContent,Hi=!0)),pe=Fs(B,Ie),0<pe.length&&(Ie=new nh(Ie,e,null,i,V),W.push({event:Ie,listeners:pe}),Me?Ie.data=Me:(Me=lh(i),Me!==null&&(Ie.data=Me)))),(Me=Xv?Zv(e,i):Jv(e,i))&&(Ie=Fs(B,"onBeforeInput"),0<Ie.length&&(pe=new nh("onBeforeInput","beforeinput",null,i,V),W.push({event:pe,listeners:Ie}),pe.data=Me)),F0(W,e,B,i,V)}Vm(W,t)})}function hr(e,t,i){return{instance:e,listener:t,currentTarget:i}}function Fs(e,t){for(var i=t+"Capture",r=[];e!==null;){var u=e,h=u.stateNode;if(u=u.tag,u!==5&&u!==26&&u!==27||h===null||(u=Lo(e,i),u!=null&&r.unshift(hr(e,u,h)),u=Lo(e,t),u!=null&&r.push(hr(e,u,h))),e.tag===3)return r;e=e.return}return[]}function $0(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function $m(e,t,i,r,u){for(var h=t._reactName,g=[];i!==null&&i!==r;){var v=i,M=v.alternate,B=v.stateNode;if(v=v.tag,M!==null&&M===r)break;v!==5&&v!==26&&v!==27||B===null||(M=B,u?(B=Lo(i,h),B!=null&&g.unshift(hr(i,B,M))):u||(B=Lo(i,h),B!=null&&g.push(hr(i,B,M)))),i=i.return}g.length!==0&&e.push({event:t,listeners:g})}var Q0=/\r\n?/g,W0=/\u0000|\uFFFD/g;function Qm(e){return(typeof e=="string"?e:""+e).replace(Q0,`
10
- `).replace(W0,"")}function Wm(e,t){return t=Qm(t),Qm(e)===t}function Ze(e,t,i,r,u,h){switch(i){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||zi(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&zi(e,""+r);break;case"className":$r(e,"class",r);break;case"tabIndex":$r(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":$r(e,i,r);break;case"style":Wf(e,r,h);break;case"data":if(t!=="object"){$r(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||i!=="href")){e.removeAttribute(i);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(i);break}r=Wr(""+r),e.setAttribute(i,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(i,"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 h=="function"&&(i==="formAction"?(t!=="input"&&Ze(e,t,"name",u.name,u,null),Ze(e,t,"formEncType",u.formEncType,u,null),Ze(e,t,"formMethod",u.formMethod,u,null),Ze(e,t,"formTarget",u.formTarget,u,null)):(Ze(e,t,"encType",u.encType,u,null),Ze(e,t,"method",u.method,u,null),Ze(e,t,"target",u.target,u,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(i);break}r=Wr(""+r),e.setAttribute(i,r);break;case"onClick":r!=null&&(e.onclick=ea);break;case"onScroll":r!=null&&_e("scroll",e);break;case"onScrollEnd":r!=null&&_e("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(s(61));if(i=r.__html,i!=null){if(u.children!=null)throw Error(s(60));e.innerHTML=i}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}i=Wr(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",i);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,""+r):e.removeAttribute(i);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":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,""):e.removeAttribute(i);break;case"capture":case"download":r===!0?e.setAttribute(i,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(i,r):e.removeAttribute(i);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(i,r):e.removeAttribute(i);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(i):e.setAttribute(i,r);break;case"popover":_e("beforetoggle",e),_e("toggle",e),Yr(e,"popover",r);break;case"xlinkActuate":Jn(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":Jn(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":Jn(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":Jn(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":Jn(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":Jn(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":Jn(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":Jn(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":Jn(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Yr(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(i=Nv.get(i)||i,Yr(e,i,r))}}function zu(e,t,i,r,u,h){switch(i){case"style":Wf(e,r,h);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(s(61));if(i=r.__html,i!=null){if(u.children!=null)throw Error(s(60));e.innerHTML=i}}break;case"children":typeof r=="string"?zi(e,r):(typeof r=="number"||typeof r=="bigint")&&zi(e,""+r);break;case"onScroll":r!=null&&_e("scroll",e);break;case"onScrollEnd":r!=null&&_e("scrollend",e);break;case"onClick":r!=null&&(e.onclick=ea);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Bf.hasOwnProperty(i))e:{if(i[0]==="o"&&i[1]==="n"&&(u=i.endsWith("Capture"),t=i.slice(2,u?i.length-7:void 0),h=e[Kt]||null,h=h!=null?h[i]:null,typeof h=="function"&&e.removeEventListener(t,h,u),typeof r=="function")){typeof h!="function"&&h!==null&&(i in e?e[i]=null:e.hasAttribute(i)&&e.removeAttribute(i)),e.addEventListener(t,r,u);break e}i in e?e[i]=r:r===!0?e.setAttribute(i,""):Yr(e,i,r)}}}function Rt(e,t,i){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 r=!1,u=!1,h;for(h in i)if(i.hasOwnProperty(h)){var g=i[h];if(g!=null)switch(h){case"src":r=!0;break;case"srcSet":u=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Ze(e,t,h,g,i,null)}}u&&Ze(e,t,"srcSet",i.srcSet,i,null),r&&Ze(e,t,"src",i.src,i,null);return;case"input":_e("invalid",e);var v=h=g=u=null,M=null,B=null;for(r in i)if(i.hasOwnProperty(r)){var V=i[r];if(V!=null)switch(r){case"name":u=V;break;case"type":g=V;break;case"checked":M=V;break;case"defaultChecked":B=V;break;case"value":h=V;break;case"defaultValue":v=V;break;case"children":case"dangerouslySetInnerHTML":if(V!=null)throw Error(s(137,t));break;default:Ze(e,t,r,V,i,null)}}Vf(e,h,v,M,B,g,u,!1);return;case"select":_e("invalid",e),r=g=h=null;for(u in i)if(i.hasOwnProperty(u)&&(v=i[u],v!=null))switch(u){case"value":h=v;break;case"defaultValue":g=v;break;case"multiple":r=v;default:Ze(e,t,u,v,i,null)}t=h,i=g,e.multiple=!!r,t!=null?_i(e,!!r,t,!1):i!=null&&_i(e,!!r,i,!0);return;case"textarea":_e("invalid",e),h=u=r=null;for(g in i)if(i.hasOwnProperty(g)&&(v=i[g],v!=null))switch(g){case"value":r=v;break;case"defaultValue":u=v;break;case"children":h=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(s(91));break;default:Ze(e,t,g,v,i,null)}$f(e,r,u,h);return;case"option":for(M in i)if(i.hasOwnProperty(M)&&(r=i[M],r!=null))switch(M){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:Ze(e,t,M,r,i,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(r=0;r<fr.length;r++)_e(fr[r],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(B in i)if(i.hasOwnProperty(B)&&(r=i[B],r!=null))switch(B){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,t));default:Ze(e,t,B,r,i,null)}return;default:if(Xl(t)){for(V in i)i.hasOwnProperty(V)&&(r=i[V],r!==void 0&&zu(e,t,V,r,i,void 0));return}}for(v in i)i.hasOwnProperty(v)&&(r=i[v],r!=null&&Ze(e,t,v,r,i,null))}function X0(e,t,i,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var u=null,h=null,g=null,v=null,M=null,B=null,V=null;for(G in i){var W=i[G];if(i.hasOwnProperty(G)&&W!=null)switch(G){case"checked":break;case"value":break;case"defaultValue":M=W;default:r.hasOwnProperty(G)||Ze(e,t,G,null,r,W)}}for(var q in r){var G=r[q];if(W=i[q],r.hasOwnProperty(q)&&(G!=null||W!=null))switch(q){case"type":h=G;break;case"name":u=G;break;case"checked":B=G;break;case"defaultChecked":V=G;break;case"value":g=G;break;case"defaultValue":v=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(s(137,t));break;default:G!==W&&Ze(e,t,q,G,r,W)}}Ql(e,g,v,M,B,V,h,u);return;case"select":G=g=v=q=null;for(h in i)if(M=i[h],i.hasOwnProperty(h)&&M!=null)switch(h){case"value":break;case"multiple":G=M;default:r.hasOwnProperty(h)||Ze(e,t,h,null,r,M)}for(u in r)if(h=r[u],M=i[u],r.hasOwnProperty(u)&&(h!=null||M!=null))switch(u){case"value":q=h;break;case"defaultValue":v=h;break;case"multiple":g=h;default:h!==M&&Ze(e,t,u,h,r,M)}t=v,i=g,r=G,q!=null?_i(e,!!i,q,!1):!!r!=!!i&&(t!=null?_i(e,!!i,t,!0):_i(e,!!i,i?[]:"",!1));return;case"textarea":G=q=null;for(v in i)if(u=i[v],i.hasOwnProperty(v)&&u!=null&&!r.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:Ze(e,t,v,null,r,u)}for(g in r)if(u=r[g],h=i[g],r.hasOwnProperty(g)&&(u!=null||h!=null))switch(g){case"value":q=u;break;case"defaultValue":G=u;break;case"children":break;case"dangerouslySetInnerHTML":if(u!=null)throw Error(s(91));break;default:u!==h&&Ze(e,t,g,u,r,h)}Yf(e,q,G);return;case"option":for(var ue in i)if(q=i[ue],i.hasOwnProperty(ue)&&q!=null&&!r.hasOwnProperty(ue))switch(ue){case"selected":e.selected=!1;break;default:Ze(e,t,ue,null,r,q)}for(M in r)if(q=r[M],G=i[M],r.hasOwnProperty(M)&&q!==G&&(q!=null||G!=null))switch(M){case"selected":e.selected=q&&typeof q!="function"&&typeof q!="symbol";break;default:Ze(e,t,M,q,r,G)}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 we in i)q=i[we],i.hasOwnProperty(we)&&q!=null&&!r.hasOwnProperty(we)&&Ze(e,t,we,null,r,q);for(B in r)if(q=r[B],G=i[B],r.hasOwnProperty(B)&&q!==G&&(q!=null||G!=null))switch(B){case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(s(137,t));break;default:Ze(e,t,B,q,r,G)}return;default:if(Xl(t)){for(var Je in i)q=i[Je],i.hasOwnProperty(Je)&&q!==void 0&&!r.hasOwnProperty(Je)&&zu(e,t,Je,void 0,r,q);for(V in r)q=r[V],G=i[V],!r.hasOwnProperty(V)||q===G||q===void 0&&G===void 0||zu(e,t,V,q,r,G);return}}for(var _ in i)q=i[_],i.hasOwnProperty(_)&&q!=null&&!r.hasOwnProperty(_)&&Ze(e,t,_,null,r,q);for(W in r)q=r[W],G=i[W],!r.hasOwnProperty(W)||q===G||q==null&&G==null||Ze(e,t,W,q,r,G)}function Xm(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Z0(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,i=performance.getEntriesByType("resource"),r=0;r<i.length;r++){var u=i[r],h=u.transferSize,g=u.initiatorType,v=u.duration;if(h&&v&&Xm(g)){for(g=0,v=u.responseEnd,r+=1;r<i.length;r++){var M=i[r],B=M.startTime;if(B>v)break;var V=M.transferSize,W=M.initiatorType;V&&Xm(W)&&(M=M.responseEnd,g+=V*(M<v?1:(v-B)/(M-B)))}if(--r,t+=8*(h+g)/(u.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 Iu=null,Uu=null;function Gs(e){return e.nodeType===9?e:e.ownerDocument}function Zm(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 Jm(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 Hu(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 Bu=null;function J0(){var e=window.event;return e&&e.type==="popstate"?e===Bu?!1:(Bu=e,!0):(Bu=null,!1)}var eg=typeof setTimeout=="function"?setTimeout:void 0,eC=typeof clearTimeout=="function"?clearTimeout:void 0,tg=typeof Promise=="function"?Promise:void 0,tC=typeof queueMicrotask=="function"?queueMicrotask:typeof tg<"u"?function(e){return tg.resolve(null).then(e).catch(nC)}:eg;function nC(e){setTimeout(function(){throw e})}function Ga(e){return e==="head"}function ng(e,t){var i=t,r=0;do{var u=i.nextSibling;if(e.removeChild(i),u&&u.nodeType===8)if(i=u.data,i==="/$"||i==="/&"){if(r===0){e.removeChild(u),mo(t);return}r--}else if(i==="$"||i==="$?"||i==="$~"||i==="$!"||i==="&")r++;else if(i==="html")pr(e.ownerDocument.documentElement);else if(i==="head"){i=e.ownerDocument.head,pr(i);for(var h=i.firstChild;h;){var g=h.nextSibling,v=h.nodeName;h[Oo]||v==="SCRIPT"||v==="STYLE"||v==="LINK"&&h.rel.toLowerCase()==="stylesheet"||i.removeChild(h),h=g}}else i==="body"&&pr(e.ownerDocument.body);i=u}while(i);mo(t)}function ag(e,t){var i=e;e=0;do{var r=i.nextSibling;if(i.nodeType===1?t?(i._stashedDisplay=i.style.display,i.style.display="none"):(i.style.display=i._stashedDisplay||"",i.getAttribute("style")===""&&i.removeAttribute("style")):i.nodeType===3&&(t?(i._stashedText=i.nodeValue,i.nodeValue=""):i.nodeValue=i._stashedText||""),r&&r.nodeType===8)if(i=r.data,i==="/$"){if(e===0)break;e--}else i!=="$"&&i!=="$?"&&i!=="$~"&&i!=="$!"||e++;i=r}while(i)}function Ku(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var i=t;switch(t=t.nextSibling,i.nodeName){case"HTML":case"HEAD":case"BODY":Ku(i),Yl(i);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(i.rel.toLowerCase()==="stylesheet")continue}e.removeChild(i)}}function aC(e,t,i,r){for(;e.nodeType===1;){var u=i;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[Oo])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==u.rel||e.getAttribute("href")!==(u.href==null||u.href===""?null:u.href)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin)||e.getAttribute("title")!==(u.title==null?null:u.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(u.src==null?null:u.src)||e.getAttribute("type")!==(u.type==null?null:u.type)||e.getAttribute("crossorigin")!==(u.crossOrigin==null?null:u.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var h=u.name==null?null:""+u.name;if(u.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=wn(e.nextSibling),e===null)break}return null}function iC(e,t,i){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=wn(e.nextSibling),e===null))return null;return e}function ig(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=wn(e.nextSibling),e===null))return null;return e}function qu(e){return e.data==="$?"||e.data==="$~"}function Fu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function oC(e,t){var i=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||i.readyState!=="loading")t();else{var r=function(){t(),i.removeEventListener("DOMContentLoaded",r)};i.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function wn(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 Gu=null;function og(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"||i==="/&"){if(t===0)return wn(e.nextSibling);t--}else i!=="$"&&i!=="$!"&&i!=="$?"&&i!=="$~"&&i!=="&"||t++}e=e.nextSibling}return null}function rg(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"){if(t===0)return e;t--}else i!=="/$"&&i!=="/&"||t++}e=e.previousSibling}return null}function sg(e,t,i){switch(t=Gs(i),e){case"html":if(e=t.documentElement,!e)throw Error(s(452));return e;case"head":if(e=t.head,!e)throw Error(s(453));return e;case"body":if(e=t.body,!e)throw Error(s(454));return e;default:throw Error(s(451))}}function pr(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Yl(e)}var Nn=new Map,lg=new Set;function Vs(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var ga=X.d;X.d={f:rC,r:sC,D:lC,C:cC,L:uC,m:dC,X:hC,S:fC,M:pC};function rC(){var e=ga.f(),t=zs();return e||t}function sC(e){var t=Pi(e);t!==null&&t.tag===5&&t.type==="form"?Ap(t):ga.r(e)}var fo=typeof document>"u"?null:document;function cg(e,t,i){var r=fo;if(r&&typeof t=="string"&&t){var u=gn(t);u='link[rel="'+e+'"][href="'+u+'"]',typeof i=="string"&&(u+='[crossorigin="'+i+'"]'),lg.has(u)||(lg.add(u),e={rel:e,crossOrigin:i,href:t},r.querySelector(u)===null&&(t=r.createElement("link"),Rt(t,"link",e),Dt(t),r.head.appendChild(t)))}}function lC(e){ga.D(e),cg("dns-prefetch",e,null)}function cC(e,t){ga.C(e,t),cg("preconnect",e,t)}function uC(e,t,i){ga.L(e,t,i);var r=fo;if(r&&e&&t){var u='link[rel="preload"][as="'+gn(t)+'"]';t==="image"&&i&&i.imageSrcSet?(u+='[imagesrcset="'+gn(i.imageSrcSet)+'"]',typeof i.imageSizes=="string"&&(u+='[imagesizes="'+gn(i.imageSizes)+'"]')):u+='[href="'+gn(e)+'"]';var h=u;switch(t){case"style":h=ho(e);break;case"script":h=po(e)}Nn.has(h)||(e=x({rel:"preload",href:t==="image"&&i&&i.imageSrcSet?void 0:e,as:t},i),Nn.set(h,e),r.querySelector(u)!==null||t==="style"&&r.querySelector(mr(h))||t==="script"&&r.querySelector(gr(h))||(t=r.createElement("link"),Rt(t,"link",e),Dt(t),r.head.appendChild(t)))}}function dC(e,t){ga.m(e,t);var i=fo;if(i&&e){var r=t&&typeof t.as=="string"?t.as:"script",u='link[rel="modulepreload"][as="'+gn(r)+'"][href="'+gn(e)+'"]',h=u;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=po(e)}if(!Nn.has(h)&&(e=x({rel:"modulepreload",href:e},t),Nn.set(h,e),i.querySelector(u)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(i.querySelector(gr(h)))return}r=i.createElement("link"),Rt(r,"link",e),Dt(r),i.head.appendChild(r)}}}function fC(e,t,i){ga.S(e,t,i);var r=fo;if(r&&e){var u=Li(r).hoistableStyles,h=ho(e);t=t||"default";var g=u.get(h);if(!g){var v={loading:0,preload:null};if(g=r.querySelector(mr(h)))v.loading=5;else{e=x({rel:"stylesheet",href:e,"data-precedence":t},i),(i=Nn.get(h))&&Vu(e,i);var M=g=r.createElement("link");Dt(M),Rt(M,"link",e),M._p=new Promise(function(B,V){M.onload=B,M.onerror=V}),M.addEventListener("load",function(){v.loading|=1}),M.addEventListener("error",function(){v.loading|=2}),v.loading|=4,Ys(g,t,r)}g={type:"stylesheet",instance:g,count:1,state:v},u.set(h,g)}}}function hC(e,t){ga.X(e,t);var i=fo;if(i&&e){var r=Li(i).hoistableScripts,u=po(e),h=r.get(u);h||(h=i.querySelector(gr(u)),h||(e=x({src:e,async:!0},t),(t=Nn.get(u))&&Yu(e,t),h=i.createElement("script"),Dt(h),Rt(h,"link",e),i.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},r.set(u,h))}}function pC(e,t){ga.M(e,t);var i=fo;if(i&&e){var r=Li(i).hoistableScripts,u=po(e),h=r.get(u);h||(h=i.querySelector(gr(u)),h||(e=x({src:e,async:!0,type:"module"},t),(t=Nn.get(u))&&Yu(e,t),h=i.createElement("script"),Dt(h),Rt(h,"link",e),i.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},r.set(u,h))}}function ug(e,t,i,r){var u=(u=ae.current)?Vs(u):null;if(!u)throw Error(s(446));switch(e){case"meta":case"title":return null;case"style":return typeof i.precedence=="string"&&typeof i.href=="string"?(t=ho(i.href),i=Li(u).hoistableStyles,r=i.get(t),r||(r={type:"style",instance:null,count:0,state:null},i.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(i.rel==="stylesheet"&&typeof i.href=="string"&&typeof i.precedence=="string"){e=ho(i.href);var h=Li(u).hoistableStyles,g=h.get(e);if(g||(u=u.ownerDocument||u,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,g),(h=u.querySelector(mr(e)))&&!h._p&&(g.instance=h,g.state.loading=5),Nn.has(e)||(i={rel:"preload",as:"style",href:i.href,crossOrigin:i.crossOrigin,integrity:i.integrity,media:i.media,hrefLang:i.hrefLang,referrerPolicy:i.referrerPolicy},Nn.set(e,i),h||mC(u,e,i,g.state))),t&&r===null)throw Error(s(528,""));return g}if(t&&r!==null)throw Error(s(529,""));return null;case"script":return t=i.async,i=i.src,typeof i=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=po(i),i=Li(u).hoistableScripts,r=i.get(t),r||(r={type:"script",instance:null,count:0,state:null},i.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,e))}}function ho(e){return'href="'+gn(e)+'"'}function mr(e){return'link[rel="stylesheet"]['+e+"]"}function dg(e){return x({},e,{"data-precedence":e.precedence,precedence:null})}function mC(e,t,i,r){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?r.loading=1:(t=e.createElement("link"),r.preload=t,t.addEventListener("load",function(){return r.loading|=1}),t.addEventListener("error",function(){return r.loading|=2}),Rt(t,"link",i),Dt(t),e.head.appendChild(t))}function po(e){return'[src="'+gn(e)+'"]'}function gr(e){return"script[async]"+e}function fg(e,t,i){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+gn(i.href)+'"]');if(r)return t.instance=r,Dt(r),r;var u=x({},i,{"data-href":i.href,"data-precedence":i.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),Dt(r),Rt(r,"style",u),Ys(r,i.precedence,e),t.instance=r;case"stylesheet":u=ho(i.href);var h=e.querySelector(mr(u));if(h)return t.state.loading|=4,t.instance=h,Dt(h),h;r=dg(i),(u=Nn.get(u))&&Vu(r,u),h=(e.ownerDocument||e).createElement("link"),Dt(h);var g=h;return g._p=new Promise(function(v,M){g.onload=v,g.onerror=M}),Rt(h,"link",r),t.state.loading|=4,Ys(h,i.precedence,e),t.instance=h;case"script":return h=po(i.src),(u=e.querySelector(gr(h)))?(t.instance=u,Dt(u),u):(r=i,(u=Nn.get(h))&&(r=x({},i),Yu(r,u)),e=e.ownerDocument||e,u=e.createElement("script"),Dt(u),Rt(u,"link",r),e.head.appendChild(u),t.instance=u);case"void":return null;default:throw Error(s(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Ys(r,i.precedence,e));return t.instance}function Ys(e,t,i){for(var r=i.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),u=r.length?r[r.length-1]:null,h=u,g=0;g<r.length;g++){var v=r[g];if(v.dataset.precedence===t)h=v;else if(h!==u)break}h?h.parentNode.insertBefore(e,h.nextSibling):(t=i.nodeType===9?i.head:i,t.insertBefore(e,t.firstChild))}function Vu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Yu(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var $s=null;function hg(e,t,i){if($s===null){var r=new Map,u=$s=new Map;u.set(i,r)}else u=$s,r=u.get(i),r||(r=new Map,u.set(i,r));if(r.has(e))return r;for(r.set(e,null),i=i.getElementsByTagName(e),u=0;u<i.length;u++){var h=i[u];if(!(h[Oo]||h[Et]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var g=h.getAttribute(t)||"";g=e+g;var v=r.get(g);v?v.push(h):r.set(g,[h])}}return r}function pg(e,t,i){e=e.ownerDocument||e,e.head.insertBefore(i,t==="title"?e.querySelector("head > title"):null)}function gC(e,t,i){if(i===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 mg(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function yC(e,t,i,r){if(i.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var u=ho(r.href),h=t.querySelector(mr(u));if(h){t=h._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Qs.bind(e),t.then(e,e)),i.state.loading|=4,i.instance=h,Dt(h);return}h=t.ownerDocument||t,r=dg(r),(u=Nn.get(u))&&Vu(r,u),h=h.createElement("link"),Dt(h);var g=h;g._p=new Promise(function(v,M){g.onload=v,g.onerror=M}),Rt(h,"link",r),i.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(e.count++,i=Qs.bind(e),t.addEventListener("load",i),t.addEventListener("error",i))}}var $u=0;function xC(e,t){return e.stylesheets&&e.count===0&&Xs(e,e.stylesheets),0<e.count||0<e.imgCount?function(i){var r=setTimeout(function(){if(e.stylesheets&&Xs(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+t);0<e.imgBytes&&$u===0&&($u=62500*Z0());var u=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xs(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>$u?50:800)+t);return e.unsuspend=i,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(u)}}:null}function Qs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Ws=null;function Xs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Ws=new Map,t.forEach(bC,e),Ws=null,Qs.call(e))}function bC(e,t){if(!(t.state.loading&4)){var i=Ws.get(e);if(i)var r=i.get(null);else{i=new Map,Ws.set(e,i);for(var u=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<u.length;h++){var g=u[h];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(i.set(g.dataset.precedence,g),r=g)}r&&i.set(null,r)}u=t.instance,g=u.getAttribute("data-precedence"),h=i.get(g)||r,h===r&&i.set(null,u),i.set(g,u),this.count++,r=Qs.bind(this),u.addEventListener("load",r),u.addEventListener("error",r),h?h.parentNode.insertBefore(u,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(u,e.firstChild)),t.state.loading|=4}}var yr={$$typeof:D,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function vC(e,t,i,r,u,h,g,v,M){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=tn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=tn(0),this.hiddenUpdates=tn(null),this.identifierPrefix=r,this.onUncaughtError=u,this.onCaughtError=h,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=M,this.incompleteTransitions=new Map}function gg(e,t,i,r,u,h,g,v,M,B,V,W){return e=new vC(e,t,i,g,M,B,V,W,v),t=1,h===!0&&(t|=24),h=an(3,null,null,t),e.current=h,h.stateNode=e,t=Dc(),t.refCount++,e.pooledCache=t,t.refCount++,h.memoizedState={element:r,isDehydrated:i,cache:t},Ec(h),e}function yg(e){return e?(e=Fi,e):Fi}function xg(e,t,i,r,u,h){u=yg(u),r.context===null?r.context=u:r.pendingContext=u,r=La(t),r.payload={element:i},h=h===void 0?null:h,h!==null&&(r.callback=h),i=Ra(e,r,t),i!==null&&($t(i,e,t),Qo(i,e,t))}function bg(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<t?i:t}}function Qu(e,t){bg(e,t),(e=e.alternate)&&bg(e,t)}function vg(e){if(e.tag===13||e.tag===31){var t=li(e,67108864);t!==null&&$t(t,e,67108864),Qu(e,67108864)}}function Cg(e){if(e.tag===13||e.tag===31){var t=cn();t=Zn(t);var i=li(e,t);i!==null&&$t(i,e,t),Qu(e,t)}}var Zs=!0;function CC(e,t,i,r){var u=I.T;I.T=null;var h=X.p;try{X.p=2,Wu(e,t,i,r)}finally{X.p=h,I.T=u}}function SC(e,t,i,r){var u=I.T;I.T=null;var h=X.p;try{X.p=8,Wu(e,t,i,r)}finally{X.p=h,I.T=u}}function Wu(e,t,i,r){if(Zs){var u=Xu(r);if(u===null)_u(e,t,r,Js,i),wg(e,r);else if(NC(u,e,t,i,r))r.stopPropagation();else if(wg(e,r),t&4&&-1<wC.indexOf(e)){for(;u!==null;){var h=Pi(u);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var g=at(h.pendingLanes);if(g!==0){var v=h;for(v.pendingLanes|=2,v.entangledLanes|=2;g;){var M=1<<31-Ce(g);v.entanglements[1]|=M,g&=~M}Un(h),($e&6)===0&&(Rs=yt()+500,dr(0))}}break;case 31:case 13:v=li(h,2),v!==null&&$t(v,h,2),zs(),Qu(h,2)}if(h=Xu(r),h===null&&_u(e,t,r,Js,i),h===u)break;u=h}u!==null&&r.stopPropagation()}else _u(e,t,r,null,i)}}function Xu(e){return e=Jl(e),Zu(e)}var Js=null;function Zu(e){if(Js=null,e=Oi(e),e!==null){var t=d(e);if(t===null)e=null;else{var i=t.tag;if(i===13){if(e=f(t),e!==null)return e;e=null}else if(i===31){if(e=p(t),e!==null)return e;e=null}else if(i===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Js=e,null}function Sg(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(en()){case Qn:return 2;case ni:return 8;case Ln:case Rn:return 32;case Ti:return 268435456;default:return 32}default:return 32}}var Ju=!1,Va=null,Ya=null,$a=null,xr=new Map,br=new Map,Qa=[],wC="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 wg(e,t){switch(e){case"focusin":case"focusout":Va=null;break;case"dragenter":case"dragleave":Ya=null;break;case"mouseover":case"mouseout":$a=null;break;case"pointerover":case"pointerout":xr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":br.delete(t.pointerId)}}function vr(e,t,i,r,u,h){return e===null||e.nativeEvent!==h?(e={blockedOn:t,domEventName:i,eventSystemFlags:r,nativeEvent:h,targetContainers:[u]},t!==null&&(t=Pi(t),t!==null&&vg(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,u!==null&&t.indexOf(u)===-1&&t.push(u),e)}function NC(e,t,i,r,u){switch(t){case"focusin":return Va=vr(Va,e,t,i,r,u),!0;case"dragenter":return Ya=vr(Ya,e,t,i,r,u),!0;case"mouseover":return $a=vr($a,e,t,i,r,u),!0;case"pointerover":var h=u.pointerId;return xr.set(h,vr(xr.get(h)||null,e,t,i,r,u)),!0;case"gotpointercapture":return h=u.pointerId,br.set(h,vr(br.get(h)||null,e,t,i,r,u)),!0}return!1}function Ng(e){var t=Oi(e.target);if(t!==null){var i=d(t);if(i!==null){if(t=i.tag,t===13){if(t=f(i),t!==null){e.blockedOn=t,Eo(e.priority,function(){Cg(i)});return}}else if(t===31){if(t=p(i),t!==null){e.blockedOn=t,Eo(e.priority,function(){Cg(i)});return}}else if(t===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function el(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var i=Xu(e.nativeEvent);if(i===null){i=e.nativeEvent;var r=new i.constructor(i.type,i);Zl=r,i.target.dispatchEvent(r),Zl=null}else return t=Pi(i),t!==null&&vg(t),e.blockedOn=i,!1;t.shift()}return!0}function Ag(e,t,i){el(e)&&i.delete(t)}function AC(){Ju=!1,Va!==null&&el(Va)&&(Va=null),Ya!==null&&el(Ya)&&(Ya=null),$a!==null&&el($a)&&($a=null),xr.forEach(Ag),br.forEach(Ag)}function tl(e,t){e.blockedOn===t&&(e.blockedOn=null,Ju||(Ju=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,AC)))}var nl=null;function kg(e){nl!==e&&(nl=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){nl===e&&(nl=null);for(var t=0;t<e.length;t+=3){var i=e[t],r=e[t+1],u=e[t+2];if(typeof r!="function"){if(Zu(r||i)===null)continue;break}var h=Pi(i);h!==null&&(e.splice(t,3),t-=3,Xc(h,{pending:!0,data:u,method:i.method,action:r},r,u))}}))}function mo(e){function t(M){return tl(M,e)}Va!==null&&tl(Va,e),Ya!==null&&tl(Ya,e),$a!==null&&tl($a,e),xr.forEach(t),br.forEach(t);for(var i=0;i<Qa.length;i++){var r=Qa[i];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Qa.length&&(i=Qa[0],i.blockedOn===null);)Ng(i),i.blockedOn===null&&Qa.shift();if(i=(e.ownerDocument||e).$$reactFormReplay,i!=null)for(r=0;r<i.length;r+=3){var u=i[r],h=i[r+1],g=u[Kt]||null;if(typeof h=="function")g||kg(i);else if(g){var v=null;if(h&&h.hasAttribute("formAction")){if(u=h,g=h[Kt]||null)v=g.formAction;else if(Zu(u)!==null)continue}else v=g.action;typeof v=="function"?i[r+1]=v:(i.splice(r,3),r-=3),kg(i)}}}function Dg(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(g){return u=g})},focusReset:"manual",scroll:"manual"})}function t(){u!==null&&(u(),u=null),r||setTimeout(i,20)}function i(){if(!r&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,u=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(i,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),u!==null&&(u(),u=null)}}}function ed(e){this._internalRoot=e}al.prototype.render=ed.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(s(409));var i=t.current,r=cn();xg(i,r,e,t,null,null)},al.prototype.unmount=ed.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;xg(e.current,2,null,e,null,null),zs(),t[Ei]=null}};function al(e){this._internalRoot=e}al.prototype.unstable_scheduleHydration=function(e){if(e){var t=Mo();e={blockedOn:null,target:e,priority:t};for(var i=0;i<Qa.length&&t!==0&&t<Qa[i].priority;i++);Qa.splice(i,0,e),i===0&&Ng(e)}};var jg=a.version;if(jg!=="19.2.1")throw Error(s(527,jg,"19.2.1"));X.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=y(t),e=e!==null?C(e):null,e=e===null?null:e.stateNode,e};var kC={bundleType:0,version:"19.2.1",rendererPackageName:"react-dom",currentDispatcherRef:I,reconcilerVersion:"19.2.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var il=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!il.isDisabled&&il.supportsFiber)try{Wn=il.inject(kC),J=il}catch{}}return Sr.createRoot=function(e,t){if(!c(e))throw Error(s(299));var i=!1,r="",u=Rp,h=_p,g=zp;return t!=null&&(t.unstable_strictMode===!0&&(i=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(u=t.onUncaughtError),t.onCaughtError!==void 0&&(h=t.onCaughtError),t.onRecoverableError!==void 0&&(g=t.onRecoverableError)),t=gg(e,1,!1,null,null,i,r,null,u,h,g,Dg),e[Ei]=t.current,Ru(e),new ed(t)},Sr.hydrateRoot=function(e,t,i){if(!c(e))throw Error(s(299));var r=!1,u="",h=Rp,g=_p,v=zp,M=null;return i!=null&&(i.unstable_strictMode===!0&&(r=!0),i.identifierPrefix!==void 0&&(u=i.identifierPrefix),i.onUncaughtError!==void 0&&(h=i.onUncaughtError),i.onCaughtError!==void 0&&(g=i.onCaughtError),i.onRecoverableError!==void 0&&(v=i.onRecoverableError),i.formState!==void 0&&(M=i.formState)),t=gg(e,1,!0,t,i??null,r,u,M,h,g,v,Dg),t.context=yg(null),i=t.current,r=cn(),r=Zn(r),u=La(r),u.callback=null,Ra(i,u,r),i=r,t.current.lanes=i,An(t,i),Un(t),e[Ei]=t.current,Ru(e),new al(t)},Sr.version="19.2.1",Sr}var Kg;function Iw(){if(Kg)return td.exports;Kg=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),td.exports=zw(),td.exports}var Uw=Iw();const Hw="modulepreload",Bw=function(n){return"/"+n},qg={},tt=function(a,o,s){let c=Promise.resolve();if(o&&o.length>0){let m=function(y){return Promise.all(y.map(C=>Promise.resolve(C).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const f=document.querySelector("meta[property=csp-nonce]"),p=f?.nonce||f?.getAttribute("nonce");c=m(o.map(y=>{if(y=Bw(y),y in qg)return;qg[y]=!0;const C=y.endsWith(".css"),x=C?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${y}"]${x}`))return;const b=document.createElement("link");if(b.rel=C?"stylesheet":Hw,C||(b.as="script"),b.crossOrigin="",b.href=y,p&&b.setAttribute("nonce",p),document.head.appendChild(b),C)return new Promise((A,N)=>{b.addEventListener("load",A),b.addEventListener("error",()=>N(new Error(`Unable to preload CSS for ${y}`)))})}))}function d(f){const p=new Event("vite:preloadError",{cancelable:!0});if(p.payload=f,window.dispatchEvent(p),!p.defaultPrevented)throw f}return c.then(f=>{for(const p of f||[])p.status==="rejected"&&d(p.reason);return a().catch(d)})},Kw=new fS({defaultOptions:{queries:{staleTime:5e3,refetchOnWindowFocus:!1,retry:1},mutations:{retry:!1}}}),Ae=n=>typeof n=="string",wr=()=>{let n,a;const o=new Promise((s,c)=>{n=s,a=c});return o.resolve=n,o.reject=a,o},Fg=n=>n==null?"":""+n,qw=(n,a,o)=>{n.forEach(s=>{a[s]&&(o[s]=a[s])})},Fw=/###/g,Gg=n=>n&&n.indexOf("###")>-1?n.replace(Fw,"."):n,Vg=n=>!n||Ae(n),Er=(n,a,o)=>{const s=Ae(a)?a.split("."):a;let c=0;for(;c<s.length-1;){if(Vg(n))return{};const d=Gg(s[c]);!n[d]&&o&&(n[d]=new o),Object.prototype.hasOwnProperty.call(n,d)?n=n[d]:n={},++c}return Vg(n)?{}:{obj:n,k:Gg(s[c])}},Yg=(n,a,o)=>{const{obj:s,k:c}=Er(n,a,Object);if(s!==void 0||a.length===1){s[c]=o;return}let d=a[a.length-1],f=a.slice(0,a.length-1),p=Er(n,f,Object);for(;p.obj===void 0&&f.length;)d=`${f[f.length-1]}.${d}`,f=f.slice(0,f.length-1),p=Er(n,f,Object),p?.obj&&typeof p.obj[`${p.k}.${d}`]<"u"&&(p.obj=void 0);p.obj[`${p.k}.${d}`]=o},Gw=(n,a,o,s)=>{const{obj:c,k:d}=Er(n,a,Object);c[d]=c[d]||[],c[d].push(o)},gl=(n,a)=>{const{obj:o,k:s}=Er(n,a);if(o&&Object.prototype.hasOwnProperty.call(o,s))return o[s]},Vw=(n,a,o)=>{const s=gl(n,o);return s!==void 0?s:gl(a,o)},Rx=(n,a,o)=>{for(const s in a)s!=="__proto__"&&s!=="constructor"&&(s in n?Ae(n[s])||n[s]instanceof String||Ae(a[s])||a[s]instanceof String?o&&(n[s]=a[s]):Rx(n[s],a[s],o):n[s]=a[s]);return n},Ci=n=>n.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var Yw={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;","/":"&#x2F;"};const $w=n=>Ae(n)?n.replace(/[&<>"'\/]/g,a=>Yw[a]):n;class Qw{constructor(a){this.capacity=a,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(a){const o=this.regExpMap.get(a);if(o!==void 0)return o;const s=new RegExp(a);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(a,s),this.regExpQueue.push(a),s}}const Ww=[" ",",","?","!",";"],Xw=new Qw(20),Zw=(n,a,o)=>{a=a||"",o=o||"";const s=Ww.filter(f=>a.indexOf(f)<0&&o.indexOf(f)<0);if(s.length===0)return!0;const c=Xw.getRegExp(`(${s.map(f=>f==="?"?"\\?":f).join("|")})`);let d=!c.test(n);if(!d){const f=n.indexOf(o);f>0&&!c.test(n.substring(0,f))&&(d=!0)}return d},kd=(n,a,o=".")=>{if(!n)return;if(n[a])return Object.prototype.hasOwnProperty.call(n,a)?n[a]:void 0;const s=a.split(o);let c=n;for(let d=0;d<s.length;){if(!c||typeof c!="object")return;let f,p="";for(let m=d;m<s.length;++m)if(m!==d&&(p+=o),p+=s[m],f=c[p],f!==void 0){if(["string","number","boolean"].indexOf(typeof f)>-1&&m<s.length-1)continue;d+=m-d+1;break}c=f}return c},zr=n=>n?.replace("_","-"),Jw={type:"logger",log(n){this.output("log",n)},warn(n){this.output("warn",n)},error(n){this.output("error",n)},output(n,a){console?.[n]?.apply?.(console,a)}};class yl{constructor(a,o={}){this.init(a,o)}init(a,o={}){this.prefix=o.prefix||"i18next:",this.logger=a||Jw,this.options=o,this.debug=o.debug}log(...a){return this.forward(a,"log","",!0)}warn(...a){return this.forward(a,"warn","",!0)}error(...a){return this.forward(a,"error","")}deprecate(...a){return this.forward(a,"warn","WARNING DEPRECATED: ",!0)}forward(a,o,s,c){return c&&!this.debug?null:(Ae(a[0])&&(a[0]=`${s}${this.prefix} ${a[0]}`),this.logger[o](a))}create(a){return new yl(this.logger,{prefix:`${this.prefix}:${a}:`,...this.options})}clone(a){return a=a||this.options,a.prefix=a.prefix||this.prefix,new yl(this.logger,a)}}var Kn=new yl;class El{constructor(){this.observers={}}on(a,o){return a.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const c=this.observers[s].get(o)||0;this.observers[s].set(o,c+1)}),this}off(a,o){if(this.observers[a]){if(!o){delete this.observers[a];return}this.observers[a].delete(o)}}emit(a,...o){this.observers[a]&&Array.from(this.observers[a].entries()).forEach(([c,d])=>{for(let f=0;f<d;f++)c(...o)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([c,d])=>{for(let f=0;f<d;f++)c.apply(c,[a,...o])})}}class $g extends El{constructor(a,o={ns:["translation"],defaultNS:"translation"}){super(),this.data=a||{},this.options=o,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(a){this.options.ns.indexOf(a)<0&&this.options.ns.push(a)}removeNamespaces(a){const o=this.options.ns.indexOf(a);o>-1&&this.options.ns.splice(o,1)}getResource(a,o,s,c={}){const d=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator,f=c.ignoreJSONStructure!==void 0?c.ignoreJSONStructure:this.options.ignoreJSONStructure;let p;a.indexOf(".")>-1?p=a.split("."):(p=[a,o],s&&(Array.isArray(s)?p.push(...s):Ae(s)&&d?p.push(...s.split(d)):p.push(s)));const m=gl(this.data,p);return!m&&!o&&!s&&a.indexOf(".")>-1&&(a=p[0],o=p[1],s=p.slice(2).join(".")),m||!f||!Ae(s)?m:kd(this.data?.[a]?.[o],s,d)}addResource(a,o,s,c,d={silent:!1}){const f=d.keySeparator!==void 0?d.keySeparator:this.options.keySeparator;let p=[a,o];s&&(p=p.concat(f?s.split(f):s)),a.indexOf(".")>-1&&(p=a.split("."),c=o,o=p[1]),this.addNamespaces(o),Yg(this.data,p,c),d.silent||this.emit("added",a,o,s,c)}addResources(a,o,s,c={silent:!1}){for(const d in s)(Ae(s[d])||Array.isArray(s[d]))&&this.addResource(a,o,d,s[d],{silent:!0});c.silent||this.emit("added",a,o,s)}addResourceBundle(a,o,s,c,d,f={silent:!1,skipCopy:!1}){let p=[a,o];a.indexOf(".")>-1&&(p=a.split("."),c=s,s=o,o=p[1]),this.addNamespaces(o);let m=gl(this.data,p)||{};f.skipCopy||(s=JSON.parse(JSON.stringify(s))),c?Rx(m,s,d):m={...m,...s},Yg(this.data,p,m),f.silent||this.emit("added",a,o,s)}removeResourceBundle(a,o){this.hasResourceBundle(a,o)&&delete this.data[a][o],this.removeNamespaces(o),this.emit("removed",a,o)}hasResourceBundle(a,o){return this.getResource(a,o)!==void 0}getResourceBundle(a,o){return o||(o=this.options.defaultNS),this.getResource(a,o)}getDataByLanguage(a){return this.data[a]}hasLanguageSomeTranslations(a){const o=this.getDataByLanguage(a);return!!(o&&Object.keys(o)||[]).find(c=>o[c]&&Object.keys(o[c]).length>0)}toJSON(){return this.data}}var _x={processors:{},addPostProcessor(n){this.processors[n.name]=n},handle(n,a,o,s,c){return n.forEach(d=>{a=this.processors[d]?.process(a,o,s,c)??a}),a}};const zx=Symbol("i18next/PATH_KEY");function eN(){const n=[],a=Object.create(null);let o;return a.get=(s,c)=>(o?.revoke?.(),c===zx?n:(n.push(c),o=Proxy.revocable(s,a),o.proxy)),Proxy.revocable(Object.create(null),a).proxy}function Dd(n,a){const{[zx]:o}=n(eN());return o.join(a?.keySeparator??".")}const Qg={},id=n=>!Ae(n)&&typeof n!="boolean"&&typeof n!="number";class xl extends El{constructor(a,o={}){super(),qw(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],a,this),this.options=o,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Kn.create("translator")}changeLanguage(a){a&&(this.language=a)}exists(a,o={interpolation:{}}){const s={...o};if(a==null)return!1;const c=this.resolve(a,s);if(c?.res===void 0)return!1;const d=id(c.res);return!(s.returnObjects===!1&&d)}extractFromKey(a,o){let s=o.nsSeparator!==void 0?o.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const c=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let d=o.ns||this.options.defaultNS||[];const f=s&&a.indexOf(s)>-1,p=!this.options.userDefinedKeySeparator&&!o.keySeparator&&!this.options.userDefinedNsSeparator&&!o.nsSeparator&&!Zw(a,s,c);if(f&&!p){const m=a.match(this.interpolator.nestingRegexp);if(m&&m.length>0)return{key:a,namespaces:Ae(d)?[d]:d};const y=a.split(s);(s!==c||s===c&&this.options.ns.indexOf(y[0])>-1)&&(d=y.shift()),a=y.join(c)}return{key:a,namespaces:Ae(d)?[d]:d}}translate(a,o,s){let c=typeof o=="object"?{...o}:o;if(typeof c!="object"&&this.options.overloadTranslationOptionHandler&&(c=this.options.overloadTranslationOptionHandler(arguments)),typeof c=="object"&&(c={...c}),c||(c={}),a==null)return"";typeof a=="function"&&(a=Dd(a,{...this.options,...c})),Array.isArray(a)||(a=[String(a)]);const d=c.returnDetails!==void 0?c.returnDetails:this.options.returnDetails,f=c.keySeparator!==void 0?c.keySeparator:this.options.keySeparator,{key:p,namespaces:m}=this.extractFromKey(a[a.length-1],c),y=m[m.length-1];let C=c.nsSeparator!==void 0?c.nsSeparator:this.options.nsSeparator;C===void 0&&(C=":");const x=c.lng||this.language,b=c.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(x?.toLowerCase()==="cimode")return b?d?{res:`${y}${C}${p}`,usedKey:p,exactUsedKey:p,usedLng:x,usedNS:y,usedParams:this.getUsedParamsDetails(c)}:`${y}${C}${p}`:d?{res:p,usedKey:p,exactUsedKey:p,usedLng:x,usedNS:y,usedParams:this.getUsedParamsDetails(c)}:p;const A=this.resolve(a,c);let N=A?.res;const E=A?.usedKey||p,O=A?.exactUsedKey||p,R=["[object Number]","[object Function]","[object RegExp]"],k=c.joinArrays!==void 0?c.joinArrays:this.options.joinArrays,D=!this.i18nFormat||this.i18nFormat.handleAsObject,j=c.count!==void 0&&!Ae(c.count),T=xl.hasDefaultValue(c),w=j?this.pluralResolver.getSuffix(x,c.count,c):"",P=c.ordinal&&j?this.pluralResolver.getSuffix(x,c.count,{ordinal:!1}):"",F=j&&!c.ordinal&&c.count===0,z=F&&c[`defaultValue${this.options.pluralSeparator}zero`]||c[`defaultValue${w}`]||c[`defaultValue${P}`]||c.defaultValue;let $=N;D&&!N&&T&&($=z);const ne=id($),Z=Object.prototype.toString.apply($);if(D&&$&&ne&&R.indexOf(Z)<0&&!(Ae(k)&&Array.isArray($))){if(!c.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const xe=this.options.returnedObjectHandler?this.options.returnedObjectHandler(E,$,{...c,ns:m}):`key '${p} (${this.language})' returned an object instead of string.`;return d?(A.res=xe,A.usedParams=this.getUsedParamsDetails(c),A):xe}if(f){const xe=Array.isArray($),te=xe?[]:{},be=xe?O:E;for(const I in $)if(Object.prototype.hasOwnProperty.call($,I)){const X=`${be}${f}${I}`;T&&!N?te[I]=this.translate(X,{...c,defaultValue:id(z)?z[I]:void 0,joinArrays:!1,ns:m}):te[I]=this.translate(X,{...c,joinArrays:!1,ns:m}),te[I]===X&&(te[I]=$[I])}N=te}}else if(D&&Ae(k)&&Array.isArray(N))N=N.join(k),N&&(N=this.extendTranslation(N,a,c,s));else{let xe=!1,te=!1;!this.isValidLookup(N)&&T&&(xe=!0,N=z),this.isValidLookup(N)||(te=!0,N=p);const I=(c.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&te?void 0:N,X=T&&z!==N&&this.options.updateMissing;if(te||xe||X){if(this.logger.log(X?"updateKey":"missingKey",x,y,p,X?z:N),f){const he=this.resolve(p,{...c,keySeparator:!1});he&&he.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let ee=[];const re=this.languageUtils.getFallbackCodes(this.options.fallbackLng,c.lng||this.language);if(this.options.saveMissingTo==="fallback"&&re&&re[0])for(let he=0;he<re.length;he++)ee.push(re[he]);else this.options.saveMissingTo==="all"?ee=this.languageUtils.toResolveHierarchy(c.lng||this.language):ee.push(c.lng||this.language);const fe=(he,de,H)=>{const Q=T&&H!==N?H:I;this.options.missingKeyHandler?this.options.missingKeyHandler(he,y,de,Q,X,c):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(he,y,de,Q,X,c),this.emit("missingKey",he,y,de,N)};this.options.saveMissing&&(this.options.saveMissingPlurals&&j?ee.forEach(he=>{const de=this.pluralResolver.getSuffixes(he,c);F&&c[`defaultValue${this.options.pluralSeparator}zero`]&&de.indexOf(`${this.options.pluralSeparator}zero`)<0&&de.push(`${this.options.pluralSeparator}zero`),de.forEach(H=>{fe([he],p+H,c[`defaultValue${H}`]||z)})}):fe(ee,p,z))}N=this.extendTranslation(N,a,c,A,s),te&&N===p&&this.options.appendNamespaceToMissingKey&&(N=`${y}${C}${p}`),(te||xe)&&this.options.parseMissingKeyHandler&&(N=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${y}${C}${p}`:p,xe?N:void 0,c))}return d?(A.res=N,A.usedParams=this.getUsedParamsDetails(c),A):N}extendTranslation(a,o,s,c,d){if(this.i18nFormat?.parse)a=this.i18nFormat.parse(a,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||c.usedLng,c.usedNS,c.usedKey,{resolved:c});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const m=Ae(a)&&(s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let y;if(m){const x=a.match(this.interpolator.nestingRegexp);y=x&&x.length}let C=s.replace&&!Ae(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(C={...this.options.interpolation.defaultVariables,...C}),a=this.interpolator.interpolate(a,C,s.lng||this.language||c.usedLng,s),m){const x=a.match(this.interpolator.nestingRegexp),b=x&&x.length;y<b&&(s.nest=!1)}!s.lng&&c&&c.res&&(s.lng=this.language||c.usedLng),s.nest!==!1&&(a=this.interpolator.nest(a,(...x)=>d?.[0]===x[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${x[0]} in key: ${o[0]}`),null):this.translate(...x,o),s)),s.interpolation&&this.interpolator.reset()}const f=s.postProcess||this.options.postProcess,p=Ae(f)?[f]:f;return a!=null&&p?.length&&s.applyPostProcessor!==!1&&(a=_x.handle(p,a,o,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...c,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),a}resolve(a,o={}){let s,c,d,f,p;return Ae(a)&&(a=[a]),a.forEach(m=>{if(this.isValidLookup(s))return;const y=this.extractFromKey(m,o),C=y.key;c=C;let x=y.namespaces;this.options.fallbackNS&&(x=x.concat(this.options.fallbackNS));const b=o.count!==void 0&&!Ae(o.count),A=b&&!o.ordinal&&o.count===0,N=o.context!==void 0&&(Ae(o.context)||typeof o.context=="number")&&o.context!=="",E=o.lngs?o.lngs:this.languageUtils.toResolveHierarchy(o.lng||this.language,o.fallbackLng);x.forEach(O=>{this.isValidLookup(s)||(p=O,!Qg[`${E[0]}-${O}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(p)&&(Qg[`${E[0]}-${O}`]=!0,this.logger.warn(`key "${c}" for languages "${E.join(", ")}" won't get resolved as namespace "${p}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),E.forEach(R=>{if(this.isValidLookup(s))return;f=R;const k=[C];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(k,C,R,O,o);else{let j;b&&(j=this.pluralResolver.getSuffix(R,o.count,o));const T=`${this.options.pluralSeparator}zero`,w=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(b&&(o.ordinal&&j.indexOf(w)===0&&k.push(C+j.replace(w,this.options.pluralSeparator)),k.push(C+j),A&&k.push(C+T)),N){const P=`${C}${this.options.contextSeparator||"_"}${o.context}`;k.push(P),b&&(o.ordinal&&j.indexOf(w)===0&&k.push(P+j.replace(w,this.options.pluralSeparator)),k.push(P+j),A&&k.push(P+T))}}let D;for(;D=k.pop();)this.isValidLookup(s)||(d=D,s=this.getResource(R,O,D,o))}))})}),{res:s,usedKey:c,exactUsedKey:d,usedLng:f,usedNS:p}}isValidLookup(a){return a!==void 0&&!(!this.options.returnNull&&a===null)&&!(!this.options.returnEmptyString&&a==="")}getResource(a,o,s,c={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(a,o,s,c):this.resourceStore.getResource(a,o,s,c)}getUsedParamsDetails(a={}){const o=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=a.replace&&!Ae(a.replace);let c=s?a.replace:a;if(s&&typeof a.count<"u"&&(c.count=a.count),this.options.interpolation.defaultVariables&&(c={...this.options.interpolation.defaultVariables,...c}),!s){c={...c};for(const d of o)delete c[d]}return c}static hasDefaultValue(a){const o="defaultValue";for(const s in a)if(Object.prototype.hasOwnProperty.call(a,s)&&o===s.substring(0,o.length)&&a[s]!==void 0)return!0;return!1}}class Wg{constructor(a){this.options=a,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Kn.create("languageUtils")}getScriptPartFromCode(a){if(a=zr(a),!a||a.indexOf("-")<0)return null;const o=a.split("-");return o.length===2||(o.pop(),o[o.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(o.join("-"))}getLanguagePartFromCode(a){if(a=zr(a),!a||a.indexOf("-")<0)return a;const o=a.split("-");return this.formatLanguageCode(o[0])}formatLanguageCode(a){if(Ae(a)&&a.indexOf("-")>-1){let o;try{o=Intl.getCanonicalLocales(a)[0]}catch{}return o&&this.options.lowerCaseLng&&(o=o.toLowerCase()),o||(this.options.lowerCaseLng?a.toLowerCase():a)}return this.options.cleanCode||this.options.lowerCaseLng?a.toLowerCase():a}isSupportedCode(a){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(a=this.getLanguagePartFromCode(a)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(a)>-1}getBestMatchFromCodes(a){if(!a)return null;let o;return a.forEach(s=>{if(o)return;const c=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(c))&&(o=c)}),!o&&this.options.supportedLngs&&a.forEach(s=>{if(o)return;const c=this.getScriptPartFromCode(s);if(this.isSupportedCode(c))return o=c;const d=this.getLanguagePartFromCode(s);if(this.isSupportedCode(d))return o=d;o=this.options.supportedLngs.find(f=>{if(f===d)return f;if(!(f.indexOf("-")<0&&d.indexOf("-")<0)&&(f.indexOf("-")>0&&d.indexOf("-")<0&&f.substring(0,f.indexOf("-"))===d||f.indexOf(d)===0&&d.length>1))return f})}),o||(o=this.getFallbackCodes(this.options.fallbackLng)[0]),o}getFallbackCodes(a,o){if(!a)return[];if(typeof a=="function"&&(a=a(o)),Ae(a)&&(a=[a]),Array.isArray(a))return a;if(!o)return a.default||[];let s=a[o];return s||(s=a[this.getScriptPartFromCode(o)]),s||(s=a[this.formatLanguageCode(o)]),s||(s=a[this.getLanguagePartFromCode(o)]),s||(s=a.default),s||[]}toResolveHierarchy(a,o){const s=this.getFallbackCodes((o===!1?[]:o)||this.options.fallbackLng||[],a),c=[],d=f=>{f&&(this.isSupportedCode(f)?c.push(f):this.logger.warn(`rejecting language code not found in supportedLngs: ${f}`))};return Ae(a)&&(a.indexOf("-")>-1||a.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&d(this.formatLanguageCode(a)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&d(this.getScriptPartFromCode(a)),this.options.load!=="currentOnly"&&d(this.getLanguagePartFromCode(a))):Ae(a)&&d(this.formatLanguageCode(a)),s.forEach(f=>{c.indexOf(f)<0&&d(this.formatLanguageCode(f))}),c}}const Xg={zero:0,one:1,two:2,few:3,many:4,other:5},Zg={select:n=>n===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class tN{constructor(a,o={}){this.languageUtils=a,this.options=o,this.logger=Kn.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(a,o={}){const s=zr(a==="dev"?"en":a),c=o.ordinal?"ordinal":"cardinal",d=JSON.stringify({cleanedCode:s,type:c});if(d in this.pluralRulesCache)return this.pluralRulesCache[d];let f;try{f=new Intl.PluralRules(s,{type:c})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),Zg;if(!a.match(/-|_/))return Zg;const m=this.languageUtils.getLanguagePartFromCode(a);f=this.getRule(m,o)}return this.pluralRulesCache[d]=f,f}needsPlural(a,o={}){let s=this.getRule(a,o);return s||(s=this.getRule("dev",o)),s?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(a,o,s={}){return this.getSuffixes(a,s).map(c=>`${o}${c}`)}getSuffixes(a,o={}){let s=this.getRule(a,o);return s||(s=this.getRule("dev",o)),s?s.resolvedOptions().pluralCategories.sort((c,d)=>Xg[c]-Xg[d]).map(c=>`${this.options.prepend}${o.ordinal?`ordinal${this.options.prepend}`:""}${c}`):[]}getSuffix(a,o,s={}){const c=this.getRule(a,s);return c?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${c.select(o)}`:(this.logger.warn(`no plural rule found for: ${a}`),this.getSuffix("dev",o,s))}}const Jg=(n,a,o,s=".",c=!0)=>{let d=Vw(n,a,o);return!d&&c&&Ae(o)&&(d=kd(n,o,s),d===void 0&&(d=kd(a,o,s))),d},od=n=>n.replace(/\$/g,"$$$$");class ey{constructor(a={}){this.logger=Kn.create("interpolator"),this.options=a,this.format=a?.interpolation?.format||(o=>o),this.init(a)}init(a={}){a.interpolation||(a.interpolation={escapeValue:!0});const{escape:o,escapeValue:s,useRawValueToEscape:c,prefix:d,prefixEscaped:f,suffix:p,suffixEscaped:m,formatSeparator:y,unescapeSuffix:C,unescapePrefix:x,nestingPrefix:b,nestingPrefixEscaped:A,nestingSuffix:N,nestingSuffixEscaped:E,nestingOptionsSeparator:O,maxReplaces:R,alwaysFormat:k}=a.interpolation;this.escape=o!==void 0?o:$w,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=c!==void 0?c:!1,this.prefix=d?Ci(d):f||"{{",this.suffix=p?Ci(p):m||"}}",this.formatSeparator=y||",",this.unescapePrefix=C?"":x||"-",this.unescapeSuffix=this.unescapePrefix?"":C||"",this.nestingPrefix=b?Ci(b):A||Ci("$t("),this.nestingSuffix=N?Ci(N):E||Ci(")"),this.nestingOptionsSeparator=O||",",this.maxReplaces=R||1e3,this.alwaysFormat=k!==void 0?k:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const a=(o,s)=>o?.source===s?(o.lastIndex=0,o):new RegExp(s,"g");this.regexp=a(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=a(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=a(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(a,o,s,c){let d,f,p;const m=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},y=A=>{if(A.indexOf(this.formatSeparator)<0){const R=Jg(o,m,A,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(R,void 0,s,{...c,...o,interpolationkey:A}):R}const N=A.split(this.formatSeparator),E=N.shift().trim(),O=N.join(this.formatSeparator).trim();return this.format(Jg(o,m,E,this.options.keySeparator,this.options.ignoreJSONStructure),O,s,{...c,...o,interpolationkey:E})};this.resetRegExp();const C=c?.missingInterpolationHandler||this.options.missingInterpolationHandler,x=c?.interpolation?.skipOnVariables!==void 0?c.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:A=>od(A)},{regex:this.regexp,safeValue:A=>this.escapeValue?od(this.escape(A)):od(A)}].forEach(A=>{for(p=0;d=A.regex.exec(a);){const N=d[1].trim();if(f=y(N),f===void 0)if(typeof C=="function"){const O=C(a,d,c);f=Ae(O)?O:""}else if(c&&Object.prototype.hasOwnProperty.call(c,N))f="";else if(x){f=d[0];continue}else this.logger.warn(`missed to pass in variable ${N} for interpolating ${a}`),f="";else!Ae(f)&&!this.useRawValueToEscape&&(f=Fg(f));const E=A.safeValue(f);if(a=a.replace(d[0],E),x?(A.regex.lastIndex+=f.length,A.regex.lastIndex-=d[0].length):A.regex.lastIndex=0,p++,p>=this.maxReplaces)break}}),a}nest(a,o,s={}){let c,d,f;const p=(m,y)=>{const C=this.nestingOptionsSeparator;if(m.indexOf(C)<0)return m;const x=m.split(new RegExp(`${Ci(C)}[ ]*{`));let b=`{${x[1]}`;m=x[0],b=this.interpolate(b,f);const A=b.match(/'/g),N=b.match(/"/g);((A?.length??0)%2===0&&!N||(N?.length??0)%2!==0)&&(b=b.replace(/'/g,'"'));try{f=JSON.parse(b),y&&(f={...y,...f})}catch(E){return this.logger.warn(`failed parsing options string in nesting for key ${m}`,E),`${m}${C}${b}`}return f.defaultValue&&f.defaultValue.indexOf(this.prefix)>-1&&delete f.defaultValue,m};for(;c=this.nestingRegexp.exec(a);){let m=[];f={...s},f=f.replace&&!Ae(f.replace)?f.replace:f,f.applyPostProcessor=!1,delete f.defaultValue;const y=/{.*}/.test(c[1])?c[1].lastIndexOf("}")+1:c[1].indexOf(this.formatSeparator);if(y!==-1&&(m=c[1].slice(y).split(this.formatSeparator).map(C=>C.trim()).filter(Boolean),c[1]=c[1].slice(0,y)),d=o(p.call(this,c[1].trim(),f),f),d&&c[0]===a&&!Ae(d))return d;Ae(d)||(d=Fg(d)),d||(this.logger.warn(`missed to resolve ${c[1]} for nesting ${a}`),d=""),m.length&&(d=m.reduce((C,x)=>this.format(C,x,s.lng,{...s,interpolationkey:c[1].trim()}),d.trim())),a=a.replace(c[0],d),this.regexp.lastIndex=0}return a}}const nN=n=>{let a=n.toLowerCase().trim();const o={};if(n.indexOf("(")>-1){const s=n.split("(");a=s[0].toLowerCase().trim();const c=s[1].substring(0,s[1].length-1);a==="currency"&&c.indexOf(":")<0?o.currency||(o.currency=c.trim()):a==="relativetime"&&c.indexOf(":")<0?o.range||(o.range=c.trim()):c.split(";").forEach(f=>{if(f){const[p,...m]=f.split(":"),y=m.join(":").trim().replace(/^'+|'+$/g,""),C=p.trim();o[C]||(o[C]=y),y==="false"&&(o[C]=!1),y==="true"&&(o[C]=!0),isNaN(y)||(o[C]=parseInt(y,10))}})}return{formatName:a,formatOptions:o}},ty=n=>{const a={};return(o,s,c)=>{let d=c;c&&c.interpolationkey&&c.formatParams&&c.formatParams[c.interpolationkey]&&c[c.interpolationkey]&&(d={...d,[c.interpolationkey]:void 0});const f=s+JSON.stringify(d);let p=a[f];return p||(p=n(zr(s),c),a[f]=p),p(o)}},aN=n=>(a,o,s)=>n(zr(o),s)(a);class iN{constructor(a={}){this.logger=Kn.create("formatter"),this.options=a,this.init(a)}init(a,o={interpolation:{}}){this.formatSeparator=o.interpolation.formatSeparator||",";const s=o.cacheInBuiltFormats?ty:aN;this.formats={number:s((c,d)=>{const f=new Intl.NumberFormat(c,{...d});return p=>f.format(p)}),currency:s((c,d)=>{const f=new Intl.NumberFormat(c,{...d,style:"currency"});return p=>f.format(p)}),datetime:s((c,d)=>{const f=new Intl.DateTimeFormat(c,{...d});return p=>f.format(p)}),relativetime:s((c,d)=>{const f=new Intl.RelativeTimeFormat(c,{...d});return p=>f.format(p,d.range||"day")}),list:s((c,d)=>{const f=new Intl.ListFormat(c,{...d});return p=>f.format(p)})}}add(a,o){this.formats[a.toLowerCase().trim()]=o}addCached(a,o){this.formats[a.toLowerCase().trim()]=ty(o)}format(a,o,s,c={}){const d=o.split(this.formatSeparator);if(d.length>1&&d[0].indexOf("(")>1&&d[0].indexOf(")")<0&&d.find(p=>p.indexOf(")")>-1)){const p=d.findIndex(m=>m.indexOf(")")>-1);d[0]=[d[0],...d.splice(1,p)].join(this.formatSeparator)}return d.reduce((p,m)=>{const{formatName:y,formatOptions:C}=nN(m);if(this.formats[y]){let x=p;try{const b=c?.formatParams?.[c.interpolationkey]||{},A=b.locale||b.lng||c.locale||c.lng||s;x=this.formats[y](p,A,{...C,...c,...b})}catch(b){this.logger.warn(b)}return x}else this.logger.warn(`there was no format function for ${y}`);return p},a)}}const oN=(n,a)=>{n.pending[a]!==void 0&&(delete n.pending[a],n.pendingCount--)};class rN extends El{constructor(a,o,s,c={}){super(),this.backend=a,this.store=o,this.services=s,this.languageUtils=s.languageUtils,this.options=c,this.logger=Kn.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=c.maxParallelReads||10,this.readingCalls=0,this.maxRetries=c.maxRetries>=0?c.maxRetries:5,this.retryTimeout=c.retryTimeout>=1?c.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(s,c.backend,c)}queueLoad(a,o,s,c){const d={},f={},p={},m={};return a.forEach(y=>{let C=!0;o.forEach(x=>{const b=`${y}|${x}`;!s.reload&&this.store.hasResourceBundle(y,x)?this.state[b]=2:this.state[b]<0||(this.state[b]===1?f[b]===void 0&&(f[b]=!0):(this.state[b]=1,C=!1,f[b]===void 0&&(f[b]=!0),d[b]===void 0&&(d[b]=!0),m[x]===void 0&&(m[x]=!0)))}),C||(p[y]=!0)}),(Object.keys(d).length||Object.keys(f).length)&&this.queue.push({pending:f,pendingCount:Object.keys(f).length,loaded:{},errors:[],callback:c}),{toLoad:Object.keys(d),pending:Object.keys(f),toLoadLanguages:Object.keys(p),toLoadNamespaces:Object.keys(m)}}loaded(a,o,s){const c=a.split("|"),d=c[0],f=c[1];o&&this.emit("failedLoading",d,f,o),!o&&s&&this.store.addResourceBundle(d,f,s,void 0,void 0,{skipCopy:!0}),this.state[a]=o?-1:2,o&&s&&(this.state[a]=0);const p={};this.queue.forEach(m=>{Gw(m.loaded,[d],f),oN(m,a),o&&m.errors.push(o),m.pendingCount===0&&!m.done&&(Object.keys(m.loaded).forEach(y=>{p[y]||(p[y]={});const C=m.loaded[y];C.length&&C.forEach(x=>{p[y][x]===void 0&&(p[y][x]=!0)})}),m.done=!0,m.errors.length?m.callback(m.errors):m.callback())}),this.emit("loaded",p),this.queue=this.queue.filter(m=>!m.done)}read(a,o,s,c=0,d=this.retryTimeout,f){if(!a.length)return f(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:a,ns:o,fcName:s,tried:c,wait:d,callback:f});return}this.readingCalls++;const p=(y,C)=>{if(this.readingCalls--,this.waitingReads.length>0){const x=this.waitingReads.shift();this.read(x.lng,x.ns,x.fcName,x.tried,x.wait,x.callback)}if(y&&C&&c<this.maxRetries){setTimeout(()=>{this.read.call(this,a,o,s,c+1,d*2,f)},d);return}f(y,C)},m=this.backend[s].bind(this.backend);if(m.length===2){try{const y=m(a,o);y&&typeof y.then=="function"?y.then(C=>p(null,C)).catch(p):p(null,y)}catch(y){p(y)}return}return m(a,o,p)}prepareLoading(a,o,s={},c){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),c&&c();Ae(a)&&(a=this.languageUtils.toResolveHierarchy(a)),Ae(o)&&(o=[o]);const d=this.queueLoad(a,o,s,c);if(!d.toLoad.length)return d.pending.length||c(),null;d.toLoad.forEach(f=>{this.loadOne(f)})}load(a,o,s){this.prepareLoading(a,o,{},s)}reload(a,o,s){this.prepareLoading(a,o,{reload:!0},s)}loadOne(a,o=""){const s=a.split("|"),c=s[0],d=s[1];this.read(c,d,"read",void 0,void 0,(f,p)=>{f&&this.logger.warn(`${o}loading namespace ${d} for language ${c} failed`,f),!f&&p&&this.logger.log(`${o}loaded namespace ${d} for language ${c}`,p),this.loaded(a,f,p)})}saveMissing(a,o,s,c,d,f={},p=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(o)){this.logger.warn(`did not save key "${s}" as the namespace "${o}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if(this.backend?.create){const m={...f,isUpdate:d},y=this.backend.create.bind(this.backend);if(y.length<6)try{let C;y.length===5?C=y(a,o,s,c,m):C=y(a,o,s,c),C&&typeof C.then=="function"?C.then(x=>p(null,x)).catch(p):p(null,C)}catch(C){p(C)}else y(a,o,s,c,p,m)}!a||!a[0]||this.store.addResource(a[0],o,s,c)}}}const rd=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:n=>{let a={};if(typeof n[1]=="object"&&(a=n[1]),Ae(n[1])&&(a.defaultValue=n[1]),Ae(n[2])&&(a.tDescription=n[2]),typeof n[2]=="object"||typeof n[3]=="object"){const o=n[3]||n[2];Object.keys(o).forEach(s=>{a[s]=o[s]})}return a},interpolation:{escapeValue:!0,format:n=>n,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),ny=n=>(Ae(n.ns)&&(n.ns=[n.ns]),Ae(n.fallbackLng)&&(n.fallbackLng=[n.fallbackLng]),Ae(n.fallbackNS)&&(n.fallbackNS=[n.fallbackNS]),n.supportedLngs?.indexOf?.("cimode")<0&&(n.supportedLngs=n.supportedLngs.concat(["cimode"])),typeof n.initImmediate=="boolean"&&(n.initAsync=n.initImmediate),n),ol=()=>{},sN=n=>{Object.getOwnPropertyNames(Object.getPrototypeOf(n)).forEach(o=>{typeof n[o]=="function"&&(n[o]=n[o].bind(n))})},Ix="__i18next_supportNoticeShown",lN=()=>typeof globalThis<"u"&&!!globalThis[Ix],cN=()=>{typeof globalThis<"u"&&(globalThis[Ix]=!0)},uN=n=>!!(n?.modules?.backend?.name?.indexOf("Locize")>0||n?.modules?.backend?.constructor?.name?.indexOf("Locize")>0||n?.options?.backend?.backends&&n.options.backend.backends.some(a=>a?.name?.indexOf("Locize")>0||a?.constructor?.name?.indexOf("Locize")>0)||n?.options?.backend?.projectId||n?.options?.backend?.backendOptions&&n.options.backend.backendOptions.some(a=>a?.projectId));class Or extends El{constructor(a={},o){if(super(),this.options=ny(a),this.services={},this.logger=Kn,this.modules={external:[]},sN(this),o&&!this.isInitialized&&!a.isClone){if(!this.options.initAsync)return this.init(a,o),this;setTimeout(()=>{this.init(a,o)},0)}}init(a={},o){this.isInitializing=!0,typeof a=="function"&&(o=a,a={}),a.defaultNS==null&&a.ns&&(Ae(a.ns)?a.defaultNS=a.ns:a.ns.indexOf("translation")<0&&(a.defaultNS=a.ns[0]));const s=rd();this.options={...s,...this.options,...ny(a)},this.options.interpolation={...s.interpolation,...this.options.interpolation},a.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=a.keySeparator),a.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=a.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=s.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!uN(this)&&!lN()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is maintained with support from Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),cN());const c=y=>y?typeof y=="function"?new y:y:null;if(!this.options.isClone){this.modules.logger?Kn.init(c(this.modules.logger),this.options):Kn.init(null,this.options);let y;this.modules.formatter?y=this.modules.formatter:y=iN;const C=new Wg(this.options);this.store=new $g(this.options.resources,this.options);const x=this.services;x.logger=Kn,x.resourceStore=this.store,x.languageUtils=C,x.pluralResolver=new tN(C,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),y&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(x.formatter=c(y),x.formatter.init&&x.formatter.init(x,this.options),this.options.interpolation.format=x.formatter.format.bind(x.formatter)),x.interpolator=new ey(this.options),x.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},x.backendConnector=new rN(c(this.modules.backend),x.resourceStore,x,this.options),x.backendConnector.on("*",(A,...N)=>{this.emit(A,...N)}),this.modules.languageDetector&&(x.languageDetector=c(this.modules.languageDetector),x.languageDetector.init&&x.languageDetector.init(x,this.options.detection,this.options)),this.modules.i18nFormat&&(x.i18nFormat=c(this.modules.i18nFormat),x.i18nFormat.init&&x.i18nFormat.init(this)),this.translator=new xl(this.services,this.options),this.translator.on("*",(A,...N)=>{this.emit(A,...N)}),this.modules.external.forEach(A=>{A.init&&A.init(this)})}if(this.format=this.options.interpolation.format,o||(o=ol),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const y=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);y.length>0&&y[0]!=="dev"&&(this.options.lng=y[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(y=>{this[y]=(...C)=>this.store[y](...C)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(y=>{this[y]=(...C)=>(this.store[y](...C),this)});const p=wr(),m=()=>{const y=(C,x)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),p.resolve(x),o(C,x)};if(this.languages&&!this.isInitialized)return y(null,this.t.bind(this));this.changeLanguage(this.options.lng,y)};return this.options.resources||!this.options.initAsync?m():setTimeout(m,0),p}loadResources(a,o=ol){let s=o;const c=Ae(a)?a:this.language;if(typeof a=="function"&&(s=a),!this.options.resources||this.options.partialBundledLanguages){if(c?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const d=[],f=p=>{if(!p||p==="cimode")return;this.services.languageUtils.toResolveHierarchy(p).forEach(y=>{y!=="cimode"&&d.indexOf(y)<0&&d.push(y)})};c?f(c):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(m=>f(m)),this.options.preload?.forEach?.(p=>f(p)),this.services.backendConnector.load(d,this.options.ns,p=>{!p&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(p)})}else s(null)}reloadResources(a,o,s){const c=wr();return typeof a=="function"&&(s=a,a=void 0),typeof o=="function"&&(s=o,o=void 0),a||(a=this.languages),o||(o=this.options.ns),s||(s=ol),this.services.backendConnector.reload(a,o,d=>{c.resolve(),s(d)}),c}use(a){if(!a)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!a.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return a.type==="backend"&&(this.modules.backend=a),(a.type==="logger"||a.log&&a.warn&&a.error)&&(this.modules.logger=a),a.type==="languageDetector"&&(this.modules.languageDetector=a),a.type==="i18nFormat"&&(this.modules.i18nFormat=a),a.type==="postProcessor"&&_x.addPostProcessor(a),a.type==="formatter"&&(this.modules.formatter=a),a.type==="3rdParty"&&this.modules.external.push(a),this}setResolvedLanguage(a){if(!(!a||!this.languages)&&!(["cimode","dev"].indexOf(a)>-1)){for(let o=0;o<this.languages.length;o++){const s=this.languages[o];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&this.languages.indexOf(a)<0&&this.store.hasLanguageSomeTranslations(a)&&(this.resolvedLanguage=a,this.languages.unshift(a))}}changeLanguage(a,o){this.isLanguageChangingTo=a;const s=wr();this.emit("languageChanging",a);const c=p=>{this.language=p,this.languages=this.services.languageUtils.toResolveHierarchy(p),this.resolvedLanguage=void 0,this.setResolvedLanguage(p)},d=(p,m)=>{m?this.isLanguageChangingTo===a&&(c(m),this.translator.changeLanguage(m),this.isLanguageChangingTo=void 0,this.emit("languageChanged",m),this.logger.log("languageChanged",m)):this.isLanguageChangingTo=void 0,s.resolve((...y)=>this.t(...y)),o&&o(p,(...y)=>this.t(...y))},f=p=>{!a&&!p&&this.services.languageDetector&&(p=[]);const m=Ae(p)?p:p&&p[0],y=this.store.hasLanguageSomeTranslations(m)?m:this.services.languageUtils.getBestMatchFromCodes(Ae(p)?[p]:p);y&&(this.language||c(y),this.translator.language||this.translator.changeLanguage(y),this.services.languageDetector?.cacheUserLanguage?.(y)),this.loadResources(y,C=>{d(C,y)})};return!a&&this.services.languageDetector&&!this.services.languageDetector.async?f(this.services.languageDetector.detect()):!a&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(f):this.services.languageDetector.detect(f):f(a),s}getFixedT(a,o,s){const c=(d,f,...p)=>{let m;typeof f!="object"?m=this.options.overloadTranslationOptionHandler([d,f].concat(p)):m={...f},m.lng=m.lng||c.lng,m.lngs=m.lngs||c.lngs,m.ns=m.ns||c.ns,m.keyPrefix!==""&&(m.keyPrefix=m.keyPrefix||s||c.keyPrefix);const y=this.options.keySeparator||".";let C;return m.keyPrefix&&Array.isArray(d)?C=d.map(x=>(typeof x=="function"&&(x=Dd(x,{...this.options,...f})),`${m.keyPrefix}${y}${x}`)):(typeof d=="function"&&(d=Dd(d,{...this.options,...f})),C=m.keyPrefix?`${m.keyPrefix}${y}${d}`:d),this.t(C,m)};return Ae(a)?c.lng=a:c.lngs=a,c.ns=o,c.keyPrefix=s,c}t(...a){return this.translator?.translate(...a)}exists(...a){return this.translator?.exists(...a)}setDefaultNamespace(a){this.options.defaultNS=a}hasLoadedNamespace(a,o={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=o.lng||this.resolvedLanguage||this.languages[0],c=this.options?this.options.fallbackLng:!1,d=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const f=(p,m)=>{const y=this.services.backendConnector.state[`${p}|${m}`];return y===-1||y===0||y===2};if(o.precheck){const p=o.precheck(this,f);if(p!==void 0)return p}return!!(this.hasResourceBundle(s,a)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||f(s,a)&&(!c||f(d,a)))}loadNamespaces(a,o){const s=wr();return this.options.ns?(Ae(a)&&(a=[a]),a.forEach(c=>{this.options.ns.indexOf(c)<0&&this.options.ns.push(c)}),this.loadResources(c=>{s.resolve(),o&&o(c)}),s):(o&&o(),Promise.resolve())}loadLanguages(a,o){const s=wr();Ae(a)&&(a=[a]);const c=this.options.preload||[],d=a.filter(f=>c.indexOf(f)<0&&this.services.languageUtils.isSupportedCode(f));return d.length?(this.options.preload=c.concat(d),this.loadResources(f=>{s.resolve(),o&&o(f)}),s):(o&&o(),Promise.resolve())}dir(a){if(a||(a=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!a)return"rtl";try{const c=new Intl.Locale(a);if(c&&c.getTextInfo){const d=c.getTextInfo();if(d&&d.direction)return d.direction}}catch{}const o=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=this.services?.languageUtils||new Wg(rd());return a.toLowerCase().indexOf("-latn")>1?"ltr":o.indexOf(s.getLanguagePartFromCode(a))>-1||a.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(a={},o){const s=new Or(a,o);return s.createInstance=Or.createInstance,s}cloneInstance(a={},o=ol){const s=a.forkResourceStore;s&&delete a.forkResourceStore;const c={...this.options,...a,isClone:!0},d=new Or(c);if((a.debug!==void 0||a.prefix!==void 0)&&(d.logger=d.logger.clone(a)),["store","services","language"].forEach(p=>{d[p]=this[p]}),d.services={...this.services},d.services.utils={hasLoadedNamespace:d.hasLoadedNamespace.bind(d)},s){const p=Object.keys(this.store.data).reduce((m,y)=>(m[y]={...this.store.data[y]},m[y]=Object.keys(m[y]).reduce((C,x)=>(C[x]={...m[y][x]},C),m[y]),m),{});d.store=new $g(p,c),d.services.resourceStore=d.store}if(a.interpolation){const m={...rd().interpolation,...this.options.interpolation,...a.interpolation},y={...c,interpolation:m};d.services.interpolator=new ey(y)}return d.translator=new xl(d.services,c),d.translator.on("*",(p,...m)=>{d.emit(p,...m)}),d.init(c,o),d.translator.options=c,d.translator.backendConnector.services.utils={hasLoadedNamespace:d.hasLoadedNamespace.bind(d)},d}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const Be=Or.createInstance();Be.createInstance;Be.dir;Be.init;Be.loadResources;Be.reloadResources;Be.use;Be.changeLanguage;Be.getFixedT;Be.t;Be.exists;Be.setDefaultNamespace;Be.hasLoadedNamespace;Be.loadNamespaces;Be.loadLanguages;const dN=(n,a,o,s)=>{const c=[o,{code:a,...s||{}}];if(n?.services?.logger?.forward)return n.services.logger.forward(c,"warn","react-i18next::",!0);Ai(c[0])&&(c[0]=`react-i18next:: ${c[0]}`),n?.services?.logger?.warn?n.services.logger.warn(...c):console?.warn&&console.warn(...c)},ay={},Ux=(n,a,o,s)=>{Ai(o)&&ay[o]||(Ai(o)&&(ay[o]=new Date),dN(n,a,o,s))},Hx=(n,a)=>()=>{if(n.isInitialized)a();else{const o=()=>{setTimeout(()=>{n.off("initialized",o)},0),a()};n.on("initialized",o)}},jd=(n,a,o)=>{n.loadNamespaces(a,Hx(n,o))},iy=(n,a,o,s)=>{if(Ai(o)&&(o=[o]),n.options.preload&&n.options.preload.indexOf(a)>-1)return jd(n,o,s);o.forEach(c=>{n.options.ns.indexOf(c)<0&&n.options.ns.push(c)}),n.loadLanguages(a,Hx(n,s))},fN=(n,a,o={})=>!a.languages||!a.languages.length?(Ux(a,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:a.languages}),!0):a.hasLoadedNamespace(n,{lng:o.lng,precheck:(s,c)=>{if(o.bindI18n&&o.bindI18n.indexOf("languageChanging")>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!c(s.isLanguageChangingTo,n))return!1}}),Ai=n=>typeof n=="string",hN=n=>typeof n=="object"&&n!==null,pN=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,mN={"&amp;":"&","&#38;":"&","&lt;":"<","&#60;":"<","&gt;":">","&#62;":">","&apos;":"'","&#39;":"'","&quot;":'"',"&#34;":'"',"&nbsp;":" ","&#160;":" ","&copy;":"©","&#169;":"©","&reg;":"®","&#174;":"®","&hellip;":"…","&#8230;":"…","&#x2F;":"/","&#47;":"/"},gN=n=>mN[n],yN=n=>n.replace(pN,gN);let Td={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:yN,transDefaultProps:void 0};const xN=(n={})=>{Td={...Td,...n}},bN=()=>Td;let Bx;const vN=n=>{Bx=n},CN=()=>Bx,SN={type:"3rdParty",init(n){xN(n.options.react),vN(n)}},wN=S.createContext();class NN{constructor(){this.usedNamespaces={}}addUsedNamespaces(a){a.forEach(o=>{this.usedNamespaces[o]||(this.usedNamespaces[o]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var sd={exports:{}},ld={};var oy;function AN(){if(oy)return ld;oy=1;var n=Kd();function a(x,b){return x===b&&(x!==0||1/x===1/b)||x!==x&&b!==b}var o=typeof Object.is=="function"?Object.is:a,s=n.useState,c=n.useEffect,d=n.useLayoutEffect,f=n.useDebugValue;function p(x,b){var A=b(),N=s({inst:{value:A,getSnapshot:b}}),E=N[0].inst,O=N[1];return d(function(){E.value=A,E.getSnapshot=b,m(E)&&O({inst:E})},[x,A,b]),c(function(){return m(E)&&O({inst:E}),x(function(){m(E)&&O({inst:E})})},[x]),f(A),A}function m(x){var b=x.getSnapshot;x=x.value;try{var A=b();return!o(x,A)}catch{return!0}}function y(x,b){return b()}var C=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?y:p;return ld.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:C,ld}var ry;function kN(){return ry||(ry=1,sd.exports=AN()),sd.exports}var DN=kN();const jN=(n,a)=>Ai(a)?a:hN(a)&&Ai(a.defaultValue)?a.defaultValue:Array.isArray(n)?n[n.length-1]:n,TN={t:jN,ready:!1},MN=()=>()=>{},Mt=(n,a={})=>{const{i18n:o}=a,{i18n:s,defaultNS:c}=S.useContext(wN)||{},d=o||s||CN();d&&!d.reportNamespaces&&(d.reportNamespaces=new NN),d||Ux(d,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const f=S.useMemo(()=>({...bN(),...d?.options?.react,...a}),[d,a]),{useSuspense:p,keyPrefix:m}=f,y=c||d?.options?.defaultNS,C=Ai(y)?[y]:y||["translation"],x=S.useMemo(()=>C,C);d?.reportNamespaces?.addUsedNamespaces?.(x);const b=S.useRef(0),A=S.useCallback(z=>{if(!d)return MN;const{bindI18n:$,bindI18nStore:ne}=f,Z=()=>{b.current+=1,z()};return $&&d.on($,Z),ne&&d.store.on(ne,Z),()=>{$&&$.split(" ").forEach(xe=>d.off(xe,Z)),ne&&ne.split(" ").forEach(xe=>d.store.off(xe,Z))}},[d,f]),N=S.useRef(),E=S.useCallback(()=>{if(!d)return TN;const z=!!(d.isInitialized||d.initializedStoreOnce)&&x.every(be=>fN(be,d,f)),$=a.lng||d.language,ne=b.current,Z=N.current;if(Z&&Z.ready===z&&Z.lng===$&&Z.keyPrefix===m&&Z.revision===ne)return Z;const te={t:d.getFixedT($,f.nsMode==="fallback"?x:x[0],m),ready:z,lng:$,keyPrefix:m,revision:ne};return N.current=te,te},[d,x,m,f,a.lng]),[O,R]=S.useState(0),{t:k,ready:D}=DN.useSyncExternalStore(A,E,E);S.useEffect(()=>{if(d&&!D&&!p){const z=()=>R($=>$+1);a.lng?iy(d,a.lng,x,z):jd(d,x,z)}},[d,a.lng,x,D,p,O]);const j=d||{},T=S.useRef(null),w=S.useRef(),P=z=>{const $=Object.getOwnPropertyDescriptors(z);$.__original&&delete $.__original;const ne=Object.create(Object.getPrototypeOf(z),$);if(!Object.prototype.hasOwnProperty.call(ne,"__original"))try{Object.defineProperty(ne,"__original",{value:z,writable:!1,enumerable:!1,configurable:!1})}catch{}return ne},F=S.useMemo(()=>{const z=j,$=z?.language;let ne=z;z&&(T.current&&T.current.__original===z?w.current!==$?(ne=P(z),T.current=ne,w.current=$):ne=T.current:(ne=P(z),T.current=ne,w.current=$));const Z=[k,ne,D];return Z.t=k,Z.i18n=ne,Z.ready=D,Z},[k,j,D,j.resolvedLanguage,j.language,j.languages]);if(d&&p&&!D)throw new Promise(z=>{const $=()=>z();a.lng?iy(d,a.lng,x,$):jd(d,x,$)});return F},Kx="ccs-ui-locale",EN=["en","zh-CN","vi","ja"];function qr(n){return n?n.toLowerCase().startsWith("ja")?"ja":n.toLowerCase().startsWith("zh")?"zh-CN":n.toLowerCase().startsWith("vi")?"vi":"en":"en"}function qx(){if(typeof window>"u")return null;try{const n=window.localStorage.getItem(Kx);return n?qr(n):null}catch{return null}}function ON(){const n=qx();return n||(typeof navigator<"u"?qr(navigator.language):"en")}function $d(n){const a=qx();return a||(typeof navigator<"u"?qr(navigator.language):"en")}function PN(n){const a=qr(n);if(typeof window<"u")try{window.localStorage.setItem(Kx,a)}catch{}return a}const LN={en:{translation:{locale:{en:"English","zh-CN":"Simplified Chinese",vi:"Vietnamese",ja:"Japanese"},layout:{languageSwitcher:"Language"},nav:{general:"General",home:"Home",analytics:"Analytics",identityAccess:"Identity & Access",apiProfiles:"API Profiles",cliproxyPlus:"CLIProxy Plus",cliproxyOverview:"Overview",controlPanel:"Control Panel",githubCopilot:"GitHub Copilot",cursorIde:"Cursor IDE",claudeExtension:"Claude Extension",accounts:"Accounts",allAccounts:"All Accounts",sharedData:"Shared Data",compatibleClis:"Compatible",factoryDroid:"Factory Droid",system:"System",health:"Health",settings:"Settings",openrouterTooltip:"Featured: OpenRouter + Alibaba Coding Plan + Ollama"},home:{profiles:"Profiles",cliproxy:"CLIProxy",accounts:"Accounts",health:"Health",configurationRequired:"Configuration Required"},auth:{dashboardTitle:"CCS Dashboard",loginDescription:"Enter your credentials to access the dashboard",username:"Username",password:"Password",usernamePlaceholder:"Enter username",passwordPlaceholder:"Enter password",signIn:"Sign In",signingIn:"Signing in...",loginFailed:"Login failed"},commonToast:{apiKeyRequired:"API key is required",accountAddedPresetFailed:"Account added, but failed to apply default preset",settingsCopied:"Settings copied to clipboard",enterPresetName:"Please enter a preset name to save",codeCopied:"Code copied to clipboard",copyCodeFailed:"Failed to copy code",appliedModelAllTiers:"Applied model to all tiers",settingsSaved:"Settings saved",defaultTargetUpdated:"Default target updated",failedUpdateDefaultTarget:"Failed to update default target to {{target}}{{suffix}}"},profileDialog:{editTitle:"Edit Profile",createTitle:"Create API Profile",name:"Name",namePlaceholder:"my-api",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com",apiKey:"API Key",defaultModel:"Default Model (ANTHROPIC_MODEL)",defaultModelHint:"Leave blank to use: {{model}}",modelMappingTitle:"Model Mapping (Opus/Sonnet/Haiku)",modelMappingDesc:"Configure different model IDs for each tier. Useful for API proxies that route different model types to different backends.",opusModel:"Opus Model (ANTHROPIC_DEFAULT_OPUS_MODEL)",sonnetModel:"Sonnet Model (ANTHROPIC_DEFAULT_SONNET_MODEL)",haikuModel:"Haiku Model (ANTHROPIC_DEFAULT_HAIKU_MODEL)",cancel:"Cancel",saving:"Saving...",update:"Update",create:"Create"},modelTierMapping:{title:"Model Tier Mapping",advanced:"Advanced",description:"Configure different models for Claude Code's opus/sonnet/haiku tiers.",autoSuggest:"Auto-suggest based on {{provider}}",opusPlaceholder:"e.g., anthropic/claude-opus-4",sonnetPlaceholder:"e.g., anthropic/claude-sonnet-4",haikuPlaceholder:"e.g., anthropic/claude-3.5-haiku",footer:"These set ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL."},envEditor:{sensitive:"sensitive",none:"No environment variables configured.",noneHint:"Add variables using the input below or edit the JSON directly.",addVariable:"Add Environment Variable",keyPlaceholder:"VARIABLE_NAME",valuePlaceholder:"value"},setupVariant:{using:"Using:",variantNameRequired:"Variant Name *",variantNamePlaceholder:"e.g., my-gemini, g3, flash",invokeHintPrefix:"Use this name to invoke:",model:"Model",modelPlaceholder:"e.g., gemini-2.5-pro, claude-opus-4-6-thinking",choosePresetInstead:"Choose from presets instead",selectModel:"Select a model",customModelName:"Custom model name...",enterAnyModel:"Enter any model name supported by CLIProxy",defaultModel:"Default: {{model}}",providerDefault:"provider default",back:"Back",skip:"Skip",creating:"Creating...",createVariant:"Create Variant",skipHint:"Skip if you just wanted to add an account without creating a variant"},customPresetDialog:{title:"Custom Preset",presetNameOptional:"Preset Name (optional)",presetNamePlaceholder:"e.g., My Custom Config",codexTipPrefix:"Codex tip: suffixes",codexTipSuffix:"pin effort. Unsuffixed models use Thinking settings.",defaultModel:"Default Model",defaultModelDesc:"Used when no specific tier is requested",opusModel:"Opus (Most capable)",opusModelDesc:"For complex reasoning tasks",sonnetModel:"Sonnet (Balanced)",sonnetModelDesc:"Balance of speed and capability",haikuModel:"Haiku (Fast)",haikuModelDesc:"Quick responses for simple tasks",cancel:"Cancel",savePreset:"Save Preset",applyPreset:"Apply Preset"},componentModelSelector:{selectModel:"Select model",availableModelsCount:"Available Models ({{count}})",preview:"Preview"},searchableSelect:{searchModels:"Search models...",noResults:"No results found."},copilotSettings:{enableCopilot:"Enable Copilot",enableCopilotDesc:"Allow using GitHub Copilot subscription",basicSettings:"Basic Settings",accountType:"Account Type",accountTypeIndividual:"Individual",accountTypeBusiness:"Business",accountTypeEnterprise:"Enterprise",rateLimiting:"Rate Limiting",rateLimitSeconds:"Rate Limit (seconds)",noLimit:"No limit",waitOnRateLimit:"Wait on Rate Limit",waitOnRateLimitDesc:"Wait instead of error when limit hit",daemonSettings:"Daemon Settings",autoStartDaemon:"Auto-start Daemon",autoStartDaemonDesc:"Start copilot-api when using profile"},providerModelSelector:{selectModel:"Select model",noModelsForProvider:"No models available for this provider",broken:"BROKEN",deprecated:"DEPRECATED",paid:"PAID",freeTier:"Free Tier",paidTier:"Paid Tier",modelKnownIssues:"This model has known issues",viewIssueDetails:"View issue details",modelDeprecated:"This model is deprecated",recommended:"Recommended",allModelsCount:"All Models ({{count}})",noModelsAvailable:"No models available"},createAuthProfileDialog:{title:"Create New Account",description:"Auth profiles require Claude CLI login. Run the command below in your terminal. You can edit sync mode, group, and continuity depth later from the Accounts table.",profileName:"Profile Name",profileNamePlaceholder:"e.g., work, personal, client",invalidProfileName:"Name must start with a letter and contain only letters, numbers, dashes, or underscores.",enableSharedHistory:"Enable shared history sync with other ccs auth accounts",historySyncGroupOptional:"History Sync Group (optional)",historySyncGroupPlaceholder:"default, sprint-a, client-x",historySyncGroupHint:"Leave empty to use the default shared group. Spaces are normalized to dashes.",deeperContinuity:"Advanced: deeper continuity mode",deeperContinuityHint:"Adds sync for session-env, file-history, shell-snapshots, and todos. Credentials stay isolated.",invalidContextGroup:"Group must start with a letter and use only letters, numbers, dashes, or underscores (max {{max}} chars).",command:"Command",commandFallback:"ccs auth create <name>",afterRunPrefix:"After running the command:",afterRunStep1:"Complete the Claude login in your browser",afterRunStep2:"Return here and refresh to see the new account",poolingHint:"Prefer pooled Claude OAuth routing instead? Use CLIProxy Claude pool from the Accounts page action button.",close:"Close",copied:"Copied!",copyCommand:"Copy Command"},cliproxyModelCategory:{google:"Google (Gemini)",openai:"OpenAI (GPT)",anthropic:"Anthropic (Claude)",antigravity:"Antigravity",other:"Other"},cliproxyOverviewComponents:{availableModels:"Available Models",noModelsAvailable:"No models available",startSessionHint:"Start a CLIProxy session to fetch available models",totalCount:"{{count}} total",availableThroughGroupedByProvider:"Models available through {{backendLabel}}, grouped by provider",moreCount:"+{{count}} more"},categorizedModelSelector:{selectModel:"Select a model",noModelsAvailable:"No models available",modelPlaceholder:"Model..."},openrouterQuickStart:{recommended:"Recommended",title:"Start with OpenRouter",description:"Access {{modelCountLabel}} models from OpenAI, Anthropic, Google, Meta and more - all through one API.",featureOneApi:"One API, all providers",featureTierMapping:"Model tier mapping",profileCount:"{{count}} profile",profileCount_other:"{{count}} profiles",selectProfileTitle:"Select an API profile",summaryDescriptionWithProfiles:"You already have {{count}} profile in this workspace. Select one from the left rail to edit it, or create another profile from here.",summaryDescriptionWithProfiles_other:"You already have {{count}} profiles in this workspace. Select one from the left rail to edit it, or create another profile from here.",summaryDescriptionNoProfiles:"Use API Profiles for Anthropic-compatible endpoints. Use AI Providers for Gemini, Codex, Claude, Vertex, and OpenAI-compatible connectors.",openrouterModelsBadge:"{{modelCountLabel}} OpenRouter models",runtimeProviderBadge:"Runtime provider setup",runtimeProviderTitle:"Open AI Providers",runtimeProviderDescription:"Manage shared provider keys and runtime connectors before creating standalone API Profiles.",runtimeProviderFeatureConnectors:"Gemini, Codex, Claude, Vertex, and OpenAI-compatible connectors",runtimeProviderFeatureSecrets:"Shared secrets stay outside individual API profiles",runtimeProviderFooter:"Best when multiple profiles should share one provider configuration.",createOpenRouterProfile:"Create OpenRouter Profile",getApiKeyAt:"Get your API key at",or:"or",createCustomProfile:"Create Custom API Profile"},alibabaCodingPlanQuickStart:{recommended:"Recommended",title:"Try Alibaba Coding Plan",description:"Use Alibaba Cloud Coding Plan through an Anthropic-compatible endpoint for coding workloads.",featureEndpoint:"Anthropic-compatible endpoint",featureKeyFormat:"Dedicated sk-sp API keys",createAlibabaProfile:"Create Alibaba Coding Plan Profile",readGuideAt:"Read setup guide at"},alibabaCodingPlanPromo:{title:"Alibaba Coding Plan",subtitle:"Model Studio Coding Plan via Anthropic endpoint",add:"Add"},credentialHealth:{title:"Credential Health",ready:"Ready",noCredentialsConfigured:"No credentials configured. Use the login buttons above to authenticate.",neverUsed:"Never used",justNow:"Just now",unknown:"Unknown",daysAgo:"{{count}}d ago",hoursAgo:"{{count}}h ago",minutesAgo:"{{count}}m ago"},proxyStatusWidget:{justNow:"just now",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",syncReady:"Sync Ready",noConfig:"No Config",remoteProxy:"Remote Proxy",active:"Active",trafficAutoRouted:"Traffic auto-routed to remote server",tooltipSync:"Sync profiles to CLIProxy",tooltipRestart:"Restart",tooltipStop:"Stop",tooltipClose:"Close",tooltipVersionSettings:"Version settings",versionManagement:"Version Management",selectVersionPlaceholder:"Select version to install...",stable:"(stable)",install:"Install",versionsAboveUnstable:"Versions above {{version}} have known issues",versionsKnownIssues:"Version {{version}} has known issues",lastChecked:"Last checked {{time}}",notRunning:"Not running",start:"Start",port:"Port {{port}}",sessionCount:"{{count}} session",sessionCount_other:"{{count}} sessions",installFaultyTitle:"Install Version With Known Issues?",installFaultyDesc:"You are about to install <strong>v{{version}}</strong>, which falls inside the known faulty range <strong>{{range}}</strong>.",installFaultyWarning:"This version has known bugs and may fail or leave the proxy in a bad state.",installUnstableTitle:"Install Unstable Version?",installUnstableDesc:"You are about to install <strong>v{{version}}</strong>, which is above the maximum stable version <strong>v{{maxStable}}</strong>.",installUnstableWarning:"This version has known stability issues and may cause unexpected behavior.",installUnstableConfirm:"Are you sure you want to proceed?",cancel:"Cancel",installAnyway:"Install Anyway",clickToDowngrade:"Click to downgrade",clickToUpdate:"Click to update"},syncStatusCard:{profileSync:"Profile Sync",ready:"Ready",noConfig:"No Config",syncsProfilesDesc:"Syncs API profiles to local CLIProxy config",runDoctorHint:"Run <code>ccs doctor --fix</code> to generate config.",details:"Details",syncNow:"Sync Now"},syncDialog:{title:"Sync Profiles to Local CLIProxy",description:"Sync your CCS API profiles to the local CLIProxy config.yaml.",noProfiles:"No profiles configured to sync.",createProfilesFirst:"Create API profiles first using the Profiles tab.",modelLabel:"Model:",ready:"Ready",profilesToSync_one:"{{count}} profile to sync",profilesToSync_other:"{{count}} profiles to sync",cancel:"Cancel",syncing:"Syncing...",synced:"Synced!",syncNow:"Sync Now"},errorLogs:{title:"Error Logs",failedRequests_one:"{{count}} failed request",failedRequests_other:"{{count}} failed requests",cliproxyDiagnostics:"CLIProxy Diagnostics",showingCount:"Showing 50 of {{total}} logs",selectLog:"Select a log to view details",failedLoadContent:"Failed to load log content",copyAbsolutePath:"Copy absolute path",copyRawContent:"Copy raw log content",tabOverview:"Overview",tabHeaders:"Headers",tabRequest:"Request",tabResponse:"Response",tabRaw:"Raw",modelLabel:"Model:",quotaResetsIn:"Quota resets in ",method:"Method",provider:"Provider",version:"Version",endpoint:"Endpoint",url:"URL",timestamp:"Timestamp",na:"N/A",noHeaders:"No headers available",noRequestBody:"No request body",noResponseBody:"No response body",rateLimitedMsg:"Rate Limited. Switch to a different account or wait for quota reset. Model {{model}} has exhausted quota.",rateLimitedMsgNoModel:"Rate Limited. Switch to a different account or wait for quota reset.",authFailedMsg:"Authentication failed. Re-authenticate via CLIProxy Settings or check API key.",notFoundMsg:"Endpoint not found. This endpoint may not exist on this provider.",serverErrorMsg:"Server error from upstream. Retry later or check provider status page.",timeoutMsg:"Request timed out. Check network connection or increase timeout settings.",unknown:"unknown"},editAccountContext:{title:"Edit History Sync",description:'Configure how "{{name}}" shares history and continuity with other ccs auth accounts.',syncMode:"Sync Mode",selectContextMode:"Select context mode",isolatedOption:"isolated (no sync)",sharedOption:"shared (sync enabled)",sharedModeHint:"Shared mode reuses workspace context for accounts in the same history sync group.",isolatedModeHint:"Isolated mode keeps this account fully separate from other ccs auth accounts.",historySyncGroup:"History Sync Group",groupPlaceholder:"default",groupHint:"Normalized to lowercase (spaces become dashes). Allowed: letters, numbers, _ , - (max {{max}} chars).",invalidGroup:"Enter a valid group name that starts with a letter.",continuityDepth:"Continuity Depth",selectContinuityDepth:"Select continuity depth",standardOption:"standard (projects only)",deeperOption:"deeper continuity (advanced)",deeperHint:"Advanced mode also syncs session-env, file-history, shell-snapshots, and todos.",standardHint:"Standard mode syncs project workspace context only.",credentialsIsolated:"Credentials and .anthropic remain isolated per account in all modes.",cancel:"Cancel",save:"Save",saving:"Saving..."},historySyncLearningMap:{title:"How History Sync Works",description:"Isolated -> Shared -> Deeper. Use Sync per row for all changes.",learningMap:"Learning Map",isolated:"Isolated",shared:"Shared",deeper:"Deeper",cliproxyManaged_one:"{{count}} CLIProxy Claude pool account is managed in Action Center / CLIProxy page.",cliproxyManaged_other:"{{count}} CLIProxy Claude pool accounts are managed in Action Center / CLIProxy page.",showDetails:"Show details: groups, switching, and legacy policy",modeSwitch:"Mode Switch",modeSwitchDesc:"Sync dialog lets users move between isolated/shared and choose deeper continuity.",historySyncGroup:"History Sync Group",historySyncGroupDesc:"Same group means shared project context lane. Default fallback is default.",legacyConfirmation_one:"{{count}} legacy account still needs explicit confirmation.",legacyConfirmation_other:"{{count}} legacy accounts still need explicit confirmation."},accountsTable:{name:"Name",type:"Type",defaultBadge:"default",created:"Created",lastUsed:"Last Used",historySync:"History Sync",actions:"Actions",syncTitle:"Edit sync mode, group, and continuity depth",confirmLegacyTitle:"Confirm this legacy account's current mode as explicit",sync:"Sync",confirm:"Confirm",active:"Active",setDefault:"Set Default",deleteAccount:"Delete account",cannotDeleteDefault:"Cannot delete default account",noAccounts:"No CCS auth accounts found. Use ccs auth create to add accounts.",resetToDefault:"Reset to CCS Default",deleteDialogTitle:"Delete Account",deleteDialogDesc:'Are you sure you want to delete the account "{{name}}"? This will remove the profile and all its session data. This action cannot be undone.',cancel:"Cancel",delete:"Delete",sharedGroupStandard:"shared ({{group}}, standard)",sharedGroupDeeper:"shared ({{group}}, deeper)",sharedGroupLegacy:"shared ({{group}}, standard legacy)",isolatedLegacy:"isolated (legacy default)",isolated:"isolated"},addAccountDialog:{title:"Add {{displayName}} Account",descKiro:"Choose a Kiro auth method, then authenticate via browser or import from Kiro IDE.",descDeviceCode:"Click Authenticate. A verification code will appear for you to enter on the provider website.",descOauth:"Click Authenticate to get an OAuth URL. Open it in any browser to sign in.",powerUserEnabled:"Power user mode enabled",powerUserSkipped:"Settings > Proxy power user mode is skipping the AGY responsibility checklist and Gemini dashboard risk phrase. You accept full responsibility for OAuth/account risk.",powerUserLoadFailed:"Failed to load power user mode settings. Check Settings > Proxy and try again.",powerUserLoading:"Loading power user safety settings. Please wait a moment and retry.",powerUserUnavailableRetry:"Power user mode is unavailable. Complete the required provider safety step and retry.",authMethod:"Auth Method",selectKiroAuthMethod:"Select Kiro auth method",nicknameRequired:"Nickname (required)",nicknameOptional:"Nickname (optional)",nicknamePlaceholder:"e.g., work, personal",nicknameRequiredHint:"Required for this provider. Use a unique friendly name (e.g., work, personal).",nicknameOptionalHint:"A friendly name to identify this account. Leave blank to use a safe generated identifier.",waitingForAuth:"Waiting for authentication...",deviceCodeHint:"A verification code dialog will appear shortly. Enter the code on the provider website.",browserHint:"Complete the authentication in your browser. This dialog closes automatically.",openUrlLabel:"Open this URL in any browser to sign in:",copied:"Copied",copy:"Copy",open:"Open",popupBlocked:"Popup blocked. Copy the URL above and open it manually in your browser.",redirectPasteLabel:"Redirect didn't work? Paste the callback URL:",callbackPlaceholder:"Paste the redirect URL here...",submitCallback:"Submit Callback",submitting:"Submitting...",preparingUrl:"Preparing sign-in URL...",cancel:"Cancel",importingToken:"Importing token from Kiro IDE...",authenticate:"Authenticate",importFromIde:"Import from IDE",importing:"Importing..."},flowViz:{backToProviders:"Back to providers",showDetails:"Show Details",hideDetails:"Hide Details",resetLayout:"Reset layout",provider:"Provider",totalRequests:"Total Requests",accounts:"Accounts",connectionTimeline:"Connection Timeline",noRecentConnections:"No recent connections"},quickStats:{totalRequests:"Total Requests",successRate:"Success Rate",totalTokens:"Total Tokens",activeModels:"Active Models"},authMonitor:{accounts:"Accounts",accountsCount:"{{count}} accounts",success:"Success",failed:"Failed",successRate:"Success Rate"},accountCard:{resumeAccount:"Resume account",pauseAccount:"Pause account",quotaLoading:"Quota...",quota:"Quota",quotaUnavailable:"Quota limits unavailable",reauthNeeded:"Reauth needed",failureLabelReauth:"Reauth",failureLabelWorkspace:"Workspace",failureLabelNoAccess:"No Access",failureLabelRetry:"Retry",failureLabelReconnect:"Reconnect",failureLabelTemporary:"Temporary",failureLabelUnavailable:"Unavailable",failureHintReauth:"Refresh this account by running its auth flow again.",failureHintWorkspace:"Move this account back to an active workspace, then remove and re-add it.",failureHintNoAccess:"This account cannot access the provider quota endpoint.",failureHintRetry:"Wait a bit, then retry the quota request.",failureHintReconnect:"Remove the stale account and authenticate it again.",failureHintTemporary:"Retry later. This looks temporary.",removeAndReadd:"Remove and re-add account",autoRefreshFailed:"Auto-refresh failed"},antigravityChecklist:{title:"Antigravity OAuth Responsibility",subtitle:"Complete all 4 steps before you can authenticate.",mandatory:"Mandatory",completion:"Completion",stepsCount:"{{current}}/4 steps"},accountSafetyWarning:{title:"OAuth Account Safety Warning",subtitle:"Issue #509 · Gemini + AGY OAuth risk",firstLine:"Issue #509 documents suspension/ban reports tied to ccs agy and shared-account usage between ccs gemini and ccs agy.",secondLine:"Continue only if you accept full responsibility for OAuth and account-access risk.",issueLabel:"Read issue #509",proxySettingsLabel:"Gemini + AGY controls: Settings > Proxy"},cliproxyDialog:{name:"Name",provider:"Provider",account:"Account",accountOptional:"Account (optional)",model:"Model",modelOptional:"Model (optional)",defaultTarget:"Default Target",defaultTier:"Default Tier",tierConfig:"Tier Configuration",selectProvider:"Select provider...",useDefaultAccount:"Use default account",defaultSuffix:"(default)",opus:"Opus",sonnet:"Sonnet",haiku:"Haiku",claudeCode:"Claude Code",factoryDroid:"Factory Droid",cancel:"Cancel",create:"Create",creating:"Creating...",saveChanges:"Save Changes",saving:"Saving...",placeholderName:"my-gemini",placeholderModel:"gemini-2.5-pro",placeholderComposite:"my-composite",placeholderModelId:"model-id",placeholderAccountId:"account-id",editCompositeTitle:"Edit Composite Variant: {{name}}",editSingleTitle:"Edit Single Variant: {{name}}"},profileEditor:{profileInfo:"Profile Information",profileName:"Profile Name",filePath:"File Path",lastModified:"Last Modified",defaultTarget:"Default Target",quickUsage:"Quick Usage",runWithProfile:"Run with profile",runOnDroid:"Run on Droid",runOnDroidWithFlag:"Run on Droid (--target)",droidAliasExplicit:"Droid alias (explicit)",overrideToClaude:"Override to Claude",overrideToClaudeExplicit:"Override to Claude (explicit)",targetHintPreferredAlias:"Preferred explicit alias:",targetHintClaudeDefault:"Default command:",targetHintLegacyAlias:"Legacy shortcut still works:",targetHintOverride:"You can still override each run with",setAsDefault:"Set as default",provider:"Provider",custom:"Custom",providerChooserHint:"Start with a preset, then adjust the URL, API key, or model mapping as needed.",featuredProviders:"Featured Providers",scrollHint:"Scroll if your screen is narrow",customEndpoint:"Custom Endpoint",morePresets:"More Presets",customEndpointDescription:"Start from a blank Anthropic-compatible URL and configure everything manually."},settings:{sectionLoadFailed:"Failed to load section",unknownError:"Unknown error occurred",reloadPage:"Reload page",refresh:"Refresh",copy:"Copy",copied:"Copied",saved:"Saved",loading:"Loading...",configFileNotFound:"Config file not found"},settingsTabs:{web:"Web",env:"Env",think:"Think",proxy:"Proxy",auth:"Auth",backup:"Backup"},settingsAuth:{failedFetchTokens:"Failed to fetch auth tokens",failedSaveTokens:"Failed to save tokens",tokensUpdated:"Tokens updated. Restart CLIProxy to apply.",failedRegenerate:"Failed to regenerate secret",secretRegenerated:"New management secret generated. Restart CLIProxy to apply.",failedReset:"Failed to reset tokens",tokensReset:"Tokens reset to defaults. Restart CLIProxy to apply.",description:"Configure CLIProxy authentication tokens. Changes require CLIProxy restart.",apiKey:"API Key",custom:"Custom",apiKeyDesc:"Used by Claude Code to authenticate with CLIProxy",apiKeyPlaceholder:"API key",managementSecret:"Management Secret",managementSecretDesc:"Used by CCS dashboard to access CLIProxy management APIs",managementSecretPlaceholder:"Management secret",generateSecret:"Generate new secure secret",resetDefaults:"Reset to Defaults",resetDesc:"Resets both API key and management secret to their default values.",saving:"Saving...",save:"Save"},settingsGlobalEnv:{description:"Environment variables injected into all non-Claude subscription profiles (gemini, codex, agy, ghcp, etc.)",enabled:"Global Env enabled",disabled:"Global Env disabled",enabledDesc:"Env vars will be injected into third-party profiles",disabledDesc:"Env vars will not be injected",envVars:"Environment Variables",noneConfigured:"No environment variables configured",addNew:"Add New Variable",keyName:"KEY_NAME",value:"value",add:"Add",quickAdd:"Quick Add Common Variables",allConfigured:"All common variables are configured"},settingsBackups:{failedFetch:"Failed to fetch backups",failedRestore:"Failed to restore backup",restoreSuccess:"Backup restored successfully",title:"Settings Backups",description:"Restore previous versions of your settings.json file. Backups are created automatically when settings are modified.",none:"No backups available",noneHint:"Backups will appear here when you modify settings",latest:"Latest",restoring:"Restoring...",restore:"Restore",restoreConfirmTitle:"Restore Backup?",restoreConfirmPrefix:"This will replace your current settings with backup from",restoreConfirmSuffix:"This action cannot be undone.",cancel:"Cancel"},settingsWebsearch:{description:"CLI-based web search for third-party profiles (gemini, codex, agy, etc.)",enabled:"WebSearch enabled",disabled:"WebSearch disabled",checking:"Checking status...",providers:"Providers",noneConfigured:"No providers configured",noneConfiguredHint:"Install CLI tools to enable web search providers",checkProviders:"Check for providers",installed:"installed",notInstalled:"not installed",model:"Model:",howInstall:"How to install {{name}} CLI",installGlobally:"Install globally",requiresKey:"(requires xAI API key)",freeTier:"(FREE tier available)",viewDocs:"View documentation"},settingsProxy:{failedLoadAgyMode:"Failed to load power user mode",failedUpdateAgyMode:"Failed to update power user mode",failedVerifyAgyMode:"Failed to verify power user mode persistence",notPersistedAgyMode:"Power user mode was not persisted. Config may have been modified by another process.",agyModeEnabled:"Power user mode enabled.",agyModeDisabled:"Power user mode disabled.",typePhraseToContinue:'Type "{{value}}" to continue.',description:"Configure local or remote {{backend}} connection for proxy-based profiles",backendPlus:"CLIProxy Plus",backend:"CLIProxy",instanceStatus:"Instance Status",connectionMode:"Connection Mode",local:"Local",remote:"Remote",localDesc:"Run {{backend}} binary on this machine",remoteDesc:"Connect to a remote {{backend}} server",backendBinary:"Backend Binary",stopProxyToSwitch:"Stop the running proxy in Instance Status to switch backend.",default:"Default",plusDesc:"Full provider support including Kiro and GitHub Copilot",originalDesc:"Original binary (Gemini, Codex, Antigravity only)",variantsIncompatible:"Existing Kiro/Copilot variants will not work with CLIProxyAPI. Switch to CLIProxyAPIPlus or remove those variants.",safety:"Safety",agyModeTitle:"Antigravity + Gemini Power User Mode",agyModeDesc:"Skip the AGY responsibility checklist and the Gemini dashboard typed acknowledgement.",agyWarning:"Use only if you fully understand the OAuth suspension/ban risk pattern (#509). CCS cannot assume responsibility for account loss.",finalConfirm:"Final confirmation required",finalConfirmDesc:"Enabling this will skip AGY safety checkpoints and the Gemini dashboard risk phrase gate. Review issue #509 and type the exact phrase to proceed.",step1:"Step 1",readIssue:"Read issue #509",step2:"Step 2",typePrefix:"Type",typeSuffix:"to enable.",typePhraseAria:"Type I ACCEPT RISK to enable Antigravity + Gemini power user mode",exactPhrase:"Exact phrase required.",enableAgyMode:"Enable Antigravity + Gemini Power User Mode",toggleAgyMode:"Toggle Antigravity + Gemini power user mode",fallbackSettings:"Fallback Settings",enableFallback:"Enable fallback to local",enableFallbackDesc:"Use local proxy if remote is unreachable",autoStartLocal:"Auto-start local proxy",autoStartLocalDesc:"Automatically start local proxy on fallback",advanced:"Advanced",debugMode:"Debug Mode",debugModeDesc:"Enable developer diagnostics in browser console",debugModeEnabled:"Debug mode enabled. Check browser console for detailed logs.",localProxy:"Local Proxy",port:"Port",autoStart:"Auto-start",localAutoStartDesc:"Start local proxy automatically when needed",remoteConfigTitle:"Remote Server Configuration",host:"Host",hostPlaceholder:"192.168.1.100 or proxy.example.com",defaultPort:"default: {{value}}",portPlaceholder:"Leave empty for {{value}}",protocol:"Protocol",http:"HTTP",https:"HTTPS",apiKeyOptional:"API Key (optional)",apiKeyPlaceholder:"For /v1/* API endpoints",apiKeyDesc:"Used for API requests to /v1/chat/completions",managementKeyOptional:"Management Key (optional)",managementKeyPlaceholder:"For /v0/management/* endpoints",managementKeyDesc:"Used for dashboard management APIs. Falls back to API Key if not set.",testing:"Testing...",testConnection:"Test Connection",connectedLatency:"Connected ({{value}}ms)",connectionFailed:"Connection failed",invalidPortOrEmpty:"Port must be an integer between 1 and 65535, or empty for default",invalidLocalPort:"Local port must be an integer between 1 and 65535",backendPlusApi:"CLIProxyAPIPlus",backendApi:"CLIProxyAPI"},settingsThinking:{description:"Configure extended thinking/reasoning for supported models.",supportedProviders:"Supported Providers",modeTitle:"Thinking Mode",modeAutoDesc:"Automatically set thinking based on model tier",modeOffDesc:"Disable extended thinking",modeManualDesc:"Set a persistent override level or use CLI flags per run",tierDefaults:"Tier Defaults",tierDefaultsDesc:"Default thinking level for each model tier when in auto mode.",persistentOverride:"Persistent Override",persistentOverrideDesc:"Applied to all sessions. CLI flags still take priority.",enterCustomBudget:"Enter custom budget",apply:"Apply",providerOverrides:"Provider Overrides ({{count}})",providerOverridesDesc:"Override tier defaults for specific providers. Add custom provider keys as needed.",addProviderPlaceholder:"Add provider key (e.g. qwen)",showWarnings:"Show Warnings",showWarningsDesc:"Display warnings when thinking values are clamped or adjusted",cliEnvOverride:"CLI & Env Override",supportLine1Prefix:"Thinking budget:",supportLine1Suffix:"(token-based)",supportLine2Prefix:"Reasoning effort:",supportLine2SuffixPrefix:"(suffix or ",supportLine2SuffixPostfix:": minimal/low/medium/high/xhigh)",supportLine3Prefix:"Codex suffixes pin effort (for example ",supportLine3Suffix:"); unsuffixed models use Thinking mode."},analytics:{title:"Analytics",subtitle:"Track usage and insights",month:"Month",allTime:"All Time",updated:"Updated {{value}}"},analyticsSummary:{totalTokens:"Total Tokens",totalTokensSubtitle:"{{input}} in / {{output}} out",totalCost:"Total Cost",totalCostSubtitle:"${{value}}/day avg",cacheTokens:"Cache Tokens",cacheTokensSubtitle:"${{cost}} ({{percent}}% of cost)",inputCost:"Input Cost",outputCost:"Output Cost",tokensSubtitle:"{{value}} tokens"},apiProfiles:{title:"API Profiles",new:"New",searchPlaceholder:"Search profiles...",loadingProfiles:"Loading profiles...",failedLoadTitle:"Failed to load profiles",failedLoadDesc:"Unable to fetch API profiles. Please try again.",retry:"Retry",noProfilesYet:"No API profiles yet",noProfilesDesc:"Create your first profile to connect to custom API endpoints",createProfile:"Create Profile",noProfileMatch:'No profiles match "{{query}}"',profileCount:"{{count}} profile",profileCount_other:"{{count}} profiles",configuredCount:"{{count}} configured",deleteProfileTitle:"Delete Profile",deleteProfileDesc:'Are you sure you want to delete "{{name}}"? This will remove the settings file and cannot be undone.',delete:"Delete",unsavedChangesTitle:"Unsaved Changes",unsavedChangesDesc:'You have unsaved changes in "{{current}}". Discard and switch to "{{next}}"?',discardSwitch:"Discard and Switch"},accountsPage:{title:"Accounts",managePrefix:"Manage",manageSuffix:"accounts and pool onboarding from one panel.",mobileManageSuffix:"continuity per account.",primaryActions:"Primary Actions",createAccount:"Create Account",authClaudeInPool:"Authenticate Claude in Pool",openClaudePoolSettings:"Open Claude Pool Settings",openCliProxyClaudePool:"Open CLIProxy Claude Pool",migrationFollowup:"Migration Follow-up",legacyContextPending:"{{count}} account still needs first-time mode confirmation.",legacyContextPending_other:"{{count}} accounts still need first-time mode confirmation.",legacyContinuityPending:"{{count}} shared account remains on standard legacy continuity depth.",legacyContinuityPending_other:"{{count}} shared accounts remain on standard legacy continuity depth.",confirmingLegacy:"Confirming Legacy Policies...",confirmLegacy:"Confirm Legacy Policies ({{count}})",noLegacyFollowup:"No legacy follow-up pending.",continuityGuide:"Continuity Guide",expandWhenNeeded:"Expand only when needed.",sharedStandard:"Shared Standard",sharedStandardDesc:"Project workspace sync only. Best default for most teams.",sharedDeeper:"Shared Deeper",sharedDeeperPrefix:"Adds",isolated:"Isolated",isolatedDesc:"No link. Best for strict separation.",quickCommands:"Quick Commands",quickCommandsDesc:"Copy and run in terminal.",workspaceBadge:"ccs auth Workspace",historySyncBadge:"History Sync Controls",authAccounts:"Auth Accounts",tableScopePrefix:"This table is intentionally scoped to",tableScopeMiddle:"accounts. Use",tableScopeSuffix:"for mode/group/depth changes.",accountMatrix:"Account Matrix",sharedTotalDesc:"Shared total: {{count}}. Actions include Sync settings and legacy confirmation.",loadingAccounts:"Loading accounts..."},health:{justNow:"just now",secondsAgo:"{{count}}s ago",minutesAgo:"{{count}}m ago",hoursAgo:"{{count}}h ago",systemHealth:"System Health",build:"build {{version}}",lastScan:"Last scan:",autoRefresh:"Auto-refresh:",refresh:"Refresh",checks:"Checks",version:"Version",platform:"Platform",liveMonitoring:"Live monitoring active",copied:"Copied to clipboard",refreshing:"Refreshing health checks...",fix:"Fix",applyFix:"Apply Fix",healthLabel:"health"},updates:{actionRequired:"Action Required",done:"Done",all:"All",inboxTitle:"Updates Center",inboxSubtitle:"Focus on actions, then mark updates done or dismissed.",needsAction:"Needs Action",doneCount:"Done",searchPlaceholder:"Search actions or commands",noNotices:"No notices match this view.",noUpdates:"No updates available.",published:"Published {{date}}",markDone:"Mark done",dismiss:"Dismiss",reopen:"Reopen",doNext:"Do Next",impactedIntegrations:"Impacted Integrations",impactedDesc:"Related areas based on update scope and routing.",whyMatters:"Why It Matters",whyMattersDesc:"Short context only, no wall-of-text release notes.",open:"Open",progressNeedsAction:"Needs Action",progressInReview:"In Review",progressDone:"Done",progressDismissed:"Dismissed",statusNew:"New",statusStable:"Stable",statusPlanned:"Planned",dashboard:"Dashboard",cliUsage:"CLI Usage"},cliproxyPage:{connected:"Connected",notConnected:"Not connected",variant:"variant",parentNotConnected:"Parent not connected",viaProvider:"via {{provider}}",emptyTitle:"CCS Profile Manager",emptyDesc:"Manage OAuth authentication, account preferences, and model selection for CLIProxy providers. Configure how CCS routes requests to different AI backends.",emptyControlPanelPrefix:"For live usage stats and real-time monitoring, visit the",controlPanel:"Control Panel",quickSetup:"Quick Setup",accountManagement:"CCS-level account management",providers:"Providers",variants:"Variants",providerCount:"{{count}} provider",providerCount_other:"{{count}} providers",connectedCount:"{{count}} connected",variantDisplay:"{{name}} ({{provider}} variant)"},copilotPage:{title:"Copilot",subtitle:"GitHub Copilot proxy",setup:"Setup",auth:"Auth",daemon:"Daemon",unofficialTitle:"Unofficial API - Use at Your Own Risk",unofficialItem1:"Reverse-engineered API - may break anytime",unofficialItem2:"Excessive use may trigger account restrictions",unofficialItem3:"No warranty, no responsibility from CCS",yes:"Yes",no:"No",installed:"Installed",missing:"Missing",integration:"Integration",enabled:"Enabled",disabled:"Disabled",github:"GitHub",connected:"Connected",notConnected:"Not Connected",authenticate:"Authenticate",authenticating:"Authenticating...",status:"Status",running:"Running",stopped:"Stopped",port:"Port",stopping:"Stopping...",stop:"Stop",starting:"Starting...",start:"Start",installing:"Installing...",installCopilotApi:"Install copilot-api",proxy:"Proxy",active:"Active",inactive:"Inactive"},cursorPage:{title:"Cursor",beta:"Beta",subtitle:"Dedicated Cursor integration controls",unofficialTitle:"Unofficial API - Use at Your Own Risk",unofficialItem1:"Reverse-engineered integration may break anytime",unofficialItem2:"Abuse or excessive usage may risk account restrictions",unofficialItem3:"No warranty, no responsibility from CCS",integration:"Integration",authentication:"Authentication",daemon:"Daemon",enabled:"Enabled",disabled:"Disabled",expired:"Expired",connected:"Connected",notConnected:"Not connected",running:"Running",stopped:"Stopped",actions:"Actions",disableIntegration:"Disable Integration",enableIntegration:"Enable Integration",autoDetectAuth:"Auto-detect Auth",manualAuthImport:"Manual Auth Import",stopDaemon:"Stop Daemon",startDaemon:"Start Daemon",port:"Port",configuration:"Cursor Configuration",lastModified:"Last modified:",neverSaved:"Never saved",saving:"Saving...",save:"Save",modelConfig:"Model Config",settings:"Settings",info:"Info",presets:"Presets",presetsDesc:"Apply pre-configured model mappings",modelMapping:"Model Mapping",modelMappingDesc:"Configure which models to use for each tier",defaultModel:"Default Model",defaultModelDesc:"Used when no specific tier is requested.",opusModel:"Opus (Most capable)",opusModelDesc:"Complex reasoning and highest quality responses.",sonnetModel:"Sonnet (Balanced)",sonnetModelDesc:"General coding and day-to-day chat workloads.",haikuModel:"Haiku (Fast)",haikuModelDesc:"Low-latency and lightweight request paths.",runtimeSettings:"Runtime Settings",autoStartDaemon:"Auto-start Daemon",autoStartDesc:"Start Cursor daemon automatically when integration is used.",ghostMode:"Ghost Mode",ghostModeDesc:"Request x-ghost-mode to reduce telemetry.",provider:"Provider",filePath:"File Path",availableModels:"Available Models",loadingModels:"Loading models...",noModels:"No model metadata available yet. Start daemon and refresh.",default:"Default",rawConfiguration:"Raw Configuration (JSON)",manualImportTitle:"Manual Cursor Auth Import",manualImportDesc:"Provide Cursor access token and machine ID if auto-detect is unavailable.",accessToken:"Access Token",accessTokenPlaceholder:"Paste Cursor access token",machineId:"Machine ID",machineIdPlaceholder:"32-char hex (UUID without hyphens)",cancel:"Cancel",import:"Import",selectModel:"Select model",useDefaultModel:"Use Default Model",availableModelCount:"Available Models ({{count}})",invalidPort:"Port must be an integer between 1 and 65535",defaultModelRequired:"Default model is required",savedConfig:"Cursor config and model mapping saved",failedSaveConfig:"Failed to save config",modelsLoadingWait:"Models are still loading. Please wait before applying a preset.",noModelsAvailable:"No models available yet. Start the daemon and refresh first.",appliedCodexPreset:"Applied GPT-5.3 Codex preset",appliedClaudePreset:"Applied Claude 4.6 preset",appliedGeminiPreset:"Applied Gemini 3 preset",integrationEnabled:"Cursor integration enabled",integrationDisabled:"Cursor integration disabled",failedUpdateIntegration:"Failed to update integration state",credentialsImported:"Cursor credentials imported",autoDetectFailed:"Auto-detect failed",manualRequired:"Token and machine ID are required",manualImportFailed:"Manual import failed",failedStartDaemon:"Failed to start daemon",daemonStarted:"Daemon started",daemonStartedWithPid:"Daemon started (PID: {{pid}})",failedStopDaemon:"Failed to stop daemon",daemonStopped:"Daemon stopped",rawLoading:"Raw settings are still loading. Please wait and try again.",invalidJson:"Invalid JSON",rawSaved:"Raw settings saved",rawChanged:"Raw settings changed externally. Refresh and retry.",failedSaveRaw:"Failed to save raw settings",savedAll:"Cursor configuration saved"},droidPage:{loadingDiagnostics:"Loading Droid diagnostics...",failedDiagnostics:"Failed to load Droid diagnostics.",overview:"Overview",byok:"BYOK",docs:"Docs",runtimeInstall:"Runtime and Installation",status:"Status",detected:"Detected",notFound:"Not Found",detectionSource:"Detection source",binaryPath:"Binary path",installDirectory:"Install directory",version:"Version",overridePath:"Override (CCS_DROID_PATH)",configFiles:"Config Files",path:"Path",resolved:"Resolved",size:"Size",lastModified:"Last modified",parseWarning:"Parse warning: {{value}}",readWarning:"Read warning: {{value}}",warnings:"Warnings",byokSummary:"BYOK Summary",activeModelSelector:"Active model selector",customModels:"Custom models",ccsManaged:"CCS-managed",userManaged:"User-managed",malformedEntries:"Malformed entries",providers:"Providers",none:"none",customModelsTitle:"Custom Models",modelName:"Name / Model",provider:"Provider",baseUrl:"Base URL",noCustomModels:"No custom models",docsAlignedNotes:"Docs-Aligned Notes",factoryDocs:"Factory Docs",providerFactCheckDocs:"Provider Fact-Check Docs",providerValues:"Provider values: {{value}}",settingsHierarchy:"Settings hierarchy: {{value}}",settingsTitle:"Droid BYOK Settings",fixJsonBeforeQuickSettings:"Fix JSON syntax before using quick settings controls.",fixJsonBeforeReasoning:"Fix JSON syntax before updating BYOK reasoning settings.",unableUpdateReasoning:"Unable to update selected BYOK model reasoning setting.",fixJsonBeforeBudget:"Fix JSON syntax before updating thinking budget.",anthropicOnlyBudget:"Thinking budget is only available for Anthropic BYOK models.",invalidJson:"Invalid JSON: {{value}}",saved:"Droid settings saved",changedExternally:"Droid settings changed externally. Refresh and retry.",failedSave:"Failed to save Droid settings"},sharedPage:{commands:"Commands",skills:"Skills",agents:"Agents",title:"Shared Data",subtitle:"Commands, skills, and agents shared across Claude instances",totalShared:"Total Shared",visible:"Visible",markdownDetail:"Markdown detail view",filterPrefix:"Filter:",configurationRequired:"Configuration Required",countsUnavailable:"Counts unavailable",retryCounts:"Retry counts",filterPlaceholder:"Filter {{tab}} by name, description, or path",showing:"Showing {{visible}} of {{total}} {{tab}}",showingQuery:' for "{{query}}"',refreshing:" (refreshing...)",loadingShared:"Loading shared {{tab}}...",failedLoadShared:"Failed to load shared {{tab}}",retry:"Retry",noSharedFound:"No shared {{tab}} found. Run `ccs sync` or add items in your shared directory.",noMatch:'No {{tab}} match "{{query}}".',selectOne:"Select a {{tab}} to view full content.",pathLabel:"Path",resolvedSource:"Resolved Source",loadingMarkdown:"Loading markdown content...",failedLoadContent:"Failed to load content",retryContent:"Retry content",noMarkdown:"No markdown content available."}}},"zh-CN":{translation:{locale:{en:"English","zh-CN":"简体中文",vi:"越南语",ja:"日语"},layout:{languageSwitcher:"语言"},nav:{general:"通用",home:"首页",analytics:"分析",identityAccess:"身份与访问",apiProfiles:"API 配置",cliproxyPlus:"CLIProxy Plus",cliproxyOverview:"概览",controlPanel:"控制面板",githubCopilot:"GitHub Copilot",cursorIde:"Cursor IDE",claudeExtension:"Claude Extension",accounts:"账号",allAccounts:"全部账号",sharedData:"共享数据",compatibleClis:"兼容",factoryDroid:"Factory Droid",system:"系统",health:"健康",settings:"设置",openrouterTooltip:"精选:OpenRouter + Alibaba Coding Plan + Ollama"},home:{profiles:"配置",cliproxy:"CLIProxy",accounts:"账号",health:"健康",configurationRequired:"需要配置"},auth:{dashboardTitle:"CCS 控制台",loginDescription:"请输入凭据以访问控制台",username:"用户名",password:"密码",usernamePlaceholder:"请输入用户名",passwordPlaceholder:"请输入密码",signIn:"登录",signingIn:"登录中...",loginFailed:"登录失败"},commonToast:{apiKeyRequired:"API key 为必填项",accountAddedPresetFailed:"账号已添加,但应用默认预设失败",settingsCopied:"设置已复制到剪贴板",enterPresetName:"请先输入预设名称再保存",codeCopied:"验证码已复制到剪贴板",copyCodeFailed:"复制验证码失败",appliedModelAllTiers:"已将模型应用到全部层级",settingsSaved:"设置已保存",defaultTargetUpdated:"默认目标已更新",failedUpdateDefaultTarget:"更新默认目标到 {{target}} 失败{{suffix}}"},profileDialog:{editTitle:"编辑配置",createTitle:"创建 API 配置",name:"名称",namePlaceholder:"my-api",baseUrl:"Base URL",baseUrlPlaceholder:"https://api.example.com",apiKey:"API Key",defaultModel:"默认模型(ANTHROPIC_MODEL)",defaultModelHint:"留空则使用:{{model}}",modelMappingTitle:"模型映射(Opus/Sonnet/Haiku)",modelMappingDesc:"为不同档位配置不同模型 ID,适合按模型类型路由到不同后端的 API 代理。",opusModel:"Opus 模型(ANTHROPIC_DEFAULT_OPUS_MODEL)",sonnetModel:"Sonnet 模型(ANTHROPIC_DEFAULT_SONNET_MODEL)",haikuModel:"Haiku 模型(ANTHROPIC_DEFAULT_HAIKU_MODEL)",cancel:"取消",saving:"保存中...",update:"更新",create:"创建"},modelTierMapping:{title:"模型档位映射",advanced:"高级",description:"为 Claude Code 的 opus/sonnet/haiku 档位配置不同模型。",autoSuggest:"基于 {{provider}} 自动建议",opusPlaceholder:"例如:anthropic/claude-opus-4",sonnetPlaceholder:"例如:anthropic/claude-sonnet-4",haikuPlaceholder:"例如:anthropic/claude-3.5-haiku",footer:"这些字段对应 ANTHROPIC_DEFAULT_OPUS_MODEL、ANTHROPIC_DEFAULT_SONNET_MODEL、ANTHROPIC_DEFAULT_HAIKU_MODEL。"},envEditor:{sensitive:"敏感",none:"尚未配置环境变量。",noneHint:"可在下方输入添加,或直接编辑 JSON。",addVariable:"添加环境变量",keyPlaceholder:"VARIABLE_NAME",valuePlaceholder:"value"},setupVariant:{using:"当前使用:",variantNameRequired:"变体名称 *",variantNamePlaceholder:"例如:my-gemini、g3、flash",invokeHintPrefix:"可通过该名称调用:",model:"模型",modelPlaceholder:"例如:gemini-2.5-pro、claude-opus-4-6-thinking",choosePresetInstead:"改为从预设中选择",selectModel:"选择模型",customModelName:"自定义模型名称...",enterAnyModel:"可输入 CLIProxy 支持的任意模型名",defaultModel:"默认:{{model}}",providerDefault:"提供商默认值",back:"返回",skip:"跳过",creating:"创建中...",createVariant:"创建变体",skipHint:"如果你只想添加账号而不创建变体,可以直接跳过"},customPresetDialog:{title:"自定义预设",presetNameOptional:"预设名称(可选)",presetNamePlaceholder:"例如:我的自定义配置",codexTipPrefix:"Codex 提示:后缀",codexTipSuffix:"会固定 effort。无后缀模型使用 Thinking 设置。",defaultModel:"默认模型",defaultModelDesc:"未指定档位时使用",opusModel:"Opus(最强)",opusModelDesc:"用于复杂推理任务",sonnetModel:"Sonnet(均衡)",sonnetModelDesc:"兼顾速度与能力",haikuModel:"Haiku(快速)",haikuModelDesc:"适合简单任务的快速响应",cancel:"取消",savePreset:"保存预设",applyPreset:"应用预设"},componentModelSelector:{selectModel:"选择模型",availableModelsCount:"可用模型({{count}})",preview:"预览"},searchableSelect:{searchModels:"搜索模型...",noResults:"未找到匹配结果。"},copilotSettings:{enableCopilot:"启用 Copilot",enableCopilotDesc:"允许使用 GitHub Copilot 订阅",basicSettings:"基础设置",accountType:"账户类型",accountTypeIndividual:"个人",accountTypeBusiness:"企业",accountTypeEnterprise:"组织",rateLimiting:"速率限制",rateLimitSeconds:"速率限制(秒)",noLimit:"不限制",waitOnRateLimit:"触发限速时等待",waitOnRateLimitDesc:"达到限制时等待而不是报错",daemonSettings:"守护进程设置",autoStartDaemon:"自动启动守护进程",autoStartDaemonDesc:"使用配置时自动启动 copilot-api"},providerModelSelector:{selectModel:"选择模型",noModelsForProvider:"该提供商暂无可用模型",broken:"故障",deprecated:"已弃用",paid:"付费",freeTier:"免费档",paidTier:"付费档",modelKnownIssues:"该模型存在已知问题",viewIssueDetails:"查看问题详情",modelDeprecated:"该模型已弃用",recommended:"推荐",allModelsCount:"全部模型({{count}})",noModelsAvailable:"暂无可用模型"},createAuthProfileDialog:{title:"创建新账号",description:"Auth 配置需要先完成 Claude CLI 登录。请在终端执行下方命令。稍后你仍可在 Accounts 表中编辑同步模式、分组与连续性深度。",profileName:"配置名称",profileNamePlaceholder:"例如:work、personal、client",invalidProfileName:"名称必须以字母开头,且只能包含字母、数字、短横线或下划线。",enableSharedHistory:"与其他 ccs auth 账号启用共享历史同步",historySyncGroupOptional:"历史同步分组(可选)",historySyncGroupPlaceholder:"default、sprint-a、client-x",historySyncGroupHint:"留空将使用默认共享分组。空格会自动规范为短横线。",deeperContinuity:"高级:更深连续性模式",deeperContinuityHint:"会同步 session-env、file-history、shell-snapshots 与 todos。凭据仍保持隔离。",invalidContextGroup:"分组必须以字母开头,且只能包含字母、数字、短横线或下划线(最多 {{max}} 个字符)。",command:"命令",commandFallback:"ccs auth create <name>",afterRunPrefix:"执行命令后:",afterRunStep1:"在浏览器中完成 Claude 登录",afterRunStep2:"返回此处并刷新,即可看到新账号",poolingHint:"如果更倾向于共享池化 Claude OAuth 路由,可在 Accounts 页面操作按钮中使用 CLIProxy Claude pool。",close:"关闭",copied:"已复制!",copyCommand:"复制命令"},cliproxyModelCategory:{google:"Google(Gemini)",openai:"OpenAI(GPT)",anthropic:"Anthropic(Claude)",antigravity:"Antigravity",other:"其他"},cliproxyOverviewComponents:{availableModels:"可用模型",noModelsAvailable:"暂无可用模型",startSessionHint:"启动 CLIProxy 会话后即可拉取可用模型",totalCount:"共 {{count}} 个",availableThroughGroupedByProvider:"通过 {{backendLabel}} 提供的模型,按提供商分组",moreCount:"另外 {{count}} 个"},categorizedModelSelector:{selectModel:"选择模型",noModelsAvailable:"暂无可用模型",modelPlaceholder:"模型..."},openrouterQuickStart:{recommended:"推荐",title:"从 OpenRouter 开始",description:"通过一个 API 即可访问来自 OpenAI、Anthropic、Google、Meta 等的 {{modelCountLabel}} 个模型。",featureOneApi:"一个 API,接入全部提供商",featureTierMapping:"模型档位映射",profileCount:"{{count}} 个 API 配置",profileCount_other:"{{count}} 个 API 配置",selectProfileTitle:"选择一个 API 配置",summaryDescriptionWithProfiles:"此工作区中已存在 {{count}} 个 API 配置。请从左侧栏选择一个进行编辑,或在此继续创建新的配置。",summaryDescriptionWithProfiles_other:"此工作区中已存在 {{count}} 个 API 配置。请从左侧栏选择一个进行编辑,或在此继续创建新的配置。",summaryDescriptionNoProfiles:"API 配置适用于 Anthropic 兼容端点。AI Providers 适用于 Gemini、Codex、Claude、Vertex 以及 OpenAI 兼容连接器。",openrouterModelsBadge:"{{modelCountLabel}} 个 OpenRouter 模型",runtimeProviderBadge:"运行时提供商设置",runtimeProviderTitle:"打开 AI Providers",runtimeProviderDescription:"先管理共享的提供商密钥和运行时连接器,再创建独立的 API 配置。",runtimeProviderFeatureConnectors:"Gemini、Codex、Claude、Vertex 以及 OpenAI 兼容连接器",runtimeProviderFeatureSecrets:"共享密钥与单个 API 配置分离存放",runtimeProviderFooter:"当多个配置需要共享同一提供商设置时最适合使用。",createOpenRouterProfile:"创建 OpenRouter 配置",getApiKeyAt:"在此获取 API Key:",or:"或",createCustomProfile:"创建自定义 API 配置"},alibabaCodingPlanQuickStart:{recommended:"推荐",title:"试用阿里云 Coding Plan",description:"通过 Anthropic 兼容端点接入阿里云 Model Studio Coding Plan。",featureEndpoint:"Anthropic 兼容端点",featureKeyFormat:"专用 sk-sp API Key",createAlibabaProfile:"创建 Alibaba Coding Plan 配置",readGuideAt:"查看配置文档:"},alibabaCodingPlanPromo:{title:"Alibaba Coding Plan",subtitle:"通过 Anthropic 端点接入 Model Studio Coding Plan",add:"添加"},credentialHealth:{title:"凭据健康状态",ready:"就绪",noCredentialsConfigured:"尚未配置凭据。请使用上方登录按钮完成认证。",neverUsed:"从未使用",justNow:"刚刚",unknown:"未知",daysAgo:"{{count}} 天前",hoursAgo:"{{count}} 小时前",minutesAgo:"{{count}} 分钟前"},proxyStatusWidget:{justNow:"刚刚",minutesAgo:"{{count}} 分钟前",hoursAgo:"{{count}} 小时前",syncReady:"同步就绪",noConfig:"未配置",remoteProxy:"远程代理",active:"已连接",trafficAutoRouted:"流量已自动转发到远程服务器",tooltipSync:"同步配置到 CLIProxy",tooltipRestart:"重启",tooltipStop:"停止",tooltipClose:"关闭",tooltipVersionSettings:"版本设置",versionManagement:"版本管理",selectVersionPlaceholder:"选择要安装的版本...",stable:"(稳定版)",install:"安装",versionsAboveUnstable:"高于 {{version}} 的版本存在已知问题",versionsKnownIssues:"版本 {{version}} 存在已知问题",lastChecked:"上次检查 {{time}}",notRunning:"未运行",start:"启动",port:"端口 {{port}}",sessionCount:"{{count}} 个会话",sessionCount_other:"{{count}} 个会话",installFaultyTitle:"安装存在已知问题的版本?",installFaultyDesc:"即将安装 <strong>v{{version}}</strong>,该版本位于已知故障范围 <strong>{{range}}</strong> 内。",installFaultyWarning:"该版本存在已知缺陷,可能安装失败或让代理处于异常状态。",installUnstableTitle:"安装非稳定版本?",installUnstableDesc:"即将安装 <strong>v{{version}}</strong>,该版本高于当前最大稳定版 <strong>v{{maxStable}}</strong>。",installUnstableWarning:"该版本存在已知稳定性问题,可能导致异常行为。",installUnstableConfirm:"确定要继续吗?",cancel:"取消",installAnyway:"仍要安装",clickToDowngrade:"点击降级",clickToUpdate:"点击更新"},syncStatusCard:{profileSync:"配置同步",ready:"就绪",noConfig:"未配置",syncsProfilesDesc:"将 API 配置同步到本地 CLIProxy 配置",runDoctorHint:"运行 <code>ccs doctor --fix</code> 生成配置。",details:"详情",syncNow:"立即同步"},syncDialog:{title:"同步配置到本地 CLIProxy",description:"将 CCS API 配置同步到本地 CLIProxy 的 config.yaml。",noProfiles:"没有可同步的配置。",createProfilesFirst:"请先在「配置」页创建 API 配置。",modelLabel:"模型:",ready:"就绪",profilesToSync_one:"{{count}} 个配置待同步",profilesToSync_other:"{{count}} 个配置待同步",cancel:"取消",syncing:"同步中...",synced:"已同步!",syncNow:"立即同步"},errorLogs:{title:"错误日志",failedRequests_one:"{{count}} 个失败请求",failedRequests_other:"{{count}} 个失败请求",cliproxyDiagnostics:"CLIProxy 诊断",showingCount:"显示 50 / {{total}} 条",selectLog:"选择一条日志查看详情",failedLoadContent:"加载日志内容失败",copyAbsolutePath:"复制绝对路径",copyRawContent:"复制原始日志",tabOverview:"概览",tabHeaders:"请求头",tabRequest:"请求体",tabResponse:"响应体",tabRaw:"原始",modelLabel:"模型:",quotaResetsIn:"配额重置于 ",method:"方法",provider:"提供商",version:"版本",endpoint:"端点",url:"URL",timestamp:"时间戳",na:"无",noHeaders:"无请求头",noRequestBody:"无请求体内容",noResponseBody:"无响应体内容",rateLimitedMsg:"触发限速。请切换账号或等待配额重置。模型 {{model}} 配额已用尽。",rateLimitedMsgNoModel:"触发限速。请切换账号或等待配额重置。",authFailedMsg:"认证失败。请通过 CLIProxy 设置重新认证或检查 API Key。",notFoundMsg:"端点未找到,该提供商可能不存在此端点。",serverErrorMsg:"上游服务器错误。请稍后重试或查看提供商状态页。",timeoutMsg:"请求超时。请检查网络或增大超时设置。",unknown:"未知"},editAccountContext:{title:"编辑历史同步",description:"配置「{{name}}」与其他 ccs auth 账号共享历史与连续性的方式。",syncMode:"同步模式",selectContextMode:"选择同步模式",isolatedOption:"隔离(不同步)",sharedOption:"共享(启用同步)",sharedModeHint:"共享模式会为同一历史同步分组内的账号复用工作区上下文。",isolatedModeHint:"隔离模式使该账号与其他 ccs auth 账号完全独立。",historySyncGroup:"历史同步分组",groupPlaceholder:"default",groupHint:"会规范为小写(空格变为短横线)。允许:字母、数字、_、-(最多 {{max}} 字符)。",invalidGroup:"请输入以字母开头的有效分组名。",continuityDepth:"连续性深度",selectContinuityDepth:"选择连续性深度",standardOption:"标准(仅项目)",deeperOption:"更深连续性(高级)",deeperHint:"高级模式还会同步 session-env、file-history、shell-snapshots 和 todos。",standardHint:"标准模式仅同步项目工作区上下文。",credentialsIsolated:"凭据与 .anthropic 在所有模式下均按账号隔离。",cancel:"取消",save:"保存",saving:"保存中..."},historySyncLearningMap:{title:"历史同步说明",description:"隔离 -> 共享 -> 更深。在每行使用「同步」进行所有更改。",learningMap:"说明",isolated:"隔离",shared:"共享",deeper:"更深",cliproxyManaged_one:"{{count}} 个 CLIProxy Claude 池账号在操作中心 / CLIProxy 页面管理。",cliproxyManaged_other:"{{count}} 个 CLIProxy Claude 池账号在操作中心 / CLIProxy 页面管理。",showDetails:"显示详情:分组、切换与旧策略",modeSwitch:"模式切换",modeSwitchDesc:"同步对话框可让用户在隔离/共享间切换并选择更深连续性。",historySyncGroup:"历史同步分组",historySyncGroupDesc:"同一分组即共享项目上下文。默认回退为 default。",legacyConfirmation_one:"{{count}} 个旧账号仍需要显式确认。",legacyConfirmation_other:"{{count}} 个旧账号仍需要显式确认。"},accountsTable:{name:"名称",type:"类型",defaultBadge:"默认",created:"创建时间",lastUsed:"最后使用",historySync:"历史同步",actions:"操作",syncTitle:"编辑同步模式、分组与连续性深度",confirmLegacyTitle:"确认此旧账号的当前模式为显式",sync:"同步",confirm:"确认",active:"当前",setDefault:"设为默认",deleteAccount:"删除账号",cannotDeleteDefault:"不能删除默认账号",noAccounts:"未找到 CCS auth 账号。请使用 ccs auth create 添加。",resetToDefault:"恢复为 CCS 默认",deleteDialogTitle:"删除账号",deleteDialogDesc:"确定要删除账号「{{name}}」吗?将移除该配置及其所有会话数据,且无法撤销。",cancel:"取消",delete:"删除",sharedGroupStandard:"共享({{group}},标准)",sharedGroupDeeper:"共享({{group}},更深)",sharedGroupLegacy:"共享({{group}},标准旧策略)",isolatedLegacy:"隔离(旧默认)",isolated:"隔离"},addAccountDialog:{title:"添加 {{displayName}} 账号",descKiro:"选择 Kiro 认证方式,然后通过浏览器或从 Kiro IDE 导入完成认证。",descDeviceCode:"点击认证后,验证码将显示,请在提供商网站输入。",descOauth:"点击认证获取 OAuth URL,在任意浏览器中打开即可登录。",powerUserEnabled:"已启用高级用户模式",powerUserSkipped:"设置 > 代理 中的高级用户模式会跳过 AGY 责任确认清单和 Gemini Dashboard 的风险短语。OAuth / 账号风险需自行承担。",powerUserLoadFailed:"加载高级用户模式设置失败。请检查“设置 > 代理”后重试。",powerUserLoading:"正在加载高级用户安全设置。请稍候后重试。",powerUserUnavailableRetry:"高级用户模式不可用。请完成当前提供商要求的安全步骤后重试。",authMethod:"认证方式",selectKiroAuthMethod:"选择 Kiro 认证方式",nicknameRequired:"昵称(必填)",nicknameOptional:"昵称(选填)",nicknamePlaceholder:"例如:工作、个人",nicknameRequiredHint:"该提供商必填。请使用唯一易记名称(如工作、个人)。",nicknameOptionalHint:"用于区分账号的友好名称。留空将自动生成安全标识。",waitingForAuth:"等待认证中...",deviceCodeHint:"验证码对话框即将出现,请在提供商网站输入验证码。",browserHint:"在浏览器中完成认证后,本对话框将自动关闭。",openUrlLabel:"在任意浏览器中打开此 URL 登录:",copied:"已复制",copy:"复制",open:"打开",popupBlocked:"弹窗被拦截。请复制上方 URL 在浏览器中手动打开。",redirectPasteLabel:"重定向未生效?请粘贴回调 URL:",callbackPlaceholder:"在此粘贴重定向 URL...",submitCallback:"提交回调",submitting:"提交中...",preparingUrl:"正在准备登录 URL...",cancel:"取消",importingToken:"正在从 Kiro IDE 导入令牌...",authenticate:"认证",importFromIde:"从 IDE 导入",importing:"导入中..."},flowViz:{backToProviders:"返回提供商",showDetails:"显示详情",hideDetails:"隐藏详情",resetLayout:"重置布局",provider:"提供商",totalRequests:"总请求数",accounts:"账号",connectionTimeline:"连接时间线",noRecentConnections:"暂无最近连接"},quickStats:{totalRequests:"总请求数",successRate:"成功率",totalTokens:"总 Token 数",activeModels:"活跃模型数"},authMonitor:{accounts:"账号",accountsCount:"{{count}} 个账号",success:"成功",failed:"失败",successRate:"成功率"},accountCard:{resumeAccount:"恢复账号",pauseAccount:"暂停账号",quotaLoading:"配额...",quota:"配额",quotaUnavailable:"配额限制不可用",reauthNeeded:"需要重新认证",failureLabelReauth:"重新认证",failureLabelWorkspace:"工作区",failureLabelNoAccess:"无权限",failureLabelRetry:"重试",failureLabelReconnect:"重新连接",failureLabelTemporary:"临时问题",failureLabelUnavailable:"不可用",failureHintReauth:"请重新运行该账号的认证流程以刷新访问权限。",failureHintWorkspace:"请将该账号移回可用的工作区,然后移除并重新添加。",failureHintNoAccess:"该账号无法访问提供商的配额接口。",failureHintRetry:"稍后再试一次。",failureHintReconnect:"请移除这个失效账号并重新认证。",failureHintTemporary:"这看起来是临时问题,请稍后重试。",removeAndReadd:"移除并重新添加账号",autoRefreshFailed:"自动刷新失败"},antigravityChecklist:{title:"Antigravity OAuth 责任须知",subtitle:"认证前请完成全部 4 步。",mandatory:"必读",completion:"完成度",stepsCount:"{{current}}/4 步"},accountSafetyWarning:{title:"OAuth 账号安全提示",subtitle:"Issue #509 · Gemini + AGY OAuth 风险",firstLine:"Issue #509 记录了与 ccs agy 及 ccs gemini 与 ccs agy 共享账号使用相关的封禁/停用报告。",secondLine:"仅在您愿意承担 OAuth 与账号访问风险的前提下继续。",issueLabel:"查看 issue #509",proxySettingsLabel:"Gemini + AGY 控制:设置 > 代理"},cliproxyDialog:{name:"名称",provider:"提供商",account:"账号",accountOptional:"账号(选填)",model:"模型",modelOptional:"模型(选填)",defaultTarget:"默认目标",defaultTier:"默认档位",tierConfig:"档位配置",selectProvider:"选择提供商...",useDefaultAccount:"使用默认账号",defaultSuffix:"(默认)",opus:"Opus",sonnet:"Sonnet",haiku:"Haiku",claudeCode:"Claude Code",factoryDroid:"Factory Droid",cancel:"取消",create:"创建",creating:"创建中...",saveChanges:"保存更改",saving:"保存中...",placeholderName:"my-gemini",placeholderModel:"gemini-2.5-pro",placeholderComposite:"my-composite",placeholderModelId:"model-id",placeholderAccountId:"account-id",editCompositeTitle:"编辑复合变体:{{name}}",editSingleTitle:"编辑单一样式:{{name}}"},profileEditor:{profileInfo:"配置信息",profileName:"配置名称",filePath:"文件路径",lastModified:"最后修改",defaultTarget:"默认目标",quickUsage:"快速使用",runWithProfile:"使用配置运行",runOnDroid:"在 Droid 上运行",runOnDroidWithFlag:"通过 --target 在 Droid 上运行",droidAliasExplicit:"Droid 别名(显式)",overrideToClaude:"切换为 Claude",overrideToClaudeExplicit:"切换为 Claude(显式)",targetHintPreferredAlias:"推荐显式别名:",targetHintClaudeDefault:"默认命令:",targetHintLegacyAlias:"旧快捷方式仍可用:",targetHintOverride:"你仍可在每次运行时用",setAsDefault:"设为默认",provider:"提供商",custom:"自定义",providerChooserHint:"先选择一个预设,之后仍可调整 URL、API key 和模型映射。",featuredProviders:"精选提供商",scrollHint:"屏幕较窄时可横向滚动",customEndpoint:"自定义端点",morePresets:"更多预设",customEndpointDescription:"从空白的 Anthropic 兼容 URL 开始,手动配置全部内容。"},settings:{sectionLoadFailed:"加载分区失败",unknownError:"发生未知错误",reloadPage:"重新加载页面",refresh:"刷新",copy:"复制",copied:"已复制",saved:"已保存",loading:"加载中...",configFileNotFound:"未找到配置文件"},settingsTabs:{web:"网页",env:"环境",think:"思考",proxy:"代理",auth:"认证",backup:"备份"},settingsAuth:{failedFetchTokens:"获取认证令牌失败",failedSaveTokens:"保存令牌失败",tokensUpdated:"令牌已更新,请重启 CLIProxy 生效。",failedRegenerate:"重新生成密钥失败",secretRegenerated:"新的管理密钥已生成,请重启 CLIProxy 生效。",failedReset:"重置令牌失败",tokensReset:"令牌已重置为默认值,请重启 CLIProxy 生效。",description:"配置 CLIProxy 认证令牌。修改后需要重启 CLIProxy。",apiKey:"API Key",custom:"自定义",apiKeyDesc:"Claude Code 通过该值向 CLIProxy 鉴权",apiKeyPlaceholder:"API key",managementSecret:"管理密钥",managementSecretDesc:"CCS Dashboard 使用该值访问 CLIProxy 管理接口",managementSecretPlaceholder:"管理密钥",generateSecret:"生成新的安全密钥",resetDefaults:"重置为默认值",resetDesc:"将 API key 和管理密钥都恢复为默认值。",saving:"保存中...",save:"保存"},settingsGlobalEnv:{description:"向所有非 Claude 订阅型配置注入环境变量(gemini、codex、agy、ghcp 等)",enabled:"全局环境变量已启用",disabled:"全局环境变量已禁用",enabledDesc:"环境变量将注入第三方配置",disabledDesc:"环境变量不会被注入",envVars:"环境变量",noneConfigured:"尚未配置环境变量",addNew:"新增变量",keyName:"KEY_NAME",value:"value",add:"添加",quickAdd:"快速添加常用变量",allConfigured:"常用变量已全部配置"},settingsBackups:{failedFetch:"获取备份失败",failedRestore:"恢复备份失败",restoreSuccess:"备份恢复成功",title:"设置备份",description:"恢复 settings.json 的历史版本。每次修改设置时会自动创建备份。",none:"暂无备份",noneHint:"修改设置后,备份会显示在这里",latest:"最新",restoring:"恢复中...",restore:"恢复",restoreConfirmTitle:"确认恢复备份?",restoreConfirmPrefix:"这将用以下备份替换当前设置:",restoreConfirmSuffix:"此操作不可撤销。",cancel:"取消"},settingsWebsearch:{description:"面向第三方配置(gemini、codex、agy 等)的 CLI 网页搜索",enabled:"WebSearch 已启用",disabled:"WebSearch 已禁用",checking:"正在检查状态...",providers:"提供商",noneConfigured:"未配置任何提供商",noneConfiguredHint:"请先安装 CLI 工具以启用网页搜索提供商",checkProviders:"检查可用提供商",installed:"已安装",notInstalled:"未安装",model:"模型:",howInstall:"如何安装 {{name}} CLI",installGlobally:"全局安装",requiresKey:"(需要 xAI API key)",freeTier:"(提供免费额度)",viewDocs:"查看文档"},settingsProxy:{failedLoadAgyMode:"加载高级模式失败",failedUpdateAgyMode:"更新高级模式失败",failedVerifyAgyMode:"校验高级模式持久化失败",notPersistedAgyMode:"高级模式未成功持久化,配置可能被其他进程修改。",agyModeEnabled:"高级模式已启用。",agyModeDisabled:"高级模式已关闭。",typePhraseToContinue:"请输入“{{value}}”后继续。",description:"为基于代理的配置设置本地或远程 {{backend}} 连接",backendPlus:"CLIProxy Plus",backend:"CLIProxy",instanceStatus:"实例状态",connectionMode:"连接模式",local:"本地",remote:"远程",localDesc:"在本机运行 {{backend}} 二进制",remoteDesc:"连接到远程 {{backend}} 服务器",backendBinary:"后端二进制",stopProxyToSwitch:"请先在实例状态中停止正在运行的代理,再切换后端。",default:"默认",plusDesc:"完整支持包括 Kiro 和 GitHub Copilot 在内的提供商",originalDesc:"原版二进制(仅 Gemini、Codex、Antigravity)",variantsIncompatible:"现有 Kiro/Copilot 变体与 CLIProxyAPI 不兼容。请切换到 CLIProxyAPIPlus 或移除这些变体。",safety:"安全",agyModeTitle:"Antigravity + Gemini 高级模式",agyModeDesc:"跳过 AGY 责任确认清单,以及 Gemini Dashboard 中输入风险短语的步骤。",agyWarning:"仅在你充分理解 OAuth 封禁风险模式(#509)后使用。CCS 不对账号损失承担责任。",finalConfirm:"需要最终确认",finalConfirmDesc:"启用后会跳过 Dashboard / CLI 中的 AGY 安全检查,以及 Gemini Dashboard 的风险短语确认。请先阅读 issue #509,并输入精确短语后继续。",step1:"步骤 1",readIssue:"阅读 issue #509",step2:"步骤 2",typePrefix:"输入",typeSuffix:"以启用。",typePhraseAria:"输入 I ACCEPT RISK 以启用 Antigravity + Gemini 高级模式",exactPhrase:"必须输入完全一致的短语。",enableAgyMode:"启用 Antigravity + Gemini 高级模式",toggleAgyMode:"切换 Antigravity + Gemini 高级模式",fallbackSettings:"回退设置",enableFallback:"启用本地回退",enableFallbackDesc:"远程不可达时使用本地代理",autoStartLocal:"自动启动本地代理",autoStartLocalDesc:"发生回退时自动启动本地代理",advanced:"高级",debugMode:"调试模式",debugModeDesc:"在浏览器控制台输出开发诊断信息",debugModeEnabled:"调试模式已开启,请在浏览器控制台查看详细日志。",localProxy:"本地代理",port:"端口",autoStart:"自动启动",localAutoStartDesc:"需要时自动启动本地代理",remoteConfigTitle:"远程服务器配置",host:"主机",hostPlaceholder:"192.168.1.100 或 proxy.example.com",defaultPort:"默认:{{value}}",portPlaceholder:"留空使用 {{value}}",protocol:"协议",http:"HTTP",https:"HTTPS",apiKeyOptional:"API Key(可选)",apiKeyPlaceholder:"用于 /v1/* API 接口",apiKeyDesc:"用于 /v1/chat/completions 接口请求",managementKeyOptional:"管理密钥(可选)",managementKeyPlaceholder:"用于 /v0/management/* 接口",managementKeyDesc:"用于 Dashboard 管理接口。未设置时回退使用 API Key。",testing:"测试中...",testConnection:"测试连接",connectedLatency:"已连接({{value}}ms)",connectionFailed:"连接失败",invalidPortOrEmpty:"端口必须是 1 到 65535 的整数,或留空使用默认值",invalidLocalPort:"本地端口必须是 1 到 65535 的整数",backendPlusApi:"CLIProxyAPIPlus",backendApi:"CLIProxyAPI"},settingsThinking:{description:"为支持的模型配置扩展思考/推理。",supportedProviders:"支持的提供商",modeTitle:"思考模式",modeAutoDesc:"根据模型档位自动设置思考级别",modeOffDesc:"关闭扩展思考",modeManualDesc:"设置持久覆盖级别,或按次使用 CLI 参数",tierDefaults:"档位默认值",tierDefaultsDesc:"自动模式下各模型档位的默认思考级别。",persistentOverride:"持久覆盖",persistentOverrideDesc:"应用到所有会话。CLI 参数仍具有更高优先级。",enterCustomBudget:"输入自定义预算",apply:"应用",providerOverrides:"提供商覆盖({{count}})",providerOverridesDesc:"为特定提供商覆盖档位默认值。可按需添加自定义提供商键。",addProviderPlaceholder:"添加提供商键(例如 qwen)",showWarnings:"显示告警",showWarningsDesc:"当思考值被限制或调整时显示告警",cliEnvOverride:"CLI 与环境变量覆盖",supportLine1Prefix:"思考预算:",supportLine1Suffix:"(基于 token)",supportLine2Prefix:"推理强度:",supportLine2SuffixPrefix:"(后缀或 ",supportLine2SuffixPostfix:":minimal/low/medium/high/xhigh)",supportLine3Prefix:"Codex 后缀会固定强度(例如 ",supportLine3Suffix:");无后缀模型使用 Thinking mode。"},analytics:{title:"分析",subtitle:"追踪使用情况与洞察",month:"本月",allTime:"全部时间",updated:"更新于 {{value}}"},analyticsSummary:{totalTokens:"总 Token",totalTokensSubtitle:"输入 {{input}} / 输出 {{output}}",totalCost:"总成本",totalCostSubtitle:"日均 ${{value}}",cacheTokens:"缓存 Token",cacheTokensSubtitle:"${{cost}}(占成本 {{percent}}%)",inputCost:"输入成本",outputCost:"输出成本",tokensSubtitle:"{{value}} 个 token"},apiProfiles:{title:"API 配置",new:"新建",searchPlaceholder:"搜索配置...",loadingProfiles:"正在加载配置...",failedLoadTitle:"加载配置失败",failedLoadDesc:"无法获取 API 配置,请稍后重试。",retry:"重试",noProfilesYet:"还没有 API 配置",noProfilesDesc:"创建你的第一个配置以连接自定义 API 端点",createProfile:"创建配置",noProfileMatch:"没有匹配“{{query}}”的配置",profileCount:"{{count}} 个配置",profileCount_other:"{{count}} 个配置",configuredCount:"{{count}} 个已配置",deleteProfileTitle:"删除配置",deleteProfileDesc:"确定要删除“{{name}}”吗?这会移除设置文件且无法恢复。",delete:"删除",unsavedChangesTitle:"未保存的更改",unsavedChangesDesc:"你在“{{current}}”中有未保存内容,是否丢弃并切换到“{{next}}”?",discardSwitch:"丢弃并切换"},accountsPage:{title:"账号",managePrefix:"统一管理",manageSuffix:"账号与池化接入流程。",mobileManageSuffix:"的连续性配置。",primaryActions:"主要操作",createAccount:"创建账号",authClaudeInPool:"在 Pool 中认证 Claude",openClaudePoolSettings:"打开 Claude Pool 设置",openCliProxyClaudePool:"打开 CLIProxy Claude Pool",migrationFollowup:"迁移后续处理",legacyContextPending:"{{count}} 个账号仍需首次模式确认。",legacyContextPending_other:"{{count}} 个账号仍需首次模式确认。",legacyContinuityPending:"{{count}} 个共享账号仍处于标准旧版连续性深度。",legacyContinuityPending_other:"{{count}} 个共享账号仍处于标准旧版连续性深度。",confirmingLegacy:"正在确认旧版策略...",confirmLegacy:"确认旧版策略({{count}})",noLegacyFollowup:"暂无待处理的迁移后续项。",continuityGuide:"连续性指南",expandWhenNeeded:"按需展开查看。",sharedStandard:"共享标准",sharedStandardDesc:"仅同步项目工作区。适合大多数团队。",sharedDeeper:"共享更深",sharedDeeperPrefix:"额外包含",isolated:"隔离",isolatedDesc:"不建立链接。适合严格隔离场景。",quickCommands:"快捷命令",quickCommandsDesc:"复制后在终端运行。",workspaceBadge:"ccs auth 工作区",historySyncBadge:"历史同步控制",authAccounts:"认证账号",tableScopePrefix:"该表仅展示",tableScopeMiddle:"账号。模式/分组/深度调整请使用",tableScopeSuffix:"。",accountMatrix:"账号矩阵",sharedTotalDesc:"共享总数:{{count}}。可执行 Sync 设置和旧版确认操作。",loadingAccounts:"正在加载账号..."},health:{justNow:"刚刚",secondsAgo:"{{count}} 秒前",minutesAgo:"{{count}} 分钟前",hoursAgo:"{{count}} 小时前",systemHealth:"系统健康",build:"构建 {{version}}",lastScan:"上次扫描:",autoRefresh:"自动刷新:",refresh:"刷新",checks:"检查项",version:"版本",platform:"平台",liveMonitoring:"实时监控已启用",copied:"已复制到剪贴板",refreshing:"正在刷新健康检查...",fix:"修复",applyFix:"应用修复",healthLabel:"健康"},updates:{actionRequired:"待处理",done:"已完成",all:"全部",inboxTitle:"更新中心",inboxSubtitle:"先处理操作,再将更新标记为完成或忽略。",needsAction:"需处理",doneCount:"已完成",searchPlaceholder:"搜索操作或命令",noNotices:"当前视图下没有通知。",noUpdates:"暂无更新。",published:"发布于 {{date}}",markDone:"标记完成",dismiss:"忽略",reopen:"重新打开",doNext:"下一步",impactedIntegrations:"受影响的集成",impactedDesc:"根据更新范围与路由匹配的相关区域。",whyMatters:"为什么重要",whyMattersDesc:"仅保留简要背景,不展示冗长发布说明。",open:"打开",progressNeedsAction:"需处理",progressInReview:"审阅中",progressDone:"已完成",progressDismissed:"已忽略",statusNew:"新",statusStable:"稳定",statusPlanned:"计划中",dashboard:"Dashboard",cliUsage:"CLI 用法"},cliproxyPage:{connected:"已连接",notConnected:"未连接",variant:"变体",parentNotConnected:"上游未连接",viaProvider:"通过 {{provider}}",emptyTitle:"CCS 配置管理",emptyDesc:"管理 CLIProxy 提供商的 OAuth 认证、账号偏好与模型选择,配置 CCS 的请求路由。",emptyControlPanelPrefix:"如需查看实时用量和监控,请前往",controlPanel:"控制面板",quickSetup:"快速设置",accountManagement:"CCS 级账号管理",providers:"提供商",variants:"变体",providerCount:"{{count}} 个提供商",providerCount_other:"{{count}} 个提供商",connectedCount:"{{count}} 个已连接",variantDisplay:"{{name}}({{provider}} 变体)"},copilotPage:{title:"Copilot",subtitle:"GitHub Copilot 代理",setup:"安装",auth:"认证",daemon:"守护进程",unofficialTitle:"非官方 API - 风险自负",unofficialItem1:"逆向接口,可能随时失效",unofficialItem2:"过度使用可能触发账号限制",unofficialItem3:"CCS 不提供担保,也不承担责任",yes:"是",no:"否",installed:"已安装",missing:"缺失",integration:"集成",enabled:"已启用",disabled:"已禁用",github:"GitHub",connected:"已连接",notConnected:"未连接",authenticate:"去认证",authenticating:"认证中...",status:"状态",running:"运行中",stopped:"已停止",port:"端口",stopping:"停止中...",stop:"停止",starting:"启动中...",start:"启动",installing:"安装中...",installCopilotApi:"安装 copilot-api",proxy:"代理",active:"活跃",inactive:"未激活"},cursorPage:{title:"Cursor",beta:"Beta",subtitle:"Cursor 集成专用控制面板",unofficialTitle:"非官方 API - 风险自负",unofficialItem1:"逆向集成可能随时失效",unofficialItem2:"滥用或过量使用可能导致账号受限",unofficialItem3:"CCS 不提供担保,也不承担责任",integration:"集成",authentication:"认证",daemon:"守护进程",enabled:"已启用",disabled:"已禁用",expired:"已过期",connected:"已连接",notConnected:"未连接",running:"运行中",stopped:"已停止",actions:"操作",disableIntegration:"禁用集成",enableIntegration:"启用集成",autoDetectAuth:"自动检测认证",manualAuthImport:"手动导入认证",stopDaemon:"停止守护进程",startDaemon:"启动守护进程",port:"端口",configuration:"Cursor 配置",lastModified:"最后修改:",neverSaved:"从未保存",saving:"保存中...",save:"保存",modelConfig:"模型配置",settings:"设置",info:"信息",presets:"预设",presetsDesc:"应用预设模型映射",modelMapping:"模型映射",modelMappingDesc:"为不同档位配置使用模型",defaultModel:"默认模型",defaultModelDesc:"未指定档位时使用。",opusModel:"Opus(最强)",opusModelDesc:"复杂推理与最高质量输出。",sonnetModel:"Sonnet(均衡)",sonnetModelDesc:"日常编码和通用对话。",haikuModel:"Haiku(快速)",haikuModelDesc:"低延迟与轻量请求。",runtimeSettings:"运行时设置",autoStartDaemon:"自动启动守护进程",autoStartDesc:"在使用集成时自动启动 Cursor 守护进程。",ghostMode:"Ghost 模式",ghostModeDesc:"请求时附带 x-ghost-mode 以减少遥测。",provider:"提供商",filePath:"文件路径",availableModels:"可用模型",loadingModels:"加载模型中...",noModels:"暂无模型元数据,请先启动守护进程后刷新。",default:"默认",rawConfiguration:"原始配置(JSON)",manualImportTitle:"手动导入 Cursor 认证",manualImportDesc:"若无法自动检测,请提供 Cursor access token 与 machine ID。",accessToken:"访问令牌",accessTokenPlaceholder:"粘贴 Cursor access token",machineId:"机器 ID",machineIdPlaceholder:"32 位十六进制(无连字符 UUID)",cancel:"取消",import:"导入",selectModel:"选择模型",useDefaultModel:"使用默认模型",availableModelCount:"可用模型({{count}})",invalidPort:"端口必须是 1 到 65535 之间的整数",defaultModelRequired:"默认模型必填",savedConfig:"Cursor 配置与模型映射已保存",failedSaveConfig:"保存配置失败",modelsLoadingWait:"模型仍在加载中,请稍后再应用预设。",noModelsAvailable:"暂无可用模型,请先启动守护进程并刷新。",appliedCodexPreset:"已应用 GPT-5.3 Codex 预设",appliedClaudePreset:"已应用 Claude 4.6 预设",appliedGeminiPreset:"已应用 Gemini 3 预设",integrationEnabled:"Cursor 集成已启用",integrationDisabled:"Cursor 集成已禁用",failedUpdateIntegration:"更新集成状态失败",credentialsImported:"Cursor 凭据已导入",autoDetectFailed:"自动检测失败",manualRequired:"Token 和 machine ID 为必填项",manualImportFailed:"手动导入失败",failedStartDaemon:"启动守护进程失败",daemonStarted:"守护进程已启动",daemonStartedWithPid:"守护进程已启动(PID: {{pid}})",failedStopDaemon:"停止守护进程失败",daemonStopped:"守护进程已停止",rawLoading:"原始设置仍在加载,请稍后重试。",invalidJson:"JSON 无效",rawSaved:"原始设置已保存",rawChanged:"原始设置已被外部修改,请刷新后重试。",failedSaveRaw:"保存原始设置失败",savedAll:"Cursor 配置已保存"},droidPage:{loadingDiagnostics:"加载 Droid 诊断中...",failedDiagnostics:"加载 Droid 诊断失败。",overview:"概览",byok:"BYOK",docs:"文档",runtimeInstall:"运行时与安装",status:"状态",detected:"已检测",notFound:"未找到",detectionSource:"检测来源",binaryPath:"二进制路径",installDirectory:"安装目录",version:"版本",overridePath:"覆盖路径(CCS_DROID_PATH)",configFiles:"配置文件",path:"路径",resolved:"解析结果",size:"大小",lastModified:"最后修改",parseWarning:"解析告警:{{value}}",readWarning:"读取告警:{{value}}",warnings:"告警",byokSummary:"BYOK 概览",activeModelSelector:"当前模型选择器",customModels:"自定义模型",ccsManaged:"CCS 管理",userManaged:"用户管理",malformedEntries:"异常条目",providers:"提供商",none:"无",customModelsTitle:"自定义模型",modelName:"名称 / 模型",provider:"提供商",baseUrl:"Base URL",noCustomModels:"没有自定义模型",docsAlignedNotes:"文档对齐说明",factoryDocs:"Factory 文档",providerFactCheckDocs:"Provider 校验文档",providerValues:"Provider 值:{{value}}",settingsHierarchy:"Settings 层级:{{value}}",settingsTitle:"Droid BYOK 设置",fixJsonBeforeQuickSettings:"请先修复 JSON 语法,再使用快速设置。",fixJsonBeforeReasoning:"请先修复 JSON 语法,再更新 BYOK 推理设置。",unableUpdateReasoning:"无法更新所选 BYOK 模型的推理设置。",fixJsonBeforeBudget:"请先修复 JSON 语法,再更新思考预算。",anthropicOnlyBudget:"思考预算仅适用于 Anthropic BYOK 模型。",invalidJson:"JSON 无效:{{value}}",saved:"Droid 设置已保存",changedExternally:"Droid 设置已被外部修改,请刷新后重试。",failedSave:"保存 Droid 设置失败"},sharedPage:{commands:"命令",skills:"技能",agents:"代理",title:"共享数据",subtitle:"在 Claude 实例间共享的命令、技能和代理",totalShared:"共享总数",visible:"可见",markdownDetail:"Markdown 详情视图",filterPrefix:"筛选:",configurationRequired:"需要配置",countsUnavailable:"统计不可用",retryCounts:"重试统计",filterPlaceholder:"按名称、描述或路径筛选 {{tab}}",showing:"显示 {{visible}} / {{total}} 个{{tab}}",showingQuery:"(关键字“{{query}}”)",refreshing:"(刷新中...)",loadingShared:"正在加载共享{{tab}}...",failedLoadShared:"加载共享{{tab}}失败",retry:"重试",noSharedFound:"未找到共享{{tab}}。请运行 `ccs sync` 或在共享目录添加内容。",noMatch:"没有匹配“{{query}}”的{{tab}}。",selectOne:"选择一个{{tab}}查看完整内容。",pathLabel:"路径",resolvedSource:"解析后来源",loadingMarkdown:"正在加载 Markdown 内容...",failedLoadContent:"加载内容失败",retryContent:"重试内容加载",noMarkdown:"暂无 Markdown 内容。"}}},vi:{translation:{locale:{en:"Tiếng Anh","zh-CN":"Tiếng Trung giản thể",vi:"Tiếng Việt",ja:"Tiếng Nhật"},layout:{languageSwitcher:"Ngôn ngữ"},nav:{general:"Chung",home:"Trang chủ",analytics:"Phân tích",identityAccess:"Nhận dạng & Quyền truy cập",apiProfiles:"Hồ sơ API",cliproxyPlus:"CLIProxy Plus",cliproxyOverview:"Tổng quan",controlPanel:"Bảng điều khiển",githubCopilot:"GitHub Copilot",cursorIde:"Cursor IDE",claudeExtension:"Claude Extension",accounts:"Tài khoản",allAccounts:"Tất cả tài khoản",sharedData:"Dữ liệu dùng chung",compatibleClis:"Tương thích",factoryDroid:"Factory Droid",system:"Hệ thống",health:"Sức khỏe",settings:"Cài đặt",openrouterTooltip:"Nổi bật: OpenRouter + Alibaba Coding Plan + Ollama"},home:{profiles:"Hồ sơ",cliproxy:"CLIProxy",accounts:"Tài khoản",health:"Sức khỏe",configurationRequired:"Cần cấu hình"},auth:{dashboardTitle:"Bảng điều khiển CCS",loginDescription:"Nhập thông tin đăng nhập của bạn để truy cập bảng điều khiển",username:"Tên người dùng",password:"Mật khẩu",usernamePlaceholder:"Nhập tên người dùng",passwordPlaceholder:"Nhập mật khẩu",signIn:"Đăng nhập",signingIn:"Đang đăng nhập...",loginFailed:"Đăng nhập không thành công"},commonToast:{apiKeyRequired:"Cần có khóa API",accountAddedPresetFailed:"Đã thêm tài khoản nhưng không áp dụng được preset mặc định",settingsCopied:"Đã sao chép cài đặt vào bảng nhớ tạm",enterPresetName:"Vui lòng nhập tên preset để lưu",codeCopied:"Đã sao chép mã vào bảng nhớ tạm",copyCodeFailed:"Không sao chép được mã",appliedModelAllTiers:"Đã áp dụng mô hình cho tất cả các tier",settingsSaved:"Đã lưu cài đặt",defaultTargetUpdated:"Đã cập nhật mục tiêu mặc định",failedUpdateDefaultTarget:"Không cập nhật được mục tiêu mặc định thành {{target}}{{suffix}}"},profileDialog:{editTitle:"Chỉnh sửa hồ sơ",createTitle:"Tạo hồ sơ API",name:"Tên",namePlaceholder:"my-api",baseUrl:"URL cơ sở",baseUrlPlaceholder:"https://api.example.com",apiKey:"Khóa API",defaultModel:"Mô hình mặc định (ANTHROPIC_MODEL)",defaultModelHint:"Để trống để sử dụng: {{model}}",modelMappingTitle:"Ánh xạ mô hình (Opus/Sonnet/Haiku)",modelMappingDesc:"Cấu hình ID mô hình riêng cho từng tier. Hữu ích với API proxy định tuyến từng loại mô hình đến backend khác nhau.",opusModel:"Mô hình Opus (ANTHROPIC_DEFAULT_OPUS_MODEL)",sonnetModel:"Mô hình Sonnet (ANTHROPIC_DEFAULT_SONNET_MODEL)",haikuModel:"Mô hình Haiku (ANTHROPIC_DEFAULT_HAIKU_MODEL)",cancel:"Hủy bỏ",saving:"Đang lưu...",update:"Cập nhật",create:"Tạo"},modelTierMapping:{title:"Ánh xạ tầng mô hình",advanced:"Nâng cao",description:"Định cấu hình các mô hình khác nhau cho các cấp độ opus/sonnet/haiku của Claude Code.",autoSuggest:"Tự động đề xuất dựa trên {{provider}}",opusPlaceholder:"vd: anthropic/claude-opus-4",sonnetPlaceholder:"ví dụ: anthropic/claude-sonnet-4",haikuPlaceholder:"vd: anthropic/claude-3.5-haiku",footer:"Các biến này thiết lập ANTHROPIC_DEFAULT_OPUS_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, ANTHROPIC_DEFAULT_HAIKU_MODEL."},envEditor:{sensitive:"nhạy cảm",none:"Không có biến môi trường nào được cấu hình.",noneHint:"Thêm biến bằng ô nhập bên dưới hoặc chỉnh sửa trực tiếp JSON.",addVariable:"Thêm biến môi trường",keyPlaceholder:"VARIABLE_NAME",valuePlaceholder:"giá trị"},setupVariant:{using:"Sử dụng:",variantNameRequired:"Tên biến thể *",variantNamePlaceholder:"ví dụ: my-gemini, g3, flash",invokeHintPrefix:"Sử dụng tên này để gọi:",model:"Mô hình",modelPlaceholder:"ví dụ: gemini-2.5-pro, claude-opus-4-5",choosePresetInstead:"Hoặc chọn từ preset có sẵn",selectModel:"Chọn mô hình",customModelName:"Tên mô hình tùy chỉnh...",enterAnyModel:"Nhập bất kỳ tên mô hình nào được CLIProxy hỗ trợ",defaultModel:"Mặc định: {{model}}",providerDefault:"mặc định theo nhà cung cấp",back:"Quay lại",skip:"Bỏ qua",creating:"Đang tạo...",createVariant:"Tạo biến thể",skipHint:"Bỏ qua nếu bạn chỉ muốn thêm tài khoản mà không tạo biến thể"},customPresetDialog:{title:"Preset tùy chỉnh",presetNameOptional:"Tên preset (tùy chọn)",presetNamePlaceholder:"ví dụ: Preset tùy chỉnh của tôi",codexTipPrefix:"Mẹo Codex: hậu tố",codexTipSuffix:"nỗ lực ghim. Các mô hình không có hậu tố sử dụng cài đặt Tư duy.",defaultModel:"Mô hình mặc định",defaultModelDesc:"Dùng khi không yêu cầu cấp mô hình cụ thể",opusModel:"Opus (Có khả năng nhất)",opusModelDesc:"Đối với các nhiệm vụ lý luận phức tạp",sonnetModel:"Sonnet (Cân bằng)",sonnetModelDesc:"Cân bằng giữa tốc độ và khả năng",haikuModel:"Haiku (Nhanh)",haikuModelDesc:"Phản hồi nhanh cho các tác vụ đơn giản",cancel:"Hủy bỏ",savePreset:"Lưu preset",applyPreset:"Áp dụng cài sẵn"},componentModelSelector:{selectModel:"Chọn mô hình",availableModelsCount:"Mô hình khả dụng ({{count}})",preview:"Xem trước"},searchableSelect:{searchModels:"Tìm mô hình...",noResults:"Không tìm thấy kết quả phù hợp."},copilotSettings:{enableCopilot:"Bật Copilot",enableCopilotDesc:"Cho phép sử dụng đăng ký GitHub Copilot",basicSettings:"Cài đặt cơ bản",accountType:"Loại tài khoản",accountTypeIndividual:"Cá nhân",accountTypeBusiness:"Business",accountTypeEnterprise:"Enterprise",rateLimiting:"Giới hạn tỷ lệ",rateLimitSeconds:"Giới hạn tốc độ (giây)",noLimit:"Không giới hạn",waitOnRateLimit:"Chờ giới hạn tỷ lệ",waitOnRateLimitDesc:"Chờ thay vì lỗi khi đạt đến giới hạn",daemonSettings:"Cài đặt Daemon",autoStartDaemon:"Daemon tự động khởi động",autoStartDaemonDesc:"Bắt đầu copilot-api khi sử dụng hồ sơ"},providerModelSelector:{selectModel:"Chọn mô hình",noModelsForProvider:"Không có mô hình nào cho nhà cung cấp này",broken:"BROKEN",deprecated:"DEPRECATED",paid:"PAID",freeTier:"Gói miễn phí",paidTier:"Gói trả phí",modelKnownIssues:"Mô hình này có vấn đề đã biết",viewIssueDetails:"Xem chi tiết vấn đề",modelDeprecated:"Mô hình này không được dùng nữa",recommended:"Đề xuất",allModelsCount:"Tất cả mô hình ({{count}})",noModelsAvailable:"Không có mô hình khả dụng"},createAuthProfileDialog:{title:"Tạo tài khoản mới",description:"Hồ sơ xác thực yêu cầu đăng nhập Claude CLI. Chạy lệnh dưới đây trong terminal của bạn. Bạn có thể chỉnh sửa chế độ đồng bộ hóa, nhóm và độ liên tục sau này từ bảng Tài khoản.",profileName:"Tên hồ sơ",profileNamePlaceholder:"ví dụ: công việc, cá nhân, khách hàng",invalidProfileName:"Tên phải bắt đầu bằng một chữ cái và chỉ chứa các chữ cái, số, dấu gạch ngang hoặc dấu gạch dưới.",enableSharedHistory:"Bật đồng bộ hóa lịch sử chia sẻ với các tài khoản xác thực ccs khác",historySyncGroupOptional:"Nhóm đồng bộ hóa lịch sử (tùy chọn)",historySyncGroupPlaceholder:"default, sprint-a, client-x",historySyncGroupHint:"Để trống để sử dụng nhóm chia sẻ mặc định. Dấu cách được chuẩn hóa thành dấu gạch ngang.",deeperContinuity:"Nâng cao: chế độ liên tục sâu hơn",deeperContinuityHint:"Thêm đồng bộ cho session-env, file-history, shell-snapshots và todos. Thông tin xác thực vẫn tách biệt.",invalidContextGroup:"Nhóm phải bắt đầu bằng một chữ cái và chỉ sử dụng các chữ cái, số, dấu gạch ngang hoặc dấu gạch dưới (tối đa {{max}} ký tự).",command:"Lệnh",commandFallback:"ccs auth create <name>",afterRunPrefix:"Sau khi chạy lệnh:",afterRunStep1:"Hoàn tất đăng nhập Claude trong trình duyệt của bạn",afterRunStep2:"Quay lại đây và làm mới để xem tài khoản mới",poolingHint:"Muốn dùng định tuyến Claude OAuth dạng pool? Dùng CLIProxy Claude pool từ nút hành động ở trang Tài khoản.",close:"Đóng",copied:"Đã sao chép!",copyCommand:"Sao chép lệnh"},cliproxyModelCategory:{google:"Google (Gemini)",openai:"OpenAI (GPT)",anthropic:"Anthropic (Claude)",antigravity:"Antigravity",other:"Khác"},cliproxyOverviewComponents:{availableModels:"Mô hình khả dụng",noModelsAvailable:"Không có mô hình khả dụng",startSessionHint:"Bắt đầu phiên CLIProxy để tải danh sách mô hình khả dụng",totalCount:"tổng cộng {{count}}",availableThroughGroupedByProvider:"Các mô hình khả dụng qua {{backendLabel}}, được nhóm theo nhà cung cấp",moreCount:"+{{count}} thêm"},categorizedModelSelector:{selectModel:"Chọn mô hình",noModelsAvailable:"Không có mô hình khả dụng",modelPlaceholder:"Mô hình..."},openrouterQuickStart:{recommended:"Đề xuất",title:"Bắt đầu với OpenRouter",description:"Truy cập các mô hình {{modelCountLabel}} từ OpenAI, Anthropic, Google, Meta, v.v. - tất cả đều thông qua một API.",featureOneApi:"Một API cho mọi nhà cung cấp",featureTierMapping:"Ánh xạ tầng mô hình",profileCount:"{{count}} hồ sơ",profileCount_other:"{{count}} hồ sơ",selectProfileTitle:"Chọn một hồ sơ API",summaryDescriptionWithProfiles:"Bạn đã có {{count}} hồ sơ trong workspace này. Chọn một hồ sơ ở thanh bên trái để chỉnh sửa, hoặc tạo thêm hồ sơ mới tại đây.",summaryDescriptionWithProfiles_other:"Bạn đã có {{count}} hồ sơ trong workspace này. Chọn một hồ sơ ở thanh bên trái để chỉnh sửa, hoặc tạo thêm hồ sơ mới tại đây.",summaryDescriptionNoProfiles:"Dùng API Profiles cho các endpoint tương thích Anthropic. Dùng AI Providers cho Gemini, Codex, Claude, Vertex và các connector tương thích OpenAI.",openrouterModelsBadge:"{{modelCountLabel}} mô hình OpenRouter",runtimeProviderBadge:"Thiết lập nhà cung cấp runtime",runtimeProviderTitle:"Mở AI Providers",runtimeProviderDescription:"Quản lý khóa nhà cung cấp dùng chung và các connector runtime trước khi tạo API Profiles độc lập.",runtimeProviderFeatureConnectors:"Gemini, Codex, Claude, Vertex và các connector tương thích OpenAI",runtimeProviderFeatureSecrets:"Khóa dùng chung tách biệt khỏi từng API Profile",runtimeProviderFooter:"Phù hợp nhất khi nhiều hồ sơ cần dùng chung một cấu hình nhà cung cấp.",createOpenRouterProfile:"Tạo hồ sơ OpenRouter",getApiKeyAt:"Nhận khóa API của bạn tại",or:"hoặc",createCustomProfile:"Tạo hồ sơ API tùy chỉnh"},alibabaCodingPlanQuickStart:{recommended:"Đề xuất",title:"Dùng thử Alibaba Coding Plan",description:"Sử dụng Alibaba Cloud Coding Plan qua endpoint tương thích Anthropic cho tác vụ lập trình.",featureEndpoint:"Endpoint tương thích Anthropic",featureKeyFormat:"Khóa API sk-sp chuyên dụng",createAlibabaProfile:"Tạo hồ sơ Alibaba Coding Plan",readGuideAt:"Xem hướng dẫn tại"},alibabaCodingPlanPromo:{title:"Alibaba Coding Plan",subtitle:"Model Studio Coding Plan qua endpoint Anthropic",add:"Thêm"},credentialHealth:{title:"Tình trạng thông tin xác thực",ready:"Sẵn sàng",noCredentialsConfigured:"Không có thông tin xác thực nào được định cấu hình. Sử dụng các nút đăng nhập ở trên để xác thực.",neverUsed:"Chưa bao giờ sử dụng",justNow:"Vừa rồi",unknown:"Không xác định",daysAgo:"{{count}} ngày trước",hoursAgo:"{{count}} giờ trước",minutesAgo:"{{count}} phút trước"},proxyStatusWidget:{justNow:"vừa xong",minutesAgo:"{{count}} phút trước",hoursAgo:"{{count}} giờ trước",syncReady:"Sẵn sàng đồng bộ hóa",noConfig:"Không có cấu hình",remoteProxy:"Proxy từ xa",active:"Đang hoạt động",trafficAutoRouted:"Lưu lượng truy cập tự động được định tuyến đến máy chủ từ xa",tooltipSync:"Đồng bộ hóa hồ sơ với CLIProxy",tooltipRestart:"Khởi động lại",tooltipStop:"Dừng lại",tooltipClose:"Đóng",tooltipVersionSettings:"Cài đặt phiên bản",versionManagement:"Quản lý phiên bản",selectVersionPlaceholder:"Chọn phiên bản để cài đặt...",stable:"(ổn định)",install:"Cài đặt",versionsAboveUnstable:"Các phiên bản trên {{version}} có vấn đề đã biết",versionsKnownIssues:"Phiên bản {{version}} có vấn đề đã biết",lastChecked:"Đã kiểm tra lần cuối {{time}}",notRunning:"Không chạy",start:"Bắt đầu",port:"Cổng {{port}}",sessionCount:"{{count}} phiên",sessionCount_other:"{{count}} phiên",installFaultyTitle:"Cài đặt phiên bản có lỗi đã biết?",installFaultyDesc:"Bạn sắp cài đặt <strong>v{{version}}</strong>, phiên bản này nằm trong dải lỗi đã biết <strong>{{range}}</strong>.",installFaultyWarning:"Phiên bản này có lỗi đã biết và có thể cài đặt thất bại hoặc làm proxy ở trạng thái xấu.",installUnstableTitle:"Cài đặt phiên bản không ổn định?",installUnstableDesc:"Bạn sắp cài đặt <strong>v{{version}}</strong>, phiên bản này cao hơn phiên bản ổn định tối đa <strong>v{{maxStable}}</strong>.",installUnstableWarning:"Phiên bản này đã biết có vấn đề về độ ổn định và có thể gây ra hành vi không mong muốn.",installUnstableConfirm:"Bạn có chắc chắn muốn tiếp tục không?",cancel:"Hủy bỏ",installAnyway:"Vẫn cài đặt",clickToDowngrade:"Bấm để hạ cấp",clickToUpdate:"Bấm để cập nhật"},syncStatusCard:{profileSync:"Đồng bộ hồ sơ",ready:"Sẵn sàng",noConfig:"Không có cấu hình",syncsProfilesDesc:"Đồng bộ hóa cấu hình API với cấu hình CLIProxy cục bộ",runDoctorHint:"Chạy <code>ccs doctor --fix</code> để tạo cấu hình.",details:"Chi tiết",syncNow:"Đồng bộ ngay"},syncDialog:{title:"Đồng bộ hóa hồ sơ với CLIProxy cục bộ",description:"Đồng bộ hóa cấu hình API CCS của bạn với CLIProxy config.yaml cục bộ.",noProfiles:"Không có profile nào để đồng bộ.",createProfilesFirst:"Trước tiên hãy tạo hồ sơ API bằng tab Hồ sơ.",modelLabel:"Mô hình:",ready:"Sẵn sàng",profilesToSync_one:"{{count}} hồ sơ để đồng bộ hóa",profilesToSync_other:"{{count}} hồ sơ cần đồng bộ hóa",cancel:"Hủy bỏ",syncing:"Đang đồng bộ hóa...",synced:"Đã đồng bộ hóa!",syncNow:"Đồng bộ ngay"},errorLogs:{title:"Nhật ký lỗi",failedRequests_one:"{{count}} yêu cầu thất bại",failedRequests_other:"{{count}} yêu cầu thất bại",cliproxyDiagnostics:"Chẩn đoán CLIProxy",showingCount:"Hiển thị 50 trong số {{total}} nhật ký",selectLog:"Chọn nhật ký để xem chi tiết",failedLoadContent:"Không tải được nội dung nhật ký",copyAbsolutePath:"Sao chép đường dẫn tuyệt đối",copyRawContent:"Sao chép nội dung nhật ký thô",tabOverview:"Tổng quan",tabHeaders:"Tiêu đề",tabRequest:"Yêu cầu",tabResponse:"Phản hồi",tabRaw:"Raw",modelLabel:"Mô hình:",quotaResetsIn:"Quota sẽ được đặt lại sau",method:"Phương thức",provider:"Nhà cung cấp",version:"Phiên bản",endpoint:"Điểm cuối",url:"URL",timestamp:"Dấu thời gian",na:"không áp dụng",noHeaders:"Không có tiêu đề nào",noRequestBody:"Không có nội dung yêu cầu",noResponseBody:"Không có nội dung phản hồi",rateLimitedMsg:"Bị giới hạn tốc độ. Hãy chuyển sang tài khoản khác hoặc chờ reset hạn ngạch. Mô hình {{model}} đã hết quota.",rateLimitedMsgNoModel:"Bị giới hạn tốc độ. Hãy chuyển sang tài khoản khác hoặc chờ reset hạn ngạch.",authFailedMsg:"Xác thực không thành công. Xác thực lại thông qua Cài đặt CLIProxy hoặc kiểm tra khóa API.",notFoundMsg:"Không tìm thấy điểm cuối. Điểm cuối này có thể không tồn tại trên nhà cung cấp này.",serverErrorMsg:"Lỗi máy chủ từ upstream. Hãy thử lại sau hoặc kiểm tra trang trạng thái của nhà cung cấp.",timeoutMsg:"Yêu cầu hết thời gian chờ. Kiểm tra kết nối mạng hoặc tăng timeout.",unknown:"không rõ"},editAccountContext:{title:"Chỉnh sửa đồng bộ hóa lịch sử",description:'Định cấu hình cách "{{name}}" chia sẻ lịch sử và tính liên tục với các tài khoản xác thực ccs khác.',syncMode:"Chế độ đồng bộ",selectContextMode:"Chọn chế độ ngữ cảnh",isolatedOption:"tách biệt (không đồng bộ)",sharedOption:"chia sẻ (đã bật đồng bộ)",sharedModeHint:"Chế độ chia sẻ sử dụng lại ngữ cảnh không gian làm việc cho các tài khoản trong cùng một nhóm đồng bộ lịch sử.",isolatedModeHint:"Chế độ biệt lập giúp tài khoản này tách biệt hoàn toàn với các tài khoản xác thực ccs khác.",historySyncGroup:"Nhóm đồng bộ hóa lịch sử",groupPlaceholder:"mặc định",groupHint:"Chuẩn hóa thành chữ thường (dấu cách trở thành dấu gạch ngang). Được phép: chữ cái, số, _ , - (tối đa {{max}} ký tự).",invalidGroup:"Nhập tên nhóm hợp lệ bắt đầu bằng một chữ cái.",continuityDepth:"Độ sâu liên tục",selectContinuityDepth:"Chọn độ sâu liên tục",standardOption:"tiêu chuẩn (chỉ đồng bộ project)",deeperOption:"tính liên tục sâu hơn (nâng cao)",deeperHint:"Chế độ nâng cao cũng đồng bộ hóa phiên-env, lịch sử tệp, ảnh chụp nhanh shell và todos.",standardHint:"Chế độ tiêu chuẩn chỉ đồng bộ hóa bối cảnh không gian làm việc của dự án.",credentialsIsolated:"Thông tin xác thực và .anthropic vẫn được tách riêng cho mỗi tài khoản ở tất cả các chế độ.",cancel:"Hủy bỏ",save:"Lưu",saving:"Đang lưu..."},historySyncLearningMap:{title:"Cách đồng bộ hóa lịch sử hoạt động",description:"Tách biệt -> Chia sẻ -> Sâu hơn. Dùng Sync trên từng dòng để áp dụng thay đổi.",learningMap:"Bản đồ học tập",isolated:"Tách biệt",shared:"Chia sẻ",deeper:"Sâu hơn",cliproxyManaged_one:"{{count}} Tài khoản nhóm CLIProxy Claude được quản lý trong trang Action Center / CLIProxy.",cliproxyManaged_other:"{{count}} Tài khoản CLIProxy Claude pool được quản lý trong trang Action Center / CLIProxy.",showDetails:"Hiển thị chi tiết: nhóm, chuyển đổi và chính sách kế thừa",modeSwitch:"Chuyển đổi chế độ",modeSwitchDesc:"Hộp thoại đồng bộ hóa cho phép người dùng di chuyển giữa cách ly/chia sẻ và chọn tính liên tục sâu hơn.",historySyncGroup:"Nhóm đồng bộ hóa lịch sử",historySyncGroupDesc:"Cùng một nhóm nghĩa là chia sẻ cùng bối cảnh project. Nếu để trống sẽ dùng nhóm mặc định.",legacyConfirmation_one:"{{count}} tài khoản cũ vẫn cần xác nhận rõ ràng.",legacyConfirmation_other:"{{count}} tài khoản cũ vẫn cần xác nhận rõ ràng."},accountsTable:{name:"Tên",type:"Kiểu",defaultBadge:"mặc định",created:"Ngày tạo",lastUsed:"Được sử dụng lần cuối",historySync:"Đồng bộ hóa lịch sử",actions:"Hành động",syncTitle:"Chỉnh sửa chế độ đồng bộ, nhóm và độ sâu liên tục",confirmLegacyTitle:"Xác nhận chế độ hiện tại của tài khoản cũ này là rõ ràng",sync:"Đồng bộ hóa",confirm:"Xác nhận",active:"Đang hoạt động",setDefault:"Đặt mặc định",deleteAccount:"Xóa tài khoản",cannotDeleteDefault:"Không thể xóa tài khoản mặc định",noAccounts:"Không tìm thấy tài khoản xác thực CCS nào. Sử dụng ccs auth create để thêm tài khoản.",resetToDefault:"Đặt lại về mặc định CCS",deleteDialogTitle:"Xóa tài khoản",deleteDialogDesc:'Bạn có chắc chắn muốn xóa tài khoản "{{name}}" không? Thao tác này sẽ xóa hồ sơ và tất cả dữ liệu phiên của nó. Không thể hoàn tác hành động này.',cancel:"Hủy bỏ",delete:"Xóa",sharedGroupStandard:"chia sẻ ({{group}}, tiêu chuẩn)",sharedGroupDeeper:"chia sẻ ({{group}}, sâu hơn)",sharedGroupLegacy:"chia sẻ ({{group}}, kế thừa tiêu chuẩn)",isolatedLegacy:"tách biệt (mặc định cũ)",isolated:"tách biệt"},addAccountDialog:{title:"Thêm tài khoản {{displayName}}",descKiro:"Chọn phương thức xác thực Kiro, sau đó xác thực qua trình duyệt hoặc nhập từ Kiro IDE.",descDeviceCode:"Nhấp vào Xác thực. Mã xác minh sẽ xuất hiện để bạn nhập vào trang web của nhà cung cấp.",descOauth:"Nhấp vào Xác thực để nhận URL OAuth. Mở nó trong bất kỳ trình duyệt nào để đăng nhập.",powerUserEnabled:"Đã bật chế độ power user",powerUserSkipped:"Chế độ power user trong Cài đặt > Proxy đang bỏ qua danh sách kiểm tra trách nhiệm AGY và bước nhập cụm từ rủi ro của Gemini trên dashboard. Bạn tự chịu hoàn toàn rủi ro OAuth/tài khoản.",powerUserLoadFailed:"Không thể tải cài đặt chế độ power user. Hãy kiểm tra Cài đặt > Proxy rồi thử lại.",powerUserLoading:"Đang tải cài đặt an toàn cho chế độ power user. Vui lòng đợi một chút rồi thử lại.",powerUserUnavailableRetry:"Chế độ power user hiện không khả dụng. Hãy hoàn tất bước an toàn bắt buộc của nhà cung cấp rồi thử lại.",authMethod:"Phương thức xác thực",selectKiroAuthMethod:"Chọn phương thức xác thực Kiro",nicknameRequired:"Biệt danh (bắt buộc)",nicknameOptional:"Biệt danh (tùy chọn)",nicknamePlaceholder:"ví dụ: công việc, cá nhân",nicknameRequiredHint:"Bắt buộc với nhà cung cấp này. Dùng tên thân thiện duy nhất (ví dụ: work, personal).",nicknameOptionalHint:"Tên thân thiện để nhận biết tài khoản này. Để trống để dùng mã nhận dạng an toàn do hệ thống tạo.",waitingForAuth:"Đang chờ xác thực...",deviceCodeHint:"Hộp thoại mã xác minh sẽ sớm xuất hiện. Nhập mã trên trang web của nhà cung cấp.",browserHint:"Hoàn tất xác thực trong trình duyệt của bạn. Hộp thoại này sẽ tự động đóng lại.",openUrlLabel:"Mở URL này trong bất kỳ trình duyệt nào để đăng nhập:",copied:"Đã sao chép",copy:"Sao chép",open:"Mở",popupBlocked:"Cửa sổ bật lên bị chặn. Sao chép URL ở trên và mở thủ công trong trình duyệt của bạn.",redirectPasteLabel:"Chuyển hướng không hoạt động? Dán URL gọi lại:",callbackPlaceholder:"Dán URL chuyển hướng vào đây...",submitCallback:"Gửi cuộc gọi lại",submitting:"Đang gửi...",preparingUrl:"Đang chuẩn bị URL đăng nhập...",cancel:"Hủy bỏ",importingToken:"Đang nhập token từ Kiro IDE...",authenticate:"Xác thực",importFromIde:"Nhập từ IDE",importing:"Đang nhập..."},flowViz:{backToProviders:"Quay lại nhà cung cấp",showDetails:"Hiển thị chi tiết",hideDetails:"Ẩn chi tiết",resetLayout:"Đặt lại bố cục",provider:"Nhà cung cấp",totalRequests:"Tổng số yêu cầu",accounts:"Tài khoản",connectionTimeline:"Dòng thời gian kết nối",noRecentConnections:"Không có kết nối gần đây"},quickStats:{totalRequests:"Tổng số yêu cầu",successRate:"Tỷ lệ thành công",totalTokens:"Tổng số token",activeModels:"Mô hình hoạt động"},authMonitor:{accounts:"Tài khoản",accountsCount:"{{count}} tài khoản",success:"Thành công",failed:"Thất bại",successRate:"Tỷ lệ thành công"},accountCard:{resumeAccount:"Tiếp tục tài khoản",pauseAccount:"Tạm dừng tài khoản",quotaLoading:"Hạn ngạch...",quota:"hạn ngạch",quotaUnavailable:"Thông tin quota chưa khả dụng",reauthNeeded:"Cần xác thực lại",failureLabelReauth:"Xác thực lại",failureLabelWorkspace:"Workspace",failureLabelNoAccess:"Không có quyền",failureLabelRetry:"Thử lại",failureLabelReconnect:"Kết nối lại",failureLabelTemporary:"Tạm thời",failureLabelUnavailable:"Chưa khả dụng",failureHintReauth:"Chạy lại luồng xác thực của tài khoản này để làm mới quyền truy cập.",failureHintWorkspace:"Chuyển tài khoản này về workspace còn hoạt động rồi xóa và thêm lại.",failureHintNoAccess:"Tài khoản này không thể truy cập endpoint quota của nhà cung cấp.",failureHintRetry:"Đợi một chút rồi thử lại yêu cầu quota.",failureHintReconnect:"Xóa tài khoản cũ rồi xác thực lại.",failureHintTemporary:"Có vẻ đây là lỗi tạm thời. Hãy thử lại sau.",removeAndReadd:"Xóa và thêm lại tài khoản",autoRefreshFailed:"Tự động làm mới không thành công"},antigravityChecklist:{title:"Trách nhiệm OAuth Antigravity",subtitle:"Hoàn thành tất cả 4 bước trước khi bạn có thể xác thực.",mandatory:"Bắt buộc",completion:"Hoàn thành",stepsCount:"{{current}}/4 bước"},accountSafetyWarning:{title:"Cảnh báo an toàn tài khoản OAuth",subtitle:"Vấn đề #509 · Rủi ro Gemini + AGY OAuth",firstLine:"Issue #509 ghi nhận các trường hợp bị đình chỉ/cấm liên quan đến ccs agy và việc dùng chung tài khoản giữa ccs gemini và ccs agy.",secondLine:"Chỉ tiếp tục nếu bạn chấp nhận hoàn toàn trách nhiệm về OAuth và rủi ro truy cập tài khoản.",issueLabel:"Đọc vấn đề #509",proxySettingsLabel:"Điều khiển Gemini + AGY: Cài đặt > Proxy"},cliproxyDialog:{name:"Tên",provider:"Nhà cung cấp",account:"Tài khoản",accountOptional:"Tài khoản (tùy chọn)",model:"Mô hình",modelOptional:"Mô hình (tùy chọn)",defaultTarget:"Mục tiêu mặc định",defaultTier:"Cấp mặc định",tierConfig:"Cấu hình cấp độ",selectProvider:"Chọn nhà cung cấp...",useDefaultAccount:"Sử dụng tài khoản mặc định",defaultSuffix:"(mặc định)",opus:"Opus",sonnet:"Sonnet",haiku:"Haiku",claudeCode:"Claude Code",factoryDroid:"Factory Droid",cancel:"Hủy bỏ",create:"Tạo",creating:"Đang tạo...",saveChanges:"Lưu thay đổi",saving:"Đang lưu...",placeholderName:"Gemini của tôi",placeholderModel:"gemini-2.5-pro",placeholderComposite:"my-composite",placeholderModelId:"model-id",placeholderAccountId:"account-id",editCompositeTitle:"Chỉnh sửa biến thể tổng hợp: {{name}}",editSingleTitle:"Chỉnh sửa biến thể: {{name}}"},profileEditor:{profileInfo:"Thông tin hồ sơ",profileName:"Tên hồ sơ",filePath:"Đường dẫn tệp",lastModified:"Sửa đổi lần cuối",defaultTarget:"Mục tiêu mặc định",quickUsage:"Sử dụng nhanh",runWithProfile:"Chạy với hồ sơ",runOnDroid:"Chạy trên Droid",runOnDroidWithFlag:"Chạy trên Droid (--target)",droidAliasExplicit:"Bí danh Droid (rõ ràng)",overrideToClaude:"Ghi đè lên Claude",overrideToClaudeExplicit:"Ghi đè lên Claude (rõ ràng)",targetHintPreferredAlias:"Bí danh rõ ràng nên dùng:",targetHintClaudeDefault:"Lệnh mặc định:",targetHintLegacyAlias:"Lối tắt cũ vẫn dùng được:",targetHintOverride:"Bạn vẫn có thể ghi đè mỗi lần chạy bằng",setAsDefault:"Đặt làm mặc định",provider:"Nhà cung cấp",custom:"Tùy chỉnh",providerChooserHint:"Bắt đầu với preset, sau đó bạn vẫn có thể chỉnh URL, API key và ánh xạ mô hình.",featuredProviders:"Nhà cung cấp nổi bật",scrollHint:"Có thể cuộn ngang trên màn hình hẹp",customEndpoint:"Endpoint tùy chỉnh",morePresets:"Thêm preset",customEndpointDescription:"Bắt đầu với URL tương thích Anthropic trống và tự cấu hình mọi thứ."},settings:{sectionLoadFailed:"Không tải được phần",unknownError:"Đã xảy ra lỗi không xác định",reloadPage:"Tải lại trang",refresh:"Làm mới",copy:"Sao chép",copied:"Đã sao chép",saved:"Đã lưu",loading:"Đang tải...",configFileNotFound:"Không tìm thấy tập tin cấu hình"},settingsTabs:{web:"Web",env:"Env",think:"Tư duy",proxy:"Proxy",auth:"Xác thực",backup:"Sao lưu"},settingsAuth:{failedFetchTokens:"Không thể tải token xác thực",failedSaveTokens:"Không thể lưu token",tokensUpdated:"Đã cập nhật token. Khởi động lại CLIProxy để áp dụng.",failedRegenerate:"Không thể tạo lại bí mật",secretRegenerated:"Bí mật quản lý mới được tạo. Khởi động lại CLIProxy để áp dụng.",failedReset:"Không thể đặt lại token",tokensReset:"Token đã được đặt lại về mặc định. Khởi động lại CLIProxy để áp dụng.",description:"Cấu hình token xác thực CLIProxy. Các thay đổi yêu cầu khởi động lại CLIProxy.",apiKey:"Khóa API",custom:"Tùy chỉnh",apiKeyDesc:"Được Claude Code dùng để xác thực qua CLIProxy",apiKeyPlaceholder:"Khóa API",managementSecret:"Bí mật quản lý",managementSecretDesc:"Được bảng điều khiển CCS sử dụng để truy cập API quản lý CLIProxy",managementSecretPlaceholder:"Bí mật quản lý",generateSecret:"Tạo bí mật an toàn mới",resetDefaults:"Đặt lại về mặc định",resetDesc:"Đặt lại cả khóa API và bí mật quản lý về giá trị mặc định.",saving:"Đang lưu...",save:"Lưu"},settingsGlobalEnv:{description:"Biến môi trường được áp dụng cho tất cả hồ sơ không dùng Claude subscription (gemini, codex, agy, ghcp, v.v.)",enabled:"Đã bật Env toàn cầu",disabled:"Env toàn cầu bị vô hiệu hóa",enabledDesc:"Biến Env sẽ được áp dụng cho các hồ sơ bên thứ ba",disabledDesc:"Biến Env sẽ không được áp dụng",envVars:"Biến môi trường",noneConfigured:"Không có biến môi trường nào được cấu hình",addNew:"Thêm biến mới",keyName:"KEY_NAME",value:"giá trị",add:"Thêm",quickAdd:"Thêm nhanh các biến phổ biến",allConfigured:"Tất cả biến phổ biến đã được cấu hình"},settingsBackups:{failedFetch:"Không tìm nạp được bản sao lưu",failedRestore:"Không thể khôi phục bản sao lưu",restoreSuccess:"Đã khôi phục bản sao lưu thành công",title:"Sao lưu cài đặt",description:"Khôi phục các phiên bản trước của tệp settings.json của bạn. Bản sao lưu được tạo tự động khi cài đặt được sửa đổi.",none:"Không có bản sao lưu nào",noneHint:"Bản sao lưu sẽ xuất hiện ở đây khi bạn sửa đổi cài đặt",latest:"Mới nhất",restoring:"Đang khôi phục...",restore:"Khôi phục",restoreConfirmTitle:"Khôi phục bản sao lưu?",restoreConfirmPrefix:"Điều này sẽ thay thế cài đặt hiện tại của bạn bằng bản sao lưu từ",restoreConfirmSuffix:"Không thể hoàn tác hành động này.",cancel:"Hủy bỏ"},settingsWebsearch:{description:"Tìm kiếm trên web dựa trên CLI cho hồ sơ của bên thứ ba (gemini, codex, agy, v.v.)",enabled:"Đã bật Tìm kiếm trên web",disabled:"Tìm kiếm trên web bị vô hiệu hóa",checking:"Đang kiểm tra trạng thái...",providers:"Nhà cung cấp",noneConfigured:"Không có nhà cung cấp nào được cấu hình",noneConfiguredHint:"Cài công cụ CLI để bật các nhà cung cấp WebSearch",checkProviders:"Kiểm tra các nhà cung cấp",installed:"đã cài đặt",notInstalled:"chưa được cài đặt",model:"Mô hình:",howInstall:"Cách cài đặt {{name}} CLI",installGlobally:"Cài đặt trên toàn cầu",requiresKey:"(cần khóa API xAI)",freeTier:"(Có sẵn cấp MIỄN PHÍ)",viewDocs:"Xem tài liệu"},settingsProxy:{failedLoadAgyMode:"Không thể tải chế độ power user",failedUpdateAgyMode:"Không thể cập nhật chế độ power user",failedVerifyAgyMode:"Không thể xác minh trạng thái lưu của chế độ power user",notPersistedAgyMode:"Chế độ power user chưa được lưu bền vững. Cấu hình có thể đã bị tiến trình khác sửa.",agyModeEnabled:"Đã bật chế độ power user.",agyModeDisabled:"Đã tắt chế độ power user.",typePhraseToContinue:'Nhập "{{value}}" để tiếp tục.',description:"Định cấu hình kết nối {{backend}} cục bộ hoặc từ xa cho cấu hình dựa trên proxy",backendPlus:"CLIProxy Plus",backend:"CLIProxy",instanceStatus:"Trạng thái phiên bản",connectionMode:"Chế độ kết nối",local:"Cục bộ",remote:"Từ xa",localDesc:"Chạy nhị phân {{backend}} trên máy này",remoteDesc:"Kết nối với máy chủ {{backend}} từ xa",backendBinary:"Tệp thực thi backend",stopProxyToSwitch:"Dừng proxy đang chạy trong Trạng thái phiên bản trước khi chuyển backend.",default:"Mặc định",plusDesc:"Hỗ trợ đầy đủ nhà cung cấp, bao gồm Kiro và GitHub Copilot",originalDesc:"Binary gốc (chỉ Gemini, Codex, Antigravity)",variantsIncompatible:"Các biến thể Kiro/Copilot hiện tại sẽ không hoạt động với CLIProxyAPI. Chuyển sang CLIProxyAPIPlus hoặc xóa các biến thể đó.",safety:"An toàn",agyModeTitle:"Chế độ power user Antigravity + Gemini",agyModeDesc:"Bỏ qua danh sách kiểm tra trách nhiệm AGY và bước nhập cụm từ xác nhận của Gemini trên dashboard.",agyWarning:"Chỉ bật nếu bạn hiểu rõ rủi ro bị đình chỉ/cấm OAuth (#509). CCS không chịu trách nhiệm khi mất tài khoản.",finalConfirm:"Xác nhận cuối cùng",finalConfirmDesc:"Việc bật tính năng này sẽ bỏ qua các điểm kiểm tra an toàn AGY và bước nhập cụm từ rủi ro của Gemini trên dashboard. Xem lại vấn đề #509 và nhập cụm từ chính xác để tiếp tục.",step1:"Bước 1",readIssue:"Đọc vấn đề #509",step2:"Bước 2",typePrefix:"Nhập",typeSuffix:"để kích hoạt.",typePhraseAria:"Nhập I ACCEPT RISK để bật chế độ power user Antigravity + Gemini",exactPhrase:"Phải nhập chính xác cụm từ.",enableAgyMode:"Bật chế độ power user Antigravity + Gemini",toggleAgyMode:"Chuyển đổi chế độ power user Antigravity + Gemini",fallbackSettings:"Cài đặt dự phòng",enableFallback:"Cho phép dự phòng về cục bộ",enableFallbackDesc:"Sử dụng proxy cục bộ nếu không thể truy cập được từ xa",autoStartLocal:"Tự động khởi động proxy cục bộ",autoStartLocalDesc:"Tự động khởi động proxy cục bộ khi dự phòng",advanced:"Nâng cao",debugMode:"Chế độ gỡ lỗi",debugModeDesc:"Bật chẩn đoán dành cho nhà phát triển trong bảng điều khiển trình duyệt",debugModeEnabled:"Đã bật chế độ gỡ lỗi. Kiểm tra bảng điều khiển trình duyệt để biết nhật ký chi tiết.",localProxy:"Proxy cục bộ",port:"Cổng",autoStart:"Tự động khởi động",localAutoStartDesc:"Tự động khởi động proxy cục bộ khi cần",remoteConfigTitle:"Cấu hình máy chủ từ xa",host:"Host",hostPlaceholder:"192.168.1.100 hoặc proxy.example.com",defaultPort:"mặc định {{value}}",portPlaceholder:"Để trống để dùng {{value}}",protocol:"Giao thức",http:"HTTP",https:"HTTPS",apiKeyOptional:"Khóa API (tùy chọn)",apiKeyPlaceholder:"Đối với điểm cuối API /v1/*",apiKeyDesc:"Dùng cho các yêu cầu API đến /v1/chat/completions",managementKeyOptional:"Khóa quản lý (tùy chọn)",managementKeyPlaceholder:"Đối với điểm cuối /v0/management/*",managementKeyDesc:"Dùng cho API quản lý dashboard. Nếu bỏ trống sẽ dùng Khóa API.",testing:"Đang thử nghiệm...",testConnection:"Kiểm tra kết nối",connectedLatency:"Đã kết nối ({{value}}ms)",connectionFailed:"Kết nối không thành công",invalidPortOrEmpty:"Cổng phải là số nguyên từ 1 đến 65535 hoặc để trống theo mặc định",invalidLocalPort:"Cổng cục bộ phải là số nguyên từ 1 đến 65535",backendPlusApi:"CLIProxyAPIPlus",backendApi:"CLIProxyAPI"},settingsThinking:{description:"Định cấu hình tư duy/lý luận mở rộng cho các mô hình được hỗ trợ.",supportedProviders:"Nhà cung cấp được hỗ trợ",modeTitle:"Chế độ Thinking",modeAutoDesc:"Tự động thiết lập tư duy dựa trên tầng mô hình",modeOffDesc:"Vô hiệu hóa suy nghĩ mở rộng",modeManualDesc:"Đặt mức ghi đè liên tục hoặc sử dụng cờ CLI mỗi lần chạy",tierDefaults:"Mặc định cấp độ",tierDefaultsDesc:"Mức độ tư duy mặc định cho từng tầng mô hình khi ở chế độ tự động.",persistentOverride:"Ghi đè liên tục",persistentOverrideDesc:"Áp dụng cho tất cả các buổi. Cờ CLI vẫn được ưu tiên.",enterCustomBudget:"Nhập ngân sách tùy chỉnh",apply:"Áp dụng",providerOverrides:"Ghi đè nhà cung cấp ({{count}})",providerOverridesDesc:"Ghi đè mặc định cấp độ cho các nhà cung cấp cụ thể. Thêm khóa nhà cung cấp tùy chỉnh nếu cần.",addProviderPlaceholder:"Thêm khóa nhà cung cấp (ví dụ: qwen)",showWarnings:"Hiển thị cảnh báo",showWarningsDesc:"Hiển thị cảnh báo khi các giá trị suy nghĩ bị hạn chế hoặc điều chỉnh",cliEnvOverride:"Ghi đè CLI & Env",supportLine1Prefix:"Ngân sách suy nghĩ:",supportLine1Suffix:"(dựa trên token)",supportLine2Prefix:"Nỗ lực lý luận:",supportLine2SuffixPrefix:"(hậu tố hoặc ",supportLine2SuffixPostfix:": minimal/low/medium/high/xhigh)",supportLine3Prefix:"Hậu tố Codex cố định mức effort (ví dụ ",supportLine3Suffix:"); model không hậu tố sẽ dùng chế độ Thinking."},analytics:{title:"Phân tích",subtitle:"Theo dõi việc sử dụng và thông tin chi tiết",month:"Tháng",allTime:"Tất cả thời gian",updated:"Đã cập nhật {{value}}"},analyticsSummary:{totalTokens:"Tổng số token",totalTokensSubtitle:"{{input}} vào / {{output}} ra",totalCost:"Tổng chi phí",totalCostSubtitle:"trung bình ${{value}}/ngày",cacheTokens:"Token bộ đệm",cacheTokensSubtitle:"${{cost}} ({{percent}}% chi phí)",inputCost:"Chi phí đầu vào",outputCost:"Chi phí đầu ra",tokensSubtitle:"{{value}} token"},apiProfiles:{title:"Hồ sơ API",new:"Mới",searchPlaceholder:"Tìm kiếm hồ sơ...",loadingProfiles:"Đang tải hồ sơ...",failedLoadTitle:"Không tải được hồ sơ",failedLoadDesc:"Không thể tìm nạp hồ sơ API. Vui lòng thử lại.",retry:"Thử lại",noProfilesYet:"Chưa có hồ sơ API nào",noProfilesDesc:"Tạo hồ sơ đầu tiên của bạn để kết nối với các điểm cuối API tùy chỉnh",createProfile:"Tạo hồ sơ",noProfileMatch:'Không có hồ sơ nào khớp với "{{query}}"',profileCount:"{{count}} hồ sơ",profileCount_other:"{{count}} hồ sơ",configuredCount:"{{count}} đã cấu hình",deleteProfileTitle:"Xóa hồ sơ",deleteProfileDesc:'Bạn có chắc chắn muốn xóa "{{name}}" không? Thao tác này sẽ xóa tệp cài đặt và không thể hoàn tác.',delete:"Xóa",unsavedChangesTitle:"Những thay đổi chưa được lưu",unsavedChangesDesc:'Bạn có những thay đổi chưa được lưu trong "{{current}}". Hủy và chuyển sang "{{next}}"?',discardSwitch:"Loại bỏ và chuyển đổi"},accountsPage:{title:"Tài khoản",managePrefix:"Quản lý",manageSuffix:"tài khoản và nhóm đồng bộ từ một nơi.",mobileManageSuffix:"tính liên tục cho mỗi tài khoản.",primaryActions:"Hành động chính",createAccount:"Tạo tài khoản",authClaudeInPool:"Xác thực Claude trong Pool",openClaudePoolSettings:"Mở cài đặt Claude pool",openCliProxyClaudePool:"Mở CLIProxy Claude Pool",migrationFollowup:"Theo dõi sau di chuyển",legacyContextPending:"{{count}} tài khoản vẫn cần xác nhận chế độ lần đầu.",legacyContextPending_other:"{{count}} tài khoản vẫn cần xác nhận chế độ lần đầu.",legacyContinuityPending:"{{count}} tài khoản được chia sẻ vẫn ở mức độ liên tục kế thừa tiêu chuẩn.",legacyContinuityPending_other:"{{count}} tài khoản được chia sẻ vẫn ở mức độ liên tục kế thừa tiêu chuẩn.",confirmingLegacy:"Đang xác nhận chính sách kế thừa...",confirmLegacy:"Xác nhận chính sách kế thừa ({{count}})",noLegacyFollowup:"Không có hoạt động theo dõi kế thừa nào đang chờ xử lý.",continuityGuide:"Hướng dẫn liên tục",expandWhenNeeded:"Chỉ mở rộng khi cần thiết.",sharedStandard:"Tiêu chuẩn chung",sharedStandardDesc:"Chỉ đồng bộ hóa không gian làm việc của dự án. Mặc định tốt nhất cho hầu hết các đội.",sharedDeeper:"Chia sẻ sâu hơn",sharedDeeperPrefix:"Thêm",isolated:"Tách biệt",isolatedDesc:"Không có liên kết. Tốt nhất cho sự tách biệt nghiêm ngặt.",quickCommands:"Lệnh nhanh",quickCommandsDesc:"Sao chép và chạy trong terminal.",workspaceBadge:"Không gian làm việc `ccs auth`",historySyncBadge:"Kiểm soát đồng bộ hóa lịch sử",authAccounts:"Tài khoản xác thực",tableScopePrefix:"Bảng này được cố ý đặt trong phạm vi",tableScopeMiddle:"tài khoản. Sử dụng",tableScopeSuffix:"để thay đổi chế độ/nhóm/độ sâu.",accountMatrix:"Ma trận tài khoản",sharedTotalDesc:"Tổng số tài khoản chia sẻ: {{count}}. Bao gồm thao tác Sync và xác nhận kế thừa.",loadingAccounts:"Đang tải tài khoản..."},health:{justNow:"vừa xong",secondsAgo:"{{count}} giây trước",minutesAgo:"{{count}} phút trước",hoursAgo:"{{count}} giờ trước",systemHealth:"Tình trạng hệ thống",build:"bản dựng {{version}}",lastScan:"Lần quét cuối cùng:",autoRefresh:"Tự động làm mới:",refresh:"Làm mới",checks:"Kiểm tra",version:"Phiên bản",platform:"Nền tảng",liveMonitoring:"Giám sát trực tiếp đang hoạt động",copied:"Đã sao chép vào bảng nhớ tạm",refreshing:"Đang làm mới kiểm tra trạng thái...",fix:"Sửa chữa",applyFix:"Áp dụng bản sửa lỗi",healthLabel:"trạng thái"},updates:{actionRequired:"Hành động bắt buộc",done:"Xong",all:"Tất cả",inboxTitle:"Trung tâm cập nhật",inboxSubtitle:"Tập trung vào các hành động, sau đó đánh dấu các cập nhật đã hoàn tất hoặc bị loại bỏ.",needsAction:"Cần hành động",doneCount:"Xong",searchPlaceholder:"Tìm kiếm hành động hoặc lệnh",noNotices:"Không có thông báo nào khớp với chế độ xem này.",noUpdates:"Hiện không có bản cập nhật nào.",published:"Đã xuất bản {{date}}",markDone:"Đánh dấu hoàn tất",dismiss:"Ẩn",reopen:"Mở lại",doNext:"Làm tiếp theo",impactedIntegrations:"Tích hợp bị ảnh hưởng",impactedDesc:"Các khu vực liên quan dựa trên phạm vi cập nhật và định tuyến.",whyMatters:"Tại sao nó quan trọng",whyMattersDesc:"Chỉ ngữ cảnh ngắn, không có ghi chú phát hành trên tường văn bản.",open:"Mở",progressNeedsAction:"Cần hành động",progressInReview:"Đang xem xét",progressDone:"Xong",progressDismissed:"Bị loại bỏ",statusNew:"Mới",statusStable:"Ổn định",statusPlanned:"Đã lên kế hoạch",dashboard:"Trang tổng quan",cliUsage:"Cách sử dụng CLI"},cliproxyPage:{connected:"Đã kết nối",notConnected:"Chưa kết nối",variant:"Biến thể",parentNotConnected:"Profile gốc chưa kết nối",viaProvider:"qua {{provider}}",emptyTitle:"Trình quản lý hồ sơ CCS",emptyDesc:"Quản lý xác thực OAuth, tùy chọn tài khoản và chọn mô hình cho nhà cung cấp CLIProxy. Cấu hình cách CCS định tuyến yêu cầu đến các backend AI khác nhau.",emptyControlPanelPrefix:"Để biết số liệu thống kê sử dụng trực tiếp và theo dõi thời gian thực, hãy truy cập",controlPanel:"Bảng điều khiển",quickSetup:"Thiết lập nhanh",accountManagement:"Quản lý tài khoản cấp CCS",providers:"Nhà cung cấp",variants:"Biến thể",providerCount:"{{count}} nhà cung cấp",providerCount_other:"{{count}} nhà cung cấp",connectedCount:"{{count}} đã kết nối",variantDisplay:"{{name}} (biến thể {{provider}})"},copilotPage:{title:"Copilot",subtitle:"Proxy GitHub Copilot",setup:"Cài đặt",auth:"Xác thực",daemon:"Daemon",unofficialTitle:"API không chính thức - Bạn phải tự chịu rủi ro khi sử dụng",unofficialItem1:"API được thiết kế ngược - có thể bị hỏng bất cứ lúc nào",unofficialItem2:"Việc sử dụng quá mức có thể gây ra hạn chế tài khoản",unofficialItem3:"Không bảo hành, không chịu trách nhiệm từ CCS",yes:"Có",no:"Không",installed:"Đã cài đặt",missing:"Thiếu",integration:"Tích hợp",enabled:"Đã bật",disabled:"Đã tắt",github:"GitHub",connected:"Đã kết nối",notConnected:"Chưa kết nối",authenticate:"Xác thực",authenticating:"Đang xác thực...",status:"Trạng thái",running:"Đang chạy",stopped:"Đã dừng",port:"Cổng",stopping:"Đang dừng...",stop:"Dừng lại",starting:"Đang bắt đầu...",start:"Bắt đầu",installing:"Đang cài đặt...",installCopilotApi:"Cài đặt copilot-api",proxy:"Proxy",active:"Đang hoạt động",inactive:"Không hoạt động"},cursorPage:{title:"Cursor",beta:"Beta",subtitle:"Bảng điều khiển tích hợp Cursor",unofficialTitle:"API không chính thức - Bạn phải tự chịu rủi ro khi sử dụng",unofficialItem1:"Tích hợp thiết kế ngược có thể bị hỏng bất cứ lúc nào",unofficialItem2:"Lạm dụng hoặc sử dụng quá mức có thể có nguy cơ bị hạn chế tài khoản",unofficialItem3:"Không bảo hành, không chịu trách nhiệm từ CCS",integration:"Tích hợp",authentication:"Xác thực",daemon:"Daemon",enabled:"Đã bật",disabled:"Đã tắt",expired:"Hết hạn",connected:"Đã kết nối",notConnected:"Chưa kết nối",running:"Đang chạy",stopped:"Đã dừng",actions:"Hành động",disableIntegration:"Vô hiệu hóa tích hợp",enableIntegration:"Kích hoạt tích hợp",autoDetectAuth:"Tự động phát hiện xác thực",manualAuthImport:"Nhập xác thực thủ công",stopDaemon:"Dừng Daemon",startDaemon:"Khởi động Daemon",port:"Cổng",configuration:"Cấu hình Cursor",lastModified:"Sửa đổi lần cuối:",neverSaved:"Chưa bao giờ lưu",saving:"Đang lưu...",save:"Lưu",modelConfig:"Cấu hình mô hình",settings:"Cài đặt",info:"Thông tin",presets:"Cài đặt sẵn",presetsDesc:"Áp dụng ánh xạ mô hình được cấu hình sẵn",modelMapping:"Ánh xạ mô hình",modelMappingDesc:"Định cấu hình mô hình nào sẽ sử dụng cho từng tầng",defaultModel:"Mô hình mặc định",defaultModelDesc:"Dùng khi không chỉ định tier cụ thể.",opusModel:"Opus (Có khả năng nhất)",opusModelDesc:"Lý luận phức tạp và phản hồi chất lượng cao nhất.",sonnetModel:"Sonnet (Cân bằng)",sonnetModelDesc:"Khối lượng công việc mã hóa chung và trò chuyện hàng ngày.",haikuModel:"Haiku (Nhanh)",haikuModelDesc:"Đường dẫn yêu cầu nhẹ, độ trễ thấp.",runtimeSettings:"Cài đặt thời gian chạy",autoStartDaemon:"Daemon tự động khởi động",autoStartDesc:"Tự động khởi động daemon Cursor khi dùng tích hợp.",ghostMode:"Chế độ ma",ghostModeDesc:"Gửi x-ghost-mode để giảm telemetry.",provider:"Nhà cung cấp",filePath:"Đường dẫn tệp",availableModels:"Mô hình khả dụng",loadingModels:"Đang tải mô hình...",noModels:"Chưa có siêu dữ liệu mô hình nào. Bắt đầu daemon và làm mới.",default:"Mặc định",rawConfiguration:"Cấu hình thô (JSON)",manualImportTitle:"Nhập xác thực Cursor thủ công",manualImportDesc:"Cung cấp access token và machine ID của Cursor nếu không tự phát hiện được.",accessToken:"Access token",accessTokenPlaceholder:"Dán access token của Cursor",machineId:"ID máy",machineIdPlaceholder:"Hex 32 ký tự (UUID không có dấu gạch nối)",cancel:"Hủy bỏ",import:"Nhập",selectModel:"Chọn mô hình",useDefaultModel:"Sử dụng mô hình mặc định",availableModelCount:"Mô hình khả dụng ({{count}})",invalidPort:"Cổng phải là số nguyên từ 1 đến 65535",defaultModelRequired:"Mô hình mặc định là bắt buộc",savedConfig:"Đã lưu cấu hình Cursor và ánh xạ mô hình",failedSaveConfig:"Không lưu được cấu hình",modelsLoadingWait:"Mô hình vẫn đang tải. Vui lòng đợi trước khi áp dụng preset.",noModelsAvailable:"Chưa có mô hình nào. Hãy khởi động daemon rồi làm mới.",appliedCodexPreset:"Đã áp dụng preset Codex GPT-5.3",appliedClaudePreset:"Đã áp dụng preset Claude 4.6",appliedGeminiPreset:"Đã áp dụng preset Gemini 3",integrationEnabled:"Đã bật tích hợp Cursor",integrationDisabled:"Đã tắt tích hợp Cursor",failedUpdateIntegration:"Không cập nhật được trạng thái tích hợp",credentialsImported:"Đã nhập thông tin xác thực Cursor",autoDetectFailed:"Tự động phát hiện không thành công",manualRequired:"Cần token và machine ID",manualImportFailed:"Nhập thủ công không thành công",failedStartDaemon:"Không thể khởi động daemon",daemonStarted:"Đã khởi động daemon",daemonStartedWithPid:"Daemon đã khởi động (PID: {{pid}})",failedStopDaemon:"Không thể dừng daemon",daemonStopped:"Đã dừng daemon",rawLoading:"Cài đặt thô vẫn đang tải. Vui lòng đợi và thử lại.",invalidJson:"JSON không hợp lệ",rawSaved:"Đã lưu cài đặt thô",rawChanged:"Cài đặt thô đã thay đổi bên ngoài. Làm mới và thử lại.",failedSaveRaw:"Không lưu được cài đặt thô",savedAll:"Đã lưu cấu hình Cursor"},droidPage:{loadingDiagnostics:"Đang tải chẩn đoán Droid...",failedDiagnostics:"Không tải được chẩn đoán Droid.",overview:"Tổng quan",byok:"BYOK",docs:"Tài liệu",runtimeInstall:"Thời gian chạy và cài đặt",status:"Trạng thái",detected:"Đã phát hiện",notFound:"Không tìm thấy",detectionSource:"Nguồn phát hiện",binaryPath:"Đường dẫn nhị phân",installDirectory:"Thư mục cài đặt",version:"Phiên bản",overridePath:"Ghi đè (CCS_DROID_PATH)",configFiles:"Tệp cấu hình",path:"Đường dẫn",resolved:"Đã giải quyết",size:"Kích cỡ",lastModified:"Sửa đổi lần cuối",parseWarning:"Cảnh báo phân tích cú pháp: {{value}}",readWarning:"Đọc cảnh báo: {{value}}",warnings:"Cảnh báo",byokSummary:"Tóm tắt BYOK",activeModelSelector:"Bộ chọn mô hình hoạt động",customModels:"Mô hình tùy chỉnh",ccsManaged:"do CCS quản lý",userManaged:"Do người dùng quản lý",malformedEntries:"Mục nhập không đúng định dạng",providers:"Nhà cung cấp",none:"không có",customModelsTitle:"Mô hình tùy chỉnh",modelName:"Tên/model",provider:"Nhà cung cấp",baseUrl:"URL cơ sở",noCustomModels:"Không có mô hình tùy chỉnh",docsAlignedNotes:"Ghi chú được căn chỉnh trong Tài liệu",factoryDocs:"Tài liệu Factory",providerFactCheckDocs:"Tài liệu kiểm tra thực tế của nhà cung cấp",providerValues:"Giá trị của nhà cung cấp: {{value}}",settingsHierarchy:"Phân cấp cài đặt: {{value}}",settingsTitle:"Cài đặt BYOK của Droid",fixJsonBeforeQuickSettings:"Sửa cú pháp JSON trước khi sử dụng các điều khiển cài đặt nhanh.",fixJsonBeforeReasoning:"Sửa cú pháp JSON trước khi cập nhật cài đặt lý luận BYOK.",unableUpdateReasoning:"Không thể cập nhật cài đặt lý luận mô hình BYOK đã chọn.",fixJsonBeforeBudget:"Sửa cú pháp JSON trước khi cập nhật ngân sách tư duy.",anthropicOnlyBudget:"Ngân sách tư duy chỉ có sẵn cho các mô hình BYOK của Anthropic.",invalidJson:"JSON không hợp lệ: {{value}}",saved:"Đã lưu cài đặt Droid",changedExternally:"Cài đặt Droid đã thay đổi bên ngoài. Làm mới và thử lại.",failedSave:"Không lưu được cài đặt Droid"},sharedPage:{commands:"Lệnh",skills:"Kỹ năng",agents:"Agent",title:"Dữ liệu dùng chung",subtitle:"Các lệnh, kỹ năng và agent được chia sẻ giữa các phiên Claude",totalShared:"Tổng số mục dùng chung",visible:"Hiển thị",markdownDetail:"Chế độ xem chi tiết Markdown",filterPrefix:"Lọc:",configurationRequired:"Cần cấu hình",countsUnavailable:"Không có số liệu",retryCounts:"Số lần thử lại",filterPlaceholder:"Lọc {{tab}} theo tên, mô tả hoặc đường dẫn",showing:"Đang hiển thị {{visible}} trong số {{total}} {{tab}}",showingQuery:'cho "{{query}}"',refreshing:"(đang làm mới...)",loadingShared:"Đang tải {{tab}} dùng chung...",failedLoadShared:"Không tải được danh sách {{tab}} dùng chung",retry:"Thử lại",noSharedFound:"Không tìm thấy {{tab}} dùng chung. Chạy `ccs sync` hoặc thêm mục trong thư mục dùng chung của bạn.",noMatch:'Không có {{tab}} khớp với "{{query}}".',selectOne:"Chọn {{tab}} để xem toàn bộ nội dung.",pathLabel:"Đường dẫn",resolvedSource:"Nguồn đã giải quyết",loadingMarkdown:"Đang tải nội dung Markdown...",failedLoadContent:"Không tải được nội dung",retryContent:"Thử lại nội dung",noMarkdown:"Không có nội dung Markdown khả dụng."}}},ja:{translation:{locale:{en:"英語","zh-CN":"簡体字中国語",vi:"ベトナム語",ja:"日本語"},layout:{languageSwitcher:"言語"},nav:{general:"全般",home:"ホーム",analytics:"分析",identityAccess:"認証とアクセス",apiProfiles:"API プロファイル",cliproxyPlus:"CLIProxy Plus",cliproxyOverview:"概要",controlPanel:"コントロールパネル",githubCopilot:"GitHub Copilot",cursorIde:"Cursor IDE",claudeExtension:"Claude Extension",accounts:"アカウント",allAccounts:"すべてのアカウント",sharedData:"共有データ",compatibleClis:"互換",factoryDroid:"Factory Droid",system:"システム",health:"ヘルス",settings:"設定",openrouterTooltip:"注目: OpenRouter + Alibaba Coding Plan + Ollama"},home:{profiles:"プロファイル",cliproxy:"CLIProxy",accounts:"アカウント",health:"ヘルス",configurationRequired:"設定が必要"},auth:{dashboardTitle:"CCS Dashboard",loginDescription:"ダッシュボードにアクセスするには認証情報を入力してください",username:"ユーザー名",password:"パスワード",usernamePlaceholder:"ユーザー名を入力",passwordPlaceholder:"パスワードを入力",signIn:"サインイン",signingIn:"サインイン中...",loginFailed:"ログインに失敗しました"},commonToast:{apiKeyRequired:"API キーは必須です",accountAddedPresetFailed:"アカウントは追加されましたが、デフォルトプリセットの適用に失敗しました",settingsCopied:"設定をクリップボードにコピーしました",enterPresetName:"保存するプリセット名を入力してください",codeCopied:"コードをクリップボードにコピーしました",copyCodeFailed:"コードのコピーに失敗しました",appliedModelAllTiers:"すべてのティアにモデルを適用しました",settingsSaved:"設定を保存しました",defaultTargetUpdated:"デフォルトターゲットを更新しました",failedUpdateDefaultTarget:"デフォルトターゲットを {{target}}{{suffix}} に更新できませんでした"},profileDialog:{editTitle:"プロファイルを編集",createTitle:"API プロファイルを作成",name:"名前",namePlaceholder:"my-api",baseUrl:"ベース URL",baseUrlPlaceholder:"https://api.example.com",apiKey:"API キー",defaultModel:"デフォルトモデル (ANTHROPIC_MODEL)",defaultModelHint:"空欄の場合は {{model}} を使用",modelMappingTitle:"モデルマッピング (Opus/Sonnet/Haiku)",modelMappingDesc:"各ティアに異なるモデル ID を設定します。異なるモデル種別を別バックエンドへ振り分ける API プロキシで便利です。",opusModel:"Opus モデル (ANTHROPIC_DEFAULT_OPUS_MODEL)",sonnetModel:"Sonnet モデル (ANTHROPIC_DEFAULT_SONNET_MODEL)",haikuModel:"Haiku モデル (ANTHROPIC_DEFAULT_HAIKU_MODEL)",cancel:"キャンセル",saving:"保存中...",update:"更新",create:"作成"},modelTierMapping:{title:"モデルティアマッピング",advanced:"詳細",description:"Claude Code の opus/sonnet/haiku ティアごとに別のモデルを設定します。",autoSuggest:"{{provider}} に基づいて自動提案",opusPlaceholder:"例: anthropic/claude-opus-4",sonnetPlaceholder:"例: anthropic/claude-sonnet-4",haikuPlaceholder:"例: anthropic/claude-3.5-haiku",footer:"これにより ANTHROPIC_DEFAULT_OPUS_MODEL、ANTHROPIC_DEFAULT_SONNET_MODEL、ANTHROPIC_DEFAULT_HAIKU_MODEL を設定します。"},envEditor:{sensitive:"機密",none:"環境変数は設定されていません。",noneHint:"下の入力から追加するか、JSON を直接編集してください。",addVariable:"環境変数を追加",keyPlaceholder:"VARIABLE_NAME",valuePlaceholder:"値"},setupVariant:{using:"使用中:",variantNameRequired:"バリアント名 *",variantNamePlaceholder:"例: my-gemini, g3, flash",invokeHintPrefix:"この名前で呼び出せます:",model:"モデル",modelPlaceholder:"例: gemini-2.5-pro, claude-opus-4-6-thinking",choosePresetInstead:"代わりにプリセットから選択",selectModel:"モデルを選択",customModelName:"カスタムモデル名...",enterAnyModel:"CLIProxy がサポートする任意のモデル名を入力",defaultModel:"デフォルト: {{model}}",providerDefault:"プロバイダーのデフォルト",back:"戻る",skip:"スキップ",creating:"作成中...",createVariant:"バリアントを作成",skipHint:"アカウント追加だけが目的なら、バリアント作成はスキップできます"},customPresetDialog:{title:"カスタムプリセット",presetNameOptional:"プリセット名 (任意)",presetNamePlaceholder:"例: My Custom Config",codexTipPrefix:"Codex のヒント: サフィックス",codexTipSuffix:"で推論強度を固定できます。サフィックスなしのモデルは思考設定を使います。",defaultModel:"デフォルトモデル",defaultModelDesc:"特定のティア指定がない場合に使用",opusModel:"Opus (最上位)",opusModelDesc:"複雑な推論タスク向け",sonnetModel:"Sonnet (バランス)",sonnetModelDesc:"速度と性能のバランス",haikuModel:"Haiku (高速)",haikuModelDesc:"単純なタスクにすばやく応答",cancel:"キャンセル",savePreset:"プリセットを保存",applyPreset:"プリセットを適用"},componentModelSelector:{selectModel:"モデルを選択",availableModelsCount:"利用可能なモデル ({{count}})",preview:"プレビュー"},searchableSelect:{searchModels:"モデルを検索...",noResults:"一致する結果がありません。"},copilotSettings:{enableCopilot:"Copilot を有効化",enableCopilotDesc:"GitHub Copilot サブスクリプションを利用できるようにします",basicSettings:"基本設定",accountType:"アカウント種別",accountTypeIndividual:"個人",accountTypeBusiness:"ビジネス",accountTypeEnterprise:"エンタープライズ",rateLimiting:"レート制限",rateLimitSeconds:"レート制限 (秒)",noLimit:"制限なし",waitOnRateLimit:"レート制限時に待機",waitOnRateLimitDesc:"制限到達時にエラーではなく待機します",daemonSettings:"デーモン設定",autoStartDaemon:"デーモンを自動起動",autoStartDaemonDesc:"プロファイル使用時に copilot-api を起動します"},providerModelSelector:{selectModel:"モデルを選択",noModelsForProvider:"このプロバイダーで利用可能なモデルはありません",broken:"問題あり",deprecated:"非推奨",paid:"有料",freeTier:"無料ティア",paidTier:"有料ティア",modelKnownIssues:"このモデルには既知の問題があります",viewIssueDetails:"問題の詳細を見る",modelDeprecated:"このモデルは非推奨です",recommended:"推奨",allModelsCount:"すべてのモデル ({{count}})",noModelsAvailable:"利用可能なモデルはありません"},createAuthProfileDialog:{title:"新しいアカウントを作成",description:"認証プロファイルには Claude CLI へのログインが必要です。以下のコマンドをターミナルで実行してください。同期モード、グループ、継続性の深さは後でアカウント一覧から編集できます。",profileName:"プロファイル名",profileNamePlaceholder:"例: work, personal, client",invalidProfileName:"名前は英字で始め、英数字、ハイフン、アンダースコアのみ使用できます。",enableSharedHistory:"他の ccs 認証アカウントとの共有履歴同期を有効にする",historySyncGroupOptional:"履歴同期グループ (任意)",historySyncGroupPlaceholder:"default, sprint-a, client-x",historySyncGroupHint:"空欄の場合はデフォルトの共有グループを使用します。スペースはハイフンに正規化されます。",deeperContinuity:"詳細: より深い継続性モード",deeperContinuityHint:"session-env、file-history、shell-snapshots、todos の同期も追加します。認証情報は分離されたままです。",invalidContextGroup:"グループは英字で始め、英数字、ハイフン、アンダースコアのみ使用できます (最大 {{max}} 文字)。",command:"コマンド",commandFallback:"ccs auth create <name>",afterRunPrefix:"コマンド実行後:",afterRunStep1:"ブラウザで Claude のログインを完了します",afterRunStep2:"ここに戻って更新し、新しいアカウントを確認します",poolingHint:"Claude OAuth のプールルーティングを使う場合は、アカウントページのアクションボタンから CLIProxy Claude Pool を利用してください。",close:"閉じる",copied:"コピーしました!",copyCommand:"コマンドをコピー"},cliproxyModelCategory:{google:"Google (Gemini)",openai:"OpenAI (GPT)",anthropic:"Anthropic (Claude)",antigravity:"Antigravity",other:"その他"},cliproxyOverviewComponents:{availableModels:"利用可能なモデル",noModelsAvailable:"利用可能なモデルはありません",startSessionHint:"利用可能なモデルを取得するには CLIProxy セッションを開始してください",totalCount:"合計 {{count}}",availableThroughGroupedByProvider:"{{backendLabel}} 経由で利用可能なモデルをプロバイダー別に表示",moreCount:"+{{count}} 件"},categorizedModelSelector:{selectModel:"モデルを選択",noModelsAvailable:"利用可能なモデルはありません",modelPlaceholder:"モデル..."},openrouterQuickStart:{recommended:"推奨",title:"OpenRouter から始める",description:"OpenAI、Anthropic、Google、Meta などの {{modelCountLabel}} モデルを、1 つの API で利用できます。",featureOneApi:"1 つの API で全プロバイダー",featureTierMapping:"モデルティアマッピング",profileCount:"{{count}} 個の API プロファイル",profileCount_other:"{{count}} 個の API プロファイル",selectProfileTitle:"API プロファイルを選択",summaryDescriptionWithProfiles:"このワークスペースには既に {{count}} 個の API プロファイルがあります。左側レールから 1 つ選んで編集するか、ここから新しいプロファイルを作成してください。",summaryDescriptionWithProfiles_other:"このワークスペースには既に {{count}} 個の API プロファイルがあります。左側レールから 1 つ選んで編集するか、ここから新しいプロファイルを作成してください。",summaryDescriptionNoProfiles:"API Profiles は Anthropic 互換エンドポイント向けです。AI Providers は Gemini、Codex、Claude、Vertex、OpenAI 互換コネクタ向けです。",openrouterModelsBadge:"{{modelCountLabel}} 個の OpenRouter モデル",runtimeProviderBadge:"ランタイムプロバイダー設定",runtimeProviderTitle:"AI Providers を開く",runtimeProviderDescription:"個別の API プロファイルを作成する前に、共有プロバイダーキーとランタイムコネクタを管理します。",runtimeProviderFeatureConnectors:"Gemini、Codex、Claude、Vertex、OpenAI 互換コネクタ",runtimeProviderFeatureSecrets:"共有シークレットを個別の API プロファイルから切り離して管理",runtimeProviderFooter:"複数のプロファイルで 1 つのプロバイダー設定を共有したい場合に最適です。",createOpenRouterProfile:"OpenRouter プロファイルを作成",getApiKeyAt:"API キー取得:",or:"または",createCustomProfile:"カスタム API プロファイルを作成"},alibabaCodingPlanQuickStart:{recommended:"推奨",title:"Alibaba Coding Plan を試す",description:"コーディング用途向けに、Anthropic 互換エンドポイント経由で Alibaba Cloud Coding Plan を利用します。",featureEndpoint:"Anthropic 互換エンドポイント",featureKeyFormat:"専用の sk-sp API キー",createAlibabaProfile:"Alibaba Coding Plan プロファイルを作成",readGuideAt:"セットアップガイド:"},alibabaCodingPlanPromo:{title:"Alibaba Coding Plan",subtitle:"Anthropic エンドポイント経由の Model Studio Coding Plan",add:"追加"},credentialHealth:{title:"認証情報の状態",ready:"準備完了",noCredentialsConfigured:"認証情報が未設定です。上のログインボタンから認証してください。",neverUsed:"未使用",justNow:"たった今",unknown:"不明",daysAgo:"{{count}}日前",hoursAgo:"{{count}}時間前",minutesAgo:"{{count}}分前"},proxyStatusWidget:{justNow:"たった今",minutesAgo:"{{count}}分前",hoursAgo:"{{count}}時間前",syncReady:"同期準備完了",noConfig:"設定なし",remoteProxy:"リモートプロキシ",active:"稼働中",trafficAutoRouted:"トラフィックは自動でリモートサーバーにルーティングされます",tooltipSync:"CLIProxy にプロファイルを同期",tooltipRestart:"再起動",tooltipStop:"停止",tooltipClose:"閉じる",tooltipVersionSettings:"バージョン設定",versionManagement:"バージョン管理",selectVersionPlaceholder:"インストールするバージョンを選択...",stable:"(安定版)",install:"インストール",versionsAboveUnstable:"{{version}} より新しいバージョンには既知の問題があります",versionsKnownIssues:"バージョン {{version}} には既知の問題があります",lastChecked:"最終確認: {{time}}",notRunning:"停止中",start:"起動",port:"ポート {{port}}",sessionCount:"{{count}} セッション",sessionCount_other:"{{count}} セッション",installFaultyTitle:"既知の問題があるバージョンをインストールしますか?",installFaultyDesc:"既知の不具合範囲 <strong>{{range}}</strong> に含まれる <strong>v{{version}}</strong> をインストールしようとしています。",installFaultyWarning:"このバージョンには既知のバグがあり、失敗したりプロキシが不安定になる可能性があります。",installUnstableTitle:"不安定なバージョンをインストールしますか?",installUnstableDesc:"最大安定版 <strong>v{{maxStable}}</strong> を上回る <strong>v{{version}}</strong> をインストールしようとしています。",installUnstableWarning:"このバージョンには安定性の問題があり、予期しない動作を引き起こす可能性があります。",installUnstableConfirm:"このまま続行しますか?",cancel:"キャンセル",installAnyway:"このままインストール",clickToDowngrade:"クリックしてダウングレード",clickToUpdate:"クリックして更新"},syncStatusCard:{profileSync:"プロファイル同期",ready:"準備完了",noConfig:"設定なし",syncsProfilesDesc:"API プロファイルをローカルの CLIProxy 設定に同期します",runDoctorHint:"設定を生成するには <code>ccs doctor --fix</code> を実行してください。",details:"詳細",syncNow:"今すぐ同期"},syncDialog:{title:"プロファイルをローカル CLIProxy に同期",description:"CCS の API プロファイルをローカルの CLIProxy config.yaml に同期します。",noProfiles:"同期するプロファイルがありません。",createProfilesFirst:"先にプロファイルタブで API プロファイルを作成してください。",modelLabel:"モデル:",ready:"準備完了",profilesToSync_one:"{{count}} 件のプロファイルを同期",profilesToSync_other:"{{count}} 件のプロファイルを同期",cancel:"キャンセル",syncing:"同期中...",synced:"同期完了",syncNow:"今すぐ同期"},errorLogs:{title:"エラーログ",failedRequests_one:"{{count}} 件の失敗したリクエスト",failedRequests_other:"{{count}} 件の失敗したリクエスト",cliproxyDiagnostics:"CLIProxy 診断",showingCount:"{{total}} 件中 50 件のログを表示",selectLog:"詳細を表示するログを選択してください",failedLoadContent:"ログ内容の読み込みに失敗しました",copyAbsolutePath:"絶対パスをコピー",copyRawContent:"生のログ内容をコピー",tabOverview:"概要",tabHeaders:"ヘッダー",tabRequest:"リクエスト",tabResponse:"レスポンス",tabRaw:"生データ",modelLabel:"モデル:",quotaResetsIn:"クォータのリセットまで ",method:"メソッド",provider:"プロバイダー",version:"バージョン",endpoint:"エンドポイント",url:"URL",timestamp:"タイムスタンプ",na:"該当なし",noHeaders:"利用可能なヘッダーはありません",noRequestBody:"リクエストボディなし",noResponseBody:"レスポンスボディなし",rateLimitedMsg:"レート制限です。別のアカウントに切り替えるか、クォータのリセットを待ってください。モデル {{model}} のクォータは上限に達しています。",rateLimitedMsgNoModel:"レート制限です。別のアカウントに切り替えるか、クォータのリセットを待ってください。",authFailedMsg:"認証に失敗しました。CLIProxy 設定で再認証するか、API キーを確認してください。",notFoundMsg:"エンドポイントが見つかりません。このプロバイダーには存在しない可能性があります。",serverErrorMsg:"上流サーバーでエラーが発生しました。後でもう一度試すか、プロバイダーのステータスページを確認してください。",timeoutMsg:"リクエストがタイムアウトしました。ネットワーク接続を確認するか、タイムアウト設定を延長してください。",unknown:"不明"},editAccountContext:{title:"履歴同期の設定",description:'"{{name}}" が他の CCS auth アカウントと履歴や継続性を共有する方法を設定します。',syncMode:"同期モード",selectContextMode:"コンテキストモードを選択",isolatedOption:"分離(同期なし)",sharedOption:"共有(同期あり)",sharedModeHint:"共有モードでは、同じ履歴同期グループ内のアカウントでワークスペースコンテキストを再利用します。",isolatedModeHint:"分離モードでは、このアカウントを他の CCS auth アカウントから完全に切り離します。",historySyncGroup:"履歴同期グループ",groupPlaceholder:"default",groupHint:"小文字に正規化されます(スペースはダッシュに変換)。使用可能: 英字、数字、_、-(最大 {{max}} 文字)。",invalidGroup:"英字で始まる有効なグループ名を入力してください。",continuityDepth:"継続性レベル",selectContinuityDepth:"継続性レベルを選択",standardOption:"標準(プロジェクトのみ)",deeperOption:"拡張継続性(上級者向け)",deeperHint:"上級モードでは、session-env、file-history、shell-snapshots、todos も同期します。",standardHint:"標準モードでは、プロジェクトのワークスペースコンテキストのみ同期します。",credentialsIsolated:"どのモードでも、認証情報と .anthropic はアカウントごとに分離されます。",cancel:"キャンセル",save:"保存",saving:"保存中..."},historySyncLearningMap:{title:"履歴同期の仕組み",description:"分離 -> 共有 -> 拡張共有。変更は各行の「同期」から行います。",learningMap:"概要図",isolated:"分離",shared:"共有",deeper:"拡張共有",cliproxyManaged_one:"{{count}} 件の CLIProxy Claude Pool アカウントは、CLIProxy ページで管理します。",cliproxyManaged_other:"{{count}} 件の CLIProxy Claude Pool アカウントは、CLIProxy ページで管理します。",showDetails:"詳細を表示: グループ、切り替え、レガシーポリシー",modeSwitch:"モード切り替え",modeSwitchDesc:"「同期」ダイアログでは、分離/共有の切り替えと、より深い継続性の選択ができます。",historySyncGroup:"履歴同期グループ",historySyncGroupDesc:"同じグループのアカウントは、同じプロジェクトのコンテキストレーンを共有します。未設定時は default を使います。",legacyConfirmation_one:"{{count}} 件のレガシーアカウントで明示的な確認がまだ必要です。",legacyConfirmation_other:"{{count}} 件のレガシーアカウントで明示的な確認がまだ必要です。"},accountsTable:{name:"名前",type:"種別",defaultBadge:"既定",created:"作成日",lastUsed:"最終使用",historySync:"履歴同期",actions:"操作",syncTitle:"同期モード、グループ、継続性レベルを編集",confirmLegacyTitle:"このレガシーアカウントの現在のモードを明示的に確定する",sync:"同期",confirm:"確定",active:"有効",setDefault:"既定に設定",deleteAccount:"アカウントを削除",cannotDeleteDefault:"既定のアカウントは削除できません",noAccounts:"CCS auth アカウントが見つかりません。追加するには ccs auth create を使ってください。",resetToDefault:"CCS の既定値に戻す",deleteDialogTitle:"アカウントを削除",deleteDialogDesc:'アカウント "{{name}}" を削除しますか? この操作でプロファイルと関連するすべてのセッションデータが削除されます。この操作は元に戻せません。',cancel:"キャンセル",delete:"削除",sharedGroupStandard:"共有({{group}}、標準)",sharedGroupDeeper:"共有({{group}}、拡張)",sharedGroupLegacy:"共有({{group}}、標準・レガシー)",isolatedLegacy:"分離(旧既定値)",isolated:"分離"},addAccountDialog:{title:"{{displayName}} アカウントを追加",descKiro:"Kiro の認証方法を選び、ブラウザーで認証するか Kiro IDE からインポートしてください。",descDeviceCode:"認証をクリックすると、プロバイダーのサイトで入力する確認コードが表示されます。",descOauth:"認証をクリックすると OAuth URL を取得します。任意のブラウザーで開いてサインインしてください。",powerUserEnabled:"上級者モードが有効です",powerUserSkipped:"設定 > プロキシのパワーユーザーモードにより、AGY の責任確認チェックと Gemini ダッシュボードのリスク文言入力をスキップしています。OAuth / アカウントに関するリスクはすべて自己責任です。",powerUserLoadFailed:"パワーユーザーモード設定を読み込めませんでした。設定 > プロキシを確認してから再試行してください。",powerUserLoading:"パワーユーザーモードの安全設定を読み込み中です。少し待ってから再試行してください。",powerUserUnavailableRetry:"パワーユーザーモードは利用できません。必要なプロバイダーの安全確認を完了してから再試行してください。",authMethod:"認証方法",selectKiroAuthMethod:"Kiro の認証方法を選択",nicknameRequired:"ニックネーム(必須)",nicknameOptional:"ニックネーム(任意)",nicknamePlaceholder:"例: work, personal",nicknameRequiredHint:"このプロバイダーでは必須です。重複しないわかりやすい名前を付けてください(例: work, personal)。",nicknameOptionalHint:"このアカウントを識別しやすい名前です。空欄の場合は安全な識別子を自動生成します。",waitingForAuth:"認証を待機中...",deviceCodeHint:"確認コードのダイアログがまもなく表示されます。プロバイダーのサイトでコードを入力してください。",browserHint:"ブラウザーで認証を完了してください。このダイアログは自動で閉じます。",openUrlLabel:"サインインするには、この URL を任意のブラウザーで開いてください:",copied:"コピー済み",copy:"コピー",open:"開く",popupBlocked:"ポップアップがブロックされました。上の URL をコピーして、ブラウザーで手動で開いてください。",redirectPasteLabel:"リダイレクトが機能しない場合は、コールバック URL を貼り付けてください:",callbackPlaceholder:"リダイレクト URL をここに貼り付け...",submitCallback:"コールバックを送信",submitting:"送信中...",preparingUrl:"サインイン URL を準備中...",cancel:"キャンセル",importingToken:"Kiro IDE からトークンをインポート中...",authenticate:"認証",importFromIde:"IDE からインポート",importing:"インポート中..."},flowViz:{backToProviders:"プロバイダーに戻る",showDetails:"詳細を表示",hideDetails:"詳細を隠す",resetLayout:"レイアウトをリセット",provider:"プロバイダー",totalRequests:"総リクエスト数",accounts:"アカウント",connectionTimeline:"接続タイムライン",noRecentConnections:"最近の接続はありません"},quickStats:{totalRequests:"総リクエスト数",successRate:"成功率",totalTokens:"総トークン数",activeModels:"アクティブなモデル"},authMonitor:{accounts:"アカウント",accountsCount:"{{count}} アカウント",success:"成功",failed:"失敗",successRate:"成功率"},accountCard:{resumeAccount:"アカウントを再開",pauseAccount:"アカウントを一時停止",quotaLoading:"クォータ...",quota:"クォータ",quotaUnavailable:"クォータ上限を取得できません",reauthNeeded:"再認証が必要",failureLabelReauth:"再認証",failureLabelWorkspace:"ワークスペース",failureLabelNoAccess:"アクセス不可",failureLabelRetry:"再試行",failureLabelReconnect:"再接続",failureLabelTemporary:"一時的",failureLabelUnavailable:"利用不可",failureHintReauth:"このアカウントの認証フローをもう一度実行して更新してください。",failureHintWorkspace:"このアカウントをアクティブなワークスペースに戻してから、削除して再追加してください。",failureHintNoAccess:"このアカウントでは、プロバイダーのクォータエンドポイントにアクセスできません。",failureHintRetry:"しばらく待ってから、クォータリクエストを再試行してください。",failureHintReconnect:"古いアカウントを削除し、再度認証してください。",failureHintTemporary:"一時的な問題のようです。後でもう一度試してください。",removeAndReadd:"削除して再追加",autoRefreshFailed:"自動更新に失敗しました"},antigravityChecklist:{title:"Antigravity OAuth の責任確認",subtitle:"認証する前に 4 ステップすべて完了してください。",mandatory:"必須",completion:"完了状況",stepsCount:"{{current}}/4 ステップ"},accountSafetyWarning:{title:"OAuth アカウント安全性の警告",subtitle:"Issue #509 · Gemini + AGY OAuth リスク",firstLine:"Issue #509 では、CCS AGY と、CCS Gemini と CCS AGY 間での共有アカウント利用に関連する停止・BAN 報告がまとめられています。",secondLine:"OAuth とアカウントアクセスのリスクをすべて自己責任で負う場合のみ続行してください。",issueLabel:"Issue #509 を読む",proxySettingsLabel:"Gemini + AGY の設定: 設定 > プロキシ"},cliproxyDialog:{name:"名前",provider:"プロバイダー",account:"アカウント",accountOptional:"アカウント(任意)",model:"モデル",modelOptional:"モデル(任意)",defaultTarget:"デフォルトターゲット",defaultTier:"デフォルトティア",tierConfig:"ティア設定",selectProvider:"プロバイダーを選択...",useDefaultAccount:"デフォルトのアカウントを使用",defaultSuffix:"(デフォルト)",opus:"Opus",sonnet:"Sonnet",haiku:"Haiku",claudeCode:"Claude Code",factoryDroid:"Factory Droid",cancel:"キャンセル",create:"作成",creating:"作成中...",saveChanges:"変更を保存",saving:"保存中...",placeholderName:"my-gemini",placeholderModel:"gemini-2.5-pro",placeholderComposite:"my-composite",placeholderModelId:"model-id",placeholderAccountId:"account-id",editCompositeTitle:"複合バリアントを編集: {{name}}",editSingleTitle:"単一バリアントを編集: {{name}}"},profileEditor:{profileInfo:"プロファイル情報",profileName:"プロファイル名",filePath:"ファイルパス",lastModified:"最終更新",defaultTarget:"デフォルトターゲット",quickUsage:"クイック実行",runWithProfile:"このプロファイルで実行",runOnDroid:"Droid で実行",runOnDroidWithFlag:"--target で Droid 実行",droidAliasExplicit:"Droid エイリアス(明示)",overrideToClaude:"Claude に切り替え",overrideToClaudeExplicit:"Claude に切り替え(明示)",targetHintPreferredAlias:"推奨の明示エイリアス:",targetHintClaudeDefault:"デフォルトコマンド:",targetHintLegacyAlias:"従来ショートカットも利用可能:",targetHintOverride:"実行ごとに次でも上書きできます",setAsDefault:"デフォルトに設定",provider:"プロバイダー",custom:"カスタム",providerChooserHint:"まずプリセットを選び、その後で URL、API Key、モデルマッピングを調整できます。",featuredProviders:"注目のプロバイダー",scrollHint:"画面が狭い場合は横にスクロールできます",customEndpoint:"カスタムエンドポイント",morePresets:"その他のプリセット",customEndpointDescription:"空の Anthropic 互換 URL から始め、すべて手動で設定します。"},settings:{sectionLoadFailed:"セクションの読み込みに失敗しました",unknownError:"不明なエラーが発生しました",reloadPage:"ページを再読み込み",refresh:"更新",copy:"コピー",copied:"コピーしました",saved:"保存しました",loading:"読み込み中...",configFileNotFound:"設定ファイルが見つかりません"},settingsTabs:{web:"Web検索",env:"環境変数",think:"思考",proxy:"プロキシ",auth:"認証",backup:"バックアップ"},settingsAuth:{failedFetchTokens:"認証トークンの取得に失敗しました",failedSaveTokens:"トークンの保存に失敗しました",tokensUpdated:"トークンを更新しました。反映するには CLIProxy を再起動してください。",failedRegenerate:"シークレットの再生成に失敗しました",secretRegenerated:"新しい Management Secret を生成しました。反映するには CLIProxy を再起動してください。",failedReset:"トークンのリセットに失敗しました",tokensReset:"トークンをデフォルトに戻しました。反映するには CLIProxy を再起動してください。",description:"CLIProxy の認証トークンを設定します。変更を反映するには CLIProxy の再起動が必要です。",apiKey:"API Key",custom:"カスタム",apiKeyDesc:"Claude Code が CLIProxy への認証に使用します",apiKeyPlaceholder:"API key",managementSecret:"Management Secret",managementSecretDesc:"CCS ダッシュボードが CLIProxy の管理 API にアクセスするために使用します",managementSecretPlaceholder:"Management secret",generateSecret:"新しい安全なシークレットを生成",resetDefaults:"デフォルトに戻す",resetDesc:"API Key と Management Secret の両方をデフォルト値に戻します。",saving:"保存中...",save:"保存"},settingsGlobalEnv:{description:"Claude 以外のサブスクリプション型プロファイル(gemini、codex、agy、ghcp など)に注入する環境変数",enabled:"グローバル環境変数を有効化",disabled:"グローバル環境変数を無効化",enabledDesc:"環境変数をサードパーティープロファイルに注入します",disabledDesc:"環境変数は注入されません",envVars:"環境変数",noneConfigured:"環境変数は未設定です",addNew:"変数を追加",keyName:"KEY_NAME",value:"値",add:"追加",quickAdd:"よく使う変数を追加",allConfigured:"主要な変数はすべて設定済みです"},settingsBackups:{failedFetch:"バックアップの取得に失敗しました",failedRestore:"バックアップの復元に失敗しました",restoreSuccess:"バックアップを復元しました",title:"設定バックアップ",description:"settings.json の以前のバージョンを復元します。設定を変更するとバックアップが自動作成されます。",none:"利用できるバックアップはありません",noneHint:"設定を変更すると、ここにバックアップが表示されます",latest:"最新",restoring:"復元中...",restore:"復元",restoreConfirmTitle:"バックアップを復元しますか?",restoreConfirmPrefix:"現在の設定を次のバックアップで置き換えます:",restoreConfirmSuffix:"この操作は元に戻せません。",cancel:"キャンセル"},settingsWebsearch:{description:"サードパーティープロファイル(gemini、codex、agy など)向けの CLI ベース Web 検索",enabled:"WebSearch を有効化",disabled:"WebSearch を無効化",checking:"状態を確認中...",providers:"プロバイダー",noneConfigured:"プロバイダーが設定されていません",noneConfiguredHint:"Web 検索プロバイダーを有効にするには CLI ツールをインストールしてください",checkProviders:"プロバイダーを確認",installed:"インストール済み",notInstalled:"未インストール",model:"モデル:",howInstall:"{{name}} CLI のインストール方法",installGlobally:"グローバルにインストール",requiresKey:"(xAI API Key が必要)",freeTier:"(無料枠あり)",viewDocs:"ドキュメントを見る"},settingsProxy:{failedLoadAgyMode:"パワーユーザーモードの読み込みに失敗しました",failedUpdateAgyMode:"パワーユーザーモードの更新に失敗しました",failedVerifyAgyMode:"パワーユーザーモードの永続化確認に失敗しました",notPersistedAgyMode:"パワーユーザーモードが保存されませんでした。別のプロセスが設定を変更した可能性があります。",agyModeEnabled:"パワーユーザーモードを有効にしました。",agyModeDisabled:"パワーユーザーモードを無効にしました。",typePhraseToContinue:"続行するには「{{value}}」と入力してください。",description:"プロキシベースのプロファイル用に、ローカルまたはリモートの {{backend}} 接続を設定します",backendPlus:"CLIProxy Plus",backend:"CLIProxy",instanceStatus:"インスタンス状態",connectionMode:"接続モード",local:"ローカル",remote:"リモート",localDesc:"このマシンで {{backend}} バイナリを実行します",remoteDesc:"リモートの {{backend}} サーバーに接続します",backendBinary:"バックエンドバイナリ",stopProxyToSwitch:"バックエンドを切り替える前に、インスタンス状態から実行中のプロキシを停止してください。",default:"デフォルト",plusDesc:"Kiro と GitHub Copilot を含むすべてのプロバイダーをサポート",originalDesc:"元のバイナリ(Gemini、Codex、Antigravity のみ)",variantsIncompatible:"既存の Kiro/Copilot バリアントは CLIProxyAPI では動作しません。CLIProxyAPIPlus に切り替えるか、それらのバリアントを削除してください。",safety:"安全設定",agyModeTitle:"Antigravity + Gemini パワーユーザーモード",agyModeDesc:"アカウント追加画面の AGY 責任確認チェックと、Gemini ダッシュボードの入力確認をスキップします。",agyWarning:"OAuth の停止/BAN リスクパターン (#509) を十分理解している場合にのみ使用してください。CCS はアカウント喪失の責任を負いません。",finalConfirm:"最終確認",finalConfirmDesc:"有効にすると、ダッシュボード / CLI の AGY 安全チェックと Gemini ダッシュボードのリスク文言確認をスキップします。続行する前に issue #509 を確認し、正確なフレーズを入力してください。",step1:"ステップ 1",readIssue:"Issue #509 を読む",step2:"ステップ 2",typePrefix:"有効にするには",typeSuffix:"と入力してください。",typePhraseAria:"Antigravity + Gemini パワーユーザーモードを有効にするには I ACCEPT RISK と入力してください",exactPhrase:"完全一致で入力してください。",enableAgyMode:"Antigravity + Gemini パワーユーザーモードを有効にする",toggleAgyMode:"Antigravity + Gemini パワーユーザーモードを切り替え",fallbackSettings:"フォールバック設定",enableFallback:"ローカルへのフォールバックを有効化",enableFallbackDesc:"リモートに接続できない場合はローカルプロキシを使用します",autoStartLocal:"ローカルプロキシを自動起動",autoStartLocalDesc:"フォールバック時にローカルプロキシを自動で起動します",advanced:"詳細設定",debugMode:"デバッグモード",debugModeDesc:"ブラウザコンソールで開発者向け診断を有効にします",debugModeEnabled:"デバッグモードを有効にしました。詳細ログはブラウザコンソールを確認してください。",localProxy:"ローカルプロキシ",port:"ポート",autoStart:"自動起動",localAutoStartDesc:"必要になったらローカルプロキシを自動起動します",remoteConfigTitle:"リモートサーバー設定",host:"ホスト",hostPlaceholder:"192.168.1.100 または proxy.example.com",defaultPort:"デフォルト: {{value}}",portPlaceholder:"{{value}} を使う場合は空欄",protocol:"プロトコル",http:"HTTP",https:"HTTPS",apiKeyOptional:"API Key(任意)",apiKeyPlaceholder:"/v1/* API エンドポイント用",apiKeyDesc:"/v1/chat/completions への API リクエストで使用します",managementKeyOptional:"Management Key(任意)",managementKeyPlaceholder:"/v0/management/* エンドポイント用",managementKeyDesc:"ダッシュボードの管理 API で使用します。未設定の場合は API Key を使用します。",testing:"テスト中...",testConnection:"接続をテスト",connectedLatency:"接続済み({{value}}ms)",connectionFailed:"接続に失敗しました",invalidPortOrEmpty:"ポートは 1〜65535 の整数で入力するか、デフォルトを使う場合は空欄にしてください",invalidLocalPort:"ローカルポートは 1〜65535 の整数で指定してください",backendPlusApi:"CLIProxyAPIPlus",backendApi:"CLIProxyAPI"},settingsThinking:{description:"対応モデルの高度な思考 / 推論設定を行います。",supportedProviders:"対応プロバイダー",modeTitle:"思考モード",modeAutoDesc:"モデルのティアに応じて思考レベルを自動設定します",modeOffDesc:"高度な思考を無効化します",modeManualDesc:"永続的な上書きレベルを設定するか、実行ごとに CLI フラグを使います",tierDefaults:"ティア別デフォルト",tierDefaultsDesc:"自動モード時に各モデルティアへ適用する既定の思考レベルです。",persistentOverride:"永続オーバーライド",persistentOverrideDesc:"すべてのセッションに適用されます。CLI フラグが優先されます。",enterCustomBudget:"カスタム予算を入力",apply:"適用",providerOverrides:"プロバイダー別オーバーライド({{count}})",providerOverridesDesc:"特定のプロバイダーに対してティア別デフォルトを上書きします。必要に応じてカスタムのプロバイダーキーを追加してください。",addProviderPlaceholder:"プロバイダーキーを追加(例: qwen)",showWarnings:"警告を表示",showWarningsDesc:"思考値が制限または調整された場合に警告を表示します",cliEnvOverride:"CLI / 環境変数の上書き",supportLine1Prefix:"思考予算:",supportLine1Suffix:"(トークンベース)",supportLine2Prefix:"推論強度:",supportLine2SuffixPrefix:"(サフィックス、または ",supportLine2SuffixPostfix:": minimal/low/medium/high/xhigh)",supportLine3Prefix:"Codex のサフィックスは推論強度を固定します(例: ",supportLine3Suffix:")。サフィックスなしのモデルは思考モードを使います。"},analytics:{title:"分析",subtitle:"利用状況とインサイトを確認",month:"月",allTime:"全期間",updated:"最終更新: {{value}}"},analyticsSummary:{totalTokens:"総トークン数",totalTokensSubtitle:"入力 {{input}} / 出力 {{output}}",totalCost:"総コスト",totalCostSubtitle:"1日平均 ${{value}}",cacheTokens:"キャッシュトークン",cacheTokensSubtitle:"${{cost}}(コストの{{percent}}%)",inputCost:"入力コスト",outputCost:"出力コスト",tokensSubtitle:"{{value}} トークン"},apiProfiles:{title:"API プロファイル",new:"新規",searchPlaceholder:"プロファイルを検索...",loadingProfiles:"プロファイルを読み込み中...",failedLoadTitle:"プロファイルを読み込めませんでした",failedLoadDesc:"API プロファイルを取得できませんでした。もう一度お試しください。",retry:"再試行",noProfilesYet:"API プロファイルがまだありません",noProfilesDesc:"最初のプロファイルを作成して、カスタム API エンドポイントに接続します",createProfile:"プロファイルを作成",noProfileMatch:'"{{query}}" に一致するプロファイルはありません',profileCount:"{{count}} 件のプロファイル",profileCount_other:"{{count}} 件のプロファイル",configuredCount:"{{count}} 件設定済み",deleteProfileTitle:"プロファイルを削除",deleteProfileDesc:'"{{name}}" を削除しますか?設定ファイルも削除され、この操作は元に戻せません。',delete:"削除",unsavedChangesTitle:"未保存の変更",unsavedChangesDesc:'"{{current}}" に未保存の変更があります。破棄して "{{next}}" に切り替えますか?',discardSwitch:"破棄して切り替え"},accountsPage:{title:"アカウント",managePrefix:"一つの画面で",manageSuffix:"のアカウント管理とプール導線をまとめて扱えます。",mobileManageSuffix:"の継続性設定をまとめて管理できます。",primaryActions:"主要アクション",createAccount:"アカウントを作成",authClaudeInPool:"Pool で Claude を認証",openClaudePoolSettings:"Claude Pool の設定を開く",openCliProxyClaudePool:"CLIProxy Claude Pool を開く",migrationFollowup:"移行フォローアップ",legacyContextPending:"{{count}} 件のアカウントで初回モード確認がまだ必要です。",legacyContextPending_other:"{{count}} 件のアカウントで初回モード確認がまだ必要です。",legacyContinuityPending:"{{count}} 件の共有アカウントが標準のレガシー継続深度のままです。",legacyContinuityPending_other:"{{count}} 件の共有アカウントが標準のレガシー継続深度のままです。",confirmingLegacy:"レガシーポリシーを確認中...",confirmLegacy:"レガシーポリシーを確認({{count}})",noLegacyFollowup:"保留中のレガシーフォローアップはありません。",continuityGuide:"継続性ガイド",expandWhenNeeded:"必要なときだけ展開。",sharedStandard:"共有標準",sharedStandardDesc:"プロジェクトワークスペースの同期のみ。ほとんどのチームに最適な既定値です。",sharedDeeper:"共有拡張",sharedDeeperPrefix:"追加で",isolated:"分離",isolatedDesc:"リンクなし。厳密な分離に最適です。",quickCommands:"クイックコマンド",quickCommandsDesc:"コピーしてターミナルで実行します。",workspaceBadge:"ccs auth ワークスペース",historySyncBadge:"履歴同期設定",authAccounts:"認証アカウント",tableScopePrefix:"この表では",tableScopeMiddle:"のアカウントのみを表示します。モード/グループ/継続性の変更は",tableScopeSuffix:"を使ってください。",accountMatrix:"アカウント一覧",sharedTotalDesc:"共有アカウント合計: {{count}}。ここから同期設定とレガシー確認を行えます。",loadingAccounts:"アカウントを読み込み中..."},health:{justNow:"たった今",secondsAgo:"{{count}}秒前",minutesAgo:"{{count}}分前",hoursAgo:"{{count}}時間前",systemHealth:"システムヘルス",build:"ビルド {{version}}",lastScan:"最終スキャン:",autoRefresh:"自動更新:",refresh:"更新",checks:"チェック",version:"バージョン",platform:"プラットフォーム",liveMonitoring:"ライブ監視中",copied:"クリップボードにコピーしました",refreshing:"ヘルスチェックを更新中...",fix:"修正",applyFix:"修正を適用",healthLabel:"ヘルス"},updates:{actionRequired:"対応が必要",done:"完了",all:"すべて",inboxTitle:"更新センター",inboxSubtitle:"対応を優先し、その後で完了または非表示にします。",needsAction:"要対応",doneCount:"完了",searchPlaceholder:"対応内容またはコマンドを検索",noNotices:"このビューに一致する通知はありません。",noUpdates:"利用可能な更新はありません。",published:"{{date}} 公開",markDone:"完了にする",dismiss:"非表示",reopen:"再表示",doNext:"次にやる",impactedIntegrations:"影響を受ける連携",impactedDesc:"更新範囲とルーティングに基づく関連領域です。",whyMatters:"重要な理由",whyMattersDesc:"長文のリリースノートではなく、要点だけを表示します。",open:"開く",progressNeedsAction:"要対応",progressInReview:"確認中",progressDone:"完了",progressDismissed:"非表示",statusNew:"新着",statusStable:"安定",statusPlanned:"予定",dashboard:"ダッシュボード",cliUsage:"CLI利用状況"},cliproxyPage:{connected:"接続済み",notConnected:"未接続",variant:"バリアント",parentNotConnected:"親が未接続",viaProvider:"{{provider}} 経由",emptyTitle:"CCS プロファイルマネージャー",emptyDesc:"CLIProxy プロバイダー向けの OAuth 認証、アカウント設定、モデル選択を管理します。CCS が各 AI バックエンドへのリクエストをどうルーティングするかを設定できます。",emptyControlPanelPrefix:"ライブ利用統計とリアルタイム監視は",controlPanel:"コントロールパネルで確認できます",quickSetup:"クイックセットアップ",accountManagement:"CCSレベルのアカウント管理",providers:"プロバイダー",variants:"バリアント",providerCount:"{{count}} 件のプロバイダー",providerCount_other:"{{count}} 件のプロバイダー",connectedCount:"{{count}} 件接続済み",variantDisplay:"{{name}}({{provider}} バリアント)"},copilotPage:{title:"Copilot",subtitle:"GitHub Copilot プロキシ",setup:"セットアップ",auth:"認証",daemon:"デーモン",unofficialTitle:"非公式API: 自己責任で利用してください",unofficialItem1:"リバースエンジニアリングされたAPIのため、いつでも動かなくなる可能性があります",unofficialItem2:"過度な利用でアカウントに制限がかかる可能性があります",unofficialItem3:"CCSは保証も責任も負いません",yes:"はい",no:"いいえ",installed:"インストール済み",missing:"未インストール",integration:"連携",enabled:"有効",disabled:"無効",github:"GitHub",connected:"接続済み",notConnected:"未接続",authenticate:"認証する",authenticating:"認証中...",status:"ステータス",running:"稼働中",stopped:"停止",port:"ポート",stopping:"停止中...",stop:"停止",starting:"起動中...",start:"起動",installing:"インストール中...",installCopilotApi:"copilot-api をインストール",proxy:"プロキシ",active:"有効",inactive:"無効"},cursorPage:{title:"Cursor",beta:"ベータ",subtitle:"Cursor 専用の連携設定",unofficialTitle:"非公式API - 自己責任で利用",unofficialItem1:"リバースエンジニアリング連携のため、いつでも利用不能になる可能性があります",unofficialItem2:"不正利用や過度な利用により、アカウントが制限されるおそれがあります",unofficialItem3:"CCSは保証も責任も負いません",integration:"連携",authentication:"認証",daemon:"デーモン",enabled:"有効",disabled:"無効",expired:"期限切れ",connected:"接続済み",notConnected:"未接続",running:"稼働中",stopped:"停止中",actions:"操作",disableIntegration:"連携を無効化",enableIntegration:"連携を有効化",autoDetectAuth:"認証を自動検出",manualAuthImport:"認証情報を手動インポート",stopDaemon:"デーモンを停止",startDaemon:"デーモンを起動",port:"ポート",configuration:"Cursor設定",lastModified:"最終更新:",neverSaved:"未保存",saving:"保存中...",save:"保存",modelConfig:"モデル設定",settings:"設定",info:"情報",presets:"プリセット",presetsDesc:"事前設定済みのモデルマッピングを適用します",modelMapping:"モデルマッピング",modelMappingDesc:"各ティアで使うモデルを設定します",defaultModel:"デフォルトモデル",defaultModelDesc:"特定のティア指定がない場合に使われます。",opusModel:"Opus(最高性能)",opusModelDesc:"複雑な推論と最高品質の応答向け。",sonnetModel:"Sonnet(バランス)",sonnetModelDesc:"一般的なコーディングや日常的なチャット向け。",haikuModel:"Haiku(高速)",haikuModelDesc:"低レイテンシで軽量なリクエスト向け。",runtimeSettings:"ランタイム設定",autoStartDaemon:"デーモンを自動起動",autoStartDesc:"連携使用時にCursorデーモンを自動で起動します。",ghostMode:"ゴーストモード",ghostModeDesc:"テレメトリ削減のため x-ghost-mode を要求します。",provider:"プロバイダー",filePath:"ファイルパス",availableModels:"利用可能なモデル",loadingModels:"モデルを読み込み中...",noModels:"モデルメタデータはまだありません。デーモンを起動して更新してください。",default:"デフォルト",rawConfiguration:"生の設定(JSON)",manualImportTitle:"Cursor 認証情報の手動インポート",manualImportDesc:"自動検出できない場合は、CursorのアクセストークンとマシンIDを入力してください。",accessToken:"アクセストークン",accessTokenPlaceholder:"Cursorのアクセストークンを貼り付け",machineId:"マシンID",machineIdPlaceholder:"32文字の16進数(ハイフンなしUUID)",cancel:"キャンセル",import:"インポート",selectModel:"モデルを選択",useDefaultModel:"デフォルトモデルを使用",availableModelCount:"利用可能なモデル({{count}})",invalidPort:"ポートは1から65535の整数で指定してください",defaultModelRequired:"デフォルトモデルは必須です",savedConfig:"Cursor設定とモデルマッピングを保存しました",failedSaveConfig:"設定の保存に失敗しました",modelsLoadingWait:"モデルの読み込み中です。プリセットの適用前にしばらくお待ちください。",noModelsAvailable:"まだ利用可能なモデルがありません。先にデーモンを起動して更新してください。",appliedCodexPreset:"GPT-5.3 Codexプリセットを適用しました",appliedClaudePreset:"Claude 4.6プリセットを適用しました",appliedGeminiPreset:"Gemini 3プリセットを適用しました",integrationEnabled:"Cursor連携を有効化しました",integrationDisabled:"Cursor連携を無効化しました",failedUpdateIntegration:"連携状態の更新に失敗しました",credentialsImported:"Cursor認証情報をインポートしました",autoDetectFailed:"自動検出に失敗しました",manualRequired:"トークンとマシンIDは必須です",manualImportFailed:"手動インポートに失敗しました",failedStartDaemon:"デーモンの起動に失敗しました",daemonStarted:"デーモンを起動しました",daemonStartedWithPid:"デーモンを起動しました(PID: {{pid}})",failedStopDaemon:"デーモンの停止に失敗しました",daemonStopped:"デーモンを停止しました",rawLoading:"生の設定をまだ読み込み中です。しばらく待ってから再試行してください。",invalidJson:"JSONが不正です",rawSaved:"生の設定を保存しました",rawChanged:"生の設定が外部で変更されました。更新して再試行してください。",failedSaveRaw:"生の設定の保存に失敗しました",savedAll:"Cursor設定を保存しました"},droidPage:{loadingDiagnostics:"Droid診断を読み込み中...",failedDiagnostics:"Droid診断の読み込みに失敗しました。",overview:"概要",byok:"BYOK",docs:"ドキュメント",runtimeInstall:"ランタイムとインストール",status:"状態",detected:"検出済み",notFound:"未検出",detectionSource:"検出元",binaryPath:"バイナリパス",installDirectory:"インストール先",version:"バージョン",overridePath:"オーバーライド(CCS_DROID_PATH)",configFiles:"設定ファイル",path:"パス",resolved:"解決先",size:"サイズ",lastModified:"最終更新",parseWarning:"解析警告: {{value}}",readWarning:"読み取り警告: {{value}}",warnings:"警告",byokSummary:"BYOK概要",activeModelSelector:"現在のモデルセレクター",customModels:"カスタムモデル",ccsManaged:"CCS管理",userManaged:"ユーザー管理",malformedEntries:"不正なエントリ",providers:"プロバイダー",none:"なし",customModelsTitle:"カスタムモデル",modelName:"名前 / モデル",provider:"プロバイダー",baseUrl:"ベース URL",noCustomModels:"カスタムモデルはありません",docsAlignedNotes:"ドキュメント整合メモ",factoryDocs:"Factory Docs",providerFactCheckDocs:"プロバイダー検証ドキュメント",providerValues:"プロバイダー値: {{value}}",settingsHierarchy:"設定階層: {{value}}",settingsTitle:"Droid BYOK 設定",fixJsonBeforeQuickSettings:"クイック設定を使う前に JSON 構文を修正してください。",fixJsonBeforeReasoning:"BYOK 推論設定を更新する前に JSON 構文を修正してください。",unableUpdateReasoning:"選択した BYOK モデルの推論設定を更新できません。",fixJsonBeforeBudget:"思考予算を更新する前に JSON 構文を修正してください。",anthropicOnlyBudget:"思考予算は Anthropic の BYOK モデルでのみ利用できます。",invalidJson:"JSON が不正です: {{value}}",saved:"Droid 設定を保存しました",changedExternally:"Droid 設定が外部で変更されました。更新して再試行してください。",failedSave:"Droid 設定の保存に失敗しました"},sharedPage:{commands:"コマンド",skills:"スキル",agents:"エージェント",title:"共有データ",subtitle:"Claudeインスタンス間で共有されるコマンド、スキル、エージェント",totalShared:"共有数",visible:"表示中",markdownDetail:"Markdown詳細ビュー",filterPrefix:"フィルター:",configurationRequired:"設定が必要です",countsUnavailable:"件数を取得できません",retryCounts:"件数を再取得",filterPlaceholder:"{{tab}}を名前、説明、パスで絞り込み",showing:"{{visible}} / {{total}} 件の{{tab}}を表示",showingQuery:"(「{{query}}」で絞り込み)",refreshing:"(更新中...)",loadingShared:"共有{{tab}}を読み込み中...",failedLoadShared:"共有{{tab}}の読み込みに失敗しました",retry:"再試行",noSharedFound:"共有{{tab}}が見つかりません。`ccs sync` を実行するか、共有ディレクトリに項目を追加してください。",noMatch:"{{tab}}で「{{query}}」に一致するものはありません。",selectOne:"内容を表示する{{tab}}を選択してください。",pathLabel:"パス",resolvedSource:"解決後ソース",loadingMarkdown:"Markdownコンテンツを読み込み中...",failedLoadContent:"コンテンツの読み込みに失敗しました",retryContent:"再読み込み",noMarkdown:"Markdownコンテンツはありません。"}}}};Be.isInitialized||Be.use(SN).init({resources:LN,lng:ON(),fallbackLng:"en",interpolation:{escapeValue:!1}});const RN={theme:"system",setTheme:()=>null,isDark:!1},Fx=S.createContext(RN);function _N({children:n,defaultTheme:a="system",storageKey:o="vite-ui-theme"}){const[s,c]=S.useState(()=>localStorage.getItem(o)||a),[d,f]=S.useState(()=>typeof window<"u"?window.matchMedia("(prefers-color-scheme: dark)").matches:!1);S.useEffect(()=>{const y=window.matchMedia("(prefers-color-scheme: dark)"),C=x=>{f(x.matches)};return y.addEventListener("change",C),()=>y.removeEventListener("change",C)},[]);const p=s==="dark"||s==="system"&&d;S.useEffect(()=>{const y=window.document.documentElement;y.classList.remove("light","dark"),y.classList.add(p?"dark":"light")},[p]);const m={theme:s,setTheme:y=>{localStorage.setItem(o,y),c(y)},isDark:p};return l.jsx(Fx.Provider,{value:m,children:n})}const Gx=S.createContext(null),sy="ccs-privacy-mode";function zN({children:n}){const[a,o]=S.useState(()=>typeof window<"u"?localStorage.getItem(sy)==="true":!1);S.useEffect(()=>{localStorage.setItem(sy,String(a))},[a]);const s=S.useCallback(()=>o(d=>!d),[]),c=S.useMemo(()=>({privacyMode:a,togglePrivacyMode:s}),[a,s]);return l.jsx(Gx.Provider,{value:c,children:n})}function Qd(){const n=S.useContext(Gx);if(!n)throw new Error("usePrivacy must be used within a PrivacyProvider");return n}const Vx="blur-[4px] select-none hover:blur-none transition-all duration-200",IN="/api/auth";async function Wd(n,a){const o=await fetch(`${IN}${n}`,{headers:{"Content-Type":"application/json"},credentials:"include",...a});if(!o.ok){const s=await o.json().catch(()=>({error:"Unknown error"}));throw new Error(s.error||o.statusText)}return o.json()}function UN(){return Wd("/check")}function HN(n,a){return Wd("/login",{method:"POST",body:JSON.stringify({username:n,password:a})})}function BN(){return Wd("/logout",{method:"POST"})}const Yx=S.createContext(null);function KN({children:n}){const[a,o]=S.useState(!1),[s,c]=S.useState(!1),[d,f]=S.useState(null),[p,m]=S.useState(!0);S.useEffect(()=>{UN().then(b=>{o(b.authRequired),c(b.authenticated),f(b.username)}).catch(()=>{o(!0),c(!1)}).finally(()=>m(!1))},[]);const y=S.useCallback(async(b,A)=>{const N=await HN(b,A);c(!0),f(N.username)},[]),C=S.useCallback(async()=>{await BN(),c(!1),f(null)},[]),x=S.useMemo(()=>({authRequired:a,isAuthenticated:s,username:d,loading:p,login:y,logout:C}),[a,s,d,p,y,C]);return l.jsx(Yx.Provider,{value:x,children:n})}function Xd(){const n=S.useContext(Yx);if(!n)throw new Error("useAuth must be used within an AuthProvider");return n}function qN(){const{authRequired:n,isAuthenticated:a,loading:o}=Xd(),s=wl();return o?l.jsx("div",{className:"flex h-screen items-center justify-center",children:l.jsx(On,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):n?a?l.jsx(Nd,{}):l.jsx(sS,{to:"/login",state:{from:s},replace:!0}):l.jsx(Nd,{})}const cd=768;function FN(){const[n,a]=S.useState(void 0);return S.useEffect(()=>{const o=window.matchMedia(`(max-width: ${cd-1}px)`),s=()=>{a(window.innerWidth<cd)};return o.addEventListener("change",s),a(window.innerWidth<cd),()=>o.removeEventListener("change",s)},[]),!!n}const $x=S.createContext(null);function Ol(){const n=S.useContext($x);if(!n)throw new Error("useSidebar must be used within a SidebarProvider.");return n}function K(...n){return QS(WS(n))}function Zd(n){if(!Number.isFinite(n))return"0";const a=Math.max(0,Math.min(100,n));return`${Math.round(a)}`}const ly=["#f94144","#f3722c","#f8961e","#f9844a","#f9c74f","#90be6d","#43aa8b","#4d908e","#577590","#277da1"],Wt={success:"#15803d",degraded:"#b45309",failed:"#b91c1c"};function WE(n){let a=2166136261;for(let o=0;o<n.length;o++)a^=n.charCodeAt(o),a=Math.imul(a,16777619);return ly[(a>>>0)%ly.length]}function Md(n){if(!n)return null;try{const a=new Date(n),o=new Date,s=a.getTime()-o.getTime();if(s<=0)return"soon";const c=Math.floor(s/(1e3*60*60));if(c>=24)return a.toLocaleDateString(void 0,{month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"});const d=Math.floor(s%(1e3*60*60)/(1e3*60));return c>0?`in ${c}h ${d}m`:`in ${d}m`}catch{return null}}function Jd(n){return n.filter(a=>{const o=(a.displayName||a.name||"").toLowerCase();return o.includes("claude")||o.includes("gpt")})}function GN(n){if(n.length===0)return null;const a=Jd(n);if(a.length===0)return 0;const o=a.map(s=>s.percentage).filter(s=>typeof s=="number"&&isFinite(s));return o.length===0?0:Math.min(...o)}function VN(n){if(n.length===0)return null;const a=Jd(n);return a.length===0?null:a.reduce((o,s)=>s.resetTime?o?new Date(s.resetTime)<new Date(o)?s.resetTime:o:s.resetTime:o,null)}const YN=/claude-(?:opus|sonnet)-4(?:[.-])5(?:-thinking)?(?=(?:$|[^a-z0-9]))/i;function XE(n){return YN.test((n||"").trim())}const $N=[{name:"claude-opus-4-6-thinking",displayName:"Claude Opus 4.6 (Thinking)"},{name:"claude-sonnet-4-6",displayName:"Claude Sonnet 4.6"},{name:"gpt-oss-120b",displayName:"GPT-OSS 120B (Medium)"}];function QN(n){const a=n.toLowerCase();return a.includes("claude")||a.includes("gpt")?"primary":a.includes("gemini 3")||a.includes("gemini-3")?"gemini-3":a.includes("gemini 2")||a.includes("gemini-2")?"gemini-2":"other"}function WN(n){if(n.length===0)return[];const a=Jd(n),o=[];if(a.length===0)for(const c of $N)o.push({name:c.name,displayName:c.displayName,percentage:0,tier:"primary",exhausted:!0});for(const c of n){const d=c.displayName||c.name,f=QN(d);o.push({name:c.name,displayName:d,percentage:c.percentage,tier:f,exhausted:f==="primary"&&c.percentage===0})}const s=["primary","gemini-3","gemini-2","other"];return o.sort((c,d)=>{const f=s.indexOf(c.tier)-s.indexOf(d.tier);return f!==0?f:c.displayName.localeCompare(d.displayName)})}function XN(n){const a=new Map;for(const o of n){const s=a.get(o.tier)||[];s.push(o),a.set(o.tier,s)}return a}function Pr(n){const a=(n||"").toLowerCase(),o=a.includes("code review")||a.includes("code_review"),s=a.includes("primary"),c=a.includes("secondary");return o?s?"code-review-5h":c?"code-review-weekly":"code-review":s?"usage-5h":c?"usage-weekly":"unknown"}function ZN(n,a){if(Pr(n.label)==="code-review-weekly")return"weekly";const s=n.resetAfterSeconds;if(typeof s!="number"||!isFinite(s)||s<=0)return null;const c=a.find(m=>Pr(m.label)==="usage-5h"&&typeof m.resetAfterSeconds=="number"&&isFinite(m.resetAfterSeconds)&&m.resetAfterSeconds>0),d=a.find(m=>Pr(m.label)==="usage-weekly"&&typeof m.resetAfterSeconds=="number"&&isFinite(m.resetAfterSeconds)&&m.resetAfterSeconds>0);if(!c||!d)return null;const f=Math.abs(s-c.resetAfterSeconds);return Math.abs(s-d.resetAfterSeconds)<=f?"weekly":"5h"}function JN(n,a=[]){const o=typeof n=="string"?n:n.label,s=typeof n=="string"?{label:o,resetAfterSeconds:null}:{label:o,resetAfterSeconds:n.resetAfterSeconds},c=a.length>0?a:[s];switch(Pr(o)){case"usage-5h":return"5h usage limit";case"usage-weekly":return"Weekly usage limit";case"code-review-5h":case"code-review-weekly":case"code-review":{const d=ZN(s,c);return d==="5h"?"Code review (5h)":d==="weekly"?"Code review (weekly)":"Code review"}case"unknown":return o}}function Pl(n){if(!n||n.length===0)return{fiveHourWindow:null,weeklyWindow:null,codeReviewWindows:[],unknownWindows:[]};let a=null,o=null;const s=[],c=[],d=[];for(const f of n)switch(Pr(f.label)){case"usage-5h":a||(a=f),d.push(f);break;case"usage-weekly":o||(o=f),d.push(f);break;case"code-review-5h":case"code-review-weekly":case"code-review":s.push(f);break;case"unknown":c.push(f),d.push(f);break}if((!a||!o)&&d.length>0){const f=d.filter(p=>typeof p.resetAfterSeconds=="number"&&p.resetAfterSeconds>=0).sort((p,m)=>(p.resetAfterSeconds||0)-(m.resetAfterSeconds||0));a||(a=f[0]||d[0]||null),o||(o=f.length>1?f[f.length-1]:d.find(p=>p!==a)||null)}return{fiveHourWindow:a,weeklyWindow:o,codeReviewWindows:s,unknownWindows:c}}function eA(n){if(!n||n.length===0)return null;const{fiveHourWindow:a,weeklyWindow:o}=Pl(n),s=[a,o].filter((f,p,m)=>!!f&&m.indexOf(f)===p),d=(s.length>0?s:n).map(f=>f.remainingPercent);return Math.min(...d)}function tA(n){if(!n||n.length===0)return null;const{fiveHourWindow:a,weeklyWindow:o}=Pl(n),s=[a,o].filter((f,p,m)=>!!f&&m.indexOf(f)===p),d=(s.length>0?s:n).map(f=>f.resetAt).filter(f=>f!==null);return d.length===0?null:d.sort()[0]}function nA(n){if(!n.success)return null;const a=[n.coreUsage?.fiveHour,n.coreUsage?.weekly].filter(s=>!!s);if(a.length>0)return Math.min(...a.map(s=>s.remainingPercent));const o=n.windows.filter(s=>s.rateLimitType!=="overage");return o.length>0?Math.min(...o.map(s=>s.remainingPercent)):null}function aA(n){if(!n.success)return null;const a=[n.coreUsage?.fiveHour?.resetAt,n.coreUsage?.weekly?.resetAt].filter(s=>!!s);if(a.length>0)return a.sort()[0];const o=n.windows.filter(s=>s.rateLimitType!=="overage").map(s=>s.resetAt).filter(s=>s!==null);return o.length===0?null:o.sort()[0]}function iA(n){if(!n||n.length===0)return null;const a=n.map(o=>o.remainingPercent);return Math.min(...a)}function oA(n){if(!n||n.length===0)return null;const a=n.map(o=>o.resetTime).filter(o=>o!==null);return a.length===0?null:a.sort()[0]}function rA(n){if(!n)return null;const a=[n.premiumInteractions.percentRemaining,n.chat.percentRemaining,n.completions.percentRemaining].filter(o=>typeof o=="number"&&isFinite(o));return a.length===0?null:Math.min(...a)}function Fn(n){return typeof n=="object"&&n!==null}function ki(n){return typeof n=="number"&&Number.isFinite(n)}function ef(n){if(!Fn(n))return!1;const a=n.models;return typeof n.success=="boolean"&&Array.isArray(a)}function Ll(n){if(!Fn(n))return!1;const a=n;return typeof a.success!="boolean"||!Array.isArray(a.windows)||!("planType"in a)?!1:a.windows.every(o=>Fn(o)&&typeof o.label=="string"&&ki(o.usedPercent)&&ki(o.remainingPercent))}function Rl(n){if(!Fn(n))return!1;const a=n;return typeof a.success!="boolean"||!Array.isArray(a.windows)||"planType"in a?!1:a.windows.every(o=>Fn(o)&&typeof o.rateLimitType=="string"&&ki(o.remainingPercent)&&typeof o.status=="string")}function tf(n){if(!Fn(n))return!1;const a=n;return typeof a.success!="boolean"||!Array.isArray(a.buckets)?!1:a.buckets.every(o=>Fn(o)&&typeof o.id=="string"&&ki(o.remainingFraction)&&ki(o.remainingPercent)&&Array.isArray(o.modelIds))}function nf(n){if(!Fn(n))return!1;const a=n,o=a.snapshots;return typeof a.success!="boolean"||!Fn(o)?!1:["premiumInteractions","chat","completions"].every(c=>{const d=o[c];return Fn(d)&&ki(d.percentRemaining)&&ki(d.percentUsed)})}function sA(n){const a=[];return typeof n.httpStatus=="number"&&a.push(`HTTP ${n.httpStatus}`),typeof n.errorCode=="string"&&n.errorCode.trim()&&a.push(n.errorCode.trim()),a.length>0?a.join(" | "):null}function lA(n,a,o){const s=n.errorDetail?.trim()||null;if(!s)return null;const c=s.toLowerCase();return c===a.toLowerCase()||o&&c===o.toLowerCase()?null:s}function af(n){if(!n||n.success)return null;const a=n.error?.trim()||"Quota information unavailable",o=n.actionHint?.trim()||null,s=n.errorCode?.trim().toLowerCase()||"",c=sA(n),d=lA(n,a,c),f=a.toLowerCase();return n.needsReauth||s==="token_expired"||s==="reauth_required"||f.includes("token expired")||f.includes("re-authenticate")||f.includes("reauth")||f.includes("expired or invalid")?{label:Be.t("accountCard.failureLabelReauth"),summary:a,actionHint:o||Be.t("accountCard.failureHintReauth"),technicalDetail:c,rawDetail:d,tone:"warning"}:s==="deactivated_workspace"||n.httpStatus===402||f.includes("workspace deactivated")||f.includes("payment or workspace access required")?{label:Be.t("accountCard.failureLabelWorkspace"),summary:a,actionHint:o||Be.t("accountCard.failureHintWorkspace"),technicalDetail:c,rawDetail:d,tone:"warning"}:n.isForbidden||n.httpStatus===403||s==="quota_api_forbidden"||f.includes("forbidden")?{label:Be.t("accountCard.failureLabelNoAccess"),summary:a,actionHint:o||Be.t("accountCard.failureHintNoAccess"),technicalDetail:c,rawDetail:d,tone:"muted"}:n.httpStatus===429||s==="rate_limited"||f.includes("rate limited")?{label:Be.t("accountCard.failureLabelRetry"),summary:a,actionHint:o||Be.t("accountCard.failureHintRetry"),technicalDetail:c,rawDetail:d,tone:"warning"}:s==="auth_file_missing"||s==="missing_account_id"||f.includes("auth file not found")||f.includes("missing chatgpt-account-id")?{label:Be.t("accountCard.failureLabelReconnect"),summary:a,actionHint:o||Be.t("accountCard.failureHintReconnect"),technicalDetail:c,rawDetail:d,tone:"muted"}:n.retryable||s==="network_timeout"||s==="network_error"||s==="provider_unavailable"||f.includes("timeout")||f.includes("network")||f.includes("fetch failed")||f.includes("service unavailable")?{label:Be.t("accountCard.failureLabelTemporary"),summary:a,actionHint:o||Be.t("accountCard.failureHintTemporary"),technicalDetail:c,rawDetail:d,tone:"warning"}:{label:Be.t("accountCard.failureLabelUnavailable"),summary:a,actionHint:o,technicalDetail:c,rawDetail:d,tone:"muted"}}function Qx(n,a){if(!a?.success)return null;switch(n.trim().toLowerCase()){case"agy":return ef(a)?GN(a.models):null;case"codex":return Ll(a)?eA(a.windows):null;case"claude":case"anthropic":return Rl(a)?nA(a):null;case"gemini":return tf(a)?iA(a.buckets):null;case"ghcp":case"github-copilot":return nf(a)?rA(a.snapshots):null;default:return null}}function Wx(n,a){if(!a?.success)return null;switch(n.trim().toLowerCase()){case"agy":return ef(a)?VN(a.models):null;case"codex":return Ll(a)?tA(a.windows):null;case"claude":case"anthropic":return Rl(a)?aA(a):null;case"gemini":return tf(a)?oA(a.buckets):null;case"ghcp":case"github-copilot":return nf(a)?a.quotaResetDate:null;default:return null}}const ul=Ml("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 dt({className:n,variant:a,size:o,asChild:s=!1,...c}){const d=s?Sl:"button";return l.jsx(d,{"data-slot":"button",className:K(ul({variant:a,size:o,className:n})),...c})}function Hn({className:n,type:a,...o}){return l.jsx("input",{type:a,"data-slot":"input",className:K("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",n),...o})}function cA({...n}){return l.jsx(ax,{"data-slot":"sheet",...n})}function uA({...n}){return l.jsx(lx,{"data-slot":"sheet-portal",...n})}function dA({className:n,...a}){return l.jsx(cx,{"data-slot":"sheet-overlay",className:K("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",n),...a})}function fA({className:n,children:a,side:o="right",...s}){return l.jsxs(uA,{children:[l.jsx(dA,{}),l.jsxs(ix,{"data-slot":"sheet-content",className:K("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",o==="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",o==="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",o==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",o==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",n),...s,children:[a,l.jsxs(ox,{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:[l.jsx(No,{className:"size-4"}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function hA({className:n,...a}){return l.jsx("div",{"data-slot":"sheet-header",className:K("flex flex-col gap-1.5 p-4",n),...a})}function pA({className:n,...a}){return l.jsx(rx,{"data-slot":"sheet-title",className:K("text-foreground font-semibold",n),...a})}function mA({className:n,...a}){return l.jsx(sx,{"data-slot":"sheet-description",className:K("text-muted-foreground text-sm",n),...a})}function Ye({className:n,...a}){return l.jsx("div",{"data-slot":"skeleton",className:K("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",n),...a})}function Di({delayDuration:n=0,...a}){return l.jsx(jC,{"data-slot":"tooltip-provider",delayDuration:n,...a})}function Sa({...n}){return l.jsx(Di,{children:l.jsx(TC,{"data-slot":"tooltip",...n})})}function wa({...n}){return l.jsx(MC,{"data-slot":"tooltip-trigger",...n})}function Na({className:n,sideOffset:a=0,children:o,...s}){return l.jsx(EC,{children:l.jsxs(OC,{"data-slot":"tooltip-content",sideOffset:a,className:K("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",n),...s,children:[o,l.jsx(PC,{className:"bg-foreground fill-foreground z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const gA="sidebar_state",yA=3600*24*7,xA="16rem",bA="18rem",vA="3rem",CA="b";function SA({defaultOpen:n=!0,open:a,onOpenChange:o,className:s,style:c,children:d,...f}){const p=FN(),[m,y]=S.useState(!1),[C,x]=S.useState(n),b=a??C,A=S.useCallback(R=>{const k=typeof R=="function"?R(b):R;o?o(k):x(k),document.cookie=`${gA}=${k}; path=/; max-age=${yA}`},[o,b]),N=S.useCallback(()=>p?y(R=>!R):A(R=>!R),[p,A,y]);S.useEffect(()=>{const R=k=>{k.key===CA&&(k.metaKey||k.ctrlKey)&&(k.preventDefault(),N())};return window.addEventListener("keydown",R),()=>window.removeEventListener("keydown",R)},[N]);const E=b?"expanded":"collapsed",O=S.useMemo(()=>({state:E,open:b,setOpen:A,isMobile:p,openMobile:m,setOpenMobile:y,toggleSidebar:N}),[E,b,A,p,m,y,N]);return l.jsx($x.Provider,{value:O,children:l.jsx(Di,{delayDuration:0,children:l.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":xA,"--sidebar-width-icon":vA,...c},className:K("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex h-svh min-h-0 w-full overflow-hidden",s),...f,children:d})})})}function wA({side:n="left",variant:a="sidebar",collapsible:o="offcanvas",className:s,children:c,...d}){const{isMobile:f,state:p,openMobile:m,setOpenMobile:y}=Ol();return o==="none"?l.jsx("div",{"data-slot":"sidebar",className:K("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",s),...d,children:c}):f?l.jsx(cA,{open:m,onOpenChange:y,...d,children:l.jsxs(fA,{"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":bA},side:n,children:[l.jsxs(hA,{className:"sr-only",children:[l.jsx(pA,{children:"Sidebar"}),l.jsx(mA,{children:"Displays the mobile sidebar."})]}),l.jsx("div",{className:"flex h-full w-full flex-col",children:c})]})}):l.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":p,"data-collapsible":p==="collapsed"?o:"","data-variant":a,"data-side":n,"data-slot":"sidebar",children:[l.jsx("div",{"data-slot":"sidebar-gap",className:K("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),l.jsx("div",{"data-slot":"sidebar-container",className:K("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",n==="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)]",a==="floating"||a==="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",s),...d,children:l.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:c})})]})}function NA({className:n,onClick:a,...o}){const{toggleSidebar:s}=Ol();return l.jsxs(dt,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:K("size-7",n),onClick:c=>{a?.(c),s()},...o,children:[l.jsx(gS,{}),l.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function AA({className:n,...a}){return l.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:K("flex flex-col gap-2 p-2",n),...a})}function kA({className:n,...a}){return l.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:K("flex flex-col gap-2 p-2",n),...a})}function DA({className:n,...a}){return l.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:K("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",n),...a})}function jA({className:n,...a}){return l.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:K("relative flex w-full min-w-0 flex-col p-2",n),...a})}function TA({className:n,asChild:a=!1,...o}){const s=a?Sl:"div";return l.jsx(s,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:K("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",n),...o})}function MA({className:n,...a}){return l.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:K("w-full text-sm",n),...a})}function EA({className:n,...a}){return l.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:K("flex w-full min-w-0 flex-col gap-1 group-data-[collapsible=icon]:items-center",n),...a})}function OA({className:n,...a}){return l.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:K("group/menu-item relative",n),...a})}const PA=Ml("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 cy({asChild:n=!1,isActive:a=!1,variant:o="default",size:s="default",tooltip:c,className:d,...f}){const p=n?Sl:"button",{isMobile:m,state:y}=Ol(),C=l.jsx(p,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":a,className:K(PA({variant:o,size:s}),d),...f});return c?(typeof c=="string"&&(c={children:c}),l.jsxs(Sa,{children:[l.jsx(wa,{asChild:!0,children:C}),l.jsx(Na,{side:"right",align:"center",hidden:y!=="collapsed"||m,...c})]})):C}function LA({className:n,...a}){return l.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:K("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",n),...a})}function RA({className:n,...a}){return l.jsx("li",{"data-slot":"sidebar-menu-sub-item","data-sidebar":"menu-sub-item",className:K("group/menu-sub-item relative",n),...a})}function _A({asChild:n=!1,size:a="md",isActive:o=!1,className:s,...c}){const d=n?Sl:"a";return l.jsx(d,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":a,"data-active":o,className:K("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",a==="sm"&&"text-xs",a==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",s),...c})}const zA={sm:24,md:32,lg:48};function Xx({size:n="md",className:a,showText:o=!0}){const s=zA[n];return l.jsxs("div",{className:K("flex items-center gap-2",a),children:[l.jsx("img",{src:"/logo/ccs-logo-256.png",alt:"CCS Logo",width:s,height:s,className:"rounded"}),o&&l.jsx("span",{className:"font-bold text-lg",children:"CCS Config"})]})}const rl="/api",Zx="CONFLICT";class ZE extends Error{code=Zx;constructor(a="Resource modified externally"){super(a),this.name="ApiConflictError"}}function JE(n){return n instanceof Error&&"code"in n&&n.code===Zx}function kr(n){return n?/^https?:\/\//i.test(n)||n===rl||n.startsWith(`${rl}/`)?n:`${rl}${n.startsWith("/")?n:`/${n}`}`:rl}async function IA(n){const a=`Request failed (${n.status}${n.statusText?` ${n.statusText}`:""})`,o=await n.text();if(!o)return a;try{const s=JSON.parse(o);return s.error?.trim()?s.error:s.message?.trim()?s.message:a}catch{return o.trim()||a}}async function ce(n,a){const o=await fetch(kr(n),{headers:{"Content-Type":"application/json"},...a});if(!o.ok)throw new Error(await IA(o));if(o.status===204)return;if((o.headers.get("content-type")?.toLowerCase()??"").includes("application/json"))return await o.json();const c=await o.text();if(c)try{return JSON.parse(c)}catch{return c}}const Ke={profiles:{list:()=>ce("/profiles"),create:n=>ce("/profiles",{method:"POST",body:JSON.stringify(n)}),update:(n,a)=>ce(`/profiles/${n}`,{method:"PUT",body:JSON.stringify(a)}),delete:n=>ce(`/profiles/${n}`,{method:"DELETE"}),discoverOrphans:()=>ce("/profiles/orphans"),registerOrphans:n=>ce("/profiles/orphans/register",{method:"POST",body:JSON.stringify(n)}),copy:(n,a)=>ce(`/profiles/${n}/copy`,{method:"POST",body:JSON.stringify(a)}),export:(n,a=!1)=>ce(`/profiles/${n}/export`,{method:"POST",body:JSON.stringify({includeSecrets:a})}),import:n=>ce("/profiles/import",{method:"POST",body:JSON.stringify(n)})},imageAnalysis:{get:()=>ce("/image-analysis"),update:n=>ce("/image-analysis",{method:"PUT",body:JSON.stringify(n)})},cliproxy:{list:()=>ce("/cliproxy"),getAuthStatus:()=>ce("/cliproxy/auth"),create:n=>ce("/cliproxy",{method:"POST",body:JSON.stringify(n)}),update:(n,a)=>ce(`/cliproxy/${n}`,{method:"PUT",body:JSON.stringify(a)}),delete:n=>ce(`/cliproxy/${n}`,{method:"DELETE"}),proxyStatus:()=>ce("/cliproxy/proxy-status"),proxyStart:()=>ce("/cliproxy/proxy-start",{method:"POST"}),proxyStop:()=>ce("/cliproxy/proxy-stop",{method:"POST"}),updateCheck:()=>ce("/cliproxy/update-check"),versions:()=>ce("/cliproxy/versions"),install:(n,a)=>ce("/cliproxy/install",{method:"POST",body:JSON.stringify({version:n,force:a})}),restart:()=>ce("/cliproxy/restart",{method:"POST"}),stats:()=>ce("/cliproxy/usage"),models:()=>ce("/cliproxy/models"),updateModel:(n,a)=>ce(`/cliproxy/models/${n}`,{method:"PUT",body:JSON.stringify({model:a})}),aiProviders:{list:()=>ce("/cliproxy/ai-providers"),create:(n,a)=>ce(`/cliproxy/ai-providers/${encodeURIComponent(n)}`,{method:"POST",body:JSON.stringify(a)}),update:(n,a,o)=>ce(`/cliproxy/ai-providers/${encodeURIComponent(n)}/${encodeURIComponent(a)}`,{method:"PUT",body:JSON.stringify(o)}),delete:(n,a)=>ce(`/cliproxy/ai-providers/${encodeURIComponent(n)}/${encodeURIComponent(a)}`,{method:"DELETE"})},getConfigYaml:async()=>{const n=await fetch(kr("/cliproxy/config.yaml"));if(!n.ok)throw new Error("Failed to load config");return n.text()},saveConfigYaml:async n=>{const a=await fetch(kr("/cliproxy/config.yaml"),{method:"PUT",headers:{"Content-Type":"application/yaml"},body:n});if(!a.ok){const o=await a.json().catch(()=>({error:"Failed to save config"}));throw new Error(o.error||"Failed to save config")}},getAuthFiles:()=>ce("/cliproxy/auth-files"),getAuthFile:async n=>{const a=await fetch(kr(`/cliproxy/auth-files/download?name=${encodeURIComponent(n)}`));if(!a.ok)throw new Error("Failed to load auth file");return a.text()},accounts:{list:()=>ce("/cliproxy/auth/accounts"),listByProvider:n=>ce(`/cliproxy/auth/accounts/${n}`),setDefault:(n,a)=>ce(`/cliproxy/auth/accounts/${n}/default`,{method:"POST",body:JSON.stringify({accountId:a})}),remove:(n,a)=>ce(`/cliproxy/auth/accounts/${n}/${encodeURIComponent(a)}`,{method:"DELETE"}),pause:(n,a)=>ce(`/cliproxy/auth/accounts/${n}/${encodeURIComponent(a)}/pause`,{method:"POST"}),resume:(n,a)=>ce(`/cliproxy/auth/accounts/${n}/${encodeURIComponent(a)}/resume`,{method:"POST"}),solo:(n,a)=>ce("/accounts/solo",{method:"POST",body:JSON.stringify({provider:n,accountId:a})}),bulkPause:(n,a)=>ce("/accounts/bulk-pause",{method:"POST",body:JSON.stringify({provider:n,accountIds:a})}),bulkResume:(n,a)=>ce("/accounts/bulk-resume",{method:"POST",body:JSON.stringify({provider:n,accountIds:a})})},auth:{start:(n,a)=>ce(`/cliproxy/auth/${n}/start`,{method:"POST",body:JSON.stringify({nickname:a})}),cancel:n=>ce(`/cliproxy/auth/${n}/cancel`,{method:"POST"}),kiroImport:()=>ce("/cliproxy/auth/kiro/import",{method:"POST"})},errorLogs:{list:()=>ce("/cliproxy/error-logs"),getContent:async n=>{const a=await fetch(kr(`/cliproxy/error-logs/${encodeURIComponent(n)}`));if(!a.ok)throw new Error("Failed to load error log");return a.text()}}},accounts:{list:()=>ce("/accounts"),setDefault:n=>ce("/accounts/default",{method:"POST",body:JSON.stringify({name:n})}),resetDefault:()=>ce("/accounts/reset-default",{method:"DELETE"}),delete:n=>ce(`/accounts/${n}`,{method:"DELETE"}),updateContext:(n,a)=>ce(`/accounts/${encodeURIComponent(n)}/context`,{method:"PUT",body:JSON.stringify(a)})},config:{format:()=>ce("/config/format"),get:()=>ce("/config"),update:n=>ce("/config",{method:"PUT",body:JSON.stringify(n)}),migrate:(n=!1)=>ce(`/config/migrate?dryRun=${n}`,{method:"POST"}),rollback:n=>ce("/config/rollback",{method:"POST",body:JSON.stringify({backupPath:n})})},presets:{list:n=>ce(`/settings/${n}/presets`),create:(n,a)=>ce(`/settings/${n}/presets`,{method:"POST",body:JSON.stringify(a)}),delete:(n,a)=>ce(`/settings/${n}/presets/${encodeURIComponent(a)}`,{method:"DELETE"})},cliproxyServer:{get:()=>ce("/cliproxy-server"),update:n=>ce("/cliproxy-server",{method:"PUT",body:JSON.stringify(n)}),getBackend:()=>ce("/cliproxy-server/backend"),updateBackend:(n,a=!1)=>ce("/cliproxy-server/backend",{method:"PUT",body:JSON.stringify({backend:n,force:a})}),test:n=>ce("/cliproxy-server/test",{method:"POST",body:JSON.stringify(n)})},quota:{get:(n,a)=>ce(`/cliproxy/quota/${n}/${encodeURIComponent(a)}`),getCodex:n=>ce(`/cliproxy/quota/codex/${encodeURIComponent(n)}`),getClaude:n=>ce(`/cliproxy/quota/claude/${encodeURIComponent(n)}`),getGemini:n=>ce(`/cliproxy/quota/gemini/${encodeURIComponent(n)}`)}};function eO(){return Tt({queryKey:["cliproxy"],queryFn:()=>Ke.cliproxy.list()})}function UA(){return Tt({queryKey:["cliproxy-auth"],queryFn:()=>Ke.cliproxy.getAuthStatus()})}function tO(){const n=rt();return nt({mutationFn:a=>Ke.cliproxy.create(a),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy"]}),le.success("Variant created successfully")},onError:a=>{le.error(a.message)}})}function nO(){const n=rt();return nt({mutationFn:a=>Ke.cliproxy.delete(a),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy"]}),le.success("Variant deleted successfully")},onError:a=>{le.error(a.message)}})}function aO(){const n=rt();return nt({mutationFn:({provider:a,accountId:o})=>Ke.cliproxy.accounts.setDefault(a,o),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),le.success("Default account updated")},onError:a=>{le.error(a.message)}})}function iO(){const n=rt();return nt({mutationFn:({provider:a,accountId:o})=>Ke.cliproxy.accounts.remove(a,o),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),le.success("Account removed")},onError:a=>{le.error(a.message)}})}function HA(){const n=rt();return nt({mutationFn:({provider:a,accountId:o})=>Ke.cliproxy.accounts.pause(a,o),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]}),le.success("Account paused")},onError:a=>{le.error(a.message)}})}function BA(){const n=rt();return nt({mutationFn:({provider:a,accountId:o})=>Ke.cliproxy.accounts.resume(a,o),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]}),le.success("Account resumed")},onError:a=>{le.error(a.message)}})}function oO(){const n=rt();return nt({mutationFn:({provider:a,accountId:o})=>Ke.cliproxy.accounts.solo(a,o),onSuccess:a=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]});const o=a.paused.length;le.success(`Solo mode: paused ${o} other account${o!==1?"s":""}`)},onError:a=>{le.error(a.message)}})}function KA(){const n=rt();return nt({mutationFn:({provider:a,accountIds:o})=>Ke.cliproxy.accounts.bulkPause(a,o),onSuccess:a=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]}),le.success(`Paused ${a.succeeded.length} account${a.succeeded.length!==1?"s":""}`),a.failed.length>0&&le.warning(`${a.failed.length} account${a.failed.length!==1?"s":""} failed to pause`)},onError:a=>{le.error(a.message)}})}function qA(){const n=rt();return nt({mutationFn:({provider:a,accountIds:o})=>Ke.cliproxy.accounts.bulkResume(a,o),onSuccess:a=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]}),le.success(`Resumed ${a.succeeded.length} account${a.succeeded.length!==1?"s":""}`),a.failed.length>0&&le.warning(`${a.failed.length} account${a.failed.length!==1?"s":""} failed to resume`)},onError:a=>{le.error(a.message)}})}function rO(){const n=rt();return nt({mutationFn:({provider:a,nickname:o})=>Ke.cliproxy.auth.start(a,o),onSuccess:(a,o)=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),le.success(`Account added for ${o.provider}`)},onError:a=>{le.error(a.message)}})}function sO(){return nt({mutationFn:n=>Ke.cliproxy.auth.cancel(n),onError:n=>{le.error(n.message)}})}function lO(){const n=rt();return nt({mutationFn:()=>Ke.cliproxy.auth.kiroImport(),onSuccess:a=>{n.invalidateQueries({queryKey:["cliproxy-accounts"]}),n.invalidateQueries({queryKey:["cliproxy-auth"]}),a.account?le.success(`Imported Kiro account: ${a.account.email||a.account.id}`):le.success("Kiro token imported")},onError:a=>{le.error(a.message)}})}function cO(){return Tt({queryKey:["cliproxy-models"],queryFn:()=>Ke.cliproxy.models()})}function uO(n){return Tt({queryKey:["presets",n],queryFn:()=>Ke.presets.list(n),enabled:!!n})}function dO(){const n=rt();return nt({mutationFn:({profile:a,data:o})=>Ke.presets.create(a,o),onSuccess:(a,o)=>{n.invalidateQueries({queryKey:["presets",o.profile]}),le.success(`Preset "${o.data.name}" saved`)},onError:a=>{le.error(a.message)}})}function fO(){const n=rt();return nt({mutationFn:({profile:a,name:o})=>Ke.presets.delete(a,o),onSuccess:(a,o)=>{n.invalidateQueries({queryKey:["presets",o.profile]}),le.success("Preset deleted")},onError:a=>{le.error(a.message)}})}function hO(){return Tt({queryKey:["proxy-status"],queryFn:()=>Ke.cliproxy.proxyStatus(),refetchInterval:3e4})}function pO(){const n=rt();return nt({mutationFn:()=>Ke.cliproxy.proxyStart(),onSuccess:a=>{n.invalidateQueries({queryKey:["proxy-status"]}),a.alreadyRunning?le.info("CLIProxy was already running"):a.started?le.success("CLIProxy started successfully"):le.error(a.error||"Failed to start CLIProxy")},onError:a=>{le.error(a.message)}})}function mO(){const n=rt();return nt({mutationFn:()=>Ke.cliproxy.proxyStop(),onSuccess:a=>{n.invalidateQueries({queryKey:["proxy-status"]}),a.stopped?le.success(`CLIProxy stopped${a.sessionCount?` (${a.sessionCount} session(s) disconnected)`:""}`):le.error(a.error||"Failed to stop CLIProxy")},onError:a=>{le.error(a.message)}})}function FA(){return Tt({queryKey:["cliproxy-update-check"],queryFn:()=>Ke.cliproxy.updateCheck(),staleTime:300*1e3,refetchInterval:300*1e3,refetchOnWindowFocus:!0})}function gO(){const n=rt();return nt({mutationKey:["update-backend"],mutationFn:({backend:a,force:o=!1})=>Ke.cliproxyServer.updateBackend(a,o),onSuccess:()=>{n.invalidateQueries({queryKey:["cliproxy-update-check"],refetchType:"all"}),n.invalidateQueries({queryKey:["cliproxy-versions"],refetchType:"all"}),n.invalidateQueries({queryKey:["cliproxy-server-config"],refetchType:"all"}),n.invalidateQueries({queryKey:["proxy-status"]}),n.invalidateQueries({queryKey:["cliproxy-stats"]}),le.success("Backend updated")},onError:a=>{a.message.includes("Proxy is running")?le.error("Stop the proxy first to change backend"):le.error(a.message)}})}function yO(){return Tt({queryKey:["cliproxy-versions"],queryFn:()=>Ke.cliproxy.versions(),staleTime:300*1e3,refetchOnWindowFocus:!0})}function xO(){const n=rt();return nt({mutationFn:({version:a,force:o})=>Ke.cliproxy.install(a,o),onSuccess:a=>{a.requiresConfirmation||(n.invalidateQueries({queryKey:["cliproxy-versions"]}),n.invalidateQueries({queryKey:["cliproxy-update-check"]}),n.invalidateQueries({queryKey:["proxy-status"]}),a.success?le.success(a.message||`Installed v${a.version}`):le.error(a.error||"Installation failed"))},onError:a=>{le.error(a.message)}})}function bO(){const n=rt();return nt({mutationFn:()=>Ke.cliproxy.restart(),onSuccess:a=>{n.invalidateQueries({queryKey:["proxy-status"]}),a.success?le.success(`Proxy restarted on port ${a.port}`):le.error(a.error||"Restart failed")},onError:a=>{le.error(a.message)}})}const GA=LC,VA=RC,YA=_C;function $A(n){return[{title:n("nav.general"),items:[{path:"/",icon:yS,label:n("nav.home")},{path:"/analytics",icon:xS,label:n("nav.analytics")}]},{title:n("nav.identityAccess"),items:[{path:"/providers",icon:Ad,label:n("nav.apiProfiles"),badge:{icons:["/icons/openrouter.svg","/assets/providers/alibabacloud-color.svg","/icons/ollama.svg"]}},{path:"/cliproxy",icon:Nx,label:n("nav.cliproxyPlus"),isCollapsible:!0,children:[{path:"/cliproxy",label:n("nav.cliproxyOverview")},{path:"/cliproxy/ai-providers",icon:Ad,label:"AI Providers"},{path:"/cliproxy/control-panel",icon:bS,label:n("nav.controlPanel")}]},{path:"/copilot",icon:Ax,label:n("nav.githubCopilot")},{path:"/cursor",iconSrc:"/assets/sidebar/cursor.svg",label:n("nav.cursorIde")},{path:"/accounts",icon:Dx,label:n("nav.accounts"),isCollapsible:!0,children:[{path:"/accounts",label:n("nav.allAccounts")},{path:"/shared",icon:kx,label:n("nav.sharedData")}]}]},{title:n("nav.compatibleClis"),items:[{path:"/claude-extension",icon:vS,label:n("nav.claudeExtension")},{path:"/codex",iconSrc:"/assets/sidebar/codex.svg",label:"Codex CLI"},{path:"/droid",icon:CS,label:n("nav.factoryDroid")}]},{title:n("nav.system"),items:[{path:"/health",icon:Rr,label:n("nav.health")},{path:"/settings",icon:SS,label:n("nav.settings")}]}]}function QA(){const{t:n}=Mt(),a=wl(),o=qd(),{state:s}=Ol(),{data:c}=FA(),d=$A(n),f=c?.backendLabel??"CLIProxy",p=b=>b.path==="/cliproxy"?f:b.label,m=b=>a.pathname===b,y=b=>b.some(A=>m(A.path)||a.pathname.startsWith(A.path+"/")),C=b=>b.path==="/accounts"?"/shared":b.path,x=b=>{if(b.iconSrc)return l.jsx("img",{src:b.iconSrc,alt:"",className:"w-4 h-4 object-contain"});if(b.icon){const A=b.icon;return l.jsx(A,{className:"w-4 h-4"})}return null};return l.jsxs(wA,{collapsible:"icon",children:[l.jsx(AA,{className:"h-12 flex items-center justify-center",children:l.jsx(Xx,{size:"sm",showText:s==="expanded"})}),l.jsx(DA,{children:d.map((b,A)=>l.jsxs(jA,{children:[b.title&&l.jsx(TA,{children:b.title}),l.jsx(MA,{children:l.jsx(EA,{children:b.items.map(N=>l.jsx(OA,{children:N.isCollapsible&&N.children?l.jsxs(GA,{defaultOpen:y(N.children)||m(N.path),className:"group/collapsible",children:[l.jsx(VA,{asChild:!0,children:l.jsxs(cy,{tooltip:p(N),isActive:y(N.children),onClick:()=>o(C(N)),children:[x(N),l.jsx("span",{className:"group-data-[collapsible=icon]:hidden",children:p(N)}),l.jsx(Nl,{className:"ml-auto transition-transform duration-200 group-data-[state=open]/collapsible:rotate-90 group-data-[collapsible=icon]:hidden"})]})}),l.jsx(YA,{children:l.jsx(LA,{children:N.children.map(E=>l.jsx(RA,{children:l.jsx(_A,{asChild:!0,isActive:m(E.path),children:l.jsx(pl,{to:E.path,children:l.jsx("span",{children:E.label})})})},E.path))})})]}):l.jsx(cy,{asChild:!0,isActive:m(N.path),tooltip:p(N),children:l.jsxs(pl,{to:N.path,children:[x(N),l.jsx("span",{className:"group-data-[collapsible=icon]:hidden flex-1",children:p(N)}),N.badge&&l.jsxs(Sa,{children:[l.jsx(wa,{asChild:!0,children:l.jsxs("span",{className:K("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",m(N.path)?"bg-white/92 border border-white/65 shadow-sm":"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:[(N.badge.icons&&N.badge.icons.length>0?N.badge.icons:N.badge.icon?[N.badge.icon]:[]).map(E=>l.jsx("span",{className:K("inline-flex h-4 w-4 items-center justify-center rounded-[3px] border",m(N.path)?"bg-white border-black/10":"bg-background/80 border-border/40 group-hover/menu-item:bg-white/90"),children:l.jsx("img",{src:E,alt:"",className:"h-3 w-3 object-contain"})},E)),N.badge.text&&l.jsx("span",{className:"hidden sm:inline",children:N.badge.text})]})}),l.jsx(Na,{side:"right",children:l.jsx("p",{children:n("nav.openrouterTooltip")})})]})]})})},N.path))})})]},b.title||A))}),l.jsx(kA,{className:"p-4 border-t flex items-center justify-center",children:l.jsx(NA,{})})]})}const Jx=()=>{const n=S.useContext(Fx);if(n===void 0)throw new Error("useTheme must be used within a ThemeProvider");return n};function WA(){const{theme:n,setTheme:a}=Jx();return l.jsxs(dt,{variant:"ghost",size:"icon",onClick:()=>a(n==="dark"?"light":"dark"),children:[l.jsx(wS,{className:"h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"}),l.jsx(NS,{className:"absolute h-[1.2rem] w-[1.2rem] rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100"}),l.jsx("span",{className:"sr-only",children:"Toggle theme"})]})}function XA(){const{privacyMode:n,togglePrivacyMode:a}=Qd();return l.jsxs(Sa,{children:[l.jsx(wa,{asChild:!0,children:l.jsx(dt,{variant:"ghost",size:"icon",onClick:a,className:K("h-8 w-8 transition-colors",n&&"text-amber-600 hover:text-amber-700 dark:text-amber-400"),children:n?l.jsx(Al,{className:"h-4 w-4"}):l.jsx(kl,{className:"h-4 w-4"})})}),l.jsx(Na,{children:l.jsx("p",{children:n?"Privacy mode ON - Click to show data":"Privacy mode OFF - Click to hide data"})})]})}const ZA="https://github.com/kaitranntt/ccs/issues";function JA(){return l.jsx(dt,{variant:"ghost",size:"icon",asChild:!0,title:"Report an issue on GitHub",children:l.jsx("a",{href:ZA,target:"_blank",rel:"noopener noreferrer",children:l.jsx(Ax,{className:"w-4 h-4"})})})}const e1="https://docs.ccs.kaitran.ca";function t1(){return l.jsx(dt,{variant:"ghost",size:"icon",asChild:!0,title:"View documentation",children:l.jsx("a",{href:e1,target:"_blank",rel:"noopener noreferrer",children:l.jsx(AS,{className:"w-4 h-4"})})})}function n1(){const[n,a]=S.useState("disconnected"),[o,s]=S.useState(!1),c=S.useRef(null),d=rt(),f=S.useRef(0),p=5,m=S.useRef(null),y=S.useRef(()=>{}),C=S.useCallback(A=>{switch(A.type){case"connected":console.log("[WS] Server acknowledged connection");break;case"config-changed":d.invalidateQueries({queryKey:["profiles"]}),d.invalidateQueries({queryKey:["cliproxy"]}),le.info("Configuration updated externally");break;case"settings-changed":d.invalidateQueries({queryKey:["profiles"]}),le.info("Settings file updated");break;case"profiles-changed":d.invalidateQueries({queryKey:["accounts"]}),le.info("Accounts updated");break;case"proxy-status-changed":d.invalidateQueries({queryKey:["proxy-status"]});break;case"pong":break;default:console.log(`[WS] Unknown message: ${A.type}`)}},[d]),x=S.useCallback(()=>{if(c.current?.readyState===WebSocket.OPEN)return;a("connecting");const A=window.location.protocol==="https:"?"wss:":"ws:",N=new WebSocket(`${A}//${window.location.host}/ws`);c.current=N,N.onopen=()=>{a("connected"),s(!1),f.current=0,console.log("[WS] Connected")},N.onmessage=E=>{try{const O=JSON.parse(E.data);C(O),window.dispatchEvent(new CustomEvent("ws-message",{detail:O}))}catch{console.log("[WS] Invalid message")}},N.onclose=()=>{if(a("disconnected"),c.current=null,f.current<p){s(!0);const E=Math.min(1e3*Math.pow(2,f.current),3e4);f.current++,console.log(`[WS] Reconnecting in ${E}ms (attempt ${f.current})`),m.current=setTimeout(()=>{y.current()},E)}else s(!1)},N.onerror=()=>{console.log("[WS] Connection error")}},[C]);y.current=x;const b=S.useCallback(()=>{f.current=p,s(!1),m.current&&(clearTimeout(m.current),m.current=null),c.current?.close()},[]);return S.useEffect(()=>(y.current(),()=>b()),[]),S.useEffect(()=>{const A=setInterval(()=>{c.current?.readyState===WebSocket.OPEN&&c.current.send(JSON.stringify({type:"ping"}))},3e4);return()=>clearInterval(A)},[]),S.useMemo(()=>({status:n,isReconnecting:o,connect:x,disconnect:b}),[n,o,x,b])}function a1(){const{status:n,isReconnecting:a}=n1(),s={connected:{icon:DS,color:"text-green-600",label:"Connected",animate:!1},connecting:{icon:_r,color:"text-yellow-500",label:"Connecting...",animate:!0},disconnected:{icon:a?_r:kS,color:a?"text-amber-500":"text-red-500",label:a?"Reconnecting...":"Disconnected",animate:a}}[n],c=s.icon;return l.jsxs("div",{className:`flex items-center gap-1 text-sm ${s.color}`,children:[l.jsx(c,{className:`w-4 h-4 ${s.animate?"animate-spin":""}`}),l.jsx("span",{className:"hidden sm:inline",children:s.label})]})}function i1(){const[n,a]=S.useState(!1);return n?null:l.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:l.jsxs("div",{className:"flex items-center justify-center gap-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm text-yellow-800 dark:text-yellow-200",children:[l.jsx(jS,{className:"w-4 h-4 flex-shrink-0"}),l.jsx("span",{className:"hidden sm:inline",children:"This dashboard runs locally. All data stays on your machine."}),l.jsx("span",{className:"sm:hidden",children:"Local dashboard - data stays on your device."})]}),l.jsx("button",{onClick:()=>a(!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:l.jsx(No,{className:"w-4 h-4"})})]})})}const o1="https://claudekit.cc?ref=HMNKXOHN";function r1(){return l.jsxs("a",{href:o1,target:"_blank",rel:"noopener noreferrer",className:K("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:[l.jsx("img",{src:"/logos/claudekit-logo.png",alt:"ClaudeKit",className:"w-5 h-5"}),l.jsxs("span",{className:"flex items-baseline gap-1.5 whitespace-nowrap",children:[l.jsx("span",{className:K("text-[10px] font-medium uppercase tracking-wide","text-muted-foreground group-hover:text-accent-foreground/80","transition-colors"),children:"Powered by"}),l.jsx("span",{className:K("text-xs font-bold text-foreground","group-hover:text-accent-foreground","transition-colors"),children:"ClaudeKit"})]})]})}const s1="https://github.com/sponsors/kaitranntt";function l1(){return l.jsxs("a",{href:s1,target:"_blank",rel:"noopener noreferrer",className:K("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:[l.jsx(TS,{className:K("w-4 h-4 text-pink-500","group-hover:text-white group-hover:fill-white","group-hover:animate-pulse","transition-colors")}),l.jsx("span",{className:K("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 of({...n}){return l.jsx(ax,{"data-slot":"dialog",...n})}function c1({...n}){return l.jsx(lx,{"data-slot":"dialog-portal",...n})}function u1({className:n,...a}){return l.jsx(cx,{"data-slot":"dialog-overlay",className:K("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",n),...a})}function rf({className:n,children:a,showCloseButton:o=!0,...s}){return l.jsxs(c1,{"data-slot":"dialog-portal",children:[l.jsx(u1,{}),l.jsxs(ix,{"data-slot":"dialog-content",className:K("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",n),...s,children:[a,o&&l.jsxs(ox,{"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:[l.jsx(No,{}),l.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function sf({className:n,...a}){return l.jsx("div",{"data-slot":"dialog-header",className:K("flex flex-col gap-2 text-center sm:text-left",n),...a})}function d1({className:n,...a}){return l.jsx("div",{"data-slot":"dialog-footer",className:K("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",n),...a})}function lf({className:n,...a}){return l.jsx(rx,{"data-slot":"dialog-title",className:K("text-lg leading-none font-semibold",n),...a})}function cf({className:n,...a}){return l.jsx(sx,{"data-slot":"dialog-description",className:K("text-muted-foreground text-sm",n),...a})}function f1({open:n,onClose:a,sessionId:o,provider:s,projects:c,defaultProjectId:d,supportsAll:f,onSelect:p,timeoutSeconds:m=30}){const[y,C]=S.useState(d),[x,b]=S.useState(!1),[A,N]=S.useState(m);S.useEffect(()=>{if(!n){N(m);return}const R=setInterval(()=>{N(k=>k<=1?(clearInterval(R),E(!0),0):k-1)},1e3);return()=>clearInterval(R)},[n,m]),S.useEffect(()=>{n&&(C(d),b(!1),N(m))},[n,d,m]);const E=async(R=!1)=>{if(!x){b(!0);try{await p(R?"":y),a()}catch(k){console.error("Failed to submit project selection:",k);try{await p("")}catch{}a()}}},O=s.charAt(0).toUpperCase()+s.slice(1);return l.jsx(of,{open:n,onOpenChange:R=>!R&&!x&&a(),children:l.jsxs(rf,{className:"sm:max-w-lg",children:[l.jsxs(sf,{children:[l.jsxs(lf,{className:"flex items-center gap-2",children:[l.jsx(kx,{className:"w-5 h-5"}),"Select Google Cloud Project"]}),l.jsxs(cf,{children:["Choose which project to use for ",O," authentication.",A>0&&l.jsxs("span",{className:"text-muted-foreground ml-1",children:["(Auto-selecting default in ",A,"s)"]})]})]}),l.jsxs("div",{className:"space-y-4 py-4",children:[l.jsxs("div",{className:"space-y-2",children:[c.map(R=>l.jsxs("div",{className:`flex items-center space-x-3 p-3 rounded-lg border cursor-pointer transition-colors ${y===R.id?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>!x&&C(R.id),children:[y===R.id?l.jsx(Mg,{className:"w-5 h-5 text-primary"}):l.jsx(Eg,{className:"w-5 h-5 text-muted-foreground"}),l.jsxs("div",{className:"flex-1",children:[l.jsx("div",{className:"font-medium",children:R.name}),l.jsx("div",{className:"text-sm text-muted-foreground font-mono",children:R.id})]}),R.id===d&&l.jsx("span",{className:"text-xs px-2 py-1 bg-secondary rounded",children:"Default"})]},R.id)),f&&l.jsxs("div",{className:`flex items-center space-x-3 p-3 rounded-lg border cursor-pointer transition-colors ${y==="ALL"?"border-primary bg-primary/5":"border-border hover:border-primary/50"}`,onClick:()=>!x&&C("ALL"),children:[y==="ALL"?l.jsx(Mg,{className:"w-5 h-5 text-primary"}):l.jsx(Eg,{className:"w-5 h-5 text-muted-foreground"}),l.jsxs("div",{className:"flex-1",children:[l.jsx("div",{className:"font-medium",children:"All Projects"}),l.jsxs("div",{className:"text-sm text-muted-foreground",children:["Onboard all ",c.length," listed projects"]})]})]})]}),l.jsxs("div",{className:"flex items-center justify-end gap-2 pt-2",children:[l.jsx(dt,{variant:"ghost",onClick:()=>E(!0),disabled:x,children:"Use Default"}),l.jsx(dt,{onClick:()=>E(!1),disabled:x,children:x?l.jsxs(l.Fragment,{children:[l.jsx(On,{className:"w-4 h-4 mr-2 animate-spin"}),"Selecting..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Co,{className:"w-4 h-4 mr-2"}),"Confirm Selection"]})})]})]})]})})}const wo={gemini:{displayName:"Google Gemini",description:"Gemini Pro/Flash models",oauthFlow:"authorization_code",callbackPort:8085,callbackProviderName:"gemini",authUrlProviderName:"gemini-cli",refreshOwnership:"ccs",authFilePrefixes:["gemini-","google-"],tokenTypeValues:["gemini"],aliases:["gemini-cli"]},codex:{displayName:"OpenAI Codex",description:"GPT-4 and codex models",oauthFlow:"authorization_code",callbackPort:1455,callbackProviderName:"codex",authUrlProviderName:"codex",refreshOwnership:"cliproxy",authFilePrefixes:["codex-","openai-"],tokenTypeValues:["codex"],aliases:[]},agy:{displayName:"Antigravity",description:"Antigravity AI models",oauthFlow:"authorization_code",callbackPort:51121,callbackProviderName:"antigravity",authUrlProviderName:"antigravity",refreshOwnership:"cliproxy",authFilePrefixes:["antigravity-","agy-"],tokenTypeValues:["antigravity"],aliases:["antigravity"]},qwen:{displayName:"Alibaba Qwen",description:"Qwen Code models",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"qwen",authUrlProviderName:"qwen",refreshOwnership:"cliproxy",authFilePrefixes:["qwen-"],tokenTypeValues:["qwen"],aliases:[]},iflow:{displayName:"iFlow",description:"iFlow AI models",oauthFlow:"authorization_code",callbackPort:11451,callbackProviderName:"iflow",authUrlProviderName:"iflow",refreshOwnership:"cliproxy",authFilePrefixes:["iflow-"],tokenTypeValues:["iflow"],aliases:[]},kiro:{displayName:"Kiro (AWS)",description:"AWS CodeWhisperer models",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"kiro",authUrlProviderName:"kiro",refreshOwnership:"cliproxy",authFilePrefixes:["kiro-","aws-","codewhisperer-"],tokenTypeValues:["kiro","codewhisperer"],aliases:["codewhisperer"]},ghcp:{displayName:"GitHub Copilot (OAuth)",description:"GitHub Copilot via OAuth",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"copilot",authUrlProviderName:"github",refreshOwnership:"cliproxy",authFilePrefixes:["github-copilot-","copilot-","gh-"],tokenTypeValues:["github-copilot","copilot"],aliases:["github-copilot","copilot"]},claude:{displayName:"Claude (Anthropic)",description:"Claude Opus/Sonnet models",oauthFlow:"authorization_code",callbackPort:54545,callbackProviderName:"anthropic",authUrlProviderName:"anthropic",refreshOwnership:"unsupported",authFilePrefixes:["claude-","anthropic-"],tokenTypeValues:["claude","anthropic"],aliases:["anthropic"]},kimi:{displayName:"Kimi (Moonshot)",description:"Moonshot AI K2/K2.5 models",oauthFlow:"device_code",callbackPort:null,callbackProviderName:"kimi",authUrlProviderName:"kimi",refreshOwnership:"cliproxy",authFilePrefixes:["kimi-"],tokenTypeValues:["kimi"],aliases:["moonshot"]}},uf=Object.freeze(Object.keys(wo)),Ed=Object.freeze(["agy","codex","claude","gemini","ghcp"]);new Set(Ed);const h1=Object.freeze([...Ed,...Ed.flatMap(n=>wo[n].aliases),"all"].filter((n,a,o)=>o.indexOf(n)===a));h1.join(", ");new Set(uf);function p1(n=wo){const a=new Map,o=Object.keys(n),s=(c,d)=>{const f=c.trim().toLowerCase();if(!f)return;const p=a.get(f);if(p&&p!==d)throw new Error(`Provider alias collision for "${f}": ${p} and ${d}`);a.set(f,d)};for(const c of o){s(c,c);for(const d of n[c].aliases)s(d,c)}return a}p1();function m1(n){return uf.filter(a=>wo[a].oauthFlow===n)}const df=uf;function Fr(n){return df.includes(n)}function Aa(n){return typeof n=="string"?n.trim().toLowerCase():""}const g1=["openai","vertex"];function _l(n){return Fr(n)||g1.includes(n)}const eb=Object.freeze(Object.fromEntries(df.map(n=>[n,{displayName:wo[n].displayName,description:wo[n].description}]))),y1={gemini:"/assets/providers/gemini-color.svg",agy:"/assets/providers/agy.png",codex:"/assets/providers/codex-color.svg",qwen:"/assets/providers/qwen-color.svg",iflow:"/assets/providers/iflow.png",kiro:"/assets/providers/kiro.png",ghcp:"/assets/providers/copilot.svg",claude:"/assets/providers/claude.svg",kimi:"/assets/providers/kimi.svg",openai:"/assets/providers/openai.svg",vertex:"/assets/providers/vertex.svg"},uy={textClass:"text-gray-600",letter:"?"},x1={gemini:{textClass:"text-blue-600",letter:"G"},claude:{textClass:"text-orange-600",letter:"C"},codex:{textClass:"text-emerald-600",letter:"X"},agy:{textClass:"text-violet-600",letter:"A"},qwen:{textClass:"text-cyan-600",letter:"Q"},iflow:{textClass:"text-indigo-600",letter:"i"},kiro:{textClass:"text-teal-600",letter:"K"},ghcp:{textClass:"text-green-600",letter:"C"},kimi:{textClass:"text-orange-500",letter:"K"},openai:{textClass:"text-slate-900",letter:"O"},vertex:{textClass:"text-blue-600",letter:"V"}},b1=new Set(["kimi"]),v1=new Set(["codex"]);function vO(n){switch(n){case"gemini-api-key":return"gemini";case"codex-api-key":return"codex";case"claude-api-key":return"claude";case"vertex-api-key":return"vertex";case"openai-compatibility":return"openai"}}function tb(n){const a=Aa(n);if(_l(a))return y1[a]}function C1(n){const a=Aa(n);return _l(a)?x1[a]:{...uy,letter:a[0]?.toUpperCase()||uy.letter}}function S1(n){const a=Aa(n);return _l(a)&&b1.has(a)}function w1(n){const a=Aa(n);return _l(a)&&v1.has(a)}const ff={gemini:"#4285F4",agy:"#f3722c",codex:"#10a37f",openai:"#111827",vertex:"#4285F4",iflow:"#f94144",qwen:"#6236FF",kiro:"#4d908e",ghcp:"#43aa8b",claude:"#D97757",kimi:"#FF6B35"},N1={...Object.fromEntries(df.map(n=>[n,eb[n].displayName])),openai:"OpenAI",vertex:"Vertex AI"};function hf(n){const a=Aa(n);return a?N1[a]||String(n):"Unknown provider"}function A1(n){const a=Aa(n);return Fr(a)?eb[a].description:""}const k1=[...m1("device_code")],D1=Object.freeze({ghcp:"GitHub Copilot",kiro:"Kiro (AWS)",qwen:"Qwen Code"}),j1=Object.freeze({ghcp:"Sign in with your GitHub account that has Copilot access.",qwen:"Sign in with your Qwen account to authorize access.",kiro:"Sign in with your selected Kiro auth provider to continue.",kimi:"Sign in with your Kimi account and finish the device authorization."});function CO(n){const a=Aa(n);return Fr(a)&&k1.includes(a)}function dl(n){const a=Aa(n);return a?Fr(a)?D1[a]||hf(a):String(n):"Unknown provider"}function T1(n){const a=Aa(n);return Fr(a)&&j1[a]||"Complete the authorization in your browser."}const SO="aws",dy=[{id:"aws",label:"AWS Builder ID (Recommended)",description:"Device code flow for AWS organizations and Builder ID accounts.",flowType:"device_code",startEndpoint:"start"},{id:"aws-authcode",label:"AWS Builder ID (Auth Code)",description:"Authorization code flow via CLI binary.",flowType:"authorization_code",startEndpoint:"start"},{id:"google",label:"Google OAuth",description:"Social OAuth flow with callback URL support.",flowType:"authorization_code",startEndpoint:"start-url"},{id:"github",label:"GitHub OAuth",description:"Social OAuth flow via management API callback.",flowType:"authorization_code",startEndpoint:"start-url"}];function wO(n){return dy.find(o=>o.id===n)||dy[0]}function M1({open:n,onClose:a,sessionId:o,provider:s,userCode:c,verificationUrl:d,expiresAt:f}){const[p,m]=S.useState(!1),[y,C]=S.useState(null);S.useEffect(()=>{if(!n)return;let k=null;const D=()=>{const j=Math.max(0,Math.floor((f-Date.now())/1e3));C(j),j===0&&k&&(clearInterval(k),k=null)};return D(),k=setInterval(D,1e3),()=>{k&&clearInterval(k)}},[n,f]);const x=S.useCallback(async()=>{try{await navigator.clipboard.writeText(c),m(!0),le.success(Be.t("commonToast.codeCopied")),setTimeout(()=>m(!1),2e3)}catch{le.error(Be.t("commonToast.copyCodeFailed"))}},[c]),b=S.useCallback(()=>{window.open(d,"_blank","noopener,noreferrer")},[d]),A=dl(s),N=T1(s),E=A==="Unknown provider"?"Open verification page":`Open ${A.split(" ")[0]}`,O=k=>{const D=Math.floor(k/60),j=k%60;return`${D}:${j.toString().padStart(2,"0")}`},R=y===0;return l.jsx(of,{open:n,onOpenChange:k=>!k&&a(),children:l.jsxs(rf,{className:"sm:max-w-md","data-session-id":o,children:[l.jsxs(sf,{children:[l.jsxs(lf,{className:"flex items-center gap-2",children:[l.jsx(Fd,{className:"w-5 h-5"}),"Authorize ",A]}),l.jsxs(cf,{children:["Enter the code below at the authorization page.",y!==null&&y>0&&l.jsxs("span",{className:"text-muted-foreground ml-1",children:["(Expires in ",O(y),")"]}),R&&l.jsx("span",{className:"text-destructive ml-1 font-medium",children:"(Code expired)"})]})]}),l.jsxs("div",{className:"space-y-6 py-4",children:[l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"bg-muted rounded-lg p-6 text-center",children:l.jsx("div",{className:"text-4xl font-mono font-bold tracking-[0.3em] text-foreground select-all",children:c})}),l.jsx(dt,{variant:"outline",size:"icon",className:"absolute top-2 right-2",onClick:x,"aria-label":p?"Code copied":"Copy verification code",children:p?l.jsx(Co,{className:"h-4 w-4 text-green-500"}):l.jsx(ml,{className:"h-4 w-4"})})]}),l.jsx("div",{className:"text-sm text-muted-foreground text-center",children:l.jsx("p",{children:N})}),l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsxs(dt,{onClick:b,className:"w-full",children:[l.jsx(jx,{className:"w-4 h-4 mr-2"}),E]}),l.jsx(dt,{variant:"outline",onClick:x,className:"w-full",children:p?l.jsxs(l.Fragment,{children:[l.jsx(Co,{className:"w-4 h-4 mr-2 text-green-500"}),"Copied!"]}):l.jsxs(l.Fragment,{children:[l.jsx(ml,{className:"w-4 h-4 mr-2"}),"Copy Code"]})})]}),l.jsxs("div",{className:"flex items-center justify-center gap-2 text-sm text-muted-foreground",children:[l.jsx(On,{className:"h-4 w-4 animate-spin"}),l.jsx("span",{children:"Waiting for authorization..."})]})]})]})})}function E1({...n}){return l.jsx(zC,{"data-slot":"dropdown-menu",...n})}function O1({...n}){return l.jsx(IC,{"data-slot":"dropdown-menu-trigger",...n})}function P1({className:n,sideOffset:a=4,...o}){return l.jsx(UC,{children:l.jsx(HC,{"data-slot":"dropdown-menu-content",sideOffset:a,className:K("bg-popover text-popover-foreground 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 z-50 max-h-(--radix-dropdown-menu-content-available-height) min-w-[8rem] origin-(--radix-dropdown-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md bg-white dark:bg-zinc-950",n),...o})})}function L1({className:n,inset:a,variant:o="default",...s}){return l.jsx(BC,{"data-slot":"dropdown-menu-item","data-inset":a,"data-variant":o,className:K("focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground focus:[&_svg:not([class*='text-'])]:text-current relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",n),...s})}function R1(){const{authRequired:n,isAuthenticated:a,username:o,logout:s}=Xd();if(!n||!a)return null;const c=async()=>{await s()};return l.jsxs(E1,{children:[l.jsx(O1,{asChild:!0,children:l.jsxs(dt,{variant:"ghost",size:"sm",className:"gap-2",children:[l.jsx(Tx,{className:"h-4 w-4"}),l.jsx("span",{className:"hidden sm:inline",children:o})]})}),l.jsx(P1,{align:"end",children:l.jsxs(L1,{onClick:c,className:"gap-2 text-destructive",children:[l.jsx(MS,{className:"h-4 w-4"}),"Sign Out"]})})]})}const nb=YC,ab=$C,pf=S.forwardRef(({className:n,children:a,...o},s)=>l.jsxs(ux,{ref:s,className:K("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",n),...o,children:[a,l.jsx(KC,{asChild:!0,children:l.jsx(Br,{className:"h-4 w-4 opacity-50"})})]}));pf.displayName=ux.displayName;const ib=S.forwardRef(({className:n,...a},o)=>l.jsx(dx,{ref:o,className:K("flex cursor-default items-center justify-center py-1",n),...a,children:l.jsx(Gd,{className:"h-4 w-4"})}));ib.displayName=dx.displayName;const ob=S.forwardRef(({className:n,...a},o)=>l.jsx(fx,{ref:o,className:K("flex cursor-default items-center justify-center py-1",n),...a,children:l.jsx(Br,{className:"h-4 w-4"})}));ob.displayName=fx.displayName;const mf=S.forwardRef(({className:n,children:a,position:o="popper",...s},c)=>l.jsx(qC,{children:l.jsxs(hx,{ref:c,className:K("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",o==="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",n),position:o,...s,children:[l.jsx(ib,{}),l.jsx(FC,{className:K("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:a}),l.jsx(ob,{})]})}));mf.displayName=hx.displayName;const _1=S.forwardRef(({className:n,...a},o)=>l.jsx(px,{ref:o,className:K("px-2 py-1.5 text-sm font-semibold",n),...a}));_1.displayName=px.displayName;const Lr=S.forwardRef(({className:n,children:a,...o},s)=>l.jsxs(mx,{ref:s,className:K("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",n),...o,children:[l.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:l.jsx(GC,{children:l.jsx(Co,{className:"h-4 w-4"})})}),l.jsx(VC,{children:a})]}));Lr.displayName=mx.displayName;const z1=S.forwardRef(({className:n,...a},o)=>l.jsx(gx,{ref:o,className:K("-mx-1 my-1 h-px bg-muted",n),...a}));z1.displayName=gx.displayName;function I1(){const{t:n,i18n:a}=Mt(),o=qr(a.resolvedLanguage??a.language??"en"),s=c=>{const d=PN(c);a.changeLanguage(d)};return l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Mx,{className:"h-4 w-4 text-muted-foreground"}),l.jsxs(nb,{value:o,onValueChange:s,children:[l.jsx(pf,{className:"h-8 w-[150px]",children:l.jsx(ab,{placeholder:n("layout.languageSwitcher")})}),l.jsx(mf,{children:EN.map(c=>l.jsx(Lr,{value:c,children:n(`locale.${c}`)},c))})]})]})}function U1(){const[n,a]=S.useState({isOpen:!1,prompt:null});S.useEffect(()=>{const c=d=>{const f=d.detail;f.type==="projectSelectionRequired"?(console.log("[ProjectSelection] Received prompt:",f.sessionId),a({isOpen:!0,prompt:{sessionId:f.sessionId,provider:f.provider,projects:f.projects,defaultProjectId:f.defaultProjectId,supportsAll:f.supportsAll}})):f.type==="projectSelectionTimeout"?(console.log("[ProjectSelection] Timeout:",f.sessionId),a(p=>p.prompt?.sessionId===f.sessionId?{isOpen:!1,prompt:null}:p)):f.type==="projectSelectionSubmitted"&&(console.log("[ProjectSelection] Submitted:",f.sessionId),a(p=>p.prompt?.sessionId===f.sessionId?{isOpen:!1,prompt:null}:p))};return window.addEventListener("ws-message",c),()=>{window.removeEventListener("ws-message",c)}},[]);const o=S.useCallback(async c=>{if(!n.prompt)return;if(!(await fetch(`/api/cliproxy/auth/project-selection/${n.prompt.sessionId}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({selectedId:c})})).ok)throw new Error("Failed to submit project selection")},[n.prompt]),s=S.useCallback(()=>{a({isOpen:!1,prompt:null})},[]);return S.useMemo(()=>({isOpen:n.isOpen,prompt:n.prompt,onSelect:o,onClose:s}),[n.isOpen,n.prompt,o,s])}function H1(n){return typeof n!="string"?"unknown":n.trim().toLowerCase()||"unknown"}function B1(){const[n,a]=S.useState({isOpen:!1,prompt:null,error:null});S.useEffect(()=>{const d=f=>{const p=f.detail;if(p.type==="deviceCodeReceived"){console.log("[DeviceCode] Received prompt:",p.sessionId);const m=H1(p.provider),y=dl(m);le.info(`${y} authorization required`),a({isOpen:!0,prompt:{sessionId:p.sessionId,provider:m,userCode:p.userCode,verificationUrl:p.verificationUrl,expiresAt:p.expiresAt},error:null})}else p.type==="deviceCodeCompleted"?(console.log("[DeviceCode] Auth completed:",p.sessionId),a(m=>{if(m.prompt&&m.prompt.sessionId===p.sessionId){const y=dl(m.prompt.provider);return le.success(`${y} authentication successful!`),{isOpen:!1,prompt:null,error:null}}return m})):p.type==="deviceCodeFailed"?(console.log("[DeviceCode] Auth failed:",p.sessionId,p.error),a(m=>{if(m.prompt&&m.prompt.sessionId===p.sessionId){const y=dl(m.prompt.provider);return le.error(`${y} authentication failed`),{isOpen:!1,prompt:null,error:p.error}}return m})):p.type==="deviceCodeExpired"&&(console.log("[DeviceCode] Code expired:",p.sessionId),a(m=>m.prompt?.sessionId===p.sessionId?(le.error("Device code expired. Please try again."),{isOpen:!1,prompt:null,error:"Device code expired"}):m))};return window.addEventListener("ws-message",d),()=>{window.removeEventListener("ws-message",d)}},[]);const o=S.useCallback(()=>{a({isOpen:!1,prompt:null,error:null})},[]),s=S.useCallback(()=>{n.prompt?.verificationUrl&&window.open(n.prompt.verificationUrl,"_blank","noopener,noreferrer")},[n.prompt]),c=S.useCallback(async()=>{if(n.prompt?.userCode)try{await navigator.clipboard.writeText(n.prompt.userCode),le.success("Code copied to clipboard")}catch{le.error("Failed to copy code")}},[n.prompt]);return S.useMemo(()=>({isOpen:n.isOpen,prompt:n.prompt,error:n.error,onClose:o,onOpenUrl:s,onCopyCode:c}),[n.isOpen,n.prompt,n.error,o,s,c])}const K1="ccs-dashboard:last-route";function q1(n,a="",o=""){try{localStorage.setItem(K1,`${n}${a}${o}`)}catch{}}function F1(){return l.jsxs("div",{className:"p-6 space-y-4",children:[l.jsx(Ye,{className:"h-8 w-48"}),l.jsx(Ye,{className:"h-64 w-full"})]})}function G1(){const n=wl(),{isOpen:a,prompt:o,onSelect:s,onClose:c}=U1(),d=B1();return S.useEffect(()=>{q1(n.pathname,n.search,n.hash)},[n.pathname,n.search,n.hash]),l.jsxs(SA,{children:[l.jsx(QA,{}),l.jsxs("main",{className:"flex-1 flex flex-col min-h-0 overflow-hidden bg-background",children:[l.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:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(r1,{}),l.jsx(l1,{})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(a1,{}),l.jsx(I1,{}),l.jsx(t1,{}),l.jsx(JA,{}),l.jsx(XA,{}),l.jsx(WA,{}),l.jsx(R1,{})]})]}),l.jsx("div",{className:"flex-1 overflow-auto min-h-0",children:l.jsx(S.Suspense,{fallback:l.jsx(F1,{}),children:l.jsx(Nd,{})})}),l.jsx(i1,{})]}),o&&l.jsx(f1,{open:a,onClose:c,sessionId:o.sessionId,provider:o.provider,projects:o.projects,defaultProjectId:o.defaultProjectId,supportsAll:o.supportsAll,onSelect:s}),d.prompt&&l.jsx(M1,{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 V1=Ml("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 zt({className:n,variant:a,...o}){return l.jsx("div",{className:K(V1({variant:a}),n),...o})}function Y1({version:n}){return l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx(Xx,{size:"lg",showText:!1}),l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("h1",{className:"text-2xl font-bold",children:"CCS Config"}),n&&l.jsxs(zt,{variant:"outline",className:"font-mono text-xs",children:["v",n]})]}),l.jsx("p",{className:"text-muted-foreground text-sm mt-1",children:"Claude Code Switch Dashboard"})]})]})}const $1=100,fy=["#3b3c36","#568203","#8d4557","#da9100","#3c6c82","#c96907"];function Q1(n){return fy[n%fy.length]}function Od(n){return n.replace(/@(gmail|yahoo|hotmail|outlook|icloud)\.com$/i,"")}function W1(n){const o=new Date().getTime()-n.getTime(),s=Math.floor(o/6e4);if(s<1)return"now";if(s<60)return`${s}m`;const c=Math.floor(s/60);return c<24?`${c}h`:`${Math.floor(c/24)}d`}function X1(n){const a=[],o=Date.now(),s=n.reduce((c,d)=>{const f=d.lastUsedAt?new Date(d.lastUsedAt).getTime():o;return Math.max(c,isNaN(f)?o:f)},o);return n.forEach(c=>{const d=new Date(s),f=(p,m)=>{for(let y=0;y<p;y++){const C=Math.floor(Math.random()*24*60*60*1e3*(y/(p||1))),x=new Date(d.getTime()-C),b=Math.floor((Math.random()-.5)*10*60*1e3);x.setTime(x.getTime()+b);const A=new Date;x>A&&x.setTime(A.getTime()),a.push({id:`${c.id}-${m}-${y}`,timestamp:x,accountEmail:c.email,status:m,latencyMs:m==="success"?50+Math.floor(Math.random()*150):200+Math.floor(Math.random()*4800)})}};f(c.successCount,"success"),f(c.failureCount,"failed")}),a.sort((c,d)=>d.timestamp.getTime()-c.timestamp.getTime())}function Z1({containerRef:n,svgRef:a,accounts:o}){if(!n.current||!a.current)return[];const s=n.current,d=a.current.getBoundingClientRect(),f=s.querySelector("[data-provider-node]");if(!f)return[];const p=f.getBoundingClientRect(),m=[];return o.forEach((y,C)=>{const x=s.querySelector(`[data-account-index="${C}"]`);if(!x)return;const b=x.getBoundingClientRect(),A=x.getAttribute("data-zone")||"left";let N,E,O,R;switch(A){case"right":N=b.left-d.left,E=b.top+b.height/2-d.top,O=p.right-d.left,R=p.top+p.height/2-d.top;break;case"top":N=b.left+b.width/2-d.left,E=b.bottom-d.top,O=p.left+p.width/2-d.left,R=p.top-d.top;break;case"bottom":N=b.left+b.width/2-d.left,E=b.top-d.top,O=p.left+p.width/2-d.left,R=p.bottom-d.top;break;default:N=b.right-d.left,E=b.top+b.height/2-d.top,O=p.left-d.left,R=p.top+p.height/2-d.top}let k,D,j,T;A==="top"||A==="bottom"?(k=N,D=E+(R-E)*.5,j=O,T=R-(R-E)*.5):(k=N+(O-N)*.5,D=E,j=O-(O-N)*.5,T=R),m.push(`M ${N} ${E} C ${k} ${D}, ${j} ${T}, ${O} ${R}`)}),m}function J1(n){const a=n.length;if(a<=2)return{leftAccounts:n,rightAccounts:[],topAccounts:[],bottomAccounts:[]};if(a<=4){const s=Math.ceil(a/2);return{leftAccounts:n.slice(0,s),rightAccounts:n.slice(s),topAccounts:[],bottomAccounts:[]}}if(a<=8){const s=Math.ceil(a/3);return{leftAccounts:n.slice(0,s),rightAccounts:n.slice(s,s*2),topAccounts:n.slice(s*2),bottomAccounts:[]}}const o=Math.ceil(a/4);return{leftAccounts:n.slice(0,o),rightAccounts:n.slice(o,o*2),topAccounts:n.slice(o*2,o*3),bottomAccounts:n.slice(o*3)}}function ek(n){return n>=9?"w-64":n>=5?"w-60":n>=3?"w-56":"w-52"}function tk({storageKey:n,onDrag:a}){const[o,s]=S.useState(null),c=S.useRef(null),d=S.useRef(!1),f=S.useCallback(()=>{try{const N=localStorage.getItem(n);if(N)return JSON.parse(N)}catch{}return{}},[n]),[p,m]=S.useState(()=>f());S.useEffect(()=>{Object.keys(p).length>0&&localStorage.setItem(n,JSON.stringify(p))},[p,n]);const y=S.useCallback(()=>{m({}),localStorage.removeItem(n)},[n]),C=S.useCallback((N,E)=>{E.preventDefault(),E.stopPropagation(),E.target.setPointerCapture(E.pointerId);const O=p[N]||{x:0,y:0};c.current={x:E.clientX,y:E.clientY,offsetX:O.x,offsetY:O.y},d.current=!1,s(N)},[p]),x=S.useCallback(N=>{if(!o||!c.current)return;const E=c.current,O=N.clientX-E.x,R=N.clientY-E.y;(Math.abs(O)>3||Math.abs(R)>3)&&(d.current=!0),m(k=>({...k,[o]:{x:E.offsetX+O,y:E.offsetY+R}})),a&&requestAnimationFrame(a)},[o,a]),b=S.useCallback(()=>{s(null),c.current=null},[]);return{dragOffsets:p,draggingId:o,didDragRef:d,handlePointerDown:C,handlePointerMove:x,handlePointerUp:b,getOffset:N=>p[N]||{x:0,y:0},resetPositions:y,hasCustomPositions:Object.keys(p).length>0}}function nk(n){let a=0,o=0;return Object.values(n).forEach(s=>{a=Math.min(a,s.y),o=Math.max(o,s.y)}),{paddingTop:Math.max(0,-a),paddingBottom:Math.max(0,o),extraHeight:Math.max(0,Math.abs(a),Math.abs(o))*2}}function ak(n){const[a,o]=S.useState(new Set),s=S.useRef({});return S.useEffect(()=>{const c=new Set,d={};if(n.forEach(f=>{const p=f.successCount+f.failureCount;d[f.id]=p;const m=s.current[f.id];m!==void 0&&p>m&&c.add(f.id)}),s.current=d,c.size>0){o(c);const f=setTimeout(()=>o(new Set),2e3);return()=>clearTimeout(f)}},[n]),a}function ik({events:n,privacyMode:a}){const{t:o}=Mt();return n.length===0?l.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:l.jsx("div",{className:"text-xs text-muted-foreground font-mono",children:o("flowViz.noRecentConnections")})}):l.jsxs("div",{className:"h-full flex flex-col",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-3 px-2",children:[l.jsx(Rr,{className:"w-3.5 h-3.5 text-muted-foreground"}),l.jsx("span",{className:"text-[10px] text-muted-foreground font-medium uppercase tracking-wider",children:o("flowViz.connectionTimeline")})]}),l.jsx("div",{className:K("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:l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:"absolute left-[7px] top-2 bottom-2 w-px bg-border/50 dark:bg-white/[0.08]"}),l.jsx("div",{className:"space-y-3",children:n.map(s=>{const c=s.status==="success"?Wt.success:s.status==="failed"?Wt.failed:Wt.degraded;return l.jsxs("div",{className:"relative flex items-start gap-3 pl-1",children:[l.jsx("div",{className:K("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}}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2",children:[l.jsx("span",{className:K("text-[10px] font-mono text-foreground truncate",a&&Vx),children:Od(s.accountEmail)}),l.jsx("span",{className:"text-[9px] text-muted-foreground font-mono flex-shrink-0",children:W1(s.timestamp)})]}),l.jsxs("div",{className:"flex items-center gap-2 mt-0.5",children:[l.jsx("span",{className:"text-[9px] font-medium uppercase",style:{color:c},children:s.status}),s.latencyMs&&l.jsxs("span",{className:"text-[9px] text-muted-foreground font-mono",children:[s.latencyMs,"ms"]})]})]})]},s.id)})})]})})]})}const ok=new Set(["free","plus","pro"]),rk=new Set(["team"]);function hy(n){return n.trim().replace(/^[^a-z0-9]+|[^a-z0-9]+$/gi,"").replace(/[^a-z0-9._-]+/gi,"-").replace(/-+/g,"-").toLowerCase()}function Dr(n){const a=n.trim().toLowerCase();if(!a)return"";switch(a){case"team":return"Team";case"free":return"Free";case"plus":return"Plus";case"pro":return"Pro";default:return/^[a-f0-9]{8}$/i.test(a)?a:a.split(/[._-]+/).filter(Boolean).map(o=>o[0]?.toUpperCase()+o.slice(1)).join(" ")}}function rb(n){const a=n.split("#")[0]?.trim();return a&&a.includes("@")?a:null}function sk(n,a){if(!a)return null;const o=`${a}#`;return n.startsWith(o)?n.slice(o.length):null}function lk(n,a){if(!n||!a)return null;const s=(n.split(/[\\/]/).pop()??n).replace(/\.json$/i,"");if(!s.toLowerCase().startsWith("codex-"))return null;const c=s.indexOf("-"),d=c>0&&!s.slice(0,c).includes("@")?s.slice(c+1):s,f=d.toLowerCase().indexOf(a.toLowerCase());if(f===-1)return null;const p=hy(d.slice(0,f)),m=hy(d.slice(f+a.length)),y=[p,m].filter(Boolean);return y.length>0?y.join("-"):null}function ck(n){const a=n.find(s=>/^[a-f0-9]{8}$/i.test(s));if(a)return{detailLabel:`Workspace ${a.toLowerCase()}`,compactDetailLabel:a.toLowerCase()};const o=n.map(Dr).filter(Boolean).join(" · ");return{detailLabel:o||"Team",compactDetailLabel:o||"Team"}}function uk(n,a,o){const s=a?.trim()||rb(n)||void 0;return lk(o,s)??sk(n,s)}function gf(n,a,o){const s=a?.trim()||rb(n)||n,c=uk(n,s,o);if(!c)return{email:s,audience:"unknown",audienceLabel:null,detailLabel:null,compactDetailLabel:null,inlineLabel:null};const d=c.split("-").filter(Boolean);if(d.length===0)return{email:s,audience:"unknown",audienceLabel:null,detailLabel:null,compactDetailLabel:null,inlineLabel:null};const f=d[d.length-1]?.toLowerCase();if(f&&rk.has(f)){const m=ck(d.slice(0,-1)),y=["Business",m.detailLabel].filter(Boolean).join(" · ");return{email:s,audience:"business",audienceLabel:"Business",detailLabel:m.detailLabel,compactDetailLabel:m.compactDetailLabel,inlineLabel:y}}if(f&&ok.has(f)){const y=[Dr(f),...d.slice(0,-1).map(Dr)].filter(Boolean).join(" · ")||Dr(f),C=["Personal",y].filter(Boolean).join(" · ");return{email:s,audience:"personal",audienceLabel:"Personal",detailLabel:y,compactDetailLabel:y,inlineLabel:C}}const p=d.map(Dr).filter(Boolean).join(" · ");return{email:s,audience:"unknown",audienceLabel:null,detailLabel:p||null,compactDetailLabel:p||null,inlineLabel:p||null}}function dk(n,a,o){const s=gf(n,a,o);return s.inlineLabel?`${s.email} (${s.inlineLabel})`:s.email}function fk(n){if(!n)return null;const a=n.split(/[\s_-]+/g).map(o=>o.trim()).filter(o=>o.length>0).map(o=>o.charAt(0).toUpperCase()+o.slice(1));return a.length>0?a.join(" "):n}function hk(n,a){switch(n){case"five_hour":return"5h usage limit";case"seven_day":return"Weekly usage limit";case"seven_day_opus":return"Weekly usage (Opus)";case"seven_day_sonnet":return"Weekly usage (Sonnet)";case"seven_day_oauth_apps":return"Weekly usage (OAuth apps)";case"seven_day_cowork":return"Weekly usage (Cowork)";case"overage":return"Extra usage";default:return a}}function sb({quota:n,resetTime:a}){if(!n)return l.jsx("p",{className:"text-xs text-muted-foreground",children:"Loading quota..."});if(!n.success){const o=af(n);return l.jsxs("div",{className:"text-xs space-y-1",children:[l.jsx("p",{className:"font-medium text-destructive",children:o?.label||n.error||"Failed to load quota"}),l.jsx("p",{className:"text-destructive/90",children:o?.summary||n.error}),o?.actionHint&&l.jsx("p",{className:"text-muted-foreground",children:o.actionHint}),o?.technicalDetail&&l.jsx("p",{className:"font-mono text-[11px] text-muted-foreground",children:o.technicalDetail}),o?.rawDetail&&l.jsx("pre",{className:"whitespace-pre-wrap break-all rounded bg-muted/40 px-2 py-1 font-mono text-[10px] text-muted-foreground",children:o.rawDetail})]})}if(ef(n)){const o=WN(n.models||[]),s=XN(o),c=["primary","gemini-3","gemini-2","other"];return l.jsxs("div",{className:"text-xs space-y-1",children:[l.jsx("p",{className:"font-medium",children:"Model Quotas:"}),c.map((d,f)=>{const p=s.get(d);if(!p||p.length===0)return null;const m=c.slice(0,f).every(y=>!s.get(y)?.length);return l.jsxs("div",{children:[!m&&l.jsx("div",{className:"border-t border-border/40 my-1"}),p.map(y=>l.jsxs("div",{className:"flex justify-between gap-4",children:[l.jsx("span",{className:K("truncate",y.exhausted&&"text-red-500"),children:y.displayName}),l.jsxs("span",{className:K("font-mono",y.exhausted&&"text-red-500"),children:[y.percentage,"%"]})]},y.name))]},d)}),l.jsx(fl,{resetTime:a})]})}if(Ll(n)){const{fiveHourWindow:o,weeklyWindow:s,codeReviewWindows:c,unknownWindows:d}=Pl(n.windows),f=n.coreUsage?.fiveHour?.resetAt??o?.resetAt??null,p=n.coreUsage?.weekly?.resetAt??s?.resetAt??null,m=[o,s,...c,...d].filter(y=>!!y).filter((y,C,x)=>x.findIndex(b=>b.label===y.label&&b.resetAt===y.resetAt)===C);return l.jsxs("div",{className:"text-xs space-y-1",children:[l.jsx("p",{className:"font-medium",children:"Rate Limits:"}),n.planType&&l.jsxs("p",{className:"text-muted-foreground",children:["Plan: ",n.planType]}),m.map((y,C)=>l.jsxs("div",{className:"flex justify-between gap-4",children:[l.jsx("span",{className:K(y.remainingPercent<20&&"text-red-500"),children:JN(y,m)}),l.jsxs("span",{className:"font-mono",children:[y.remainingPercent,"%"]})]},`${y.label}-${y.resetAt??"no-reset"}-${C}`)),l.jsx(py,{fiveHourResetTime:f,weeklyResetTime:p,fallbackResetTime:a})]})}if(Rl(n)){const o=[n.coreUsage?.fiveHour,n.coreUsage?.weekly].filter(p=>!!p).map(p=>({rateLimitType:p.rateLimitType,label:p.label,remainingPercent:p.remainingPercent,resetAt:p.resetAt,status:p.status})),s=n.windows.map(p=>({rateLimitType:p.rateLimitType,label:p.label,remainingPercent:p.remainingPercent,resetAt:p.resetAt,status:p.status})),c=[...o,...s].filter((p,m,y)=>y.findIndex(C=>C.rateLimitType===p.rateLimitType&&C.resetAt===p.resetAt&&C.status===p.status)===m),d=n.coreUsage?.fiveHour?.resetAt??n.windows.find(p=>p.rateLimitType==="five_hour")?.resetAt??null,f=n.coreUsage?.weekly?.resetAt??n.windows.find(p=>["seven_day","seven_day_opus","seven_day_sonnet","seven_day_oauth_apps","seven_day_cowork"].includes(p.rateLimitType))?.resetAt??null;return l.jsxs("div",{className:"text-xs space-y-1",children:[l.jsx("p",{className:"font-medium",children:"Rate Limits:"}),c.map((p,m)=>l.jsxs("div",{className:"flex justify-between gap-4",children:[l.jsx("span",{className:K(p.remainingPercent<20&&"text-red-500"),children:hk(p.rateLimitType,p.label)}),l.jsxs("span",{className:"font-mono",children:[p.remainingPercent,"%"]})]},`${p.rateLimitType}-${p.resetAt??"no-reset"}-${p.status}-${m}`)),l.jsx(py,{fiveHourResetTime:d,weeklyResetTime:f,fallbackResetTime:a})]})}if(tf(n))return l.jsxs("div",{className:"text-xs space-y-1",children:[l.jsx("p",{className:"font-medium",children:"Buckets:"}),n.buckets.map(o=>l.jsxs("div",{className:"flex justify-between gap-4",children:[l.jsxs("span",{className:K(o.remainingPercent<20&&"text-red-500"),children:[o.label,o.tokenType?` (${o.tokenType})`:""]}),l.jsxs("span",{className:"font-mono",children:[o.remainingPercent,"%"]})]},o.id)),l.jsx(fl,{resetTime:a})]});if(nf(n)){const o=[{label:"Premium Interactions",snapshot:n.snapshots.premiumInteractions},{label:"Chat",snapshot:n.snapshots.chat},{label:"Completions",snapshot:n.snapshots.completions}],s=n.quotaResetDate??a,c=fk(n.planType);return l.jsxs("div",{className:"text-xs space-y-1",children:[l.jsx("p",{className:"font-medium",children:"Quota Snapshots:"}),c&&l.jsxs("p",{className:"text-muted-foreground",children:["Plan: ",c]}),o.map(({label:d,snapshot:f})=>{const p=f.percentRemaining<20;return l.jsxs("div",{className:"space-y-0.5",children:[l.jsxs("div",{className:"flex justify-between gap-4",children:[l.jsx("span",{className:K(p&&"text-red-500"),children:d}),l.jsx("span",{className:K("font-mono",p&&"text-red-500"),children:f.unlimited?"Unlimited":`${Zd(f.percentRemaining)}%`})]}),!f.unlimited&&l.jsxs("div",{className:"text-[11px] text-muted-foreground",children:[f.remaining,"/",f.entitlement," remaining"]})]},d)}),l.jsx(fl,{resetTime:s})]})}return null}function fl({resetTime:n}){return n?l.jsxs("div",{className:"flex items-center gap-1.5 pt-1 border-t border-border/50",children:[l.jsx(So,{className:"w-3 h-3 text-blue-400"}),l.jsxs("span",{className:"text-blue-400 font-medium",children:["Resets ",Md(n)]})]}):null}function py({fiveHourResetTime:n,weeklyResetTime:a,fallbackResetTime:o}){const s=!!n||!!a;return!s&&!o?null:l.jsxs("div",{className:"pt-1 border-t border-border/50 space-y-1",children:[n&&l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(So,{className:"w-3 h-3 text-blue-400"}),l.jsxs("span",{className:"text-blue-400 font-medium",children:["5h resets ",Md(n)]})]}),a&&l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(So,{className:"w-3 h-3 text-indigo-400"}),l.jsxs("span",{className:"text-indigo-400 font-medium",children:["Weekly resets ",Md(a)]})]}),!s&&o&&l.jsx(fl,{resetTime:o})]})}const Pd=S.forwardRef(({className:n,value:a=0,max:o=100,indicatorClassName:s,...c},d)=>{const f=Math.min(Math.max(a/o*100,0),100);return l.jsx("div",{ref:d,role:"progressbar","aria-valuemin":0,"aria-valuemax":o,"aria-valuenow":a,className:K("relative h-2 w-full overflow-hidden rounded-full bg-secondary",n),...c,children:l.jsx("div",{className:K("h-full transition-all",s||"bg-primary"),style:{width:`${f}%`}})})});Pd.displayName="Progress";function my(n){const a=Math.max(0,Math.min(100,n));return a<=20?"bg-destructive":a<=50?"bg-yellow-500":"bg-green-500"}function gy(n){if(!n)return"";try{const a=new Date(n),o=Date.now()-a.getTime();if(o<0)return"just now";const s=Math.floor(o/(1e3*60)),c=Math.floor(o/(1e3*60*60)),d=Math.floor(o/(1e3*60*60*24));return d>0?`${d}d ago`:c>0?`${c}h ago`:s>0?`${s}m ago`:"just now"}catch{return""}}function pk(n){if(!n)return!1;try{return Date.now()-new Date(n).getTime()<3600*1e3}catch{return!1}}function mk({provider:n,quota:a,quotaLoading:o,runtimeLastUsed:s,mode:c,className:d}){const{t:f}=Mt(),p=n.toLowerCase(),m=p==="codex",y=p==="claude"||p==="anthropic",C=Qx(n,a),x=Wx(n,a),b=C!==null?Zd(C):null,A=b!==null?Number(b):null,N=af(a),E=N?.label==="Reauth"?Fd:N?.tone==="warning"?Gn:Dl,O=m&&a&&Ll(a)?Pl(a.windows):null,k=(m?[{label:"5h",value:O?.fiveHourWindow?.remainingPercent??null},{label:c==="compact"?"Wk":"Weekly",value:O?.weeklyWindow?.remainingPercent??null}]:y&&a&&Rl(a)?[{label:"5h",value:a.coreUsage?.fiveHour?.remainingPercent??a.windows.find(j=>j.rateLimitType==="five_hour")?.remainingPercent??null},{label:c==="compact"?"Wk":"Weekly",value:a.coreUsage?.weekly?.remainingPercent??a.windows.find(j=>["seven_day","seven_day_opus","seven_day_sonnet","seven_day_oauth_apps","seven_day_cowork"].includes(j.rateLimitType))?.remainingPercent??null}]:[]).filter(j=>j.value!==null);if(o)return l.jsxs("div",{className:K("flex items-center gap-1.5 text-xs text-muted-foreground",d),children:[l.jsx(On,{className:"w-3 h-3 animate-spin"}),l.jsx("span",{children:c==="compact"?f("accountCard.quotaLoading"):"Loading quota..."})]});if(A!==null)return l.jsx("div",{className:K(c==="compact"?"px-0.5":"",d),children:l.jsx(Di,{children:l.jsxs(Sa,{children:[l.jsx(wa,{asChild:!0,children:c==="compact"?l.jsxs("div",{className:"space-y-0.5 cursor-help",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("span",{className:"text-[8px] text-muted-foreground/70 uppercase font-bold tracking-tight",children:f("accountCard.quota")}),l.jsxs("span",{className:K("text-[10px] font-mono font-bold",A>50?"text-emerald-600 dark:text-emerald-400":A>20?"text-amber-500":"text-red-500"),children:[b,"%"]})]}),k.length>0&&l.jsx("div",{className:"flex items-center justify-between text-[7px] text-muted-foreground/70",children:k.map(j=>l.jsxs("span",{children:[j.label," ",j.value,"%"]},j.label))}),l.jsx("div",{className:"w-full bg-muted dark:bg-zinc-800/50 h-1 rounded-full overflow-hidden",children:l.jsx("div",{className:K("h-full rounded-full transition-all",A>50?"bg-emerald-500":A>20?"bg-amber-500":"bg-red-500"),style:{width:`${A}%`}})})]}):l.jsxs("div",{className:"space-y-1.5 cursor-help",children:[l.jsx("div",{className:"flex items-center gap-1.5 text-xs",children:pk(s)?l.jsxs(l.Fragment,{children:[l.jsx(Kr,{className:"w-3 h-3 text-emerald-500"}),l.jsxs("span",{className:"text-emerald-600 dark:text-emerald-400",children:["Active · ",gy(s)]})]}):s?l.jsxs(l.Fragment,{children:[l.jsx(So,{className:"w-3 h-3 text-muted-foreground"}),l.jsxs("span",{className:"text-muted-foreground",children:["Last used ",gy(s)]})]}):l.jsxs(l.Fragment,{children:[l.jsx(Og,{className:"w-3 h-3 text-muted-foreground"}),l.jsx("span",{className:"text-muted-foreground",children:"Not used yet"})]})}),k.length>0?l.jsx("div",{className:"space-y-1.5",children:k.map(j=>l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"w-10 text-[10px] text-muted-foreground",children:j.label}),l.jsx(Pd,{value:Math.max(0,Math.min(100,j.value)),className:"h-2 flex-1",indicatorClassName:my(j.value)}),l.jsxs("span",{className:"text-xs font-medium w-10 text-right",children:[j.value,"%"]})]},j.label))}):l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(Pd,{value:Math.max(0,Math.min(100,A)),className:"h-2 flex-1",indicatorClassName:my(A)}),l.jsxs("span",{className:"text-xs font-medium w-10 text-right",children:[b,"%"]})]})]})}),l.jsx(Na,{side:c==="compact"?"top":"bottom",className:"max-w-xs",children:l.jsx(sb,{quota:a,resetTime:x})})]})})});if(a?.success)return c==="compact"?l.jsx("div",{className:K("text-[8px] text-muted-foreground/60",d),children:f("accountCard.quotaUnavailable")}):l.jsx("div",{className:d,children:l.jsxs(zt,{variant:"outline",className:"text-[10px] h-5 px-2 gap-1 border-muted-foreground/50 text-muted-foreground",children:[l.jsx(Og,{className:"w-3 h-3"}),f("accountCard.quotaUnavailable")]})});if(!N)return null;const D=N.tone==="warning"?"text-amber-600 dark:text-amber-400 border-amber-500/50":N.tone==="destructive"?"text-destructive border-destructive/50":"text-muted-foreground/70 border-muted-foreground/50";return l.jsx(Di,{children:l.jsxs(Sa,{children:[l.jsx(wa,{asChild:!0,children:c==="compact"?l.jsxs("div",{className:K("flex items-center gap-1 text-[8px]",D,d),children:[l.jsx(E,{className:"w-2.5 h-2.5"}),l.jsx("span",{children:N.label})]}):l.jsx("div",{className:d,children:l.jsxs(zt,{variant:"outline",className:K("text-[10px] h-5 px-2 gap-1",D),children:[l.jsx(E,{className:"w-3 h-3"}),N.label]})})}),l.jsx(Na,{side:c==="compact"?"top":"bottom",className:"max-w-[260px]",children:l.jsxs("div",{className:"space-y-1 text-xs",children:[l.jsx("p",{children:N.summary}),N.actionHint&&l.jsx("p",{className:"text-muted-foreground",children:N.actionHint}),N.technicalDetail&&l.jsx("p",{className:"font-mono text-[11px] text-muted-foreground",children:N.technicalDetail}),N.rawDetail&&l.jsx("pre",{className:"whitespace-pre-wrap break-all rounded bg-muted/40 px-2 py-1 font-mono text-[10px] text-muted-foreground",children:N.rawDetail})]})})]})})}function gk(n){return n==="business"?"bg-sky-500/12 text-sky-700 dark:text-sky-300":n==="personal"?"bg-emerald-500/12 text-emerald-700 dark:text-emerald-300":"bg-muted text-muted-foreground"}function yk(n){return n==="ultra"?"bg-violet-500/15 text-violet-600 dark:bg-violet-500/25 dark:text-violet-300":"bg-yellow-500/15 text-yellow-700 dark:bg-yellow-500/20 dark:text-yellow-400"}function xk(n){return n==="business"?"Biz":n==="personal"?"Pers":"?"}function bk({mode:n,provider:a,accountId:o,email:s,displayEmail:c,tokenFile:d,tier:f,isDefault:p,paused:m,privacyMode:y,showQuota:C,quota:x,quotaLoading:b,runtimeLastUsed:A,beforeIdentity:N,headerEnd:E,compactMetaBadges:O,bodySlot:R,footerSlot:k,quotaInsetClassName:D,className:j}){const T=gf(o,s,d),w=c||T.email||o,P=a.toLowerCase(),F=(P==="agy"||P==="antigravity")&&f&&f!=="unknown"&&f!=="free",z=n==="compact",$=l.jsxs(l.Fragment,{children:[F&&l.jsx("span",{className:K("text-[8px] font-semibold px-1.5 py-0.5 rounded-md shrink-0",yk(f)),children:f}),T.audienceLabel&&l.jsx("span",{title:T.audienceLabel,className:K("text-[8px] font-semibold px-1.5 py-0.5 rounded-md shrink-0",T.audience==="business"?"bg-sky-500/15 text-sky-700 dark:bg-sky-500/25 dark:text-sky-300":"bg-emerald-500/15 text-emerald-700 dark:bg-emerald-500/25 dark:text-emerald-300"),children:xk(T.audience)}),m&&l.jsx("span",{className:"text-[8px] font-semibold px-1.5 py-0.5 rounded-md shrink-0 bg-amber-500/15 text-amber-700 dark:bg-amber-500/25 dark:text-amber-300",children:"Paused"})]});return l.jsxs("div",{className:K("flex flex-col gap-2",j),children:[l.jsxs("div",{className:"flex items-start justify-between gap-2",children:[l.jsxs("div",{className:K("flex min-w-0 flex-1",z?"gap-2":"gap-3"),children:[N,!z&&l.jsxs("div",{className:"relative shrink-0",children:[l.jsx("div",{className:K("flex items-center justify-center w-8 h-8 rounded-full",p?"bg-primary/10":"bg-muted"),children:l.jsx(Tx,{className:"w-4 h-4"})}),F&&l.jsx("span",{className:K("absolute -bottom-0.5 -right-0.5 text-[7px] font-bold uppercase px-1 py-px rounded ring-1 ring-background",f==="ultra"?"bg-violet-500/20 text-violet-600 dark:bg-violet-500/30 dark:text-violet-300":"bg-yellow-500/20 text-yellow-700 dark:bg-yellow-500/25 dark:text-yellow-400"),children:f==="ultra"?"U":"P"})]}),l.jsxs("div",{className:"min-w-0 flex-1",children:[l.jsxs("div",{className:K("flex items-center min-w-0",z?"gap-1.5":"gap-2 flex-wrap"),children:[l.jsx("span",{title:w,className:K(z?"flex-1 min-w-0 text-xs font-semibold tracking-tight truncate leading-none":"font-medium text-sm truncate",y&&Vx),children:w}),z&&(O??$),!z&&T.audienceLabel&&l.jsx(zt,{variant:"outline",className:K("text-[10px] h-4 px-1.5 border-transparent",gk(T.audience)),children:T.audienceLabel}),!z&&T.detailLabel&&l.jsx(zt,{variant:"outline",className:"text-[10px] h-4 px-1.5",children:T.detailLabel}),!z&&p&&l.jsxs(zt,{variant:"secondary",className:"text-[10px] h-4 px-1.5 gap-0.5",children:[l.jsx(ES,{className:"w-2.5 h-2.5 fill-current"}),"Default"]}),!z&&m&&l.jsxs(zt,{variant:"outline",className:"text-[10px] h-4 px-1.5 border-yellow-500 text-yellow-600",children:[l.jsx(Ex,{className:"w-2 h-2 mr-0.5"}),"Paused"]})]}),R&&l.jsx("div",{className:"mt-1",children:R})]})]}),E&&l.jsx("div",{className:K("flex items-center shrink-0",z?"gap-0.5":"gap-1"),children:E})]}),k,C&&l.jsx(mk,{provider:a,quota:x,quotaLoading:b,runtimeLastUsed:A,mode:n,className:D})]})}async function vk(){const n=await fetch("/api/cliproxy/stats");if(!n.ok){const a=await n.json();throw new Error(a.message||"Failed to fetch stats")}return n.json()}async function Ck(){const n=await fetch("/api/cliproxy/status");if(!n.ok)throw new Error("Failed to fetch status");return n.json()}function Sk(){return Tt({queryKey:["cliproxy-status"],queryFn:Ck,refetchInterval:1e4,retry:1})}function wk(n=!0){return Tt({queryKey:["cliproxy-stats"],queryFn:vk,enabled:n,refetchInterval:5e3,retry:1,staleTime:3e3})}async function Nk(){const n=await fetch("/api/cliproxy/error-logs");if(!n.ok){const o=await n.json();throw new Error(o.message||"Failed to fetch error logs")}return(await n.json()).files??[]}async function Ak(n){const a=await fetch(`/api/cliproxy/error-logs/${encodeURIComponent(n)}`);if(!a.ok)throw new Error("Failed to fetch error log content");return a.text()}function kk(n=!0){return Tt({queryKey:["cliproxy-error-logs"],queryFn:Nk,enabled:n,refetchInterval:3e4,retry:1,staleTime:1e4})}function Dk(n){return Tt({queryKey:["cliproxy-error-log-content",n],queryFn:()=>n?Ak(n):Promise.resolve(""),enabled:!!n,staleTime:6e4})}const lb=["agy","codex","claude","gemini","ghcp"],jk={antigravity:"agy",anthropic:"claude","gemini-cli":"gemini",copilot:"ghcp","github-copilot":"ghcp"};function cb(n){const a=n.trim().toLowerCase();return a?lb.includes(a)?a:jk[a]??null:null}async function yy(n,a){const o=await fetch(`/api/cliproxy/quota/${n}/${encodeURIComponent(a)}`);if(!o.ok){let s="Failed to fetch quota";try{s=(await o.json()).message||s}catch{}throw new Error(s)}return o.json()}async function Tk(n){const a=await fetch(`/api/cliproxy/quota/codex/${encodeURIComponent(n)}`);if(!a.ok){let o="Failed to fetch Codex quota";try{o=(await a.json()).message||o}catch{}throw new Error(o)}return a.json()}async function Mk(n){const a=await fetch(`/api/cliproxy/quota/claude/${encodeURIComponent(n)}`);if(!a.ok){let o="Failed to fetch Claude quota";try{o=(await a.json()).message||o}catch{}throw new Error(o)}return a.json()}async function Ek(n){const a=await fetch(`/api/cliproxy/quota/gemini/${encodeURIComponent(n)}`);if(!a.ok){let o="Failed to fetch Gemini quota";try{o=(await a.json()).message||o}catch{}throw new Error(o)}return a.json()}async function Ok(n){const a=await fetch(`/api/cliproxy/quota/ghcp/${encodeURIComponent(n)}`);if(!a.ok){let o="Failed to fetch GitHub Copilot quota";try{o=(await a.json()).message||o}catch{}throw new Error(o)}return a.json()}function ub(n,a,o=!0){const s=cb(n);return{queryKey:["account-quota",s??n,a],queryFn:()=>Pk(s??n,a),enabled:o&&!!s&&!!a,staleTime:6e4,refetchInterval:6e4,refetchOnWindowFocus:!1,refetchOnMount:!1,retry:1}}async function Pk(n,a){const o=cb(n);if(!o)return yy(n,a);switch(o){case"codex":return Tk(a);case"claude":return Mk(a);case"gemini":return Ek(a);case"ghcp":return Ok(a);default:return yy(n,a)}}function Lk(n,a,o=!0){return Tt(ub(n,a,o))}function Rk(n,a=!0){return hS({queries:n.map(o=>ub(o.provider,o.accountId,a))})}function _k({success:n,failure:a,showDetails:o}){const s=n+a,c=s>0?n/s*100:100;return l.jsxs("div",{className:"mt-2 space-y-2",children:[l.jsxs("div",{className:"flex items-end justify-between px-0.5",children:[l.jsxs("div",{className:"flex flex-col",children:[l.jsx("span",{className:"text-[8px] text-muted-foreground/70 uppercase font-bold tracking-tight",children:"Success Rate"}),l.jsxs("span",{className:K("text-sm font-mono font-bold leading-none mt-0.5",c===100?"text-emerald-600 dark:text-emerald-400":c>=90?"text-amber-500":"text-red-500"),children:[Math.round(c),"%"]})]}),l.jsxs("div",{className:"flex flex-col items-end",children:[l.jsx("span",{className:"text-[8px] text-muted-foreground/70 uppercase font-bold tracking-tight",children:"Volume"}),l.jsx("span",{className:"text-xs font-mono font-medium text-foreground/80 leading-none mt-0.5",children:s.toLocaleString()})]})]}),l.jsxs("div",{className:K("grid grid-cols-2 gap-2 overflow-hidden transition-all duration-300 ease-in-out",o?"max-h-20 opacity-100 mt-2":"max-h-0 opacity-0 mt-0"),children:[l.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:[l.jsx(Kr,{className:"w-2.5 h-2.5 text-emerald-600 dark:text-emerald-400"}),l.jsx("span",{className:"text-[10px] font-mono font-bold text-emerald-600 dark:text-emerald-400",children:n})]}),l.jsxs("div",{className:K("flex items-center gap-1.5 px-1.5 py-1 rounded-md border",a>0?"bg-red-500/5 dark:bg-red-500/10 border-red-500/20":"bg-muted/10 border-transparent opacity-40"),children:[l.jsx(Vd,{className:K("w-2.5 h-2.5",a>0?"text-red-500":"text-muted-foreground")}),l.jsx("span",{className:K("text-[10px] font-mono font-bold",a>0?"text-red-500":"text-muted-foreground"),children:a})]})]})]})}const zk=["antigravity","anthropic","gemini-cli","copilot","github-copilot"],Ik={left:"border-l-2",right:"border-r-2",top:"border-t-2",bottom:"border-b-2"},Uk={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 Hk(n,a){switch(n){case"left":return{borderLeftColor:a};case"right":return{borderRightColor:a};case"top":return{borderTopColor:a};case"bottom":return{borderBottomColor:a}}}function Bk(n){return n>50?"bg-emerald-500":n>20?"bg-amber-500":"bg-red-500"}function db(n,a){return n==="business"?"Biz":n==="personal"?"Pers":a?.trim()?.[0]?.toUpperCase()??"?"}function Kk(n){const a=new Set(n.map(o=>o.audience));if(a.size===2&&a.has("business")&&a.has("personal"))return"B|P";if(n.length===1){const[o]=n;return db(o.audience,o.audienceLabel??o.detailLabel??null)}return null}function qk({account:n,zone:a,originalIndex:o,isHovered:s,isDragging:c,offset:d,showDetails:f,privacyMode:p,onMouseEnter:m,onMouseLeave:y,onPointerDown:C,onPointerMove:x,onPointerUp:b,onPauseToggle:A,isPausingAccount:N}){const{t:E}=Mt(),O=Ik[a],R=Hk(a,n.color),k=Uk[a],D=n.provider.toLowerCase(),j=lb.includes(D)||zk.includes(D),T=(n.variants?.length??0)>1,{data:w,isLoading:P}=Lk(D,n.id,j&&!T),F=Rk((n.variants??[]).map(te=>({provider:n.provider,accountId:te.id})),j&&T),z=T?Array.from(new Map((n.variants??[]).slice().sort((te,be)=>{const I={business:0,personal:1,unknown:2};return I[te.audience]-I[be.audience]}).map(te=>[te.audienceLabel??te.detailLabel??te.id,te])).values()):[],$=Kk(z),ne=T?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"inline-flex shrink-0 items-center overflow-hidden rounded-md border border-border/60 bg-muted/60 shadow-sm shadow-black/5 dark:bg-zinc-900/80",title:z.map(te=>te.audienceLabel??te.detailLabel??"Variant").join(" • "),children:$?l.jsx("span",{className:"inline-flex min-w-[2.2rem] items-center justify-center px-1.5 py-1 text-[9px] font-semibold leading-none text-foreground/80",children:$}):z.map((te,be)=>l.jsx("span",{className:K("inline-flex min-w-[1.9rem] items-center justify-center px-1.5 py-1 text-[9px] font-semibold leading-none",be>0&&"border-l border-border/50",te.audience==="business"?"bg-sky-500/12 text-sky-700 dark:bg-sky-500/20 dark:text-sky-300":te.audience==="personal"?"bg-emerald-500/12 text-emerald-700 dark:bg-emerald-500/20 dark:text-emerald-300":"bg-muted text-muted-foreground"),children:db(te.audience,te.audienceLabel??te.detailLabel??null)},te.id))}),n.paused&&l.jsx("span",{className:"text-[7px] font-bold uppercase tracking-wide px-1 py-px rounded shrink-0 bg-amber-500/15 text-amber-700 dark:bg-amber-500/25 dark:text-amber-300",children:"Paused"})]}):void 0,Z=T&&j?(n.variants??[]).map((te,be)=>{const I=F[be],X=I?.data,ee=Qx(n.provider,X),re=Wx(n.provider,X),fe=ee!==null?Zd(ee):null,he=fe!==null?Number(fe):null,de=af(X),H=te.audienceLabel??te.detailLabel??Od(te.email);return l.jsxs(Sa,{children:[l.jsx(wa,{asChild:!0,children:l.jsxs("div",{className:"space-y-0.5 cursor-help",children:[l.jsxs("div",{className:"flex items-center justify-between gap-2 text-[8px]",children:[l.jsx("span",{className:"text-muted-foreground/80 truncate",children:H}),l.jsx("span",{className:"font-mono text-foreground/80 shrink-0",children:I?.isLoading?E("accountCard.quotaLoading"):he!==null?`${fe}%`:de?.label||E("accountCard.quotaUnavailable")})]}),he!==null&&l.jsx("div",{className:"w-full bg-muted dark:bg-zinc-800/50 h-1 rounded-full overflow-hidden",children:l.jsx("div",{className:K("h-full rounded-full transition-all",Bk(he)),style:{width:`${he}%`}})})]})}),l.jsx(Na,{side:"top",className:"max-w-xs",children:l.jsx(sb,{quota:X,resetTime:re})})]},te.id)}):null,xe=l.jsxs(l.Fragment,{children:[A&&l.jsx(Di,{children:l.jsxs(Sa,{children:[l.jsx(wa,{asChild:!0,children:l.jsx(dt,{variant:"ghost",size:"icon",className:K("h-4 w-4 shrink-0 transition-all rounded-full",n.paused?"bg-amber-500/20 hover:bg-amber-500/30":"hover:bg-muted"),onClick:te=>{te.stopPropagation(),A(n.memberIds??[n.id],!n.paused)},disabled:N,children:N?l.jsx(On,{className:"w-2.5 h-2.5 animate-spin"}):n.paused?l.jsx(OS,{className:"w-2.5 h-2.5 text-amber-600 dark:text-amber-400"}):l.jsx(Ex,{className:"w-2.5 h-2.5 text-muted-foreground/50 hover:text-foreground"})})}),l.jsx(Na,{side:"top",className:"text-xs",children:n.paused?E("accountCard.resumeAccount"):E("accountCard.pauseAccount")})]})}),l.jsx(jl,{className:"w-4 h-4 text-muted-foreground/40 shrink-0"})]});return l.jsxs("div",{"data-account-index":o,"data-zone":a,onMouseEnter:m,onMouseLeave:y,onPointerDown:C,onPointerMove:x,onPointerUp:b,onPointerCancel:b,className:K("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]",O,"select-none touch-none",s&&"bg-muted/50 dark:bg-zinc-800/60",c&&"cursor-grabbing shadow-xl scale-105 z-50",n.paused&&"opacity-60"),style:{...R,transform:`translate(${d.x}px, ${d.y}px)${c?" scale(1.05)":""}`},children:[l.jsx(bk,{mode:"compact",provider:n.provider,accountId:n.id,email:n.email,displayEmail:Od(n.email),tokenFile:n.tokenFile,tier:n.tier,isDefault:n.isDefault,paused:n.paused,privacyMode:p,showQuota:j&&!T,quota:w,quotaLoading:P,runtimeLastUsed:n.lastUsedAt,headerEnd:xe,compactMetaBadges:ne,footerSlot:l.jsxs(l.Fragment,{children:[l.jsx(_k,{success:n.successCount,failure:n.failureCount,showDetails:f}),Z&&l.jsx("div",{className:"mt-2 px-0.5 space-y-1",children:Z})]})}),l.jsx("div",{className:K("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,s&&"bg-foreground dark:bg-white border-transparent")})]})}function yf({provider:n,className:a,size:o=18,withBackground:s=!1}){const c=n.toLowerCase(),d=tb(n),f=ff[c]||"#6b7280",p=s?Math.floor(o*.65):o,m=d?l.jsx("img",{src:d,alt:`${n} icon`,width:p,height:p,className:"shrink-0 object-contain"}):l.jsx("span",{className:"font-bold",style:{color:f,fontSize:p*.6},children:n.charAt(0).toUpperCase()});if(s)return l.jsx("div",{className:K("shrink-0 rounded-full bg-white border border-border flex items-center justify-center shadow-sm",a),style:{width:o,height:o},children:m});if(d)return l.jsx("img",{src:d,alt:`${n} icon`,width:o,height:o,className:K("shrink-0 rounded-sm object-contain",a)});const y=f;return l.jsx("div",{className:K("shrink-0 rounded-full flex items-center justify-center text-white font-bold",a),style:{width:o,height:o,backgroundColor:y,fontSize:o*.5},children:n.charAt(0).toUpperCase()})}function Fk({providerData:n,providerColor:a,totalRequests:o,maxRequests:s,isDragging:c,offset:d,hoveredAccount:f,hasRightAccounts:p,hasTopAccounts:m,hasBottomAccounts:y,onPointerDown:C,onPointerMove:x,onPointerUp:b}){const{t:A}=Mt(),{accounts:N}=n;return l.jsxs("div",{"data-provider-node":!0,onPointerDown:C,onPointerMove:x,onPointerUp:b,onPointerCancel:b,className:K("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]",!c&&"animate-subtle-float animate-border-glow","select-none touch-none",f!==null&&"scale-[1.02]",c&&"cursor-grabbing shadow-2xl scale-105 z-50"),style:{"--glow-color":`${a}60`,borderColor:f!==null?`${a}80`:void 0,transform:`translate(${d.x}px, ${d.y}px)${c?" scale(1.05)":""}`},children:[l.jsx(jl,{className:"absolute top-2 right-2 w-4 h-4 text-muted-foreground/40"}),l.jsx("div",{className:"absolute inset-0 rounded-xl animate-glow-pulse pointer-events-none",style:{"--glow-color":`${a}30`}}),l.jsx("div",{className:"absolute top-1/2 -left-1.5 w-3 h-3 rounded-full transform -translate-y-1/2",style:{backgroundColor:a,boxShadow:"0 0 0 4px var(--background)"}}),p&&l.jsx("div",{className:"absolute top-1/2 -right-1.5 w-3 h-3 rounded-full transform -translate-y-1/2",style:{backgroundColor:a,boxShadow:"0 0 0 4px var(--background)"}}),m&&l.jsx("div",{className:"absolute left-1/2 -top-1.5 w-3 h-3 rounded-full transform -translate-x-1/2",style:{backgroundColor:a,boxShadow:"0 0 0 4px var(--background)"}}),y&&l.jsx("div",{className:"absolute left-1/2 -bottom-1.5 w-3 h-3 rounded-full transform -translate-x-1/2",style:{backgroundColor:a,boxShadow:"0 0 0 4px var(--background)"}}),l.jsxs("div",{className:"flex items-center gap-3 mb-4 relative z-10",children:[l.jsx("div",{className:"animate-icon-breathe",children:l.jsx(yf,{provider:n.provider,size:36,withBackground:!0})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold text-foreground tracking-tight",children:n.displayName}),l.jsx("p",{className:"text-[10px] text-muted-foreground font-medium uppercase",children:A("flowViz.provider")})]})]}),l.jsxs("div",{className:"space-y-2 relative z-10",children:[l.jsxs("div",{className:"flex justify-between items-center text-xs",children:[l.jsx("span",{className:"text-muted-foreground",children:A("flowViz.totalRequests")}),l.jsx("span",{className:"text-foreground font-mono",children:o.toLocaleString()})]}),l.jsxs("div",{className:"flex justify-between items-center text-xs",children:[l.jsx("span",{className:"text-muted-foreground",children:A("flowViz.accounts")}),l.jsx("span",{className:"text-foreground font-mono",children:N.length})]}),l.jsx("div",{className:"w-full bg-muted dark:bg-zinc-800/50 h-1 rounded-full mt-2 overflow-hidden",children:l.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${Math.min(100,o/(s*N.length)*100)}%`,backgroundColor:a}})})]})]})}function Gk({paths:n,accounts:a,maxRequests:o,hoveredAccount:s,pulsingAccounts:c}){return l.jsxs(l.Fragment,{children:[l.jsx("defs",{children:l.jsxs("filter",{id:"flow-glow",x:"-20%",y:"-20%",width:"140%",height:"140%",filterUnits:"userSpaceOnUse",children:[l.jsx("feGaussianBlur",{stdDeviation:"3",result:"blur"}),l.jsx("feComposite",{in:"SourceGraphic",in2:"blur",operator:"over"})]})}),n.map((d,f)=>{const p=a[f];if(!p)return null;const m=p.successCount+p.failureCount,y=Math.max(2,m/o*10),C=s===f,x=s!==null&&s!==f,b=c.has(p.id),A=Q1(f);return l.jsxs("g",{children:[l.jsx("path",{d,fill:"none",stroke:A,strokeWidth:y,strokeOpacity:C?.8:x?.15:.4,strokeLinecap:"round",filter:C?"url(#flow-glow)":void 0,className:"transition-all duration-300"}),b&&l.jsxs(l.Fragment,{children:[l.jsx("path",{d,fill:"none",stroke:p.color,strokeWidth:y*2,strokeLinecap:"round",filter:"url(#flow-glow)",className:"animate-request-pulse"}),l.jsx("circle",{r:6,fill:p.color,filter:"url(#flow-glow)",style:{offsetPath:`path('${d}')`,offsetDistance:"0%",animation:"travel-dot 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards"}})]})]},f)})]})}function Vk({onBack:n,showDetails:a,onToggleDetails:o,hasCustomPositions:s,onResetPositions:c}){const{t:d}=Mt();return l.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5",children:[n?l.jsxs("button",{onClick:n,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:[l.jsx(Nl,{className:"w-3.5 h-3.5 rotate-180 transition-transform group-hover:-translate-x-0.5"}),l.jsx("span",{children:d("flowViz.backToProviders")})]}):l.jsx("div",{}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{onClick:o,className:K("flex items-center gap-1.5 text-xs font-medium transition-all duration-200 px-3 py-1.5 rounded-md border shadow-sm",a?"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:[a?l.jsx(Al,{className:"w-3.5 h-3.5"}):l.jsx(kl,{className:"w-3.5 h-3.5"}),l.jsx("span",{children:d(a?"flowViz.hideDetails":"flowViz.showDetails")})]}),s&&l.jsxs("button",{onClick:c,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:[l.jsx(PS,{className:"w-3.5 h-3.5"}),l.jsx("span",{children:d("flowViz.resetLayout")})]})]})]})}function Yk({providerData:n,onBack:a,onPauseToggle:o,isPausingAccount:s}){const c=S.useRef(null),d=S.useRef(null),[f,p]=S.useState(null),[m,y]=S.useState(!1),[C,x]=S.useState([]),{privacyMode:b}=Qd(),{accounts:A}=n,N=Math.max(...A.map(Q=>Q.successCount+Q.failureCount),1),E=A.reduce((Q,ie)=>Q+ie.successCount+ie.failureCount,0),O=S.useCallback(()=>{const Q=Z1({containerRef:c,svgRef:d,accounts:A});Q.length>0&&x(Q)},[A]),R=`ccs-flow-positions-${n.provider}`,{dragOffsets:k,draggingId:D,handlePointerDown:j,handlePointerMove:T,handlePointerUp:w,getOffset:P,resetPositions:F,hasCustomPositions:z}=tk({storageKey:R,onDrag:O}),$=nk(k),ne=ak(A),Z=S.useMemo(()=>X1(A).slice(0,$1),[A]);S.useEffect(()=>{const Q=setTimeout(O,50);return window.addEventListener("resize",O),()=>{clearTimeout(Q),window.removeEventListener("resize",O)}},[O]),S.useEffect(()=>{const Q=setTimeout(O,10);return()=>clearTimeout(Q)},[k,O]),S.useEffect(()=>{const Q=Date.now(),ie=350,ae=()=>{O(),Date.now()-Q<ie&&requestAnimationFrame(ae)};requestAnimationFrame(ae)},[m,O]);const xe=ff[n.provider.toLowerCase()]||"#6b7280",te=S.useMemo(()=>J1(A),[A]),{leftAccounts:be,rightAccounts:I,topAccounts:X,bottomAccounts:ee}=te,re=I.length>0,fe=X.length>0,he=ee.length>0,de=S.useMemo(()=>ek(A.length),[A.length]),H=(Q,ie)=>Q.map(ae=>{const oe=A.findIndex(ge=>ge.id===ae.id);return l.jsx(qk,{account:ae,zone:ie,originalIndex:oe,isHovered:f===oe,isDragging:D===ae.id,offset:P(ae.id),showDetails:m,privacyMode:b,onMouseEnter:()=>p(oe),onMouseLeave:()=>p(null),onPointerDown:ge=>j(ae.id,ge),onPointerMove:T,onPointerUp:w,onPauseToggle:o,isPausingAccount:s},ae.id)});return l.jsxs("div",{className:"flex flex-col",ref:c,children:[l.jsx(Vk,{onBack:a,showDetails:m,onToggleDetails:()=>y(!m),hasCustomPositions:z,onResetPositions:F}),l.jsxs("div",{className:"min-h-[320px] flex gap-4 px-4 py-6 self-stretch items-stretch transition-all duration-200",children:[l.jsxs("div",{className:"relative flex-1 flex flex-col items-stretch justify-center px-4",style:{paddingTop:`${24+$.paddingTop}px`,paddingBottom:`${24+$.paddingBottom}px`,minHeight:`${320+$.extraHeight}px`},children:[l.jsx("svg",{ref:d,className:"absolute inset-0 w-full h-full pointer-events-none z-0 overflow-visible",children:l.jsx(Gk,{paths:C,accounts:A,maxRequests:N,hoveredAccount:f,pulsingAccounts:ne})}),fe&&l.jsx("div",{className:"flex flex-row gap-3 z-10 justify-center flex-wrap mb-8",children:H(X,"top")}),l.jsxs("div",{className:"flex items-center justify-between gap-8 flex-1",children:[l.jsx("div",{className:"flex flex-col gap-3 z-10 w-48 justify-center flex-shrink-0",children:H(be,"left")}),l.jsx("div",{className:K("z-10 flex items-center flex-shrink-0",de),children:l.jsx(Fk,{providerData:n,providerColor:xe,totalRequests:E,maxRequests:N,isDragging:D==="provider",offset:P("provider"),hoveredAccount:f,hasRightAccounts:re,hasTopAccounts:fe,hasBottomAccounts:he,onPointerDown:Q=>j("provider",Q),onPointerMove:T,onPointerUp:w})}),re&&l.jsx("div",{className:"flex flex-col gap-3 z-10 w-48 justify-center flex-shrink-0",children:H(I,"right")})]}),he&&l.jsx("div",{className:"flex flex-row gap-3 z-10 justify-center flex-wrap mt-8",children:H(ee,"bottom")})]}),l.jsx("div",{className:"w-56 flex-shrink-0 self-stretch relative",children:l.jsx("div",{className:"absolute inset-0",children:l.jsx(ik,{events:Z,privacyMode:b})})})]})]})}function $k(n,a){return`${n.trim().toLowerCase()}:${a.trim()}`}function Qk(n,a){const o=Array.from(new Set([a.id,a.email].filter(s=>!!s?.trim())));for(const s of o){const c=$k(a.provider,s),d=n?.accountStats?.[c]??n?.accountStats?.[s];if(d)return d}}const xy={business:0,personal:1,unknown:2};function Wk(n,a){return a?n?new Date(a).getTime()>new Date(n).getTime()?a:n:a:n}function Xk(n,a){const o=gf(n.id,n.email,n.tokenFile),s=Qk(a,n);return{id:n.id,email:o.email||n.email||n.id,tokenFile:n.tokenFile,isDefault:n.isDefault,successCount:s?.successCount??0,failureCount:s?.failureCount??0,lastUsedAt:s?.lastUsedAt??n.lastUsedAt,paused:n.paused,tier:n.tier,audience:o.audience,audienceLabel:o.audienceLabel,detailLabel:o.detailLabel}}function Zk(n){return[...n].sort((a,o)=>{const s=xy[a.audience]-xy[o.audience];if(s!==0)return s;const c=a.audienceLabel??a.detailLabel??a.id,d=o.audienceLabel??o.detailLabel??o.id;return c.localeCompare(d)})}function Jk(n,a){const o=new Map,s=new Map;for(const c of n){const d=Xk(c,a),p=c.provider.toLowerCase()==="codex"?`${c.provider}:${d.email}`:c.id;o.has(p)||o.set(p,[]),o.get(p)?.push(d),s.set(c.id,c)}return Array.from(o.entries()).map(([c,d])=>{if(d.length===1){const[y]=d,C=s.get(y.id);return{id:y.id,email:y.email,tokenFile:y.tokenFile,provider:C?.provider??"codex",isDefault:y.isDefault,successCount:y.successCount,failureCount:y.failureCount,lastUsedAt:y.lastUsedAt,paused:y.paused,tier:y.tier,projectId:C?.projectId}}const f=Zk(d),p=f[0]?.email??c,m=s.get(f[0]?.id??"")?.provider??"codex";return{id:c,email:p,tokenFile:f[0]?.tokenFile??"",provider:m,isDefault:f.some(y=>y.isDefault),successCount:f.reduce((y,C)=>y+C.successCount,0),failureCount:f.reduce((y,C)=>y+C.failureCount,0),lastUsedAt:f.reduce((y,C)=>Wk(y,C.lastUsedAt),void 0),paused:f.every(y=>!!y.paused),memberIds:f.map(y=>y.id),variants:f}})}function eD(n,a){const o=n+a;return o===0?100:Math.round(n/o*100)}const by=["#1e6091","#2d8a6e","#d4a012","#c92a2d","#c45a1a","#6b9c4d","#3d5a73","#cc7614","#3a7371","#7c5fc4"];function tD(){const{data:n,isLoading:a,error:o}=UA(),{data:s,isLoading:c,dataUpdatedAt:d}=wk(),[f,p]=S.useState("");S.useEffect(()=>{if(!d)return;const N=()=>{const O=Math.floor((Date.now()-d)/1e3);O<60?p(`${O}s ago`):p(`${Math.floor(O/60)}m ago`)};N();const E=setInterval(N,1e3);return()=>clearInterval(E)},[d]);const{accounts:m,totalSuccess:y,totalFailure:C,totalRequests:x,providerStats:b}=S.useMemo(()=>{if(!n?.authStatus)return{accounts:[],totalSuccess:0,totalFailure:0,totalRequests:0,providerStats:[]};const N=[],E=new Map;let O=0,R=0,k=0;n.authStatus.forEach(j=>{const T=j.provider;E.has(T)||E.set(T,{success:0,failure:0,accounts:[]});const w=E.get(T);if(!w)return;const P=(j.accounts??[]).map(F=>({...F,provider:F.provider||j.provider}));Jk(P,s).forEach(F=>{O+=F.successCount,R+=F.failureCount,w.success+=F.successCount,w.failure+=F.failureCount;const z={id:F.id,email:F.email,tokenFile:F.tokenFile,provider:j.provider,displayName:j.displayName,isDefault:F.isDefault,successCount:F.successCount,failureCount:F.failureCount,lastUsedAt:F.lastUsedAt,color:by[k%by.length],projectId:F.projectId,paused:F.paused,tier:F.tier,memberIds:F.memberIds,variants:F.variants};N.push(z),w.accounts.push(z),k++})});const D=[];return E.forEach((j,T)=>{j.accounts.length!==0&&D.push({provider:T,displayName:hf(T),totalRequests:j.success+j.failure,successCount:j.success,failureCount:j.failure,accountCount:j.accounts.length,accounts:j.accounts})}),D.sort((j,T)=>T.totalRequests-j.totalRequests),{accounts:N,totalSuccess:O,totalFailure:R,totalRequests:O+R,providerStats:D}},[n?.authStatus,s]),A=x>0?Math.round(y/x*100):100;return{accounts:m,totalSuccess:y,totalFailure:C,totalRequests:x,providerStats:b,overallSuccessRate:A,isLoading:a||c,error:o??null,timeSinceUpdate:f}}function nD(){return l.jsxs("div",{className:"relative flex items-center justify-center w-5 h-5",children:[l.jsx("div",{className:"absolute w-4 h-4 rounded-full animate-ping opacity-20",style:{backgroundColor:Wt.success}}),l.jsx("div",{className:"absolute w-3 h-3 rounded-full animate-pulse opacity-40",style:{backgroundColor:Wt.success}}),l.jsx("div",{className:"relative w-2 h-2 rounded-full z-10",style:{backgroundColor:Wt.success}})]})}function aD({success:n,failure:a}){return n===0&&a===0?l.jsx("span",{className:"text-[9px] text-muted-foreground/50 font-mono",children:"no activity"}):l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("div",{className:"flex items-center gap-0.5",children:[l.jsx(Kr,{className:"w-3 h-3 text-emerald-700 dark:text-emerald-500"}),l.jsx("span",{className:"text-[10px] font-mono font-medium text-emerald-700 dark:text-emerald-500",children:n.toLocaleString()})]}),a>0&&l.jsxs("div",{className:"flex items-center gap-0.5",children:[l.jsx(Vd,{className:"w-3 h-3 text-red-700 dark:text-red-500"}),l.jsx("span",{className:"text-[10px] font-mono font-medium text-red-700 dark:text-red-500",children:a.toLocaleString()})]})]})}function iD({stats:n,isHovered:a,privacyMode:o,onSelect:s,onMouseEnter:c,onMouseLeave:d}){const f=eD(n.successCount,n.failureCount),p=ff[n.provider.toLowerCase()]||"#6b7280";return l.jsxs("button",{onClick:s,onMouseEnter:c,onMouseLeave:d,className:K("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",a&&"ring-1"),style:{borderColor:a?p:void 0,"--ring-color":p},children:[l.jsxs("div",{className:"flex items-center gap-3 mb-3",children:[l.jsx(yf,{provider:n.provider,size:36,withBackground:!0}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-semibold text-foreground tracking-tight",children:n.displayName}),l.jsxs("p",{className:"text-[10px] text-muted-foreground",children:[n.accountCount," account",n.accountCount!==1?"s":""]})]}),l.jsx(Nl,{className:K("w-4 h-4 ml-auto text-muted-foreground transition-all",a?"opacity-100 translate-x-0":"opacity-0 -translate-x-2")})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex justify-between items-center text-xs",children:[l.jsx("span",{className:"text-muted-foreground",children:"Stats"}),l.jsx(aD,{success:n.successCount,failure:n.failureCount})]}),l.jsxs("div",{className:"flex justify-between text-xs",children:[l.jsx("span",{className:"text-muted-foreground",children:"Success Rate"}),l.jsxs("span",{className:"font-mono font-semibold",style:{color:f===100?Wt.success:f>=95?Wt.degraded:Wt.failed},children:[f,"%"]})]}),l.jsx("div",{className:"w-full bg-muted dark:bg-zinc-800/50 h-1 rounded-full overflow-hidden",children:l.jsx("div",{className:"h-full rounded-full transition-all duration-500",style:{width:`${f}%`,backgroundColor:p}})})]}),l.jsxs("div",{className:"flex gap-1 mt-3 items-center",children:[n.accounts.slice(0,5).map(m=>{const y=n.provider==="agy"&&!m.projectId;return l.jsxs("div",{className:"relative",children:[l.jsx("div",{className:K("w-2 h-2 rounded-full",m.paused&&"opacity-50"),style:{backgroundColor:m.color},title:o?"••••••":dk(m.id,m.email,m.tokenFile)}),y&&l.jsx(Di,{children:l.jsxs(Sa,{children:[l.jsx(wa,{asChild:!0,children:l.jsx(Gn,{className:"absolute -top-1 -right-1 w-2.5 h-2.5 text-amber-500","aria-label":"Missing Project ID"})}),l.jsx(Na,{side:"top",className:"text-xs",children:"Missing Project ID - re-add account to fix"})]})})]},m.id)}),n.accounts.length>5&&l.jsxs("span",{className:"text-[10px] text-muted-foreground ml-1",children:["+",n.accounts.length-5]})]})]})}function sl({icon:n,label:a,value:o,color:s}){return l.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:[l.jsx("div",{className:"w-8 h-8 rounded-md flex items-center justify-center",style:{backgroundColor:s?`${s}15`:"var(--muted)",color:s||"var(--muted-foreground)"},children:n}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:a}),l.jsx("div",{className:"text-lg font-semibold font-mono leading-tight",style:{color:s||"var(--foreground)"},children:o})]})]})}const ud="auth-monitor-selected-provider";function oD(){const{t:n}=Mt(),{accounts:a,totalSuccess:o,totalFailure:s,totalRequests:c,providerStats:d,overallSuccessRate:f,isLoading:p,error:m,timeSinceUpdate:y}=tD(),{privacyMode:C}=Qd(),[x,b]=S.useState(()=>typeof window<"u"?localStorage.getItem(ud):null),A=P=>{b(P),P?localStorage.setItem(ud,P):localStorage.removeItem(ud)},N=S.useMemo(()=>x&&d.some(P=>P.provider===x)?x:null,[x,d]),[E,O]=S.useState(null),R=HA(),k=BA(),D=KA(),j=qA(),T=N?d.find(P=>P.provider===N):null,w=(P,F)=>{if(!N||R.isPending||k.isPending||D.isPending||j.isPending)return;if(P.length>1){F?D.mutate({provider:N,accountIds:P}):j.mutate({provider:N,accountIds:P});return}const[z]=P;z&&(F?R.mutate({provider:N,accountId:z}):k.mutate({provider:N,accountId:z}))};return p?l.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:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[l.jsx(Ye,{className:"h-4 w-32"}),l.jsx(Ye,{className:"h-4 w-20"})]}),l.jsxs("div",{className:"p-4 space-y-4",children:[l.jsx("div",{className:"flex gap-3",children:[1,2,3,4].map(P=>l.jsx(Ye,{className:"h-16 flex-1 rounded-lg"},P))}),l.jsx(Ye,{className:"h-48 w-full rounded-lg"})]})]}):m||a.length===0?null:l.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:[l.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:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(nD,{}),l.jsx("span",{className:"text-xs font-semibold tracking-tight text-foreground",children:"LIVE"}),l.jsx("span",{className:"text-[10px] text-muted-foreground",children:"Account Monitor"})]}),l.jsxs("div",{className:"flex items-center gap-4 text-[10px] text-muted-foreground",children:[l.jsxs("div",{className:"flex items-center gap-1.5",children:[l.jsx(LS,{className:"w-3 h-3 animate-pulse"}),l.jsxs("span",{children:["Updated ",y||"now"]})]}),l.jsx("span",{className:"text-muted-foreground/50",children:"|"}),l.jsx("span",{children:n("authMonitor.accountsCount",{count:a.length})}),l.jsxs("span",{className:"font-mono",children:[c.toLocaleString()," req"]})]})]}),l.jsxs("div",{className:"grid grid-cols-4 gap-3 p-4 border-b border-border bg-muted/20 dark:bg-zinc-900/30",children:[l.jsx(sl,{icon:l.jsx(Rr,{className:"w-4 h-4"}),label:n("authMonitor.accounts"),value:a.length,color:"var(--accent)"}),l.jsx(sl,{icon:l.jsx(Kr,{className:"w-4 h-4"}),label:n("authMonitor.success"),value:o.toLocaleString(),color:Wt.success}),l.jsx(sl,{icon:l.jsx(Vd,{className:"w-4 h-4"}),label:n("authMonitor.failed"),value:s.toLocaleString(),color:s>0?Wt.failed:void 0}),l.jsx(sl,{icon:l.jsx(Rr,{className:"w-4 h-4"}),label:n("authMonitor.successRate"),value:`${f}%`,color:f===100?Wt.success:f>=95?Wt.degraded:Wt.failed})]}),l.jsx("div",{className:"relative overflow-hidden",children:T?l.jsx(Yk,{providerData:T,onBack:()=>A(null),onPauseToggle:w,isPausingAccount:R.isPending||k.isPending||D.isPending||j.isPending}):l.jsxs("div",{className:"p-6",children:[l.jsx("div",{className:"text-[10px] text-muted-foreground uppercase tracking-widest mb-4",children:"Request Distribution by Provider"}),l.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-3 gap-4",children:d.map(P=>l.jsx(iD,{stats:P,isHovered:E===P.provider,privacyMode:C,onSelect:()=>A(P.provider),onMouseEnter:()=>O(P.provider),onMouseLeave:()=>O(null)},P.provider))})]})})]})}const zl=S.createContext(null);zl.displayName="PanelGroupContext";const mt={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"},xf=10,Ni=S.useLayoutEffect,vy=lS.useId,rD=typeof vy=="function"?vy:()=>null;let sD=0;function bf(n=null){const a=rD(),o=S.useRef(n||a||null);return o.current===null&&(o.current=""+sD++),n??o.current}function fb({children:n,className:a="",collapsedSize:o,collapsible:s,defaultSize:c,forwardedRef:d,id:f,maxSize:p,minSize:m,onCollapse:y,onExpand:C,onResize:x,order:b,style:A,tagName:N="div",...E}){const O=S.useContext(zl);if(O===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:R,expandPanel:k,getPanelSize:D,getPanelStyle:j,groupId:T,isPanelCollapsed:w,reevaluatePanelConstraints:P,registerPanel:F,resizePanel:z,unregisterPanel:$}=O,ne=bf(f),Z=S.useRef({callbacks:{onCollapse:y,onExpand:C,onResize:x},constraints:{collapsedSize:o,collapsible:s,defaultSize:c,maxSize:p,minSize:m},id:ne,idIsFromProps:f!==void 0,order:b});S.useRef({didLogMissingDefaultSizeWarning:!1}),Ni(()=>{const{callbacks:te,constraints:be}=Z.current,I={...be};Z.current.id=ne,Z.current.idIsFromProps=f!==void 0,Z.current.order=b,te.onCollapse=y,te.onExpand=C,te.onResize=x,be.collapsedSize=o,be.collapsible=s,be.defaultSize=c,be.maxSize=p,be.minSize=m,(I.collapsedSize!==be.collapsedSize||I.collapsible!==be.collapsible||I.maxSize!==be.maxSize||I.minSize!==be.minSize)&&P(Z.current,I)}),Ni(()=>{const te=Z.current;return F(te),()=>{$(te)}},[b,ne,F,$]),S.useImperativeHandle(d,()=>({collapse:()=>{R(Z.current)},expand:te=>{k(Z.current,te)},getId(){return ne},getSize(){return D(Z.current)},isCollapsed(){return w(Z.current)},isExpanded(){return!w(Z.current)},resize:te=>{z(Z.current,te)}}),[R,k,D,w,ne,z]);const xe=j(Z.current,c);return S.createElement(N,{...E,children:n,className:a,id:ne,style:{...xe,...A},[mt.groupId]:T,[mt.panel]:"",[mt.panelCollapsible]:s||void 0,[mt.panelId]:ne,[mt.panelSize]:parseFloat(""+xe.flexGrow).toFixed(1)})}const Ir=S.forwardRef((n,a)=>S.createElement(fb,{...n,forwardedRef:a}));fb.displayName="Panel";Ir.displayName="forwardRef(Panel)";let Ld=null,hl=-1,Ja=null;function lD(n,a,o){const s=(a&yb)!==0,c=(a&xb)!==0,d=(a&bb)!==0,f=(a&vb)!==0;if(a){if(s)return d?"se-resize":f?"ne-resize":"e-resize";if(c)return d?"sw-resize":f?"nw-resize":"w-resize";if(d)return"s-resize";if(f)return"n-resize"}switch(n){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function cD(){Ja!==null&&(document.head.removeChild(Ja),Ld=null,Ja=null,hl=-1)}function dd(n,a,o){var s,c;const d=lD(n,a);if(Ld!==d){if(Ld=d,Ja===null&&(Ja=document.createElement("style"),document.head.appendChild(Ja)),hl>=0){var f;(f=Ja.sheet)===null||f===void 0||f.removeRule(hl)}hl=(s=(c=Ja.sheet)===null||c===void 0?void 0:c.insertRule(`*{cursor: ${d} !important;}`))!==null&&s!==void 0?s:-1}}function hb(n){return n.type==="keydown"}function pb(n){return n.type.startsWith("pointer")}function mb(n){return n.type.startsWith("mouse")}function Il(n){if(pb(n)){if(n.isPrimary)return{x:n.clientX,y:n.clientY}}else if(mb(n))return{x:n.clientX,y:n.clientY};return{x:1/0,y:1/0}}function uD(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function dD(n,a,o){return n.x<a.x+a.width&&n.x+n.width>a.x&&n.y<a.y+a.height&&n.y+n.height>a.y}function fD(n,a){if(n===a)throw new Error("Cannot compare node with itself");const o={a:wy(n),b:wy(a)};let s;for(;o.a.at(-1)===o.b.at(-1);)n=o.a.pop(),a=o.b.pop(),s=n;Le(s,"Stacking order can only be calculated for elements with a common ancestor");const c={a:Sy(Cy(o.a)),b:Sy(Cy(o.b))};if(c.a===c.b){const d=s.childNodes,f={a:o.a.at(-1),b:o.b.at(-1)};let p=d.length;for(;p--;){const m=d[p];if(m===f.a)return 1;if(m===f.b)return-1}}return Math.sign(c.a-c.b)}const hD=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function pD(n){var a;const o=getComputedStyle((a=gb(n))!==null&&a!==void 0?a:n).display;return o==="flex"||o==="inline-flex"}function mD(n){const a=getComputedStyle(n);return!!(a.position==="fixed"||a.zIndex!=="auto"&&(a.position!=="static"||pD(n))||+a.opacity<1||"transform"in a&&a.transform!=="none"||"webkitTransform"in a&&a.webkitTransform!=="none"||"mixBlendMode"in a&&a.mixBlendMode!=="normal"||"filter"in a&&a.filter!=="none"||"webkitFilter"in a&&a.webkitFilter!=="none"||"isolation"in a&&a.isolation==="isolate"||hD.test(a.willChange)||a.webkitOverflowScrolling==="touch")}function Cy(n){let a=n.length;for(;a--;){const o=n[a];if(Le(o,"Missing node"),mD(o))return o}return null}function Sy(n){return n&&Number(getComputedStyle(n).zIndex)||0}function wy(n){const a=[];for(;n;)a.push(n),n=gb(n);return a}function gb(n){const{parentNode:a}=n;return a&&a instanceof ShadowRoot?a.host:a}const yb=1,xb=2,bb=4,vb=8,gD=uD()==="coarse";let En=[],vo=!1,ei=new Map,Ul=new Map;const Ur=new Set;function yD(n,a,o,s,c){var d;const{ownerDocument:f}=a,p={direction:o,element:a,hitAreaMargins:s,setResizeHandlerState:c},m=(d=ei.get(f))!==null&&d!==void 0?d:0;return ei.set(f,m+1),Ur.add(p),bl(),function(){var C;Ul.delete(n),Ur.delete(p);const x=(C=ei.get(f))!==null&&C!==void 0?C:1;if(ei.set(f,x-1),bl(),x===1&&ei.delete(f),En.includes(p)){const b=En.indexOf(p);b>=0&&En.splice(b,1),Hl(),c("up",!0,null)}}}function xD(n){const{target:a}=n,{x:o,y:s}=Il(n);vo=!0,vf({target:a,x:o,y:s}),bl(),En.length>0&&(vl("down",n),Hl(),n.preventDefault(),Cb(a)||n.stopImmediatePropagation())}function fd(n){const{x:a,y:o}=Il(n);if(vo&&n.type!=="pointerleave"&&n.buttons===0&&(vo=!1,vl("up",n)),!vo){const{target:s}=n;vf({target:s,x:a,y:o})}vl("move",n),Hl(),En.length>0&&n.preventDefault()}function hd(n){const{target:a}=n,{x:o,y:s}=Il(n);Ul.clear(),vo=!1,En.length>0&&(n.preventDefault(),Cb(a)||n.stopImmediatePropagation()),vl("up",n),vf({target:a,x:o,y:s}),Hl(),bl()}function Cb(n){let a=n;for(;a;){if(a.hasAttribute(mt.resizeHandle))return!0;a=a.parentElement}return!1}function vf({target:n,x:a,y:o}){En.splice(0);let s=null;(n instanceof HTMLElement||n instanceof SVGElement)&&(s=n),Ur.forEach(c=>{const{element:d,hitAreaMargins:f}=c,p=d.getBoundingClientRect(),{bottom:m,left:y,right:C,top:x}=p,b=gD?f.coarse:f.fine;if(a>=y-b&&a<=C+b&&o>=x-b&&o<=m+b){if(s!==null&&document.contains(s)&&d!==s&&!d.contains(s)&&!s.contains(d)&&fD(s,d)>0){let N=s,E=!1;for(;N&&!N.contains(d);){if(dD(N.getBoundingClientRect(),p)){E=!0;break}N=N.parentElement}if(E)return}En.push(c)}})}function pd(n,a){Ul.set(n,a)}function Hl(){let n=!1,a=!1;En.forEach(s=>{const{direction:c}=s;c==="horizontal"?n=!0:a=!0});let o=0;Ul.forEach(s=>{o|=s}),n&&a?dd("intersection",o):n?dd("horizontal",o):a?dd("vertical",o):cD()}let md;function bl(){var n;(n=md)===null||n===void 0||n.abort(),md=new AbortController;const a={capture:!0,signal:md.signal};Ur.size&&(vo?(En.length>0&&ei.forEach((o,s)=>{const{body:c}=s;o>0&&(c.addEventListener("contextmenu",hd,a),c.addEventListener("pointerleave",fd,a),c.addEventListener("pointermove",fd,a))}),ei.forEach((o,s)=>{const{body:c}=s;c.addEventListener("pointerup",hd,a),c.addEventListener("pointercancel",hd,a)})):ei.forEach((o,s)=>{const{body:c}=s;o>0&&(c.addEventListener("pointerdown",xD,a),c.addEventListener("pointermove",fd,a))}))}function vl(n,a){Ur.forEach(o=>{const{setResizeHandlerState:s}=o,c=En.includes(o);s(n,c,a)})}function bD(){const[n,a]=S.useState(0);return S.useCallback(()=>a(o=>o+1),[])}function Le(n,a){if(!n)throw console.error(a),Error(a)}function ji(n,a,o=xf){return n.toFixed(o)===a.toFixed(o)?0:n>a?1:-1}function ya(n,a,o=xf){return ji(n,a,o)===0}function dn(n,a,o){return ji(n,a,o)===0}function vD(n,a,o){if(n.length!==a.length)return!1;for(let s=0;s<n.length;s++){const c=n[s],d=a[s];if(!dn(c,d,o))return!1}return!0}function xo({panelConstraints:n,panelIndex:a,size:o}){const s=n[a];Le(s!=null,`Panel constraints not found for index ${a}`);let{collapsedSize:c=0,collapsible:d,maxSize:f=100,minSize:p=0}=s;if(ji(o,p)<0)if(d){const m=(c+p)/2;ji(o,m)<0?o=c:o=p}else o=p;return o=Math.min(f,o),o=parseFloat(o.toFixed(xf)),o}function jr({delta:n,initialLayout:a,panelConstraints:o,pivotIndices:s,prevLayout:c,trigger:d}){if(dn(n,0))return a;const f=[...a],[p,m]=s;Le(p!=null,"Invalid first pivot index"),Le(m!=null,"Invalid second pivot index");let y=0;if(d==="keyboard"){{const x=n<0?m:p,b=o[x];Le(b,`Panel constraints not found for index ${x}`);const{collapsedSize:A=0,collapsible:N,minSize:E=0}=b;if(N){const O=a[x];if(Le(O!=null,`Previous layout not found for panel index ${x}`),dn(O,A)){const R=E-O;ji(R,Math.abs(n))>0&&(n=n<0?0-R:R)}}}{const x=n<0?p:m,b=o[x];Le(b,`No panel constraints found for index ${x}`);const{collapsedSize:A=0,collapsible:N,minSize:E=0}=b;if(N){const O=a[x];if(Le(O!=null,`Previous layout not found for panel index ${x}`),dn(O,E)){const R=O-A;ji(R,Math.abs(n))>0&&(n=n<0?0-R:R)}}}}{const x=n<0?1:-1;let b=n<0?m:p,A=0;for(;;){const E=a[b];Le(E!=null,`Previous layout not found for panel index ${b}`);const R=xo({panelConstraints:o,panelIndex:b,size:100})-E;if(A+=R,b+=x,b<0||b>=o.length)break}const N=Math.min(Math.abs(n),Math.abs(A));n=n<0?0-N:N}{let b=n<0?p:m;for(;b>=0&&b<o.length;){const A=Math.abs(n)-Math.abs(y),N=a[b];Le(N!=null,`Previous layout not found for panel index ${b}`);const E=N-A,O=xo({panelConstraints:o,panelIndex:b,size:E});if(!dn(N,O)&&(y+=N-O,f[b]=O,y.toFixed(3).localeCompare(Math.abs(n).toFixed(3),void 0,{numeric:!0})>=0))break;n<0?b--:b++}}if(vD(c,f))return c;{const x=n<0?m:p,b=a[x];Le(b!=null,`Previous layout not found for panel index ${x}`);const A=b+y,N=xo({panelConstraints:o,panelIndex:x,size:A});if(f[x]=N,!dn(N,A)){let E=A-N,R=n<0?m:p;for(;R>=0&&R<o.length;){const k=f[R];Le(k!=null,`Previous layout not found for panel index ${R}`);const D=k+E,j=xo({panelConstraints:o,panelIndex:R,size:D});if(dn(k,j)||(E-=j-k,f[R]=j),dn(E,0))break;n>0?R--:R++}}}const C=f.reduce((x,b)=>b+x,0);return dn(C,100)?f:c}function CD({layout:n,panelsArray:a,pivotIndices:o}){let s=0,c=100,d=0,f=0;const p=o[0];Le(p!=null,"No pivot index found"),a.forEach((x,b)=>{const{constraints:A}=x,{maxSize:N=100,minSize:E=0}=A;b===p?(s=E,c=N):(d+=E,f+=N)});const m=Math.min(c,100-d),y=Math.max(s,100-f),C=n[p];return{valueMax:m,valueMin:y,valueNow:C}}function Hr(n,a=document){return Array.from(a.querySelectorAll(`[${mt.resizeHandleId}][data-panel-group-id="${n}"]`))}function Sb(n,a,o=document){const c=Hr(n,o).findIndex(d=>d.getAttribute(mt.resizeHandleId)===a);return c??null}function wb(n,a,o){const s=Sb(n,a,o);return s!=null?[s,s+1]:[-1,-1]}function SD(n){return n instanceof HTMLElement?!0:typeof n=="object"&&n!==null&&"tagName"in n&&"getAttribute"in n}function Nb(n,a=document){if(SD(a)&&a.dataset.panelGroupId==n)return a;const o=a.querySelector(`[data-panel-group][data-panel-group-id="${n}"]`);return o||null}function Bl(n,a=document){const o=a.querySelector(`[${mt.resizeHandleId}="${n}"]`);return o||null}function wD(n,a,o,s=document){var c,d,f,p;const m=Bl(a,s),y=Hr(n,s),C=m?y.indexOf(m):-1,x=(c=(d=o[C])===null||d===void 0?void 0:d.id)!==null&&c!==void 0?c:null,b=(f=(p=o[C+1])===null||p===void 0?void 0:p.id)!==null&&f!==void 0?f:null;return[x,b]}function ND({committedValuesRef:n,eagerValuesRef:a,groupId:o,layout:s,panelDataArray:c,panelGroupElement:d,setLayout:f}){S.useRef({didWarnAboutMissingResizeHandle:!1}),Ni(()=>{if(!d)return;const p=Hr(o,d);for(let m=0;m<c.length-1;m++){const{valueMax:y,valueMin:C,valueNow:x}=CD({layout:s,panelsArray:c,pivotIndices:[m,m+1]}),b=p[m];if(b!=null){const A=c[m];Le(A,`No panel data found for index "${m}"`),b.setAttribute("aria-controls",A.id),b.setAttribute("aria-valuemax",""+Math.round(y)),b.setAttribute("aria-valuemin",""+Math.round(C)),b.setAttribute("aria-valuenow",x!=null?""+Math.round(x):"")}}return()=>{p.forEach((m,y)=>{m.removeAttribute("aria-controls"),m.removeAttribute("aria-valuemax"),m.removeAttribute("aria-valuemin"),m.removeAttribute("aria-valuenow")})}},[o,s,c,d]),S.useEffect(()=>{if(!d)return;const p=a.current;Le(p,"Eager values not found");const{panelDataArray:m}=p,y=Nb(o,d);Le(y!=null,`No group found for id "${o}"`);const C=Hr(o,d);Le(C,`No resize handles found for group id "${o}"`);const x=C.map(b=>{const A=b.getAttribute(mt.resizeHandleId);Le(A,"Resize handle element has no handle id attribute");const[N,E]=wD(o,A,m,d);if(N==null||E==null)return()=>{};const O=R=>{if(!R.defaultPrevented)switch(R.key){case"Enter":{R.preventDefault();const k=m.findIndex(D=>D.id===N);if(k>=0){const D=m[k];Le(D,`No panel data found for index ${k}`);const j=s[k],{collapsedSize:T=0,collapsible:w,minSize:P=0}=D.constraints;if(j!=null&&w){const F=jr({delta:dn(j,T)?P-T:T-j,initialLayout:s,panelConstraints:m.map(z=>z.constraints),pivotIndices:wb(o,A,d),prevLayout:s,trigger:"keyboard"});s!==F&&f(F)}}break}}};return b.addEventListener("keydown",O),()=>{b.removeEventListener("keydown",O)}});return()=>{x.forEach(b=>b())}},[d,n,a,o,s,c,f])}function Ny(n,a){if(n.length!==a.length)return!1;for(let o=0;o<n.length;o++)if(n[o]!==a[o])return!1;return!0}function Ab(n,a){const o=n==="horizontal",{x:s,y:c}=Il(a);return o?s:c}function AD(n,a,o,s,c){const d=o==="horizontal",f=Bl(a,c);Le(f,`No resize handle element found for id "${a}"`);const p=f.getAttribute(mt.groupId);Le(p,"Resize handle element has no group id attribute");let{initialCursorPosition:m}=s;const y=Ab(o,n),C=Nb(p,c);Le(C,`No group element found for id "${p}"`);const x=C.getBoundingClientRect(),b=d?x.width:x.height;return(y-m)/b*100}function kD(n,a,o,s,c,d){if(hb(n)){const f=o==="horizontal";let p=0;n.shiftKey?p=100:c!=null?p=c:p=10;let m=0;switch(n.key){case"ArrowDown":m=f?0:p;break;case"ArrowLeft":m=f?-p:0;break;case"ArrowRight":m=f?p:0;break;case"ArrowUp":m=f?0:-p;break;case"End":m=100;break;case"Home":m=-100;break}return m}else return s==null?0:AD(n,a,o,s,d)}function DD({panelDataArray:n}){const a=Array(n.length),o=n.map(d=>d.constraints);let s=0,c=100;for(let d=0;d<n.length;d++){const f=o[d];Le(f,`Panel constraints not found for index ${d}`);const{defaultSize:p}=f;p!=null&&(s++,a[d]=p,c-=p)}for(let d=0;d<n.length;d++){const f=o[d];Le(f,`Panel constraints not found for index ${d}`);const{defaultSize:p}=f;if(p!=null)continue;const m=n.length-s,y=c/m;s++,a[d]=y,c-=y}return a}function go(n,a,o){a.forEach((s,c)=>{const d=n[c];Le(d,`Panel data not found for index ${c}`);const{callbacks:f,constraints:p,id:m}=d,{collapsedSize:y=0,collapsible:C}=p,x=o[m];if(x==null||s!==x){o[m]=s;const{onCollapse:b,onExpand:A,onResize:N}=f;N&&N(s,x),C&&(b||A)&&(A&&(x==null||ya(x,y))&&!ya(s,y)&&A(),b&&(x==null||!ya(x,y))&&ya(s,y)&&b())}})}function ll(n,a){if(n.length!==a.length)return!1;for(let o=0;o<n.length;o++)if(n[o]!=a[o])return!1;return!0}function jD({defaultSize:n,dragState:a,layout:o,panelData:s,panelIndex:c,precision:d=3}){const f=o[c];let p;return f==null?p=n!=null?n.toFixed(d):"1":s.length===1?p="1":p=f.toFixed(d),{flexBasis:0,flexGrow:p,flexShrink:1,overflow:"hidden",pointerEvents:a!==null?"none":void 0}}function TD(n,a=10){let o=null;return(...c)=>{o!==null&&clearTimeout(o),o=setTimeout(()=>{n(...c)},a)}}function Ay(n){try{if(typeof localStorage<"u")n.getItem=a=>localStorage.getItem(a),n.setItem=(a,o)=>{localStorage.setItem(a,o)};else throw new Error("localStorage not supported in this environment")}catch(a){console.error(a),n.getItem=()=>null,n.setItem=()=>{}}}function kb(n){return`react-resizable-panels:${n}`}function Db(n){return n.map(a=>{const{constraints:o,id:s,idIsFromProps:c,order:d}=a;return c?s:d?`${d}:${JSON.stringify(o)}`:JSON.stringify(o)}).sort((a,o)=>a.localeCompare(o)).join(",")}function jb(n,a){try{const o=kb(n),s=a.getItem(o);if(s){const c=JSON.parse(s);if(typeof c=="object"&&c!=null)return c}}catch{}return null}function MD(n,a,o){var s,c;const d=(s=jb(n,o))!==null&&s!==void 0?s:{},f=Db(a);return(c=d[f])!==null&&c!==void 0?c:null}function ED(n,a,o,s,c){var d;const f=kb(n),p=Db(a),m=(d=jb(n,c))!==null&&d!==void 0?d:{};m[p]={expandToSizes:Object.fromEntries(o.entries()),layout:s};try{c.setItem(f,JSON.stringify(m))}catch(y){console.error(y)}}function ky({layout:n,panelConstraints:a}){const o=[...n],s=o.reduce((d,f)=>d+f,0);if(o.length!==a.length)throw Error(`Invalid ${a.length} panel layout: ${o.map(d=>`${d}%`).join(", ")}`);if(!dn(s,100)&&o.length>0)for(let d=0;d<a.length;d++){const f=o[d];Le(f!=null,`No layout data found for index ${d}`);const p=100/s*f;o[d]=p}let c=0;for(let d=0;d<a.length;d++){const f=o[d];Le(f!=null,`No layout data found for index ${d}`);const p=xo({panelConstraints:a,panelIndex:d,size:f});f!=p&&(c+=f-p,o[d]=p)}if(!dn(c,0))for(let d=0;d<a.length;d++){const f=o[d];Le(f!=null,`No layout data found for index ${d}`);const p=f+c,m=xo({panelConstraints:a,panelIndex:d,size:p});if(f!==m&&(c-=m-f,o[d]=m,dn(c,0)))break}return o}const OD=100,Tr={getItem:n=>(Ay(Tr),Tr.getItem(n)),setItem:(n,a)=>{Ay(Tr),Tr.setItem(n,a)}},Dy={};function Tb({autoSaveId:n=null,children:a,className:o="",direction:s,forwardedRef:c,id:d=null,onLayout:f=null,keyboardResizeBy:p=null,storage:m=Tr,style:y,tagName:C="div",...x}){const b=bf(d),A=S.useRef(null),[N,E]=S.useState(null),[O,R]=S.useState([]),k=bD(),D=S.useRef({}),j=S.useRef(new Map),T=S.useRef(0),w=S.useRef({autoSaveId:n,direction:s,dragState:N,id:b,keyboardResizeBy:p,onLayout:f,storage:m}),P=S.useRef({layout:O,panelDataArray:[],panelDataArrayChanged:!1});S.useRef({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),S.useImperativeHandle(c,()=>({getId:()=>w.current.id,getLayout:()=>{const{layout:H}=P.current;return H},setLayout:H=>{const{onLayout:Q}=w.current,{layout:ie,panelDataArray:ae}=P.current,oe=ky({layout:H,panelConstraints:ae.map(ge=>ge.constraints)});Ny(ie,oe)||(R(oe),P.current.layout=oe,Q&&Q(oe),go(ae,oe,D.current))}}),[]),Ni(()=>{w.current.autoSaveId=n,w.current.direction=s,w.current.dragState=N,w.current.id=b,w.current.onLayout=f,w.current.storage=m}),ND({committedValuesRef:w,eagerValuesRef:P,groupId:b,layout:O,panelDataArray:P.current.panelDataArray,setLayout:R,panelGroupElement:A.current}),S.useEffect(()=>{const{panelDataArray:H}=P.current;if(n){if(O.length===0||O.length!==H.length)return;let Q=Dy[n];Q==null&&(Q=TD(ED,OD),Dy[n]=Q);const ie=[...H],ae=new Map(j.current);Q(n,ie,ae,O,m)}},[n,O,m]),S.useEffect(()=>{});const F=S.useCallback(H=>{const{onLayout:Q}=w.current,{layout:ie,panelDataArray:ae}=P.current;if(H.constraints.collapsible){const oe=ae.map(st=>st.constraints),{collapsedSize:ge=0,panelSize:De,pivotIndices:Ue}=Si(ae,H,ie);if(Le(De!=null,`Panel size not found for panel "${H.id}"`),!ya(De,ge)){j.current.set(H.id,De);const gt=yo(ae,H)===ae.length-1?De-ge:ge-De,qe=jr({delta:gt,initialLayout:ie,panelConstraints:oe,pivotIndices:Ue,prevLayout:ie,trigger:"imperative-api"});ll(ie,qe)||(R(qe),P.current.layout=qe,Q&&Q(qe),go(ae,qe,D.current))}}},[]),z=S.useCallback((H,Q)=>{const{onLayout:ie}=w.current,{layout:ae,panelDataArray:oe}=P.current;if(H.constraints.collapsible){const ge=oe.map(lt=>lt.constraints),{collapsedSize:De=0,panelSize:Ue=0,minSize:st=0,pivotIndices:gt}=Si(oe,H,ae),qe=Q??st;if(ya(Ue,De)){const lt=j.current.get(H.id),Bt=lt!=null&&lt>=qe?lt:qe,Yn=yo(oe,H)===oe.length-1?Ue-Bt:Bt-Ue,je=jr({delta:Yn,initialLayout:ae,panelConstraints:ge,pivotIndices:gt,prevLayout:ae,trigger:"imperative-api"});ll(ae,je)||(R(je),P.current.layout=je,ie&&ie(je),go(oe,je,D.current))}}},[]),$=S.useCallback(H=>{const{layout:Q,panelDataArray:ie}=P.current,{panelSize:ae}=Si(ie,H,Q);return Le(ae!=null,`Panel size not found for panel "${H.id}"`),ae},[]),ne=S.useCallback((H,Q)=>{const{panelDataArray:ie}=P.current,ae=yo(ie,H);return jD({defaultSize:Q,dragState:N,layout:O,panelData:ie,panelIndex:ae})},[N,O]),Z=S.useCallback(H=>{const{layout:Q,panelDataArray:ie}=P.current,{collapsedSize:ae=0,collapsible:oe,panelSize:ge}=Si(ie,H,Q);return Le(ge!=null,`Panel size not found for panel "${H.id}"`),oe===!0&&ya(ge,ae)},[]),xe=S.useCallback(H=>{const{layout:Q,panelDataArray:ie}=P.current,{collapsedSize:ae=0,collapsible:oe,panelSize:ge}=Si(ie,H,Q);return Le(ge!=null,`Panel size not found for panel "${H.id}"`),!oe||ji(ge,ae)>0},[]),te=S.useCallback(H=>{const{panelDataArray:Q}=P.current;Q.push(H),Q.sort((ie,ae)=>{const oe=ie.order,ge=ae.order;return oe==null&&ge==null?0:oe==null?-1:ge==null?1:oe-ge}),P.current.panelDataArrayChanged=!0,k()},[k]);Ni(()=>{if(P.current.panelDataArrayChanged){P.current.panelDataArrayChanged=!1;const{autoSaveId:H,onLayout:Q,storage:ie}=w.current,{layout:ae,panelDataArray:oe}=P.current;let ge=null;if(H){const Ue=MD(H,oe,ie);Ue&&(j.current=new Map(Object.entries(Ue.expandToSizes)),ge=Ue.layout)}ge==null&&(ge=DD({panelDataArray:oe}));const De=ky({layout:ge,panelConstraints:oe.map(Ue=>Ue.constraints)});Ny(ae,De)||(R(De),P.current.layout=De,Q&&Q(De),go(oe,De,D.current))}}),Ni(()=>{const H=P.current;return()=>{H.layout=[]}},[]);const be=S.useCallback(H=>{let Q=!1;const ie=A.current;return ie&&window.getComputedStyle(ie,null).getPropertyValue("direction")==="rtl"&&(Q=!0),function(oe){oe.preventDefault();const ge=A.current;if(!ge)return()=>null;const{direction:De,dragState:Ue,id:st,keyboardResizeBy:gt,onLayout:qe}=w.current,{layout:lt,panelDataArray:Bt}=P.current,{initialLayout:Xt}=Ue??{},Yn=wb(st,H,ge);let je=kD(oe,H,De,Ue,gt,ge);const Zt=De==="horizontal";Zt&&Q&&(je=-je);const Pn=Bt.map($n=>$n.constraints),Jt=jr({delta:je,initialLayout:Xt??lt,panelConstraints:Pn,pivotIndices:Yn,prevLayout:lt,trigger:hb(oe)?"keyboard":"mouse-or-touch"}),ka=!ll(lt,Jt);(pb(oe)||mb(oe))&&T.current!=je&&(T.current=je,!ka&&je!==0?Zt?pd(H,je<0?yb:xb):pd(H,je<0?bb:vb):pd(H,0)),ka&&(R(Jt),P.current.layout=Jt,qe&&qe(Jt),go(Bt,Jt,D.current))}},[]),I=S.useCallback((H,Q)=>{const{onLayout:ie}=w.current,{layout:ae,panelDataArray:oe}=P.current,ge=oe.map(lt=>lt.constraints),{panelSize:De,pivotIndices:Ue}=Si(oe,H,ae);Le(De!=null,`Panel size not found for panel "${H.id}"`);const gt=yo(oe,H)===oe.length-1?De-Q:Q-De,qe=jr({delta:gt,initialLayout:ae,panelConstraints:ge,pivotIndices:Ue,prevLayout:ae,trigger:"imperative-api"});ll(ae,qe)||(R(qe),P.current.layout=qe,ie&&ie(qe),go(oe,qe,D.current))},[]),X=S.useCallback((H,Q)=>{const{layout:ie,panelDataArray:ae}=P.current,{collapsedSize:oe=0,collapsible:ge}=Q,{collapsedSize:De=0,collapsible:Ue,maxSize:st=100,minSize:gt=0}=H.constraints,{panelSize:qe}=Si(ae,H,ie);qe!=null&&(ge&&Ue&&ya(qe,oe)?ya(oe,De)||I(H,De):qe<gt?I(H,gt):qe>st&&I(H,st))},[I]),ee=S.useCallback((H,Q)=>{const{direction:ie}=w.current,{layout:ae}=P.current;if(!A.current)return;const oe=Bl(H,A.current);Le(oe,`Drag handle element not found for id "${H}"`);const ge=Ab(ie,Q);E({dragHandleId:H,dragHandleRect:oe.getBoundingClientRect(),initialCursorPosition:ge,initialLayout:ae})},[]),re=S.useCallback(()=>{E(null)},[]),fe=S.useCallback(H=>{const{panelDataArray:Q}=P.current,ie=yo(Q,H);ie>=0&&(Q.splice(ie,1),delete D.current[H.id],P.current.panelDataArrayChanged=!0,k())},[k]),he=S.useMemo(()=>({collapsePanel:F,direction:s,dragState:N,expandPanel:z,getPanelSize:$,getPanelStyle:ne,groupId:b,isPanelCollapsed:Z,isPanelExpanded:xe,reevaluatePanelConstraints:X,registerPanel:te,registerResizeHandle:be,resizePanel:I,startDragging:ee,stopDragging:re,unregisterPanel:fe,panelGroupElement:A.current}),[F,N,s,z,$,ne,b,Z,xe,X,te,be,I,ee,re,fe]),de={display:"flex",flexDirection:s==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return S.createElement(zl.Provider,{value:he},S.createElement(C,{...x,children:a,className:o,id:d,ref:A,style:{...de,...y},[mt.group]:"",[mt.groupDirection]:s,[mt.groupId]:b}))}const Cf=S.forwardRef((n,a)=>S.createElement(Tb,{...n,forwardedRef:a}));Tb.displayName="PanelGroup";Cf.displayName="forwardRef(PanelGroup)";function yo(n,a){return n.findIndex(o=>o===a||o.id===a.id)}function Si(n,a,o){const s=yo(n,a),d=s===n.length-1?[s-1,s]:[s,s+1],f=o[s];return{...a.constraints,panelSize:f,pivotIndices:d}}function PD({disabled:n,handleId:a,resizeHandler:o,panelGroupElement:s}){S.useEffect(()=>{if(n||o==null||s==null)return;const c=Bl(a,s);if(c==null)return;const d=f=>{if(!f.defaultPrevented)switch(f.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{f.preventDefault(),o(f);break}case"F6":{f.preventDefault();const p=c.getAttribute(mt.groupId);Le(p,`No group element found for id "${p}"`);const m=Hr(p,s),y=Sb(p,a,s);Le(y!==null,`No resize element found for id "${a}"`);const C=f.shiftKey?y>0?y-1:m.length-1:y+1<m.length?y+1:0;m[C].focus();break}}};return c.addEventListener("keydown",d),()=>{c.removeEventListener("keydown",d)}},[s,n,a,o])}function Sf({children:n=null,className:a="",disabled:o=!1,hitAreaMargins:s,id:c,onBlur:d,onClick:f,onDragging:p,onFocus:m,onPointerDown:y,onPointerUp:C,style:x={},tabIndex:b=0,tagName:A="div",...N}){var E,O;const R=S.useRef(null),k=S.useRef({onClick:f,onDragging:p,onPointerDown:y,onPointerUp:C});S.useEffect(()=>{k.current.onClick=f,k.current.onDragging=p,k.current.onPointerDown=y,k.current.onPointerUp=C});const D=S.useContext(zl);if(D===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:j,groupId:T,registerResizeHandle:w,startDragging:P,stopDragging:F,panelGroupElement:z}=D,$=bf(c),[ne,Z]=S.useState("inactive"),[xe,te]=S.useState(!1),[be,I]=S.useState(null),X=S.useRef({state:ne});Ni(()=>{X.current.state=ne}),S.useEffect(()=>{if(o)I(null);else{const he=w($);I(()=>he)}},[o,$,w]);const ee=(E=s?.coarse)!==null&&E!==void 0?E:15,re=(O=s?.fine)!==null&&O!==void 0?O:5;S.useEffect(()=>{if(o||be==null)return;const he=R.current;Le(he,"Element ref not attached");let de=!1;return yD($,he,j,{coarse:ee,fine:re},(Q,ie,ae)=>{if(!ie){Z("inactive");return}switch(Q){case"down":{Z("drag"),de=!1,Le(ae,'Expected event to be defined for "down" action'),P($,ae);const{onDragging:oe,onPointerDown:ge}=k.current;oe?.(!0),ge?.();break}case"move":{const{state:oe}=X.current;de=!0,oe!=="drag"&&Z("hover"),Le(ae,'Expected event to be defined for "move" action'),be(ae);break}case"up":{Z("hover"),F();const{onClick:oe,onDragging:ge,onPointerUp:De}=k.current;ge?.(!1),De?.(),de||oe?.();break}}})},[ee,j,o,re,w,$,be,P,F]),PD({disabled:o,handleId:$,resizeHandler:be,panelGroupElement:z});const fe={touchAction:"none",userSelect:"none"};return S.createElement(A,{...N,children:n,className:a,id:c,onBlur:()=>{te(!1),d?.()},onFocus:()=>{te(!0),m?.()},ref:R,role:"separator",style:{...fe,...x},tabIndex:b,[mt.groupDirection]:j,[mt.groupId]:T,[mt.resizeHandle]:"",[mt.resizeHandleActive]:ne==="drag"?"pointer":xe?"keyboard":void 0,[mt.resizeHandleEnabled]:!o,[mt.resizeHandleId]:$,[mt.resizeHandleState]:ne})}Sf.displayName="PanelResizeHandle";const Ao=S.forwardRef(({className:n,children:a,...o},s)=>l.jsxs(yx,{ref:s,className:K("relative overflow-hidden",n),...o,children:[l.jsx(QC,{className:"h-full w-full rounded-[inherit]",children:a}),l.jsx(Mb,{}),l.jsx(WC,{})]}));Ao.displayName=yx.displayName;const Mb=S.forwardRef(({className:n,orientation:a="vertical",...o},s)=>l.jsx(xx,{ref:s,orientation:a,className:K("flex touch-none select-none transition-colors",a==="vertical"&&"h-full w-2.5 border-l border-l-transparent p-[1px]",a==="horizontal"&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",n),...o,children:l.jsx(XC,{className:"relative flex-1 rounded-full bg-border"})}));Mb.displayName=xx.displayName;function LD(n){const a={provider:"unknown",endpoint:"unknown",timestamp:new Date,raw:n},o=n.match(/error-api-provider-([^-]+)-/);o&&(a.provider=o[1]);const s=n.match(/error-api-provider-[^-]+-(.+?)-\d{4}-\d{2}-\d{2}T/);s&&(a.endpoint=s[1].replace(/-/g,"/"));const c=n.match(/(\d{4}-\d{2}-\d{2}T\d{6})/);if(c){const d=c[1],f=`${d.slice(0,10)}T${d.slice(11,13)}:${d.slice(13,15)}:${d.slice(15,17)}`;a.timestamp=new Date(f)}return a}function RD(n){const a={version:"",url:"",method:"",timestamp:"",statusCode:0,statusText:"",requestHeaders:{},requestBody:"",responseHeaders:{},responseBody:"",provider:"",endpoint:"",isClientError:!1,isServerError:!1,errorType:"unknown",model:null,quotaResetDelay:null,quotaResetTimestamp:null},o=n.split(/^===\s*(.+?)\s*===$/m);let s="";for(let c=0;c<o.length;c++){const d=o[c].trim();if(d==="REQUEST INFO"){s="request_info";continue}else if(d==="HEADERS"){s="headers";continue}else if(d==="REQUEST BODY"){s="request_body";continue}else if(d==="API RESPONSE"){s="";continue}else if(d==="RESPONSE"){s="response";continue}switch(s){case"request_info":_D(d,a);break;case"headers":a.requestHeaders=zD(d);break;case"request_body":a.requestBody=d;break;case"response":ID(d,a);break}}return UD(a),a}function _D(n,a){const o=n.split(`
11
- `);for(const s of o){const[c,...d]=s.split(":"),f=d.join(":").trim();switch(c?.trim()?.toLowerCase()){case"version":a.version=f;break;case"url":a.url=f;break;case"method":a.method=f;break;case"timestamp":a.timestamp=f;break}}}function zD(n){const a={},o=n.split(`
12
- `);for(const s of o){const c=s.indexOf(":");if(c>0){const d=s.slice(0,c).trim(),f=s.slice(c+1).trim();d&&(a[d]=f)}}return a}function ID(n,a){const o=n.split(`
13
- `);let s=!1;const c=[];for(const d of o){if(d.startsWith("Status:")){const p=d.replace("Status:","").trim().split(/\s+/);a.statusCode=parseInt(p[0],10)||0,a.statusText=p.slice(1).join(" ")||KD(a.statusCode);continue}if(d.trim()===""&&!s){s=!0;continue}if(s)c.push(d);else{const f=d.indexOf(":");if(f>0){const p=d.slice(0,f).trim(),m=d.slice(f+1).trim();p&&(a.responseHeaders[p]=m)}}}a.responseBody=c.join(`
14
- `).trim()}function UD(n){const a=n.url.match(/\/api\/provider\/([^/]+)/);a&&(n.provider=a[1]);const o=n.url.match(/\/api\/provider\/[^/]+\/(.+?)(?:\?|$)/);o&&(n.endpoint=o[1]),n.isClientError=n.statusCode>=400&&n.statusCode<500,n.isServerError=n.statusCode>=500,n.statusCode===429?n.errorType="rate_limit":n.statusCode===401||n.statusCode===403?n.errorType="auth":n.statusCode===404?n.errorType="not_found":n.statusCode>=500?n.errorType="server":(n.statusCode===408||n.statusCode===504)&&(n.errorType="timeout"),HD(n),n.statusCode===429&&BD(n)}function HD(n){if(n.requestBody)try{const a=JSON.parse(n.requestBody);typeof a.model=="string"&&(n.model=a.model)}catch{}}function BD(n){if(n.responseBody)try{const a=JSON.parse(n.responseBody),o=Rd(a);o!==null&&(n.quotaResetDelay=o);const s=_d(a);s&&(n.quotaResetTimestamp=s)}catch{}}function Rd(n){if(typeof n!="object"||n===null)return null;const a=n;if("quotaResetDelay"in a){const o=a.quotaResetDelay;if(typeof o=="number")return o;if(typeof o=="string"){const s=o.match(/^(\d+)s?$/);if(s)return parseInt(s[1],10)}}if("error"in a&&typeof a.error=="object"){const o=Rd(a.error);if(o!==null)return o}if("details"in a&&Array.isArray(a.details))for(const o of a.details){const s=Rd(o);if(s!==null)return s}return null}function _d(n){if(typeof n!="object"||n===null)return null;const a=n;for(const o of["quotaResetTimeStamp","quotaResetTimestamp","resetTime","reset_time"])if(o in a&&typeof a[o]=="string")return a[o];if("error"in a&&typeof a.error=="object"){const o=_d(a.error);if(o)return o}if("details"in a&&Array.isArray(a.details))for(const o of a.details){const s=_d(o);if(s)return s}return null}function KD(n){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"}[n]||""}function qD(n,a){const o=$d(),s=o==="zh-CN",c=o==="vi",d=Date.now(),f=n*1e3,p=d-f,m=Math.floor(p/1e3),y=Math.floor(m/60),C=Math.floor(y/60),x=Math.floor(C/24);return m<60?s?"刚刚":c?"vừa xong":"just now":y<60?s?`${y} 分钟前`:c?`${y} phút trước`:`${y}m ago`:C<24?s?`${C} 小时前`:c?`${C} giờ trước`:`${C}h ago`:x<7?s?`${x} 天前`:c?`${x} ngày trước`:`${x}d ago`:new Date(f).toLocaleDateString(o,{month:"short",day:"numeric"})}function FD(n){return n>=500?"text-red-500":n===429?"text-orange-500":n>=400?"text-yellow-500":"text-gray-500"}function GD(n,a){const o=$d();return o==="zh-CN"?{rate_limit:"限流",auth:"认证错误",not_found:"未找到",server:"服务错误",timeout:"超时",unknown:"错误"}[n]||"错误":o==="vi"?{rate_limit:"Quá giới hạn",auth:"Lỗi xác thực",not_found:"Không tìm thấy",server:"Lỗi máy chủ",timeout:"Hết thời gian chờ",unknown:"Lỗi"}[n]||"Lỗi":{rate_limit:"Rate Limited",auth:"Auth Error",not_found:"Not Found",server:"Server Error",timeout:"Timeout",unknown:"Error"}[n]||"Error"}function VD(n){if(n===null||n<=0)return null;if(n<60)return`${n}s`;if(n<3600)return`${Math.floor(n/60)}m`;const a=Math.floor(n/3600),o=Math.floor(n%3600/60);return o>0?`${a}h ${o}m`:`${a}h`}function YD(n,a){if(!n)return null;const o=$d(),s=o==="zh-CN",c=o==="vi";try{const d=new Date(n),f=new Date,p=d.getTime()-f.getTime();if(p<=0)return s?"现在":c?"bây giờ":"now";const m=Math.floor(p/1e3);if(m<60)return s?`${m}秒`:c?`${m} giây`:`${m}s`;if(m<3600){const x=Math.floor(m/60);return s?`${x}分钟`:c?`${x} phút`:`${x}m`}const y=Math.floor(m/3600),C=Math.floor(m%3600/60);return s?C>0?`${y}小时 ${C}分钟`:`${y}小时`:c?C>0?`${y} giờ ${C} phút`:`${y} giờ`:C>0?`${y}h ${C}m`:`${y}h`}catch{return null}}function $D(n){return n?n===429?"bg-amber-100 text-amber-700 dark:bg-amber-900/30 dark:text-amber-400":n>=500?"bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400":n>=400?"bg-orange-100 text-orange-700 dark:bg-orange-900/30 dark:text-orange-400":"bg-gray-100 text-gray-600":"bg-gray-100 text-gray-600"}function QD(n){return n||""}function WD({name:n,size:a,modified:o,isSelected:s,onClick:c,statusCode:d,model:f}){const p=S.useMemo(()=>LD(n),[n]),m=S.useMemo(()=>QD(f),[f]);return l.jsxs("button",{onClick:c,className:K("w-full px-2.5 py-2 flex items-center gap-2 text-left transition-colors","hover:bg-muted/40 border-l-[3px]",s?"bg-muted/50 border-l-red-500":"border-l-transparent"),children:[l.jsx("span",{className:K("shrink-0 text-[10px] font-bold px-1.5 py-0.5 rounded min-w-[32px] text-center",$D(d)),children:d||"???"}),l.jsx(yf,{provider:p.provider,size:18,withBackground:!0,className:"shrink-0"}),l.jsxs("div",{className:"flex-1 min-w-0 flex flex-col",children:[l.jsx("span",{className:"text-[11px] font-medium text-foreground truncate",children:p.endpoint||"unknown"}),m&&l.jsx("span",{className:"text-[10px] text-muted-foreground truncate",title:m,children:m}),l.jsxs("div",{className:"flex items-center gap-1 text-[9px] text-muted-foreground/60",children:[l.jsx(So,{className:"w-2.5 h-2.5"}),l.jsx("span",{children:qD(o)})]})]})]})}function jy({value:n,className:a,variant:o="outline",size:s="icon",label:c="Copy to clipboard"}){const[d,f]=S.useState(!1),p=()=>{navigator.clipboard.writeText(n),f(!0),setTimeout(()=>f(!1),2e3)};return l.jsx(Di,{children:l.jsxs(Sa,{children:[l.jsx(wa,{asChild:!0,children:l.jsxs(dt,{size:s,variant:o,className:K("relative z-10 text-muted-foreground hover:text-foreground",a),onClick:m=>{m.stopPropagation(),p()},children:[d?l.jsx(Co,{className:"h-3.5 w-3.5 text-green-500"}):l.jsx(ml,{className:"h-3.5 w-3.5"}),l.jsx("span",{className:"sr-only",children:c})]})}),l.jsx(Na,{children:l.jsx("p",{children:d?"Copied!":c})})]})})}function Nr({active:n,onClick:a,children:o,icon:s}){return l.jsxs("button",{onClick:a,className:K("px-2.5 py-1.5 text-xs font-medium rounded transition-colors flex items-center gap-1.5",n?"bg-primary/15 text-primary":"text-muted-foreground hover:bg-muted/50 hover:text-foreground"),children:[s&&l.jsx(s,{className:"w-3.5 h-3.5"}),o]})}function Eb({code:n}){const a=FD(n);return l.jsx("span",{className:K("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",a),children:n})}function XD({parsed:n}){const{t:a}=Mt(),o=VD(n.quotaResetDelay)||YD(n.quotaResetTimestamp),s=a("errorLogs.na");return l.jsx(Ao,{className:"h-full",children:l.jsxs("div",{className:"p-4 space-y-4",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Eb,{code:n.statusCode}),l.jsx("span",{className:"text-sm font-medium",children:n.statusText}),l.jsx("span",{className:"text-xs text-muted-foreground px-2 py-0.5 rounded bg-muted/50",children:GD(n.errorType)})]}),n.model&&l.jsxs("div",{className:"flex items-center gap-2.5 p-3 rounded-lg bg-violet-500/10 border border-violet-500/20",children:[l.jsx(RS,{className:"w-4 h-4 text-violet-500 shrink-0"}),l.jsxs("div",{className:"text-sm",children:[l.jsx("span",{className:"text-muted-foreground",children:a("errorLogs.modelLabel")}),l.jsx("span",{className:"font-semibold text-violet-600 dark:text-violet-400",children:n.model})]})]}),n.errorType==="rate_limit"&&o&&l.jsxs("div",{className:"flex items-center gap-2.5 p-3 rounded-lg bg-amber-500/10 border border-amber-500/20",children:[l.jsx(So,{className:"w-4 h-4 text-amber-500 shrink-0"}),l.jsxs("div",{className:"text-sm",children:[l.jsx("span",{className:"text-muted-foreground",children:a("errorLogs.quotaResetsIn")}),l.jsx("span",{className:"font-semibold text-amber-600 dark:text-amber-400",children:o})]})]}),l.jsxs("div",{className:"grid grid-cols-4 gap-3 text-xs",children:[l.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[l.jsx("div",{className:"text-muted-foreground mb-1",children:a("errorLogs.method")}),l.jsx("div",{className:"font-medium",children:n.method||s})]}),l.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[l.jsx("div",{className:"text-muted-foreground mb-1",children:a("errorLogs.provider")}),l.jsx("div",{className:"font-medium",children:n.provider||s})]}),l.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[l.jsx("div",{className:"text-muted-foreground mb-1",children:a("errorLogs.version")}),l.jsx("div",{className:"font-medium",children:n.version||s})]}),l.jsxs("div",{className:"p-2.5 rounded bg-muted/30 border border-border/50",children:[l.jsx("div",{className:"text-muted-foreground mb-1",children:a("errorLogs.endpoint")}),l.jsx("div",{className:"font-medium truncate",title:n.endpoint,children:n.endpoint||s})]})]}),l.jsxs("div",{className:"text-xs",children:[l.jsx("div",{className:"text-muted-foreground mb-1.5",children:a("errorLogs.url")}),l.jsx("div",{className:"font-mono p-2.5 rounded bg-muted/30 border border-border/50 break-all leading-relaxed",children:n.url||s})]}),l.jsxs("div",{className:"text-xs",children:[l.jsx("div",{className:"text-muted-foreground mb-1.5",children:a("errorLogs.timestamp")}),l.jsx("div",{className:"font-mono",children:n.timestamp||s})]}),n.errorType!=="unknown"&&l.jsxs("div",{className:K("flex items-start gap-3 p-3 rounded text-xs",n.errorType==="rate_limit"?"bg-amber-500/10 border border-amber-500/20":n.errorType==="auth"?"bg-red-500/10 border border-red-500/20":"bg-blue-500/10 border border-blue-500/20"),children:[n.errorType==="rate_limit"?l.jsx(Gn,{className:"w-4 h-4 mt-0.5 text-amber-500 shrink-0"}):n.errorType==="auth"?l.jsx(Gn,{className:"w-4 h-4 mt-0.5 text-red-500 shrink-0"}):l.jsx(Tl,{className:"w-4 h-4 mt-0.5 text-blue-500 shrink-0"}),l.jsxs("div",{className:K("leading-relaxed",n.errorType==="rate_limit"?"text-amber-600 dark:text-amber-400":n.errorType==="auth"?"text-red-600 dark:text-red-400":"text-blue-600 dark:text-blue-400"),children:[n.errorType==="rate_limit"&&(n.model?a("errorLogs.rateLimitedMsg",{model:n.model}):a("errorLogs.rateLimitedMsgNoModel")),n.errorType==="auth"&&a("errorLogs.authFailedMsg"),n.errorType==="not_found"&&a("errorLogs.notFoundMsg"),n.errorType==="server"&&a("errorLogs.serverErrorMsg"),n.errorType==="timeout"&&a("errorLogs.timeoutMsg")]})]})]})})}function ZD({headers:n}){const a=Object.entries(n);return a.length===0?l.jsx("div",{className:"p-4 text-xs text-muted-foreground",children:"No headers available"}):l.jsx(Ao,{className:"h-full",children:l.jsx("div",{className:"p-4 space-y-1",children:a.map(([o,s])=>l.jsxs("div",{className:"flex gap-3 text-xs font-mono py-1.5 border-b border-border/30 last:border-0",children:[l.jsxs("span",{className:"text-muted-foreground shrink-0 min-w-[140px]",children:[o,":"]}),l.jsx("span",{className:"break-all",children:s})]},o))})})}function Ty({content:n,label:a}){const{t:o}=Mt();if(!n||n.trim()===""){const d=a==="Request"?"errorLogs.noRequestBody":"errorLogs.noResponseBody";return l.jsx("div",{className:"p-4 text-xs text-muted-foreground",children:o(d)})}let s=n,c=!1;try{const d=JSON.parse(n);s=JSON.stringify(d,null,2),c=!0}catch{}return l.jsx(Ao,{className:"h-full",children:l.jsx("pre",{className:K("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:s})})}function JD({content:n}){return l.jsx(Ao,{className:"h-full",children:l.jsx("pre",{className:"p-4 text-xs font-mono text-zinc-700 dark:text-muted-foreground whitespace-pre-wrap break-all leading-relaxed",children:n})})}function ej({name:n,absolutePath:a}){const{t:o}=Mt(),[s,c]=S.useState("overview"),{data:d,isLoading:f,error:p}=Dk(n),m=S.useMemo(()=>d?RD(d):null,[d]);return n?f?l.jsxs("div",{className:"flex-1 p-6 space-y-3",children:[l.jsx(Ye,{className:"h-5 w-full"}),l.jsx(Ye,{className:"h-5 w-3/4"}),l.jsx(Ye,{className:"h-5 w-5/6"}),l.jsx(Ye,{className:"h-5 w-2/3"})]}):p||!d||!m?l.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:l.jsx("p",{className:"text-sm",children:o("errorLogs.failedLoadContent")})}):l.jsxs("div",{className:"flex-1 flex flex-col min-w-0 h-full",children:[l.jsxs("div",{className:"px-4 py-3 border-b border-border bg-muted/30 flex items-center justify-between gap-3 shrink-0",children:[l.jsxs("div",{className:"flex items-center gap-3 min-w-0 flex-1",children:[l.jsx(Eb,{code:m.statusCode}),l.jsxs("span",{className:"text-xs font-semibold truncate text-foreground",children:[m.provider,"/",m.endpoint||"unknown"]}),n&&l.jsx(jy,{value:a||n,label:o("errorLogs.copyAbsolutePath"),size:"icon-sm",className:"ml-1 text-muted-foreground hover:text-foreground opacity-50 hover:opacity-100 transition-opacity"})]}),l.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[d&&l.jsx(jy,{value:d,label:o("errorLogs.copyRawContent"),variant:"ghost",size:"icon-sm",className:"text-muted-foreground hover:text-foreground"}),l.jsx("span",{className:"text-[10px] text-muted-foreground font-mono bg-muted px-1.5 py-0.5 rounded border border-border/50",children:m.method})]})]}),l.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:[l.jsx(Nr,{active:s==="overview",onClick:()=>c("overview"),icon:Tl,children:o("errorLogs.tabOverview")}),l.jsx(Nr,{active:s==="headers",onClick:()=>c("headers"),icon:zS,children:o("errorLogs.tabHeaders")}),l.jsx(Nr,{active:s==="request",onClick:()=>c("request"),icon:Ox,children:o("errorLogs.tabRequest")}),l.jsx(Nr,{active:s==="response",onClick:()=>c("response"),icon:IS,children:o("errorLogs.tabResponse")}),l.jsx(Nr,{active:s==="raw",onClick:()=>c("raw"),icon:US,children:o("errorLogs.tabRaw")})]}),l.jsxs("div",{className:"flex-1 overflow-hidden bg-card/30",children:[s==="overview"&&l.jsx(XD,{parsed:m}),s==="headers"&&l.jsx(ZD,{headers:m.requestHeaders}),s==="request"&&l.jsx(Ty,{content:m.requestBody,label:"Request"}),s==="response"&&l.jsx(Ty,{content:m.responseBody,label:"Response"}),s==="raw"&&l.jsx(JD,{content:d})]})]}):l.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:l.jsxs("div",{className:"text-center space-y-3",children:[l.jsx(_S,{className:"w-10 h-10 mx-auto opacity-40"}),l.jsx("p",{className:"text-sm",children:o("errorLogs.selectLog")})]})})}function tj(){const{t:n}=Mt(),{data:a,isLoading:o}=Sk(),{data:s,isLoading:c,error:d}=kk(a?.running??!1),[f,p]=S.useState(500),[m,y]=S.useState(!1),C=S.useRef(null),x=S.useRef(null),b=()=>{x.current&&(clearInterval(x.current),x.current=null)};S.useEffect(()=>{if(!m)return;const j=w=>{const P=C.current;if(!P)return;const z=P.getBoundingClientRect().top+window.scrollY,$=w.pageY-z;p(Math.max(300,$));const Z=window.innerHeight-w.clientY,xe=15;b(),Z<50?x.current=setInterval(()=>{window.scrollBy(0,xe)},16):w.clientY<50&&(x.current=setInterval(()=>{window.scrollBy(0,-xe)},16))},T=()=>{y(!1),b(),document.body.style.cursor="default",document.body.style.userSelect="auto"};return document.addEventListener("mousemove",j),document.addEventListener("mouseup",T),document.body.style.cursor="row-resize",document.body.style.userSelect="none",()=>{document.removeEventListener("mousemove",j),document.removeEventListener("mouseup",T),document.body.style.cursor="default",document.body.style.userSelect="auto",b()}},[m]);const A=j=>{j.preventDefault(),y(!0)},N=S.useMemo(()=>s?.[0]?.name??null,[s]),[E,O]=S.useState(null),R=E??N,k=S.useMemo(()=>!R||!s?void 0:s.find(T=>T.name===R)?.absolutePath,[R,s]);if(o||!a?.running)return null;if(c)return l.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:[l.jsxs("div",{className:"flex items-center justify-between px-4 py-3 border-b border-border",children:[l.jsx(Ye,{className:"h-4 w-32"}),l.jsx(Ye,{className:"h-4 w-20"})]}),l.jsx("div",{className:"p-4 space-y-3",children:[1,2,3].map(j=>l.jsx(Ye,{className:"h-12 w-full rounded-lg"},j))})]});if(!s||s.length===0)return null;const D=s.length;return l.jsxs("div",{ref:C,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:f},children:[l.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:[l.jsxs("div",{className:"flex items-center gap-2.5",children:[l.jsx(Gn,{className:"w-4 h-4 text-amber-500"}),l.jsx("span",{className:"text-sm font-semibold tracking-tight",children:n("errorLogs.title")}),l.jsx("span",{className:"text-xs text-muted-foreground ml-1",children:n("errorLogs.failedRequests",{count:D})})]}),l.jsxs("div",{className:"flex items-center gap-2 text-xs text-muted-foreground",children:[l.jsx(HS,{className:"w-3.5 h-3.5"}),l.jsx("span",{children:n("errorLogs.cliproxyDiagnostics")})]})]}),l.jsx("div",{className:"flex-1 min-h-0",children:l.jsxs(Cf,{direction:"horizontal",children:[l.jsx(Ir,{defaultSize:30,minSize:20,maxSize:50,className:"flex flex-col min-w-0",children:l.jsxs(Ao,{className:"h-full",children:[l.jsx("div",{className:"divide-y divide-border/50",children:s.slice(0,50).map(j=>l.jsx(WD,{name:j.name,size:j.size,modified:j.modified,isSelected:R===j.name,onClick:()=>O(j.name),statusCode:j.statusCode,model:j.model},j.name))}),s.length>50&&l.jsx("div",{className:"px-3 py-3 text-center text-[10px] text-muted-foreground border-t border-border/50",children:n("errorLogs.showingCount",{total:s.length})})]})}),l.jsxs(Sf,{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:[l.jsx("div",{className:"w-[1px] h-full bg-border group-hover:bg-primary/50 transition-colors"}),l.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:l.jsx(jl,{className:"h-4 w-4 text-muted-foreground"})})]}),l.jsx(Ir,{className:"flex flex-col min-w-0 bg-background/50",children:l.jsx(ej,{name:R,absolutePath:k})})]})}),d?l.jsx("div",{className:"px-4 py-2 border-t border-border text-xs text-destructive bg-destructive/5 shrink-0",children:d.message}):l.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:A,children:l.jsx(BS,{className:"w-8 h-3 text-border group-hover:text-primary/50 transition-colors"})})]})}const nj=Ml("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"}}),wf=S.forwardRef(({className:n,variant:a,...o},s)=>l.jsx("div",{ref:s,role:"alert",className:K(nj({variant:a}),n),...o}));wf.displayName="Alert";const Ob=S.forwardRef(({className:n,...a},o)=>l.jsx("h5",{ref:o,className:K("mb-1 font-medium leading-none tracking-tight",n),...a}));Ob.displayName="AlertTitle";const Nf=S.forwardRef(({className:n,...a},o)=>l.jsx("div",{ref:o,className:K("text-sm [&_p]:leading-relaxed",n),...a}));Nf.displayName="AlertDescription";function aj(){return Tt({queryKey:["overview"],queryFn:async()=>(await fetch("/api/overview")).json()})}function Pb(n,a){return typeof n=="object"&&n!==null&&"error"in n&&typeof n.error=="string"?n.error:a}function Lb(n){const a=n.trim();if(!a)return null;try{return JSON.parse(a)}catch{return null}}function ij(n){const a=n.trim().toLowerCase();return a.startsWith("<!doctype html")||a.startsWith("<html")}function oj(n){if(!n||typeof n!="object")return!1;const a=n;return!(typeof a.content!="string"||"contentPath"in a&&typeof a.contentPath!="string")}async function Rb(n,a){const o=await n.text(),s=Lb(o);if(!n.ok){const c=Pb(s,a);throw new Error(c)}if(s===null)throw new Error(a);return s}function rj(){return Tt({queryKey:["shared","summary"],queryFn:async()=>{const n=await fetch("/api/shared/summary");return Rb(n,"Failed to fetch shared summary")}})}function NO(n){return Tt({queryKey:["shared",n],queryFn:async()=>{const a=await fetch(`/api/shared/${n}`);return Rb(a,`Failed to fetch shared ${n}`)}})}function AO(n,a){return Tt({queryKey:["shared",n,"content",a],enabled:typeof a=="string"&&a.length>0,queryFn:async()=>{if(!a)throw new Error("Missing shared item path");const o=new URLSearchParams({type:n,path:a}),s=await fetch(`/api/shared/content?${o.toString()}`),c=await s.text(),d=Lb(c);if(!s.ok)throw new Error(Pb(d,`Failed to fetch shared ${n} content`));if(oj(d))return{content:d.content,contentPath:typeof d.contentPath=="string"&&d.contentPath.length>0?d.contentPath:a};if(c.trim().length>0){if(ij(c))throw new Error("Shared content endpoint unavailable. Restart `ccs config` and try again.");return{content:c,contentPath:a}}throw new Error(`Failed to fetch shared ${n} content`)}})}const sj={ok:"success",warning:"warning",error:"error"},lj={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 cl({title:n,value:a,icon:o,variant:s="default",onClick:c}){const d=lj[s];return l.jsxs("button",{onClick:c,className:K("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:[l.jsx("div",{className:K("flex items-center justify-center w-9 h-9 rounded-md",d.iconBg),children:l.jsx(o,{className:K("w-4 h-4",d.iconColor)})}),l.jsxs("div",{className:"text-left",children:[l.jsx("p",{className:"text-[10px] text-muted-foreground uppercase tracking-wider",children:n}),l.jsx("p",{className:K("text-lg font-bold font-mono leading-tight",d.iconColor),children:a})]})]})}function cj(){const{t:n}=Mt(),a=qd(),{data:o,isLoading:s}=aj(),{data:c,isLoading:d}=rj();if(s||d)return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"rounded-xl border p-6 flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx(Ye,{className:"h-12 w-12 rounded-lg"}),l.jsxs("div",{children:[l.jsx(Ye,{className:"h-7 w-[180px] mb-2"}),l.jsx(Ye,{className:"h-4 w-[220px]"})]})]}),l.jsx("div",{className:"flex items-center gap-3",children:[1,2,3,4].map(p=>l.jsx(Ye,{className:"h-14 w-28 rounded-lg"},p))})]}),l.jsxs("div",{className:"border rounded-xl overflow-hidden",children:[l.jsxs("div",{className:"px-4 py-2.5 border-b flex items-center justify-between",children:[l.jsx(Ye,{className:"h-4 w-32"}),l.jsx(Ye,{className:"h-4 w-20"})]}),l.jsx("div",{className:"px-4 py-3 border-b",children:l.jsx(Ye,{className:"h-2 w-full rounded-full"})}),[1,2,3].map(p=>l.jsxs("div",{className:"px-4 py-2.5 flex items-center gap-3 border-b last:border-b-0",children:[l.jsx(Ye,{className:"w-2.5 h-2.5 rounded-full"}),l.jsx(Ye,{className:"h-4 flex-1"}),l.jsx(Ye,{className:"h-1.5 w-24 rounded-full"}),l.jsx(Ye,{className:"h-4 w-16"})]},p))]})]});const f=o?.health?sj[o.health.status]:void 0;return l.jsxs("div",{className:"p-6 space-y-6",children:[l.jsxs("div",{className:"relative overflow-hidden rounded-xl border bg-gradient-to-br from-background via-background to-muted/30",children:[l.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",children:l.jsx("div",{className:"absolute inset-0",style:{backgroundImage:"radial-gradient(circle at 1px 1px, currentColor 1px, transparent 0)",backgroundSize:"24px 24px"}})}),l.jsxs("div",{className:"relative p-6 flex flex-col lg:flex-row lg:items-center lg:justify-between gap-4",children:[l.jsx(Y1,{version:o?.version}),l.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[l.jsx(cl,{title:n("home.profiles"),value:o?.profiles??0,icon:Ad,variant:"accent",onClick:()=>a("/providers")}),l.jsx(cl,{title:n("home.cliproxy"),value:o?.cliproxy??0,icon:Nx,variant:"accent",onClick:()=>a("/cliproxy")}),l.jsx(cl,{title:n("home.accounts"),value:o?.accounts??0,icon:Dx,variant:"default",onClick:()=>a("/accounts")}),l.jsx(cl,{title:n("home.health"),value:o?.health?`${o.health.passed}/${o.health.total}`:"-",icon:Rr,variant:f,onClick:()=>a("/health")})]})]})]}),c?.symlinkStatus&&!c.symlinkStatus.valid&&l.jsxs(wf,{variant:"warning",children:[l.jsx(Gn,{className:"h-4 w-4"}),l.jsx(Ob,{children:n("home.configurationRequired")}),l.jsx(Nf,{children:c.symlinkStatus.message})]}),l.jsx(oD,{}),l.jsx(tj,{})]})}const _b=ZC,Af=S.forwardRef(({className:n,...a},o)=>l.jsx(bx,{ref:o,className:K("inline-flex h-10 items-center justify-center rounded-md bg-muted p-1 text-muted-foreground",n),...a}));Af.displayName=bx.displayName;const Cl=S.forwardRef(({className:n,...a},o)=>l.jsx(vx,{ref:o,className:K("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",n),...a}));Cl.displayName=vx.displayName;const zd=S.forwardRef(({className:n,...a},o)=>l.jsx(Cx,{ref:o,className:K("mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",n),...a}));zd.displayName=Cx.displayName;function un({className:n,...a}){return l.jsx(JC,{"data-slot":"label",className:K("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",n),...a})}const kf="ccs:openrouter-models",uj=1440*60*1e3,zb="1";function Id(n){const a=parseFloat(n);return isNaN(a)||a===0?0:a*1e6}function My(n){const a=Id(n);return a===0?"Free":a<.01?"<$0.01":a<1?`$${a.toFixed(2)}`:`$${a.toFixed(a<10?2:0)}`}function dj(n){const a=My(n.prompt),o=My(n.completion);return a==="Free"&&o==="Free"?"Free":`${a}/${o}`}function fj(n){const a=n.id.toLowerCase();return a.startsWith("anthropic/")?"anthropic":a.startsWith("openai/")?"openai":a.startsWith("google/")?"google":a.startsWith("meta-llama/")||a.startsWith("meta/")?"meta":a.startsWith("mistralai/")?"mistral":a.includes(":free")||a.includes("qwen")||a.includes("deepseek")?"opensource":"other"}function hj(n){return{...n,category:fj(n),pricePerMillionPrompt:Id(n.pricing.prompt),pricePerMillionCompletion:Id(n.pricing.completion),isFree:n.pricing.prompt==="0"&&n.pricing.completion==="0",isExacto:n.id.includes(":exacto")}}function pj(n,a,o){const s=a.toLowerCase().trim();return n.filter(c=>o?.category&&c.category!==o.category||o?.freeOnly&&!c.isFree||o?.minContext&&c.context_length<o.minContext?!1:s?c.id.toLowerCase().includes(s)||c.name.toLowerCase().includes(s)||c.description?.toLowerCase().includes(s):!0)}function kO(n){return[...n].sort((a,o)=>{if(a.isFree&&!o.isFree)return-1;if(!a.isFree&&o.isFree)return 1;if(!a.isFree&&!o.isFree){if(a.isExacto&&!o.isExacto)return-1;if(!a.isExacto&&o.isExacto)return 1}return a.name.localeCompare(o.name)})}function mj(){try{const n=localStorage.getItem(kf);if(!n)return null;const a=JSON.parse(n);return a.version!==zb||Date.now()-a.fetchedAt>uj?null:a.models}catch{return null}}function gj(n){try{localStorage.setItem(kf,JSON.stringify({models:n,fetchedAt:Date.now(),version:zb}))}catch{}}function yj(){localStorage.removeItem(kf)}function DO(n,a){const[o]=n.split("/");if(!o)return{};const s=a.filter(f=>f.id.startsWith(`${o}/`));if(s.length===0)return{};const c=[...s].sort((f,p)=>p.pricePerMillionPrompt-f.pricePerMillionPrompt),d=Math.ceil(c.length/3);return{opus:c[0]?.id,sonnet:c[Math.min(d,c.length-1)]?.id,haiku:c[c.length-1]?.id}}function xj(n){return n>=1e6?`${(n/1e6).toFixed(1)}M`:n>=1e3?`${Math.round(n/1e3)}K`:String(n)}const jO={anthropic:"Anthropic (Claude)",openai:"OpenAI (GPT)",google:"Google (Gemini)",meta:"Meta (Llama)",mistral:"Mistral",opensource:"Open Source",other:"Other"},bj={anthropic:["anthropic/"],openai:["openai/"],google:["google/"],meta:["meta-llama/","meta/"],mistral:["mistralai/"],opensource:["deepseek/","qwen/","cohere/"],other:[]};function vj(n,a=2){const o=[],s=["anthropic","openai","google","meta","mistral","opensource"];for(const c of s){const d=bj[c];if(d.length===0)continue;const p=[...n.filter(m=>d.some(y=>m.id.toLowerCase().startsWith(y)))].sort((m,y)=>(y.created??0)-(m.created??0));o.push(...p.slice(0,a))}return o.sort((c,d)=>(d.created??0)-(c.created??0))}function Cj(n){const o=Date.now()/1e3-n;return o<86400?"Today":o<172800?"Yesterday":o<604800?`${Math.floor(o/86400)}d ago`:o<2592e3?`${Math.floor(o/604800)}w ago`:o<31536e3?`${Math.floor(o/2592e3)}mo ago`:`${Math.floor(o/31536e3)}y ago`}const Sj="https://openrouter.ai/api/v1/models",Ib=["openrouter-models"],Ey=1440*60*1e3;async function wj(){const n=await fetch(Sj);if(!n.ok)throw new Error(`Failed to fetch OpenRouter models: ${n.status}`);const o=(await n.json()).data;return gj(o),o}function Ub(){return Tt({queryKey:Ib,queryFn:wj,staleTime:Ey,gcTime:Ey,initialData:()=>mj()??void 0,refetchOnWindowFocus:!1})}function Nj(){const n=Ub(),a=(n.data??[]).map(hj);return{...n,models:a}}function TO(){const n=rt();return()=>(yj(),n.invalidateQueries({queryKey:Ib}))}function MO(){const{data:n,isLoading:a,isError:o}=Ub();return{isReady:!!n&&n.length>0,isLoading:a,isError:o,modelCount:n?.length??0}}function Df({profileEnv:n={}}){const[a,o]=S.useState(null),[s,c]=S.useState(!0),[d,f]=S.useState(!1);S.useEffect(()=>{p()},[]);const p=async()=>{try{c(!0);const b=await fetch("/api/global-env");if(!b.ok)throw new Error("Failed to load");const A=await b.json();o(A)}catch{o(null)}finally{c(!1)}};if(s||!a?.enabled)return null;const m=a.env||{},y=Object.keys(m);if(y.length===0)return null;const C=y.filter(b=>!(b in n)),x=y.filter(b=>b in n);return l.jsxs("div",{className:"border-t bg-muted/20",children:[l.jsxs("button",{onClick:()=>f(!d),className:"w-full px-4 py-2 flex items-center gap-2 hover:bg-muted/30 transition-colors",children:[l.jsx(Tl,{className:"w-4 h-4 text-blue-500"}),l.jsxs("span",{className:"text-xs text-muted-foreground flex-1 text-left",children:[l.jsx("span",{className:"font-medium text-foreground",children:C.length})," global env var",C.length!==1?"s":""," will be injected at runtime",x.length>0&&l.jsxs("span",{className:"text-amber-600 dark:text-amber-400 ml-1",children:["(",x.length," overridden by profile)"]})]}),d?l.jsx(Gd,{className:"w-4 h-4 text-muted-foreground"}):l.jsx(Br,{className:"w-4 h-4 text-muted-foreground"})]}),d&&l.jsxs("div",{className:"px-4 pb-3 space-y-2",children:[C.length>0&&l.jsx("div",{className:"space-y-1",children:C.map(b=>l.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:[l.jsx("span",{className:"text-green-500",children:"+"}),l.jsxs("span",{className:"truncate",children:[b,"=",m[b]]})]},b))}),x.length>0&&l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"text-xs text-muted-foreground",children:"Skipped (profile already defines):"}),x.map(b=>l.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:[l.jsx("span",{className:"text-amber-500",children:"~"}),l.jsx("span",{className:"truncate",children:b})]},b))]}),l.jsx("div",{className:"pt-2 border-t border-border/50",children:l.jsx(dt,{variant:"ghost",size:"sm",asChild:!0,className:"h-7 text-xs gap-1.5 -ml-2",children:l.jsxs(pl,{to:"/settings?tab=globalenv",children:[l.jsx(Yd,{className:"w-3.5 h-3.5"}),"Configure in Settings",l.jsx(jx,{className:"w-3 h-3 opacity-50"})]})})})]})]})}function Aj({className:n,...a}){return l.jsx(eS,{"data-slot":"switch",className:K("peer data-[state=checked]:bg-primary data-[state=unchecked]:bg-input focus-visible:border-ring focus-visible:ring-ring/50 dark:data-[state=unchecked]:bg-input/80 inline-flex h-[1.15rem] w-8 shrink-0 items-center rounded-full border border-transparent shadow-xs transition-all outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",n),...a,children:l.jsx(tS,{"data-slot":"switch-thumb",className:K("bg-background dark:data-[state=unchecked]:bg-foreground dark:data-[state=checked]:bg-primary-foreground pointer-events-none block size-4 rounded-full ring-0 transition-transform data-[state=checked]:translate-x-[calc(100%-2px)] data-[state=unchecked]:translate-x-0")})})}const jf={claude:"Claude Code",droid:"Factory Droid",codex:"Codex CLI"};function kj(n,a){return a==="refreshing"?"Refreshing preview":a==="invalid"?"Saved status":n==="editor"?"Live preview":"Saved status"}function Dj(n,a){return n.status==="disabled"?"Disabled globally":a!=="claude"?`${jf[a]} bypasses the hook`:n.nativeReadPreference?"Native image reading":n.status==="hook-missing"?"Setup needed":n.authReadiness==="missing"?"Needs auth":n.proxyReadiness==="unavailable"?"Needs proxy":n.effectiveRuntimeMode==="native-read"?"Native fallback":"Transformer ready"}function jj(n,a){return n.status==="disabled"?{label:"Disabled",className:"border-border/80 bg-background/85 text-muted-foreground"}:a!=="claude"?{label:"Bypassed",className:"border-sky-500/25 bg-sky-500/10 text-sky-800 dark:text-sky-200"}:n.nativeReadPreference?{label:"Native",className:"border-emerald-500/25 bg-emerald-500/10 text-emerald-800 dark:text-emerald-200"}:n.status==="hook-missing"||n.authReadiness==="missing"?{label:n.status==="hook-missing"?"Setup":"Auth",className:"border-amber-500/25 bg-amber-500/10 text-amber-800 dark:text-amber-200"}:n.proxyReadiness==="unavailable"?{label:"Proxy",className:"border-amber-500/25 bg-amber-500/10 text-amber-800 dark:text-amber-200"}:{label:"Ready",className:"border-emerald-500/25 bg-emerald-500/10 text-emerald-800 dark:text-emerald-200"}}function Tj(n,a){if(n.nativeReadPreference)return n.profileModel&&n.nativeImageCapable?`${n.profileModel} looks image-ready. CCS will bypass the transformer here.`:n.profileModel?`CCS will prefer native reading for ${n.profileModel}.`:"CCS will prefer native image reading for this profile.";if(!n.backendDisplayName&&a==="claude")return"This profile currently stays on native file access.";if(!n.backendDisplayName)return`Saved Claude-side image routing is inactive while ${jf[a]} is selected.`;const o=n.model?` · ${n.model}`:"";return`Transformer route: ${n.backendDisplayName}${o}.`}function Mj(n,a){return n.status==="disabled"?"Image is disabled globally in CCS settings.":a!=="claude"?`Current target ${jf[a]} bypasses the Claude Read hook.`:n.nativeReadPreference?n.nativeImageCapable===!0?null:n.nativeImageReason:n.status==="hook-missing"?"Persist the profile hook before transformer routing can run here.":n.authReadiness==="missing"?n.authReason:n.proxyReadiness==="unavailable"?n.proxyReason:null}function Ej({status:n,target:a="claude",source:o="saved",previewState:s="saved",nativeReadPreferenceOverride:c,onToggleNativeRead:d}){if(!n)return l.jsxs("div",{className:"rounded-2xl border bg-muted/20 px-4 py-3","aria-live":"polite",children:[l.jsx("div",{className:"h-4 w-24 animate-pulse rounded bg-muted"}),l.jsx("div",{className:"mt-2 h-3 w-52 animate-pulse rounded bg-muted"})]});const f=c??n.nativeReadPreference,p={...n,nativeReadPreference:f},m=jj(p,a),y=Mj(p,a),C=n.nativeImageCapable?"Verified":n.profileModel?"Unknown":null;return l.jsxs("section",{className:"rounded-2xl border bg-background/95 px-4 py-3 shadow-sm",children:[l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsx("div",{className:"min-w-0",children:l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:"inline-flex h-8 w-8 items-center justify-center rounded-xl border border-sky-500/20 bg-sky-500/10 text-sky-700 dark:text-sky-300",children:l.jsx(Px,{className:"h-4 w-4"})}),l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("h3",{className:"text-sm font-semibold",children:"Image"}),l.jsx(zt,{className:K("h-5 border px-1.5 text-[10px]",m.className),children:m.label})]}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:[kj(o,s)," · ",Dj(p,a)]})]})]})}),l.jsx(dt,{size:"sm",variant:"outline",className:"h-8 shrink-0",asChild:!0,children:l.jsxs(pl,{to:"/settings?tab=image",children:["Open Settings",l.jsx(Ox,{className:"ml-1 h-3.5 w-3.5"})]})})]}),l.jsx("div",{className:"mt-3 rounded-xl border bg-muted/15 px-3 py-3",children:l.jsxs("div",{className:"flex items-start justify-between gap-3",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[l.jsx("div",{className:"text-sm font-medium text-foreground",children:"Use native image reading"}),C&&l.jsx(zt,{variant:"outline",className:"h-5 px-1.5 text-[10px]",children:C})]}),l.jsx("p",{className:"mt-1 text-xs leading-5 text-muted-foreground",children:Tj(p,a)})]}),l.jsx(Aj,{checked:f,onCheckedChange:d,disabled:!d,"aria-label":"Use native image reading"})]})}),y&&l.jsx("div",{className:"mt-2 rounded-lg border border-border/70 bg-muted/20 px-3 py-2 text-xs leading-5 text-muted-foreground",children:y})]})}const Oj=S.lazy(()=>tt(()=>Promise.resolve().then(()=>ql),void 0).then(n=>({default:n.CodeEditor})));function EO({rawJsonContent:n,isRawJsonValid:a,rawJsonEdits:o,settings:s,profileTarget:c="claude",imageAnalysisStatus:d,imageAnalysisStatusSource:f="saved",imageAnalysisStatusPreviewState:p="saved",nativeReadPreferenceOverride:m,onToggleNativeRead:y,onChange:C,missingRequiredFields:x=[]}){const b=x.length>0;return l.jsx(S.Suspense,{fallback:l.jsxs("div",{className:"flex items-center justify-center h-full",children:[l.jsx(On,{className:"w-6 h-6 animate-spin text-muted-foreground"}),l.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading editor..."})]}),children:l.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[!a&&o!==null&&l.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:[l.jsx(No,{className:"w-4 h-4"}),"Invalid JSON syntax"]}),a&&b&&l.jsxs("div",{className:"mb-2 px-3 py-2 bg-warning/10 text-warning-foreground text-sm rounded-md flex items-start gap-2 mx-6 mt-4 shrink-0 border border-warning/20",children:[l.jsx(Gn,{className:"w-4 h-4 mt-0.5 text-amber-500 shrink-0"}),l.jsxs("div",{children:[l.jsx("span",{className:"font-medium text-amber-600 dark:text-amber-400",children:"Missing required fields:"})," ",l.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:x.join(", ")}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"These fields will use default values at runtime."})]})]}),l.jsx("div",{className:"min-h-0 flex-1 overflow-hidden px-6 pb-4 pt-4",children:l.jsx("div",{className:"h-full border rounded-md overflow-hidden bg-background",children:l.jsx(Oj,{value:n,onChange:C,language:"json",minHeight:"100%",heightMode:"fill-parent"})})}),l.jsx("div",{className:"mx-6 mb-4",children:l.jsx(Ej,{status:d,target:c,source:f,previewState:p,nativeReadPreferenceOverride:m,onToggleNativeRead:y})}),l.jsx("div",{className:"mx-6 mb-4",children:l.jsx("div",{className:"border rounded-md overflow-hidden",children:l.jsx(Df,{profileEnv:s?.env})})})]})})}function Oy(n,a){try{var o=n()}catch(s){return a(s)}return o&&o.then?o.then(void 0,a):o}function Pj(n,a){for(var o={};n.length;){var s=n[0],c=s.code,d=s.message,f=s.path.join(".");if(!o[f])if("unionErrors"in s){var p=s.unionErrors[0].errors[0];o[f]={message:p.message,type:p.code}}else o[f]={message:d,type:c};if("unionErrors"in s&&s.unionErrors.forEach(function(C){return C.errors.forEach(function(x){return n.push(x)})}),a){var m=o[f].types,y=m&&m[s.code];o[f]=Lx(f,a,o,c,y?[].concat(y,s.message):s.message)}n.shift()}return o}function Lj(n,a){for(var o={};n.length;){var s=n[0],c=s.code,d=s.message,f=s.path.join(".");if(!o[f])if(s.code==="invalid_union"&&s.errors.length>0){var p=s.errors[0][0];o[f]={message:p.message,type:p.code}}else o[f]={message:d,type:c};if(s.code==="invalid_union"&&s.errors.forEach(function(C){return C.forEach(function(x){return n.push(x)})}),a){var m=o[f].types,y=m&&m[s.code];o[f]=Lx(f,a,o,c,y?[].concat(y,s.message):s.message)}n.shift()}return o}function Rj(n,a,o){if(o===void 0&&(o={}),(function(s){return"_def"in s&&typeof s._def=="object"&&"typeName"in s._def})(n))return function(s,c,d){try{return Promise.resolve(Oy(function(){return Promise.resolve(n[o.mode==="sync"?"parse":"parseAsync"](s,a)).then(function(f){return d.shouldUseNativeValidation&&Rg({},d),{errors:{},values:o.raw?Object.assign({},s):f}})},function(f){if((function(p){return Array.isArray(p?.issues)})(f))return{values:{},errors:_g(Pj(f.errors,!d.shouldUseNativeValidation&&d.criteriaMode==="all"),d)};throw f}))}catch(f){return Promise.reject(f)}};if((function(s){return"_zod"in s&&typeof s._zod=="object"})(n))return function(s,c,d){try{return Promise.resolve(Oy(function(){return Promise.resolve((o.mode==="sync"?jw:Tw)(n,s,a)).then(function(f){return d.shouldUseNativeValidation&&Rg({},d),{errors:{},values:o.raw?Object.assign({},s):f}})},function(f){if((function(p){return p instanceof Mw})(f))return{values:{},errors:_g(Lj(f.issues,!d.shouldUseNativeValidation&&d.criteriaMode==="all"),d)};throw f}))}catch(f){return Promise.reject(f)}};throw new Error("Invalid input: not a Zod schema")}const _j={sm:{container:"w-6 h-6",icon:"w-4 h-4",text:"text-xs"},md:{container:"w-8 h-8",icon:"w-5 h-5",text:"text-sm"},lg:{container:"w-12 h-12",icon:"w-8 h-8",text:"text-lg"}};function zj({provider:n,className:a,size:o="md"}){const s=C1(n),c=_j[o],d=tb(n),f=w1(n);return l.jsx("div",{className:K("flex items-center justify-center rounded-md",d&&!f&&(S1(n)?"bg-gray-900 p-1":"bg-white p-1"),c.container,a),children:d?l.jsx("img",{src:d,alt:`${n} logo`,className:K(f?c.container:c.icon,"object-contain")}):l.jsx("span",{className:K("font-semibold",s.textClass,c.text),children:s.letter})})}function OO(){return Tt({queryKey:["profiles"],queryFn:()=>Ke.profiles.list()})}function Ij(){const n=rt();return nt({mutationFn:a=>Ke.profiles.create(a),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),le.success("Profile created successfully")},onError:a=>{le.error(a.message)}})}function PO(){const n=rt();return nt({mutationFn:a=>Ke.profiles.delete(a),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),le.success("Profile deleted successfully")},onError:a=>{le.error(a.message)}})}function LO(){return nt({mutationFn:()=>Ke.profiles.discoverOrphans()})}function RO(){const n=rt();return nt({mutationFn:a=>Ke.profiles.registerOrphans(a),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),le.success("Orphan profiles registration complete")}})}function _O(){const n=rt();return nt({mutationFn:({name:a,data:o})=>Ke.profiles.copy(a,o),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),le.success("Profile copied successfully")}})}function zO(){return nt({mutationFn:({name:n,includeSecrets:a})=>Ke.profiles.export(n,a??!1)})}function IO(){const n=rt();return nt({mutationFn:a=>Ke.profiles.import(a),onSuccess:()=>{n.invalidateQueries({queryKey:["profiles"]}),le.success("Profile imported successfully")}})}const Uj="https://openrouter.ai/api",Hb=Object.freeze({glmt:"glm",kimi:"km",alibaba:"alibaba-coding-plan",acp:"alibaba-coding-plan"}),Bb=[{id:"openrouter",name:"OpenRouter",description:"349+ models from OpenAI, Anthropic, Google, Meta",baseUrl:Uj,defaultProfileName:"openrouter",defaultModel:"anthropic/claude-opus-4.5",apiKeyPlaceholder:"sk-or-...",apiKeyHint:"Get your API key at openrouter.ai/keys",category:"recommended",requiresApiKey:!0,badge:"349+ models",featured:!0,icon:"/icons/openrouter.svg"},{id:"alibaba-coding-plan",name:"Alibaba Coding Plan",description:"Alibaba Cloud Coding Plan via Anthropic-compatible endpoint",baseUrl:"https://coding-intl.dashscope.aliyuncs.com/apps/anthropic",defaultProfileName:"albb",defaultModel:"qwen3-coder-plus",apiKeyPlaceholder:"sk-sp-...",apiKeyHint:"Get your Coding Plan key from Alibaba Cloud Model Studio",category:"recommended",requiresApiKey:!0,badge:"Coding Plan",featured:!0,icon:"/assets/providers/alibabacloud-color.svg"},{id:"ollama",name:"Ollama (Local)",description:"Local open-source models via Ollama (32K+ context)",baseUrl:"http://localhost:11434",defaultProfileName:"ollama",defaultModel:"qwen3-coder",apiKeyPlaceholder:"ollama",apiKeyHint:"Install Ollama from ollama.com - no API key needed for local",category:"recommended",requiresApiKey:!1,badge:"Local",featured:!0,icon:"/icons/ollama.svg"},{id:"llamacpp",name:"llama.cpp (Local)",description:"Local inference via llama.cpp (LLaMA models)",baseUrl:"http://127.0.0.1:8080",defaultProfileName:"llamacpp",defaultModel:"llama3-8b",apiKeyPlaceholder:"llamacpp",apiKeyHint:"Run llama.cpp server: ./server --host 0.0.0.0 --port 8080 -m model.gguf",category:"recommended",requiresApiKey:!1,badge:"Local",featured:!0,icon:"/assets/providers/llama-cpp.svg"},{id:"anthropic",name:"Anthropic (Direct API)",description:"Use your own Anthropic API key (sk-ant-...)",baseUrl:"",defaultProfileName:"anthropic",defaultModel:"claude-sonnet-4-5-20250929",apiKeyPlaceholder:"sk-ant-api03-...",apiKeyHint:"Get key at console.anthropic.com/settings/keys",category:"recommended",requiresApiKey:!0,badge:"Direct",featured:!0,icon:"/assets/providers/claude.svg"},{id:"glm",name:"GLM",description:"Direct Z.AI Anthropic-compatible API profile",baseUrl:"https://api.z.ai/api/anthropic",defaultProfileName:"glm",defaultModel:"glm-5",apiKeyPlaceholder:"ghp_...",apiKeyHint:"Get your API key from Z.AI",category:"alternative",requiresApiKey:!0,badge:"Z.AI",icon:"/icons/zai.svg"},{id:"km",name:"Kimi",description:"Moonshot AI - Fast reasoning model",baseUrl:"https://api.kimi.com/coding/",defaultProfileName:"km",defaultModel:"kimi-k2-thinking-turbo",apiKeyPlaceholder:"sk-...",apiKeyHint:"Get your API key from Moonshot AI",category:"alternative",requiresApiKey:!0,alwaysThinkingEnabled:!0,badge:"Reasoning",icon:"/icons/kimi.svg"},{id:"foundry",name:"Azure Foundry",description:"Claude via Microsoft Azure AI Foundry",baseUrl:"https://<your-resource>.services.ai.azure.com/api/anthropic",defaultProfileName:"foundry",defaultModel:"claude-sonnet-4-5",apiKeyPlaceholder:"YOUR_AZURE_API_KEY",apiKeyHint:"Create resource at ai.azure.com, get API key from Keys tab",category:"alternative",requiresApiKey:!0,badge:"Azure",icon:"/icons/azure.svg"},{id:"mm",name:"Minimax",description:"M2.1/M2.1-lightning/M2 - multilang coding (1M context)",baseUrl:"https://api.minimax.io/anthropic",defaultProfileName:"mm",defaultModel:"MiniMax-M2.1",apiKeyPlaceholder:"YOUR_MINIMAX_API_KEY_HERE",apiKeyHint:"Get your API key at platform.minimax.io",category:"alternative",requiresApiKey:!0,badge:"1M context",icon:"/icons/minimax.svg"},{id:"deepseek",name:"DeepSeek",description:"V3.2 and R1 reasoning model (128K context)",baseUrl:"https://api.deepseek.com/anthropic",defaultProfileName:"deepseek",defaultModel:"deepseek-chat",apiKeyPlaceholder:"sk-...",apiKeyHint:"Get your API key at platform.deepseek.com",category:"alternative",requiresApiKey:!0,badge:"Reasoning",icon:"/icons/deepseek.svg"},{id:"qwen",name:"Qwen",description:"Alibaba Cloud - Qwen3 models (256K-1M context, thinking support)",baseUrl:"https://dashscope-intl.aliyuncs.com/apps/anthropic",defaultProfileName:"qwen-api",defaultModel:"qwen3-coder-plus",apiKeyPlaceholder:"sk-...",apiKeyHint:"Get your API key from Alibaba Cloud Model Studio",category:"alternative",requiresApiKey:!0,badge:"Alibaba",icon:"/assets/providers/qwen-color.svg"},{id:"ollama-cloud",name:"Ollama Cloud",description:"Ollama cloud models via direct API (glm-5:cloud, minimax-m2.1:cloud)",baseUrl:"https://ollama.com",defaultProfileName:"ollama-cloud",defaultModel:"glm-5:cloud",apiKeyPlaceholder:"YOUR_OLLAMA_CLOUD_API_KEY",apiKeyHint:"Get your API key at ollama.com",category:"alternative",requiresApiKey:!0,badge:"Cloud",icon:"/icons/ollama.svg"},{id:"novita",name:"Novita AI",description:"Anthropic-compatible API for Claude Code and CCS profiles",baseUrl:"https://api.novita.ai/anthropic",defaultProfileName:"novita",defaultModel:"deepseek/deepseek-v3.2",apiKeyPlaceholder:"YOUR_NOVITA_API_KEY",apiKeyHint:"Get your API key at novita.ai",category:"alternative",requiresApiKey:!0,badge:"Anthropic-compatible",icon:"/icons/novita.svg"}];function Kb(n){return{...n,extraEnv:n.extraEnv?{...n.extraEnv}:void 0}}function Hj(n){const a=Kb(n);return a.extraEnv&&Object.freeze(a.extraEnv),Object.freeze(a)}function Bj(n,a){const o=new Set;for(const c of n){const d=c.id.trim().toLowerCase();if(c.id!==d)throw new Error(`Preset ID must be normalized: "${c.id}"`);if(o.has(c.id))throw new Error(`Duplicate preset ID detected: "${c.id}"`);o.add(c.id)}const s=new Set;for(const[c,d]of Object.entries(a)){const f=c.trim().toLowerCase();if(!f)throw new Error("Preset alias keys cannot be empty");if(c!==f)throw new Error(`Preset alias must be normalized: "${c}"`);if(s.has(f))throw new Error(`Duplicate normalized preset alias detected: "${c}"`);if(s.add(f),!o.has(d))throw new Error(`Preset alias "${c}" points to unknown target "${d}"`);if(o.has(f))throw new Error(`Preset alias "${c}" collides with canonical preset ID "${f}"`)}}Bj(Bb,Hb);const Kj=Object.freeze(Bb.map(Hj));function qj(){return Kj.map(Kb)}function Fj(n){const a=n.trim().toLowerCase();return Hb[a]||a}const Gj=qj(),Tf=Object.freeze(Gj.map(n=>({...n})));function Vj(n,a){return a||(n?.requiresApiKey===!1?n.apiKeyPlaceholder||n.id:"")}function Yj(n){return Tf.filter(a=>a.category===n)}function gd(n){const a=Fj(n);return Tf.find(o=>o.id===a)}const $j=Za().refine(n=>n.trim().length===0||Za().url().safeParse(n).success,{message:"Invalid URL format"}),Qj=Ew({name:Za().min(1,"Name is required").regex(/^[a-zA-Z][a-zA-Z0-9._-]*$/,"Must start with letter, only letters/numbers/.-_"),baseUrl:$j,apiKey:Za(),model:Za().optional(),opusModel:Za().optional(),sonnetModel:Za().optional(),haikuModel:Za().optional(),target:Ow(["claude","droid","codex"])}),Wj=["/chat/completions","/v1/messages","/messages","/completions"],Xa="custom",yd="openrouter",xd={name:"",baseUrl:"",apiKey:"",model:"",opusModel:"",sonnetModel:"",haikuModel:"",target:"claude"},Xj=Yj("recommended"),qb=Tf.filter(n=>n.category!=="recommended"),Py=new Set(qb.map(n=>n.id));function UO({open:n,onOpenChange:a,onSuccess:o,initialMode:s="openrouter"}){const{t:c}=Mt(),d=Ij(),[f,p]=S.useState("basic"),[m,y]=S.useState(null),[C,x]=S.useState(!1),[b,A]=S.useState(yd),[N,E]=S.useState(!1),[O,R]=S.useState(""),{models:k}=Nj(),{register:D,handleSubmit:j,formState:{errors:T},control:w,reset:P,setValue:F}=Pw({resolver:Rj(Qj),defaultValues:xd}),z=zg({control:w,name:"baseUrl"}),$=zg({control:w,name:"target"}),ne=S.useCallback(H=>{if(!H){P(xd);return}P({...xd,name:H.defaultProfileName,baseUrl:H.baseUrl,model:H.defaultModel,opusModel:H.defaultModel,sonnetModel:H.defaultModel,haikuModel:H.defaultModel})},[P]),Z=S.useMemo(()=>b===Xa?null:gd(b)??null,[b]),xe=S.useMemo(()=>O.trim()?[...pj(k,O)].sort((Q,ie)=>(ie.created??0)-(Q.created??0)).slice(0,20):vj(k,2),[k,O]);S.useEffect(()=>{if(n)if(p("basic"),y(null),x(!1),E(!1),R(""),s==="normal")A(Xa),ne(null);else{const Q=gd(s==="openrouter"?yd:s);if(Q){A(Q.id),ne(Q);return}A(Xa),ne(null)}},[n,s,ne,P]);const te=H=>{const Q=gd(H);if(Q){A(Q.id),E(Py.has(Q.id)),ne(Q);return}A(Xa),E(!1),ne(null)},be=H=>{F("model",H.id),F("opusModel",H.id),F("sonnetModel",H.id),F("haikuModel",H.id),R(H.name),le.success(`Applied "${H.name}" to all model tiers`,{duration:2e3})};S.useEffect(()=>{if(z&&b===Xa){const Q=z.toLowerCase();for(const ie of Wj)if(Q.endsWith(ie)){const ae=z.replace(new RegExp(ie+"$","i"),"");y(`URL ends with "${ie}" - Claude appends this automatically. You likely want: ${ae}`);return}}y(null)},[z,b]);const I=async H=>{if(Z?.requiresApiKey!==!1&&!H.apiKey){le.error(Be.t("commonToast.apiKeyRequired"));return}const Q={...H,apiKey:Vj(Z,H.apiKey)};try{await d.mutateAsync(Q),le.success(`Profile "${Q.name}" created`),o(Q.name),a(!1)}catch(ie){le.error(ie.message||"Failed to create profile")}},X=!!T.name||!!T.baseUrl||!!T.apiKey,ee=!!T.model||!!T.opusModel||!!T.sonnetModel||!!T.haikuModel,re=d.isPending,fe=b!==Xa&&Py.has(b),he=Z?.id===yd,de=N||fe;return l.jsx(of,{open:n,onOpenChange:a,children:l.jsxs(rf,{className:"sm:max-w-[700px] p-0 gap-0 overflow-hidden max-h-[90vh] !flex !flex-col",children:[l.jsxs(sf,{className:"p-6 pb-4 border-b",children:[l.jsxs(lf,{className:"flex items-center gap-2",children:[l.jsx(Pg,{className:"w-5 h-5 text-primary"}),"Create API Profile"]}),l.jsx(cf,{children:"Choose a provider preset or configure a custom API endpoint."})]}),l.jsxs("form",{onSubmit:j(I),className:"flex flex-col flex-1 min-h-0 overflow-hidden",children:[l.jsx("div",{className:"border-b bg-muted/10 px-6 py-3 space-y-3",children:l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-start justify-between gap-4",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx(un,{className:"text-xs text-muted-foreground",children:c("profileEditor.provider")}),l.jsx("p",{className:"text-xs text-muted-foreground",children:c("profileEditor.providerChooserHint")})]}),l.jsx("span",{className:"pt-0.5 text-[11px] text-muted-foreground",children:c("profileEditor.scrollHint")})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(un,{className:"text-xs font-medium uppercase tracking-[0.12em] text-foreground/70",children:c("profileEditor.featuredProviders")}),l.jsx("div",{className:"-mx-1 overflow-x-auto pb-1",children:l.jsxs("div",{className:"flex min-w-max items-stretch gap-2 px-1",children:[Xj.map(H=>l.jsx(Ly,{preset:H,isSelected:b===H.id,onClick:()=>te(H.id),density:"featured"},H.id)),l.jsx("div",{className:"mx-1 hidden w-px rounded-full bg-border/70 sm:block"}),l.jsx(Zj,{isSelected:b===Xa,onClick:()=>te(Xa)})]})})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsxs(dt,{type:"button",variant:"ghost",size:"sm",onClick:()=>E(H=>!H),"aria-expanded":de,className:"h-8 px-2 text-xs font-medium text-muted-foreground hover:text-foreground",children:[l.jsx(Br,{className:K("mr-1 h-3.5 w-3.5 transition-transform",de?"rotate-0":"-rotate-90")}),c("profileEditor.morePresets")]}),de&&l.jsx("div",{className:"-mx-1 overflow-x-auto pb-1",children:l.jsx("div",{className:"flex min-w-max items-stretch gap-2 px-1",children:qb.map(H=>l.jsx(Ly,{preset:H,isSelected:b===H.id,onClick:()=>te(H.id),density:"compact"},H.id))})})]})]})}),l.jsxs(_b,{value:f,onValueChange:p,className:"flex flex-col flex-1 min-h-0 overflow-hidden",children:[l.jsx("div",{className:"px-6 pt-4",children:l.jsxs(Af,{className:"grid w-full grid-cols-2",children:[l.jsxs(Cl,{value:"basic",className:"relative",children:["Basic Information",X&&l.jsx("span",{className:"absolute top-1 right-2 w-2 h-2 rounded-full bg-destructive animate-pulse"})]}),l.jsxs(Cl,{value:"models",className:"relative",children:["Model Configuration",ee&&l.jsx("span",{className:"absolute top-1 right-2 w-2 h-2 rounded-full bg-destructive animate-pulse"})]})]})}),l.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto",children:[l.jsxs(zd,{value:"basic",className:"p-6 space-y-4 mt-0",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs(un,{htmlFor:"name",children:["Profile Name ",l.jsx("span",{className:"text-destructive",children:"*"})]}),l.jsx(Hn,{id:"name",...D("name"),placeholder:"my-api",className:"font-mono"}),T.name?l.jsx("p",{className:"text-xs text-destructive",children:T.name.message}):l.jsxs("p",{className:"text-xs text-muted-foreground",children:["Used in CLI:"," ",l.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:'ccs my-api "prompt"'})]})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(un,{htmlFor:"baseUrl",children:"API Base URL"}),l.jsx(Hn,{id:"baseUrl",...D("baseUrl"),placeholder:"https://api.example.com/v1"}),T.baseUrl?l.jsx("p",{className:"text-xs text-destructive",children:T.baseUrl.message}):m?l.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:[l.jsx(Gn,{className:"w-4 h-4 shrink-0 mt-0.5"}),l.jsx("span",{children:m})]}):Z?l.jsx("p",{className:"text-xs text-muted-foreground",children:Z.baseUrl?`Pre-filled from ${Z.name}. You can customize if needed.`:`Optional for ${Z.name}. Leave blank to use native Anthropic auth.`}):l.jsx("p",{className:"text-xs text-muted-foreground",children:"The endpoint that accepts OpenAI-compatible and Anthropic requests"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs(un,{htmlFor:"apiKey",children:["API Key"," ",Z?.requiresApiKey!==!1&&l.jsx("span",{className:"text-destructive",children:"*"}),Z?.requiresApiKey===!1&&l.jsx("span",{className:"text-muted-foreground text-xs font-normal",children:"(optional)"})]}),l.jsxs("div",{className:"relative",children:[l.jsx(Hn,{id:"apiKey",type:C?"text":"password",...D("apiKey"),placeholder:Z?.requiresApiKey===!1?"Optional - only if auth is enabled":Z?.apiKeyPlaceholder??"sk-...",className:"pr-10"}),l.jsx(dt,{type:"button",variant:"ghost",size:"icon",className:"absolute right-0 top-0 h-9 w-9 text-muted-foreground hover:text-foreground",onClick:()=>x(!C),tabIndex:-1,children:C?l.jsx(Al,{className:"h-4 w-4"}):l.jsx(kl,{className:"h-4 w-4"})})]}),T.apiKey?l.jsx("p",{className:"text-xs text-destructive",children:T.apiKey.message}):Z?.requiresApiKey===!1?l.jsx("p",{className:"text-xs text-muted-foreground",children:"Only needed if your local endpoint has authentication enabled"}):Z?.apiKeyHint&&l.jsx("p",{className:"text-xs text-muted-foreground",children:Z.apiKeyHint})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(un,{htmlFor:"target",children:"Default Target CLI"}),l.jsxs(nb,{value:$,onValueChange:H=>F("target",H),children:[l.jsx(pf,{id:"target",children:l.jsx(ab,{})}),l.jsxs(mf,{children:[l.jsx(Lr,{value:"claude",children:"Claude Code (default)"}),l.jsx(Lr,{value:"droid",children:"Factory Droid"}),l.jsx(Lr,{value:"codex",children:"Codex CLI"})]})]}),l.jsxs("p",{className:"text-xs text-muted-foreground",children:[$==="droid"?l.jsxs(l.Fragment,{children:[c("profileEditor.targetHintPreferredAlias")," ",l.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:"ccs-droid"}),"."]}):$==="codex"?l.jsxs(l.Fragment,{children:[c("profileEditor.targetHintPreferredAlias")," ",l.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:"ccsx"}),"."]}):l.jsxs(l.Fragment,{children:[c("profileEditor.targetHintClaudeDefault")," ",l.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:"ccs"}),"."]}),$==="droid"?l.jsxs(l.Fragment,{children:[" ",c("profileEditor.targetHintLegacyAlias")," ",l.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:"ccsd"}),"."]}):$==="codex"?l.jsxs(l.Fragment,{children:[" ",c("profileEditor.targetHintLegacyAlias")," ",l.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:"ccs-codex"}),"."]}):null," ",c("profileEditor.targetHintOverride")," ",l.jsx("code",{className:"bg-muted px-1 rounded text-[10px]",children:"--target"}),"."]})]})]}),l.jsxs(zd,{value:"models",className:"p-6 mt-0 space-y-4",children:[l.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:[l.jsx(Tl,{className:"w-5 h-5 shrink-0 mt-0.5"}),l.jsxs("div",{children:[l.jsx("p",{className:"font-medium mb-1",children:"Model Mapping"}),l.jsx("p",{className:"text-xs opacity-90",children:"Map Claude Code tiers (Opus/Sonnet/Haiku) to models supported by your provider."})]})]}),he&&l.jsxs("div",{className:"space-y-2",children:[l.jsx(un,{children:"Search Models"}),l.jsx(Hn,{value:O,onChange:H=>R(H.target.value),placeholder:"Type to search (e.g., opus, sonnet, gpt-4o)...",onKeyDown:H=>{H.key==="Enter"&&xe.length>0&&(H.preventDefault(),be(xe[0]))}}),l.jsx("div",{className:"border rounded-md max-h-48 overflow-y-auto",children:xe.length===0?l.jsx("p",{className:"text-sm text-muted-foreground p-3 text-center",children:O?`No models found for "${O}"`:"Loading models..."}):l.jsxs("div",{className:"p-1",children:[!O&&l.jsxs("div",{className:"flex items-center gap-1.5 px-2 py-1 text-xs text-muted-foreground",children:[l.jsx(KS,{className:"w-3 h-3 text-accent"}),l.jsx("span",{children:"Newest Models"})]}),xe.map(H=>l.jsx(Jj,{model:H,onClick:()=>be(H),showAge:!O},H.id))]})})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs(un,{htmlFor:"model",children:["Default Model",l.jsx(zt,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"ANTHROPIC_MODEL"})]}),l.jsx(Hn,{id:"model",...D("model"),placeholder:Z?.defaultModel??"claude-sonnet-4",className:"font-mono text-sm"})]}),l.jsxs("div",{className:"grid gap-3 pt-2 border-t",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs(un,{htmlFor:"sonnetModel",className:"text-sm",children:["Sonnet Mapping",l.jsx(zt,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"DEFAULT_SONNET"})]}),l.jsx(Hn,{id:"sonnetModel",...D("sonnetModel"),placeholder:"e.g. gpt-4o, claude-sonnet-4",className:"font-mono text-sm h-9"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs(un,{htmlFor:"opusModel",className:"text-sm",children:["Opus Mapping",l.jsx(zt,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"DEFAULT_OPUS"})]}),l.jsx(Hn,{id:"opusModel",...D("opusModel"),placeholder:"e.g. o1, claude-opus-4.5",className:"font-mono text-sm h-9"})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs(un,{htmlFor:"haikuModel",className:"text-sm",children:["Haiku Mapping",l.jsx(zt,{variant:"outline",className:"ml-2 text-[10px] font-mono",children:"DEFAULT_HAIKU"})]}),l.jsx(Hn,{id:"haikuModel",...D("haikuModel"),placeholder:"e.g. gpt-4o-mini, claude-3.5-haiku",className:"font-mono text-sm h-9"})]})]})]})]})]}),l.jsxs(d1,{className:"p-6 pt-4 border-t bg-muted/10",children:[l.jsx(dt,{type:"button",variant:"outline",onClick:()=>a(!1),children:"Cancel"}),l.jsx(dt,{type:"submit",disabled:re,className:K(re&&"opacity-80"),children:re?l.jsxs(l.Fragment,{children:[l.jsx(On,{className:"w-4 h-4 mr-2 animate-spin"}),"Creating..."]}):l.jsxs(l.Fragment,{children:[l.jsx(Pg,{className:"w-4 h-4 mr-2"}),"Create Profile"]})})]})]})]})]})})}function Ly({preset:n,isSelected:a,onClick:o,density:s="compact"}){const c=n.id==="anthropic",d=s==="featured";return l.jsxs("button",{type:"button",onClick:o,className:K("flex flex-none items-center gap-3 rounded-xl border px-3 py-2.5 text-left transition-all",d?"h-[68px] w-[236px]":"h-[64px] w-[168px]",a?"border-primary bg-primary/8 shadow-sm ring-1 ring-primary/10":"border-border/60 bg-background hover:border-primary/40 hover:bg-accent/20"),children:[l.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-border/60 bg-background",children:c?l.jsx(zj,{provider:"claude",size:"md",className:"rounded-lg"}):n.icon?l.jsx("img",{src:n.icon,alt:"",className:"h-5 w-5 object-contain"}):l.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-lg bg-muted/70 text-xs font-semibold text-foreground/70",children:n.name.charAt(0)})}),l.jsxs("div",{className:"min-w-0 flex-1 space-y-1",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("div",{className:"truncate text-[13px] font-semibold leading-tight tracking-[-0.01em]",children:n.name}),n.badge&&d&&l.jsx(zt,{variant:"secondary",className:"inline-flex bg-muted px-1.5 py-0 text-[10px] text-muted-foreground",children:n.badge})]}),n.badge&&!d&&l.jsx(zt,{variant:"secondary",className:"inline-flex w-fit bg-muted px-1.5 py-0 text-[10px] text-muted-foreground",children:n.badge})]})]})}function Zj({isSelected:n,onClick:a}){const{t:o}=Mt();return l.jsxs("button",{type:"button",onClick:a,className:K("flex h-[68px] w-[236px] flex-none items-center gap-3 rounded-xl border border-dashed px-3 py-2.5 text-left transition-all",n?"border-primary bg-primary/8 shadow-sm ring-1 ring-primary/10":"border-muted-foreground/30 bg-background hover:border-primary/40 hover:bg-accent/20"),children:[l.jsx("div",{className:"flex h-9 w-9 shrink-0 items-center justify-center rounded-lg border border-dashed border-current/30 bg-muted/70",children:l.jsx(Yd,{className:"h-4 w-4 text-muted-foreground"})}),l.jsx("div",{className:"min-w-0 flex-1",children:l.jsx("div",{className:"text-sm font-semibold leading-tight",children:o("profileEditor.customEndpoint")})})]})}function Jj({model:n,onClick:a,showAge:o}){return l.jsxs("button",{type:"button",onClick:a,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:[l.jsx("span",{className:"flex-1 truncate",children:n.name}),l.jsxs("span",{className:"text-muted-foreground group-hover:text-accent-foreground/80 ml-2 flex items-center gap-2 text-xs",children:[o&&n.created&&l.jsx(zt,{variant:"outline",className:"text-[10px] text-accent group-hover:text-accent-foreground/80 group-hover:border-accent-foreground/30",children:Cj(n.created)}),n.isFree?l.jsx(zt,{variant:"secondary",className:"text-xs group-hover:bg-accent-foreground/20 group-hover:text-accent-foreground",children:"Free"}):l.jsx("span",{children:dj(n.pricing)}),l.jsx("span",{children:xj(n.context_length)})]})]})}function eT({className:n,...a}){return l.jsx("div",{"data-slot":"card",className:K("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",n),...a})}function tT({className:n,...a}){return l.jsx("div",{"data-slot":"card-header",className:K("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-2 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",n),...a})}function nT({className:n,...a}){return l.jsx("div",{"data-slot":"card-title",className:K("leading-none font-semibold",n),...a})}function aT({className:n,...a}){return l.jsx("div",{"data-slot":"card-description",className:K("text-muted-foreground text-sm",n),...a})}function iT({className:n,...a}){return l.jsx("div",{"data-slot":"card-content",className:K("px-6",n),...a})}const Mf="[1m]",Ef=["ANTHROPIC_MODEL","ANTHROPIC_DEFAULT_OPUS_MODEL","ANTHROPIC_DEFAULT_SONNET_MODEL","ANTHROPIC_DEFAULT_HAIKU_MODEL"],oT=new Set(Ef);function HO(n){return n.toLowerCase().startsWith("gemini-")}function Of(n){return n.toLowerCase().endsWith(Mf.toLowerCase())}function rT(n){return!n||Of(n)?n:`${n}${Mf}`}function Fb(n){return n&&(Of(n)?n.slice(0,-Mf.length):n)}function BO(n){return oT.has(n)}function sT(n){return Fb(n.trim()).replace(/\([^)]+\)$/,"")}function KO(n){return Ef.some(a=>{const o=n[a];return typeof o=="string"&&Of(o)})}function qO(n,a,o={}){const s={...n};for(const c of Ef){const d=s[c];if(typeof d!="string"||d.trim().length===0)continue;const f=sT(d),p=o.supportsExtendedContext?.(f,c)??!0;s[c]=a&&p?rT(d):Fb(d)}return s}const lT=["agy","claude","gemini","codex","qwen","kimi","iflow","kiro","ghcp"],FO=lT.map(n=>({id:n,name:hf(n),description:A1(n)})),cT=["provider","auth","variant","success"];function GO(n){return n==="account"?1:cT.indexOf(n)}const VO=aS,YO=oS,$O=iS,uT=S.forwardRef(({className:n,align:a="center",sideOffset:o=4,...s},c)=>l.jsx(nS,{children:l.jsx(Sx,{ref:c,align:a,sideOffset:o,className:K("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",n),...s})}));uT.displayName=Sx.displayName;const dT=S.lazy(()=>tt(()=>Promise.resolve().then(()=>ql),void 0).then(n=>({default:n.CodeEditor})));function QO({rawJsonContent:n,isRawJsonValid:a,rawJsonEdits:o,onRawJsonChange:s,profileEnv:c,missingRequiredFields:d=[]}){const f=d.length>0;return l.jsx(S.Suspense,{fallback:l.jsxs("div",{className:"flex items-center justify-center h-full",children:[l.jsx(On,{className:"w-6 h-6 animate-spin text-muted-foreground"}),l.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading editor..."})]}),children:l.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[!a&&o!==null&&l.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:[l.jsx(No,{className:"w-4 h-4"}),"Invalid JSON syntax"]}),a&&f&&l.jsxs("div",{className:"mb-2 px-3 py-2 bg-warning/10 text-warning-foreground text-sm rounded-md flex items-start gap-2 mx-6 mt-4 shrink-0 border border-warning/20",children:[l.jsx(Gn,{className:"w-4 h-4 mt-0.5 text-amber-500 shrink-0"}),l.jsxs("div",{children:[l.jsx("span",{className:"font-medium text-amber-600 dark:text-amber-400",children:"Missing required fields:"})," ",l.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:d.join(", ")}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"Apply a preset from Model Config tab or add these fields manually. Without them, Claude Code will fail with 404 errors."})]})]}),l.jsx("div",{className:"min-h-0 flex-1 overflow-hidden px-6 pb-4 pt-4",children:l.jsx("div",{className:"h-full border rounded-md overflow-hidden bg-background",children:l.jsx(dT,{value:n,onChange:s,language:"json",minHeight:"100%",heightMode:"fill-parent"})})}),l.jsx("div",{className:"mx-6 mb-4",children:l.jsx("div",{className:"border rounded-md overflow-hidden",children:l.jsx(Df,{profileEnv:c})})})]})})}var Qt={},Ry;function fT(){if(Ry)return Qt;Ry=1;var n=Qt&&Qt.__assign||function(){return n=Object.assign||function(T){for(var w,P=1,F=arguments.length;P<F;P++){w=arguments[P];for(var z in w)Object.prototype.hasOwnProperty.call(w,z)&&(T[z]=w[z])}return T},n.apply(this,arguments)},a=Qt&&Qt.__createBinding||(Object.create?(function(T,w,P,F){F===void 0&&(F=P);var z=Object.getOwnPropertyDescriptor(w,P);(!z||("get"in z?!w.__esModule:z.writable||z.configurable))&&(z={enumerable:!0,get:function(){return w[P]}}),Object.defineProperty(T,F,z)}):(function(T,w,P,F){F===void 0&&(F=P),T[F]=w[P]})),o=Qt&&Qt.__setModuleDefault||(Object.create?(function(T,w){Object.defineProperty(T,"default",{enumerable:!0,value:w})}):function(T,w){T.default=w}),s=Qt&&Qt.__importStar||function(T){if(T&&T.__esModule)return T;var w={};if(T!=null)for(var P in T)P!=="default"&&Object.prototype.hasOwnProperty.call(T,P)&&a(w,T,P);return o(w,T),w},c=Qt&&Qt.__rest||function(T,w){var P={};for(var F in T)Object.prototype.hasOwnProperty.call(T,F)&&w.indexOf(F)<0&&(P[F]=T[F]);if(T!=null&&typeof Object.getOwnPropertySymbols=="function")for(var z=0,F=Object.getOwnPropertySymbols(T);z<F.length;z++)w.indexOf(F[z])<0&&Object.prototype.propertyIsEnumerable.call(T,F[z])&&(P[F[z]]=T[F[z]]);return P};Object.defineProperty(Qt,"__esModule",{value:!0});var d=s(Kd()),f=89,p=90,m=77,y=57,C=219,x=222,b=192,A=100,N=3e3,E=typeof window<"u"&&"navigator"in window&&/Win/i.test(navigator.platform),O=typeof window<"u"&&"navigator"in window&&/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform),R="npm__react-simple-code-editor__textarea",k=`
15
- /**
16
- * Reset the text fill color so that placeholder is visible
17
- */
18
- .`.concat(R,`: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(R,` {
32
- color: transparent !important;
33
- }
34
-
35
- .`).concat(R,`::selection {
36
- background-color: #accef7 !important;
37
- color: transparent !important;
38
- }
39
- }
40
- `),D=d.forwardRef(function(w,P){var F=w.autoFocus,z=w.disabled,$=w.form,ne=w.highlight,Z=w.ignoreTabKey,xe=Z===void 0?!1:Z,te=w.insertSpaces,be=te===void 0?!0:te,I=w.maxLength,X=w.minLength,ee=w.name,re=w.onBlur,fe=w.onClick,he=w.onFocus,de=w.onKeyDown,H=w.onKeyUp,Q=w.onValueChange,ie=w.padding,ae=ie===void 0?0:ie,oe=w.placeholder,ge=w.preClassName,De=w.readOnly,Ue=w.required,st=w.style,gt=w.tabSize,qe=gt===void 0?2:gt,lt=w.textareaClassName,Bt=w.textareaId,Xt=w.value,Yn=c(w,["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"]),je=d.useRef({stack:[],offset:-1}),Zt=d.useRef(null),Pn=d.useState(!0),Jt=Pn[0],ka=Pn[1],$n={paddingTop:typeof ae=="object"?ae.top:ae,paddingRight:typeof ae=="object"?ae.right:ae,paddingBottom:typeof ae=="object"?ae.bottom:ae,paddingLeft:typeof ae=="object"?ae.left:ae},yt=ne(Xt),en=function(J,Ee){return J.substring(0,Ee).split(`
41
- `)},Qn=d.useCallback(function(J,Ee){var Ce,Oe,ct;Ee===void 0&&(Ee=!1);var me=je.current,ke=me.stack,Se=me.offset;if(ke.length&&Se>-1){je.current.stack=ke.slice(0,Se+1);var Pe=je.current.stack.length;if(Pe>A){var at=Pe-A;je.current.stack=ke.slice(at,Pe),je.current.offset=Math.max(je.current.offset-at,0)}}var Ne=Date.now();if(Ee){var It=je.current.stack[je.current.offset];if(It&&Ne-It.timestamp<N){var Xn=/[^a-z0-9]([a-z0-9]+)$/i,kt=(Ce=en(It.value,It.selectionStart).pop())===null||Ce===void 0?void 0:Ce.match(Xn),tn=(Oe=en(J.value,J.selectionStart).pop())===null||Oe===void 0?void 0:Oe.match(Xn);if(kt?.[1]&&(!((ct=tn?.[1])===null||ct===void 0)&&ct.startsWith(kt[1]))){je.current.stack[je.current.offset]=n(n({},J),{timestamp:Ne});return}}}je.current.stack.push(n(n({},J),{timestamp:Ne})),je.current.offset++},[]),ni=d.useCallback(function(){var J=Zt.current;if(J){var Ee=J.value,Ce=J.selectionStart,Oe=J.selectionEnd;Qn({value:Ee,selectionStart:Ce,selectionEnd:Oe})}},[Qn]),Ln=function(J){var Ee=Zt.current;Ee&&(Ee.value=J.value,Ee.selectionStart=J.selectionStart,Ee.selectionEnd=J.selectionEnd,Q?.(J.value))},Rn=function(J){var Ee=Zt.current,Ce=je.current.stack[je.current.offset];Ce&&Ee&&(je.current.stack[je.current.offset]=n(n({},Ce),{selectionStart:Ee.selectionStart,selectionEnd:Ee.selectionEnd})),Qn(J),Ln(J)},Ti=function(){var J=je.current,Ee=J.stack,Ce=J.offset,Oe=Ee[Ce-1];Oe&&(Ln(Oe),je.current.offset=Math.max(Ce-1,0))},ko=function(){var J=je.current,Ee=J.stack,Ce=J.offset,Oe=Ee[Ce+1];Oe&&(Ln(Oe),je.current.offset=Math.min(Ce+1,Ee.length-1))},Do=function(J){if(!(de&&(de(J),J.defaultPrevented))){J.key==="Escape"&&J.currentTarget.blur();var Ee=J.currentTarget,Ce=Ee.value,Oe=Ee.selectionStart,ct=Ee.selectionEnd,me=(be?" ":" ").repeat(qe);if(J.key==="Tab"&&!xe&&Jt)if(J.preventDefault(),J.shiftKey){var ke=en(Ce,Oe),Se=ke.length-1,Pe=en(Ce,ct).length-1,at=Ce.split(`
42
- `).map(function(Zn,Mi){return Mi>=Se&&Mi<=Pe&&Zn.startsWith(me)?Zn.substring(me.length):Zn}).join(`
43
- `);if(Ce!==at){var Ne=ke[Se];Rn({value:at,selectionStart:Ne?.startsWith(me)?Oe-me.length:Oe,selectionEnd:ct-(Ce.length-at.length)})}}else if(Oe!==ct){var ke=en(Ce,Oe),It=ke.length-1,Xn=en(Ce,ct).length-1,Ne=ke[It];Rn({value:Ce.split(`
44
- `).map(function(Mo,Eo){return Eo>=It&&Eo<=Xn?me+Mo:Mo}).join(`
45
- `),selectionStart:Ne&&/\S/.test(Ne)?Oe+me.length:Oe,selectionEnd:ct+me.length*(Xn-It+1)})}else{var kt=Oe+me.length;Rn({value:Ce.substring(0,Oe)+me+Ce.substring(ct),selectionStart:kt,selectionEnd:kt})}else if(J.key==="Backspace"){var tn=Oe!==ct,An=Ce.substring(0,Oe);if(An.endsWith(me)&&!tn){J.preventDefault();var kt=Oe-me.length;Rn({value:Ce.substring(0,Oe-me.length)+Ce.substring(ct),selectionStart:kt,selectionEnd:kt})}}else if(J.key==="Enter"){if(Oe===ct){var jo=en(Ce,Oe).pop(),ai=jo?.match(/^\s+/);if(ai?.[0]){J.preventDefault();var To=`
46
- `+ai[0],kt=Oe+To.length;Rn({value:Ce.substring(0,Oe)+To+Ce.substring(ct),selectionStart:kt,selectionEnd:kt})}}}else if(J.keyCode===y||J.keyCode===C||J.keyCode===x||J.keyCode===b){var pn=void 0;J.keyCode===y&&J.shiftKey?pn=["(",")"]:J.keyCode===C?J.shiftKey?pn=["{","}"]:pn=["[","]"]:J.keyCode===x?J.shiftKey?pn=['"','"']:pn=["'","'"]:J.keyCode===b&&!J.shiftKey&&(pn=["`","`"]),Oe!==ct&&pn&&(J.preventDefault(),Rn({value:Ce.substring(0,Oe)+pn[0]+Ce.substring(Oe,ct)+pn[1]+Ce.substring(ct),selectionStart:Oe,selectionEnd:ct+2}))}else(O?J.metaKey&&J.keyCode===p:J.ctrlKey&&J.keyCode===p)&&!J.shiftKey&&!J.altKey?(J.preventDefault(),Ti()):(O?J.metaKey&&J.keyCode===p&&J.shiftKey:E?J.ctrlKey&&J.keyCode===f:J.ctrlKey&&J.keyCode===p&&J.shiftKey)&&!J.altKey?(J.preventDefault(),ko()):J.keyCode===m&&J.ctrlKey&&(!O||J.shiftKey)&&(J.preventDefault(),ka(function(Zn){return!Zn}))}},Wn=function(J){var Ee=J.currentTarget,Ce=Ee.value,Oe=Ee.selectionStart,ct=Ee.selectionEnd;Qn({value:Ce,selectionStart:Oe,selectionEnd:ct},!0),Q(Ce)};return d.useEffect(function(){ni()},[ni]),d.useImperativeHandle(P,function(){return{get session(){return{history:je.current}},set session(J){je.current=J.history}}},[]),d.createElement("div",n({},Yn,{style:n(n({},j.container),st)}),d.createElement("pre",n({className:ge,"aria-hidden":"true",style:n(n(n({},j.editor),j.highlight),$n)},typeof yt=="string"?{dangerouslySetInnerHTML:{__html:yt+"<br />"}}:{children:yt})),d.createElement("textarea",{ref:function(J){return Zt.current=J},style:n(n(n({},j.editor),j.textarea),$n),className:R+(lt?" ".concat(lt):""),id:Bt,value:Xt,onChange:Wn,onKeyDown:Do,onClick:fe,onKeyUp:H,onFocus:he,onBlur:re,disabled:z,form:$,maxLength:I,minLength:X,name:ee,placeholder:oe,readOnly:De,required:Ue,autoFocus:F,autoCapitalize:"off",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"data-gramm":!1}),d.createElement("style",{dangerouslySetInnerHTML:{__html:k}}))}),j={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=D,Qt}var hT=fT();const pT=wx(hT);var bd={exports:{}},_y;function mT(){return _y||(_y=1,(function(n){var a=typeof window<"u"?window:typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope?self:{};var o=(function(s){var c=/(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i,d=0,f={},p={manual:s.Prism&&s.Prism.manual,disableWorkerMessageHandler:s.Prism&&s.Prism.disableWorkerMessageHandler,util:{encode:function k(D){return D instanceof m?new m(D.type,k(D.content),D.alias):Array.isArray(D)?D.map(k):D.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/\u00a0/g," ")},type:function(k){return Object.prototype.toString.call(k).slice(8,-1)},objId:function(k){return k.__id||Object.defineProperty(k,"__id",{value:++d}),k.__id},clone:function k(D,j){j=j||{};var T,w;switch(p.util.type(D)){case"Object":if(w=p.util.objId(D),j[w])return j[w];T={},j[w]=T;for(var P in D)D.hasOwnProperty(P)&&(T[P]=k(D[P],j));return T;case"Array":return w=p.util.objId(D),j[w]?j[w]:(T=[],j[w]=T,D.forEach(function(F,z){T[z]=k(F,j)}),T);default:return D}},getLanguage:function(k){for(;k;){var D=c.exec(k.className);if(D)return D[1].toLowerCase();k=k.parentElement}return"none"},setLanguage:function(k,D){k.className=k.className.replace(RegExp(c,"gi"),""),k.classList.add("language-"+D)},currentScript:function(){if(typeof document>"u")return null;if(document.currentScript&&document.currentScript.tagName==="SCRIPT")return document.currentScript;try{throw new Error}catch(T){var k=(/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(T.stack)||[])[1];if(k){var D=document.getElementsByTagName("script");for(var j in D)if(D[j].src==k)return D[j]}return null}},isActive:function(k,D,j){for(var T="no-"+D;k;){var w=k.classList;if(w.contains(D))return!0;if(w.contains(T))return!1;k=k.parentElement}return!!j}},languages:{plain:f,plaintext:f,text:f,txt:f,extend:function(k,D){var j=p.util.clone(p.languages[k]);for(var T in D)j[T]=D[T];return j},insertBefore:function(k,D,j,T){T=T||p.languages;var w=T[k],P={};for(var F in w)if(w.hasOwnProperty(F)){if(F==D)for(var z in j)j.hasOwnProperty(z)&&(P[z]=j[z]);j.hasOwnProperty(F)||(P[F]=w[F])}var $=T[k];return T[k]=P,p.languages.DFS(p.languages,function(ne,Z){Z===$&&ne!=k&&(this[ne]=P)}),P},DFS:function k(D,j,T,w){w=w||{};var P=p.util.objId;for(var F in D)if(D.hasOwnProperty(F)){j.call(D,F,D[F],T||F);var z=D[F],$=p.util.type(z);$==="Object"&&!w[P(z)]?(w[P(z)]=!0,k(z,j,null,w)):$==="Array"&&!w[P(z)]&&(w[P(z)]=!0,k(z,j,F,w))}}},plugins:{},highlightAll:function(k,D){p.highlightAllUnder(document,k,D)},highlightAllUnder:function(k,D,j){var T={callback:j,container:k,selector:'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'};p.hooks.run("before-highlightall",T),T.elements=Array.prototype.slice.apply(T.container.querySelectorAll(T.selector)),p.hooks.run("before-all-elements-highlight",T);for(var w=0,P;P=T.elements[w++];)p.highlightElement(P,D===!0,T.callback)},highlightElement:function(k,D,j){var T=p.util.getLanguage(k),w=p.languages[T];p.util.setLanguage(k,T);var P=k.parentElement;P&&P.nodeName.toLowerCase()==="pre"&&p.util.setLanguage(P,T);var F=k.textContent,z={element:k,language:T,grammar:w,code:F};function $(Z){z.highlightedCode=Z,p.hooks.run("before-insert",z),z.element.innerHTML=z.highlightedCode,p.hooks.run("after-highlight",z),p.hooks.run("complete",z),j&&j.call(z.element)}if(p.hooks.run("before-sanity-check",z),P=z.element.parentElement,P&&P.nodeName.toLowerCase()==="pre"&&!P.hasAttribute("tabindex")&&P.setAttribute("tabindex","0"),!z.code){p.hooks.run("complete",z),j&&j.call(z.element);return}if(p.hooks.run("before-highlight",z),!z.grammar){$(p.util.encode(z.code));return}if(D&&s.Worker){var ne=new Worker(p.filename);ne.onmessage=function(Z){$(Z.data)},ne.postMessage(JSON.stringify({language:z.language,code:z.code,immediateClose:!0}))}else $(p.highlight(z.code,z.grammar,z.language))},highlight:function(k,D,j){var T={code:k,grammar:D,language:j};if(p.hooks.run("before-tokenize",T),!T.grammar)throw new Error('The language "'+T.language+'" has no grammar.');return T.tokens=p.tokenize(T.code,T.grammar),p.hooks.run("after-tokenize",T),m.stringify(p.util.encode(T.tokens),T.language)},tokenize:function(k,D){var j=D.rest;if(j){for(var T in j)D[T]=j[T];delete D.rest}var w=new x;return b(w,w.head,k),C(k,w,D,w.head,0),N(w)},hooks:{all:{},add:function(k,D){var j=p.hooks.all;j[k]=j[k]||[],j[k].push(D)},run:function(k,D){var j=p.hooks.all[k];if(!(!j||!j.length))for(var T=0,w;w=j[T++];)w(D)}},Token:m};s.Prism=p;function m(k,D,j,T){this.type=k,this.content=D,this.alias=j,this.length=(T||"").length|0}m.stringify=function k(D,j){if(typeof D=="string")return D;if(Array.isArray(D)){var T="";return D.forEach(function($){T+=k($,j)}),T}var w={type:D.type,content:k(D.content,j),tag:"span",classes:["token",D.type],attributes:{},language:j},P=D.alias;P&&(Array.isArray(P)?Array.prototype.push.apply(w.classes,P):w.classes.push(P)),p.hooks.run("wrap",w);var F="";for(var z in w.attributes)F+=" "+z+'="'+(w.attributes[z]||"").replace(/"/g,"&quot;")+'"';return"<"+w.tag+' class="'+w.classes.join(" ")+'"'+F+">"+w.content+"</"+w.tag+">"};function y(k,D,j,T){k.lastIndex=D;var w=k.exec(j);if(w&&T&&w[1]){var P=w[1].length;w.index+=P,w[0]=w[0].slice(P)}return w}function C(k,D,j,T,w,P){for(var F in j)if(!(!j.hasOwnProperty(F)||!j[F])){var z=j[F];z=Array.isArray(z)?z:[z];for(var $=0;$<z.length;++$){if(P&&P.cause==F+","+$)return;var ne=z[$],Z=ne.inside,xe=!!ne.lookbehind,te=!!ne.greedy,be=ne.alias;if(te&&!ne.pattern.global){var I=ne.pattern.toString().match(/[imsuy]*$/)[0];ne.pattern=RegExp(ne.pattern.source,I+"g")}for(var X=ne.pattern||ne,ee=T.next,re=w;ee!==D.tail&&!(P&&re>=P.reach);re+=ee.value.length,ee=ee.next){var fe=ee.value;if(D.length>k.length)return;if(!(fe instanceof m)){var he=1,de;if(te){if(de=y(X,re,k,xe),!de||de.index>=k.length)break;var ae=de.index,H=de.index+de[0].length,Q=re;for(Q+=ee.value.length;ae>=Q;)ee=ee.next,Q+=ee.value.length;if(Q-=ee.value.length,re=Q,ee.value instanceof m)continue;for(var ie=ee;ie!==D.tail&&(Q<H||typeof ie.value=="string");ie=ie.next)he++,Q+=ie.value.length;he--,fe=k.slice(re,Q),de.index-=re}else if(de=y(X,0,fe,xe),!de)continue;var ae=de.index,oe=de[0],ge=fe.slice(0,ae),De=fe.slice(ae+oe.length),Ue=re+fe.length;P&&Ue>P.reach&&(P.reach=Ue);var st=ee.prev;ge&&(st=b(D,st,ge),re+=ge.length),A(D,st,he);var gt=new m(F,Z?p.tokenize(oe,Z):oe,be,oe);if(ee=b(D,st,gt),De&&b(D,ee,De),he>1){var qe={cause:F+","+$,reach:Ue};C(k,D,j,ee.prev,re,qe),P&&qe.reach>P.reach&&(P.reach=qe.reach)}}}}}}function x(){var k={value:null,prev:null,next:null},D={value:null,prev:k,next:null};k.next=D,this.head=k,this.tail=D,this.length=0}function b(k,D,j){var T=D.next,w={value:j,prev:D,next:T};return D.next=w,T.prev=w,k.length++,w}function A(k,D,j){for(var T=D.next,w=0;w<j&&T!==k.tail;w++)T=T.next;D.next=T,T.prev=D,k.length-=w}function N(k){for(var D=[],j=k.head.next;j!==k.tail;)D.push(j.value),j=j.next;return D}if(!s.document)return s.addEventListener&&(p.disableWorkerMessageHandler||s.addEventListener("message",function(k){var D=JSON.parse(k.data),j=D.language,T=D.code,w=D.immediateClose;s.postMessage(p.highlight(T,p.languages[j],j)),w&&s.close()},!1)),p;var E=p.util.currentScript();E&&(p.filename=E.src,E.hasAttribute("data-manual")&&(p.manual=!0));function O(){p.manual||p.highlightAll()}if(!p.manual){var R=document.readyState;R==="loading"||R==="interactive"&&E&&E.defer?document.addEventListener("DOMContentLoaded",O):window.requestAnimationFrame?window.requestAnimationFrame(O):window.setTimeout(O,16)}return p})(a);n.exports&&(n.exports=o),typeof Tg<"u"&&(Tg.Prism=o),o.languages.markup={comment:{pattern:/<!--(?:(?!<!--)[\s\S])*?-->/,greedy:!0},prolog:{pattern:/<\?[\s\S]+?\?>/,greedy:!0},doctype:{pattern:/<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,greedy:!0,inside:{"internal-subset":{pattern:/(^[^\[]*\[)[\s\S]+(?=\]>$)/,lookbehind:!0,greedy:!0,inside:null},string:{pattern:/"[^"]*"|'[^']*'/,greedy:!0},punctuation:/^<!|>$|[[\]]/,"doctype-tag":/^DOCTYPE/i,name:/[^\s<>'"]+/}},cdata:{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,greedy:!0},tag:{pattern:/<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,greedy:!0,inside:{tag:{pattern:/^<\/?[^\s>\/]+/,inside:{punctuation:/^<\/?/,namespace:/^[^\s>\/:]+:/}},"special-attr":[],"attr-value":{pattern:/=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,inside:{punctuation:[{pattern:/^=/,alias:"attr-equals"},{pattern:/^(\s*)["']|["']$/,lookbehind:!0}]}},punctuation:/\/?>/,"attr-name":{pattern:/[^\s>\/]+/,inside:{namespace:/^[^\s>\/:]+:/}}}},entity:[{pattern:/&[\da-z]{1,8};/i,alias:"named-entity"},/&#x?[\da-f]{1,8};/i]},o.languages.markup.tag.inside["attr-value"].inside.entity=o.languages.markup.entity,o.languages.markup.doctype.inside["internal-subset"].inside=o.languages.markup,o.hooks.add("wrap",function(s){s.type==="entity"&&(s.attributes.title=s.content.replace(/&amp;/,"&"))}),Object.defineProperty(o.languages.markup.tag,"addInlined",{value:function(c,d){var f={};f["language-"+d]={pattern:/(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,lookbehind:!0,inside:o.languages[d]},f.cdata=/^<!\[CDATA\[|\]\]>$/i;var p={"included-cdata":{pattern:/<!\[CDATA\[[\s\S]*?\]\]>/i,inside:f}};p["language-"+d]={pattern:/[\s\S]+/,inside:o.languages[d]};var m={};m[c]={pattern:RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g,function(){return c}),"i"),lookbehind:!0,greedy:!0,inside:p},o.languages.insertBefore("markup","cdata",m)}}),Object.defineProperty(o.languages.markup.tag,"addAttribute",{value:function(s,c){o.languages.markup.tag.inside["special-attr"].push({pattern:RegExp(/(^|["'\s])/.source+"(?:"+s+")"+/\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,"i"),lookbehind:!0,inside:{"attr-name":/^[^\s=]+/,"attr-value":{pattern:/=[\s\S]+/,inside:{value:{pattern:/(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,lookbehind:!0,alias:[c,"language-"+c],inside:o.languages[c]},punctuation:[{pattern:/^=/,alias:"attr-equals"},/"|'/]}}}})}}),o.languages.html=o.languages.markup,o.languages.mathml=o.languages.markup,o.languages.svg=o.languages.markup,o.languages.xml=o.languages.extend("markup",{}),o.languages.ssml=o.languages.xml,o.languages.atom=o.languages.xml,o.languages.rss=o.languages.xml,(function(s){var c=/(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;s.languages.css={comment:/\/\*[\s\S]*?\*\//,atrule:{pattern:RegExp("@[\\w-](?:"+/[^;{\s"']|\s+(?!\s)/.source+"|"+c.source+")*?"+/(?:;|(?=\s*\{))/.source),inside:{rule:/^@[\w-]+/,"selector-function-argument":{pattern:/(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,lookbehind:!0,alias:"selector"},keyword:{pattern:/(^|[^\w-])(?:and|not|only|or)(?![\w-])/,lookbehind:!0}}},url:{pattern:RegExp("\\burl\\((?:"+c.source+"|"+/(?:[^\\\r\n()"']|\\[\s\S])*/.source+")\\)","i"),greedy:!0,inside:{function:/^url/i,punctuation:/^\(|\)$/,string:{pattern:RegExp("^"+c.source+"$"),alias:"url"}}},selector:{pattern:RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|`+c.source+")*(?=\\s*\\{)"),lookbehind:!0},string:{pattern:c,greedy:!0},property:{pattern:/(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,lookbehind:!0},important:/!important\b/i,function:{pattern:/(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,lookbehind:!0},punctuation:/[(){};:,]/},s.languages.css.atrule.inside.rest=s.languages.css;var d=s.languages.markup;d&&(d.tag.addInlined("style","css"),d.tag.addAttribute("style","css"))})(o),o.languages.clike={comment:[{pattern:/(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,lookbehind:!0,greedy:!0},{pattern:/(^|[^\\:])\/\/.*/,lookbehind:!0,greedy:!0}],string:{pattern:/(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,greedy:!0},"class-name":{pattern:/(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,lookbehind:!0,inside:{punctuation:/[.\\]/}},keyword:/\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,boolean:/\b(?:false|true)\b/,function:/\b\w+(?=\()/,number:/\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,operator:/[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,punctuation:/[{}[\];(),.:]/},o.languages.javascript=o.languages.extend("clike",{"class-name":[o.languages.clike["class-name"],{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,lookbehind:!0}],keyword:[{pattern:/((?:^|\})\s*)catch\b/,lookbehind:!0},{pattern:/(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,lookbehind:!0}],function:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,number:{pattern:RegExp(/(^|[^\w$])/.source+"(?:"+(/NaN|Infinity/.source+"|"+/0[bB][01]+(?:_[01]+)*n?/.source+"|"+/0[oO][0-7]+(?:_[0-7]+)*n?/.source+"|"+/0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source+"|"+/\d+(?:_\d+)*n/.source+"|"+/(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source)+")"+/(?![\w$])/.source),lookbehind:!0},operator:/--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/}),o.languages.javascript["class-name"][0].pattern=/(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/,o.languages.insertBefore("javascript","keyword",{regex:{pattern:RegExp(/((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source+/\//.source+"(?:"+/(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source+"|"+/(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source+")"+/(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source),lookbehind:!0,greedy:!0,inside:{"regex-source":{pattern:/^(\/)[\s\S]+(?=\/[a-z]*$)/,lookbehind:!0,alias:"language-regex",inside:o.languages.regex},"regex-delimiter":/^\/|\/$/,"regex-flags":/^[a-z]+$/}},"function-variable":{pattern:/#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,alias:"function"},parameter:[{pattern:/(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,lookbehind:!0,inside:o.languages.javascript},{pattern:/(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,lookbehind:!0,inside:o.languages.javascript},{pattern:/(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,lookbehind:!0,inside:o.languages.javascript},{pattern:/((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,lookbehind:!0,inside:o.languages.javascript}],constant:/\b[A-Z](?:[A-Z_]|\dx?)*\b/}),o.languages.insertBefore("javascript","string",{hashbang:{pattern:/^#!.*/,greedy:!0,alias:"comment"},"template-string":{pattern:/`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,greedy:!0,inside:{"template-punctuation":{pattern:/^`|`$/,alias:"string"},interpolation:{pattern:/((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,lookbehind:!0,inside:{"interpolation-punctuation":{pattern:/^\$\{|\}$/,alias:"punctuation"},rest:o.languages.javascript}},string:/[\s\S]+/}},"string-property":{pattern:/((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,lookbehind:!0,greedy:!0,alias:"property"}}),o.languages.insertBefore("javascript","operator",{"literal-property":{pattern:/((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,lookbehind:!0,alias:"property"}}),o.languages.markup&&(o.languages.markup.tag.addInlined("script","javascript"),o.languages.markup.tag.addAttribute(/on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,"javascript")),o.languages.js=o.languages.javascript,(function(){if(typeof o>"u"||typeof document>"u")return;Element.prototype.matches||(Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector);var s="Loading…",c=function(E,O){return"✖ Error "+E+" while fetching file: "+O},d="✖ Error: File does not exist or is empty",f={js:"javascript",py:"python",rb:"ruby",ps1:"powershell",psm1:"powershell",sh:"bash",bat:"batch",h:"c",tex:"latex"},p="data-src-status",m="loading",y="loaded",C="failed",x="pre[data-src]:not(["+p+'="'+y+'"]):not(['+p+'="'+m+'"])';function b(E,O,R){var k=new XMLHttpRequest;k.open("GET",E,!0),k.onreadystatechange=function(){k.readyState==4&&(k.status<400&&k.responseText?O(k.responseText):k.status>=400?R(c(k.status,k.statusText)):R(d))},k.send(null)}function A(E){var O=/^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(E||"");if(O){var R=Number(O[1]),k=O[2],D=O[3];return k?D?[R,Number(D)]:[R,void 0]:[R,R]}}o.hooks.add("before-highlightall",function(E){E.selector+=", "+x}),o.hooks.add("before-sanity-check",function(E){var O=E.element;if(O.matches(x)){E.code="",O.setAttribute(p,m);var R=O.appendChild(document.createElement("CODE"));R.textContent=s;var k=O.getAttribute("data-src"),D=E.language;if(D==="none"){var j=(/\.(\w+)$/.exec(k)||[,"none"])[1];D=f[j]||j}o.util.setLanguage(R,D),o.util.setLanguage(O,D);var T=o.plugins.autoloader;T&&T.loadLanguages(D),b(k,function(w){O.setAttribute(p,y);var P=A(O.getAttribute("data-range"));if(P){var F=w.split(/\r\n?|\n/g),z=P[0],$=P[1]==null?F.length:P[1];z<0&&(z+=F.length),z=Math.max(0,Math.min(z-1,F.length)),$<0&&($+=F.length),$=Math.max(0,Math.min($,F.length)),w=F.slice(z,$).join(`
47
- `),O.hasAttribute("data-start")||O.setAttribute("data-start",String(z+1))}R.textContent=w,o.highlightElement(R)},function(w){O.setAttribute(p,C),R.textContent=w})}}),o.plugins.fileHighlight={highlight:function(O){for(var R=(O||document).querySelectorAll(x),k=0,D;D=R[k++];)o.highlightElement(D)}};var N=!1;o.fileHighlight=function(){N||(console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."),N=!0),o.plugins.fileHighlight.highlight.apply(this,arguments)}})()})(bd)),bd.exports}var gT=mT();const yT=wx(gT);Prism.languages.json={property:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?=\s*:)/,lookbehind:!0,greedy:!0},string:{pattern:/(^|[^\\])"(?:\\.|[^\\"\r\n])*"(?!\s*:)/,lookbehind:!0,greedy:!0},comment:{pattern:/\/\/.*|\/\*[\s\S]*?(?:\*\/|$)/,greedy:!0},number:/-?\b\d+(?:\.\d+)?(?:e[+-]?\d+)?\b/i,punctuation:/[{}[\],]/,operator:/:/,boolean:/\b(?:false|true)\b/,null:{pattern:/\bnull\b/,alias:"keyword"}};Prism.languages.webmanifest=Prism.languages.json;(function(n){var a=/[*&][^\s[\]{},]+/,o=/!(?:<[\w\-%#;/?:@&=+$,.!~*'()[\]]+>|(?:[a-zA-Z\d-]*!)?[\w\-%#;/?:@&=+$.~*'()]+)?/,s="(?:"+o.source+"(?:[ ]+"+a.source+")?|"+a.source+"(?:[ ]+"+o.source+")?)",c=/(?:[^\s\x00-\x08\x0e-\x1f!"#%&'*,\-:>?@[\]`{|}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]|[?:-]<PLAIN>)(?:[ \t]*(?:(?![#:])<PLAIN>|:<PLAIN>))*/.source.replace(/<PLAIN>/g,function(){return/[^\s\x00-\x08\x0e-\x1f,[\]{}\x7f-\x84\x86-\x9f\ud800-\udfff\ufffe\uffff]/.source}),d=/"(?:[^"\\\r\n]|\\.)*"|'(?:[^'\\\r\n]|\\.)*'/.source;function f(p,m){m=(m||"").replace(/m/g,"")+"m";var y=/([:\-,[{]\s*(?:\s<<prop>>[ \t]+)?)(?:<<value>>)(?=[ \t]*(?:$|,|\]|\}|(?:[\r\n]\s*)?#))/.source.replace(/<<prop>>/g,function(){return s}).replace(/<<value>>/g,function(){return p});return RegExp(y,m)}n.languages.yaml={scalar:{pattern:RegExp(/([\-:]\s*(?:\s<<prop>>[ \t]+)?[|>])[ \t]*(?:((?:\r?\n|\r)[ \t]+)\S[^\r\n]*(?:\2[^\r\n]+)*)/.source.replace(/<<prop>>/g,function(){return s})),lookbehind:!0,alias:"string"},comment:/#.*/,key:{pattern:RegExp(/((?:^|[:\-,[{\r\n?])[ \t]*(?:<<prop>>[ \t]+)?)<<key>>(?=\s*:\s)/.source.replace(/<<prop>>/g,function(){return s}).replace(/<<key>>/g,function(){return"(?:"+c+"|"+d+")"})),lookbehind:!0,greedy:!0,alias:"atrule"},directive:{pattern:/(^[ \t]*)%.+/m,lookbehind:!0,alias:"important"},datetime:{pattern:f(/\d{4}-\d\d?-\d\d?(?:[tT]|[ \t]+)\d\d?:\d{2}:\d{2}(?:\.\d*)?(?:[ \t]*(?:Z|[-+]\d\d?(?::\d{2})?))?|\d{4}-\d{2}-\d{2}|\d\d?:\d{2}(?::\d{2}(?:\.\d*)?)?/.source),lookbehind:!0,alias:"number"},boolean:{pattern:f(/false|true/.source,"i"),lookbehind:!0,alias:"important"},null:{pattern:f(/null|~/.source,"i"),lookbehind:!0,alias:"important"},string:{pattern:f(d),lookbehind:!0,greedy:!0},number:{pattern:f(/[+-]?(?:0x[\da-f]+|0o[0-7]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?|\.inf|\.nan)/.source,"i"),lookbehind:!0},tag:o,important:a,punctuation:/---|[:[\]{}\-,|>?]|\.\.\./},n.languages.yml=n.languages.yaml})(Prism);(function(n){var a=/(?:[\w-]+|'[^'\n\r]*'|"(?:\\.|[^\\"\r\n])*")/.source;function o(s){return s.replace(/__/g,function(){return a})}n.languages.toml={comment:{pattern:/#.*/,greedy:!0},table:{pattern:RegExp(o(/(^[\t ]*\[\s*(?:\[\s*)?)__(?:\s*\.\s*__)*(?=\s*\])/.source),"m"),lookbehind:!0,greedy:!0,alias:"class-name"},key:{pattern:RegExp(o(/(^[\t ]*|[{,]\s*)__(?:\s*\.\s*__)*(?=\s*=)/.source),"m"),lookbehind:!0,greedy:!0,alias:"property"},string:{pattern:/"""(?:\\[\s\S]|[^\\])*?"""|'''[\s\S]*?'''|'[^'\n\r]*'|"(?:\\.|[^\\"\r\n])*"/,greedy:!0},date:[{pattern:/\b\d{4}-\d{2}-\d{2}(?:[T\s]\d{2}:\d{2}:\d{2}(?:\.\d+)?(?:Z|[+-]\d{2}:\d{2})?)?\b/i,alias:"number"},{pattern:/\b\d{2}:\d{2}:\d{2}(?:\.\d+)?\b/,alias:"number"}],number:/(?:\b0(?:x[\da-zA-Z]+(?:_[\da-zA-Z]+)*|o[0-7]+(?:_[0-7]+)*|b[10]+(?:_[10]+)*))\b|[-+]?\b\d+(?:_\d+)*(?:\.\d+(?:_\d+)*)?(?:[eE][+-]?\d+(?:_\d+)*)?\b|[-+]?\b(?:inf|nan)\b/,boolean:/\b(?:false|true)\b/,punctuation:/[.,=[\]{}]/}})(Prism);function xT(n,a){let o=n.slice(0,a).split(/\r\n|\n|\r/g);return[o.length,o.pop().length+1]}function bT(n,a,o){let s=n.split(/\r\n|\n|\r/g),c="",d=(Math.log10(a+1)|0)+1;for(let f=a-1;f<=a+1;f++){let p=s[f-1];p&&(c+=f.toString().padEnd(d," "),c+=": ",c+=p,c+=`
48
- `,f===a&&(c+=" ".repeat(d+o+2),c+=`^
49
- `))}return c}class Fe extends Error{line;column;codeblock;constructor(a,o){const[s,c]=xT(o.toml,o.ptr),d=bT(o.toml,s,c);super(`Invalid TOML document: ${a}
50
-
51
- ${d}`,o),this.line=s,this.column=c,this.codeblock=d}}function vT(n,a){let o=0;for(;n[a-++o]==="\\";);return--o&&o%2}function Ud(n,a=0,o=n.length){let s=n.indexOf(`
52
- `,a);return n[s-1]==="\r"&&s--,s<=o?s:-1}function Kl(n,a){for(let o=a;o<n.length;o++){let s=n[o];if(s===`
53
- `)return o;if(s==="\r"&&n[o+1]===`
54
- `)return o+1;if(s<" "&&s!==" "||s==="")throw new Fe("control characters are not allowed in comments",{toml:n,ptr:a})}return n.length}function Ca(n,a,o,s){let c;for(;;){for(;(c=n[a])===" "||c===" "||!o&&(c===`
55
- `||c==="\r"&&n[a+1]===`
56
- `);)a++;if(s||c!=="#")break;a=Kl(n,a)}return a}function CT(n,a,o,s,c=!1){if(!s)return a=Ud(n,a),a<0?n.length:a;for(let d=a;d<n.length;d++){let f=n[d];if(f==="#")d=Ud(n,d);else{if(f===o)return d+1;if(f===s||c&&(f===`
57
- `||f==="\r"&&n[d+1]===`
58
- `))return d}}throw new Fe("cannot find end of structure",{toml:n,ptr:a})}function Gb(n,a){let o=n[a],s=o===n[a+1]&&n[a+1]===n[a+2]?n.slice(a,a+3):o;a+=s.length-1;do a=n.indexOf(s,++a);while(a>-1&&o!=="'"&&vT(n,a));return a>-1&&(a+=s.length,s.length>1&&(n[a]===o&&a++,n[a]===o&&a++)),a}let ST=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;class bo extends Date{#t=!1;#n=!1;#e=null;constructor(a){let o=!0,s=!0,c="Z";if(typeof a=="string"){let d=a.match(ST);d?(d[1]||(o=!1,a=`0000-01-01T${a}`),s=!!d[2],s&&a[10]===" "&&(a=a.replace(" ","T")),d[2]&&+d[2]>23?a="":(c=d[3]||null,a=a.toUpperCase(),!c&&s&&(a+="Z"))):a=""}super(a),isNaN(this.getTime())||(this.#t=o,this.#n=s,this.#e=c)}isDateTime(){return this.#t&&this.#n}isLocal(){return!this.#t||!this.#n||!this.#e}isDate(){return this.#t&&!this.#n}isTime(){return this.#n&&!this.#t}isValid(){return this.#t||this.#n}toISOString(){let a=super.toISOString();if(this.isDate())return a.slice(0,10);if(this.isTime())return a.slice(11,23);if(this.#e===null)return a.slice(0,-1);if(this.#e==="Z")return a;let o=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return o=this.#e[0]==="-"?o:-o,new Date(this.getTime()-o*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(a,o="Z"){let s=new bo(a);return s.#e=o,s}static wrapAsLocalDateTime(a){let o=new bo(a);return o.#e=null,o}static wrapAsLocalDate(a){let o=new bo(a);return o.#n=!1,o.#e=null,o}static wrapAsLocalTime(a){let o=new bo(a);return o.#t=!1,o.#e=null,o}}let wT=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,NT=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,AT=/^[+-]?0[0-9_]/,kT=/^[0-9a-f]{2,8}$/i,zy={b:"\b",t:" ",n:`
59
- `,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function Vb(n,a=0,o=n.length){let s=n[a]==="'",c=n[a++]===n[a]&&n[a]===n[a+1];c&&(o-=2,n[a+=2]==="\r"&&a++,n[a]===`
60
- `&&a++);let d=0,f,p="",m=a;for(;a<o-1;){let y=n[a++];if(y===`
61
- `||y==="\r"&&n[a]===`
62
- `){if(!c)throw new Fe("newlines are not allowed in strings",{toml:n,ptr:a-1})}else if(y<" "&&y!==" "||y==="")throw new Fe("control characters are not allowed in strings",{toml:n,ptr:a-1});if(f){if(f=!1,y==="x"||y==="u"||y==="U"){let C=n.slice(a,a+=y==="x"?2:y==="u"?4:8);if(!kT.test(C))throw new Fe("invalid unicode escape",{toml:n,ptr:d});try{p+=String.fromCodePoint(parseInt(C,16))}catch{throw new Fe("invalid unicode escape",{toml:n,ptr:d})}}else if(c&&(y===`
63
- `||y===" "||y===" "||y==="\r")){if(a=Ca(n,a-1,!0),n[a]!==`
64
- `&&n[a]!=="\r")throw new Fe("invalid escape: only line-ending whitespace may be escaped",{toml:n,ptr:d});a=Ca(n,a)}else if(y in zy)p+=zy[y];else throw new Fe("unrecognized escape sequence",{toml:n,ptr:d});m=a}else!s&&y==="\\"&&(d=a-1,f=!0,p+=n.slice(m,d))}return p+n.slice(m,o-1)}function DT(n,a,o,s){if(n==="true")return!0;if(n==="false")return!1;if(n==="-inf")return-1/0;if(n==="inf"||n==="+inf")return 1/0;if(n==="nan"||n==="+nan"||n==="-nan")return NaN;if(n==="-0")return s?0n:0;let c=wT.test(n);if(c||NT.test(n)){if(AT.test(n))throw new Fe("leading zeroes are not allowed",{toml:a,ptr:o});n=n.replace(/_/g,"");let f=+n;if(isNaN(f))throw new Fe("invalid number",{toml:a,ptr:o});if(c){if((c=!Number.isSafeInteger(f))&&!s)throw new Fe("integer value cannot be represented losslessly",{toml:a,ptr:o});(c||s===!0)&&(f=BigInt(n))}return f}const d=new bo(n);if(!d.isValid())throw new Fe("invalid value",{toml:a,ptr:o});return d}function jT(n,a,o){let s=n.slice(a,o),c=s.indexOf("#");return c>-1&&(Kl(n,c),s=s.slice(0,c)),[s.trimEnd(),c]}function Pf(n,a,o,s,c){if(s===0)throw new Fe("document contains excessively nested structures. aborting.",{toml:n,ptr:a});let d=n[a];if(d==="["||d==="{"){let[m,y]=d==="["?ET(n,a,s,c):MT(n,a,s,c);if(o){if(y=Ca(n,y),n[y]===",")y++;else if(n[y]!==o)throw new Fe("expected comma or end of structure",{toml:n,ptr:y})}return[m,y]}let f;if(d==='"'||d==="'"){f=Gb(n,a);let m=Vb(n,a,f);if(o){if(f=Ca(n,f),n[f]&&n[f]!==","&&n[f]!==o&&n[f]!==`
65
- `&&n[f]!=="\r")throw new Fe("unexpected character encountered",{toml:n,ptr:f});f+=+(n[f]===",")}return[m,f]}f=CT(n,a,",",o);let p=jT(n,a,f-+(n[f-1]===","));if(!p[0])throw new Fe("incomplete key-value declaration: no value specified",{toml:n,ptr:a});return o&&p[1]>-1&&(f=Ca(n,a+p[1]),f+=+(n[f]===",")),[DT(p[0],n,a,c),f]}let TT=/^[a-zA-Z0-9-_]+[ \t]*$/;function Hd(n,a,o="="){let s=a-1,c=[],d=n.indexOf(o,a);if(d<0)throw new Fe("incomplete key-value: cannot find end of key",{toml:n,ptr:a});do{let f=n[a=++s];if(f!==" "&&f!==" ")if(f==='"'||f==="'"){if(f===n[a+1]&&f===n[a+2])throw new Fe("multiline strings are not allowed in keys",{toml:n,ptr:a});let p=Gb(n,a);if(p<0)throw new Fe("unfinished string encountered",{toml:n,ptr:a});s=n.indexOf(".",p);let m=n.slice(p,s<0||s>d?d:s),y=Ud(m);if(y>-1)throw new Fe("newlines are not allowed in keys",{toml:n,ptr:a+s+y});if(m.trimStart())throw new Fe("found extra tokens after the string part",{toml:n,ptr:p});if(d<p&&(d=n.indexOf(o,p),d<0))throw new Fe("incomplete key-value: cannot find end of key",{toml:n,ptr:a});c.push(Vb(n,a,p))}else{s=n.indexOf(".",a);let p=n.slice(a,s<0||s>d?d:s);if(!TT.test(p))throw new Fe("only letter, numbers, dashes and underscores are allowed in keys",{toml:n,ptr:a});c.push(p.trimEnd())}}while(s+1&&s<d);return[c,Ca(n,d+1,!0,!0)]}function MT(n,a,o,s){let c={},d=new Set,f;for(a++;(f=n[a++])!=="}"&&f;){if(f===",")throw new Fe("expected value, found comma",{toml:n,ptr:a-1});if(f==="#")a=Kl(n,a);else if(f!==" "&&f!==" "&&f!==`
66
- `&&f!=="\r"){let p,m=c,y=!1,[C,x]=Hd(n,a-1);for(let N=0;N<C.length;N++){if(N&&(m=y?m[p]:m[p]={}),p=C[N],(y=Object.hasOwn(m,p))&&(typeof m[p]!="object"||d.has(m[p])))throw new Fe("trying to redefine an already defined value",{toml:n,ptr:a});!y&&p==="__proto__"&&Object.defineProperty(m,p,{enumerable:!0,configurable:!0,writable:!0})}if(y)throw new Fe("trying to redefine an already defined value",{toml:n,ptr:a});let[b,A]=Pf(n,x,"}",o-1,s);d.add(b),m[p]=b,a=A}}if(!f)throw new Fe("unfinished table encountered",{toml:n,ptr:a});return[c,a]}function ET(n,a,o,s){let c=[],d;for(a++;(d=n[a++])!=="]"&&d;){if(d===",")throw new Fe("expected value, found comma",{toml:n,ptr:a-1});if(d==="#")a=Kl(n,a);else if(d!==" "&&d!==" "&&d!==`
67
- `&&d!=="\r"){let f=Pf(n,a-1,"]",o-1,s);c.push(f[0]),a=f[1]}}if(!d)throw new Fe("unfinished array encountered",{toml:n,ptr:a});return[c,a]}function Iy(n,a,o,s){let c=a,d=o,f,p=!1,m;for(let y=0;y<n.length;y++){if(y){if(c=p?c[f]:c[f]={},d=(m=d[f]).c,s===0&&(m.t===1||m.t===2))return null;if(m.t===2){let C=c.length-1;c=c[C],d=d[C].c}}if(f=n[y],(p=Object.hasOwn(c,f))&&d[f]?.t===0&&d[f]?.d)return null;p||(f==="__proto__"&&(Object.defineProperty(c,f,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(d,f,{enumerable:!0,configurable:!0,writable:!0})),d[f]={t:y<n.length-1&&s===2?3:s,d:!1,i:0,c:{}})}if(m=d[f],m.t!==s&&!(s===1&&m.t===3)||(s===2&&(m.d||(m.d=!0,c[f]=[]),c[f].push(c={}),m.c[m.i++]=m={t:1,d:!1,i:0,c:{}}),m.d))return null;if(m.d=!0,s===1)c=p?c[f]:c[f]={};else if(s===0&&p)return null;return[f,c,m.c]}function OT(n,{maxDepth:a=1e3,integersAsBigInt:o}={}){let s={},c={},d=s,f=c;for(let p=Ca(n,0);p<n.length;){if(n[p]==="["){let m=n[++p]==="[",y=Hd(n,p+=+m,"]");if(m){if(n[y[1]-1]!=="]")throw new Fe("expected end of table declaration",{toml:n,ptr:y[1]-1});y[1]++}let C=Iy(y[0],s,c,m?2:1);if(!C)throw new Fe("trying to redefine an already defined table or value",{toml:n,ptr:p});f=C[2],d=C[1],p=y[1]}else{let m=Hd(n,p),y=Iy(m[0],d,f,0);if(!y)throw new Fe("trying to redefine an already defined table or value",{toml:n,ptr:p});let C=Pf(n,m[1],void 0,a,o);y[1][y[0]]=C[0],p=C[1]}if(p=Ca(n,p,!0),n[p]&&n[p]!==`
68
- `&&n[p]!=="\r")throw new Fe("each key-value declaration must be followed by an end-of-line",{toml:n,ptr:p});p=Ca(n,p)}return s}const PT=[/^ANTHROPIC_AUTH_TOKEN$/,/_API_KEY$/,/_AUTH_TOKEN$/,/_SECRET$/,/_SECRET_KEY$/,/^API_KEY$/,/^AUTH_TOKEN$/,/^SECRET$/,/_PASSWORD$/,/^PASSWORD$/,/_CREDENTIAL$/,/_PRIVATE_KEY$/];function LT(n){return PT.some(a=>a.test(n))}function RT(n){if(!n.trim())return{valid:!0};try{return JSON.parse(n),{valid:!0}}catch(a){const s=a.message,c=s.match(/position (\d+)/);if(c){const d=parseInt(c[1],10),f=n.substring(0,d).split(`
69
- `);return{valid:!1,error:s,line:f.length}}return{valid:!1,error:s}}}function _T(n){if(!n.trim())return{valid:!0};try{return OT(n),{valid:!0}}catch(a){const o=a.message,s=o.match(/line\s+(\d+)/i);return{valid:!1,error:o,line:s?Number.parseInt(s[1],10):void 0}}}function Yb({value:n,onChange:a,language:o="json",readonly:s=!1,className:c,minHeight:d="300px",heightMode:f="content"}){const{isDark:p}=Jx(),[m,y]=S.useState(!1),[C,x]=S.useState(!0),b=f==="fill-parent",A=S.useMemo(()=>o==="json"?RT(n):o==="toml"?_T(n):{valid:!0},[n,o]),N=S.useCallback(E=>l.jsx(Lw,{prism:yT,theme:p?Ig.nightOwl:Ig.github,code:E,language:o,children:({tokens:O,getLineProps:R,getTokenProps:k})=>{let D=!1;return l.jsx(l.Fragment,{children:O.map((j,T)=>l.jsx("div",{...R({line:j}),className:K(A.line===T+1&&"bg-destructive/20"),children:j.map((w,P)=>{let F=!1;if(w.types.includes("property")){const $=w.content.replace(/['"]/g,"");LT($)?D=!0:D=!1}else(w.types.includes("string")||w.types.includes("number")||w.types.includes("boolean"))&&D?(F=!0,D=!1):w.types.includes("punctuation")&&w.content!==":"&&w.content!=="["&&w.content!=="{"&&(D=!1);const z=k({token:w});return F&&C&&(z.className=K(z.className,"blur-[3px] select-none opacity-70 transition-all duration-200")),l.jsx("span",{...z},P)})},T))})}}),[p,o,A.line,C]);return l.jsxs("div",{className:K("flex min-h-0 flex-col",b&&"h-full",c),style:b?{height:d==="auto"?void 0:d}:void 0,children:[l.jsxs("div",{className:K("relative rounded-md border overflow-hidden","bg-muted/30",b&&"flex min-h-0 flex-1 flex-col",m&&"ring-2 ring-ring ring-offset-2 ring-offset-background",s&&"opacity-70 cursor-not-allowed",!A.valid&&"border-destructive"),"data-slot":"code-editor-surface",children:[l.jsx("div",{className:K(b&&"scrollbar-editor min-h-0 flex-1 overflow-auto"),"data-slot":b?"code-editor-viewport":void 0,children:l.jsx(pT,{value:n,onValueChange:s?()=>{}:a,highlight:N,padding:12,disabled:s,onFocus:()=>y(!0),onBlur:()=>y(!1),textareaClassName:K("focus:outline-none font-mono text-sm",s&&"cursor-not-allowed"),preClassName:"font-mono text-sm",style:{fontFamily:"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace",fontSize:"0.875rem",minHeight:d}},p?"dark-editor":"light-editor")}),l.jsx("div",{className:"absolute top-2 right-2 z-10 opacity-50 hover:opacity-100 transition-opacity",children:l.jsx(dt,{variant:"ghost",size:"icon",className:"h-6 w-6 bg-background/50 hover:bg-background border shadow-sm rounded-full",onClick:()=>x(!C),title:C?"Reveal sensitive values":"Mask sensitive values",children:C?l.jsx(kl,{className:"h-3 w-3"}):l.jsx(Al,{className:"h-3 w-3"})})})]}),l.jsxs("div",{className:"flex items-center gap-2 mt-2 text-xs",children:[A.valid?l.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",children:[l.jsx(Kr,{className:"w-3 h-3 text-green-500"}),"Valid ",o.toUpperCase()]}):l.jsxs("span",{className:"flex items-center gap-1 text-destructive",children:[l.jsx(Dl,{className:"w-3 h-3"}),A.error,A.line&&` (line ${A.line})`]}),s&&l.jsx("span",{className:"ml-auto text-muted-foreground",children:"(Read-only)"})]})]})}const ql=Object.freeze(Object.defineProperty({__proto__:null,CodeEditor:Yb},Symbol.toStringTag,{value:"Module"})),zT={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 IT(n,a){switch(a.type){case"SET_WEBSEARCH_CONFIG":return{...n,webSearchConfig:a.payload};case"SET_WEBSEARCH_STATUS":return{...n,webSearchStatus:a.payload};case"SET_WEBSEARCH_LOADING":return{...n,webSearchLoading:a.payload};case"SET_WEBSEARCH_STATUS_LOADING":return{...n,webSearchStatusLoading:a.payload};case"SET_WEBSEARCH_SAVING":return{...n,webSearchSaving:a.payload};case"SET_WEBSEARCH_ERROR":return{...n,webSearchError:a.payload};case"SET_WEBSEARCH_SUCCESS":return{...n,webSearchSuccess:a.payload};case"SET_GLOBALENV_CONFIG":return{...n,globalEnvConfig:a.payload};case"SET_GLOBALENV_LOADING":return{...n,globalEnvLoading:a.payload};case"SET_GLOBALENV_SAVING":return{...n,globalEnvSaving:a.payload};case"SET_GLOBALENV_ERROR":return{...n,globalEnvError:a.payload};case"SET_GLOBALENV_SUCCESS":return{...n,globalEnvSuccess:a.payload};case"SET_PROXY_CONFIG":return{...n,proxyConfig:a.payload};case"SET_PROXY_LOADING":return{...n,proxyLoading:a.payload};case"SET_PROXY_SAVING":return{...n,proxySaving:a.payload};case"SET_PROXY_ERROR":return{...n,proxyError:a.payload};case"SET_PROXY_SUCCESS":return{...n,proxySuccess:a.payload};case"SET_PROXY_TEST_RESULT":return{...n,proxyTestResult:a.payload};case"SET_PROXY_TESTING":return{...n,proxyTesting:a.payload};case"SET_RAW_CONFIG":return{...n,rawConfig:a.payload};case"SET_RAW_CONFIG_LOADING":return{...n,rawConfigLoading:a.payload};default:return n}}const $b=S.createContext(null);function UT({children:n}){const[a,o]=S.useReducer(IT,zT);return l.jsx($b.Provider,{value:{state:a,dispatch:o},children:n})}function Qb(){const n=S.useContext($b);if(!n)throw new Error("useSettingsContext must be used within a SettingsProvider");return n}function HT(){const{dispatch:n}=Qb(),a=S.useCallback(w=>n({type:"SET_WEBSEARCH_CONFIG",payload:w}),[n]),o=S.useCallback(w=>n({type:"SET_WEBSEARCH_STATUS",payload:w}),[n]),s=S.useCallback(w=>n({type:"SET_WEBSEARCH_LOADING",payload:w}),[n]),c=S.useCallback(w=>n({type:"SET_WEBSEARCH_STATUS_LOADING",payload:w}),[n]),d=S.useCallback(w=>n({type:"SET_WEBSEARCH_SAVING",payload:w}),[n]),f=S.useCallback(w=>n({type:"SET_WEBSEARCH_ERROR",payload:w}),[n]),p=S.useCallback(w=>n({type:"SET_WEBSEARCH_SUCCESS",payload:w}),[n]),m=S.useCallback(w=>n({type:"SET_GLOBALENV_CONFIG",payload:w}),[n]),y=S.useCallback(w=>n({type:"SET_GLOBALENV_LOADING",payload:w}),[n]),C=S.useCallback(w=>n({type:"SET_GLOBALENV_SAVING",payload:w}),[n]),x=S.useCallback(w=>n({type:"SET_GLOBALENV_ERROR",payload:w}),[n]),b=S.useCallback(w=>n({type:"SET_GLOBALENV_SUCCESS",payload:w}),[n]),A=S.useCallback(w=>n({type:"SET_PROXY_CONFIG",payload:w}),[n]),N=S.useCallback(w=>n({type:"SET_PROXY_LOADING",payload:w}),[n]),E=S.useCallback(w=>n({type:"SET_PROXY_SAVING",payload:w}),[n]),O=S.useCallback(w=>n({type:"SET_PROXY_ERROR",payload:w}),[n]),R=S.useCallback(w=>n({type:"SET_PROXY_SUCCESS",payload:w}),[n]),k=S.useCallback(w=>n({type:"SET_PROXY_TEST_RESULT",payload:w}),[n]),D=S.useCallback(w=>n({type:"SET_PROXY_TESTING",payload:w}),[n]),j=S.useCallback(w=>n({type:"SET_RAW_CONFIG",payload:w}),[n]),T=S.useCallback(w=>n({type:"SET_RAW_CONFIG_LOADING",payload:w}),[n]);return S.useMemo(()=>({setWebSearchConfig:a,setWebSearchStatus:o,setWebSearchLoading:s,setWebSearchStatusLoading:c,setWebSearchSaving:d,setWebSearchError:f,setWebSearchSuccess:p,setGlobalEnvConfig:m,setGlobalEnvLoading:y,setGlobalEnvSaving:C,setGlobalEnvError:x,setGlobalEnvSuccess:b,setProxyConfig:A,setProxyLoading:N,setProxySaving:E,setProxyError:O,setProxySuccess:R,setProxyTestResult:k,setProxyTesting:D,setRawConfig:j,setRawConfigLoading:T}),[a,o,s,c,d,f,p,m,y,C,x,b,A,N,E,O,R,k,D,j,T])}function BT(){const[n,a]=cS(),o=n.get("tab")?.toLowerCase(),s=o==="imageanalysis"||o==="image"?"image":o==="channels"?"channels":o==="globalenv"?"globalenv":o==="proxy"?"proxy":o==="auth"?"auth":o==="thinking"?"thinking":o==="backups"?"backups":"websearch",c=S.useCallback(d=>{a({tab:d},{replace:!0})},[a]);return{activeTab:s,setActiveTab:c}}function KT(){const{state:n}=Qb(),a=HT(),[o,s]=S.useState(!1),c=S.useCallback(async()=>{try{a.setRawConfigLoading(!0);const f=await fetch("/api/config/raw");if(!f.ok){a.setRawConfig(null);return}const p=await f.text();a.setRawConfig(p)}catch{a.setRawConfig(null)}finally{a.setRawConfigLoading(!1)}},[a]),d=S.useCallback(async()=>{if(n.rawConfig)try{await navigator.clipboard.writeText(n.rawConfig),s(!0),setTimeout(()=>s(!1),2e3)}catch{}},[n.rawConfig]);return{rawConfig:n.rawConfig,loading:n.rawConfigLoading,copied:o,fetchRawConfig:c,copyToClipboard:d}}function Uy({activeTab:n,onTabChange:a}){const{t:o}=Mt(),s=[{value:"websearch",label:o("settingsTabs.web"),icon:Mx},{value:"image",label:"Image",icon:Px},{value:"channels",label:"Channels",icon:qS},{value:"globalenv",label:o("settingsTabs.env"),icon:Yd},{value:"thinking",label:o("settingsTabs.think"),icon:FS},{value:"proxy",label:o("settingsTabs.proxy"),icon:GS},{value:"auth",label:o("settingsTabs.auth"),icon:Fd},{value:"backups",label:o("settingsTabs.backup"),icon:VS}];return l.jsx(_b,{value:n,onValueChange:c=>a(c),children:l.jsx(Af,{className:"grid w-full grid-cols-8",children:s.map(({value:c,label:d,icon:f})=>l.jsxs(Cl,{value:c,className:"gap-1.5 px-2 text-xs",children:[l.jsx(f,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{className:"truncate",children:d})]},c))})})}function Hy(){return l.jsxs("div",{className:"flex-1 p-5 space-y-6",children:[l.jsx(Ye,{className:"h-4 w-2/3"}),l.jsx("div",{className:"p-4 rounded-lg border",children:l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ye,{className:"h-5 w-32"}),l.jsx(Ye,{className:"h-4 w-48"})]}),l.jsx(Ye,{className:"h-6 w-10 rounded-full"})]})}),l.jsxs("div",{className:"space-y-3",children:[l.jsx(Ye,{className:"h-5 w-24"}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Ye,{className:"h-20 w-full rounded-lg"}),l.jsx(Ye,{className:"h-20 w-full rounded-lg"}),l.jsx(Ye,{className:"h-20 w-full rounded-lg"})]})]})]})}function Wb(n,a=3,o=1e3){return n().catch(s=>{if(a<=0)throw s;return new Promise(c=>setTimeout(c,o)).then(()=>Wb(n,a-1,o*2))})}function ti(n){return S.lazy(()=>Wb(n))}const By=ti(()=>tt(()=>import("./index-N2ZSJurX.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),Ky=ti(()=>tt(()=>import("./index-BVeN0dIB.js"),__vite__mapDeps([10,1,2,4,5,6,7,8,9]))),qy=ti(()=>tt(()=>import("./channels-uZ_9CBqO.js"),__vite__mapDeps([11,1,2,4,5,6,7,8,9]))),Fy=ti(()=>tt(()=>import("./globalenv-section-Cf6dKgSf.js"),__vite__mapDeps([12,1,2,4,5,6,7,8,9]))),Gy=ti(()=>tt(()=>import("./index-wg7UtkFv.js"),__vite__mapDeps([13,1,2,4,5,6,7,8,9]))),Vy=ti(()=>tt(()=>import("./index-DuRYaONg.js"),__vite__mapDeps([14,1,2,15,4,16,17,5,6,18,7,8,9]))),Yy=ti(()=>tt(()=>import("./auth-section-DVp8FQGm.js"),__vite__mapDeps([19,1,2,4,5,6,7,8,9]))),$y=ti(()=>tt(()=>import("./backups-section-CRo0NZkA.js"),__vite__mapDeps([20,1,2,17,4,5,6,7,8,9])));class Qy extends S.Component{constructor(a){super(a),this.state={hasError:!1,error:null}}static getDerivedStateFromError(a){return{hasError:!0,error:a}}render(){return this.state.hasError?l.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:l.jsxs("div",{className:"text-center p-6 max-w-md",children:[l.jsx(Dl,{className:"w-12 h-12 mx-auto mb-4 text-destructive"}),l.jsx("p",{className:"font-medium text-foreground mb-2",children:Be.t("settings.sectionLoadFailed")}),l.jsx("p",{className:"text-sm mb-4",children:this.state.error?.message||Be.t("settings.unknownError")}),l.jsxs(dt,{variant:"outline",onClick:()=>window.location.reload(),className:"inline-flex items-center gap-2",children:[l.jsx(_r,{className:"w-4 h-4"}),Be.t("settings.reloadPage")]})]})}):this.props.children}}function qT(){const{t:n}=Mt(),{activeTab:a,setActiveTab:o}=BT(),{rawConfig:s,loading:c,copied:d,fetchRawConfig:f,copyToClipboard:p}=KT();S.useEffect(()=>{f()},[f]);const m=y=>{S.startTransition(()=>{o(y)})};return l.jsxs("div",{className:"h-full min-h-0",children:[l.jsxs("div",{className:"md:hidden h-full flex flex-col",children:[l.jsx("div",{className:"border-b bg-background p-4",children:l.jsx(Uy,{activeTab:a,onTabChange:m})}),l.jsx(Qy,{children:l.jsxs(S.Suspense,{fallback:l.jsx(Hy,{}),children:[a==="websearch"&&l.jsx(By,{}),a==="image"&&l.jsx(Ky,{}),a==="channels"&&l.jsx(qy,{}),a==="globalenv"&&l.jsx(Fy,{}),a==="thinking"&&l.jsx(Gy,{}),a==="proxy"&&l.jsx(Vy,{}),a==="auth"&&l.jsx(Yy,{}),a==="backups"&&l.jsx($y,{})]})})]}),l.jsxs(Cf,{direction:"horizontal",className:"h-full hidden md:flex",children:[l.jsx(Ir,{defaultSize:46,minSize:36,maxSize:62,children:l.jsxs("div",{className:"h-full border-r flex flex-col bg-muted/30 relative",children:[l.jsx("div",{className:"p-5 border-b bg-background",children:l.jsx(Uy,{activeTab:a,onTabChange:m})}),l.jsx(Qy,{children:l.jsxs(S.Suspense,{fallback:l.jsx(Hy,{}),children:[a==="websearch"&&l.jsx(By,{}),a==="image"&&l.jsx(Ky,{}),a==="channels"&&l.jsx(qy,{}),a==="globalenv"&&l.jsx(Fy,{}),a==="thinking"&&l.jsx(Gy,{}),a==="proxy"&&l.jsx(Vy,{}),a==="auth"&&l.jsx(Yy,{}),a==="backups"&&l.jsx($y,{})]})})]})}),l.jsx(Sf,{className:"w-2 bg-border hover:bg-primary/20 transition-colors cursor-col-resize flex items-center justify-center group",children:l.jsx(jl,{className:"w-3 h-3 text-muted-foreground group-hover:text-primary"})}),l.jsx(Ir,{defaultSize:54,minSize:35,children:l.jsxs("div",{className:"h-full flex flex-col",children:[l.jsxs("div",{className:"p-4 border-b bg-background flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(Lg,{className:"w-5 h-5 text-primary"}),l.jsxs("div",{children:[l.jsx("h2",{className:"font-semibold",children:"config.yaml"}),l.jsx("p",{className:"text-sm text-muted-foreground",children:"~/.ccs/config.yaml"})]})]}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx(dt,{variant:"outline",size:"sm",onClick:p,disabled:!s,children:d?l.jsxs(l.Fragment,{children:[l.jsx(Co,{className:"w-4 h-4 mr-1"}),n("settings.copied")]}):l.jsxs(l.Fragment,{children:[l.jsx(ml,{className:"w-4 h-4 mr-1"}),n("settings.copy")]})}),l.jsx(dt,{variant:"outline",size:"sm",onClick:f,disabled:c,children:l.jsx(_r,{className:`w-4 h-4 ${c?"animate-spin":""}`})})]})]}),l.jsx("div",{className:"flex-1 overflow-auto",children:s?l.jsx(Yb,{value:s,onChange:()=>{},language:"yaml",readonly:!0,minHeight:"auto",className:"min-h-full"}):c?l.jsxs("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:[l.jsx(_r,{className:"w-5 h-5 animate-spin mr-2"}),n("settings.loading")]}):l.jsx("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:l.jsxs("div",{className:"text-center",children:[l.jsx(Lg,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),l.jsx("p",{children:n("settings.configFileNotFound")}),l.jsx("code",{className:"text-sm bg-muted px-2 py-1 rounded mt-2 inline-block",children:"ccs migrate"})]})})})]})})]})]})}function FT(){return l.jsx(UT,{children:l.jsx(qT,{})})}const GT=Object.freeze(Object.defineProperty({__proto__:null,SettingsPage:FT},Symbol.toStringTag,{value:"Module"}));function VT(n,a,o="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:n,timeZoneName:o}).format(a).split(/\s/g).slice(2).join(" ")}const YT={},Mr={};function wi(n,a){try{const s=(YT[n]||=new Intl.DateTimeFormat("en-US",{timeZone:n,timeZoneName:"longOffset"}).format)(a).split("GMT")[1];return s in Mr?Mr[s]:Wy(s,s.split(":"))}catch{if(n in Mr)return Mr[n];const o=n?.match($T);return o?Wy(n,o.slice(1)):NaN}}const $T=/([+-]\d\d):?(\d\d)?/;function Wy(n,a){const o=+(a[0]||0),s=+(a[1]||0),c=+(a[2]||0)/60;return Mr[n]=o*60+s>0?o*60+s+c:o*60-s-c}class qn extends Date{constructor(...a){super(),a.length>1&&typeof a[a.length-1]=="string"&&(this.timeZone=a.pop()),this.internal=new Date,isNaN(wi(this.timeZone,this))?this.setTime(NaN):a.length?typeof a[0]=="number"&&(a.length===1||a.length===2&&typeof a[1]!="number")?this.setTime(a[0]):typeof a[0]=="string"?this.setTime(+new Date(a[0])):a[0]instanceof Date?this.setTime(+a[0]):(this.setTime(+new Date(...a)),Xb(this),Bd(this)):this.setTime(Date.now())}static tz(a,...o){return o.length?new qn(...o,a):new qn(Date.now(),a)}withTimeZone(a){return new qn(+this,a)}getTimezoneOffset(){const a=-wi(this.timeZone,this);return a>0?Math.floor(a):Math.ceil(a)}setTime(a){return Date.prototype.setTime.apply(this,arguments),Bd(this),+this}[Symbol.for("constructDateFrom")](a){return new qn(+new Date(a),this.timeZone)}}const Xy=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(n=>{if(!Xy.test(n))return;const a=n.replace(Xy,"$1UTC");qn.prototype[a]&&(n.startsWith("get")?qn.prototype[n]=function(){return this.internal[a]()}:(qn.prototype[n]=function(){return Date.prototype[a].apply(this.internal,arguments),QT(this),+this},qn.prototype[a]=function(){return Date.prototype[a].apply(this,arguments),Bd(this),+this}))});function Bd(n){n.internal.setTime(+n),n.internal.setUTCSeconds(n.internal.getUTCSeconds()-Math.round(-wi(n.timeZone,n)*60))}function QT(n){Date.prototype.setFullYear.call(n,n.internal.getUTCFullYear(),n.internal.getUTCMonth(),n.internal.getUTCDate()),Date.prototype.setHours.call(n,n.internal.getUTCHours(),n.internal.getUTCMinutes(),n.internal.getUTCSeconds(),n.internal.getUTCMilliseconds()),Xb(n)}function Xb(n){const a=wi(n.timeZone,n),o=a>0?Math.floor(a):Math.ceil(a),s=new Date(+n);s.setUTCHours(s.getUTCHours()-1);const c=-new Date(+n).getTimezoneOffset(),d=-new Date(+s).getTimezoneOffset(),f=c-d,p=Date.prototype.getHours.apply(n)!==n.internal.getUTCHours();f&&p&&n.internal.setUTCMinutes(n.internal.getUTCMinutes()+f);const m=c-o;m&&Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+m);const y=new Date(+n);y.setUTCSeconds(0);const C=c>0?y.getSeconds():(y.getSeconds()-60)%60,x=Math.round(-(wi(n.timeZone,n)*60))%60;(x||C)&&(n.internal.setUTCSeconds(n.internal.getUTCSeconds()+x),Date.prototype.setUTCSeconds.call(n,Date.prototype.getUTCSeconds.call(n)+x+C));const b=wi(n.timeZone,n),A=b>0?Math.floor(b):Math.ceil(b),E=-new Date(+n).getTimezoneOffset()-A,O=A!==o,R=E-m;if(O&&R){Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+R);const k=wi(n.timeZone,n),D=k>0?Math.floor(k):Math.ceil(k),j=A-D;j&&(n.internal.setUTCMinutes(n.internal.getUTCMinutes()+j),Date.prototype.setUTCMinutes.call(n,Date.prototype.getUTCMinutes.call(n)+j))}}class xa extends qn{static tz(a,...o){return o.length?new xa(...o,a):new xa(Date.now(),a)}toISOString(){const[a,o,s]=this.tzComponents(),c=`${a}${o}:${s}`;return this.internal.toISOString().slice(0,-1)+c}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[a,o,s,c]=this.internal.toUTCString().split(" ");return`${a?.slice(0,-1)} ${s} ${o} ${c}`}toTimeString(){const a=this.internal.toUTCString().split(" ")[4],[o,s,c]=this.tzComponents();return`${a} GMT${o}${s}${c} (${VT(this.timeZone,this)})`}toLocaleString(a,o){return Date.prototype.toLocaleString.call(this,a,{...o,timeZone:o?.timeZone||this.timeZone})}toLocaleDateString(a,o){return Date.prototype.toLocaleDateString.call(this,a,{...o,timeZone:o?.timeZone||this.timeZone})}toLocaleTimeString(a,o){return Date.prototype.toLocaleTimeString.call(this,a,{...o,timeZone:o?.timeZone||this.timeZone})}tzComponents(){const a=this.getTimezoneOffset(),o=a>0?"-":"+",s=String(Math.floor(Math.abs(a)/60)).padStart(2,"0"),c=String(Math.abs(a)%60).padStart(2,"0");return[o,s,c]}withTimeZone(a){return new xa(+this,a)}[Symbol.for("constructDateFrom")](a){return new xa(+new Date(a),this.timeZone)}}const Zy=5,WT=4;function XT(n,a){const o=a.startOfMonth(n),s=o.getDay()>0?o.getDay():7,c=a.addDays(n,-s+1),d=a.addDays(c,Zy*7-1);return a.getMonth(n)===a.getMonth(d)?Zy:WT}function Zb(n,a){const o=a.startOfMonth(n),s=o.getDay();return s===1?o:s===0?a.addDays(o,-6):a.addDays(o,-1*(s-1))}function ZT(n,a){const o=Zb(n,a),s=XT(n,a);return a.addDays(o,s*7-1)}const Jb={...Cr,labels:{labelDayButton:(n,a,o,s)=>{let c;s&&typeof s.format=="function"?c=s.format.bind(s):c=(f,p)=>Ar(f,p,{locale:Cr,...o});let d=c(n,"PPPP");return a.today&&(d=`Today, ${d}`),a.selected&&(d=`${d}, selected`),d},labelMonthDropdown:"Choose the Month",labelNext:"Go to the Next Month",labelPrevious:"Go to the Previous Month",labelWeekNumber:n=>`Week ${n}`,labelYearDropdown:"Choose the Year",labelGrid:(n,a,o)=>{let s;return o&&typeof o.format=="function"?s=o.format.bind(o):s=(c,d)=>Ar(c,d,{locale:Cr,...a}),s(n,"LLLL yyyy")},labelGridcell:(n,a,o,s)=>{let c;s&&typeof s.format=="function"?c=s.format.bind(s):c=(f,p)=>Ar(f,p,{locale:Cr,...o});let d=c(n,"PPPP");return a?.today&&(d=`Today, ${d}`),d},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(n,a,o)=>{let s;return o&&typeof o.format=="function"?s=o.format.bind(o):s=(c,d)=>Ar(c,d,{locale:Cr,...a}),s(n,"cccc")}}};class hn{constructor(a,o){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?xa.tz(this.options.timeZone):new this.Date,this.newDate=(s,c,d)=>this.overrides?.newDate?this.overrides.newDate(s,c,d):this.options.timeZone?new xa(s,c,d,this.options.timeZone):new Date(s,c,d),this.addDays=(s,c)=>this.overrides?.addDays?this.overrides.addDays(s,c):XS(s,c),this.addMonths=(s,c)=>this.overrides?.addMonths?this.overrides.addMonths(s,c):ZS(s,c),this.addWeeks=(s,c)=>this.overrides?.addWeeks?this.overrides.addWeeks(s,c):JS(s,c),this.addYears=(s,c)=>this.overrides?.addYears?this.overrides.addYears(s,c):ew(s,c),this.differenceInCalendarDays=(s,c)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(s,c):tw(s,c),this.differenceInCalendarMonths=(s,c)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(s,c):nw(s,c),this.eachMonthOfInterval=s=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(s):aw(s),this.eachYearOfInterval=s=>{const c=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(s):iw(s),d=new Set(c.map(p=>this.getYear(p)));if(d.size===c.length)return c;const f=[];return d.forEach(p=>{f.push(new Date(p,0,1))}),f},this.endOfBroadcastWeek=s=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(s):ZT(s,this),this.endOfISOWeek=s=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(s):ow(s),this.endOfMonth=s=>this.overrides?.endOfMonth?this.overrides.endOfMonth(s):rw(s),this.endOfWeek=(s,c)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(s,c):sw(s,this.options),this.endOfYear=s=>this.overrides?.endOfYear?this.overrides.endOfYear(s):lw(s),this.format=(s,c,d)=>{const f=this.overrides?.format?this.overrides.format(s,c,this.options):Ar(s,c,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(f):f},this.getISOWeek=s=>this.overrides?.getISOWeek?this.overrides.getISOWeek(s):cw(s),this.getMonth=(s,c)=>this.overrides?.getMonth?this.overrides.getMonth(s,this.options):uw(s,this.options),this.getYear=(s,c)=>this.overrides?.getYear?this.overrides.getYear(s,this.options):dw(s,this.options),this.getWeek=(s,c)=>this.overrides?.getWeek?this.overrides.getWeek(s,this.options):fw(s,this.options),this.isAfter=(s,c)=>this.overrides?.isAfter?this.overrides.isAfter(s,c):hw(s,c),this.isBefore=(s,c)=>this.overrides?.isBefore?this.overrides.isBefore(s,c):pw(s,c),this.isDate=s=>this.overrides?.isDate?this.overrides.isDate(s):mw(s),this.isSameDay=(s,c)=>this.overrides?.isSameDay?this.overrides.isSameDay(s,c):gw(s,c),this.isSameMonth=(s,c)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(s,c):yw(s,c),this.isSameYear=(s,c)=>this.overrides?.isSameYear?this.overrides.isSameYear(s,c):xw(s,c),this.max=s=>this.overrides?.max?this.overrides.max(s):bw(s),this.min=s=>this.overrides?.min?this.overrides.min(s):vw(s),this.setMonth=(s,c)=>this.overrides?.setMonth?this.overrides.setMonth(s,c):Cw(s,c),this.setYear=(s,c)=>this.overrides?.setYear?this.overrides.setYear(s,c):Sw(s,c),this.startOfBroadcastWeek=(s,c)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(s,this):Zb(s,this),this.startOfDay=s=>this.overrides?.startOfDay?this.overrides.startOfDay(s):ww(s),this.startOfISOWeek=s=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(s):Nw(s),this.startOfMonth=s=>this.overrides?.startOfMonth?this.overrides.startOfMonth(s):Aw(s),this.startOfWeek=(s,c)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(s,this.options):kw(s,this.options),this.startOfYear=s=>this.overrides?.startOfYear?this.overrides.startOfYear(s):Dw(s),this.options={locale:Jb,...a},this.overrides=o}getDigitMap(){const{numerals:a="latn"}=this.options,o=new Intl.NumberFormat("en-US",{numberingSystem:a}),s={};for(let c=0;c<10;c++)s[c.toString()]=o.format(c);return s}replaceDigits(a){const o=this.getDigitMap();return a.replace(/\d/g,s=>o[s]||s)}formatNumber(a){return this.replaceDigits(a.toString())}getMonthYearOrder(){const a=this.options.locale?.code;return a&&hn.yearFirstLocales.has(a)?"year-first":"month-first"}formatMonthYear(a){const{locale:o,timeZone:s,numerals:c}=this.options,d=o?.code;if(d&&hn.yearFirstLocales.has(d))try{return new Intl.DateTimeFormat(d,{month:"long",year:"numeric",timeZone:s,numberingSystem:c}).format(a)}catch{}const f=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(a,f)}}hn.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 Vn=new hn;class ev{constructor(a,o,s=Vn){this.date=a,this.displayMonth=o,this.outside=!!(o&&!s.isSameMonth(a,o)),this.dateLib=s,this.isoDate=s.format(a,"yyyy-MM-dd"),this.displayMonthId=s.format(o,"yyyy-MM"),this.dateMonthId=s.format(a,"yyyy-MM")}isEqualTo(a){return this.dateLib.isSameDay(a.date,this.date)&&this.dateLib.isSameMonth(a.displayMonth,this.displayMonth)}}class JT{constructor(a,o){this.date=a,this.weeks=o}}class eM{constructor(a,o){this.days=o,this.weekNumber=a}}function tM(n){return se.createElement("button",{...n})}function nM(n){return se.createElement("span",{...n})}function aM(n){const{size:a=24,orientation:o="left",className:s}=n;return se.createElement("svg",{className:s,width:a,height:a,viewBox:"0 0 24 24"},o==="up"&&se.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),o==="down"&&se.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),o==="left"&&se.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),o==="right"&&se.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function iM(n){const{day:a,modifiers:o,...s}=n;return se.createElement("td",{...s})}function oM(n){const{day:a,modifiers:o,...s}=n,c=se.useRef(null);return se.useEffect(()=>{o.focused&&c.current?.focus()},[o.focused]),se.createElement("button",{ref:c,...s})}var ye;(function(n){n.Root="root",n.Chevron="chevron",n.Day="day",n.DayButton="day_button",n.CaptionLabel="caption_label",n.Dropdowns="dropdowns",n.Dropdown="dropdown",n.DropdownRoot="dropdown_root",n.Footer="footer",n.MonthGrid="month_grid",n.MonthCaption="month_caption",n.MonthsDropdown="months_dropdown",n.Month="month",n.Months="months",n.Nav="nav",n.NextMonthButton="button_next",n.PreviousMonthButton="button_previous",n.Week="week",n.Weeks="weeks",n.Weekday="weekday",n.Weekdays="weekdays",n.WeekNumber="week_number",n.WeekNumberHeader="week_number_header",n.YearsDropdown="years_dropdown"})(ye||(ye={}));var ft;(function(n){n.disabled="disabled",n.hidden="hidden",n.outside="outside",n.focused="focused",n.today="today"})(ft||(ft={}));var Mn;(function(n){n.range_end="range_end",n.range_middle="range_middle",n.range_start="range_start",n.selected="selected"})(Mn||(Mn={}));var fn;(function(n){n.weeks_before_enter="weeks_before_enter",n.weeks_before_exit="weeks_before_exit",n.weeks_after_enter="weeks_after_enter",n.weeks_after_exit="weeks_after_exit",n.caption_after_enter="caption_after_enter",n.caption_after_exit="caption_after_exit",n.caption_before_enter="caption_before_enter",n.caption_before_exit="caption_before_exit"})(fn||(fn={}));function rM(n){const{options:a,className:o,components:s,classNames:c,...d}=n,f=[c[ye.Dropdown],o].join(" "),p=a?.find(({value:m})=>m===d.value);return se.createElement("span",{"data-disabled":d.disabled,className:c[ye.DropdownRoot]},se.createElement(s.Select,{className:f,...d},a?.map(({value:m,label:y,disabled:C})=>se.createElement(s.Option,{key:m,value:m,disabled:C},y))),se.createElement("span",{className:c[ye.CaptionLabel],"aria-hidden":!0},p?.label,se.createElement(s.Chevron,{orientation:"down",size:18,className:c[ye.Chevron]})))}function sM(n){return se.createElement("div",{...n})}function lM(n){return se.createElement("div",{...n})}function cM(n){const{calendarMonth:a,displayIndex:o,...s}=n;return se.createElement("div",{...s},n.children)}function uM(n){const{calendarMonth:a,displayIndex:o,...s}=n;return se.createElement("div",{...s})}function dM(n){return se.createElement("table",{...n})}function fM(n){return se.createElement("div",{...n})}const tv=S.createContext(void 0);function Gr(){const n=S.useContext(tv);if(n===void 0)throw new Error("useDayPicker() must be used within a custom component.");return n}function hM(n){const{components:a}=Gr();return se.createElement(a.Dropdown,{...n})}function pM(n){const{onPreviousClick:a,onNextClick:o,previousMonth:s,nextMonth:c,...d}=n,{components:f,classNames:p,labels:{labelPrevious:m,labelNext:y}}=Gr(),C=S.useCallback(b=>{c&&o?.(b)},[c,o]),x=S.useCallback(b=>{s&&a?.(b)},[s,a]);return se.createElement("nav",{...d},se.createElement(f.PreviousMonthButton,{type:"button",className:p[ye.PreviousMonthButton],tabIndex:s?void 0:-1,"aria-disabled":s?void 0:!0,"aria-label":m(s),onClick:x},se.createElement(f.Chevron,{disabled:s?void 0:!0,className:p[ye.Chevron],orientation:"left"})),se.createElement(f.NextMonthButton,{type:"button",className:p[ye.NextMonthButton],tabIndex:c?void 0:-1,"aria-disabled":c?void 0:!0,"aria-label":y(c),onClick:C},se.createElement(f.Chevron,{disabled:c?void 0:!0,orientation:"right",className:p[ye.Chevron]})))}function mM(n){const{components:a}=Gr();return se.createElement(a.Button,{...n})}function gM(n){return se.createElement("option",{...n})}function yM(n){const{components:a}=Gr();return se.createElement(a.Button,{...n})}function xM(n){const{rootRef:a,...o}=n;return se.createElement("div",{...o,ref:a})}function bM(n){return se.createElement("select",{...n})}function vM(n){const{week:a,...o}=n;return se.createElement("tr",{...o})}function CM(n){return se.createElement("th",{...n})}function SM(n){return se.createElement("thead",{"aria-hidden":!0},se.createElement("tr",{...n}))}function wM(n){const{week:a,...o}=n;return se.createElement("th",{...o})}function NM(n){return se.createElement("th",{...n})}function AM(n){return se.createElement("tbody",{...n})}function kM(n){const{components:a}=Gr();return se.createElement(a.Dropdown,{...n})}const DM=Object.freeze(Object.defineProperty({__proto__:null,Button:tM,CaptionLabel:nM,Chevron:aM,Day:iM,DayButton:oM,Dropdown:rM,DropdownNav:sM,Footer:lM,Month:cM,MonthCaption:uM,MonthGrid:dM,Months:fM,MonthsDropdown:hM,Nav:pM,NextMonthButton:mM,Option:gM,PreviousMonthButton:yM,Root:xM,Select:bM,Week:vM,WeekNumber:wM,WeekNumberHeader:NM,Weekday:CM,Weekdays:SM,Weeks:AM,YearsDropdown:kM},Symbol.toStringTag,{value:"Module"}));function ba(n,a,o=!1,s=Vn){let{from:c,to:d}=n;const{differenceInCalendarDays:f,isSameDay:p}=s;return c&&d?(f(d,c)<0&&([c,d]=[d,c]),f(a,c)>=(o?1:0)&&f(d,a)>=(o?1:0)):!o&&d?p(d,a):!o&&c?p(c,a):!1}function Lf(n){return!!(n&&typeof n=="object"&&"before"in n&&"after"in n)}function Fl(n){return!!(n&&typeof n=="object"&&"from"in n)}function Rf(n){return!!(n&&typeof n=="object"&&"after"in n)}function _f(n){return!!(n&&typeof n=="object"&&"before"in n)}function nv(n){return!!(n&&typeof n=="object"&&"dayOfWeek"in n)}function av(n,a){return Array.isArray(n)&&n.every(a.isDate)}function va(n,a,o=Vn){const s=Array.isArray(a)?a:[a],{isSameDay:c,differenceInCalendarDays:d,isAfter:f}=o;return s.some(p=>{if(typeof p=="boolean")return p;if(o.isDate(p))return c(n,p);if(av(p,o))return p.some(m=>c(n,m));if(Fl(p))return ba(p,n,!1,o);if(nv(p))return Array.isArray(p.dayOfWeek)?p.dayOfWeek.includes(n.getDay()):p.dayOfWeek===n.getDay();if(Lf(p)){const m=d(p.before,n),y=d(p.after,n),C=m>0,x=y<0;return f(p.before,p.after)?x&&C:C||x}return Rf(p)?d(n,p.after)>0:_f(p)?d(p.before,n)>0:typeof p=="function"?p(n):!1})}function jM(n,a,o,s,c){const{disabled:d,hidden:f,modifiers:p,showOutsideDays:m,broadcastCalendar:y,today:C=c.today()}=a,{isSameDay:x,isSameMonth:b,startOfMonth:A,isBefore:N,endOfMonth:E,isAfter:O}=c,R=o&&A(o),k=s&&E(s),D={[ft.focused]:[],[ft.outside]:[],[ft.disabled]:[],[ft.hidden]:[],[ft.today]:[]},j={};for(const T of n){const{date:w,displayMonth:P}=T,F=!!(P&&!b(w,P)),z=!!(R&&N(w,R)),$=!!(k&&O(w,k)),ne=!!(d&&va(w,d,c)),Z=!!(f&&va(w,f,c))||z||$||!y&&!m&&F||y&&m===!1&&F,xe=x(w,C);F&&D.outside.push(T),ne&&D.disabled.push(T),Z&&D.hidden.push(T),xe&&D.today.push(T),p&&Object.keys(p).forEach(te=>{const be=p?.[te];be&&va(w,be,c)&&(j[te]?j[te].push(T):j[te]=[T])})}return T=>{const w={[ft.focused]:!1,[ft.disabled]:!1,[ft.hidden]:!1,[ft.outside]:!1,[ft.today]:!1},P={};for(const F in D){const z=D[F];w[F]=z.some($=>$===T)}for(const F in j)P[F]=j[F].some(z=>z===T);return{...w,...P}}}function TM(n,a,o={}){return Object.entries(n).filter(([,c])=>c===!0).reduce((c,[d])=>(o[d]?c.push(o[d]):a[ft[d]]?c.push(a[ft[d]]):a[Mn[d]]&&c.push(a[Mn[d]]),c),[a[ye.Day]])}function MM(n){return{...DM,...n}}function EM(n){const a={"data-mode":n.mode??void 0,"data-required":"required"in n?n.required:void 0,"data-multiple-months":n.numberOfMonths&&n.numberOfMonths>1||void 0,"data-week-numbers":n.showWeekNumber||void 0,"data-broadcast-calendar":n.broadcastCalendar||void 0,"data-nav-layout":n.navLayout||void 0};return Object.entries(n).forEach(([o,s])=>{o.startsWith("data-")&&(a[o]=s)}),a}function OM(){const n={};for(const a in ye)n[ye[a]]=`rdp-${ye[a]}`;for(const a in ft)n[ft[a]]=`rdp-${ft[a]}`;for(const a in Mn)n[Mn[a]]=`rdp-${Mn[a]}`;for(const a in fn)n[fn[a]]=`rdp-${fn[a]}`;return n}function iv(n,a,o){return(o??new hn(a)).formatMonthYear(n)}const PM=iv;function LM(n,a,o){return(o??new hn(a)).format(n,"d")}function RM(n,a=Vn){return a.format(n,"LLLL")}function _M(n,a,o){return(o??new hn(a)).format(n,"cccccc")}function zM(n,a=Vn){return n<10?a.formatNumber(`0${n.toLocaleString()}`):a.formatNumber(`${n.toLocaleString()}`)}function IM(){return""}function ov(n,a=Vn){return a.format(n,"yyyy")}const UM=ov,HM=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:iv,formatDay:LM,formatMonthCaption:PM,formatMonthDropdown:RM,formatWeekNumber:zM,formatWeekNumberHeader:IM,formatWeekdayName:_M,formatYearCaption:UM,formatYearDropdown:ov},Symbol.toStringTag,{value:"Module"}));function BM(n){return n?.formatMonthCaption&&!n.formatCaption&&(n.formatCaption=n.formatMonthCaption),n?.formatYearCaption&&!n.formatYearDropdown&&(n.formatYearDropdown=n.formatYearCaption),{...HM,...n}}function zf(n,a,o,s){let c=(s??new hn(o)).format(n,"PPPP");return a.today&&(c=`Today, ${c}`),a.selected&&(c=`${c}, selected`),c}const KM=zf;function If(n,a,o){return(o??new hn(a)).formatMonthYear(n)}const qM=If;function rv(n,a,o,s){let c=(s??new hn(o)).format(n,"PPPP");return a?.today&&(c=`Today, ${c}`),c}function sv(n){return"Choose the Month"}function lv(){return""}const FM="Go to the Next Month";function cv(n,a){return FM}function uv(n){return"Go to the Previous Month"}function dv(n,a,o){return(o??new hn(a)).format(n,"cccc")}function fv(n,a){return`Week ${n}`}function hv(n){return"Week Number"}function pv(n){return"Choose the Year"}const GM=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:qM,labelDay:KM,labelDayButton:zf,labelGrid:If,labelGridcell:rv,labelMonthDropdown:sv,labelNav:lv,labelNext:cv,labelPrevious:uv,labelWeekNumber:fv,labelWeekNumberHeader:hv,labelWeekday:dv,labelYearDropdown:pv},Symbol.toStringTag,{value:"Module"})),Tn=(n,a,o)=>a||(o?typeof o=="function"?o:(...s)=>o:n);function VM(n,a){const o=a.locale?.labels??{};return{...GM,...n??{},labelDayButton:Tn(zf,n?.labelDayButton,o.labelDayButton),labelMonthDropdown:Tn(sv,n?.labelMonthDropdown,o.labelMonthDropdown),labelNext:Tn(cv,n?.labelNext,o.labelNext),labelPrevious:Tn(uv,n?.labelPrevious,o.labelPrevious),labelWeekNumber:Tn(fv,n?.labelWeekNumber,o.labelWeekNumber),labelYearDropdown:Tn(pv,n?.labelYearDropdown,o.labelYearDropdown),labelGrid:Tn(If,n?.labelGrid,o.labelGrid),labelGridcell:Tn(rv,n?.labelGridcell,o.labelGridcell),labelNav:Tn(lv,n?.labelNav,o.labelNav),labelWeekNumberHeader:Tn(hv,n?.labelWeekNumberHeader,o.labelWeekNumberHeader),labelWeekday:Tn(dv,n?.labelWeekday,o.labelWeekday)}}function YM(n,a,o,s,c){const{startOfMonth:d,startOfYear:f,endOfYear:p,eachMonthOfInterval:m,getMonth:y}=c;return m({start:f(n),end:p(n)}).map(b=>{const A=s.formatMonthDropdown(b,c),N=y(b),E=a&&b<d(a)||o&&b>d(o)||!1;return{value:N,label:A,disabled:E}})}function $M(n,a={},o={}){let s={...a?.[ye.Day]};return Object.entries(n).filter(([,c])=>c===!0).forEach(([c])=>{s={...s,...o?.[c]}}),s}function QM(n,a,o,s){const c=s??n.today(),d=o?n.startOfBroadcastWeek(c,n):a?n.startOfISOWeek(c):n.startOfWeek(c),f=[];for(let p=0;p<7;p++){const m=n.addDays(d,p);f.push(m)}return f}function WM(n,a,o,s,c=!1){if(!n||!a)return;const{startOfYear:d,endOfYear:f,eachYearOfInterval:p,getYear:m}=s,y=d(n),C=f(a),x=p({start:y,end:C});return c&&x.reverse(),x.map(b=>{const A=o.formatYearDropdown(b,s);return{value:m(b),label:A,disabled:!1}})}const Vr=n=>n instanceof HTMLElement?n:null,vd=n=>[...n.querySelectorAll("[data-animated-month]")??[]],XM=n=>Vr(n.querySelector("[data-animated-month]")),Cd=n=>Vr(n.querySelector("[data-animated-caption]")),Sd=n=>Vr(n.querySelector("[data-animated-weeks]")),ZM=n=>Vr(n.querySelector("[data-animated-nav]")),JM=n=>Vr(n.querySelector("[data-animated-weekdays]"));function eE(n,a,{classNames:o,months:s,focused:c,dateLib:d}){const f=S.useRef(null),p=S.useRef(s),m=S.useRef(!1);S.useLayoutEffect(()=>{const y=p.current;if(p.current=s,!a||!n.current||!(n.current instanceof HTMLElement)||s.length===0||y.length===0||s.length!==y.length)return;const C=d.isSameMonth(s[0].date,y[0].date),x=d.isAfter(s[0].date,y[0].date),b=x?o[fn.caption_after_enter]:o[fn.caption_before_enter],A=x?o[fn.weeks_after_enter]:o[fn.weeks_before_enter],N=f.current,E=n.current.cloneNode(!0);if(E instanceof HTMLElement?(vd(E).forEach(D=>{if(!(D instanceof HTMLElement))return;const j=XM(D);j&&D.contains(j)&&D.removeChild(j);const T=Cd(D);T&&T.classList.remove(b);const w=Sd(D);w&&w.classList.remove(A)}),f.current=E):f.current=null,m.current||C||c)return;const O=N instanceof HTMLElement?vd(N):[],R=vd(n.current);if(R?.every(k=>k instanceof HTMLElement)&&O&&O.every(k=>k instanceof HTMLElement)){m.current=!0,n.current.style.isolation="isolate";const k=ZM(n.current);k&&(k.style.zIndex="1"),R.forEach((D,j)=>{const T=O[j];if(!T)return;D.style.position="relative",D.style.overflow="hidden";const w=Cd(D);w&&w.classList.add(b);const P=Sd(D);P&&P.classList.add(A);const F=()=>{m.current=!1,n.current&&(n.current.style.isolation=""),k&&(k.style.zIndex=""),w&&w.classList.remove(b),P&&P.classList.remove(A),D.style.position="",D.style.overflow="",D.contains(T)&&D.removeChild(T)};T.style.pointerEvents="none",T.style.position="absolute",T.style.overflow="hidden",T.setAttribute("aria-hidden","true");const z=JM(T);z&&(z.style.opacity="0");const $=Cd(T);$&&($.classList.add(x?o[fn.caption_before_exit]:o[fn.caption_after_exit]),$.addEventListener("animationend",F));const ne=Sd(T);ne&&ne.classList.add(x?o[fn.weeks_before_exit]:o[fn.weeks_after_exit]),D.insertBefore(T,D.firstChild)})}})}function tE(n,a,o,s){const c=n[0],d=n[n.length-1],{ISOWeek:f,fixedWeeks:p,broadcastCalendar:m}=o??{},{addDays:y,differenceInCalendarDays:C,differenceInCalendarMonths:x,endOfBroadcastWeek:b,endOfISOWeek:A,endOfMonth:N,endOfWeek:E,isAfter:O,startOfBroadcastWeek:R,startOfISOWeek:k,startOfWeek:D}=s,j=m?R(c,s):f?k(c):D(c),T=m?b(d):f?A(N(d)):E(N(d)),w=a&&(m?b(a):f?A(a):E(a)),P=w&&O(T,w)?w:T,F=C(P,j),z=x(d,c)+1,$=[];for(let xe=0;xe<=F;xe++){const te=y(j,xe);$.push(te)}const Z=(m?35:42)*z;if(p&&$.length<Z){const xe=Z-$.length;for(let te=0;te<xe;te++){const be=y($[$.length-1],1);$.push(be)}}return $}function nE(n){const a=[];return n.reduce((o,s)=>{const c=s.weeks.reduce((d,f)=>d.concat(f.days.slice()),a.slice());return o.concat(c.slice())},a.slice())}function aE(n,a,o,s){const{numberOfMonths:c=1}=o,d=[];for(let f=0;f<c;f++){const p=s.addMonths(n,f);if(a&&p>a)break;d.push(p)}return d}function Jy(n,a,o,s){const{month:c,defaultMonth:d,today:f=s.today(),numberOfMonths:p=1}=n;let m=c||d||f;const{differenceInCalendarMonths:y,addMonths:C,startOfMonth:x}=s;if(o&&y(o,m)<p-1){const b=-1*(p-1);m=C(o,b)}return a&&y(m,a)<0&&(m=a),x(m)}function iE(n,a,o,s){const{addDays:c,endOfBroadcastWeek:d,endOfISOWeek:f,endOfMonth:p,endOfWeek:m,getISOWeek:y,getWeek:C,startOfBroadcastWeek:x,startOfISOWeek:b,startOfWeek:A}=s,N=n.reduce((E,O)=>{const R=o.broadcastCalendar?x(O,s):o.ISOWeek?b(O):A(O),k=o.broadcastCalendar?d(O):o.ISOWeek?f(p(O)):m(p(O)),D=a.filter(P=>P>=R&&P<=k),j=o.broadcastCalendar?35:42;if(o.fixedWeeks&&D.length<j){const P=a.filter(F=>{const z=j-D.length;return F>k&&F<=c(k,z)});D.push(...P)}const T=D.reduce((P,F)=>{const z=o.ISOWeek?y(F):C(F),$=P.find(Z=>Z.weekNumber===z),ne=new ev(F,O,s);return $?$.days.push(ne):P.push(new eM(z,[ne])),P},[]),w=new JT(O,T);return E.push(w),E},[]);return o.reverseMonths?N.reverse():N}function oE(n,a){let{startMonth:o,endMonth:s}=n;const{startOfYear:c,startOfDay:d,startOfMonth:f,endOfMonth:p,addYears:m,endOfYear:y,newDate:C,today:x}=a,{fromYear:b,toYear:A,fromMonth:N,toMonth:E}=n;!o&&N&&(o=N),!o&&b&&(o=a.newDate(b,0,1)),!s&&E&&(s=E),!s&&A&&(s=C(A,11,31));const O=n.captionLayout==="dropdown"||n.captionLayout==="dropdown-years";return o?o=f(o):b?o=C(b,0,1):!o&&O&&(o=c(m(n.today??x(),-100))),s?s=p(s):A?s=C(A,11,31):!s&&O&&(s=y(n.today??x())),[o&&d(o),s&&d(s)]}function rE(n,a,o,s){if(o.disableNavigation)return;const{pagedNavigation:c,numberOfMonths:d=1}=o,{startOfMonth:f,addMonths:p,differenceInCalendarMonths:m}=s,y=c?d:1,C=f(n);if(!a)return p(C,y);if(!(m(a,n)<d))return p(C,y)}function sE(n,a,o,s){if(o.disableNavigation)return;const{pagedNavigation:c,numberOfMonths:d}=o,{startOfMonth:f,addMonths:p,differenceInCalendarMonths:m}=s,y=c?d??1:1,C=f(n);if(!a)return p(C,-y);if(!(m(C,a)<=0))return p(C,-y)}function lE(n){const a=[];return n.reduce((o,s)=>o.concat(s.weeks.slice()),a.slice())}function Gl(n,a){const[o,s]=S.useState(n);return[a===void 0?o:a,s]}function cE(n,a){const[o,s]=oE(n,a),{startOfMonth:c,endOfMonth:d}=a,f=Jy(n,o,s,a),[p,m]=Gl(f,n.month?f:void 0);S.useEffect(()=>{const j=Jy(n,o,s,a);m(j)},[n.timeZone]);const{months:y,weeks:C,days:x,previousMonth:b,nextMonth:A}=S.useMemo(()=>{const j=aE(p,s,{numberOfMonths:n.numberOfMonths},a),T=tE(j,n.endMonth?d(n.endMonth):void 0,{ISOWeek:n.ISOWeek,fixedWeeks:n.fixedWeeks,broadcastCalendar:n.broadcastCalendar},a),w=iE(j,T,{broadcastCalendar:n.broadcastCalendar,fixedWeeks:n.fixedWeeks,ISOWeek:n.ISOWeek,reverseMonths:n.reverseMonths},a),P=lE(w),F=nE(w),z=sE(p,o,n,a),$=rE(p,s,n,a);return{months:w,weeks:P,days:F,previousMonth:z,nextMonth:$}},[a,p.getTime(),s?.getTime(),o?.getTime(),n.disableNavigation,n.broadcastCalendar,n.endMonth?.getTime(),n.fixedWeeks,n.ISOWeek,n.numberOfMonths,n.pagedNavigation,n.reverseMonths]),{disableNavigation:N,onMonthChange:E}=n,O=j=>C.some(T=>T.days.some(w=>w.isEqualTo(j))),R=j=>{if(N)return;let T=c(j);o&&T<c(o)&&(T=c(o)),s&&T>c(s)&&(T=c(s)),m(T),E?.(T)};return{months:y,weeks:C,days:x,navStart:o,navEnd:s,previousMonth:b,nextMonth:A,goToMonth:R,goToDay:j=>{O(j)||R(j.date)}}}var Bn;(function(n){n[n.Today=0]="Today",n[n.Selected=1]="Selected",n[n.LastFocused=2]="LastFocused",n[n.FocusedModifier=3]="FocusedModifier"})(Bn||(Bn={}));function ex(n){return!n[ft.disabled]&&!n[ft.hidden]&&!n[ft.outside]}function uE(n,a,o,s){let c,d=-1;for(const f of n){const p=a(f);ex(p)&&(p[ft.focused]&&d<Bn.FocusedModifier?(c=f,d=Bn.FocusedModifier):s?.isEqualTo(f)&&d<Bn.LastFocused?(c=f,d=Bn.LastFocused):o(f.date)&&d<Bn.Selected?(c=f,d=Bn.Selected):p[ft.today]&&d<Bn.Today&&(c=f,d=Bn.Today))}return c||(c=n.find(f=>ex(a(f)))),c}function dE(n,a,o,s,c,d,f){const{ISOWeek:p,broadcastCalendar:m}=d,{addDays:y,addMonths:C,addWeeks:x,addYears:b,endOfBroadcastWeek:A,endOfISOWeek:N,endOfWeek:E,max:O,min:R,startOfBroadcastWeek:k,startOfISOWeek:D,startOfWeek:j}=f;let w={day:y,week:x,month:C,year:b,startOfWeek:P=>m?k(P,f):p?D(P):j(P),endOfWeek:P=>m?A(P):p?N(P):E(P)}[n](o,a==="after"?1:-1);return a==="before"&&s?w=O([s,w]):a==="after"&&c&&(w=R([c,w])),w}function mv(n,a,o,s,c,d,f,p=0){if(p>365)return;const m=dE(n,a,o.date,s,c,d,f),y=!!(d.disabled&&va(m,d.disabled,f)),C=!!(d.hidden&&va(m,d.hidden,f)),x=m,b=new ev(m,x,f);return!y&&!C?b:mv(n,a,b,s,c,d,f,p+1)}function fE(n,a,o,s,c){const{autoFocus:d}=n,[f,p]=S.useState(),m=uE(a.days,o,s||(()=>!1),f),[y,C]=S.useState(d?m:void 0);return{isFocusTarget:E=>!!m?.isEqualTo(E),setFocused:C,focused:y,blur:()=>{p(y),C(void 0)},moveFocus:(E,O)=>{if(!y)return;const R=mv(E,O,y,a.navStart,a.navEnd,n,c);R&&(n.disableNavigation&&!a.days.some(D=>D.isEqualTo(R))||(a.goToDay(R),C(R)))}}}function hE(n,a){const{selected:o,required:s,onSelect:c}=n,[d,f]=Gl(o,c?o:void 0),p=c?o:d,{isSameDay:m}=a,y=A=>p?.some(N=>m(N,A))??!1,{min:C,max:x}=n;return{selected:p,select:(A,N,E)=>{let O=[...p??[]];if(y(A)){if(p?.length===C||s&&p?.length===1)return;O=p?.filter(R=>!m(R,A))}else p?.length===x?O=[A]:O=[...O,A];return c||f(O),c?.(O,A,N,E),O},isSelected:y}}function pE(n,a,o=0,s=0,c=!1,d=Vn){const{from:f,to:p}=a||{},{isSameDay:m,isAfter:y,isBefore:C}=d;let x;if(!f&&!p)x={from:n,to:o>0?void 0:n};else if(f&&!p)m(f,n)?o===0?x={from:f,to:n}:c?x={from:f,to:void 0}:x=void 0:C(n,f)?x={from:n,to:f}:x={from:f,to:n};else if(f&&p)if(m(f,n)&&m(p,n))c?x={from:f,to:p}:x=void 0;else if(m(f,n))x={from:f,to:o>0?void 0:n};else if(m(p,n))x={from:n,to:o>0?void 0:n};else if(C(n,f))x={from:n,to:p};else if(y(n,f))x={from:f,to:n};else if(y(n,p))x={from:f,to:n};else throw new Error("Invalid range");if(x?.from&&x?.to){const b=d.differenceInCalendarDays(x.to,x.from);s>0&&b>s?x={from:n,to:void 0}:o>1&&b<o&&(x={from:n,to:void 0})}return x}function mE(n,a,o=Vn){const s=Array.isArray(a)?a:[a];let c=n.from;const d=o.differenceInCalendarDays(n.to,n.from),f=Math.min(d,6);for(let p=0;p<=f;p++){if(s.includes(c.getDay()))return!0;c=o.addDays(c,1)}return!1}function tx(n,a,o=Vn){return ba(n,a.from,!1,o)||ba(n,a.to,!1,o)||ba(a,n.from,!1,o)||ba(a,n.to,!1,o)}function gE(n,a,o=Vn){const s=Array.isArray(a)?a:[a];if(s.filter(p=>typeof p!="function").some(p=>typeof p=="boolean"?p:o.isDate(p)?ba(n,p,!1,o):av(p,o)?p.some(m=>ba(n,m,!1,o)):Fl(p)?p.from&&p.to?tx(n,{from:p.from,to:p.to},o):!1:nv(p)?mE(n,p.dayOfWeek,o):Lf(p)?o.isAfter(p.before,p.after)?tx(n,{from:o.addDays(p.after,1),to:o.addDays(p.before,-1)},o):va(n.from,p,o)||va(n.to,p,o):Rf(p)||_f(p)?va(n.from,p,o)||va(n.to,p,o):!1))return!0;const f=s.filter(p=>typeof p=="function");if(f.length){let p=n.from;const m=o.differenceInCalendarDays(n.to,n.from);for(let y=0;y<=m;y++){if(f.some(C=>C(p)))return!0;p=o.addDays(p,1)}}return!1}function yE(n,a){const{disabled:o,excludeDisabled:s,selected:c,required:d,onSelect:f}=n,[p,m]=Gl(c,f?c:void 0),y=f?c:p;return{selected:y,select:(b,A,N)=>{const{min:E,max:O}=n,R=b?pE(b,y,E,O,d,a):void 0;return s&&o&&R?.from&&R.to&&gE({from:R.from,to:R.to},o,a)&&(R.from=b,R.to=void 0),f||m(R),f?.(R,b,A,N),R},isSelected:b=>y&&ba(y,b,!1,a)}}function xE(n,a){const{selected:o,required:s,onSelect:c}=n,[d,f]=Gl(o,c?o:void 0),p=c?o:d,{isSameDay:m}=a;return{selected:p,select:(x,b,A)=>{let N=x;return!s&&p&&p&&m(x,p)&&(N=void 0),c||f(N),c?.(N,x,b,A),N},isSelected:x=>p?m(p,x):!1}}function bE(n,a){const o=xE(n,a),s=hE(n,a),c=yE(n,a);switch(n.mode){case"single":return o;case"multiple":return s;case"range":return c;default:return}}function _t(n,a){return n instanceof xa&&n.timeZone===a?n:new xa(n,a)}function nx(n,a){return typeof n=="boolean"||typeof n=="function"?n:n instanceof Date?_t(n,a):Array.isArray(n)?n.map(o=>o instanceof Date?_t(o,a):o):Fl(n)?{...n,from:n.from?_t(n.from,a):n.from,to:n.to?_t(n.to,a):n.to}:Lf(n)?{before:_t(n.before,a),after:_t(n.after,a)}:Rf(n)?{after:_t(n.after,a)}:_f(n)?{before:_t(n.before,a)}:n}function wd(n,a){return n&&(Array.isArray(n)?n.map(o=>nx(o,a)):nx(n,a))}function vE(n){let a=n;const o=a.timeZone;if(o&&(a={...n,timeZone:o},a.today&&(a.today=_t(a.today,o)),a.month&&(a.month=_t(a.month,o)),a.defaultMonth&&(a.defaultMonth=_t(a.defaultMonth,o)),a.startMonth&&(a.startMonth=_t(a.startMonth,o)),a.endMonth&&(a.endMonth=_t(a.endMonth,o)),a.mode==="single"&&a.selected?a.selected=_t(a.selected,o):a.mode==="multiple"&&a.selected?a.selected=a.selected?.map(me=>_t(me,o)):a.mode==="range"&&a.selected&&(a.selected={from:a.selected.from?_t(a.selected.from,o):a.selected.from,to:a.selected.to?_t(a.selected.to,o):a.selected.to}),a.disabled!==void 0&&(a.disabled=wd(a.disabled,o)),a.hidden!==void 0&&(a.hidden=wd(a.hidden,o)),a.modifiers)){const me={};Object.keys(a.modifiers).forEach(ke=>{me[ke]=wd(a.modifiers?.[ke],o)}),a.modifiers=me}const{components:s,formatters:c,labels:d,dateLib:f,locale:p,classNames:m}=S.useMemo(()=>{const me={...Jb,...a.locale},ke=new hn({locale:me,weekStartsOn:a.broadcastCalendar?1:a.weekStartsOn,firstWeekContainsDate:a.firstWeekContainsDate,useAdditionalWeekYearTokens:a.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:a.useAdditionalDayOfYearTokens,timeZone:a.timeZone,numerals:a.numerals},a.dateLib);return{dateLib:ke,components:MM(a.components),formatters:BM(a.formatters),labels:VM(a.labels,ke.options),locale:me,classNames:{...OM(),...a.classNames}}},[a.locale,a.broadcastCalendar,a.weekStartsOn,a.firstWeekContainsDate,a.useAdditionalWeekYearTokens,a.useAdditionalDayOfYearTokens,a.timeZone,a.numerals,a.dateLib,a.components,a.formatters,a.labels,a.classNames]);a.today||(a={...a,today:f.today()});const{captionLayout:y,mode:C,navLayout:x,numberOfMonths:b=1,onDayBlur:A,onDayClick:N,onDayFocus:E,onDayKeyDown:O,onDayMouseEnter:R,onDayMouseLeave:k,onNextClick:D,onPrevClick:j,showWeekNumber:T,styles:w}=a,{formatCaption:P,formatDay:F,formatMonthDropdown:z,formatWeekNumber:$,formatWeekNumberHeader:ne,formatWeekdayName:Z,formatYearDropdown:xe}=c,te=cE(a,f),{days:be,months:I,navStart:X,navEnd:ee,previousMonth:re,nextMonth:fe,goToMonth:he}=te,de=jM(be,a,X,ee,f),{isSelected:H,select:Q,selected:ie}=bE(a,f)??{},{blur:ae,focused:oe,isFocusTarget:ge,moveFocus:De,setFocused:Ue}=fE(a,te,de,H??(()=>!1),f),{labelDayButton:st,labelGridcell:gt,labelGrid:qe,labelMonthDropdown:lt,labelNav:Bt,labelPrevious:Xt,labelNext:Yn,labelWeekday:je,labelWeekNumber:Zt,labelWeekNumberHeader:Pn,labelYearDropdown:Jt}=d,ka=S.useMemo(()=>QM(f,a.ISOWeek,a.broadcastCalendar,a.today),[f,a.ISOWeek,a.broadcastCalendar,a.today]),$n=C!==void 0||N!==void 0,yt=S.useCallback(()=>{re&&(he(re),j?.(re))},[re,he,j]),en=S.useCallback(()=>{fe&&(he(fe),D?.(fe))},[he,fe,D]),Qn=S.useCallback((me,ke)=>Se=>{Se.preventDefault(),Se.stopPropagation(),Ue(me),!ke.disabled&&(Q?.(me.date,ke,Se),N?.(me.date,ke,Se))},[Q,N,Ue]),ni=S.useCallback((me,ke)=>Se=>{Ue(me),E?.(me.date,ke,Se)},[E,Ue]),Ln=S.useCallback((me,ke)=>Se=>{ae(),A?.(me.date,ke,Se)},[ae,A]),Rn=S.useCallback((me,ke)=>Se=>{const Pe={ArrowLeft:[Se.shiftKey?"month":"day",a.dir==="rtl"?"after":"before"],ArrowRight:[Se.shiftKey?"month":"day",a.dir==="rtl"?"before":"after"],ArrowDown:[Se.shiftKey?"year":"week","after"],ArrowUp:[Se.shiftKey?"year":"week","before"],PageUp:[Se.shiftKey?"year":"month","before"],PageDown:[Se.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(Pe[Se.key]){Se.preventDefault(),Se.stopPropagation();const[at,Ne]=Pe[Se.key];De(at,Ne)}O?.(me.date,ke,Se)},[De,O,a.dir]),Ti=S.useCallback((me,ke)=>Se=>{R?.(me.date,ke,Se)},[R]),ko=S.useCallback((me,ke)=>Se=>{k?.(me.date,ke,Se)},[k]),Do=S.useCallback(me=>ke=>{const Se=Number(ke.target.value),Pe=f.setMonth(f.startOfMonth(me),Se);he(Pe)},[f,he]),Wn=S.useCallback(me=>ke=>{const Se=Number(ke.target.value),Pe=f.setYear(f.startOfMonth(me),Se);he(Pe)},[f,he]),{className:J,style:Ee}=S.useMemo(()=>({className:[m[ye.Root],a.className].filter(Boolean).join(" "),style:{...w?.[ye.Root],...a.style}}),[m,a.className,a.style,w]),Ce=EM(a),Oe=S.useRef(null);eE(Oe,!!a.animate,{classNames:m,months:I,focused:oe,dateLib:f});const ct={dayPickerProps:a,selected:ie,select:Q,isSelected:H,months:I,nextMonth:fe,previousMonth:re,goToMonth:he,getModifiers:de,components:s,classNames:m,styles:w,labels:d,formatters:c};return se.createElement(tv.Provider,{value:ct},se.createElement(s.Root,{rootRef:a.animate?Oe:void 0,className:J,style:Ee,dir:a.dir,id:a.id,lang:a.lang,nonce:a.nonce,title:a.title,role:a.role,"aria-label":a["aria-label"],"aria-labelledby":a["aria-labelledby"],...Ce},se.createElement(s.Months,{className:m[ye.Months],style:w?.[ye.Months]},!a.hideNavigation&&!x&&se.createElement(s.Nav,{"data-animated-nav":a.animate?"true":void 0,className:m[ye.Nav],style:w?.[ye.Nav],"aria-label":Bt(),onPreviousClick:yt,onNextClick:en,previousMonth:re,nextMonth:fe}),I.map((me,ke)=>se.createElement(s.Month,{"data-animated-month":a.animate?"true":void 0,className:m[ye.Month],style:w?.[ye.Month],key:ke,displayIndex:ke,calendarMonth:me},x==="around"&&!a.hideNavigation&&ke===0&&se.createElement(s.PreviousMonthButton,{type:"button",className:m[ye.PreviousMonthButton],tabIndex:re?void 0:-1,"aria-disabled":re?void 0:!0,"aria-label":Xt(re),onClick:yt,"data-animated-button":a.animate?"true":void 0},se.createElement(s.Chevron,{disabled:re?void 0:!0,className:m[ye.Chevron],orientation:a.dir==="rtl"?"right":"left"})),se.createElement(s.MonthCaption,{"data-animated-caption":a.animate?"true":void 0,className:m[ye.MonthCaption],style:w?.[ye.MonthCaption],calendarMonth:me,displayIndex:ke},y?.startsWith("dropdown")?se.createElement(s.DropdownNav,{className:m[ye.Dropdowns],style:w?.[ye.Dropdowns]},(()=>{const Se=y==="dropdown"||y==="dropdown-months"?se.createElement(s.MonthsDropdown,{key:"month",className:m[ye.MonthsDropdown],"aria-label":lt(),classNames:m,components:s,disabled:!!a.disableNavigation,onChange:Do(me.date),options:YM(me.date,X,ee,c,f),style:w?.[ye.Dropdown],value:f.getMonth(me.date)}):se.createElement("span",{key:"month"},z(me.date,f)),Pe=y==="dropdown"||y==="dropdown-years"?se.createElement(s.YearsDropdown,{key:"year",className:m[ye.YearsDropdown],"aria-label":Jt(f.options),classNames:m,components:s,disabled:!!a.disableNavigation,onChange:Wn(me.date),options:WM(X,ee,c,f,!!a.reverseYears),style:w?.[ye.Dropdown],value:f.getYear(me.date)}):se.createElement("span",{key:"year"},xe(me.date,f));return f.getMonthYearOrder()==="year-first"?[Pe,Se]:[Se,Pe]})(),se.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"}},P(me.date,f.options,f))):se.createElement(s.CaptionLabel,{className:m[ye.CaptionLabel],role:"status","aria-live":"polite"},P(me.date,f.options,f))),x==="around"&&!a.hideNavigation&&ke===b-1&&se.createElement(s.NextMonthButton,{type:"button",className:m[ye.NextMonthButton],tabIndex:fe?void 0:-1,"aria-disabled":fe?void 0:!0,"aria-label":Yn(fe),onClick:en,"data-animated-button":a.animate?"true":void 0},se.createElement(s.Chevron,{disabled:fe?void 0:!0,className:m[ye.Chevron],orientation:a.dir==="rtl"?"left":"right"})),ke===b-1&&x==="after"&&!a.hideNavigation&&se.createElement(s.Nav,{"data-animated-nav":a.animate?"true":void 0,className:m[ye.Nav],style:w?.[ye.Nav],"aria-label":Bt(),onPreviousClick:yt,onNextClick:en,previousMonth:re,nextMonth:fe}),se.createElement(s.MonthGrid,{role:"grid","aria-multiselectable":C==="multiple"||C==="range","aria-label":qe(me.date,f.options,f)||void 0,className:m[ye.MonthGrid],style:w?.[ye.MonthGrid]},!a.hideWeekdays&&se.createElement(s.Weekdays,{"data-animated-weekdays":a.animate?"true":void 0,className:m[ye.Weekdays],style:w?.[ye.Weekdays]},T&&se.createElement(s.WeekNumberHeader,{"aria-label":Pn(f.options),className:m[ye.WeekNumberHeader],style:w?.[ye.WeekNumberHeader],scope:"col"},ne()),ka.map(Se=>se.createElement(s.Weekday,{"aria-label":je(Se,f.options,f),className:m[ye.Weekday],key:String(Se),style:w?.[ye.Weekday],scope:"col"},Z(Se,f.options,f)))),se.createElement(s.Weeks,{"data-animated-weeks":a.animate?"true":void 0,className:m[ye.Weeks],style:w?.[ye.Weeks]},me.weeks.map(Se=>se.createElement(s.Week,{className:m[ye.Week],key:Se.weekNumber,style:w?.[ye.Week],week:Se},T&&se.createElement(s.WeekNumber,{week:Se,style:w?.[ye.WeekNumber],"aria-label":Zt(Se.weekNumber,{locale:p}),className:m[ye.WeekNumber],scope:"row",role:"rowheader"},$(Se.weekNumber,f)),Se.days.map(Pe=>{const{date:at}=Pe,Ne=de(Pe);if(Ne[ft.focused]=!Ne.hidden&&!!oe?.isEqualTo(Pe),Ne[Mn.selected]=H?.(at)||Ne.selected,Fl(ie)){const{from:tn,to:An}=ie;Ne[Mn.range_start]=!!(tn&&An&&f.isSameDay(at,tn)),Ne[Mn.range_end]=!!(tn&&An&&f.isSameDay(at,An)),Ne[Mn.range_middle]=ba(ie,at,!0,f)}const It=$M(Ne,w,a.modifiersStyles),Xn=TM(Ne,m,a.modifiersClassNames),kt=!$n&&!Ne.hidden?gt(at,Ne,f.options,f):void 0;return se.createElement(s.Day,{key:`${Pe.isoDate}_${Pe.displayMonthId}`,day:Pe,modifiers:Ne,className:Xn.join(" "),style:It,role:"gridcell","aria-selected":Ne.selected||void 0,"aria-label":kt,"data-day":Pe.isoDate,"data-month":Pe.outside?Pe.dateMonthId:void 0,"data-selected":Ne.selected||void 0,"data-disabled":Ne.disabled||void 0,"data-hidden":Ne.hidden||void 0,"data-outside":Pe.outside||void 0,"data-focused":Ne.focused||void 0,"data-today":Ne.today||void 0},!Ne.hidden&&$n?se.createElement(s.DayButton,{className:m[ye.DayButton],style:w?.[ye.DayButton],type:"button",day:Pe,modifiers:Ne,disabled:!Ne.focused&&Ne.disabled||void 0,"aria-disabled":Ne.focused&&Ne.disabled||void 0,tabIndex:ge(Pe)?0:-1,"aria-label":st(at,Ne,f.options,f),onClick:Qn(Pe,Ne),onBlur:Ln(Pe,Ne),onFocus:ni(Pe,Ne),onKeyDown:Rn(Pe,Ne),onMouseEnter:Ti(Pe,Ne),onMouseLeave:ko(Pe,Ne)},F(at,f.options,f)):!Ne.hidden&&F(Pe.date,f.options,f))})))))))),a.footer&&se.createElement(s.Footer,{className:m[ye.Footer],style:w?.[ye.Footer],role:"status","aria-live":"polite"},a.footer)))}function CE({className:n,classNames:a,showOutsideDays:o=!0,...s}){return l.jsx(vE,{showOutsideDays:o,className:K("p-2",n),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:K(ul({variant:"ghost"}),"h-7 w-7 bg-transparent p-0 opacity-70 hover:opacity-100 hover:bg-accent rounded-md"),button_next:K(ul({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:K("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:K(ul({variant:"ghost"}),"h-8 w-8 p-0 font-normal rounded-full text-xs","aria-selected:opacity-100"),range_start:K("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:K("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:K("aria-selected:bg-accent aria-selected:text-accent-foreground","aria-selected:rounded-none"),selected:K("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",...a},components:{Chevron:({orientation:c,className:d,...f})=>{const p=c==="left"?YS:c==="right"?Nl:c==="up"?Gd:Br;return l.jsx(p,{className:K("h-4 w-4",d),...f})}},...s})}CE.displayName="Calendar";const SE=S.lazy(()=>tt(()=>Promise.resolve().then(()=>ql),void 0).then(n=>({default:n.CodeEditor})));function WO({rawJsonContent:n,isRawJsonValid:a,rawJsonEdits:o,rawSettingsEnv:s,onChange:c,missingRequiredFields:d=[]}){const f=d.length>0;return l.jsx(S.Suspense,{fallback:l.jsxs("div",{className:"flex items-center justify-center h-full",children:[l.jsx(On,{className:"w-6 h-6 animate-spin text-muted-foreground"}),l.jsx("span",{className:"ml-2 text-muted-foreground",children:"Loading editor..."})]}),children:l.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[!a&&o!==null&&l.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:[l.jsx(No,{className:"w-4 h-4"}),"Invalid JSON syntax"]}),a&&f&&l.jsxs("div",{className:"mb-2 px-3 py-2 bg-warning/10 text-warning-foreground text-sm rounded-md flex items-start gap-2 mx-6 mt-4 shrink-0 border border-warning/20",children:[l.jsx(Gn,{className:"w-4 h-4 mt-0.5 text-amber-500 shrink-0"}),l.jsxs("div",{children:[l.jsx("span",{className:"font-medium text-amber-600 dark:text-amber-400",children:"Missing required fields:"})," ",l.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:d.join(", ")}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"These fields will use default values at runtime."})]})]}),l.jsx("div",{className:"min-h-0 flex-1 overflow-hidden px-6 pb-4 pt-4",children:l.jsx("div",{className:"h-full border rounded-md overflow-hidden bg-background",children:l.jsx(SE,{value:n,onChange:c,language:"json",minHeight:"100%",heightMode:"fill-parent"})})}),l.jsx("div",{className:"mx-6 mb-4",children:l.jsx("div",{className:"border rounded-md overflow-hidden",children:l.jsx(Df,{profileEnv:s})})})]})})}const XO={target:"Target CLI",cliproxy:"CLIProxy Provider","api-profiles":"API Profile",websearch:"WebSearch"},ZO=[{id:"codex-target-runtime-support",title:"Native Codex runtime support is live",summary:"Codex now participates as a first-class runtime target through ccs-codex, ccsx, ccsxp, or --target codex.",primaryAction:"Use Codex as a runtime target for native Codex sessions and Codex-routed CLIProxy flows.",publishedAt:"2026-03-28",status:"new",scopes:["target","cliproxy","api-profiles"],entryIds:["codex-target","codex-cliproxy"],highlights:["Use ccs-codex or ccsx for native Codex runs.","Use ccsxp for the built-in CCS Codex provider shortcut on native Codex.","Built-in Codex and Codex bridge profiles can run on native Codex with --target codex.","Saved default targets for API profiles and variants can now be claude, droid, or codex."],actions:[{id:"copy-codex-alias-command",label:"Open native Codex",description:"Launch Codex through the explicit CCS runtime alias.",type:"command",command:"ccs-codex"},{id:"copy-codex-provider-command",label:"Run built-in Codex on Codex",description:"Use the built-in Codex provider shortcut on native Codex.",type:"command",command:'ccsxp "your prompt"'},{id:"copy-codex-provider-command-explicit",label:"Run built-in Codex on Codex (explicit)",description:"Use the explicit built-in Codex provider route on native Codex.",type:"command",command:'ccs codex --target codex "your prompt"'},{id:"open-codex-dashboard",label:"Open Codex dashboard",description:"Review Codex runtime support, config layers, and dashboard setup flows.",type:"route",path:"/codex"}],routes:[{label:"Codex CLI",path:"/codex"}],commands:["ccs-codex","ccsx",'ccsxp "your prompt"','ccs codex --target codex "your prompt"']},{id:"droid-target-support",title:"Factory Droid support is live",summary:"API Profiles and CLIProxy variants now support Droid as a first-class execution target.",primaryAction:"Set Droid as your default execution target for non-Claude workflows.",publishedAt:"2026-02-25",status:"new",scopes:["target","api-profiles","cliproxy"],entryIds:["droid-target","custom-api-profiles","codex-cliproxy","agy-cliproxy"],highlights:["Set default target to Droid when creating or editing API Profiles.","Set default target to Droid for CLIProxy variants, including Codex and Antigravity flows.","Use ccs-droid as the explicit alias, with ccsd kept as the legacy shortcut."],actions:[{id:"open-api-profiles",label:"Set default target in API Profiles",description:"Open API Profiles and set Default Target to Droid for profiles you run often.",type:"route",path:"/providers"},{id:"open-cliproxy",label:"Set default target in CLIProxy variants",description:"Open CLIProxy variants and set target to Droid for Codex/Antigravity or custom variants.",type:"route",path:"/cliproxy"},{id:"copy-ccs-droid-command",label:"Run once with explicit Droid alias",description:"Use ccs-droid to force the Droid target with your current profile.",type:"command",command:"ccs-droid glm"},{id:"copy-target-override",label:"Run once with --target override",description:"Keep your default profile but force Droid for a single command.",type:"command",command:'ccs codex --target droid "your prompt"'}],routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccs-droid glm",'ccs codex --target droid "your prompt"',"ccs cliproxy create mycodex --provider codex --target droid"]},{id:"updates-center-launch",title:"Updates Center is available for rollout tasks",summary:"A focused Updates Center exists for setup tasks and rollout guidance when you need it.",primaryAction:"Use this page only when needed for rollout tasks, then return to your normal workflow.",publishedAt:"2026-02-25",status:"new",scopes:["target","cliproxy","api-profiles","websearch"],entryIds:["droid-target","codex-cliproxy","custom-api-profiles","opencode-websearch"],highlights:["Single data source powers update content and integration mapping.","Notices can be tracked as new, seen, done, or dismissed.","Catalog covers target CLI, CLIProxy providers, and WebSearch integrations."],actions:[{id:"open-updates-page",label:"Open Updates Center when needed",description:"Review rollout tasks only when you want guided setup changes.",type:"route",path:"/updates"},{id:"copy-open-dashboard",label:"Open dashboard from terminal",description:"Re-open config dashboard anytime from CLI.",type:"command",command:"ccs config"}],routes:[{label:"Updates Center",path:"/updates"}],commands:["ccs config"]}],wE=[{id:"claude-target",name:"Claude Code",scope:"target",status:"stable",summary:"Default runtime target for all CCS profile types.",pillars:{baseUrl:"From profile settings (ANTHROPIC_BASE_URL)",auth:"From profile settings (ANTHROPIC_AUTH_TOKEN)",model:"From profile settings (ANTHROPIC_MODEL)"},routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccs",'ccs glm "your prompt"']},{id:"droid-target",name:"Factory Droid",scope:"target",status:"new",summary:"First-class target for API Profiles and CLIProxy variants.",pillars:{baseUrl:"From profile or variant settings",auth:"From profile or variant settings",model:"From profile or variant settings"},routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccs-droid glm","ccs km --target droid","ccs codex --target droid"],notes:"Use ccs-droid as the explicit runtime alias. Legacy ccsd still works."},{id:"codex-target",name:"Codex CLI",scope:"target",status:"new",summary:"First-class runtime target for native Codex sessions and Codex-routed CLIProxy flows.",pillars:{baseUrl:"Native ~/.codex config for default mode, transient -c overrides for CCS-backed routes",auth:"Native Codex auth for default mode, env_key injection for CCS-backed routes",model:"Native Codex config or routed Codex model mapping from CLIProxy"},routes:[{label:"Codex CLI",path:"/codex"}],commands:["ccs-codex","ccsx","ccs codex --target codex","ccs codex-api --target codex"],notes:"Saved default targets for API profiles and CLIProxy variants can now be claude, droid, or codex."},{id:"codex-cliproxy",name:"Codex via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed provider with configurable variant model and a native Codex shortcut.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:['ccsxp "your prompt"',"ccs codex --target codex","ccs codex","ccs cliproxy create mycodex --provider codex","ccs api create codex-api --cliproxy-provider codex"],notes:"Use ccsxp when you want the built-in Codex provider on native Codex without retyping --target codex."},{id:"gemini-cliproxy",name:"Gemini via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed Gemini provider with multi-account management.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:["ccs gemini","ccs cliproxy create mygem --provider gemini"]},{id:"agy-cliproxy",name:"Antigravity via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed Antigravity provider with variant target controls.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:["ccs agy","ccs cliproxy create myagy --provider agy --target droid"]},{id:"custom-api-profiles",name:"Custom API Profiles",scope:"api-profiles",status:"stable",summary:"Any Anthropic-compatible endpoint with per-profile target and model mapping.",pillars:{baseUrl:"User-defined endpoint",auth:"User-defined token/key",model:"User-defined model identifier"},routes:[{label:"API Profiles",path:"/providers"}],commands:["ccs api create myprofile",'ccs myprofile "your prompt"']},{id:"opencode-websearch",name:"OpenCode WebSearch",scope:"websearch",status:"stable",summary:"WebSearch provider surfaced in Settings for third-party profile workflows.",pillars:{baseUrl:"Managed by OpenCode CLI integration",auth:"Provider-specific (managed externally)",model:"Configurable in WebSearch settings"},routes:[{label:"Settings",path:"/settings"}],commands:["ccs config",'ccs codex "your prompt"'],notes:"Enable OpenCode in Settings > WebSearch to activate fallback search."}],NE=new Map(wE.map(n=>[n.id,n]));function JO(n){return n.entryIds.map(a=>NE.get(a)).filter(a=>!!a)}function eP(n){const a=new Date(`${n}T00:00:00Z`);return Number.isNaN(a.getTime())?n:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",timeZone:"UTC"}).format(a)}S.lazy(()=>tt(()=>Promise.resolve().then(()=>ql),void 0).then(n=>({default:n.CodeEditor})));function AE(){const{t:n}=Mt(),[a,o]=S.useState(""),[s,c]=S.useState(""),[d,f]=S.useState(null),[p,m]=S.useState(!1),{login:y,authRequired:C,isAuthenticated:x}=Xd(),b=qd(),N=wl().state?.from?.pathname||"/";if(S.useEffect(()=>{(x||!C)&&b(N,{replace:!0})},[x,C,b,N]),x||!C)return null;const E=async O=>{O.preventDefault(),f(null),m(!0);try{await y(a,s),b(N,{replace:!0})}catch(R){f(R instanceof Error?R.message:n("auth.loginFailed"))}finally{m(!1)}};return l.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:l.jsxs(eT,{className:"w-full max-w-sm",children:[l.jsxs(tT,{className:"space-y-1 text-center",children:[l.jsx("div",{className:"mx-auto mb-2 flex h-12 w-12 items-center justify-center rounded-full bg-primary/10",children:l.jsx($S,{className:"h-6 w-6 text-primary"})}),l.jsx(nT,{className:"text-2xl",children:n("auth.dashboardTitle")}),l.jsx(aT,{children:n("auth.loginDescription")})]}),l.jsx(iT,{children:l.jsxs("form",{onSubmit:E,className:"space-y-4",children:[d&&l.jsxs(wf,{variant:"destructive",children:[l.jsx(Dl,{className:"h-4 w-4"}),l.jsx(Nf,{children:d})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(un,{htmlFor:"username",children:n("auth.username")}),l.jsx(Hn,{id:"username",type:"text",value:a,onChange:O=>o(O.target.value),placeholder:n("auth.usernamePlaceholder"),autoComplete:"username",disabled:p,required:!0})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(un,{htmlFor:"password",children:n("auth.password")}),l.jsx(Hn,{id:"password",type:"password",value:s,onChange:O=>c(O.target.value),placeholder:n("auth.passwordPlaceholder"),autoComplete:"current-password",disabled:p,required:!0})]}),l.jsx(dt,{type:"submit",className:"w-full",disabled:p,children:p?l.jsxs(l.Fragment,{children:[l.jsx(On,{className:"mr-2 h-4 w-4 animate-spin"}),n("auth.signingIn")]}):n("auth.signIn")})]})})]})})}const kE=S.lazy(()=>tt(()=>import("./index-DHrTq-0n.js"),__vite__mapDeps([21,1,2,4,5,7,22,6,8,9])).then(n=>({default:n.AnalyticsPage}))),DE=S.lazy(()=>tt(()=>import("./api-DhM3BYXr.js"),__vite__mapDeps([23,1,2,5,24,17,6,4,3,7,8,9])).then(n=>({default:n.ApiPage}))),jE=S.lazy(()=>tt(()=>import("./cliproxy-DjNY9H-U.js"),__vite__mapDeps([25,1,2,5,15,6,4,18,26,24,17,27,28,16,7,8,9])).then(n=>({default:n.CliproxyPage}))),TE=S.lazy(()=>tt(()=>import("./cliproxy-ai-providers-5SHLMHiy.js"),__vite__mapDeps([29,1,2,16,17,5,6,4,24,7,8,9])).then(n=>({default:n.CliproxyAiProvidersPage}))),ME=S.lazy(()=>tt(()=>import("./cliproxy-control-panel-Zax_m1AC.js"),__vite__mapDeps([30,1,2,5,15,4,6,7,8,9])).then(n=>({default:n.CliproxyControlPanelPage}))),EE=S.lazy(()=>tt(()=>import("./copilot-BZrihl_Z.js"),__vite__mapDeps([31,1,2,5,24,17,4,27,28,6,7,8,9])).then(n=>({default:n.CopilotPage}))),OE=S.lazy(()=>tt(()=>import("./cursor-BP4nbEk_.js"),__vite__mapDeps([32,1,2,6,5,15,27,28,4,7,8,9])).then(n=>({default:n.CursorPage}))),PE=S.lazy(()=>tt(()=>import("./claude-extension-BfXlz5gV.js"),__vite__mapDeps([33,1,2,5,6,4,7,8,9])).then(n=>({default:n.ClaudeExtensionPage}))),LE=S.lazy(()=>tt(()=>import("./codex-CRUSpjsu.js"),__vite__mapDeps([34,1,2,6,4,27,5,9,7,35,36,8])).then(n=>({default:n.CodexPage}))),RE=S.lazy(()=>tt(()=>import("./droid-BG92rdM2.js"),__vite__mapDeps([37,1,2,6,5,36,4,27,7,8,9])).then(n=>({default:n.DroidPage}))),_E=S.lazy(()=>tt(()=>import("./accounts-BHEYnq6b.js"),__vite__mapDeps([38,1,2,5,35,17,6,4,26,7,8,9])).then(n=>({default:n.AccountsPage}))),zE=S.lazy(()=>tt(()=>Promise.resolve().then(()=>GT),void 0).then(n=>({default:n.SettingsPage}))),IE=S.lazy(()=>tt(()=>import("./health-BTy1UZs3.js"),__vite__mapDeps([39,1,2,5,6,4,7,8,9])).then(n=>({default:n.HealthPage}))),UE=S.lazy(()=>tt(()=>import("./shared-G0XRyLig.js"),__vite__mapDeps([40,1,2,4,5,6,7,8,9])).then(n=>({default:n.SharedPage}))),HE=S.lazy(()=>tt(()=>import("./updates--A2Sdo7N.js"),__vite__mapDeps([41,1,2,4,5,6,7,8,9])).then(n=>({default:n.UpdatesPage})));function Ht(){return l.jsx("div",{className:"flex h-64 items-center justify-center",children:l.jsx(On,{className:"h-8 w-8 animate-spin text-muted-foreground"})})}function BE(){return l.jsx(pS,{client:Kw,children:l.jsx(_N,{defaultTheme:"system",storageKey:"vite-ui-theme",children:l.jsx(zN,{children:l.jsx(KN,{children:l.jsxs(uS,{children:[l.jsxs(dS,{children:[l.jsx(At,{path:"/login",element:l.jsx(AE,{})}),l.jsx(At,{element:l.jsx(qN,{}),children:l.jsxs(At,{element:l.jsx(G1,{}),children:[l.jsx(At,{path:"/",element:l.jsx(cj,{})}),l.jsx(At,{path:"/analytics",element:l.jsx(S.Suspense,{fallback:l.jsx(Ht,{}),children:l.jsx(kE,{})})}),l.jsx(At,{path:"/updates",element:l.jsx(S.Suspense,{fallback:l.jsx(Ht,{}),children:l.jsx(HE,{})})}),l.jsx(At,{path:"/providers",element:l.jsx(S.Suspense,{fallback:l.jsx(Ht,{}),children:l.jsx(DE,{})})}),l.jsx(At,{path:"/cliproxy",element:l.jsx(S.Suspense,{fallback:l.jsx(Ht,{}),children:l.jsx(jE,{})})}),l.jsx(At,{path:"/cliproxy/ai-providers",element:l.jsx(S.Suspense,{fallback:l.jsx(Ht,{}),children:l.jsx(TE,{})})}),l.jsx(At,{path:"/cliproxy/control-panel",element:l.jsx(S.Suspense,{fallback:l.jsx(Ht,{}),children:l.jsx(ME,{})})}),l.jsx(At,{path:"/copilot",element:l.jsx(S.Suspense,{fallback:l.jsx(Ht,{}),children:l.jsx(EE,{})})}),l.jsx(At,{path:"/cursor",element:l.jsx(S.Suspense,{fallback:l.jsx(Ht,{}),children:l.jsx(OE,{})})}),l.jsx(At,{path:"/claude-extension",element:l.jsx(S.Suspense,{fallback:l.jsx(Ht,{}),children:l.jsx(PE,{})})}),l.jsx(At,{path:"/codex",element:l.jsx(S.Suspense,{fallback:l.jsx(Ht,{}),children:l.jsx(LE,{})})}),l.jsx(At,{path:"/droid",element:l.jsx(S.Suspense,{fallback:l.jsx(Ht,{}),children:l.jsx(RE,{})})}),l.jsx(At,{path:"/accounts",element:l.jsx(S.Suspense,{fallback:l.jsx(Ht,{}),children:l.jsx(_E,{})})}),l.jsx(At,{path:"/settings",element:l.jsx(S.Suspense,{fallback:l.jsx(Ht,{}),children:l.jsx(zE,{})})}),l.jsx(At,{path:"/health",element:l.jsx(S.Suspense,{fallback:l.jsx(Ht,{}),children:l.jsx(IE,{})})}),l.jsx(At,{path:"/shared",element:l.jsx(S.Suspense,{fallback:l.jsx(Ht,{}),children:l.jsx(UE,{})})})]})})]}),l.jsx(mS,{position:"top-right"})]})})})})})}const gv=document.getElementById("root");if(!gv)throw new Error("Root element not found. Failed to mount React application.");Uw.createRoot(gv).render(l.jsx(S.StrictMode,{children:l.jsx(BE,{})}));export{OO as $,pj as A,zt as B,eT as C,vj as D,kO as E,jO as F,dj as G,xj as H,Hn as I,Cj as J,DO as K,un as L,GA as M,VA as N,YA as O,Vx as P,_b as Q,Af as R,Ye as S,Sa as T,Cl as U,zd as V,Be as W,EO as X,Ke as Y,MO as Z,aT as _,Mt as a,vO as a$,PO as a0,LO as a1,RO as a2,_O as a3,zO as a4,IO as a5,Ub as a6,UO as a7,sT as a8,gf as a9,Aj as aA,Fb as aB,Lk as aC,Qk as aD,Di as aE,E1 as aF,O1 as aG,P1 as aH,L1 as aI,bk as aJ,lb as aK,cO as aL,uO as aM,dO as aN,fO as aO,QO as aP,eO as aQ,FA as aR,aO as aS,iO as aT,HA as aU,BA as aV,oO as aW,KA as aX,qA as aY,nO as aZ,hf as a_,XE as aa,UA as ab,tO as ac,rO as ad,sO as ae,of as af,rf as ag,sf as ah,lf as ai,cf as aj,FO as ak,cT as al,GO as am,Fr as an,CO as ao,Pd as ap,SO as aq,lO as ar,wO as as,dy as at,KO as au,qO as av,BO as aw,d1 as ax,zj as ay,HO as az,iT as b,Yb as b0,Df as b1,kr as b2,ZE as b3,JE as b4,wf as b5,Ob as b6,Nf as b7,WO as b8,Cf as b9,bO as bA,xO as bB,ul as bC,Ir as ba,Sf as bb,rj as bc,NO as bd,AO as be,eP as bf,XO as bg,ZO as bh,JO as bi,Qb as bj,HT as bk,KT as bl,gO as bm,hO as bn,Ux as bo,CN as bp,bN as bq,Dd as br,Ai as bs,dN as bt,hN as bu,yN as bv,wN as bw,yO as bx,pO as by,mO as bz,K as c,dt as d,VO as e,YO as f,uT as g,CE as h,WE as i,tT as j,nT as k,Sk as l,wk as m,Ao as n,$O as o,wa as p,Na as q,nb as r,pf as s,ab as t,Qd as u,mf as v,Lr as w,jy as x,Nj as y,TO as z};