@kaitranntt/ccs 7.74.0 → 7.75.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/services/profile-writer.d.ts +1 -1
- package/dist/api/services/profile-writer.d.ts.map +1 -1
- package/dist/api/services/profile-writer.js +11 -5
- package/dist/api/services/profile-writer.js.map +1 -1
- package/dist/bin/ccsxp-runtime.d.ts +8 -0
- package/dist/bin/ccsxp-runtime.d.ts.map +1 -1
- package/dist/bin/ccsxp-runtime.js +60 -3
- package/dist/bin/ccsxp-runtime.js.map +1 -1
- package/dist/ccs.js +4 -2
- package/dist/ccs.js.map +1 -1
- package/dist/cliproxy/account-safety.d.ts.map +1 -1
- package/dist/cliproxy/account-safety.js +6 -1
- package/dist/cliproxy/account-safety.js.map +1 -1
- package/dist/cliproxy/ai-providers/service.d.ts.map +1 -1
- package/dist/cliproxy/ai-providers/service.js +10 -3
- package/dist/cliproxy/ai-providers/service.js.map +1 -1
- package/dist/cliproxy/binary/lifecycle.d.ts.map +1 -1
- package/dist/cliproxy/binary/lifecycle.js +2 -1
- package/dist/cliproxy/binary/lifecycle.js.map +1 -1
- package/dist/cliproxy/codex-plan-compatibility.d.ts.map +1 -1
- package/dist/cliproxy/codex-plan-compatibility.js +1 -0
- package/dist/cliproxy/codex-plan-compatibility.js.map +1 -1
- package/dist/cliproxy/config/generator.d.ts +2 -1
- package/dist/cliproxy/config/generator.d.ts.map +1 -1
- package/dist/cliproxy/config/generator.js +25 -1
- package/dist/cliproxy/config/generator.js.map +1 -1
- package/dist/cliproxy/executor/index.d.ts +5 -0
- package/dist/cliproxy/executor/index.d.ts.map +1 -1
- package/dist/cliproxy/executor/index.js +22 -6
- package/dist/cliproxy/executor/index.js.map +1 -1
- package/dist/cliproxy/executor/retry-handler.js +2 -2
- package/dist/cliproxy/executor/retry-handler.js.map +1 -1
- package/dist/cliproxy/management-api-client.d.ts.map +1 -1
- package/dist/cliproxy/management-api-client.js +3 -2
- package/dist/cliproxy/management-api-client.js.map +1 -1
- package/dist/cliproxy/model-catalog.d.ts.map +1 -1
- package/dist/cliproxy/model-catalog.js +12 -0
- package/dist/cliproxy/model-catalog.js.map +1 -1
- package/dist/cliproxy/quota-fetcher-claude-normalizer.d.ts.map +1 -1
- package/dist/cliproxy/quota-fetcher-claude-normalizer.js +16 -12
- package/dist/cliproxy/quota-fetcher-claude-normalizer.js.map +1 -1
- package/dist/cliproxy/quota-fetcher-codex.d.ts +18 -3
- package/dist/cliproxy/quota-fetcher-codex.d.ts.map +1 -1
- package/dist/cliproxy/quota-fetcher-codex.js +74 -24
- package/dist/cliproxy/quota-fetcher-codex.js.map +1 -1
- package/dist/cliproxy/quota-fetcher-ghcp.d.ts.map +1 -1
- package/dist/cliproxy/quota-fetcher-ghcp.js +19 -8
- package/dist/cliproxy/quota-fetcher-ghcp.js.map +1 -1
- package/dist/cliproxy/quota-manager.d.ts +5 -2
- package/dist/cliproxy/quota-manager.d.ts.map +1 -1
- package/dist/cliproxy/quota-manager.js +177 -63
- package/dist/cliproxy/quota-manager.js.map +1 -1
- package/dist/cliproxy/quota-types.d.ts +16 -2
- package/dist/cliproxy/quota-types.d.ts.map +1 -1
- package/dist/cliproxy/routing-strategy-http.d.ts +1 -0
- package/dist/cliproxy/routing-strategy-http.d.ts.map +1 -1
- package/dist/cliproxy/routing-strategy-http.js +7 -2
- package/dist/cliproxy/routing-strategy-http.js.map +1 -1
- package/dist/cliproxy/routing-strategy.d.ts +23 -0
- package/dist/cliproxy/routing-strategy.d.ts.map +1 -1
- package/dist/cliproxy/routing-strategy.js +148 -2
- package/dist/cliproxy/routing-strategy.js.map +1 -1
- package/dist/cliproxy/service-manager.d.ts +17 -1
- package/dist/cliproxy/service-manager.d.ts.map +1 -1
- package/dist/cliproxy/service-manager.js +10 -5
- package/dist/cliproxy/service-manager.js.map +1 -1
- package/dist/cliproxy/sync/profile-mapper.d.ts.map +1 -1
- package/dist/cliproxy/sync/profile-mapper.js +21 -0
- package/dist/cliproxy/sync/profile-mapper.js.map +1 -1
- package/dist/cliproxy/types.d.ts +11 -0
- package/dist/cliproxy/types.d.ts.map +1 -1
- package/dist/cliproxy/types.js.map +1 -1
- package/dist/commands/api-command/create-command.d.ts.map +1 -1
- package/dist/commands/api-command/create-command.js +4 -1
- package/dist/commands/api-command/create-command.js.map +1 -1
- package/dist/commands/api-command/help.d.ts.map +1 -1
- package/dist/commands/api-command/help.js +4 -0
- package/dist/commands/api-command/help.js.map +1 -1
- package/dist/commands/api-command/shared.d.ts +2 -1
- package/dist/commands/api-command/shared.d.ts.map +1 -1
- package/dist/commands/api-command/shared.js +9 -0
- package/dist/commands/api-command/shared.js.map +1 -1
- package/dist/commands/cliproxy/help-subcommand.d.ts.map +1 -1
- package/dist/commands/cliproxy/help-subcommand.js +3 -1
- package/dist/commands/cliproxy/help-subcommand.js.map +1 -1
- package/dist/commands/cliproxy/index.d.ts.map +1 -1
- package/dist/commands/cliproxy/index.js +12 -0
- package/dist/commands/cliproxy/index.js.map +1 -1
- package/dist/commands/cliproxy/quota-subcommand.d.ts.map +1 -1
- package/dist/commands/cliproxy/quota-subcommand.js +79 -23
- package/dist/commands/cliproxy/quota-subcommand.js.map +1 -1
- package/dist/commands/cliproxy/routing-subcommand.d.ts +3 -0
- package/dist/commands/cliproxy/routing-subcommand.d.ts.map +1 -1
- package/dist/commands/cliproxy/routing-subcommand.js +127 -2
- package/dist/commands/cliproxy/routing-subcommand.js.map +1 -1
- package/dist/commands/command-catalog.d.ts.map +1 -1
- package/dist/commands/command-catalog.js +4 -1
- package/dist/commands/command-catalog.js.map +1 -1
- package/dist/commands/completion-backend.d.ts.map +1 -1
- package/dist/commands/completion-backend.js +16 -1
- package/dist/commands/completion-backend.js.map +1 -1
- package/dist/commands/config-dashboard-host.d.ts.map +1 -1
- package/dist/commands/config-dashboard-host.js +14 -2
- package/dist/commands/config-dashboard-host.js.map +1 -1
- package/dist/config/unified-config-loader.d.ts.map +1 -1
- package/dist/config/unified-config-loader.js +26 -0
- package/dist/config/unified-config-loader.js.map +1 -1
- package/dist/config/unified-config-types.d.ts +4 -0
- package/dist/config/unified-config-types.d.ts.map +1 -1
- package/dist/config/unified-config-types.js +2 -0
- package/dist/config/unified-config-types.js.map +1 -1
- package/dist/delegation/headless-executor.d.ts.map +1 -1
- package/dist/delegation/headless-executor.js +17 -2
- package/dist/delegation/headless-executor.js.map +1 -1
- package/dist/proxy/transformers/request-transformer.d.ts.map +1 -1
- package/dist/proxy/transformers/request-transformer.js +0 -8
- package/dist/proxy/transformers/request-transformer.js.map +1 -1
- package/dist/targets/target-metadata.js +1 -1
- package/dist/targets/target-metadata.js.map +1 -1
- package/dist/ui/assets/{accounts-D0Z5AVKW.js → accounts-CP_Nosd7.js} +1 -1
- package/dist/ui/assets/{alert-dialog-CzJucE0e.js → alert-dialog-CjnZBDj3.js} +1 -1
- package/dist/ui/assets/{api-DXAf4i-v.js → api-B7mmrAjt.js} +1 -1
- package/dist/ui/assets/{auth-section-BrnnHBi-.js → auth-section-BFQ8Mu15.js} +1 -1
- package/dist/ui/assets/{backups-section-DCBcfZ-C.js → backups-section-CPwm9q19.js} +1 -1
- package/dist/ui/assets/{channels-BSapONLx.js → channels-B2colnY7.js} +1 -1
- package/dist/ui/assets/{checkbox-Bd7X5Xud.js → checkbox-BAMXPp68.js} +1 -1
- package/dist/ui/assets/{claude-extension-BYJxm4B5.js → claude-extension-BDVoXHr-.js} +1 -1
- package/dist/ui/assets/{cliproxy-G5JuFm2j.js → cliproxy-CuLlmDu7.js} +1 -1
- package/dist/ui/assets/{cliproxy-ai-providers-D7r2Us_Y.js → cliproxy-ai-providers-8dH1cHVk.js} +1 -1
- package/dist/ui/assets/{cliproxy-control-panel-Cmo3ArVL.js → cliproxy-control-panel-CC8HzA8e.js} +1 -1
- package/dist/ui/assets/codex-C6Q9rOwp.js +27 -0
- package/dist/ui/assets/{confirm-dialog--zJgz4y0.js → confirm-dialog-D0VQlM7B.js} +1 -1
- package/dist/ui/assets/{copilot-2ARJ9YVb.js → copilot-CgG2oaRV.js} +1 -1
- package/dist/ui/assets/{cursor-CQNCrVt0.js → cursor-CE1giQU2.js} +1 -1
- package/dist/ui/assets/{droid-Dl5wRjDv.js → droid-FG2w7nRu.js} +1 -1
- package/dist/ui/assets/{globalenv-section-T1imQsSA.js → globalenv-section-BJbBud4W.js} +1 -1
- package/dist/ui/assets/health-Dh7o4wt7.js +1 -0
- package/dist/ui/assets/index-0mNJhDEG.js +72 -0
- package/dist/ui/assets/{index-CqJFugM4.js → index-B6bIHdvz.js} +1 -1
- package/dist/ui/assets/{index-DH916Tyi.js → index-BNTqP5R7.js} +1 -1
- package/dist/ui/assets/index-BNW5qVXZ.js +1 -0
- package/dist/ui/assets/{index-fV5BBuAO.js → index-Bj8UFR7b.js} +1 -1
- package/dist/ui/assets/index-DM5Khyln.css +1 -0
- package/dist/ui/assets/{index-DFgCoUVv.js → index-DTAdzUUA.js} +1 -1
- package/dist/ui/assets/index-X21iqV9e.js +1 -0
- package/dist/ui/assets/{logs-CZsWbq7X.js → logs-CxwEaeVS.js} +1 -1
- package/dist/ui/assets/masked-input-DygH0M2a.js +1 -0
- package/dist/ui/assets/proxy-g4_N-fbB.js +9 -0
- package/dist/ui/assets/proxy-status-widget-BWjGFUas.js +1 -0
- package/dist/ui/assets/{raw-json-settings-editor-panel-DNmb_vR-.js → raw-json-settings-editor-panel-DYpsr-1d.js} +1 -1
- package/dist/ui/assets/{searchable-select--iFe00dY.js → searchable-select-BKx31cCH.js} +1 -1
- package/dist/ui/assets/{separator-CaGbNw8E.js → separator-mG07scBE.js} +1 -1
- package/dist/ui/assets/{shared-Cgk48Wu3.js → shared-hbFOfnWU.js} +1 -1
- package/dist/ui/assets/{table-CKuoPAz4.js → table-DoECcNZ-.js} +1 -1
- package/dist/ui/assets/updates-BSeFQRwL.js +1 -0
- package/dist/ui/index.html +2 -2
- package/dist/utils/openai-compat-launch-settings.d.ts +7 -0
- package/dist/utils/openai-compat-launch-settings.d.ts.map +1 -0
- package/dist/utils/openai-compat-launch-settings.js +61 -0
- package/dist/utils/openai-compat-launch-settings.js.map +1 -0
- package/dist/utils/shell-executor.d.ts +1 -1
- package/dist/utils/shell-executor.d.ts.map +1 -1
- package/dist/utils/shell-executor.js +11 -1
- package/dist/utils/shell-executor.js.map +1 -1
- package/dist/web-server/jsonl-parser.d.ts.map +1 -1
- package/dist/web-server/jsonl-parser.js +22 -4
- package/dist/web-server/jsonl-parser.js.map +1 -1
- package/dist/web-server/model-pricing.d.ts +8 -6
- package/dist/web-server/model-pricing.d.ts.map +1 -1
- package/dist/web-server/model-pricing.js +80 -29
- package/dist/web-server/model-pricing.js.map +1 -1
- package/dist/web-server/models-dev/pricing-resolver.d.ts +18 -0
- package/dist/web-server/models-dev/pricing-resolver.d.ts.map +1 -0
- package/dist/web-server/models-dev/pricing-resolver.js +153 -0
- package/dist/web-server/models-dev/pricing-resolver.js.map +1 -0
- package/dist/web-server/models-dev/registry-cache.d.ts +19 -0
- package/dist/web-server/models-dev/registry-cache.d.ts.map +1 -0
- package/dist/web-server/models-dev/registry-cache.js +155 -0
- package/dist/web-server/models-dev/registry-cache.js.map +1 -0
- package/dist/web-server/models-dev/types.d.ts +39 -0
- package/dist/web-server/models-dev/types.d.ts.map +1 -0
- package/dist/web-server/models-dev/types.js +3 -0
- package/dist/web-server/models-dev/types.js.map +1 -0
- package/dist/web-server/routes/cliproxy-routing-routes.d.ts.map +1 -1
- package/dist/web-server/routes/cliproxy-routing-routes.js +35 -0
- package/dist/web-server/routes/cliproxy-routing-routes.js.map +1 -1
- package/dist/web-server/routes/profile-routes.d.ts.map +1 -1
- package/dist/web-server/routes/profile-routes.js +13 -3
- package/dist/web-server/routes/profile-routes.js.map +1 -1
- package/dist/web-server/routes/route-helpers.d.ts +1 -0
- package/dist/web-server/routes/route-helpers.d.ts.map +1 -1
- package/dist/web-server/routes/route-helpers.js +11 -0
- package/dist/web-server/routes/route-helpers.js.map +1 -1
- package/dist/web-server/usage/aggregator.d.ts +1 -0
- package/dist/web-server/usage/aggregator.d.ts.map +1 -1
- package/dist/web-server/usage/aggregator.js +121 -20
- package/dist/web-server/usage/aggregator.js.map +1 -1
- package/dist/web-server/usage/cliproxy-usage-syncer.d.ts +0 -15
- package/dist/web-server/usage/cliproxy-usage-syncer.d.ts.map +1 -1
- package/dist/web-server/usage/cliproxy-usage-syncer.js +159 -55
- package/dist/web-server/usage/cliproxy-usage-syncer.js.map +1 -1
- package/dist/web-server/usage/cliproxy-usage-transformer.d.ts +23 -7
- package/dist/web-server/usage/cliproxy-usage-transformer.d.ts.map +1 -1
- package/dist/web-server/usage/cliproxy-usage-transformer.js +191 -28
- package/dist/web-server/usage/cliproxy-usage-transformer.js.map +1 -1
- package/dist/web-server/usage/codex-native-usage-collector.d.ts +11 -0
- package/dist/web-server/usage/codex-native-usage-collector.d.ts.map +1 -0
- package/dist/web-server/usage/codex-native-usage-collector.js +177 -0
- package/dist/web-server/usage/codex-native-usage-collector.js.map +1 -0
- package/dist/web-server/usage/data-aggregator.d.ts.map +1 -1
- package/dist/web-server/usage/data-aggregator.js +45 -46
- package/dist/web-server/usage/data-aggregator.js.map +1 -1
- package/dist/web-server/usage/droid-native-usage-collector.d.ts +14 -0
- package/dist/web-server/usage/droid-native-usage-collector.d.ts.map +1 -0
- package/dist/web-server/usage/droid-native-usage-collector.js +201 -0
- package/dist/web-server/usage/droid-native-usage-collector.js.map +1 -0
- package/dist/web-server/usage/handlers.d.ts +1 -0
- package/dist/web-server/usage/handlers.d.ts.map +1 -1
- package/dist/web-server/usage/handlers.js +155 -45
- package/dist/web-server/usage/handlers.js.map +1 -1
- package/dist/web-server/usage/model-identity.d.ts +16 -0
- package/dist/web-server/usage/model-identity.d.ts.map +1 -0
- package/dist/web-server/usage/model-identity.js +70 -0
- package/dist/web-server/usage/model-identity.js.map +1 -0
- package/dist/web-server/usage/sqlite-cli.d.ts +3 -0
- package/dist/web-server/usage/sqlite-cli.d.ts.map +1 -0
- package/dist/web-server/usage/sqlite-cli.js +62 -0
- package/dist/web-server/usage/sqlite-cli.js.map +1 -0
- package/dist/web-server/usage/types.d.ts +6 -0
- package/dist/web-server/usage/types.d.ts.map +1 -1
- package/lib/mcp/ccs-browser-server.cjs +309 -121
- package/package.json +1 -1
- package/scripts/dev-release.sh +4 -2
- package/dist/ui/assets/codex-4VNBJ4Nb.js +0 -27
- package/dist/ui/assets/health-CNous3WN.js +0 -1
- package/dist/ui/assets/index-2X8-14xr.js +0 -72
- package/dist/ui/assets/index-BcLnqcxD.js +0 -1
- package/dist/ui/assets/index-Be3dhMW3.js +0 -9
- package/dist/ui/assets/index-DuTB1_9r.css +0 -1
- package/dist/ui/assets/masked-input-_EkW1Pzo.js +0 -1
- package/dist/ui/assets/proxy-status-widget-D82T2X4F.js +0 -1
- package/dist/ui/assets/updates-Dr8Yq-Pm.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s}from"./radix-ui-Zb8sVEtn.js";import{r}from"./react-vendor-CNOkPC89.js";import{I as i,d as m}from"./index-2X8-14xr.js";import{E as l,g as n}from"./icons-DyorC3Xk.js";function f({label:e,...a}){const[t,o]=r.useState(!1);return s.jsxs("div",{className:"space-y-1",children:[e&&s.jsx("label",{className:"text-sm font-medium",children:e}),s.jsxs("div",{className:"relative",children:[s.jsx(i,{type:t?"text":"password",className:"pr-10 font-mono",...a}),s.jsx(m,{type:"button",variant:"ghost",size:"sm",className:"absolute right-0 top-0 h-full px-3",onClick:()=>o(!t),tabIndex:-1,children:t?s.jsx(l,{className:"w-4 h-4"}):s.jsx(n,{className:"w-4 h-4"})})]})]})}export{f as M};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as t}from"./radix-ui-Zb8sVEtn.js";import{g as Ve,r as w}from"./react-vendor-CNOkPC89.js";import{bB as be,bC as je,bD as ve,bE as $e,bF as M,bG as te,bH as L,bI as Oe,bJ as We,a as ce,c as O,B as H,d as K,bx as _e,aZ as De,bK as Ie,bL as Re,bM as Fe,bN as Le,bO as Ue,bP as Me,bQ as qe,aM as ze,M as Be,O as He,r as Ge,s as Ke,t as Ze,v as Qe,w as Ye,T as Je,p as Xe,q as et,Y as tt}from"./index-2X8-14xr.js";import{A as st,a as nt,b as rt,c as at,d as it,e as ot,f as lt,g as ct}from"./alert-dialog-CzJucE0e.js";import{u as Ne,a as ut,b as dt,h as mt}from"./tanstack-CrmUhA7Z.js";import{t as se}from"./notifications-B2HqRBj7.js";import{be as xe,R as G,t as xt,s as pt,u as gt,A as ft,bf as ht,bg as yt,bh as bt,X as jt,e as vt,bi as Nt,bj as St,U as wt,v as Ct,m as kt,w as At,aF as Et,T as ne,aP as Pt}from"./icons-DyorC3Xk.js";var re,pe;function Tt(){return pe||(pe=1,re={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0}),re}var Vt=Tt();const $t=Ve(Vt);var Ot=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function ge(e){var s={type:"tag",name:"",voidElement:!1,attrs:{},children:[]},n=e.match(/<\/?([^\s]+?)[/\s>]/);if(n&&(s.name=n[1],($t[n[1]]||e.charAt(e.length-2)==="/")&&(s.voidElement=!0),s.name.startsWith("!--"))){var r=e.indexOf("-->");return{type:"comment",comment:r!==-1?e.slice(4,r):""}}for(var a=new RegExp(Ot),i=null;(i=a.exec(e))!==null;)if(i[0].trim())if(i[1]){var o=i[1].trim(),c=[o,""];o.indexOf("=")>-1&&(c=o.split("=")),s.attrs[c[0]]=c[1],a.lastIndex--}else i[2]&&(s.attrs[i[2]]=i[3].trim().substring(1,i[3].length-1));return s}var Wt=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,_t=/^\s*$/,Dt=Object.create(null);function Se(e,s){switch(s.type){case"text":return e+s.content;case"tag":return e+="<"+s.name+(s.attrs?(function(n){var r=[];for(var a in n)r.push(a+'="'+n[a]+'"');return r.length?" "+r.join(" "):""})(s.attrs):"")+(s.voidElement?"/>":">"),s.voidElement?e:e+s.children.reduce(Se,"")+"</"+s.name+">";case"comment":return e+"<!--"+s.comment+"-->"}}var It={parse:function(e,s){s||(s={}),s.components||(s.components=Dt);var n,r=[],a=[],i=-1,o=!1;if(e.indexOf("<")!==0){var c=e.indexOf("<");r.push({type:"text",content:c===-1?e:e.substring(0,c)})}return e.replace(Wt,function(u,d){if(o){if(u!=="</"+n.name+">")return;o=!1}var p,v=u.charAt(1)!=="/",k=u.startsWith("<!--"),h=d+u.length,f=e.charAt(h);if(k){var V=ge(u);return i<0?(r.push(V),r):((p=a[i]).children.push(V),r)}if(v&&(i++,(n=ge(u)).type==="tag"&&s.components[n.name]&&(n.type="component",o=!0),n.voidElement||o||!f||f==="<"||n.children.push({type:"text",content:e.slice(h,e.indexOf("<",h))}),i===0&&r.push(n),(p=a[i-1])&&p.children.push(n),a[i]=n),(!v||n.voidElement)&&(i>-1&&(n.voidElement||n.name===u.slice(2,-1))&&(i--,n=i===-1?r:a[i]),!o&&f!=="<"&&f)){p=i===-1?r:a[i].children;var m=e.indexOf("<",h),x=e.slice(h,m===-1?void 0:m);_t.test(x)&&(x=" "),(m>-1&&i+p.length>=0||x!==" ")&&p.push({type:"text",content:x})}}),r},stringify:function(e){return e.reduce(function(s,n){return s+Se("",n)},"")}};const Q=(e,s)=>{if(!e)return!1;const n=e.props?.children??e.children;return s?n.length>0:!!n},Y=e=>{if(!e)return[];const s=e.props?.children??e.children;return e.props?.i18nIsDynamicList?U(s):s},Rt=e=>Array.isArray(e)&&e.every(w.isValidElement),U=e=>Array.isArray(e)?e:[e],Ft=(e,s)=>{const n={...s};return n.props={...s.props,...e.props},n},Lt=e=>{const s={};if(!e)return s;const n=r=>{U(r).forEach(i=>{M(i)||(Q(i)?n(Y(i)):L(i)&&!w.isValidElement(i)&&Object.assign(s,i))})};return n(e),s},we=(e,s,n,r)=>{if(!e)return"";let a="";const i=U(e),o=s?.transSupportBasicHtmlNodes?s.transKeepBasicHtmlNodesFor??[]:[];return i.forEach((c,u)=>{if(M(c)){a+=`${c}`;return}if(w.isValidElement(c)){const{props:d,type:p}=c,v=Object.keys(d).length,k=o.indexOf(p)>-1,h=d.children;if(!h&&k&&!v){a+=`<${p}/>`;return}if(!h&&(!k||v)||d.i18nIsDynamicList){a+=`<${u}></${u}>`;return}if(k&&v===1&&M(h)){a+=`<${p}>${h}</${p}>`;return}const f=we(h,s,n,r);a+=`<${u}>${f}</${u}>`;return}if(c===null){te(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:r});return}if(L(c)){const{format:d,...p}=c,v=Object.keys(p);if(v.length===1){const k=d?`${v[0]}, ${d}`:v[0];a+=`{{${k}}}`;return}te(n,"TRANS_INVALID_OBJ","Invalid child - Object should only have keys {{ value, format }} (format is optional).",{i18nKey:r,child:c});return}te(n,"TRANS_INVALID_VAR","Passed in a variable like {number} - pass variables for interpolation as full objects like {{number}}.",{i18nKey:r,child:c})}),a},Ut=(e,s=[],n={})=>{if(!e)return e;const r=Object.keys(n),a=[...s,...r];let i="",o=0;for(;o<e.length;)if(e[o]==="<"){let c=!1;const u=e.slice(o).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(u){const d=u[1];(/^\d+$/.test(d)||a.includes(d))&&(c=!0,i+=u[0],o+=u[0].length)}if(!c){const d=e.slice(o).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(d){const p=d[1];(/^\d+$/.test(p)||a.includes(p))&&(c=!0,i+=d[0],o+=d[0].length)}}c||(i+="<",o+=1)}else i+=e[o],o+=1;return i},Mt=(e,s,n,r,a,i,o)=>{if(n==="")return[];const c=a.transKeepBasicHtmlNodesFor||[],u=n&&new RegExp(c.map(g=>`<${g}`).join("|")).test(n);if(!e&&!s&&!u&&!o)return[n];const d=s??{},p=g=>{U(g).forEach(C=>{M(C)||(Q(C)?p(Y(C)):L(C)&&!w.isValidElement(C)&&Object.assign(d,C))})};p(e);const v=Ut(n,c,d),k=It.parse(`<0>${v}</0>`),h={...d,...i},f=(g,N,C)=>{const A=Y(g),$=m(A,N.children,C);return Rt(A)&&$.length===0||g.props?.i18nIsDynamicList?A:$},V=(g,N,C,A,$)=>{g.dummy?(g.children=N,C.push(w.cloneElement(g,{key:A},$?void 0:N))):C.push(...w.Children.map([g],y=>{const l="data-i18n-is-dynamic-list",P={key:A,[l]:void 0};return y&&y.props&&Object.keys(y.props).forEach(E=>{E==="ref"||E==="children"||E==="i18nIsDynamicList"||E===l||(P[E]=y.props[E])}),w.cloneElement(y,P,$?null:N)}))},m=(g,N,C)=>{const A=U(g);return U(N).reduce((y,l,P)=>{const E=l.children?.[0]?.content&&r.services.interpolator.interpolate(l.children[0].content,h,r.language);if(l.type==="tag"){let T=A[parseInt(l.name,10)];!T&&s&&(T=s[l.name]),C.length===1&&!T&&(T=C[0][l.name]),T||(T={});const W={...l.attrs};o&&Object.keys(W).forEach(b=>{const F=W[b];M(F)&&(W[b]=Oe(F))});const j=Object.keys(W).length!==0?Ft({props:W},T):T,_=w.isValidElement(j),D=_&&Q(l,!0)&&!l.voidElement,R=u&&L(j)&&j.dummy&&!_,q=L(s)&&Object.hasOwnProperty.call(s,l.name);if(M(j)){const b=r.services.interpolator.interpolate(j,h,r.language);y.push(b)}else if(Q(j)||D){const b=f(j,l,C);V(j,b,y,P)}else if(R){const b=m(A,l.children,C);V(j,b,y,P)}else if(Number.isNaN(parseFloat(l.name)))if(q){const b=f(j,l,C);V(j,b,y,P,l.voidElement)}else if(a.transSupportBasicHtmlNodes&&c.indexOf(l.name)>-1)if(l.voidElement)y.push(w.createElement(l.name,{key:`${l.name}-${P}`}));else{const b=m(A,l.children,C);y.push(w.createElement(l.name,{key:`${l.name}-${P}`},b))}else if(l.voidElement)y.push(`<${l.name} />`);else{const b=m(A,l.children,C);y.push(`<${l.name}>${b}</${l.name}>`)}else if(L(j)&&!_){const b=l.children[0]?E:null;b&&y.push(b)}else V(j,E,y,P,l.children.length!==1||!E)}else if(l.type==="text"){const T=a.transWrapTextNodes,W=typeof a.unescape=="function"?a.unescape:ve().unescape,j=o?W(r.services.interpolator.interpolate(l.content,h,r.language)):r.services.interpolator.interpolate(l.content,h,r.language);T?y.push(w.createElement(T,{key:`${l.name}-${P}`},j)):y.push(j)}return y},[])},x=m([{dummy:!0,children:e||[]}],k,U(e||[]));return Y(x[0])},Ce=(e,s,n)=>{const r=e.key||s,a=w.cloneElement(e,{key:r});if(!a.props||!a.props.children||n.indexOf(`${s}/>`)<0&&n.indexOf(`${s} />`)<0)return a;function i(){return w.createElement(w.Fragment,null,a)}return w.createElement(i,{key:r})},qt=(e,s)=>e.map((n,r)=>Ce(n,r,s)),zt=(e,s)=>{const n={};return Object.keys(e).forEach(r=>{Object.assign(n,{[r]:Ce(e[r],r,s)})}),n},Bt=(e,s,n,r)=>e?Array.isArray(e)?qt(e,s):L(e)?zt(e,s):(be(n,"TRANS_INVALID_COMPONENTS",'<Trans /> "components" prop expects an object or array',{i18nKey:r}),null):null,Ht=e=>!L(e)||Array.isArray(e)?!1:Object.keys(e).reduce((s,n)=>s&&Number.isNaN(Number.parseFloat(n)),!0);function Gt({children:e,count:s,parent:n,i18nKey:r,context:a,tOptions:i={},values:o,defaults:c,components:u,ns:d,i18n:p,t:v,shouldUnescape:k,...h}){const f=p||je();if(!f)return be(f,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:r}),e;const V=v||f.t.bind(f)||(z=>z),m={...ve(),...f.options?.react};let x=d||V.ns||f.options?.defaultNS;x=M(x)?[x]:x||["translation"];const{transDefaultProps:g}=m,N=g?.tOptions?{...g.tOptions,...i}:i,C=k??g?.shouldUnescape,A=g?.values?{...g.values,...o}:o,$=g?.components?{...g.components,...u}:u,y=we(e,m,f,r),l=c||N?.defaultValue||y||m.transEmptyNodeValue||(typeof r=="function"?$e(r):r),{hashTransKey:P}=m,E=r||(P?P(y||l):y||l);f.options?.interpolation?.defaultVariables?o=A&&Object.keys(A).length>0?{...A,...f.options.interpolation.defaultVariables}:{...f.options.interpolation.defaultVariables}:o=A;const T=Lt(e);T&&typeof T.count=="number"&&s===void 0&&(s=T.count);const W=o||s!==void 0&&!f.options?.interpolation?.alwaysFormat||!e?N.interpolation:{interpolation:{...N.interpolation,prefix:"#$?",suffix:"?$#"}},j={...N,context:a||N.context,count:s,...o,...W,defaultValue:l,ns:x};let _=E?V(E,j):l;_===E&&l&&(_=l);const D=Bt($,_,f,r);let R=D||e,q=null;Ht(D)&&(q=D,R=e);const b=Mt(R,q,_,f,m,j,C),F=n??m.defaultTransParent;return F?w.createElement(F,h,b):b}function fe({children:e,count:s,parent:n,i18nKey:r,context:a,tOptions:i={},values:o,defaults:c,components:u,ns:d,i18n:p,t:v,shouldUnescape:k,...h}){const{i18n:f,defaultNS:V}=w.useContext(We)||{},m=p||f||je(),x=v||m?.t.bind(m);return Gt({children:e,count:s,parent:n,i18nKey:r,context:a,tOptions:i,values:o,defaults:c,components:u,ns:d||x?.ns||V||m?.options?.defaultNS,i18n:m,t:v,shouldUnescape:k,...h})}async function Kt(){const e=await fetch("/api/cliproxy/sync/status");if(!e.ok){let s="Failed to fetch sync status";try{const n=await e.json();s=n.error||n.message||s}catch{}throw new Error(s)}return e.json()}async function Zt(){const e=new AbortController,s=setTimeout(()=>e.abort(),3e4);try{const n=await fetch("/api/cliproxy/sync",{method:"POST",headers:{"Content-Type":"application/json"},signal:e.signal});if(!n.ok){let r="Sync failed";try{const a=await n.json();r=a.error||a.message||r}catch{}throw new Error(r)}return n.json()}catch(n){throw n instanceof Error&&n.name==="AbortError"?new Error("Sync request timed out after 30 seconds"):n}finally{clearTimeout(s)}}function Qt(){return Ne({queryKey:["cliproxy-sync-status"],queryFn:Kt,refetchInterval:3e4,retry:1,staleTime:1e4})}function Yt(){const e=ut(),{t:s}=ce();return dt({mutationFn:Zt,onSuccess:n=>{e.invalidateQueries({queryKey:["cliproxy-sync-status"]}),e.invalidateQueries({queryKey:["cliproxy-sync-preview"]}),n.syncedCount===0?se.info(s("toasts.noProfilesToSync")):se.success(`Synced ${n.syncedCount} profile${n.syncedCount===1?"":"s"} to CLIProxy`)},onError:n=>{se.error(s("toasts.syncFailed",{error:n.message}))}})}function he(e){return e.replace(/-\d+$/,"").split(".").map(Number)}function le(e,s){const n=he(e),r=he(s);for(let a=0;a<3;a+=1){const i=n[a]||0,o=r[a]||0;if(i>o)return 1;if(i<o)return-1}return 0}function ae(e,s){return le(e,s)>0}function ie(e,s,n){return le(e,s)>=0&&le(e,n)<=0}const oe={"round-robin":{title:"Round Robin",description:"Spread requests across matching accounts for even usage."},"fill-first":{title:"Fill First",description:"Drain one healthy account first and keep backups untouched until needed."}};function ye({className:e,compact:s=!1,state:n,isLoading:r,isSaving:a,error:i,onApply:o}){const{t:c}=ce(),u=n?.strategy??"round-robin",[d,p]=w.useState(u),[v,k]=w.useState(!1),h=n?.source==="live"?"Live CLIProxy":"Saved startup default",f=r||a||!n||d===u,V=v?"Hide details":"Show details";if(s){const m=x=>{p(x),x!==u&&o(x)};return t.jsxs("div",{className:O("group/routing flex items-center justify-between mt-1 p-1 -mx-1 rounded-lg transition-colors hover:bg-primary/5",e),children:[t.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-foreground",children:[t.jsxs("div",{className:"relative flex h-6 w-6 shrink-0 items-center justify-center rounded-md bg-background border border-border/60 text-muted-foreground shadow-sm overflow-hidden transition-all duration-300 group-hover/routing:border-primary/40 group-hover/routing:text-primary group-hover/routing:shadow-[0_0_12px_rgba(59,130,246,0.15)] dark:group-hover/routing:shadow-[0_0_12px_rgba(59,130,246,0.1)]",children:[t.jsx("div",{className:"absolute inset-0 bg-primary/10 translate-y-full group-hover/routing:translate-y-0 transition-transform duration-300 ease-out"}),t.jsx(xe,{className:"relative z-10 h-3.5 w-3.5 transition-transform duration-300 group-hover/routing:scale-110"})]}),t.jsx("span",{className:"tracking-tight transition-colors duration-300 group-hover/routing:text-primary group-hover/routing:font-semibold",children:"Routing"}),a&&t.jsx(G,{className:"ml-1 h-3 w-3 shrink-0 animate-spin text-primary"})]}),t.jsxs("div",{className:"relative grid grid-cols-2 p-0.5 gap-0.5 rounded-lg border border-border/60 bg-muted/30 shadow-[inset_0_1px_2px_rgba(0,0,0,0.05)] dark:shadow-[inset_0_1px_3px_rgba(0,0,0,0.2)] transition-colors duration-300 group-hover/routing:border-primary/20 group-hover/routing:bg-primary/5",children:[t.jsx("div",{className:O("absolute inset-y-0.5 left-0.5 w-[calc(50%-0.1875rem)] rounded bg-background shadow-[0_1px_3px_rgba(0,0,0,0.1),0_1px_2px_rgba(0,0,0,0.06)] ring-1 ring-black/5 dark:ring-white/10 transition-all duration-300",d==="fill-first"?"translate-x-[calc(100%+0.125rem)]":"translate-x-0","group-hover/routing:shadow-[0_0_8px_rgba(59,130,246,0.15)] dark:group-hover/routing:shadow-[0_0_8px_rgba(59,130,246,0.1)] group-hover/routing:ring-primary/30"),style:{transitionTimingFunction:"cubic-bezier(0.175, 0.885, 0.32, 1.275)"}}),Object.entries(oe).map(([x,g])=>{const N=d===x;return t.jsx("button",{type:"button",className:O("relative z-10 flex items-center justify-center rounded px-2.5 py-0.5 text-[10px] font-medium whitespace-nowrap transition-colors duration-200",N?"text-foreground group-hover/routing:text-primary":"text-muted-foreground/70 hover:text-foreground/90 group-hover/routing:text-muted-foreground/90"),onClick:()=>m(x),disabled:r||a||!!i,title:g.description,children:g.title},x)})]})]})}return t.jsx("section",{className:O("rounded-xl border border-border/70 bg-background",e),children:t.jsxs("div",{className:"grid gap-3 px-4 py-3 xl:grid-cols-[minmax(0,1fr)_auto] xl:items-start",children:[t.jsxs("div",{className:"min-w-0 space-y-2",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("div",{className:"inline-flex h-7 w-7 items-center justify-center rounded-lg bg-muted text-primary",children:t.jsx(xe,{className:"h-4 w-4"})}),t.jsx("div",{className:"text-sm font-medium",children:c("routingGuidance.routingStrategy")}),t.jsx(H,{variant:"secondary",children:u}),n?t.jsx(H,{variant:"outline",children:h}):null,n?t.jsx(H,{variant:"outline",children:n.target}):null]}),t.jsx("p",{className:"max-w-3xl text-xs leading-5 text-muted-foreground",children:"Proxy-wide account rotation. CCS keeps round-robin as the default until you explicitly change it."})]}),t.jsxs("div",{className:"flex flex-col gap-2 xl:items-end",children:[t.jsx("div",{className:"inline-flex flex-wrap rounded-lg border border-border/70 bg-muted/35 p-1",children:Object.entries(oe).map(([m,x])=>{const g=d===m;return t.jsx("button",{type:"button",className:O("rounded-md px-3 py-1.5 text-sm font-medium transition-colors",g?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>p(m),disabled:r||a||!!i,children:x.title},m)})}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsxs(K,{type:"button",variant:"ghost",size:"sm",className:"h-8 px-2 text-xs text-muted-foreground",onClick:()=>k(m=>!m),children:[v?t.jsx(xt,{className:"mr-1 h-3.5 w-3.5"}):t.jsx(pt,{className:"mr-1 h-3.5 w-3.5"}),V]}),t.jsx(K,{size:"sm",onClick:()=>o(d),disabled:f||!!i,children:a?"Saving...":`Use ${d}`})]})]}),t.jsxs("div",{className:"flex flex-wrap items-center gap-x-2 gap-y-1 text-[11px] text-muted-foreground xl:col-span-2",children:[t.jsx("span",{children:c("routingGuidance.roundRobin")}),t.jsx("span",{className:"hidden text-border sm:inline",children:"•"}),t.jsx("span",{children:c("routingGuidance.fillFirst")})]}),i?t.jsx("div",{className:"rounded-lg border border-destructive/25 bg-destructive/5 px-3 py-2 text-sm xl:col-span-2",children:i.message}):null,!i&&n?.message?t.jsx("div",{className:"rounded-lg border border-border/70 bg-muted/35 px-3 py-2 text-xs text-muted-foreground xl:col-span-2",children:n.message}):null,v?t.jsx("div",{className:"grid gap-4 border-t border-border/60 pt-3 md:grid-cols-2 xl:col-span-2",children:Object.entries(oe).map(([m,x])=>{const g=u===m;return t.jsxs("div",{className:"space-y-1",children:[t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsx("div",{className:"text-sm font-medium",children:x.title}),g?t.jsx(H,{variant:"secondary",children:"Current"}):null]}),t.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:x.description})]},m)})}):null]})})}function Jt(e){if(!e)return"";const s=new Date(e).getTime(),r=Date.now()-s,a=Math.floor(r/(1e3*60*60)),i=Math.floor(r%(1e3*60*60)/(1e3*60));return a>0?`${a}h ${i}m`:`${i}m`}function Xt(e,s){if(!e)return"";const n=Date.now()-e,r=Math.floor(n/(1e3*60)),a=Math.floor(n/(1e3*60*60));return r<1?s("proxyStatusWidget.justNow"):r<60?s("proxyStatusWidget.minutesAgo",{count:r}):s("proxyStatusWidget.hoursAgo",{count:a})}function Z({icon:e,tooltip:s,onClick:n,disabled:r,isPending:a,className:i,variant:o="ghost"}){return t.jsxs(Je,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(K,{variant:o==="destructive-ghost"?"ghost":o,size:"sm",className:O("h-7 w-7 p-0",o==="destructive-ghost"&&"hover:bg-destructive/10 hover:text-destructive hover:border-destructive/30",i),onClick:n,disabled:r,children:a?t.jsx(G,{className:"w-3.5 h-3.5 animate-spin"}):t.jsx(e,{className:"w-3.5 h-3.5"})})}),t.jsx(et,{side:"bottom",className:"text-xs",children:s})]})}function os(){const{t:e}=ce(),{data:s,isLoading:n}=_e(),{data:r}=De(),{data:a,isLoading:i}=Ie(),{data:o,isLoading:c,error:u}=Re(),d=Fe(),p=Le(),v=Ue(),k=Me(),h=qe(),{data:f}=Qt(),{mutate:V,isPending:m}=Yt(),[x,g]=w.useState(!1),[N,C]=w.useState(""),[A,$]=w.useState(!1),[y,l]=w.useState(null),[P,E]=w.useState(null),{data:T}=Ne({queryKey:["cliproxy-server-config"],queryFn:()=>tt.cliproxyServer.get(),staleTime:3e4}),W=mt({mutationKey:["update-backend"]})>0,j=T?.remote,_=j?.enabled&&j?.host,D=s?.running??!1,R=p.isPending||v.isPending||k.isPending||h.isPending||W||m,q=r?.hasUpdate??!1,b=r?.isStable===!1,F=r?.currentVersion,z=f?.configured??!1,ke=e(z?"proxyStatusWidget.syncReady":"proxyStatusWidget.noConfig"),J=b?r?.maxStableVersion||a?.latestStable:r?.latestVersion,ue=a?.maxStableVersion||r?.maxStableVersion||"6.6.80",B=a?.faultyRange,Ae=B&&`${B.min.replace(/-\d+$/,"")}-${B.max.replace(/-\d+$/,"")}`,X=(S,I)=>{l(S),E(I),$(!0)},de=async S=>{if(!S)return;const I=ae(S,ue);if(B!==void 0&&ie(S,B.min,B.max)){X(S,"faulty");return}if(I){X(S,"experimental");return}try{const me=await h.mutateAsync({version:S});me.requiresConfirmation&&X(S,me.isFaulty?"faulty":"experimental")}catch{}},Ee=()=>{y&&h.mutate({version:y,force:!0}),$(!1),l(null),E(null)},Pe=()=>{$(!1),l(null),E(null)},Te=_?(()=>{const S=j.protocol||"http",I=j.port||(S==="https"?443:80);return S==="https"&&I===443||S==="http"&&I===80?j.host:`${j.host}:${I}`})():null;return _?t.jsxs("div",{className:O("rounded-lg border p-3 transition-colors","border-blue-500/30 bg-blue-500/5"),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx(gt,{className:"w-4 h-4 text-blue-500"}),t.jsx("span",{className:"text-sm font-medium",children:e("proxyStatusWidget.remoteProxy")}),t.jsx(H,{variant:"secondary",className:"text-[10px] h-4 px-1.5 bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400",children:e("proxyStatusWidget.active")})]}),t.jsx(ft,{className:"w-3 h-3 text-blue-600"})]}),t.jsxs("div",{className:"mt-2 text-xs text-muted-foreground",children:[t.jsx("div",{className:"flex items-center gap-1 mb-1",children:t.jsx("span",{className:"font-mono",children:Te})}),t.jsx("p",{className:"text-[10px] text-muted-foreground/70 leading-tight",children:e("proxyStatusWidget.trafficAutoRouted")})]}),t.jsx(ye,{compact:!0,className:"mt-3",state:o,isLoading:c,isSaving:d.isPending,error:u instanceof Error?u:null,onApply:S=>d.mutate(S)},`remote:${o?.strategy??"round-robin"}`)]}):t.jsx(ze,{delayDuration:300,children:t.jsxs("div",{className:O("rounded-lg border p-3 transition-colors",D?"border-green-500/30 bg-green-500/5":"border-muted bg-muted/30"),children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("div",{className:O("w-2 h-2 rounded-full",D?"bg-green-500 animate-pulse":"bg-muted-foreground/30")}),t.jsx("span",{className:"text-sm font-medium",children:r?.backendLabel??"CLIProxy"})]}),t.jsxs("div",{className:"flex items-center gap-1",children:[n?t.jsx(G,{className:"w-3 h-3 animate-spin text-muted-foreground"}):D?t.jsxs(t.Fragment,{children:[t.jsx(Z,{icon:m?G:ht,tooltip:e("proxyStatusWidget.tooltipSync"),onClick:()=>V(),disabled:!z||R,isPending:m}),t.jsx(Z,{icon:yt,tooltip:e("proxyStatusWidget.tooltipRestart"),onClick:()=>k.mutate(),disabled:R,isPending:k.isPending}),t.jsx(Z,{icon:bt,tooltip:e("proxyStatusWidget.tooltipStop"),onClick:()=>v.mutate(),disabled:R,isPending:v.isPending,variant:"destructive-ghost"})]}):null,t.jsx(Z,{icon:x?jt:vt,tooltip:e(x?"proxyStatusWidget.tooltipClose":"proxyStatusWidget.tooltipVersionSettings"),onClick:()=>g(!x),className:x?"bg-muted":void 0})]})]}),F&&t.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[t.jsxs("span",{className:O("text-xs font-mono text-muted-foreground",b&&"text-amber-600 dark:text-amber-400"),children:["v",F]}),(q||b)&&J&&t.jsxs(H,{variant:"secondary",className:O("text-[10px] h-4 px-1.5 gap-0.5 cursor-pointer transition-colors",b?"bg-amber-100 text-amber-700 hover:bg-amber-200 dark:bg-amber-900/30 dark:text-amber-400 dark:hover:bg-amber-900/50":"bg-green-100 text-green-700 hover:bg-green-200 dark:bg-green-900/30 dark:text-green-400 dark:hover:bg-green-900/50"),onClick:()=>void de(J),title:e(b?"proxyStatusWidget.clickToDowngrade":"proxyStatusWidget.clickToUpdate"),children:[b?t.jsx(Nt,{className:"w-2.5 h-2.5"}):t.jsx(St,{className:"w-2.5 h-2.5"}),J]})]}),D&&s&&t.jsxs("div",{className:"mt-2 flex items-center gap-4 text-xs text-muted-foreground",children:[t.jsx("span",{className:"flex items-center gap-1",children:e("proxyStatusWidget.port",{port:s.port})}),s.sessionCount!==void 0&&s.sessionCount>0&&t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(wt,{className:"w-3 h-3"}),e("proxyStatusWidget.sessionCount",{count:s.sessionCount})]}),s.startedAt&&t.jsxs("span",{className:"flex items-center gap-1",children:[t.jsx(Ct,{className:"w-3 h-3"}),Jt(s.startedAt)]})]}),t.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs",children:[z?t.jsx(kt,{className:"w-3 h-3 text-green-600 dark:text-green-400"}):t.jsx(At,{className:"w-3 h-3 text-muted-foreground"}),t.jsx("span",{className:O("text-xs",z?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:ke})]}),t.jsx(ye,{compact:!0,className:"mt-3",state:o,isLoading:c,isSaving:d.isPending,error:u instanceof Error?u:null,onApply:S=>d.mutate(S)},`local:${o?.strategy??"round-robin"}`),t.jsx(Be,{open:x,onOpenChange:g,children:t.jsxs(He,{className:"mt-3 pt-3 border-t border-muted",children:[t.jsx("h4",{className:"text-xs font-medium text-muted-foreground mb-3",children:e("proxyStatusWidget.versionManagement")}),t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs(Ge,{value:N,onValueChange:C,disabled:i,children:[t.jsx(Ke,{className:"h-8 text-xs flex-1",children:t.jsx(Ze,{placeholder:e("proxyStatusWidget.selectVersionPlaceholder")})}),t.jsx(Qe,{children:a?.versions.slice(0,20).map(S=>{const I=a?.maxStableVersion&&ae(S,a.maxStableVersion),ee=a?.faultyRange&&ie(S,a.faultyRange.min,a.faultyRange.max);return t.jsx(Ye,{value:S,className:"text-xs",children:t.jsxs("span",{className:"flex items-center gap-2",children:["v",S,S===a.latestStable&&t.jsx("span",{className:"text-green-600 dark:text-green-400",children:e("proxyStatusWidget.stable")}),(ee||I)&&t.jsx("span",{className:"text-amber-600 dark:text-amber-400",children:"⚠"})]})},S)})})]}),t.jsxs(K,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5 px-3",onClick:()=>void de(N),disabled:h.isPending||!N,children:[h.isPending?t.jsx(G,{className:"w-3.5 h-3.5 animate-spin"}):t.jsx(Et,{className:"w-3.5 h-3.5"}),e("proxyStatusWidget.install")]})]}),N&&a?.maxStableVersion&&ae(N,a.maxStableVersion)&&t.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-amber-600 dark:text-amber-400",children:[t.jsx(ne,{className:"w-3.5 h-3.5 flex-shrink-0"}),t.jsx("span",{children:e("proxyStatusWidget.versionsAboveUnstable",{version:a.maxStableVersion})})]}),N&&a?.faultyRange&&ie(N,a.faultyRange.min,a.faultyRange.max)&&t.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-[11px] text-amber-600 dark:text-amber-400",children:[t.jsx(ne,{className:"w-3.5 h-3.5 flex-shrink-0"}),t.jsx("span",{children:e("proxyStatusWidget.versionsKnownIssues",{version:N})})]}),r?.checkedAt&&t.jsx("div",{className:"mt-2 text-[10px] text-muted-foreground/60",children:e("proxyStatusWidget.lastChecked",{time:Xt(r.checkedAt,e)})})]})}),!D&&t.jsxs("div",{className:"mt-2 flex items-center justify-between",children:[t.jsx("span",{className:"text-xs text-muted-foreground",children:e("proxyStatusWidget.notRunning")}),t.jsxs(K,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>p.mutate(),disabled:p.isPending,children:[p.isPending?t.jsx(G,{className:"w-3 h-3 animate-spin"}):t.jsx(Pt,{className:"w-3 h-3"}),e("proxyStatusWidget.start")]})]}),t.jsx(st,{open:A,onOpenChange:$,children:t.jsxs(nt,{children:[t.jsxs(rt,{children:[t.jsxs(at,{className:"flex items-center gap-2",children:[t.jsx(ne,{className:"w-5 h-5 text-amber-500"}),e(P==="faulty"?"proxyStatusWidget.installFaultyTitle":"proxyStatusWidget.installUnstableTitle")]}),t.jsxs(it,{className:"space-y-2",children:[P==="faulty"?t.jsx("p",{children:t.jsx(fe,{i18nKey:"proxyStatusWidget.installFaultyDesc",values:{version:y??"",range:Ae||""},components:{strong:t.jsx("strong",{})}})}):t.jsx("p",{children:t.jsx(fe,{i18nKey:"proxyStatusWidget.installUnstableDesc",values:{version:y??"",maxStable:ue},components:{strong:t.jsx("strong",{})}})}),t.jsx("p",{className:"text-amber-600 dark:text-amber-400",children:e(P==="faulty"?"proxyStatusWidget.installFaultyWarning":"proxyStatusWidget.installUnstableWarning")}),t.jsx("p",{children:e("proxyStatusWidget.installUnstableConfirm")})]})]}),t.jsxs(ot,{children:[t.jsx(lt,{onClick:Pe,children:e("proxyStatusWidget.cancel")}),t.jsx(ct,{onClick:Ee,className:"bg-amber-500 hover:bg-amber-600 text-white",children:e("proxyStatusWidget.installAnyway")})]})]})})]})})}export{os as P};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-Zb8sVEtn.js";import{L,r as c}from"./react-vendor-CNOkPC89.js";import{a as x,B as P,c as S,W as M,d as u,x as U,C,j as v,k as N,_ as w,b as j,n as b,I as B}from"./index-2X8-14xr.js";import{a1 as F,$ as z,b8 as W,x as H,E as Q,Q as G,aa as K,C as q,b9 as J,av as V}from"./icons-DyorC3Xk.js";import"./tanstack-CrmUhA7Z.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";const Y={new:"border-blue-200 bg-blue-50 text-blue-700 dark:border-blue-900/50 dark:bg-blue-900/20 dark:text-blue-300",stable:"border-green-200 bg-green-50 text-green-700 dark:border-green-900/50 dark:bg-green-900/20 dark:text-green-300",planned:"border-amber-200 bg-amber-50 text-amber-700 dark:border-amber-900/50 dark:bg-amber-900/20 dark:text-amber-300"};function Z({status:t,className:s}){const{t:r}=x(),i={new:r("updates.statusNew"),stable:r("updates.statusStable"),planned:r("updates.statusPlanned")};return e.jsx(P,{variant:"outline",className:S("font-medium",Y[t],s),children:i[t]})}const g={target:"Target CLI",cliproxy:"CLIProxy Provider","api-profiles":"API Profile",websearch:"WebSearch"},X=[{id:"codex-target-runtime-support",title:"Native Codex runtime support is live",summary:"Codex now participates as a first-class runtime target through ccs-codex, ccsx, ccsxp, or --target codex.",primaryAction:"Use Codex as a runtime target for native Codex sessions and Codex-routed CLIProxy flows.",publishedAt:"2026-03-28",status:"new",scopes:["target","cliproxy","api-profiles"],entryIds:["codex-target","codex-cliproxy"],highlights:["Use ccs-codex or ccsx for native Codex runs.","Use ccsxp for the built-in CCS Codex provider shortcut on native Codex.","Built-in Codex and Codex bridge profiles can run on native Codex with --target codex.","Saved default targets for API profiles and variants can now be claude, droid, or codex."],actions:[{id:"copy-codex-alias-command",label:"Open native Codex",description:"Launch Codex through the explicit CCS runtime alias.",type:"command",command:"ccs-codex"},{id:"copy-codex-provider-command",label:"Run built-in Codex on Codex",description:"Use the built-in Codex provider shortcut on native Codex.",type:"command",command:'ccsxp "your prompt"'},{id:"copy-codex-provider-command-explicit",label:"Run built-in Codex on Codex (explicit)",description:"Use the explicit built-in Codex provider route on native Codex.",type:"command",command:'ccs codex --target codex "your prompt"'},{id:"open-codex-dashboard",label:"Open Codex dashboard",description:"Review Codex runtime support, config layers, and dashboard setup flows.",type:"route",path:"/codex"}],routes:[{label:"Codex CLI",path:"/codex"}],commands:["ccs-codex","ccsx",'ccsxp "your prompt"','ccs codex --target codex "your prompt"']},{id:"droid-target-support",title:"Factory Droid support is live",summary:"API Profiles and CLIProxy variants now support Droid as a first-class execution target.",primaryAction:"Set Droid as your default execution target for non-Claude workflows.",publishedAt:"2026-02-25",status:"new",scopes:["target","api-profiles","cliproxy"],entryIds:["droid-target","custom-api-profiles","codex-cliproxy","agy-cliproxy"],highlights:["Set default target to Droid when creating or editing API Profiles.","Set default target to Droid for CLIProxy variants, including Codex and Antigravity flows.","Use ccs-droid as the explicit alias, with ccsd kept as the legacy shortcut."],actions:[{id:"open-api-profiles",label:"Set default target in API Profiles",description:"Open API Profiles and set Default Target to Droid for profiles you run often.",type:"route",path:"/providers"},{id:"open-cliproxy",label:"Set default target in CLIProxy variants",description:"Open CLIProxy variants and set target to Droid for Codex/Antigravity or custom variants.",type:"route",path:"/cliproxy"},{id:"copy-ccs-droid-command",label:"Run once with explicit Droid alias",description:"Use ccs-droid to force the Droid target with your current profile.",type:"command",command:"ccs-droid glm"},{id:"copy-target-override",label:"Run once with --target override",description:"Keep your default profile but force Droid for a single command.",type:"command",command:'ccs codex --target droid "your prompt"'}],routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccs-droid glm",'ccs codex --target droid "your prompt"',"ccs cliproxy create mycodex --provider codex --target droid"]},{id:"updates-center-launch",title:"Updates Center is available for rollout tasks",summary:"A focused Updates Center exists for setup tasks and rollout guidance when you need it.",primaryAction:"Use this page only when needed for rollout tasks, then return to your normal workflow.",publishedAt:"2026-02-25",status:"new",scopes:["target","cliproxy","api-profiles","websearch"],entryIds:["droid-target","codex-cliproxy","custom-api-profiles","opencode-websearch"],highlights:["Single data source powers update content and integration mapping.","Notices can be tracked as new, seen, done, or dismissed.","Catalog covers target CLI, CLIProxy providers, and WebSearch integrations."],actions:[{id:"open-updates-page",label:"Open Updates Center when needed",description:"Review rollout tasks only when you want guided setup changes.",type:"route",path:"/updates"},{id:"copy-open-dashboard",label:"Open dashboard from terminal",description:"Re-open config dashboard anytime from CLI.",type:"command",command:"ccs config"}],routes:[{label:"Updates Center",path:"/updates"}],commands:["ccs config"]}],ee=[{id:"claude-target",name:"Claude Code",scope:"target",status:"stable",summary:"Default runtime target for all CCS profile types.",pillars:{baseUrl:"From profile settings (ANTHROPIC_BASE_URL)",auth:"From profile settings (ANTHROPIC_AUTH_TOKEN)",model:"From profile settings (ANTHROPIC_MODEL)"},routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccs",'ccs glm "your prompt"']},{id:"droid-target",name:"Factory Droid",scope:"target",status:"new",summary:"First-class target for API Profiles and CLIProxy variants.",pillars:{baseUrl:"From profile or variant settings",auth:"From profile or variant settings",model:"From profile or variant settings"},routes:[{label:"API Profiles",path:"/providers"},{label:"CLIProxy",path:"/cliproxy"}],commands:["ccs-droid glm","ccs km --target droid","ccs codex --target droid"],notes:"Use ccs-droid as the explicit runtime alias. Legacy ccsd still works."},{id:"codex-target",name:"Codex CLI",scope:"target",status:"new",summary:"First-class runtime target for native Codex sessions and Codex-routed CLIProxy flows.",pillars:{baseUrl:"Native ~/.codex config for default mode, transient -c overrides for CCS-backed routes",auth:"Native Codex auth for default mode, env_key injection for CCS-backed routes",model:"Native Codex config or routed Codex model mapping from CLIProxy"},routes:[{label:"Codex CLI",path:"/codex"}],commands:["ccs-codex","ccsx","ccs codex --target codex","ccs codex-api --target codex"],notes:"Saved default targets for API profiles and CLIProxy variants can now be claude, droid, or codex."},{id:"codex-cliproxy",name:"Codex via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed provider with configurable variant model and a native Codex shortcut.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:['ccsxp "your prompt"',"ccs codex --target codex","ccs codex","ccs cliproxy create mycodex --provider codex","ccs api create codex-api --cliproxy-provider codex"],notes:"Use ccsxp when you want the built-in Codex provider on native Codex without retyping --target codex."},{id:"gemini-cliproxy",name:"Gemini via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed Gemini provider with multi-account management.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:["ccs gemini","ccs cliproxy create mygem --provider gemini"]},{id:"agy-cliproxy",name:"Antigravity via CLIProxy",scope:"cliproxy",status:"stable",summary:"OAuth-backed Antigravity provider with variant target controls.",pillars:{baseUrl:"Managed by CLIProxy backend",auth:"OAuth account via CLIProxy auth flow",model:"Selectable per provider or variant"},routes:[{label:"CLIProxy",path:"/cliproxy"},{label:"Control Panel",path:"/cliproxy/control-panel"}],commands:["ccs agy","ccs cliproxy create myagy --provider agy --target droid"]},{id:"custom-api-profiles",name:"Custom API Profiles",scope:"api-profiles",status:"stable",summary:"Any Anthropic-compatible endpoint with per-profile target and model mapping.",pillars:{baseUrl:"User-defined endpoint",auth:"User-defined token/key",model:"User-defined model identifier"},routes:[{label:"API Profiles",path:"/providers"}],commands:["ccs api create myprofile",'ccs myprofile "your prompt"']},{id:"opencode-websearch",name:"OpenCode WebSearch",scope:"websearch",status:"stable",summary:"WebSearch provider surfaced in Settings for third-party profile workflows.",pillars:{baseUrl:"Managed by OpenCode CLI integration",auth:"Provider-specific (managed externally)",model:"Configurable in WebSearch settings"},routes:[{label:"Settings",path:"/settings"}],commands:["ccs config",'ccs codex "your prompt"'],notes:"Enable OpenCode in Settings > WebSearch to activate fallback search."}];function l(t,s,r){return M.t(t,{defaultValue:s,...r})}function te(){return{target:l("supportCatalog.scope.target",g.target),cliproxy:l("supportCatalog.scope.cliproxy",g.cliproxy),"api-profiles":l("supportCatalog.scope.apiProfiles",g["api-profiles"]),websearch:l("supportCatalog.scope.websearch",g.websearch)}}function se(t){return{...t,title:l(`supportCatalog.notice.${t.id}.title`,t.title),summary:l(`supportCatalog.notice.${t.id}.summary`,t.summary),primaryAction:l(`supportCatalog.notice.${t.id}.primaryAction`,t.primaryAction),highlights:t.highlights.map((s,r)=>l(`supportCatalog.notice.${t.id}.highlight.${r}`,s)),actions:t.actions.map(s=>({...s,label:l(`supportCatalog.notice.${t.id}.action.${s.id}.label`,s.label),description:l(`supportCatalog.notice.${t.id}.action.${s.id}.description`,s.description)})),routes:t.routes.map((s,r)=>({...s,label:l(`supportCatalog.notice.${t.id}.route.${r}.label`,s.label)}))}}function re(t){return{...t,name:l(`supportCatalog.entry.${t.id}.name`,t.name),summary:l(`supportCatalog.entry.${t.id}.summary`,t.summary),pillars:{baseUrl:l(`supportCatalog.entry.${t.id}.pillar.baseUrl`,t.pillars.baseUrl),auth:l(`supportCatalog.entry.${t.id}.pillar.auth`,t.pillars.auth),model:l(`supportCatalog.entry.${t.id}.pillar.model`,t.pillars.model)},routes:t.routes.map((s,r)=>({...s,label:l(`supportCatalog.entry.${t.id}.route.${r}.label`,s.label)})),notes:t.notes?l(`supportCatalog.entry.${t.id}.notes`,t.notes):t.notes}}function ae(){return X.map(se)}function oe(){return ee.map(re)}function ie(t){const s=new Map(oe().map(r=>[r.id,r]));return t.entryIds.map(r=>s.get(r)).filter(r=>!!r)}function O(t){const s=new Date(`${t}T00:00:00Z`);return Number.isNaN(s.getTime())?t:new Intl.DateTimeFormat(void 0,{year:"numeric",month:"short",day:"numeric",timeZone:"UTC"}).format(s)}const $="ccs:updates:notice-progress:v1";function de(t){return t==="new"?"new":"seen"}function m(t,s){return s[t.id]??de(t.status)}function A(t){return t!=="done"&&t!=="dismissed"}function le(){if(typeof window>"u")return{};try{const t=window.localStorage.getItem($);if(!t)return{};const s=JSON.parse(t);if(!s||typeof s!="object"||Array.isArray(s))return{};const r={};for(const[i,d]of Object.entries(s))typeof i=="string"&&(d==="new"||d==="seen"||d==="done"||d==="dismissed")&&(r[i]=d);return r}catch{return{}}}function ne(t){typeof window>"u"||window.localStorage.setItem($,JSON.stringify(t))}function D({state:t,className:s}){const{t:r}=x(),i={new:{label:r("updates.progressNeedsAction"),className:"border-amber-300/70 bg-amber-100/70 text-amber-800 dark:border-amber-500/40 dark:bg-amber-500/15 dark:text-amber-300",showDot:!0},seen:{label:r("updates.progressInReview"),className:"border-blue-300/70 bg-blue-100/70 text-blue-800 dark:border-blue-500/40 dark:bg-blue-500/15 dark:text-blue-300"},done:{label:r("updates.progressDone"),className:"border-emerald-300/70 bg-emerald-100/70 text-emerald-800 dark:border-emerald-500/40 dark:bg-emerald-500/15 dark:text-emerald-300"},dismissed:{label:r("updates.progressDismissed"),className:"border-muted-foreground/20 bg-muted text-muted-foreground dark:border-muted-foreground/30"}}[t];return e.jsxs(P,{variant:"outline",className:S("gap-1.5 border text-[10px] font-medium",i.className,s),children:[i.showDot&&e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}),i.label]})}function ce({action:t}){const{t:s}=x();return e.jsxs("div",{className:"rounded-md border bg-muted/20 p-3",children:[e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 space-y-0.5",children:[e.jsx("p",{className:"text-sm font-medium",children:t.label}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t.description})]}),t.type==="route"&&t.path&&e.jsx(u,{size:"sm",asChild:!0,children:e.jsxs(L,{to:t.path,children:[s("updates.open"),e.jsx(F,{className:"h-3.5 w-3.5"})]})})]}),t.type==="command"&&t.command&&e.jsxs("div",{className:"mt-2 flex items-center gap-2 rounded-md border bg-background px-2 py-1.5",children:[e.jsx(z,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("code",{className:"min-w-0 flex-1 truncate text-[11px]",children:t.command}),e.jsx(U,{value:t.command})]})]})}function pe({notice:t,progress:s,relatedEntries:r,onUpdateProgress:i}){const{t:d}=x(),f=te();return t?e.jsxs("div",{className:"flex-1 min-w-0 bg-background grid grid-rows-[auto_minmax(0,1fr)] overflow-hidden",children:[e.jsxs("div",{className:"border-b bg-background px-4 py-3",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("h2",{className:"text-base font-semibold leading-tight",children:t.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t.summary})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[s&&e.jsx(D,{state:s}),e.jsx(Z,{status:t.status})]})]}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(W,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:d("updates.published",{date:O(t.publishedAt)})})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsxs(u,{size:"sm",onClick:()=>i("done"),children:[e.jsx(H,{className:"h-4 w-4"}),d("updates.markDone")]}),e.jsxs(u,{size:"sm",variant:"outline",onClick:()=>i("dismissed"),children:[e.jsx(Q,{className:"h-4 w-4"}),d("updates.dismiss")]}),e.jsxs(u,{size:"sm",variant:"ghost",onClick:()=>i("new"),children:[e.jsx(G,{className:"h-4 w-4"}),d("updates.reopen")]})]})]}),e.jsx("div",{className:"min-h-0 p-4",children:e.jsxs("div",{className:"grid h-full gap-4 xl:grid-cols-[minmax(0,1.5fr)_minmax(320px,1fr)] overflow-hidden",children:[e.jsxs(C,{className:"h-full overflow-hidden",children:[e.jsxs(v,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(K,{className:"h-4 w-4 text-primary"}),e.jsx(N,{className:"text-base",children:d("updates.doNext")})]}),e.jsx(w,{children:t.primaryAction})]}),e.jsx(j,{className:"min-h-0",children:e.jsx(b,{className:"h-full pr-2",children:e.jsx("div",{className:"space-y-3",children:t.actions.map(o=>e.jsx(ce,{action:o},`${t.id}-${o.id}`))})})})]}),e.jsxs("div",{className:"grid h-full grid-rows-[minmax(0,1fr)_minmax(0,1fr)] gap-4 overflow-hidden",children:[e.jsxs(C,{className:"overflow-hidden",children:[e.jsxs(v,{className:"pb-3",children:[e.jsx(N,{className:"text-base",children:d("updates.impactedIntegrations")}),e.jsx(w,{children:d("updates.impactedDesc")})]}),e.jsx(j,{className:"min-h-0",children:e.jsx(b,{className:"h-full pr-2",children:e.jsx("div",{className:"space-y-2",children:r.map(o=>e.jsxs("div",{className:"rounded-md border bg-muted/20 p-2.5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx("p",{className:"min-w-0 truncate text-sm font-medium",children:o.name}),e.jsx(P,{variant:"outline",className:"h-5 px-1.5 text-[10px]",children:f[o.scope]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[o.routes[0]&&e.jsx(u,{size:"sm",variant:"outline",asChild:!0,children:e.jsx(L,{to:o.routes[0].path,children:o.routes[0].label})}),o.commands[0]&&e.jsxs("div",{className:"ml-auto flex min-w-0 items-center gap-1.5",children:[e.jsx("code",{className:"truncate rounded bg-background px-1.5 py-0.5 text-[11px]",children:o.commands[0]}),e.jsx(U,{value:o.commands[0]})]})]})]},o.id))})})})]}),e.jsxs(C,{className:"overflow-hidden",children:[e.jsxs(v,{className:"pb-3",children:[e.jsx(N,{className:"text-base",children:d("updates.whyMatters")}),e.jsx(w,{children:d("updates.whyMattersDesc")})]}),e.jsx(j,{className:"min-h-0",children:e.jsx(b,{className:"h-full pr-2",children:e.jsx("ul",{className:"space-y-2 text-sm text-muted-foreground",children:t.highlights.map(o=>e.jsxs("li",{children:["- ",o]},`${t.id}-${o}`))})})})]})]})]})})]}):e.jsx("div",{className:"flex h-full items-center justify-center rounded-lg border border-dashed bg-muted/20 p-6",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:d("updates.noUpdates")})})}function me({notice:t,progress:s,selected:r,onSelect:i}){return e.jsxs("button",{type:"button",onClick:i,className:S("w-full rounded-lg border px-3 py-3 text-left transition-colors",r?"border-primary/30 bg-primary/10":"border-transparent bg-background/40 hover:border-border hover:bg-muted/70"),children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0 space-y-1",children:[e.jsx("p",{className:"truncate text-sm font-medium",children:t.title}),e.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:t.primaryAction})]}),e.jsx(q,{className:"mt-0.5 h-4 w-4 shrink-0 text-muted-foreground"})]}),e.jsxs("div",{className:"mt-2 flex items-center justify-between gap-2",children:[e.jsx("span",{className:"text-[11px] text-muted-foreground",children:O(t.publishedAt)}),e.jsx(D,{state:s})]})]})}function ue(t,s){return s?[t.title,t.summary,t.primaryAction,...t.highlights,...t.commands,...t.actions.map(i=>`${i.label} ${i.description} ${i.command||""}`),...t.routes.map(i=>i.label)].join(" ").toLowerCase().includes(s):!0}function je(){const{t}=x(),s=[...ae()].sort((a,n)=>n.publishedAt.localeCompare(a.publishedAt)),[r,i]=c.useState("inbox"),[d,f]=c.useState(""),[o,I]=c.useState(()=>le()),[k,E]=c.useState(null);c.useEffect(()=>{ne(o)},[o]);const h=c.useMemo(()=>{const a=d.trim().toLowerCase();return s.filter(n=>{const y=m(n,o);return ue(n,a)?r==="done"?y==="done":r==="inbox"?A(y):!0:!1})},[s,o,d,r]),p=c.useMemo(()=>{const a=r==="all"?s:h;return a.find(n=>n.id===k)??a[0]??null},[s,k,r,h]),R=a=>{E(a.id),I(n=>m(a,n)!=="new"?n:{...n,[a.id]:"seen"})},T=c.useMemo(()=>s.filter(a=>A(m(a,o))).length,[s,o]),_=c.useMemo(()=>s.filter(a=>m(a,o)==="done").length,[s,o]);return e.jsxs("div",{className:"flex h-full min-h-0 overflow-hidden",children:[e.jsxs("div",{className:"w-80 border-r bg-muted/30 flex flex-col overflow-hidden",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:t("updates.inboxTitle")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:t("updates.inboxSubtitle")})]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2 text-xs",children:[e.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5",children:[e.jsx("p",{className:"text-muted-foreground",children:t("updates.needsAction")}),e.jsx("p",{className:"text-base font-semibold",children:T})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5",children:[e.jsx("p",{className:"text-muted-foreground",children:t("updates.doneCount")}),e.jsx("p",{className:"text-base font-semibold",children:_})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(V,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(B,{value:d,onChange:a=>f(a.target.value),placeholder:t("updates.searchPlaceholder"),className:"h-9 pl-8"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:[{id:"inbox",label:t("updates.actionRequired")},{id:"done",label:t("updates.done")},{id:"all",label:t("updates.all")}].map(a=>e.jsx(u,{size:"sm",variant:r===a.id?"default":"outline",onClick:()=>i(a.id),children:a.label},a.id))})]}),e.jsx(b,{className:"flex-1",children:e.jsx("div",{className:"space-y-2 p-2",children:h.length===0?e.jsx("div",{className:"rounded-md border border-dashed p-3 text-xs text-muted-foreground",children:t("updates.noNotices")}):h.map(a=>e.jsx(me,{notice:a,progress:m(a,o),selected:p?.id===a.id,onSelect:()=>R(a)},a.id))})})]}),e.jsx(pe,{notice:p,progress:p?m(p,o):null,relatedEntries:p?ie(p):[],onUpdateProgress:a=>{p&&I(n=>({...n,[p.id]:a}))}})]})}export{je as UpdatesPage};
|