@kaitranntt/ccs 7.73.0 → 7.73.1-dev.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/config/base-claude.settings.json +1 -1
  2. package/dist/ccs.js +47 -13
  3. package/dist/ccs.js.map +1 -1
  4. package/dist/cliproxy/account-safety.d.ts +11 -0
  5. package/dist/cliproxy/account-safety.d.ts.map +1 -1
  6. package/dist/cliproxy/account-safety.js +114 -1
  7. package/dist/cliproxy/account-safety.js.map +1 -1
  8. package/dist/cliproxy/binary-manager.d.ts +20 -0
  9. package/dist/cliproxy/binary-manager.d.ts.map +1 -1
  10. package/dist/cliproxy/binary-manager.js +95 -12
  11. package/dist/cliproxy/binary-manager.js.map +1 -1
  12. package/dist/cliproxy/config/env-builder.d.ts.map +1 -1
  13. package/dist/cliproxy/config/env-builder.js +0 -57
  14. package/dist/cliproxy/config/env-builder.js.map +1 -1
  15. package/dist/cliproxy/executor/index.d.ts.map +1 -1
  16. package/dist/cliproxy/executor/index.js +46 -28
  17. package/dist/cliproxy/executor/index.js.map +1 -1
  18. package/dist/cliproxy/model-catalog.d.ts.map +1 -1
  19. package/dist/cliproxy/model-catalog.js +15 -1
  20. package/dist/cliproxy/model-catalog.js.map +1 -1
  21. package/dist/cliproxy/model-config.d.ts.map +1 -1
  22. package/dist/cliproxy/model-config.js +1 -8
  23. package/dist/cliproxy/model-config.js.map +1 -1
  24. package/dist/cliproxy/model-id-normalizer.d.ts +2 -2
  25. package/dist/cliproxy/model-id-normalizer.d.ts.map +1 -1
  26. package/dist/cliproxy/model-id-normalizer.js +20 -9
  27. package/dist/cliproxy/model-id-normalizer.js.map +1 -1
  28. package/dist/cliproxy/platform-detector.d.ts +10 -3
  29. package/dist/cliproxy/platform-detector.d.ts.map +1 -1
  30. package/dist/cliproxy/platform-detector.js +9 -2
  31. package/dist/cliproxy/platform-detector.js.map +1 -1
  32. package/dist/cliproxy/quota-manager.d.ts.map +1 -1
  33. package/dist/cliproxy/quota-manager.js +25 -2
  34. package/dist/cliproxy/quota-manager.js.map +1 -1
  35. package/dist/cliproxy/services/binary-service.d.ts.map +1 -1
  36. package/dist/cliproxy/services/binary-service.js +21 -7
  37. package/dist/cliproxy/services/binary-service.js.map +1 -1
  38. package/dist/cliproxy/services/variant-service.d.ts +2 -1
  39. package/dist/cliproxy/services/variant-service.d.ts.map +1 -1
  40. package/dist/cliproxy/services/variant-service.js +16 -18
  41. package/dist/cliproxy/services/variant-service.js.map +1 -1
  42. package/dist/cliproxy/services/variant-settings.d.ts.map +1 -1
  43. package/dist/cliproxy/services/variant-settings.js +2 -4
  44. package/dist/cliproxy/services/variant-settings.js.map +1 -1
  45. package/dist/cliproxy/types.d.ts +4 -2
  46. package/dist/cliproxy/types.d.ts.map +1 -1
  47. package/dist/cliproxy/types.js.map +1 -1
  48. package/dist/commands/browser-command.d.ts.map +1 -1
  49. package/dist/commands/browser-command.js +243 -12
  50. package/dist/commands/browser-command.js.map +1 -1
  51. package/dist/commands/cliproxy/help-subcommand.d.ts.map +1 -1
  52. package/dist/commands/cliproxy/help-subcommand.js +5 -1
  53. package/dist/commands/cliproxy/help-subcommand.js.map +1 -1
  54. package/dist/commands/cliproxy/index.d.ts.map +1 -1
  55. package/dist/commands/cliproxy/index.js +3 -7
  56. package/dist/commands/cliproxy/index.js.map +1 -1
  57. package/dist/commands/cliproxy/install-subcommand.js +1 -1
  58. package/dist/commands/cliproxy/install-subcommand.js.map +1 -1
  59. package/dist/commands/command-catalog.d.ts +1 -1
  60. package/dist/commands/command-catalog.d.ts.map +1 -1
  61. package/dist/commands/command-catalog.js +4 -2
  62. package/dist/commands/command-catalog.js.map +1 -1
  63. package/dist/commands/completion-backend.d.ts.map +1 -1
  64. package/dist/commands/completion-backend.js +21 -0
  65. package/dist/commands/completion-backend.js.map +1 -1
  66. package/dist/commands/proxy-command.d.ts +1 -0
  67. package/dist/commands/proxy-command.d.ts.map +1 -1
  68. package/dist/commands/proxy-command.js +93 -23
  69. package/dist/commands/proxy-command.js.map +1 -1
  70. package/dist/config/unified-config-loader.d.ts.map +1 -1
  71. package/dist/config/unified-config-loader.js +10 -1
  72. package/dist/config/unified-config-loader.js.map +1 -1
  73. package/dist/config/unified-config-types.d.ts +13 -3
  74. package/dist/config/unified-config-types.d.ts.map +1 -1
  75. package/dist/config/unified-config-types.js +10 -3
  76. package/dist/config/unified-config-types.js.map +1 -1
  77. package/dist/cursor/cursor-default-models.d.ts +1 -1
  78. package/dist/cursor/cursor-default-models.d.ts.map +1 -1
  79. package/dist/cursor/cursor-default-models.js +11 -1
  80. package/dist/cursor/cursor-default-models.js.map +1 -1
  81. package/dist/glmt/delta-accumulator.d.ts +4 -0
  82. package/dist/glmt/delta-accumulator.d.ts.map +1 -1
  83. package/dist/glmt/delta-accumulator.js +17 -5
  84. package/dist/glmt/delta-accumulator.js.map +1 -1
  85. package/dist/glmt/pipeline/stream-parser.d.ts +0 -3
  86. package/dist/glmt/pipeline/stream-parser.d.ts.map +1 -1
  87. package/dist/glmt/pipeline/stream-parser.js +20 -27
  88. package/dist/glmt/pipeline/stream-parser.js.map +1 -1
  89. package/dist/glmt/pipeline/tool-call-handler.d.ts +0 -7
  90. package/dist/glmt/pipeline/tool-call-handler.d.ts.map +1 -1
  91. package/dist/glmt/pipeline/tool-call-handler.js +15 -24
  92. package/dist/glmt/pipeline/tool-call-handler.js.map +1 -1
  93. package/dist/proxy/index.d.ts +1 -0
  94. package/dist/proxy/index.d.ts.map +1 -1
  95. package/dist/proxy/index.js +1 -0
  96. package/dist/proxy/index.js.map +1 -1
  97. package/dist/proxy/proxy-daemon-paths.d.ts +5 -2
  98. package/dist/proxy/proxy-daemon-paths.d.ts.map +1 -1
  99. package/dist/proxy/proxy-daemon-paths.js +17 -5
  100. package/dist/proxy/proxy-daemon-paths.js.map +1 -1
  101. package/dist/proxy/proxy-daemon-state.d.ts +10 -5
  102. package/dist/proxy/proxy-daemon-state.d.ts.map +1 -1
  103. package/dist/proxy/proxy-daemon-state.js +81 -12
  104. package/dist/proxy/proxy-daemon-state.js.map +1 -1
  105. package/dist/proxy/proxy-daemon.d.ts +4 -3
  106. package/dist/proxy/proxy-daemon.d.ts.map +1 -1
  107. package/dist/proxy/proxy-daemon.js +351 -93
  108. package/dist/proxy/proxy-daemon.js.map +1 -1
  109. package/dist/proxy/proxy-port-resolver.d.ts +7 -0
  110. package/dist/proxy/proxy-port-resolver.d.ts.map +1 -0
  111. package/dist/proxy/proxy-port-resolver.js +22 -0
  112. package/dist/proxy/proxy-port-resolver.js.map +1 -0
  113. package/dist/proxy/server/messages-route.d.ts.map +1 -1
  114. package/dist/proxy/server/messages-route.js +2 -7
  115. package/dist/proxy/server/messages-route.js.map +1 -1
  116. package/dist/proxy/server/proxy-server.d.ts.map +1 -1
  117. package/dist/proxy/server/proxy-server.js +35 -23
  118. package/dist/proxy/server/proxy-server.js.map +1 -1
  119. package/dist/proxy/transformers/request-transformer.d.ts.map +1 -1
  120. package/dist/proxy/transformers/request-transformer.js +21 -16
  121. package/dist/proxy/transformers/request-transformer.js.map +1 -1
  122. package/dist/targets/target-resolver.d.ts.map +1 -1
  123. package/dist/targets/target-resolver.js +15 -0
  124. package/dist/targets/target-resolver.js.map +1 -1
  125. package/dist/ui/assets/{accounts-DfkqFx14.js → accounts-CdmEv5jU.js} +1 -1
  126. package/dist/ui/assets/{alert-dialog-BJ9GwHLZ.js → alert-dialog-pSzyQP3S.js} +1 -1
  127. package/dist/ui/assets/{api-BVo8Vm1B.js → api-6xZ1yyns.js} +1 -1
  128. package/dist/ui/assets/{auth-section-B-Ms1O_M.js → auth-section-DJMuqfhE.js} +1 -1
  129. package/dist/ui/assets/{backups-section-f8hvkPfH.js → backups-section-DGKT51IG.js} +1 -1
  130. package/dist/ui/assets/{channels-Bgvry5fT.js → channels-DezQJzMm.js} +1 -1
  131. package/dist/ui/assets/{checkbox-CbI3Vbww.js → checkbox-D0fhe2bc.js} +1 -1
  132. package/dist/ui/assets/{claude-extension-lDT7lp8C.js → claude-extension-zS7zGQAr.js} +1 -1
  133. package/dist/ui/assets/cliproxy-CllaWHzR.js +3 -0
  134. package/dist/ui/assets/{cliproxy-ai-providers-Cjrk90aJ.js → cliproxy-ai-providers-DsMeN_St.js} +1 -1
  135. package/dist/ui/assets/{cliproxy-control-panel-DL8JoyKU.js → cliproxy-control-panel-p9QVUsRu.js} +1 -1
  136. package/dist/ui/assets/{codex-B3bW7lzx.js → codex-BibvFkeM.js} +1 -1
  137. package/dist/ui/assets/{confirm-dialog-Bm2Y3ArL.js → confirm-dialog-Cl3M6ytT.js} +1 -1
  138. package/dist/ui/assets/{copilot-CPLBRpFA.js → copilot-fBbT2Giy.js} +1 -1
  139. package/dist/ui/assets/{cursor-D1xhqEEF.js → cursor-Df6ARj5V.js} +1 -1
  140. package/dist/ui/assets/{droid-DiFtSJkl.js → droid-DxoeGW_k.js} +1 -1
  141. package/dist/ui/assets/{globalenv-section-BadlR8mm.js → globalenv-section-Cpfv8x9d.js} +1 -1
  142. package/dist/ui/assets/{health-Bxol1p1X.js → health-DftbLTPo.js} +1 -1
  143. package/dist/ui/assets/{index-CA4r5qY8.js → index-BC_nh-r0.js} +1 -1
  144. package/dist/ui/assets/{index-x07V45Iw.js → index-BU5nSuXf.js} +1 -1
  145. package/dist/ui/assets/{index-CXRoMyUA.js → index-BeGXGfW3.js} +1 -1
  146. package/dist/ui/assets/index-Bg5fPsun.js +1 -0
  147. package/dist/ui/assets/{index-C2-J9AKi.js → index-Bz4O7ubX.js} +1 -1
  148. package/dist/ui/assets/{index-DM7Qb4kd.js → index-CXjGRa6N.js} +2 -2
  149. package/dist/ui/assets/{index-BPCsEKJ8.js → index-Dazklm4w.js} +1 -1
  150. package/dist/ui/assets/{logs-kvpMF-pw.js → logs-BO4HN515.js} +1 -1
  151. package/dist/ui/assets/{masked-input-CFQ05toP.js → masked-input-DOdZz311.js} +1 -1
  152. package/dist/ui/assets/{proxy-status-widget-Df_-wCR0.js → proxy-status-widget-BMrsa5c4.js} +1 -1
  153. package/dist/ui/assets/{raw-json-settings-editor-panel-DeWgWDSP.js → raw-json-settings-editor-panel-DxneYnUX.js} +1 -1
  154. package/dist/ui/assets/{searchable-select-CPbVBSoE.js → searchable-select-D5MLlu56.js} +1 -1
  155. package/dist/ui/assets/{separator--T-CzItG.js → separator-MbLyvcwG.js} +1 -1
  156. package/dist/ui/assets/{shared-Dx_5pa5N.js → shared-Odb9AKYo.js} +1 -1
  157. package/dist/ui/assets/{table-wE_LUUUQ.js → table-CtGeOCTd.js} +1 -1
  158. package/dist/ui/assets/{updates-mWDqf-fm.js → updates-BnaFXuVV.js} +1 -1
  159. package/dist/ui/index.html +1 -1
  160. package/dist/utils/browser/browser-policy.d.ts +22 -0
  161. package/dist/utils/browser/browser-policy.d.ts.map +1 -0
  162. package/dist/utils/browser/browser-policy.js +65 -0
  163. package/dist/utils/browser/browser-policy.js.map +1 -0
  164. package/dist/utils/browser/browser-settings.d.ts +9 -1
  165. package/dist/utils/browser/browser-settings.d.ts.map +1 -1
  166. package/dist/utils/browser/browser-settings.js +53 -37
  167. package/dist/utils/browser/browser-settings.js.map +1 -1
  168. package/dist/utils/browser/browser-setup.d.ts +21 -0
  169. package/dist/utils/browser/browser-setup.d.ts.map +1 -0
  170. package/dist/utils/browser/browser-setup.js +68 -0
  171. package/dist/utils/browser/browser-setup.js.map +1 -0
  172. package/dist/utils/browser/browser-status.d.ts +6 -5
  173. package/dist/utils/browser/browser-status.d.ts.map +1 -1
  174. package/dist/utils/browser/browser-status.js +83 -33
  175. package/dist/utils/browser/browser-status.js.map +1 -1
  176. package/dist/utils/browser/index.d.ts +7 -3
  177. package/dist/utils/browser/index.d.ts.map +1 -1
  178. package/dist/utils/browser/index.js +15 -1
  179. package/dist/utils/browser/index.js.map +1 -1
  180. package/dist/utils/config-manager.d.ts +5 -0
  181. package/dist/utils/config-manager.d.ts.map +1 -1
  182. package/dist/utils/config-manager.js +16 -3
  183. package/dist/utils/config-manager.js.map +1 -1
  184. package/dist/web-server/middleware/auth-middleware.d.ts +1 -1
  185. package/dist/web-server/middleware/auth-middleware.d.ts.map +1 -1
  186. package/dist/web-server/middleware/auth-middleware.js.map +1 -1
  187. package/dist/web-server/model-pricing.d.ts.map +1 -1
  188. package/dist/web-server/model-pricing.js +7 -0
  189. package/dist/web-server/model-pricing.js.map +1 -1
  190. package/dist/web-server/routes/browser-routes.d.ts.map +1 -1
  191. package/dist/web-server/routes/browser-routes.js +51 -10
  192. package/dist/web-server/routes/browser-routes.js.map +1 -1
  193. package/dist/web-server/routes/cliproxy-stats-routes.d.ts +3 -5
  194. package/dist/web-server/routes/cliproxy-stats-routes.d.ts.map +1 -1
  195. package/dist/web-server/routes/cliproxy-stats-routes.js +3 -14
  196. package/dist/web-server/routes/cliproxy-stats-routes.js.map +1 -1
  197. package/dist/web-server/services/cliproxy-dashboard-install-service.d.ts.map +1 -1
  198. package/dist/web-server/services/cliproxy-dashboard-install-service.js +4 -2
  199. package/dist/web-server/services/cliproxy-dashboard-install-service.js.map +1 -1
  200. package/package.json +2 -2
  201. package/scripts/ensure-deps.sh +18 -0
  202. package/dist/ui/assets/cliproxy-D50Owb9u.js +0 -3
  203. package/dist/ui/assets/index-BZYBDV6A.js +0 -1
