@thangnm.nip/arouter 0.1.5 → 0.1.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.next/standalone/.next/BUILD_ID +1 -1
- package/.next/standalone/.next/app-path-routes-manifest.json +10 -10
- package/.next/standalone/.next/build-manifest.json +2 -2
- package/.next/standalone/.next/server/app/(dashboard)/mitm/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/(dashboard)/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_global-error.html +2 -2
- package/.next/standalone/.next/server/app/_global-error.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_global-error.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found/page_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/_not-found.html +1 -1
- package/.next/standalone/.next/server/app/_not-found.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_full.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/antigravity-mitm/alias/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/antigravity-mitm/console-logs/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/antigravity-mitm/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/antigravity-mitm/settings/route.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/antigravity-mitm/settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/claude-settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/codex-settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/copilot-settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/droid-settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/openclaw-settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/cli-tools/opencode-settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/keys/[id]/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/keys/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/locale/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/models/alias/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/models/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/providers/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/settings/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/api/version/route.js +1 -1
- package/.next/standalone/.next/server/app/api/version/route_client-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/app/index.html +1 -1
- package/.next/standalone/.next/server/app/index.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/!KGRhc2hib2FyZCk/__PAGE__.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/index.segments/_full.segment.rsc +4 -4
- package/.next/standalone/.next/server/app/index.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/index.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/index.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/mitm.html +1 -1
- package/.next/standalone/.next/server/app/mitm.rsc +5 -5
- package/.next/standalone/.next/server/app/mitm.segments/!KGRhc2hib2FyZCk/mitm/__PAGE__.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/mitm.segments/!KGRhc2hib2FyZCk/mitm.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/mitm.segments/!KGRhc2hib2FyZCk.segment.rsc +2 -2
- package/.next/standalone/.next/server/app/mitm.segments/_full.segment.rsc +5 -5
- package/.next/standalone/.next/server/app/mitm.segments/_head.segment.rsc +1 -1
- package/.next/standalone/.next/server/app/mitm.segments/_index.segment.rsc +3 -3
- package/.next/standalone/.next/server/app/mitm.segments/_tree.segment.rsc +1 -1
- package/.next/standalone/.next/server/app-paths-manifest.json +10 -10
- package/.next/standalone/.next/server/chunks/411.js +1 -1
- package/.next/standalone/.next/server/chunks/724.js +1 -1
- package/.next/standalone/.next/server/pages/404.html +1 -1
- package/.next/standalone/.next/server/pages/500.html +2 -2
- package/.next/standalone/.next/server/server-reference-manifest.js +1 -1
- package/.next/standalone/.next/server/server-reference-manifest.json +1 -1
- package/.next/standalone/.next/static/chunks/{497-c353b4f1956bed6d.js → 497-ccc7bd75dbf8f86a.js} +1 -1
- package/.next/standalone/.next/static/chunks/{702-69718ee1c240bc82.js → 702-95bdd18daf0b487c.js} +1 -1
- package/.next/standalone/package.json +1 -1
- package/package.json +1 -1
- /package/.next/standalone/.next/static/{g3wZoO1EH-r9FpeStePOD → D0LEa5K3p5asRN-XfJyez}/_buildManifest.js +0 -0
- /package/.next/standalone/.next/static/{g3wZoO1EH-r9FpeStePOD → D0LEa5K3p5asRN-XfJyez}/_ssgManifest.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
self.__RSC_SERVER_MANIFEST="{\"node\":{\"406dfc465c82ffda1ba8d867a23e79bab28001d9e0\":{\"workers\":{\"app/api/cli-tools/antigravity-mitm/alias/route\":{\"moduleId\":\"41041\",\"async\":false}},\"layer\":{\"app/api/cli-tools/antigravity-mitm/alias/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/antigravity-mitm/alias/route.js\",\"exportedName\":\"PUT\"},\"40b420272fd40ab7db9ce54d33394601d907eccadf\":{\"workers\":{\"app/api/cli-tools/antigravity-mitm/alias/route\":{\"moduleId\":\"41041\",\"async\":false}},\"layer\":{\"app/api/cli-tools/antigravity-mitm/alias/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/antigravity-mitm/alias/route.js\",\"exportedName\":\"GET\"},\"404e06b1b91747b0b3c62675d9dd0b89d3c739b293\":{\"workers\":{\"app/api/cli-tools/antigravity-mitm/settings/route\":{\"moduleId\":\"36804\",\"async\":false}},\"layer\":{\"app/api/cli-tools/antigravity-mitm/settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/antigravity-mitm/settings/route.js\",\"exportedName\":\"PATCH\"},\"4062345e69ef1e47b7f9060eea43bb658d9a4ea8c2\":{\"workers\":{\"app/api/cli-tools/antigravity-mitm/settings/route\":{\"moduleId\":\"36804\",\"async\":false}},\"layer\":{\"app/api/cli-tools/antigravity-mitm/settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/antigravity-mitm/settings/route.js\",\"exportedName\":\"POST\"},\"40b81ed87ede32d146b90ab98c35fe9e3751fa9273\":{\"workers\":{\"app/api/cli-tools/antigravity-mitm/settings/route\":{\"moduleId\":\"36804\",\"async\":false}},\"layer\":{\"app/api/cli-tools/antigravity-mitm/settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/antigravity-mitm/settings/route.js\",\"exportedName\":\"GET\"},\"
|
|
1
|
+
self.__RSC_SERVER_MANIFEST="{\"node\":{\"406dfc465c82ffda1ba8d867a23e79bab28001d9e0\":{\"workers\":{\"app/api/cli-tools/antigravity-mitm/alias/route\":{\"moduleId\":\"41041\",\"async\":false}},\"layer\":{\"app/api/cli-tools/antigravity-mitm/alias/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/antigravity-mitm/alias/route.js\",\"exportedName\":\"PUT\"},\"40b420272fd40ab7db9ce54d33394601d907eccadf\":{\"workers\":{\"app/api/cli-tools/antigravity-mitm/alias/route\":{\"moduleId\":\"41041\",\"async\":false}},\"layer\":{\"app/api/cli-tools/antigravity-mitm/alias/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/antigravity-mitm/alias/route.js\",\"exportedName\":\"GET\"},\"404e06b1b91747b0b3c62675d9dd0b89d3c739b293\":{\"workers\":{\"app/api/cli-tools/antigravity-mitm/settings/route\":{\"moduleId\":\"36804\",\"async\":false}},\"layer\":{\"app/api/cli-tools/antigravity-mitm/settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/antigravity-mitm/settings/route.js\",\"exportedName\":\"PATCH\"},\"4062345e69ef1e47b7f9060eea43bb658d9a4ea8c2\":{\"workers\":{\"app/api/cli-tools/antigravity-mitm/settings/route\":{\"moduleId\":\"36804\",\"async\":false}},\"layer\":{\"app/api/cli-tools/antigravity-mitm/settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/antigravity-mitm/settings/route.js\",\"exportedName\":\"POST\"},\"40b81ed87ede32d146b90ab98c35fe9e3751fa9273\":{\"workers\":{\"app/api/cli-tools/antigravity-mitm/settings/route\":{\"moduleId\":\"36804\",\"async\":false}},\"layer\":{\"app/api/cli-tools/antigravity-mitm/settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/antigravity-mitm/settings/route.js\",\"exportedName\":\"GET\"},\"00f56c28daebec3385c20a312e14833b1bebedc1e6\":{\"workers\":{\"app/api/cli-tools/antigravity-mitm/route\":{\"moduleId\":\"67471\",\"async\":false}},\"layer\":{\"app/api/cli-tools/antigravity-mitm/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/antigravity-mitm/route.js\",\"exportedName\":\"GET\"},\"40268da7146fa49806923bc00b23e8b361c581df02\":{\"workers\":{\"app/api/cli-tools/antigravity-mitm/route\":{\"moduleId\":\"67471\",\"async\":false}},\"layer\":{\"app/api/cli-tools/antigravity-mitm/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/antigravity-mitm/route.js\",\"exportedName\":\"POST\"},\"40766ce5520334a28dcda147dc2d38ea07eefb0b1a\":{\"workers\":{\"app/api/cli-tools/antigravity-mitm/route\":{\"moduleId\":\"67471\",\"async\":false}},\"layer\":{\"app/api/cli-tools/antigravity-mitm/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/antigravity-mitm/route.js\",\"exportedName\":\"DELETE\"},\"40d17b06493bc0960d88fdb1684c8971d00f2485d6\":{\"workers\":{\"app/api/cli-tools/antigravity-mitm/route\":{\"moduleId\":\"67471\",\"async\":false}},\"layer\":{\"app/api/cli-tools/antigravity-mitm/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/antigravity-mitm/route.js\",\"exportedName\":\"PATCH\"},\"00181f1247813b4eb658351b1cb3dd9f621698e617\":{\"workers\":{\"app/api/cli-tools/codex-settings/route\":{\"moduleId\":\"37962\",\"async\":false}},\"layer\":{\"app/api/cli-tools/codex-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/codex-settings/route.js\",\"exportedName\":\"DELETE\"},\"003ba786613d896cb177e84f4f8f3861d27558d71b\":{\"workers\":{\"app/api/cli-tools/codex-settings/route\":{\"moduleId\":\"37962\",\"async\":false}},\"layer\":{\"app/api/cli-tools/codex-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/codex-settings/route.js\",\"exportedName\":\"GET\"},\"407a79761c1c6fdf1127bd02ddf92dd6fcb2fb078a\":{\"workers\":{\"app/api/cli-tools/codex-settings/route\":{\"moduleId\":\"37962\",\"async\":false}},\"layer\":{\"app/api/cli-tools/codex-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/codex-settings/route.js\",\"exportedName\":\"POST\"},\"002fd1558db8dd64193de93104122ea35801e8f13f\":{\"workers\":{\"app/api/cli-tools/copilot-settings/route\":{\"moduleId\":\"76280\",\"async\":false}},\"layer\":{\"app/api/cli-tools/copilot-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/copilot-settings/route.js\",\"exportedName\":\"DELETE\"},\"00749cff684cfbefb3dbdfa16dfca219ccb9da4bdc\":{\"workers\":{\"app/api/cli-tools/copilot-settings/route\":{\"moduleId\":\"76280\",\"async\":false}},\"layer\":{\"app/api/cli-tools/copilot-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/copilot-settings/route.js\",\"exportedName\":\"GET\"},\"400aef4b294585c579568feb16c11aab70708ce7f0\":{\"workers\":{\"app/api/cli-tools/copilot-settings/route\":{\"moduleId\":\"76280\",\"async\":false}},\"layer\":{\"app/api/cli-tools/copilot-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/copilot-settings/route.js\",\"exportedName\":\"POST\"},\"0006e2c4f49c31567cc6a59a3189bcd4a010c9397b\":{\"workers\":{\"app/api/cli-tools/openclaw-settings/route\":{\"moduleId\":\"15538\",\"async\":false}},\"layer\":{\"app/api/cli-tools/openclaw-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/openclaw-settings/route.js\",\"exportedName\":\"DELETE\"},\"0078906680557a96e700a4f066dec6d38a9de88308\":{\"workers\":{\"app/api/cli-tools/openclaw-settings/route\":{\"moduleId\":\"15538\",\"async\":false}},\"layer\":{\"app/api/cli-tools/openclaw-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/openclaw-settings/route.js\",\"exportedName\":\"GET\"},\"403371c738a5d2910999add5307bb8caeb6e0ac048\":{\"workers\":{\"app/api/cli-tools/openclaw-settings/route\":{\"moduleId\":\"15538\",\"async\":false}},\"layer\":{\"app/api/cli-tools/openclaw-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/openclaw-settings/route.js\",\"exportedName\":\"POST\"},\"0080a188e7cbeab66d1795ace8cdef86f53cb0f2d7\":{\"workers\":{\"app/api/cli-tools/droid-settings/route\":{\"moduleId\":\"45293\",\"async\":false}},\"layer\":{\"app/api/cli-tools/droid-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/droid-settings/route.js\",\"exportedName\":\"GET\"},\"00955fc428532daa2cdc86ab3d266b7c0b997dd02a\":{\"workers\":{\"app/api/cli-tools/droid-settings/route\":{\"moduleId\":\"45293\",\"async\":false}},\"layer\":{\"app/api/cli-tools/droid-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/droid-settings/route.js\",\"exportedName\":\"DELETE\"},\"404162b5843ef1ef30cd375a71fa2c4537c9890b78\":{\"workers\":{\"app/api/cli-tools/droid-settings/route\":{\"moduleId\":\"45293\",\"async\":false}},\"layer\":{\"app/api/cli-tools/droid-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/droid-settings/route.js\",\"exportedName\":\"POST\"},\"004386aaccd881414b42d99a57d904dd9543a9e754\":{\"workers\":{\"app/api/cli-tools/opencode-settings/route\":{\"moduleId\":\"74885\",\"async\":false}},\"layer\":{\"app/api/cli-tools/opencode-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/opencode-settings/route.js\",\"exportedName\":\"DELETE\"},\"00e6f608548b8bc73cd4666e77e7e17a9e29caf7ef\":{\"workers\":{\"app/api/cli-tools/opencode-settings/route\":{\"moduleId\":\"74885\",\"async\":false}},\"layer\":{\"app/api/cli-tools/opencode-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/opencode-settings/route.js\",\"exportedName\":\"GET\"},\"409857a9570e48ceff648384c70a4e3f0c84ec129a\":{\"workers\":{\"app/api/cli-tools/opencode-settings/route\":{\"moduleId\":\"74885\",\"async\":false}},\"layer\":{\"app/api/cli-tools/opencode-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/opencode-settings/route.js\",\"exportedName\":\"POST\"},\"40ab1e58a6b7c348b22efcd65ccd897bfefc98ac1b\":{\"workers\":{\"app/api/locale/route\":{\"moduleId\":\"18674\",\"async\":false}},\"layer\":{\"app/api/locale/route\":\"rsc\"},\"filename\":\"app/api/locale/route.js\",\"exportedName\":\"POST\"},\"006d253d84497cb29fd000b6adb869d04b0c284bf7\":{\"workers\":{\"app/api/cli-tools/claude-settings/route\":{\"moduleId\":\"52429\",\"async\":false}},\"layer\":{\"app/api/cli-tools/claude-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/claude-settings/route.js\",\"exportedName\":\"GET\"},\"00d6461f4c0f0e885026cc3164c6aa47d3acc711d0\":{\"workers\":{\"app/api/cli-tools/claude-settings/route\":{\"moduleId\":\"52429\",\"async\":false}},\"layer\":{\"app/api/cli-tools/claude-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/claude-settings/route.js\",\"exportedName\":\"DELETE\"},\"40e7b1efca665d6140c4e7f6e7e16cd9c7e6517bfe\":{\"workers\":{\"app/api/cli-tools/claude-settings/route\":{\"moduleId\":\"52429\",\"async\":false}},\"layer\":{\"app/api/cli-tools/claude-settings/route\":\"rsc\"},\"filename\":\"app/api/cli-tools/claude-settings/route.js\",\"exportedName\":\"POST\"}},\"edge\":{},\"encryptionKey\":\"process.env.NEXT_SERVER_ACTIONS_ENCRYPTION_KEY\"}"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"node":{"406dfc465c82ffda1ba8d867a23e79bab28001d9e0":{"workers":{"app/api/cli-tools/antigravity-mitm/alias/route":{"moduleId":"41041","async":false}},"layer":{"app/api/cli-tools/antigravity-mitm/alias/route":"rsc"},"filename":"app/api/cli-tools/antigravity-mitm/alias/route.js","exportedName":"PUT"},"40b420272fd40ab7db9ce54d33394601d907eccadf":{"workers":{"app/api/cli-tools/antigravity-mitm/alias/route":{"moduleId":"41041","async":false}},"layer":{"app/api/cli-tools/antigravity-mitm/alias/route":"rsc"},"filename":"app/api/cli-tools/antigravity-mitm/alias/route.js","exportedName":"GET"},"404e06b1b91747b0b3c62675d9dd0b89d3c739b293":{"workers":{"app/api/cli-tools/antigravity-mitm/settings/route":{"moduleId":"36804","async":false}},"layer":{"app/api/cli-tools/antigravity-mitm/settings/route":"rsc"},"filename":"app/api/cli-tools/antigravity-mitm/settings/route.js","exportedName":"PATCH"},"4062345e69ef1e47b7f9060eea43bb658d9a4ea8c2":{"workers":{"app/api/cli-tools/antigravity-mitm/settings/route":{"moduleId":"36804","async":false}},"layer":{"app/api/cli-tools/antigravity-mitm/settings/route":"rsc"},"filename":"app/api/cli-tools/antigravity-mitm/settings/route.js","exportedName":"POST"},"40b81ed87ede32d146b90ab98c35fe9e3751fa9273":{"workers":{"app/api/cli-tools/antigravity-mitm/settings/route":{"moduleId":"36804","async":false}},"layer":{"app/api/cli-tools/antigravity-mitm/settings/route":"rsc"},"filename":"app/api/cli-tools/antigravity-mitm/settings/route.js","exportedName":"GET"},"
|
|
1
|
+
{"node":{"406dfc465c82ffda1ba8d867a23e79bab28001d9e0":{"workers":{"app/api/cli-tools/antigravity-mitm/alias/route":{"moduleId":"41041","async":false}},"layer":{"app/api/cli-tools/antigravity-mitm/alias/route":"rsc"},"filename":"app/api/cli-tools/antigravity-mitm/alias/route.js","exportedName":"PUT"},"40b420272fd40ab7db9ce54d33394601d907eccadf":{"workers":{"app/api/cli-tools/antigravity-mitm/alias/route":{"moduleId":"41041","async":false}},"layer":{"app/api/cli-tools/antigravity-mitm/alias/route":"rsc"},"filename":"app/api/cli-tools/antigravity-mitm/alias/route.js","exportedName":"GET"},"404e06b1b91747b0b3c62675d9dd0b89d3c739b293":{"workers":{"app/api/cli-tools/antigravity-mitm/settings/route":{"moduleId":"36804","async":false}},"layer":{"app/api/cli-tools/antigravity-mitm/settings/route":"rsc"},"filename":"app/api/cli-tools/antigravity-mitm/settings/route.js","exportedName":"PATCH"},"4062345e69ef1e47b7f9060eea43bb658d9a4ea8c2":{"workers":{"app/api/cli-tools/antigravity-mitm/settings/route":{"moduleId":"36804","async":false}},"layer":{"app/api/cli-tools/antigravity-mitm/settings/route":"rsc"},"filename":"app/api/cli-tools/antigravity-mitm/settings/route.js","exportedName":"POST"},"40b81ed87ede32d146b90ab98c35fe9e3751fa9273":{"workers":{"app/api/cli-tools/antigravity-mitm/settings/route":{"moduleId":"36804","async":false}},"layer":{"app/api/cli-tools/antigravity-mitm/settings/route":"rsc"},"filename":"app/api/cli-tools/antigravity-mitm/settings/route.js","exportedName":"GET"},"00f56c28daebec3385c20a312e14833b1bebedc1e6":{"workers":{"app/api/cli-tools/antigravity-mitm/route":{"moduleId":"67471","async":false}},"layer":{"app/api/cli-tools/antigravity-mitm/route":"rsc"},"filename":"app/api/cli-tools/antigravity-mitm/route.js","exportedName":"GET"},"40268da7146fa49806923bc00b23e8b361c581df02":{"workers":{"app/api/cli-tools/antigravity-mitm/route":{"moduleId":"67471","async":false}},"layer":{"app/api/cli-tools/antigravity-mitm/route":"rsc"},"filename":"app/api/cli-tools/antigravity-mitm/route.js","exportedName":"POST"},"40766ce5520334a28dcda147dc2d38ea07eefb0b1a":{"workers":{"app/api/cli-tools/antigravity-mitm/route":{"moduleId":"67471","async":false}},"layer":{"app/api/cli-tools/antigravity-mitm/route":"rsc"},"filename":"app/api/cli-tools/antigravity-mitm/route.js","exportedName":"DELETE"},"40d17b06493bc0960d88fdb1684c8971d00f2485d6":{"workers":{"app/api/cli-tools/antigravity-mitm/route":{"moduleId":"67471","async":false}},"layer":{"app/api/cli-tools/antigravity-mitm/route":"rsc"},"filename":"app/api/cli-tools/antigravity-mitm/route.js","exportedName":"PATCH"},"00181f1247813b4eb658351b1cb3dd9f621698e617":{"workers":{"app/api/cli-tools/codex-settings/route":{"moduleId":"37962","async":false}},"layer":{"app/api/cli-tools/codex-settings/route":"rsc"},"filename":"app/api/cli-tools/codex-settings/route.js","exportedName":"DELETE"},"003ba786613d896cb177e84f4f8f3861d27558d71b":{"workers":{"app/api/cli-tools/codex-settings/route":{"moduleId":"37962","async":false}},"layer":{"app/api/cli-tools/codex-settings/route":"rsc"},"filename":"app/api/cli-tools/codex-settings/route.js","exportedName":"GET"},"407a79761c1c6fdf1127bd02ddf92dd6fcb2fb078a":{"workers":{"app/api/cli-tools/codex-settings/route":{"moduleId":"37962","async":false}},"layer":{"app/api/cli-tools/codex-settings/route":"rsc"},"filename":"app/api/cli-tools/codex-settings/route.js","exportedName":"POST"},"002fd1558db8dd64193de93104122ea35801e8f13f":{"workers":{"app/api/cli-tools/copilot-settings/route":{"moduleId":"76280","async":false}},"layer":{"app/api/cli-tools/copilot-settings/route":"rsc"},"filename":"app/api/cli-tools/copilot-settings/route.js","exportedName":"DELETE"},"00749cff684cfbefb3dbdfa16dfca219ccb9da4bdc":{"workers":{"app/api/cli-tools/copilot-settings/route":{"moduleId":"76280","async":false}},"layer":{"app/api/cli-tools/copilot-settings/route":"rsc"},"filename":"app/api/cli-tools/copilot-settings/route.js","exportedName":"GET"},"400aef4b294585c579568feb16c11aab70708ce7f0":{"workers":{"app/api/cli-tools/copilot-settings/route":{"moduleId":"76280","async":false}},"layer":{"app/api/cli-tools/copilot-settings/route":"rsc"},"filename":"app/api/cli-tools/copilot-settings/route.js","exportedName":"POST"},"0006e2c4f49c31567cc6a59a3189bcd4a010c9397b":{"workers":{"app/api/cli-tools/openclaw-settings/route":{"moduleId":"15538","async":false}},"layer":{"app/api/cli-tools/openclaw-settings/route":"rsc"},"filename":"app/api/cli-tools/openclaw-settings/route.js","exportedName":"DELETE"},"0078906680557a96e700a4f066dec6d38a9de88308":{"workers":{"app/api/cli-tools/openclaw-settings/route":{"moduleId":"15538","async":false}},"layer":{"app/api/cli-tools/openclaw-settings/route":"rsc"},"filename":"app/api/cli-tools/openclaw-settings/route.js","exportedName":"GET"},"403371c738a5d2910999add5307bb8caeb6e0ac048":{"workers":{"app/api/cli-tools/openclaw-settings/route":{"moduleId":"15538","async":false}},"layer":{"app/api/cli-tools/openclaw-settings/route":"rsc"},"filename":"app/api/cli-tools/openclaw-settings/route.js","exportedName":"POST"},"0080a188e7cbeab66d1795ace8cdef86f53cb0f2d7":{"workers":{"app/api/cli-tools/droid-settings/route":{"moduleId":"45293","async":false}},"layer":{"app/api/cli-tools/droid-settings/route":"rsc"},"filename":"app/api/cli-tools/droid-settings/route.js","exportedName":"GET"},"00955fc428532daa2cdc86ab3d266b7c0b997dd02a":{"workers":{"app/api/cli-tools/droid-settings/route":{"moduleId":"45293","async":false}},"layer":{"app/api/cli-tools/droid-settings/route":"rsc"},"filename":"app/api/cli-tools/droid-settings/route.js","exportedName":"DELETE"},"404162b5843ef1ef30cd375a71fa2c4537c9890b78":{"workers":{"app/api/cli-tools/droid-settings/route":{"moduleId":"45293","async":false}},"layer":{"app/api/cli-tools/droid-settings/route":"rsc"},"filename":"app/api/cli-tools/droid-settings/route.js","exportedName":"POST"},"004386aaccd881414b42d99a57d904dd9543a9e754":{"workers":{"app/api/cli-tools/opencode-settings/route":{"moduleId":"74885","async":false}},"layer":{"app/api/cli-tools/opencode-settings/route":"rsc"},"filename":"app/api/cli-tools/opencode-settings/route.js","exportedName":"DELETE"},"00e6f608548b8bc73cd4666e77e7e17a9e29caf7ef":{"workers":{"app/api/cli-tools/opencode-settings/route":{"moduleId":"74885","async":false}},"layer":{"app/api/cli-tools/opencode-settings/route":"rsc"},"filename":"app/api/cli-tools/opencode-settings/route.js","exportedName":"GET"},"409857a9570e48ceff648384c70a4e3f0c84ec129a":{"workers":{"app/api/cli-tools/opencode-settings/route":{"moduleId":"74885","async":false}},"layer":{"app/api/cli-tools/opencode-settings/route":"rsc"},"filename":"app/api/cli-tools/opencode-settings/route.js","exportedName":"POST"},"40ab1e58a6b7c348b22efcd65ccd897bfefc98ac1b":{"workers":{"app/api/locale/route":{"moduleId":"18674","async":false}},"layer":{"app/api/locale/route":"rsc"},"filename":"app/api/locale/route.js","exportedName":"POST"},"006d253d84497cb29fd000b6adb869d04b0c284bf7":{"workers":{"app/api/cli-tools/claude-settings/route":{"moduleId":"52429","async":false}},"layer":{"app/api/cli-tools/claude-settings/route":"rsc"},"filename":"app/api/cli-tools/claude-settings/route.js","exportedName":"GET"},"00d6461f4c0f0e885026cc3164c6aa47d3acc711d0":{"workers":{"app/api/cli-tools/claude-settings/route":{"moduleId":"52429","async":false}},"layer":{"app/api/cli-tools/claude-settings/route":"rsc"},"filename":"app/api/cli-tools/claude-settings/route.js","exportedName":"DELETE"},"40e7b1efca665d6140c4e7f6e7e16cd9c7e6517bfe":{"workers":{"app/api/cli-tools/claude-settings/route":{"moduleId":"52429","async":false}},"layer":{"app/api/cli-tools/claude-settings/route":"rsc"},"filename":"app/api/cli-tools/claude-settings/route.js","exportedName":"POST"}},"edge":{},"encryptionKey":"Q9cRpVj80EyXH9L6E6bP0jVmk/VFK9LJeyUjw7uYhA0="}
|
package/.next/standalone/.next/static/chunks/{497-c353b4f1956bed6d.js → 497-ccc7bd75dbf8f86a.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[497],{98:(e,t,r)=>{r.d(t,{default:()=>l});var s=r(5155),a=r(1474);function l({label:e,options:t=[],value:r,onChange:l,placeholder:i="Select an option",error:n,hint:o,disabled:c=!1,required:d=!1,className:m,selectClassName:x,...u}){return(0,s.jsxs)("div",{className:(0,a.cn)("flex flex-col gap-1.5",m),children:[e&&(0,s.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[e,d&&(0,s.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsxs)("select",{value:r,onChange:l,disabled:c,className:(0,a.cn)("w-full py-2 px-3 pr-10 text-sm text-text-main","bg-white dark:bg-white/5 border border-black/10 dark:border-white/10 rounded-md appearance-none","focus:ring-1 focus:ring-primary/30 focus:border-primary/50 focus:outline-none","transition-all disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",n?"border-red-500 focus:border-red-500 focus:ring-red-500/20":"",x),...u,children:[(0,s.jsx)("option",{value:"",disabled:!0,children:i}),t.map(e=>(0,s.jsx)("option",{value:e.value,children:e.label},e.value))]}),(0,s.jsx)("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none text-text-muted",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"expand_more"})})]}),n&&(0,s.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),n]}),o&&!n&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:o})]})}},815:(e,t,r)=>{r.d(t,{default:()=>o});var s=r(5155),a=r(2115),l=r(4051),i=r.n(l),n=r(5497);function o({isOpen:e,onSuccess:t,onClose:r}){let[l,i]=(0,a.useState)(""),[o,c]=(0,a.useState)(""),[d,m]=(0,a.useState)(null),[x,u]=(0,a.useState)(!1),[h,p]=(0,a.useState)(!1),[b,f]=(0,a.useState)(!1),[g,j]=(0,a.useState)(!1),v=async()=>{p(!0),m(null),f(!1),j(!1);try{let e=await fetch("/api/oauth/cursor/auto-import"),t=await e.json();t.found?(i(t.accessToken),c(t.machineId),f(!0)):t.windowsManual?j(!0):m(t.error||"Could not auto-detect tokens")}catch(e){m("Failed to auto-detect tokens")}finally{p(!1)}};(0,a.useEffect)(()=>{e&&v()},[e]);let y=async()=>{if(!l.trim())return void m("Please enter an access token");if(!o.trim())return void m("Please enter a machine ID");u(!0),m(null);try{let e=await fetch("/api/oauth/cursor/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:l.trim(),machineId:o.trim()})}),s=await e.json();if(!e.ok)throw Error(s.error||"Import failed");t?.(),r()}catch(e){m(e.message)}finally{u(!1)}};return(0,s.jsx)(n.aF,{isOpen:e,title:"Connect Cursor IDE",onClose:r,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[h&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting tokens..."}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from Cursor IDE database"})]}),!h&&(0,s.jsxs)(s.Fragment,{children:[b&&(0,s.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,s.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Tokens auto-detected from Cursor IDE successfully!"})]})}),g&&(0,s.jsxs)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-3 rounded-lg border border-amber-200 dark:border-amber-800 flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,s.jsx)("p",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:"Could not read Cursor database automatically."})]}),(0,s.jsxs)("p",{className:"text-xs text-amber-700 dark:text-amber-300",children:["Run this command in your terminal, then click ",(0,s.jsx)("strong",{children:"Retry"}),":"]}),(0,s.jsx)("pre",{className:"text-xs bg-black/10 dark:bg-white/10 rounded p-2 font-mono select-all",children:"npm i better-sqlite3 -g"}),(0,s.jsx)(n.$n,{onClick:v,variant:"outline",fullWidth:!0,children:"Retry"})]}),!b&&!g&&!d&&(0,s.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,s.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Cursor IDE not detected. Please paste your tokens manually."})]})}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Access Token ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)("textarea",{value:l,onChange:e=>i(e.target.value),placeholder:"Access token will be auto-filled...",rows:3,className:"w-full px-3 py-2 text-sm font-mono border border-border rounded-lg bg-background focus:outline-none focus:border-primary resize-none"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Machine ID ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)(n.pd,{value:o,onChange:e=>c(e.target.value),placeholder:"Machine ID will be auto-filled...",className:"font-mono text-sm"})]}),d&&(0,s.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,s.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:d})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.$n,{onClick:y,fullWidth:!0,disabled:x||!l.trim()||!o.trim(),children:x?"Importing...":"Import Token"}),(0,s.jsx)(n.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}o.propTypes={isOpen:i().bool.isRequired,onSuccess:i().func,onClose:i().func.isRequired}},882:(e,t,r)=>{r.d(t,{default:()=>c});var s=r(5155),a=r(2115),l=r(4051),i=r.n(l),n=r(5497),o=r(1059);function c({isOpen:e,provider:t,providerInfo:r,onSuccess:l,onClose:i}){let[c,d]=(0,a.useState)("waiting"),[m,x]=(0,a.useState)(null),[u,h]=(0,a.useState)(""),[p,b]=(0,a.useState)(null),[f,g]=(0,a.useState)(!1),[j,v]=(0,a.useState)(null),[y,N]=(0,a.useState)(!1),k=(0,a.useRef)(null),w=(0,a.useRef)(!1),{copied:C,copy:S}=(0,o.C)(),[$,z]=(0,a.useState)(!1),[_,E]=(0,a.useState)("/callback?code=..."),L=(0,a.useRef)(!1);(0,a.useEffect)(()=>{z("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname),E(`${window.location.origin}/callback?code=...`)},[]);let T=(0,a.useCallback)(async(e,r)=>{if(m)try{let s=await fetch(`/api/oauth/${t}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,redirectUri:m.redirectUri,codeVerifier:m.codeVerifier,state:r})}),a=await s.json();if(!s.ok)throw Error(a.error);d("success"),l?.()}catch(e){b(e.message),d("error")}},[m,t,l]),R=(0,a.useCallback)(async(e,r,s,a)=>{w.current=!1,N(!0);for(let i=0;i<60;i++){if(w.current){console.log("[OAuthModal] Polling aborted"),N(!1);return}if(await new Promise(e=>setTimeout(e,1e3*s)),w.current){console.log("[OAuthModal] Polling aborted after sleep"),N(!1);return}try{let i=await fetch(`/api/oauth/${t}/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:e,codeVerifier:r,extraData:a})}),n=await i.json();if(n.success){w.current=!0,d("success"),N(!1),l?.();return}if("expired_token"===n.error||"access_denied"===n.error)throw Error(n.errorDescription||n.error);"slow_down"===n.error&&(s=Math.min(s+5,30))}catch(e){b(e.message),d("error"),N(!1);return}}b("Authorization timeout"),d("error"),N(!1)},[t,l]),I=(0,a.useCallback)(async()=>{if(t)try{let e;if(b(null),["github","qwen","kiro","kimi-coding","kilocode"].includes(t)){g(!0),d("waiting");let e=await fetch(`/api/oauth/${t}/device-code`),r=await e.json();if(!e.ok)throw Error(r.error);v(r);let s=r.verification_uri_complete||r.verification_uri;s&&window.open(s,"_blank");let a="kiro"===t?{_clientId:r._clientId,_clientSecret:r._clientSecret}:null;R(r.device_code,r.codeVerifier,r.interval||5,a);return}if("codex"===t)e="http://localhost:1455/auth/callback";else{let t=window.location.port||("https:"===window.location.protocol?"443":"80");e=`http://localhost:${t}/callback`}let r=await fetch(`/api/oauth/${t}/authorize?redirect_uri=${encodeURIComponent(e)}`),s=await r.json();if(!r.ok)throw Error(s.error);x({...s,redirectUri:e}),"codex"!==t&&$?(d("waiting"),k.current=window.open(s.authUrl,"oauth_popup","width=600,height=700"),k.current||d("input")):(d("input"),window.open(s.authUrl,"_blank"))}catch(e){b(e.message),d("error")}},[t,$,R]);(0,a.useEffect)(()=>{e&&t?(x(null),h(""),b(null),g(!1),v(null),N(!1),w.current=!1,I()):e||(w.current=!0)},[e,t,I]),(0,a.useEffect)(()=>{let e;if(!m)return;L.current=!1;let t=async e=>{if(L.current)return;let{code:t,state:r,error:s,errorDescription:a}=e;if(s){L.current=!0,b(a||s),d("error");return}t&&(L.current=!0,await T(t,r))},r=e=>{let r=e.origin.includes("localhost")||e.origin.includes("127.0.0.1"),s=e.origin===window.location.origin;(r||s)&&e.data?.type==="oauth_callback"&&t(e.data.data)};window.addEventListener("message",r);try{(e=new BroadcastChannel("oauth_callback")).onmessage=e=>t(e.data)}catch(e){console.log("BroadcastChannel not supported")}let s=e=>{if("oauth_callback"===e.key&&e.newValue)try{let r=JSON.parse(e.newValue);t(r),localStorage.removeItem("oauth_callback")}catch(e){console.log("Failed to parse localStorage data")}};window.addEventListener("storage",s);try{let e=localStorage.getItem("oauth_callback");if(e){let r=JSON.parse(e);r.timestamp&&Date.now()-r.timestamp<3e4&&t(r),localStorage.removeItem("oauth_callback")}}catch{}return()=>{window.removeEventListener("message",r),window.removeEventListener("storage",s),e&&e.close()}},[m,T]);let O=async()=>{try{b(null);let e=new URL(u),t=e.searchParams.get("code"),r=e.searchParams.get("state"),s=e.searchParams.get("error");if(s)throw Error(e.searchParams.get("error_description")||s);if(!t)throw Error("No authorization code found in URL");await T(t,r)}catch(e){b(e.message),d("error")}},A=(0,a.useCallback)(()=>{i()},[i]);return t&&r?(0,s.jsx)(n.aF,{isOpen:e,title:`Connect ${r.name}`,onClose:A,size:"lg",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:["waiting"===c&&!f&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Waiting for Authorization"}),(0,s.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Complete the authorization in the popup window."}),(0,s.jsx)(n.$n,{variant:"ghost",onClick:()=>d("input"),children:"Popup blocked? Enter URL manually"})]}),"waiting"===c&&f&&j&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"text-center py-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Visit the URL below and enter the code:"}),(0,s.jsxs)("div",{className:"bg-sidebar p-4 rounded-lg mb-4",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Verification URL"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("code",{className:"flex-1 text-sm break-all",children:j.verification_uri}),(0,s.jsx)(n.$n,{size:"sm",variant:"ghost",icon:"verify_url"===C?"check":"content_copy",onClick:()=>S(j.verification_uri,"verify_url")})]})]}),(0,s.jsxs)("div",{className:"bg-primary/10 p-4 rounded-lg",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Your Code"}),(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,s.jsx)("p",{className:"text-2xl font-mono font-bold text-primary",children:j.user_code}),(0,s.jsx)(n.$n,{size:"sm",variant:"ghost",icon:"user_code"===C?"check":"content_copy",onClick:()=>S(j.user_code,"user_code")})]})]})]}),y&&(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2 text-sm text-text-muted",children:[(0,s.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),"Waiting for authorization..."]})]}),"input"===c&&!f&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.pd,{value:m?.authUrl||"",readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,s.jsx)(n.$n,{variant:"secondary",icon:"auth_url"===C?"check":"content_copy",onClick:()=>S(m?.authUrl,"auth_url"),children:"Copy"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser."}),(0,s.jsx)(n.pd,{value:u,onChange:e=>h(e.target.value),placeholder:_,className:"font-mono text-xs"})]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.$n,{onClick:O,fullWidth:!0,disabled:!u,children:"Connect"}),(0,s.jsx)(n.$n,{onClick:A,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===c&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,s.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your ",r.name," account has been connected."]}),(0,s.jsx)(n.$n,{onClick:A,fullWidth:!0,children:"Done"})]}),"error"===c&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,s.jsx)("p",{className:"text-sm text-red-600 mb-4",children:p}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.$n,{onClick:I,variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,s.jsx)(n.$n,{onClick:A,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}c.propTypes={isOpen:i().bool.isRequired,provider:i().string,providerInfo:i().shape({name:i().string}),onSuccess:i().func,onClose:i().func.isRequired}},1059:(e,t,r)=>{r.d(t,{C:()=>a});var s=r(2115);function a(e=2e3){let[t,r]=(0,s.useState)(null),l=(0,s.useRef)(null);return{copied:t,copy:(0,s.useCallback)((t,s="default")=>{navigator.clipboard.writeText(t),r(s),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{r(null)},e)},[e])}}},1127:(e,t,r)=>{r.d(t,{ConfirmModal:()=>o,default:()=>n});var s=r(5155),a=r(2115),l=r(1474),i=r(2542);function n({isOpen:e,onClose:t,title:r,children:i,footer:n,size:o="md",closeOnOverlay:c=!0,showCloseButton:d=!0,className:m}){return((0,a.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,a.useEffect)(()=>{let r=r=>{"Escape"===r.key&&e&&t()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,t]),e)?(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:c?t:void 0}),(0,s.jsxs)("div",{className:(0,l.cn)("relative w-full bg-surface","border border-black/10 dark:border-white/10","rounded-xl shadow-2xl","animate-in fade-in zoom-in-95 duration-200",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-4xl"}[o],m),children:[(r||d)&&(0,s.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-black/5 dark:border-white/5",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mr-4",children:[(0,s.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FF5F56]"}),(0,s.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E]"}),(0,s.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#27C93F]"})]}),r&&(0,s.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:r})]}),d&&(0,s.jsx)("button",{onClick:t,className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,s.jsx)("div",{className:"p-6 max-h-[calc(80vh-140px)] overflow-y-auto",children:i}),n&&(0,s.jsx)("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-black/5 dark:border-white/5",children:n})]})]}):null}function o({isOpen:e,onClose:t,onConfirm:r,title:a="Confirm",message:l,confirmText:o="Confirm",cancelText:c="Cancel",variant:d="danger",loading:m=!1}){return(0,s.jsx)(n,{isOpen:e,onClose:t,title:a,size:"sm",footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.default,{variant:"ghost",onClick:t,disabled:m,children:c}),(0,s.jsx)(i.default,{variant:d,onClick:r,loading:m,children:o})]}),children:(0,s.jsx)("p",{className:"text-text-muted",children:l})})}},1450:(e,t,r)=>{r.d(t,{default:()=>n});var s=r(5155),a=r(4051),l=r.n(a),i=r(1929);function n({children:e}){return(0,s.jsxs)("div",{className:"min-h-screen flex flex-col relative bg-bg transition-colors duration-500 overflow-x-hidden selection:bg-primary/20 selection:text-primary",children:[(0,s.jsx)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] bg-primary/5 dark:bg-primary/5 rounded-full blur-[100px] pointer-events-none z-0"}),(0,s.jsx)("div",{className:"fixed bottom-0 right-0 w-[600px] h-[600px] bg-orange-200/20 dark:bg-orange-900/10 rounded-full blur-[120px] pointer-events-none z-0 translate-y-1/3 translate-x-1/3"}),(0,s.jsx)("div",{className:"absolute top-6 right-6 z-20",children:(0,s.jsx)(i.default,{variant:"card"})}),(0,s.jsx)("main",{className:"flex-1 flex flex-col items-center justify-center p-4 sm:p-6 z-10 w-full h-full",children:e})]})}n.propTypes={children:l().node.isRequired}},1474:(e,t,r)=>{r.d(t,{cn:()=>s});function s(...e){return e.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}},1500:(e,t,r)=>{r.d(t,{default:()=>o});var s=r(5155),a=r(2115),l=r(4051),i=r.n(l),n=r(5497);function o({isOpen:e,onMethodSelect:t,onClose:r}){let[l,i]=(0,a.useState)(null),[o,c]=(0,a.useState)(""),[d,m]=(0,a.useState)("us-east-1"),[x,u]=(0,a.useState)(""),[h,p]=(0,a.useState)(null),[b,f]=(0,a.useState)(!1),[g,j]=(0,a.useState)(!1),[v,y]=(0,a.useState)(!1);(0,a.useEffect)(()=>{"import"===l&&e&&(async()=>{j(!0),p(null),y(!1);try{let e=await fetch("/api/oauth/kiro/auto-import"),t=await e.json();t.found?(u(t.refreshToken),y(!0)):p(t.error||"Could not auto-detect token")}catch(e){p("Failed to auto-detect token")}finally{j(!1)}})()},[l,e]);let N=e=>{i(e),p(null)},k=()=>{i(null),p(null)},w=async()=>{if(!x.trim())return void p("Please enter a refresh token");f(!0),p(null);try{let e=await fetch("/api/oauth/kiro/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:x.trim()})}),r=await e.json();if(!e.ok)throw Error(r.error||"Import failed");t("import")}catch(e){p(e.message)}finally{f(!1)}},C=e=>{t("social",{provider:e})};return(0,s.jsx)(n.aF,{isOpen:e,title:"Connect Kiro",onClose:r,size:"lg",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[!l&&(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Choose your authentication method:"}),(0,s.jsx)("button",{onClick:()=>t("builder-id"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"shield"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"AWS Builder ID"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Recommended for most users. Free AWS account required."})]})]})}),(0,s.jsx)("button",{onClick:()=>N("idc"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"business"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"AWS IAM Identity Center"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"For enterprise users with custom AWS IAM Identity Center."})]})]})}),(0,s.jsx)("button",{onClick:()=>N("social-google"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"account_circle"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"Google Account"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your Google account (manual callback)."})]})]})}),(0,s.jsx)("button",{onClick:()=>N("social-github"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"code"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"GitHub Account"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your GitHub account (manual callback)."})]})]})}),(0,s.jsx)("button",{onClick:()=>N("import"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"file_upload"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"Import Token"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Paste refresh token from Kiro IDE."})]})]})})]}),"idc"===l&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["IDC Start URL ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)(n.pd,{value:o,onChange:e=>c(e.target.value),placeholder:"https://your-org.awsapps.com/start",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Your organization's AWS IAM Identity Center URL"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2",children:"AWS Region"}),(0,s.jsx)(n.pd,{value:d,onChange:e=>m(e.target.value),placeholder:"us-east-1",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"AWS region for your Identity Center (default: us-east-1)"})]}),h&&(0,s.jsx)("p",{className:"text-sm text-red-600",children:h}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.$n,{onClick:()=>{o.trim()?t("idc",{startUrl:o.trim(),region:d}):p("Please enter your IDC start URL")},fullWidth:!0,children:"Continue"}),(0,s.jsx)(n.$n,{onClick:k,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-google"===l&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,s.jsxs)("div",{className:"flex-1 text-sm",children:[(0,s.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,s.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.$n,{onClick:()=>C("google"),fullWidth:!0,children:"Continue with Google"}),(0,s.jsx)(n.$n,{onClick:k,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-github"===l&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,s.jsxs)("div",{className:"flex-1 text-sm",children:[(0,s.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,s.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.$n,{onClick:()=>C("github"),fullWidth:!0,children:"Continue with GitHub"}),(0,s.jsx)(n.$n,{onClick:k,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"import"===l&&(0,s.jsxs)("div",{className:"space-y-4",children:[g&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting token..."}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from AWS SSO cache"})]}),!g&&(0,s.jsxs)(s.Fragment,{children:[v&&(0,s.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,s.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Token auto-detected from Kiro IDE successfully!"})]})}),!v&&!h&&(0,s.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,s.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Kiro IDE not detected. Please paste your refresh token manually."})]})}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Refresh Token ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)(n.pd,{value:x,onChange:e=>u(e.target.value),placeholder:"Token will be auto-filled...",className:"font-mono text-sm"})]}),h&&(0,s.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,s.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:h})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.$n,{onClick:w,fullWidth:!0,disabled:b||!x.trim(),children:b?"Importing...":"Import Token"}),(0,s.jsx)(n.$n,{onClick:k,variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})]})})}o.propTypes={isOpen:i().bool.isRequired,onMethodSelect:i().func.isRequired,onClose:i().func.isRequired}},1738:(e,t,r)=>{r.d(t,{default:()=>m});var s=r(5155),a=r(2115),l=r(3321),i=r(1934);let n=0,o=(0,i.v)((e,t)=>({notifications:[],addNotification:r=>{let s=++n,a={id:s,type:r.type||"info",message:r.message,title:r.title||null,duration:r.duration??5e3,dismissible:r.dismissible??!0,createdAt:Date.now()};return e(e=>({notifications:[...e.notifications,a]})),a.duration>0&&setTimeout(()=>t().removeNotification(s),a.duration),s},removeNotification:t=>{e(e=>({notifications:e.notifications.filter(e=>e.id!==t)}))},clearAll:()=>e({notifications:[]}),success:(e,r)=>t().addNotification({type:"success",message:e,title:r}),error:(e,r)=>t().addNotification({type:"error",message:e,title:r,duration:8e3}),warning:(e,r)=>t().addNotification({type:"warning",message:e,title:r}),info:(e,r)=>t().addNotification({type:"info",message:e,title:r})}));var c=r(2622),d=r(4891);function m({children:e}){let[t,r]=(0,a.useState)(!1),[i,n]=(0,a.useState)(!1),m=(0,l.usePathname)(),x=o(e=>e.notifications),u=o(e=>e.removeNotification);return(0,s.jsxs)("div",{className:"flex h-screen w-full overflow-hidden bg-bg",children:[(0,s.jsx)("div",{className:"fixed top-4 right-4 z-[80] flex w-[min(92vw,380px)] flex-col gap-2",children:x.map(e=>{var t;let r="success"===(t=e.type)?{wrapper:"border-green-500/30 bg-green-500/10 text-green-600 dark:text-green-400",icon:"check_circle"}:"error"===t?{wrapper:"border-red-500/30 bg-red-500/10 text-red-600 dark:text-red-400",icon:"error"}:"warning"===t?{wrapper:"border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400",icon:"warning"}:{wrapper:"border-blue-500/30 bg-blue-500/10 text-blue-600 dark:text-blue-400",icon:"info"};return(0,s.jsx)("div",{className:`rounded-lg border px-3 py-2 shadow-lg backdrop-blur-sm ${r.wrapper}`,children:(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px] leading-5",children:r.icon}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[e.title?(0,s.jsx)("p",{className:"text-xs font-semibold mb-0.5",children:e.title}):null,(0,s.jsx)("p",{className:"text-xs whitespace-pre-wrap break-words",children:e.message})]}),e.dismissible?(0,s.jsx)("button",{type:"button",onClick:()=>u(e.id),className:"text-current/70 hover:text-current","aria-label":"Dismiss notification",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})}):null]})},e.id)})}),t&&(0,s.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20 lg:hidden",onClick:()=>r(!1)}),(0,s.jsx)("div",{className:"hidden lg:flex",children:(0,s.jsx)(c.default,{collapsed:i,onToggleCollapse:()=>n(e=>!e)})}),(0,s.jsx)("div",{className:`fixed inset-y-0 left-0 z-50 transform lg:hidden transition-transform duration-300 ease-in-out ${t?"translate-x-0":"-translate-x-full"}`,children:(0,s.jsx)(c.default,{onClose:()=>r(!1)})}),(0,s.jsxs)("main",{className:"flex flex-col flex-1 h-full min-w-0 relative transition-colors duration-300",children:[(0,s.jsx)(d.default,{onMenuClick:()=>r(!0)},m),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar p-6 lg:p-10",children:(0,s.jsx)("div",{className:"max-w-7xl mx-auto",children:e})})]})]})}},1910:(e,t,r)=>{r.d(t,{default:()=>l});var s=r(5155),a=r(1474);function l({label:e,type:t="text",placeholder:r,value:l,onChange:i,error:n,hint:o,icon:c,disabled:d=!1,required:m=!1,className:x,inputClassName:u,...h}){return(0,s.jsxs)("div",{className:(0,a.cn)("flex flex-col gap-1.5",x),children:[e&&(0,s.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[e,m&&(0,s.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,s.jsxs)("div",{className:"relative",children:[c&&(0,s.jsx)("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-text-muted",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:c})}),(0,s.jsx)("input",{type:t,placeholder:r,value:l,onChange:i,disabled:d,className:(0,a.cn)("w-full py-2 px-3 text-sm text-text-main","bg-white dark:bg-white/5 border border-black/10 dark:border-white/10 rounded-md","placeholder-text-muted/60","focus:ring-1 focus:ring-primary/30 focus:border-primary/50 focus:outline-none","transition-all shadow-inner disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",c&&"pl-10",n?"border-red-500 focus:border-red-500 focus:ring-red-500/20":"",u),...h})]}),n&&(0,s.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),n]}),o&&!n&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:o})]})}},1929:(e,t,r)=>{r.d(t,{default:()=>d});var s=r(5155),a=r(2115),l=r(85);function i(e){let t=window.matchMedia("(prefers-color-scheme: dark)");return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function n(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function o(){return!1}var c=r(1474);function d({className:e,variant:t="default"}){let{theme:r,toggleTheme:d,isDark:m}=function(){let{theme:e,setTheme:t,toggleTheme:r,initTheme:s}=(0,l.A)(),c=(0,a.useSyncExternalStore)(i,n,o);(0,a.useEffect)(()=>{s()},[s]),(0,a.useEffect)(()=>{if("system"!==e)return;let t=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>s();return t.addEventListener("change",r),()=>t.removeEventListener("change",r)},[e,s]);let d="dark"===e||"system"===e&&c;return{theme:e,setTheme:t,toggleTheme:r,isDark:d}}(),x={default:(0,c.cn)("flex items-center justify-center size-10 rounded-full","text-text-muted","hover:bg-black/5","hover:text-text-main","transition-colors"),card:(0,c.cn)("flex items-center justify-center size-11 rounded-full","bg-surface/60","hover:bg-surface","border border-border","backdrop-blur-md shadow-sm hover:shadow-md","text-text-muted-light hover:text-primary","hover:text-primary","transition-all group")};return(0,s.jsx)("button",{onClick:d,className:(0,c.cn)(x[t],e),"aria-label":`Switch to ${m?"light":"dark"} mode`,title:`Switch to ${m?"light":"dark"} mode`,children:(0,s.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[22px]","card"===t&&"transition-transform duration-300 group-hover:rotate-12"),children:m?"light_mode":"dark_mode"})})}},1931:(e,t,r)=>{r.d(t,{default:()=>o});var s=r(5155),a=r(2115),l=r(3308),i=r(3006);let n=e=>({en:"English",vi:"Tiếng Việt","zh-CN":"简体中文"})[e]||e;function o({className:e=""}){let[t,r]=(0,a.useState)("en"),[o,c]=(0,a.useState)(!1),[d,m]=(0,a.useState)(!1),x=(0,a.useRef)(null);(0,a.useEffect)(()=>{r(function(){if("u"<typeof document)return"en";let e=document.cookie.split(";").find(e=>e.trim().startsWith(`${l.CL}=`)),t=e?decodeURIComponent(e.split("=")[1]):"en";return(0,l.QC)(t)}())},[]),(0,a.useEffect)(()=>{function e(e){x.current&&!x.current.contains(e.target)&&m(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let u=async e=>{if(e!==t&&!o){c(!0),m(!1);try{await fetch("/api/locale",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({locale:e})}),await (0,i.wn)(),r(e)}catch(e){console.error("Failed to set locale:",e)}finally{c(!1)}}};return(0,s.jsxs)("div",{className:`relative ${e}`,ref:x,children:[(0,s.jsxs)("button",{onClick:()=>m(!d),disabled:o,className:"flex items-center gap-2 px-3 py-2 rounded-lg text-text-muted hover:text-text-main hover:bg-surface/60 transition-colors",title:"Language","data-i18n-skip":"true",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-xl",children:"language"}),(0,s.jsx)("span",{className:"text-sm font-medium",children:n(t)}),(0,s.jsx)("span",{className:"material-symbols-outlined text-base",children:d?"expand_less":"expand_more"})]}),d&&(0,s.jsx)("div",{className:"absolute right-0 mt-2 w-48 bg-surface border border-black/10 dark:border-white/10 rounded-lg shadow-lg overflow-hidden z-50","data-i18n-skip":"true",children:l.YZ.map(e=>{let r=t===e;return(0,s.jsxs)("button",{onClick:()=>u(e),disabled:o,className:`w-full flex items-center justify-between px-4 py-2.5 text-sm transition-colors ${r?"bg-primary/15 text-primary font-medium":"text-text-main hover:bg-surface-hover"} ${o?"opacity-70 cursor-wait":""}`,children:[(0,s.jsx)("span",{children:n(e)}),r&&(0,s.jsx)("span",{className:"material-symbols-outlined text-base",children:"check"})]},e)})})]})}},2173:(e,t,r)=>{r.d(t,{default:()=>d});var s=r(5155),a=r(8500),l=r.n(a),i=r(620);let n=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"#"}],o=[{label:"Documentation",href:"#"},{label:"API Reference",href:"#"},{label:"Help Center",href:"#"}],c=[{label:"About",href:"#"},{label:"Blog",href:"#"},{label:"Contact",href:"#"}];function d(){return(0,s.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,s.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,s.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,s.jsx)("div",{className:"size-6 text-primary",children:(0,s.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,s.jsx)("path",{clipRule:"evenodd",d:"M12.0799 24L4 19.2479L9.95537 8.75216L18.04 13.4961L18.0446 4H29.9554L29.96 13.4961L38.0446 8.75216L44 19.2479L35.92 24L44 28.7521L38.0446 39.2479L29.96 34.5039L29.9554 44H18.0446L18.04 34.5039L9.95537 39.2479L4 28.7521L12.0799 24Z",fillRule:"evenodd"})})}),(0,s.jsx)("span",{className:"text-xl font-bold text-text-main",children:i.vQ.name})]}),(0,s.jsx)("p",{className:"text-text-muted mb-6 max-w-sm font-light",children:"The unified interface for modern AI infrastructure. Secure, observable, and scalable."}),(0,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Twitter",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"})})}),(0,s.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z"})})})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,s.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:n.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,s.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:o.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,s.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:c.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]})]}),(0,s.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 ",new Date().getFullYear()," ",i.vQ.name," Inc. All rights reserved."]}),(0,s.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,s.jsx)(l(),{href:"#",className:"hover:text-primary transition-colors",children:"Privacy Policy"}),(0,s.jsx)(l(),{href:"#",className:"hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})})}},2542:(e,t,r)=>{r.d(t,{default:()=>n});var s=r(5155),a=r(1474);let l={primary:"bg-gradient-to-b from-primary to-primary-hover text-white shadow-sm",secondary:"bg-white dark:bg-white/10 border border-black/10 dark:border-white/10 text-text-main hover:bg-black/5 dark:hover:bg-white/5",outline:"border border-black/15 dark:border-white/15 text-text-main hover:bg-black/5",ghost:"text-text-muted hover:bg-black/5 dark:hover:bg-white/5 hover:text-text-main",danger:"bg-red-500 text-white hover:bg-red-600 shadow-sm"},i={sm:"h-7 px-3 text-xs rounded-md",md:"h-9 px-4 text-sm rounded-lg",lg:"h-11 px-6 text-sm rounded-lg"};function n({children:e,variant:t="primary",size:r="md",icon:n,iconRight:o,disabled:c=!1,loading:d=!1,fullWidth:m=!1,className:x,...u}){return(0,s.jsxs)("button",{className:(0,a.cn)("inline-flex items-center justify-center gap-2 font-medium transition-all duration-200 cursor-pointer","active:scale-[0.99] disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100",l[t],i[r],m&&"w-full",x),disabled:c||d,...u,children:[d?(0,s.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}):n?(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:n}):null,e,o&&!d&&(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:o})]})}},2622:(e,t,r)=>{r.d(t,{default:()=>p});var s=r(5155),a=r(2115),l=r(4051),i=r.n(l),n=r(8500),o=r.n(n),c=r(3321),d=r(1474),m=r(620),x=r(2542),u=r(1127);let h=[{href:"/mitm",label:"MITM",icon:"security"}];function p({onClose:e,collapsed:t=!1,onToggleCollapse:r}){let l=(0,c.usePathname)(),[i,n]=(0,a.useState)(!1),[p,b]=(0,a.useState)(!1),[f,g]=(0,a.useState)(!1),[j,v]=(0,a.useState)(null),[y,N]=(0,a.useState)(!1);(0,a.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{e.enableTranslator&&N(!0)}).catch(()=>{})},[]),(0,a.useEffect)(()=>{fetch("/api/version").then(e=>e.json()).then(e=>{e.hasUpdate&&v(e)}).catch(()=>{})},[]);let k=e=>"/endpoint"===e?"/"===l||l.startsWith("/endpoint"):l.startsWith(e),w=async()=>{b(!0);try{await fetch("/api/shutdown",{method:"POST"})}catch(e){}b(!1),n(!1),g(!0)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("aside",{className:(0,d.cn)("flex flex-col border-r border-black/5 dark:border-white/5 bg-vibrancy backdrop-blur-xl transition-all duration-300 ease-in-out",t?"w-[68px]":"w-72"),children:[r&&(0,s.jsx)("div",{className:(0,d.cn)("flex items-center pt-4 pb-1",t?"px-3 justify-center":"px-4 justify-end"),children:(0,s.jsx)("button",{type:"button",onClick:r,className:"flex items-center justify-center size-7 rounded-md text-text-muted hover:bg-surface/50 hover:text-text-main transition-colors",title:t?"Expand sidebar":"Collapse sidebar",children:(0,s.jsx)("span",{className:(0,d.cn)("material-symbols-outlined text-[18px] transition-transform duration-300",t?"rotate-0":"rotate-180"),children:"chevron_right"})})}),(0,s.jsxs)("div",{className:(0,d.cn)("py-4 flex flex-col gap-2",t?"px-3 items-center":"px-6"),children:[(0,s.jsxs)(o(),{href:"/",className:"flex items-center gap-3",children:[(0,s.jsx)("img",{src:"/favicon.svg",alt:"aRouter",className:"size-11 rounded shrink-0"}),!t&&(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("h1",{className:"text-lg font-semibold tracking-tight text-text-main",children:m.vQ.name}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["v",m.vQ.version," - C' Jay Nguyen"]})]})]}),!t&&j&&(0,s.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-green-600 dark:text-amber-500",children:["↑ New version available: v",j.latestVersion]}),(0,s.jsx)("code",{className:"text-[10px] text-green-600/80 dark:text-amber-400/70 font-mono select-all",children:"npm install -g @cjay/arouter@latest"})]})]}),(0,s.jsx)("nav",{className:"flex-1 px-2 py-2 space-y-1 overflow-y-auto custom-scrollbar",children:h.map(r=>(0,s.jsxs)(o(),{href:r.href,onClick:e,title:t?r.label:void 0,className:(0,d.cn)("flex items-center gap-3 rounded-lg transition-all group",t?"justify-center px-2 py-2":"px-4 py-2",k(r.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,s.jsx)("span",{className:(0,d.cn)("material-symbols-outlined text-[18px]",k(r.href)?"fill-1":"group-hover:text-primary transition-colors"),children:r.icon}),!t&&(0,s.jsx)("span",{className:"text-sm font-medium",children:r.label})]},r.href))}),(0,s.jsx)("div",{className:"p-3 border-t border-black/5 dark:border-white/5",children:!t&&(0,s.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded-lg bg-surface/50 mb-2",children:[(0,s.jsx)("div",{className:"flex items-center justify-center size-6 rounded-md bg-blue-500/10 text-blue-500 shrink-0 mt-0.5",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"info"})}),(0,s.jsx)("div",{className:"flex flex-col",children:(0,s.jsx)("span",{className:"text-xs font-medium text-text-main leading-relaxed",children:"Service is running in terminal. You can close this web page. Shutdown will stop the service."})})]})})]}),(0,s.jsx)(u.ConfirmModal,{isOpen:i,onClose:()=>n(!1),onConfirm:w,title:"Close Proxy",message:"Are you sure you want to close the proxy server?",confirmText:"Close",cancelText:"Cancel",variant:"danger",loading:p}),f&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm",children:(0,s.jsxs)("div",{className:"text-center p-8",children:[(0,s.jsx)("div",{className:"flex items-center justify-center size-16 rounded-full bg-red-500/20 text-red-500 mx-auto mb-4",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"power_off"})}),(0,s.jsx)("h2",{className:"text-xl font-semibold text-white mb-2",children:"Server Disconnected"}),(0,s.jsx)("p",{className:"text-text-muted mb-6",children:"The proxy server has been stopped."}),(0,s.jsx)(x.default,{variant:"secondary",onClick:()=>globalThis.location.reload(),children:"Reload Page"})]})})]})}p.propTypes={onClose:i().func,collapsed:i().bool,onToggleCollapse:i().func}},2899:(e,t,r)=>{r.d(t,{default:()=>d});var s=r(5155),a=r(2115),l=r(4051),i=r.n(l),n=r(882),o=r(1500),c=r(4230);function d({isOpen:e,providerInfo:t,onSuccess:r,onClose:l}){let[i,d]=(0,a.useState)(null),[m,x]=(0,a.useState)(null),[u,h]=(0,a.useState)(null),p=(0,a.useCallback)((e,t)=>{"builder-id"===e?d("builder-id"):"idc"===e?(d("idc"),h(t)):"social"===e?(d("social"),x(t.provider)):"import"===e&&r?.()},[r]),b=()=>{d(null),x(null),h(null)};return i?"builder-id"===i||"idc"===i?(0,s.jsx)(n.default,{isOpen:e,provider:"kiro",providerInfo:t,onSuccess:()=>{d(null),h(null),r?.(),l?.()},onClose:b,idcConfig:u}):"social"===i&&m?(0,s.jsx)(c.default,{isOpen:e,provider:m,onSuccess:()=>{d(null),x(null),r?.(),l?.()},onClose:b}):null:(0,s.jsx)(o.default,{isOpen:e,onMethodSelect:p,onClose:l})}d.propTypes={isOpen:i().bool.isRequired,providerInfo:i().shape({name:i().string}),onSuccess:i().func,onClose:i().func.isRequired}},2908:(e,t,r)=>{r.d(t,{default:()=>m});var s=r(5155),a=r(2115),l=r(4051),i=r.n(l),n=r(1127),o=r(7202),c=r(2679);let d=[...Object.keys(c.zN),...Object.keys(c.fg)];function m({isOpen:e,onClose:t,onSelect:r,selectedModel:l,activeProviders:i=[],title:m="Select Model",modelAliases:x={}}){let[u,h]=(0,a.useState)(""),[p,b]=(0,a.useState)([]),[f,g]=(0,a.useState)([]),j=async()=>{try{let e=await fetch("/api/combos");if(!e.ok)throw Error(`Failed to fetch combos: ${e.status}`);let t=await e.json();b(t.combos||[])}catch(e){console.error("Error fetching combos:",e),b([])}};(0,a.useEffect)(()=>{e&&j()},[e]);let v=async()=>{try{let e=await fetch("/api/provider-nodes");if(!e.ok)throw Error(`Failed to fetch provider nodes: ${e.status}`);let t=await e.json();g(t.nodes||[])}catch(e){console.error("Error fetching provider nodes:",e),g([])}};(0,a.useEffect)(()=>{e&&v()},[e]);let y=(0,a.useMemo)(()=>({...c.zN,...c.fg}),[]),N=(0,a.useMemo)(()=>{let e={};return[...new Set([...i.map(e=>e.provider)])].sort((e,t)=>{let r=d.indexOf(e),s=d.indexOf(t);return(-1===r?999:r)-(-1===s?999:s)}).forEach(t=>{let r=o.Xg[t]||t,s=y[t]||{name:t,color:"#666"},a=(0,c.mq)(t)||(0,c.gb)(t);if(s.passthroughModels){let a=Object.entries(x).filter(([,e])=>e.startsWith(`${r}/`)).map(([e,t])=>({id:t.replace(`${r}/`,""),name:e,value:t}));if(a.length>0){let l=f.find(e=>e.id===t),i=l?.name||s.name;e[t]={name:i,alias:r,color:s.color,models:a}}}else if(a){let r=i.find(e=>e.provider===t),a=f.find(e=>e.id===t),l=r?.name||a?.name||s.name,n=r?.providerSpecificData?.prefix||a?.prefix||t,o=Object.entries(x).filter(([,e])=>e.startsWith(`${t}/`)).map(([e,r])=>({id:r.replace(`${t}/`,""),name:e,value:`${n}/${r.replace(`${t}/`,"")}`})),c=o.length>0?o:[{id:`__placeholder__${t}`,name:`${n}/model-id`,value:`${n}/model-id`,isPlaceholder:!0}];e[t]={name:l,alias:n,color:s.color,models:c,isCustom:!0,hasModels:o.length>0}}else{let a=(0,o.KC)(t),l=new Set(a.map(e=>e.id)),i=Object.entries(x).filter(([e,t])=>t.startsWith(`${r}/`)&&e===t.replace(`${r}/`,"")&&!l.has(t.replace(`${r}/`,""))).map(([,e])=>{let t=e.replace(`${r}/`,"");return{id:t,name:t,value:e,isCustom:!0}}),n=[...a.map(e=>({id:e.id,name:e.name,value:`${r}/${e.id}`})),...i];n.length>0&&(e[t]={name:s.name,alias:r,color:s.color,models:n})}}),e},[i,x,y,f]),k=(0,a.useMemo)(()=>{if(!u.trim())return p;let e=u.toLowerCase();return p.filter(t=>t.name.toLowerCase().includes(e))},[p,u]),w=(0,a.useMemo)(()=>{if(!u.trim())return N;let e=u.toLowerCase(),t={};return Object.entries(N).forEach(([r,s])=>{let a=s.models.filter(t=>t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e)),l=s.name.toLowerCase().includes(e);(a.length>0||l)&&(t[r]={...s,models:a})}),t},[N,u]),C=e=>{r(e),t(),h("")};return(0,s.jsxs)(n.default,{isOpen:e,onClose:()=>{t(),h("")},title:m,size:"md",className:"p-4!",children:[(0,s.jsx)("div",{className:"mb-3",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,s.jsx)("input",{type:"text",placeholder:"Search...",value:u,onChange:e=>h(e.target.value),className:"w-full pl-8 pr-3 py-1.5 bg-surface border border-border rounded text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"})]})}),(0,s.jsxs)("div",{className:"max-h-[300px] overflow-y-auto space-y-3",children:[k.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary text-[14px]",children:"layers"}),(0,s.jsx)("span",{className:"text-xs font-medium text-primary",children:"Combos"}),(0,s.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",k.length,")"]})]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:k.map(e=>{let t=l===e.name;return(0,s.jsx)("button",{onClick:()=>C({id:e.name,name:e.name,value:e.name}),className:`
|
|
1
|
+
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[497],{98:(e,t,r)=>{r.d(t,{default:()=>l});var s=r(5155),a=r(1474);function l({label:e,options:t=[],value:r,onChange:l,placeholder:i="Select an option",error:n,hint:o,disabled:c=!1,required:d=!1,className:m,selectClassName:x,...u}){return(0,s.jsxs)("div",{className:(0,a.cn)("flex flex-col gap-1.5",m),children:[e&&(0,s.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[e,d&&(0,s.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsxs)("select",{value:r,onChange:l,disabled:c,className:(0,a.cn)("w-full py-2 px-3 pr-10 text-sm text-text-main","bg-white dark:bg-white/5 border border-black/10 dark:border-white/10 rounded-md appearance-none","focus:ring-1 focus:ring-primary/30 focus:border-primary/50 focus:outline-none","transition-all disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",n?"border-red-500 focus:border-red-500 focus:ring-red-500/20":"",x),...u,children:[(0,s.jsx)("option",{value:"",disabled:!0,children:i}),t.map(e=>(0,s.jsx)("option",{value:e.value,children:e.label},e.value))]}),(0,s.jsx)("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3 pointer-events-none text-text-muted",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"expand_more"})})]}),n&&(0,s.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),n]}),o&&!n&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:o})]})}},815:(e,t,r)=>{r.d(t,{default:()=>o});var s=r(5155),a=r(2115),l=r(4051),i=r.n(l),n=r(5497);function o({isOpen:e,onSuccess:t,onClose:r}){let[l,i]=(0,a.useState)(""),[o,c]=(0,a.useState)(""),[d,m]=(0,a.useState)(null),[x,u]=(0,a.useState)(!1),[h,p]=(0,a.useState)(!1),[b,f]=(0,a.useState)(!1),[g,j]=(0,a.useState)(!1),v=async()=>{p(!0),m(null),f(!1),j(!1);try{let e=await fetch("/api/oauth/cursor/auto-import"),t=await e.json();t.found?(i(t.accessToken),c(t.machineId),f(!0)):t.windowsManual?j(!0):m(t.error||"Could not auto-detect tokens")}catch(e){m("Failed to auto-detect tokens")}finally{p(!1)}};(0,a.useEffect)(()=>{e&&v()},[e]);let y=async()=>{if(!l.trim())return void m("Please enter an access token");if(!o.trim())return void m("Please enter a machine ID");u(!0),m(null);try{let e=await fetch("/api/oauth/cursor/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({accessToken:l.trim(),machineId:o.trim()})}),s=await e.json();if(!e.ok)throw Error(s.error||"Import failed");t?.(),r()}catch(e){m(e.message)}finally{u(!1)}};return(0,s.jsx)(n.aF,{isOpen:e,title:"Connect Cursor IDE",onClose:r,children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[h&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting tokens..."}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from Cursor IDE database"})]}),!h&&(0,s.jsxs)(s.Fragment,{children:[b&&(0,s.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,s.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Tokens auto-detected from Cursor IDE successfully!"})]})}),g&&(0,s.jsxs)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-3 rounded-lg border border-amber-200 dark:border-amber-800 flex flex-col gap-2",children:[(0,s.jsxs)("div",{className:"flex gap-2 items-center",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,s.jsx)("p",{className:"text-sm font-medium text-amber-800 dark:text-amber-200",children:"Could not read Cursor database automatically."})]}),(0,s.jsxs)("p",{className:"text-xs text-amber-700 dark:text-amber-300",children:["Run this command in your terminal, then click ",(0,s.jsx)("strong",{children:"Retry"}),":"]}),(0,s.jsx)("pre",{className:"text-xs bg-black/10 dark:bg-white/10 rounded p-2 font-mono select-all",children:"npm i better-sqlite3 -g"}),(0,s.jsx)(n.$n,{onClick:v,variant:"outline",fullWidth:!0,children:"Retry"})]}),!b&&!g&&!d&&(0,s.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,s.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Cursor IDE not detected. Please paste your tokens manually."})]})}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Access Token ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)("textarea",{value:l,onChange:e=>i(e.target.value),placeholder:"Access token will be auto-filled...",rows:3,className:"w-full px-3 py-2 text-sm font-mono border border-border rounded-lg bg-background focus:outline-none focus:border-primary resize-none"})]}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Machine ID ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)(n.pd,{value:o,onChange:e=>c(e.target.value),placeholder:"Machine ID will be auto-filled...",className:"font-mono text-sm"})]}),d&&(0,s.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,s.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:d})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.$n,{onClick:y,fullWidth:!0,disabled:x||!l.trim()||!o.trim(),children:x?"Importing...":"Import Token"}),(0,s.jsx)(n.$n,{onClick:r,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})})}o.propTypes={isOpen:i().bool.isRequired,onSuccess:i().func,onClose:i().func.isRequired}},882:(e,t,r)=>{r.d(t,{default:()=>c});var s=r(5155),a=r(2115),l=r(4051),i=r.n(l),n=r(5497),o=r(1059);function c({isOpen:e,provider:t,providerInfo:r,onSuccess:l,onClose:i}){let[c,d]=(0,a.useState)("waiting"),[m,x]=(0,a.useState)(null),[u,h]=(0,a.useState)(""),[p,b]=(0,a.useState)(null),[f,g]=(0,a.useState)(!1),[j,v]=(0,a.useState)(null),[y,N]=(0,a.useState)(!1),k=(0,a.useRef)(null),w=(0,a.useRef)(!1),{copied:C,copy:S}=(0,o.C)(),[$,z]=(0,a.useState)(!1),[_,E]=(0,a.useState)("/callback?code=..."),L=(0,a.useRef)(!1);(0,a.useEffect)(()=>{z("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname),E(`${window.location.origin}/callback?code=...`)},[]);let T=(0,a.useCallback)(async(e,r)=>{if(m)try{let s=await fetch(`/api/oauth/${t}/exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({code:e,redirectUri:m.redirectUri,codeVerifier:m.codeVerifier,state:r})}),a=await s.json();if(!s.ok)throw Error(a.error);d("success"),l?.()}catch(e){b(e.message),d("error")}},[m,t,l]),R=(0,a.useCallback)(async(e,r,s,a)=>{w.current=!1,N(!0);for(let i=0;i<60;i++){if(w.current){console.log("[OAuthModal] Polling aborted"),N(!1);return}if(await new Promise(e=>setTimeout(e,1e3*s)),w.current){console.log("[OAuthModal] Polling aborted after sleep"),N(!1);return}try{let i=await fetch(`/api/oauth/${t}/poll`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({deviceCode:e,codeVerifier:r,extraData:a})}),n=await i.json();if(n.success){w.current=!0,d("success"),N(!1),l?.();return}if("expired_token"===n.error||"access_denied"===n.error)throw Error(n.errorDescription||n.error);"slow_down"===n.error&&(s=Math.min(s+5,30))}catch(e){b(e.message),d("error"),N(!1);return}}b("Authorization timeout"),d("error"),N(!1)},[t,l]),I=(0,a.useCallback)(async()=>{if(t)try{let e;if(b(null),["github","qwen","kiro","kimi-coding","kilocode"].includes(t)){g(!0),d("waiting");let e=await fetch(`/api/oauth/${t}/device-code`),r=await e.json();if(!e.ok)throw Error(r.error);v(r);let s=r.verification_uri_complete||r.verification_uri;s&&window.open(s,"_blank");let a="kiro"===t?{_clientId:r._clientId,_clientSecret:r._clientSecret}:null;R(r.device_code,r.codeVerifier,r.interval||5,a);return}if("codex"===t)e="http://localhost:1455/auth/callback";else{let t=window.location.port||("https:"===window.location.protocol?"443":"80");e=`http://localhost:${t}/callback`}let r=await fetch(`/api/oauth/${t}/authorize?redirect_uri=${encodeURIComponent(e)}`),s=await r.json();if(!r.ok)throw Error(s.error);x({...s,redirectUri:e}),"codex"!==t&&$?(d("waiting"),k.current=window.open(s.authUrl,"oauth_popup","width=600,height=700"),k.current||d("input")):(d("input"),window.open(s.authUrl,"_blank"))}catch(e){b(e.message),d("error")}},[t,$,R]);(0,a.useEffect)(()=>{e&&t?(x(null),h(""),b(null),g(!1),v(null),N(!1),w.current=!1,I()):e||(w.current=!0)},[e,t,I]),(0,a.useEffect)(()=>{let e;if(!m)return;L.current=!1;let t=async e=>{if(L.current)return;let{code:t,state:r,error:s,errorDescription:a}=e;if(s){L.current=!0,b(a||s),d("error");return}t&&(L.current=!0,await T(t,r))},r=e=>{let r=e.origin.includes("localhost")||e.origin.includes("127.0.0.1"),s=e.origin===window.location.origin;(r||s)&&e.data?.type==="oauth_callback"&&t(e.data.data)};window.addEventListener("message",r);try{(e=new BroadcastChannel("oauth_callback")).onmessage=e=>t(e.data)}catch(e){console.log("BroadcastChannel not supported")}let s=e=>{if("oauth_callback"===e.key&&e.newValue)try{let r=JSON.parse(e.newValue);t(r),localStorage.removeItem("oauth_callback")}catch(e){console.log("Failed to parse localStorage data")}};window.addEventListener("storage",s);try{let e=localStorage.getItem("oauth_callback");if(e){let r=JSON.parse(e);r.timestamp&&Date.now()-r.timestamp<3e4&&t(r),localStorage.removeItem("oauth_callback")}}catch{}return()=>{window.removeEventListener("message",r),window.removeEventListener("storage",s),e&&e.close()}},[m,T]);let O=async()=>{try{b(null);let e=new URL(u),t=e.searchParams.get("code"),r=e.searchParams.get("state"),s=e.searchParams.get("error");if(s)throw Error(e.searchParams.get("error_description")||s);if(!t)throw Error("No authorization code found in URL");await T(t,r)}catch(e){b(e.message),d("error")}},A=(0,a.useCallback)(()=>{i()},[i]);return t&&r?(0,s.jsx)(n.aF,{isOpen:e,title:`Connect ${r.name}`,onClose:A,size:"lg",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:["waiting"===c&&!f&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Waiting for Authorization"}),(0,s.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Complete the authorization in the popup window."}),(0,s.jsx)(n.$n,{variant:"ghost",onClick:()=>d("input"),children:"Popup blocked? Enter URL manually"})]}),"waiting"===c&&f&&j&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"text-center py-4",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Visit the URL below and enter the code:"}),(0,s.jsxs)("div",{className:"bg-sidebar p-4 rounded-lg mb-4",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Verification URL"}),(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)("code",{className:"flex-1 text-sm break-all",children:j.verification_uri}),(0,s.jsx)(n.$n,{size:"sm",variant:"ghost",icon:"verify_url"===C?"check":"content_copy",onClick:()=>S(j.verification_uri,"verify_url")})]})]}),(0,s.jsxs)("div",{className:"bg-primary/10 p-4 rounded-lg",children:[(0,s.jsx)("p",{className:"text-xs text-text-muted mb-1",children:"Your Code"}),(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2",children:[(0,s.jsx)("p",{className:"text-2xl font-mono font-bold text-primary",children:j.user_code}),(0,s.jsx)(n.$n,{size:"sm",variant:"ghost",icon:"user_code"===C?"check":"content_copy",onClick:()=>S(j.user_code,"user_code")})]})]})]}),y&&(0,s.jsxs)("div",{className:"flex items-center justify-center gap-2 text-sm text-text-muted",children:[(0,s.jsx)("span",{className:"material-symbols-outlined animate-spin",children:"progress_activity"}),"Waiting for authorization..."]})]}),"input"===c&&!f&&(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 1: Open this URL in your browser"}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.pd,{value:m?.authUrl||"",readOnly:!0,className:"flex-1 font-mono text-xs"}),(0,s.jsx)(n.$n,{variant:"secondary",icon:"auth_url"===C?"check":"content_copy",onClick:()=>S(m?.authUrl,"auth_url"),children:"Copy"})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("p",{className:"text-sm font-medium mb-2",children:"Step 2: Paste the callback URL here"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mb-2",children:"After authorization, copy the full URL from your browser."}),(0,s.jsx)(n.pd,{value:u,onChange:e=>h(e.target.value),placeholder:_,className:"font-mono text-xs"})]})]}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.$n,{onClick:O,fullWidth:!0,disabled:!u,children:"Connect"}),(0,s.jsx)(n.$n,{onClick:A,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]}),"success"===c&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-green-100 dark:bg-green-900/30 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-green-600",children:"check_circle"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connected Successfully!"}),(0,s.jsxs)("p",{className:"text-sm text-text-muted mb-4",children:["Your ",r.name," account has been connected."]}),(0,s.jsx)(n.$n,{onClick:A,fullWidth:!0,children:"Done"})]}),"error"===c&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-red-100 dark:bg-red-900/30 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-red-600",children:"error"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Connection Failed"}),(0,s.jsx)("p",{className:"text-sm text-red-600 mb-4",children:p}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.$n,{onClick:I,variant:"secondary",fullWidth:!0,children:"Try Again"}),(0,s.jsx)(n.$n,{onClick:A,variant:"ghost",fullWidth:!0,children:"Cancel"})]})]})]})}):null}c.propTypes={isOpen:i().bool.isRequired,provider:i().string,providerInfo:i().shape({name:i().string}),onSuccess:i().func,onClose:i().func.isRequired}},1059:(e,t,r)=>{r.d(t,{C:()=>a});var s=r(2115);function a(e=2e3){let[t,r]=(0,s.useState)(null),l=(0,s.useRef)(null);return{copied:t,copy:(0,s.useCallback)((t,s="default")=>{navigator.clipboard.writeText(t),r(s),l.current&&clearTimeout(l.current),l.current=setTimeout(()=>{r(null)},e)},[e])}}},1127:(e,t,r)=>{r.d(t,{ConfirmModal:()=>o,default:()=>n});var s=r(5155),a=r(2115),l=r(1474),i=r(2542);function n({isOpen:e,onClose:t,title:r,children:i,footer:n,size:o="md",closeOnOverlay:c=!0,showCloseButton:d=!0,className:m}){return((0,a.useEffect)(()=>(e?document.body.style.overflow="hidden":document.body.style.overflow="",()=>{document.body.style.overflow=""}),[e]),(0,a.useEffect)(()=>{let r=r=>{"Escape"===r.key&&e&&t()};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[e,t]),e)?(0,s.jsxs)("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:[(0,s.jsx)("div",{className:"absolute inset-0 bg-black/30 backdrop-blur-sm",onClick:c?t:void 0}),(0,s.jsxs)("div",{className:(0,l.cn)("relative w-full bg-surface","border border-black/10 dark:border-white/10","rounded-xl shadow-2xl","animate-in fade-in zoom-in-95 duration-200",{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg",xl:"max-w-xl",full:"max-w-4xl"}[o],m),children:[(r||d)&&(0,s.jsxs)("div",{className:"flex items-center justify-between p-6 border-b border-black/5 dark:border-white/5",children:[(0,s.jsxs)("div",{className:"flex items-center",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mr-4",children:[(0,s.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FF5F56]"}),(0,s.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#FFBD2E]"}),(0,s.jsx)("div",{className:"w-3 h-3 rounded-full bg-[#27C93F]"})]}),r&&(0,s.jsx)("h2",{className:"text-lg font-semibold text-text-main",children:r})]}),d&&(0,s.jsx)("button",{onClick:t,className:"p-1.5 rounded-lg text-text-muted hover:bg-black/5 dark:hover:bg-white/5 transition-colors",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:"close"})})]}),(0,s.jsx)("div",{className:"p-6 max-h-[calc(80vh-140px)] overflow-y-auto",children:i}),n&&(0,s.jsx)("div",{className:"flex items-center justify-end gap-3 p-6 border-t border-black/5 dark:border-white/5",children:n})]})]}):null}function o({isOpen:e,onClose:t,onConfirm:r,title:a="Confirm",message:l,confirmText:o="Confirm",cancelText:c="Cancel",variant:d="danger",loading:m=!1}){return(0,s.jsx)(n,{isOpen:e,onClose:t,title:a,size:"sm",footer:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(i.default,{variant:"ghost",onClick:t,disabled:m,children:c}),(0,s.jsx)(i.default,{variant:d,onClick:r,loading:m,children:o})]}),children:(0,s.jsx)("p",{className:"text-text-muted",children:l})})}},1450:(e,t,r)=>{r.d(t,{default:()=>n});var s=r(5155),a=r(4051),l=r.n(a),i=r(1929);function n({children:e}){return(0,s.jsxs)("div",{className:"min-h-screen flex flex-col relative bg-bg transition-colors duration-500 overflow-x-hidden selection:bg-primary/20 selection:text-primary",children:[(0,s.jsx)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[800px] h-[800px] bg-primary/5 dark:bg-primary/5 rounded-full blur-[100px] pointer-events-none z-0"}),(0,s.jsx)("div",{className:"fixed bottom-0 right-0 w-[600px] h-[600px] bg-orange-200/20 dark:bg-orange-900/10 rounded-full blur-[120px] pointer-events-none z-0 translate-y-1/3 translate-x-1/3"}),(0,s.jsx)("div",{className:"absolute top-6 right-6 z-20",children:(0,s.jsx)(i.default,{variant:"card"})}),(0,s.jsx)("main",{className:"flex-1 flex flex-col items-center justify-center p-4 sm:p-6 z-10 w-full h-full",children:e})]})}n.propTypes={children:l().node.isRequired}},1474:(e,t,r)=>{r.d(t,{cn:()=>s});function s(...e){return e.filter(Boolean).join(" ").replace(/\s+/g," ").trim()}},1500:(e,t,r)=>{r.d(t,{default:()=>o});var s=r(5155),a=r(2115),l=r(4051),i=r.n(l),n=r(5497);function o({isOpen:e,onMethodSelect:t,onClose:r}){let[l,i]=(0,a.useState)(null),[o,c]=(0,a.useState)(""),[d,m]=(0,a.useState)("us-east-1"),[x,u]=(0,a.useState)(""),[h,p]=(0,a.useState)(null),[b,f]=(0,a.useState)(!1),[g,j]=(0,a.useState)(!1),[v,y]=(0,a.useState)(!1);(0,a.useEffect)(()=>{"import"===l&&e&&(async()=>{j(!0),p(null),y(!1);try{let e=await fetch("/api/oauth/kiro/auto-import"),t=await e.json();t.found?(u(t.refreshToken),y(!0)):p(t.error||"Could not auto-detect token")}catch(e){p("Failed to auto-detect token")}finally{j(!1)}})()},[l,e]);let N=e=>{i(e),p(null)},k=()=>{i(null),p(null)},w=async()=>{if(!x.trim())return void p("Please enter a refresh token");f(!0),p(null);try{let e=await fetch("/api/oauth/kiro/import",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({refreshToken:x.trim()})}),r=await e.json();if(!e.ok)throw Error(r.error||"Import failed");t("import")}catch(e){p(e.message)}finally{f(!1)}},C=e=>{t("social",{provider:e})};return(0,s.jsx)(n.aF,{isOpen:e,title:"Connect Kiro",onClose:r,size:"lg",children:(0,s.jsxs)("div",{className:"flex flex-col gap-4",children:[!l&&(0,s.jsxs)("div",{className:"space-y-3",children:[(0,s.jsx)("p",{className:"text-sm text-text-muted mb-4",children:"Choose your authentication method:"}),(0,s.jsx)("button",{onClick:()=>t("builder-id"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"shield"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"AWS Builder ID"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Recommended for most users. Free AWS account required."})]})]})}),(0,s.jsx)("button",{onClick:()=>N("idc"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"business"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"AWS IAM Identity Center"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"For enterprise users with custom AWS IAM Identity Center."})]})]})}),(0,s.jsx)("button",{onClick:()=>N("social-google"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"account_circle"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"Google Account"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your Google account (manual callback)."})]})]})}),(0,s.jsx)("button",{onClick:()=>N("social-github"),className:"hidden w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"code"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"GitHub Account"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Login with your GitHub account (manual callback)."})]})]})}),(0,s.jsx)("button",{onClick:()=>N("import"),className:"w-full p-4 text-left border border-border rounded-lg hover:bg-sidebar transition-colors",children:(0,s.jsxs)("div",{className:"flex items-start gap-3",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary mt-0.5",children:"file_upload"}),(0,s.jsxs)("div",{className:"flex-1",children:[(0,s.jsx)("h3",{className:"font-semibold mb-1",children:"Import Token"}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Paste refresh token from Kiro IDE."})]})]})})]}),"idc"===l&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["IDC Start URL ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)(n.pd,{value:o,onChange:e=>c(e.target.value),placeholder:"https://your-org.awsapps.com/start",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"Your organization's AWS IAM Identity Center URL"})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("label",{className:"block text-sm font-medium mb-2",children:"AWS Region"}),(0,s.jsx)(n.pd,{value:d,onChange:e=>m(e.target.value),placeholder:"us-east-1",className:"font-mono text-sm"}),(0,s.jsx)("p",{className:"text-xs text-text-muted mt-1",children:"AWS region for your Identity Center (default: us-east-1)"})]}),h&&(0,s.jsx)("p",{className:"text-sm text-red-600",children:h}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.$n,{onClick:()=>{o.trim()?t("idc",{startUrl:o.trim(),region:d}):p("Please enter your IDC start URL")},fullWidth:!0,children:"Continue"}),(0,s.jsx)(n.$n,{onClick:k,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-google"===l&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,s.jsxs)("div",{className:"flex-1 text-sm",children:[(0,s.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,s.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.$n,{onClick:()=>C("google"),fullWidth:!0,children:"Continue with Google"}),(0,s.jsx)(n.$n,{onClick:k,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"social-github"===l&&(0,s.jsxs)("div",{className:"space-y-4",children:[(0,s.jsx)("div",{className:"bg-amber-50 dark:bg-amber-900/20 p-4 rounded-lg border border-amber-200 dark:border-amber-800",children:(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-amber-600 dark:text-amber-400",children:"info"}),(0,s.jsxs)("div",{className:"flex-1 text-sm",children:[(0,s.jsx)("p",{className:"font-medium text-amber-900 dark:text-amber-100 mb-1",children:"Manual Callback Required"}),(0,s.jsx)("p",{className:"text-amber-800 dark:text-amber-200",children:"After login, you'll need to copy the callback URL from your browser and paste it back here."})]})]})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.$n,{onClick:()=>C("github"),fullWidth:!0,children:"Continue with GitHub"}),(0,s.jsx)(n.$n,{onClick:k,variant:"ghost",fullWidth:!0,children:"Back"})]})]}),"import"===l&&(0,s.jsxs)("div",{className:"space-y-4",children:[g&&(0,s.jsxs)("div",{className:"text-center py-6",children:[(0,s.jsx)("div",{className:"size-16 mx-auto mb-4 rounded-full bg-primary/10 flex items-center justify-center",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-3xl text-primary animate-spin",children:"progress_activity"})}),(0,s.jsx)("h3",{className:"text-lg font-semibold mb-2",children:"Auto-detecting token..."}),(0,s.jsx)("p",{className:"text-sm text-text-muted",children:"Reading from AWS SSO cache"})]}),!g&&(0,s.jsxs)(s.Fragment,{children:[v&&(0,s.jsx)("div",{className:"bg-green-50 dark:bg-green-900/20 p-3 rounded-lg border border-green-200 dark:border-green-800",children:(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-green-600 dark:text-green-400",children:"check_circle"}),(0,s.jsx)("p",{className:"text-sm text-green-800 dark:text-green-200",children:"Token auto-detected from Kiro IDE successfully!"})]})}),!v&&!h&&(0,s.jsx)("div",{className:"bg-blue-50 dark:bg-blue-900/20 p-3 rounded-lg border border-blue-200 dark:border-blue-800",children:(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-blue-600 dark:text-blue-400",children:"info"}),(0,s.jsx)("p",{className:"text-sm text-blue-800 dark:text-blue-200",children:"Kiro IDE not detected. Please paste your refresh token manually."})]})}),(0,s.jsxs)("div",{children:[(0,s.jsxs)("label",{className:"block text-sm font-medium mb-2",children:["Refresh Token ",(0,s.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,s.jsx)(n.pd,{value:x,onChange:e=>u(e.target.value),placeholder:"Token will be auto-filled...",className:"font-mono text-sm"})]}),h&&(0,s.jsx)("div",{className:"bg-red-50 dark:bg-red-900/20 p-3 rounded-lg border border-red-200 dark:border-red-800",children:(0,s.jsx)("p",{className:"text-sm text-red-600 dark:text-red-400",children:h})}),(0,s.jsxs)("div",{className:"flex gap-2",children:[(0,s.jsx)(n.$n,{onClick:w,fullWidth:!0,disabled:b||!x.trim(),children:b?"Importing...":"Import Token"}),(0,s.jsx)(n.$n,{onClick:k,variant:"ghost",fullWidth:!0,children:"Back"})]})]})]})]})})}o.propTypes={isOpen:i().bool.isRequired,onMethodSelect:i().func.isRequired,onClose:i().func.isRequired}},1738:(e,t,r)=>{r.d(t,{default:()=>m});var s=r(5155),a=r(2115),l=r(3321),i=r(1934);let n=0,o=(0,i.v)((e,t)=>({notifications:[],addNotification:r=>{let s=++n,a={id:s,type:r.type||"info",message:r.message,title:r.title||null,duration:r.duration??5e3,dismissible:r.dismissible??!0,createdAt:Date.now()};return e(e=>({notifications:[...e.notifications,a]})),a.duration>0&&setTimeout(()=>t().removeNotification(s),a.duration),s},removeNotification:t=>{e(e=>({notifications:e.notifications.filter(e=>e.id!==t)}))},clearAll:()=>e({notifications:[]}),success:(e,r)=>t().addNotification({type:"success",message:e,title:r}),error:(e,r)=>t().addNotification({type:"error",message:e,title:r,duration:8e3}),warning:(e,r)=>t().addNotification({type:"warning",message:e,title:r}),info:(e,r)=>t().addNotification({type:"info",message:e,title:r})}));var c=r(2622),d=r(4891);function m({children:e}){let[t,r]=(0,a.useState)(!1),[i,n]=(0,a.useState)(!1),m=(0,l.usePathname)(),x=o(e=>e.notifications),u=o(e=>e.removeNotification);return(0,s.jsxs)("div",{className:"flex h-screen w-full overflow-hidden bg-bg",children:[(0,s.jsx)("div",{className:"fixed top-4 right-4 z-[80] flex w-[min(92vw,380px)] flex-col gap-2",children:x.map(e=>{var t;let r="success"===(t=e.type)?{wrapper:"border-green-500/30 bg-green-500/10 text-green-600 dark:text-green-400",icon:"check_circle"}:"error"===t?{wrapper:"border-red-500/30 bg-red-500/10 text-red-600 dark:text-red-400",icon:"error"}:"warning"===t?{wrapper:"border-amber-500/30 bg-amber-500/10 text-amber-600 dark:text-amber-400",icon:"warning"}:{wrapper:"border-blue-500/30 bg-blue-500/10 text-blue-600 dark:text-blue-400",icon:"info"};return(0,s.jsx)("div",{className:`rounded-lg border px-3 py-2 shadow-lg backdrop-blur-sm ${r.wrapper}`,children:(0,s.jsxs)("div",{className:"flex items-start gap-2",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px] leading-5",children:r.icon}),(0,s.jsxs)("div",{className:"min-w-0 flex-1",children:[e.title?(0,s.jsx)("p",{className:"text-xs font-semibold mb-0.5",children:e.title}):null,(0,s.jsx)("p",{className:"text-xs whitespace-pre-wrap break-words",children:e.message})]}),e.dismissible?(0,s.jsx)("button",{type:"button",onClick:()=>u(e.id),className:"text-current/70 hover:text-current","aria-label":"Dismiss notification",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[16px]",children:"close"})}):null]})},e.id)})}),t&&(0,s.jsx)("div",{className:"fixed inset-0 z-40 bg-black/20 lg:hidden",onClick:()=>r(!1)}),(0,s.jsx)("div",{className:"hidden lg:flex",children:(0,s.jsx)(c.default,{collapsed:i,onToggleCollapse:()=>n(e=>!e)})}),(0,s.jsx)("div",{className:`fixed inset-y-0 left-0 z-50 transform lg:hidden transition-transform duration-300 ease-in-out ${t?"translate-x-0":"-translate-x-full"}`,children:(0,s.jsx)(c.default,{onClose:()=>r(!1)})}),(0,s.jsxs)("main",{className:"flex flex-col flex-1 h-full min-w-0 relative transition-colors duration-300",children:[(0,s.jsx)(d.default,{onMenuClick:()=>r(!0)},m),(0,s.jsx)("div",{className:"flex-1 overflow-y-auto custom-scrollbar p-6 lg:p-10",children:(0,s.jsx)("div",{className:"max-w-7xl mx-auto",children:e})})]})]})}},1910:(e,t,r)=>{r.d(t,{default:()=>l});var s=r(5155),a=r(1474);function l({label:e,type:t="text",placeholder:r,value:l,onChange:i,error:n,hint:o,icon:c,disabled:d=!1,required:m=!1,className:x,inputClassName:u,...h}){return(0,s.jsxs)("div",{className:(0,a.cn)("flex flex-col gap-1.5",x),children:[e&&(0,s.jsxs)("label",{className:"text-sm font-medium text-text-main",children:[e,m&&(0,s.jsx)("span",{className:"text-red-500 ml-1",children:"*"})]}),(0,s.jsxs)("div",{className:"relative",children:[c&&(0,s.jsx)("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none text-text-muted",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[20px]",children:c})}),(0,s.jsx)("input",{type:t,placeholder:r,value:l,onChange:i,disabled:d,className:(0,a.cn)("w-full py-2 px-3 text-sm text-text-main","bg-white dark:bg-white/5 border border-black/10 dark:border-white/10 rounded-md","placeholder-text-muted/60","focus:ring-1 focus:ring-primary/30 focus:border-primary/50 focus:outline-none","transition-all shadow-inner disabled:opacity-50 disabled:cursor-not-allowed","text-[16px] sm:text-sm",c&&"pl-10",n?"border-red-500 focus:border-red-500 focus:ring-red-500/20":"",u),...h})]}),n&&(0,s.jsxs)("p",{className:"text-xs text-red-500 flex items-center gap-1",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"error"}),n]}),o&&!n&&(0,s.jsx)("p",{className:"text-xs text-text-muted",children:o})]})}},1929:(e,t,r)=>{r.d(t,{default:()=>d});var s=r(5155),a=r(2115),l=r(85);function i(e){let t=window.matchMedia("(prefers-color-scheme: dark)");return t.addEventListener("change",e),()=>t.removeEventListener("change",e)}function n(){return window.matchMedia("(prefers-color-scheme: dark)").matches}function o(){return!1}var c=r(1474);function d({className:e,variant:t="default"}){let{theme:r,toggleTheme:d,isDark:m}=function(){let{theme:e,setTheme:t,toggleTheme:r,initTheme:s}=(0,l.A)(),c=(0,a.useSyncExternalStore)(i,n,o);(0,a.useEffect)(()=>{s()},[s]),(0,a.useEffect)(()=>{if("system"!==e)return;let t=window.matchMedia("(prefers-color-scheme: dark)"),r=()=>s();return t.addEventListener("change",r),()=>t.removeEventListener("change",r)},[e,s]);let d="dark"===e||"system"===e&&c;return{theme:e,setTheme:t,toggleTheme:r,isDark:d}}(),x={default:(0,c.cn)("flex items-center justify-center size-10 rounded-full","text-text-muted","hover:bg-black/5","hover:text-text-main","transition-colors"),card:(0,c.cn)("flex items-center justify-center size-11 rounded-full","bg-surface/60","hover:bg-surface","border border-border","backdrop-blur-md shadow-sm hover:shadow-md","text-text-muted-light hover:text-primary","hover:text-primary","transition-all group")};return(0,s.jsx)("button",{onClick:d,className:(0,c.cn)(x[t],e),"aria-label":`Switch to ${m?"light":"dark"} mode`,title:`Switch to ${m?"light":"dark"} mode`,children:(0,s.jsx)("span",{className:(0,c.cn)("material-symbols-outlined text-[22px]","card"===t&&"transition-transform duration-300 group-hover:rotate-12"),children:m?"light_mode":"dark_mode"})})}},1931:(e,t,r)=>{r.d(t,{default:()=>o});var s=r(5155),a=r(2115),l=r(3308),i=r(3006);let n=e=>({en:"English",vi:"Tiếng Việt","zh-CN":"简体中文"})[e]||e;function o({className:e=""}){let[t,r]=(0,a.useState)("en"),[o,c]=(0,a.useState)(!1),[d,m]=(0,a.useState)(!1),x=(0,a.useRef)(null);(0,a.useEffect)(()=>{r(function(){if("u"<typeof document)return"en";let e=document.cookie.split(";").find(e=>e.trim().startsWith(`${l.CL}=`)),t=e?decodeURIComponent(e.split("=")[1]):"en";return(0,l.QC)(t)}())},[]),(0,a.useEffect)(()=>{function e(e){x.current&&!x.current.contains(e.target)&&m(!1)}return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]);let u=async e=>{if(e!==t&&!o){c(!0),m(!1);try{await fetch("/api/locale",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({locale:e})}),await (0,i.wn)(),r(e)}catch(e){console.error("Failed to set locale:",e)}finally{c(!1)}}};return(0,s.jsxs)("div",{className:`relative ${e}`,ref:x,children:[(0,s.jsxs)("button",{onClick:()=>m(!d),disabled:o,className:"flex items-center gap-2 px-3 py-2 rounded-lg text-text-muted hover:text-text-main hover:bg-surface/60 transition-colors",title:"Language","data-i18n-skip":"true",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-xl",children:"language"}),(0,s.jsx)("span",{className:"text-sm font-medium",children:n(t)}),(0,s.jsx)("span",{className:"material-symbols-outlined text-base",children:d?"expand_less":"expand_more"})]}),d&&(0,s.jsx)("div",{className:"absolute right-0 mt-2 w-48 bg-surface border border-black/10 dark:border-white/10 rounded-lg shadow-lg overflow-hidden z-50","data-i18n-skip":"true",children:l.YZ.map(e=>{let r=t===e;return(0,s.jsxs)("button",{onClick:()=>u(e),disabled:o,className:`w-full flex items-center justify-between px-4 py-2.5 text-sm transition-colors ${r?"bg-primary/15 text-primary font-medium":"text-text-main hover:bg-surface-hover"} ${o?"opacity-70 cursor-wait":""}`,children:[(0,s.jsx)("span",{children:n(e)}),r&&(0,s.jsx)("span",{className:"material-symbols-outlined text-base",children:"check"})]},e)})})]})}},2173:(e,t,r)=>{r.d(t,{default:()=>d});var s=r(5155),a=r(8500),l=r.n(a),i=r(620);let n=[{label:"Features",href:"#features"},{label:"Pricing",href:"#pricing"},{label:"Changelog",href:"#"}],o=[{label:"Documentation",href:"#"},{label:"API Reference",href:"#"},{label:"Help Center",href:"#"}],c=[{label:"About",href:"#"},{label:"Blog",href:"#"},{label:"Contact",href:"#"}];function d(){return(0,s.jsx)("footer",{className:"bg-bg border-t border-border pt-16 pb-12",children:(0,s.jsxs)("div",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:[(0,s.jsxs)("div",{className:"grid grid-cols-2 md:grid-cols-4 lg:grid-cols-5 gap-10 mb-12",children:[(0,s.jsxs)("div",{className:"col-span-2 lg:col-span-2",children:[(0,s.jsxs)("div",{className:"flex items-center gap-2 mb-6",children:[(0,s.jsx)("div",{className:"size-6 text-primary",children:(0,s.jsx)("svg",{className:"w-full h-full",fill:"currentColor",viewBox:"0 0 48 48",children:(0,s.jsx)("path",{clipRule:"evenodd",d:"M12.0799 24L4 19.2479L9.95537 8.75216L18.04 13.4961L18.0446 4H29.9554L29.96 13.4961L38.0446 8.75216L44 19.2479L35.92 24L44 28.7521L38.0446 39.2479L29.96 34.5039L29.9554 44H18.0446L18.04 34.5039L9.95537 39.2479L4 28.7521L12.0799 24Z",fillRule:"evenodd"})})}),(0,s.jsx)("span",{className:"text-xl font-bold text-text-main",children:i.vQ.name})]}),(0,s.jsx)("p",{className:"text-text-muted mb-6 max-w-sm font-light",children:"The unified interface for modern AI infrastructure. Secure, observable, and scalable."}),(0,s.jsxs)("div",{className:"flex gap-4",children:[(0,s.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"Twitter",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M22.46 6c-.77.35-1.6.58-2.46.69.88-.53 1.56-1.37 1.88-2.38-.83.5-1.75.85-2.72 1.05C18.37 4.5 17.26 4 16 4c-2.35 0-4.27 1.92-4.27 4.29 0 .34.04.67.11.98C8.28 9.09 5.11 7.38 3 4.79c-.37.63-.58 1.37-.58 2.15 0 1.49.75 2.81 1.91 3.56-.71 0-1.37-.2-1.95-.5v.03c0 2.08 1.48 3.82 3.44 4.21a4.22 4.22 0 0 1-1.93.07 4.28 4.28 0 0 0 4 2.98 8.521 8.521 0 0 1-5.33 1.84c-.34 0-.68-.02-1.02-.06C3.44 20.29 5.7 21 8.12 21 16 21 20.33 14.46 20.33 8.79c0-.19 0-.37-.01-.56.84-.6 1.56-1.36 2.14-2.23z"})})}),(0,s.jsx)("a",{href:"#",className:"text-gray-400 hover:text-primary transition-colors","aria-label":"GitHub",children:(0,s.jsx)("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:(0,s.jsx)("path",{d:"M12 2C6.477 2 2 6.484 2 12.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0 1 12 6.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.202 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.943.359.309.678.92.678 1.855 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0 0 22 12.017C22 6.484 17.522 2 12 2z"})})})]})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Product"}),(0,s.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:n.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Resources"}),(0,s.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:o.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]}),(0,s.jsxs)("div",{children:[(0,s.jsx)("h4",{className:"font-semibold text-text-main mb-4",children:"Company"}),(0,s.jsx)("ul",{className:"flex flex-col gap-3 text-sm text-text-muted font-light",children:c.map(e=>(0,s.jsx)("li",{children:(0,s.jsx)(l(),{href:e.href,className:"hover:text-primary transition-colors",children:e.label})},e.label))})]})]}),(0,s.jsxs)("div",{className:"border-t border-border pt-8 flex flex-col md:flex-row justify-between items-center gap-4",children:[(0,s.jsxs)("p",{className:"text-sm text-text-muted",children:["\xa9 ",new Date().getFullYear()," ",i.vQ.name," Inc. All rights reserved."]}),(0,s.jsxs)("div",{className:"flex gap-6 text-sm text-text-muted",children:[(0,s.jsx)(l(),{href:"#",className:"hover:text-primary transition-colors",children:"Privacy Policy"}),(0,s.jsx)(l(),{href:"#",className:"hover:text-primary transition-colors",children:"Terms of Service"})]})]})]})})}},2542:(e,t,r)=>{r.d(t,{default:()=>n});var s=r(5155),a=r(1474);let l={primary:"bg-gradient-to-b from-primary to-primary-hover text-white shadow-sm",secondary:"bg-white dark:bg-white/10 border border-black/10 dark:border-white/10 text-text-main hover:bg-black/5 dark:hover:bg-white/5",outline:"border border-black/15 dark:border-white/15 text-text-main hover:bg-black/5",ghost:"text-text-muted hover:bg-black/5 dark:hover:bg-white/5 hover:text-text-main",danger:"bg-red-500 text-white hover:bg-red-600 shadow-sm"},i={sm:"h-7 px-3 text-xs rounded-md",md:"h-9 px-4 text-sm rounded-lg",lg:"h-11 px-6 text-sm rounded-lg"};function n({children:e,variant:t="primary",size:r="md",icon:n,iconRight:o,disabled:c=!1,loading:d=!1,fullWidth:m=!1,className:x,...u}){return(0,s.jsxs)("button",{className:(0,a.cn)("inline-flex items-center justify-center gap-2 font-medium transition-all duration-200 cursor-pointer","active:scale-[0.99] disabled:opacity-50 disabled:cursor-not-allowed disabled:active:scale-100",l[t],i[r],m&&"w-full",x),disabled:c||d,...u,children:[d?(0,s.jsx)("span",{className:"material-symbols-outlined animate-spin text-[18px]",children:"progress_activity"}):n?(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:n}):null,e,o&&!d&&(0,s.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:o})]})}},2622:(e,t,r)=>{r.d(t,{default:()=>p});var s=r(5155),a=r(2115),l=r(4051),i=r.n(l),n=r(8500),o=r.n(n),c=r(3321),d=r(1474),m=r(620),x=r(2542),u=r(1127);let h=[{href:"/mitm",label:"MITM",icon:"security"}];function p({onClose:e,collapsed:t=!1,onToggleCollapse:r}){let l=(0,c.usePathname)(),[i,n]=(0,a.useState)(!1),[p,b]=(0,a.useState)(!1),[f,g]=(0,a.useState)(!1),[j,v]=(0,a.useState)(null),[y,N]=(0,a.useState)(!1);(0,a.useEffect)(()=>{fetch("/api/settings").then(e=>e.json()).then(e=>{e.enableTranslator&&N(!0)}).catch(()=>{})},[]),(0,a.useEffect)(()=>{fetch("/api/version").then(e=>e.json()).then(e=>{e.hasUpdate&&v(e)}).catch(()=>{})},[]);let k=e=>"/endpoint"===e?"/"===l||l.startsWith("/endpoint"):l.startsWith(e),w=async()=>{b(!0);try{await fetch("/api/shutdown",{method:"POST"})}catch(e){}b(!1),n(!1),g(!0)};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsxs)("aside",{className:(0,d.cn)("flex flex-col border-r border-black/5 dark:border-white/5 bg-vibrancy backdrop-blur-xl transition-all duration-300 ease-in-out",t?"w-[68px]":"w-72"),children:[r&&(0,s.jsx)("div",{className:(0,d.cn)("flex items-center pt-4 pb-1",t?"px-3 justify-center":"px-4 justify-end"),children:(0,s.jsx)("button",{type:"button",onClick:r,className:"flex items-center justify-center size-7 rounded-md text-text-muted hover:bg-surface/50 hover:text-text-main transition-colors",title:t?"Expand sidebar":"Collapse sidebar",children:(0,s.jsx)("span",{className:(0,d.cn)("material-symbols-outlined text-[18px] transition-transform duration-300",t?"rotate-0":"rotate-180"),children:"chevron_right"})})}),(0,s.jsxs)("div",{className:(0,d.cn)("py-4 flex flex-col gap-2",t?"px-3 items-center":"px-6"),children:[(0,s.jsxs)(o(),{href:"/",className:"flex items-center gap-3",children:[(0,s.jsx)("img",{src:"/favicon.svg",alt:"aRouter",className:"size-11 rounded shrink-0"}),!t&&(0,s.jsxs)("div",{className:"flex flex-col",children:[(0,s.jsx)("h1",{className:"text-lg font-semibold tracking-tight text-text-main",children:m.vQ.name}),(0,s.jsxs)("span",{className:"text-xs text-text-muted",children:["v",m.vQ.version," - C' Jay Nguyen"]})]})]}),!t&&j&&(0,s.jsxs)("div",{className:"flex flex-col gap-0.5",children:[(0,s.jsxs)("span",{className:"text-xs font-semibold text-green-600 dark:text-amber-500",children:["↑ New version available: v",j.latestVersion]}),(0,s.jsx)("code",{className:"text-[10px] text-green-600/80 dark:text-amber-400/70 font-mono select-all",children:"npm install -g @thangnm.nip/arouter@latest"})]})]}),(0,s.jsx)("nav",{className:"flex-1 px-2 py-2 space-y-1 overflow-y-auto custom-scrollbar",children:h.map(r=>(0,s.jsxs)(o(),{href:r.href,onClick:e,title:t?r.label:void 0,className:(0,d.cn)("flex items-center gap-3 rounded-lg transition-all group",t?"justify-center px-2 py-2":"px-4 py-2",k(r.href)?"bg-primary/10 text-primary":"text-text-muted hover:bg-surface/50 hover:text-text-main"),children:[(0,s.jsx)("span",{className:(0,d.cn)("material-symbols-outlined text-[18px]",k(r.href)?"fill-1":"group-hover:text-primary transition-colors"),children:r.icon}),!t&&(0,s.jsx)("span",{className:"text-sm font-medium",children:r.label})]},r.href))}),(0,s.jsx)("div",{className:"p-3 border-t border-black/5 dark:border-white/5",children:!t&&(0,s.jsxs)("div",{className:"flex items-start gap-2 p-2 rounded-lg bg-surface/50 mb-2",children:[(0,s.jsx)("div",{className:"flex items-center justify-center size-6 rounded-md bg-blue-500/10 text-blue-500 shrink-0 mt-0.5",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[14px]",children:"info"})}),(0,s.jsx)("div",{className:"flex flex-col",children:(0,s.jsx)("span",{className:"text-xs font-medium text-text-main leading-relaxed",children:"Service is running in terminal. You can close this web page. Shutdown will stop the service."})})]})})]}),(0,s.jsx)(u.ConfirmModal,{isOpen:i,onClose:()=>n(!1),onConfirm:w,title:"Close Proxy",message:"Are you sure you want to close the proxy server?",confirmText:"Close",cancelText:"Cancel",variant:"danger",loading:p}),f&&(0,s.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/80 backdrop-blur-sm",children:(0,s.jsxs)("div",{className:"text-center p-8",children:[(0,s.jsx)("div",{className:"flex items-center justify-center size-16 rounded-full bg-red-500/20 text-red-500 mx-auto mb-4",children:(0,s.jsx)("span",{className:"material-symbols-outlined text-[32px]",children:"power_off"})}),(0,s.jsx)("h2",{className:"text-xl font-semibold text-white mb-2",children:"Server Disconnected"}),(0,s.jsx)("p",{className:"text-text-muted mb-6",children:"The proxy server has been stopped."}),(0,s.jsx)(x.default,{variant:"secondary",onClick:()=>globalThis.location.reload(),children:"Reload Page"})]})})]})}p.propTypes={onClose:i().func,collapsed:i().bool,onToggleCollapse:i().func}},2899:(e,t,r)=>{r.d(t,{default:()=>d});var s=r(5155),a=r(2115),l=r(4051),i=r.n(l),n=r(882),o=r(1500),c=r(4230);function d({isOpen:e,providerInfo:t,onSuccess:r,onClose:l}){let[i,d]=(0,a.useState)(null),[m,x]=(0,a.useState)(null),[u,h]=(0,a.useState)(null),p=(0,a.useCallback)((e,t)=>{"builder-id"===e?d("builder-id"):"idc"===e?(d("idc"),h(t)):"social"===e?(d("social"),x(t.provider)):"import"===e&&r?.()},[r]),b=()=>{d(null),x(null),h(null)};return i?"builder-id"===i||"idc"===i?(0,s.jsx)(n.default,{isOpen:e,provider:"kiro",providerInfo:t,onSuccess:()=>{d(null),h(null),r?.(),l?.()},onClose:b,idcConfig:u}):"social"===i&&m?(0,s.jsx)(c.default,{isOpen:e,provider:m,onSuccess:()=>{d(null),x(null),r?.(),l?.()},onClose:b}):null:(0,s.jsx)(o.default,{isOpen:e,onMethodSelect:p,onClose:l})}d.propTypes={isOpen:i().bool.isRequired,providerInfo:i().shape({name:i().string}),onSuccess:i().func,onClose:i().func.isRequired}},2908:(e,t,r)=>{r.d(t,{default:()=>m});var s=r(5155),a=r(2115),l=r(4051),i=r.n(l),n=r(1127),o=r(7202),c=r(2679);let d=[...Object.keys(c.zN),...Object.keys(c.fg)];function m({isOpen:e,onClose:t,onSelect:r,selectedModel:l,activeProviders:i=[],title:m="Select Model",modelAliases:x={}}){let[u,h]=(0,a.useState)(""),[p,b]=(0,a.useState)([]),[f,g]=(0,a.useState)([]),j=async()=>{try{let e=await fetch("/api/combos");if(!e.ok)throw Error(`Failed to fetch combos: ${e.status}`);let t=await e.json();b(t.combos||[])}catch(e){console.error("Error fetching combos:",e),b([])}};(0,a.useEffect)(()=>{e&&j()},[e]);let v=async()=>{try{let e=await fetch("/api/provider-nodes");if(!e.ok)throw Error(`Failed to fetch provider nodes: ${e.status}`);let t=await e.json();g(t.nodes||[])}catch(e){console.error("Error fetching provider nodes:",e),g([])}};(0,a.useEffect)(()=>{e&&v()},[e]);let y=(0,a.useMemo)(()=>({...c.zN,...c.fg}),[]),N=(0,a.useMemo)(()=>{let e={};return[...new Set([...i.map(e=>e.provider)])].sort((e,t)=>{let r=d.indexOf(e),s=d.indexOf(t);return(-1===r?999:r)-(-1===s?999:s)}).forEach(t=>{let r=o.Xg[t]||t,s=y[t]||{name:t,color:"#666"},a=(0,c.mq)(t)||(0,c.gb)(t);if(s.passthroughModels){let a=Object.entries(x).filter(([,e])=>e.startsWith(`${r}/`)).map(([e,t])=>({id:t.replace(`${r}/`,""),name:e,value:t}));if(a.length>0){let l=f.find(e=>e.id===t),i=l?.name||s.name;e[t]={name:i,alias:r,color:s.color,models:a}}}else if(a){let r=i.find(e=>e.provider===t),a=f.find(e=>e.id===t),l=r?.name||a?.name||s.name,n=r?.providerSpecificData?.prefix||a?.prefix||t,o=Object.entries(x).filter(([,e])=>e.startsWith(`${t}/`)).map(([e,r])=>({id:r.replace(`${t}/`,""),name:e,value:`${n}/${r.replace(`${t}/`,"")}`})),c=o.length>0?o:[{id:`__placeholder__${t}`,name:`${n}/model-id`,value:`${n}/model-id`,isPlaceholder:!0}];e[t]={name:l,alias:n,color:s.color,models:c,isCustom:!0,hasModels:o.length>0}}else{let a=(0,o.KC)(t),l=new Set(a.map(e=>e.id)),i=Object.entries(x).filter(([e,t])=>t.startsWith(`${r}/`)&&e===t.replace(`${r}/`,"")&&!l.has(t.replace(`${r}/`,""))).map(([,e])=>{let t=e.replace(`${r}/`,"");return{id:t,name:t,value:e,isCustom:!0}}),n=[...a.map(e=>({id:e.id,name:e.name,value:`${r}/${e.id}`})),...i];n.length>0&&(e[t]={name:s.name,alias:r,color:s.color,models:n})}}),e},[i,x,y,f]),k=(0,a.useMemo)(()=>{if(!u.trim())return p;let e=u.toLowerCase();return p.filter(t=>t.name.toLowerCase().includes(e))},[p,u]),w=(0,a.useMemo)(()=>{if(!u.trim())return N;let e=u.toLowerCase(),t={};return Object.entries(N).forEach(([r,s])=>{let a=s.models.filter(t=>t.name.toLowerCase().includes(e)||t.id.toLowerCase().includes(e)),l=s.name.toLowerCase().includes(e);(a.length>0||l)&&(t[r]={...s,models:a})}),t},[N,u]),C=e=>{r(e),t(),h("")};return(0,s.jsxs)(n.default,{isOpen:e,onClose:()=>{t(),h("")},title:m,size:"md",className:"p-4!",children:[(0,s.jsx)("div",{className:"mb-3",children:(0,s.jsxs)("div",{className:"relative",children:[(0,s.jsx)("span",{className:"material-symbols-outlined absolute left-2.5 top-1/2 -translate-y-1/2 text-text-muted text-[16px]",children:"search"}),(0,s.jsx)("input",{type:"text",placeholder:"Search...",value:u,onChange:e=>h(e.target.value),className:"w-full pl-8 pr-3 py-1.5 bg-surface border border-border rounded text-xs focus:outline-none focus:ring-1 focus:ring-primary/50"})]})}),(0,s.jsxs)("div",{className:"max-h-[300px] overflow-y-auto space-y-3",children:[k.length>0&&(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,s.jsx)("span",{className:"material-symbols-outlined text-primary text-[14px]",children:"layers"}),(0,s.jsx)("span",{className:"text-xs font-medium text-primary",children:"Combos"}),(0,s.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",k.length,")"]})]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:k.map(e=>{let t=l===e.name;return(0,s.jsx)("button",{onClick:()=>C({id:e.name,name:e.name,value:e.name}),className:`
|
|
2
2
|
px-2 py-1 rounded-xl text-xs font-medium transition-all border hover:cursor-pointer
|
|
3
3
|
${t?"bg-primary text-white border-primary":"bg-surface border-border text-text-main hover:border-primary/50 hover:bg-primary/5"}
|
|
4
4
|
`,children:e.name},e.id)})})]}),Object.entries(w).map(([e,t])=>(0,s.jsxs)("div",{children:[(0,s.jsxs)("div",{className:"flex items-center gap-1.5 mb-1.5 sticky top-0 bg-surface py-0.5",children:[(0,s.jsx)("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:t.color}}),(0,s.jsx)("span",{className:"text-xs font-medium text-primary",children:t.name}),(0,s.jsxs)("span",{className:"text-[10px] text-text-muted",children:["(",t.models.length,")"]})]}),(0,s.jsx)("div",{className:"flex flex-wrap gap-1.5",children:t.models.map(e=>{let t=l===e.value,r=e.isPlaceholder;return(0,s.jsx)("button",{onClick:()=>C(e),title:r?"Select to pre-fill, then edit model ID in the input":void 0,className:`
|