@kaitranntt/ccs 7.68.1-dev.2 → 7.68.1-dev.3
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/config/unified-config-loader.d.ts +8 -3
- package/dist/config/unified-config-loader.d.ts.map +1 -1
- package/dist/config/unified-config-loader.js +20 -7
- package/dist/config/unified-config-loader.js.map +1 -1
- package/dist/config/unified-config-types.d.ts +15 -2
- package/dist/config/unified-config-types.d.ts.map +1 -1
- package/dist/config/unified-config-types.js +8 -3
- package/dist/config/unified-config-types.js.map +1 -1
- package/dist/ui/assets/{accounts-DKiswDnO.js → accounts-4Wxzh1pD.js} +1 -1
- package/dist/ui/assets/{alert-dialog-2aL2HMgG.js → alert-dialog-DGxGdNKD.js} +1 -1
- package/dist/ui/assets/{api-0XFpJIwX.js → api-DDTb78NK.js} +1 -1
- package/dist/ui/assets/{auth-section-BGBYw5dp.js → auth-section-r5XbRAUy.js} +1 -1
- package/dist/ui/assets/{backups-section-DuEFBimp.js → backups-section-CfhkSFYu.js} +1 -1
- package/dist/ui/assets/{channels-g_MsyBQd.js → channels-CUNcGH3S.js} +1 -1
- package/dist/ui/assets/{checkbox-D6stHDR5.js → checkbox-Dhabke8C.js} +1 -1
- package/dist/ui/assets/{claude-extension-MmCl67DV.js → claude-extension-B7woSTcR.js} +1 -1
- package/dist/ui/assets/{cliproxy-BFYDC1Qv.js → cliproxy-0UypW7So.js} +1 -1
- package/dist/ui/assets/{cliproxy-ai-providers-CiFdchyE.js → cliproxy-ai-providers-n7M1sRek.js} +1 -1
- package/dist/ui/assets/{cliproxy-control-panel-BnRavAdV.js → cliproxy-control-panel-BfElGwOQ.js} +1 -1
- package/dist/ui/assets/{codex-C_NQb-b_.js → codex-CP1dPOyh.js} +1 -1
- package/dist/ui/assets/{confirm-dialog-Ch-M9Hbx.js → confirm-dialog-vhsQSaZ6.js} +1 -1
- package/dist/ui/assets/{copilot-BjBYvnCs.js → copilot-DUTtEVYH.js} +1 -1
- package/dist/ui/assets/{cursor-L5hSOzMq.js → cursor-ThAyj_tQ.js} +1 -1
- package/dist/ui/assets/{droid-Cgv8qdDe.js → droid-mrP_PnYz.js} +1 -1
- package/dist/ui/assets/{globalenv-section-CCOKhfQR.js → globalenv-section-Gh2BxqVn.js} +1 -1
- package/dist/ui/assets/{health-CcgzRrGn.js → health-TGXaQNZq.js} +1 -1
- package/dist/ui/assets/index-CQIjTCyk.js +1 -0
- package/dist/ui/assets/{index-CBkM-K11.js → index-CRAY9dRC.js} +1 -1
- package/dist/ui/assets/{index-Be5tzS8b.js → index-CaRCgIIp.js} +1 -1
- package/dist/ui/assets/{index-Dqc1e2bT.js → index-DRXqBE1w.js} +1 -1
- package/dist/ui/assets/{index-DpF_8BcK.js → index-DSM3luVm.js} +2 -2
- package/dist/ui/assets/{index-DUbpdx2e.js → index-wYHVuydD.js} +1 -1
- package/dist/ui/assets/{logs-DJtDYnsv.js → logs-5mpClyQ2.js} +1 -1
- package/dist/ui/assets/{masked-input-NRy3dgQf.js → masked-input-DhWU9sNj.js} +1 -1
- package/dist/ui/assets/{proxy-status-widget-D7M56E9T.js → proxy-status-widget-C1IFaC6c.js} +1 -1
- package/dist/ui/assets/{raw-json-settings-editor-panel-qjLoSybO.js → raw-json-settings-editor-panel-tK2P1u12.js} +1 -1
- package/dist/ui/assets/{searchable-select-Bf0WOPIH.js → searchable-select-CNH0YBur.js} +1 -1
- package/dist/ui/assets/{separator-Y87DseSV.js → separator-CJd089R0.js} +1 -1
- package/dist/ui/assets/{shared-Bk0tDwnM.js → shared-DxH1omaN.js} +1 -1
- package/dist/ui/assets/{table-BAO0vhjx.js → table-lWkyktS-.js} +1 -1
- package/dist/ui/assets/{updates-DLNvHqY-.js → updates-nm2PIK8k.js} +1 -1
- package/dist/ui/index.html +1 -1
- package/dist/utils/websearch/hook-env.d.ts.map +1 -1
- package/dist/utils/websearch/hook-env.js +19 -1
- package/dist/utils/websearch/hook-env.js.map +1 -1
- package/dist/utils/websearch/status.d.ts +1 -1
- package/dist/utils/websearch/status.d.ts.map +1 -1
- package/dist/utils/websearch/status.js +33 -12
- package/dist/utils/websearch/status.js.map +1 -1
- package/dist/utils/websearch/types.d.ts +12 -2
- package/dist/utils/websearch/types.d.ts.map +1 -1
- package/dist/utils/websearch/types.js +38 -0
- package/dist/utils/websearch/types.js.map +1 -1
- package/dist/web-server/health/websearch-checks.js +1 -1
- package/dist/web-server/health/websearch-checks.js.map +1 -1
- package/dist/web-server/routes/websearch-routes.d.ts.map +1 -1
- package/dist/web-server/routes/websearch-routes.js +37 -0
- package/dist/web-server/routes/websearch-routes.js.map +1 -1
- package/lib/hooks/websearch-transformer.cjs +136 -0
- package/lib/mcp/ccs-websearch-server.cjs +1 -1
- package/package.json +1 -1
- package/dist/ui/assets/index-B8BM0x4w.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./radix-ui-Zb8sVEtn.js";import{g as Ve,r as S}from"./react-vendor-CNOkPC89.js";import{by as ye,bz as be,bA as je,bB as Pe,bC as z,bD as te,bE as L,bF as $e,bG as We,c as W,B as H,d as Y,a as Oe,bx as _e,aW as De,bH as Ie,bI as Re,bJ as Fe,bK as Le,bL as Ue,bM as ze,bN as qe,aJ as Me,M as Be,O as He,r as Ke,s as Ye,t as Ze,v as Ge,w as Je,T as Qe,p as Xe,q as et,Y as tt}from"./index-DpF_8BcK.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-2aL2HMgG.js";import{u as ve,a as ut,b as dt,h as mt}from"./tanstack-CrmUhA7Z.js";import{t as se}from"./notifications-B2HqRBj7.js";import{bd as me,R as K,t as pt,s as xt,u as gt,A as ft,be as ht,bf as yt,bg as bt,X as jt,e as vt,bh as Nt,bi as St,U as wt,v as Ct,m as kt,w as At,aE as Et,T as ne,aO as Tt}from"./icons-KVCk4_U8.js";var re,pe;function Vt(){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 Pt=Vt();const $t=Ve(Pt);var Wt=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function xe(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(Wt),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 Ot=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,_t=/^\s*$/,Dt=Object.create(null);function Ne(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(Ne,"")+"</"+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(Ot,function(d,m){if(o){if(d!=="</"+n.name+">")return;o=!1}var p,w=d.charAt(1)!=="/",A=d.startsWith("<!--"),g=m+d.length,x=e.charAt(g);if(A){var v=xe(d);return i<0?(r.push(v),r):((p=a[i]).children.push(v),r)}if(w&&(i++,(n=xe(d)).type==="tag"&&s.components[n.name]&&(n.type="component",o=!0),n.voidElement||o||!x||x==="<"||n.children.push({type:"text",content:e.slice(g,e.indexOf("<",g))}),i===0&&r.push(n),(p=a[i-1])&&p.children.push(n),a[i]=n),(!w||n.voidElement)&&(i>-1&&(n.voidElement||n.name===d.slice(2,-1))&&(i--,n=i===-1?r:a[i]),!o&&x!=="<"&&x)){p=i===-1?r:a[i].children;var u=e.indexOf("<",g),h=e.slice(g,u===-1?void 0:u);_t.test(h)&&(h=" "),(u>-1&&i+p.length>=0||h!==" ")&&p.push({type:"text",content:h})}}),r},stringify:function(e){return e.reduce(function(s,n){return s+Ne("",n)},"")}};const G=(e,s)=>{if(!e)return!1;const n=e.props?.children??e.children;return s?n.length>0:!!n},J=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(S.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=>{z(i)||(G(i)?n(J(i)):L(i)&&!S.isValidElement(i)&&Object.assign(s,i))})};return n(e),s},Se=(e,s,n,r)=>{if(!e)return"";let a="";const i=U(e),o=s?.transSupportBasicHtmlNodes?s.transKeepBasicHtmlNodesFor??[]:[];return i.forEach((c,d)=>{if(z(c)){a+=`${c}`;return}if(S.isValidElement(c)){const{props:m,type:p}=c,w=Object.keys(m).length,A=o.indexOf(p)>-1,g=m.children;if(!g&&A&&!w){a+=`<${p}/>`;return}if(!g&&(!A||w)||m.i18nIsDynamicList){a+=`<${d}></${d}>`;return}if(A&&w===1&&z(g)){a+=`<${p}>${g}</${p}>`;return}const x=Se(g,s,n,r);a+=`<${d}>${x}</${d}>`;return}if(c===null){te(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:r});return}if(L(c)){const{format:m,...p}=c,w=Object.keys(p);if(w.length===1){const A=m?`${w[0]}, ${m}`:w[0];a+=`{{${A}}}`;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 d=e.slice(o).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(d){const m=d[1];(/^\d+$/.test(m)||a.includes(m))&&(c=!0,i+=d[0],o+=d[0].length)}if(!c){const m=e.slice(o).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(m){const p=m[1];(/^\d+$/.test(p)||a.includes(p))&&(c=!0,i+=m[0],o+=m[0].length)}}c||(i+="<",o+=1)}else i+=e[o],o+=1;return i},zt=(e,s,n,r,a,i,o)=>{if(n==="")return[];const c=a.transKeepBasicHtmlNodesFor||[],d=n&&new RegExp(c.map(b=>`<${b}`).join("|")).test(n);if(!e&&!s&&!d&&!o)return[n];const m=s??{},p=b=>{U(b).forEach(k=>{z(k)||(G(k)?p(J(k)):L(k)&&!S.isValidElement(k)&&Object.assign(m,k))})};p(e);const w=Ut(n,c,m),A=It.parse(`<0>${w}</0>`),g={...m,...i},x=(b,C,k)=>{const E=J(b),$=u(E,C.children,k);return Rt(E)&&$.length===0||b.props?.i18nIsDynamicList?E:$},v=(b,C,k,E,$)=>{b.dummy?(b.children=C,k.push(S.cloneElement(b,{key:E},$?void 0:C))):k.push(...S.Children.map([b],f=>{const l="data-i18n-is-dynamic-list",V={key:E,[l]:void 0};return f&&f.props&&Object.keys(f.props).forEach(T=>{T==="ref"||T==="children"||T==="i18nIsDynamicList"||T===l||(V[T]=f.props[T])}),S.cloneElement(f,V,$?null:C)}))},u=(b,C,k)=>{const E=U(b);return U(C).reduce((f,l,V)=>{const T=l.children?.[0]?.content&&r.services.interpolator.interpolate(l.children[0].content,g,r.language);if(l.type==="tag"){let P=E[parseInt(l.name,10)];!P&&s&&(P=s[l.name]),k.length===1&&!P&&(P=k[0][l.name]),P||(P={});const O={...l.attrs};o&&Object.keys(O).forEach(y=>{const F=O[y];z(F)&&(O[y]=$e(F))});const j=Object.keys(O).length!==0?Ft({props:O},P):P,_=S.isValidElement(j),D=_&&G(l,!0)&&!l.voidElement,R=d&&L(j)&&j.dummy&&!_,q=L(s)&&Object.hasOwnProperty.call(s,l.name);if(z(j)){const y=r.services.interpolator.interpolate(j,g,r.language);f.push(y)}else if(G(j)||D){const y=x(j,l,k);v(j,y,f,V)}else if(R){const y=u(E,l.children,k);v(j,y,f,V)}else if(Number.isNaN(parseFloat(l.name)))if(q){const y=x(j,l,k);v(j,y,f,V,l.voidElement)}else if(a.transSupportBasicHtmlNodes&&c.indexOf(l.name)>-1)if(l.voidElement)f.push(S.createElement(l.name,{key:`${l.name}-${V}`}));else{const y=u(E,l.children,k);f.push(S.createElement(l.name,{key:`${l.name}-${V}`},y))}else if(l.voidElement)f.push(`<${l.name} />`);else{const y=u(E,l.children,k);f.push(`<${l.name}>${y}</${l.name}>`)}else if(L(j)&&!_){const y=l.children[0]?T:null;y&&f.push(y)}else v(j,T,f,V,l.children.length!==1||!T)}else if(l.type==="text"){const P=a.transWrapTextNodes,O=typeof a.unescape=="function"?a.unescape:je().unescape,j=o?O(r.services.interpolator.interpolate(l.content,g,r.language)):r.services.interpolator.interpolate(l.content,g,r.language);P?f.push(S.createElement(P,{key:`${l.name}-${V}`},j)):f.push(j)}return f},[])},h=u([{dummy:!0,children:e||[]}],A,U(e||[]));return J(h[0])},we=(e,s,n)=>{const r=e.key||s,a=S.cloneElement(e,{key:r});if(!a.props||!a.props.children||n.indexOf(`${s}/>`)<0&&n.indexOf(`${s} />`)<0)return a;function i(){return S.createElement(S.Fragment,null,a)}return S.createElement(i,{key:r})},qt=(e,s)=>e.map((n,r)=>we(n,r,s)),Mt=(e,s)=>{const n={};return Object.keys(e).forEach(r=>{Object.assign(n,{[r]:we(e[r],r,s)})}),n},Bt=(e,s,n,r)=>e?Array.isArray(e)?qt(e,s):L(e)?Mt(e,s):(ye(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 Kt({children:e,count:s,parent:n,i18nKey:r,context:a,tOptions:i={},values:o,defaults:c,components:d,ns:m,i18n:p,t:w,shouldUnescape:A,...g}){const x=p||be();if(!x)return ye(x,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:r}),e;const v=w||x.t.bind(x)||(M=>M),u={...je(),...x.options?.react};let h=m||v.ns||x.options?.defaultNS;h=z(h)?[h]:h||["translation"];const{transDefaultProps:b}=u,C=b?.tOptions?{...b.tOptions,...i}:i,k=A??b?.shouldUnescape,E=b?.values?{...b.values,...o}:o,$=b?.components?{...b.components,...d}:d,f=Se(e,u,x,r),l=c||C?.defaultValue||f||u.transEmptyNodeValue||(typeof r=="function"?Pe(r):r),{hashTransKey:V}=u,T=r||(V?V(f||l):f||l);x.options?.interpolation?.defaultVariables?o=E&&Object.keys(E).length>0?{...E,...x.options.interpolation.defaultVariables}:{...x.options.interpolation.defaultVariables}:o=E;const P=Lt(e);P&&typeof P.count=="number"&&s===void 0&&(s=P.count);const O=o||s!==void 0&&!x.options?.interpolation?.alwaysFormat||!e?C.interpolation:{interpolation:{...C.interpolation,prefix:"#$?",suffix:"?$#"}},j={...C,context:a||C.context,count:s,...o,...O,defaultValue:l,ns:h};let _=T?v(T,j):l;_===T&&l&&(_=l);const D=Bt($,_,x,r);let R=D||e,q=null;Ht(D)&&(q=D,R=e);const y=zt(R,q,_,x,u,j,k),F=n??u.defaultTransParent;return F?S.createElement(F,g,y):y}function ge({children:e,count:s,parent:n,i18nKey:r,context:a,tOptions:i={},values:o,defaults:c,components:d,ns:m,i18n:p,t:w,shouldUnescape:A,...g}){const{i18n:x,defaultNS:v}=S.useContext(We)||{},u=p||x||be(),h=w||u?.t.bind(u);return Kt({children:e,count:s,parent:n,i18nKey:r,context:a,tOptions:i,values:o,defaults:c,components:d,ns:m||h?.ns||v||u?.options?.defaultNS,i18n:u,t:w,shouldUnescape:A,...g})}async function Yt(){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 Gt(){return ve({queryKey:["cliproxy-sync-status"],queryFn:Yt,refetchInterval:3e4,retry:1,staleTime:1e4})}function Jt(){const e=ut();return dt({mutationFn:Zt,onSuccess:s=>{e.invalidateQueries({queryKey:["cliproxy-sync-status"]}),e.invalidateQueries({queryKey:["cliproxy-sync-preview"]}),s.syncedCount===0?se.info("No profiles to sync"):se.success(`Synced ${s.syncedCount} profile${s.syncedCount===1?"":"s"} to CLIProxy`)},onError:s=>{se.error(`Sync failed: ${s.message}`)}})}function fe(e){return e.replace(/-\d+$/,"").split(".").map(Number)}function le(e,s){const n=fe(e),r=fe(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 he({className:e,compact:s=!1,state:n,isLoading:r,isSaving:a,error:i,onApply:o}){const c=n?.strategy??"round-robin",[d,m]=S.useState(c),[p,w]=S.useState(!1),A=n?.source==="live"?"Live CLIProxy":"Saved startup default",g=r||a||!n||d===c,x=p?"Hide details":"Show details";if(s){const v=u=>{m(u),u!==c&&o(u)};return t.jsxs("div",{className:W("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(me,{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(K,{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:W("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(([u,h])=>{const b=d===u;return t.jsx("button",{type:"button",className:W("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",b?"text-foreground group-hover/routing:text-primary":"text-muted-foreground/70 hover:text-foreground/90 group-hover/routing:text-muted-foreground/90"),onClick:()=>v(u),disabled:r||a||!!i,title:h.description,children:h.title},u)})]})]})}return t.jsx("section",{className:W("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(me,{className:"h-4 w-4"})}),t.jsx("div",{className:"text-sm font-medium",children:"Routing strategy"}),t.jsx(H,{variant:"secondary",children:c}),n?t.jsx(H,{variant:"outline",children:A}):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(([v,u])=>{const h=d===v;return t.jsx("button",{type:"button",className:W("rounded-md px-3 py-1.5 text-sm font-medium transition-colors",h?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>m(v),disabled:r||a||!!i,children:u.title},v)})}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsxs(Y,{type:"button",variant:"ghost",size:"sm",className:"h-8 px-2 text-xs text-muted-foreground",onClick:()=>w(v=>!v),children:[p?t.jsx(pt,{className:"mr-1 h-3.5 w-3.5"}):t.jsx(xt,{className:"mr-1 h-3.5 w-3.5"}),x]}),t.jsx(Y,{size:"sm",onClick:()=>o(d),disabled:g||!!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:"Round robin spreads usage."}),t.jsx("span",{className:"hidden text-border sm:inline",children:"•"}),t.jsx("span",{children:"Fill first keeps backup accounts cold until they are needed."})]}),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,p?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(([v,u])=>{const h=c===v;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:u.title}),h?t.jsx(H,{variant:"secondary",children:"Current"}):null]}),t.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:u.description})]},v)})}):null]})})}function Qt(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(Qe,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(Y,{variant:o==="destructive-ghost"?"ghost":o,size:"sm",className:W("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(K,{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}=Oe(),{data:s,isLoading:n}=_e(),{data:r}=De(),{data:a,isLoading:i}=Ie(),{data:o,isLoading:c,error:d}=Re(),m=Fe(),p=Le(),w=Ue(),A=ze(),g=qe(),{data:x}=Gt(),{mutate:v,isPending:u}=Jt(),[h,b]=S.useState(!1),[C,k]=S.useState(""),[E,$]=S.useState(!1),[f,l]=S.useState(null),[V,T]=S.useState(null),{data:P}=ve({queryKey:["cliproxy-server-config"],queryFn:()=>tt.cliproxyServer.get(),staleTime:3e4}),O=mt({mutationKey:["update-backend"]})>0,j=P?.remote,_=j?.enabled&&j?.host,D=s?.running??!1,R=p.isPending||w.isPending||A.isPending||g.isPending||O||u,q=r?.hasUpdate??!1,y=r?.isStable===!1,F=r?.currentVersion,M=x?.configured??!1,Ce=e(M?"proxyStatusWidget.syncReady":"proxyStatusWidget.noConfig"),Q=y?r?.maxStableVersion||a?.latestStable:r?.latestVersion,ce=a?.maxStableVersion||r?.maxStableVersion||"6.6.80",B=a?.faultyRange,ke=B&&`${B.min.replace(/-\d+$/,"")}-${B.max.replace(/-\d+$/,"")}`,X=(N,I)=>{l(N),T(I),$(!0)},ue=async N=>{if(!N)return;const I=ae(N,ce);if(B!==void 0&&ie(N,B.min,B.max)){X(N,"faulty");return}if(I){X(N,"experimental");return}try{const de=await g.mutateAsync({version:N});de.requiresConfirmation&&X(N,de.isFaulty?"faulty":"experimental")}catch{}},Ae=()=>{f&&g.mutate({version:f,force:!0}),$(!1),l(null),T(null)},Ee=()=>{$(!1),l(null),T(null)},Te=_?(()=>{const N=j.protocol||"http",I=j.port||(N==="https"?443:80);return N==="https"&&I===443||N==="http"&&I===80?j.host:`${j.host}:${I}`})():null;return _?t.jsxs("div",{className:W("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(he,{compact:!0,className:"mt-3",state:o,isLoading:c,isSaving:m.isPending,error:d instanceof Error?d:null,onApply:N=>m.mutate(N)},`remote:${o?.strategy??"round-robin"}`)]}):t.jsx(Me,{delayDuration:300,children:t.jsxs("div",{className:W("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:W("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(K,{className:"w-3 h-3 animate-spin text-muted-foreground"}):D?t.jsxs(t.Fragment,{children:[t.jsx(Z,{icon:u?K:ht,tooltip:e("proxyStatusWidget.tooltipSync"),onClick:()=>v(),disabled:!M||R,isPending:u}),t.jsx(Z,{icon:yt,tooltip:e("proxyStatusWidget.tooltipRestart"),onClick:()=>A.mutate(),disabled:R,isPending:A.isPending}),t.jsx(Z,{icon:bt,tooltip:e("proxyStatusWidget.tooltipStop"),onClick:()=>w.mutate(),disabled:R,isPending:w.isPending,variant:"destructive-ghost"})]}):null,t.jsx(Z,{icon:h?jt:vt,tooltip:e(h?"proxyStatusWidget.tooltipClose":"proxyStatusWidget.tooltipVersionSettings"),onClick:()=>b(!h),className:h?"bg-muted":void 0})]})]}),F&&t.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[t.jsxs("span",{className:W("text-xs font-mono text-muted-foreground",y&&"text-amber-600 dark:text-amber-400"),children:["v",F]}),(q||y)&&Q&&t.jsxs(H,{variant:"secondary",className:W("text-[10px] h-4 px-1.5 gap-0.5 cursor-pointer transition-colors",y?"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 ue(Q),title:e(y?"proxyStatusWidget.clickToDowngrade":"proxyStatusWidget.clickToUpdate"),children:[y?t.jsx(Nt,{className:"w-2.5 h-2.5"}):t.jsx(St,{className:"w-2.5 h-2.5"}),Q]})]}),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"}),Qt(s.startedAt)]})]}),t.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs",children:[M?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:W("text-xs",M?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:Ce})]}),t.jsx(he,{compact:!0,className:"mt-3",state:o,isLoading:c,isSaving:m.isPending,error:d instanceof Error?d:null,onApply:N=>m.mutate(N)},`local:${o?.strategy??"round-robin"}`),t.jsx(Be,{open:h,onOpenChange:b,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(Ke,{value:C,onValueChange:k,disabled:i,children:[t.jsx(Ye,{className:"h-8 text-xs flex-1",children:t.jsx(Ze,{placeholder:e("proxyStatusWidget.selectVersionPlaceholder")})}),t.jsx(Ge,{children:a?.versions.slice(0,20).map(N=>{const I=a?.maxStableVersion&&ae(N,a.maxStableVersion),ee=a?.faultyRange&&ie(N,a.faultyRange.min,a.faultyRange.max);return t.jsx(Je,{value:N,className:"text-xs",children:t.jsxs("span",{className:"flex items-center gap-2",children:["v",N,N===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:"⚠"})]})},N)})})]}),t.jsxs(Y,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5 px-3",onClick:()=>void ue(C),disabled:g.isPending||!C,children:[g.isPending?t.jsx(K,{className:"w-3.5 h-3.5 animate-spin"}):t.jsx(Et,{className:"w-3.5 h-3.5"}),e("proxyStatusWidget.install")]})]}),C&&a?.maxStableVersion&&ae(C,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})})]}),C&&a?.faultyRange&&ie(C,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:C})})]}),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(Y,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>p.mutate(),disabled:p.isPending,children:[p.isPending?t.jsx(K,{className:"w-3 h-3 animate-spin"}):t.jsx(Tt,{className:"w-3 h-3"}),e("proxyStatusWidget.start")]})]}),t.jsx(st,{open:E,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(V==="faulty"?"proxyStatusWidget.installFaultyTitle":"proxyStatusWidget.installUnstableTitle")]}),t.jsxs(it,{className:"space-y-2",children:[V==="faulty"?t.jsx("p",{children:t.jsx(ge,{i18nKey:"proxyStatusWidget.installFaultyDesc",values:{version:f??"",range:ke||""},components:{strong:t.jsx("strong",{})}})}):t.jsx("p",{children:t.jsx(ge,{i18nKey:"proxyStatusWidget.installUnstableDesc",values:{version:f??"",maxStable:ce},components:{strong:t.jsx("strong",{})}})}),t.jsx("p",{className:"text-amber-600 dark:text-amber-400",children:e(V==="faulty"?"proxyStatusWidget.installFaultyWarning":"proxyStatusWidget.installUnstableWarning")}),t.jsx("p",{children:e("proxyStatusWidget.installUnstableConfirm")})]})]}),t.jsxs(ot,{children:[t.jsx(lt,{onClick:Ee,children:e("proxyStatusWidget.cancel")}),t.jsx(ct,{onClick:Ae,className:"bg-amber-500 hover:bg-amber-600 text-white",children:e("proxyStatusWidget.installAnyway")})]})]})})]})})}export{os as P};
|
|
1
|
+
import{j as t}from"./radix-ui-Zb8sVEtn.js";import{g as Ve,r as S}from"./react-vendor-CNOkPC89.js";import{by as ye,bz as be,bA as je,bB as Pe,bC as z,bD as te,bE as L,bF as $e,bG as We,c as W,B as H,d as Y,a as Oe,bx as _e,aW as De,bH as Ie,bI as Re,bJ as Fe,bK as Le,bL as Ue,bM as ze,bN as qe,aJ as Me,M as Be,O as He,r as Ke,s as Ye,t as Ze,v as Ge,w as Je,T as Qe,p as Xe,q as et,Y as tt}from"./index-DSM3luVm.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-DGxGdNKD.js";import{u as ve,a as ut,b as dt,h as mt}from"./tanstack-CrmUhA7Z.js";import{t as se}from"./notifications-B2HqRBj7.js";import{bd as me,R as K,t as pt,s as xt,u as gt,A as ft,be as ht,bf as yt,bg as bt,X as jt,e as vt,bh as Nt,bi as St,U as wt,v as Ct,m as kt,w as At,aE as Et,T as ne,aO as Tt}from"./icons-KVCk4_U8.js";var re,pe;function Vt(){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 Pt=Vt();const $t=Ve(Pt);var Wt=/\s([^'"/\s><]+?)[\s/>]|([^\s=]+)=\s?(".*?"|'.*?')/g;function xe(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(Wt),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 Ot=/<[a-zA-Z0-9\-\!\/](?:"[^"]*"|'[^']*'|[^'">])*>/g,_t=/^\s*$/,Dt=Object.create(null);function Ne(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(Ne,"")+"</"+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(Ot,function(d,m){if(o){if(d!=="</"+n.name+">")return;o=!1}var p,w=d.charAt(1)!=="/",A=d.startsWith("<!--"),g=m+d.length,x=e.charAt(g);if(A){var v=xe(d);return i<0?(r.push(v),r):((p=a[i]).children.push(v),r)}if(w&&(i++,(n=xe(d)).type==="tag"&&s.components[n.name]&&(n.type="component",o=!0),n.voidElement||o||!x||x==="<"||n.children.push({type:"text",content:e.slice(g,e.indexOf("<",g))}),i===0&&r.push(n),(p=a[i-1])&&p.children.push(n),a[i]=n),(!w||n.voidElement)&&(i>-1&&(n.voidElement||n.name===d.slice(2,-1))&&(i--,n=i===-1?r:a[i]),!o&&x!=="<"&&x)){p=i===-1?r:a[i].children;var u=e.indexOf("<",g),h=e.slice(g,u===-1?void 0:u);_t.test(h)&&(h=" "),(u>-1&&i+p.length>=0||h!==" ")&&p.push({type:"text",content:h})}}),r},stringify:function(e){return e.reduce(function(s,n){return s+Ne("",n)},"")}};const G=(e,s)=>{if(!e)return!1;const n=e.props?.children??e.children;return s?n.length>0:!!n},J=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(S.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=>{z(i)||(G(i)?n(J(i)):L(i)&&!S.isValidElement(i)&&Object.assign(s,i))})};return n(e),s},Se=(e,s,n,r)=>{if(!e)return"";let a="";const i=U(e),o=s?.transSupportBasicHtmlNodes?s.transKeepBasicHtmlNodesFor??[]:[];return i.forEach((c,d)=>{if(z(c)){a+=`${c}`;return}if(S.isValidElement(c)){const{props:m,type:p}=c,w=Object.keys(m).length,A=o.indexOf(p)>-1,g=m.children;if(!g&&A&&!w){a+=`<${p}/>`;return}if(!g&&(!A||w)||m.i18nIsDynamicList){a+=`<${d}></${d}>`;return}if(A&&w===1&&z(g)){a+=`<${p}>${g}</${p}>`;return}const x=Se(g,s,n,r);a+=`<${d}>${x}</${d}>`;return}if(c===null){te(n,"TRANS_NULL_VALUE","Passed in a null value as child",{i18nKey:r});return}if(L(c)){const{format:m,...p}=c,w=Object.keys(p);if(w.length===1){const A=m?`${w[0]}, ${m}`:w[0];a+=`{{${A}}}`;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 d=e.slice(o).match(/^<\/(\d+|[a-zA-Z][a-zA-Z0-9_-]*)>/);if(d){const m=d[1];(/^\d+$/.test(m)||a.includes(m))&&(c=!0,i+=d[0],o+=d[0].length)}if(!c){const m=e.slice(o).match(/^<(\d+|[a-zA-Z][a-zA-Z0-9_-]*)(\s+[\w-]+(?:=(?:"[^"]*"|'[^']*'|[^\s>]+))?)*\s*(\/)?>/);if(m){const p=m[1];(/^\d+$/.test(p)||a.includes(p))&&(c=!0,i+=m[0],o+=m[0].length)}}c||(i+="<",o+=1)}else i+=e[o],o+=1;return i},zt=(e,s,n,r,a,i,o)=>{if(n==="")return[];const c=a.transKeepBasicHtmlNodesFor||[],d=n&&new RegExp(c.map(b=>`<${b}`).join("|")).test(n);if(!e&&!s&&!d&&!o)return[n];const m=s??{},p=b=>{U(b).forEach(k=>{z(k)||(G(k)?p(J(k)):L(k)&&!S.isValidElement(k)&&Object.assign(m,k))})};p(e);const w=Ut(n,c,m),A=It.parse(`<0>${w}</0>`),g={...m,...i},x=(b,C,k)=>{const E=J(b),$=u(E,C.children,k);return Rt(E)&&$.length===0||b.props?.i18nIsDynamicList?E:$},v=(b,C,k,E,$)=>{b.dummy?(b.children=C,k.push(S.cloneElement(b,{key:E},$?void 0:C))):k.push(...S.Children.map([b],f=>{const l="data-i18n-is-dynamic-list",V={key:E,[l]:void 0};return f&&f.props&&Object.keys(f.props).forEach(T=>{T==="ref"||T==="children"||T==="i18nIsDynamicList"||T===l||(V[T]=f.props[T])}),S.cloneElement(f,V,$?null:C)}))},u=(b,C,k)=>{const E=U(b);return U(C).reduce((f,l,V)=>{const T=l.children?.[0]?.content&&r.services.interpolator.interpolate(l.children[0].content,g,r.language);if(l.type==="tag"){let P=E[parseInt(l.name,10)];!P&&s&&(P=s[l.name]),k.length===1&&!P&&(P=k[0][l.name]),P||(P={});const O={...l.attrs};o&&Object.keys(O).forEach(y=>{const F=O[y];z(F)&&(O[y]=$e(F))});const j=Object.keys(O).length!==0?Ft({props:O},P):P,_=S.isValidElement(j),D=_&&G(l,!0)&&!l.voidElement,R=d&&L(j)&&j.dummy&&!_,q=L(s)&&Object.hasOwnProperty.call(s,l.name);if(z(j)){const y=r.services.interpolator.interpolate(j,g,r.language);f.push(y)}else if(G(j)||D){const y=x(j,l,k);v(j,y,f,V)}else if(R){const y=u(E,l.children,k);v(j,y,f,V)}else if(Number.isNaN(parseFloat(l.name)))if(q){const y=x(j,l,k);v(j,y,f,V,l.voidElement)}else if(a.transSupportBasicHtmlNodes&&c.indexOf(l.name)>-1)if(l.voidElement)f.push(S.createElement(l.name,{key:`${l.name}-${V}`}));else{const y=u(E,l.children,k);f.push(S.createElement(l.name,{key:`${l.name}-${V}`},y))}else if(l.voidElement)f.push(`<${l.name} />`);else{const y=u(E,l.children,k);f.push(`<${l.name}>${y}</${l.name}>`)}else if(L(j)&&!_){const y=l.children[0]?T:null;y&&f.push(y)}else v(j,T,f,V,l.children.length!==1||!T)}else if(l.type==="text"){const P=a.transWrapTextNodes,O=typeof a.unescape=="function"?a.unescape:je().unescape,j=o?O(r.services.interpolator.interpolate(l.content,g,r.language)):r.services.interpolator.interpolate(l.content,g,r.language);P?f.push(S.createElement(P,{key:`${l.name}-${V}`},j)):f.push(j)}return f},[])},h=u([{dummy:!0,children:e||[]}],A,U(e||[]));return J(h[0])},we=(e,s,n)=>{const r=e.key||s,a=S.cloneElement(e,{key:r});if(!a.props||!a.props.children||n.indexOf(`${s}/>`)<0&&n.indexOf(`${s} />`)<0)return a;function i(){return S.createElement(S.Fragment,null,a)}return S.createElement(i,{key:r})},qt=(e,s)=>e.map((n,r)=>we(n,r,s)),Mt=(e,s)=>{const n={};return Object.keys(e).forEach(r=>{Object.assign(n,{[r]:we(e[r],r,s)})}),n},Bt=(e,s,n,r)=>e?Array.isArray(e)?qt(e,s):L(e)?Mt(e,s):(ye(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 Kt({children:e,count:s,parent:n,i18nKey:r,context:a,tOptions:i={},values:o,defaults:c,components:d,ns:m,i18n:p,t:w,shouldUnescape:A,...g}){const x=p||be();if(!x)return ye(x,"NO_I18NEXT_INSTANCE","Trans: You need to pass in an i18next instance using i18nextReactModule",{i18nKey:r}),e;const v=w||x.t.bind(x)||(M=>M),u={...je(),...x.options?.react};let h=m||v.ns||x.options?.defaultNS;h=z(h)?[h]:h||["translation"];const{transDefaultProps:b}=u,C=b?.tOptions?{...b.tOptions,...i}:i,k=A??b?.shouldUnescape,E=b?.values?{...b.values,...o}:o,$=b?.components?{...b.components,...d}:d,f=Se(e,u,x,r),l=c||C?.defaultValue||f||u.transEmptyNodeValue||(typeof r=="function"?Pe(r):r),{hashTransKey:V}=u,T=r||(V?V(f||l):f||l);x.options?.interpolation?.defaultVariables?o=E&&Object.keys(E).length>0?{...E,...x.options.interpolation.defaultVariables}:{...x.options.interpolation.defaultVariables}:o=E;const P=Lt(e);P&&typeof P.count=="number"&&s===void 0&&(s=P.count);const O=o||s!==void 0&&!x.options?.interpolation?.alwaysFormat||!e?C.interpolation:{interpolation:{...C.interpolation,prefix:"#$?",suffix:"?$#"}},j={...C,context:a||C.context,count:s,...o,...O,defaultValue:l,ns:h};let _=T?v(T,j):l;_===T&&l&&(_=l);const D=Bt($,_,x,r);let R=D||e,q=null;Ht(D)&&(q=D,R=e);const y=zt(R,q,_,x,u,j,k),F=n??u.defaultTransParent;return F?S.createElement(F,g,y):y}function ge({children:e,count:s,parent:n,i18nKey:r,context:a,tOptions:i={},values:o,defaults:c,components:d,ns:m,i18n:p,t:w,shouldUnescape:A,...g}){const{i18n:x,defaultNS:v}=S.useContext(We)||{},u=p||x||be(),h=w||u?.t.bind(u);return Kt({children:e,count:s,parent:n,i18nKey:r,context:a,tOptions:i,values:o,defaults:c,components:d,ns:m||h?.ns||v||u?.options?.defaultNS,i18n:u,t:w,shouldUnescape:A,...g})}async function Yt(){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 Gt(){return ve({queryKey:["cliproxy-sync-status"],queryFn:Yt,refetchInterval:3e4,retry:1,staleTime:1e4})}function Jt(){const e=ut();return dt({mutationFn:Zt,onSuccess:s=>{e.invalidateQueries({queryKey:["cliproxy-sync-status"]}),e.invalidateQueries({queryKey:["cliproxy-sync-preview"]}),s.syncedCount===0?se.info("No profiles to sync"):se.success(`Synced ${s.syncedCount} profile${s.syncedCount===1?"":"s"} to CLIProxy`)},onError:s=>{se.error(`Sync failed: ${s.message}`)}})}function fe(e){return e.replace(/-\d+$/,"").split(".").map(Number)}function le(e,s){const n=fe(e),r=fe(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 he({className:e,compact:s=!1,state:n,isLoading:r,isSaving:a,error:i,onApply:o}){const c=n?.strategy??"round-robin",[d,m]=S.useState(c),[p,w]=S.useState(!1),A=n?.source==="live"?"Live CLIProxy":"Saved startup default",g=r||a||!n||d===c,x=p?"Hide details":"Show details";if(s){const v=u=>{m(u),u!==c&&o(u)};return t.jsxs("div",{className:W("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(me,{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(K,{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:W("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(([u,h])=>{const b=d===u;return t.jsx("button",{type:"button",className:W("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",b?"text-foreground group-hover/routing:text-primary":"text-muted-foreground/70 hover:text-foreground/90 group-hover/routing:text-muted-foreground/90"),onClick:()=>v(u),disabled:r||a||!!i,title:h.description,children:h.title},u)})]})]})}return t.jsx("section",{className:W("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(me,{className:"h-4 w-4"})}),t.jsx("div",{className:"text-sm font-medium",children:"Routing strategy"}),t.jsx(H,{variant:"secondary",children:c}),n?t.jsx(H,{variant:"outline",children:A}):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(([v,u])=>{const h=d===v;return t.jsx("button",{type:"button",className:W("rounded-md px-3 py-1.5 text-sm font-medium transition-colors",h?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),onClick:()=>m(v),disabled:r||a||!!i,children:u.title},v)})}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[t.jsxs(Y,{type:"button",variant:"ghost",size:"sm",className:"h-8 px-2 text-xs text-muted-foreground",onClick:()=>w(v=>!v),children:[p?t.jsx(pt,{className:"mr-1 h-3.5 w-3.5"}):t.jsx(xt,{className:"mr-1 h-3.5 w-3.5"}),x]}),t.jsx(Y,{size:"sm",onClick:()=>o(d),disabled:g||!!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:"Round robin spreads usage."}),t.jsx("span",{className:"hidden text-border sm:inline",children:"•"}),t.jsx("span",{children:"Fill first keeps backup accounts cold until they are needed."})]}),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,p?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(([v,u])=>{const h=c===v;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:u.title}),h?t.jsx(H,{variant:"secondary",children:"Current"}):null]}),t.jsx("p",{className:"text-xs leading-5 text-muted-foreground",children:u.description})]},v)})}):null]})})}function Qt(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(Qe,{children:[t.jsx(Xe,{asChild:!0,children:t.jsx(Y,{variant:o==="destructive-ghost"?"ghost":o,size:"sm",className:W("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(K,{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}=Oe(),{data:s,isLoading:n}=_e(),{data:r}=De(),{data:a,isLoading:i}=Ie(),{data:o,isLoading:c,error:d}=Re(),m=Fe(),p=Le(),w=Ue(),A=ze(),g=qe(),{data:x}=Gt(),{mutate:v,isPending:u}=Jt(),[h,b]=S.useState(!1),[C,k]=S.useState(""),[E,$]=S.useState(!1),[f,l]=S.useState(null),[V,T]=S.useState(null),{data:P}=ve({queryKey:["cliproxy-server-config"],queryFn:()=>tt.cliproxyServer.get(),staleTime:3e4}),O=mt({mutationKey:["update-backend"]})>0,j=P?.remote,_=j?.enabled&&j?.host,D=s?.running??!1,R=p.isPending||w.isPending||A.isPending||g.isPending||O||u,q=r?.hasUpdate??!1,y=r?.isStable===!1,F=r?.currentVersion,M=x?.configured??!1,Ce=e(M?"proxyStatusWidget.syncReady":"proxyStatusWidget.noConfig"),Q=y?r?.maxStableVersion||a?.latestStable:r?.latestVersion,ce=a?.maxStableVersion||r?.maxStableVersion||"6.6.80",B=a?.faultyRange,ke=B&&`${B.min.replace(/-\d+$/,"")}-${B.max.replace(/-\d+$/,"")}`,X=(N,I)=>{l(N),T(I),$(!0)},ue=async N=>{if(!N)return;const I=ae(N,ce);if(B!==void 0&&ie(N,B.min,B.max)){X(N,"faulty");return}if(I){X(N,"experimental");return}try{const de=await g.mutateAsync({version:N});de.requiresConfirmation&&X(N,de.isFaulty?"faulty":"experimental")}catch{}},Ae=()=>{f&&g.mutate({version:f,force:!0}),$(!1),l(null),T(null)},Ee=()=>{$(!1),l(null),T(null)},Te=_?(()=>{const N=j.protocol||"http",I=j.port||(N==="https"?443:80);return N==="https"&&I===443||N==="http"&&I===80?j.host:`${j.host}:${I}`})():null;return _?t.jsxs("div",{className:W("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(he,{compact:!0,className:"mt-3",state:o,isLoading:c,isSaving:m.isPending,error:d instanceof Error?d:null,onApply:N=>m.mutate(N)},`remote:${o?.strategy??"round-robin"}`)]}):t.jsx(Me,{delayDuration:300,children:t.jsxs("div",{className:W("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:W("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(K,{className:"w-3 h-3 animate-spin text-muted-foreground"}):D?t.jsxs(t.Fragment,{children:[t.jsx(Z,{icon:u?K:ht,tooltip:e("proxyStatusWidget.tooltipSync"),onClick:()=>v(),disabled:!M||R,isPending:u}),t.jsx(Z,{icon:yt,tooltip:e("proxyStatusWidget.tooltipRestart"),onClick:()=>A.mutate(),disabled:R,isPending:A.isPending}),t.jsx(Z,{icon:bt,tooltip:e("proxyStatusWidget.tooltipStop"),onClick:()=>w.mutate(),disabled:R,isPending:w.isPending,variant:"destructive-ghost"})]}):null,t.jsx(Z,{icon:h?jt:vt,tooltip:e(h?"proxyStatusWidget.tooltipClose":"proxyStatusWidget.tooltipVersionSettings"),onClick:()=>b(!h),className:h?"bg-muted":void 0})]})]}),F&&t.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[t.jsxs("span",{className:W("text-xs font-mono text-muted-foreground",y&&"text-amber-600 dark:text-amber-400"),children:["v",F]}),(q||y)&&Q&&t.jsxs(H,{variant:"secondary",className:W("text-[10px] h-4 px-1.5 gap-0.5 cursor-pointer transition-colors",y?"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 ue(Q),title:e(y?"proxyStatusWidget.clickToDowngrade":"proxyStatusWidget.clickToUpdate"),children:[y?t.jsx(Nt,{className:"w-2.5 h-2.5"}):t.jsx(St,{className:"w-2.5 h-2.5"}),Q]})]}),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"}),Qt(s.startedAt)]})]}),t.jsxs("div",{className:"mt-2 flex items-center gap-1.5 text-xs",children:[M?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:W("text-xs",M?"text-green-600 dark:text-green-400":"text-muted-foreground"),children:Ce})]}),t.jsx(he,{compact:!0,className:"mt-3",state:o,isLoading:c,isSaving:m.isPending,error:d instanceof Error?d:null,onApply:N=>m.mutate(N)},`local:${o?.strategy??"round-robin"}`),t.jsx(Be,{open:h,onOpenChange:b,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(Ke,{value:C,onValueChange:k,disabled:i,children:[t.jsx(Ye,{className:"h-8 text-xs flex-1",children:t.jsx(Ze,{placeholder:e("proxyStatusWidget.selectVersionPlaceholder")})}),t.jsx(Ge,{children:a?.versions.slice(0,20).map(N=>{const I=a?.maxStableVersion&&ae(N,a.maxStableVersion),ee=a?.faultyRange&&ie(N,a.faultyRange.min,a.faultyRange.max);return t.jsx(Je,{value:N,className:"text-xs",children:t.jsxs("span",{className:"flex items-center gap-2",children:["v",N,N===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:"⚠"})]})},N)})})]}),t.jsxs(Y,{variant:"outline",size:"sm",className:"h-8 text-xs gap-1.5 px-3",onClick:()=>void ue(C),disabled:g.isPending||!C,children:[g.isPending?t.jsx(K,{className:"w-3.5 h-3.5 animate-spin"}):t.jsx(Et,{className:"w-3.5 h-3.5"}),e("proxyStatusWidget.install")]})]}),C&&a?.maxStableVersion&&ae(C,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})})]}),C&&a?.faultyRange&&ie(C,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:C})})]}),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(Y,{variant:"outline",size:"sm",className:"h-7 text-xs gap-1",onClick:()=>p.mutate(),disabled:p.isPending,children:[p.isPending?t.jsx(K,{className:"w-3 h-3 animate-spin"}):t.jsx(Tt,{className:"w-3 h-3"}),e("proxyStatusWidget.start")]})]}),t.jsx(st,{open:E,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(V==="faulty"?"proxyStatusWidget.installFaultyTitle":"proxyStatusWidget.installUnstableTitle")]}),t.jsxs(it,{className:"space-y-2",children:[V==="faulty"?t.jsx("p",{children:t.jsx(ge,{i18nKey:"proxyStatusWidget.installFaultyDesc",values:{version:f??"",range:ke||""},components:{strong:t.jsx("strong",{})}})}):t.jsx("p",{children:t.jsx(ge,{i18nKey:"proxyStatusWidget.installUnstableDesc",values:{version:f??"",maxStable:ce},components:{strong:t.jsx("strong",{})}})}),t.jsx("p",{className:"text-amber-600 dark:text-amber-400",children:e(V==="faulty"?"proxyStatusWidget.installFaultyWarning":"proxyStatusWidget.installUnstableWarning")}),t.jsx("p",{children:e("proxyStatusWidget.installUnstableConfirm")})]})]}),t.jsxs(ot,{children:[t.jsx(lt,{onClick:Ee,children:e("proxyStatusWidget.cancel")}),t.jsx(ct,{onClick:Ae,className:"bg-amber-500 hover:bg-amber-600 text-white",children:e("proxyStatusWidget.installAnyway")})]})]})})]})})}export{os as P};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-Zb8sVEtn.js";import{r as y}from"./react-vendor-CNOkPC89.js";import{t as k}from"./notifications-B2HqRBj7.js";import{B as R,d as a,c as E,b8 as z,W as S}from"./index-
|
|
1
|
+
import{j as e}from"./radix-ui-Zb8sVEtn.js";import{r as y}from"./react-vendor-CNOkPC89.js";import{t as k}from"./notifications-B2HqRBj7.js";import{B as R,d as a,c as E,b8 as z,W as S}from"./index-DSM3luVm.js";import{aW as B,L as m,at as L,o as P,R as T}from"./icons-KVCk4_U8.js";function F({title:c,pathLabel:x,loading:t,parseWarning:r,readWarning:i,value:s,dirty:n,readOnly:h=!1,saving:f,saveDisabled:j,onChange:p,onSave:u,onRefresh:b,onDiscard:l,language:v="json",loadingLabel:N="Loading settings.json...",parseWarningLabel:g="Parse warning",ownershipNotice:d}){const[w,o]=y.useState(!1),C=async()=>{s&&(await navigator.clipboard.writeText(s),o(!0),k.success(S.t("commonToast.settingsCopied")),window.setTimeout(()=>o(!1),1500))};return e.jsxs("div",{className:"h-full flex flex-col",children:[e.jsxs("div",{className:"p-4 border-b bg-background flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs("h2",{className:"font-semibold flex items-center gap-2",children:[e.jsx(B,{className:"h-4 w-4 text-primary"}),c,n&&e.jsx(R,{variant:"secondary",className:"text-[10px]",children:"Unsaved"})]}),e.jsx("p",{className:"text-xs text-muted-foreground font-mono truncate",children:x})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(a,{size:"sm",onClick:u,disabled:j,children:[f?e.jsx(m,{className:"h-4 w-4 mr-1 animate-spin"}):e.jsx(L,{className:"h-4 w-4 mr-1"}),"Save"]}),l?e.jsx(a,{variant:"outline",size:"sm",onClick:l,disabled:!n||t,children:"Discard"}):null,e.jsxs(a,{variant:"outline",size:"sm",onClick:C,disabled:!s,children:[e.jsx(P,{className:"h-4 w-4 mr-1"}),w?"Copied":"Copy"]}),e.jsx(a,{variant:"outline",size:"sm",onClick:b,"aria-label":"Refresh raw config",children:e.jsx(T,{className:E("h-4 w-4",t?"animate-spin":"")})})]})]}),e.jsx("div",{className:"flex-1 overflow-auto",children:t?e.jsxs("div",{className:"h-full flex items-center justify-center text-muted-foreground",children:[e.jsx(m,{className:"h-5 w-5 animate-spin mr-2"}),N]}):e.jsxs("div",{className:"flex h-full min-h-0 flex-col",children:[d&&e.jsx("div",{className:"mx-4 mt-4",children:d}),r&&e.jsxs("div",{className:"mx-4 mt-4 rounded-md border border-amber-300 bg-amber-50 px-3 py-2 text-sm text-amber-800 dark:bg-amber-950/20 dark:text-amber-300",children:[g,": ",r]}),i&&e.jsxs("div",{className:"mx-4 mt-4 rounded-md border border-destructive/40 bg-destructive/5 px-3 py-2 text-sm text-destructive",children:["Read-only: ",i]}),e.jsx("div",{className:"min-h-0 flex-1 p-4 pt-3",children:e.jsx("div",{className:"h-full rounded-md border overflow-hidden bg-background",children:e.jsx(z,{value:s,onChange:p,language:v,readonly:h,minHeight:"100%",heightMode:"fill-parent"})})})]})})]})}const A=F;export{F as R,A as a};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as n}from"./radix-ui-Zb8sVEtn.js";import{r as a}from"./react-vendor-CNOkPC89.js";import{e as _,f as P,d as $,c as w,g as B,I as G}from"./index-
|
|
1
|
+
import{j as n}from"./radix-ui-Zb8sVEtn.js";import{r as a}from"./react-vendor-CNOkPC89.js";import{e as _,f as P,d as $,c as w,g as B,I as G}from"./index-DSM3luVm.js";import{aQ as H,au as L,m as V}from"./icons-KVCk4_U8.js";function S(o){return o.trim().toLowerCase()}function M(o,h){return`${o}-option-${h.replace(/[^a-z0-9_-]+/gi,"-")}`}function Z({value:o,onChange:h,options:f,groups:g,placeholder:j,searchPlaceholder:k,emptyText:E,disabled:F,className:q,triggerClassName:K,contentClassName:R}){const[l,T]=a.useState(!1),[y,A]=a.useState(""),[i,c]=a.useState(),m=a.useId(),I=a.useRef(null),N=a.useRef({}),O=a.useMemo(()=>f.find(e=>e.value===o),[f,o]),d=a.useMemo(()=>{const e=S(y);return e?f.filter(t=>[t.searchText,...t.keywords??[]].some(u=>S(u).includes(e))):f},[f,y]),z=a.useMemo(()=>{const e=new Map((g??[]).map(r=>[r.key,r])),t=d.filter(r=>!r.groupKey||!e.has(r.groupKey)),u=(g??[]).map(r=>({...r,options:d.filter(x=>x.groupKey===r.key)})).filter(r=>r.options.length>0);return t.length===0?u:[{key:"__default",options:t},...u]},[d,g]),s=a.useMemo(()=>d.filter(e=>!e.disabled),[d]),D=O?.triggerContent??O?.itemContent,v=e=>{T(e),e||(A(""),c(void 0))},b=()=>I.current?.focus();a.useEffect(()=>{if(l){if(s.length===0){c(void 0);return}c(e=>e&&s.some(t=>t.value===e)?e:s.find(t=>t.value===o)?.value??s[0]?.value)}},[s,l,o]),a.useEffect(()=>{!l||!i||N.current[i]?.scrollIntoView({block:"nearest"})},[i,l]);const p=e=>{if(s.length===0)return;if(e==="first"){c(s[0]?.value);return}if(e==="last"){c(s.at(-1)?.value);return}const t=s.findIndex(U=>U.value===i),u=e==="next"?-1:s.length,r=t>=0?t:u,x=e==="next"?Math.min(r+1,s.length-1):Math.max(r-1,0);c(s[x]?.value)},C=e=>{h(e),v(!1)},Q=()=>{if(!i)return;const e=s.find(t=>t.value===i);e&&C(e.value)};return n.jsxs(_,{open:l,onOpenChange:v,children:[n.jsx(P,{asChild:!0,children:n.jsxs($,{type:"button",variant:"outline","aria-expanded":l,"aria-controls":l?m:void 0,"aria-haspopup":"dialog",disabled:F,onKeyDown:e=>{if(e.key!=="ArrowDown"&&e.key!=="ArrowUp")return;e.preventDefault(),v(!0);const t=()=>{b(),p(e.key==="ArrowDown"?"first":"last")};if(typeof requestAnimationFrame=="function"){requestAnimationFrame(t);return}setTimeout(t,0)},className:w("w-full justify-between font-normal",q,K,!D&&"text-muted-foreground"),children:[n.jsx("div",{className:"min-w-0 flex-1 text-left",children:D??n.jsx("span",{children:j})}),n.jsx(H,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),n.jsxs(B,{align:"start",className:w("w-[var(--radix-popover-trigger-width)] p-0",R),onOpenAutoFocus:e=>{if(e.preventDefault(),typeof requestAnimationFrame=="function"){requestAnimationFrame(b);return}setTimeout(b,0)},children:[n.jsx("div",{className:"border-b p-2",children:n.jsxs("div",{className:"relative",children:[n.jsx(L,{className:"text-muted-foreground absolute left-2.5 top-1/2 h-4 w-4 -translate-y-1/2"}),n.jsx(G,{ref:I,value:y,onChange:e=>A(e.target.value),role:"combobox","aria-label":k,"aria-autocomplete":"list","aria-expanded":l,"aria-controls":m,"aria-activedescendant":i?M(m,i):void 0,onKeyDown:e=>{if(e.key==="ArrowDown"){e.preventDefault(),p("next");return}if(e.key==="ArrowUp"){e.preventDefault(),p("previous");return}if(e.key==="Home"){e.preventDefault(),p("first");return}if(e.key==="End"){e.preventDefault(),p("last");return}if(e.key==="Enter"){e.preventDefault(),Q();return}e.key==="Escape"&&(e.preventDefault(),v(!1))},placeholder:k,className:"pl-8"})]})}),n.jsx("div",{"data-slot":"searchable-select-scroll-container","data-testid":"searchable-select-scroll-container",className:"max-h-72 overflow-y-auto overscroll-contain",children:d.length===0?n.jsx("div",{className:"px-3 py-6 text-center text-sm text-muted-foreground",children:E}):n.jsx("div",{id:m,role:"listbox","aria-label":j,className:"p-1",children:z.map(e=>n.jsxs("div",{children:[e.label&&n.jsx("div",{className:"px-2 py-1.5 text-xs font-medium text-muted-foreground",children:e.label}),e.options.map(t=>{const u=t.value===i,r=t.value===o;return n.jsxs("button",{id:M(m,t.value),type:"button",role:"option","aria-selected":r,disabled:t.disabled,tabIndex:-1,ref:x=>{N.current[t.value]=x},onMouseMove:()=>{t.disabled||c(t.value)},onFocus:()=>{t.disabled||c(t.value)},onClick:()=>C(t.value),className:w("hover:bg-accent hover:text-accent-foreground flex w-full items-center gap-2 rounded-sm px-2 py-1.5 text-left text-sm outline-none","focus-visible:ring-ring focus-visible:ring-1",u&&"bg-accent text-accent-foreground",r&&"bg-accent text-accent-foreground",t.disabled&&"pointer-events-none opacity-50"),children:[n.jsx("div",{className:"min-w-0 flex-1",children:t.itemContent}),r&&n.jsx(V,{className:"h-4 w-4 shrink-0"})]},t.value)})]},e.key))})})]})]})}export{Z as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i,a0 as n}from"./radix-ui-Zb8sVEtn.js";import"./react-vendor-CNOkPC89.js";import{c as e}from"./index-
|
|
1
|
+
import{j as i,a0 as n}from"./radix-ui-Zb8sVEtn.js";import"./react-vendor-CNOkPC89.js";import{c as e}from"./index-DSM3luVm.js";function m({className:t,orientation:a="horizontal",decorative:o=!0,...r}){return i.jsx(n,{"data-slot":"separator",decorative:o,orientation:a,className:e("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...r})}export{m as S};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-Zb8sVEtn.js";import{r as j}from"./react-vendor-CNOkPC89.js";import{a as Q,bm as ee,bn as se,bo as te,Q as ae,R as re,U as ne,B as $,be as S,bf as M,bg as L,d as I,I as le,n as B,c as U,C as ie,b as de}from"./index-DpF_8BcK.js";import{a3 as ce,aa as oe,b7 as me,T as E,R as T,F as he,au as ue,w as xe}from"./icons-KVCk4_U8.js";import"./tanstack-CrmUhA7Z.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";function Se(){const{t:s}=Q(),[a,l]=j.useState("commands"),t={commands:s("sharedPage.commands"),skills:s("sharedPage.skills"),agents:s("sharedPage.agents")},[r,d]=j.useState(""),[n,o]=j.useState(null),{data:c,isError:h,error:p,refetch:w}=ee(),{data:m,isLoading:x,isFetching:y,isError:g,error:q,refetch:D}=se(a),N=m?.items??[],C=r.trim().toLowerCase(),b=r.trim(),u=j.useMemo(()=>{const i=m?.items??[];return C?i.filter(v=>[v.name,v.description,v.path].some(Y=>Y.toLowerCase().includes(C))):i},[m,C]),f=j.useMemo(()=>u.length===0?null:n?u.find(i=>i.path===n)??u[0]:u[0],[u,n]),{data:P,isLoading:O,isError:_,error:W,refetch:V}=te(a,f?.path??null),z=[{id:"commands",label:t.commands,icon:ce,count:c?.commands??0},{id:"skills",label:t.skills,icon:oe,count:c?.skills??0},{id:"agents",label:t.agents,icon:me,count:c?.agents??0}],H=z.reduce((i,v)=>i+v.count,0),K=!x&&!g&&N.length===0,Z=!x&&!g&&N.length>0&&u.length===0,G=A(p,"Shared item totals could not be loaded. Listing still works."),J=A(q,`Unable to fetch shared ${a}. Please try again.`),X=A(W,`Unable to load content for ${f?.name??"selected item"}.`);return e.jsxs("div",{className:"h-full overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"p-6 pb-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:s("sharedPage.title")}),e.jsx("p",{className:"text-muted-foreground",children:s("sharedPage.subtitle")})]}),e.jsx(ae,{value:a,onValueChange:i=>{l(i),d(""),o(null)},children:e.jsx(re,{className:"h-auto flex-wrap justify-start",children:z.map(i=>e.jsxs(ne,{value:i.id,className:"flex items-center gap-2",children:[e.jsx(i.icon,{className:"w-4 h-4"}),e.jsx("span",{children:i.label}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",i.count,")"]})]},i.id))})})]}),e.jsxs("div",{className:"flex flex-col gap-2 lg:items-end",children:[e.jsxs("div",{className:"grid w-full gap-2 sm:w-auto sm:min-w-[340px] sm:grid-cols-3",children:[e.jsx(F,{label:s("sharedPage.totalShared"),value:H}),e.jsx(F,{label:t[a],value:N.length}),e.jsx(F,{label:s("sharedPage.visible"),value:u.length})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx($,{variant:"secondary",children:s("sharedPage.markdownDetail")}),b?e.jsxs($,{variant:"outline",children:[s("sharedPage.filterPrefix")," ",b]}):null]})]})]}),c&&!c.symlinkStatus.valid&&e.jsxs(S,{variant:"warning",children:[e.jsx(E,{className:"h-4 w-4"}),e.jsx(M,{children:s("sharedPage.configurationRequired")}),e.jsxs(L,{children:[c.symlinkStatus.message,". Run `ccs sync` to configure."]})]}),h&&e.jsxs(S,{variant:"info",children:[e.jsx(E,{className:"h-4 w-4"}),e.jsx(M,{children:s("sharedPage.countsUnavailable")}),e.jsxs(L,{children:[e.jsx("p",{children:G}),e.jsx("div",{className:"mt-3",children:e.jsxs(I,{size:"sm",variant:"outline",onClick:()=>{w()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),s("sharedPage.retryCounts")]})})]})]})]}),e.jsx("div",{className:"flex-1 min-h-0 px-6 pb-6",children:e.jsx("div",{className:"h-full rounded-lg border overflow-hidden bg-background",children:e.jsxs("div",{className:"grid h-full min-h-0 lg:grid-cols-[320px_minmax(0,1fr)]",children:[e.jsxs("div",{className:"min-h-0 border-b lg:border-b-0 lg:border-r flex flex-col bg-muted/30",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(he,{className:"w-4 h-4 text-primary shrink-0"}),e.jsx("h2",{className:"font-semibold truncate",children:t[a]})]}),!x&&!g&&e.jsxs($,{variant:"outline",className:"text-[10px] h-5",children:[u.length,"/",N.length]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(ue,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(le,{value:r,onChange:i=>d(i.target.value),placeholder:s("sharedPage.filterPlaceholder",{tab:a}),"aria-label":s("sharedPage.filterPlaceholder",{tab:a}),className:"pl-8 h-9"})]}),!x&&!g&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s("sharedPage.showing",{visible:u.length,total:N.length,tab:a}),b?s("sharedPage.showingQuery",{query:b}):"",y?s("sharedPage.refreshing"):""]})]}),e.jsx(B,{className:"flex-1 min-h-0",children:x?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("sharedPage.loadingShared",{tab:a})}):g?e.jsx("div",{className:"p-4 text-center",children:e.jsxs("div",{className:"space-y-3 py-8",children:[e.jsx(xe,{className:"w-10 h-10 mx-auto text-destructive/50"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s("sharedPage.failedLoadShared",{tab:a})}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:J})]}),e.jsxs(I,{size:"sm",variant:"outline",onClick:()=>{D()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),s("sharedPage.retry")]})]})}):K?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("sharedPage.noSharedFound",{tab:a})}):Z?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("sharedPage.noMatch",{tab:a,query:b})}):e.jsx("div",{className:"p-2 space-y-1",children:u.map(i=>e.jsxs("button",{type:"button",onClick:()=>o(i.path),className:U("w-full text-left p-3 rounded-md border transition-colors",f?.path===i.path?"bg-primary/10 border-primary/30":"bg-background hover:bg-muted border-transparent"),children:[e.jsx("p",{className:"text-sm font-medium truncate",children:i.name}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:i.description}),e.jsx("p",{className:"text-[11px] text-muted-foreground/90 mt-2 font-mono truncate",children:i.path})]},`${i.type}:${i.path}`))})})]}),e.jsx("div",{className:"min-w-0 min-h-0 flex flex-col bg-muted/20",children:f?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-4 py-3 border-b bg-background",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold truncate",children:f.name}),e.jsx($,{variant:"outline",className:"uppercase text-[10px]",children:f.type})]})}),e.jsxs("div",{className:"p-4 space-y-4 min-h-0 flex-1 flex flex-col",children:[e.jsx("div",{className:"rounded-md border bg-muted/35 p-3",children:e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:[e.jsx(R,{label:s("sharedPage.pathLabel"),value:f.path,mono:!0}),P?.contentPath&&P.contentPath!==f.path&&e.jsx(R,{label:s("sharedPage.resolvedSource"),value:P.contentPath,mono:!0})]})}),e.jsx(ie,{className:"min-h-0 flex-1",children:e.jsx(de,{className:"p-0 h-full",children:e.jsx(B,{className:"h-full px-5 py-4",children:O?e.jsx("p",{className:"text-sm text-muted-foreground",children:s("sharedPage.loadingMarkdown")}):_?e.jsxs(S,{variant:"destructive",className:"max-w-2xl",children:[e.jsx(E,{className:"h-4 w-4"}),e.jsx(M,{children:s("sharedPage.failedLoadContent")}),e.jsxs(L,{children:[e.jsx("p",{children:X}),e.jsx("div",{className:"mt-3",children:e.jsxs(I,{size:"sm",variant:"outline",onClick:()=>{V()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),s("sharedPage.retryContent")]})})]})]}):e.jsx(pe,{content:P?.content??""})})})})]})]}):e.jsx("div",{className:"min-h-[320px] flex items-center justify-center p-6 text-center text-muted-foreground",children:s("sharedPage.selectOne",{tab:a.slice(0,-1)})})})]})})})]})}function F({label:s,value:a}){return e.jsxs("div",{className:"rounded-md border bg-muted/30 px-3 py-2",children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:s}),e.jsx("p",{className:"text-lg font-semibold leading-tight mt-1",children:a})]})}function R({label:s,value:a,mono:l=!1}){return e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:s}),e.jsx("p",{className:U("text-xs mt-1 break-words",l?"font-mono":"text-sm"),children:a})]})}function A(s,a){if(!(s instanceof Error))return a;const l=s.message.toLowerCase();return l.includes("failed to fetch")||l.includes("network")?"Connection to dashboard server lost or restarting. Keep `ccs config` running, then retry.":s.message||a}function pe({content:s}){const{t:a}=Q(),l=j.useMemo(()=>fe(s),[s]);return l.blocks.length===0&&l.frontmatter.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:a("sharedPage.noMarkdown")}):e.jsxs("div",{className:"space-y-5",children:[l.frontmatter.length>0?e.jsx("div",{className:"rounded-md border bg-muted/35 p-3",children:e.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:l.frontmatter.map(t=>e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:ge(t.key)}),e.jsx("p",{className:"text-xs mt-1 break-words",children:t.value})]},`${t.key}:${t.value}`))})}):null,l.blocks.map((t,r)=>{if(t.type==="heading"){const d=t.level<=1?"text-xl font-semibold":t.level===2?"text-lg font-semibold":"text-base font-semibold";return e.jsx("h3",{className:d,children:k(t.text,`heading-${r}`)},`heading-${r}`)}return t.type==="paragraph"?e.jsx("p",{className:"text-sm leading-6 whitespace-pre-wrap",children:k(t.text,`paragraph-${r}`)},`paragraph-${r}`):t.type==="unordered-list"?e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm leading-6",children:t.items.map((d,n)=>e.jsx("li",{children:k(d,`ul-item-${r}-${n}`)},`ul-item-${r}-${n}`))},`ul-${r}`):t.type==="ordered-list"?e.jsx("ol",{className:"list-decimal pl-5 space-y-1 text-sm leading-6",children:t.items.map((d,n)=>e.jsx("li",{children:k(d,`ol-item-${r}-${n}`)},`ol-item-${r}-${n}`))},`ol-${r}`):e.jsxs("div",{className:"rounded-md border bg-muted/60 p-3 font-mono text-xs leading-5 overflow-x-auto",children:[t.language&&e.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground mb-2",children:t.language}),e.jsx("pre",{className:"whitespace-pre-wrap break-words m-0",children:t.content})]},`code-${r}`)})]})}function ge(s){return s.replace(/[-_]/g," ")}function k(s,a){const l=/(\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*|\[([^\]]+)\]\(([^)]+)\))/g,t=[];let r=0,d=0;for(const n of s.matchAll(l)){const o=n[0],c=n.index??0;if(c>r&&t.push(s.slice(r,c)),n[2])t.push(e.jsx("strong",{className:"font-semibold",children:n[2]},`${a}-strong-${d}`));else if(n[3])t.push(e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.82em]",children:n[3]},`${a}-code-${d}`));else if(n[4])t.push(e.jsx("em",{className:"italic",children:n[4]},`${a}-em-${d}`));else if(n[5]&&n[6]){const h=n[6].trim();/^(https?:\/\/|mailto:)/i.test(h)?t.push(e.jsx("a",{href:h,target:"_blank",rel:"noreferrer",className:"text-primary underline underline-offset-2 hover:opacity-90",children:n[5]},`${a}-link-${d}`)):t.push(n[5])}else t.push(o);r=c+o.length,d+=1}return r<s.length&&t.push(s.slice(r)),t.length===0?[s]:t}function fe(s){const a=s.replace(/\r\n/g,`
|
|
1
|
+
import{j as e}from"./radix-ui-Zb8sVEtn.js";import{r as j}from"./react-vendor-CNOkPC89.js";import{a as Q,bm as ee,bn as se,bo as te,Q as ae,R as re,U as ne,B as $,be as S,bf as M,bg as L,d as I,I as le,n as B,c as U,C as ie,b as de}from"./index-DSM3luVm.js";import{a3 as ce,aa as oe,b7 as me,T as E,R as T,F as he,au as ue,w as xe}from"./icons-KVCk4_U8.js";import"./tanstack-CrmUhA7Z.js";import"./notifications-B2HqRBj7.js";import"./utils-CzKF5WmX.js";import"./form-utils-Bcoyqxpq.js";import"./code-highlight-BRUf_pqB.js";function Se(){const{t:s}=Q(),[a,l]=j.useState("commands"),t={commands:s("sharedPage.commands"),skills:s("sharedPage.skills"),agents:s("sharedPage.agents")},[r,d]=j.useState(""),[n,o]=j.useState(null),{data:c,isError:h,error:p,refetch:w}=ee(),{data:m,isLoading:x,isFetching:y,isError:g,error:q,refetch:D}=se(a),N=m?.items??[],C=r.trim().toLowerCase(),b=r.trim(),u=j.useMemo(()=>{const i=m?.items??[];return C?i.filter(v=>[v.name,v.description,v.path].some(Y=>Y.toLowerCase().includes(C))):i},[m,C]),f=j.useMemo(()=>u.length===0?null:n?u.find(i=>i.path===n)??u[0]:u[0],[u,n]),{data:P,isLoading:O,isError:_,error:W,refetch:V}=te(a,f?.path??null),z=[{id:"commands",label:t.commands,icon:ce,count:c?.commands??0},{id:"skills",label:t.skills,icon:oe,count:c?.skills??0},{id:"agents",label:t.agents,icon:me,count:c?.agents??0}],H=z.reduce((i,v)=>i+v.count,0),K=!x&&!g&&N.length===0,Z=!x&&!g&&N.length>0&&u.length===0,G=A(p,"Shared item totals could not be loaded. Listing still works."),J=A(q,`Unable to fetch shared ${a}. Please try again.`),X=A(W,`Unable to load content for ${f?.name??"selected item"}.`);return e.jsxs("div",{className:"h-full overflow-hidden flex flex-col",children:[e.jsxs("div",{className:"p-6 pb-4 space-y-3",children:[e.jsxs("div",{className:"flex flex-col gap-3 lg:flex-row lg:items-end lg:justify-between",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-bold",children:s("sharedPage.title")}),e.jsx("p",{className:"text-muted-foreground",children:s("sharedPage.subtitle")})]}),e.jsx(ae,{value:a,onValueChange:i=>{l(i),d(""),o(null)},children:e.jsx(re,{className:"h-auto flex-wrap justify-start",children:z.map(i=>e.jsxs(ne,{value:i.id,className:"flex items-center gap-2",children:[e.jsx(i.icon,{className:"w-4 h-4"}),e.jsx("span",{children:i.label}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:["(",i.count,")"]})]},i.id))})})]}),e.jsxs("div",{className:"flex flex-col gap-2 lg:items-end",children:[e.jsxs("div",{className:"grid w-full gap-2 sm:w-auto sm:min-w-[340px] sm:grid-cols-3",children:[e.jsx(F,{label:s("sharedPage.totalShared"),value:H}),e.jsx(F,{label:t[a],value:N.length}),e.jsx(F,{label:s("sharedPage.visible"),value:u.length})]}),e.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[e.jsx($,{variant:"secondary",children:s("sharedPage.markdownDetail")}),b?e.jsxs($,{variant:"outline",children:[s("sharedPage.filterPrefix")," ",b]}):null]})]})]}),c&&!c.symlinkStatus.valid&&e.jsxs(S,{variant:"warning",children:[e.jsx(E,{className:"h-4 w-4"}),e.jsx(M,{children:s("sharedPage.configurationRequired")}),e.jsxs(L,{children:[c.symlinkStatus.message,". Run `ccs sync` to configure."]})]}),h&&e.jsxs(S,{variant:"info",children:[e.jsx(E,{className:"h-4 w-4"}),e.jsx(M,{children:s("sharedPage.countsUnavailable")}),e.jsxs(L,{children:[e.jsx("p",{children:G}),e.jsx("div",{className:"mt-3",children:e.jsxs(I,{size:"sm",variant:"outline",onClick:()=>{w()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),s("sharedPage.retryCounts")]})})]})]})]}),e.jsx("div",{className:"flex-1 min-h-0 px-6 pb-6",children:e.jsx("div",{className:"h-full rounded-lg border overflow-hidden bg-background",children:e.jsxs("div",{className:"grid h-full min-h-0 lg:grid-cols-[320px_minmax(0,1fr)]",children:[e.jsxs("div",{className:"min-h-0 border-b lg:border-b-0 lg:border-r flex flex-col bg-muted/30",children:[e.jsxs("div",{className:"p-4 border-b bg-background space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[e.jsx(he,{className:"w-4 h-4 text-primary shrink-0"}),e.jsx("h2",{className:"font-semibold truncate",children:t[a]})]}),!x&&!g&&e.jsxs($,{variant:"outline",className:"text-[10px] h-5",children:[u.length,"/",N.length]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(ue,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(le,{value:r,onChange:i=>d(i.target.value),placeholder:s("sharedPage.filterPlaceholder",{tab:a}),"aria-label":s("sharedPage.filterPlaceholder",{tab:a}),className:"pl-8 h-9"})]}),!x&&!g&&e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s("sharedPage.showing",{visible:u.length,total:N.length,tab:a}),b?s("sharedPage.showingQuery",{query:b}):"",y?s("sharedPage.refreshing"):""]})]}),e.jsx(B,{className:"flex-1 min-h-0",children:x?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("sharedPage.loadingShared",{tab:a})}):g?e.jsx("div",{className:"p-4 text-center",children:e.jsxs("div",{className:"space-y-3 py-8",children:[e.jsx(xe,{className:"w-10 h-10 mx-auto text-destructive/50"}),e.jsxs("div",{children:[e.jsx("p",{className:"text-sm font-medium",children:s("sharedPage.failedLoadShared",{tab:a})}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:J})]}),e.jsxs(I,{size:"sm",variant:"outline",onClick:()=>{D()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),s("sharedPage.retry")]})]})}):K?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("sharedPage.noSharedFound",{tab:a})}):Z?e.jsx("div",{className:"p-4 text-sm text-muted-foreground",children:s("sharedPage.noMatch",{tab:a,query:b})}):e.jsx("div",{className:"p-2 space-y-1",children:u.map(i=>e.jsxs("button",{type:"button",onClick:()=>o(i.path),className:U("w-full text-left p-3 rounded-md border transition-colors",f?.path===i.path?"bg-primary/10 border-primary/30":"bg-background hover:bg-muted border-transparent"),children:[e.jsx("p",{className:"text-sm font-medium truncate",children:i.name}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1 line-clamp-2",children:i.description}),e.jsx("p",{className:"text-[11px] text-muted-foreground/90 mt-2 font-mono truncate",children:i.path})]},`${i.type}:${i.path}`))})})]}),e.jsx("div",{className:"min-w-0 min-h-0 flex flex-col bg-muted/20",children:f?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"px-4 py-3 border-b bg-background",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx("h2",{className:"text-base font-semibold truncate",children:f.name}),e.jsx($,{variant:"outline",className:"uppercase text-[10px]",children:f.type})]})}),e.jsxs("div",{className:"p-4 space-y-4 min-h-0 flex-1 flex flex-col",children:[e.jsx("div",{className:"rounded-md border bg-muted/35 p-3",children:e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:[e.jsx(R,{label:s("sharedPage.pathLabel"),value:f.path,mono:!0}),P?.contentPath&&P.contentPath!==f.path&&e.jsx(R,{label:s("sharedPage.resolvedSource"),value:P.contentPath,mono:!0})]})}),e.jsx(ie,{className:"min-h-0 flex-1",children:e.jsx(de,{className:"p-0 h-full",children:e.jsx(B,{className:"h-full px-5 py-4",children:O?e.jsx("p",{className:"text-sm text-muted-foreground",children:s("sharedPage.loadingMarkdown")}):_?e.jsxs(S,{variant:"destructive",className:"max-w-2xl",children:[e.jsx(E,{className:"h-4 w-4"}),e.jsx(M,{children:s("sharedPage.failedLoadContent")}),e.jsxs(L,{children:[e.jsx("p",{children:X}),e.jsx("div",{className:"mt-3",children:e.jsxs(I,{size:"sm",variant:"outline",onClick:()=>{V()},children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),s("sharedPage.retryContent")]})})]})]}):e.jsx(pe,{content:P?.content??""})})})})]})]}):e.jsx("div",{className:"min-h-[320px] flex items-center justify-center p-6 text-center text-muted-foreground",children:s("sharedPage.selectOne",{tab:a.slice(0,-1)})})})]})})})]})}function F({label:s,value:a}){return e.jsxs("div",{className:"rounded-md border bg-muted/30 px-3 py-2",children:[e.jsx("p",{className:"text-[11px] uppercase tracking-wide text-muted-foreground",children:s}),e.jsx("p",{className:"text-lg font-semibold leading-tight mt-1",children:a})]})}function R({label:s,value:a,mono:l=!1}){return e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:s}),e.jsx("p",{className:U("text-xs mt-1 break-words",l?"font-mono":"text-sm"),children:a})]})}function A(s,a){if(!(s instanceof Error))return a;const l=s.message.toLowerCase();return l.includes("failed to fetch")||l.includes("network")?"Connection to dashboard server lost or restarting. Keep `ccs config` running, then retry.":s.message||a}function pe({content:s}){const{t:a}=Q(),l=j.useMemo(()=>fe(s),[s]);return l.blocks.length===0&&l.frontmatter.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:a("sharedPage.noMarkdown")}):e.jsxs("div",{className:"space-y-5",children:[l.frontmatter.length>0?e.jsx("div",{className:"rounded-md border bg-muted/35 p-3",children:e.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-3",children:l.frontmatter.map(t=>e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"text-[10px] uppercase tracking-wide text-muted-foreground",children:ge(t.key)}),e.jsx("p",{className:"text-xs mt-1 break-words",children:t.value})]},`${t.key}:${t.value}`))})}):null,l.blocks.map((t,r)=>{if(t.type==="heading"){const d=t.level<=1?"text-xl font-semibold":t.level===2?"text-lg font-semibold":"text-base font-semibold";return e.jsx("h3",{className:d,children:k(t.text,`heading-${r}`)},`heading-${r}`)}return t.type==="paragraph"?e.jsx("p",{className:"text-sm leading-6 whitespace-pre-wrap",children:k(t.text,`paragraph-${r}`)},`paragraph-${r}`):t.type==="unordered-list"?e.jsx("ul",{className:"list-disc pl-5 space-y-1 text-sm leading-6",children:t.items.map((d,n)=>e.jsx("li",{children:k(d,`ul-item-${r}-${n}`)},`ul-item-${r}-${n}`))},`ul-${r}`):t.type==="ordered-list"?e.jsx("ol",{className:"list-decimal pl-5 space-y-1 text-sm leading-6",children:t.items.map((d,n)=>e.jsx("li",{children:k(d,`ol-item-${r}-${n}`)},`ol-item-${r}-${n}`))},`ol-${r}`):e.jsxs("div",{className:"rounded-md border bg-muted/60 p-3 font-mono text-xs leading-5 overflow-x-auto",children:[t.language&&e.jsx("div",{className:"text-[10px] uppercase tracking-wide text-muted-foreground mb-2",children:t.language}),e.jsx("pre",{className:"whitespace-pre-wrap break-words m-0",children:t.content})]},`code-${r}`)})]})}function ge(s){return s.replace(/[-_]/g," ")}function k(s,a){const l=/(\*\*([^*]+)\*\*|`([^`]+)`|\*([^*]+)\*|\[([^\]]+)\]\(([^)]+)\))/g,t=[];let r=0,d=0;for(const n of s.matchAll(l)){const o=n[0],c=n.index??0;if(c>r&&t.push(s.slice(r,c)),n[2])t.push(e.jsx("strong",{className:"font-semibold",children:n[2]},`${a}-strong-${d}`));else if(n[3])t.push(e.jsx("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-[0.82em]",children:n[3]},`${a}-code-${d}`));else if(n[4])t.push(e.jsx("em",{className:"italic",children:n[4]},`${a}-em-${d}`));else if(n[5]&&n[6]){const h=n[6].trim();/^(https?:\/\/|mailto:)/i.test(h)?t.push(e.jsx("a",{href:h,target:"_blank",rel:"noreferrer",className:"text-primary underline underline-offset-2 hover:opacity-90",children:n[5]},`${a}-link-${d}`)):t.push(n[5])}else t.push(o);r=c+o.length,d+=1}return r<s.length&&t.push(s.slice(r)),t.length===0?[s]:t}function fe(s){const a=s.replace(/\r\n/g,`
|
|
2
2
|
`).trim();if(!a)return{blocks:[],frontmatter:[]};let l=a;const t=[];if(l.startsWith(`---
|
|
3
3
|
`)){const r=l.indexOf(`
|
|
4
4
|
---
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as t}from"./radix-ui-Zb8sVEtn.js";import"./react-vendor-CNOkPC89.js";import{c as l}from"./index-
|
|
1
|
+
import{j as t}from"./radix-ui-Zb8sVEtn.js";import"./react-vendor-CNOkPC89.js";import{c as l}from"./index-DSM3luVm.js";function n({className:a,...e}){return t.jsx("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto",children:t.jsx("table",{"data-slot":"table",className:l("w-full caption-bottom text-sm",a),...e})})}function c({className:a,...e}){return t.jsx("thead",{"data-slot":"table-header",className:l("[&_tr]:border-b",a),...e})}function d({className:a,...e}){return t.jsx("tbody",{"data-slot":"table-body",className:l("[&_tr:last-child]:border-0",a),...e})}function b({className:a,...e}){return t.jsx("tr",{"data-slot":"table-row",className:l("hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors",a),...e})}function i({className:a,...e}){return t.jsx("th",{"data-slot":"table-head",className:l("text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...e})}function m({className:a,...e}){return t.jsx("td",{"data-slot":"table-cell",className:l("p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]",a),...e})}export{n as T,c as a,b,i as c,d,m as e};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as e}from"./radix-ui-Zb8sVEtn.js";import{L as P,r as o}from"./react-vendor-CNOkPC89.js";import{a as p,B as y,c as k,d as x,x as E,bp as M,C as g,j,k as N,_ as w,b as v,n as b,bq as U,br as $,I as z,bs as B}from"./index-DpF_8BcK.js";import{a1 as L,$ as Q,b8 as q,x as G,E as J,Q as V,aa as Y,C as F,b9 as H,au as K}from"./icons-KVCk4_U8.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 W={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 X({status:s,className:a}){const{t}=p(),d={new:t("updates.statusNew"),stable:t("updates.statusStable"),planned:t("updates.statusPlanned")};return e.jsx(y,{variant:"outline",className:k("font-medium",W[s],a),children:d[s]})}const I="ccs:updates:notice-progress:v1";function Z(s){return s==="new"?"new":"seen"}function u(s,a){return a[s.id]??Z(s.status)}function A(s){return s!=="done"&&s!=="dismissed"}function ee(){if(typeof window>"u")return{};try{const s=window.localStorage.getItem(I);if(!s)return{};const a=JSON.parse(s);if(!a||typeof a!="object"||Array.isArray(a))return{};const t={};for(const[d,l]of Object.entries(a))typeof d=="string"&&(l==="new"||l==="seen"||l==="done"||l==="dismissed")&&(t[d]=l);return t}catch{return{}}}function se(s){typeof window>"u"||window.localStorage.setItem(I,JSON.stringify(s))}function R({state:s,className:a}){const{t}=p(),d={new:{label:t("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:t("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:t("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:t("updates.progressDismissed"),className:"border-muted-foreground/20 bg-muted text-muted-foreground dark:border-muted-foreground/30"}}[s];return e.jsxs(y,{variant:"outline",className:k("gap-1.5 border text-[10px] font-medium",d.className,a),children:[d.showDot&&e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}),d.label]})}function ae({action:s}){const{t:a}=p();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:s.label}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.description})]}),s.type==="route"&&s.path&&e.jsx(x,{size:"sm",asChild:!0,children:e.jsxs(P,{to:s.path,children:[a("updates.open"),e.jsx(L,{className:"h-3.5 w-3.5"})]})})]}),s.type==="command"&&s.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(Q,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("code",{className:"min-w-0 flex-1 truncate text-[11px]",children:s.command}),e.jsx(E,{value:s.command})]})]})}function re({notice:s,progress:a,relatedEntries:t,onUpdateProgress:d}){const{t:l}=p();return s?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:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.summary})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[a&&e.jsx(R,{state:a}),e.jsx(X,{status:s.status})]})]}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(q,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:l("updates.published",{date:M(s.publishedAt)})})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsxs(x,{size:"sm",onClick:()=>d("done"),children:[e.jsx(G,{className:"h-4 w-4"}),l("updates.markDone")]}),e.jsxs(x,{size:"sm",variant:"outline",onClick:()=>d("dismissed"),children:[e.jsx(J,{className:"h-4 w-4"}),l("updates.dismiss")]}),e.jsxs(x,{size:"sm",variant:"ghost",onClick:()=>d("new"),children:[e.jsx(V,{className:"h-4 w-4"}),l("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(g,{className:"h-full overflow-hidden",children:[e.jsxs(j,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Y,{className:"h-4 w-4 text-primary"}),e.jsx(N,{className:"text-base",children:l("updates.doNext")})]}),e.jsx(w,{children:s.primaryAction})]}),e.jsx(v,{className:"min-h-0",children:e.jsx(b,{className:"h-full pr-2",children:e.jsx("div",{className:"space-y-3",children:s.actions.map(n=>e.jsx(ae,{action:n},`${s.id}-${n.id}`))})})})]}),e.jsxs("div",{className:"grid h-full grid-rows-[minmax(0,1fr)_minmax(0,1fr)] gap-4 overflow-hidden",children:[e.jsxs(g,{className:"overflow-hidden",children:[e.jsxs(j,{className:"pb-3",children:[e.jsx(N,{className:"text-base",children:l("updates.impactedIntegrations")}),e.jsx(w,{children:l("updates.impactedDesc")})]}),e.jsx(v,{className:"min-h-0",children:e.jsx(b,{className:"h-full pr-2",children:e.jsx("div",{className:"space-y-2",children:t.map(n=>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:n.name}),e.jsx(y,{variant:"outline",className:"h-5 px-1.5 text-[10px]",children:U[n.scope]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[n.routes[0]&&e.jsx(x,{size:"sm",variant:"outline",asChild:!0,children:e.jsx(P,{to:n.routes[0].path,children:n.routes[0].label})}),n.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:n.commands[0]}),e.jsx(E,{value:n.commands[0]})]})]})]},n.id))})})})]}),e.jsxs(g,{className:"overflow-hidden",children:[e.jsxs(j,{className:"pb-3",children:[e.jsx(N,{className:"text-base",children:l("updates.whyMatters")}),e.jsx(w,{children:l("updates.whyMattersDesc")})]}),e.jsx(v,{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:s.highlights.map(n=>e.jsxs("li",{children:["- ",n]},`${s.id}-${n}`))})})})]})]})]})})]}):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:l("updates.noUpdates")})})}function te({notice:s,progress:a,selected:t,onSelect:d}){return e.jsxs("button",{type:"button",onClick:d,className:k("w-full rounded-lg border px-3 py-3 text-left transition-colors",t?"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:s.title}),e.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:s.primaryAction})]}),e.jsx(F,{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:M(s.publishedAt)}),e.jsx(R,{state:a})]})]})}function de(s,a){return a?[s.title,s.summary,s.primaryAction,...s.highlights,...s.commands,...s.actions.map(d=>`${d.label} ${d.description} ${d.command||""}`),...s.routes.map(d=>d.label)].join(" ").toLowerCase().includes(a):!0}function be(){const{t:s}=p(),a=o.useMemo(()=>[...$].sort((r,i)=>i.publishedAt.localeCompare(r.publishedAt)),[]),[t,d]=o.useState("inbox"),[l,n]=o.useState(""),[c,C]=o.useState(()=>ee()),[S,T]=o.useState(null);o.useEffect(()=>{se(c)},[c]);const h=o.useMemo(()=>{const r=l.trim().toLowerCase();return a.filter(i=>{const f=u(i,c);return de(i,r)?t==="done"?f==="done":t==="inbox"?A(f):!0:!1})},[a,c,l,t]),m=o.useMemo(()=>{const r=t==="all"?a:h;return r.find(i=>i.id===S)??r[0]??null},[a,S,t,h]),D=r=>{T(r.id),C(i=>u(r,i)!=="new"?i:{...i,[r.id]:"seen"})},O=o.useMemo(()=>a.filter(r=>A(u(r,c))).length,[a,c]),_=o.useMemo(()=>a.filter(r=>u(r,c)==="done").length,[a,c]);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(H,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:s("updates.inboxTitle")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("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:s("updates.needsAction")}),e.jsx("p",{className:"text-base font-semibold",children:O})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5",children:[e.jsx("p",{className:"text-muted-foreground",children:s("updates.doneCount")}),e.jsx("p",{className:"text-base font-semibold",children:_})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(K,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(z,{value:l,onChange:r=>n(r.target.value),placeholder:s("updates.searchPlaceholder"),className:"h-9 pl-8"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:[{id:"inbox",label:s("updates.actionRequired")},{id:"done",label:s("updates.done")},{id:"all",label:s("updates.all")}].map(r=>e.jsx(x,{size:"sm",variant:t===r.id?"default":"outline",onClick:()=>d(r.id),children:r.label},r.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:s("updates.noNotices")}):h.map(r=>e.jsx(te,{notice:r,progress:u(r,c),selected:m?.id===r.id,onSelect:()=>D(r)},r.id))})})]}),e.jsx(re,{notice:m,progress:m?u(m,c):null,relatedEntries:m?B(m):[],onUpdateProgress:r=>{m&&C(i=>({...i,[m.id]:r}))}})]})}export{be as UpdatesPage};
|
|
1
|
+
import{j as e}from"./radix-ui-Zb8sVEtn.js";import{L as P,r as o}from"./react-vendor-CNOkPC89.js";import{a as p,B as y,c as k,d as x,x as E,bp as M,C as g,j,k as N,_ as w,b as v,n as b,bq as U,br as $,I as z,bs as B}from"./index-DSM3luVm.js";import{a1 as L,$ as Q,b8 as q,x as G,E as J,Q as V,aa as Y,C as F,b9 as H,au as K}from"./icons-KVCk4_U8.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 W={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 X({status:s,className:a}){const{t}=p(),d={new:t("updates.statusNew"),stable:t("updates.statusStable"),planned:t("updates.statusPlanned")};return e.jsx(y,{variant:"outline",className:k("font-medium",W[s],a),children:d[s]})}const I="ccs:updates:notice-progress:v1";function Z(s){return s==="new"?"new":"seen"}function u(s,a){return a[s.id]??Z(s.status)}function A(s){return s!=="done"&&s!=="dismissed"}function ee(){if(typeof window>"u")return{};try{const s=window.localStorage.getItem(I);if(!s)return{};const a=JSON.parse(s);if(!a||typeof a!="object"||Array.isArray(a))return{};const t={};for(const[d,l]of Object.entries(a))typeof d=="string"&&(l==="new"||l==="seen"||l==="done"||l==="dismissed")&&(t[d]=l);return t}catch{return{}}}function se(s){typeof window>"u"||window.localStorage.setItem(I,JSON.stringify(s))}function R({state:s,className:a}){const{t}=p(),d={new:{label:t("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:t("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:t("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:t("updates.progressDismissed"),className:"border-muted-foreground/20 bg-muted text-muted-foreground dark:border-muted-foreground/30"}}[s];return e.jsxs(y,{variant:"outline",className:k("gap-1.5 border text-[10px] font-medium",d.className,a),children:[d.showDot&&e.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-current"}),d.label]})}function ae({action:s}){const{t:a}=p();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:s.label}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s.description})]}),s.type==="route"&&s.path&&e.jsx(x,{size:"sm",asChild:!0,children:e.jsxs(P,{to:s.path,children:[a("updates.open"),e.jsx(L,{className:"h-3.5 w-3.5"})]})})]}),s.type==="command"&&s.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(Q,{className:"h-3.5 w-3.5 text-muted-foreground"}),e.jsx("code",{className:"min-w-0 flex-1 truncate text-[11px]",children:s.command}),e.jsx(E,{value:s.command})]})]})}function re({notice:s,progress:a,relatedEntries:t,onUpdateProgress:d}){const{t:l}=p();return s?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:s.title}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.summary})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[a&&e.jsx(R,{state:a}),e.jsx(X,{status:s.status})]})]}),e.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 text-xs text-muted-foreground",children:[e.jsx(q,{className:"h-3.5 w-3.5"}),e.jsx("span",{children:l("updates.published",{date:M(s.publishedAt)})})]}),e.jsxs("div",{className:"mt-3 flex flex-wrap gap-2",children:[e.jsxs(x,{size:"sm",onClick:()=>d("done"),children:[e.jsx(G,{className:"h-4 w-4"}),l("updates.markDone")]}),e.jsxs(x,{size:"sm",variant:"outline",onClick:()=>d("dismissed"),children:[e.jsx(J,{className:"h-4 w-4"}),l("updates.dismiss")]}),e.jsxs(x,{size:"sm",variant:"ghost",onClick:()=>d("new"),children:[e.jsx(V,{className:"h-4 w-4"}),l("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(g,{className:"h-full overflow-hidden",children:[e.jsxs(j,{className:"pb-3",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Y,{className:"h-4 w-4 text-primary"}),e.jsx(N,{className:"text-base",children:l("updates.doNext")})]}),e.jsx(w,{children:s.primaryAction})]}),e.jsx(v,{className:"min-h-0",children:e.jsx(b,{className:"h-full pr-2",children:e.jsx("div",{className:"space-y-3",children:s.actions.map(n=>e.jsx(ae,{action:n},`${s.id}-${n.id}`))})})})]}),e.jsxs("div",{className:"grid h-full grid-rows-[minmax(0,1fr)_minmax(0,1fr)] gap-4 overflow-hidden",children:[e.jsxs(g,{className:"overflow-hidden",children:[e.jsxs(j,{className:"pb-3",children:[e.jsx(N,{className:"text-base",children:l("updates.impactedIntegrations")}),e.jsx(w,{children:l("updates.impactedDesc")})]}),e.jsx(v,{className:"min-h-0",children:e.jsx(b,{className:"h-full pr-2",children:e.jsx("div",{className:"space-y-2",children:t.map(n=>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:n.name}),e.jsx(y,{variant:"outline",className:"h-5 px-1.5 text-[10px]",children:U[n.scope]})]}),e.jsxs("div",{className:"mt-2 flex items-center gap-2",children:[n.routes[0]&&e.jsx(x,{size:"sm",variant:"outline",asChild:!0,children:e.jsx(P,{to:n.routes[0].path,children:n.routes[0].label})}),n.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:n.commands[0]}),e.jsx(E,{value:n.commands[0]})]})]})]},n.id))})})})]}),e.jsxs(g,{className:"overflow-hidden",children:[e.jsxs(j,{className:"pb-3",children:[e.jsx(N,{className:"text-base",children:l("updates.whyMatters")}),e.jsx(w,{children:l("updates.whyMattersDesc")})]}),e.jsx(v,{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:s.highlights.map(n=>e.jsxs("li",{children:["- ",n]},`${s.id}-${n}`))})})})]})]})]})})]}):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:l("updates.noUpdates")})})}function te({notice:s,progress:a,selected:t,onSelect:d}){return e.jsxs("button",{type:"button",onClick:d,className:k("w-full rounded-lg border px-3 py-3 text-left transition-colors",t?"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:s.title}),e.jsx("p",{className:"line-clamp-2 text-xs text-muted-foreground",children:s.primaryAction})]}),e.jsx(F,{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:M(s.publishedAt)}),e.jsx(R,{state:a})]})]})}function de(s,a){return a?[s.title,s.summary,s.primaryAction,...s.highlights,...s.commands,...s.actions.map(d=>`${d.label} ${d.description} ${d.command||""}`),...s.routes.map(d=>d.label)].join(" ").toLowerCase().includes(a):!0}function be(){const{t:s}=p(),a=o.useMemo(()=>[...$].sort((r,i)=>i.publishedAt.localeCompare(r.publishedAt)),[]),[t,d]=o.useState("inbox"),[l,n]=o.useState(""),[c,C]=o.useState(()=>ee()),[S,T]=o.useState(null);o.useEffect(()=>{se(c)},[c]);const h=o.useMemo(()=>{const r=l.trim().toLowerCase();return a.filter(i=>{const f=u(i,c);return de(i,r)?t==="done"?f==="done":t==="inbox"?A(f):!0:!1})},[a,c,l,t]),m=o.useMemo(()=>{const r=t==="all"?a:h;return r.find(i=>i.id===S)??r[0]??null},[a,S,t,h]),D=r=>{T(r.id),C(i=>u(r,i)!=="new"?i:{...i,[r.id]:"seen"})},O=o.useMemo(()=>a.filter(r=>A(u(r,c))).length,[a,c]),_=o.useMemo(()=>a.filter(r=>u(r,c)==="done").length,[a,c]);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(H,{className:"h-5 w-5 text-primary"}),e.jsx("h1",{className:"font-semibold",children:s("updates.inboxTitle")})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:s("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:s("updates.needsAction")}),e.jsx("p",{className:"text-base font-semibold",children:O})]}),e.jsxs("div",{className:"rounded-md border bg-background px-2 py-1.5",children:[e.jsx("p",{className:"text-muted-foreground",children:s("updates.doneCount")}),e.jsx("p",{className:"text-base font-semibold",children:_})]})]}),e.jsxs("div",{className:"relative",children:[e.jsx(K,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(z,{value:l,onChange:r=>n(r.target.value),placeholder:s("updates.searchPlaceholder"),className:"h-9 pl-8"})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:[{id:"inbox",label:s("updates.actionRequired")},{id:"done",label:s("updates.done")},{id:"all",label:s("updates.all")}].map(r=>e.jsx(x,{size:"sm",variant:t===r.id?"default":"outline",onClick:()=>d(r.id),children:r.label},r.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:s("updates.noNotices")}):h.map(r=>e.jsx(te,{notice:r,progress:u(r,c),selected:m?.id===r.id,onSelect:()=>D(r)},r.id))})})]}),e.jsx(re,{notice:m,progress:m?u(m,c):null,relatedEntries:m?B(m):[],onUpdateProgress:r=>{m&&C(i=>({...i,[m.id]:r}))}})]})}export{be as UpdatesPage};
|
package/dist/ui/index.html
CHANGED
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
href="https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500;600;700&display=swap"
|
|
25
25
|
rel="stylesheet"
|
|
26
26
|
/>
|
|
27
|
-
<script type="module" crossorigin src="/assets/index-
|
|
27
|
+
<script type="module" crossorigin src="/assets/index-DSM3luVm.js"></script>
|
|
28
28
|
<link rel="modulepreload" crossorigin href="/assets/react-vendor-CNOkPC89.js">
|
|
29
29
|
<link rel="modulepreload" crossorigin href="/assets/radix-ui-Zb8sVEtn.js">
|
|
30
30
|
<link rel="modulepreload" crossorigin href="/assets/tanstack-CrmUhA7Z.js">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook-env.d.ts","sourceRoot":"","sources":["../../../src/utils/websearch/hook-env.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;
|
|
1
|
+
{"version":3,"file":"hook-env.d.ts","sourceRoot":"","sources":["../../../src/utils/websearch/hook-env.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAMH;;;;;;GAMG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAgG5D"}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.getWebSearchHookEnv = void 0;
|
|
11
11
|
const unified_config_loader_1 = require("../../config/unified-config-loader");
|
|
12
|
+
const types_1 = require("./types");
|
|
12
13
|
const trace_1 = require("./trace");
|
|
13
14
|
/**
|
|
14
15
|
* Get environment variables for WebSearch hook configuration.
|
|
@@ -19,7 +20,18 @@ const trace_1 = require("./trace");
|
|
|
19
20
|
*/
|
|
20
21
|
function getWebSearchHookEnv() {
|
|
21
22
|
const wsConfig = (0, unified_config_loader_1.getWebSearchConfig)();
|
|
22
|
-
const env = {
|
|
23
|
+
const env = {
|
|
24
|
+
CCS_WEBSEARCH_ENABLED: '0',
|
|
25
|
+
CCS_WEBSEARCH_SKIP: '0',
|
|
26
|
+
CCS_WEBSEARCH_EXA: '0',
|
|
27
|
+
CCS_WEBSEARCH_TAVILY: '0',
|
|
28
|
+
CCS_WEBSEARCH_BRAVE: '0',
|
|
29
|
+
CCS_WEBSEARCH_SEARXNG: '0',
|
|
30
|
+
CCS_WEBSEARCH_DUCKDUCKGO: '0',
|
|
31
|
+
CCS_WEBSEARCH_GEMINI: '0',
|
|
32
|
+
CCS_WEBSEARCH_OPENCODE: '0',
|
|
33
|
+
CCS_WEBSEARCH_GROK: '0',
|
|
34
|
+
};
|
|
23
35
|
if (process.env.CCS_WEBSEARCH_TRACE === '1' || process.env.CCS_DEBUG === '1') {
|
|
24
36
|
env.CCS_WEBSEARCH_TRACE = '1';
|
|
25
37
|
}
|
|
@@ -52,6 +64,12 @@ function getWebSearchHookEnv() {
|
|
|
52
64
|
env.CCS_WEBSEARCH_BRAVE = '1';
|
|
53
65
|
env.CCS_WEBSEARCH_BRAVE_MAX_RESULTS = String(wsConfig.providers.brave.max_results || 5);
|
|
54
66
|
}
|
|
67
|
+
const searxngBaseUrl = (0, types_1.normalizeSearxngBaseUrl)(wsConfig.providers?.searxng?.url);
|
|
68
|
+
if (wsConfig.providers?.searxng?.enabled && searxngBaseUrl) {
|
|
69
|
+
env.CCS_WEBSEARCH_SEARXNG = '1';
|
|
70
|
+
env.CCS_WEBSEARCH_SEARXNG_URL = searxngBaseUrl;
|
|
71
|
+
env.CCS_WEBSEARCH_SEARXNG_MAX_RESULTS = String(wsConfig.providers.searxng.max_results || 5);
|
|
72
|
+
}
|
|
55
73
|
if (wsConfig.providers?.gemini?.enabled) {
|
|
56
74
|
env.CCS_WEBSEARCH_GEMINI = '1';
|
|
57
75
|
if (wsConfig.providers.gemini.model) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hook-env.js","sourceRoot":"","sources":["../../../src/utils/websearch/hook-env.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,8EAAwE;AACxE,mCAA2D;AAE3D;;;;;;GAMG;AACH,SAAgB,mBAAmB;IACjC,MAAM,QAAQ,GAAG,IAAA,0CAAkB,GAAE,CAAC;IACtC,MAAM,GAAG,GAA2B,EAAE,CAAC;
|
|
1
|
+
{"version":3,"file":"hook-env.js","sourceRoot":"","sources":["../../../src/utils/websearch/hook-env.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,8EAAwE;AACxE,mCAAkD;AAClD,mCAA2D;AAE3D;;;;;;GAMG;AACH,SAAgB,mBAAmB;IACjC,MAAM,QAAQ,GAAG,IAAA,0CAAkB,GAAE,CAAC;IACtC,MAAM,GAAG,GAA2B;QAClC,qBAAqB,EAAE,GAAG;QAC1B,kBAAkB,EAAE,GAAG;QACvB,iBAAiB,EAAE,GAAG;QACtB,oBAAoB,EAAE,GAAG;QACzB,mBAAmB,EAAE,GAAG;QACxB,qBAAqB,EAAE,GAAG;QAC1B,wBAAwB,EAAE,GAAG;QAC7B,oBAAoB,EAAE,GAAG;QACzB,sBAAsB,EAAE,GAAG;QAC3B,kBAAkB,EAAE,GAAG;KACxB,CAAC;IAEF,IAAI,OAAO,CAAC,GAAG,CAAC,mBAAmB,KAAK,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,SAAS,KAAK,GAAG,EAAE,CAAC;QAC7E,GAAG,CAAC,mBAA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QAChD,IAAI,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC;YAC/B,GAAG,CAAC,qBAAqB,GAAG,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;QAChF,CAAC;IACH,CAAC;IAED,IAAI,QAAQ,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;QACtC,GAAG,CAAC,kBAAkB,GAAG,GAAG,CAAC;QAC7B,2CAA2C;QAC3C,IAAI,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC;YAC/B,GAAG,CAAC,qBAAqB,GAAG,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;IAED,8BAA8B;IAC9B,IAAI,CAAC,GAAG,CAAC,qBAAqB,EAAE,CAAC;QAC/B,GAAG,CAAC,qBAAqB,GAAG,IAAI,CAAC;IACnC,CAAC;IAED,OAAO,GAAG,CAAC;AACb,CAAC;AAhGD,kDAgGC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/utils/websearch/status.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"status.d.ts","sourceRoot":"","sources":["../../../src/utils/websearch/status.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAWH,OAAO,EAA2B,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AA6J/F;;GAEG;AACH,wBAAgB,wBAAwB,IAAI,gBAAgB,EAAE,CAyF7D;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,OAAO,CAE5C;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAY7C;AAED,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,OAAO,EAChB,SAAS,EAAE,gBAAgB,EAAE,GAC5B,eAAe,CAmCjB;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,eAAe,CAIvD;AAED;;GAEG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAiB7C"}
|
|
@@ -17,10 +17,15 @@ const gemini_cli_1 = require("./gemini-cli");
|
|
|
17
17
|
const grok_cli_1 = require("./grok-cli");
|
|
18
18
|
const opencode_cli_1 = require("./opencode-cli");
|
|
19
19
|
const provider_secrets_1 = require("./provider-secrets");
|
|
20
|
+
const types_1 = require("./types");
|
|
20
21
|
const PROVIDER_STATE_FILE = 'websearch-provider-state.json';
|
|
21
22
|
function hasEnvValue(name) {
|
|
22
23
|
return (process.env[name] || '').trim().length > 0;
|
|
23
24
|
}
|
|
25
|
+
function hasValidSearxngUrl(url) {
|
|
26
|
+
const normalized = (0, types_1.normalizeSearxngBaseUrl)(url);
|
|
27
|
+
return normalized !== null && normalized !== '';
|
|
28
|
+
}
|
|
24
29
|
function getProviderStatePath() {
|
|
25
30
|
return (0, path_1.join)((0, config_manager_1.getCcsDir)(), 'cache', PROVIDER_STATE_FILE);
|
|
26
31
|
}
|
|
@@ -184,18 +189,6 @@ function getWebSearchCliProviders() {
|
|
|
184
189
|
? 'Stored in dashboard, but Global Env is disabled'
|
|
185
190
|
: 'Set TAVILY_API_KEY',
|
|
186
191
|
},
|
|
187
|
-
{
|
|
188
|
-
id: 'duckduckgo',
|
|
189
|
-
kind: 'backend',
|
|
190
|
-
name: 'DuckDuckGo',
|
|
191
|
-
enabled: wsConfig.providers?.duckduckgo?.enabled ?? true,
|
|
192
|
-
available: wsConfig.providers?.duckduckgo?.enabled ?? true,
|
|
193
|
-
version: null,
|
|
194
|
-
docsUrl: 'https://duckduckgo.com',
|
|
195
|
-
requiresApiKey: false,
|
|
196
|
-
description: 'Default built-in HTML search backend. Zero setup.',
|
|
197
|
-
detail: `Built-in (${wsConfig.providers?.duckduckgo?.max_results ?? 5} results)`,
|
|
198
|
-
},
|
|
199
192
|
{
|
|
200
193
|
id: 'brave',
|
|
201
194
|
kind: 'backend',
|
|
@@ -213,6 +206,33 @@ function getWebSearchCliProviders() {
|
|
|
213
206
|
? 'Stored in dashboard, but Global Env is disabled'
|
|
214
207
|
: 'Set BRAVE_API_KEY',
|
|
215
208
|
},
|
|
209
|
+
{
|
|
210
|
+
id: 'searxng',
|
|
211
|
+
kind: 'backend',
|
|
212
|
+
name: 'SearXNG',
|
|
213
|
+
enabled: wsConfig.providers?.searxng?.enabled ?? false,
|
|
214
|
+
available: (wsConfig.providers?.searxng?.enabled ?? false) &&
|
|
215
|
+
hasValidSearxngUrl(wsConfig.providers?.searxng?.url),
|
|
216
|
+
version: null,
|
|
217
|
+
docsUrl: 'https://docs.searxng.org/dev/search_api.html',
|
|
218
|
+
requiresApiKey: false,
|
|
219
|
+
description: 'Configurable SearXNG JSON backend for self-hosted or public instances.',
|
|
220
|
+
detail: hasValidSearxngUrl(wsConfig.providers?.searxng?.url)
|
|
221
|
+
? `Configured (${wsConfig.providers?.searxng?.max_results ?? 5} results)`
|
|
222
|
+
: 'Set a valid SearXNG base URL',
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
id: 'duckduckgo',
|
|
226
|
+
kind: 'backend',
|
|
227
|
+
name: 'DuckDuckGo',
|
|
228
|
+
enabled: wsConfig.providers?.duckduckgo?.enabled ?? true,
|
|
229
|
+
available: wsConfig.providers?.duckduckgo?.enabled ?? true,
|
|
230
|
+
version: null,
|
|
231
|
+
docsUrl: 'https://duckduckgo.com',
|
|
232
|
+
requiresApiKey: false,
|
|
233
|
+
description: 'Default built-in HTML search backend. Zero setup.',
|
|
234
|
+
detail: `Built-in (${wsConfig.providers?.duckduckgo?.max_results ?? 5} results)`,
|
|
235
|
+
},
|
|
216
236
|
];
|
|
217
237
|
return [...providers, ...getLegacyProviderStatuses()].map((provider) => applyCooldownStatus(provider, cooldowns));
|
|
218
238
|
}
|
|
@@ -234,6 +254,7 @@ function getCliInstallHints() {
|
|
|
234
254
|
return [
|
|
235
255
|
'WebSearch: no ready providers',
|
|
236
256
|
' Enable DuckDuckGo in Settings > WebSearch for zero-setup search',
|
|
257
|
+
' Or enable SearXNG and set a valid base URL (must support /search?format=json)',
|
|
237
258
|
' Or export EXA_API_KEY, TAVILY_API_KEY, or BRAVE_API_KEY for API-backed search',
|
|
238
259
|
' Optional legacy fallback: npm i -g @google/gemini-cli',
|
|
239
260
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/utils/websearch/status.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,2BAA8C;AAC9C,+BAA4B;AAC5B,8BAA6C;AAC7C,8EAAwE;AACxE,sDAA8C;AAC9C,6CAAyE;AACzE,yCAA8C;AAC9C,iDAAsD;AACtD,yDAA8D;
|
|
1
|
+
{"version":3,"file":"status.js","sourceRoot":"","sources":["../../../src/utils/websearch/status.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,2BAA8C;AAC9C,+BAA4B;AAC5B,8BAA6C;AAC7C,8EAAwE;AACxE,sDAA8C;AAC9C,6CAAyE;AACzE,yCAA8C;AAC9C,iDAAsD;AACtD,yDAA8D;AAC9D,mCAA+F;AAE/F,MAAM,mBAAmB,GAAG,+BAA+B,CAAC;AAO5D,SAAS,WAAW,CAAC,IAAY;IAC/B,OAAO,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;AACrD,CAAC;AAED,SAAS,kBAAkB,CAAC,GAAuB;IACjD,MAAM,UAAU,GAAG,IAAA,+BAAuB,EAAC,GAAG,CAAC,CAAC;IAChD,OAAO,UAAU,KAAK,IAAI,IAAI,UAAU,KAAK,EAAE,CAAC;AAClD,CAAC;AAED,SAAS,oBAAoB;IAC3B,OAAO,IAAA,WAAI,EAAC,IAAA,0BAAS,GAAE,EAAE,O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