@@ -1,4 +1,4 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-BPCsEKJ8.js","assets/radix-ui-Zb8sVEtn.js","assets/react-vendor-CNOkPC89.js","assets/masked-input-CFQ05toP.js","assets/icons-Dmi9qMuE.js","assets/tanstack-CrmUhA7Z.js","assets/notifications-B2HqRBj7.js","assets/utils-CzKF5WmX.js","assets/form-utils-Bcoyqxpq.js","assets/code-highlight-BRUf_pqB.js","assets/index-CXRoMyUA.js","assets/index-CA4r5qY8.js","assets/channels-Bgvry5fT.js","assets/globalenv-section-BadlR8mm.js","assets/index-x07V45Iw.js","assets/index-BZYBDV6A.js","assets/default-ports-1QQSffYX.js","assets/proxy-status-widget-Df_-wCR0.js","assets/alert-dialog-BJ9GwHLZ.js","assets/antigravity-responsibility-constants-Bvh4Ybz0.js","assets/auth-section-B-Ms1O_M.js","assets/backups-section-f8hvkPfH.js","assets/index-C2-J9AKi.js","assets/charts-BBPXh0Ar.js","assets/api-BVo8Vm1B.js","assets/confirm-dialog-Bm2Y3ArL.js","assets/cliproxy-D50Owb9u.js","assets/checkbox-CbI3Vbww.js","assets/separator--T-CzItG.js","assets/searchable-select-CPbVBSoE.js","assets/cliproxy-ai-providers-Cjrk90aJ.js","assets/cliproxy-control-panel-DL8JoyKU.js","assets/copilot-CPLBRpFA.js","assets/cursor-D1xhqEEF.js","assets/claude-extension-lDT7lp8C.js","assets/codex-B3bW7lzx.js","assets/table-wE_LUUUQ.js","assets/raw-json-settings-editor-panel-DeWgWDSP.js","assets/droid-DiFtSJkl.js","assets/logs-kvpMF-pw.js","assets/accounts-DfkqFx14.js","assets/health-Bxol1p1X.js","assets/shared-Dx_5pa5N.js","assets/updates-mWDqf-fm.js"])))=>i.map(i=>d[i]);
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/index-Dazklm4w.js","assets/radix-ui-Zb8sVEtn.js","assets/react-vendor-CNOkPC89.js","assets/masked-input-DOdZz311.js","assets/icons-Dmi9qMuE.js","assets/tanstack-CrmUhA7Z.js","assets/notifications-B2HqRBj7.js","assets/utils-CzKF5WmX.js","assets/form-utils-Bcoyqxpq.js","assets/code-highlight-BRUf_pqB.js","assets/index-BeGXGfW3.js","assets/index-BC_nh-r0.js","assets/channels-DezQJzMm.js","assets/globalenv-section-Cpfv8x9d.js","assets/index-BU5nSuXf.js","assets/index-Bg5fPsun.js","assets/default-ports-1QQSffYX.js","assets/proxy-status-widget-BMrsa5c4.js","assets/alert-dialog-pSzyQP3S.js","assets/antigravity-responsibility-constants-Bvh4Ybz0.js","assets/auth-section-DJMuqfhE.js","assets/backups-section-DGKT51IG.js","assets/index-Bz4O7ubX.js","assets/charts-BBPXh0Ar.js","assets/api-6xZ1yyns.js","assets/confirm-dialog-Cl3M6ytT.js","assets/cliproxy-CllaWHzR.js","assets/checkbox-D0fhe2bc.js","assets/separator-MbLyvcwG.js","assets/searchable-select-D5MLlu56.js","assets/cliproxy-ai-providers-DsMeN_St.js","assets/cliproxy-control-panel-p9QVUsRu.js","assets/copilot-fBbT2Giy.js","assets/cursor-Df6ARj5V.js","assets/claude-extension-zS7zGQAr.js","assets/codex-BibvFkeM.js","assets/table-CtGeOCTd.js","assets/raw-json-settings-editor-panel-DxneYnUX.js","assets/droid-DxoeGW_k.js","assets/logs-BO4HN515.js","assets/accounts-CdmEv5jU.js","assets/health-DftbLTPo.js","assets/shared-Odb9AKYo.js","assets/updates-BnaFXuVV.js"])))=>i.map(i=>d[i]);
2
2
  import{j as l,S as Pl,R as vb,C as xb,a as Cb,T as Sb,D as wb,P as kb,O as Ab,b as t0,c as n0,d as a0,e as i0,f as o0,A as r0,g as s0,h as l0,i as c0,k as u0,l as d0,m as h0,n as f0,I as p0,o as Db,p as g0,q as Nb,r as Tb,s as m0,t as Pb,V as y0,L as Mb,u as Lb,v as b0,w as v0,x as jb,y as x0,z as C0,B as Eb,E as S0,F as w0,G as Rb,H as k0,J as Ob,K as Ib,M as _b,N as A0,Q as D0,U as N0,W as T0,X as P0,Y as Ub,Z as M0,_ as L0,$ as j0}from"./radix-ui-Zb8sVEtn.js";import{e as Zd,f as E0,r as S,u as Ml,O as Ed,N as Hb,h as eh,L as xl,R as R0,g as zb,d as Um,i as Bb,c as ue,B as O0,j as I0,k as Ct}from"./react-vendor-CNOkPC89.js";import{Q as _0,u as Dt,a as lt,b as st,c as U0,d as H0}from"./tanstack-CrmUhA7Z.js";import{t as ce,T as z0}from"./notifications-B2HqRBj7.js";import{L as An,X as No,P as B0,C as Ll,H as F0,a as K0,K as Rd,G as q0,Z as Fb,b as Kb,F as qb,U as Gb,c as G0,S as V0,A as Hr,d as Vb,e as Y0,f as Yb,M as Wb,E as Vr,g as Yr,B as W0,R as zr,W as Q0,h as $0,i as X0,j as J0,k as Hm,l as zm,m as ko,n as th,o as Cl,p as Qb,q as $b,r as Z0,s as jl,t as nh,u as Xb,v as Ao,T as Gn,w as Br,x as Wr,y as Bm,z as ew,D as Jb,I as ah,J as tw,N as El,O as nw,Q as aw,V as iw,Y as ow,_ as Rl,$ as rw,a0 as sw,a1 as Zb,a2 as lw,a3 as cw,a4 as uw,a5 as dw,a6 as hw,a7 as ih,a8 as ev,a9 as Fm,aa as fw,ab as pw,ac as gw,ad as mw,ae as yw,af as bw,ag as Km,ah as vw,ai as ul,aj as qm,ak as Gm,al as xw}from"./icons-Dmi9qMuE.js";import{t as Cw,c as Sw,a as Ol,e as kr,f as Tr,b as ww,d as kw,g as Aw,h as Dw,i as Nw,j as Tw,k as Pw,l as Mw,m as Lw,n as jw,o as Ew,p as Rw,q as Ow,r as Iw,s as _w,u as Uw,v as Hw,w as zw,x as Bw,y as Fw,z as Kw,A as qw,B as Gw,C as Vw,D as Yw,E as Ww,F as Qw,G as $w,H as Xw,I as Jw,J as Zw}from"./utils-CzKF5WmX.js";import{o as Vm,s as Ym,p as ek,a as tk,$ as nk,b as tv,c as Za,d as ak,_ as ik,u as ok,e as Wm}from"./form-utils-Bcoyqxpq.js";import{H as rk,t as Qm}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 ld={exports:{}},Ar={},cd={exports:{}},ud={};var $m;function sk(){return $m||($m=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=[],x=1,b=null,C=3,T=!1,w=!1,M=!1,E=!1,j=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 q(){return E?!0:!(t.unstable_now()-_<U)}function ee(){if(E=!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=C;try{t:{for(A(H),b=o(g);b!==null&&!(b.expirationTime>H&&q());){var Q=b.callback;if(typeof Q=="function"){b.callback=null,C=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,C=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(){j(ee,0)};function pe(H,Z){O=j(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 C},t.unstable_next=function(H){switch(C){case 1:case 2:case 3:var Z=3;break;default:Z=C}var ne=C;C=Z;try{return H()}finally{C=ne}},t.unstable_requestPaint=function(){E=!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=C;C=H;try{return Z()}finally{C=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:x++,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=q,t.unstable_wrapCallback=function(H){var Z=C;return function(){var ne=C;C=Z;try{return H.apply(this,arguments)}finally{C=ne}}}})(ud)),ud}var Xm;function lk(){return Xm||(Xm=1,cd.exports=sk()),cd.exports}var Jm;function ck(){if(Jm)return Ar;Jm=1;var t=lk(),a=Zd(),o=E0();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 x(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=x(e),n!==null)return n;e=e.sibling}return null}var b=Object.assign,C=Symbol.for("react.element"),T=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),E=Symbol.for("react.strict_mode"),j=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"),q=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 j:return"Profiler";case E: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),oe=de(null),le=de(null);function xe(e,n){switch(J(oe,n),J(he,e),J(ae,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?sm(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=sm(n),e=lm(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(oe)}function He(e){e.memoizedState!==null&&J(le,e);var n=ae.current,i=lm(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),xr._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 Et(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 K=G}Reflect.construct(e,[],X)}else{try{X.call()}catch(G){K=G}e.call(X.prototype)}}else{try{throw Error()}catch(G){K=G}(X=e())&&typeof X.catch=="function"&&X.catch(function(){})}}catch(G){if(G&&K&&typeof G.stack=="string")return[G.stack,K.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(`
@@ -69,4 +69,4 @@ ${d}`,o),this.line=r,this.column=c,this.codeblock=d}}function o1(t,a){let o=0;fo
69
69
  `&&h!=="\r"){let p,g=c,m=!1,[x,b]=Xd(t,a-1);for(let w=0;w<x.length;w++){if(w&&(g=m?g[p]:g[p]={}),p=x[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[C,T]=Bh(t,b,"}",o-1,r);d.add(C),g[p]=C,a=T}}if(!h)throw new Ye("unfinished table encountered",{toml:t,ptr:a});return[c,a]}function m1(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=Ql(t,a);else if(d!==" "&&d!==" "&&d!==`
70
70
  `&&d!=="\r"){let h=Bh(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 Zy(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 x=c.length-1;c=c[x],d=d[x].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 y1(t,{maxDepth:a=1e3,integersAsBigInt:o}={}){let r={},c={},d=r,h=c;for(let p=Ca(t,0);p<t.length;){if(t[p]==="["){let g=t[++p]==="[",m=Xd(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 x=Zy(m[0],r,c,g?2:1);if(!x)throw new Ye("trying to redefine an already defined table or value",{toml:t,ptr:p});h=x[2],d=x[1],p=m[1]}else{let g=Xd(t,p),m=Zy(g[0],d,h,0);if(!m)throw new Ye("trying to redefine an already defined table or value",{toml:t,ptr:p});let x=Bh(t,g[1],void 0,a,o);m[1][m[0]]=x[0],p=x[1]}if(p=Ca(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=Ca(t,p)}return r}const b1=[/^ANTHROPIC_AUTH_TOKEN$/,/_API_KEY$/,/_AUTH_TOKEN$/,/_SECRET$/,/_SECRET_KEY$/,/^API_KEY$/,/^AUTH_TOKEN$/,/^SECRET$/,/_PASSWORD$/,/^PASSWORD$/,/_CREDENTIAL$/,/_PRIVATE_KEY$/];function v1(t){return b1.some(a=>a.test(t))}function x1(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 C1(t){if(!t.trim())return{valid:!0};try{return y1(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 xx({value:t,onChange:a,language:o="json",readonly:r=!1,className:c,minHeight:d="300px",heightMode:h="content"}){const{isDark:p}=ph(),{t:g}=ye(),[m,x]=S.useState(!1),[b,C]=S.useState(!0),T=h==="fill-parent",w=S.useMemo(()=>o==="json"?x1(t):o==="toml"?C1(t):{valid:!0},[t,o]),M=S.useCallback(E=>l.jsx(rk,{prism:n1,theme:p?Qm.nightOwl:Qm.github,code:E,language:o,children:({tokens:j,getLineProps:D,getTokenProps:N})=>{let A=!1;return l.jsx(l.Fragment,{children:j.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,"");v1(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 q=N({token:O});return _&&b&&(q.className=z(q.className,"blur-[3px] select-none opacity-70 transition-all duration-200")),l.jsx("span",{...q},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(ZM,{value:t,onValueChange:r?()=>{}:a,highlight:M,padding:12,disabled:r,onFocus:()=>x(!0),onBlur:()=>x(!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(rt,{variant:"ghost",size:"icon",className:"h-6 w-6 bg-background/50 hover:bg-background border shadow-sm rounded-full",onClick:()=>C(!b),title:g(b?"codeEditor.revealSensitive":"codeEditor.maskSensitive"),children:b?l.jsx(Yr,{className:"h-3 w-3"}):l.jsx(Vr,{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(Wr,{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(Br,{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 $l=Object.freeze(Object.defineProperty({__proto__:null,CodeEditor:xx},Symbol.toStringTag,{value:"Module"})),S1={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 w1(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 Cx=S.createContext(null);function k1({children:t}){const[a,o]=S.useReducer(w1,S1);return l.jsx(Cx.Provider,{value:{state:a,dispatch:o},children:t})}function Sx(){const t=S.useContext(Cx);if(!t)throw new Error("useSettingsContext must be used within a SettingsProvider");return t}function A1(){const{dispatch:t}=Sx(),a=S.useCallback($=>t({type:"SET_BROWSER_CONFIG",payload:$}),[t]),o=S.useCallback($=>t({type:"SET_BROWSER_STATUS",payload:$}),[t]),r=S.useCallback($=>t({type:"SET_BROWSER_LOADING",payload:$}),[t]),c=S.useCallback($=>t({type:"SET_BROWSER_STATUS_LOADING",payload:$}),[t]),d=S.useCallback($=>t({type:"SET_BROWSER_SAVING",payload:$}),[t]),h=S.useCallback($=>t({type:"SET_BROWSER_ERROR",payload:$}),[t]),p=S.useCallback($=>t({type:"SET_BROWSER_SUCCESS",payload:$}),[t]),g=S.useCallback($=>t({type:"SET_WEBSEARCH_CONFIG",payload:$}),[t]),m=S.useCallback($=>t({type:"SET_WEBSEARCH_STATUS",payload:$}),[t]),x=S.useCallback($=>t({type:"SET_WEBSEARCH_LOADING",payload:$}),[t]),b=S.useCallback($=>t({type:"SET_WEBSEARCH_STATUS_LOADING",payload:$}),[t]),C=S.useCallback($=>t({type:"SET_WEBSEARCH_SAVING",payload:$}),[t]),T=S.useCallback($=>t({type:"SET_WEBSEARCH_ERROR",payload:$}),[t]),w=S.useCallback($=>t({type:"SET_WEBSEARCH_SUCCESS",payload:$}),[t]),M=S.useCallback($=>t({type:"SET_GLOBALENV_CONFIG",payload:$}),[t]),E=S.useCallback($=>t({type:"SET_GLOBALENV_LOADING",payload:$}),[t]),j=S.useCallback($=>t({type:"SET_GLOBALENV_SAVING",payload:$}),[t]),D=S.useCallback($=>t({type:"SET_GLOBALENV_ERROR",payload:$}),[t]),N=S.useCallback($=>t({type:"SET_GLOBALENV_SUCCESS",payload:$}),[t]),A=S.useCallback($=>t({type:"SET_PROXY_CONFIG",payload:$}),[t]),P=S.useCallback($=>t({type:"SET_PROXY_LOADING",payload:$}),[t]),k=S.useCallback($=>t({type:"SET_PROXY_SAVING",payload:$}),[t]),O=S.useCallback($=>t({type:"SET_PROXY_ERROR",payload:$}),[t]),U=S.useCallback($=>t({type:"SET_PROXY_SUCCESS",payload:$}),[t]),_=S.useCallback($=>t({type:"SET_PROXY_TEST_RESULT",payload:$}),[t]),q=S.useCallback($=>t({type:"SET_PROXY_TESTING",payload:$}),[t]),ee=S.useCallback($=>t({type:"SET_RAW_CONFIG",payload:$}),[t]),Y=S.useCallback($=>t({type:"SET_RAW_CONFIG_LOADING",payload:$}),[t]);return S.useMemo(()=>({setBrowserConfig:a,setBrowserStatus:o,setBrowserLoading:r,setBrowserStatusLoading:c,setBrowserSaving:d,setBrowserError:h,setBrowserSuccess:p,setWebSearchConfig:g,setWebSearchStatus:m,setWebSearchLoading:x,setWebSearchStatusLoading:b,setWebSearchSaving:C,setWebSearchError:T,setWebSearchSuccess:w,setGlobalEnvConfig:M,setGlobalEnvLoading:E,setGlobalEnvSaving:j,setGlobalEnvError:D,setGlobalEnvSuccess:N,setProxyConfig:A,setProxyLoading:P,setProxySaving:k,setProxyError:O,setProxySuccess:U,setProxyTestResult:_,setProxyTesting:q,setRawConfig:ee,setRawConfigLoading:Y}),[a,o,r,c,d,h,p,g,m,x,b,C,T,w,M,E,j,D,N,A,P,k,O,U,_,q,ee,Y])}function D1(){const[t,a]=Bb(),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=S.useCallback(d=>{a({tab:d},{replace:!0})},[a]);return{activeTab:r,setActiveTab:c}}function N1(){const{state:t}=Sx(),a=A1(),[o,r]=S.useState(!1),c=S.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=S.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 eb({activeTab:t,onTabChange:a}){const{t:o}=ye(),r=[{value:"browser",label:o("settingsTabs.browser"),icon:pw},{value:"websearch",label:o("settingsTabs.web"),icon:Xb},{value:"image",label:o("settingsTabs.image"),icon:ev},{value:"channels",label:o("settingsTabs.channels"),icon:gw},{value:"globalenv",label:o("settingsTabs.env"),icon:ih},{value:"thinking",label:o("settingsTabs.think"),icon:mw},{value:"proxy",label:o("settingsTabs.proxy"),icon:yw},{value:"auth",label:o("settingsTabs.auth"),icon:th},{value:"backups",label:o("settingsTabs.backup"),icon:bw}];return l.jsx(lx,{value:t,onValueChange:c=>a(c),children:l.jsx(Rh,{className:"grid w-full grid-cols-9",children:r.map(({value:c,label:d,icon:h})=>l.jsxs(Tl,{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 tb(){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 wx(t,a=3,o=1e3){return t().catch(r=>{if(a<=0)throw r;return new Promise(c=>setTimeout(c,o)).then(()=>wx(t,a-1,o*2))})}function Na(t){return S.lazy(()=>wx(t))}const nb=Na(()=>tt(()=>import("./index-BPCsEKJ8.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),ab=Na(()=>tt(()=>import("./index-CXRoMyUA.js"),__vite__mapDeps([10,1,2,5,6,4,7,8,9]))),ib=Na(()=>tt(()=>import("./index-CA4r5qY8.js"),__vite__mapDeps([11,1,2,4,5,6,7,8,9]))),ob=Na(()=>tt(()=>import("./channels-Bgvry5fT.js"),__vite__mapDeps([12,1,2,4,5,6,7,8,9]))),rb=Na(()=>tt(()=>import("./globalenv-section-BadlR8mm.js"),__vite__mapDeps([13,1,2,4,5,6,7,8,9]))),sb=Na(()=>tt(()=>import("./index-x07V45Iw.js"),__vite__mapDeps([14,1,2,4,5,6,7,8,9]))),lb=Na(()=>tt(()=>import("./index-BZYBDV6A.js"),__vite__mapDeps([15,1,2,16,4,17,18,5,6,19,7,8,9]))),cb=Na(()=>tt(()=>import("./auth-section-B-Ms1O_M.js"),__vite__mapDeps([20,1,2,4,5,6,7,8,9]))),ub=Na(()=>tt(()=>import("./backups-section-f8hvkPfH.js"),__vite__mapDeps([21,1,2,18,4,5,6,7,8,9])));class db extends S.Component{constructor(a){super(a),this.state={hasError:!1,error:null}}static getDerivedStateFromError(a){return{hasError:!0,error:a}}render(){return this.state.hasError?l.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:l.jsxs("div",{className:"text-center p-6 max-w-md",children:[l.jsx(Br,{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(rt,{variant:"outline",onClick:()=>window.location.reload(),className:"inline-flex items-center gap-2",children:[l.jsx(zr,{className:"w-4 h-4"}),ie.t("settings.reloadPage")]})]})}):this.props.children}}function T1(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 P1(){const{t}=ye(),{setActiveTab:a}=D1(),[o]=Bb(),r=T1(o.get("tab")),{rawConfig:c,loading:d,copied:h,fetchRawConfig:p,copyToClipboard:g}=N1();S.useEffect(()=>{p()},[p]);const m=x=>{S.startTransition(()=>{a(x)})};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(eb,{activeTab:r,onTabChange:m})}),l.jsx(db,{children:l.jsxs(S.Suspense,{fallback:l.jsx(tb,{}),children:[r==="browser"&&l.jsx(ab,{}),r==="websearch"&&l.jsx(nb,{}),r==="image"&&l.jsx(ib,{}),r==="channels"&&l.jsx(ob,{}),r==="globalenv"&&l.jsx(rb,{}),r==="thinking"&&l.jsx(sb,{}),r==="proxy"&&l.jsx(lb,{}),r==="auth"&&l.jsx(cb,{}),r==="backups"&&l.jsx(ub,{})]})})]}),l.jsxs(jh,{direction:"horizontal",className:"h-full hidden md:flex",children:[l.jsx(Kr,{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(eb,{activeTab:r,onTabChange:m})}),l.jsx(db,{children:l.jsxs(S.Suspense,{fallback:l.jsx(tb,{}),children:[r==="browser"&&l.jsx(ab,{}),r==="websearch"&&l.jsx(nb,{}),r==="image"&&l.jsx(ib,{}),r==="channels"&&l.jsx(ob,{}),r==="globalenv"&&l.jsx(rb,{}),r==="thinking"&&l.jsx(sb,{}),r==="proxy"&&l.jsx(lb,{}),r==="auth"&&l.jsx(cb,{}),r==="backups"&&l.jsx(ub,{})]})})]})}),l.jsx(Eh,{className:"w-2 bg-border hover:bg-primary/20 transition-colors cursor-col-resize flex items-center justify-center group",children:l.jsx(El,{className:"w-3 h-3 text-muted-foreground group-hover:text-primary"})}),l.jsx(Kr,{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(Km,{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(rt,{variant:"outline",size:"sm",onClick:g,disabled:!c,children:h?l.jsxs(l.Fragment,{children:[l.jsx(ko,{className:"w-4 h-4 mr-1"}),t("settings.copied")]}):l.jsxs(l.Fragment,{children:[l.jsx(Cl,{className:"w-4 h-4 mr-1"}),t("settings.copy")]})}),l.jsx(rt,{variant:"outline",size:"sm",onClick:p,disabled:d,children:l.jsx(zr,{className:`w-4 h-4 ${d?"animate-spin":""}`})})]})]}),l.jsx("div",{className:"flex-1 overflow-auto",children:c?l.jsx(xx,{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(zr,{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(Km,{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 M1(){return l.jsx(k1,{children:l.jsx(P1,{})})}const L1=Object.freeze(Object.defineProperty({__proto__:null,SettingsPage:M1},Symbol.toStringTag,{value:"Module"}));function j1(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 E1={},jr={};function Ai(t,a){try{const r=(E1[t]||=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"longOffset"}).format)(a).split("GMT")[1];return r in jr?jr[r]:hb(r,r.split(":"))}catch{if(t in jr)return jr[t];const o=t?.match(R1);return o?hb(t,o.slice(1)):NaN}}const R1=/([+-]\d\d):?(\d\d)?/;function hb(t,a){const o=+(a[0]||0),r=+(a[1]||0),c=+(a[2]||0)/60;return jr[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)),kx(this),Jd(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),Jd(this),+this}[Symbol.for("constructDateFrom")](a){return new Kn(+new Date(a),this.timeZone)}}const fb=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!fb.test(t))return;const a=t.replace(fb,"$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),O1(this),+this},Kn.prototype[a]=function(){return Date.prototype[a].apply(this,arguments),Jd(this),+this}))});function Jd(t){t.internal.setTime(+t),t.internal.setUTCSeconds(t.internal.getUTCSeconds()-Math.round(-Ai(t.timeZone,t)*60))}function O1(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()),kx(t)}function kx(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 x=c>0?m.getSeconds():(m.getSeconds()-60)%60,b=Math.round(-(Ai(t.timeZone,t)*60))%60;(b||x)&&(t.internal.setUTCSeconds(t.internal.getUTCSeconds()+b),Date.prototype.setUTCSeconds.call(t,Date.prototype.getUTCSeconds.call(t)+b+x));const C=Ai(t.timeZone,t),T=C>0?Math.floor(C):Math.ceil(C),M=-new Date(+t).getTimezoneOffset()-T,E=T!==o,j=M-g;if(E&&j){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+j);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 ba extends Kn{static tz(a,...o){return o.length?new ba(...o,a):new ba(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} (${j1(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 ba(+this,a)}[Symbol.for("constructDateFrom")](a){return new ba(+new Date(a),this.timeZone)}}const pb=5,I1=4;function _1(t,a){const o=a.startOfMonth(t),r=o.getDay()>0?o.getDay():7,c=a.addDays(t,-r+1),d=a.addDays(c,pb*7-1);return a.getMonth(t)===a.getMonth(d)?pb:I1}function Ax(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 U1(t,a){const o=Ax(t,a),r=_1(t,a);return a.addDays(o,r*7-1)}const Dx={...kr,labels:{labelDayButton:(t,a,o,r)=>{let c;r&&typeof r.format=="function"?c=r.format.bind(r):c=(h,p)=>Tr(h,p,{locale:kr,...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)=>Tr(c,d,{locale:kr,...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)=>Tr(h,p,{locale:kr,...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)=>Tr(c,d,{locale:kr,...a}),r(t,"cccc")}}};class fn{constructor(a,o){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?ba.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 ba(r,c,d,this.options.timeZone):new Date(r,c,d),this.addDays=(r,c)=>this.overrides?.addDays?this.overrides.addDays(r,c):ww(r,c),this.addMonths=(r,c)=>this.overrides?.addMonths?this.overrides.addMonths(r,c):kw(r,c),this.addWeeks=(r,c)=>this.overrides?.addWeeks?this.overrides.addWeeks(r,c):Aw(r,c),this.addYears=(r,c)=>this.overrides?.addYears?this.overrides.addYears(r,c):Dw(r,c),this.differenceInCalendarDays=(r,c)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,c):Nw(r,c),this.differenceInCalendarMonths=(r,c)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,c):Tw(r,c),this.eachMonthOfInterval=r=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):Pw(r),this.eachYearOfInterval=r=>{const c=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(r):Mw(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):U1(r,this),this.endOfISOWeek=r=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(r):Lw(r),this.endOfMonth=r=>this.overrides?.endOfMonth?this.overrides.endOfMonth(r):jw(r),this.endOfWeek=(r,c)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(r,c):Ew(r,this.options),this.endOfYear=r=>this.overrides?.endOfYear?this.overrides.endOfYear(r):Rw(r),this.format=(r,c,d)=>{const h=this.overrides?.format?this.overrides.format(r,c,this.options):Tr(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):Ow(r),this.getMonth=(r,c)=>this.overrides?.getMonth?this.overrides.getMonth(r,this.options):Iw(r,this.options),this.getYear=(r,c)=>this.overrides?.getYear?this.overrides.getYear(r,this.options):_w(r,this.options),this.getWeek=(r,c)=>this.overrides?.getWeek?this.overrides.getWeek(r,this.options):Uw(r,this.options),this.isAfter=(r,c)=>this.overrides?.isAfter?this.overrides.isAfter(r,c):Hw(r,c),this.isBefore=(r,c)=>this.overrides?.isBefore?this.overrides.isBefore(r,c):zw(r,c),this.isDate=r=>this.overrides?.isDate?this.overrides.isDate(r):Bw(r),this.isSameDay=(r,c)=>this.overrides?.isSameDay?this.overrides.isSameDay(r,c):Fw(r,c),this.isSameMonth=(r,c)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(r,c):Kw(r,c),this.isSameYear=(r,c)=>this.overrides?.isSameYear?this.overrides.isSameYear(r,c):qw(r,c),this.max=r=>this.overrides?.max?this.overrides.max(r):Gw(r),this.min=r=>this.overrides?.min?this.overrides.min(r):Vw(r),this.setMonth=(r,c)=>this.overrides?.setMonth?this.overrides.setMonth(r,c):Yw(r,c),this.setYear=(r,c)=>this.overrides?.setYear?this.overrides.setYear(r,c):Ww(r,c),this.startOfBroadcastWeek=(r,c)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):Ax(r,this),this.startOfDay=r=>this.overrides?.startOfDay?this.overrides.startOfDay(r):Qw(r),this.startOfISOWeek=r=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(r):$w(r),this.startOfMonth=r=>this.overrides?.startOfMonth?this.overrides.startOfMonth(r):Xw(r),this.startOfWeek=(r,c)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(r,this.options):Jw(r,this.options),this.startOfYear=r=>this.overrides?.startOfYear?this.overrides.startOfYear(r):Zw(r),this.options={locale:Dx,...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 Vn=new fn;class Nx{constructor(a,o,r=Vn){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 H1{constructor(a,o){this.date=a,this.weeks=o}}class z1{constructor(a,o){this.days=o,this.weekNumber=a}}function B1(t){return ue.createElement("button",{...t})}function F1(t){return ue.createElement("span",{...t})}function K1(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 q1(t){const{day:a,modifiers:o,...r}=t;return ue.createElement("td",{...r})}function G1(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 Ln;(function(t){t.range_end="range_end",t.range_middle="range_middle",t.range_start="range_start",t.selected="selected"})(Ln||(Ln={}));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 V1(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:x})=>ue.createElement(r.Option,{key:g,value:g,disabled:x},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 Y1(t){return ue.createElement("div",{...t})}function W1(t){return ue.createElement("div",{...t})}function Q1(t){const{calendarMonth:a,displayIndex:o,...r}=t;return ue.createElement("div",{...r},t.children)}function $1(t){const{calendarMonth:a,displayIndex:o,...r}=t;return ue.createElement("div",{...r})}function X1(t){return ue.createElement("table",{...t})}function J1(t){return ue.createElement("div",{...t})}const Tx=S.createContext(void 0);function $r(){const t=S.useContext(Tx);if(t===void 0)throw new Error("useDayPicker() must be used within a custom component.");return t}function Z1(t){const{components:a}=$r();return ue.createElement(a.Dropdown,{...t})}function eL(t){const{onPreviousClick:a,onNextClick:o,previousMonth:r,nextMonth:c,...d}=t,{components:h,classNames:p,labels:{labelPrevious:g,labelNext:m}}=$r(),x=S.useCallback(C=>{c&&o?.(C)},[c,o]),b=S.useCallback(C=>{r&&a?.(C)},[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:x},ue.createElement(h.Chevron,{disabled:c?void 0:!0,orientation:"right",className:p[Ce.Chevron]})))}function tL(t){const{components:a}=$r();return ue.createElement(a.Button,{...t})}function nL(t){return ue.createElement("option",{...t})}function aL(t){const{components:a}=$r();return ue.createElement(a.Button,{...t})}function iL(t){const{rootRef:a,...o}=t;return ue.createElement("div",{...o,ref:a})}function oL(t){return ue.createElement("select",{...t})}function rL(t){const{week:a,...o}=t;return ue.createElement("tr",{...o})}function sL(t){return ue.createElement("th",{...t})}function lL(t){return ue.createElement("thead",{"aria-hidden":!0},ue.createElement("tr",{...t}))}function cL(t){const{week:a,...o}=t;return ue.createElement("th",{...o})}function uL(t){return ue.createElement("th",{...t})}function dL(t){return ue.createElement("tbody",{...t})}function hL(t){const{components:a}=$r();return ue.createElement(a.Dropdown,{...t})}const fL=Object.freeze(Object.defineProperty({__proto__:null,Button:B1,CaptionLabel:F1,Chevron:K1,Day:q1,DayButton:G1,Dropdown:V1,DropdownNav:Y1,Footer:W1,Month:Q1,MonthCaption:$1,MonthGrid:X1,Months:J1,MonthsDropdown:Z1,Nav:eL,NextMonthButton:tL,Option:nL,PreviousMonthButton:aL,Root:iL,Select:oL,Week:rL,WeekNumber:cL,WeekNumberHeader:uL,Weekday:sL,Weekdays:lL,Weeks:dL,YearsDropdown:hL},Symbol.toStringTag,{value:"Module"}));function va(t,a,o=!1,r=Vn){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 Fh(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function Xl(t){return!!(t&&typeof t=="object"&&"from"in t)}function Kh(t){return!!(t&&typeof t=="object"&&"after"in t)}function qh(t){return!!(t&&typeof t=="object"&&"before"in t)}function Px(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function Mx(t,a){return Array.isArray(t)&&t.every(a.isDate)}function xa(t,a,o=Vn){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(Mx(p,o))return p.some(g=>c(t,g));if(Xl(p))return va(p,t,!1,o);if(Px(p))return Array.isArray(p.dayOfWeek)?p.dayOfWeek.includes(t.getDay()):p.dayOfWeek===t.getDay();if(Fh(p)){const g=d(p.before,t),m=d(p.after,t),x=g>0,b=m<0;return h(p.before,p.after)?b&&x:x||b}return Kh(p)?d(t,p.after)>0:qh(p)?d(p.before,t)>0:typeof p=="function"?p(t):!1})}function pL(t,a,o,r,c){const{disabled:d,hidden:h,modifiers:p,showOutsideDays:g,broadcastCalendar:m,today:x=c.today()}=a,{isSameDay:b,isSameMonth:C,startOfMonth:T,isBefore:w,endOfMonth:M,isAfter:E}=c,j=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&&!C(k,O)),_=!!(j&&w(k,j)),q=!!(D&&E(k,D)),ee=!!(d&&xa(k,d,c)),Y=!!(h&&xa(k,h,c))||_||q||!m&&!g&&U||m&&g===!1&&U,$=b(k,x);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&&xa(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(q=>q===P)}for(const U in A)O[U]=A[U].some(_=>_===P);return{...k,...O}}}function gL(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[Ln[d]]&&c.push(a[Ln[d]]),c),[a[Ce.Day]])}function mL(t){return{...fL,...t}}function yL(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 bL(){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 Ln)t[Ln[a]]=`rdp-${Ln[a]}`;for(const a in hn)t[hn[a]]=`rdp-${hn[a]}`;return t}function Lx(t,a,o){return(o??new fn(a)).formatMonthYear(t)}const vL=Lx;function xL(t,a,o){return(o??new fn(a)).format(t,"d")}function CL(t,a=Vn){return a.format(t,"LLLL")}function SL(t,a,o){return(o??new fn(a)).format(t,"cccccc")}function wL(t,a=Vn){return t<10?a.formatNumber(`0${t.toLocaleString()}`):a.formatNumber(`${t.toLocaleString()}`)}function kL(){return""}function jx(t,a=Vn){return a.format(t,"yyyy")}const AL=jx,DL=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:Lx,formatDay:xL,formatMonthCaption:vL,formatMonthDropdown:CL,formatWeekNumber:wL,formatWeekNumberHeader:kL,formatWeekdayName:SL,formatYearCaption:AL,formatYearDropdown:jx},Symbol.toStringTag,{value:"Module"}));function NL(t){return t?.formatMonthCaption&&!t.formatCaption&&(t.formatCaption=t.formatMonthCaption),t?.formatYearCaption&&!t.formatYearDropdown&&(t.formatYearDropdown=t.formatYearCaption),{...DL,...t}}function Gh(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 TL=Gh;function Vh(t,a,o){return(o??new fn(a)).formatMonthYear(t)}const PL=Vh;function Ex(t,a,o,r){let c=(r??new fn(o)).format(t,"PPPP");return a?.today&&(c=`Today, ${c}`),c}function Rx(t){return"Choose the Month"}function Ox(){return""}const ML="Go to the Next Month";function Ix(t,a){return ML}function _x(t){return"Go to the Previous Month"}function Ux(t,a,o){return(o??new fn(a)).format(t,"cccc")}function Hx(t,a){return`Week ${t}`}function zx(t){return"Week Number"}function Bx(t){return"Choose the Year"}const LL=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:PL,labelDay:TL,labelDayButton:Gh,labelGrid:Vh,labelGridcell:Ex,labelMonthDropdown:Rx,labelNav:Ox,labelNext:Ix,labelPrevious:_x,labelWeekNumber:Hx,labelWeekNumberHeader:zx,labelWeekday:Ux,labelYearDropdown:Bx},Symbol.toStringTag,{value:"Module"})),Mn=(t,a,o)=>a||(o?typeof o=="function"?o:(...r)=>o:t);function jL(t,a){const o=a.locale?.labels??{};return{...LL,...t??{},labelDayButton:Mn(Gh,t?.labelDayButton,o.labelDayButton),labelMonthDropdown:Mn(Rx,t?.labelMonthDropdown,o.labelMonthDropdown),labelNext:Mn(Ix,t?.labelNext,o.labelNext),labelPrevious:Mn(_x,t?.labelPrevious,o.labelPrevious),labelWeekNumber:Mn(Hx,t?.labelWeekNumber,o.labelWeekNumber),labelYearDropdown:Mn(Bx,t?.labelYearDropdown,o.labelYearDropdown),labelGrid:Mn(Vh,t?.labelGrid,o.labelGrid),labelGridcell:Mn(Ex,t?.labelGridcell,o.labelGridcell),labelNav:Mn(Ox,t?.labelNav,o.labelNav),labelWeekNumberHeader:Mn(zx,t?.labelWeekNumberHeader,o.labelWeekNumberHeader),labelWeekday:Mn(Ux,t?.labelWeekday,o.labelWeekday)}}function EL(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(C=>{const T=r.formatMonthDropdown(C,c),w=m(C),M=a&&C<d(a)||o&&C>d(o)||!1;return{value:w,label:T,disabled:M}})}function RL(t,a={},o={}){let r={...a?.[Ce.Day]};return Object.entries(t).filter(([,c])=>c===!0).forEach(([c])=>{r={...r,...o?.[c]}}),r}function OL(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 IL(t,a,o,r,c=!1){if(!t||!a)return;const{startOfYear:d,endOfYear:h,eachYearOfInterval:p,getYear:g}=r,m=d(t),x=h(a),b=p({start:m,end:x});return c&&b.reverse(),b.map(C=>{const T=o.formatYearDropdown(C,r);return{value:g(C),label:T,disabled:!1}})}const Xr=t=>t instanceof HTMLElement?t:null,Pd=t=>[...t.querySelectorAll("[data-animated-month]")??[]],_L=t=>Xr(t.querySelector("[data-animated-month]")),Md=t=>Xr(t.querySelector("[data-animated-caption]")),Ld=t=>Xr(t.querySelector("[data-animated-weeks]")),UL=t=>Xr(t.querySelector("[data-animated-nav]")),HL=t=>Xr(t.querySelector("[data-animated-weekdays]"));function zL(t,a,{classNames:o,months:r,focused:c,dateLib:d}){const h=S.useRef(null),p=S.useRef(r),g=S.useRef(!1);S.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 x=d.isSameMonth(r[0].date,m[0].date),b=d.isAfter(r[0].date,m[0].date),C=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?(Pd(M).forEach(N=>{if(!(N instanceof HTMLElement))return;const A=_L(N);A&&N.contains(A)&&N.removeChild(A);const P=Md(N);P&&P.classList.remove(C);const k=Ld(N);k&&k.classList.remove(T)}),h.current=M):h.current=null,g.current||x||c)return;const E=w instanceof HTMLElement?Pd(w):[],j=Pd(t.current);if(j?.every(D=>D instanceof HTMLElement)&&E&&E.every(D=>D instanceof HTMLElement)){g.current=!0,t.current.style.isolation="isolate";const D=UL(t.current);D&&(D.style.zIndex="1"),j.forEach((N,A)=>{const P=E[A];if(!P)return;N.style.position="relative",N.style.overflow="hidden";const k=Md(N);k&&k.classList.add(C);const O=Ld(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(C),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 _=HL(P);_&&(_.style.opacity="0");const q=Md(P);q&&(q.classList.add(b?o[hn.caption_before_exit]:o[hn.caption_after_exit]),q.addEventListener("animationend",U));const ee=Ld(P);ee&&ee.classList.add(b?o[hn.weeks_before_exit]:o[hn.weeks_after_exit]),N.insertBefore(P,N.firstChild)})}})}function BL(t,a,o,r){const c=t[0],d=t[t.length-1],{ISOWeek:h,fixedWeeks:p,broadcastCalendar:g}=o??{},{addDays:m,differenceInCalendarDays:x,differenceInCalendarMonths:b,endOfBroadcastWeek:C,endOfISOWeek:T,endOfMonth:w,endOfWeek:M,isAfter:E,startOfBroadcastWeek:j,startOfISOWeek:D,startOfWeek:N}=r,A=g?j(c,r):h?D(c):N(c),P=g?C(d):h?T(w(d)):M(w(d)),k=a&&(g?C(a):h?T(a):M(a)),O=k&&E(P,k)?k:P,U=x(O,A),_=b(d,c)+1,q=[];for(let $=0;$<=U;$++){const fe=m(A,$);q.push(fe)}const Y=(g?35:42)*_;if(p&&q.length<Y){const $=Y-q.length;for(let fe=0;fe<$;fe++){const pe=m(q[q.length-1],1);q.push(pe)}}return q}function FL(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 KL(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 gb(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:x,startOfMonth:b}=r;if(o&&m(o,g)<p-1){const C=-1*(p-1);g=x(o,C)}return a&&m(g,a)<0&&(g=a),b(g)}function qL(t,a,o,r){const{addDays:c,endOfBroadcastWeek:d,endOfISOWeek:h,endOfMonth:p,endOfWeek:g,getISOWeek:m,getWeek:x,startOfBroadcastWeek:b,startOfISOWeek:C,startOfWeek:T}=r,w=t.reduce((M,E)=>{const j=o.broadcastCalendar?b(E,r):o.ISOWeek?C(E):T(E),D=o.broadcastCalendar?d(E):o.ISOWeek?h(p(E)):g(p(E)),N=a.filter(O=>O>=j&&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):x(U),q=O.find(Y=>Y.weekNumber===_),ee=new Nx(U,E,r);return q?q.days.push(ee):O.push(new z1(_,[ee])),O},[]),k=new H1(E,P);return M.push(k),M},[]);return o.reverseMonths?w.reverse():w}function GL(t,a){let{startMonth:o,endMonth:r}=t;const{startOfYear:c,startOfDay:d,startOfMonth:h,endOfMonth:p,addYears:g,endOfYear:m,newDate:x,today:b}=a,{fromYear:C,toYear:T,fromMonth:w,toMonth:M}=t;!o&&w&&(o=w),!o&&C&&(o=a.newDate(C,0,1)),!r&&M&&(r=M),!r&&T&&(r=x(T,11,31));const E=t.captionLayout==="dropdown"||t.captionLayout==="dropdown-years";return o?o=h(o):C?o=x(C,0,1):!o&&E&&(o=c(g(t.today??b(),-100))),r?r=p(r):T?r=x(T,11,31):!r&&E&&(r=m(t.today??b())),[o&&d(o),r&&d(r)]}function VL(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,x=h(t);if(!a)return p(x,m);if(!(g(a,t)<d))return p(x,m)}function YL(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,x=h(t);if(!a)return p(x,-m);if(!(g(x,a)<=0))return p(x,-m)}function WL(t){const a=[];return t.reduce((o,r)=>o.concat(r.weeks.slice()),a.slice())}function Jl(t,a){const[o,r]=S.useState(t);return[a===void 0?o:a,r]}function QL(t,a){const[o,r]=GL(t,a),{startOfMonth:c,endOfMonth:d}=a,h=gb(t,o,r,a),[p,g]=Jl(h,t.month?h:void 0);S.useEffect(()=>{const A=gb(t,o,r,a);g(A)},[t.timeZone]);const{months:m,weeks:x,days:b,previousMonth:C,nextMonth:T}=S.useMemo(()=>{const A=KL(p,r,{numberOfMonths:t.numberOfMonths},a),P=BL(A,t.endMonth?d(t.endMonth):void 0,{ISOWeek:t.ISOWeek,fixedWeeks:t.fixedWeeks,broadcastCalendar:t.broadcastCalendar},a),k=qL(A,P,{broadcastCalendar:t.broadcastCalendar,fixedWeeks:t.fixedWeeks,ISOWeek:t.ISOWeek,reverseMonths:t.reverseMonths},a),O=WL(k),U=FL(k),_=YL(p,o,t,a),q=VL(p,r,t,a);return{months:k,weeks:O,days:U,previousMonth:_,nextMonth:q}},[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,E=A=>x.some(P=>P.days.some(k=>k.isEqualTo(A))),j=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:x,days:b,navStart:o,navEnd:r,previousMonth:C,nextMonth:T,goToMonth:j,goToDay:A=>{E(A)||j(A.date)}}}var Bn;(function(t){t[t.Today=0]="Today",t[t.Selected=1]="Selected",t[t.LastFocused=2]="LastFocused",t[t.FocusedModifier=3]="FocusedModifier"})(Bn||(Bn={}));function mb(t){return!t[pt.disabled]&&!t[pt.hidden]&&!t[pt.outside]}function $L(t,a,o,r){let c,d=-1;for(const h of t){const p=a(h);mb(p)&&(p[pt.focused]&&d<Bn.FocusedModifier?(c=h,d=Bn.FocusedModifier):r?.isEqualTo(h)&&d<Bn.LastFocused?(c=h,d=Bn.LastFocused):o(h.date)&&d<Bn.Selected?(c=h,d=Bn.Selected):p[pt.today]&&d<Bn.Today&&(c=h,d=Bn.Today))}return c||(c=t.find(h=>mb(a(h)))),c}function XL(t,a,o,r,c,d,h){const{ISOWeek:p,broadcastCalendar:g}=d,{addDays:m,addMonths:x,addWeeks:b,addYears:C,endOfBroadcastWeek:T,endOfISOWeek:w,endOfWeek:M,max:E,min:j,startOfBroadcastWeek:D,startOfISOWeek:N,startOfWeek:A}=h;let k={day:m,week:b,month:x,year:C,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=E([r,k]):a==="after"&&c&&(k=j([c,k])),k}function Fx(t,a,o,r,c,d,h,p=0){if(p>365)return;const g=XL(t,a,o.date,r,c,d,h),m=!!(d.disabled&&xa(g,d.disabled,h)),x=!!(d.hidden&&xa(g,d.hidden,h)),b=g,C=new Nx(g,b,h);return!m&&!x?C:Fx(t,a,C,r,c,d,h,p+1)}function JL(t,a,o,r,c){const{autoFocus:d}=t,[h,p]=S.useState(),g=$L(a.days,o,r||(()=>!1),h),[m,x]=S.useState(d?g:void 0);return{isFocusTarget:M=>!!g?.isEqualTo(M),setFocused:x,focused:m,blur:()=>{p(m),x(void 0)},moveFocus:(M,E)=>{if(!m)return;const j=Fx(M,E,m,a.navStart,a.navEnd,t,c);j&&(t.disableNavigation&&!a.days.some(N=>N.isEqualTo(j))||(a.goToDay(j),x(j)))}}}function ZL(t,a){const{selected:o,required:r,onSelect:c}=t,[d,h]=Jl(o,c?o:void 0),p=c?o:d,{isSameDay:g}=a,m=T=>p?.some(w=>g(w,T))??!1,{min:x,max:b}=t;return{selected:p,select:(T,w,M)=>{let E=[...p??[]];if(m(T)){if(p?.length===x||r&&p?.length===1)return;E=p?.filter(j=>!g(j,T))}else p?.length===b?E=[T]:E=[...E,T];return c||h(E),c?.(E,T,w,M),E},isSelected:m}}function ej(t,a,o=0,r=0,c=!1,d=Vn){const{from:h,to:p}=a||{},{isSameDay:g,isAfter:m,isBefore:x}=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:x(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(x(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 C=d.differenceInCalendarDays(b.to,b.from);r>0&&C>r?b={from:t,to:void 0}:o>1&&C<o&&(b={from:t,to:void 0})}return b}function tj(t,a,o=Vn){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 yb(t,a,o=Vn){return va(t,a.from,!1,o)||va(t,a.to,!1,o)||va(a,t.from,!1,o)||va(a,t.to,!1,o)}function nj(t,a,o=Vn){const r=Array.isArray(a)?a:[a];if(r.filter(p=>typeof p!="function").some(p=>typeof p=="boolean"?p:o.isDate(p)?va(t,p,!1,o):Mx(p,o)?p.some(g=>va(t,g,!1,o)):Xl(p)?p.from&&p.to?yb(t,{from:p.from,to:p.to},o):!1:Px(p)?tj(t,p.dayOfWeek,o):Fh(p)?o.isAfter(p.before,p.after)?yb(t,{from:o.addDays(p.after,1),to:o.addDays(p.before,-1)},o):xa(t.from,p,o)||xa(t.to,p,o):Kh(p)||qh(p)?xa(t.from,p,o)||xa(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(x=>x(p)))return!0;p=o.addDays(p,1)}}return!1}function aj(t,a){const{disabled:o,excludeDisabled:r,selected:c,required:d,onSelect:h}=t,[p,g]=Jl(c,h?c:void 0),m=h?c:p;return{selected:m,select:(C,T,w)=>{const{min:M,max:E}=t,j=C?ej(C,m,M,E,d,a):void 0;return r&&o&&j?.from&&j.to&&nj({from:j.from,to:j.to},o,a)&&(j.from=C,j.to=void 0),h||g(j),h?.(j,C,T,w),j},isSelected:C=>m&&va(m,C,!1,a)}}function ij(t,a){const{selected:o,required:r,onSelect:c}=t,[d,h]=Jl(o,c?o:void 0),p=c?o:d,{isSameDay:g}=a;return{selected:p,select:(b,C,T)=>{let w=b;return!r&&p&&p&&g(b,p)&&(w=void 0),c||h(w),c?.(w,b,C,T),w},isSelected:b=>p?g(p,b):!1}}function oj(t,a){const o=ij(t,a),r=ZL(t,a),c=aj(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 ba&&t.timeZone===a?t:new ba(t,a)}function bb(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):Xl(t)?{...t,from:t.from?Ht(t.from,a):t.from,to:t.to?Ht(t.to,a):t.to}:Fh(t)?{before:Ht(t.before,a),after:Ht(t.after,a)}:Kh(t)?{after:Ht(t.after,a)}:qh(t)?{before:Ht(t.before,a)}:t}function jd(t,a){return t&&(Array.isArray(t)?t.map(o=>bb(o,a)):bb(t,a))}function rj(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=jd(a.disabled,o)),a.hidden!==void 0&&(a.hidden=jd(a.hidden,o)),a.modifiers)){const ve={};Object.keys(a.modifiers).forEach(Me=>{ve[Me]=jd(a.modifiers?.[Me],o)}),a.modifiers=ve}const{components:r,formatters:c,labels:d,dateLib:h,locale:p,classNames:g}=S.useMemo(()=>{const ve={...Dx,...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:mL(a.components),formatters:NL(a.formatters),labels:jL(a.labels,Me.options),locale:ve,classNames:{...bL(),...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:x,navLayout:b,numberOfMonths:C=1,onDayBlur:T,onDayClick:w,onDayFocus:M,onDayKeyDown:E,onDayMouseEnter:j,onDayMouseLeave:D,onNextClick:N,onPrevClick:A,showWeekNumber:P,styles:k}=a,{formatCaption:O,formatDay:U,formatMonthDropdown:_,formatWeekNumber:q,formatWeekNumberHeader:ee,formatWeekdayName:Y,formatYearDropdown:$}=c,fe=QL(a,h),{days:pe,months:H,navStart:Z,navEnd:ne,previousMonth:Q,nextMonth:se,goToMonth:de}=fe,ge=pL(pe,a,Z,ne,h),{isSelected:J,select:ae,selected:he}=oj(a,h)??{},{blur:oe,focused:le,isFocusTarget:xe,moveFocus:Pe,setFocused:He}=JL(a,fe,ge,J??(()=>!1),h),{labelDayButton:Je,labelGridcell:we,labelGrid:Re,labelMonthDropdown:Ve,labelNav:Tt,labelPrevious:Et,labelNext:Yn,labelWeekday:Le,labelWeekNumber:Zt,labelWeekNumberHeader:En,labelYearDropdown:en}=d,Ta=S.useMemo(()=>OL(h,a.ISOWeek,a.broadcastCalendar,a.today),[h,a.ISOWeek,a.broadcastCalendar,a.today]),Wn=x!==void 0||w!==void 0,bt=S.useCallback(()=>{Q&&(de(Q),A?.(Q))},[Q,de,A]),tn=S.useCallback(()=>{se&&(de(se),N?.(se))},[de,se,N]),Qn=S.useCallback((ve,Me)=>Ae=>{Ae.preventDefault(),Ae.stopPropagation(),He(ve),!Me.disabled&&(ae?.(ve.date,Me,Ae),w?.(ve.date,Me,Ae))},[ae,w,He]),ni=S.useCallback((ve,Me)=>Ae=>{He(ve),M?.(ve.date,Me,Ae)},[M,He]),Rn=S.useCallback((ve,Me)=>Ae=>{oe(),T?.(ve.date,Me,Ae)},[oe,T]),On=S.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)}E?.(ve.date,Me,Ae)},[Pe,E,a.dir]),Li=S.useCallback((ve,Me)=>Ae=>{j?.(ve.date,Me,Ae)},[j]),Po=S.useCallback((ve,Me)=>Ae=>{D?.(ve.date,Me,Ae)},[D]),Mo=S.useCallback(ve=>Me=>{const Ae=Number(Me.target.value),_e=h.setMonth(h.startOfMonth(ve),Ae);de(_e)},[h,de]),$n=S.useCallback(ve=>Me=>{const Ae=Number(Me.target.value),_e=h.setYear(h.startOfMonth(ve),Ae);de(_e)},[h,de]),{className:te,style:Oe}=S.useMemo(()=>({className:[g[Ce.Root],a.className].filter(Boolean).join(" "),style:{...k?.[Ce.Root],...a.style}}),[g,a.className,a.style,k]),ke=yL(a),Ie=S.useRef(null);zL(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(Tx.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":Et(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:Mo(ve.date),options:EL(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:$n(ve.date),options:IL(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===C-1&&ue.createElement(r.NextMonthButton,{type:"button",className:g[Ce.NextMonthButton],tabIndex:se?void 0:-1,"aria-disabled":se?void 0:!0,"aria-label":Yn(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===C-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":x==="multiple"||x==="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":En(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"},q(Ae.weekNumber,h)),Ae.days.map(_e=>{const{date:ct}=_e,Ne=ge(_e);if(Ne[pt.focused]=!Ne.hidden&&!!le?.isEqualTo(_e),Ne[Ln.selected]=J?.(ct)||Ne.selected,Xl(he)){const{from:nn,to:Dn}=he;Ne[Ln.range_start]=!!(nn&&Dn&&h.isSameDay(ct,nn)),Ne[Ln.range_end]=!!(nn&&Dn&&h.isSameDay(ct,Dn)),Ne[Ln.range_middle]=va(he,ct,!0,h)}const zt=RL(Ne,k,a.modifiersStyles),Xn=gL(Ne,g,a.modifiersClassNames),Pt=!Wn&&!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:Xn.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&&Wn?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:Qn(_e,Ne),onBlur:Rn(_e,Ne),onFocus:ni(_e,Ne),onKeyDown:On(_e,Ne),onMouseEnter:Li(_e,Ne),onMouseLeave:Po(_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 sj({className:t,classNames:a,showOutsideDays:o=!0,...r}){return l.jsx(rj,{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(ml({variant:"ghost"}),"h-7 w-7 bg-transparent p-0 opacity-70 hover:opacity-100 hover:bg-accent rounded-md"),button_next:z(ml({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(ml({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"?vw:c==="right"?Ll:c==="up"?nh:jl;return l.jsx(p,{className:z("h-4 w-4",d),...h})}},...r})}sj.displayName="Calendar";const lj=S.lazy(()=>tt(()=>Promise.resolve().then(()=>$l),void 0).then(t=>({default:t.CodeEditor})));function GE({rawJsonContent:t,isRawJsonValid:a,rawJsonEdits:o,rawSettingsEnv:r,onChange:c,missingRequiredFields:d=[]}){const{t:h}=ye(),p=d.length>0;return l.jsx(S.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(No,{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(Gn,{className:"w-4 h-4 mt-0.5 text-amber-500 shrink-0"}),l.jsxs("div",{children:[l.jsx("span",{className:"font-medium text-amber-600 dark:text-amber-400",children:"Missing required fields:"})," ",l.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:d.join(", ")}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"These fields will use default values at runtime."})]})]}),l.jsx("div",{className:"min-h-0 flex-1 overflow-hidden px-6 pb-4 pt-4",children:l.jsx("div",{className:"h-full border rounded-md overflow-hidden bg-background",children:l.jsx(lj,{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(Ih,{profileEnv:r})})})]})})}S.lazy(()=>tt(()=>Promise.resolve().then(()=>$l),void 0).then(t=>({default:t.CodeEditor})));function cj(){const{t}=ye(),{isDark:a,setTheme:o}=ph(),[r,c]=S.useState(""),[d,h]=S.useState(""),[p,g]=S.useState(!1),[m,x]=S.useState(null),[b,C]=S.useState(!1),{login:T,authRequired:w,isAuthenticated:M,loading:E,accessMode:j,authEnabled:D}=_l(),N=eh(),A=Ml(),P=j==="setup",k=t(P?"auth.remoteGuardLabel":"auth.protectedAccessLabel"),O=t(P?D?"auth.incompleteSetupDescription":"auth.remoteSetupDescription":"auth.loginDescription"),U=A.state?.from?.pathname||"/";if(S.useEffect(()=>{E||(M||!w)&&N(U,{replace:!0})},[M,w,E,N,U]),E)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 q=>{q.preventDefault(),x(null),C(!0);try{await T(r,d),N(U,{replace:!0})}catch(ee){x(ee instanceof Error?ee.message:t("auth.loginFailed"))}finally{C(!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(ul,{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(rt,{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(Yb,{className:"h-3.5 w-3.5"}),t("auth.lightMode")]}),l.jsxs(rt,{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(Wb,{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(qm,{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(Gm,{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(ul,{className:"mb-3 h-4 w-4 text-accent"}),l.jsx("p",{children:t("auth.safetyNoteSession")})]})]})]}),l.jsxs(HM,{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(zM,{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(qm,{className:"h-5 w-5 text-accent"}):l.jsx(Gm,{className:"h-5 w-5 text-accent"})}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(BM,{className:"text-2xl tracking-[-0.03em]",children:t(P?"auth.remoteSetupTitle":"auth.dashboardTitle")}),l.jsx(FM,{className:"text-sm leading-6 text-muted-foreground",children:P?O:t("auth.credentialsHint")})]})]}),l.jsx(KM,{className:"space-y-5 px-6 py-6",children:P?l.jsxs(l.Fragment,{children:[l.jsxs(_r,{variant:"warning",className:"rounded-2xl border-yellow-300/70 bg-yellow-50/80",children:[l.jsx(Br,{className:"h-4 w-4"}),l.jsx(Nl,{children:t("auth.noDefaultCredentials")}),l.jsx(Ur,{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(xw,{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(ul,{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(_r,{variant:"destructive",className:"rounded-2xl",children:[l.jsx(Br,{className:"h-4 w-4"}),l.jsx(Ur,{children:m})]}),l.jsxs(_r,{variant:"info",className:"rounded-2xl border-blue-200/80 bg-blue-50/80",children:[l.jsx(ul,{className:"h-4 w-4"}),l.jsx(Nl,{children:t("auth.noDefaultCredentials")}),l.jsx(Ur,{children:t("auth.credentialsHint")})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Kt,{htmlFor:"username",className:"text-sm font-semibold",children:t("auth.username")}),l.jsx(zn,{id:"username",type:"text",value:r,onChange:q=>c(q.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(Kt,{htmlFor:"password",className:"text-sm font-semibold",children:t("auth.password")}),l.jsxs("div",{className:"relative",children:[l.jsx(zn,{id:"password",type:p?"text":"password",value:d,onChange:q=>h(q.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(rt,{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(q=>!q),disabled:b,children:p?l.jsx(Vr,{className:"h-4 w-4"}):l.jsx(Yr,{className:"h-4 w-4"})})]})]}),l.jsx(rt,{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 uj=S.lazy(()=>tt(()=>import("./index-C2-J9AKi.js"),__vite__mapDeps([22,1,2,4,5,7,23,6,8,9])).then(t=>({default:t.AnalyticsPage}))),dj=S.lazy(()=>tt(()=>import("./api-BVo8Vm1B.js"),__vite__mapDeps([24,1,2,5,25,18,6,4,3,7,8,9])).then(t=>({default:t.ApiPage}))),hj=S.lazy(()=>tt(()=>import("./cliproxy-D50Owb9u.js"),__vite__mapDeps([26,1,2,5,16,6,4,19,27,25,18,28,29,17,7,8,9])).then(t=>({default:t.CliproxyPage}))),fj=S.lazy(()=>tt(()=>import("./cliproxy-ai-providers-Cjrk90aJ.js"),__vite__mapDeps([30,1,2,17,18,5,6,4,25,7,8,9])).then(t=>({default:t.CliproxyAiProvidersPage}))),pj=S.lazy(()=>tt(()=>import("./cliproxy-control-panel-DL8JoyKU.js"),__vite__mapDeps([31,1,2,5,16,4,6,7,8,9])).then(t=>({default:t.CliproxyControlPanelPage}))),gj=S.lazy(()=>tt(()=>import("./copilot-CPLBRpFA.js"),__vite__mapDeps([32,1,2,5,25,18,4,28,29,6,7,8,9])).then(t=>({default:t.CopilotPage}))),mj=S.lazy(()=>tt(()=>import("./cursor-D1xhqEEF.js"),__vite__mapDeps([33,1,2,6,5,16,28,29,4,7,8,9])).then(t=>({default:t.CursorPage}))),yj=S.lazy(()=>tt(()=>import("./claude-extension-lDT7lp8C.js"),__vite__mapDeps([34,1,2,5,6,4,7,8,9])).then(t=>({default:t.ClaudeExtensionPage}))),bj=S.lazy(()=>tt(()=>import("./codex-B3bW7lzx.js"),__vite__mapDeps([35,1,2,6,4,28,5,9,7,36,37,8])).then(t=>({default:t.CodexPage}))),vj=S.lazy(()=>tt(()=>import("./droid-DiFtSJkl.js"),__vite__mapDeps([38,1,2,6,5,37,4,28,7,8,9])).then(t=>({default:t.DroidPage}))),xj=S.lazy(()=>tt(()=>import("./logs-kvpMF-pw.js"),__vite__mapDeps([39,1,2,4,5,6,7,8,9])).then(t=>({default:t.LogsPage}))),Cj=S.lazy(()=>tt(()=>import("./accounts-DfkqFx14.js"),__vite__mapDeps([40,1,2,5,36,18,6,4,27,7,8,9])).then(t=>({default:t.AccountsPage}))),Sj=S.lazy(()=>tt(()=>Promise.resolve().then(()=>L1),void 0).then(t=>({default:t.SettingsPage}))),wj=S.lazy(()=>tt(()=>import("./health-Bxol1p1X.js"),__vite__mapDeps([41,1,2,5,6,4,7,8,9])).then(t=>({default:t.HealthPage}))),kj=S.lazy(()=>tt(()=>import("./shared-Dx_5pa5N.js"),__vite__mapDeps([42,1,2,4,5,6,7,8,9])).then(t=>({default:t.SharedPage}))),Aj=S.lazy(()=>tt(()=>import("./updates-mWDqf-fm.js"),__vite__mapDeps([43,1,2,4,5,6,7,8,9])).then(t=>({default:t.UpdatesPage})));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 Dj(){return l.jsx(H0,{client:pk,children:l.jsx(lA,{defaultTheme:"system",storageKey:"vite-ui-theme",children:l.jsx(cA,{children:l.jsx(pA,{children:l.jsxs(O0,{children:[l.jsxs(I0,{children:[l.jsx(Ct,{path:"/login",element:l.jsx(cj,{})}),l.jsx(Ct,{element:l.jsx(gA,{}),children:l.jsxs(Ct,{element:l.jsx(CN,{}),children:[l.jsx(Ct,{path:"/",element:l.jsx(VP,{})}),l.jsx(Ct,{path:"/analytics",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(uj,{})})}),l.jsx(Ct,{path:"/updates",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(Aj,{})})}),l.jsx(Ct,{path:"/providers",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(dj,{})})}),l.jsx(Ct,{path:"/cliproxy",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(hj,{})})}),l.jsx(Ct,{path:"/cliproxy/ai-providers",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(fj,{})})}),l.jsx(Ct,{path:"/cliproxy/control-panel",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(pj,{})})}),l.jsx(Ct,{path:"/copilot",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(gj,{})})}),l.jsx(Ct,{path:"/cursor",element:l.jsx(Hb,{to:"/cliproxy?provider=cursor",replace:!0})}),l.jsx(Ct,{path:"/legacy/cursor",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(mj,{})})}),l.jsx(Ct,{path:"/claude-extension",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(yj,{})})}),l.jsx(Ct,{path:"/codex",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(bj,{})})}),l.jsx(Ct,{path:"/droid",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(vj,{})})}),l.jsx(Ct,{path:"/accounts",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(Cj,{})})}),l.jsx(Ct,{path:"/settings",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(Sj,{})})}),l.jsx(Ct,{path:"/health",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(wj,{})})}),l.jsx(Ct,{path:"/logs",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(xj,{})})}),l.jsx(Ct,{path:"/shared",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(kj,{})})})]})})]}),l.jsx(z0,{position:"top-right"})]})})})})})}const Kx=document.getElementById("root");if(!Kx)throw new Error("Root element not found. Failed to mount React application.");dk.createRoot(Kx).render(l.jsx(S.StrictMode,{children:l.jsx(Dj,{})}));export{NE as $,XP as A,jt as B,HM as C,aM as D,CE as E,wE as F,WP as G,tM as H,zn as I,iM as J,SE as K,Kt as L,bD as M,vD as N,xD as O,fv as P,lx as Q,Rh as R,$e as S,Sa as T,Tl as U,Wd as V,ie as W,DE as X,Fe as Y,AE as Z,FM as _,ye as a,pD as a$,TE as a0,PE as a1,ME as a2,LE as a3,jE as a4,EE as a5,dx as a6,RE as a7,VM as a8,Dh as a9,_E as aA,UE as aB,IE as aC,UD as aD,xM as aE,OE as aF,lM as aG,yx as aH,yT as aI,ET as aJ,Pi as aK,sN as aL,lN as aM,cN as aN,uN as aO,nT as aP,Tv as aQ,Xj as aR,Jj as aS,Zj as aT,eE as aU,qE as aV,Hj as aW,yD as aX,Gj as aY,Vj as aZ,fD as a_,Nh as aa,Ij as ab,hD as ac,zj as ad,Kj as ae,Wj as af,Qj as ag,gh as ah,mh as ai,yh as aj,bh as ak,vh as al,HE as am,WM as an,zE as ao,Fl as ap,fE as aq,qd as ar,pE as as,Bd as at,$j as au,gE as av,mE as aw,bE as ax,Sy as ay,yE as az,KM as b,Yj as b0,gD as b1,mD as b2,qj as b3,wh as b4,lE as b5,uE as b6,dE as b7,cE as b8,xx as b9,_k as bA,Hk as bB,Kk as bC,Qk as bD,oE as bE,Bj as bF,Fj as bG,nE as bH,aE as bI,sE as bJ,rE as bK,ml as bL,Ih as ba,hE as bb,Pr as bc,_j as bd,Uj as be,_r as bf,Nl as bg,Ur as bh,GE as bi,jh as bj,Kr as bk,Eh as bl,UP as bm,KP as bn,vE as bo,xE as bp,Sx as bq,A1 as br,N1 as bs,iE as bt,tE as bu,rv as bv,Yk as bw,Gk as bx,Id as by,Ni as bz,z as c,rt as d,BE as e,FE as f,QM as g,sj as h,Oj as i,zM as j,BM as k,oT as l,rT as m,To as n,KE as o,wa as p,ka as q,wv as r,kh as s,kv as t,rh as u,Ah as v,Ir as w,Gy as x,sM as y,kE as z};
72
+ `);return{valid:!1,error:r,line:h.length}}return{valid:!1,error:r}}}function C1(t){if(!t.trim())return{valid:!0};try{return y1(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 xx({value:t,onChange:a,language:o="json",readonly:r=!1,className:c,minHeight:d="300px",heightMode:h="content"}){const{isDark:p}=ph(),{t:g}=ye(),[m,x]=S.useState(!1),[b,C]=S.useState(!0),T=h==="fill-parent",w=S.useMemo(()=>o==="json"?x1(t):o==="toml"?C1(t):{valid:!0},[t,o]),M=S.useCallback(E=>l.jsx(rk,{prism:n1,theme:p?Qm.nightOwl:Qm.github,code:E,language:o,children:({tokens:j,getLineProps:D,getTokenProps:N})=>{let A=!1;return l.jsx(l.Fragment,{children:j.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,"");v1(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 q=N({token:O});return _&&b&&(q.className=z(q.className,"blur-[3px] select-none opacity-70 transition-all duration-200")),l.jsx("span",{...q},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(ZM,{value:t,onValueChange:r?()=>{}:a,highlight:M,padding:12,disabled:r,onFocus:()=>x(!0),onBlur:()=>x(!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(rt,{variant:"ghost",size:"icon",className:"h-6 w-6 bg-background/50 hover:bg-background border shadow-sm rounded-full",onClick:()=>C(!b),title:g(b?"codeEditor.revealSensitive":"codeEditor.maskSensitive"),children:b?l.jsx(Yr,{className:"h-3 w-3"}):l.jsx(Vr,{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(Wr,{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(Br,{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 $l=Object.freeze(Object.defineProperty({__proto__:null,CodeEditor:xx},Symbol.toStringTag,{value:"Module"})),S1={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 w1(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 Cx=S.createContext(null);function k1({children:t}){const[a,o]=S.useReducer(w1,S1);return l.jsx(Cx.Provider,{value:{state:a,dispatch:o},children:t})}function Sx(){const t=S.useContext(Cx);if(!t)throw new Error("useSettingsContext must be used within a SettingsProvider");return t}function A1(){const{dispatch:t}=Sx(),a=S.useCallback($=>t({type:"SET_BROWSER_CONFIG",payload:$}),[t]),o=S.useCallback($=>t({type:"SET_BROWSER_STATUS",payload:$}),[t]),r=S.useCallback($=>t({type:"SET_BROWSER_LOADING",payload:$}),[t]),c=S.useCallback($=>t({type:"SET_BROWSER_STATUS_LOADING",payload:$}),[t]),d=S.useCallback($=>t({type:"SET_BROWSER_SAVING",payload:$}),[t]),h=S.useCallback($=>t({type:"SET_BROWSER_ERROR",payload:$}),[t]),p=S.useCallback($=>t({type:"SET_BROWSER_SUCCESS",payload:$}),[t]),g=S.useCallback($=>t({type:"SET_WEBSEARCH_CONFIG",payload:$}),[t]),m=S.useCallback($=>t({type:"SET_WEBSEARCH_STATUS",payload:$}),[t]),x=S.useCallback($=>t({type:"SET_WEBSEARCH_LOADING",payload:$}),[t]),b=S.useCallback($=>t({type:"SET_WEBSEARCH_STATUS_LOADING",payload:$}),[t]),C=S.useCallback($=>t({type:"SET_WEBSEARCH_SAVING",payload:$}),[t]),T=S.useCallback($=>t({type:"SET_WEBSEARCH_ERROR",payload:$}),[t]),w=S.useCallback($=>t({type:"SET_WEBSEARCH_SUCCESS",payload:$}),[t]),M=S.useCallback($=>t({type:"SET_GLOBALENV_CONFIG",payload:$}),[t]),E=S.useCallback($=>t({type:"SET_GLOBALENV_LOADING",payload:$}),[t]),j=S.useCallback($=>t({type:"SET_GLOBALENV_SAVING",payload:$}),[t]),D=S.useCallback($=>t({type:"SET_GLOBALENV_ERROR",payload:$}),[t]),N=S.useCallback($=>t({type:"SET_GLOBALENV_SUCCESS",payload:$}),[t]),A=S.useCallback($=>t({type:"SET_PROXY_CONFIG",payload:$}),[t]),P=S.useCallback($=>t({type:"SET_PROXY_LOADING",payload:$}),[t]),k=S.useCallback($=>t({type:"SET_PROXY_SAVING",payload:$}),[t]),O=S.useCallback($=>t({type:"SET_PROXY_ERROR",payload:$}),[t]),U=S.useCallback($=>t({type:"SET_PROXY_SUCCESS",payload:$}),[t]),_=S.useCallback($=>t({type:"SET_PROXY_TEST_RESULT",payload:$}),[t]),q=S.useCallback($=>t({type:"SET_PROXY_TESTING",payload:$}),[t]),ee=S.useCallback($=>t({type:"SET_RAW_CONFIG",payload:$}),[t]),Y=S.useCallback($=>t({type:"SET_RAW_CONFIG_LOADING",payload:$}),[t]);return S.useMemo(()=>({setBrowserConfig:a,setBrowserStatus:o,setBrowserLoading:r,setBrowserStatusLoading:c,setBrowserSaving:d,setBrowserError:h,setBrowserSuccess:p,setWebSearchConfig:g,setWebSearchStatus:m,setWebSearchLoading:x,setWebSearchStatusLoading:b,setWebSearchSaving:C,setWebSearchError:T,setWebSearchSuccess:w,setGlobalEnvConfig:M,setGlobalEnvLoading:E,setGlobalEnvSaving:j,setGlobalEnvError:D,setGlobalEnvSuccess:N,setProxyConfig:A,setProxyLoading:P,setProxySaving:k,setProxyError:O,setProxySuccess:U,setProxyTestResult:_,setProxyTesting:q,setRawConfig:ee,setRawConfigLoading:Y}),[a,o,r,c,d,h,p,g,m,x,b,C,T,w,M,E,j,D,N,A,P,k,O,U,_,q,ee,Y])}function D1(){const[t,a]=Bb(),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=S.useCallback(d=>{a({tab:d},{replace:!0})},[a]);return{activeTab:r,setActiveTab:c}}function N1(){const{state:t}=Sx(),a=A1(),[o,r]=S.useState(!1),c=S.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=S.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 eb({activeTab:t,onTabChange:a}){const{t:o}=ye(),r=[{value:"browser",label:o("settingsTabs.browser"),icon:pw},{value:"websearch",label:o("settingsTabs.web"),icon:Xb},{value:"image",label:o("settingsTabs.image"),icon:ev},{value:"channels",label:o("settingsTabs.channels"),icon:gw},{value:"globalenv",label:o("settingsTabs.env"),icon:ih},{value:"thinking",label:o("settingsTabs.think"),icon:mw},{value:"proxy",label:o("settingsTabs.proxy"),icon:yw},{value:"auth",label:o("settingsTabs.auth"),icon:th},{value:"backups",label:o("settingsTabs.backup"),icon:bw}];return l.jsx(lx,{value:t,onValueChange:c=>a(c),children:l.jsx(Rh,{className:"grid w-full grid-cols-9",children:r.map(({value:c,label:d,icon:h})=>l.jsxs(Tl,{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 tb(){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 wx(t,a=3,o=1e3){return t().catch(r=>{if(a<=0)throw r;return new Promise(c=>setTimeout(c,o)).then(()=>wx(t,a-1,o*2))})}function Na(t){return S.lazy(()=>wx(t))}const nb=Na(()=>tt(()=>import("./index-Dazklm4w.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9]))),ab=Na(()=>tt(()=>import("./index-BeGXGfW3.js"),__vite__mapDeps([10,1,2,5,6,4,7,8,9]))),ib=Na(()=>tt(()=>import("./index-BC_nh-r0.js"),__vite__mapDeps([11,1,2,4,5,6,7,8,9]))),ob=Na(()=>tt(()=>import("./channels-DezQJzMm.js"),__vite__mapDeps([12,1,2,4,5,6,7,8,9]))),rb=Na(()=>tt(()=>import("./globalenv-section-Cpfv8x9d.js"),__vite__mapDeps([13,1,2,4,5,6,7,8,9]))),sb=Na(()=>tt(()=>import("./index-BU5nSuXf.js"),__vite__mapDeps([14,1,2,4,5,6,7,8,9]))),lb=Na(()=>tt(()=>import("./index-Bg5fPsun.js"),__vite__mapDeps([15,1,2,16,4,17,18,5,6,19,7,8,9]))),cb=Na(()=>tt(()=>import("./auth-section-DJMuqfhE.js"),__vite__mapDeps([20,1,2,4,5,6,7,8,9]))),ub=Na(()=>tt(()=>import("./backups-section-DGKT51IG.js"),__vite__mapDeps([21,1,2,18,4,5,6,7,8,9])));class db extends S.Component{constructor(a){super(a),this.state={hasError:!1,error:null}}static getDerivedStateFromError(a){return{hasError:!0,error:a}}render(){return this.state.hasError?l.jsx("div",{className:"flex-1 flex items-center justify-center text-muted-foreground",children:l.jsxs("div",{className:"text-center p-6 max-w-md",children:[l.jsx(Br,{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(rt,{variant:"outline",onClick:()=>window.location.reload(),className:"inline-flex items-center gap-2",children:[l.jsx(zr,{className:"w-4 h-4"}),ie.t("settings.reloadPage")]})]})}):this.props.children}}function T1(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 P1(){const{t}=ye(),{setActiveTab:a}=D1(),[o]=Bb(),r=T1(o.get("tab")),{rawConfig:c,loading:d,copied:h,fetchRawConfig:p,copyToClipboard:g}=N1();S.useEffect(()=>{p()},[p]);const m=x=>{S.startTransition(()=>{a(x)})};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(eb,{activeTab:r,onTabChange:m})}),l.jsx(db,{children:l.jsxs(S.Suspense,{fallback:l.jsx(tb,{}),children:[r==="browser"&&l.jsx(ab,{}),r==="websearch"&&l.jsx(nb,{}),r==="image"&&l.jsx(ib,{}),r==="channels"&&l.jsx(ob,{}),r==="globalenv"&&l.jsx(rb,{}),r==="thinking"&&l.jsx(sb,{}),r==="proxy"&&l.jsx(lb,{}),r==="auth"&&l.jsx(cb,{}),r==="backups"&&l.jsx(ub,{})]})})]}),l.jsxs(jh,{direction:"horizontal",className:"h-full hidden md:flex",children:[l.jsx(Kr,{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(eb,{activeTab:r,onTabChange:m})}),l.jsx(db,{children:l.jsxs(S.Suspense,{fallback:l.jsx(tb,{}),children:[r==="browser"&&l.jsx(ab,{}),r==="websearch"&&l.jsx(nb,{}),r==="image"&&l.jsx(ib,{}),r==="channels"&&l.jsx(ob,{}),r==="globalenv"&&l.jsx(rb,{}),r==="thinking"&&l.jsx(sb,{}),r==="proxy"&&l.jsx(lb,{}),r==="auth"&&l.jsx(cb,{}),r==="backups"&&l.jsx(ub,{})]})})]})}),l.jsx(Eh,{className:"w-2 bg-border hover:bg-primary/20 transition-colors cursor-col-resize flex items-center justify-center group",children:l.jsx(El,{className:"w-3 h-3 text-muted-foreground group-hover:text-primary"})}),l.jsx(Kr,{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(Km,{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(rt,{variant:"outline",size:"sm",onClick:g,disabled:!c,children:h?l.jsxs(l.Fragment,{children:[l.jsx(ko,{className:"w-4 h-4 mr-1"}),t("settings.copied")]}):l.jsxs(l.Fragment,{children:[l.jsx(Cl,{className:"w-4 h-4 mr-1"}),t("settings.copy")]})}),l.jsx(rt,{variant:"outline",size:"sm",onClick:p,disabled:d,children:l.jsx(zr,{className:`w-4 h-4 ${d?"animate-spin":""}`})})]})]}),l.jsx("div",{className:"flex-1 overflow-auto",children:c?l.jsx(xx,{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(zr,{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(Km,{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 M1(){return l.jsx(k1,{children:l.jsx(P1,{})})}const L1=Object.freeze(Object.defineProperty({__proto__:null,SettingsPage:M1},Symbol.toStringTag,{value:"Module"}));function j1(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 E1={},jr={};function Ai(t,a){try{const r=(E1[t]||=new Intl.DateTimeFormat("en-US",{timeZone:t,timeZoneName:"longOffset"}).format)(a).split("GMT")[1];return r in jr?jr[r]:hb(r,r.split(":"))}catch{if(t in jr)return jr[t];const o=t?.match(R1);return o?hb(t,o.slice(1)):NaN}}const R1=/([+-]\d\d):?(\d\d)?/;function hb(t,a){const o=+(a[0]||0),r=+(a[1]||0),c=+(a[2]||0)/60;return jr[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)),kx(this),Jd(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),Jd(this),+this}[Symbol.for("constructDateFrom")](a){return new Kn(+new Date(a),this.timeZone)}}const fb=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!fb.test(t))return;const a=t.replace(fb,"$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),O1(this),+this},Kn.prototype[a]=function(){return Date.prototype[a].apply(this,arguments),Jd(this),+this}))});function Jd(t){t.internal.setTime(+t),t.internal.setUTCSeconds(t.internal.getUTCSeconds()-Math.round(-Ai(t.timeZone,t)*60))}function O1(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()),kx(t)}function kx(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 x=c>0?m.getSeconds():(m.getSeconds()-60)%60,b=Math.round(-(Ai(t.timeZone,t)*60))%60;(b||x)&&(t.internal.setUTCSeconds(t.internal.getUTCSeconds()+b),Date.prototype.setUTCSeconds.call(t,Date.prototype.getUTCSeconds.call(t)+b+x));const C=Ai(t.timeZone,t),T=C>0?Math.floor(C):Math.ceil(C),M=-new Date(+t).getTimezoneOffset()-T,E=T!==o,j=M-g;if(E&&j){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+j);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 ba extends Kn{static tz(a,...o){return o.length?new ba(...o,a):new ba(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} (${j1(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 ba(+this,a)}[Symbol.for("constructDateFrom")](a){return new ba(+new Date(a),this.timeZone)}}const pb=5,I1=4;function _1(t,a){const o=a.startOfMonth(t),r=o.getDay()>0?o.getDay():7,c=a.addDays(t,-r+1),d=a.addDays(c,pb*7-1);return a.getMonth(t)===a.getMonth(d)?pb:I1}function Ax(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 U1(t,a){const o=Ax(t,a),r=_1(t,a);return a.addDays(o,r*7-1)}const Dx={...kr,labels:{labelDayButton:(t,a,o,r)=>{let c;r&&typeof r.format=="function"?c=r.format.bind(r):c=(h,p)=>Tr(h,p,{locale:kr,...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)=>Tr(c,d,{locale:kr,...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)=>Tr(h,p,{locale:kr,...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)=>Tr(c,d,{locale:kr,...a}),r(t,"cccc")}}};class fn{constructor(a,o){this.Date=Date,this.today=()=>this.overrides?.today?this.overrides.today():this.options.timeZone?ba.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 ba(r,c,d,this.options.timeZone):new Date(r,c,d),this.addDays=(r,c)=>this.overrides?.addDays?this.overrides.addDays(r,c):ww(r,c),this.addMonths=(r,c)=>this.overrides?.addMonths?this.overrides.addMonths(r,c):kw(r,c),this.addWeeks=(r,c)=>this.overrides?.addWeeks?this.overrides.addWeeks(r,c):Aw(r,c),this.addYears=(r,c)=>this.overrides?.addYears?this.overrides.addYears(r,c):Dw(r,c),this.differenceInCalendarDays=(r,c)=>this.overrides?.differenceInCalendarDays?this.overrides.differenceInCalendarDays(r,c):Nw(r,c),this.differenceInCalendarMonths=(r,c)=>this.overrides?.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(r,c):Tw(r,c),this.eachMonthOfInterval=r=>this.overrides?.eachMonthOfInterval?this.overrides.eachMonthOfInterval(r):Pw(r),this.eachYearOfInterval=r=>{const c=this.overrides?.eachYearOfInterval?this.overrides.eachYearOfInterval(r):Mw(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):U1(r,this),this.endOfISOWeek=r=>this.overrides?.endOfISOWeek?this.overrides.endOfISOWeek(r):Lw(r),this.endOfMonth=r=>this.overrides?.endOfMonth?this.overrides.endOfMonth(r):jw(r),this.endOfWeek=(r,c)=>this.overrides?.endOfWeek?this.overrides.endOfWeek(r,c):Ew(r,this.options),this.endOfYear=r=>this.overrides?.endOfYear?this.overrides.endOfYear(r):Rw(r),this.format=(r,c,d)=>{const h=this.overrides?.format?this.overrides.format(r,c,this.options):Tr(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):Ow(r),this.getMonth=(r,c)=>this.overrides?.getMonth?this.overrides.getMonth(r,this.options):Iw(r,this.options),this.getYear=(r,c)=>this.overrides?.getYear?this.overrides.getYear(r,this.options):_w(r,this.options),this.getWeek=(r,c)=>this.overrides?.getWeek?this.overrides.getWeek(r,this.options):Uw(r,this.options),this.isAfter=(r,c)=>this.overrides?.isAfter?this.overrides.isAfter(r,c):Hw(r,c),this.isBefore=(r,c)=>this.overrides?.isBefore?this.overrides.isBefore(r,c):zw(r,c),this.isDate=r=>this.overrides?.isDate?this.overrides.isDate(r):Bw(r),this.isSameDay=(r,c)=>this.overrides?.isSameDay?this.overrides.isSameDay(r,c):Fw(r,c),this.isSameMonth=(r,c)=>this.overrides?.isSameMonth?this.overrides.isSameMonth(r,c):Kw(r,c),this.isSameYear=(r,c)=>this.overrides?.isSameYear?this.overrides.isSameYear(r,c):qw(r,c),this.max=r=>this.overrides?.max?this.overrides.max(r):Gw(r),this.min=r=>this.overrides?.min?this.overrides.min(r):Vw(r),this.setMonth=(r,c)=>this.overrides?.setMonth?this.overrides.setMonth(r,c):Yw(r,c),this.setYear=(r,c)=>this.overrides?.setYear?this.overrides.setYear(r,c):Ww(r,c),this.startOfBroadcastWeek=(r,c)=>this.overrides?.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(r,this):Ax(r,this),this.startOfDay=r=>this.overrides?.startOfDay?this.overrides.startOfDay(r):Qw(r),this.startOfISOWeek=r=>this.overrides?.startOfISOWeek?this.overrides.startOfISOWeek(r):$w(r),this.startOfMonth=r=>this.overrides?.startOfMonth?this.overrides.startOfMonth(r):Xw(r),this.startOfWeek=(r,c)=>this.overrides?.startOfWeek?this.overrides.startOfWeek(r,this.options):Jw(r,this.options),this.startOfYear=r=>this.overrides?.startOfYear?this.overrides.startOfYear(r):Zw(r),this.options={locale:Dx,...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 Vn=new fn;class Nx{constructor(a,o,r=Vn){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 H1{constructor(a,o){this.date=a,this.weeks=o}}class z1{constructor(a,o){this.days=o,this.weekNumber=a}}function B1(t){return ue.createElement("button",{...t})}function F1(t){return ue.createElement("span",{...t})}function K1(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 q1(t){const{day:a,modifiers:o,...r}=t;return ue.createElement("td",{...r})}function G1(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 Ln;(function(t){t.range_end="range_end",t.range_middle="range_middle",t.range_start="range_start",t.selected="selected"})(Ln||(Ln={}));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 V1(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:x})=>ue.createElement(r.Option,{key:g,value:g,disabled:x},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 Y1(t){return ue.createElement("div",{...t})}function W1(t){return ue.createElement("div",{...t})}function Q1(t){const{calendarMonth:a,displayIndex:o,...r}=t;return ue.createElement("div",{...r},t.children)}function $1(t){const{calendarMonth:a,displayIndex:o,...r}=t;return ue.createElement("div",{...r})}function X1(t){return ue.createElement("table",{...t})}function J1(t){return ue.createElement("div",{...t})}const Tx=S.createContext(void 0);function $r(){const t=S.useContext(Tx);if(t===void 0)throw new Error("useDayPicker() must be used within a custom component.");return t}function Z1(t){const{components:a}=$r();return ue.createElement(a.Dropdown,{...t})}function eL(t){const{onPreviousClick:a,onNextClick:o,previousMonth:r,nextMonth:c,...d}=t,{components:h,classNames:p,labels:{labelPrevious:g,labelNext:m}}=$r(),x=S.useCallback(C=>{c&&o?.(C)},[c,o]),b=S.useCallback(C=>{r&&a?.(C)},[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:x},ue.createElement(h.Chevron,{disabled:c?void 0:!0,orientation:"right",className:p[Ce.Chevron]})))}function tL(t){const{components:a}=$r();return ue.createElement(a.Button,{...t})}function nL(t){return ue.createElement("option",{...t})}function aL(t){const{components:a}=$r();return ue.createElement(a.Button,{...t})}function iL(t){const{rootRef:a,...o}=t;return ue.createElement("div",{...o,ref:a})}function oL(t){return ue.createElement("select",{...t})}function rL(t){const{week:a,...o}=t;return ue.createElement("tr",{...o})}function sL(t){return ue.createElement("th",{...t})}function lL(t){return ue.createElement("thead",{"aria-hidden":!0},ue.createElement("tr",{...t}))}function cL(t){const{week:a,...o}=t;return ue.createElement("th",{...o})}function uL(t){return ue.createElement("th",{...t})}function dL(t){return ue.createElement("tbody",{...t})}function hL(t){const{components:a}=$r();return ue.createElement(a.Dropdown,{...t})}const fL=Object.freeze(Object.defineProperty({__proto__:null,Button:B1,CaptionLabel:F1,Chevron:K1,Day:q1,DayButton:G1,Dropdown:V1,DropdownNav:Y1,Footer:W1,Month:Q1,MonthCaption:$1,MonthGrid:X1,Months:J1,MonthsDropdown:Z1,Nav:eL,NextMonthButton:tL,Option:nL,PreviousMonthButton:aL,Root:iL,Select:oL,Week:rL,WeekNumber:cL,WeekNumberHeader:uL,Weekday:sL,Weekdays:lL,Weeks:dL,YearsDropdown:hL},Symbol.toStringTag,{value:"Module"}));function va(t,a,o=!1,r=Vn){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 Fh(t){return!!(t&&typeof t=="object"&&"before"in t&&"after"in t)}function Xl(t){return!!(t&&typeof t=="object"&&"from"in t)}function Kh(t){return!!(t&&typeof t=="object"&&"after"in t)}function qh(t){return!!(t&&typeof t=="object"&&"before"in t)}function Px(t){return!!(t&&typeof t=="object"&&"dayOfWeek"in t)}function Mx(t,a){return Array.isArray(t)&&t.every(a.isDate)}function xa(t,a,o=Vn){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(Mx(p,o))return p.some(g=>c(t,g));if(Xl(p))return va(p,t,!1,o);if(Px(p))return Array.isArray(p.dayOfWeek)?p.dayOfWeek.includes(t.getDay()):p.dayOfWeek===t.getDay();if(Fh(p)){const g=d(p.before,t),m=d(p.after,t),x=g>0,b=m<0;return h(p.before,p.after)?b&&x:x||b}return Kh(p)?d(t,p.after)>0:qh(p)?d(p.before,t)>0:typeof p=="function"?p(t):!1})}function pL(t,a,o,r,c){const{disabled:d,hidden:h,modifiers:p,showOutsideDays:g,broadcastCalendar:m,today:x=c.today()}=a,{isSameDay:b,isSameMonth:C,startOfMonth:T,isBefore:w,endOfMonth:M,isAfter:E}=c,j=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&&!C(k,O)),_=!!(j&&w(k,j)),q=!!(D&&E(k,D)),ee=!!(d&&xa(k,d,c)),Y=!!(h&&xa(k,h,c))||_||q||!m&&!g&&U||m&&g===!1&&U,$=b(k,x);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&&xa(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(q=>q===P)}for(const U in A)O[U]=A[U].some(_=>_===P);return{...k,...O}}}function gL(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[Ln[d]]&&c.push(a[Ln[d]]),c),[a[Ce.Day]])}function mL(t){return{...fL,...t}}function yL(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 bL(){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 Ln)t[Ln[a]]=`rdp-${Ln[a]}`;for(const a in hn)t[hn[a]]=`rdp-${hn[a]}`;return t}function Lx(t,a,o){return(o??new fn(a)).formatMonthYear(t)}const vL=Lx;function xL(t,a,o){return(o??new fn(a)).format(t,"d")}function CL(t,a=Vn){return a.format(t,"LLLL")}function SL(t,a,o){return(o??new fn(a)).format(t,"cccccc")}function wL(t,a=Vn){return t<10?a.formatNumber(`0${t.toLocaleString()}`):a.formatNumber(`${t.toLocaleString()}`)}function kL(){return""}function jx(t,a=Vn){return a.format(t,"yyyy")}const AL=jx,DL=Object.freeze(Object.defineProperty({__proto__:null,formatCaption:Lx,formatDay:xL,formatMonthCaption:vL,formatMonthDropdown:CL,formatWeekNumber:wL,formatWeekNumberHeader:kL,formatWeekdayName:SL,formatYearCaption:AL,formatYearDropdown:jx},Symbol.toStringTag,{value:"Module"}));function NL(t){return t?.formatMonthCaption&&!t.formatCaption&&(t.formatCaption=t.formatMonthCaption),t?.formatYearCaption&&!t.formatYearDropdown&&(t.formatYearDropdown=t.formatYearCaption),{...DL,...t}}function Gh(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 TL=Gh;function Vh(t,a,o){return(o??new fn(a)).formatMonthYear(t)}const PL=Vh;function Ex(t,a,o,r){let c=(r??new fn(o)).format(t,"PPPP");return a?.today&&(c=`Today, ${c}`),c}function Rx(t){return"Choose the Month"}function Ox(){return""}const ML="Go to the Next Month";function Ix(t,a){return ML}function _x(t){return"Go to the Previous Month"}function Ux(t,a,o){return(o??new fn(a)).format(t,"cccc")}function Hx(t,a){return`Week ${t}`}function zx(t){return"Week Number"}function Bx(t){return"Choose the Year"}const LL=Object.freeze(Object.defineProperty({__proto__:null,labelCaption:PL,labelDay:TL,labelDayButton:Gh,labelGrid:Vh,labelGridcell:Ex,labelMonthDropdown:Rx,labelNav:Ox,labelNext:Ix,labelPrevious:_x,labelWeekNumber:Hx,labelWeekNumberHeader:zx,labelWeekday:Ux,labelYearDropdown:Bx},Symbol.toStringTag,{value:"Module"})),Mn=(t,a,o)=>a||(o?typeof o=="function"?o:(...r)=>o:t);function jL(t,a){const o=a.locale?.labels??{};return{...LL,...t??{},labelDayButton:Mn(Gh,t?.labelDayButton,o.labelDayButton),labelMonthDropdown:Mn(Rx,t?.labelMonthDropdown,o.labelMonthDropdown),labelNext:Mn(Ix,t?.labelNext,o.labelNext),labelPrevious:Mn(_x,t?.labelPrevious,o.labelPrevious),labelWeekNumber:Mn(Hx,t?.labelWeekNumber,o.labelWeekNumber),labelYearDropdown:Mn(Bx,t?.labelYearDropdown,o.labelYearDropdown),labelGrid:Mn(Vh,t?.labelGrid,o.labelGrid),labelGridcell:Mn(Ex,t?.labelGridcell,o.labelGridcell),labelNav:Mn(Ox,t?.labelNav,o.labelNav),labelWeekNumberHeader:Mn(zx,t?.labelWeekNumberHeader,o.labelWeekNumberHeader),labelWeekday:Mn(Ux,t?.labelWeekday,o.labelWeekday)}}function EL(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(C=>{const T=r.formatMonthDropdown(C,c),w=m(C),M=a&&C<d(a)||o&&C>d(o)||!1;return{value:w,label:T,disabled:M}})}function RL(t,a={},o={}){let r={...a?.[Ce.Day]};return Object.entries(t).filter(([,c])=>c===!0).forEach(([c])=>{r={...r,...o?.[c]}}),r}function OL(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 IL(t,a,o,r,c=!1){if(!t||!a)return;const{startOfYear:d,endOfYear:h,eachYearOfInterval:p,getYear:g}=r,m=d(t),x=h(a),b=p({start:m,end:x});return c&&b.reverse(),b.map(C=>{const T=o.formatYearDropdown(C,r);return{value:g(C),label:T,disabled:!1}})}const Xr=t=>t instanceof HTMLElement?t:null,Pd=t=>[...t.querySelectorAll("[data-animated-month]")??[]],_L=t=>Xr(t.querySelector("[data-animated-month]")),Md=t=>Xr(t.querySelector("[data-animated-caption]")),Ld=t=>Xr(t.querySelector("[data-animated-weeks]")),UL=t=>Xr(t.querySelector("[data-animated-nav]")),HL=t=>Xr(t.querySelector("[data-animated-weekdays]"));function zL(t,a,{classNames:o,months:r,focused:c,dateLib:d}){const h=S.useRef(null),p=S.useRef(r),g=S.useRef(!1);S.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 x=d.isSameMonth(r[0].date,m[0].date),b=d.isAfter(r[0].date,m[0].date),C=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?(Pd(M).forEach(N=>{if(!(N instanceof HTMLElement))return;const A=_L(N);A&&N.contains(A)&&N.removeChild(A);const P=Md(N);P&&P.classList.remove(C);const k=Ld(N);k&&k.classList.remove(T)}),h.current=M):h.current=null,g.current||x||c)return;const E=w instanceof HTMLElement?Pd(w):[],j=Pd(t.current);if(j?.every(D=>D instanceof HTMLElement)&&E&&E.every(D=>D instanceof HTMLElement)){g.current=!0,t.current.style.isolation="isolate";const D=UL(t.current);D&&(D.style.zIndex="1"),j.forEach((N,A)=>{const P=E[A];if(!P)return;N.style.position="relative",N.style.overflow="hidden";const k=Md(N);k&&k.classList.add(C);const O=Ld(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(C),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 _=HL(P);_&&(_.style.opacity="0");const q=Md(P);q&&(q.classList.add(b?o[hn.caption_before_exit]:o[hn.caption_after_exit]),q.addEventListener("animationend",U));const ee=Ld(P);ee&&ee.classList.add(b?o[hn.weeks_before_exit]:o[hn.weeks_after_exit]),N.insertBefore(P,N.firstChild)})}})}function BL(t,a,o,r){const c=t[0],d=t[t.length-1],{ISOWeek:h,fixedWeeks:p,broadcastCalendar:g}=o??{},{addDays:m,differenceInCalendarDays:x,differenceInCalendarMonths:b,endOfBroadcastWeek:C,endOfISOWeek:T,endOfMonth:w,endOfWeek:M,isAfter:E,startOfBroadcastWeek:j,startOfISOWeek:D,startOfWeek:N}=r,A=g?j(c,r):h?D(c):N(c),P=g?C(d):h?T(w(d)):M(w(d)),k=a&&(g?C(a):h?T(a):M(a)),O=k&&E(P,k)?k:P,U=x(O,A),_=b(d,c)+1,q=[];for(let $=0;$<=U;$++){const fe=m(A,$);q.push(fe)}const Y=(g?35:42)*_;if(p&&q.length<Y){const $=Y-q.length;for(let fe=0;fe<$;fe++){const pe=m(q[q.length-1],1);q.push(pe)}}return q}function FL(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 KL(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 gb(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:x,startOfMonth:b}=r;if(o&&m(o,g)<p-1){const C=-1*(p-1);g=x(o,C)}return a&&m(g,a)<0&&(g=a),b(g)}function qL(t,a,o,r){const{addDays:c,endOfBroadcastWeek:d,endOfISOWeek:h,endOfMonth:p,endOfWeek:g,getISOWeek:m,getWeek:x,startOfBroadcastWeek:b,startOfISOWeek:C,startOfWeek:T}=r,w=t.reduce((M,E)=>{const j=o.broadcastCalendar?b(E,r):o.ISOWeek?C(E):T(E),D=o.broadcastCalendar?d(E):o.ISOWeek?h(p(E)):g(p(E)),N=a.filter(O=>O>=j&&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):x(U),q=O.find(Y=>Y.weekNumber===_),ee=new Nx(U,E,r);return q?q.days.push(ee):O.push(new z1(_,[ee])),O},[]),k=new H1(E,P);return M.push(k),M},[]);return o.reverseMonths?w.reverse():w}function GL(t,a){let{startMonth:o,endMonth:r}=t;const{startOfYear:c,startOfDay:d,startOfMonth:h,endOfMonth:p,addYears:g,endOfYear:m,newDate:x,today:b}=a,{fromYear:C,toYear:T,fromMonth:w,toMonth:M}=t;!o&&w&&(o=w),!o&&C&&(o=a.newDate(C,0,1)),!r&&M&&(r=M),!r&&T&&(r=x(T,11,31));const E=t.captionLayout==="dropdown"||t.captionLayout==="dropdown-years";return o?o=h(o):C?o=x(C,0,1):!o&&E&&(o=c(g(t.today??b(),-100))),r?r=p(r):T?r=x(T,11,31):!r&&E&&(r=m(t.today??b())),[o&&d(o),r&&d(r)]}function VL(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,x=h(t);if(!a)return p(x,m);if(!(g(a,t)<d))return p(x,m)}function YL(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,x=h(t);if(!a)return p(x,-m);if(!(g(x,a)<=0))return p(x,-m)}function WL(t){const a=[];return t.reduce((o,r)=>o.concat(r.weeks.slice()),a.slice())}function Jl(t,a){const[o,r]=S.useState(t);return[a===void 0?o:a,r]}function QL(t,a){const[o,r]=GL(t,a),{startOfMonth:c,endOfMonth:d}=a,h=gb(t,o,r,a),[p,g]=Jl(h,t.month?h:void 0);S.useEffect(()=>{const A=gb(t,o,r,a);g(A)},[t.timeZone]);const{months:m,weeks:x,days:b,previousMonth:C,nextMonth:T}=S.useMemo(()=>{const A=KL(p,r,{numberOfMonths:t.numberOfMonths},a),P=BL(A,t.endMonth?d(t.endMonth):void 0,{ISOWeek:t.ISOWeek,fixedWeeks:t.fixedWeeks,broadcastCalendar:t.broadcastCalendar},a),k=qL(A,P,{broadcastCalendar:t.broadcastCalendar,fixedWeeks:t.fixedWeeks,ISOWeek:t.ISOWeek,reverseMonths:t.reverseMonths},a),O=WL(k),U=FL(k),_=YL(p,o,t,a),q=VL(p,r,t,a);return{months:k,weeks:O,days:U,previousMonth:_,nextMonth:q}},[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,E=A=>x.some(P=>P.days.some(k=>k.isEqualTo(A))),j=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:x,days:b,navStart:o,navEnd:r,previousMonth:C,nextMonth:T,goToMonth:j,goToDay:A=>{E(A)||j(A.date)}}}var Bn;(function(t){t[t.Today=0]="Today",t[t.Selected=1]="Selected",t[t.LastFocused=2]="LastFocused",t[t.FocusedModifier=3]="FocusedModifier"})(Bn||(Bn={}));function mb(t){return!t[pt.disabled]&&!t[pt.hidden]&&!t[pt.outside]}function $L(t,a,o,r){let c,d=-1;for(const h of t){const p=a(h);mb(p)&&(p[pt.focused]&&d<Bn.FocusedModifier?(c=h,d=Bn.FocusedModifier):r?.isEqualTo(h)&&d<Bn.LastFocused?(c=h,d=Bn.LastFocused):o(h.date)&&d<Bn.Selected?(c=h,d=Bn.Selected):p[pt.today]&&d<Bn.Today&&(c=h,d=Bn.Today))}return c||(c=t.find(h=>mb(a(h)))),c}function XL(t,a,o,r,c,d,h){const{ISOWeek:p,broadcastCalendar:g}=d,{addDays:m,addMonths:x,addWeeks:b,addYears:C,endOfBroadcastWeek:T,endOfISOWeek:w,endOfWeek:M,max:E,min:j,startOfBroadcastWeek:D,startOfISOWeek:N,startOfWeek:A}=h;let k={day:m,week:b,month:x,year:C,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=E([r,k]):a==="after"&&c&&(k=j([c,k])),k}function Fx(t,a,o,r,c,d,h,p=0){if(p>365)return;const g=XL(t,a,o.date,r,c,d,h),m=!!(d.disabled&&xa(g,d.disabled,h)),x=!!(d.hidden&&xa(g,d.hidden,h)),b=g,C=new Nx(g,b,h);return!m&&!x?C:Fx(t,a,C,r,c,d,h,p+1)}function JL(t,a,o,r,c){const{autoFocus:d}=t,[h,p]=S.useState(),g=$L(a.days,o,r||(()=>!1),h),[m,x]=S.useState(d?g:void 0);return{isFocusTarget:M=>!!g?.isEqualTo(M),setFocused:x,focused:m,blur:()=>{p(m),x(void 0)},moveFocus:(M,E)=>{if(!m)return;const j=Fx(M,E,m,a.navStart,a.navEnd,t,c);j&&(t.disableNavigation&&!a.days.some(N=>N.isEqualTo(j))||(a.goToDay(j),x(j)))}}}function ZL(t,a){const{selected:o,required:r,onSelect:c}=t,[d,h]=Jl(o,c?o:void 0),p=c?o:d,{isSameDay:g}=a,m=T=>p?.some(w=>g(w,T))??!1,{min:x,max:b}=t;return{selected:p,select:(T,w,M)=>{let E=[...p??[]];if(m(T)){if(p?.length===x||r&&p?.length===1)return;E=p?.filter(j=>!g(j,T))}else p?.length===b?E=[T]:E=[...E,T];return c||h(E),c?.(E,T,w,M),E},isSelected:m}}function ej(t,a,o=0,r=0,c=!1,d=Vn){const{from:h,to:p}=a||{},{isSameDay:g,isAfter:m,isBefore:x}=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:x(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(x(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 C=d.differenceInCalendarDays(b.to,b.from);r>0&&C>r?b={from:t,to:void 0}:o>1&&C<o&&(b={from:t,to:void 0})}return b}function tj(t,a,o=Vn){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 yb(t,a,o=Vn){return va(t,a.from,!1,o)||va(t,a.to,!1,o)||va(a,t.from,!1,o)||va(a,t.to,!1,o)}function nj(t,a,o=Vn){const r=Array.isArray(a)?a:[a];if(r.filter(p=>typeof p!="function").some(p=>typeof p=="boolean"?p:o.isDate(p)?va(t,p,!1,o):Mx(p,o)?p.some(g=>va(t,g,!1,o)):Xl(p)?p.from&&p.to?yb(t,{from:p.from,to:p.to},o):!1:Px(p)?tj(t,p.dayOfWeek,o):Fh(p)?o.isAfter(p.before,p.after)?yb(t,{from:o.addDays(p.after,1),to:o.addDays(p.before,-1)},o):xa(t.from,p,o)||xa(t.to,p,o):Kh(p)||qh(p)?xa(t.from,p,o)||xa(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(x=>x(p)))return!0;p=o.addDays(p,1)}}return!1}function aj(t,a){const{disabled:o,excludeDisabled:r,selected:c,required:d,onSelect:h}=t,[p,g]=Jl(c,h?c:void 0),m=h?c:p;return{selected:m,select:(C,T,w)=>{const{min:M,max:E}=t,j=C?ej(C,m,M,E,d,a):void 0;return r&&o&&j?.from&&j.to&&nj({from:j.from,to:j.to},o,a)&&(j.from=C,j.to=void 0),h||g(j),h?.(j,C,T,w),j},isSelected:C=>m&&va(m,C,!1,a)}}function ij(t,a){const{selected:o,required:r,onSelect:c}=t,[d,h]=Jl(o,c?o:void 0),p=c?o:d,{isSameDay:g}=a;return{selected:p,select:(b,C,T)=>{let w=b;return!r&&p&&p&&g(b,p)&&(w=void 0),c||h(w),c?.(w,b,C,T),w},isSelected:b=>p?g(p,b):!1}}function oj(t,a){const o=ij(t,a),r=ZL(t,a),c=aj(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 ba&&t.timeZone===a?t:new ba(t,a)}function bb(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):Xl(t)?{...t,from:t.from?Ht(t.from,a):t.from,to:t.to?Ht(t.to,a):t.to}:Fh(t)?{before:Ht(t.before,a),after:Ht(t.after,a)}:Kh(t)?{after:Ht(t.after,a)}:qh(t)?{before:Ht(t.before,a)}:t}function jd(t,a){return t&&(Array.isArray(t)?t.map(o=>bb(o,a)):bb(t,a))}function rj(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=jd(a.disabled,o)),a.hidden!==void 0&&(a.hidden=jd(a.hidden,o)),a.modifiers)){const ve={};Object.keys(a.modifiers).forEach(Me=>{ve[Me]=jd(a.modifiers?.[Me],o)}),a.modifiers=ve}const{components:r,formatters:c,labels:d,dateLib:h,locale:p,classNames:g}=S.useMemo(()=>{const ve={...Dx,...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:mL(a.components),formatters:NL(a.formatters),labels:jL(a.labels,Me.options),locale:ve,classNames:{...bL(),...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:x,navLayout:b,numberOfMonths:C=1,onDayBlur:T,onDayClick:w,onDayFocus:M,onDayKeyDown:E,onDayMouseEnter:j,onDayMouseLeave:D,onNextClick:N,onPrevClick:A,showWeekNumber:P,styles:k}=a,{formatCaption:O,formatDay:U,formatMonthDropdown:_,formatWeekNumber:q,formatWeekNumberHeader:ee,formatWeekdayName:Y,formatYearDropdown:$}=c,fe=QL(a,h),{days:pe,months:H,navStart:Z,navEnd:ne,previousMonth:Q,nextMonth:se,goToMonth:de}=fe,ge=pL(pe,a,Z,ne,h),{isSelected:J,select:ae,selected:he}=oj(a,h)??{},{blur:oe,focused:le,isFocusTarget:xe,moveFocus:Pe,setFocused:He}=JL(a,fe,ge,J??(()=>!1),h),{labelDayButton:Je,labelGridcell:we,labelGrid:Re,labelMonthDropdown:Ve,labelNav:Tt,labelPrevious:Et,labelNext:Yn,labelWeekday:Le,labelWeekNumber:Zt,labelWeekNumberHeader:En,labelYearDropdown:en}=d,Ta=S.useMemo(()=>OL(h,a.ISOWeek,a.broadcastCalendar,a.today),[h,a.ISOWeek,a.broadcastCalendar,a.today]),Wn=x!==void 0||w!==void 0,bt=S.useCallback(()=>{Q&&(de(Q),A?.(Q))},[Q,de,A]),tn=S.useCallback(()=>{se&&(de(se),N?.(se))},[de,se,N]),Qn=S.useCallback((ve,Me)=>Ae=>{Ae.preventDefault(),Ae.stopPropagation(),He(ve),!Me.disabled&&(ae?.(ve.date,Me,Ae),w?.(ve.date,Me,Ae))},[ae,w,He]),ni=S.useCallback((ve,Me)=>Ae=>{He(ve),M?.(ve.date,Me,Ae)},[M,He]),Rn=S.useCallback((ve,Me)=>Ae=>{oe(),T?.(ve.date,Me,Ae)},[oe,T]),On=S.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)}E?.(ve.date,Me,Ae)},[Pe,E,a.dir]),Li=S.useCallback((ve,Me)=>Ae=>{j?.(ve.date,Me,Ae)},[j]),Po=S.useCallback((ve,Me)=>Ae=>{D?.(ve.date,Me,Ae)},[D]),Mo=S.useCallback(ve=>Me=>{const Ae=Number(Me.target.value),_e=h.setMonth(h.startOfMonth(ve),Ae);de(_e)},[h,de]),$n=S.useCallback(ve=>Me=>{const Ae=Number(Me.target.value),_e=h.setYear(h.startOfMonth(ve),Ae);de(_e)},[h,de]),{className:te,style:Oe}=S.useMemo(()=>({className:[g[Ce.Root],a.className].filter(Boolean).join(" "),style:{...k?.[Ce.Root],...a.style}}),[g,a.className,a.style,k]),ke=yL(a),Ie=S.useRef(null);zL(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(Tx.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":Et(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:Mo(ve.date),options:EL(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:$n(ve.date),options:IL(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===C-1&&ue.createElement(r.NextMonthButton,{type:"button",className:g[Ce.NextMonthButton],tabIndex:se?void 0:-1,"aria-disabled":se?void 0:!0,"aria-label":Yn(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===C-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":x==="multiple"||x==="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":En(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"},q(Ae.weekNumber,h)),Ae.days.map(_e=>{const{date:ct}=_e,Ne=ge(_e);if(Ne[pt.focused]=!Ne.hidden&&!!le?.isEqualTo(_e),Ne[Ln.selected]=J?.(ct)||Ne.selected,Xl(he)){const{from:nn,to:Dn}=he;Ne[Ln.range_start]=!!(nn&&Dn&&h.isSameDay(ct,nn)),Ne[Ln.range_end]=!!(nn&&Dn&&h.isSameDay(ct,Dn)),Ne[Ln.range_middle]=va(he,ct,!0,h)}const zt=RL(Ne,k,a.modifiersStyles),Xn=gL(Ne,g,a.modifiersClassNames),Pt=!Wn&&!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:Xn.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&&Wn?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:Qn(_e,Ne),onBlur:Rn(_e,Ne),onFocus:ni(_e,Ne),onKeyDown:On(_e,Ne),onMouseEnter:Li(_e,Ne),onMouseLeave:Po(_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 sj({className:t,classNames:a,showOutsideDays:o=!0,...r}){return l.jsx(rj,{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(ml({variant:"ghost"}),"h-7 w-7 bg-transparent p-0 opacity-70 hover:opacity-100 hover:bg-accent rounded-md"),button_next:z(ml({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(ml({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"?vw:c==="right"?Ll:c==="up"?nh:jl;return l.jsx(p,{className:z("h-4 w-4",d),...h})}},...r})}sj.displayName="Calendar";const lj=S.lazy(()=>tt(()=>Promise.resolve().then(()=>$l),void 0).then(t=>({default:t.CodeEditor})));function GE({rawJsonContent:t,isRawJsonValid:a,rawJsonEdits:o,rawSettingsEnv:r,onChange:c,missingRequiredFields:d=[]}){const{t:h}=ye(),p=d.length>0;return l.jsx(S.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(No,{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(Gn,{className:"w-4 h-4 mt-0.5 text-amber-500 shrink-0"}),l.jsxs("div",{children:[l.jsx("span",{className:"font-medium text-amber-600 dark:text-amber-400",children:"Missing required fields:"})," ",l.jsx("code",{className:"text-xs bg-muted px-1 py-0.5 rounded",children:d.join(", ")}),l.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:"These fields will use default values at runtime."})]})]}),l.jsx("div",{className:"min-h-0 flex-1 overflow-hidden px-6 pb-4 pt-4",children:l.jsx("div",{className:"h-full border rounded-md overflow-hidden bg-background",children:l.jsx(lj,{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(Ih,{profileEnv:r})})})]})})}S.lazy(()=>tt(()=>Promise.resolve().then(()=>$l),void 0).then(t=>({default:t.CodeEditor})));function cj(){const{t}=ye(),{isDark:a,setTheme:o}=ph(),[r,c]=S.useState(""),[d,h]=S.useState(""),[p,g]=S.useState(!1),[m,x]=S.useState(null),[b,C]=S.useState(!1),{login:T,authRequired:w,isAuthenticated:M,loading:E,accessMode:j,authEnabled:D}=_l(),N=eh(),A=Ml(),P=j==="setup",k=t(P?"auth.remoteGuardLabel":"auth.protectedAccessLabel"),O=t(P?D?"auth.incompleteSetupDescription":"auth.remoteSetupDescription":"auth.loginDescription"),U=A.state?.from?.pathname||"/";if(S.useEffect(()=>{E||(M||!w)&&N(U,{replace:!0})},[M,w,E,N,U]),E)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 q=>{q.preventDefault(),x(null),C(!0);try{await T(r,d),N(U,{replace:!0})}catch(ee){x(ee instanceof Error?ee.message:t("auth.loginFailed"))}finally{C(!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(ul,{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(rt,{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(Yb,{className:"h-3.5 w-3.5"}),t("auth.lightMode")]}),l.jsxs(rt,{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(Wb,{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(qm,{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(Gm,{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(ul,{className:"mb-3 h-4 w-4 text-accent"}),l.jsx("p",{children:t("auth.safetyNoteSession")})]})]})]}),l.jsxs(HM,{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(zM,{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(qm,{className:"h-5 w-5 text-accent"}):l.jsx(Gm,{className:"h-5 w-5 text-accent"})}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx(BM,{className:"text-2xl tracking-[-0.03em]",children:t(P?"auth.remoteSetupTitle":"auth.dashboardTitle")}),l.jsx(FM,{className:"text-sm leading-6 text-muted-foreground",children:P?O:t("auth.credentialsHint")})]})]}),l.jsx(KM,{className:"space-y-5 px-6 py-6",children:P?l.jsxs(l.Fragment,{children:[l.jsxs(_r,{variant:"warning",className:"rounded-2xl border-yellow-300/70 bg-yellow-50/80",children:[l.jsx(Br,{className:"h-4 w-4"}),l.jsx(Nl,{children:t("auth.noDefaultCredentials")}),l.jsx(Ur,{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(xw,{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(ul,{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(_r,{variant:"destructive",className:"rounded-2xl",children:[l.jsx(Br,{className:"h-4 w-4"}),l.jsx(Ur,{children:m})]}),l.jsxs(_r,{variant:"info",className:"rounded-2xl border-blue-200/80 bg-blue-50/80",children:[l.jsx(ul,{className:"h-4 w-4"}),l.jsx(Nl,{children:t("auth.noDefaultCredentials")}),l.jsx(Ur,{children:t("auth.credentialsHint")})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx(Kt,{htmlFor:"username",className:"text-sm font-semibold",children:t("auth.username")}),l.jsx(zn,{id:"username",type:"text",value:r,onChange:q=>c(q.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(Kt,{htmlFor:"password",className:"text-sm font-semibold",children:t("auth.password")}),l.jsxs("div",{className:"relative",children:[l.jsx(zn,{id:"password",type:p?"text":"password",value:d,onChange:q=>h(q.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(rt,{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(q=>!q),disabled:b,children:p?l.jsx(Vr,{className:"h-4 w-4"}):l.jsx(Yr,{className:"h-4 w-4"})})]})]}),l.jsx(rt,{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 uj=S.lazy(()=>tt(()=>import("./index-Bz4O7ubX.js"),__vite__mapDeps([22,1,2,4,5,7,23,6,8,9])).then(t=>({default:t.AnalyticsPage}))),dj=S.lazy(()=>tt(()=>import("./api-6xZ1yyns.js"),__vite__mapDeps([24,1,2,5,25,18,6,4,3,7,8,9])).then(t=>({default:t.ApiPage}))),hj=S.lazy(()=>tt(()=>import("./cliproxy-CllaWHzR.js"),__vite__mapDeps([26,1,2,5,16,6,4,19,27,25,18,28,29,17,7,8,9])).then(t=>({default:t.CliproxyPage}))),fj=S.lazy(()=>tt(()=>import("./cliproxy-ai-providers-DsMeN_St.js"),__vite__mapDeps([30,1,2,17,18,5,6,4,25,7,8,9])).then(t=>({default:t.CliproxyAiProvidersPage}))),pj=S.lazy(()=>tt(()=>import("./cliproxy-control-panel-p9QVUsRu.js"),__vite__mapDeps([31,1,2,5,16,4,6,7,8,9])).then(t=>({default:t.CliproxyControlPanelPage}))),gj=S.lazy(()=>tt(()=>import("./copilot-fBbT2Giy.js"),__vite__mapDeps([32,1,2,5,25,18,4,28,29,6,7,8,9])).then(t=>({default:t.CopilotPage}))),mj=S.lazy(()=>tt(()=>import("./cursor-Df6ARj5V.js"),__vite__mapDeps([33,1,2,6,5,16,28,29,4,7,8,9])).then(t=>({default:t.CursorPage}))),yj=S.lazy(()=>tt(()=>import("./claude-extension-zS7zGQAr.js"),__vite__mapDeps([34,1,2,5,6,4,7,8,9])).then(t=>({default:t.ClaudeExtensionPage}))),bj=S.lazy(()=>tt(()=>import("./codex-BibvFkeM.js"),__vite__mapDeps([35,1,2,6,4,28,5,9,7,36,37,8])).then(t=>({default:t.CodexPage}))),vj=S.lazy(()=>tt(()=>import("./droid-DxoeGW_k.js"),__vite__mapDeps([38,1,2,6,5,37,4,28,7,8,9])).then(t=>({default:t.DroidPage}))),xj=S.lazy(()=>tt(()=>import("./logs-BO4HN515.js"),__vite__mapDeps([39,1,2,4,5,6,7,8,9])).then(t=>({default:t.LogsPage}))),Cj=S.lazy(()=>tt(()=>import("./accounts-CdmEv5jU.js"),__vite__mapDeps([40,1,2,5,36,18,6,4,27,7,8,9])).then(t=>({default:t.AccountsPage}))),Sj=S.lazy(()=>tt(()=>Promise.resolve().then(()=>L1),void 0).then(t=>({default:t.SettingsPage}))),wj=S.lazy(()=>tt(()=>import("./health-DftbLTPo.js"),__vite__mapDeps([41,1,2,5,6,4,7,8,9])).then(t=>({default:t.HealthPage}))),kj=S.lazy(()=>tt(()=>import("./shared-Odb9AKYo.js"),__vite__mapDeps([42,1,2,4,5,6,7,8,9])).then(t=>({default:t.SharedPage}))),Aj=S.lazy(()=>tt(()=>import("./updates-BnaFXuVV.js"),__vite__mapDeps([43,1,2,4,5,6,7,8,9])).then(t=>({default:t.UpdatesPage})));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 Dj(){return l.jsx(H0,{client:pk,children:l.jsx(lA,{defaultTheme:"system",storageKey:"vite-ui-theme",children:l.jsx(cA,{children:l.jsx(pA,{children:l.jsxs(O0,{children:[l.jsxs(I0,{children:[l.jsx(Ct,{path:"/login",element:l.jsx(cj,{})}),l.jsx(Ct,{element:l.jsx(gA,{}),children:l.jsxs(Ct,{element:l.jsx(CN,{}),children:[l.jsx(Ct,{path:"/",element:l.jsx(VP,{})}),l.jsx(Ct,{path:"/analytics",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(uj,{})})}),l.jsx(Ct,{path:"/updates",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(Aj,{})})}),l.jsx(Ct,{path:"/providers",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(dj,{})})}),l.jsx(Ct,{path:"/cliproxy",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(hj,{})})}),l.jsx(Ct,{path:"/cliproxy/ai-providers",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(fj,{})})}),l.jsx(Ct,{path:"/cliproxy/control-panel",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(pj,{})})}),l.jsx(Ct,{path:"/copilot",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(gj,{})})}),l.jsx(Ct,{path:"/cursor",element:l.jsx(Hb,{to:"/cliproxy?provider=cursor",replace:!0})}),l.jsx(Ct,{path:"/legacy/cursor",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(mj,{})})}),l.jsx(Ct,{path:"/claude-extension",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(yj,{})})}),l.jsx(Ct,{path:"/codex",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(bj,{})})}),l.jsx(Ct,{path:"/droid",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(vj,{})})}),l.jsx(Ct,{path:"/accounts",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(Cj,{})})}),l.jsx(Ct,{path:"/settings",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(Sj,{})})}),l.jsx(Ct,{path:"/health",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(wj,{})})}),l.jsx(Ct,{path:"/logs",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(xj,{})})}),l.jsx(Ct,{path:"/shared",element:l.jsx(S.Suspense,{fallback:l.jsx(Bt,{}),children:l.jsx(kj,{})})})]})})]}),l.jsx(z0,{position:"top-right"})]})})})})})}const Kx=document.getElementById("root");if(!Kx)throw new Error("Root element not found. Failed to mount React application.");dk.createRoot(Kx).render(l.jsx(S.StrictMode,{children:l.jsx(Dj,{})}));export{NE as $,XP as A,jt as B,HM as C,aM as D,CE as E,wE as F,WP as G,tM as H,zn as I,iM as J,SE as K,Kt as L,bD as M,vD as N,xD as O,fv as P,lx as Q,Rh as R,$e as S,Sa as T,Tl as U,Wd as V,ie as W,DE as X,Fe as Y,AE as Z,FM as _,ye as a,pD as a$,TE as a0,PE as a1,ME as a2,LE as a3,jE as a4,EE as a5,dx as a6,RE as a7,VM as a8,Dh as a9,_E as aA,UE as aB,IE as aC,UD as aD,xM as aE,OE as aF,lM as aG,yx as aH,yT as aI,ET as aJ,Pi as aK,sN as aL,lN as aM,cN as aN,uN as aO,nT as aP,Tv as aQ,Xj as aR,Jj as aS,Zj as aT,eE as aU,qE as aV,Hj as aW,yD as aX,Gj as aY,Vj as aZ,fD as a_,Nh as aa,Ij as ab,hD as ac,zj as ad,Kj as ae,Wj as af,Qj as ag,gh as ah,mh as ai,yh as aj,bh as ak,vh as al,HE as am,WM as an,zE as ao,Fl as ap,fE as aq,qd as ar,pE as as,Bd as at,$j as au,gE as av,mE as aw,bE as ax,Sy as ay,yE as az,KM as b,Yj as b0,gD as b1,mD as b2,qj as b3,wh as b4,lE as b5,uE as b6,dE as b7,cE as b8,xx as b9,_k as bA,Hk as bB,Kk as bC,Qk as bD,oE as bE,Bj as bF,Fj as bG,nE as bH,aE as bI,sE as bJ,rE as bK,ml as bL,Ih as ba,hE as bb,Pr as bc,_j as bd,Uj as be,_r as bf,Nl as bg,Ur as bh,GE as bi,jh as bj,Kr as bk,Eh as bl,UP as bm,KP as bn,vE as bo,xE as bp,Sx as bq,A1 as br,N1 as bs,iE as bt,tE as bu,rv as bv,Yk as bw,Gk as bx,Id as by,Ni as bz,z as c,rt as d,BE as e,FE as f,QM as g,sj as h,Oj as i,zM as j,BM as k,oT as l,rT as m,To as n,KE as o,wa as p,ka as q,wv as r,kh as s,kv as t,rh as u,Ah as v,Ir as w,Gy as x,sM as y,kE as z};