9router-imagefix 0.5.97 → 0.5.99

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (186) hide show
  1. package/app/.next-cli-build/BUILD_ID +1 -1
  2. package/app/.next-cli-build/app-path-routes-manifest.json +6 -6
  3. package/app/.next-cli-build/build-manifest.json +2 -2
  4. package/app/.next-cli-build/server/app/(dashboard)/dashboard/basic-chat/page_client-reference-manifest.js +1 -1
  5. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/[toolId]/page_client-reference-manifest.js +1 -1
  6. package/app/.next-cli-build/server/app/(dashboard)/dashboard/cli-tools/page_client-reference-manifest.js +1 -1
  7. package/app/.next-cli-build/server/app/(dashboard)/dashboard/combos/page_client-reference-manifest.js +1 -1
  8. package/app/.next-cli-build/server/app/(dashboard)/dashboard/console-log/page_client-reference-manifest.js +1 -1
  9. package/app/.next-cli-build/server/app/(dashboard)/dashboard/endpoint/page_client-reference-manifest.js +1 -1
  10. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/[id]/page_client-reference-manifest.js +1 -1
  11. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/[kind]/page_client-reference-manifest.js +1 -1
  12. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/combo/[id]/page_client-reference-manifest.js +1 -1
  13. package/app/.next-cli-build/server/app/(dashboard)/dashboard/media-providers/web/page_client-reference-manifest.js +1 -1
  14. package/app/.next-cli-build/server/app/(dashboard)/dashboard/mitm/page_client-reference-manifest.js +1 -1
  15. package/app/.next-cli-build/server/app/(dashboard)/dashboard/page_client-reference-manifest.js +1 -1
  16. package/app/.next-cli-build/server/app/(dashboard)/dashboard/profile/page_client-reference-manifest.js +1 -1
  17. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page.js +1 -1
  18. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/[id]/page_client-reference-manifest.js +1 -1
  19. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/new/page_client-reference-manifest.js +1 -1
  20. package/app/.next-cli-build/server/app/(dashboard)/dashboard/providers/page_client-reference-manifest.js +1 -1
  21. package/app/.next-cli-build/server/app/(dashboard)/dashboard/proxy-pools/page_client-reference-manifest.js +1 -1
  22. package/app/.next-cli-build/server/app/(dashboard)/dashboard/pxpipe/page_client-reference-manifest.js +1 -1
  23. package/app/.next-cli-build/server/app/(dashboard)/dashboard/quota/page_client-reference-manifest.js +1 -1
  24. package/app/.next-cli-build/server/app/(dashboard)/dashboard/skills/page_client-reference-manifest.js +1 -1
  25. package/app/.next-cli-build/server/app/(dashboard)/dashboard/token-saver/page_client-reference-manifest.js +1 -1
  26. package/app/.next-cli-build/server/app/(dashboard)/dashboard/translator/page_client-reference-manifest.js +1 -1
  27. package/app/.next-cli-build/server/app/(dashboard)/dashboard/usage/page_client-reference-manifest.js +1 -1
  28. package/app/.next-cli-build/server/app/_global-error/page_client-reference-manifest.js +1 -1
  29. package/app/.next-cli-build/server/app/_global-error.html +1 -1
  30. package/app/.next-cli-build/server/app/_global-error.rsc +1 -1
  31. package/app/.next-cli-build/server/app/_global-error.segments/_full.segment.rsc +1 -1
  32. package/app/.next-cli-build/server/app/_global-error.segments/_global-error/__PAGE__.segment.rsc +1 -1
  33. package/app/.next-cli-build/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  34. package/app/.next-cli-build/server/app/_not-found/page_client-reference-manifest.js +1 -1
  35. package/app/.next-cli-build/server/app/_not-found.html +1 -1
  36. package/app/.next-cli-build/server/app/_not-found.rsc +4 -4
  37. package/app/.next-cli-build/server/app/_not-found.segments/_full.segment.rsc +4 -4
  38. package/app/.next-cli-build/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +4 -4
  39. package/app/.next-cli-build/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  40. package/app/.next-cli-build/server/app/api/oauth/[provider]/[action]/route.js +1 -1
  41. package/app/.next-cli-build/server/app/api/oauth/codex/bulk-import/route.js +1 -1
  42. package/app/.next-cli-build/server/app/api/oauth/codex/import-token/route.js +1 -1
  43. package/app/.next-cli-build/server/app/api/providers/client/route.js +1 -1
  44. package/app/.next-cli-build/server/app/api/providers/validate/route.js +1 -1
  45. package/app/.next-cli-build/server/app/api/translator/send/route.js +1 -1
  46. package/app/.next-cli-build/server/app/api/translator/translate/route.js +1 -1
  47. package/app/.next-cli-build/server/app/api/usage/[connectionId]/codex-reset-credits/route.js +1 -1
  48. package/app/.next-cli-build/server/app/api/usage/[connectionId]/route.js +1 -1
  49. package/app/.next-cli-build/server/app/api/version/route.js +1 -1
  50. package/app/.next-cli-build/server/app/callback/page_client-reference-manifest.js +1 -1
  51. package/app/.next-cli-build/server/app/callback.html +1 -1
  52. package/app/.next-cli-build/server/app/callback.rsc +4 -4
  53. package/app/.next-cli-build/server/app/callback.segments/_full.segment.rsc +4 -4
  54. package/app/.next-cli-build/server/app/callback.segments/_tree.segment.rsc +1 -1
  55. package/app/.next-cli-build/server/app/callback.segments/callback/__PAGE__.segment.rsc +4 -4
  56. package/app/.next-cli-build/server/app/dashboard/basic-chat.html +1 -1
  57. package/app/.next-cli-build/server/app/dashboard/basic-chat.rsc +6 -6
  58. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/!KGRhc2hib2FyZCk/dashboard/basic-chat/__PAGE__.segment.rsc +6 -6
  59. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_full.segment.rsc +6 -6
  60. package/app/.next-cli-build/server/app/dashboard/basic-chat.segments/_tree.segment.rsc +1 -1
  61. package/app/.next-cli-build/server/app/dashboard/cli-tools.html +1 -1
  62. package/app/.next-cli-build/server/app/dashboard/cli-tools.rsc +6 -6
  63. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/!KGRhc2hib2FyZCk/dashboard/cli-tools/__PAGE__.segment.rsc +6 -6
  64. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_full.segment.rsc +6 -6
  65. package/app/.next-cli-build/server/app/dashboard/cli-tools.segments/_tree.segment.rsc +1 -1
  66. package/app/.next-cli-build/server/app/dashboard/combos.html +1 -1
  67. package/app/.next-cli-build/server/app/dashboard/combos.rsc +6 -6
  68. package/app/.next-cli-build/server/app/dashboard/combos.segments/!KGRhc2hib2FyZCk/dashboard/combos/__PAGE__.segment.rsc +6 -6
  69. package/app/.next-cli-build/server/app/dashboard/combos.segments/_full.segment.rsc +6 -6
  70. package/app/.next-cli-build/server/app/dashboard/combos.segments/_tree.segment.rsc +1 -1
  71. package/app/.next-cli-build/server/app/dashboard/endpoint.html +1 -1
  72. package/app/.next-cli-build/server/app/dashboard/endpoint.rsc +6 -6
  73. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/!KGRhc2hib2FyZCk/dashboard/endpoint/__PAGE__.segment.rsc +6 -6
  74. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_full.segment.rsc +6 -6
  75. package/app/.next-cli-build/server/app/dashboard/endpoint.segments/_tree.segment.rsc +1 -1
  76. package/app/.next-cli-build/server/app/dashboard/media-providers/web.html +1 -1
  77. package/app/.next-cli-build/server/app/dashboard/media-providers/web.rsc +6 -6
  78. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/!KGRhc2hib2FyZCk/dashboard/media-providers/web/__PAGE__.segment.rsc +6 -6
  79. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_full.segment.rsc +6 -6
  80. package/app/.next-cli-build/server/app/dashboard/media-providers/web.segments/_tree.segment.rsc +1 -1
  81. package/app/.next-cli-build/server/app/dashboard/mitm.html +1 -1
  82. package/app/.next-cli-build/server/app/dashboard/mitm.rsc +6 -6
  83. package/app/.next-cli-build/server/app/dashboard/mitm.segments/!KGRhc2hib2FyZCk/dashboard/mitm/__PAGE__.segment.rsc +6 -6
  84. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_full.segment.rsc +6 -6
  85. package/app/.next-cli-build/server/app/dashboard/mitm.segments/_tree.segment.rsc +1 -1
  86. package/app/.next-cli-build/server/app/dashboard/profile.html +1 -1
  87. package/app/.next-cli-build/server/app/dashboard/profile.rsc +6 -6
  88. package/app/.next-cli-build/server/app/dashboard/profile.segments/!KGRhc2hib2FyZCk/dashboard/profile/__PAGE__.segment.rsc +6 -6
  89. package/app/.next-cli-build/server/app/dashboard/profile.segments/_full.segment.rsc +6 -6
  90. package/app/.next-cli-build/server/app/dashboard/profile.segments/_tree.segment.rsc +1 -1
  91. package/app/.next-cli-build/server/app/dashboard/providers/new.html +1 -1
  92. package/app/.next-cli-build/server/app/dashboard/providers/new.rsc +6 -6
  93. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/!KGRhc2hib2FyZCk/dashboard/providers/new/__PAGE__.segment.rsc +6 -6
  94. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_full.segment.rsc +6 -6
  95. package/app/.next-cli-build/server/app/dashboard/providers/new.segments/_tree.segment.rsc +1 -1
  96. package/app/.next-cli-build/server/app/dashboard/providers.html +1 -1
  97. package/app/.next-cli-build/server/app/dashboard/providers.rsc +6 -6
  98. package/app/.next-cli-build/server/app/dashboard/providers.segments/!KGRhc2hib2FyZCk/dashboard/providers/__PAGE__.segment.rsc +6 -6
  99. package/app/.next-cli-build/server/app/dashboard/providers.segments/_full.segment.rsc +6 -6
  100. package/app/.next-cli-build/server/app/dashboard/providers.segments/_tree.segment.rsc +1 -1
  101. package/app/.next-cli-build/server/app/dashboard/proxy-pools.html +1 -1
  102. package/app/.next-cli-build/server/app/dashboard/proxy-pools.rsc +6 -6
  103. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/!KGRhc2hib2FyZCk/dashboard/proxy-pools/__PAGE__.segment.rsc +6 -6
  104. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_full.segment.rsc +6 -6
  105. package/app/.next-cli-build/server/app/dashboard/proxy-pools.segments/_tree.segment.rsc +1 -1
  106. package/app/.next-cli-build/server/app/dashboard/pxpipe.html +1 -1
  107. package/app/.next-cli-build/server/app/dashboard/pxpipe.rsc +6 -6
  108. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/!KGRhc2hib2FyZCk/dashboard/pxpipe/__PAGE__.segment.rsc +6 -6
  109. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_full.segment.rsc +6 -6
  110. package/app/.next-cli-build/server/app/dashboard/pxpipe.segments/_tree.segment.rsc +1 -1
  111. package/app/.next-cli-build/server/app/dashboard/quota.html +2 -2
  112. package/app/.next-cli-build/server/app/dashboard/quota.rsc +7 -7
  113. package/app/.next-cli-build/server/app/dashboard/quota.segments/!KGRhc2hib2FyZCk/dashboard/quota/__PAGE__.segment.rsc +7 -7
  114. package/app/.next-cli-build/server/app/dashboard/quota.segments/_full.segment.rsc +7 -7
  115. package/app/.next-cli-build/server/app/dashboard/quota.segments/_tree.segment.rsc +1 -1
  116. package/app/.next-cli-build/server/app/dashboard/settings/pricing/page_client-reference-manifest.js +1 -1
  117. package/app/.next-cli-build/server/app/dashboard/settings/pricing.html +1 -1
  118. package/app/.next-cli-build/server/app/dashboard/settings/pricing.rsc +4 -4
  119. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_full.segment.rsc +4 -4
  120. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/_tree.segment.rsc +1 -1
  121. package/app/.next-cli-build/server/app/dashboard/settings/pricing.segments/dashboard/settings/pricing/__PAGE__.segment.rsc +4 -4
  122. package/app/.next-cli-build/server/app/dashboard/skills.html +1 -1
  123. package/app/.next-cli-build/server/app/dashboard/skills.rsc +6 -6
  124. package/app/.next-cli-build/server/app/dashboard/skills.segments/!KGRhc2hib2FyZCk/dashboard/skills/__PAGE__.segment.rsc +6 -6
  125. package/app/.next-cli-build/server/app/dashboard/skills.segments/_full.segment.rsc +6 -6
  126. package/app/.next-cli-build/server/app/dashboard/skills.segments/_tree.segment.rsc +1 -1
  127. package/app/.next-cli-build/server/app/dashboard/token-saver.html +1 -1
  128. package/app/.next-cli-build/server/app/dashboard/token-saver.rsc +6 -6
  129. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/!KGRhc2hib2FyZCk/dashboard/token-saver/__PAGE__.segment.rsc +6 -6
  130. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_full.segment.rsc +6 -6
  131. package/app/.next-cli-build/server/app/dashboard/token-saver.segments/_tree.segment.rsc +1 -1
  132. package/app/.next-cli-build/server/app/dashboard/translator.html +1 -1
  133. package/app/.next-cli-build/server/app/dashboard/translator.rsc +6 -6
  134. package/app/.next-cli-build/server/app/dashboard/translator.segments/!KGRhc2hib2FyZCk/dashboard/translator/__PAGE__.segment.rsc +6 -6
  135. package/app/.next-cli-build/server/app/dashboard/translator.segments/_full.segment.rsc +6 -6
  136. package/app/.next-cli-build/server/app/dashboard/translator.segments/_tree.segment.rsc +1 -1
  137. package/app/.next-cli-build/server/app/dashboard/usage.html +1 -1
  138. package/app/.next-cli-build/server/app/dashboard/usage.rsc +6 -6
  139. package/app/.next-cli-build/server/app/dashboard/usage.segments/!KGRhc2hib2FyZCk/dashboard/usage/__PAGE__.segment.rsc +6 -6
  140. package/app/.next-cli-build/server/app/dashboard/usage.segments/_full.segment.rsc +6 -6
  141. package/app/.next-cli-build/server/app/dashboard/usage.segments/_tree.segment.rsc +1 -1
  142. package/app/.next-cli-build/server/app/dashboard.html +1 -1
  143. package/app/.next-cli-build/server/app/dashboard.rsc +6 -6
  144. package/app/.next-cli-build/server/app/dashboard.segments/!KGRhc2hib2FyZCk/dashboard/__PAGE__.segment.rsc +6 -6
  145. package/app/.next-cli-build/server/app/dashboard.segments/_full.segment.rsc +6 -6
  146. package/app/.next-cli-build/server/app/dashboard.segments/_tree.segment.rsc +1 -1
  147. package/app/.next-cli-build/server/app/index.html +1 -1
  148. package/app/.next-cli-build/server/app/index.rsc +4 -4
  149. package/app/.next-cli-build/server/app/index.segments/__PAGE__.segment.rsc +4 -4
  150. package/app/.next-cli-build/server/app/index.segments/_full.segment.rsc +4 -4
  151. package/app/.next-cli-build/server/app/index.segments/_tree.segment.rsc +1 -1
  152. package/app/.next-cli-build/server/app/landing/page_client-reference-manifest.js +1 -1
  153. package/app/.next-cli-build/server/app/landing.html +1 -1
  154. package/app/.next-cli-build/server/app/landing.rsc +4 -4
  155. package/app/.next-cli-build/server/app/landing.segments/_full.segment.rsc +4 -4
  156. package/app/.next-cli-build/server/app/landing.segments/_tree.segment.rsc +1 -1
  157. package/app/.next-cli-build/server/app/landing.segments/landing/__PAGE__.segment.rsc +4 -4
  158. package/app/.next-cli-build/server/app/login/page_client-reference-manifest.js +1 -1
  159. package/app/.next-cli-build/server/app/login.html +1 -1
  160. package/app/.next-cli-build/server/app/login.rsc +5 -5
  161. package/app/.next-cli-build/server/app/login.segments/_full.segment.rsc +5 -5
  162. package/app/.next-cli-build/server/app/login.segments/_tree.segment.rsc +1 -1
  163. package/app/.next-cli-build/server/app/login.segments/login/__PAGE__.segment.rsc +5 -5
  164. package/app/.next-cli-build/server/app/page_client-reference-manifest.js +1 -1
  165. package/app/.next-cli-build/server/app-paths-manifest.json +6 -6
  166. package/app/.next-cli-build/server/chunks/4037.js +1 -1
  167. package/app/.next-cli-build/server/chunks/4733.js +1 -1
  168. package/app/.next-cli-build/server/chunks/6197.js +1 -1
  169. package/app/.next-cli-build/server/chunks/7807.js +1 -1
  170. package/app/.next-cli-build/server/chunks/827.js +1 -1
  171. package/app/.next-cli-build/server/chunks/869.js +1 -1
  172. package/app/.next-cli-build/server/chunks/8847.js +1 -1
  173. package/app/.next-cli-build/server/chunks/8908.js +1 -1
  174. package/app/.next-cli-build/server/chunks/929.js +1 -1
  175. package/app/.next-cli-build/server/chunks/9497.js +1 -1
  176. package/app/.next-cli-build/server/middleware-build-manifest.js +1 -1
  177. package/app/.next-cli-build/server/pages/404.html +1 -1
  178. package/app/.next-cli-build/server/pages/500.html +1 -1
  179. package/app/.next-cli-build/static/chunks/{1321-a19a12eda0139904.js → 1321-8cc912c171e07c2b.js} +1 -1
  180. package/app/.next-cli-build/static/chunks/app/(dashboard)/dashboard/providers/[id]/{page-1c7fe14f7ad3569a.js → page-9d6748ba351963e1.js} +1 -1
  181. package/app/cli/.build-home/AppData/Roaming/9router/db/data.sqlite-shm +0 -0
  182. package/app/cli/.build-home/AppData/Roaming/9router/db/data.sqlite-wal +0 -0
  183. package/app/package.json +1 -1
  184. package/package.json +1 -1
  185. /package/app/.next-cli-build/static/{I5VVSGP7C6QvZA3ZRoSDq → nNFIgvn-gWuACaSlqXifs}/_buildManifest.js +0 -0
  186. /package/app/.next-cli-build/static/{I5VVSGP7C6QvZA3ZRoSDq → nNFIgvn-gWuACaSlqXifs}/_ssgManifest.js +0 -0
