@kaitranntt/ccs 7.75.0-dev.9 → 7.76.0-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.
- package/dist/auth/profile-registry.d.ts.map +1 -1
- package/dist/auth/profile-registry.js +9 -0
- package/dist/auth/profile-registry.js.map +1 -1
- package/dist/ccs.js +77 -9
- package/dist/ccs.js.map +1 -1
- package/dist/cliproxy/auth/oauth-handler.d.ts.map +1 -1
- package/dist/cliproxy/auth/oauth-handler.js +20 -0
- package/dist/cliproxy/auth/oauth-handler.js.map +1 -1
- package/dist/cliproxy/binary/platform-detector.d.ts +4 -4
- package/dist/cliproxy/binary/platform-detector.d.ts.map +1 -1
- package/dist/cliproxy/binary/platform-detector.js +2 -2
- package/dist/cliproxy/binary/platform-detector.js.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher.d.ts.map +1 -1
- package/dist/cliproxy/quota/quota-fetcher.js +28 -9
- package/dist/cliproxy/quota/quota-fetcher.js.map +1 -1
- package/dist/commands/command-catalog.d.ts.map +1 -1
- package/dist/commands/command-catalog.js +4 -0
- package/dist/commands/command-catalog.js.map +1 -1
- package/dist/commands/doctor-command.d.ts.map +1 -1
- package/dist/commands/doctor-command.js +9 -0
- package/dist/commands/doctor-command.js.map +1 -1
- package/dist/copilot/copilot-auth.d.ts.map +1 -1
- package/dist/copilot/copilot-auth.js +22 -0
- package/dist/copilot/copilot-auth.js.map +1 -1
- package/dist/copilot/copilot-daemon.d.ts.map +1 -1
- package/dist/copilot/copilot-daemon.js +26 -0
- package/dist/copilot/copilot-daemon.js.map +1 -1
- package/dist/copilot/copilot-executor.d.ts.map +1 -1
- package/dist/copilot/copilot-executor.js +22 -0
- package/dist/copilot/copilot-executor.js.map +1 -1
- package/dist/cursor/cursor-daemon.d.ts.map +1 -1
- package/dist/cursor/cursor-daemon.js +28 -1
- package/dist/cursor/cursor-daemon.js.map +1 -1
- package/dist/cursor/cursor-executor.d.ts.map +1 -1
- package/dist/cursor/cursor-executor.js +17 -1
- package/dist/cursor/cursor-executor.js.map +1 -1
- package/dist/delegation/delegation-handler.d.ts.map +1 -1
- package/dist/delegation/delegation-handler.js +4 -1
- package/dist/delegation/delegation-handler.js.map +1 -1
- package/dist/glmt/glmt-proxy.d.ts.map +1 -1
- package/dist/glmt/glmt-proxy.js +7 -0
- package/dist/glmt/glmt-proxy.js.map +1 -1
- package/dist/glmt/glmt-transformer.d.ts.map +1 -1
- package/dist/glmt/glmt-transformer.js +1 -3
- package/dist/glmt/glmt-transformer.js.map +1 -1
- package/dist/management/instance-manager.d.ts.map +1 -1
- package/dist/management/instance-manager.js +9 -0
- package/dist/management/instance-manager.js.map +1 -1
- package/dist/proxy/server/messages-route.d.ts.map +1 -1
- package/dist/proxy/server/messages-route.js +27 -7
- package/dist/proxy/server/messages-route.js.map +1 -1
- package/dist/proxy/server/proxy-server.d.ts.map +1 -1
- package/dist/proxy/server/proxy-server.js +24 -6
- package/dist/proxy/server/proxy-server.js.map +1 -1
- package/dist/services/logging/index.d.ts +6 -1
- package/dist/services/logging/index.d.ts.map +1 -1
- package/dist/services/logging/index.js +16 -1
- package/dist/services/logging/index.js.map +1 -1
- package/dist/services/logging/log-context.d.ts +41 -0
- package/dist/services/logging/log-context.d.ts.map +1 -0
- package/dist/services/logging/log-context.js +51 -0
- package/dist/services/logging/log-context.js.map +1 -0
- package/dist/services/logging/log-redaction.d.ts +8 -0
- package/dist/services/logging/log-redaction.d.ts.map +1 -1
- package/dist/services/logging/log-redaction.js +40 -3
- package/dist/services/logging/log-redaction.js.map +1 -1
- package/dist/services/logging/log-types.d.ts +30 -0
- package/dist/services/logging/log-types.d.ts.map +1 -1
- package/dist/services/logging/log-types.js +15 -1
- package/dist/services/logging/log-types.js.map +1 -1
- package/dist/services/logging/logger.d.ts +17 -0
- package/dist/services/logging/logger.d.ts.map +1 -1
- package/dist/services/logging/logger.js +23 -4
- package/dist/services/logging/logger.js.map +1 -1
- package/dist/targets/claude-adapter.d.ts.map +1 -1
- package/dist/targets/claude-adapter.js +11 -0
- package/dist/targets/claude-adapter.js.map +1 -1
- package/dist/targets/codex-adapter.d.ts.map +1 -1
- package/dist/targets/codex-adapter.js +11 -0
- package/dist/targets/codex-adapter.js.map +1 -1
- package/dist/targets/droid-adapter.d.ts.map +1 -1
- package/dist/targets/droid-adapter.js +11 -0
- package/dist/targets/droid-adapter.js.map +1 -1
- package/dist/ui/assets/{accounts-C11yNnFn.js → accounts-CybVGDsm.js} +1 -1
- package/dist/ui/assets/{alert-dialog-BDhZ9T12.js → alert-dialog-C6npAhT0.js} +1 -1
- package/dist/ui/assets/{api-DXFMasvG.js → api-DZosWVkR.js} +1 -1
- package/dist/ui/assets/{auth-section-BQpO_21y.js → auth-section-D4MZkgcP.js} +1 -1
- package/dist/ui/assets/{backups-section-BM2lP-ap.js → backups-section-DvMJrmHH.js} +1 -1
- package/dist/ui/assets/{channels-qstH8YTZ.js → channels-BVftYfOn.js} +1 -1
- package/dist/ui/assets/{charts-BBPXh0Ar.js → charts-CeK2xCSo.js} +1 -1
- package/dist/ui/assets/{checkbox-BPx7K8To.js → checkbox-BLRznRTO.js} +1 -1
- package/dist/ui/assets/{claude-extension-BD6uQlc-.js → claude-extension-C6OeBQ73.js} +1 -1
- package/dist/ui/assets/cliproxy-B3Jyu3r9.js +3 -0
- package/dist/ui/assets/{cliproxy-ai-providers-BNffQh5X.js → cliproxy-ai-providers-BAJ78pUc.js} +1 -1
- package/dist/ui/assets/{cliproxy-control-panel-CjExrU2o.js → cliproxy-control-panel-XEvUMVJe.js} +1 -1
- package/dist/ui/assets/{code-highlight-BRUf_pqB.js → code-highlight-D4E79GKQ.js} +1 -1
- package/dist/ui/assets/{codex-Dd2XIT8b.js → codex-CY2vikqX.js} +1 -1
- package/dist/ui/assets/{confirm-dialog-BZP3xwZi.js → confirm-dialog-DjLHh1qX.js} +1 -1
- package/dist/ui/assets/{copilot-gf-rTcY8.js → copilot-afee2lL9.js} +1 -1
- package/dist/ui/assets/{cursor-CJGCGy-H.js → cursor-DuWy60wp.js} +1 -1
- package/dist/ui/assets/{droid-D1Wq6rRO.js → droid-FlceoQ6k.js} +1 -1
- package/dist/ui/assets/{form-utils-Bcoyqxpq.js → form-utils-CuHzLhJZ.js} +1 -1
- package/dist/ui/assets/{globalenv-section-DBqYbsuu.js → globalenv-section-DpJ7unxC.js} +1 -1
- package/dist/ui/assets/{health-DW8M92nq.js → health-BEMgcKD3.js} +1 -1
- package/dist/ui/assets/icons-DQFHtVq5.js +1 -0
- package/dist/ui/assets/{index-JIaHpwil.js → index-0GkznW41.js} +1 -1
- package/dist/ui/assets/{index-B0dun58L.js → index-0n_43sCZ.js} +1 -1
- package/dist/ui/assets/index-6xrth3Oz.css +1 -0
- package/dist/ui/assets/{index-ubH9RpKo.js → index-BRtgic66.js} +3 -3
- package/dist/ui/assets/{index-BczU222d.js → index-Ba4ysocb.js} +1 -1
- package/dist/ui/assets/{index-CoeauyY0.js → index-Cj7EjEq6.js} +1 -1
- package/dist/ui/assets/{index-IiaQMFco.js → index-Cq9VySs6.js} +1 -1
- package/dist/ui/assets/{index-B5cw5Mhf.js → index-DOC7_hun.js} +1 -1
- package/dist/ui/assets/logs-Dth4naJl.js +1 -0
- package/dist/ui/assets/{masked-input-Bmo6mlTB.js → masked-input-DL6pJ8pE.js} +1 -1
- package/dist/ui/assets/{notifications-B2HqRBj7.js → notifications-B4_o8bcr.js} +1 -1
- package/dist/ui/assets/{proxy-g4_N-fbB.js → proxy-C4-M_9kB.js} +1 -1
- package/dist/ui/assets/{proxy-status-widget-EX_Raok7.js → proxy-status-widget-DW4cPFeD.js} +1 -1
- package/dist/ui/assets/{radix-ui-Zb8sVEtn.js → radix-ui-nu4wz29m.js} +1 -1
- package/dist/ui/assets/{raw-json-settings-editor-panel-C4DFuY4g.js → raw-json-settings-editor-panel-Dcumu3Qi.js} +1 -1
- package/dist/ui/assets/{react-vendor-CNOkPC89.js → react-vendor-Bjx91N7w.js} +1 -1
- package/dist/ui/assets/{searchable-select-CLhlrHkQ.js → searchable-select-CWL2D5Ft.js} +1 -1
- package/dist/ui/assets/{separator-BEJQ4e4O.js → separator-Do_vqTQD.js} +1 -1
- package/dist/ui/assets/{shared-4QlIu64T.js → shared-CwWuZx24.js} +1 -1
- package/dist/ui/assets/{table-B6xzmyfm.js → table-BP6nBZzg.js} +1 -1
- package/dist/ui/assets/{tanstack-CrmUhA7Z.js → tanstack-bhJxV1h8.js} +1 -1
- package/dist/ui/assets/{updates-DBkXWRpR.js → updates-BTHJZ7Rk.js} +1 -1
- package/dist/ui/index.html +9 -9
- package/package.json +1 -1
- package/scripts/run-test-bucket.js +2 -0
- package/dist/ui/assets/cliproxy-5-BIu9Wb.js +0 -3
- package/dist/ui/assets/icons-DyorC3Xk.js +0 -1
- package/dist/ui/assets/index-Bbiq6Xkt.css +0 -1
- package/dist/ui/assets/logs-DbWcj2t5.js +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-
|
|
2
|
-
import{j as l,S as jl,R as kb,C as Ab,a as Db,T as Nb,D as Tb,P as Pb,O as Mb,b as s0,c as l0,d as c0,e as u0,f as d0,A as h0,g as f0,h as p0,i as g0,k as m0,l as y0,m as b0,n as v0,I as x0,o as Lb,p as C0,q as Eb,r as jb,s as S0,t as Rb,V as w0,L as Ob,u as Ib,v as k0,w as A0,x as _b,y as D0,z as N0,B as Ub,E as T0,F as P0,G as Hb,H as M0,J as zb,K as Bb,M as Fb,N as L0,Q as E0,U as j0,W as R0,X as O0,Y as qb,Z as I0,_ as _0,$ as U0}from"./radix-ui-Zb8sVEtn.js";import{e as nh,f as H0,r as C,u as Rl,O as _d,N as Kb,h as ah,L as kl,R as z0,g as Gb,d as zm,i as Vb,c as ue,B as B0,j as F0,k as Ct}from"./react-vendor-CNOkPC89.js";import{Q as q0,u as St,a as lt,b as ot,c as K0,d as G0}from"./tanstack-CrmUhA7Z.js";import{t as ce,T as V0}from"./notifications-B2HqRBj7.js";import{L as An,X as Mo,P as Y0,C as Ol,H as W0,a as Q0,K as Ud,G as $0,Z as Yb,b as Wb,F as Qb,U as $b,c as X0,S as J0,A as Fr,d as Xb,e as Z0,f as Jb,M as Zb,E as Qr,g as $r,B as ew,R as qr,W as tw,h as nw,i as aw,j as iw,k as Bm,l as Fm,m as No,n as ih,o as Al,p as ev,q as tv,r as ow,s as Il,t as oh,u as nv,v as To,T as Vn,w as Kr,x as Xr,y as qm,z as rw,D as av,I as rh,J as sw,N as _l,O as lw,Q as cw,V as uw,Y as dw,_ as Ul,$ as hw,a0 as fw,a1 as iv,a2 as pw,a3 as gw,a4 as mw,a5 as yw,a6 as bw,a7 as sh,a8 as ov,a9 as Km,aa as vw,ab as xw,ac as Cw,ad as Sw,ae as ww,af as kw,ag as Gm,ah as Aw,ai as pl,aj as Vm,ak as Ym,al as Dw}from"./icons-DyorC3Xk.js";import{t as Nw,c as Tw,a as Hl,e as Nr,f as Lr,b as Pw,d as Mw,g as Lw,h as Ew,i as jw,j as Rw,k as Ow,l as Iw,m as _w,n as Uw,o as Hw,p as zw,q as Bw,r as Fw,s as qw,u as Kw,v as Gw,w as Vw,x as Yw,y as Ww,z as Qw,A as $w,B as Xw,C as Jw,D as Zw,E as ek,F as tk,G as nk,H as ak,I as ik,J as ok}from"./utils-CzKF5WmX.js";import{o as Wm,s as Qm,p as rk,a as sk,$ as lk,b as rv,c as Za,d as ck,_ as uk,u as dk,e as $m}from"./form-utils-Bcoyqxpq.js";import{H as hk,t as Xm}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"]'))r(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&r(h)}).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 r(c){if(c.ep)return;c.ep=!0;const d=o(c);fetch(c.href,d)}})();var dd={exports:{}},Tr={},hd={exports:{}},fd={};var Jm;function fk(){return Jm||(Jm=1,(function(t){function a(H,Z){var ne=H.length;H.push(Z);e:for(;0<ne;){var Q=ne-1>>>1,se=H[Q];if(0<c(se,Z))H[Q]=Z,H[ne]=se,ne=Q;else break e}}function o(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var Z=H[0],ne=H.pop();if(ne!==Z){H[0]=ne;e:for(var Q=0,se=H.length,de=se>>>1;Q<de;){var ge=2*(Q+1)-1,J=H[ge],ae=ge+1,he=H[ae];if(0>c(J,ne))ae<se&&0>c(he,J)?(H[Q]=he,H[ae]=ne,Q=ae):(H[Q]=J,H[ge]=ne,Q=ge);else if(ae<se&&0>c(he,ne))H[Q]=he,H[ae]=ne,Q=ae;else break e}}return Z}function c(H,Z){var ne=H.sortIndex-Z.sortIndex;return ne!==0?ne:H.id-Z.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;t.unstable_now=function(){return d.now()}}else{var h=Date,p=h.now();t.unstable_now=function(){return h.now()-p}}var g=[],m=[],S=1,b=null,x=3,T=!1,w=!1,M=!1,j=!1,E=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function A(H){for(var Z=o(m);Z!==null;){if(Z.callback===null)r(m);else if(Z.startTime<=H)r(m),Z.sortIndex=Z.expirationTime,a(g,Z);else break;Z=o(m)}}function P(H){if(M=!1,A(H),!w)if(o(g)!==null)w=!0,k||(k=!0,Y());else{var Z=o(m);Z!==null&&pe(P,Z.startTime-H)}}var k=!1,O=-1,U=5,_=-1;function K(){return j?!0:!(t.unstable_now()-_<U)}function ee(){if(j=!1,k){var H=t.unstable_now();_=H;var Z=!0;try{e:{w=!1,M&&(M=!1,D(O),O=-1),T=!0;var ne=x;try{t:{for(A(H),b=o(g);b!==null&&!(b.expirationTime>H&&K());){var Q=b.callback;if(typeof Q=="function"){b.callback=null,x=b.priorityLevel;var se=Q(b.expirationTime<=H);if(H=t.unstable_now(),typeof se=="function"){b.callback=se,A(H),Z=!0;break t}b===o(g)&&r(g),A(H)}else r(g);b=o(g)}if(b!==null)Z=!0;else{var de=o(m);de!==null&&pe(P,de.startTime-H),Z=!1}}break e}finally{b=null,x=ne,T=!1}Z=void 0}}finally{Z?Y():k=!1}}}var Y;if(typeof N=="function")Y=function(){N(ee)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,fe=$.port2;$.port1.onmessage=ee,Y=function(){fe.postMessage(null)}}else Y=function(){E(ee,0)};function pe(H,Z){O=E(function(){H(t.unstable_now())},Z)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(H){H.callback=null},t.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<H?Math.floor(1e3/H):5},t.unstable_getCurrentPriorityLevel=function(){return x},t.unstable_next=function(H){switch(x){case 1:case 2:case 3:var Z=3;break;default:Z=x}var ne=x;x=Z;try{return H()}finally{x=ne}},t.unstable_requestPaint=function(){j=!0},t.unstable_runWithPriority=function(H,Z){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var ne=x;x=H;try{return Z()}finally{x=ne}},t.unstable_scheduleCallback=function(H,Z,ne){var Q=t.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?Q+ne:Q):ne=Q,H){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=ne+se,H={id:S++,callback:Z,priorityLevel:H,startTime:ne,expirationTime:se,sortIndex:-1},ne>Q?(H.sortIndex=ne,a(m,H),o(g)===null&&H===o(m)&&(M?(D(O),O=-1):M=!0,pe(P,ne-Q))):(H.sortIndex=se,a(g,H),w||T||(w=!0,k||(k=!0,Y()))),H},t.unstable_shouldYield=K,t.unstable_wrapCallback=function(H){var Z=x;return function(){var ne=x;x=Z;try{return H.apply(this,arguments)}finally{x=ne}}}})(fd)),fd}var Zm;function pk(){return Zm||(Zm=1,hd.exports=fk()),hd.exports}var ey;function gk(){if(ey)return Tr;ey=1;var t=pk(),a=nh(),o=H0();function r(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)n+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+n+" 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 n=e,i=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(i=n.return),e=n.return;while(e)}return n.tag===3?i:null}function h(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function p(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function g(e){if(d(e)!==e)throw Error(r(188))}function m(e){var n=e.alternate;if(!n){if(n=d(e),n===null)throw Error(r(188));return n!==e?null:e}for(var i=e,s=n;;){var u=i.return;if(u===null)break;var f=u.alternate;if(f===null){if(s=u.return,s!==null){i=s;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===i)return g(u),e;if(f===s)return g(u),n;f=f.sibling}throw Error(r(188))}if(i.return!==s.return)i=u,s=f;else{for(var y=!1,v=u.child;v;){if(v===i){y=!0,i=u,s=f;break}if(v===s){y=!0,s=u,i=f;break}v=v.sibling}if(!y){for(v=f.child;v;){if(v===i){y=!0,i=f,s=u;break}if(v===s){y=!0,s=f,i=u;break}v=v.sibling}if(!y)throw Error(r(189))}}if(i.alternate!==s)throw Error(r(190))}if(i.tag!==3)throw Error(r(188));return i.stateNode.current===i?e:n}function S(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=S(e),n!==null)return n;e=e.sibling}return null}var b=Object.assign,x=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),N=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),ee=Symbol.iterator;function Y(e){return e===null||typeof e!="object"?null:(e=ee&&e[ee]||e["@@iterator"],typeof e=="function"?e:null)}var $=Symbol.for("react.client.reference");function fe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===$?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case M:return"Fragment";case E:return"Profiler";case j:return"StrictMode";case P:return"Suspense";case k:return"SuspenseList";case _:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case N:return e.displayName||"Context";case D:return(e._context.displayName||"Context")+".Consumer";case A:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case O:return n=e.displayName||null,n!==null?n:fe(e.type)||"Memo";case U:n=e._payload,e=e._init;try{return fe(e(n))}catch{}}return null}var pe=Array.isArray,H=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},Q=[],se=-1;function de(e){return{current:e}}function ge(e){0>se||(e.current=Q[se],Q[se]=null,se--)}function J(e,n){se++,Q[se]=e.current,e.current=n}var ae=de(null),he=de(null),re=de(null),le=de(null);function xe(e,n){switch(J(re,n),J(he,e),J(ae,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?cm(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=cm(n),e=um(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ge(ae),J(ae,e)}function Pe(){ge(ae),ge(he),ge(re)}function ze(e){e.memoizedState!==null&&J(le,e);var n=ae.current,i=um(n,e.type);n!==i&&(J(he,e),J(ae,i))}function Je(e){he.current===e&&(ge(ae),ge(he)),le.current===e&&(ge(le),wr._currentValue=ne)}var we,Re;function Ve(e){if(we===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);we=n&&n[1]||"",Re=-1<i.stack.indexOf(`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-0n_43sCZ.js","assets/radix-ui-nu4wz29m.js","assets/react-vendor-Bjx91N7w.js","assets/masked-input-DL6pJ8pE.js","assets/icons-DQFHtVq5.js","assets/tanstack-bhJxV1h8.js","assets/notifications-B4_o8bcr.js","assets/utils-CzKF5WmX.js","assets/form-utils-CuHzLhJZ.js","assets/code-highlight-D4E79GKQ.js","assets/index-Cj7EjEq6.js","assets/proxy-C4-M_9kB.js","assets/index-Ba4ysocb.js","assets/channels-BVftYfOn.js","assets/globalenv-section-DpJ7unxC.js","assets/index-DOC7_hun.js","assets/index-0GkznW41.js","assets/default-ports-1QQSffYX.js","assets/proxy-status-widget-DW4cPFeD.js","assets/alert-dialog-C6npAhT0.js","assets/antigravity-responsibility-constants-Bvh4Ybz0.js","assets/auth-section-D4MZkgcP.js","assets/backups-section-DvMJrmHH.js","assets/index-Cq9VySs6.js","assets/charts-CeK2xCSo.js","assets/api-DZosWVkR.js","assets/confirm-dialog-DjLHh1qX.js","assets/cliproxy-B3Jyu3r9.js","assets/checkbox-BLRznRTO.js","assets/separator-Do_vqTQD.js","assets/searchable-select-CWL2D5Ft.js","assets/cliproxy-ai-providers-BAJ78pUc.js","assets/cliproxy-control-panel-XEvUMVJe.js","assets/copilot-afee2lL9.js","assets/cursor-DuWy60wp.js","assets/claude-extension-C6OeBQ73.js","assets/codex-CY2vikqX.js","assets/table-BP6nBZzg.js","assets/raw-json-settings-editor-panel-Dcumu3Qi.js","assets/droid-FlceoQ6k.js","assets/logs-Dth4naJl.js","assets/accounts-CybVGDsm.js","assets/health-BEMgcKD3.js","assets/shared-CwWuZx24.js","assets/updates-BTHJZ7Rk.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{j as l,S as jl,R as kb,C as Ab,a as Db,T as Nb,D as Tb,P as Pb,O as Mb,b as s0,c as l0,d as c0,e as u0,f as d0,A as h0,g as f0,h as p0,i as g0,k as m0,l as y0,m as b0,n as v0,I as x0,o as Lb,p as C0,q as Eb,r as jb,s as S0,t as Rb,V as w0,L as Ob,u as Ib,v as k0,w as A0,x as _b,y as D0,z as N0,B as Ub,E as T0,F as P0,G as Hb,H as M0,J as zb,K as Bb,M as Fb,N as L0,Q as E0,U as j0,W as R0,X as O0,Y as qb,Z as I0,_ as _0,$ as U0}from"./radix-ui-nu4wz29m.js";import{b as nh,d as H0,r as C,u as Rl,O as _d,N as Kb,e as ah,L as kl,R as z0,g as Gb,c as zm,h as Vb,E as ue,B as B0,i as F0,j as Ct}from"./react-vendor-Bjx91N7w.js";import{Q as q0,u as St,a as lt,b as ot,c as K0,d as G0}from"./tanstack-bhJxV1h8.js";import{t as ce,T as V0}from"./notifications-B4_o8bcr.js";import{L as An,X as Mo,P as Y0,C as Ol,H as W0,a as Q0,K as Ud,G as $0,Z as Yb,b as Wb,F as Qb,U as $b,c as X0,S as J0,A as Fr,d as Xb,e as Z0,f as Jb,M as Zb,E as Qr,g as $r,B as ew,R as qr,W as tw,h as nw,i as aw,j as iw,k as Bm,l as Fm,m as No,n as ih,o as Al,p as ev,q as tv,r as ow,s as Il,t as oh,u as nv,v as To,T as Vn,w as Kr,x as Xr,y as qm,z as rw,D as av,I as rh,J as sw,N as _l,O as lw,Q as cw,V as uw,Y as dw,_ as Ul,$ as hw,a0 as fw,a1 as iv,a2 as pw,a3 as gw,a4 as mw,a5 as yw,a6 as bw,a7 as sh,a8 as ov,a9 as Km,aa as vw,ab as xw,ac as Cw,ad as Sw,ae as ww,af as kw,ag as Gm,ah as Aw,ai as pl,aj as Vm,ak as Ym,al as Dw}from"./icons-DQFHtVq5.js";import{t as Nw,c as Tw,a as Hl,e as Nr,f as Lr,b as Pw,d as Mw,g as Lw,h as Ew,i as jw,j as Rw,k as Ow,l as Iw,m as _w,n as Uw,o as Hw,p as zw,q as Bw,r as Fw,s as qw,u as Kw,v as Gw,w as Vw,x as Yw,y as Ww,z as Qw,A as $w,B as Xw,C as Jw,D as Zw,E as ek,F as tk,G as nk,H as ak,I as ik,J as ok}from"./utils-CzKF5WmX.js";import{o as Wm,s as Qm,p as rk,a as sk,$ as lk,b as rv,c as Za,d as ck,_ as uk,u as dk,e as $m}from"./form-utils-CuHzLhJZ.js";import{H as hk,t as Xm}from"./code-highlight-D4E79GKQ.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"]'))r(c);new MutationObserver(c=>{for(const d of c)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&r(h)}).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 r(c){if(c.ep)return;c.ep=!0;const d=o(c);fetch(c.href,d)}})();var dd={exports:{}},Tr={},hd={exports:{}},fd={};var Jm;function fk(){return Jm||(Jm=1,(function(t){function a(H,Z){var ne=H.length;H.push(Z);e:for(;0<ne;){var Q=ne-1>>>1,se=H[Q];if(0<c(se,Z))H[Q]=Z,H[ne]=se,ne=Q;else break e}}function o(H){return H.length===0?null:H[0]}function r(H){if(H.length===0)return null;var Z=H[0],ne=H.pop();if(ne!==Z){H[0]=ne;e:for(var Q=0,se=H.length,de=se>>>1;Q<de;){var ge=2*(Q+1)-1,J=H[ge],ae=ge+1,he=H[ae];if(0>c(J,ne))ae<se&&0>c(he,J)?(H[Q]=he,H[ae]=ne,Q=ae):(H[Q]=J,H[ge]=ne,Q=ge);else if(ae<se&&0>c(he,ne))H[Q]=he,H[ae]=ne,Q=ae;else break e}}return Z}function c(H,Z){var ne=H.sortIndex-Z.sortIndex;return ne!==0?ne:H.id-Z.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;t.unstable_now=function(){return d.now()}}else{var h=Date,p=h.now();t.unstable_now=function(){return h.now()-p}}var g=[],m=[],S=1,b=null,x=3,T=!1,w=!1,M=!1,j=!1,E=typeof setTimeout=="function"?setTimeout:null,D=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function A(H){for(var Z=o(m);Z!==null;){if(Z.callback===null)r(m);else if(Z.startTime<=H)r(m),Z.sortIndex=Z.expirationTime,a(g,Z);else break;Z=o(m)}}function P(H){if(M=!1,A(H),!w)if(o(g)!==null)w=!0,k||(k=!0,Y());else{var Z=o(m);Z!==null&&pe(P,Z.startTime-H)}}var k=!1,O=-1,U=5,_=-1;function K(){return j?!0:!(t.unstable_now()-_<U)}function ee(){if(j=!1,k){var H=t.unstable_now();_=H;var Z=!0;try{e:{w=!1,M&&(M=!1,D(O),O=-1),T=!0;var ne=x;try{t:{for(A(H),b=o(g);b!==null&&!(b.expirationTime>H&&K());){var Q=b.callback;if(typeof Q=="function"){b.callback=null,x=b.priorityLevel;var se=Q(b.expirationTime<=H);if(H=t.unstable_now(),typeof se=="function"){b.callback=se,A(H),Z=!0;break t}b===o(g)&&r(g),A(H)}else r(g);b=o(g)}if(b!==null)Z=!0;else{var de=o(m);de!==null&&pe(P,de.startTime-H),Z=!1}}break e}finally{b=null,x=ne,T=!1}Z=void 0}}finally{Z?Y():k=!1}}}var Y;if(typeof N=="function")Y=function(){N(ee)};else if(typeof MessageChannel<"u"){var $=new MessageChannel,fe=$.port2;$.port1.onmessage=ee,Y=function(){fe.postMessage(null)}}else Y=function(){E(ee,0)};function pe(H,Z){O=E(function(){H(t.unstable_now())},Z)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(H){H.callback=null},t.unstable_forceFrameRate=function(H){0>H||125<H?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<H?Math.floor(1e3/H):5},t.unstable_getCurrentPriorityLevel=function(){return x},t.unstable_next=function(H){switch(x){case 1:case 2:case 3:var Z=3;break;default:Z=x}var ne=x;x=Z;try{return H()}finally{x=ne}},t.unstable_requestPaint=function(){j=!0},t.unstable_runWithPriority=function(H,Z){switch(H){case 1:case 2:case 3:case 4:case 5:break;default:H=3}var ne=x;x=H;try{return Z()}finally{x=ne}},t.unstable_scheduleCallback=function(H,Z,ne){var Q=t.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?Q+ne:Q):ne=Q,H){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=ne+se,H={id:S++,callback:Z,priorityLevel:H,startTime:ne,expirationTime:se,sortIndex:-1},ne>Q?(H.sortIndex=ne,a(m,H),o(g)===null&&H===o(m)&&(M?(D(O),O=-1):M=!0,pe(P,ne-Q))):(H.sortIndex=se,a(g,H),w||T||(w=!0,k||(k=!0,Y()))),H},t.unstable_shouldYield=K,t.unstable_wrapCallback=function(H){var Z=x;return function(){var ne=x;x=Z;try{return H.apply(this,arguments)}finally{x=ne}}}})(fd)),fd}var Zm;function pk(){return Zm||(Zm=1,hd.exports=fk()),hd.exports}var ey;function gk(){if(ey)return Tr;ey=1;var t=pk(),a=nh(),o=H0();function r(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var i=2;i<arguments.length;i++)n+="&args[]="+encodeURIComponent(arguments[i])}return"Minified React error #"+e+"; visit "+n+" 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 n=e,i=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(i=n.return),e=n.return;while(e)}return n.tag===3?i:null}function h(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function p(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function g(e){if(d(e)!==e)throw Error(r(188))}function m(e){var n=e.alternate;if(!n){if(n=d(e),n===null)throw Error(r(188));return n!==e?null:e}for(var i=e,s=n;;){var u=i.return;if(u===null)break;var f=u.alternate;if(f===null){if(s=u.return,s!==null){i=s;continue}break}if(u.child===f.child){for(f=u.child;f;){if(f===i)return g(u),e;if(f===s)return g(u),n;f=f.sibling}throw Error(r(188))}if(i.return!==s.return)i=u,s=f;else{for(var y=!1,v=u.child;v;){if(v===i){y=!0,i=u,s=f;break}if(v===s){y=!0,s=u,i=f;break}v=v.sibling}if(!y){for(v=f.child;v;){if(v===i){y=!0,i=f,s=u;break}if(v===s){y=!0,s=f,i=u;break}v=v.sibling}if(!y)throw Error(r(189))}}if(i.alternate!==s)throw Error(r(190))}if(i.tag!==3)throw Error(r(188));return i.stateNode.current===i?e:n}function S(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=S(e),n!==null)return n;e=e.sibling}return null}var b=Object.assign,x=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),D=Symbol.for("react.consumer"),N=Symbol.for("react.context"),A=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),k=Symbol.for("react.suspense_list"),O=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),_=Symbol.for("react.activity"),K=Symbol.for("react.memo_cache_sentinel"),ee=Symbol.iterator;function Y(e){return e===null||typeof e!="object"?null:(e=ee&&e[ee]||e["@@iterator"],typeof e=="function"?e:null)}var $=Symbol.for("react.client.reference");function fe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===$?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case M:return"Fragment";case E:return"Profiler";case j:return"StrictMode";case P:return"Suspense";case k:return"SuspenseList";case _:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case w:return"Portal";case N:return e.displayName||"Context";case D:return(e._context.displayName||"Context")+".Consumer";case A:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case O:return n=e.displayName||null,n!==null?n:fe(e.type)||"Memo";case U:n=e._payload,e=e._init;try{return fe(e(n))}catch{}}return null}var pe=Array.isArray,H=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},Q=[],se=-1;function de(e){return{current:e}}function ge(e){0>se||(e.current=Q[se],Q[se]=null,se--)}function J(e,n){se++,Q[se]=e.current,e.current=n}var ae=de(null),he=de(null),re=de(null),le=de(null);function xe(e,n){switch(J(re,n),J(he,e),J(ae,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?cm(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=cm(n),e=um(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ge(ae),J(ae,e)}function Pe(){ge(ae),ge(he),ge(re)}function ze(e){e.memoizedState!==null&&J(le,e);var n=ae.current,i=um(n,e.type);n!==i&&(J(he,e),J(ae,i))}function Je(e){he.current===e&&(ge(ae),ge(he)),le.current===e&&(ge(le),wr._currentValue=ne)}var we,Re;function Ve(e){if(we===void 0)try{throw Error()}catch(i){var n=i.stack.trim().match(/\n( *(at )?)/);we=n&&n[1]||"",Re=-1<i.stack.indexOf(`
|
|
3
3
|
at`)?" (<anonymous>)":-1<i.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
4
|
`+we+e+Re}var Tt=!1;function jt(e,n){if(!e||Tt)return"";Tt=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var X=function(){throw Error()};if(Object.defineProperty(X.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(X,[])}catch(G){var q=G}Reflect.construct(e,[],X)}else{try{X.call()}catch(G){q=G}e.call(X.prototype)}}else{try{throw Error()}catch(G){q=G}(X=e())&&typeof X.catch=="function"&&X.catch(function(){})}}catch(G){if(G&&q&&typeof G.stack=="string")return[G.stack,q.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var u=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");u&&u.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var f=s.DetermineComponentFrameRoot(),y=f[0],v=f[1];if(y&&v){var L=y.split(`
|
|
5
5
|
`),F=v.split(`
|
|
@@ -69,4 +69,4 @@ ${d}`,o),this.line=r,this.column=c,this.codeblock=d}}function gL(t,a){let o=0;fo
|
|
|
69
69
|
`&&h!=="\r"){let p,g=c,m=!1,[S,b]=eh(t,a-1);for(let w=0;w<S.length;w++){if(w&&(g=m?g[p]:g[p]={}),p=S[w],(m=Object.hasOwn(g,p))&&(typeof g[p]!="object"||d.has(g[p])))throw new Ye("trying to redefine an already defined value",{toml:t,ptr:a});!m&&p==="__proto__"&&Object.defineProperty(g,p,{enumerable:!0,configurable:!0,writable:!0})}if(m)throw new Ye("trying to redefine an already defined value",{toml:t,ptr:a});let[x,T]=qh(t,b,"}",o-1,r);d.add(x),g[p]=x,a=T}}if(!h)throw new Ye("unfinished table encountered",{toml:t,ptr:a});return[c,a]}function DL(t,a,o,r){let c=[],d;for(a++;(d=t[a++])!=="]"&&d;){if(d===",")throw new Ye("expected value, found comma",{toml:t,ptr:a-1});if(d==="#")a=Jl(t,a);else if(d!==" "&&d!==" "&&d!==`
|
|
70
70
|
`&&d!=="\r"){let h=qh(t,a-1,"]",o-1,r);c.push(h[0]),a=h[1]}}if(!d)throw new Ye("unfinished array encountered",{toml:t,ptr:a});return[c,a]}function ib(t,a,o,r){let c=a,d=o,h,p=!1,g;for(let m=0;m<t.length;m++){if(m){if(c=p?c[h]:c[h]={},d=(g=d[h]).c,r===0&&(g.t===1||g.t===2))return null;if(g.t===2){let S=c.length-1;c=c[S],d=d[S].c}}if(h=t[m],(p=Object.hasOwn(c,h))&&d[h]?.t===0&&d[h]?.d)return null;p||(h==="__proto__"&&(Object.defineProperty(c,h,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(d,h,{enumerable:!0,configurable:!0,writable:!0})),d[h]={t:m<t.length-1&&r===2?3:r,d:!1,i:0,c:{}})}if(g=d[h],g.t!==r&&!(r===1&&g.t===3)||(r===2&&(g.d||(g.d=!0,c[h]=[]),c[h].push(c={}),g.c[g.i++]=g={t:1,d:!1,i:0,c:{}}),g.d))return null;if(g.d=!0,r===1)c=p?c[h]:c[h]={};else if(r===0&&p)return null;return[h,c,g.c]}function NL(t,{maxDepth:a=1e3,integersAsBigInt:o}={}){let r={},c={},d=r,h=c;for(let p=Sa(t,0);p<t.length;){if(t[p]==="["){let g=t[++p]==="[",m=eh(t,p+=+g,"]");if(g){if(t[m[1]-1]!=="]")throw new Ye("expected end of table declaration",{toml:t,ptr:m[1]-1});m[1]++}let S=ib(m[0],r,c,g?2:1);if(!S)throw new Ye("trying to redefine an already defined table or value",{toml:t,ptr:p});h=S[2],d=S[1],p=m[1]}else{let g=eh(t,p),m=ib(g[0],d,h,0);if(!m)throw new Ye("trying to redefine an already defined table or value",{toml:t,ptr:p});let S=qh(t,g[1],void 0,a,o);m[1][m[0]]=S[0],p=S[1]}if(p=Sa(t,p,!0),t[p]&&t[p]!==`
|
|
71
71
|
`&&t[p]!=="\r")throw new Ye("each key-value declaration must be followed by an end-of-line",{toml:t,ptr:p});p=Sa(t,p)}return r}const TL=[/^ANTHROPIC_AUTH_TOKEN$/,/_API_KEY$/,/_AUTH_TOKEN$/,/_SECRET$/,/_SECRET_KEY$/,/^API_KEY$/,/^AUTH_TOKEN$/,/^SECRET$/,/_PASSWORD$/,/^PASSWORD$/,/_CREDENTIAL$/,/_PRIVATE_KEY$/];function PL(t){return TL.some(a=>a.test(t))}function ML(t){if(!t.trim())return{valid:!0};try{return JSON.parse(t),{valid:!0}}catch(a){const r=a.message,c=r.match(/position (\d+)/);if(c){const d=parseInt(c[1],10),h=t.substring(0,d).split(`
|
|
72
|
-
`);return{valid:!1,error:r,line:h.length}}return{valid:!1,error:r}}}function LL(t){if(!t.trim())return{valid:!0};try{return NL(t),{valid:!0}}catch(a){const o=a.message,r=o.match(/line\s+(\d+)/i);return{valid:!1,error:o,line:r?Number.parseInt(r[1],10):void 0}}}function Dx({value:t,onChange:a,language:o="json",readonly:r=!1,className:c,minHeight:d="300px",heightMode:h="content"}){const{isDark:p}=mh(),{t:g}=ye(),[m,S]=C.useState(!1),[b,x]=C.useState(!0),T=h==="fill-parent",w=C.useMemo(()=>o==="json"?ML(t):o==="toml"?LL(t):{valid:!0},[t,o]),M=C.useCallback(j=>l.jsx(hk,{prism:hL,theme:p?Xm.nightOwl:Xm.github,code:j,language:o,children:({tokens:E,getLineProps:D,getTokenProps:N})=>{let A=!1;return l.jsx(l.Fragment,{children:E.map((P,k)=>l.jsx("div",{...D({line:P}),className:z(w.line===k+1&&"bg-destructive/20"),children:P.map((O,U)=>{let _=!1;if(O.types.includes("property")){const ee=O.content.replace(/['"]/g,"");PL(ee)?A=!0:A=!1}else(O.types.includes("string")||O.types.includes("number")||O.types.includes("boolean"))&&A?(_=!0,A=!1):O.types.includes("punctuation")&&O.content!==":"&&O.content!=="["&&O.content!=="{"&&(A=!1);const K=N({token:O});return _&&b&&(K.className=z(K.className,"blur-[3px] select-none opacity-70 transition-all duration-200")),l.jsx("span",{...K},U)})},k))})}}),[p,o,w.line,b]);return l.jsxs("div",{className:z("flex min-h-0 flex-col",T&&"h-full",c),style:T?{height:d==="auto"?void 0:d}:void 0,children:[l.jsxs("div",{className:z("relative rounded-md border overflow-hidden","bg-muted/30",T&&"flex min-h-0 flex-1 flex-col",m&&"ring-2 ring-ring ring-offset-2 ring-offset-background",r&&"opacity-70 cursor-not-allowed",!w.valid&&"border-destructive"),"data-slot":"code-editor-surface",children:[l.jsx("div",{className:z(T&&"scrollbar-editor min-h-0 flex-1 overflow-auto"),"data-slot":T?"code-editor-viewport":void 0,children:l.jsx(cL,{value:t,onValueChange:r?()=>{}:a,highlight:M,padding:12,disabled:r,onFocus:()=>S(!0),onBlur:()=>S(!1),textareaClassName:z("focus:outline-none font-mono text-sm",r&&"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(st,{variant:"ghost",size:"icon",className:"h-6 w-6 bg-background/50 hover:bg-background border shadow-sm rounded-full",onClick:()=>x(!b),title:g(b?"codeEditor.revealSensitive":"codeEditor.maskSensitive"),children:b?l.jsx($r,{className:"h-3 w-3"}):l.jsx(Qr,{className:"h-3 w-3"})})})]}),l.jsxs("div",{className:"flex items-center gap-2 mt-2 text-xs",children:[w.valid?l.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",children:[l.jsx(Xr,{className:"w-3 h-3 text-green-500"}),g("codeEditor.valid",{language:o.toUpperCase()})]}):l.jsxs("span",{className:"flex items-center gap-1 text-destructive",children:[l.jsx(Kr,{className:"w-3 h-3"}),w.error,w.line&&` (line ${w.line})`]}),r&&l.jsx("span",{className:"ml-auto text-muted-foreground",children:g("codeEditor.readOnly")})]})]})}const Zl=Object.freeze(Object.defineProperty({__proto__:null,CodeEditor:Dx},Symbol.toStringTag,{value:"Module"})),EL={browserConfig:null,browserStatus:null,browserLoading:!0,browserStatusLoading:!0,browserSaving:!1,browserError:null,browserSuccess:!1,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 jL(t,a){switch(a.type){case"SET_BROWSER_CONFIG":return{...t,browserConfig:a.payload};case"SET_BROWSER_STATUS":return{...t,browserStatus:a.payload};case"SET_BROWSER_LOADING":return{...t,browserLoading:a.payload};case"SET_BROWSER_STATUS_LOADING":return{...t,browserStatusLoading:a.payload};case"SET_BROWSER_SAVING":return{...t,browserSaving:a.payload};case"SET_BROWSER_ERROR":return{...t,browserError:a.payload};case"SET_BROWSER_SUCCESS":return{...t,browserSuccess:a.payload};case"SET_WEBSEARCH_CONFIG":return{...t,webSearchConfig:a.payload};case"SET_WEBSEARCH_STATUS":return{...t,webSearchStatus:a.payload};case"SET_WEBSEARCH_LOADING":return{...t,webSearchLoading:a.payload};case"SET_WEBSEARCH_STATUS_LOADING":return{...t,webSearchStatusLoading:a.payload};case"SET_WEBSEARCH_SAVING":return{...t,webSearchSaving:a.payload};case"SET_WEBSEARCH_ERROR":return{...t,webSearchError:a.payload};case"SET_WEBSEARCH_SUCCESS":return{...t,webSearchSuccess:a.payload};case"SET_GLOBALENV_CONFIG":return{...t,globalEnvConfig:a.payload};case"SET_GLOBALENV_LOADING":return{...t,globalEnvLoading:a.payload};case"SET_GLOBALENV_SAVING":return{...t,globalEnvSaving:a.payload};case"SET_GLOBALENV_ERROR":return{...t,globalEnvError:a.payload};case"SET_GLOBALENV_SUCCESS":return{...t,globalEnvSuccess:a.payload};case"SET_PROXY_CONFIG":return{...t,proxyConfig:a.payload};case"SET_PROXY_LOADING":return{...t,proxyLoading:a.payload};case"SET_PROXY_SAVING":return{...t,proxySaving:a.payload};case"SET_PROXY_ERROR":return{...t,proxyError:a.payload};case"SET_PROXY_SUCCESS":return{...t,proxySuccess:a.payload};case"SET_PROXY_TEST_RESULT":return{...t,proxyTestResult:a.payload};case"SET_PROXY_TESTING":return{...t,proxyTesting:a.payload};case"SET_RAW_CONFIG":return{...t,rawConfig:a.payload};case"SET_RAW_CONFIG_LOADING":return{...t,rawConfigLoading:a.payload};default:return t}}const Nx=C.createContext(null);function RL({children:t}){const[a,o]=C.useReducer(jL,EL);return l.jsx(Nx.Provider,{value:{state:a,dispatch:o},children:t})}function Tx(){const t=C.useContext(Nx);if(!t)throw new Error("useSettingsContext must be used within a SettingsProvider");return t}function OL(){const{dispatch:t}=Tx(),a=C.useCallback($=>t({type:"SET_BROWSER_CONFIG",payload:$}),[t]),o=C.useCallback($=>t({type:"SET_BROWSER_STATUS",payload:$}),[t]),r=C.useCallback($=>t({type:"SET_BROWSER_LOADING",payload:$}),[t]),c=C.useCallback($=>t({type:"SET_BROWSER_STATUS_LOADING",payload:$}),[t]),d=C.useCallback($=>t({type:"SET_BROWSER_SAVING",payload:$}),[t]),h=C.useCallback($=>t({type:"SET_BROWSER_ERROR",payload:$}),[t]),p=C.useCallback($=>t({type:"SET_BROWSER_SUCCESS",payload:$}),[t]),g=C.useCallback($=>t({type:"SET_WEBSEARCH_CONFIG",payload:$}),[t]),m=C.useCallback($=>t({type:"SET_WEBSEARCH_STATUS",payload:$}),[t]),S=C.useCallback($=>t({type:"SET_WEBSEARCH_LOADING",payload:$}),[t]),b=C.useCallback($=>t({type:"SET_WEBSEARCH_STATUS_LOADING",payload:$}),[t]),x=C.useCallback($=>t({type:"SET_WEBSEARCH_SAVING",payload:$}),[t]),T=C.useCallback($=>t({type:"SET_WEBSEARCH_ERROR",payload:$}),[t]),w=C.useCallback($=>t({type:"SET_WEBSEARCH_SUCCESS",payload:$}),[t]),M=C.useCallback($=>t({type:"SET_GLOBALENV_CONFIG",payload:$}),[t]),j=C.useCallback($=>t({type:"SET_GLOBALENV_LOADING",payload:$}),[t]),E=C.useCallback($=>t({type:"SET_GLOBALENV_SAVING",payload:$}),[t]),D=C.useCallback($=>t({type:"SET_GLOBALENV_ERROR",payload:$}),[t]),N=C.useCallback($=>t({type:"SET_GLOBALENV_SUCCESS",payload:$}),[t]),A=C.useCallback($=>t({type:"SET_PROXY_CONFIG",payload:$}),[t]),P=C.useCallback($=>t({type:"SET_PROXY_LOADING",payload:$}),[t]),k=C.useCallback($=>t({type:"SET_PROXY_SAVING",payload:$}),[t]),O=C.useCallback($=>t({type:"SET_PROXY_ERROR",payload:$}),[t]),U=C.useCallback($=>t({type:"SET_PROXY_SUCCESS",payload:$}),[t]),_=C.useCallback($=>t({type:"SET_PROXY_TEST_RESULT",payload:$}),[t]),K=C.useCallback($=>t({type:"SET_PROXY_TESTING",payload:$}),[t]),ee=C.useCallback($=>t({type:"SET_RAW_CONFIG",payload:$}),[t]),Y=C.useCallback($=>t({type:"SET_RAW_CONFIG_LOADING",payload:$}),[t]);return C.useMemo(()=>({setBrowserConfig:a,setBrowserStatus:o,setBrowserLoading:r,setBrowserStatusLoading:c,setBrowserSaving:d,setBrowserError:h,setBrowserSuccess:p,setWebSearchConfig:g,setWebSearchStatus:m,setWebSearchLoading:S,setWebSearchStatusLoading:b,setWebSearchSaving:x,setWebSearchError:T,setWebSearchSuccess:w,setGlobalEnvConfig:M,setGlobalEnvLoading:j,setGlobalEnvSaving:E,setGlobalEnvError:D,setGlobalEnvSuccess:N,setProxyConfig:A,setProxyLoading:P,setProxySaving:k,setProxyError:O,setProxySuccess:U,setProxyTestResult:_,setProxyTesting:K,setRawConfig:ee,setRawConfigLoading:Y}),[a,o,r,c,d,h,p,g,m,S,b,x,T,w,M,j,E,D,N,A,P,k,O,U,_,K,ee,Y])}function IL(){const[t,a]=Vb(),o=t.get("tab")?.toLowerCase(),r=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=C.useCallback(d=>{a({tab:d},{replace:!0})},[a]);return{activeTab:r,setActiveTab:c}}function _L(){const{state:t}=Tx(),a=OL(),[o,r]=C.useState(!1),c=C.useCallback(async()=>{try{a.setRawConfigLoading(!0);const h=await fetch("/api/config/raw");if(!h.ok){a.setRawConfig(null);return}const p=await h.text();a.setRawConfig(p)}catch{a.setRawConfig(null)}finally{a.setRawConfigLoading(!1)}},[a]),d=C.useCallback(async()=>{if(t.rawConfig)try{await navigator.clipboard.writeText(t.rawConfig),r(!0),setTimeout(()=>r(!1),2e3)}catch{}},[t.rawConfig]);return{rawConfig:t.rawConfig,loading:t.rawConfigLoading,copied:o,fetchRawConfig:c,copyToClipboard:d}}function ob({activeTab:t,onTabChange:a}){const{t:o}=ye(),r=[{value:"browser",label:o("settingsTabs.browser"),icon:xw},{value:"websearch",label:o("settingsTabs.web"),icon:nv},{value:"image",label:o("settingsTabs.image"),icon:ov},{value:"channels",label:o("settingsTabs.channels"),icon:Cw},{value:"globalenv",label:o("settingsTabs.env"),icon:sh},{value:"thinking",label:o("settingsTabs.think"),icon:Sw},{value:"proxy",label:o("settingsTabs.proxy"),icon:ww},{value:"auth",label:o("settingsTabs.auth"),icon:ih},{value:"backups",label:o("settingsTabs.backup"),icon:kw}];return l.jsx(px,{value:t,onValueChange:c=>a(c),children:l.jsx(Ih,{className:"grid w-full grid-cols-9",children:r.map(({value:c,label:d,icon:h})=>l.jsxs(El,{value:c,className:"gap-1.5 px-2 text-xs",children:[l.jsx(h,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{className:"truncate",children:d})]},c))})})}function rb(){return l.jsxs("div",{className:"flex-1 p-5 space-y-6",children:[l.jsx($e,{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($e,{className:"h-5 w-32"}),l.jsx($e,{className:"h-4 w-48"})]}),l.jsx($e,{className:"h-6 w-10 rounded-full"})]})}),l.jsxs("div",{className:"space-y-3",children:[l.jsx($e,{className:"h-5 w-24"}),l.jsxs("div",{className:"space-y-2",children:[l.jsx($e,{className:"h-20 w-full rounded-lg"}),l.jsx($e,{className:"h-20 w-full rounded-lg"}),l.jsx($e,{className:"h-20 w-full rounded-lg"})]})]})]})}function Px(t,a=3,o=1e3){return t().catch(r=>{if(a<=0)throw r;return new Promise(c=>setTimeout(c,o)).then(()=>Px(t,a-1,o*2))})}function Na(t){return C.lazy(()=>Px(t))}const sb=Na(()=>tt(()=>import("./index-B0dun58L.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),lb=Na(()=>tt(()=>import("./index-CoeauyY0.js"),__vite__mapDeps([10,1,2,11,4,5,6,7,8,9]))),cb=Na(()=>tt(()=>import("./index-BczU222d.js"),__vite__mapDeps([12,1,2,4,5,6,7,8,9]))),ub=Na(()=>tt(()=>import("./channels-qstH8YTZ.js"),__vite__mapDeps([13,1,2,4,5,6,7,8,9]))),db=Na(()=>tt(()=>import("./globalenv-section-DBqYbsuu.js"),__vite__mapDeps([14,1,2,4,5,6,7,8,9]))),hb=Na(()=>tt(()=>import("./index-B5cw5Mhf.js"),__vite__mapDeps([15,1,2,4,5,6,7,8,9]))),fb=Na(()=>tt(()=>import("./index-JIaHpwil.js"),__vite__mapDeps([16,1,2,17,4,18,19,5,6,20,7,8,9]))),pb=Na(()=>tt(()=>import("./auth-section-BQpO_21y.js"),__vite__mapDeps([21,1,2,4,5,6,7,8,9]))),gb=Na(()=>tt(()=>import("./backups-section-BM2lP-ap.js"),__vite__mapDeps([22,1,2,19,4,5,6,7,8,9])));class mb extends C.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(Kr,{className:"w-12 h-12 mx-auto mb-4 text-destructive"}),l.jsx("p",{className:"font-medium text-foreground mb-2",children:ie.t("settings.sectionLoadFailed")}),l.jsx("p",{className:"text-sm mb-4",children:this.state.error?.message||ie.t("settings.unknownError")}),l.jsxs(st,{variant:"outline",onClick:()=>window.location.reload(),className:"inline-flex items-center gap-2",children:[l.jsx(qr,{className:"w-4 h-4"}),ie.t("settings.reloadPage")]})]})}):this.props.children}}function UL(t){switch(t?.toLowerCase()){case"browser":return"browser";case"imageanalysis":case"image":return"image";case"channels":return"channels";case"globalenv":return"globalenv";case"proxy":return"proxy";case"auth":return"auth";case"thinking":return"thinking";case"backups":return"backups";default:return"websearch"}}function HL(){const{t}=ye(),{setActiveTab:a}=IL(),[o]=Vb(),r=UL(o.get("tab")),{rawConfig:c,loading:d,copied:h,fetchRawConfig:p,copyToClipboard:g}=_L();C.useEffect(()=>{p()},[p]);const m=S=>{C.startTransition(()=>{a(S)})};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(ob,{activeTab:r,onTabChange:m})}),l.jsx(mb,{children:l.jsxs(C.Suspense,{fallback:l.jsx(rb,{}),children:[r==="browser"&&l.jsx(lb,{}),r==="websearch"&&l.jsx(sb,{}),r==="image"&&l.jsx(cb,{}),r==="channels"&&l.jsx(ub,{}),r==="globalenv"&&l.jsx(db,{}),r==="thinking"&&l.jsx(hb,{}),r==="proxy"&&l.jsx(fb,{}),r==="auth"&&l.jsx(pb,{}),r==="backups"&&l.jsx(gb,{})]})})]}),l.jsxs(Rh,{direction:"horizontal",className:"h-full hidden md:flex",children:[l.jsx(Vr,{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(ob,{activeTab:r,onTabChange:m})}),l.jsx(mb,{children:l.jsxs(C.Suspense,{fallback:l.jsx(rb,{}),children:[r==="browser"&&l.jsx(lb,{}),r==="websearch"&&l.jsx(sb,{}),r==="image"&&l.jsx(cb,{}),r==="channels"&&l.jsx(ub,{}),r==="globalenv"&&l.jsx(db,{}),r==="thinking"&&l.jsx(hb,{}),r==="proxy"&&l.jsx(fb,{}),r==="auth"&&l.jsx(pb,{}),r==="backups"&&l.jsx(gb,{})]})})]})}),l.jsx(Oh,{className:"w-2 bg-border hover:bg-primary/20 transition-colors cursor-col-resize flex items-center justify-center group",children:l.jsx(_l,{className:"w-3 h-3 text-muted-foreground group-hover:text-primary"})}),l.jsx(Vr,{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(Gm,{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(st,{variant:"outline",size:"sm",onClick:g,disabled:!c,children:h?l.jsxs(l.Fragment,{children:[l.jsx(No,{className:"w-4 h-4 mr-1"}),t("settings.copied")]}):l.jsxs(l.Fragment,{children:[l.jsx(Al,{className:"w-4 h-4 mr-1"}),t("settings.copy")]})}),l.jsx(st,{variant:"outline",size:"sm",onClick:p,disabled:d,children:l.jsx(qr,{className:`w-4 h-4 ${d?"animate-spin":""}`})})]})]}),l.jsx("div",{className:"flex-1 overflow-auto",children:c?l.jsx(Dx,{value:c,onChange:()=>{},language:"yaml",readonly:!0,minHeight:"auto",className:"min-h-full"}):d?l.jsxs("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:[l.jsx(qr,{className:"w-5 h-5 animate-spin mr-2"}),t("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(Gm,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),l.jsx("p",{children:t("settings.configFileNotFound")}),l.jsx("code",{className:"text-sm bg-muted px-2 py-1 rounded mt-2 inline-block",children:"ccs migrate"})]})})})]})})]})]})}function zL(){return l.jsx(RL,{children:l.jsx(HL,{})})}const BL=Object.freeze(Object.defineProperty({__proto__:null,SettingsPage:zL},Symbol.toStringTag,{value:"Module"}));function FL(t,a,o="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:t,timeZoneName:o}).format(a).split(/\s/g).slice(2).join(" ")}const qL={},Ir={};function Ai(t,a){try{const r=(qL[t]||=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"longOffset"}).format)(a).split("GMT")[1];return r in Ir?Ir[r]:yb(r,r.split(":"))}catch{if(t in Ir)return Ir[t];const o=t?.match(KL);return o?yb(t,o.slice(1)):NaN}}const KL=/([+-]\d\d):?(\d\d)?/;function yb(t,a){const o=+(a[0]||0),r=+(a[1]||0),c=+(a[2]||0)/60;return Ir[t]=o*60+r>0?o*60+r+c:o*60-r-c}class Kn extends Date{constructor(...a){super(),a.length>1&&typeof a[a.length-1]=="string"&&(this.timeZone=a.pop()),this.internal=new Date,isNaN(Ai(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)),Mx(this),th(this)):this.setTime(Date.now())}static tz(a,...o){return o.length?new Kn(...o,a):new Kn(Date.now(),a)}withTimeZone(a){return new Kn(+this,a)}getTimezoneOffset(){const a=-Ai(this.timeZone,this);return a>0?Math.floor(a):Math.ceil(a)}setTime(a){return Date.prototype.setTime.apply(this,arguments),th(this),+this}[Symbol.for("constructDateFrom")](a){return new Kn(+new Date(a),this.timeZone)}}const bb=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!bb.test(t))return;const a=t.replace(bb,"$1UTC");Kn.prototype[a]&&(t.startsWith("get")?Kn.prototype[t]=function(){return this.internal[a]()}:(Kn.prototype[t]=function(){return Date.prototype[a].apply(this.internal,arguments),GL(this),+this},Kn.prototype[a]=function(){return Date.prototype[a].apply(this,arguments),th(this),+this}))});function th(t){t.internal.setTime(+t),t.internal.setUTCSeconds(t.internal.getUTCSeconds()-Math.round(-Ai(t.timeZone,t)*60))}function GL(t){Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),Mx(t)}function Mx(t){const a=Ai(t.timeZone,t),o=a>0?Math.floor(a):Math.ceil(a),r=new Date(+t);r.setUTCHours(r.getUTCHours()-1);const c=-new Date(+t).getTimezoneOffset(),d=-new Date(+r).getTimezoneOffset(),h=c-d,p=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();h&&p&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+h);const g=c-o;g&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+g);const m=new Date(+t);m.setUTCSeconds(0);const S=c>0?m.getSeconds():(m.getSeconds()-60)%60,b=Math.round(-(Ai(t.timeZone,t)*60))%60;(b||S)&&(t.internal.setUTCSeconds(t.internal.getUTCSeconds()+b),Date.prototype.setUTCSeconds.call(t,Date.prototype.getUTCSeconds.call(t)+b+S));const x=Ai(t.timeZone,t),T=x>0?Math.floor(x):Math.ceil(x),M=-new Date(+t).getTimezoneOffset()-T,j=T!==o,E=M-g;if(j&&E){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+E);const D=Ai(t.timeZone,t),N=D>0?Math.floor(D):Math.ceil(D),A=T-N;A&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+A),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+A))}}class va extends Kn{static tz(a,...o){return o.length?new va(...o,a):new va(Date.now(),a)}toISOString(){const[a,o,r]=this.tzComponents(),c=`${a}${o}:${r}`;return this.internal.toISOString().slice(0,-1)+c}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[a,o,r,c]=this.internal.toUTCString().split(" ");return`${a?.slice(0,-1)} ${r} ${o} ${c}`}toTimeString(){const a=this.internal.toUTCString().split(" ")[4],[o,r,c]=this.tzComponents();return`${a} GMT${o}${r}${c} (${FL(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?"-":"+",r=String(Math.floor(Math.abs(a)/60)).padStart(2,"0"),c=String(Math.abs(a)%60).padStart(2,"0");return[o,r,c]}withTimeZone(a){return new va(+this,a)}[Symbol.for("constructDateFrom")](a){return new va(+new Date(a),this.timeZone)}}const vb=5,VL=4;function YL(t,a){const o=a.startOfMonth(t),r=o.getDay()>0?o.getDay():7,c=a.addDays(t,-r+1),d=a.addDays(c,vb*7-1);return a.getMonth(t)===a.getMonth(d)?vb:VL}function Lx(t,a){const o=a.startOfMonth(t),r=o.getDay();return r===1?o:r===0?a.addDays(o,-6):a.addDays(o,-1*(r-1))}function WL(t,a){const o=Lx(t,a),r=YL(t,a);return a.addDays(o,r*7-1)}const Ex={...Nr,labels:{labelDayButton:(t,a,o,r)=>{let c;r&&typeof r.format=="function"?c=r.format.bind(r):c=(h,p)=>Lr(h,p,{locale:Nr,...o});let d=c(t,"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:t=>`Week ${t}`,labelYearDropdown:"Choose the Year",labelGrid:(t,a,o)=>{let r;return o&&typeof o.format=="function"?r=o.format.bind(o):r=(c,d)=>Lr(c,d,{locale:Nr,...a}),r(t,"LLLL yyyy")},labelGridcell:(t,a,o,r)=>{let c;r&&typeof r.format=="function"?c=r.format.bind(r):c=(h,p)=>Lr(h,p,{locale:Nr,...o});let d=c(t,"PPPP");return a?.today&&(d=`Today, ${d}`),d},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(t,a,o)=>{let r;return o&&typeof o.format=="function"?r=o.format.bind(o):r=(c,d)=>Lr(c,d,{locale:Nr,...a}),r(t,"cccc")}}};class fn{constructor(a,o){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?va.tz(this.options.timeZone):new this.Date,this.newDate=(r,c,d)=>this.overrides?.newDate?this.overrides.newDate(r,c,d):this.options.timeZone?new va(r,c,d,this.options.timeZone):new Date(r,c,d),this.addDays=(r,c)=>this.overrides?.addDays?this.overrides.addDays(r,c):Pw(r,c),this.addMonths=(r,c)=>this.overrides?.addMonths?this.overrides.addMonths(r,c):Mw(r,c),this.addWeeks=(r,c)=>this.overrides?.addWeeks?this.overrides.addWeeks(r,c):Lw(r,c),this.addYears=(r,c)=>this.overrides?.addYears?this.overrides.addYears(r,c):Ew(r,c),this.differenceInCalendarDays=(r,c)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,c):jw(r,c),this.differenceInCalendarMonths=(r,c)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,c):Rw(r,c),this.eachMonthOfInterval=r=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):Ow(r),this.eachYearOfInterval=r=>{const c=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(r):Iw(r),d=new Set(c.map(p=>this.getYear(p)));if(d.size===c.length)return c;const h=[];return d.forEach(p=>{h.push(new Date(p,0,1))}),h},this.endOfBroadcastWeek=r=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):WL(r,this),this.endOfISOWeek=r=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(r):_w(r),this.endOfMonth=r=>this.overrides?.endOfMonth?this.overrides.endOfMonth(r):Uw(r),this.endOfWeek=(r,c)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(r,c):Hw(r,this.options),this.endOfYear=r=>this.overrides?.endOfYear?this.overrides.endOfYear(r):zw(r),this.format=(r,c,d)=>{const h=this.overrides?.format?this.overrides.format(r,c,this.options):Lr(r,c,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(h):h},this.getISOWeek=r=>this.overrides?.getISOWeek?this.overrides.getISOWeek(r):Bw(r),this.getMonth=(r,c)=>this.overrides?.getMonth?this.overrides.getMonth(r,this.options):Fw(r,this.options),this.getYear=(r,c)=>this.overrides?.getYear?this.overrides.getYear(r,this.options):qw(r,this.options),this.getWeek=(r,c)=>this.overrides?.getWeek?this.overrides.getWeek(r,this.options):Kw(r,this.options),this.isAfter=(r,c)=>this.overrides?.isAfter?this.overrides.isAfter(r,c):Gw(r,c),this.isBefore=(r,c)=>this.overrides?.isBefore?this.overrides.isBefore(r,c):Vw(r,c),this.isDate=r=>this.overrides?.isDate?this.overrides.isDate(r):Yw(r),this.isSameDay=(r,c)=>this.overrides?.isSameDay?this.overrides.isSameDay(r,c):Ww(r,c),this.isSameMonth=(r,c)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(r,c):Qw(r,c),this.isSameYear=(r,c)=>this.overrides?.isSameYear?this.overrides.isSameYear(r,c):$w(r,c),this.max=r=>this.overrides?.max?this.overrides.max(r):Xw(r),this.min=r=>this.overrides?.min?this.overrides.min(r):Jw(r),this.setMonth=(r,c)=>this.overrides?.setMonth?this.overrides.setMonth(r,c):Zw(r,c),this.setYear=(r,c)=>this.overrides?.setYear?this.overrides.setYear(r,c):ek(r,c),this.startOfBroadcastWeek=(r,c)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):Lx(r,this),this.startOfDay=r=>this.overrides?.startOfDay?this.overrides.startOfDay(r):tk(r),this.startOfISOWeek=r=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(r):nk(r),this.startOfMonth=r=>this.overrides?.startOfMonth?this.overrides.startOfMonth(r):ak(r),this.startOfWeek=(r,c)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(r,this.options):ik(r,this.options),this.startOfYear=r=>this.overrides?.startOfYear?this.overrides.startOfYear(r):ok(r),this.options={locale:Ex,...a},this.overrides=o}getDigitMap(){const{numerals:a="latn"}=this.options,o=new Intl.NumberFormat("en-US",{numberingSystem:a}),r={};for(let c=0;c<10;c++)r[c.toString()]=o.format(c);return r}replaceDigits(a){const o=this.getDigitMap();return a.replace(/\d/g,r=>o[r]||r)}formatNumber(a){return this.replaceDigits(a.toString())}getMonthYearOrder(){const a=this.options.locale?.code;return a&&fn.yearFirstLocales.has(a)?"year-first":"month-first"}formatMonthYear(a){const{locale:o,timeZone:r,numerals:c}=this.options,d=o?.code;if(d&&fn.yearFirstLocales.has(d))try{return new Intl.DateTimeFormat(d,{month:"long",year:"numeric",timeZone:r,numberingSystem:c}).format(a)}catch{}const h=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(a,h)}}fn.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 Yn=new fn;class jx{constructor(a,o,r=Yn){this.date=a,this.displayMonth=o,this.outside=!!(o&&!r.isSameMonth(a,o)),this.dateLib=r,this.isoDate=r.format(a,"yyyy-MM-dd"),this.displayMonthId=r.format(o,"yyyy-MM"),this.dateMonthId=r.format(a,"yyyy-MM")}isEqualTo(a){return this.dateLib.isSameDay(a.date,this.date)&&this.dateLib.isSameMonth(a.displayMonth,this.displayMonth)}}class QL{constructor(a,o){this.date=a,this.weeks=o}}class $L{constructor(a,o){this.days=o,this.weekNumber=a}}function XL(t){return ue.createElement("button",{...t})}function JL(t){return ue.createElement("span",{...t})}function ZL(t){const{size:a=24,orientation:o="left",className:r}=t;return ue.createElement("svg",{className:r,width:a,height:a,viewBox:"0 0 24 24"},o==="up"&&ue.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),o==="down"&&ue.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),o==="left"&&ue.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),o==="right"&&ue.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function e1(t){const{day:a,modifiers:o,...r}=t;return ue.createElement("td",{...r})}function t1(t){const{day:a,modifiers:o,...r}=t,c=ue.useRef(null);return ue.useEffect(()=>{o.focused&&c.current?.focus()},[o.focused]),ue.createElement("button",{ref:c,...r})}var Ce;(function(t){t.Root="root",t.Chevron="chevron",t.Day="day",t.DayButton="day_button",t.CaptionLabel="caption_label",t.Dropdowns="dropdowns",t.Dropdown="dropdown",t.DropdownRoot="dropdown_root",t.Footer="footer",t.MonthGrid="month_grid",t.MonthCaption="month_caption",t.MonthsDropdown="months_dropdown",t.Month="month",t.Months="months",t.Nav="nav",t.NextMonthButton="button_next",t.PreviousMonthButton="button_previous",t.Week="week",t.Weeks="weeks",t.Weekday="weekday",t.Weekdays="weekdays",t.WeekNumber="week_number",t.WeekNumberHeader="week_number_header",t.YearsDropdown="years_dropdown"})(Ce||(Ce={}));var pt;(function(t){t.disabled="disabled",t.hidden="hidden",t.outside="outside",t.focused="focused",t.today="today"})(pt||(pt={}));var En;(function(t){t.range_end="range_end",t.range_middle="range_middle",t.range_start="range_start",t.selected="selected"})(En||(En={}));var hn;(function(t){t.weeks_before_enter="weeks_before_enter",t.weeks_before_exit="weeks_before_exit",t.weeks_after_enter="weeks_after_enter",t.weeks_after_exit="weeks_after_exit",t.caption_after_enter="caption_after_enter",t.caption_after_exit="caption_after_exit",t.caption_before_enter="caption_before_enter",t.caption_before_exit="caption_before_exit"})(hn||(hn={}));function n1(t){const{options:a,className:o,components:r,classNames:c,...d}=t,h=[c[Ce.Dropdown],o].join(" "),p=a?.find(({value:g})=>g===d.value);return ue.createElement("span",{"data-disabled":d.disabled,className:c[Ce.DropdownRoot]},ue.createElement(r.Select,{className:h,...d},a?.map(({value:g,label:m,disabled:S})=>ue.createElement(r.Option,{key:g,value:g,disabled:S},m))),ue.createElement("span",{className:c[Ce.CaptionLabel],"aria-hidden":!0},p?.label,ue.createElement(r.Chevron,{orientation:"down",size:18,className:c[Ce.Chevron]})))}function a1(t){return ue.createElement("div",{...t})}function i1(t){return ue.createElement("div",{...t})}function o1(t){const{calendarMonth:a,displayIndex:o,...r}=t;return ue.createElement("div",{...r},t.children)}function r1(t){const{calendarMonth:a,displayIndex:o,...r}=t;return ue.createElement("div",{...r})}function s1(t){return ue.createElement("table",{...t})}function l1(t){return ue.createElement("div",{...t})}const Rx=C.createContext(void 0);function es(){const t=C.useContext(Rx);if(t===void 0)throw new Error("useDayPicker() must be used within a custom component.");return t}function c1(t){const{components:a}=es();return ue.createElement(a.Dropdown,{...t})}function u1(t){const{onPreviousClick:a,onNextClick:o,previousMonth:r,nextMonth:c,...d}=t,{components:h,classNames:p,labels:{labelPrevious:g,labelNext:m}}=es(),S=C.useCallback(x=>{c&&o?.(x)},[c,o]),b=C.useCallback(x=>{r&&a?.(x)},[r,a]);return ue.createElement("nav",{...d},ue.createElement(h.PreviousMonthButton,{type:"button",className:p[Ce.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":g(r),onClick:b},ue.createElement(h.Chevron,{disabled:r?void 0:!0,className:p[Ce.Chevron],orientation:"left"})),ue.createElement(h.NextMonthButton,{type:"button",className:p[Ce.NextMonthButton],tabIndex:c?void 0:-1,"aria-disabled":c?void 0:!0,"aria-label":m(c),onClick:S},ue.createElement(h.Chevron,{disabled:c?void 0:!0,orientation:"right",className:p[Ce.Chevron]})))}function d1(t){const{components:a}=es();return ue.createElement(a.Button,{...t})}function h1(t){return ue.createElement("option",{...t})}function f1(t){const{components:a}=es();return ue.createElement(a.Button,{...t})}function p1(t){const{rootRef:a,...o}=t;return ue.createElement("div",{...o,ref:a})}function g1(t){return ue.createElement("select",{...t})}function m1(t){const{week:a,...o}=t;return ue.createElement("tr",{...o})}function y1(t){return ue.createElement("th",{...t})}function b1(t){return ue.createElement("thead",{"aria-hidden":!0},ue.createElement("tr",{...t}))}function v1(t){const{week:a,...o}=t;return ue.createElement("th",{...o})}function x1(t){return ue.createElement("th",{...t})}function C1(t){return ue.createElement("tbody",{...t})}function S1(t){const{components:a}=es();return ue.createElement(a.Dropdown,{...t})}const w1=Object.freeze(Object.defineProperty({__proto__:null,Button:XL,CaptionLabel:JL,Chevron:ZL,Day:e1,DayButton:t1,Dropdown:n1,DropdownNav:a1,Footer:i1,Month:o1,MonthCaption:r1,MonthGrid:s1,Months:l1,MonthsDropdown:c1,Nav:u1,NextMonthButton:d1,Option:h1,PreviousMonthButton:f1,Root:p1,Select:g1,Week:m1,WeekNumber:v1,WeekNumberHeader:x1,Weekday:y1,Weekdays:b1,Weeks:C1,YearsDropdown:S1},Symbol.toStringTag,{value:"Module"}));function xa(t,a,o=!1,r=Yn){let{from:c,to:d}=t;const{differenceInCalendarDays:h,isSameDay:p}=r;return c&&d?(h(d,c)<0&&([c,d]=[d,c]),h(a,c)>=(o?1:0)&&h(d,a)>=(o?1:0)):!o&&d?p(d,a):!o&&c?p(c,a):!1}function Kh(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function ec(t){return!!(t&&typeof t=="object"&&"from"in t)}function Gh(t){return!!(t&&typeof t=="object"&&"after"in t)}function Vh(t){return!!(t&&typeof t=="object"&&"before"in t)}function Ox(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function Ix(t,a){return Array.isArray(t)&&t.every(a.isDate)}function Ca(t,a,o=Yn){const r=Array.isArray(a)?a:[a],{isSameDay:c,differenceInCalendarDays:d,isAfter:h}=o;return r.some(p=>{if(typeof p=="boolean")return p;if(o.isDate(p))return c(t,p);if(Ix(p,o))return p.some(g=>c(t,g));if(ec(p))return xa(p,t,!1,o);if(Ox(p))return Array.isArray(p.dayOfWeek)?p.dayOfWeek.includes(t.getDay()):p.dayOfWeek===t.getDay();if(Kh(p)){const g=d(p.before,t),m=d(p.after,t),S=g>0,b=m<0;return h(p.before,p.after)?b&&S:S||b}return Gh(p)?d(t,p.after)>0:Vh(p)?d(p.before,t)>0:typeof p=="function"?p(t):!1})}function k1(t,a,o,r,c){const{disabled:d,hidden:h,modifiers:p,showOutsideDays:g,broadcastCalendar:m,today:S=c.today()}=a,{isSameDay:b,isSameMonth:x,startOfMonth:T,isBefore:w,endOfMonth:M,isAfter:j}=c,E=o&&T(o),D=r&&M(r),N={[pt.focused]:[],[pt.outside]:[],[pt.disabled]:[],[pt.hidden]:[],[pt.today]:[]},A={};for(const P of t){const{date:k,displayMonth:O}=P,U=!!(O&&!x(k,O)),_=!!(E&&w(k,E)),K=!!(D&&j(k,D)),ee=!!(d&&Ca(k,d,c)),Y=!!(h&&Ca(k,h,c))||_||K||!m&&!g&&U||m&&g===!1&&U,$=b(k,S);U&&N.outside.push(P),ee&&N.disabled.push(P),Y&&N.hidden.push(P),$&&N.today.push(P),p&&Object.keys(p).forEach(fe=>{const pe=p?.[fe];pe&&Ca(k,pe,c)&&(A[fe]?A[fe].push(P):A[fe]=[P])})}return P=>{const k={[pt.focused]:!1,[pt.disabled]:!1,[pt.hidden]:!1,[pt.outside]:!1,[pt.today]:!1},O={};for(const U in N){const _=N[U];k[U]=_.some(K=>K===P)}for(const U in A)O[U]=A[U].some(_=>_===P);return{...k,...O}}}function A1(t,a,o={}){return Object.entries(t).filter(([,c])=>c===!0).reduce((c,[d])=>(o[d]?c.push(o[d]):a[pt[d]]?c.push(a[pt[d]]):a[En[d]]&&c.push(a[En[d]]),c),[a[Ce.Day]])}function D1(t){return{...w1,...t}}function N1(t){const a={"data-mode":t.mode??void 0,"data-required":"required"in t?t.required:void 0,"data-multiple-months":t.numberOfMonths&&t.numberOfMonths>1||void 0,"data-week-numbers":t.showWeekNumber||void 0,"data-broadcast-calendar":t.broadcastCalendar||void 0,"data-nav-layout":t.navLayout||void 0};return Object.entries(t).forEach(([o,r])=>{o.startsWith("data-")&&(a[o]=r)}),a}function T1(){const t={};for(const a in Ce)t[Ce[a]]=`rdp-${Ce[a]}`;for(const a in pt)t[pt[a]]=`rdp-${pt[a]}`;for(const a in En)t[En[a]]=`rdp-${En[a]}`;for(const a in hn)t[hn[a]]=`rdp-${hn[a]}`;return t}function _x(t,a,o){return(o??new fn(a)).formatMonthYear(t)}const P1=_x;function M1(t,a,o){return(o??new fn(a)).format(t,"d")}function L1(t,a=Yn){return a.format(t,"LLLL")}function E1(t,a,o){return(o??new fn(a)).format(t,"cccccc")}function j1(t,a=Yn){return t<10?a.formatNumber(`0${t.toLocaleString()}`):a.formatNumber(`${t.toLocaleString()}`)}function R1(){return""}function Ux(t,a=Yn){return a.format(t,"yyyy")}const O1=Ux,I1=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:_x,formatDay:M1,formatMonthCaption:P1,formatMonthDropdown:L1,formatWeekNumber:j1,formatWeekNumberHeader:R1,formatWeekdayName:E1,formatYearCaption:O1,formatYearDropdown:Ux},Symbol.toStringTag,{value:"Module"}));function _1(t){return t?.formatMonthCaption&&!t.formatCaption&&(t.formatCaption=t.formatMonthCaption),t?.formatYearCaption&&!t.formatYearDropdown&&(t.formatYearDropdown=t.formatYearCaption),{...I1,...t}}function Yh(t,a,o,r){let c=(r??new fn(o)).format(t,"PPPP");return a.today&&(c=`Today, ${c}`),a.selected&&(c=`${c}, selected`),c}const U1=Yh;function Wh(t,a,o){return(o??new fn(a)).formatMonthYear(t)}const H1=Wh;function Hx(t,a,o,r){let c=(r??new fn(o)).format(t,"PPPP");return a?.today&&(c=`Today, ${c}`),c}function zx(t){return"Choose the Month"}function Bx(){return""}const z1="Go to the Next Month";function Fx(t,a){return z1}function qx(t){return"Go to the Previous Month"}function Kx(t,a,o){return(o??new fn(a)).format(t,"cccc")}function Gx(t,a){return`Week ${t}`}function Vx(t){return"Week Number"}function Yx(t){return"Choose the Year"}const B1=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:H1,labelDay:U1,labelDayButton:Yh,labelGrid:Wh,labelGridcell:Hx,labelMonthDropdown:zx,labelNav:Bx,labelNext:Fx,labelPrevious:qx,labelWeekNumber:Gx,labelWeekNumberHeader:Vx,labelWeekday:Kx,labelYearDropdown:Yx},Symbol.toStringTag,{value:"Module"})),Ln=(t,a,o)=>a||(o?typeof o=="function"?o:(...r)=>o:t);function F1(t,a){const o=a.locale?.labels??{};return{...B1,...t??{},labelDayButton:Ln(Yh,t?.labelDayButton,o.labelDayButton),labelMonthDropdown:Ln(zx,t?.labelMonthDropdown,o.labelMonthDropdown),labelNext:Ln(Fx,t?.labelNext,o.labelNext),labelPrevious:Ln(qx,t?.labelPrevious,o.labelPrevious),labelWeekNumber:Ln(Gx,t?.labelWeekNumber,o.labelWeekNumber),labelYearDropdown:Ln(Yx,t?.labelYearDropdown,o.labelYearDropdown),labelGrid:Ln(Wh,t?.labelGrid,o.labelGrid),labelGridcell:Ln(Hx,t?.labelGridcell,o.labelGridcell),labelNav:Ln(Bx,t?.labelNav,o.labelNav),labelWeekNumberHeader:Ln(Vx,t?.labelWeekNumberHeader,o.labelWeekNumberHeader),labelWeekday:Ln(Kx,t?.labelWeekday,o.labelWeekday)}}function q1(t,a,o,r,c){const{startOfMonth:d,startOfYear:h,endOfYear:p,eachMonthOfInterval:g,getMonth:m}=c;return g({start:h(t),end:p(t)}).map(x=>{const T=r.formatMonthDropdown(x,c),w=m(x),M=a&&x<d(a)||o&&x>d(o)||!1;return{value:w,label:T,disabled:M}})}function K1(t,a={},o={}){let r={...a?.[Ce.Day]};return Object.entries(t).filter(([,c])=>c===!0).forEach(([c])=>{r={...r,...o?.[c]}}),r}function G1(t,a,o,r){const c=r??t.today(),d=o?t.startOfBroadcastWeek(c,t):a?t.startOfISOWeek(c):t.startOfWeek(c),h=[];for(let p=0;p<7;p++){const g=t.addDays(d,p);h.push(g)}return h}function V1(t,a,o,r,c=!1){if(!t||!a)return;const{startOfYear:d,endOfYear:h,eachYearOfInterval:p,getYear:g}=r,m=d(t),S=h(a),b=p({start:m,end:S});return c&&b.reverse(),b.map(x=>{const T=o.formatYearDropdown(x,r);return{value:g(x),label:T,disabled:!1}})}const ts=t=>t instanceof HTMLElement?t:null,jd=t=>[...t.querySelectorAll("[data-animated-month]")??[]],Y1=t=>ts(t.querySelector("[data-animated-month]")),Rd=t=>ts(t.querySelector("[data-animated-caption]")),Od=t=>ts(t.querySelector("[data-animated-weeks]")),W1=t=>ts(t.querySelector("[data-animated-nav]")),Q1=t=>ts(t.querySelector("[data-animated-weekdays]"));function $1(t,a,{classNames:o,months:r,focused:c,dateLib:d}){const h=C.useRef(null),p=C.useRef(r),g=C.useRef(!1);C.useLayoutEffect(()=>{const m=p.current;if(p.current=r,!a||!t.current||!(t.current instanceof HTMLElement)||r.length===0||m.length===0||r.length!==m.length)return;const S=d.isSameMonth(r[0].date,m[0].date),b=d.isAfter(r[0].date,m[0].date),x=b?o[hn.caption_after_enter]:o[hn.caption_before_enter],T=b?o[hn.weeks_after_enter]:o[hn.weeks_before_enter],w=h.current,M=t.current.cloneNode(!0);if(M instanceof HTMLElement?(jd(M).forEach(N=>{if(!(N instanceof HTMLElement))return;const A=Y1(N);A&&N.contains(A)&&N.removeChild(A);const P=Rd(N);P&&P.classList.remove(x);const k=Od(N);k&&k.classList.remove(T)}),h.current=M):h.current=null,g.current||S||c)return;const j=w instanceof HTMLElement?jd(w):[],E=jd(t.current);if(E?.every(D=>D instanceof HTMLElement)&&j&&j.every(D=>D instanceof HTMLElement)){g.current=!0,t.current.style.isolation="isolate";const D=W1(t.current);D&&(D.style.zIndex="1"),E.forEach((N,A)=>{const P=j[A];if(!P)return;N.style.position="relative",N.style.overflow="hidden";const k=Rd(N);k&&k.classList.add(x);const O=Od(N);O&&O.classList.add(T);const U=()=>{g.current=!1,t.current&&(t.current.style.isolation=""),D&&(D.style.zIndex=""),k&&k.classList.remove(x),O&&O.classList.remove(T),N.style.position="",N.style.overflow="",N.contains(P)&&N.removeChild(P)};P.style.pointerEvents="none",P.style.position="absolute",P.style.overflow="hidden",P.setAttribute("aria-hidden","true");const _=Q1(P);_&&(_.style.opacity="0");const K=Rd(P);K&&(K.classList.add(b?o[hn.caption_before_exit]:o[hn.caption_after_exit]),K.addEventListener("animationend",U));const ee=Od(P);ee&&ee.classList.add(b?o[hn.weeks_before_exit]:o[hn.weeks_after_exit]),N.insertBefore(P,N.firstChild)})}})}function X1(t,a,o,r){const c=t[0],d=t[t.length-1],{ISOWeek:h,fixedWeeks:p,broadcastCalendar:g}=o??{},{addDays:m,differenceInCalendarDays:S,differenceInCalendarMonths:b,endOfBroadcastWeek:x,endOfISOWeek:T,endOfMonth:w,endOfWeek:M,isAfter:j,startOfBroadcastWeek:E,startOfISOWeek:D,startOfWeek:N}=r,A=g?E(c,r):h?D(c):N(c),P=g?x(d):h?T(w(d)):M(w(d)),k=a&&(g?x(a):h?T(a):M(a)),O=k&&j(P,k)?k:P,U=S(O,A),_=b(d,c)+1,K=[];for(let $=0;$<=U;$++){const fe=m(A,$);K.push(fe)}const Y=(g?35:42)*_;if(p&&K.length<Y){const $=Y-K.length;for(let fe=0;fe<$;fe++){const pe=m(K[K.length-1],1);K.push(pe)}}return K}function J1(t){const a=[];return t.reduce((o,r)=>{const c=r.weeks.reduce((d,h)=>d.concat(h.days.slice()),a.slice());return o.concat(c.slice())},a.slice())}function Z1(t,a,o,r){const{numberOfMonths:c=1}=o,d=[];for(let h=0;h<c;h++){const p=r.addMonths(t,h);if(a&&p>a)break;d.push(p)}return d}function xb(t,a,o,r){const{month:c,defaultMonth:d,today:h=r.today(),numberOfMonths:p=1}=t;let g=c||d||h;const{differenceInCalendarMonths:m,addMonths:S,startOfMonth:b}=r;if(o&&m(o,g)<p-1){const x=-1*(p-1);g=S(o,x)}return a&&m(g,a)<0&&(g=a),b(g)}function eE(t,a,o,r){const{addDays:c,endOfBroadcastWeek:d,endOfISOWeek:h,endOfMonth:p,endOfWeek:g,getISOWeek:m,getWeek:S,startOfBroadcastWeek:b,startOfISOWeek:x,startOfWeek:T}=r,w=t.reduce((M,j)=>{const E=o.broadcastCalendar?b(j,r):o.ISOWeek?x(j):T(j),D=o.broadcastCalendar?d(j):o.ISOWeek?h(p(j)):g(p(j)),N=a.filter(O=>O>=E&&O<=D),A=o.broadcastCalendar?35:42;if(o.fixedWeeks&&N.length<A){const O=a.filter(U=>{const _=A-N.length;return U>D&&U<=c(D,_)});N.push(...O)}const P=N.reduce((O,U)=>{const _=o.ISOWeek?m(U):S(U),K=O.find(Y=>Y.weekNumber===_),ee=new jx(U,j,r);return K?K.days.push(ee):O.push(new $L(_,[ee])),O},[]),k=new QL(j,P);return M.push(k),M},[]);return o.reverseMonths?w.reverse():w}function tE(t,a){let{startMonth:o,endMonth:r}=t;const{startOfYear:c,startOfDay:d,startOfMonth:h,endOfMonth:p,addYears:g,endOfYear:m,newDate:S,today:b}=a,{fromYear:x,toYear:T,fromMonth:w,toMonth:M}=t;!o&&w&&(o=w),!o&&x&&(o=a.newDate(x,0,1)),!r&&M&&(r=M),!r&&T&&(r=S(T,11,31));const j=t.captionLayout==="dropdown"||t.captionLayout==="dropdown-years";return o?o=h(o):x?o=S(x,0,1):!o&&j&&(o=c(g(t.today??b(),-100))),r?r=p(r):T?r=S(T,11,31):!r&&j&&(r=m(t.today??b())),[o&&d(o),r&&d(r)]}function nE(t,a,o,r){if(o.disableNavigation)return;const{pagedNavigation:c,numberOfMonths:d=1}=o,{startOfMonth:h,addMonths:p,differenceInCalendarMonths:g}=r,m=c?d:1,S=h(t);if(!a)return p(S,m);if(!(g(a,t)<d))return p(S,m)}function aE(t,a,o,r){if(o.disableNavigation)return;const{pagedNavigation:c,numberOfMonths:d}=o,{startOfMonth:h,addMonths:p,differenceInCalendarMonths:g}=r,m=c?d??1:1,S=h(t);if(!a)return p(S,-m);if(!(g(S,a)<=0))return p(S,-m)}function iE(t){const a=[];return t.reduce((o,r)=>o.concat(r.weeks.slice()),a.slice())}function tc(t,a){const[o,r]=C.useState(t);return[a===void 0?o:a,r]}function oE(t,a){const[o,r]=tE(t,a),{startOfMonth:c,endOfMonth:d}=a,h=xb(t,o,r,a),[p,g]=tc(h,t.month?h:void 0);C.useEffect(()=>{const A=xb(t,o,r,a);g(A)},[t.timeZone]);const{months:m,weeks:S,days:b,previousMonth:x,nextMonth:T}=C.useMemo(()=>{const A=Z1(p,r,{numberOfMonths:t.numberOfMonths},a),P=X1(A,t.endMonth?d(t.endMonth):void 0,{ISOWeek:t.ISOWeek,fixedWeeks:t.fixedWeeks,broadcastCalendar:t.broadcastCalendar},a),k=eE(A,P,{broadcastCalendar:t.broadcastCalendar,fixedWeeks:t.fixedWeeks,ISOWeek:t.ISOWeek,reverseMonths:t.reverseMonths},a),O=iE(k),U=J1(k),_=aE(p,o,t,a),K=nE(p,r,t,a);return{months:k,weeks:O,days:U,previousMonth:_,nextMonth:K}},[a,p.getTime(),r?.getTime(),o?.getTime(),t.disableNavigation,t.broadcastCalendar,t.endMonth?.getTime(),t.fixedWeeks,t.ISOWeek,t.numberOfMonths,t.pagedNavigation,t.reverseMonths]),{disableNavigation:w,onMonthChange:M}=t,j=A=>S.some(P=>P.days.some(k=>k.isEqualTo(A))),E=A=>{if(w)return;let P=c(A);o&&P<c(o)&&(P=c(o)),r&&P>c(r)&&(P=c(r)),g(P),M?.(P)};return{months:m,weeks:S,days:b,navStart:o,navEnd:r,previousMonth:x,nextMonth:T,goToMonth:E,goToDay:A=>{j(A)||E(A.date)}}}var Fn;(function(t){t[t.Today=0]="Today",t[t.Selected=1]="Selected",t[t.LastFocused=2]="LastFocused",t[t.FocusedModifier=3]="FocusedModifier"})(Fn||(Fn={}));function Cb(t){return!t[pt.disabled]&&!t[pt.hidden]&&!t[pt.outside]}function rE(t,a,o,r){let c,d=-1;for(const h of t){const p=a(h);Cb(p)&&(p[pt.focused]&&d<Fn.FocusedModifier?(c=h,d=Fn.FocusedModifier):r?.isEqualTo(h)&&d<Fn.LastFocused?(c=h,d=Fn.LastFocused):o(h.date)&&d<Fn.Selected?(c=h,d=Fn.Selected):p[pt.today]&&d<Fn.Today&&(c=h,d=Fn.Today))}return c||(c=t.find(h=>Cb(a(h)))),c}function sE(t,a,o,r,c,d,h){const{ISOWeek:p,broadcastCalendar:g}=d,{addDays:m,addMonths:S,addWeeks:b,addYears:x,endOfBroadcastWeek:T,endOfISOWeek:w,endOfWeek:M,max:j,min:E,startOfBroadcastWeek:D,startOfISOWeek:N,startOfWeek:A}=h;let k={day:m,week:b,month:S,year:x,startOfWeek:O=>g?D(O,h):p?N(O):A(O),endOfWeek:O=>g?T(O):p?w(O):M(O)}[t](o,a==="after"?1:-1);return a==="before"&&r?k=j([r,k]):a==="after"&&c&&(k=E([c,k])),k}function Wx(t,a,o,r,c,d,h,p=0){if(p>365)return;const g=sE(t,a,o.date,r,c,d,h),m=!!(d.disabled&&Ca(g,d.disabled,h)),S=!!(d.hidden&&Ca(g,d.hidden,h)),b=g,x=new jx(g,b,h);return!m&&!S?x:Wx(t,a,x,r,c,d,h,p+1)}function lE(t,a,o,r,c){const{autoFocus:d}=t,[h,p]=C.useState(),g=rE(a.days,o,r||(()=>!1),h),[m,S]=C.useState(d?g:void 0);return{isFocusTarget:M=>!!g?.isEqualTo(M),setFocused:S,focused:m,blur:()=>{p(m),S(void 0)},moveFocus:(M,j)=>{if(!m)return;const E=Wx(M,j,m,a.navStart,a.navEnd,t,c);E&&(t.disableNavigation&&!a.days.some(N=>N.isEqualTo(E))||(a.goToDay(E),S(E)))}}}function cE(t,a){const{selected:o,required:r,onSelect:c}=t,[d,h]=tc(o,c?o:void 0),p=c?o:d,{isSameDay:g}=a,m=T=>p?.some(w=>g(w,T))??!1,{min:S,max:b}=t;return{selected:p,select:(T,w,M)=>{let j=[...p??[]];if(m(T)){if(p?.length===S||r&&p?.length===1)return;j=p?.filter(E=>!g(E,T))}else p?.length===b?j=[T]:j=[...j,T];return c||h(j),c?.(j,T,w,M),j},isSelected:m}}function uE(t,a,o=0,r=0,c=!1,d=Yn){const{from:h,to:p}=a||{},{isSameDay:g,isAfter:m,isBefore:S}=d;let b;if(!h&&!p)b={from:t,to:o>0?void 0:t};else if(h&&!p)g(h,t)?o===0?b={from:h,to:t}:c?b={from:h,to:void 0}:b=void 0:S(t,h)?b={from:t,to:h}:b={from:h,to:t};else if(h&&p)if(g(h,t)&&g(p,t))c?b={from:h,to:p}:b=void 0;else if(g(h,t))b={from:h,to:o>0?void 0:t};else if(g(p,t))b={from:t,to:o>0?void 0:t};else if(S(t,h))b={from:t,to:p};else if(m(t,h))b={from:h,to:t};else if(m(t,p))b={from:h,to:t};else throw new Error("Invalid range");if(b?.from&&b?.to){const x=d.differenceInCalendarDays(b.to,b.from);r>0&&x>r?b={from:t,to:void 0}:o>1&&x<o&&(b={from:t,to:void 0})}return b}function dE(t,a,o=Yn){const r=Array.isArray(a)?a:[a];let c=t.from;const d=o.differenceInCalendarDays(t.to,t.from),h=Math.min(d,6);for(let p=0;p<=h;p++){if(r.includes(c.getDay()))return!0;c=o.addDays(c,1)}return!1}function Sb(t,a,o=Yn){return xa(t,a.from,!1,o)||xa(t,a.to,!1,o)||xa(a,t.from,!1,o)||xa(a,t.to,!1,o)}function hE(t,a,o=Yn){const r=Array.isArray(a)?a:[a];if(r.filter(p=>typeof p!="function").some(p=>typeof p=="boolean"?p:o.isDate(p)?xa(t,p,!1,o):Ix(p,o)?p.some(g=>xa(t,g,!1,o)):ec(p)?p.from&&p.to?Sb(t,{from:p.from,to:p.to},o):!1:Ox(p)?dE(t,p.dayOfWeek,o):Kh(p)?o.isAfter(p.before,p.after)?Sb(t,{from:o.addDays(p.after,1),to:o.addDays(p.before,-1)},o):Ca(t.from,p,o)||Ca(t.to,p,o):Gh(p)||Vh(p)?Ca(t.from,p,o)||Ca(t.to,p,o):!1))return!0;const h=r.filter(p=>typeof p=="function");if(h.length){let p=t.from;const g=o.differenceInCalendarDays(t.to,t.from);for(let m=0;m<=g;m++){if(h.some(S=>S(p)))return!0;p=o.addDays(p,1)}}return!1}function fE(t,a){const{disabled:o,excludeDisabled:r,selected:c,required:d,onSelect:h}=t,[p,g]=tc(c,h?c:void 0),m=h?c:p;return{selected:m,select:(x,T,w)=>{const{min:M,max:j}=t,E=x?uE(x,m,M,j,d,a):void 0;return r&&o&&E?.from&&E.to&&hE({from:E.from,to:E.to},o,a)&&(E.from=x,E.to=void 0),h||g(E),h?.(E,x,T,w),E},isSelected:x=>m&&xa(m,x,!1,a)}}function pE(t,a){const{selected:o,required:r,onSelect:c}=t,[d,h]=tc(o,c?o:void 0),p=c?o:d,{isSameDay:g}=a;return{selected:p,select:(b,x,T)=>{let w=b;return!r&&p&&p&&g(b,p)&&(w=void 0),c||h(w),c?.(w,b,x,T),w},isSelected:b=>p?g(p,b):!1}}function gE(t,a){const o=pE(t,a),r=cE(t,a),c=fE(t,a);switch(t.mode){case"single":return o;case"multiple":return r;case"range":return c;default:return}}function Ht(t,a){return t instanceof va&&t.timeZone===a?t:new va(t,a)}function wb(t,a){return typeof t=="boolean"||typeof t=="function"?t:t instanceof Date?Ht(t,a):Array.isArray(t)?t.map(o=>o instanceof Date?Ht(o,a):o):ec(t)?{...t,from:t.from?Ht(t.from,a):t.from,to:t.to?Ht(t.to,a):t.to}:Kh(t)?{before:Ht(t.before,a),after:Ht(t.after,a)}:Gh(t)?{after:Ht(t.after,a)}:Vh(t)?{before:Ht(t.before,a)}:t}function Id(t,a){return t&&(Array.isArray(t)?t.map(o=>wb(o,a)):wb(t,a))}function mE(t){let a=t;const o=a.timeZone;if(o&&(a={...t,timeZone:o},a.today&&(a.today=Ht(a.today,o)),a.month&&(a.month=Ht(a.month,o)),a.defaultMonth&&(a.defaultMonth=Ht(a.defaultMonth,o)),a.startMonth&&(a.startMonth=Ht(a.startMonth,o)),a.endMonth&&(a.endMonth=Ht(a.endMonth,o)),a.mode==="single"&&a.selected?a.selected=Ht(a.selected,o):a.mode==="multiple"&&a.selected?a.selected=a.selected?.map(ve=>Ht(ve,o)):a.mode==="range"&&a.selected&&(a.selected={from:a.selected.from?Ht(a.selected.from,o):a.selected.from,to:a.selected.to?Ht(a.selected.to,o):a.selected.to}),a.disabled!==void 0&&(a.disabled=Id(a.disabled,o)),a.hidden!==void 0&&(a.hidden=Id(a.hidden,o)),a.modifiers)){const ve={};Object.keys(a.modifiers).forEach(Me=>{ve[Me]=Id(a.modifiers?.[Me],o)}),a.modifiers=ve}const{components:r,formatters:c,labels:d,dateLib:h,locale:p,classNames:g}=C.useMemo(()=>{const ve={...Ex,...a.locale},Me=new fn({locale:ve,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:Me,components:D1(a.components),formatters:_1(a.formatters),labels:F1(a.labels,Me.options),locale:ve,classNames:{...T1(),...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:h.today()});const{captionLayout:m,mode:S,navLayout:b,numberOfMonths:x=1,onDayBlur:T,onDayClick:w,onDayFocus:M,onDayKeyDown:j,onDayMouseEnter:E,onDayMouseLeave:D,onNextClick:N,onPrevClick:A,showWeekNumber:P,styles:k}=a,{formatCaption:O,formatDay:U,formatMonthDropdown:_,formatWeekNumber:K,formatWeekNumberHeader:ee,formatWeekdayName:Y,formatYearDropdown:$}=c,fe=oE(a,h),{days:pe,months:H,navStart:Z,navEnd:ne,previousMonth:Q,nextMonth:se,goToMonth:de}=fe,ge=k1(pe,a,Z,ne,h),{isSelected:J,select:ae,selected:he}=gE(a,h)??{},{blur:re,focused:le,isFocusTarget:xe,moveFocus:Pe,setFocused:ze}=lE(a,fe,ge,J??(()=>!1),h),{labelDayButton:Je,labelGridcell:we,labelGrid:Re,labelMonthDropdown:Ve,labelNav:Tt,labelPrevious:jt,labelNext:Wn,labelWeekday:Le,labelWeekNumber:Zt,labelWeekNumberHeader:Rn,labelYearDropdown:en}=d,Ta=C.useMemo(()=>G1(h,a.ISOWeek,a.broadcastCalendar,a.today),[h,a.ISOWeek,a.broadcastCalendar,a.today]),Qn=S!==void 0||w!==void 0,bt=C.useCallback(()=>{Q&&(de(Q),A?.(Q))},[Q,de,A]),tn=C.useCallback(()=>{se&&(de(se),N?.(se))},[de,se,N]),$n=C.useCallback((ve,Me)=>Ae=>{Ae.preventDefault(),Ae.stopPropagation(),ze(ve),!Me.disabled&&(ae?.(ve.date,Me,Ae),w?.(ve.date,Me,Ae))},[ae,w,ze]),ni=C.useCallback((ve,Me)=>Ae=>{ze(ve),M?.(ve.date,Me,Ae)},[M,ze]),On=C.useCallback((ve,Me)=>Ae=>{re(),T?.(ve.date,Me,Ae)},[re,T]),In=C.useCallback((ve,Me)=>Ae=>{const _e={ArrowLeft:[Ae.shiftKey?"month":"day",a.dir==="rtl"?"after":"before"],ArrowRight:[Ae.shiftKey?"month":"day",a.dir==="rtl"?"before":"after"],ArrowDown:[Ae.shiftKey?"year":"week","after"],ArrowUp:[Ae.shiftKey?"year":"week","before"],PageUp:[Ae.shiftKey?"year":"month","before"],PageDown:[Ae.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(_e[Ae.key]){Ae.preventDefault(),Ae.stopPropagation();const[ct,Ne]=_e[Ae.key];Pe(ct,Ne)}j?.(ve.date,Me,Ae)},[Pe,j,a.dir]),Ei=C.useCallback((ve,Me)=>Ae=>{E?.(ve.date,Me,Ae)},[E]),Eo=C.useCallback((ve,Me)=>Ae=>{D?.(ve.date,Me,Ae)},[D]),jo=C.useCallback(ve=>Me=>{const Ae=Number(Me.target.value),_e=h.setMonth(h.startOfMonth(ve),Ae);de(_e)},[h,de]),Xn=C.useCallback(ve=>Me=>{const Ae=Number(Me.target.value),_e=h.setYear(h.startOfMonth(ve),Ae);de(_e)},[h,de]),{className:te,style:Oe}=C.useMemo(()=>({className:[g[Ce.Root],a.className].filter(Boolean).join(" "),style:{...k?.[Ce.Root],...a.style}}),[g,a.className,a.style,k]),ke=N1(a),Ie=C.useRef(null);$1(Ie,!!a.animate,{classNames:g,months:H,focused:le,dateLib:h});const ht={dayPickerProps:a,selected:he,select:ae,isSelected:J,months:H,nextMonth:se,previousMonth:Q,goToMonth:de,getModifiers:ge,components:r,classNames:g,styles:k,labels:d,formatters:c};return ue.createElement(Rx.Provider,{value:ht},ue.createElement(r.Root,{rootRef:a.animate?Ie:void 0,className:te,style:Oe,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"],...ke},ue.createElement(r.Months,{className:g[Ce.Months],style:k?.[Ce.Months]},!a.hideNavigation&&!b&&ue.createElement(r.Nav,{"data-animated-nav":a.animate?"true":void 0,className:g[Ce.Nav],style:k?.[Ce.Nav],"aria-label":Tt(),onPreviousClick:bt,onNextClick:tn,previousMonth:Q,nextMonth:se}),H.map((ve,Me)=>ue.createElement(r.Month,{"data-animated-month":a.animate?"true":void 0,className:g[Ce.Month],style:k?.[Ce.Month],key:Me,displayIndex:Me,calendarMonth:ve},b==="around"&&!a.hideNavigation&&Me===0&&ue.createElement(r.PreviousMonthButton,{type:"button",className:g[Ce.PreviousMonthButton],tabIndex:Q?void 0:-1,"aria-disabled":Q?void 0:!0,"aria-label":jt(Q),onClick:bt,"data-animated-button":a.animate?"true":void 0},ue.createElement(r.Chevron,{disabled:Q?void 0:!0,className:g[Ce.Chevron],orientation:a.dir==="rtl"?"right":"left"})),ue.createElement(r.MonthCaption,{"data-animated-caption":a.animate?"true":void 0,className:g[Ce.MonthCaption],style:k?.[Ce.MonthCaption],calendarMonth:ve,displayIndex:Me},m?.startsWith("dropdown")?ue.createElement(r.DropdownNav,{className:g[Ce.Dropdowns],style:k?.[Ce.Dropdowns]},(()=>{const Ae=m==="dropdown"||m==="dropdown-months"?ue.createElement(r.MonthsDropdown,{key:"month",className:g[Ce.MonthsDropdown],"aria-label":Ve(),classNames:g,components:r,disabled:!!a.disableNavigation,onChange:jo(ve.date),options:q1(ve.date,Z,ne,c,h),style:k?.[Ce.Dropdown],value:h.getMonth(ve.date)}):ue.createElement("span",{key:"month"},_(ve.date,h)),_e=m==="dropdown"||m==="dropdown-years"?ue.createElement(r.YearsDropdown,{key:"year",className:g[Ce.YearsDropdown],"aria-label":en(h.options),classNames:g,components:r,disabled:!!a.disableNavigation,onChange:Xn(ve.date),options:V1(Z,ne,c,h,!!a.reverseYears),style:k?.[Ce.Dropdown],value:h.getYear(ve.date)}):ue.createElement("span",{key:"year"},$(ve.date,h));return h.getMonthYearOrder()==="year-first"?[_e,Ae]:[Ae,_e]})(),ue.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"}},O(ve.date,h.options,h))):ue.createElement(r.CaptionLabel,{className:g[Ce.CaptionLabel],role:"status","aria-live":"polite"},O(ve.date,h.options,h))),b==="around"&&!a.hideNavigation&&Me===x-1&&ue.createElement(r.NextMonthButton,{type:"button",className:g[Ce.NextMonthButton],tabIndex:se?void 0:-1,"aria-disabled":se?void 0:!0,"aria-label":Wn(se),onClick:tn,"data-animated-button":a.animate?"true":void 0},ue.createElement(r.Chevron,{disabled:se?void 0:!0,className:g[Ce.Chevron],orientation:a.dir==="rtl"?"left":"right"})),Me===x-1&&b==="after"&&!a.hideNavigation&&ue.createElement(r.Nav,{"data-animated-nav":a.animate?"true":void 0,className:g[Ce.Nav],style:k?.[Ce.Nav],"aria-label":Tt(),onPreviousClick:bt,onNextClick:tn,previousMonth:Q,nextMonth:se}),ue.createElement(r.MonthGrid,{role:"grid","aria-multiselectable":S==="multiple"||S==="range","aria-label":Re(ve.date,h.options,h)||void 0,className:g[Ce.MonthGrid],style:k?.[Ce.MonthGrid]},!a.hideWeekdays&&ue.createElement(r.Weekdays,{"data-animated-weekdays":a.animate?"true":void 0,className:g[Ce.Weekdays],style:k?.[Ce.Weekdays]},P&&ue.createElement(r.WeekNumberHeader,{"aria-label":Rn(h.options),className:g[Ce.WeekNumberHeader],style:k?.[Ce.WeekNumberHeader],scope:"col"},ee()),Ta.map(Ae=>ue.createElement(r.Weekday,{"aria-label":Le(Ae,h.options,h),className:g[Ce.Weekday],key:String(Ae),style:k?.[Ce.Weekday],scope:"col"},Y(Ae,h.options,h)))),ue.createElement(r.Weeks,{"data-animated-weeks":a.animate?"true":void 0,className:g[Ce.Weeks],style:k?.[Ce.Weeks]},ve.weeks.map(Ae=>ue.createElement(r.Week,{className:g[Ce.Week],key:Ae.weekNumber,style:k?.[Ce.Week],week:Ae},P&&ue.createElement(r.WeekNumber,{week:Ae,style:k?.[Ce.WeekNumber],"aria-label":Zt(Ae.weekNumber,{locale:p}),className:g[Ce.WeekNumber],scope:"row",role:"rowheader"},K(Ae.weekNumber,h)),Ae.days.map(_e=>{const{date:ct}=_e,Ne=ge(_e);if(Ne[pt.focused]=!Ne.hidden&&!!le?.isEqualTo(_e),Ne[En.selected]=J?.(ct)||Ne.selected,ec(he)){const{from:nn,to:Nn}=he;Ne[En.range_start]=!!(nn&&Nn&&h.isSameDay(ct,nn)),Ne[En.range_end]=!!(nn&&Nn&&h.isSameDay(ct,Nn)),Ne[En.range_middle]=xa(he,ct,!0,h)}const zt=K1(Ne,k,a.modifiersStyles),Jn=A1(Ne,g,a.modifiersClassNames),Pt=!Qn&&!Ne.hidden?we(ct,Ne,h.options,h):void 0;return ue.createElement(r.Day,{key:`${_e.isoDate}_${_e.displayMonthId}`,day:_e,modifiers:Ne,className:Jn.join(" "),style:zt,role:"gridcell","aria-selected":Ne.selected||void 0,"aria-label":Pt,"data-day":_e.isoDate,"data-month":_e.outside?_e.dateMonthId:void 0,"data-selected":Ne.selected||void 0,"data-disabled":Ne.disabled||void 0,"data-hidden":Ne.hidden||void 0,"data-outside":_e.outside||void 0,"data-focused":Ne.focused||void 0,"data-today":Ne.today||void 0},!Ne.hidden&&Qn?ue.createElement(r.DayButton,{className:g[Ce.DayButton],style:k?.[Ce.DayButton],type:"button",day:_e,modifiers:Ne,disabled:!Ne.focused&&Ne.disabled||void 0,"aria-disabled":Ne.focused&&Ne.disabled||void 0,tabIndex:xe(_e)?0:-1,"aria-label":Je(ct,Ne,h.options,h),onClick:$n(_e,Ne),onBlur:On(_e,Ne),onFocus:ni(_e,Ne),onKeyDown:In(_e,Ne),onMouseEnter:Ei(_e,Ne),onMouseLeave:Eo(_e,Ne)},U(ct,h.options,h)):!Ne.hidden&&U(_e.date,h.options,h))})))))))),a.footer&&ue.createElement(r.Footer,{className:g[Ce.Footer],style:k?.[Ce.Footer],role:"status","aria-live":"polite"},a.footer)))}function yE({className:t,classNames:a,showOutsideDays:o=!0,...r}){return l.jsx(mE,{showOutsideDays:o,className:z("p-2",t),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:z(xl({variant:"ghost"}),"h-7 w-7 bg-transparent p-0 opacity-70 hover:opacity-100 hover:bg-accent rounded-md"),button_next:z(xl({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:z("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:z(xl({variant:"ghost"}),"h-8 w-8 p-0 font-normal rounded-full text-xs","aria-selected:opacity-100"),range_start:z("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:z("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:z("aria-selected:bg-accent aria-selected:text-accent-foreground","aria-selected:rounded-none"),selected:z("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,...h})=>{const p=c==="left"?Aw:c==="right"?Ol:c==="up"?oh:Il;return l.jsx(p,{className:z("h-4 w-4",d),...h})}},...r})}yE.displayName="Calendar";const bE=C.lazy(()=>tt(()=>Promise.resolve().then(()=>Zl),void 0).then(t=>({default:t.CodeEditor})));function sR({rawJsonContent:t,isRawJsonValid:a,rawJsonEdits:o,rawSettingsEnv:r,onChange:c,missingRequiredFields:d=[]}){const{t:h}=ye(),p=d.length>0;return l.jsx(C.Suspense,{fallback:l.jsxs("div",{className:"flex items-center justify-center h-full",children:[l.jsx(An,{className:"w-6 h-6 animate-spin text-muted-foreground"}),l.jsx("span",{className:"ml-2 text-muted-foreground",children:h("providerEditor.loadingEditor")})]}),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(Mo,{className:"w-4 h-4"}),"Invalid JSON syntax"]}),a&&p&&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(Vn,{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(bE,{value:t,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(Uh,{profileEnv:r})})})]})})}C.lazy(()=>tt(()=>Promise.resolve().then(()=>Zl),void 0).then(t=>({default:t.CodeEditor})));function vE(){const{t}=ye(),{isDark:a,setTheme:o}=mh(),[r,c]=C.useState(""),[d,h]=C.useState(""),[p,g]=C.useState(!1),[m,S]=C.useState(null),[b,x]=C.useState(!1),{login:T,authRequired:w,isAuthenticated:M,loading:j,accessMode:E,authEnabled:D}=Bl(),N=ah(),A=Rl(),P=E==="setup",k=t(P?"auth.remoteGuardLabel":"auth.protectedAccessLabel"),O=t(P?D?"auth.incompleteSetupDescription":"auth.remoteSetupDescription":"auth.loginDescription"),U=A.state?.from?.pathname||"/";if(C.useEffect(()=>{j||(M||!w)&&N(U,{replace:!0})},[M,w,j,N,U]),j)return l.jsx("div",{className:"flex min-h-[100dvh] items-center justify-center bg-background px-4",children:l.jsxs("div",{className:"flex items-center gap-3 rounded-full border border-border/80 bg-card/90 px-5 py-3 text-sm text-muted-foreground shadow-sm",children:[l.jsx(An,{className:"h-4 w-4 animate-spin"}),t("auth.loading")]})});if(M||!w)return null;const _=async K=>{K.preventDefault(),S(null),x(!0);try{await T(r,d),N(U,{replace:!0})}catch(ee){S(ee instanceof Error?ee.message:t("auth.loginFailed"))}finally{x(!1)}};return l.jsxs("div",{className:"relative min-h-[100dvh] overflow-hidden bg-background",children:[l.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_top_left,rgba(167,85,52,0.16),transparent_42%),radial-gradient(circle_at_bottom_right,rgba(39,39,42,0.12),transparent_48%)]"}),l.jsx("div",{className:"absolute inset-0 opacity-[0.18] [background-image:linear-gradient(rgba(127,117,107,0.14)_1px,transparent_1px),linear-gradient(90deg,rgba(127,117,107,0.14)_1px,transparent_1px)] [background-size:24px_24px]"}),l.jsx("div",{className:"relative mx-auto flex min-h-[100dvh] max-w-6xl items-center px-4 py-8 sm:px-6",children:l.jsxs("div",{className:"grid w-full items-stretch gap-6 lg:grid-cols-[minmax(0,1.05fr)_minmax(360px,430px)]",children:[l.jsxs("section",{className:"flex flex-col justify-between rounded-[28px] border border-border/70 bg-card/85 p-6 shadow-[0_24px_80px_-48px_rgba(68,48,34,0.55)] backdrop-blur sm:p-8",children:[l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[l.jsxs("span",{className:"inline-flex w-fit items-center gap-2 rounded-full border border-border/70 bg-background/75 px-3 py-1 text-xs font-semibold uppercase tracking-[0.24em] text-muted-foreground",children:[l.jsx(pl,{className:"h-3.5 w-3.5 text-accent"}),k]}),l.jsxs("div",{className:"inline-flex items-center gap-1 rounded-full border border-border/70 bg-background/75 p-1 shadow-sm backdrop-blur",children:[l.jsxs(st,{type:"button",variant:"ghost",size:"sm",className:z("rounded-full px-3 text-xs font-semibold",!a&&"bg-card text-foreground shadow-sm"),"aria-pressed":!a,onClick:()=>o("light"),children:[l.jsx(Jb,{className:"h-3.5 w-3.5"}),t("auth.lightMode")]}),l.jsxs(st,{type:"button",variant:"ghost",size:"sm",className:z("rounded-full px-3 text-xs font-semibold",a&&"bg-card text-foreground shadow-sm"),"aria-pressed":a,onClick:()=>o("dark"),children:[l.jsx(Zb,{className:"h-3.5 w-3.5"}),t("auth.darkMode")]})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsx("h1",{className:"max-w-xl text-4xl font-semibold tracking-[-0.04em] text-balance text-foreground sm:text-5xl",children:t(P?"auth.remoteSetupTitle":"auth.dashboardTitle")}),l.jsx("p",{className:"max-w-2xl text-base leading-7 text-muted-foreground sm:text-lg",children:O})]})]}),l.jsxs("div",{className:"mt-8 grid gap-3 text-sm text-muted-foreground sm:grid-cols-3",children:[l.jsxs("div",{className:"rounded-2xl border border-border/70 bg-background/70 p-4",children:[l.jsx(Vm,{className:"mb-3 h-4 w-4 text-accent"}),l.jsx("p",{children:t("auth.safetyNoteRemote")})]}),l.jsxs("div",{className:"rounded-2xl border border-border/70 bg-background/70 p-4",children:[l.jsx(Ym,{className:"mb-3 h-4 w-4 text-accent"}),l.jsx("p",{children:t("auth.safetyNoteLocal")})]}),l.jsxs("div",{className:"rounded-2xl border border-border/70 bg-background/70 p-4",children:[l.jsx(pl,{className:"mb-3 h-4 w-4 text-accent"}),l.jsx("p",{children:t("auth.safetyNoteSession")})]})]})]}),l.jsxs(QM,{className:"justify-center rounded-[28px] border-border/70 bg-card/95 py-0 shadow-[0_24px_90px_-54px_rgba(34,24,16,0.62)]",children:[l.jsxs($M,{className:"space-y-3 border-b border-border/70 px-6 py-6",children:[l.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl border border-accent/20 bg-accent/10",children:P?l.jsx(Vm,{className:"h-5 w-5 text-accent"}):l.jsx(Ym,{className:"h-5 w-5 text-accent"})}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(XM,{className:"text-2xl tracking-[-0.03em]",children:t(P?"auth.remoteSetupTitle":"auth.dashboardTitle")}),l.jsx(JM,{className:"text-sm leading-6 text-muted-foreground",children:P?O:t("auth.credentialsHint")})]})]}),l.jsx(ZM,{className:"space-y-5 px-6 py-6",children:P?l.jsxs(l.Fragment,{children:[l.jsxs(zr,{variant:"warning",className:"rounded-2xl border-yellow-300/70 bg-yellow-50/80",children:[l.jsx(Kr,{className:"h-4 w-4"}),l.jsx(Ll,{children:t("auth.noDefaultCredentials")}),l.jsx(Br,{children:t("auth.credentialsHint")})]}),l.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[l.jsxs("div",{className:"rounded-2xl border border-border/70 bg-background/75 p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[l.jsx(Dw,{className:"h-4 w-4 text-accent"}),t("auth.hostStepTitle")]}),l.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:t("auth.hostStepDescription")}),l.jsx("code",{className:"mt-4 block rounded-xl border border-border/70 bg-muted/60 px-3 py-2 font-mono text-[13px] text-foreground",children:"ccs config auth setup"}),l.jsx("p",{className:"mt-3 text-xs leading-5 text-muted-foreground",children:t("auth.dockerStepDescription")}),l.jsx("code",{className:"mt-2 block rounded-xl border border-border/70 bg-muted/60 px-3 py-2 font-mono text-[13px] text-foreground",children:"docker exec -it ccs-cliproxy ccs config auth setup"})]}),l.jsxs("div",{className:"rounded-2xl border border-border/70 bg-background/75 p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[l.jsx(pl,{className:"h-4 w-4 text-accent"}),t("auth.localStepTitle")]}),l.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:t("auth.localStepDescription")})]})]})]}):l.jsxs("form",{onSubmit:_,className:"space-y-4",children:[m&&l.jsxs(zr,{variant:"destructive",className:"rounded-2xl",children:[l.jsx(Kr,{className:"h-4 w-4"}),l.jsx(Br,{children:m})]}),l.jsxs(zr,{variant:"info",className:"rounded-2xl border-blue-200/80 bg-blue-50/80",children:[l.jsx(pl,{className:"h-4 w-4"}),l.jsx(Ll,{children:t("auth.noDefaultCredentials")}),l.jsx(Br,{children:t("auth.credentialsHint")})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qt,{htmlFor:"username",className:"text-sm font-semibold",children:t("auth.username")}),l.jsx(Bn,{id:"username",type:"text",value:r,onChange:K=>c(K.target.value),placeholder:t("auth.usernamePlaceholder"),autoComplete:"username",className:"h-12 rounded-2xl border-border/80 bg-background/85 px-4 text-base md:text-base",disabled:b,required:!0})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qt,{htmlFor:"password",className:"text-sm font-semibold",children:t("auth.password")}),l.jsxs("div",{className:"relative",children:[l.jsx(Bn,{id:"password",type:p?"text":"password",value:d,onChange:K=>h(K.target.value),placeholder:t("auth.passwordPlaceholder"),autoComplete:"current-password",className:"h-12 rounded-2xl border-border/80 bg-background/85 px-4 pr-14 text-base md:text-base",disabled:b,required:!0}),l.jsx(st,{type:"button",variant:"ghost",size:"sm",className:"absolute inset-y-1 right-1 h-auto rounded-xl px-3 text-muted-foreground hover:text-foreground","aria-label":t(p?"auth.hidePassword":"auth.showPassword"),"aria-pressed":p,onClick:()=>g(K=>!K),disabled:b,children:p?l.jsx(Qr,{className:"h-4 w-4"}):l.jsx($r,{className:"h-4 w-4"})})]})]}),l.jsx(st,{type:"submit",className:"h-12 w-full rounded-2xl text-sm font-semibold",disabled:b,children:b?l.jsxs(l.Fragment,{children:[l.jsx(An,{className:"mr-2 h-4 w-4 animate-spin"}),t("auth.signingIn")]}):t("auth.signIn")})]})})]})]})})]})}const xE=C.lazy(()=>tt(()=>import("./index-IiaQMFco.js"),__vite__mapDeps([23,1,2,4,5,7,24,6,8,9])).then(t=>({default:t.AnalyticsPage}))),CE=C.lazy(()=>tt(()=>import("./api-DXFMasvG.js"),__vite__mapDeps([25,1,2,5,26,19,6,4,3,7,8,9])).then(t=>({default:t.ApiPage}))),SE=C.lazy(()=>tt(()=>import("./cliproxy-5-BIu9Wb.js"),__vite__mapDeps([27,1,2,5,17,6,4,20,28,26,19,29,30,18,7,8,9])).then(t=>({default:t.CliproxyPage}))),wE=C.lazy(()=>tt(()=>import("./cliproxy-ai-providers-BNffQh5X.js"),__vite__mapDeps([31,1,2,18,19,5,6,4,26,7,8,9])).then(t=>({default:t.CliproxyAiProvidersPage}))),kE=C.lazy(()=>tt(()=>import("./cliproxy-control-panel-CjExrU2o.js"),__vite__mapDeps([32,1,2,5,17,4,6,7,8,9])).then(t=>({default:t.CliproxyControlPanelPage}))),AE=C.lazy(()=>tt(()=>import("./copilot-gf-rTcY8.js"),__vite__mapDeps([33,1,2,5,26,19,4,29,30,6,7,8,9])).then(t=>({default:t.CopilotPage}))),DE=C.lazy(()=>tt(()=>import("./cursor-CJGCGy-H.js"),__vite__mapDeps([34,1,2,6,5,17,29,30,4,7,8,9])).then(t=>({default:t.CursorPage}))),NE=C.lazy(()=>tt(()=>import("./claude-extension-BD6uQlc-.js"),__vite__mapDeps([35,1,2,5,6,4,7,8,9])).then(t=>({default:t.ClaudeExtensionPage}))),TE=C.lazy(()=>tt(()=>import("./codex-Dd2XIT8b.js"),__vite__mapDeps([36,1,2,6,4,29,5,9,7,37,38,8])).then(t=>({default:t.CodexPage}))),PE=C.lazy(()=>tt(()=>import("./droid-D1Wq6rRO.js"),__vite__mapDeps([39,1,2,6,5,38,4,29,7,8,9])).then(t=>({default:t.DroidPage}))),ME=C.lazy(()=>tt(()=>import("./logs-DbWcj2t5.js"),__vite__mapDeps([40,1,2,4,5,6,7,8,9])).then(t=>({default:t.LogsPage}))),LE=C.lazy(()=>tt(()=>import("./accounts-C11yNnFn.js"),__vite__mapDeps([41,1,2,5,37,19,6,4,28,7,8,9])).then(t=>({default:t.AccountsPage}))),EE=C.lazy(()=>tt(()=>Promise.resolve().then(()=>BL),void 0).then(t=>({default:t.SettingsPage}))),jE=C.lazy(()=>tt(()=>import("./health-DW8M92nq.js"),__vite__mapDeps([42,1,2,5,6,4,11,7,8,9])).then(t=>({default:t.HealthPage}))),RE=C.lazy(()=>tt(()=>import("./shared-4QlIu64T.js"),__vite__mapDeps([43,1,2,4,5,6,7,8,9])).then(t=>({default:t.SharedPage}))),OE=C.lazy(()=>tt(()=>import("./updates-DBkXWRpR.js"),__vite__mapDeps([44,1,2,4,5,6,7,8,9])).then(t=>({default:t.UpdatesPage}))),IE=null;function Bt(){return l.jsx("div",{className:"flex h-64 items-center justify-center",children:l.jsx(An,{className:"h-8 w-8 animate-spin text-muted-foreground"})})}function _E(){return l.jsx(G0,{client:xk,children:l.jsx(pA,{defaultTheme:"system",storageKey:"vite-ui-theme",children:l.jsx(gA,{children:l.jsx(xA,{children:l.jsxs(B0,{children:[l.jsxs(F0,{children:[l.jsx(Ct,{path:"/login",element:l.jsx(vE,{})}),l.jsx(Ct,{element:l.jsx(CA,{}),children:l.jsxs(Ct,{element:l.jsx(LN,{}),children:[l.jsx(Ct,{path:"/",element:l.jsx(nM,{})}),l.jsx(Ct,{path:"/analytics",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(xE,{})})}),l.jsx(Ct,{path:"/updates",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(OE,{})})}),l.jsx(Ct,{path:"/providers",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(CE,{})})}),l.jsx(Ct,{path:"/cliproxy",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(SE,{})})}),l.jsx(Ct,{path:"/cliproxy/ai-providers",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(wE,{})})}),l.jsx(Ct,{path:"/cliproxy/control-panel",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(kE,{})})}),l.jsx(Ct,{path:"/copilot",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(AE,{})})}),l.jsx(Ct,{path:"/cursor",element:l.jsx(Kb,{to:"/cliproxy?provider=cursor",replace:!0})}),l.jsx(Ct,{path:"/legacy/cursor",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(DE,{})})}),l.jsx(Ct,{path:"/claude-extension",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(NE,{})})}),l.jsx(Ct,{path:"/codex",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(TE,{})})}),l.jsx(Ct,{path:"/droid",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(PE,{})})}),l.jsx(Ct,{path:"/accounts",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(LE,{})})}),l.jsx(Ct,{path:"/settings",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(EE,{})})}),l.jsx(Ct,{path:"/health",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(jE,{})})}),l.jsx(Ct,{path:"/logs",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(ME,{})})}),l.jsx(Ct,{path:"/shared",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(RE,{})})}),IE]})})]}),l.jsx(V0,{position:"top-right"})]})})})})})}const Qx=document.getElementById("root");if(!Qx)throw new Error("Root element not found. Failed to mount React application.");yk.createRoot(Qx).render(l.jsx(C.StrictMode,{children:l.jsx(_E,{})}));export{qj as $,sM as A,Et as B,QM as C,fM as D,_j as E,Hj as F,iM as G,dM as H,Bn as I,pM as J,Uj as K,qt as L,AD as M,DD as N,ND as O,bv as P,px as Q,Ih as R,$e as S,wa as T,El as U,Xd as V,ie as W,Fj as X,He as Y,Bj as Z,JM as _,ye as a,oj as a$,Kj as a0,Gj as a1,Vj as a2,Yj as a3,Wj as a4,Qj as a5,yx as a6,$j as a7,nL as a8,Th as a9,Zj as aA,eR as aB,Jj as aC,GD as aD,Dj as aE,Ay as aF,MM as aG,Xj as aH,bM as aI,wx as aJ,NT as aK,qT as aL,Pi as aM,yN as aN,bN as aO,vN as aP,xN as aQ,hT as aR,Rv as aS,uj as aT,dj as aU,hj as aV,fj as aW,rR as aX,$E as aY,kD as aZ,ij as a_,Ph as aa,YE as ab,vD as ac,XE as ad,nj as ae,sj as af,lj as ag,yh as ah,bh as ai,vh as aj,xh as ak,Ch as al,tR as am,iL as an,nR as ao,Li as ap,Pj as aq,jr as ar,Mj as as,Gd as at,cj as au,Lj as av,Ej as aw,Rj as ax,Dy as ay,jj as az,ZM as b,xD as b0,CD as b1,rj as b2,SD as b3,wD as b4,aj as b5,Ah as b6,Tj as b7,Cj as b8,wj as b9,Nj as bA,dv as bB,Zk as bC,Xk as bD,zd as bE,Ni as bF,qk as bG,Gk as bH,Qk as bI,tA as bJ,bj as bK,JE as bL,ZE as bM,ej as bN,tj as bO,gj as bP,mj as bQ,xj as bR,vj as bS,xl as bT,kj as ba,Sj as bb,Dx as bc,Uh as bd,Aj as be,Er as bf,WE as bg,QE as bh,zr as bi,Ll as bj,Br as bk,sR as bl,Rh as bm,Vr as bn,Oh as bo,WP as bp,ZP as bq,Oj as br,Ij as bs,Tx as bt,OL as bu,_L as bv,yj as bw,pj as bx,XD as by,JD as bz,z as c,st as d,aR as e,iR as f,oL as g,yE as h,VE as i,$M as j,XM as k,gT as l,mT as m,Lo as n,oR as o,ka as p,Aa as q,Pv as r,Dh as s,Mv as t,ch as u,Nh as v,Hr as w,$y as x,yM as y,zj as z};
|
|
72
|
+
`);return{valid:!1,error:r,line:h.length}}return{valid:!1,error:r}}}function LL(t){if(!t.trim())return{valid:!0};try{return NL(t),{valid:!0}}catch(a){const o=a.message,r=o.match(/line\s+(\d+)/i);return{valid:!1,error:o,line:r?Number.parseInt(r[1],10):void 0}}}function Dx({value:t,onChange:a,language:o="json",readonly:r=!1,className:c,minHeight:d="300px",heightMode:h="content"}){const{isDark:p}=mh(),{t:g}=ye(),[m,S]=C.useState(!1),[b,x]=C.useState(!0),T=h==="fill-parent",w=C.useMemo(()=>o==="json"?ML(t):o==="toml"?LL(t):{valid:!0},[t,o]),M=C.useCallback(j=>l.jsx(hk,{prism:hL,theme:p?Xm.nightOwl:Xm.github,code:j,language:o,children:({tokens:E,getLineProps:D,getTokenProps:N})=>{let A=!1;return l.jsx(l.Fragment,{children:E.map((P,k)=>l.jsx("div",{...D({line:P}),className:z(w.line===k+1&&"bg-destructive/20"),children:P.map((O,U)=>{let _=!1;if(O.types.includes("property")){const ee=O.content.replace(/['"]/g,"");PL(ee)?A=!0:A=!1}else(O.types.includes("string")||O.types.includes("number")||O.types.includes("boolean"))&&A?(_=!0,A=!1):O.types.includes("punctuation")&&O.content!==":"&&O.content!=="["&&O.content!=="{"&&(A=!1);const K=N({token:O});return _&&b&&(K.className=z(K.className,"blur-[3px] select-none opacity-70 transition-all duration-200")),l.jsx("span",{...K},U)})},k))})}}),[p,o,w.line,b]);return l.jsxs("div",{className:z("flex min-h-0 flex-col",T&&"h-full",c),style:T?{height:d==="auto"?void 0:d}:void 0,children:[l.jsxs("div",{className:z("relative rounded-md border overflow-hidden","bg-muted/30",T&&"flex min-h-0 flex-1 flex-col",m&&"ring-2 ring-ring ring-offset-2 ring-offset-background",r&&"opacity-70 cursor-not-allowed",!w.valid&&"border-destructive"),"data-slot":"code-editor-surface",children:[l.jsx("div",{className:z(T&&"scrollbar-editor min-h-0 flex-1 overflow-auto"),"data-slot":T?"code-editor-viewport":void 0,children:l.jsx(cL,{value:t,onValueChange:r?()=>{}:a,highlight:M,padding:12,disabled:r,onFocus:()=>S(!0),onBlur:()=>S(!1),textareaClassName:z("focus:outline-none font-mono text-sm",r&&"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(st,{variant:"ghost",size:"icon",className:"h-6 w-6 bg-background/50 hover:bg-background border shadow-sm rounded-full",onClick:()=>x(!b),title:g(b?"codeEditor.revealSensitive":"codeEditor.maskSensitive"),children:b?l.jsx($r,{className:"h-3 w-3"}):l.jsx(Qr,{className:"h-3 w-3"})})})]}),l.jsxs("div",{className:"flex items-center gap-2 mt-2 text-xs",children:[w.valid?l.jsxs("span",{className:"flex items-center gap-1 text-muted-foreground",children:[l.jsx(Xr,{className:"w-3 h-3 text-green-500"}),g("codeEditor.valid",{language:o.toUpperCase()})]}):l.jsxs("span",{className:"flex items-center gap-1 text-destructive",children:[l.jsx(Kr,{className:"w-3 h-3"}),w.error,w.line&&` (line ${w.line})`]}),r&&l.jsx("span",{className:"ml-auto text-muted-foreground",children:g("codeEditor.readOnly")})]})]})}const Zl=Object.freeze(Object.defineProperty({__proto__:null,CodeEditor:Dx},Symbol.toStringTag,{value:"Module"})),EL={browserConfig:null,browserStatus:null,browserLoading:!0,browserStatusLoading:!0,browserSaving:!1,browserError:null,browserSuccess:!1,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 jL(t,a){switch(a.type){case"SET_BROWSER_CONFIG":return{...t,browserConfig:a.payload};case"SET_BROWSER_STATUS":return{...t,browserStatus:a.payload};case"SET_BROWSER_LOADING":return{...t,browserLoading:a.payload};case"SET_BROWSER_STATUS_LOADING":return{...t,browserStatusLoading:a.payload};case"SET_BROWSER_SAVING":return{...t,browserSaving:a.payload};case"SET_BROWSER_ERROR":return{...t,browserError:a.payload};case"SET_BROWSER_SUCCESS":return{...t,browserSuccess:a.payload};case"SET_WEBSEARCH_CONFIG":return{...t,webSearchConfig:a.payload};case"SET_WEBSEARCH_STATUS":return{...t,webSearchStatus:a.payload};case"SET_WEBSEARCH_LOADING":return{...t,webSearchLoading:a.payload};case"SET_WEBSEARCH_STATUS_LOADING":return{...t,webSearchStatusLoading:a.payload};case"SET_WEBSEARCH_SAVING":return{...t,webSearchSaving:a.payload};case"SET_WEBSEARCH_ERROR":return{...t,webSearchError:a.payload};case"SET_WEBSEARCH_SUCCESS":return{...t,webSearchSuccess:a.payload};case"SET_GLOBALENV_CONFIG":return{...t,globalEnvConfig:a.payload};case"SET_GLOBALENV_LOADING":return{...t,globalEnvLoading:a.payload};case"SET_GLOBALENV_SAVING":return{...t,globalEnvSaving:a.payload};case"SET_GLOBALENV_ERROR":return{...t,globalEnvError:a.payload};case"SET_GLOBALENV_SUCCESS":return{...t,globalEnvSuccess:a.payload};case"SET_PROXY_CONFIG":return{...t,proxyConfig:a.payload};case"SET_PROXY_LOADING":return{...t,proxyLoading:a.payload};case"SET_PROXY_SAVING":return{...t,proxySaving:a.payload};case"SET_PROXY_ERROR":return{...t,proxyError:a.payload};case"SET_PROXY_SUCCESS":return{...t,proxySuccess:a.payload};case"SET_PROXY_TEST_RESULT":return{...t,proxyTestResult:a.payload};case"SET_PROXY_TESTING":return{...t,proxyTesting:a.payload};case"SET_RAW_CONFIG":return{...t,rawConfig:a.payload};case"SET_RAW_CONFIG_LOADING":return{...t,rawConfigLoading:a.payload};default:return t}}const Nx=C.createContext(null);function RL({children:t}){const[a,o]=C.useReducer(jL,EL);return l.jsx(Nx.Provider,{value:{state:a,dispatch:o},children:t})}function Tx(){const t=C.useContext(Nx);if(!t)throw new Error("useSettingsContext must be used within a SettingsProvider");return t}function OL(){const{dispatch:t}=Tx(),a=C.useCallback($=>t({type:"SET_BROWSER_CONFIG",payload:$}),[t]),o=C.useCallback($=>t({type:"SET_BROWSER_STATUS",payload:$}),[t]),r=C.useCallback($=>t({type:"SET_BROWSER_LOADING",payload:$}),[t]),c=C.useCallback($=>t({type:"SET_BROWSER_STATUS_LOADING",payload:$}),[t]),d=C.useCallback($=>t({type:"SET_BROWSER_SAVING",payload:$}),[t]),h=C.useCallback($=>t({type:"SET_BROWSER_ERROR",payload:$}),[t]),p=C.useCallback($=>t({type:"SET_BROWSER_SUCCESS",payload:$}),[t]),g=C.useCallback($=>t({type:"SET_WEBSEARCH_CONFIG",payload:$}),[t]),m=C.useCallback($=>t({type:"SET_WEBSEARCH_STATUS",payload:$}),[t]),S=C.useCallback($=>t({type:"SET_WEBSEARCH_LOADING",payload:$}),[t]),b=C.useCallback($=>t({type:"SET_WEBSEARCH_STATUS_LOADING",payload:$}),[t]),x=C.useCallback($=>t({type:"SET_WEBSEARCH_SAVING",payload:$}),[t]),T=C.useCallback($=>t({type:"SET_WEBSEARCH_ERROR",payload:$}),[t]),w=C.useCallback($=>t({type:"SET_WEBSEARCH_SUCCESS",payload:$}),[t]),M=C.useCallback($=>t({type:"SET_GLOBALENV_CONFIG",payload:$}),[t]),j=C.useCallback($=>t({type:"SET_GLOBALENV_LOADING",payload:$}),[t]),E=C.useCallback($=>t({type:"SET_GLOBALENV_SAVING",payload:$}),[t]),D=C.useCallback($=>t({type:"SET_GLOBALENV_ERROR",payload:$}),[t]),N=C.useCallback($=>t({type:"SET_GLOBALENV_SUCCESS",payload:$}),[t]),A=C.useCallback($=>t({type:"SET_PROXY_CONFIG",payload:$}),[t]),P=C.useCallback($=>t({type:"SET_PROXY_LOADING",payload:$}),[t]),k=C.useCallback($=>t({type:"SET_PROXY_SAVING",payload:$}),[t]),O=C.useCallback($=>t({type:"SET_PROXY_ERROR",payload:$}),[t]),U=C.useCallback($=>t({type:"SET_PROXY_SUCCESS",payload:$}),[t]),_=C.useCallback($=>t({type:"SET_PROXY_TEST_RESULT",payload:$}),[t]),K=C.useCallback($=>t({type:"SET_PROXY_TESTING",payload:$}),[t]),ee=C.useCallback($=>t({type:"SET_RAW_CONFIG",payload:$}),[t]),Y=C.useCallback($=>t({type:"SET_RAW_CONFIG_LOADING",payload:$}),[t]);return C.useMemo(()=>({setBrowserConfig:a,setBrowserStatus:o,setBrowserLoading:r,setBrowserStatusLoading:c,setBrowserSaving:d,setBrowserError:h,setBrowserSuccess:p,setWebSearchConfig:g,setWebSearchStatus:m,setWebSearchLoading:S,setWebSearchStatusLoading:b,setWebSearchSaving:x,setWebSearchError:T,setWebSearchSuccess:w,setGlobalEnvConfig:M,setGlobalEnvLoading:j,setGlobalEnvSaving:E,setGlobalEnvError:D,setGlobalEnvSuccess:N,setProxyConfig:A,setProxyLoading:P,setProxySaving:k,setProxyError:O,setProxySuccess:U,setProxyTestResult:_,setProxyTesting:K,setRawConfig:ee,setRawConfigLoading:Y}),[a,o,r,c,d,h,p,g,m,S,b,x,T,w,M,j,E,D,N,A,P,k,O,U,_,K,ee,Y])}function IL(){const[t,a]=Vb(),o=t.get("tab")?.toLowerCase(),r=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=C.useCallback(d=>{a({tab:d},{replace:!0})},[a]);return{activeTab:r,setActiveTab:c}}function _L(){const{state:t}=Tx(),a=OL(),[o,r]=C.useState(!1),c=C.useCallback(async()=>{try{a.setRawConfigLoading(!0);const h=await fetch("/api/config/raw");if(!h.ok){a.setRawConfig(null);return}const p=await h.text();a.setRawConfig(p)}catch{a.setRawConfig(null)}finally{a.setRawConfigLoading(!1)}},[a]),d=C.useCallback(async()=>{if(t.rawConfig)try{await navigator.clipboard.writeText(t.rawConfig),r(!0),setTimeout(()=>r(!1),2e3)}catch{}},[t.rawConfig]);return{rawConfig:t.rawConfig,loading:t.rawConfigLoading,copied:o,fetchRawConfig:c,copyToClipboard:d}}function ob({activeTab:t,onTabChange:a}){const{t:o}=ye(),r=[{value:"browser",label:o("settingsTabs.browser"),icon:xw},{value:"websearch",label:o("settingsTabs.web"),icon:nv},{value:"image",label:o("settingsTabs.image"),icon:ov},{value:"channels",label:o("settingsTabs.channels"),icon:Cw},{value:"globalenv",label:o("settingsTabs.env"),icon:sh},{value:"thinking",label:o("settingsTabs.think"),icon:Sw},{value:"proxy",label:o("settingsTabs.proxy"),icon:ww},{value:"auth",label:o("settingsTabs.auth"),icon:ih},{value:"backups",label:o("settingsTabs.backup"),icon:kw}];return l.jsx(px,{value:t,onValueChange:c=>a(c),children:l.jsx(Ih,{className:"grid w-full grid-cols-9",children:r.map(({value:c,label:d,icon:h})=>l.jsxs(El,{value:c,className:"gap-1.5 px-2 text-xs",children:[l.jsx(h,{className:"h-3.5 w-3.5 shrink-0"}),l.jsx("span",{className:"truncate",children:d})]},c))})})}function rb(){return l.jsxs("div",{className:"flex-1 p-5 space-y-6",children:[l.jsx($e,{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($e,{className:"h-5 w-32"}),l.jsx($e,{className:"h-4 w-48"})]}),l.jsx($e,{className:"h-6 w-10 rounded-full"})]})}),l.jsxs("div",{className:"space-y-3",children:[l.jsx($e,{className:"h-5 w-24"}),l.jsxs("div",{className:"space-y-2",children:[l.jsx($e,{className:"h-20 w-full rounded-lg"}),l.jsx($e,{className:"h-20 w-full rounded-lg"}),l.jsx($e,{className:"h-20 w-full rounded-lg"})]})]})]})}function Px(t,a=3,o=1e3){return t().catch(r=>{if(a<=0)throw r;return new Promise(c=>setTimeout(c,o)).then(()=>Px(t,a-1,o*2))})}function Na(t){return C.lazy(()=>Px(t))}const sb=Na(()=>tt(()=>import("./index-0n_43sCZ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),lb=Na(()=>tt(()=>import("./index-Cj7EjEq6.js"),__vite__mapDeps([10,1,2,11,4,5,6,7,8,9]))),cb=Na(()=>tt(()=>import("./index-Ba4ysocb.js"),__vite__mapDeps([12,1,2,4,5,6,7,8,9]))),ub=Na(()=>tt(()=>import("./channels-BVftYfOn.js"),__vite__mapDeps([13,1,2,4,5,6,7,8,9]))),db=Na(()=>tt(()=>import("./globalenv-section-DpJ7unxC.js"),__vite__mapDeps([14,1,2,4,5,6,7,8,9]))),hb=Na(()=>tt(()=>import("./index-DOC7_hun.js"),__vite__mapDeps([15,1,2,4,5,6,7,8,9]))),fb=Na(()=>tt(()=>import("./index-0GkznW41.js"),__vite__mapDeps([16,1,2,17,4,18,19,5,6,20,7,8,9]))),pb=Na(()=>tt(()=>import("./auth-section-D4MZkgcP.js"),__vite__mapDeps([21,1,2,4,5,6,7,8,9]))),gb=Na(()=>tt(()=>import("./backups-section-DvMJrmHH.js"),__vite__mapDeps([22,1,2,19,4,5,6,7,8,9])));class mb extends C.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(Kr,{className:"w-12 h-12 mx-auto mb-4 text-destructive"}),l.jsx("p",{className:"font-medium text-foreground mb-2",children:ie.t("settings.sectionLoadFailed")}),l.jsx("p",{className:"text-sm mb-4",children:this.state.error?.message||ie.t("settings.unknownError")}),l.jsxs(st,{variant:"outline",onClick:()=>window.location.reload(),className:"inline-flex items-center gap-2",children:[l.jsx(qr,{className:"w-4 h-4"}),ie.t("settings.reloadPage")]})]})}):this.props.children}}function UL(t){switch(t?.toLowerCase()){case"browser":return"browser";case"imageanalysis":case"image":return"image";case"channels":return"channels";case"globalenv":return"globalenv";case"proxy":return"proxy";case"auth":return"auth";case"thinking":return"thinking";case"backups":return"backups";default:return"websearch"}}function HL(){const{t}=ye(),{setActiveTab:a}=IL(),[o]=Vb(),r=UL(o.get("tab")),{rawConfig:c,loading:d,copied:h,fetchRawConfig:p,copyToClipboard:g}=_L();C.useEffect(()=>{p()},[p]);const m=S=>{C.startTransition(()=>{a(S)})};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(ob,{activeTab:r,onTabChange:m})}),l.jsx(mb,{children:l.jsxs(C.Suspense,{fallback:l.jsx(rb,{}),children:[r==="browser"&&l.jsx(lb,{}),r==="websearch"&&l.jsx(sb,{}),r==="image"&&l.jsx(cb,{}),r==="channels"&&l.jsx(ub,{}),r==="globalenv"&&l.jsx(db,{}),r==="thinking"&&l.jsx(hb,{}),r==="proxy"&&l.jsx(fb,{}),r==="auth"&&l.jsx(pb,{}),r==="backups"&&l.jsx(gb,{})]})})]}),l.jsxs(Rh,{direction:"horizontal",className:"h-full hidden md:flex",children:[l.jsx(Vr,{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(ob,{activeTab:r,onTabChange:m})}),l.jsx(mb,{children:l.jsxs(C.Suspense,{fallback:l.jsx(rb,{}),children:[r==="browser"&&l.jsx(lb,{}),r==="websearch"&&l.jsx(sb,{}),r==="image"&&l.jsx(cb,{}),r==="channels"&&l.jsx(ub,{}),r==="globalenv"&&l.jsx(db,{}),r==="thinking"&&l.jsx(hb,{}),r==="proxy"&&l.jsx(fb,{}),r==="auth"&&l.jsx(pb,{}),r==="backups"&&l.jsx(gb,{})]})})]})}),l.jsx(Oh,{className:"w-2 bg-border hover:bg-primary/20 transition-colors cursor-col-resize flex items-center justify-center group",children:l.jsx(_l,{className:"w-3 h-3 text-muted-foreground group-hover:text-primary"})}),l.jsx(Vr,{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(Gm,{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(st,{variant:"outline",size:"sm",onClick:g,disabled:!c,children:h?l.jsxs(l.Fragment,{children:[l.jsx(No,{className:"w-4 h-4 mr-1"}),t("settings.copied")]}):l.jsxs(l.Fragment,{children:[l.jsx(Al,{className:"w-4 h-4 mr-1"}),t("settings.copy")]})}),l.jsx(st,{variant:"outline",size:"sm",onClick:p,disabled:d,children:l.jsx(qr,{className:`w-4 h-4 ${d?"animate-spin":""}`})})]})]}),l.jsx("div",{className:"flex-1 overflow-auto",children:c?l.jsx(Dx,{value:c,onChange:()=>{},language:"yaml",readonly:!0,minHeight:"auto",className:"min-h-full"}):d?l.jsxs("div",{className:"flex items-center justify-center h-full text-muted-foreground",children:[l.jsx(qr,{className:"w-5 h-5 animate-spin mr-2"}),t("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(Gm,{className:"w-12 h-12 mx-auto mb-3 opacity-30"}),l.jsx("p",{children:t("settings.configFileNotFound")}),l.jsx("code",{className:"text-sm bg-muted px-2 py-1 rounded mt-2 inline-block",children:"ccs migrate"})]})})})]})})]})]})}function zL(){return l.jsx(RL,{children:l.jsx(HL,{})})}const BL=Object.freeze(Object.defineProperty({__proto__:null,SettingsPage:zL},Symbol.toStringTag,{value:"Module"}));function FL(t,a,o="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:t,timeZoneName:o}).format(a).split(/\s/g).slice(2).join(" ")}const qL={},Ir={};function Ai(t,a){try{const r=(qL[t]||=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"longOffset"}).format)(a).split("GMT")[1];return r in Ir?Ir[r]:yb(r,r.split(":"))}catch{if(t in Ir)return Ir[t];const o=t?.match(KL);return o?yb(t,o.slice(1)):NaN}}const KL=/([+-]\d\d):?(\d\d)?/;function yb(t,a){const o=+(a[0]||0),r=+(a[1]||0),c=+(a[2]||0)/60;return Ir[t]=o*60+r>0?o*60+r+c:o*60-r-c}class Kn extends Date{constructor(...a){super(),a.length>1&&typeof a[a.length-1]=="string"&&(this.timeZone=a.pop()),this.internal=new Date,isNaN(Ai(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)),Mx(this),th(this)):this.setTime(Date.now())}static tz(a,...o){return o.length?new Kn(...o,a):new Kn(Date.now(),a)}withTimeZone(a){return new Kn(+this,a)}getTimezoneOffset(){const a=-Ai(this.timeZone,this);return a>0?Math.floor(a):Math.ceil(a)}setTime(a){return Date.prototype.setTime.apply(this,arguments),th(this),+this}[Symbol.for("constructDateFrom")](a){return new Kn(+new Date(a),this.timeZone)}}const bb=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!bb.test(t))return;const a=t.replace(bb,"$1UTC");Kn.prototype[a]&&(t.startsWith("get")?Kn.prototype[t]=function(){return this.internal[a]()}:(Kn.prototype[t]=function(){return Date.prototype[a].apply(this.internal,arguments),GL(this),+this},Kn.prototype[a]=function(){return Date.prototype[a].apply(this,arguments),th(this),+this}))});function th(t){t.internal.setTime(+t),t.internal.setUTCSeconds(t.internal.getUTCSeconds()-Math.round(-Ai(t.timeZone,t)*60))}function GL(t){Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),Mx(t)}function Mx(t){const a=Ai(t.timeZone,t),o=a>0?Math.floor(a):Math.ceil(a),r=new Date(+t);r.setUTCHours(r.getUTCHours()-1);const c=-new Date(+t).getTimezoneOffset(),d=-new Date(+r).getTimezoneOffset(),h=c-d,p=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();h&&p&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+h);const g=c-o;g&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+g);const m=new Date(+t);m.setUTCSeconds(0);const S=c>0?m.getSeconds():(m.getSeconds()-60)%60,b=Math.round(-(Ai(t.timeZone,t)*60))%60;(b||S)&&(t.internal.setUTCSeconds(t.internal.getUTCSeconds()+b),Date.prototype.setUTCSeconds.call(t,Date.prototype.getUTCSeconds.call(t)+b+S));const x=Ai(t.timeZone,t),T=x>0?Math.floor(x):Math.ceil(x),M=-new Date(+t).getTimezoneOffset()-T,j=T!==o,E=M-g;if(j&&E){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+E);const D=Ai(t.timeZone,t),N=D>0?Math.floor(D):Math.ceil(D),A=T-N;A&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+A),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+A))}}class va extends Kn{static tz(a,...o){return o.length?new va(...o,a):new va(Date.now(),a)}toISOString(){const[a,o,r]=this.tzComponents(),c=`${a}${o}:${r}`;return this.internal.toISOString().slice(0,-1)+c}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[a,o,r,c]=this.internal.toUTCString().split(" ");return`${a?.slice(0,-1)} ${r} ${o} ${c}`}toTimeString(){const a=this.internal.toUTCString().split(" ")[4],[o,r,c]=this.tzComponents();return`${a} GMT${o}${r}${c} (${FL(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?"-":"+",r=String(Math.floor(Math.abs(a)/60)).padStart(2,"0"),c=String(Math.abs(a)%60).padStart(2,"0");return[o,r,c]}withTimeZone(a){return new va(+this,a)}[Symbol.for("constructDateFrom")](a){return new va(+new Date(a),this.timeZone)}}const vb=5,VL=4;function YL(t,a){const o=a.startOfMonth(t),r=o.getDay()>0?o.getDay():7,c=a.addDays(t,-r+1),d=a.addDays(c,vb*7-1);return a.getMonth(t)===a.getMonth(d)?vb:VL}function Lx(t,a){const o=a.startOfMonth(t),r=o.getDay();return r===1?o:r===0?a.addDays(o,-6):a.addDays(o,-1*(r-1))}function WL(t,a){const o=Lx(t,a),r=YL(t,a);return a.addDays(o,r*7-1)}const Ex={...Nr,labels:{labelDayButton:(t,a,o,r)=>{let c;r&&typeof r.format=="function"?c=r.format.bind(r):c=(h,p)=>Lr(h,p,{locale:Nr,...o});let d=c(t,"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:t=>`Week ${t}`,labelYearDropdown:"Choose the Year",labelGrid:(t,a,o)=>{let r;return o&&typeof o.format=="function"?r=o.format.bind(o):r=(c,d)=>Lr(c,d,{locale:Nr,...a}),r(t,"LLLL yyyy")},labelGridcell:(t,a,o,r)=>{let c;r&&typeof r.format=="function"?c=r.format.bind(r):c=(h,p)=>Lr(h,p,{locale:Nr,...o});let d=c(t,"PPPP");return a?.today&&(d=`Today, ${d}`),d},labelNav:"Navigation bar",labelWeekNumberHeader:"Week Number",labelWeekday:(t,a,o)=>{let r;return o&&typeof o.format=="function"?r=o.format.bind(o):r=(c,d)=>Lr(c,d,{locale:Nr,...a}),r(t,"cccc")}}};class fn{constructor(a,o){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?va.tz(this.options.timeZone):new this.Date,this.newDate=(r,c,d)=>this.overrides?.newDate?this.overrides.newDate(r,c,d):this.options.timeZone?new va(r,c,d,this.options.timeZone):new Date(r,c,d),this.addDays=(r,c)=>this.overrides?.addDays?this.overrides.addDays(r,c):Pw(r,c),this.addMonths=(r,c)=>this.overrides?.addMonths?this.overrides.addMonths(r,c):Mw(r,c),this.addWeeks=(r,c)=>this.overrides?.addWeeks?this.overrides.addWeeks(r,c):Lw(r,c),this.addYears=(r,c)=>this.overrides?.addYears?this.overrides.addYears(r,c):Ew(r,c),this.differenceInCalendarDays=(r,c)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,c):jw(r,c),this.differenceInCalendarMonths=(r,c)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,c):Rw(r,c),this.eachMonthOfInterval=r=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):Ow(r),this.eachYearOfInterval=r=>{const c=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(r):Iw(r),d=new Set(c.map(p=>this.getYear(p)));if(d.size===c.length)return c;const h=[];return d.forEach(p=>{h.push(new Date(p,0,1))}),h},this.endOfBroadcastWeek=r=>this.overrides?.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(r):WL(r,this),this.endOfISOWeek=r=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(r):_w(r),this.endOfMonth=r=>this.overrides?.endOfMonth?this.overrides.endOfMonth(r):Uw(r),this.endOfWeek=(r,c)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(r,c):Hw(r,this.options),this.endOfYear=r=>this.overrides?.endOfYear?this.overrides.endOfYear(r):zw(r),this.format=(r,c,d)=>{const h=this.overrides?.format?this.overrides.format(r,c,this.options):Lr(r,c,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(h):h},this.getISOWeek=r=>this.overrides?.getISOWeek?this.overrides.getISOWeek(r):Bw(r),this.getMonth=(r,c)=>this.overrides?.getMonth?this.overrides.getMonth(r,this.options):Fw(r,this.options),this.getYear=(r,c)=>this.overrides?.getYear?this.overrides.getYear(r,this.options):qw(r,this.options),this.getWeek=(r,c)=>this.overrides?.getWeek?this.overrides.getWeek(r,this.options):Kw(r,this.options),this.isAfter=(r,c)=>this.overrides?.isAfter?this.overrides.isAfter(r,c):Gw(r,c),this.isBefore=(r,c)=>this.overrides?.isBefore?this.overrides.isBefore(r,c):Vw(r,c),this.isDate=r=>this.overrides?.isDate?this.overrides.isDate(r):Yw(r),this.isSameDay=(r,c)=>this.overrides?.isSameDay?this.overrides.isSameDay(r,c):Ww(r,c),this.isSameMonth=(r,c)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(r,c):Qw(r,c),this.isSameYear=(r,c)=>this.overrides?.isSameYear?this.overrides.isSameYear(r,c):$w(r,c),this.max=r=>this.overrides?.max?this.overrides.max(r):Xw(r),this.min=r=>this.overrides?.min?this.overrides.min(r):Jw(r),this.setMonth=(r,c)=>this.overrides?.setMonth?this.overrides.setMonth(r,c):Zw(r,c),this.setYear=(r,c)=>this.overrides?.setYear?this.overrides.setYear(r,c):ek(r,c),this.startOfBroadcastWeek=(r,c)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):Lx(r,this),this.startOfDay=r=>this.overrides?.startOfDay?this.overrides.startOfDay(r):tk(r),this.startOfISOWeek=r=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(r):nk(r),this.startOfMonth=r=>this.overrides?.startOfMonth?this.overrides.startOfMonth(r):ak(r),this.startOfWeek=(r,c)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(r,this.options):ik(r,this.options),this.startOfYear=r=>this.overrides?.startOfYear?this.overrides.startOfYear(r):ok(r),this.options={locale:Ex,...a},this.overrides=o}getDigitMap(){const{numerals:a="latn"}=this.options,o=new Intl.NumberFormat("en-US",{numberingSystem:a}),r={};for(let c=0;c<10;c++)r[c.toString()]=o.format(c);return r}replaceDigits(a){const o=this.getDigitMap();return a.replace(/\d/g,r=>o[r]||r)}formatNumber(a){return this.replaceDigits(a.toString())}getMonthYearOrder(){const a=this.options.locale?.code;return a&&fn.yearFirstLocales.has(a)?"year-first":"month-first"}formatMonthYear(a){const{locale:o,timeZone:r,numerals:c}=this.options,d=o?.code;if(d&&fn.yearFirstLocales.has(d))try{return new Intl.DateTimeFormat(d,{month:"long",year:"numeric",timeZone:r,numberingSystem:c}).format(a)}catch{}const h=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(a,h)}}fn.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 Yn=new fn;class jx{constructor(a,o,r=Yn){this.date=a,this.displayMonth=o,this.outside=!!(o&&!r.isSameMonth(a,o)),this.dateLib=r,this.isoDate=r.format(a,"yyyy-MM-dd"),this.displayMonthId=r.format(o,"yyyy-MM"),this.dateMonthId=r.format(a,"yyyy-MM")}isEqualTo(a){return this.dateLib.isSameDay(a.date,this.date)&&this.dateLib.isSameMonth(a.displayMonth,this.displayMonth)}}class QL{constructor(a,o){this.date=a,this.weeks=o}}class $L{constructor(a,o){this.days=o,this.weekNumber=a}}function XL(t){return ue.createElement("button",{...t})}function JL(t){return ue.createElement("span",{...t})}function ZL(t){const{size:a=24,orientation:o="left",className:r}=t;return ue.createElement("svg",{className:r,width:a,height:a,viewBox:"0 0 24 24"},o==="up"&&ue.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),o==="down"&&ue.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),o==="left"&&ue.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),o==="right"&&ue.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function e1(t){const{day:a,modifiers:o,...r}=t;return ue.createElement("td",{...r})}function t1(t){const{day:a,modifiers:o,...r}=t,c=ue.useRef(null);return ue.useEffect(()=>{o.focused&&c.current?.focus()},[o.focused]),ue.createElement("button",{ref:c,...r})}var Ce;(function(t){t.Root="root",t.Chevron="chevron",t.Day="day",t.DayButton="day_button",t.CaptionLabel="caption_label",t.Dropdowns="dropdowns",t.Dropdown="dropdown",t.DropdownRoot="dropdown_root",t.Footer="footer",t.MonthGrid="month_grid",t.MonthCaption="month_caption",t.MonthsDropdown="months_dropdown",t.Month="month",t.Months="months",t.Nav="nav",t.NextMonthButton="button_next",t.PreviousMonthButton="button_previous",t.Week="week",t.Weeks="weeks",t.Weekday="weekday",t.Weekdays="weekdays",t.WeekNumber="week_number",t.WeekNumberHeader="week_number_header",t.YearsDropdown="years_dropdown"})(Ce||(Ce={}));var pt;(function(t){t.disabled="disabled",t.hidden="hidden",t.outside="outside",t.focused="focused",t.today="today"})(pt||(pt={}));var En;(function(t){t.range_end="range_end",t.range_middle="range_middle",t.range_start="range_start",t.selected="selected"})(En||(En={}));var hn;(function(t){t.weeks_before_enter="weeks_before_enter",t.weeks_before_exit="weeks_before_exit",t.weeks_after_enter="weeks_after_enter",t.weeks_after_exit="weeks_after_exit",t.caption_after_enter="caption_after_enter",t.caption_after_exit="caption_after_exit",t.caption_before_enter="caption_before_enter",t.caption_before_exit="caption_before_exit"})(hn||(hn={}));function n1(t){const{options:a,className:o,components:r,classNames:c,...d}=t,h=[c[Ce.Dropdown],o].join(" "),p=a?.find(({value:g})=>g===d.value);return ue.createElement("span",{"data-disabled":d.disabled,className:c[Ce.DropdownRoot]},ue.createElement(r.Select,{className:h,...d},a?.map(({value:g,label:m,disabled:S})=>ue.createElement(r.Option,{key:g,value:g,disabled:S},m))),ue.createElement("span",{className:c[Ce.CaptionLabel],"aria-hidden":!0},p?.label,ue.createElement(r.Chevron,{orientation:"down",size:18,className:c[Ce.Chevron]})))}function a1(t){return ue.createElement("div",{...t})}function i1(t){return ue.createElement("div",{...t})}function o1(t){const{calendarMonth:a,displayIndex:o,...r}=t;return ue.createElement("div",{...r},t.children)}function r1(t){const{calendarMonth:a,displayIndex:o,...r}=t;return ue.createElement("div",{...r})}function s1(t){return ue.createElement("table",{...t})}function l1(t){return ue.createElement("div",{...t})}const Rx=C.createContext(void 0);function es(){const t=C.useContext(Rx);if(t===void 0)throw new Error("useDayPicker() must be used within a custom component.");return t}function c1(t){const{components:a}=es();return ue.createElement(a.Dropdown,{...t})}function u1(t){const{onPreviousClick:a,onNextClick:o,previousMonth:r,nextMonth:c,...d}=t,{components:h,classNames:p,labels:{labelPrevious:g,labelNext:m}}=es(),S=C.useCallback(x=>{c&&o?.(x)},[c,o]),b=C.useCallback(x=>{r&&a?.(x)},[r,a]);return ue.createElement("nav",{...d},ue.createElement(h.PreviousMonthButton,{type:"button",className:p[Ce.PreviousMonthButton],tabIndex:r?void 0:-1,"aria-disabled":r?void 0:!0,"aria-label":g(r),onClick:b},ue.createElement(h.Chevron,{disabled:r?void 0:!0,className:p[Ce.Chevron],orientation:"left"})),ue.createElement(h.NextMonthButton,{type:"button",className:p[Ce.NextMonthButton],tabIndex:c?void 0:-1,"aria-disabled":c?void 0:!0,"aria-label":m(c),onClick:S},ue.createElement(h.Chevron,{disabled:c?void 0:!0,orientation:"right",className:p[Ce.Chevron]})))}function d1(t){const{components:a}=es();return ue.createElement(a.Button,{...t})}function h1(t){return ue.createElement("option",{...t})}function f1(t){const{components:a}=es();return ue.createElement(a.Button,{...t})}function p1(t){const{rootRef:a,...o}=t;return ue.createElement("div",{...o,ref:a})}function g1(t){return ue.createElement("select",{...t})}function m1(t){const{week:a,...o}=t;return ue.createElement("tr",{...o})}function y1(t){return ue.createElement("th",{...t})}function b1(t){return ue.createElement("thead",{"aria-hidden":!0},ue.createElement("tr",{...t}))}function v1(t){const{week:a,...o}=t;return ue.createElement("th",{...o})}function x1(t){return ue.createElement("th",{...t})}function C1(t){return ue.createElement("tbody",{...t})}function S1(t){const{components:a}=es();return ue.createElement(a.Dropdown,{...t})}const w1=Object.freeze(Object.defineProperty({__proto__:null,Button:XL,CaptionLabel:JL,Chevron:ZL,Day:e1,DayButton:t1,Dropdown:n1,DropdownNav:a1,Footer:i1,Month:o1,MonthCaption:r1,MonthGrid:s1,Months:l1,MonthsDropdown:c1,Nav:u1,NextMonthButton:d1,Option:h1,PreviousMonthButton:f1,Root:p1,Select:g1,Week:m1,WeekNumber:v1,WeekNumberHeader:x1,Weekday:y1,Weekdays:b1,Weeks:C1,YearsDropdown:S1},Symbol.toStringTag,{value:"Module"}));function xa(t,a,o=!1,r=Yn){let{from:c,to:d}=t;const{differenceInCalendarDays:h,isSameDay:p}=r;return c&&d?(h(d,c)<0&&([c,d]=[d,c]),h(a,c)>=(o?1:0)&&h(d,a)>=(o?1:0)):!o&&d?p(d,a):!o&&c?p(c,a):!1}function Kh(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function ec(t){return!!(t&&typeof t=="object"&&"from"in t)}function Gh(t){return!!(t&&typeof t=="object"&&"after"in t)}function Vh(t){return!!(t&&typeof t=="object"&&"before"in t)}function Ox(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function Ix(t,a){return Array.isArray(t)&&t.every(a.isDate)}function Ca(t,a,o=Yn){const r=Array.isArray(a)?a:[a],{isSameDay:c,differenceInCalendarDays:d,isAfter:h}=o;return r.some(p=>{if(typeof p=="boolean")return p;if(o.isDate(p))return c(t,p);if(Ix(p,o))return p.some(g=>c(t,g));if(ec(p))return xa(p,t,!1,o);if(Ox(p))return Array.isArray(p.dayOfWeek)?p.dayOfWeek.includes(t.getDay()):p.dayOfWeek===t.getDay();if(Kh(p)){const g=d(p.before,t),m=d(p.after,t),S=g>0,b=m<0;return h(p.before,p.after)?b&&S:S||b}return Gh(p)?d(t,p.after)>0:Vh(p)?d(p.before,t)>0:typeof p=="function"?p(t):!1})}function k1(t,a,o,r,c){const{disabled:d,hidden:h,modifiers:p,showOutsideDays:g,broadcastCalendar:m,today:S=c.today()}=a,{isSameDay:b,isSameMonth:x,startOfMonth:T,isBefore:w,endOfMonth:M,isAfter:j}=c,E=o&&T(o),D=r&&M(r),N={[pt.focused]:[],[pt.outside]:[],[pt.disabled]:[],[pt.hidden]:[],[pt.today]:[]},A={};for(const P of t){const{date:k,displayMonth:O}=P,U=!!(O&&!x(k,O)),_=!!(E&&w(k,E)),K=!!(D&&j(k,D)),ee=!!(d&&Ca(k,d,c)),Y=!!(h&&Ca(k,h,c))||_||K||!m&&!g&&U||m&&g===!1&&U,$=b(k,S);U&&N.outside.push(P),ee&&N.disabled.push(P),Y&&N.hidden.push(P),$&&N.today.push(P),p&&Object.keys(p).forEach(fe=>{const pe=p?.[fe];pe&&Ca(k,pe,c)&&(A[fe]?A[fe].push(P):A[fe]=[P])})}return P=>{const k={[pt.focused]:!1,[pt.disabled]:!1,[pt.hidden]:!1,[pt.outside]:!1,[pt.today]:!1},O={};for(const U in N){const _=N[U];k[U]=_.some(K=>K===P)}for(const U in A)O[U]=A[U].some(_=>_===P);return{...k,...O}}}function A1(t,a,o={}){return Object.entries(t).filter(([,c])=>c===!0).reduce((c,[d])=>(o[d]?c.push(o[d]):a[pt[d]]?c.push(a[pt[d]]):a[En[d]]&&c.push(a[En[d]]),c),[a[Ce.Day]])}function D1(t){return{...w1,...t}}function N1(t){const a={"data-mode":t.mode??void 0,"data-required":"required"in t?t.required:void 0,"data-multiple-months":t.numberOfMonths&&t.numberOfMonths>1||void 0,"data-week-numbers":t.showWeekNumber||void 0,"data-broadcast-calendar":t.broadcastCalendar||void 0,"data-nav-layout":t.navLayout||void 0};return Object.entries(t).forEach(([o,r])=>{o.startsWith("data-")&&(a[o]=r)}),a}function T1(){const t={};for(const a in Ce)t[Ce[a]]=`rdp-${Ce[a]}`;for(const a in pt)t[pt[a]]=`rdp-${pt[a]}`;for(const a in En)t[En[a]]=`rdp-${En[a]}`;for(const a in hn)t[hn[a]]=`rdp-${hn[a]}`;return t}function _x(t,a,o){return(o??new fn(a)).formatMonthYear(t)}const P1=_x;function M1(t,a,o){return(o??new fn(a)).format(t,"d")}function L1(t,a=Yn){return a.format(t,"LLLL")}function E1(t,a,o){return(o??new fn(a)).format(t,"cccccc")}function j1(t,a=Yn){return t<10?a.formatNumber(`0${t.toLocaleString()}`):a.formatNumber(`${t.toLocaleString()}`)}function R1(){return""}function Ux(t,a=Yn){return a.format(t,"yyyy")}const O1=Ux,I1=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:_x,formatDay:M1,formatMonthCaption:P1,formatMonthDropdown:L1,formatWeekNumber:j1,formatWeekNumberHeader:R1,formatWeekdayName:E1,formatYearCaption:O1,formatYearDropdown:Ux},Symbol.toStringTag,{value:"Module"}));function _1(t){return t?.formatMonthCaption&&!t.formatCaption&&(t.formatCaption=t.formatMonthCaption),t?.formatYearCaption&&!t.formatYearDropdown&&(t.formatYearDropdown=t.formatYearCaption),{...I1,...t}}function Yh(t,a,o,r){let c=(r??new fn(o)).format(t,"PPPP");return a.today&&(c=`Today, ${c}`),a.selected&&(c=`${c}, selected`),c}const U1=Yh;function Wh(t,a,o){return(o??new fn(a)).formatMonthYear(t)}const H1=Wh;function Hx(t,a,o,r){let c=(r??new fn(o)).format(t,"PPPP");return a?.today&&(c=`Today, ${c}`),c}function zx(t){return"Choose the Month"}function Bx(){return""}const z1="Go to the Next Month";function Fx(t,a){return z1}function qx(t){return"Go to the Previous Month"}function Kx(t,a,o){return(o??new fn(a)).format(t,"cccc")}function Gx(t,a){return`Week ${t}`}function Vx(t){return"Week Number"}function Yx(t){return"Choose the Year"}const B1=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:H1,labelDay:U1,labelDayButton:Yh,labelGrid:Wh,labelGridcell:Hx,labelMonthDropdown:zx,labelNav:Bx,labelNext:Fx,labelPrevious:qx,labelWeekNumber:Gx,labelWeekNumberHeader:Vx,labelWeekday:Kx,labelYearDropdown:Yx},Symbol.toStringTag,{value:"Module"})),Ln=(t,a,o)=>a||(o?typeof o=="function"?o:(...r)=>o:t);function F1(t,a){const o=a.locale?.labels??{};return{...B1,...t??{},labelDayButton:Ln(Yh,t?.labelDayButton,o.labelDayButton),labelMonthDropdown:Ln(zx,t?.labelMonthDropdown,o.labelMonthDropdown),labelNext:Ln(Fx,t?.labelNext,o.labelNext),labelPrevious:Ln(qx,t?.labelPrevious,o.labelPrevious),labelWeekNumber:Ln(Gx,t?.labelWeekNumber,o.labelWeekNumber),labelYearDropdown:Ln(Yx,t?.labelYearDropdown,o.labelYearDropdown),labelGrid:Ln(Wh,t?.labelGrid,o.labelGrid),labelGridcell:Ln(Hx,t?.labelGridcell,o.labelGridcell),labelNav:Ln(Bx,t?.labelNav,o.labelNav),labelWeekNumberHeader:Ln(Vx,t?.labelWeekNumberHeader,o.labelWeekNumberHeader),labelWeekday:Ln(Kx,t?.labelWeekday,o.labelWeekday)}}function q1(t,a,o,r,c){const{startOfMonth:d,startOfYear:h,endOfYear:p,eachMonthOfInterval:g,getMonth:m}=c;return g({start:h(t),end:p(t)}).map(x=>{const T=r.formatMonthDropdown(x,c),w=m(x),M=a&&x<d(a)||o&&x>d(o)||!1;return{value:w,label:T,disabled:M}})}function K1(t,a={},o={}){let r={...a?.[Ce.Day]};return Object.entries(t).filter(([,c])=>c===!0).forEach(([c])=>{r={...r,...o?.[c]}}),r}function G1(t,a,o,r){const c=r??t.today(),d=o?t.startOfBroadcastWeek(c,t):a?t.startOfISOWeek(c):t.startOfWeek(c),h=[];for(let p=0;p<7;p++){const g=t.addDays(d,p);h.push(g)}return h}function V1(t,a,o,r,c=!1){if(!t||!a)return;const{startOfYear:d,endOfYear:h,eachYearOfInterval:p,getYear:g}=r,m=d(t),S=h(a),b=p({start:m,end:S});return c&&b.reverse(),b.map(x=>{const T=o.formatYearDropdown(x,r);return{value:g(x),label:T,disabled:!1}})}const ts=t=>t instanceof HTMLElement?t:null,jd=t=>[...t.querySelectorAll("[data-animated-month]")??[]],Y1=t=>ts(t.querySelector("[data-animated-month]")),Rd=t=>ts(t.querySelector("[data-animated-caption]")),Od=t=>ts(t.querySelector("[data-animated-weeks]")),W1=t=>ts(t.querySelector("[data-animated-nav]")),Q1=t=>ts(t.querySelector("[data-animated-weekdays]"));function $1(t,a,{classNames:o,months:r,focused:c,dateLib:d}){const h=C.useRef(null),p=C.useRef(r),g=C.useRef(!1);C.useLayoutEffect(()=>{const m=p.current;if(p.current=r,!a||!t.current||!(t.current instanceof HTMLElement)||r.length===0||m.length===0||r.length!==m.length)return;const S=d.isSameMonth(r[0].date,m[0].date),b=d.isAfter(r[0].date,m[0].date),x=b?o[hn.caption_after_enter]:o[hn.caption_before_enter],T=b?o[hn.weeks_after_enter]:o[hn.weeks_before_enter],w=h.current,M=t.current.cloneNode(!0);if(M instanceof HTMLElement?(jd(M).forEach(N=>{if(!(N instanceof HTMLElement))return;const A=Y1(N);A&&N.contains(A)&&N.removeChild(A);const P=Rd(N);P&&P.classList.remove(x);const k=Od(N);k&&k.classList.remove(T)}),h.current=M):h.current=null,g.current||S||c)return;const j=w instanceof HTMLElement?jd(w):[],E=jd(t.current);if(E?.every(D=>D instanceof HTMLElement)&&j&&j.every(D=>D instanceof HTMLElement)){g.current=!0,t.current.style.isolation="isolate";const D=W1(t.current);D&&(D.style.zIndex="1"),E.forEach((N,A)=>{const P=j[A];if(!P)return;N.style.position="relative",N.style.overflow="hidden";const k=Rd(N);k&&k.classList.add(x);const O=Od(N);O&&O.classList.add(T);const U=()=>{g.current=!1,t.current&&(t.current.style.isolation=""),D&&(D.style.zIndex=""),k&&k.classList.remove(x),O&&O.classList.remove(T),N.style.position="",N.style.overflow="",N.contains(P)&&N.removeChild(P)};P.style.pointerEvents="none",P.style.position="absolute",P.style.overflow="hidden",P.setAttribute("aria-hidden","true");const _=Q1(P);_&&(_.style.opacity="0");const K=Rd(P);K&&(K.classList.add(b?o[hn.caption_before_exit]:o[hn.caption_after_exit]),K.addEventListener("animationend",U));const ee=Od(P);ee&&ee.classList.add(b?o[hn.weeks_before_exit]:o[hn.weeks_after_exit]),N.insertBefore(P,N.firstChild)})}})}function X1(t,a,o,r){const c=t[0],d=t[t.length-1],{ISOWeek:h,fixedWeeks:p,broadcastCalendar:g}=o??{},{addDays:m,differenceInCalendarDays:S,differenceInCalendarMonths:b,endOfBroadcastWeek:x,endOfISOWeek:T,endOfMonth:w,endOfWeek:M,isAfter:j,startOfBroadcastWeek:E,startOfISOWeek:D,startOfWeek:N}=r,A=g?E(c,r):h?D(c):N(c),P=g?x(d):h?T(w(d)):M(w(d)),k=a&&(g?x(a):h?T(a):M(a)),O=k&&j(P,k)?k:P,U=S(O,A),_=b(d,c)+1,K=[];for(let $=0;$<=U;$++){const fe=m(A,$);K.push(fe)}const Y=(g?35:42)*_;if(p&&K.length<Y){const $=Y-K.length;for(let fe=0;fe<$;fe++){const pe=m(K[K.length-1],1);K.push(pe)}}return K}function J1(t){const a=[];return t.reduce((o,r)=>{const c=r.weeks.reduce((d,h)=>d.concat(h.days.slice()),a.slice());return o.concat(c.slice())},a.slice())}function Z1(t,a,o,r){const{numberOfMonths:c=1}=o,d=[];for(let h=0;h<c;h++){const p=r.addMonths(t,h);if(a&&p>a)break;d.push(p)}return d}function xb(t,a,o,r){const{month:c,defaultMonth:d,today:h=r.today(),numberOfMonths:p=1}=t;let g=c||d||h;const{differenceInCalendarMonths:m,addMonths:S,startOfMonth:b}=r;if(o&&m(o,g)<p-1){const x=-1*(p-1);g=S(o,x)}return a&&m(g,a)<0&&(g=a),b(g)}function eE(t,a,o,r){const{addDays:c,endOfBroadcastWeek:d,endOfISOWeek:h,endOfMonth:p,endOfWeek:g,getISOWeek:m,getWeek:S,startOfBroadcastWeek:b,startOfISOWeek:x,startOfWeek:T}=r,w=t.reduce((M,j)=>{const E=o.broadcastCalendar?b(j,r):o.ISOWeek?x(j):T(j),D=o.broadcastCalendar?d(j):o.ISOWeek?h(p(j)):g(p(j)),N=a.filter(O=>O>=E&&O<=D),A=o.broadcastCalendar?35:42;if(o.fixedWeeks&&N.length<A){const O=a.filter(U=>{const _=A-N.length;return U>D&&U<=c(D,_)});N.push(...O)}const P=N.reduce((O,U)=>{const _=o.ISOWeek?m(U):S(U),K=O.find(Y=>Y.weekNumber===_),ee=new jx(U,j,r);return K?K.days.push(ee):O.push(new $L(_,[ee])),O},[]),k=new QL(j,P);return M.push(k),M},[]);return o.reverseMonths?w.reverse():w}function tE(t,a){let{startMonth:o,endMonth:r}=t;const{startOfYear:c,startOfDay:d,startOfMonth:h,endOfMonth:p,addYears:g,endOfYear:m,newDate:S,today:b}=a,{fromYear:x,toYear:T,fromMonth:w,toMonth:M}=t;!o&&w&&(o=w),!o&&x&&(o=a.newDate(x,0,1)),!r&&M&&(r=M),!r&&T&&(r=S(T,11,31));const j=t.captionLayout==="dropdown"||t.captionLayout==="dropdown-years";return o?o=h(o):x?o=S(x,0,1):!o&&j&&(o=c(g(t.today??b(),-100))),r?r=p(r):T?r=S(T,11,31):!r&&j&&(r=m(t.today??b())),[o&&d(o),r&&d(r)]}function nE(t,a,o,r){if(o.disableNavigation)return;const{pagedNavigation:c,numberOfMonths:d=1}=o,{startOfMonth:h,addMonths:p,differenceInCalendarMonths:g}=r,m=c?d:1,S=h(t);if(!a)return p(S,m);if(!(g(a,t)<d))return p(S,m)}function aE(t,a,o,r){if(o.disableNavigation)return;const{pagedNavigation:c,numberOfMonths:d}=o,{startOfMonth:h,addMonths:p,differenceInCalendarMonths:g}=r,m=c?d??1:1,S=h(t);if(!a)return p(S,-m);if(!(g(S,a)<=0))return p(S,-m)}function iE(t){const a=[];return t.reduce((o,r)=>o.concat(r.weeks.slice()),a.slice())}function tc(t,a){const[o,r]=C.useState(t);return[a===void 0?o:a,r]}function oE(t,a){const[o,r]=tE(t,a),{startOfMonth:c,endOfMonth:d}=a,h=xb(t,o,r,a),[p,g]=tc(h,t.month?h:void 0);C.useEffect(()=>{const A=xb(t,o,r,a);g(A)},[t.timeZone]);const{months:m,weeks:S,days:b,previousMonth:x,nextMonth:T}=C.useMemo(()=>{const A=Z1(p,r,{numberOfMonths:t.numberOfMonths},a),P=X1(A,t.endMonth?d(t.endMonth):void 0,{ISOWeek:t.ISOWeek,fixedWeeks:t.fixedWeeks,broadcastCalendar:t.broadcastCalendar},a),k=eE(A,P,{broadcastCalendar:t.broadcastCalendar,fixedWeeks:t.fixedWeeks,ISOWeek:t.ISOWeek,reverseMonths:t.reverseMonths},a),O=iE(k),U=J1(k),_=aE(p,o,t,a),K=nE(p,r,t,a);return{months:k,weeks:O,days:U,previousMonth:_,nextMonth:K}},[a,p.getTime(),r?.getTime(),o?.getTime(),t.disableNavigation,t.broadcastCalendar,t.endMonth?.getTime(),t.fixedWeeks,t.ISOWeek,t.numberOfMonths,t.pagedNavigation,t.reverseMonths]),{disableNavigation:w,onMonthChange:M}=t,j=A=>S.some(P=>P.days.some(k=>k.isEqualTo(A))),E=A=>{if(w)return;let P=c(A);o&&P<c(o)&&(P=c(o)),r&&P>c(r)&&(P=c(r)),g(P),M?.(P)};return{months:m,weeks:S,days:b,navStart:o,navEnd:r,previousMonth:x,nextMonth:T,goToMonth:E,goToDay:A=>{j(A)||E(A.date)}}}var Fn;(function(t){t[t.Today=0]="Today",t[t.Selected=1]="Selected",t[t.LastFocused=2]="LastFocused",t[t.FocusedModifier=3]="FocusedModifier"})(Fn||(Fn={}));function Cb(t){return!t[pt.disabled]&&!t[pt.hidden]&&!t[pt.outside]}function rE(t,a,o,r){let c,d=-1;for(const h of t){const p=a(h);Cb(p)&&(p[pt.focused]&&d<Fn.FocusedModifier?(c=h,d=Fn.FocusedModifier):r?.isEqualTo(h)&&d<Fn.LastFocused?(c=h,d=Fn.LastFocused):o(h.date)&&d<Fn.Selected?(c=h,d=Fn.Selected):p[pt.today]&&d<Fn.Today&&(c=h,d=Fn.Today))}return c||(c=t.find(h=>Cb(a(h)))),c}function sE(t,a,o,r,c,d,h){const{ISOWeek:p,broadcastCalendar:g}=d,{addDays:m,addMonths:S,addWeeks:b,addYears:x,endOfBroadcastWeek:T,endOfISOWeek:w,endOfWeek:M,max:j,min:E,startOfBroadcastWeek:D,startOfISOWeek:N,startOfWeek:A}=h;let k={day:m,week:b,month:S,year:x,startOfWeek:O=>g?D(O,h):p?N(O):A(O),endOfWeek:O=>g?T(O):p?w(O):M(O)}[t](o,a==="after"?1:-1);return a==="before"&&r?k=j([r,k]):a==="after"&&c&&(k=E([c,k])),k}function Wx(t,a,o,r,c,d,h,p=0){if(p>365)return;const g=sE(t,a,o.date,r,c,d,h),m=!!(d.disabled&&Ca(g,d.disabled,h)),S=!!(d.hidden&&Ca(g,d.hidden,h)),b=g,x=new jx(g,b,h);return!m&&!S?x:Wx(t,a,x,r,c,d,h,p+1)}function lE(t,a,o,r,c){const{autoFocus:d}=t,[h,p]=C.useState(),g=rE(a.days,o,r||(()=>!1),h),[m,S]=C.useState(d?g:void 0);return{isFocusTarget:M=>!!g?.isEqualTo(M),setFocused:S,focused:m,blur:()=>{p(m),S(void 0)},moveFocus:(M,j)=>{if(!m)return;const E=Wx(M,j,m,a.navStart,a.navEnd,t,c);E&&(t.disableNavigation&&!a.days.some(N=>N.isEqualTo(E))||(a.goToDay(E),S(E)))}}}function cE(t,a){const{selected:o,required:r,onSelect:c}=t,[d,h]=tc(o,c?o:void 0),p=c?o:d,{isSameDay:g}=a,m=T=>p?.some(w=>g(w,T))??!1,{min:S,max:b}=t;return{selected:p,select:(T,w,M)=>{let j=[...p??[]];if(m(T)){if(p?.length===S||r&&p?.length===1)return;j=p?.filter(E=>!g(E,T))}else p?.length===b?j=[T]:j=[...j,T];return c||h(j),c?.(j,T,w,M),j},isSelected:m}}function uE(t,a,o=0,r=0,c=!1,d=Yn){const{from:h,to:p}=a||{},{isSameDay:g,isAfter:m,isBefore:S}=d;let b;if(!h&&!p)b={from:t,to:o>0?void 0:t};else if(h&&!p)g(h,t)?o===0?b={from:h,to:t}:c?b={from:h,to:void 0}:b=void 0:S(t,h)?b={from:t,to:h}:b={from:h,to:t};else if(h&&p)if(g(h,t)&&g(p,t))c?b={from:h,to:p}:b=void 0;else if(g(h,t))b={from:h,to:o>0?void 0:t};else if(g(p,t))b={from:t,to:o>0?void 0:t};else if(S(t,h))b={from:t,to:p};else if(m(t,h))b={from:h,to:t};else if(m(t,p))b={from:h,to:t};else throw new Error("Invalid range");if(b?.from&&b?.to){const x=d.differenceInCalendarDays(b.to,b.from);r>0&&x>r?b={from:t,to:void 0}:o>1&&x<o&&(b={from:t,to:void 0})}return b}function dE(t,a,o=Yn){const r=Array.isArray(a)?a:[a];let c=t.from;const d=o.differenceInCalendarDays(t.to,t.from),h=Math.min(d,6);for(let p=0;p<=h;p++){if(r.includes(c.getDay()))return!0;c=o.addDays(c,1)}return!1}function Sb(t,a,o=Yn){return xa(t,a.from,!1,o)||xa(t,a.to,!1,o)||xa(a,t.from,!1,o)||xa(a,t.to,!1,o)}function hE(t,a,o=Yn){const r=Array.isArray(a)?a:[a];if(r.filter(p=>typeof p!="function").some(p=>typeof p=="boolean"?p:o.isDate(p)?xa(t,p,!1,o):Ix(p,o)?p.some(g=>xa(t,g,!1,o)):ec(p)?p.from&&p.to?Sb(t,{from:p.from,to:p.to},o):!1:Ox(p)?dE(t,p.dayOfWeek,o):Kh(p)?o.isAfter(p.before,p.after)?Sb(t,{from:o.addDays(p.after,1),to:o.addDays(p.before,-1)},o):Ca(t.from,p,o)||Ca(t.to,p,o):Gh(p)||Vh(p)?Ca(t.from,p,o)||Ca(t.to,p,o):!1))return!0;const h=r.filter(p=>typeof p=="function");if(h.length){let p=t.from;const g=o.differenceInCalendarDays(t.to,t.from);for(let m=0;m<=g;m++){if(h.some(S=>S(p)))return!0;p=o.addDays(p,1)}}return!1}function fE(t,a){const{disabled:o,excludeDisabled:r,selected:c,required:d,onSelect:h}=t,[p,g]=tc(c,h?c:void 0),m=h?c:p;return{selected:m,select:(x,T,w)=>{const{min:M,max:j}=t,E=x?uE(x,m,M,j,d,a):void 0;return r&&o&&E?.from&&E.to&&hE({from:E.from,to:E.to},o,a)&&(E.from=x,E.to=void 0),h||g(E),h?.(E,x,T,w),E},isSelected:x=>m&&xa(m,x,!1,a)}}function pE(t,a){const{selected:o,required:r,onSelect:c}=t,[d,h]=tc(o,c?o:void 0),p=c?o:d,{isSameDay:g}=a;return{selected:p,select:(b,x,T)=>{let w=b;return!r&&p&&p&&g(b,p)&&(w=void 0),c||h(w),c?.(w,b,x,T),w},isSelected:b=>p?g(p,b):!1}}function gE(t,a){const o=pE(t,a),r=cE(t,a),c=fE(t,a);switch(t.mode){case"single":return o;case"multiple":return r;case"range":return c;default:return}}function Ht(t,a){return t instanceof va&&t.timeZone===a?t:new va(t,a)}function wb(t,a){return typeof t=="boolean"||typeof t=="function"?t:t instanceof Date?Ht(t,a):Array.isArray(t)?t.map(o=>o instanceof Date?Ht(o,a):o):ec(t)?{...t,from:t.from?Ht(t.from,a):t.from,to:t.to?Ht(t.to,a):t.to}:Kh(t)?{before:Ht(t.before,a),after:Ht(t.after,a)}:Gh(t)?{after:Ht(t.after,a)}:Vh(t)?{before:Ht(t.before,a)}:t}function Id(t,a){return t&&(Array.isArray(t)?t.map(o=>wb(o,a)):wb(t,a))}function mE(t){let a=t;const o=a.timeZone;if(o&&(a={...t,timeZone:o},a.today&&(a.today=Ht(a.today,o)),a.month&&(a.month=Ht(a.month,o)),a.defaultMonth&&(a.defaultMonth=Ht(a.defaultMonth,o)),a.startMonth&&(a.startMonth=Ht(a.startMonth,o)),a.endMonth&&(a.endMonth=Ht(a.endMonth,o)),a.mode==="single"&&a.selected?a.selected=Ht(a.selected,o):a.mode==="multiple"&&a.selected?a.selected=a.selected?.map(ve=>Ht(ve,o)):a.mode==="range"&&a.selected&&(a.selected={from:a.selected.from?Ht(a.selected.from,o):a.selected.from,to:a.selected.to?Ht(a.selected.to,o):a.selected.to}),a.disabled!==void 0&&(a.disabled=Id(a.disabled,o)),a.hidden!==void 0&&(a.hidden=Id(a.hidden,o)),a.modifiers)){const ve={};Object.keys(a.modifiers).forEach(Me=>{ve[Me]=Id(a.modifiers?.[Me],o)}),a.modifiers=ve}const{components:r,formatters:c,labels:d,dateLib:h,locale:p,classNames:g}=C.useMemo(()=>{const ve={...Ex,...a.locale},Me=new fn({locale:ve,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:Me,components:D1(a.components),formatters:_1(a.formatters),labels:F1(a.labels,Me.options),locale:ve,classNames:{...T1(),...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:h.today()});const{captionLayout:m,mode:S,navLayout:b,numberOfMonths:x=1,onDayBlur:T,onDayClick:w,onDayFocus:M,onDayKeyDown:j,onDayMouseEnter:E,onDayMouseLeave:D,onNextClick:N,onPrevClick:A,showWeekNumber:P,styles:k}=a,{formatCaption:O,formatDay:U,formatMonthDropdown:_,formatWeekNumber:K,formatWeekNumberHeader:ee,formatWeekdayName:Y,formatYearDropdown:$}=c,fe=oE(a,h),{days:pe,months:H,navStart:Z,navEnd:ne,previousMonth:Q,nextMonth:se,goToMonth:de}=fe,ge=k1(pe,a,Z,ne,h),{isSelected:J,select:ae,selected:he}=gE(a,h)??{},{blur:re,focused:le,isFocusTarget:xe,moveFocus:Pe,setFocused:ze}=lE(a,fe,ge,J??(()=>!1),h),{labelDayButton:Je,labelGridcell:we,labelGrid:Re,labelMonthDropdown:Ve,labelNav:Tt,labelPrevious:jt,labelNext:Wn,labelWeekday:Le,labelWeekNumber:Zt,labelWeekNumberHeader:Rn,labelYearDropdown:en}=d,Ta=C.useMemo(()=>G1(h,a.ISOWeek,a.broadcastCalendar,a.today),[h,a.ISOWeek,a.broadcastCalendar,a.today]),Qn=S!==void 0||w!==void 0,bt=C.useCallback(()=>{Q&&(de(Q),A?.(Q))},[Q,de,A]),tn=C.useCallback(()=>{se&&(de(se),N?.(se))},[de,se,N]),$n=C.useCallback((ve,Me)=>Ae=>{Ae.preventDefault(),Ae.stopPropagation(),ze(ve),!Me.disabled&&(ae?.(ve.date,Me,Ae),w?.(ve.date,Me,Ae))},[ae,w,ze]),ni=C.useCallback((ve,Me)=>Ae=>{ze(ve),M?.(ve.date,Me,Ae)},[M,ze]),On=C.useCallback((ve,Me)=>Ae=>{re(),T?.(ve.date,Me,Ae)},[re,T]),In=C.useCallback((ve,Me)=>Ae=>{const _e={ArrowLeft:[Ae.shiftKey?"month":"day",a.dir==="rtl"?"after":"before"],ArrowRight:[Ae.shiftKey?"month":"day",a.dir==="rtl"?"before":"after"],ArrowDown:[Ae.shiftKey?"year":"week","after"],ArrowUp:[Ae.shiftKey?"year":"week","before"],PageUp:[Ae.shiftKey?"year":"month","before"],PageDown:[Ae.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(_e[Ae.key]){Ae.preventDefault(),Ae.stopPropagation();const[ct,Ne]=_e[Ae.key];Pe(ct,Ne)}j?.(ve.date,Me,Ae)},[Pe,j,a.dir]),Ei=C.useCallback((ve,Me)=>Ae=>{E?.(ve.date,Me,Ae)},[E]),Eo=C.useCallback((ve,Me)=>Ae=>{D?.(ve.date,Me,Ae)},[D]),jo=C.useCallback(ve=>Me=>{const Ae=Number(Me.target.value),_e=h.setMonth(h.startOfMonth(ve),Ae);de(_e)},[h,de]),Xn=C.useCallback(ve=>Me=>{const Ae=Number(Me.target.value),_e=h.setYear(h.startOfMonth(ve),Ae);de(_e)},[h,de]),{className:te,style:Oe}=C.useMemo(()=>({className:[g[Ce.Root],a.className].filter(Boolean).join(" "),style:{...k?.[Ce.Root],...a.style}}),[g,a.className,a.style,k]),ke=N1(a),Ie=C.useRef(null);$1(Ie,!!a.animate,{classNames:g,months:H,focused:le,dateLib:h});const ht={dayPickerProps:a,selected:he,select:ae,isSelected:J,months:H,nextMonth:se,previousMonth:Q,goToMonth:de,getModifiers:ge,components:r,classNames:g,styles:k,labels:d,formatters:c};return ue.createElement(Rx.Provider,{value:ht},ue.createElement(r.Root,{rootRef:a.animate?Ie:void 0,className:te,style:Oe,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"],...ke},ue.createElement(r.Months,{className:g[Ce.Months],style:k?.[Ce.Months]},!a.hideNavigation&&!b&&ue.createElement(r.Nav,{"data-animated-nav":a.animate?"true":void 0,className:g[Ce.Nav],style:k?.[Ce.Nav],"aria-label":Tt(),onPreviousClick:bt,onNextClick:tn,previousMonth:Q,nextMonth:se}),H.map((ve,Me)=>ue.createElement(r.Month,{"data-animated-month":a.animate?"true":void 0,className:g[Ce.Month],style:k?.[Ce.Month],key:Me,displayIndex:Me,calendarMonth:ve},b==="around"&&!a.hideNavigation&&Me===0&&ue.createElement(r.PreviousMonthButton,{type:"button",className:g[Ce.PreviousMonthButton],tabIndex:Q?void 0:-1,"aria-disabled":Q?void 0:!0,"aria-label":jt(Q),onClick:bt,"data-animated-button":a.animate?"true":void 0},ue.createElement(r.Chevron,{disabled:Q?void 0:!0,className:g[Ce.Chevron],orientation:a.dir==="rtl"?"right":"left"})),ue.createElement(r.MonthCaption,{"data-animated-caption":a.animate?"true":void 0,className:g[Ce.MonthCaption],style:k?.[Ce.MonthCaption],calendarMonth:ve,displayIndex:Me},m?.startsWith("dropdown")?ue.createElement(r.DropdownNav,{className:g[Ce.Dropdowns],style:k?.[Ce.Dropdowns]},(()=>{const Ae=m==="dropdown"||m==="dropdown-months"?ue.createElement(r.MonthsDropdown,{key:"month",className:g[Ce.MonthsDropdown],"aria-label":Ve(),classNames:g,components:r,disabled:!!a.disableNavigation,onChange:jo(ve.date),options:q1(ve.date,Z,ne,c,h),style:k?.[Ce.Dropdown],value:h.getMonth(ve.date)}):ue.createElement("span",{key:"month"},_(ve.date,h)),_e=m==="dropdown"||m==="dropdown-years"?ue.createElement(r.YearsDropdown,{key:"year",className:g[Ce.YearsDropdown],"aria-label":en(h.options),classNames:g,components:r,disabled:!!a.disableNavigation,onChange:Xn(ve.date),options:V1(Z,ne,c,h,!!a.reverseYears),style:k?.[Ce.Dropdown],value:h.getYear(ve.date)}):ue.createElement("span",{key:"year"},$(ve.date,h));return h.getMonthYearOrder()==="year-first"?[_e,Ae]:[Ae,_e]})(),ue.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"}},O(ve.date,h.options,h))):ue.createElement(r.CaptionLabel,{className:g[Ce.CaptionLabel],role:"status","aria-live":"polite"},O(ve.date,h.options,h))),b==="around"&&!a.hideNavigation&&Me===x-1&&ue.createElement(r.NextMonthButton,{type:"button",className:g[Ce.NextMonthButton],tabIndex:se?void 0:-1,"aria-disabled":se?void 0:!0,"aria-label":Wn(se),onClick:tn,"data-animated-button":a.animate?"true":void 0},ue.createElement(r.Chevron,{disabled:se?void 0:!0,className:g[Ce.Chevron],orientation:a.dir==="rtl"?"left":"right"})),Me===x-1&&b==="after"&&!a.hideNavigation&&ue.createElement(r.Nav,{"data-animated-nav":a.animate?"true":void 0,className:g[Ce.Nav],style:k?.[Ce.Nav],"aria-label":Tt(),onPreviousClick:bt,onNextClick:tn,previousMonth:Q,nextMonth:se}),ue.createElement(r.MonthGrid,{role:"grid","aria-multiselectable":S==="multiple"||S==="range","aria-label":Re(ve.date,h.options,h)||void 0,className:g[Ce.MonthGrid],style:k?.[Ce.MonthGrid]},!a.hideWeekdays&&ue.createElement(r.Weekdays,{"data-animated-weekdays":a.animate?"true":void 0,className:g[Ce.Weekdays],style:k?.[Ce.Weekdays]},P&&ue.createElement(r.WeekNumberHeader,{"aria-label":Rn(h.options),className:g[Ce.WeekNumberHeader],style:k?.[Ce.WeekNumberHeader],scope:"col"},ee()),Ta.map(Ae=>ue.createElement(r.Weekday,{"aria-label":Le(Ae,h.options,h),className:g[Ce.Weekday],key:String(Ae),style:k?.[Ce.Weekday],scope:"col"},Y(Ae,h.options,h)))),ue.createElement(r.Weeks,{"data-animated-weeks":a.animate?"true":void 0,className:g[Ce.Weeks],style:k?.[Ce.Weeks]},ve.weeks.map(Ae=>ue.createElement(r.Week,{className:g[Ce.Week],key:Ae.weekNumber,style:k?.[Ce.Week],week:Ae},P&&ue.createElement(r.WeekNumber,{week:Ae,style:k?.[Ce.WeekNumber],"aria-label":Zt(Ae.weekNumber,{locale:p}),className:g[Ce.WeekNumber],scope:"row",role:"rowheader"},K(Ae.weekNumber,h)),Ae.days.map(_e=>{const{date:ct}=_e,Ne=ge(_e);if(Ne[pt.focused]=!Ne.hidden&&!!le?.isEqualTo(_e),Ne[En.selected]=J?.(ct)||Ne.selected,ec(he)){const{from:nn,to:Nn}=he;Ne[En.range_start]=!!(nn&&Nn&&h.isSameDay(ct,nn)),Ne[En.range_end]=!!(nn&&Nn&&h.isSameDay(ct,Nn)),Ne[En.range_middle]=xa(he,ct,!0,h)}const zt=K1(Ne,k,a.modifiersStyles),Jn=A1(Ne,g,a.modifiersClassNames),Pt=!Qn&&!Ne.hidden?we(ct,Ne,h.options,h):void 0;return ue.createElement(r.Day,{key:`${_e.isoDate}_${_e.displayMonthId}`,day:_e,modifiers:Ne,className:Jn.join(" "),style:zt,role:"gridcell","aria-selected":Ne.selected||void 0,"aria-label":Pt,"data-day":_e.isoDate,"data-month":_e.outside?_e.dateMonthId:void 0,"data-selected":Ne.selected||void 0,"data-disabled":Ne.disabled||void 0,"data-hidden":Ne.hidden||void 0,"data-outside":_e.outside||void 0,"data-focused":Ne.focused||void 0,"data-today":Ne.today||void 0},!Ne.hidden&&Qn?ue.createElement(r.DayButton,{className:g[Ce.DayButton],style:k?.[Ce.DayButton],type:"button",day:_e,modifiers:Ne,disabled:!Ne.focused&&Ne.disabled||void 0,"aria-disabled":Ne.focused&&Ne.disabled||void 0,tabIndex:xe(_e)?0:-1,"aria-label":Je(ct,Ne,h.options,h),onClick:$n(_e,Ne),onBlur:On(_e,Ne),onFocus:ni(_e,Ne),onKeyDown:In(_e,Ne),onMouseEnter:Ei(_e,Ne),onMouseLeave:Eo(_e,Ne)},U(ct,h.options,h)):!Ne.hidden&&U(_e.date,h.options,h))})))))))),a.footer&&ue.createElement(r.Footer,{className:g[Ce.Footer],style:k?.[Ce.Footer],role:"status","aria-live":"polite"},a.footer)))}function yE({className:t,classNames:a,showOutsideDays:o=!0,...r}){return l.jsx(mE,{showOutsideDays:o,className:z("p-2",t),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:z(xl({variant:"ghost"}),"h-7 w-7 bg-transparent p-0 opacity-70 hover:opacity-100 hover:bg-accent rounded-md"),button_next:z(xl({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:z("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:z(xl({variant:"ghost"}),"h-8 w-8 p-0 font-normal rounded-full text-xs","aria-selected:opacity-100"),range_start:z("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:z("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:z("aria-selected:bg-accent aria-selected:text-accent-foreground","aria-selected:rounded-none"),selected:z("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,...h})=>{const p=c==="left"?Aw:c==="right"?Ol:c==="up"?oh:Il;return l.jsx(p,{className:z("h-4 w-4",d),...h})}},...r})}yE.displayName="Calendar";const bE=C.lazy(()=>tt(()=>Promise.resolve().then(()=>Zl),void 0).then(t=>({default:t.CodeEditor})));function sR({rawJsonContent:t,isRawJsonValid:a,rawJsonEdits:o,rawSettingsEnv:r,onChange:c,missingRequiredFields:d=[]}){const{t:h}=ye(),p=d.length>0;return l.jsx(C.Suspense,{fallback:l.jsxs("div",{className:"flex items-center justify-center h-full",children:[l.jsx(An,{className:"w-6 h-6 animate-spin text-muted-foreground"}),l.jsx("span",{className:"ml-2 text-muted-foreground",children:h("providerEditor.loadingEditor")})]}),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(Mo,{className:"w-4 h-4"}),"Invalid JSON syntax"]}),a&&p&&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(Vn,{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(bE,{value:t,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(Uh,{profileEnv:r})})})]})})}C.lazy(()=>tt(()=>Promise.resolve().then(()=>Zl),void 0).then(t=>({default:t.CodeEditor})));function vE(){const{t}=ye(),{isDark:a,setTheme:o}=mh(),[r,c]=C.useState(""),[d,h]=C.useState(""),[p,g]=C.useState(!1),[m,S]=C.useState(null),[b,x]=C.useState(!1),{login:T,authRequired:w,isAuthenticated:M,loading:j,accessMode:E,authEnabled:D}=Bl(),N=ah(),A=Rl(),P=E==="setup",k=t(P?"auth.remoteGuardLabel":"auth.protectedAccessLabel"),O=t(P?D?"auth.incompleteSetupDescription":"auth.remoteSetupDescription":"auth.loginDescription"),U=A.state?.from?.pathname||"/";if(C.useEffect(()=>{j||(M||!w)&&N(U,{replace:!0})},[M,w,j,N,U]),j)return l.jsx("div",{className:"flex min-h-[100dvh] items-center justify-center bg-background px-4",children:l.jsxs("div",{className:"flex items-center gap-3 rounded-full border border-border/80 bg-card/90 px-5 py-3 text-sm text-muted-foreground shadow-sm",children:[l.jsx(An,{className:"h-4 w-4 animate-spin"}),t("auth.loading")]})});if(M||!w)return null;const _=async K=>{K.preventDefault(),S(null),x(!0);try{await T(r,d),N(U,{replace:!0})}catch(ee){S(ee instanceof Error?ee.message:t("auth.loginFailed"))}finally{x(!1)}};return l.jsxs("div",{className:"relative min-h-[100dvh] overflow-hidden bg-background",children:[l.jsx("div",{className:"absolute inset-0 bg-[radial-gradient(circle_at_top_left,rgba(167,85,52,0.16),transparent_42%),radial-gradient(circle_at_bottom_right,rgba(39,39,42,0.12),transparent_48%)]"}),l.jsx("div",{className:"absolute inset-0 opacity-[0.18] [background-image:linear-gradient(rgba(127,117,107,0.14)_1px,transparent_1px),linear-gradient(90deg,rgba(127,117,107,0.14)_1px,transparent_1px)] [background-size:24px_24px]"}),l.jsx("div",{className:"relative mx-auto flex min-h-[100dvh] max-w-6xl items-center px-4 py-8 sm:px-6",children:l.jsxs("div",{className:"grid w-full items-stretch gap-6 lg:grid-cols-[minmax(0,1.05fr)_minmax(360px,430px)]",children:[l.jsxs("section",{className:"flex flex-col justify-between rounded-[28px] border border-border/70 bg-card/85 p-6 shadow-[0_24px_80px_-48px_rgba(68,48,34,0.55)] backdrop-blur sm:p-8",children:[l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[l.jsxs("span",{className:"inline-flex w-fit items-center gap-2 rounded-full border border-border/70 bg-background/75 px-3 py-1 text-xs font-semibold uppercase tracking-[0.24em] text-muted-foreground",children:[l.jsx(pl,{className:"h-3.5 w-3.5 text-accent"}),k]}),l.jsxs("div",{className:"inline-flex items-center gap-1 rounded-full border border-border/70 bg-background/75 p-1 shadow-sm backdrop-blur",children:[l.jsxs(st,{type:"button",variant:"ghost",size:"sm",className:z("rounded-full px-3 text-xs font-semibold",!a&&"bg-card text-foreground shadow-sm"),"aria-pressed":!a,onClick:()=>o("light"),children:[l.jsx(Jb,{className:"h-3.5 w-3.5"}),t("auth.lightMode")]}),l.jsxs(st,{type:"button",variant:"ghost",size:"sm",className:z("rounded-full px-3 text-xs font-semibold",a&&"bg-card text-foreground shadow-sm"),"aria-pressed":a,onClick:()=>o("dark"),children:[l.jsx(Zb,{className:"h-3.5 w-3.5"}),t("auth.darkMode")]})]})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsx("h1",{className:"max-w-xl text-4xl font-semibold tracking-[-0.04em] text-balance text-foreground sm:text-5xl",children:t(P?"auth.remoteSetupTitle":"auth.dashboardTitle")}),l.jsx("p",{className:"max-w-2xl text-base leading-7 text-muted-foreground sm:text-lg",children:O})]})]}),l.jsxs("div",{className:"mt-8 grid gap-3 text-sm text-muted-foreground sm:grid-cols-3",children:[l.jsxs("div",{className:"rounded-2xl border border-border/70 bg-background/70 p-4",children:[l.jsx(Vm,{className:"mb-3 h-4 w-4 text-accent"}),l.jsx("p",{children:t("auth.safetyNoteRemote")})]}),l.jsxs("div",{className:"rounded-2xl border border-border/70 bg-background/70 p-4",children:[l.jsx(Ym,{className:"mb-3 h-4 w-4 text-accent"}),l.jsx("p",{children:t("auth.safetyNoteLocal")})]}),l.jsxs("div",{className:"rounded-2xl border border-border/70 bg-background/70 p-4",children:[l.jsx(pl,{className:"mb-3 h-4 w-4 text-accent"}),l.jsx("p",{children:t("auth.safetyNoteSession")})]})]})]}),l.jsxs(QM,{className:"justify-center rounded-[28px] border-border/70 bg-card/95 py-0 shadow-[0_24px_90px_-54px_rgba(34,24,16,0.62)]",children:[l.jsxs($M,{className:"space-y-3 border-b border-border/70 px-6 py-6",children:[l.jsx("div",{className:"flex h-12 w-12 items-center justify-center rounded-2xl border border-accent/20 bg-accent/10",children:P?l.jsx(Vm,{className:"h-5 w-5 text-accent"}):l.jsx(Ym,{className:"h-5 w-5 text-accent"})}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(XM,{className:"text-2xl tracking-[-0.03em]",children:t(P?"auth.remoteSetupTitle":"auth.dashboardTitle")}),l.jsx(JM,{className:"text-sm leading-6 text-muted-foreground",children:P?O:t("auth.credentialsHint")})]})]}),l.jsx(ZM,{className:"space-y-5 px-6 py-6",children:P?l.jsxs(l.Fragment,{children:[l.jsxs(zr,{variant:"warning",className:"rounded-2xl border-yellow-300/70 bg-yellow-50/80",children:[l.jsx(Kr,{className:"h-4 w-4"}),l.jsx(Ll,{children:t("auth.noDefaultCredentials")}),l.jsx(Br,{children:t("auth.credentialsHint")})]}),l.jsxs("div",{className:"grid gap-3 sm:grid-cols-2",children:[l.jsxs("div",{className:"rounded-2xl border border-border/70 bg-background/75 p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[l.jsx(Dw,{className:"h-4 w-4 text-accent"}),t("auth.hostStepTitle")]}),l.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:t("auth.hostStepDescription")}),l.jsx("code",{className:"mt-4 block rounded-xl border border-border/70 bg-muted/60 px-3 py-2 font-mono text-[13px] text-foreground",children:"ccs config auth setup"}),l.jsx("p",{className:"mt-3 text-xs leading-5 text-muted-foreground",children:t("auth.dockerStepDescription")}),l.jsx("code",{className:"mt-2 block rounded-xl border border-border/70 bg-muted/60 px-3 py-2 font-mono text-[13px] text-foreground",children:"docker exec -it ccs-cliproxy ccs config auth setup"})]}),l.jsxs("div",{className:"rounded-2xl border border-border/70 bg-background/75 p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-foreground",children:[l.jsx(pl,{className:"h-4 w-4 text-accent"}),t("auth.localStepTitle")]}),l.jsx("p",{className:"mt-2 text-sm leading-6 text-muted-foreground",children:t("auth.localStepDescription")})]})]})]}):l.jsxs("form",{onSubmit:_,className:"space-y-4",children:[m&&l.jsxs(zr,{variant:"destructive",className:"rounded-2xl",children:[l.jsx(Kr,{className:"h-4 w-4"}),l.jsx(Br,{children:m})]}),l.jsxs(zr,{variant:"info",className:"rounded-2xl border-blue-200/80 bg-blue-50/80",children:[l.jsx(pl,{className:"h-4 w-4"}),l.jsx(Ll,{children:t("auth.noDefaultCredentials")}),l.jsx(Br,{children:t("auth.credentialsHint")})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qt,{htmlFor:"username",className:"text-sm font-semibold",children:t("auth.username")}),l.jsx(Bn,{id:"username",type:"text",value:r,onChange:K=>c(K.target.value),placeholder:t("auth.usernamePlaceholder"),autoComplete:"username",className:"h-12 rounded-2xl border-border/80 bg-background/85 px-4 text-base md:text-base",disabled:b,required:!0})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(qt,{htmlFor:"password",className:"text-sm font-semibold",children:t("auth.password")}),l.jsxs("div",{className:"relative",children:[l.jsx(Bn,{id:"password",type:p?"text":"password",value:d,onChange:K=>h(K.target.value),placeholder:t("auth.passwordPlaceholder"),autoComplete:"current-password",className:"h-12 rounded-2xl border-border/80 bg-background/85 px-4 pr-14 text-base md:text-base",disabled:b,required:!0}),l.jsx(st,{type:"button",variant:"ghost",size:"sm",className:"absolute inset-y-1 right-1 h-auto rounded-xl px-3 text-muted-foreground hover:text-foreground","aria-label":t(p?"auth.hidePassword":"auth.showPassword"),"aria-pressed":p,onClick:()=>g(K=>!K),disabled:b,children:p?l.jsx(Qr,{className:"h-4 w-4"}):l.jsx($r,{className:"h-4 w-4"})})]})]}),l.jsx(st,{type:"submit",className:"h-12 w-full rounded-2xl text-sm font-semibold",disabled:b,children:b?l.jsxs(l.Fragment,{children:[l.jsx(An,{className:"mr-2 h-4 w-4 animate-spin"}),t("auth.signingIn")]}):t("auth.signIn")})]})})]})]})})]})}const xE=C.lazy(()=>tt(()=>import("./index-Cq9VySs6.js"),__vite__mapDeps([23,1,2,4,5,7,24,6,8,9])).then(t=>({default:t.AnalyticsPage}))),CE=C.lazy(()=>tt(()=>import("./api-DZosWVkR.js"),__vite__mapDeps([25,1,2,5,26,19,6,4,3,7,8,9])).then(t=>({default:t.ApiPage}))),SE=C.lazy(()=>tt(()=>import("./cliproxy-B3Jyu3r9.js"),__vite__mapDeps([27,1,2,5,17,6,4,20,28,26,19,29,30,18,7,8,9])).then(t=>({default:t.CliproxyPage}))),wE=C.lazy(()=>tt(()=>import("./cliproxy-ai-providers-BAJ78pUc.js"),__vite__mapDeps([31,1,2,18,19,5,6,4,26,7,8,9])).then(t=>({default:t.CliproxyAiProvidersPage}))),kE=C.lazy(()=>tt(()=>import("./cliproxy-control-panel-XEvUMVJe.js"),__vite__mapDeps([32,1,2,5,17,4,6,7,8,9])).then(t=>({default:t.CliproxyControlPanelPage}))),AE=C.lazy(()=>tt(()=>import("./copilot-afee2lL9.js"),__vite__mapDeps([33,1,2,5,26,19,4,29,30,6,7,8,9])).then(t=>({default:t.CopilotPage}))),DE=C.lazy(()=>tt(()=>import("./cursor-DuWy60wp.js"),__vite__mapDeps([34,1,2,6,5,17,29,30,4,7,8,9])).then(t=>({default:t.CursorPage}))),NE=C.lazy(()=>tt(()=>import("./claude-extension-C6OeBQ73.js"),__vite__mapDeps([35,1,2,5,6,4,7,8,9])).then(t=>({default:t.ClaudeExtensionPage}))),TE=C.lazy(()=>tt(()=>import("./codex-CY2vikqX.js"),__vite__mapDeps([36,1,2,6,4,29,5,9,7,37,38,8])).then(t=>({default:t.CodexPage}))),PE=C.lazy(()=>tt(()=>import("./droid-FlceoQ6k.js"),__vite__mapDeps([39,1,2,6,5,38,4,29,7,8,9])).then(t=>({default:t.DroidPage}))),ME=C.lazy(()=>tt(()=>import("./logs-Dth4naJl.js"),__vite__mapDeps([40,1,2,4,5,6,7,8,9])).then(t=>({default:t.LogsPage}))),LE=C.lazy(()=>tt(()=>import("./accounts-CybVGDsm.js"),__vite__mapDeps([41,1,2,5,37,19,6,4,28,7,8,9])).then(t=>({default:t.AccountsPage}))),EE=C.lazy(()=>tt(()=>Promise.resolve().then(()=>BL),void 0).then(t=>({default:t.SettingsPage}))),jE=C.lazy(()=>tt(()=>import("./health-BEMgcKD3.js"),__vite__mapDeps([42,1,2,5,6,4,11,7,8,9])).then(t=>({default:t.HealthPage}))),RE=C.lazy(()=>tt(()=>import("./shared-CwWuZx24.js"),__vite__mapDeps([43,1,2,4,5,6,7,8,9])).then(t=>({default:t.SharedPage}))),OE=C.lazy(()=>tt(()=>import("./updates-BTHJZ7Rk.js"),__vite__mapDeps([44,1,2,4,5,6,7,8,9])).then(t=>({default:t.UpdatesPage}))),IE=null;function Bt(){return l.jsx("div",{className:"flex h-64 items-center justify-center",children:l.jsx(An,{className:"h-8 w-8 animate-spin text-muted-foreground"})})}function _E(){return l.jsx(G0,{client:xk,children:l.jsx(pA,{defaultTheme:"system",storageKey:"vite-ui-theme",children:l.jsx(gA,{children:l.jsx(xA,{children:l.jsxs(B0,{children:[l.jsxs(F0,{children:[l.jsx(Ct,{path:"/login",element:l.jsx(vE,{})}),l.jsx(Ct,{element:l.jsx(CA,{}),children:l.jsxs(Ct,{element:l.jsx(LN,{}),children:[l.jsx(Ct,{path:"/",element:l.jsx(nM,{})}),l.jsx(Ct,{path:"/analytics",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(xE,{})})}),l.jsx(Ct,{path:"/updates",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(OE,{})})}),l.jsx(Ct,{path:"/providers",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(CE,{})})}),l.jsx(Ct,{path:"/cliproxy",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(SE,{})})}),l.jsx(Ct,{path:"/cliproxy/ai-providers",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(wE,{})})}),l.jsx(Ct,{path:"/cliproxy/control-panel",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(kE,{})})}),l.jsx(Ct,{path:"/copilot",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(AE,{})})}),l.jsx(Ct,{path:"/cursor",element:l.jsx(Kb,{to:"/cliproxy?provider=cursor",replace:!0})}),l.jsx(Ct,{path:"/legacy/cursor",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(DE,{})})}),l.jsx(Ct,{path:"/claude-extension",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(NE,{})})}),l.jsx(Ct,{path:"/codex",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(TE,{})})}),l.jsx(Ct,{path:"/droid",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(PE,{})})}),l.jsx(Ct,{path:"/accounts",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(LE,{})})}),l.jsx(Ct,{path:"/settings",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(EE,{})})}),l.jsx(Ct,{path:"/health",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(jE,{})})}),l.jsx(Ct,{path:"/logs",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(ME,{})})}),l.jsx(Ct,{path:"/shared",element:l.jsx(C.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(RE,{})})}),IE]})})]}),l.jsx(V0,{position:"top-right"})]})})})})})}const Qx=document.getElementById("root");if(!Qx)throw new Error("Root element not found. Failed to mount React application.");yk.createRoot(Qx).render(l.jsx(C.StrictMode,{children:l.jsx(_E,{})}));export{qj as $,sM as A,Et as B,QM as C,fM as D,_j as E,Hj as F,iM as G,dM as H,Bn as I,pM as J,Uj as K,qt as L,AD as M,DD as N,ND as O,bv as P,px as Q,Ih as R,$e as S,wa as T,El as U,Xd as V,ie as W,Fj as X,He as Y,Bj as Z,JM as _,ye as a,oj as a$,Kj as a0,Gj as a1,Vj as a2,Yj as a3,Wj as a4,Qj as a5,yx as a6,$j as a7,nL as a8,Th as a9,Zj as aA,eR as aB,Jj as aC,GD as aD,Dj as aE,Ay as aF,MM as aG,Xj as aH,bM as aI,wx as aJ,NT as aK,qT as aL,Pi as aM,yN as aN,bN as aO,vN as aP,xN as aQ,hT as aR,Rv as aS,uj as aT,dj as aU,hj as aV,fj as aW,rR as aX,$E as aY,kD as aZ,ij as a_,Ph as aa,YE as ab,vD as ac,XE as ad,nj as ae,sj as af,lj as ag,yh as ah,bh as ai,vh as aj,xh as ak,Ch as al,tR as am,iL as an,nR as ao,Li as ap,Pj as aq,jr as ar,Mj as as,Gd as at,cj as au,Lj as av,Ej as aw,Rj as ax,Dy as ay,jj as az,ZM as b,xD as b0,CD as b1,rj as b2,SD as b3,wD as b4,aj as b5,Ah as b6,Tj as b7,Cj as b8,wj as b9,_L as bA,yj as bB,pj as bC,XD as bD,JD as bE,Nj as bF,dv as bG,Zk as bH,Xk as bI,zd as bJ,Ni as bK,qk as bL,Gk as bM,Qk as bN,tA as bO,bj as bP,JE as bQ,ZE as bR,ej as bS,tj as bT,gj as bU,mj as bV,xj as bW,vj as bX,xl as bY,kj as ba,Sj as bb,Dx as bc,Uh as bd,Aj as be,Er as bf,WE as bg,QE as bh,zr as bi,Ll as bj,Br as bk,sR as bl,Rh as bm,Vr as bn,Oh as bo,WP as bp,FA as bq,GA as br,VA as bs,YA as bt,WA as bu,ZP as bv,Oj as bw,Ij as bx,Tx as by,OL as bz,z as c,st as d,aR as e,iR as f,oL as g,yE as h,VE as i,$M as j,XM as k,gT as l,mT as m,Lo as n,oR as o,ka as p,Aa as q,Pv as r,Dh as s,Mv as t,ch as u,Nh as v,Hr as w,$y as x,yM as y,zj as z};
|