@@ -1,4 +1,4 @@
1
- (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{43566:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>G});var a=s(95155),i=s(12115),l=s(73321),r=s(98500),n=s.n(r),o=s(5772),d=s(8247),c=s(35497),m=s(88105),p=s(28777),u=s(67899),x=s(62630);s(67468);let h=["none","low","medium","high"],f=["none","thinking"],g=["none","low","medium","high","max"],y={openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":g,"claude-budget":["none","low","medium","high","xhigh","max"],"gemini-level":["minimal","low","medium","high"],"gemini-budget":h,zai:f,qwen:h,kimi:g,deepseek:["none","high","max"],minimax:f,hunyuan:h,step:h},b=["none","minimal","low","medium","high","xhigh","max"],v=[{provider:"cerebras",pattern:"*",levels:["none","low","medium","high"]},{provider:"codex",pattern:"*gpt-6*",levels:b},{provider:"codex",pattern:"*gpt-5.6-sol*",levels:[...b,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:[...b,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:b},{pattern:"*codex*",levels:["low","medium","high","xhigh"]}];function j(e,t){if("kiro"===e&&null===function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".");if(/(?:^|[/.])gpt[/.]5[/.]6(?:[/.]|$)/.test(t))return"reasoning";if(!t.includes("claude"))return null;let s=t.match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);if(!s)return null;let[,a,i]=s,l=Number(a),r=void 0===i?null:Number(i);return l<4||4===l&&(null===r||r<=5||null!==r&&r>=1e3)?null:"output_config"}(t))return null;let s=(0,u.nl)(e,t);if(!s.reasoning)return null;let a=v.find(s=>(!s.provider||s.provider===e)&&(0,x.gH)(s.pattern,t)),i=a?.levels||y[s.thinkingFormat]||h;return!1===s.thinkingCanDisable&&(i=i.filter(e=>"none"!==e)),i}var k=s(11059),w=s(929),N=s(73006);let C=new Map;async function S(e){if(!e?.url||!e?.type)return[];let t=C.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let a=(await s.json()).data??[];return C.set(e.url,{data:a,expiresAt:Date.now()+6e5}),a}catch{return[]}}function A({customModels:e=[],modelAliases:t={},providerAlias:s,builtInModels:a=[],type:i="llm",includeLegacyAliases:l=!0}){let r=new Set(a.map(e=>e.id)),n=new Set,o=[];for(let t of e){if(!t?.id||t.providerAlias!==s)continue;let e=t?.kind||t?.type||"llm";if(i&&e!==i||r.has(t.id))continue;let a=`${s}/${t.id}`;n.has(a)||(n.add(a),o.push({id:t.id,name:t.name||t.id,fullModel:a,source:"custom",type:e}))}if(!l)return o;let d=`${s}/`;for(let[e,s]of Object.entries(t||{})){if("string"!=typeof s||!s.startsWith(d))continue;let t=s.slice(d.length);!t||r.has(t)||n.has(s)||(n.add(s),o.push({id:t,alias:e,fullModel:s,source:"legacyAlias",type:i||"llm"}))}return o}var T=s(14051),$=s.n(T);function O({model:e,fullModel:t,alias:s,copied:i,onCopy:l,testStatus:r,isCustom:n,isFree:o,onDeleteAlias:d,onTest:m,isTesting:p,onDisable:u,caps:x,thinkingSuffix:h}){let f=h?`${t}(${h})`:t,g="ok"===r?"#22c55e":"error"===r?"#ef4444":void 0;return(0,a.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===r?"border-green-500/40":"error"===r?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:g?{color:g}:void 0,children:"ok"===r?"check_circle":"error"===r?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,a.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:f}),(0,a.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[e.name&&(0,a.jsx)("span",{className:"truncate text-[9px] italic text-text-muted/70",children:e.name}),(0,a.jsx)(c.nh,{caps:x,colorOverride:"text-text-muted/70",size:12})]})]}),m&&(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:m,disabled:p,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${p?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:p?{animation:"spin 1s linear infinite"}:void 0,children:p?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:p?"Testing...":"Test"})]}),(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:()=>l(f,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:i===`model-${e.id}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:i===`model-${e.id}`?"Copied!":"Copy"})]}),n?(0,a.jsx)("button",{onClick:d,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):u?(0,a.jsx)("button",{onClick:u,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function P({modelId:e,fullModel:t,copied:s,onCopy:i,onDeleteAlias:l,onTest:r,testStatus:n,isTesting:o}){let d="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,a.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>i(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),r&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:r,disabled:o,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:o?"Testing...":"Test"})]})]})]}),(0,a.jsx)("button",{onClick:l,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function E({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,customModels:l,copied:r,onCopy:n,onDeleteAlias:o,onAddCustomModel:d,onDeleteCustomModel:m,connections:p,isAnthropic:u}){let[x,h]=(0,i.useState)(""),[f,g]=(0,i.useState)(!1),[y,b]=(0,i.useState)(!1),[v,j]=(0,i.useState)(null),[k,w]=(0,i.useState)({}),N=async t=>{if(!v){j(t);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),a=await s.json();w(e=>({...e,[t]:a.ok?"ok":"error"}))}catch{w(e=>({...e,[t]:"error"}))}finally{j(null)}}},C=A({customModels:l,modelAliases:s,providerAlias:e,type:"llm"}),S=async()=>{if(!x.trim()||f)return;let e=x.trim();if(C.some(t=>t.id===e))return void alert("Model already exists for this provider.");g(!0);try{await d(e),h("")}catch(e){console.log("Error adding model:",e)}finally{g(!1)}},T=async()=>{if(y)return;let e=p.find(e=>!1!==e.isActive);if(e){b(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||"Failed to import models");let a=s.models||[];if(0===a.length)return void alert("No models returned from /models.");let i=0;for(let e of a){let t=e.id||e.name||e.model;t&&(C.some(e=>e.id===t)||(await d(t),i+=1))}0===i&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{b(!1)}}},$=p.some(e=>!1!==e.isActive);return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",u?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,a.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,a.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,a.jsx)("input",{id:"new-compatible-model-input",type:"text",value:x,onChange:e=>h(e.target.value),onKeyDown:e=>"Enter"===e.key&&S(),placeholder:u?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,a.jsx)(c.$n,{size:"sm",icon:"add",onClick:S,disabled:!x.trim()||f,children:f?"Adding...":"Add"}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"download",onClick:T,disabled:!$||y,children:y?"Importing...":"Import from /models"})]}),!$&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),C.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-3",children:C.map(({id:s,alias:i,source:l})=>(0,a.jsx)(P,{modelId:s,fullModel:`${t}/${s}`,copied:r,onCopy:n,onDeleteAlias:()=>"custom"===l?m(s):o(i),onTest:p.length>0?()=>N(s):void 0,testStatus:k[s],isTesting:v===s},`${l}-${e}/${s}`))})]})}O.propTypes={model:$().shape({id:$().string.isRequired}).isRequired,fullModel:$().string.isRequired,alias:$().string,copied:$().string,onCopy:$().func.isRequired,testStatus:$().oneOf(["ok","error"]),isCustom:$().bool,isFree:$().bool,onDeleteAlias:$().func,onTest:$().func,isTesting:$().bool,onDisable:$().func,caps:$().object,thinkingSuffix:$().string},$().string.isRequired,$().string.isRequired,$().string,$().func.isRequired,$().func.isRequired,$().func,$().oneOf(["ok","error"]),$().bool,$().string.isRequired,$().object.isRequired,$().arrayOf($().object),$().string,$().func.isRequired,$().func.isRequired,$().func.isRequired,$().func.isRequired,E.propTypes={providerStorageAlias:$().string.isRequired,providerDisplayAlias:$().string.isRequired,modelAliases:$().object.isRequired,customModels:$().arrayOf($().object),copied:$().string,onCopy:$().func.isRequired,onDeleteAlias:$().func.isRequired,onAddCustomModel:$().func.isRequired,onDeleteCustomModel:$().func.isRequired,connections:$().arrayOf($().shape({id:$().string,isActive:$().bool})).isRequired,isAnthropic:$().bool};var I=s(70217);function D({until:e}){let[t,s]=(0,i.useState)("");return((0,i.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let a=Math.floor(t/1e3);if(a<60)s(`${a}s`);else if(a<3600)s(`${Math.floor(a/60)}m ${a%60}s`);else{let e=Math.floor(a/3600),t=Math.floor(a%3600/60);s(`${e}h ${t}m`)}};t();let a=setInterval(t,1e3);return()=>clearInterval(a)},[e]),t)?(0,a.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function R({connection:e,proxyPools:t,isOAuth:s,isFirst:l,isLast:r,onMoveUp:n,onMoveDown:o,onToggleActive:d,onUpdateProxy:m,onEdit:p,onDelete:u,oneByOneStatus:x=null,autoPing:h=null}){let[f,g]=(0,i.useState)(!1),[y,b]=(0,i.useState)(!1),v=(0,i.useRef)(null),j=new Map((t||[]).map(e=>[e.id,e])),k=e.providerSpecificData?.proxyPoolId||null,w=k?j.get(k):null,N=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,C=!!k||N,S=w?`Pool: ${w.name}`:k?`Pool: ${k} (inactive/missing)`:N?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",A=h?.provider==="codex"?"Auto-starts the next 5h Codex window after reset by sending a tiny gpt-5.5 request. Consumes a small amount of quota.":"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",T="";if(w?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=w?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);T=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{T=t}}let $=w?.noProxy||e.providerSpecificData?.connectionNoProxy||"",O="default";w?.isActive===!0?O="success":(k||N)&&(O="error"),(0,i.useEffect)(()=>{if(!f)return;let e=e=>{v.current&&!v.current.contains(e.target)&&g(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f]);let P=async e=>{b(!0);try{await m("__none__"===e?null:e)}finally{b(!1),g(!1)}},E=e.authType||(s?"oauth":"apikey"),_="oauth"===E,q="cookie"===E,U=e.name?.trim()||e.email?.trim()||e.displayName?.trim()||(_?"OAuth Account":q?"Cookie Account":"API Key"),z=e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null,[K,M]=(0,i.useState)(!1),J=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,i.useEffect)(()=>{let t=()=>{M(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=J?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[J]);let F="unavailable"!==e.testStatus||K?e.testStatus:"active",L=()=>x?"queued"===x.state?"queued":"testing"===x.state?"testing":"success"===x.state?"success":"failed"===x.state?x.error?`failed: ${x.error}`:"failed":null:null;return(0,a.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,a.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,a.jsx)("button",{onClick:n,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,a.jsx)("button",{onClick:o,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:q?"cookie":_?"lock":"key"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:U}),z&&(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:z}),(0,a.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,a.jsx)(c.Ex,{variant:(0,I.g)(e.isActive,F),size:"sm",dot:!0,children:!1===e.isActive?"disabled":F||"Unknown"}),(0,a.jsx)(c.Ex,{variant:"default",size:"sm",children:_?"OAuth":q?"Cookie":"API Key"}),C&&(0,a.jsx)(c.Ex,{variant:O,size:"sm",children:"Proxy"}),K&&!1!==e.isActive&&(0,a.jsx)(D,{until:J}),e.lastError&&!1!==e.isActive&&(0,a.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),L()&&(0,a.jsx)(c.Ex,{variant:x?"success"===x.state?"success":"failed"===x.state?"error":"testing"===x.state?"primary":"default":"default",size:"sm",children:L()})]}),C&&(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:S,children:S}),T&&(0,a.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:T}),$&&(0,a.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:$,children:["no_proxy: ",$]})]})]})]}),(0,a.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(t||[]).length>0&&(0,a.jsxs)("div",{className:"relative",ref:v,children:[(0,a.jsxs)("button",{onClick:()=>g(e=>!e),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${C?"text-primary":"text-text-muted hover:text-primary"}`,disabled:y,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:y?"progress_activity":"lan"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),f&&(0,a.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 max-w-[78vw] min-w-[160px] rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,a.jsx)("button",{onClick:()=>P("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!k?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,a.jsx)("button",{onClick:()=>P(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${k===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),h&&(0,a.jsx)(c.m_,{text:A,children:(0,a.jsxs)("button",{onClick:()=>h.onToggle(!h.on),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${h.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,a.jsxs)("button",{onClick:p,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,a.jsxs)("button",{onClick:u,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,a.jsx)(c.lM,{size:"sm",checked:e.isActive??!0,onChange:d,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}D.propTypes={until:$().string.isRequired},R.propTypes={connection:$().shape({id:$().string,name:$().string,email:$().string,displayName:$().string,modelLockUntil:$().string,testStatus:$().string,isActive:$().bool,lastError:$().string,priority:$().number,globalPriority:$().number}).isRequired,proxyPools:$().arrayOf($().shape({id:$().string,name:$().string,proxyUrl:$().string,noProxy:$().string,isActive:$().bool})),isOAuth:$().bool.isRequired,isFirst:$().bool.isRequired,isLast:$().bool.isRequired,onMoveUp:$().func.isRequired,onMoveDown:$().func.isRequired,onToggleActive:$().func.isRequired,onUpdateProxy:$().func,onEdit:$().func.isRequired,onDelete:$().func.isRequired,oneByOneStatus:$().shape({state:$().string,error:$().string}),autoPing:$().shape({on:$().bool,onToggle:$().func,provider:$().string})};let _=[{value:"daily-only",label:"Daily only",hint:"Host resmi IDE. Paling aman — rotasi akun saat gagal.",urls:["daily-cloudcode-pa.googleapis.com"]},{value:"daily-autopush",label:"Daily + Autopush",hint:"Tambah satu pool sandbox sebagai cadangan kapasitas.",urls:["daily-cloudcode-pa.googleapis.com","autopush-cloudcode-pa.sandbox.googleapis.com"]},{value:"all-hosts",label:"Semua host (daily + 2 sandbox)",hint:"Kapasitas maksimum. Sandbox bisa menolak 403 #3501 pada sebagian akun.",urls:["daily-cloudcode-pa.googleapis.com","autopush-cloudcode-pa.sandbox.googleapis.com","staging-cloudcode-pa.sandbox.googleapis.com"]}];function q(){let[e,t]=(0,i.useState)("daily-only"),[s,l]=(0,i.useState)(!1),[r,n]=(0,i.useState)(""),[o,d]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let e=!1;return fetch("/api/settings",{cache:"no-store"}).then(e=>e.json()).then(s=>{e||(t(s?.antigravityHostMode||"daily-only"),d(!0))}).catch(()=>d(!0)),()=>{e=!0}},[]);let m=async s=>{l(!0),n(""),t(s);try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({antigravityHostMode:s})});if(!e.ok)throw Error(`HTTP ${e.status}`);n("Tersimpan — berlaku pada request berikutnya.")}catch(s){t(e),n(`Gagal menyimpan: ${s.message}`)}finally{l(!1)}},p=_.find(t=>t.value===e)||_[0];return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Host Antigravity"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Host mana yang dicoba, berurut. Berlaku pada request berikutnya — tanpa restart."})]}),(0,a.jsx)(c.Ex,{variant:"daily-only"===e?"success":"warning",children:"daily-only"===e?"Aman":"Sandbox aktif"})]}),(0,a.jsx)(c.l6,{label:"Mode host",value:e,disabled:s||!o,onChange:e=>m(e.target.value),children:_.map(e=>(0,a.jsx)("option",{value:e.value,children:e.label},e.value))}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted",children:p.hint}),(0,a.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:p.urls.map((e,t)=>(0,a.jsxs)("span",{className:"rounded border border-border-subtle bg-bg-subtle px-2 py-1 font-mono text-xs text-text-muted",children:[t+1,". ",e.replace(".googleapis.com","")]},e))}),"daily-only"!==e&&(0,a.jsxs)("p",{className:"mt-3 rounded border border-yellow-500/30 bg-yellow-500/10 px-3 py-2 text-xs text-text-muted",children:["Host sandbox memberlakukan gerbang tambahan: request dengan project yang tidak dikenali ditolak ",(0,a.jsx)("span",{className:"font-mono",children:"403 SUBSCRIPTION_REQUIRED (#3501)"}),". Kalau muncul error itu, kembali ke ",(0,a.jsx)("strong",{children:"Daily only"}),"."]}),r&&(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted",children:r})]})}let U=`name1|sk-key1
1
+ (self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2134],{43566:(e,t,s)=>{"use strict";s.r(t),s.d(t,{default:()=>G});var a=s(95155),i=s(12115),l=s(73321),r=s(98500),n=s.n(r),o=s(5772),d=s(8247),c=s(35497),m=s(88105),p=s(28777),u=s(67899),x=s(62630);s(67468);let h=["none","low","medium","high"],f=["none","thinking"],g=["none","low","medium","high","max"],y={openai:["none","minimal","low","medium","high","xhigh"],"claude-adaptive":g,"claude-budget":["none","low","medium","high","xhigh","max"],"gemini-level":["minimal","low","medium","high"],"gemini-budget":h,zai:f,qwen:h,kimi:g,deepseek:["none","high","max"],minimax:f,hunyuan:h,step:h},b=["none","minimal","low","medium","high","xhigh","max"],v=[{provider:"cerebras",pattern:"*",levels:["none","low","medium","high"]},{provider:"codex",pattern:"*gpt-6*",levels:b},{provider:"codex",pattern:"*gpt-5.6-sol*",levels:[...b,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-terra*",levels:[...b,"ultra"]},{provider:"codex",pattern:"*gpt-5.6-luna*",levels:b},{pattern:"*codex*",levels:["low","medium","high","xhigh"]}];function j(e,t){if("kiro"===e&&null===function(e){if("string"!=typeof e)return null;let t=e.toLowerCase().replace(/-/g,".");if(/(?:^|[/.])gpt[/.]5[/.]6(?:[/.]|$)/.test(t))return"reasoning";if(!t.includes("claude"))return null;let s=t.match(/(?:^|[/.])claude(?:[/.][a-z]+)*[/.](\d+)(?:[/.](\d+))?(?:[/.]|$)/);if(!s)return null;let[,a,i]=s,l=Number(a),r=void 0===i?null:Number(i);return l<4||4===l&&(null===r||r<=5||null!==r&&r>=1e3)?null:"output_config"}(t))return null;let s=(0,u.nl)(e,t);if(!s.reasoning)return null;let a=v.find(s=>(!s.provider||s.provider===e)&&(0,x.gH)(s.pattern,t)),i=a?.levels||y[s.thinkingFormat]||h;return!1===s.thinkingCanDisable&&(i=i.filter(e=>"none"!==e)),i}var k=s(11059),w=s(929),N=s(73006);let C=new Map;async function S(e){if(!e?.url||!e?.type)return[];let t=C.get(e.url);if(t&&Date.now()<t.expiresAt)return t.data;try{let t=new URLSearchParams({url:e.url,type:e.type}),s=await fetch(`/api/providers/suggested-models?${t}`);if(!s.ok)return[];let a=(await s.json()).data??[];return C.set(e.url,{data:a,expiresAt:Date.now()+6e5}),a}catch{return[]}}function A({customModels:e=[],modelAliases:t={},providerAlias:s,builtInModels:a=[],type:i="llm",includeLegacyAliases:l=!0}){let r=new Set(a.map(e=>e.id)),n=new Set,o=[];for(let t of e){if(!t?.id||t.providerAlias!==s)continue;let e=t?.kind||t?.type||"llm";if(i&&e!==i||r.has(t.id))continue;let a=`${s}/${t.id}`;n.has(a)||(n.add(a),o.push({id:t.id,name:t.name||t.id,fullModel:a,source:"custom",type:e}))}if(!l)return o;let d=`${s}/`;for(let[e,s]of Object.entries(t||{})){if("string"!=typeof s||!s.startsWith(d))continue;let t=s.slice(d.length);!t||r.has(t)||n.has(s)||(n.add(s),o.push({id:t,alias:e,fullModel:s,source:"legacyAlias",type:i||"llm"}))}return o}var T=s(14051),$=s.n(T);function O({model:e,fullModel:t,alias:s,copied:i,onCopy:l,testStatus:r,isCustom:n,isFree:o,onDeleteAlias:d,onTest:m,isTesting:p,onDisable:u,caps:x,thinkingSuffix:h}){let f=h?`${t}(${h})`:t,g="ok"===r?"#22c55e":"error"===r?"#ef4444":void 0;return(0,a.jsx)("div",{className:`group min-w-0 max-w-full rounded-lg border px-3 py-2 ${"ok"===r?"border-green-500/40":"error"===r?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:(0,a.jsxs)("div",{className:"flex min-w-0 items-start gap-2 sm:items-center",children:[(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base",style:g?{color:g}:void 0,children:"ok"===r?"check_circle":"error"===r?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col gap-1",children:[(0,a.jsx)("code",{className:"max-w-[72vw] truncate rounded bg-sidebar px-1.5 py-0.5 font-mono text-xs text-text-muted sm:max-w-[360px]",children:f}),(0,a.jsxs)("span",{className:"flex min-w-0 items-center text-[9px] gap-1 pl-1",children:[e.name&&(0,a.jsx)("span",{className:"truncate text-[9px] italic text-text-muted/70",children:e.name}),(0,a.jsx)(c.nh,{caps:x,colorOverride:"text-text-muted/70",size:12})]})]}),m&&(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:m,disabled:p,className:`rounded p-0.5 text-text-muted transition-opacity hover:bg-sidebar hover:text-primary ${p?"opacity-100":"opacity-100 sm:opacity-0 sm:group-hover:opacity-100"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:p?{animation:"spin 1s linear infinite"}:void 0,children:p?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:p?"Testing...":"Test"})]}),(0,a.jsxs)("div",{className:"relative shrink-0 group/btn",children:[(0,a.jsx)("button",{onClick:()=>l(f,`model-${e.id}`),className:"rounded p-0.5 text-text-muted hover:bg-sidebar hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:i===`model-${e.id}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute mt-1 top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:i===`model-${e.id}`?"Copied!":"Copy"})]}),n?(0,a.jsx)("button",{onClick:d,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Remove custom model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):u?(0,a.jsx)("button",{onClick:u,className:"ml-auto rounded p-0.5 text-text-muted opacity-100 transition-opacity hover:bg-red-500/10 hover:text-red-500 sm:opacity-0 sm:group-hover:opacity-100",title:"Disable this model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"close"})}):null]})})}function P({modelId:e,fullModel:t,copied:s,onCopy:i,onDeleteAlias:l,onTest:r,testStatus:n,isTesting:o}){let d="ok"===n?"#22c55e":"error"===n?"#ef4444":void 0;return(0,a.jsxs)("div",{className:`flex items-center gap-3 p-3 rounded-lg border ${"ok"===n?"border-green-500/40":"error"===n?"border-red-500/40":"border-border"} hover:bg-sidebar/50`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-base text-text-muted",style:d?{color:d}:void 0,children:"ok"===n?"check_circle":"error"===n?"cancel":"smart_toy"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:e}),(0,a.jsxs)("div",{className:"flex items-center gap-1 mt-1",children:[(0,a.jsx)("code",{className:"text-xs text-text-muted font-mono bg-sidebar px-1.5 py-0.5 rounded",children:t}),(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:()=>i(t,`model-${e}`),className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:s===`model-${e}`?"check":"content_copy"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:s===`model-${e}`?"Copied!":"Copy"})]}),r&&(0,a.jsxs)("div",{className:"relative group/btn",children:[(0,a.jsx)("button",{onClick:r,disabled:o,className:"p-0.5 hover:bg-sidebar rounded text-text-muted hover:text-primary transition-colors",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",style:o?{animation:"spin 1s linear infinite"}:void 0,children:o?"progress_activity":"science"})}),(0,a.jsx)("span",{className:"pointer-events-none absolute top-5 left-1/2 -translate-x-1/2 text-[10px] text-text-muted whitespace-nowrap opacity-0 group-hover/btn:opacity-100 transition-opacity",children:o?"Testing...":"Test"})]})]})]}),(0,a.jsx)("button",{onClick:l,className:"p-1 hover:bg-red-50 rounded text-red-500",title:"Remove model",children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"delete"})})]})}function E({providerStorageAlias:e,providerDisplayAlias:t,modelAliases:s,customModels:l,copied:r,onCopy:n,onDeleteAlias:o,onAddCustomModel:d,onDeleteCustomModel:m,connections:p,isAnthropic:u}){let[x,h]=(0,i.useState)(""),[f,g]=(0,i.useState)(!1),[y,b]=(0,i.useState)(!1),[v,j]=(0,i.useState)(null),[k,w]=(0,i.useState)({}),N=async t=>{if(!v){j(t);try{let s=await fetch("/api/models/test",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({model:`${e}/${t}`})}),a=await s.json();w(e=>({...e,[t]:a.ok?"ok":"error"}))}catch{w(e=>({...e,[t]:"error"}))}finally{j(null)}}},C=A({customModels:l,modelAliases:s,providerAlias:e,type:"llm"}),S=async()=>{if(!x.trim()||f)return;let e=x.trim();if(C.some(t=>t.id===e))return void alert("Model already exists for this provider.");g(!0);try{await d(e),h("")}catch(e){console.log("Error adding model:",e)}finally{g(!1)}},T=async()=>{if(y)return;let e=p.find(e=>!1!==e.isActive);if(e){b(!0);try{let t=await fetch(`/api/providers/${e.id}/models`),s=await t.json();if(!t.ok)return void alert(s.error||"Failed to import models");let a=s.models||[];if(0===a.length)return void alert("No models returned from /models.");let i=0;for(let e of a){let t=e.id||e.name||e.model;t&&(C.some(e=>e.id===t)||(await d(t),i+=1))}0===i&&alert("No new models were added.")}catch(e){console.log("Error importing models:",e)}finally{b(!1)}}},$=p.some(e=>!1!==e.isActive);return(0,a.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,a.jsxs)("p",{className:"text-sm text-text-muted",children:["Add ",u?"Anthropic":"OpenAI","-compatible models manually or import them from the /models endpoint."]}),(0,a.jsxs)("div",{className:"flex items-end gap-2 flex-wrap",children:[(0,a.jsxs)("div",{className:"flex-1 min-w-[240px]",children:[(0,a.jsx)("label",{htmlFor:"new-compatible-model-input",className:"text-xs text-text-muted mb-1 block",children:"Model ID"}),(0,a.jsx)("input",{id:"new-compatible-model-input",type:"text",value:x,onChange:e=>h(e.target.value),onKeyDown:e=>"Enter"===e.key&&S(),placeholder:u?"claude-3-opus-20240229":"gpt-4o",className:"w-full px-3 py-2 text-sm border border-border rounded-lg bg-background focus:outline-none focus:border-primary"})]}),(0,a.jsx)(c.$n,{size:"sm",icon:"add",onClick:S,disabled:!x.trim()||f,children:f?"Adding...":"Add"}),(0,a.jsx)(c.$n,{size:"sm",variant:"secondary",icon:"download",onClick:T,disabled:!$||y,children:y?"Importing...":"Import from /models"})]}),!$&&(0,a.jsx)("p",{className:"text-xs text-text-muted",children:"Add a connection to enable importing models."}),C.length>0&&(0,a.jsx)("div",{className:"flex flex-col gap-3",children:C.map(({id:s,alias:i,source:l})=>(0,a.jsx)(P,{modelId:s,fullModel:`${t}/${s}`,copied:r,onCopy:n,onDeleteAlias:()=>"custom"===l?m(s):o(i),onTest:p.length>0?()=>N(s):void 0,testStatus:k[s],isTesting:v===s},`${l}-${e}/${s}`))})]})}O.propTypes={model:$().shape({id:$().string.isRequired}).isRequired,fullModel:$().string.isRequired,alias:$().string,copied:$().string,onCopy:$().func.isRequired,testStatus:$().oneOf(["ok","error"]),isCustom:$().bool,isFree:$().bool,onDeleteAlias:$().func,onTest:$().func,isTesting:$().bool,onDisable:$().func,caps:$().object,thinkingSuffix:$().string},$().string.isRequired,$().string.isRequired,$().string,$().func.isRequired,$().func.isRequired,$().func,$().oneOf(["ok","error"]),$().bool,$().string.isRequired,$().object.isRequired,$().arrayOf($().object),$().string,$().func.isRequired,$().func.isRequired,$().func.isRequired,$().func.isRequired,E.propTypes={providerStorageAlias:$().string.isRequired,providerDisplayAlias:$().string.isRequired,modelAliases:$().object.isRequired,customModels:$().arrayOf($().object),copied:$().string,onCopy:$().func.isRequired,onDeleteAlias:$().func.isRequired,onAddCustomModel:$().func.isRequired,onDeleteCustomModel:$().func.isRequired,connections:$().arrayOf($().shape({id:$().string,isActive:$().bool})).isRequired,isAnthropic:$().bool};var I=s(70217);function D({until:e}){let[t,s]=(0,i.useState)("");return((0,i.useEffect)(()=>{let t=()=>{let t=new Date(e).getTime()-Date.now();if(t<=0)return void s("");let a=Math.floor(t/1e3);if(a<60)s(`${a}s`);else if(a<3600)s(`${Math.floor(a/60)}m ${a%60}s`);else{let e=Math.floor(a/3600),t=Math.floor(a%3600/60);s(`${e}h ${t}m`)}};t();let a=setInterval(t,1e3);return()=>clearInterval(a)},[e]),t)?(0,a.jsxs)("span",{className:"text-xs text-orange-500 font-mono",children:["⏱ ",t]}):null}function R({connection:e,proxyPools:t,isOAuth:s,isFirst:l,isLast:r,onMoveUp:n,onMoveDown:o,onToggleActive:d,onUpdateProxy:m,onEdit:p,onDelete:u,oneByOneStatus:x=null,autoPing:h=null}){let[f,g]=(0,i.useState)(!1),[y,b]=(0,i.useState)(!1),v=(0,i.useRef)(null),j=new Map((t||[]).map(e=>[e.id,e])),k=e.providerSpecificData?.proxyPoolId||null,w=k?j.get(k):null,N=e.providerSpecificData?.connectionProxyEnabled===!0&&!!e.providerSpecificData?.connectionProxyUrl,C=!!k||N,S=w?`Pool: ${w.name}`:k?`Pool: ${k} (inactive/missing)`:N?`Legacy: ${e.providerSpecificData?.connectionProxyUrl}`:"",A=h?.provider==="codex"?"Auto-starts the next 5h Codex window after reset by sending a tiny gpt-5.5 request. Consumes a small amount of quota.":"When your 5h quota runs out, auto-sends a request the moment it resets so a new window starts right away.",T="";if(w?.proxyUrl||e.providerSpecificData?.connectionProxyUrl){let t=w?.proxyUrl||e.providerSpecificData?.connectionProxyUrl;try{let e=new URL(t);T=`${e.protocol}//${e.hostname}${e.port?`:${e.port}`:""}`}catch{T=t}}let $=w?.noProxy||e.providerSpecificData?.connectionNoProxy||"",O="default";w?.isActive===!0?O="success":(k||N)&&(O="error"),(0,i.useEffect)(()=>{if(!f)return;let e=e=>{v.current&&!v.current.contains(e.target)&&g(!1)};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[f]);let P=async e=>{b(!0);try{await m("__none__"===e?null:e)}finally{b(!1),g(!1)}},E=e.authType||(s?"oauth":"apikey"),_="oauth"===E,q="cookie"===E,U=e.name?.trim()||e.email?.trim()||e.displayName?.trim()||(_?"OAuth Account":q?"Cookie Account":"API Key"),z=e.name?.trim()&&e.email?.trim()&&e.name.trim()!==e.email.trim()?e.email.trim():e.name?.trim()&&e.displayName?.trim()&&e.name.trim()!==e.displayName.trim()?e.displayName.trim():null,[K,M]=(0,i.useState)(!1),J=Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>!!e).sort()[0]||null;(0,i.useEffect)(()=>{let t=()=>{M(!!Object.entries(e).filter(([e])=>e.startsWith("modelLock_")).map(([,e])=>e).filter(e=>e&&new Date(e).getTime()>Date.now()).sort()[0])};t();let s=J?setInterval(t,1e3):null;return()=>{s&&clearInterval(s)}},[J]);let F="unavailable"!==e.testStatus||K?e.testStatus:"active",L=()=>x?"queued"===x.state?"queued":"testing"===x.state?"testing":"success"===x.state?"success":"failed"===x.state?x.error?`failed: ${x.error}`:"failed":null:null;return(0,a.jsxs)("div",{className:`group flex min-w-0 flex-col gap-3 rounded-lg p-2 transition-colors hover:bg-black/[0.02] dark:hover:bg-white/[0.02] sm:flex-row sm:items-center sm:justify-between ${!1===e.isActive?"opacity-60":""}`,children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-start gap-2 sm:items-center sm:gap-3",children:[(0,a.jsxs)("div",{className:"flex shrink-0 flex-col",children:[(0,a.jsx)("button",{onClick:n,disabled:l,className:`p-0.5 rounded ${l?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_up"})}),(0,a.jsx)("button",{onClick:o,disabled:r,className:`p-0.5 rounded ${r?"text-text-muted/30 cursor-not-allowed":"hover:bg-sidebar text-text-muted hover:text-primary"}`,children:(0,a.jsx)("span",{className:"material-symbols-outlined text-sm",children:"keyboard_arrow_down"})})]}),(0,a.jsx)("span",{className:"material-symbols-outlined shrink-0 text-base text-text-muted",children:q?"cookie":_?"lock":"key"}),(0,a.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,a.jsx)("p",{className:"text-sm font-medium truncate",children:U}),z&&(0,a.jsx)("p",{className:"text-xs text-text-muted truncate",children:z}),(0,a.jsxs)("div",{className:"mt-1 flex min-w-0 flex-wrap items-center gap-1.5 sm:gap-2",children:[(0,a.jsx)(c.Ex,{variant:(0,I.g)(e.isActive,F),size:"sm",dot:!0,children:!1===e.isActive?"disabled":F||"Unknown"}),(0,a.jsx)(c.Ex,{variant:"default",size:"sm",children:_?"OAuth":q?"Cookie":"API Key"}),C&&(0,a.jsx)(c.Ex,{variant:O,size:"sm",children:"Proxy"}),K&&!1!==e.isActive&&(0,a.jsx)(D,{until:J}),e.lastError&&!1!==e.isActive&&(0,a.jsx)("span",{className:"max-w-full truncate text-xs text-red-500 sm:max-w-[300px]",title:e.lastError,children:e.lastError}),(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["#",e.priority]}),e.globalPriority&&(0,a.jsxs)("span",{className:"text-xs text-text-muted",children:["Auto: ",e.globalPriority]}),L()&&(0,a.jsx)(c.Ex,{variant:x?"success"===x.state?"success":"failed"===x.state?"error":"testing"===x.state?"primary":"default":"default",size:"sm",children:L()})]}),C&&(0,a.jsxs)("div",{className:"mt-1 flex items-center gap-2 flex-wrap",children:[(0,a.jsx)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[420px]",title:S,children:S}),T&&(0,a.jsx)("code",{className:"max-w-full truncate rounded bg-black/5 px-1 py-0.5 font-mono text-[10px] text-text-muted dark:bg-white/5 sm:max-w-[260px]",children:T}),$&&(0,a.jsxs)("span",{className:"max-w-full truncate text-[11px] text-text-muted sm:max-w-[320px]",title:$,children:["no_proxy: ",$]})]})]})]}),(0,a.jsxs)("div",{className:"flex w-full items-center justify-between gap-2 sm:w-auto sm:justify-end",children:[(0,a.jsxs)("div",{className:"grid flex-1 grid-cols-3 gap-1 sm:flex sm:flex-none",children:[(t||[]).length>0&&(0,a.jsxs)("div",{className:"relative",ref:v,children:[(0,a.jsxs)("button",{onClick:()=>g(e=>!e),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${C?"text-primary":"text-text-muted hover:text-primary"}`,disabled:y,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:y?"progress_activity":"lan"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Proxy"})]}),f&&(0,a.jsxs)("div",{className:"absolute right-0 top-full z-50 mt-1 max-w-[78vw] min-w-[160px] rounded-lg border border-border bg-bg py-1 shadow-lg",children:[(0,a.jsx)("button",{onClick:()=>P("__none__"),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${!k?"text-primary font-medium":"text-text-main"}`,children:"None"}),(t||[]).map(e=>(0,a.jsx)("button",{onClick:()=>P(e.id),className:`w-full text-left px-3 py-1.5 text-sm hover:bg-black/5 dark:hover:bg-white/5 ${k===e.id?"text-primary font-medium":"text-text-main"}`,children:e.name},e.id))]})]}),h&&(0,a.jsx)(c.m_,{text:A,children:(0,a.jsxs)("button",{onClick:()=>h.onToggle(!h.on),className:`flex w-full flex-col items-center rounded px-2 py-1 transition-colors hover:bg-black/5 dark:hover:bg-white/5 ${h.on?"text-primary":"text-text-muted hover:text-primary"}`,children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"bolt"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Auto-ping"})]})}),(0,a.jsxs)("button",{onClick:p,className:"flex flex-col items-center rounded px-2 py-1 text-text-muted hover:bg-black/5 hover:text-primary dark:hover:bg-white/5",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"edit"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Edit"})]}),(0,a.jsxs)("button",{onClick:u,className:"flex flex-col items-center rounded px-2 py-1 text-red-500 hover:bg-red-500/10",children:[(0,a.jsx)("span",{className:"material-symbols-outlined text-[18px]",children:"delete"}),(0,a.jsx)("span",{className:"text-[10px] leading-tight",children:"Delete"})]})]}),(0,a.jsx)(c.lM,{size:"sm",checked:e.isActive??!0,onChange:d,title:e.isActive??!0?"Disable connection":"Enable connection"})]})]})}D.propTypes={until:$().string.isRequired},R.propTypes={connection:$().shape({id:$().string,name:$().string,email:$().string,displayName:$().string,modelLockUntil:$().string,testStatus:$().string,isActive:$().bool,lastError:$().string,priority:$().number,globalPriority:$().number}).isRequired,proxyPools:$().arrayOf($().shape({id:$().string,name:$().string,proxyUrl:$().string,noProxy:$().string,isActive:$().bool})),isOAuth:$().bool.isRequired,isFirst:$().bool.isRequired,isLast:$().bool.isRequired,onMoveUp:$().func.isRequired,onMoveDown:$().func.isRequired,onToggleActive:$().func.isRequired,onUpdateProxy:$().func,onEdit:$().func.isRequired,onDelete:$().func.isRequired,oneByOneStatus:$().shape({state:$().string,error:$().string}),autoPing:$().shape({on:$().bool,onToggle:$().func,provider:$().string})};let _=[{value:"daily-only",label:"Daily only",hint:"Host resmi IDE saja. Paling sedikit risiko 403, tapi tidak ada cadangan saat daily kehabisan kapasitas.",urls:["daily-cloudcode-pa.googleapis.com"]},{value:"daily-autopush",label:"Daily + Autopush",hint:"Daily dulu, satu pool sandbox sebagai cadangan kapasitas.",urls:["daily-cloudcode-pa.googleapis.com","autopush-cloudcode-pa.sandbox.googleapis.com"]},{value:"all-hosts",label:"Semua host (default)",hint:"Daily dulu, lalu dua pool sandbox. Kapasitas maksimum.",urls:["daily-cloudcode-pa.googleapis.com","autopush-cloudcode-pa.sandbox.googleapis.com","staging-cloudcode-pa.sandbox.googleapis.com"]}];function q(){let[e,t]=(0,i.useState)("all-hosts"),[s,l]=(0,i.useState)(!1),[r,n]=(0,i.useState)(""),[o,d]=(0,i.useState)(!1);(0,i.useEffect)(()=>{let e=!1;return fetch("/api/settings",{cache:"no-store"}).then(e=>e.json()).then(s=>{e||(t(s?.antigravityHostMode||"all-hosts"),d(!0))}).catch(()=>d(!0)),()=>{e=!0}},[]);let m=async s=>{l(!0),n(""),t(s);try{let e=await fetch("/api/settings",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({antigravityHostMode:s})});if(!e.ok)throw Error(`HTTP ${e.status}`);n("Tersimpan — berlaku pada request berikutnya.")}catch(s){t(e),n(`Gagal menyimpan: ${s.message}`)}finally{l(!1)}},p=_.find(t=>t.value===e)||_[0];return(0,a.jsxs)(c.Zp,{children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[(0,a.jsxs)("div",{className:"min-w-0",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Host Antigravity"}),(0,a.jsx)("p",{className:"text-sm text-text-muted",children:"Host mana yang dicoba, berurut. Berlaku pada request berikutnya — tanpa restart."})]}),(0,a.jsxs)(c.Ex,{variant:"daily-only"===e?"success":"info",children:[p.urls.length," host"]})]}),(0,a.jsx)(c.l6,{label:"Mode host",value:e,disabled:s||!o,onChange:e=>m(e.target.value),options:_.map(e=>({value:e.value,label:e.label}))}),(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted",children:p.hint}),(0,a.jsx)("div",{className:"mt-3 flex flex-wrap gap-2",children:p.urls.map((e,t)=>(0,a.jsxs)("span",{className:"rounded border border-border-subtle bg-bg-subtle px-2 py-1 font-mono text-xs text-text-muted",children:[t+1,". ",e.replace(".googleapis.com","")]},e))}),"daily-only"!==e&&(0,a.jsxs)("p",{className:"mt-3 rounded border border-yellow-500/30 bg-yellow-500/10 px-3 py-2 text-xs text-text-muted",children:["Host sandbox memberlakukan gerbang tambahan: request dengan project yang tidak dikenali ditolak ",(0,a.jsx)("span",{className:"font-mono",children:"403 SUBSCRIPTION_REQUIRED (#3501)"}),". Kalau muncul error itu, kembali ke ",(0,a.jsx)("strong",{children:"Daily only"}),"."]}),r&&(0,a.jsx)("p",{className:"mt-2 text-sm text-text-muted",children:r})]})}let U=`name1|sk-key1
2
2
  name2|sk-key2
3
3
  sk-key-only-auto-named`;function z({isOpen:e,provider:t,providerName:s,isCompatible:l,isAnthropic:r,authType:n,authHint:o,website:d,proxyPools:p,error:u,existingNames:x,onSave:h,onBulkDone:f,onClose:g}){let y="__none__",b="ollama-local"===t,v="cookie"===n,j="xai"===t&&!v,k=v?"Cookie Value":"qoder"===t?"Personal Access Token (PAT)":"API Key",w="azure"===t,N="cloudflare-ai"===t,C=m.Q2?.[t]?.regions||null,S=m.Q2?.[t]?.defaultRegion||C?.[0]?.id||"",[A,T]=(0,i.useState)({name:"",apiKey:"",defaultModel:"",priority:1,proxyPoolId:y,ollamaHostUrl:""}),[$,O]=(0,i.useState)({azureEndpoint:"",apiVersion:"2024-10-01-preview",deployment:"",organization:""}),[P,E]=(0,i.useState)({accountId:""}),[I,D]=(0,i.useState)(S),[R,_]=(0,i.useState)(!1),[q,K]=(0,i.useState)(null),[M,J]=(0,i.useState)(!1),F=N?`name1|sk-key1|acc123456
4
4
  name2|sk-key2|def789012
package/app/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "9router-app",
3
- "version": "0.5.97",
3
+ "version": "0.5.99",
4
4
  "description": "9Router web dashboard",
5
5
  "private": true,
6
6
  "scripts": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "9router-imagefix",
3
- "version": "0.5.97",
3
+ "version": "0.5.99",
4
4
  "description": "9Router CLI - Start and manage 9Router server (with image fix)",
5
5
  "bin": {
6
6
  "9router-imagefix": "./cli.js"