@nextclaw/ui 0.10.5 → 0.11.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/CHANGELOG.md +23 -2
  2. package/dist/assets/{ChannelsList-Nu7Ig6_-.js → ChannelsList-CVPqrxns.js} +4 -4
  3. package/dist/assets/ChatPage-BO1VUrAY.js +37 -0
  4. package/dist/assets/{DocBrowser-3CfKmJA6.js → DocBrowser-FBwg8iji.js} +1 -1
  5. package/dist/assets/{LogoBadge-DdthDJOp.js → LogoBadge-BCmJfRT8.js} +1 -1
  6. package/dist/assets/MarketplacePage-DWxXUOCx.js +49 -0
  7. package/dist/assets/{McpMarketplacePage-Dg8GSZh6.js → McpMarketplacePage-Bth9X_hu.js} +2 -2
  8. package/dist/assets/{ModelConfig-DyQ6cC92.js → ModelConfig-PkSp_ioc.js} +1 -1
  9. package/dist/assets/ProvidersList-DVDge8wa.js +1 -0
  10. package/dist/assets/RemoteAccessPage-BVkzfEaL.js +1 -0
  11. package/dist/assets/RuntimeConfig-ByJs3khh.js +1 -0
  12. package/dist/assets/{SearchConfig-R1BcCLWO.js → SearchConfig-KZUAqYJN.js} +1 -1
  13. package/dist/assets/{SecretsConfig-D-jZMHeY.js → SecretsConfig-qwB_Y_Ka.js} +2 -2
  14. package/dist/assets/SessionsConfig-CGCl4UTr.js +2 -0
  15. package/dist/assets/index-CrilScMo.css +1 -0
  16. package/dist/assets/{index-BulnQWr6.js → index-D41ntvb7.js} +6 -6
  17. package/dist/assets/{label-C7yzBvzK.js → label-7JEFhkur.js} +1 -1
  18. package/dist/assets/ncp-session-adapter-BOqhkrc-.js +1 -0
  19. package/dist/assets/{page-layout-DF0xpax2.js → page-layout-B7q511TE.js} +1 -1
  20. package/dist/assets/popover-CywJGmPr.js +1 -0
  21. package/dist/assets/security-config-zi2UxN5r.js +1 -0
  22. package/dist/assets/skeleton-qUJZQ03S.js +1 -0
  23. package/dist/assets/{status-dot-B9opOZ22.js → status-dot-BilwNdTT.js} +1 -1
  24. package/dist/assets/{switch-l1P0ev4D.js → switch-BLp2Pno1.js} +1 -1
  25. package/dist/assets/tabs-custom-CgIdQMGC.js +1 -0
  26. package/dist/assets/useConfirmDialog-BitswAkv.js +1 -0
  27. package/dist/assets/{vendor-CNhxtHCf.js → vendor-D_JxmsLV.js} +87 -87
  28. package/dist/index.html +3 -3
  29. package/package.json +4 -4
  30. package/src/App.test.tsx +42 -10
  31. package/src/App.tsx +5 -40
  32. package/src/api/api-base.test.ts +37 -0
  33. package/src/api/api-base.ts +0 -4
  34. package/src/api/config.ts +2 -270
  35. package/src/api/ncp-attachments.ts +12 -12
  36. package/src/api/types.ts +4 -121
  37. package/src/components/chat/ChatPage.tsx +1 -11
  38. package/src/components/chat/ChatSidebar.test.tsx +1 -50
  39. package/src/components/chat/ChatSidebar.tsx +0 -5
  40. package/src/components/chat/README.md +2 -0
  41. package/src/components/chat/adapters/chat-message.adapter.test.ts +39 -0
  42. package/src/components/chat/adapters/chat-message.adapter.ts +56 -0
  43. package/src/components/chat/chat-attachment-upload-limit.test.ts +41 -0
  44. package/src/components/chat/chat-composer-state.test.ts +4 -4
  45. package/src/components/chat/chat-composer-state.ts +1 -1
  46. package/src/components/chat/chat-session-display.ts +9 -0
  47. package/src/components/chat/chat-session-label.service.ts +3 -12
  48. package/src/components/chat/chat-session-preference-sync.test.ts +10 -13
  49. package/src/components/chat/chat-stream/types.ts +4 -57
  50. package/src/components/chat/containers/chat-input-bar.container.tsx +2 -2
  51. package/src/components/chat/ncp/NcpChatPage.tsx +3 -3
  52. package/src/components/chat/ncp/ncp-chat-input.manager.ts +1 -1
  53. package/src/components/chat/useHydratedNcpAgent.test.tsx +77 -0
  54. package/src/components/config/README.md +2 -0
  55. package/src/components/config/SessionsConfig.tsx +152 -132
  56. package/src/hooks/use-auth.test.ts +3 -3
  57. package/src/hooks/use-auth.ts +16 -4
  58. package/src/hooks/use-realtime-query-bridge.ts +0 -24
  59. package/src/hooks/useConfig.ts +10 -137
  60. package/src/lib/session-run-status.ts +1 -63
  61. package/src/vite-env.d.ts +1 -0
  62. package/vite.config.ts +4 -4
  63. package/dist/assets/ChatPage-CBCFSk4e.js +0 -38
  64. package/dist/assets/MarketplacePage-inGGiv1T.js +0 -49
  65. package/dist/assets/ProvidersList-B2T8Lc_i.js +0 -1
  66. package/dist/assets/RemoteAccessPage-C9LxgK-C.js +0 -1
  67. package/dist/assets/RuntimeConfig-Ey4VIqTW.js +0 -1
  68. package/dist/assets/SessionsConfig-Cawoh4_2.js +0 -2
  69. package/dist/assets/chat-message-BbuIK4dQ.js +0 -3
  70. package/dist/assets/index-kaPUhd-8.css +0 -1
  71. package/dist/assets/popover-DjaScZDJ.js +0 -1
  72. package/dist/assets/security-config-Bg2eriNx.js +0 -1
  73. package/dist/assets/skeleton-DycBJAJF.js +0 -1
  74. package/dist/assets/tabs-custom-BG9y2JhC.js +0 -1
  75. package/dist/assets/useConfirmDialog-DTducNfn.js +0 -1
  76. package/src/api/config.stream.test.ts +0 -115
  77. package/src/components/chat/chat-chain.test.ts +0 -22
  78. package/src/components/chat/chat-chain.ts +0 -23
  79. package/src/components/chat/chat-page-data.ts +0 -171
  80. package/src/components/chat/chat-page-runtime.ts +0 -190
  81. package/src/components/chat/chat-stream/nextbot-parsers.ts +0 -52
  82. package/src/components/chat/chat-stream/nextbot-runtime-agent.ts +0 -413
  83. package/src/components/chat/chat-stream/stream-event-adapter.ts +0 -98
  84. package/src/components/chat/chat-stream/transport.ts +0 -253
  85. package/src/components/chat/legacy/LegacyChatPage.tsx +0 -223
  86. package/src/components/chat/managers/chat-input.manager.ts +0 -228
  87. package/src/components/chat/managers/chat-thread.manager.ts +0 -87
  88. package/src/components/chat/presenter/chat.presenter.ts +0 -32
  89. package/src/components/chat/useChatRuntimeController.ts +0 -134
@@ -1,49 +0,0 @@
1
- import{u as Ie,f as Ne,g as Re,e as J,r as i,j as s,aM as et,aK as tt,aL as nt,aN as Me,aQ as at,aO as st,aP as A,aR as Ee,aS as Le,aT as rt,aU as lt,a_ as ot,a$ as it,bb as ct,bc as ut,b0 as dt,bd as pt,aE as gt,aF as ft}from"./vendor-CNhxtHCf.js";import{a2 as z,t as c,c as De,S as mt,e as xt,f as ht,g as yt,h as Ce,s as bt,q as kt}from"./index-BulnQWr6.js";import{T as vt}from"./tabs-custom-BG9y2JhC.js";import{u as wt}from"./useConfirmDialog-DTducNfn.js";import{S as U}from"./skeleton-DycBJAJF.js";import{b as Tt,p as oe}from"./marketplace-localization-Dk31LJJJ.js";import{P as St,a as Ct}from"./page-layout-DF0xpax2.js";function ne(e){return Array.from(new Set(e.map(t=>t.spec).filter(Boolean)))}function Pt(e){const t=new Date().toISOString();return e.result.type==="skill"?{type:"skill",spec:e.result.spec,id:e.request.skill??e.result.spec,label:e.request.skill??e.result.name??e.result.spec,source:"workspace",installPath:e.request.installPath,installedAt:t}:{type:e.result.type,spec:e.result.spec,id:e.result.name??e.result.spec,label:e.result.name??e.result.spec,source:"marketplace",origin:"marketplace",enabled:e.request.enabled??!0,runtimeStatus:e.request.enabled===!1?"disabled":"ready",installedAt:t}}function ae(e,t){return!!(t.spec&&e.spec===t.spec||t.id&&e.id===t.id)}function $e(e,t){return t??{type:e,total:0,specs:[],records:[]}}function jt(e){const t=$e(e.result.type,e.view),n=Pt(e),a=t.records.findIndex(l=>ae(l,{id:n.id,spec:n.spec})),r=[...t.records];return a>=0?r[a]={...r[a],...n}:r.unshift(n),{...t,type:e.result.type,records:r,specs:ne(r),total:r.length}}function It(e){const t=$e(e.result.type,e.view);if(e.result.action==="uninstall"||e.result.action==="remove"){const a=t.records.filter(r=>!ae(r,{id:e.result.id,spec:e.request.spec}));return{...t,records:a,specs:ne(a),total:a.length}}const n=t.records.map(a=>ae(a,{id:e.result.id,spec:e.request.spec})?e.result.action==="disable"?{...a,enabled:!1,runtimeStatus:"disabled"}:{...a,enabled:!0,runtimeStatus:"ready"}:a);return{...t,records:n,specs:ne(n),total:n.length}}function Y(e){return e==="plugin"?"plugins":e==="skill"?"skills":"mcp"}async function Nt(e){var l,g;const t=new URLSearchParams,n=Y(e.type);(l=e.q)!=null&&l.trim()&&t.set("q",e.q.trim()),(g=e.tag)!=null&&g.trim()&&t.set("tag",e.tag.trim()),e.sort&&t.set("sort",e.sort),typeof e.page=="number"&&Number.isFinite(e.page)&&t.set("page",String(Math.max(1,Math.trunc(e.page)))),typeof e.pageSize=="number"&&Number.isFinite(e.pageSize)&&t.set("pageSize",String(Math.max(1,Math.trunc(e.pageSize))));const a=t.toString(),r=await z.get(a?`/api/marketplace/${n}/items?${a}`:`/api/marketplace/${n}/items`);if(!r.ok)throw new Error(r.error.message);return r.data}async function Rt(e){const t=await z.get(`/api/marketplace/skills/items/${encodeURIComponent(e)}/content`);if(!t.ok)throw new Error(t.error.message);return t.data}async function Mt(e){const t=await z.get(`/api/marketplace/plugins/items/${encodeURIComponent(e)}/content`);if(!t.ok)throw new Error(t.error.message);return t.data}async function Et(e){const t=Y(e.type),n=await z.post(`/api/marketplace/${t}/install`,e);if(!n.ok)throw new Error(n.error.message);return n.data}async function Lt(e){const t=Y(e),n=await z.get(`/api/marketplace/${t}/installed`);if(!n.ok)throw new Error(n.error.message);return n.data}async function Dt(e){const t=Y(e.type),n=await z.post(`/api/marketplace/${t}/manage`,e);if(!n.ok)throw new Error(n.error.message);return n.data}function $t(e){return Ie({queryKey:["marketplace-items",e],queryFn:()=>Nt(e),placeholderData:(t,n)=>{var l;const a=(l=n==null?void 0:n.queryKey)==null?void 0:l[1];return!a||typeof a!="object"||a===null?void 0:("type"in a?a.type:void 0)===e.type?t:void 0},staleTime:15e3})}function _t(e){return Ie({queryKey:["marketplace-installed",e],queryFn:()=>Lt(e),staleTime:1e4})}function Ot(){const e=Ne();return Re({mutationFn:t=>Et(t),onSuccess:(t,n)=>{e.setQueryData(["marketplace-installed",t.type],r=>jt({view:r,request:n,result:t})),e.invalidateQueries({queryKey:["marketplace-installed",t.type],refetchType:"inactive"}),t.type==="plugin"&&e.invalidateQueries({queryKey:["ncp-session-types"]});const a=t.type==="plugin"?c("marketplaceInstallSuccessPlugin"):c("marketplaceInstallSuccessSkill");J.success(t.message||a)},onError:t=>{J.error(t.message||c("marketplaceInstallFailed"))}})}function At(){const e=Ne();return Re({mutationFn:t=>Dt(t),onSuccess:(t,n)=>{e.setQueryData(["marketplace-installed",t.type],r=>It({view:r,request:n,result:t})),e.invalidateQueries({queryKey:["marketplace-installed",t.type],refetchType:"inactive"}),t.type==="plugin"&&e.invalidateQueries({queryKey:["ncp-session-types"]});const a=t.action==="enable"?c("marketplaceEnableSuccess"):t.action==="disable"?c("marketplaceDisableSuccess"):c("marketplaceUninstallSuccess");J.success(t.message||a)},onError:t=>{J.error(t.message||c("marketplaceOperationFailed"))}})}var[X]=lt("Tooltip",[Ee]),W=Ee(),_e="TooltipProvider",Ut=700,se="tooltip.open",[Ft,ie]=X(_e),Oe=e=>{const{__scopeTooltip:t,delayDuration:n=Ut,skipDelayDuration:a=300,disableHoverableContent:r=!1,children:l}=e,g=i.useRef(!0),f=i.useRef(!1),d=i.useRef(0);return i.useEffect(()=>{const k=d.current;return()=>window.clearTimeout(k)},[]),s.jsx(Ft,{scope:t,isOpenDelayedRef:g,delayDuration:n,onOpen:i.useCallback(()=>{window.clearTimeout(d.current),g.current=!1},[]),onClose:i.useCallback(()=>{window.clearTimeout(d.current),d.current=window.setTimeout(()=>g.current=!0,a)},[a]),isPointerInTransitRef:f,onPointerInTransitChange:i.useCallback(k=>{f.current=k},[]),disableHoverableContent:r,children:l})};Oe.displayName=_e;var K="Tooltip",[qt,G]=X(K),Ae=e=>{const{__scopeTooltip:t,children:n,open:a,defaultOpen:r,onOpenChange:l,disableHoverableContent:g,delayDuration:f}=e,d=ie(K,e.__scopeTooltip),k=W(t),[u,b]=i.useState(null),v=et(),h=i.useRef(0),w=g??d.disableHoverableContent,m=f??d.delayDuration,S=i.useRef(!1),[j,P]=tt({prop:a,defaultProp:r??!1,onChange:E=>{E?(d.onOpen(),document.dispatchEvent(new CustomEvent(se))):d.onClose(),l==null||l(E)},caller:K}),L=i.useMemo(()=>j?S.current?"delayed-open":"instant-open":"closed",[j]),C=i.useCallback(()=>{window.clearTimeout(h.current),h.current=0,S.current=!1,P(!0)},[P]),M=i.useCallback(()=>{window.clearTimeout(h.current),h.current=0,P(!1)},[P]),$=i.useCallback(()=>{window.clearTimeout(h.current),h.current=window.setTimeout(()=>{S.current=!0,P(!0),h.current=0},m)},[m,P]);return i.useEffect(()=>()=>{h.current&&(window.clearTimeout(h.current),h.current=0)},[]),s.jsx(nt,{...k,children:s.jsx(qt,{scope:t,contentId:v,open:j,stateAttribute:L,trigger:u,onTriggerChange:b,onTriggerEnter:i.useCallback(()=>{d.isOpenDelayedRef.current?$():C()},[d.isOpenDelayedRef,$,C]),onTriggerLeave:i.useCallback(()=>{w?M():(window.clearTimeout(h.current),h.current=0)},[M,w]),onOpen:C,onClose:M,disableHoverableContent:w,children:n})})};Ae.displayName=K;var re="TooltipTrigger",Ue=i.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,r=G(re,n),l=ie(re,n),g=W(n),f=i.useRef(null),d=Me(t,f,r.onTriggerChange),k=i.useRef(!1),u=i.useRef(!1),b=i.useCallback(()=>k.current=!1,[]);return i.useEffect(()=>()=>document.removeEventListener("pointerup",b),[b]),s.jsx(at,{asChild:!0,...g,children:s.jsx(st.button,{"aria-describedby":r.open?r.contentId:void 0,"data-state":r.stateAttribute,...a,ref:d,onPointerMove:A(e.onPointerMove,v=>{v.pointerType!=="touch"&&!u.current&&!l.isPointerInTransitRef.current&&(r.onTriggerEnter(),u.current=!0)}),onPointerLeave:A(e.onPointerLeave,()=>{r.onTriggerLeave(),u.current=!1}),onPointerDown:A(e.onPointerDown,()=>{r.open&&r.onClose(),k.current=!0,document.addEventListener("pointerup",b,{once:!0})}),onFocus:A(e.onFocus,()=>{k.current||r.onOpen()}),onBlur:A(e.onBlur,r.onClose),onClick:A(e.onClick,r.onClose)})})});Ue.displayName=re;var ce="TooltipPortal",[zt,Ht]=X(ce,{forceMount:void 0}),Fe=e=>{const{__scopeTooltip:t,forceMount:n,children:a,container:r}=e,l=G(ce,t);return s.jsx(zt,{scope:t,forceMount:n,children:s.jsx(Le,{present:n||l.open,children:s.jsx(rt,{asChild:!0,container:r,children:a})})})};Fe.displayName=ce;var q="TooltipContent",qe=i.forwardRef((e,t)=>{const n=Ht(q,e.__scopeTooltip),{forceMount:a=n.forceMount,side:r="top",...l}=e,g=G(q,e.__scopeTooltip);return s.jsx(Le,{present:a||g.open,children:g.disableHoverableContent?s.jsx(ze,{side:r,...l,ref:t}):s.jsx(Bt,{side:r,...l,ref:t})})}),Bt=i.forwardRef((e,t)=>{const n=G(q,e.__scopeTooltip),a=ie(q,e.__scopeTooltip),r=i.useRef(null),l=Me(t,r),[g,f]=i.useState(null),{trigger:d,onClose:k}=n,u=r.current,{onPointerInTransitChange:b}=a,v=i.useCallback(()=>{f(null),b(!1)},[b]),h=i.useCallback((w,m)=>{const S=w.currentTarget,j={x:w.clientX,y:w.clientY},P=Jt(j,S.getBoundingClientRect()),L=Yt(j,P),C=Xt(m.getBoundingClientRect()),M=Zt([...L,...C]);f(M),b(!0)},[b]);return i.useEffect(()=>()=>v(),[v]),i.useEffect(()=>{if(d&&u){const w=S=>h(S,u),m=S=>h(S,d);return d.addEventListener("pointerleave",w),u.addEventListener("pointerleave",m),()=>{d.removeEventListener("pointerleave",w),u.removeEventListener("pointerleave",m)}}},[d,u,h,v]),i.useEffect(()=>{if(g){const w=m=>{const S=m.target,j={x:m.clientX,y:m.clientY},P=(d==null?void 0:d.contains(S))||(u==null?void 0:u.contains(S)),L=!Wt(j,g);P?v():L&&(v(),k())};return document.addEventListener("pointermove",w),()=>document.removeEventListener("pointermove",w)}},[d,u,g,k,v]),s.jsx(ze,{...e,ref:l})}),[Kt,Gt]=X(K,{isInside:!1}),Vt=ut("TooltipContent"),ze=i.forwardRef((e,t)=>{const{__scopeTooltip:n,children:a,"aria-label":r,onEscapeKeyDown:l,onPointerDownOutside:g,...f}=e,d=G(q,n),k=W(n),{onClose:u}=d;return i.useEffect(()=>(document.addEventListener(se,u),()=>document.removeEventListener(se,u)),[u]),i.useEffect(()=>{if(d.trigger){const b=v=>{const h=v.target;h!=null&&h.contains(d.trigger)&&u()};return window.addEventListener("scroll",b,{capture:!0}),()=>window.removeEventListener("scroll",b,{capture:!0})}},[d.trigger,u]),s.jsx(ot,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:l,onPointerDownOutside:g,onFocusOutside:b=>b.preventDefault(),onDismiss:u,children:s.jsxs(it,{"data-state":d.stateAttribute,...k,...f,ref:t,style:{...f.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[s.jsx(Vt,{children:a}),s.jsx(Kt,{scope:n,isInside:!0,children:s.jsx(ct,{id:d.contentId,role:"tooltip",children:r||a})})]})})});qe.displayName=q;var He="TooltipArrow",Qt=i.forwardRef((e,t)=>{const{__scopeTooltip:n,...a}=e,r=W(n);return Gt(He,n).isInside?null:s.jsx(dt,{...r,...a,ref:t})});Qt.displayName=He;function Jt(e,t){const n=Math.abs(t.top-e.y),a=Math.abs(t.bottom-e.y),r=Math.abs(t.right-e.x),l=Math.abs(t.left-e.x);switch(Math.min(n,a,r,l)){case l:return"left";case r:return"right";case n:return"top";case a:return"bottom";default:throw new Error("unreachable")}}function Yt(e,t,n=5){const a=[];switch(t){case"top":a.push({x:e.x-n,y:e.y+n},{x:e.x+n,y:e.y+n});break;case"bottom":a.push({x:e.x-n,y:e.y-n},{x:e.x+n,y:e.y-n});break;case"left":a.push({x:e.x+n,y:e.y-n},{x:e.x+n,y:e.y+n});break;case"right":a.push({x:e.x-n,y:e.y-n},{x:e.x-n,y:e.y+n});break}return a}function Xt(e){const{top:t,right:n,bottom:a,left:r}=e;return[{x:r,y:t},{x:n,y:t},{x:n,y:a},{x:r,y:a}]}function Wt(e,t){const{x:n,y:a}=e;let r=!1;for(let l=0,g=t.length-1;l<t.length;g=l++){const f=t[l],d=t[g],k=f.x,u=f.y,b=d.x,v=d.y;u>a!=v>a&&n<(b-k)*(a-u)/(v-u)+k&&(r=!r)}return r}function Zt(e){const t=e.slice();return t.sort((n,a)=>n.x<a.x?-1:n.x>a.x?1:n.y<a.y?-1:n.y>a.y?1:0),en(t)}function en(e){if(e.length<=1)return e.slice();const t=[];for(let a=0;a<e.length;a++){const r=e[a];for(;t.length>=2;){const l=t[t.length-1],g=t[t.length-2];if((l.x-g.x)*(r.y-g.y)>=(l.y-g.y)*(r.x-g.x))t.pop();else break}t.push(r)}t.pop();const n=[];for(let a=e.length-1;a>=0;a--){const r=e[a];for(;n.length>=2;){const l=n[n.length-1],g=n[n.length-2];if((l.x-g.x)*(r.y-g.y)>=(l.y-g.y)*(r.x-g.x))n.pop();else break}n.push(r)}return n.pop(),t.length===1&&n.length===1&&t[0].x===n[0].x&&t[0].y===n[0].y?t:t.concat(n)}var tn=Oe,nn=Ae,an=Ue,sn=Fe,Be=qe;const rn=tn,ee=nn,te=an,Q=i.forwardRef(({className:e,sideOffset:t=4,...n},a)=>s.jsx(sn,{children:s.jsx(Be,{ref:a,sideOffset:t,className:De("z-[var(--z-tooltip)] overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...n})}));Q.displayName=Be.displayName;function ln(e){return s.jsx("div",{className:"mb-4",children:s.jsxs("div",{className:"flex gap-3 items-center",children:[s.jsxs("div",{className:"flex-1 min-w-0 relative",children:[s.jsx(pt,{className:"h-4 w-4 text-gray-400 absolute left-3 top-1/2 -translate-y-1/2"}),s.jsx("input",{value:e.searchText,onChange:t=>e.onSearchTextChange(t.target.value),placeholder:e.searchPlaceholder,className:"w-full h-9 border border-gray-200/80 rounded-xl pl-9 pr-3 text-sm focus:outline-none focus:ring-1 focus:ring-primary/40"})]}),e.scope==="all"&&s.jsxs(mt,{value:e.sort,onValueChange:t=>e.onSortChange(t),children:[s.jsx(xt,{className:"h-9 w-[150px] shrink-0 rounded-lg",children:s.jsx(ht,{})}),s.jsxs(yt,{children:[s.jsx(Ce,{value:"relevance",children:c("marketplaceSortRelevance")}),s.jsx(Ce,{value:"updated",children:c("marketplaceSortUpdated")})]})]})]})})}function on(e){return s.jsx(s.Fragment,{children:Array.from({length:e.count},(t,n)=>s.jsx("article",{className:"rounded-2xl border border-gray-200/40 bg-white px-5 py-4 shadow-sm",children:s.jsxs("div",{className:"flex items-start gap-3.5 justify-between",children:[s.jsxs("div",{className:"flex min-w-0 flex-1 gap-3",children:[s.jsx(U,{className:"h-10 w-10 shrink-0 rounded-xl"}),s.jsxs("div",{className:"min-w-0 flex-1 space-y-2 pt-0.5",children:[s.jsx(U,{className:"h-4 w-32 max-w-[70%]"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(U,{className:"h-3 w-12"}),s.jsx(U,{className:"h-3 w-24"})]}),s.jsx(U,{className:"h-3 w-full"})]})]}),s.jsx(U,{className:"h-8 w-20 shrink-0 rounded-xl"})]})},`marketplace-skeleton-${n}`))})}function cn(e){return s.jsxs("div",{className:"mt-4 flex items-center justify-end gap-2",children:[s.jsx("button",{className:"h-8 px-3 rounded-xl border border-gray-200/80 text-sm text-gray-600 disabled:opacity-40",onClick:e.onPrev,disabled:e.page<=1||e.busy,children:c("prev")}),s.jsx("div",{className:"text-sm text-gray-600 min-w-20 text-center",children:e.totalPages===0?"0 / 0":`${e.page} / ${e.totalPages}`}),s.jsx("button",{className:"h-8 px-3 rounded-xl border border-gray-200/80 text-sm text-gray-600 disabled:opacity-40",onClick:e.onNext,disabled:e.totalPages===0||e.page>=e.totalPages||e.busy,children:c("next")})]})}const Ke=12,un=Ke;function le(e){return(e??"").trim().toLowerCase()}function F(e,t){const n=le(t);return n.length>0?`${e}:${n}`:""}function dn(e){const t=new Map;for(const n of e){const a=[n.install.spec,n.slug,n.id];for(const r of a){const l=F(n.type,r);!l||t.has(l)||t.set(l,n)}}return t}function pn(e){const t=new Map;for(const n of e){const a=[n.spec,n.id,n.label];for(const r of a){const l=F(n.type,r);!l||t.has(l)||t.set(l,n)}}return t}function Pe(e,t){const n=[e.install.spec,e.slug,e.id];for(const a of n){const r=F(e.type,a);if(!r)continue;const l=t.get(r);if(l)return l}}function gn(e,t){const n=t.get(F(e.type,e.spec));if(n)return n;const a=t.get(F(e.type,e.id));return a||t.get(F(e.type,e.label))}function fn(e,t,n,a){const r=le(n);if(!r)return!0;const l=oe(t==null?void 0:t.summaryI18n,t==null?void 0:t.summary,a);return[e.id,e.spec,e.label,t==null?void 0:t.name,t==null?void 0:t.slug,t==null?void 0:t.summary,l,...(t==null?void 0:t.tags)??[]].map(f=>le(f)).filter(Boolean).some(f=>f.includes(r))}function mn(e){const t=["bg-amber-600","bg-orange-500","bg-yellow-600","bg-emerald-600","bg-teal-600","bg-cyan-600","bg-stone-600","bg-rose-500","bg-violet-500"];let n=0;for(let a=0;a<e.length;a++)n=e.charCodeAt(a)+((n<<5)-n);return t[Math.abs(n)%t.length]}function xn({name:e,fallback:t}){const n=e||t,a=n.substring(0,2).toUpperCase(),r=mn(n);return s.jsx("div",{className:De("flex items-center justify-center w-10 h-10 rounded-xl text-white font-semibold text-sm shrink-0",r),children:a})}function I(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function B(e){var f,d,k,u;const t=((f=e.metadataRaw)==null?void 0:f.trim())||"-",n=((d=e.contentRaw)==null?void 0:d.trim())||"-",a=(k=e.summary)==null?void 0:k.trim(),r=(u=e.description)==null?void 0:u.trim(),l=!!r&&r!==a,g=`<!doctype html>
2
- <html>
3
- <head>
4
- <meta charset="utf-8" />
5
- <meta name="viewport" content="width=device-width, initial-scale=1" />
6
- <title>${I(e.title)}</title>
7
- <style>
8
- :root { color-scheme: light; }
9
- body { margin: 0; background: #f7f9fc; color: #0f172a; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; }
10
- .wrap { max-width: 980px; margin: 0 auto; padding: 28px 20px 40px; }
11
- .hero { border: 1px solid #dbeafe; border-radius: 16px; background: linear-gradient(180deg, #eff6ff, #ffffff); padding: 20px; box-shadow: 0 6px 20px rgba(30, 64, 175, 0.08); }
12
- .hero h1 { margin: 0; font-size: 26px; }
13
- .meta { margin-top: 8px; color: #475569; font-size: 13px; overflow-wrap: anywhere; word-break: break-word; }
14
- .summary { margin-top: 14px; font-size: 14px; line-height: 1.7; color: #334155; }
15
- .grid { display: grid; grid-template-columns: 260px 1fr; gap: 14px; margin-top: 16px; }
16
- .card { border: 1px solid #e2e8f0; background: #fff; border-radius: 14px; overflow: hidden; }
17
- .card h2 { margin: 0; padding: 12px 14px; font-size: 13px; font-weight: 700; color: #1d4ed8; border-bottom: 1px solid #e2e8f0; background: #f8fafc; }
18
- .card .body { padding: 12px 14px; font-size: 13px; color: #334155; line-height: 1.7; }
19
- .code { white-space: pre-wrap; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; line-height: 1.6; margin: 0; }
20
- .tags { margin-top: 10px; }
21
- .tag { display: inline-block; margin: 0 6px 6px 0; padding: 4px 9px; border-radius: 999px; background: #e0e7ff; color: #3730a3; font-size: 11px; }
22
- .source { color: #2563eb; text-decoration: none; overflow-wrap: anywhere; word-break: break-all; }
23
- @media (max-width: 860px) { .grid { grid-template-columns: 1fr; } }
24
- </style>
25
- </head>
26
- <body>
27
- <main class="wrap">
28
- <section class="hero">
29
- <h1>${I(e.title)}</h1>
30
- <div class="meta">${I(e.typeLabel)} · ${I(e.spec)}${e.author?` · ${I(e.author)}`:""}</div>
31
- ${a?`<p class="summary">${I(a)}</p>`:""}
32
- ${l?`<p class="summary">${I(r)}</p>`:""}
33
- ${e.tags&&e.tags.length>0?`<div class="tags">${e.tags.map(b=>`<span class="tag">${I(b)}</span>`).join("")}</div>`:""}
34
- ${e.sourceUrl?`<p class="meta" style="margin-top:12px;">${I(e.sourceLabel??"Source")}: <a class="source" href="${I(e.sourceUrl)}" target="_blank" rel="noopener noreferrer">${I(e.sourceUrl)}</a></p>`:""}
35
- </section>
36
-
37
- <section class="grid">
38
- <article class="card">
39
- <h2>Metadata</h2>
40
- <div class="body"><pre class="code">${I(t)}</pre></div>
41
- </article>
42
- <article class="card">
43
- <h2>Content</h2>
44
- <div class="body"><pre class="code">${I(n)}</pre></div>
45
- </article>
46
- </section>
47
- </main>
48
- </body>
49
- </html>`;return`data:text/html;charset=utf-8,${encodeURIComponent(g)}`}function je(e){const{item:t,record:n,localeFallbacks:a,installState:r,manageState:l,onOpen:g,onInstall:f,onManage:d}=e,k=(n==null?void 0:n.type)==="plugin"?n:void 0,u=(t==null?void 0:t.name)??(n==null?void 0:n.label)??(n==null?void 0:n.id)??(n==null?void 0:n.spec)??c("marketplaceUnknownItem"),b=oe(t==null?void 0:t.summaryI18n,t==null?void 0:t.summary,a)||(n?c("marketplaceInstalledLocalSummary"):""),v=(t==null?void 0:t.install.spec)??(n==null?void 0:n.spec)??"",h=(n==null?void 0:n.id)||(n==null?void 0:n.spec),w=h?l.actionsByTarget.get(h):void 0,m=!!w,S=!!k,j=(n==null?void 0:n.type)==="plugin"&&n.origin!=="bundled",P=(n==null?void 0:n.type)==="skill"&&n.source==="workspace",L=!!(j||P),C=n?n.enabled===!1||n.runtimeStatus==="disabled":!1,M=t==null?void 0:t.install.spec,$=typeof M=="string"&&r.installingSpecs.has(M);return s.jsxs("article",{onClick:g,className:"group bg-white border border-gray-200/40 hover:border-blue-300/80 rounded-2xl px-5 py-4 hover:shadow-md shadow-sm transition-all flex items-start gap-3.5 justify-between cursor-pointer",children:[s.jsxs("div",{className:"flex gap-3 min-w-0 flex-1 h-full items-start",children:[s.jsx(xn,{name:u,fallback:v||c("marketplaceTypeExtension")}),s.jsx("div",{className:"min-w-0 flex-1 flex flex-col justify-center h-full",children:s.jsxs(rn,{delayDuration:400,children:[s.jsxs(ee,{children:[s.jsx(te,{asChild:!0,children:s.jsx("div",{className:"text-[14px] font-semibold text-gray-900 truncate leading-tight",children:u})}),s.jsx(Q,{className:"max-w-[300px] text-xs",children:u})]}),s.jsx("div",{className:"flex items-center gap-1.5 mt-0.5 mb-1.5",children:v&&s.jsxs(ee,{children:[s.jsx(te,{asChild:!0,children:s.jsx("span",{className:"text-[11px] text-gray-400 truncate max-w-full font-mono",children:v})}),s.jsx(Q,{className:"max-w-[300px] text-xs font-mono break-all",children:v})]})}),s.jsxs(ee,{children:[s.jsx(te,{asChild:!0,children:s.jsx("p",{className:"text-[12px] text-gray-500/90 line-clamp-1 transition-colors leading-relaxed text-left",children:b})}),b&&s.jsx(Q,{className:"max-w-[400px] text-xs leading-relaxed",children:b})]})]})})]}),s.jsxs("div",{className:"shrink-0 flex items-center h-full",children:[t&&!n&&s.jsx("button",{onClick:E=>{E.stopPropagation(),f(t)},disabled:$,className:"inline-flex items-center gap-1.5 h-8 px-4 rounded-xl text-xs font-medium bg-primary text-white hover:bg-primary-600 disabled:opacity-50 transition-colors",children:$?c("marketplaceInstalling"):c("marketplaceInstall")}),k&&S&&s.jsx("button",{disabled:m,onClick:E=>{E.stopPropagation(),d(C?"enable":"disable",k)},className:"inline-flex items-center h-8 px-4 rounded-xl text-xs font-medium border border-gray-200/80 text-gray-600 bg-white hover:bg-gray-50 hover:border-gray-300 disabled:opacity-50 transition-colors",children:w&&w!=="uninstall"?w==="enable"?c("marketplaceEnabling"):c("marketplaceDisabling"):C?c("marketplaceEnable"):c("marketplaceDisable")}),n&&L&&s.jsx("button",{disabled:m,onClick:E=>{E.stopPropagation(),d("uninstall",n)},className:"inline-flex items-center h-8 px-4 rounded-xl text-xs font-medium border border-rose-100 text-rose-500 bg-white hover:bg-rose-50 hover:border-rose-200 disabled:opacity-50 transition-colors",children:w==="uninstall"?c("marketplaceRemoving"):c("marketplaceUninstall")})]})]})}function hn(e={}){var ke,ve,we,Te,Se;const{forcedType:t}=e,n=gt(),a=ft(),{language:r}=bt(),l=kt(),g=i.useMemo(()=>t==="plugins"||t==="skills"?t:a.type==="plugins"||a.type==="skills"?a.type:null,[t,a.type]);i.useEffect(()=>{t||g||n("/marketplace/plugins",{replace:!0})},[t,g,n]);const f=g==="skills"?"skill":"plugin",d=i.useMemo(()=>Tt(r),[r]),u=f==="plugin"?{pageTitle:"marketplacePluginsPageTitle",pageDescription:"marketplacePluginsPageDescription",tabMarketplace:"marketplaceTabMarketplacePlugins",tabInstalled:"marketplaceTabInstalledPlugins",searchPlaceholder:"marketplaceSearchPlaceholderPlugins",sectionCatalog:"marketplaceSectionPlugins",sectionInstalled:"marketplaceSectionInstalledPlugins",errorLoadData:"marketplaceErrorLoadingPluginsData",errorLoadInstalled:"marketplaceErrorLoadingInstalledPlugins",emptyData:"marketplaceNoPlugins",emptyInstalled:"marketplaceNoInstalledPlugins",installedCountSuffix:"marketplaceInstalledPluginsCountSuffix"}:{pageTitle:"marketplaceSkillsPageTitle",pageDescription:"marketplaceSkillsPageDescription",tabMarketplace:"marketplaceTabMarketplaceSkills",tabInstalled:"marketplaceTabInstalledSkills",searchPlaceholder:"marketplaceSearchPlaceholderSkills",sectionCatalog:"marketplaceSectionSkills",sectionInstalled:"marketplaceSectionInstalledSkills",errorLoadData:"marketplaceErrorLoadingSkillsData",errorLoadInstalled:"marketplaceErrorLoadingInstalledSkills",emptyData:"marketplaceNoSkills",emptyInstalled:"marketplaceNoInstalledSkills",installedCountSuffix:"marketplaceInstalledSkillsCountSuffix"},[b,v]=i.useState(""),[h,w]=i.useState(""),[m,S]=i.useState("all"),[j,P]=i.useState("relevance"),[L,C]=i.useState(1),[M,$]=i.useState(new Set),[E,ue]=i.useState(new Map);i.useEffect(()=>{const o=setTimeout(()=>{C(1),w(b.trim())},250);return()=>clearTimeout(o)},[b]),i.useEffect(()=>{C(1)},[f]);const N=_t(f),R=$t({q:h||void 0,type:f,sort:j,page:L,pageSize:Ke}),Ge=Ot(),Ve=At(),{confirm:Qe,ConfirmDialog:Je}=wt(),V=i.useMemo(()=>{var o;return((o=N.data)==null?void 0:o.records)??[]},[(ke=N.data)==null?void 0:ke.records]),O=i.useMemo(()=>{var o;return((o=R.data)==null?void 0:o.items)??[]},[(ve=R.data)==null?void 0:ve.items]),de=i.useMemo(()=>dn(O),[O]),pe=i.useMemo(()=>pn(V),[V]),H=i.useMemo(()=>{const o=V.filter(p=>p.type===f).map(p=>({key:`${p.type}:${p.spec}:${p.id??""}`,record:p,item:gn(p,de)})).filter(p=>fn(p.record,p.item,h,d));return o.sort((p,y)=>{const T=p.record.installedAt?Date.parse(p.record.installedAt):Number.NaN,x=y.record.installedAt?Date.parse(y.record.installedAt):Number.NaN,D=!Number.isNaN(T),Ze=!Number.isNaN(x);return D&&Ze&&T!==x?x-T:p.record.spec.localeCompare(y.record.spec)}),o},[V,f,de,h,d]),ge=m==="installed"?H.length:((we=R.data)==null?void 0:we.total)??0,Z=m==="installed"?1:((Te=R.data)==null?void 0:Te.totalPages)??0,fe=m==="all"&&R.isLoading&&!R.data,Ye=m==="installed"&&N.isLoading&&!N.data,_=fe||Ye,Xe=i.useMemo(()=>m==="installed"?N.isLoading&&!N.data?c("loading"):`${H.length} ${c(u.installedCountSuffix)}`:R.data?`${O.length} / ${ge}`:c("loading"),[m,N.data,N.isLoading,H.length,R.data,O.length,ge,u.installedCountSuffix]),me={installingSpecs:M},xe={actionsByTarget:E},We=[{id:"all",label:c(u.tabMarketplace)},{id:"installed",label:c(u.tabInstalled),count:((Se=N.data)==null?void 0:Se.total)??0}],he=async o=>{const p=o.install.spec;if(!M.has(p)){$(y=>{const T=new Set(y);return T.add(p),T});try{await Ge.mutateAsync({type:o.type,spec:p,kind:o.install.kind,...o.type==="skill"?{skill:o.slug,installPath:`skills/${o.slug}`}:{}})}catch{}finally{$(y=>{if(!y.has(p))return y;const T=new Set(y);return T.delete(p),T})}}},ye=async(o,p)=>{const y=p.id||p.spec;if(y&&!E.has(y)&&!(o==="uninstall"&&!await Qe({title:`${c("marketplaceUninstallTitle")} ${y}?`,description:c("marketplaceUninstallDescription"),confirmLabel:c("marketplaceUninstall"),variant:"destructive"}))){ue(T=>{const x=new Map(T);return x.set(y,o),x});try{await Ve.mutateAsync({type:p.type,action:o,id:y,spec:p.spec})}finally{ue(T=>{if(!T.has(y))return T;const x=new Map(T);return x.delete(y),x})}}},be=async(o,p)=>{const y=(o==null?void 0:o.name)??(p==null?void 0:p.label)??(p==null?void 0:p.id)??(p==null?void 0:p.spec)??c("marketplaceUnknownItem");if(!o){const x=B({title:y,typeLabel:(p==null?void 0:p.type)==="plugin"?c("marketplaceTypePlugin"):c("marketplaceTypeSkill"),spec:(p==null?void 0:p.spec)??"-",summary:c("marketplaceInstalledLocalSummary"),metadataRaw:JSON.stringify(p??{},null,2),contentRaw:"-"});l.open(x,{newTab:!0,title:y,kind:"content"});return}const T=oe(o.summaryI18n,o.summary,d);if(o.type==="skill"){try{const x=await Rt(o.slug),D=B({title:y,typeLabel:c("marketplaceTypeSkill"),spec:o.install.spec,summary:T,metadataRaw:x.metadataRaw,contentRaw:x.bodyRaw||x.raw,sourceUrl:x.sourceUrl,sourceLabel:`Source (${x.source})`,tags:o.tags,author:o.author});l.open(D,{newTab:!0,title:y,kind:"content"})}catch(x){const D=B({title:y,typeLabel:c("marketplaceTypeSkill"),spec:o.install.spec,summary:T,metadataRaw:JSON.stringify({error:x instanceof Error?x.message:String(x)},null,2),contentRaw:c("marketplaceOperationFailed")});l.open(D,{newTab:!0,title:y,kind:"content"})}return}try{const x=await Mt(o.slug),D=B({title:y,typeLabel:c("marketplaceTypePlugin"),spec:o.install.spec,summary:T,metadataRaw:x.metadataRaw,contentRaw:x.bodyRaw||x.raw||o.summary,sourceUrl:x.sourceUrl,sourceLabel:`Source (${x.source})`,tags:o.tags,author:o.author});l.open(D,{newTab:!0,title:y,kind:"content"})}catch(x){const D=B({title:y,typeLabel:c("marketplaceTypePlugin"),spec:o.install.spec,summary:T,metadataRaw:JSON.stringify({error:x instanceof Error?x.message:String(x)},null,2),contentRaw:"-"});l.open(D,{newTab:!0,title:y,kind:"content"})}};return s.jsxs(St,{className:"flex h-full min-h-0 flex-col pb-0",children:[s.jsx(Ct,{title:c(u.pageTitle),description:c(u.pageDescription)}),s.jsx(vt,{tabs:We,activeTab:m,onChange:o=>{S(o),C(1)},className:"mb-4"}),s.jsx(ln,{scope:m,searchText:b,searchPlaceholder:c(u.searchPlaceholder),sort:j,onSearchTextChange:v,onSortChange:o=>{C(1),P(o)}}),s.jsxs("section",{className:"flex min-h-0 flex-1 flex-col",children:[s.jsxs("div",{className:"flex items-center justify-between mb-3",children:[s.jsx("h3",{className:"text-[14px] font-semibold text-gray-900",children:m==="installed"?c(u.sectionInstalled):c(u.sectionCatalog)}),s.jsx("span",{className:"text-[12px] text-gray-500",children:Xe})]}),m==="all"&&R.isError&&s.jsxs("div",{className:"p-4 rounded-xl bg-rose-50 border border-rose-200 text-rose-700 text-sm",children:[c(u.errorLoadData),": ",R.error.message]}),m==="installed"&&N.isError&&s.jsxs("div",{className:"p-4 rounded-xl bg-rose-50 border border-rose-200 text-rose-700 text-sm",children:[c(u.errorLoadInstalled),": ",N.error.message]}),s.jsxs("div",{className:"min-h-0 flex-1 overflow-y-auto custom-scrollbar pr-1","aria-busy":_,children:[s.jsxs("div",{"data-testid":_?"marketplace-list-skeleton":void 0,className:"grid grid-cols-1 gap-3 lg:grid-cols-2 2xl:grid-cols-3",children:[_&&s.jsx(on,{count:un}),!_&&m==="all"&&O.map(o=>s.jsx(je,{item:o,record:Pe(o,pe),localeFallbacks:d,installState:me,manageState:xe,onOpen:()=>void be(o,Pe(o,pe)),onInstall:he,onManage:ye},o.id)),!_&&m==="installed"&&H.map(o=>s.jsx(je,{item:o.item,record:o.record,localeFallbacks:d,installState:me,manageState:xe,onOpen:()=>void be(o.item,o.record),onInstall:he,onManage:ye},o.key))]}),m==="all"&&!_&&!R.isError&&O.length===0&&s.jsx("div",{className:"text-[13px] text-gray-500 py-8 text-center",children:c(u.emptyData)}),m==="installed"&&!_&&!N.isError&&H.length===0&&s.jsx("div",{className:"text-[13px] text-gray-500 py-8 text-center",children:c(u.emptyInstalled)})]})]}),m==="all"&&!fe&&s.jsx("div",{className:"shrink-0",children:s.jsx(cn,{page:L,totalPages:Z,busy:R.isFetching,onPrev:()=>C(o=>Math.max(1,o-1)),onNext:()=>C(o=>Z>0?Math.min(Z,o+1):o+1)})}),s.jsx(Je,{})]})}const Cn=Object.freeze(Object.defineProperty({__proto__:null,MarketplacePage:hn},Symbol.toStringTag,{value:"Module"}));export{Be as C,hn as M,tn as P,nn as R,rn as T,ee as a,te as b,Q as c,an as d,sn as e,Cn as f,_t as u};
@@ -1 +0,0 @@
1
- import{r as p,j as e,aG as St,aH as Tt,aA as et,au as ke,aI as tt,i as kt,X as Xe,f as Lt,e as W,aJ as It,G as Dt,K as Et}from"./vendor-CNhxtHCf.js";import{c as ue,I as J,B as O,t as s,S as Le,e as Ie,f as De,g as Ee,h as fe,u as st,a as nt,b as rt,W as _t,X as $t,Y as Bt,Z as Kt,_ as zt,$ as Ft,a0 as Ot,a1 as Ht}from"./index-BulnQWr6.js";import{L as F}from"./label-C7yzBvzK.js";import{h as le}from"./config-hints-CApS3K_7.js";import{c as Wt,b as Rt,C as qt,a as Ut}from"./config-layout-BHnOoweL.js";import{S as Gt}from"./switch-l1P0ev4D.js";import{a as Qt,b as Vt,c as Xt}from"./popover-DjaScZDJ.js";import{S as Se}from"./status-dot-B9opOZ22.js";import{T as Yt}from"./tabs-custom-BG9y2JhC.js";import{L as Jt}from"./LogoBadge-DdthDJOp.js";import{P as Zt,a as es}from"./page-layout-DF0xpax2.js";function ts({isSet:t,className:n,value:r,onChange:i,placeholder:l,...h}){const[d,c]=p.useState(!1),[g,v]=p.useState(!1),w=typeof r=="string"&&r.length>0,P=t&&!w&&!g;return e.jsxs("div",{className:"relative",children:[P?e.jsx("div",{onClick:()=>v(!0),className:ue("flex h-9 w-full rounded-xl border border-gray-200/80 bg-white px-3.5 py-2 text-sm text-gray-500 cursor-text items-center pr-12",n),children:"••••••••••••"}):e.jsx(J,{type:d?"text":"password",className:ue("pr-12",n),value:r,onChange:i,onBlur:()=>{w||v(!1)},placeholder:l,autoFocus:g,...h}),e.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 flex gap-1",children:(t||w)&&e.jsx(O,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>c(!d),children:d?e.jsx(St,{className:"h-4 w-4"}):e.jsx(Tt,{className:"h-4 w-4"})})})]})}function ss({value:t,onChange:n,className:r}){const i=t?Object.entries(t):[],l=(c,g,v)=>{const w=[...i];w[c]=[g,v],n(Object.fromEntries(w))},h=()=>{n({...t,"":""})},d=c=>{const g=i.filter((v,w)=>w!==c);n(Object.fromEntries(g))};return e.jsxs("div",{className:ue("space-y-2",r),children:[i.map(([c,g],v)=>e.jsxs("div",{className:"flex gap-2",children:[e.jsx(J,{type:"text",value:c,onChange:w=>l(v,w.target.value,g),placeholder:s("headerName"),className:"flex-1"}),e.jsx(J,{type:"text",value:g,onChange:w=>l(v,c,w.target.value),placeholder:s("headerValue"),className:"flex-1"}),e.jsx(O,{type:"button",variant:"ghost",size:"icon",onClick:()=>d(v),children:e.jsx(et,{className:"h-4 w-4 text-red-500"})})]},v)),e.jsxs(O,{type:"button",variant:"outline",size:"sm",onClick:h,children:[e.jsx(ke,{className:"h-4 w-4 mr-2"}),s("add")]})]})}function at(t){const{value:n,onChange:r,options:i}=t;return e.jsx("div",{className:"flex flex-wrap gap-2",children:i.map(l=>{const h=l.value===n;return e.jsx("button",{type:"button",onClick:()=>r(l.value),"aria-pressed":h,className:`rounded-full border px-3 py-1.5 text-xs font-medium transition-colors ${h?"border-primary bg-primary text-white shadow-sm":"border-gray-200 bg-white text-gray-700 hover:border-primary/40 hover:text-primary"}`,children:l.label},l.value)})})}function ns(t){const{showAdvanced:n,onShowAdvancedChange:r,supportsWireApi:i,wireApiLabel:l,wireApi:h,onWireApiChange:d,shouldUseWireApiPills:c,wireApiSelectOptions:g,extraHeadersLabel:v,extraHeaders:w,onExtraHeadersChange:P}=t;return e.jsxs("div",{className:"border-t border-gray-100 pt-4",children:[e.jsxs("button",{type:"button",onClick:()=>r(!n),className:"flex w-full items-center justify-between text-sm text-gray-600 transition-colors hover:text-gray-900",children:[e.jsxs("span",{className:"flex items-center gap-1.5",children:[e.jsx(tt,{className:"h-3.5 w-3.5"}),s("providerAdvancedSettings")]}),e.jsx(kt,{className:`h-4 w-4 transition-transform ${n?"rotate-180":""}`})]}),n?e.jsxs("div",{className:"mt-4 space-y-5",children:[i?e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{htmlFor:"wireApi",className:"text-sm font-medium text-gray-900",children:l}),c?e.jsx(at,{value:h,onChange:C=>d(C),options:g}):e.jsxs(Le,{value:h,onValueChange:C=>d(C),children:[e.jsx(Ie,{className:"rounded-xl",children:e.jsx(De,{})}),e.jsx(Ee,{children:g.map(C=>e.jsx(fe,{value:C.value,children:C.label},C.value))})]})]}):null,e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{className:"text-sm font-medium text-gray-900",children:v}),e.jsx(ss,{value:w,onChange:P}),e.jsx("p",{className:"text-xs text-gray-500",children:s("providerExtraHeadersHelpShort")})]})]}):null]})}function rs(t){const{providerAuth:n,providerAuthNote:r,providerAuthMethodOptions:i,providerAuthMethodsCount:l,selectedAuthMethodHint:h,shouldUseAuthMethodPills:d,resolvedAuthMethodId:c,onAuthMethodChange:g,onStartProviderAuth:v,onImportProviderAuthFromCli:w,startPending:P,importPending:C,authSessionId:b,authStatusMessage:N}=t;return(n==null?void 0:n.kind)!=="device_code"?null:e.jsxs("div",{className:"space-y-2 rounded-xl border border-primary/20 bg-primary-50/50 p-3",children:[e.jsx(F,{className:"text-sm font-medium text-gray-900",children:n.displayName||s("providerAuthSectionTitle")}),r?e.jsx("p",{className:"text-xs text-gray-600",children:r}):null,l>1?e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{className:"text-xs font-medium text-gray-700",children:s("providerAuthMethodLabel")}),d?e.jsx(at,{value:c,onChange:g,options:i}):e.jsxs(Le,{value:c,onValueChange:g,children:[e.jsx(Ie,{className:"h-8 rounded-lg bg-white",children:e.jsx(De,{placeholder:s("providerAuthMethodPlaceholder")})}),e.jsx(Ee,{children:i.map(A=>e.jsx(fe,{value:A.value,children:A.label},A.value))})]}),h?e.jsx("p",{className:"text-xs text-gray-500",children:h}):null]}):null,e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx(O,{type:"button",variant:"outline",size:"sm",onClick:v,disabled:P||!!b,children:P?s("providerAuthStarting"):b?s("providerAuthAuthorizing"):s("providerAuthAuthorizeInBrowser")}),n.supportsCliImport?e.jsx(O,{type:"button",variant:"outline",size:"sm",onClick:w,disabled:C,children:C?s("providerAuthImporting"):s("providerAuthImportFromCli")}):null,b?e.jsxs("span",{className:"text-xs text-gray-500",children:[s("providerAuthSessionLabel"),": ",b.slice(0,8),"…"]}):null]}),N?e.jsx("p",{className:"text-xs text-gray-600",children:N}):null]})}function as(t){return e.jsxs("div",{className:"flex items-center justify-between rounded-xl border border-gray-200 bg-gray-50 px-4 py-3",children:[e.jsx(F,{className:"text-sm font-medium text-gray-900",children:s("enabled")}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"text-xs text-gray-500",children:t.enabled?s("enabled"):s("disabled")}),e.jsx(Gt,{checked:t.enabled,onCheckedChange:t.onChange})]})]})}const is={enabled:!0,displayName:"",apiKeySet:!1,apiBase:null,extraHeaders:null,wireApi:null,models:[],modelThinking:{}},Te=["off","minimal","low","medium","high","adaptive","xhigh"],os=new Set(Te);function ce(t){if(!t)return null;const n=Object.entries(t).map(([r,i])=>[r.trim(),i]).filter(([r])=>r.length>0);return n.length===0?null:Object.fromEntries(n)}function Ye(t,n){const r=ce(t),i=ce(n);if(r===null&&i===null)return!0;if(!r||!i)return!1;const l=Object.entries(r).sort(([d],[c])=>d.localeCompare(c)),h=Object.entries(i).sort(([d],[c])=>d.localeCompare(c));return l.length!==h.length?!1:l.every(([d,c],g)=>d===h[g][0]&&c===h[g][1])}function Me(t){if(!t||t.length===0)return[];const n=new Set;for(const r of t){const i=r.trim();i&&n.add(i)}return[...n]}function ls(t,n){const r=t.trim();if(!r||!n.trim())return r;const i=`${n.trim()}/`;return r.startsWith(i)?r.slice(i.length):r}function de(t,n){let r=t.trim();if(!r)return"";for(const i of n){const l=i.trim();l&&(r=ls(r,l))}return r.trim()}function ge(t,n){return t.length!==n.length?!1:t.every((r,i)=>r===n[i])}function ds(t,n){const r=[...t];for(const i of n)r.includes(i)||r.push(i);return r}function cs(t,n){return n.length===0?t:n.every(i=>!t.includes(i))?ds(t,n):n}function us(t,n){return ge(t,n)?[]:t}function hs(t,n,r){n!==r&&(t.enabled=n)}function _e(t){if(typeof t!="string")return null;const n=t.trim().toLowerCase();return n&&os.has(n)?n:null}function it(t){if(!Array.isArray(t))return[];const n=[];for(const r of t){const i=_e(r);!i||n.includes(i)||n.push(i)}return n}function ms(t,n){if(!t)return{};const r={};for(const[i,l]of Object.entries(t)){const h=de(i,n);if(!h)continue;const d=it(l==null?void 0:l.supported);if(d.length===0)continue;const c=_e(l==null?void 0:l.default);r[h]=c&&d.includes(c)?{supported:d,default:c}:{supported:d}}return r}function Pe(t,n){const r=new Set(n.map(l=>l.trim()).filter(Boolean)),i={};for(const[l,h]of Object.entries(t)){if(!r.has(l))continue;const d=it(h.supported);if(d.length===0)continue;const c=_e(h.default);i[l]=c&&d.includes(c)?{supported:d,default:c}:{supported:d}}return i}function Je(t,n){const r=Object.keys(t).sort(),i=Object.keys(n).sort();if(r.length!==i.length)return!1;for(let l=0;l<r.length;l+=1){const h=r[l];if(h!==i[l])return!1;const d=t[h],c=n[h];if(!d||!c)return!1;const g=[...d.supported].sort(),v=[...c.supported].sort();if(!ge(g,v)||(d.default??null)!==(c.default??null))return!1}return!0}function xs(t){return t==="off"?s("chatThinkingLevelOff"):t==="minimal"?s("chatThinkingLevelMinimal"):t==="low"?s("chatThinkingLevelLow"):t==="medium"?s("chatThinkingLevelMedium"):t==="high"?s("chatThinkingLevelHigh"):t==="adaptive"?s("chatThinkingLevelAdaptive"):s("chatThinkingLevelXhigh")}function ps(t){var g,v,w,P,C;const{providerName:n,methods:r,defaultMethodId:i,language:l}=t;if(r.length===0)return"";const h=new Map;for(const b of r){const N=b.id.trim();N&&h.set(N.toLowerCase(),N)}const d=(...b)=>{for(const N of b){const A=h.get(N.toLowerCase());if(A)return A}},c=i==null?void 0:i.trim();if(n==="minimax-portal"){if(l==="zh")return d("cn","china-mainland")??d(c??"")??((g=r[0])==null?void 0:g.id)??"";if(l==="en")return d("global","intl","international")??d(c??"")??((v=r[0])==null?void 0:v.id)??""}if(c){const b=d(c);if(b)return b}return l==="zh"?d("cn")??((w=r[0])==null?void 0:w.id)??"":l==="en"?d("global")??((P=r[0])==null?void 0:P.id)??"":((C=r[0])==null?void 0:C.id)??""}function Ze(t){return t.required&&t.hasDefault&&t.optionCount>1&&t.optionCount<=3}function fs(t){const{models:n,modelThinking:r,modelDraft:i,showModelInput:l,onModelDraftChange:h,onShowModelInputChange:d,onAddModel:c,onRemoveModel:g,onToggleModelThinkingLevel:v,onSetModelThinkingDefault:w,thinkingLevels:P,formatThinkingLevelLabel:C}=t;return e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(F,{className:"text-sm font-medium text-gray-900",children:s("providerModelsTitle")}),l?null:e.jsxs("button",{type:"button",onClick:()=>d(!0),className:"flex items-center gap-1 text-xs font-medium text-primary hover:text-primary/80",children:[e.jsx(ke,{className:"h-3 w-3"}),s("providerAddModel")]})]}),l?e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(J,{value:i,onChange:b=>h(b.target.value),onKeyDown:b=>{b.key==="Enter"&&(b.preventDefault(),c()),b.key==="Escape"&&(d(!1),h(""))},placeholder:s("providerModelInputPlaceholder"),className:"flex-1 rounded-xl",autoFocus:!0}),e.jsx(O,{type:"button",size:"sm",onClick:c,disabled:i.trim().length===0,children:s("add")}),e.jsx(O,{type:"button",size:"sm",variant:"ghost",onClick:()=>{d(!1),h("")},children:e.jsx(Xe,{className:"h-4 w-4"})})]}):null,n.length===0?e.jsxs("div",{className:"rounded-xl border border-dashed border-gray-200 bg-gray-50 px-4 py-6 text-center",children:[e.jsx("p",{className:"text-sm text-gray-500",children:s("providerModelsEmptyShort")}),l?null:e.jsx("button",{type:"button",onClick:()=>d(!0),className:"mt-2 text-sm font-medium text-primary hover:text-primary/80",children:s("providerAddFirstModel")})]}):e.jsx("div",{className:"flex flex-wrap gap-2",children:n.map(b=>{const N=r[b],A=(N==null?void 0:N.supported)??[],K=(N==null?void 0:N.default)??null;return e.jsxs("div",{className:"group inline-flex max-w-full items-center gap-1 rounded-full border border-gray-200 bg-white px-3 py-1.5",children:[e.jsx("span",{className:"max-w-[140px] truncate text-sm text-gray-800 sm:max-w-[220px]",children:b}),e.jsxs(Qt,{children:[e.jsx(Vt,{asChild:!0,children:e.jsx("button",{type:"button",className:"inline-flex h-5 w-5 items-center justify-center rounded-full text-gray-400 opacity-100 transition-opacity hover:bg-gray-100 hover:text-gray-600 md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100","aria-label":s("providerModelThinkingTitle"),title:s("providerModelThinkingTitle"),children:e.jsx(tt,{className:"h-3 w-3"})})}),e.jsxs(Xt,{className:"w-80 space-y-3",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-xs font-semibold text-gray-800",children:s("providerModelThinkingTitle")}),e.jsx("p",{className:"text-xs text-gray-500",children:s("providerModelThinkingHint")})]}),e.jsx("div",{className:"flex flex-wrap gap-1.5",children:P.map(S=>{const y=A.includes(S);return e.jsx("button",{type:"button",onClick:()=>v(b,S),className:`rounded-full border px-2.5 py-1 text-xs font-medium transition-colors ${y?"border-primary bg-primary text-white":"border-gray-200 bg-white text-gray-600 hover:border-primary/40 hover:text-primary"}`,children:C(S)},S)})}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(F,{className:"text-xs font-medium text-gray-700",children:s("providerModelThinkingDefault")}),e.jsxs(Le,{value:K??"__none__",onValueChange:S=>w(b,S==="__none__"?null:S),disabled:A.length===0,children:[e.jsx(Ie,{className:"h-8 rounded-lg bg-white text-xs",children:e.jsx(De,{})}),e.jsxs(Ee,{children:[e.jsx(fe,{value:"__none__",children:s("providerModelThinkingDefaultNone")}),A.map(S=>e.jsx(fe,{value:S,children:C(S)},S))]})]}),A.length===0?e.jsx("p",{className:"text-xs text-gray-500",children:s("providerModelThinkingNoSupported")}):null]})]})]}),e.jsx("button",{type:"button",onClick:()=>g(b),className:"inline-flex h-5 w-5 items-center justify-center rounded-full text-gray-400 opacity-100 transition-opacity hover:bg-gray-100 hover:text-gray-600 md:opacity-0 md:group-hover:opacity-100 md:group-focus-within:opacity-100","aria-label":s("remove"),children:e.jsx(Xe,{className:"h-3 w-3"})})]},b)})})]})}function gs(t){return t.enabled?e.jsx(Se,{status:t.apiKeySet?"ready":"setup",label:t.apiKeySet?s("statusReady"):s("statusSetup"),className:t.className}):e.jsx(Se,{status:"inactive",label:s("disabled"),className:t.className})}function ys({providerName:t,onProviderDeleted:n}){var We,Re,qe,Ue,Ge,Qe,Ve;const r=Lt(),{data:i}=st(),{data:l}=nt(),{data:h}=rt(),d=_t(),c=$t(),g=Bt(),v=Kt(),w=zt(),P=Ft(),[C,b]=p.useState(""),[N,A]=p.useState(!0),[K,S]=p.useState(""),[y,j]=p.useState(null),[T,k]=p.useState("auto"),[M,G]=p.useState([]),[D,$]=p.useState({}),[ye,Q]=p.useState(""),[R,be]=p.useState(""),[ot,lt]=p.useState(!1),[dt,ct]=p.useState(!1),[ut,q]=p.useState(null),[ht,B]=p.useState(""),[$e,je]=p.useState(""),he=p.useRef(null),o=l==null?void 0:l.providers.find(a=>a.name===t),L=(t?i==null?void 0:i.providers[t]:null)??is,me=h==null?void 0:h.uiHints,Z=!!(o!=null&&o.isCustom),ee=t?le(`providers.${t}.apiKey`,me):void 0,H=t?le(`providers.${t}.apiBase`,me):void 0,ve=t?le(`providers.${t}.extraHeaders`,me):void 0,we=t?le(`providers.${t}.wireApi`,me):void 0,Be=(o==null?void 0:o.displayName)||t||"",te=(L.displayName||"").trim()||Be,se=L.enabled!==!1,mt=R.trim()||te||t||s("providersSelectPlaceholder"),Ke=(o==null?void 0:o.modelPrefix)||t||"",U=p.useMemo(()=>Me([Ke,t||""]),[Ke,t]),Ce=(o==null?void 0:o.defaultApiBase)||"",re=L.apiBase||Ce,Ne=ce(L.extraHeaders||null),ae=L.wireApi||(o==null?void 0:o.defaultWireApi)||"auto",Ae=p.useMemo(()=>Me(((o==null?void 0:o.defaultModels)??[]).map(a=>de(a,U))),[o==null?void 0:o.defaultModels,U]),ze=p.useMemo(()=>Me((L.models??[]).map(a=>de(a,U))),[L.models,U]),V=p.useMemo(()=>cs(Ae,ze),[Ae,ze]),ie=p.useMemo(()=>Pe(ms(L.modelThinking,U),V),[V,U,L.modelThinking]),X=Ot(),xt=((We=o==null?void 0:o.apiBaseHelp)==null?void 0:We[X])||((Re=o==null?void 0:o.apiBaseHelp)==null?void 0:Re.en)||(H==null?void 0:H.help)||s("providerApiBaseHelp"),f=o==null?void 0:o.auth,E=p.useMemo(()=>(f==null?void 0:f.methods)??[],[f==null?void 0:f.methods]),pt=p.useMemo(()=>E.map(a=>{var u,m;return{value:a.id,label:((u=a.label)==null?void 0:u[X])||((m=a.label)==null?void 0:m.en)||a.id}}),[E,X]),xe=p.useMemo(()=>ps({providerName:t,methods:E,defaultMethodId:f==null?void 0:f.defaultMethodId,language:X}),[t,f==null?void 0:f.defaultMethodId,E,X]),oe=p.useMemo(()=>{var u;if(!E.length)return"";const a=$e.trim();return a&&E.some(m=>m.id===a)?a:xe||((u=E[0])==null?void 0:u.id)||""},[$e,xe,E]),ne=p.useMemo(()=>E.find(a=>a.id===oe),[E,oe]),ft=((qe=ne==null?void 0:ne.hint)==null?void 0:qe[X])||((Ue=ne==null?void 0:ne.hint)==null?void 0:Ue.en)||"",gt=Ze({required:(f==null?void 0:f.kind)==="device_code",hasDefault:!!((Ge=f==null?void 0:f.defaultMethodId)!=null&&Ge.trim()),optionCount:E.length}),yt=((Qe=f==null?void 0:f.note)==null?void 0:Qe[X])||((Ve=f==null?void 0:f.note)==null?void 0:Ve.en)||(f==null?void 0:f.displayName)||"",Fe=((o==null?void 0:o.wireApiOptions)||["auto","chat","responses"]).map(a=>({value:a,label:a==="chat"?s("wireApiChat"):a==="responses"?s("wireApiResponses"):s("wireApiAuto")})),bt=Ze({required:!!(o!=null&&o.supportsWireApi),hasDefault:typeof(o==null?void 0:o.defaultWireApi)=="string"&&o.defaultWireApi.length>0,optionCount:Fe.length}),_=p.useCallback(()=>{he.current!==null&&(window.clearTimeout(he.current),he.current=null)},[]),Oe=p.useCallback((a,u)=>{_(),he.current=window.setTimeout(()=>{(async()=>{if(t)try{const m=await w.mutateAsync({provider:t,data:{sessionId:a}});if(m.status==="pending"){B(s("providerAuthWaitingBrowser")),Oe(a,m.nextPollMs??u);return}if(m.status==="authorized"){q(null),_(),B(s("providerAuthCompleted")),W.success(s("providerAuthCompleted")),r.invalidateQueries({queryKey:["config"]}),r.invalidateQueries({queryKey:["config-meta"]});return}q(null),_(),B(m.message||`Authorization ${m.status}.`),W.error(m.message||`Authorization ${m.status}.`)}catch(m){q(null),_();const x=m instanceof Error?m.message:String(m);B(x),W.error(`Authorization failed: ${x}`)}})()},Math.max(1e3,u))},[_,w,t,r]);p.useEffect(()=>{if(!t){b(""),A(!0),S(""),j(null),k("auto"),G([]),$({}),Q(""),be(""),q(null),B(""),je(""),_();return}b(""),A(se),S(re),j(L.extraHeaders||null),k(ae),G(V),$(ie),Q(""),be(te),q(null),B(""),je(xe),_()},[t,re,se,L.extraHeaders,ae,V,ie,te,xe,_]),p.useEffect(()=>()=>_(),[_]),p.useEffect(()=>{$(a=>Pe(a,M))},[M]);const He=p.useMemo(()=>{if(!t)return!1;const a=C.trim().length>0,u=K.trim()!==re.trim(),m=!Ye(y,Ne),x=o!=null&&o.supportsWireApi?T!==ae:!1,I=!ge(M,V),z=!Je(D,ie),pe=Z?R.trim()!==te:!1;return a||N!==se||u||m||x||I||z||pe},[t,Z,R,te,C,N,se,K,re,y,Ne,o==null?void 0:o.supportsWireApi,T,ae,M,V,D,ie]),jt=()=>{const a=de(ye,U);if(a){if(M.includes(a)){Q("");return}G(u=>[...u,a]),Q("")}},vt=(a,u)=>{$(m=>{const x=m[a],I=(x==null?void 0:x.supported)??[],z=I.includes(u)?I.filter(Y=>Y!==u):Te.filter(Y=>Y===u||I.includes(Y));if(z.length===0){const Y={...m};return delete Y[a],Y}const pe=x!=null&&x.default&&z.includes(x.default)?x.default:void 0;return{...m,[a]:pe?{supported:z,default:pe}:{supported:z}}})},wt=(a,u)=>{$(m=>{const x=m[a];return!x||x.supported.length===0||u&&!x.supported.includes(u)?m:{...m,[a]:u?{supported:x.supported,default:u}:{supported:x.supported}}})},Ct=a=>{if(a.preventDefault(),!t)return;const u={},m=C.trim(),x=K.trim(),I=ce(y),z=R.trim();Z&&z!==te&&(u.displayName=z.length>0?z:null),m.length>0&&(u.apiKey=m),hs(u,N,se),x!==re.trim()&&(u.apiBase=x.length>0&&x!==Ce?x:null),Ye(I,Ne)||(u.extraHeaders=I),o!=null&&o.supportsWireApi&&T!==ae&&(u.wireApi=T),ge(M,V)||(u.models=us(M,Ae)),Je(D,ie)||(u.modelThinking=Pe(D,M)),d.mutate({provider:t,data:u})},Nt=async()=>{if(!t)return;const a=M.find(x=>x.trim().length>0)??"",u=de(a,U),m={apiBase:K.trim(),extraHeaders:ce(y),model:u||null};C.trim().length>0&&(m.apiKey=C.trim()),o!=null&&o.supportsWireApi&&(m.wireApi=T);try{const x=await g.mutateAsync({provider:t,data:m});if(x.success){W.success(`${s("providerTestConnectionSuccess")} (${x.latencyMs}ms)`);return}const I=[`provider=${x.provider}`,`latency=${x.latencyMs}ms`];x.model&&I.push(`model=${x.model}`),W.error(`${s("providerTestConnectionFailed")}: ${x.message} | ${I.join(" | ")}`)}catch(x){const I=x instanceof Error?x.message:String(x);W.error(`${s("providerTestConnectionFailed")}: ${I}`)}},At=async()=>{if(!(!t||!Z||!window.confirm(s("providerDeleteConfirm"))))try{await c.mutateAsync({provider:t}),n==null||n(t)}catch{}},Mt=async()=>{if(!(!t||(f==null?void 0:f.kind)!=="device_code"))try{B("");const a=await v.mutateAsync({provider:t,data:oe?{methodId:oe}:{}});if(!a.sessionId||!a.verificationUri)throw new Error(s("providerAuthStartFailed"));q(a.sessionId),B(`${s("providerAuthOpenPrompt")}${a.userCode}${s("providerAuthOpenPromptSuffix")}`),window.open(a.verificationUri,"_blank","noopener,noreferrer"),Oe(a.sessionId,a.intervalMs)}catch(a){const u=a instanceof Error?a.message:String(a);q(null),_(),B(u),W.error(`${s("providerAuthStartFailed")}: ${u}`)}},Pt=async()=>{if(!(!t||(f==null?void 0:f.kind)!=="device_code"))try{_(),q(null);const a=await P.mutateAsync({provider:t}),u=a.expiresAt?` (expires: ${a.expiresAt})`:"";B(`${s("providerAuthImportStatusPrefix")}${u}`),W.success(s("providerAuthImportSuccess")),r.invalidateQueries({queryKey:["config"]}),r.invalidateQueries({queryKey:["config-meta"]})}catch(a){const u=a instanceof Error?a.message:String(a);B(u),W.error(`${s("providerAuthImportFailed")}: ${u}`)}};return!t||!o?e.jsx("div",{className:Wt,children:e.jsxs("div",{children:[e.jsx("h3",{className:"text-base font-semibold text-gray-900",children:s("providersSelectTitle")}),e.jsx("p",{className:"mt-2 text-sm text-gray-500",children:s("providersSelectDescription")})]})}):e.jsxs("div",{className:Rt,children:[e.jsx("div",{className:"border-b border-gray-100 px-6 py-4",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{className:"truncate text-lg font-semibold text-gray-900",children:mt}),e.jsxs("div",{className:"flex items-center gap-3",children:[Z&&e.jsx("button",{type:"button",onClick:At,disabled:c.isPending,className:"text-gray-400 hover:text-red-500 transition-colors",title:s("providerDelete"),children:e.jsx(et,{className:"h-4 w-4"})}),e.jsx(gs,{enabled:se,apiKeySet:L.apiKeySet})]})]})}),e.jsxs("form",{onSubmit:Ct,className:"flex min-h-0 flex-1 flex-col",children:[e.jsxs("div",{className:"min-h-0 flex-1 space-y-5 overflow-y-auto px-6 py-5",children:[e.jsx(as,{enabled:N,onChange:A}),Z&&e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{htmlFor:"providerDisplayName",className:"text-sm font-medium text-gray-900",children:s("providerDisplayName")}),e.jsx(J,{id:"providerDisplayName",type:"text",value:R,onChange:a=>be(a.target.value),placeholder:Be||s("providerDisplayNamePlaceholder"),className:"rounded-xl"}),e.jsx("p",{className:"text-xs text-gray-500",children:s("providerDisplayNameHelpShort")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{htmlFor:"apiKey",className:"text-sm font-medium text-gray-900",children:(ee==null?void 0:ee.label)??s("apiKey")}),e.jsx(ts,{id:"apiKey",value:C,isSet:L.apiKeySet,onChange:a=>b(a.target.value),placeholder:(ee==null?void 0:ee.placeholder)??s("enterApiKey"),className:"rounded-xl"}),e.jsx("p",{className:"text-xs text-gray-500",children:s("leaveBlankToKeepUnchanged")})]}),e.jsx(rs,{providerAuth:f,providerAuthNote:yt,providerAuthMethodOptions:pt,providerAuthMethodsCount:E.length,selectedAuthMethodHint:ft,shouldUseAuthMethodPills:gt,resolvedAuthMethodId:oe,onAuthMethodChange:je,onStartProviderAuth:Mt,onImportProviderAuthFromCli:Pt,startPending:v.isPending,importPending:P.isPending,authSessionId:ut,authStatusMessage:ht}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(F,{htmlFor:"apiBase",className:"text-sm font-medium text-gray-900",children:(H==null?void 0:H.label)??s("apiBase")}),e.jsx(J,{id:"apiBase",type:"text",value:K,onChange:a=>S(a.target.value),placeholder:Ce||(H==null?void 0:H.placeholder)||"https://api.example.com",className:"rounded-xl"}),e.jsx("p",{className:"text-xs text-gray-500",children:xt})]}),e.jsx(fs,{models:M,modelThinking:D,modelDraft:ye,showModelInput:dt,onModelDraftChange:Q,onShowModelInputChange:ct,onAddModel:jt,onRemoveModel:a=>{G(u=>u.filter(m=>m!==a)),$(u=>{const m={...u};return delete m[a],m})},onToggleModelThinkingLevel:vt,onSetModelThinkingDefault:wt,thinkingLevels:Te,formatThinkingLevelLabel:xs}),e.jsx(ns,{showAdvanced:ot,onShowAdvancedChange:lt,supportsWireApi:!!o.supportsWireApi,wireApiLabel:(we==null?void 0:we.label)??s("wireApi"),wireApi:T,onWireApiChange:k,shouldUseWireApiPills:bt,wireApiSelectOptions:Fe,extraHeadersLabel:(ve==null?void 0:ve.label)??s("extraHeaders"),extraHeaders:y,onExtraHeadersChange:j})]}),e.jsxs("div",{className:"flex items-center justify-between border-t border-gray-100 px-6 py-4",children:[e.jsxs(O,{type:"button",variant:"outline",size:"sm",onClick:Nt,disabled:g.isPending,children:[e.jsx(It,{className:"mr-1.5 h-4 w-4"}),g.isPending?s("providerTestingConnection"):s("providerTestConnection")]}),e.jsx(O,{type:"submit",disabled:d.isPending||!He,children:d.isPending?s("saving"):He?s("save"):s("unchanged")})]})]})]})}function bs(t){if(!t)return null;try{const n=new URL(t),r=n.pathname&&n.pathname!=="/"?n.pathname:"";return`${n.host}${r}`}catch{return t.replace(/^https?:\/\//,"")}}function Es(){const{data:t}=st(),{data:n}=nt(),{data:r}=rt(),i=Ht(),[l,h]=p.useState("installed"),[d,c]=p.useState(),[g,v]=p.useState(""),w=r==null?void 0:r.uiHints,P=(n==null?void 0:n.providers)??[],C=(t==null?void 0:t.providers)??{},b=P.filter(y=>{const j=C[y.name];return(j==null?void 0:j.enabled)!==!1&&(j==null?void 0:j.apiKeySet)}).length,N=[{id:"installed",label:s("providersTabConfigured"),count:b},{id:"all",label:s("providersTabAll"),count:P.length}],A=p.useMemo(()=>{const y=(n==null?void 0:n.providers)??[],j=(t==null?void 0:t.providers)??{},T=g.trim().toLowerCase();return y.filter(k=>{if(l==="installed"){const M=j[k.name];return!!((M==null?void 0:M.enabled)!==!1&&(M!=null&&M.apiKeySet))}return!0}).filter(k=>{var D,$;return T?((($=(D=j[k.name])==null?void 0:D.displayName)==null?void 0:$.trim())||k.displayName||k.name).toLowerCase().includes(T)||k.name.toLowerCase().includes(T):!0})},[n,t,l,g]);p.useEffect(()=>{if(A.length===0){c(void 0);return}A.some(j=>j.name===d)||c(A[0].name)},[A,d]);const K=d,S=async()=>{try{const y=await i.mutateAsync({data:{}});h("all"),v(""),c(y.name)}catch{}};return!t||!n?e.jsx("div",{className:"p-8",children:s("providersLoading")}):e.jsxs(Zt,{children:[e.jsx(es,{title:s("providersPageTitle"),description:s("providersPageDescription")}),e.jsxs("div",{className:qt,children:[e.jsxs("section",{className:Ut,children:[e.jsxs("div",{className:"border-b border-gray-100 px-4 pt-4 pb-3 space-y-3",children:[e.jsx(Yt,{tabs:N,activeTab:l,onChange:h,className:"mb-0"}),e.jsxs(O,{type:"button",variant:"outline",className:"w-full justify-center",onClick:S,disabled:i.isPending,children:[e.jsx(ke,{className:"mr-2 h-4 w-4"}),i.isPending?s("saving"):s("providerAddCustom")]})]}),e.jsx("div",{className:"border-b border-gray-100 px-4 py-3",children:e.jsxs("div",{className:"relative",children:[e.jsx(Dt,{className:"pointer-events-none absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-gray-400"}),e.jsx(J,{value:g,onChange:y=>v(y.target.value),placeholder:s("providersFilterPlaceholder"),className:"h-10 rounded-xl pl-9"})]})}),e.jsxs("div",{className:"min-h-0 flex-1 space-y-2 overflow-y-auto p-3",children:[A.map(y=>{var R;const j=t.providers[y.name],T=(j==null?void 0:j.enabled)!==!1,k=!!(T&&(j!=null&&j.apiKeySet)),M=K===y.name,G=((R=j==null?void 0:j.displayName)==null?void 0:R.trim())||y.displayName||y.name,D=le(`providers.${y.name}`,w),$=(j==null?void 0:j.apiBase)||y.defaultApiBase||"",Q=bs($)||(D==null?void 0:D.help)||s("providersDefaultDescription");return e.jsx("button",{type:"button",onClick:()=>c(y.name),className:ue("w-full rounded-xl border p-2.5 text-left transition-all",M?"border-primary/30 bg-primary-50/40 shadow-sm":"border-gray-200/70 bg-white hover:border-gray-300 hover:bg-gray-50/70"),children:e.jsxs("div",{className:"flex items-start justify-between gap-3",children:[e.jsxs("div",{className:"flex min-w-0 items-center gap-3",children:[e.jsx(Jt,{name:y.name,src:y.logo?`/logos/${y.logo}`:null,className:ue("h-10 w-10 rounded-lg border",k?"border-primary/30 bg-white":"border-gray-200/70 bg-white"),imgClassName:"h-5 w-5 object-contain",fallback:e.jsx("span",{className:"text-sm font-semibold uppercase text-gray-500",children:y.name[0]})}),e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"truncate text-sm font-semibold text-gray-900",children:G}),e.jsx("p",{className:"line-clamp-1 text-[11px] text-gray-500",children:Q})]})]}),e.jsx(Se,{status:T?k?"ready":"setup":"inactive",label:T?k?s("statusReady"):s("statusSetup"):s("disabled"),className:"min-w-[56px] justify-center"})]})},y.name)}),A.length===0&&e.jsxs("div",{className:"flex h-full min-h-[220px] flex-col items-center justify-center rounded-xl border border-dashed border-gray-200 bg-gray-50/70 py-10 text-center",children:[e.jsx("div",{className:"mb-3 flex h-10 w-10 items-center justify-center rounded-lg bg-white",children:e.jsx(Et,{className:"h-5 w-5 text-gray-300"})}),e.jsx("p",{className:"text-sm font-medium text-gray-700",children:s("providersNoMatch")})]})]})]}),e.jsx(ys,{providerName:K,onProviderDeleted:y=>{y===d&&c(void 0)}})]})]})}export{Es as ProvidersList};
@@ -1 +0,0 @@
1
- import{r as R,j as r,b9 as C,S as H,ba as L}from"./vendor-CNhxtHCf.js";import{P as k,a as z}from"./page-layout-DF0xpax2.js";import{t,ai as T,aj as E,ak as q,al as P,C as y,a6 as j,a7 as N,a8 as w,J as A,n as I,B as b}from"./index-BulnQWr6.js";import{S as d}from"./status-dot-B9opOZ22.js";const M=[/invalid or expired token/i,/missing bearer token/i,/token expired/i,/token is invalid/i,/run "nextclaw login"/i,/browser sign-in again/i];function B(i){var a,e;return((e=(a=i==null?void 0:i.runtime)==null?void 0:a.lastError)==null?void 0:e.trim())||""}function O(i){if(!(i!=null&&i.settings.enabled))return!1;const a=B(i);return M.some(e=>e.test(a))}function V(i){var e,n;return O(i)?{hero:{badgeStatus:"warning",badgeLabel:t("remoteStateReauthorizationRequired"),title:t("remoteStatusReauthorizationTitle"),description:t("remoteStatusReauthorizationDescription")},primaryAction:{kind:"reauthorize",label:t("remoteReauthorizeNow"),showRefreshIcon:!1},issueHint:{title:t("remoteStatusRecoveryTitle"),body:t("remoteStatusReauthorizationHint")},shouldShowIssueHint:!0,requiresReauthorization:!0}:i!=null&&i.account.loggedIn?i.settings.enabled?i.service.running?((e=i.runtime)==null?void 0:e.state)==="connected"?{hero:{badgeStatus:"ready",badgeLabel:t("statusReady"),title:t("remoteStatusReadyTitle"),description:t("remoteStatusReadyDescription")},primaryAction:{kind:"repair",label:t("remoteReconnectNow"),showRefreshIcon:!0},issueHint:null,shouldShowIssueHint:!1,requiresReauthorization:!1}:((n=i.runtime)==null?void 0:n.state)==="connecting"?{hero:{badgeStatus:"active",badgeLabel:t("connecting"),title:t("remoteStatusConnectingTitle"),description:t("remoteStatusConnectingDescription")},primaryAction:{kind:"repair",label:t("remoteReconnectNow"),showRefreshIcon:!0},issueHint:null,shouldShowIssueHint:!1,requiresReauthorization:!1}:{hero:{badgeStatus:"warning",badgeLabel:t("remoteStateDisconnected"),title:t("remoteStatusIssueTitle"),description:t("remoteStatusIssueDescription")},primaryAction:{kind:"repair",label:t("remoteReconnectNow"),showRefreshIcon:!0},issueHint:{title:t("remoteStatusRecoveryTitle"),body:t("remoteStatusIssueDetailGeneric")},shouldShowIssueHint:!!(i.settings.enabled&&i.account.loggedIn),requiresReauthorization:!1}:{hero:{badgeStatus:"warning",badgeLabel:t("remoteServiceStopped"),title:t("remoteStatusNeedsServiceTitle"),description:t("remoteStatusNeedsServiceDescription")},primaryAction:{kind:"repair",label:t("remoteReconnectNow"),showRefreshIcon:!0},issueHint:{title:t("remoteStatusRecoveryTitle"),body:t("remoteStatusIssueDetailServiceStopped")},shouldShowIssueHint:!0,requiresReauthorization:!1}:{hero:{badgeStatus:"inactive",badgeLabel:t("statusInactive"),title:t("remoteStatusNeedsEnable"),description:t("remoteStatusNeedsEnableDescription")},primaryAction:{kind:"enable",label:t("remoteEnableNow"),showRefreshIcon:!1},issueHint:null,shouldShowIssueHint:!1,requiresReauthorization:!1}:{hero:{badgeStatus:"setup",badgeLabel:t("statusSetup"),title:t("remoteStatusNeedsSignIn"),description:t("remoteStatusNeedsSignInDescription")},primaryAction:{kind:"sign-in-enable",label:t("remoteSignInAndEnable"),showRefreshIcon:!1},issueHint:null,shouldShowIssueHint:!1,requiresReauthorization:!1}}function s(i){const{label:a,muted:e,value:n}=i,o=n==null||n===""?"-":String(n);return r.jsxs("div",{className:"flex items-start justify-between gap-4 py-2 text-sm",children:[r.jsx("span",{className:"text-gray-500",children:a}),r.jsx("span",{className:e?"text-right text-gray-500":"text-right text-gray-900",children:o})]})}function G(){var h,p,x,S,v;const i=T(),a=E(),e=a.data,n=q(c=>c.actionLabel),o=R.useMemo(()=>V(e),[e]),m=!!n,g=((p=(h=e==null?void 0:e.runtime)==null?void 0:h.deviceName)==null?void 0:p.trim())||((x=e==null?void 0:e.settings.deviceName)==null?void 0:x.trim())||t("remoteDeviceNameAuto"),D=!!(e!=null&&e.account.loggedIn&&P(e)),{hero:l,issueHint:u}=o;return R.useEffect(()=>{i.remoteAccessManager.syncStatus(e)},[i,e]),a.isLoading&&!e?r.jsx("div",{className:"p-8 text-gray-400",children:t("remoteLoading")}):r.jsxs(k,{className:"space-y-6",children:[r.jsx(z,{title:t("remotePageTitle"),description:t("remotePageDescription")}),r.jsxs("div",{className:"grid gap-6 xl:grid-cols-[1.2fr_0.8fr]",children:[r.jsxs(y,{children:[r.jsxs(j,{className:"space-y-4",children:[r.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[r.jsx(N,{children:l.title}),r.jsx(d,{status:l.badgeStatus,label:l.badgeLabel})]}),r.jsx(w,{children:l.description})]}),r.jsxs(A,{className:"space-y-5",children:[r.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-gray-50 px-4 py-3",children:[r.jsx(s,{label:t("remoteSignedInAccount"),value:e==null?void 0:e.account.email}),r.jsx(s,{label:t("remoteDeviceName"),value:g}),r.jsx(s,{label:t("remoteConnectionStatus"),value:l.badgeLabel}),r.jsx(s,{label:t("remoteLastConnectedAt"),value:(S=e==null?void 0:e.runtime)!=null&&S.lastConnectedAt?I(e.runtime.lastConnectedAt):"-",muted:!0})]}),r.jsxs("div",{className:"flex flex-wrap gap-3",children:[o.primaryAction?r.jsxs(b,{onClick:()=>{var c,f;if(((c=o.primaryAction)==null?void 0:c.kind)==="reauthorize"){i.remoteAccessManager.reauthorizeRemoteAccess(e);return}if(((f=o.primaryAction)==null?void 0:f.kind)==="repair"){i.remoteAccessManager.repairRemoteAccess(e);return}i.remoteAccessManager.enableRemoteAccess(e)},disabled:m,children:[o.primaryAction.showRefreshIcon?r.jsx(C,{className:"mr-2 h-4 w-4"}):null,n||o.primaryAction.label]}):null,r.jsxs(b,{variant:"outline",onClick:()=>void i.accountManager.openNextClawWeb(),disabled:m||!D,children:[r.jsx(H,{className:"mr-2 h-4 w-4"}),t("remoteOpenDeviceList")]}),e!=null&&e.settings.enabled?r.jsx(b,{variant:"outline",onClick:()=>void i.remoteAccessManager.disableRemoteAccess(e),disabled:m,children:t("remoteDisable")}):null]}),o.shouldShowIssueHint&&u?r.jsxs("div",{className:"rounded-2xl border border-amber-200 bg-amber-50 px-4 py-3",children:[r.jsx("p",{className:"text-sm font-medium text-amber-900",children:u.title}),r.jsx("p",{className:"mt-1 text-sm leading-6 text-amber-800",children:u.body})]}):null,r.jsx("p",{className:"text-xs text-gray-500",children:t("remoteOpenWebHint")})]})]}),r.jsxs(y,{children:[r.jsxs(j,{children:[r.jsxs(N,{className:"flex items-center gap-2",children:[r.jsx(L,{className:"h-4 w-4 text-primary"}),t("remoteDeviceSectionTitle")]}),r.jsx(w,{children:t("remoteDeviceSectionDescription")})]}),r.jsxs(A,{className:"space-y-5",children:[r.jsxs("div",{className:"flex flex-wrap gap-2",children:[r.jsx(d,{status:e!=null&&e.account.loggedIn?"ready":"inactive",label:e!=null&&e.account.loggedIn?t("remoteAccountConnected"):t("remoteAccountNotConnected")}),r.jsx(d,{status:e!=null&&e.settings.enabled?"active":"inactive",label:e!=null&&e.settings.enabled?t("remoteEnabled"):t("remoteStateDisabled")}),r.jsx(d,{status:e!=null&&e.service.running?"active":"inactive",label:e!=null&&e.service.running?t("remoteServiceRunning"):t("remoteServiceStopped")})]}),r.jsxs("div",{className:"rounded-2xl border border-gray-200 bg-gray-50 px-4 py-3",children:[r.jsx(s,{label:t("remoteDeviceName"),value:g}),r.jsx(s,{label:t("remoteConnectionStatus"),value:l.badgeLabel}),r.jsx(s,{label:t("remoteLastConnectedAt"),value:(v=e==null?void 0:e.runtime)!=null&&v.lastConnectedAt?I(e.runtime.lastConnectedAt):"-",muted:!0})]}),r.jsx("div",{className:"rounded-2xl border border-dashed border-gray-200 bg-gray-50 px-4 py-3 text-sm text-gray-600",children:e!=null&&e.account.loggedIn?t("remoteOpenWebHint"):t("remoteStatusNeedsSignInDescription")})]})]})]})]})}export{G as RemoteAccessPage};
@@ -1 +0,0 @@
1
- import{r as p,j as e,aA as ee,au as ae,b6 as de,e as se}from"./vendor-CNhxtHCf.js";import{u as me,b as he,a5 as ue,t,C as R,a6 as $,a7 as z,a8 as D,J as L,I as i,S as te,e as re,f as ne,g as le,h as S,B as w}from"./index-BulnQWr6.js";import{S as pe}from"./switch-l1P0ev4D.js";import{h as x}from"./config-hints-CApS3K_7.js";import{P as xe,a as ge}from"./page-layout-DF0xpax2.js";const je=[{value:"main",label:"main"},{value:"per-peer",label:"per-peer"},{value:"per-channel-peer",label:"per-channel-peer"},{value:"per-account-channel-peer",label:"per-account-channel-peer"}];function ve(){return{id:"",default:!1,workspace:"",model:"",engine:"",contextTokens:void 0,maxToolIterations:void 0}}function fe(){return{agentId:"",match:{channel:"",accountId:""}}}function ce(d){const b=d.trim();if(!b)return;const j=Number.parseInt(b,10);return Number.isFinite(j)?j:void 0}function Ce(){const{data:d,isLoading:b}=me(),{data:j}=he(),E=ue(),[_,N]=p.useState([]),[q,A]=p.useState([]),[K,F]=p.useState("per-channel-peer"),[V,J]=p.useState(0),[U,G]=p.useState(2e5),[Q,W]=p.useState("native");p.useEffect(()=>{var a,r,n;d&&(N((d.agents.list??[]).map(s=>({id:s.id??"",default:!!s.default,workspace:s.workspace??"",model:s.model??"",engine:s.engine??"",contextTokens:s.contextTokens,maxToolIterations:s.maxToolIterations}))),A((d.bindings??[]).map(s=>{var c,l,o;return{agentId:s.agentId??"",match:{channel:((c=s.match)==null?void 0:c.channel)??"",accountId:((l=s.match)==null?void 0:l.accountId)??"",peer:(o=s.match)!=null&&o.peer?{kind:s.match.peer.kind,id:s.match.peer.id}:void 0}}})),F(((a=d.session)==null?void 0:a.dmScope)??"per-channel-peer"),J(((n=(r=d.session)==null?void 0:r.agentToAgent)==null?void 0:n.maxPingPongTurns)??0),G(d.agents.defaults.contextTokens??2e5),W(d.agents.defaults.engine??"native"))},[d]);const u=j==null?void 0:j.uiHints,h=x("session.dmScope",u),v=x("session.agentToAgent.maxPingPongTurns",u),f=x("agents.defaults.contextTokens",u),I=x("agents.defaults.engine",u),O=x("agents.list.*.contextTokens",u),B=x("agents.list.*.engine",u),y=x("agents.list",u),k=x("bindings",u),oe=p.useMemo(()=>{const a=new Set(["main"]);return _.forEach(r=>{const n=r.id.trim();n&&a.add(n)}),a},[_]),g=(a,r)=>{N(n=>n.map((s,c)=>c===a?{...s,...r}:s))},T=(a,r)=>{A(n=>n.map((s,c)=>c===a?r:s))},ie=()=>{try{const a=_.map((s,c)=>{var m,C,P;const l=s.id.trim();if(!l)throw new Error(t("agentIdRequiredError").replace("{index}",String(c)));const o={id:l};return s.default&&(o.default=!0),(m=s.workspace)!=null&&m.trim()&&(o.workspace=s.workspace.trim()),(C=s.model)!=null&&C.trim()&&(o.model=s.model.trim()),(P=s.engine)!=null&&P.trim()&&(o.engine=s.engine.trim()),typeof s.contextTokens=="number"&&(o.contextTokens=Math.max(1e3,s.contextTokens)),typeof s.maxToolIterations=="number"&&(o.maxToolIterations=s.maxToolIterations),o}),r=a.map(s=>s.id).filter((s,c,l)=>l.indexOf(s)!==c);if(r.length>0){se.error(`${t("duplicateAgentId")}: ${r[0]}`);return}const n=q.map((s,c)=>{var X,Y,Z,H;const l=s.agentId.trim(),o=s.match.channel.trim(),m=((X=s.match.accountId)==null?void 0:X.trim())??"",C=(Y=s.match.peer)==null?void 0:Y.kind,P=((H=(Z=s.match.peer)==null?void 0:Z.id)==null?void 0:H.trim())??"";if(!l)throw new Error(t("bindingAgentIdRequired").replace("{index}",String(c)));if(!oe.has(l))throw new Error(`${t("bindingAgentIdNotFound").replace("{index}",String(c))}: ${l}`);if(!o)throw new Error(t("bindingChannelRequired").replace("{index}",String(c)));const M={agentId:l,match:{channel:o}};if(m&&(M.match.accountId=m),C){if(!P)throw new Error(t("bindingPeerIdRequired").replace("{index}",String(c)));M.match.peer={kind:C,id:P}}return M});E.mutate({data:{agents:{defaults:{contextTokens:Math.max(1e3,U),engine:Q.trim()||"native"},list:a},bindings:n,session:{dmScope:K,agentToAgent:{maxPingPongTurns:Math.min(5,Math.max(0,V))}}}})}catch(a){const r=a instanceof Error?a.message:String(a);se.error(r)}};return b||!d?e.jsx("div",{className:"p-8 text-gray-400",children:t("runtimeLoading")}):e.jsxs(xe,{className:"space-y-6",children:[e.jsx(ge,{title:t("runtimePageTitle"),description:t("runtimePageDescription")}),e.jsxs(R,{children:[e.jsxs($,{children:[e.jsx(z,{children:(h==null?void 0:h.label)??t("dmScope")}),e.jsx(D,{children:(h==null?void 0:h.help)??t("dmScopeHelp")})]}),e.jsxs(L,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-gray-800",children:(f==null?void 0:f.label)??t("defaultContextTokens")}),e.jsx(i,{type:"number",min:1e3,step:1e3,value:U,onChange:a=>G(Math.max(1e3,Number.parseInt(a.target.value,10)||1e3))}),e.jsx("p",{className:"text-xs text-gray-500",children:(f==null?void 0:f.help)??t("defaultContextTokensHelp")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-gray-800",children:(I==null?void 0:I.label)??t("defaultEngine")}),e.jsx(i,{value:Q,onChange:a=>W(a.target.value),placeholder:t("defaultEnginePlaceholder")}),e.jsx("p",{className:"text-xs text-gray-500",children:(I==null?void 0:I.help)??t("defaultEngineHelp")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-gray-800",children:(h==null?void 0:h.label)??t("dmScope")}),e.jsxs(te,{value:K,onValueChange:a=>F(a),children:[e.jsx(re,{children:e.jsx(ne,{})}),e.jsx(le,{children:je.map(a=>e.jsx(S,{value:a.value,children:a.label},a.value))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx("label",{className:"text-sm font-medium text-gray-800",children:(v==null?void 0:v.label)??t("maxPingPongTurns")}),e.jsx(i,{type:"number",min:0,max:5,value:V,onChange:a=>J(Math.max(0,Number.parseInt(a.target.value,10)||0))}),e.jsx("p",{className:"text-xs text-gray-500",children:(v==null?void 0:v.help)??t("maxPingPongTurnsHelp")})]})]})]}),e.jsxs(R,{children:[e.jsxs($,{children:[e.jsx(z,{children:(y==null?void 0:y.label)??t("agentList")}),e.jsx(D,{children:(y==null?void 0:y.help)??t("agentListHelp")})]}),e.jsxs(L,{className:"space-y-3",children:[_.map((a,r)=>e.jsxs("div",{className:"rounded-xl border border-gray-200 p-3 space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[e.jsx(i,{value:a.id,onChange:n=>g(r,{id:n.target.value}),placeholder:t("agentIdPlaceholder")}),e.jsx(i,{value:a.workspace??"",onChange:n=>g(r,{workspace:n.target.value}),placeholder:t("workspaceOverridePlaceholder")}),e.jsx(i,{value:a.model??"",onChange:n=>g(r,{model:n.target.value}),placeholder:t("modelOverridePlaceholder")}),e.jsx(i,{value:a.engine??"",onChange:n=>g(r,{engine:n.target.value}),placeholder:(B==null?void 0:B.label)??t("engineOverridePlaceholder")}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:[e.jsx(i,{type:"number",min:1e3,step:1e3,value:a.contextTokens??"",onChange:n=>g(r,{contextTokens:ce(n.target.value)}),placeholder:(O==null?void 0:O.label)??t("contextTokensPlaceholder")}),e.jsx(i,{type:"number",min:1,value:a.maxToolIterations??"",onChange:n=>g(r,{maxToolIterations:ce(n.target.value)}),placeholder:t("maxToolsPlaceholder")})]})]}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-gray-600",children:[e.jsx(pe,{checked:!!a.default,onCheckedChange:n=>{if(!n){g(r,{default:!1});return}N(s=>s.map((c,l)=>({...c,default:l===r})))}}),e.jsx("span",{children:t("defaultAgent")})]}),e.jsxs(w,{type:"button",variant:"outline",size:"sm",onClick:()=>N(n=>n.filter((s,c)=>c!==r)),children:[e.jsx(ee,{className:"h-4 w-4 mr-1"}),t("remove")]})]})]},`${r}-${a.id}`)),e.jsxs(w,{type:"button",variant:"outline",onClick:()=>N(a=>[...a,ve()]),children:[e.jsx(ae,{className:"h-4 w-4 mr-2"}),t("addAgent")]})]})]}),e.jsxs(R,{children:[e.jsxs($,{children:[e.jsx(z,{children:(k==null?void 0:k.label)??t("bindings")}),e.jsx(D,{children:(k==null?void 0:k.help)??t("bindingsHelp")})]}),e.jsxs(L,{className:"space-y-3",children:[q.map((a,r)=>{var s,c;const n=((s=a.match.peer)==null?void 0:s.kind)??"";return e.jsxs("div",{className:"rounded-xl border border-gray-200 p-3 space-y-3",children:[e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-3",children:[e.jsx(i,{value:a.agentId,onChange:l=>T(r,{...a,agentId:l.target.value}),placeholder:t("targetAgentIdPlaceholder")}),e.jsx(i,{value:a.match.channel,onChange:l=>T(r,{...a,match:{...a.match,channel:l.target.value}}),placeholder:t("channelPlaceholder")}),e.jsx(i,{value:a.match.accountId??"",onChange:l=>T(r,{...a,match:{...a.match,accountId:l.target.value}}),placeholder:t("accountIdOptionalPlaceholder")}),e.jsxs(te,{value:n||"__none__",onValueChange:l=>{var m;const o=l==="__none__"?"":l;if(!o){T(r,{...a,match:{...a.match,peer:void 0}});return}T(r,{...a,match:{...a.match,peer:{kind:o,id:((m=a.match.peer)==null?void 0:m.id)??""}}})},children:[e.jsx(re,{children:e.jsx(ne,{})}),e.jsxs(le,{children:[e.jsx(S,{value:"__none__",children:t("peerKindOptional")}),e.jsx(S,{value:"direct",children:"direct"}),e.jsx(S,{value:"group",children:"group"}),e.jsx(S,{value:"channel",children:"channel"})]})]}),e.jsx(i,{value:((c=a.match.peer)==null?void 0:c.id)??"",onChange:l=>T(r,{...a,match:{...a.match,peer:n?{kind:n,id:l.target.value}:void 0}}),placeholder:t("peerIdPlaceholder")})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(w,{type:"button",variant:"outline",size:"sm",onClick:()=>A(l=>l.filter((o,m)=>m!==r)),children:[e.jsx(ee,{className:"h-4 w-4 mr-1"}),t("remove")]})})]},`${r}-${a.agentId}`)}),e.jsxs(w,{type:"button",variant:"outline",onClick:()=>A(a=>[...a,fe()]),children:[e.jsx(ae,{className:"h-4 w-4 mr-2"}),t("addBinding")]})]})]}),e.jsx("div",{className:"flex justify-end",children:e.jsxs(w,{type:"button",onClick:ie,disabled:E.isPending,children:[e.jsx(de,{className:"h-4 w-4 mr-2"}),E.isPending?t("saving"):t("saveRuntimeSettings")]})})]})}export{Ce as RuntimeConfig};
@@ -1,2 +0,0 @@
1
- import{r,j as e,aB as I,G as J,b7 as T,b2 as X,a0 as Z,M as Q,b8 as ee,al as se,am as te}from"./vendor-CNhxtHCf.js";import{u as ae}from"./useConfirmDialog-DTducNfn.js";import{j as re,i as ne,l as le,ae as ie,af as oe,t,B as f,c as i,S as de,e as ce,f as xe,g as me,h as U,I as k,ag as ue,n as he}from"./index-BulnQWr6.js";import{b as ge,a as fe,S as ye,e as be}from"./chat-message-BbuIK4dQ.js";import{P as pe,a as je}from"./page-layout-DF0xpax2.js";const y="__unknown_channel__";function ve(a){return he(a)}function j(a){const l=a.indexOf(":");return l<=0?y:a.slice(0,l).trim()||y}function C(a){return a===y?t("sessionsUnknownChannel"):a}function Ne({session:a,channel:l,runStatus:d,isSelected:x,onSelect:n}){const b=C(l),m=a.label||a.key.split(":").pop()||a.key;return e.jsxs("button",{onClick:n,className:i("w-full text-left p-3.5 rounded-xl transition-all duration-200 outline-none focus:outline-none focus:ring-0 group",x?"bg-brand-50 border border-brand-100/50":"bg-transparent border border-transparent hover:bg-gray-50/80"),children:[e.jsxs("div",{className:"flex items-start justify-between mb-1.5",children:[e.jsx("div",{className:i("font-semibold truncate pr-2 flex-1 text-sm",x?"text-brand-800":"text-gray-900"),children:m}),e.jsx("div",{className:i("text-[10px] font-bold px-2 py-0.5 rounded-full shrink-0 capitalize",x?"bg-white text-brand-600 shadow-[0_1px_2px_rgba(0,0,0,0.02)]":"bg-gray-100 text-gray-500"),children:b})]}),e.jsxs("div",{className:i("flex items-center text-xs justify-between mt-2 font-medium",x?"text-brand-600/80":"text-gray-400"),children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx("span",{className:"inline-flex h-3.5 w-3.5 shrink-0 items-center justify-center",children:d?e.jsx(ye,{status:d}):null}),e.jsx(ee,{className:"w-3.5 h-3.5 opacity-70"}),e.jsx("span",{className:"truncate max-w-[100px]",children:ue(a.updatedAt)})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(Q,{className:"w-3.5 h-3.5 opacity-70"}),e.jsx("span",{children:a.messageCount})]})]})]})}function we({message:a}){const l=a.role.toLowerCase()==="user",d=be(a.content).trim();return e.jsx("div",{className:i("flex w-full mb-6",l?"justify-end":"justify-start"),children:e.jsxs("div",{className:i("max-w-[85%] rounded-[1.25rem] p-5 flex gap-3 text-sm",l?"bg-primary text-white rounded-tr-sm":"bg-gray-50 text-gray-800 rounded-tl-sm border border-gray-100/50"),children:[e.jsx("div",{className:"shrink-0 pt-0.5",children:l?e.jsx(se,{className:"w-4 h-4 text-primary-100"}):e.jsx(te,{className:"w-4 h-4 text-gray-400"})}),e.jsxs("div",{className:"flex-1 space-y-1 overflow-x-hidden",children:[e.jsxs("div",{className:"flex items-baseline justify-between gap-4 mb-2",children:[e.jsx("span",{className:i("font-semibold text-xs",l?"text-primary-50":"text-gray-900 capitalize"),children:a.role}),e.jsx("span",{className:i("text-[10px]",l?"text-primary-200":"text-gray-400"),children:ve(a.timestamp)})]}),e.jsx("div",{className:"whitespace-pre-wrap break-words leading-relaxed text-[15px]",children:d||"-"})]})]})})}function De(){var B,E,K,R;const[a,l]=r.useState(""),[d]=r.useState(100),[x]=r.useState(0),[n,b]=r.useState(null),[m,q]=r.useState("all"),[M,v]=r.useState(""),[L,N]=r.useState(""),[w,S]=r.useState(!1),F=r.useMemo(()=>({q:a.trim()||void 0,limit:d,activeMinutes:x}),[a,d,x]),g=re(F),D=ne({states:["queued","running"],limit:200}),u=le(n,200),p=ie(),_=oe(),{confirm:P,ConfirmDialog:O}=ae(),c=r.useMemo(()=>{var s;return((s=g.data)==null?void 0:s.sessions)??[]},[(B=g.data)==null?void 0:B.sessions]),z=r.useMemo(()=>{var s;return ge(((s=D.data)==null?void 0:s.runs)??[])},[(E=D.data)==null?void 0:E.runs]),V=r.useMemo(()=>fe(z),[z]),o=r.useMemo(()=>c.find(s=>s.key===n),[c,n]),$=r.useMemo(()=>{const s=new Set;for(const h of c)s.add(j(h.key));return Array.from(s).sort((h,A)=>h===y?1:A===y?-1:h.localeCompare(A))},[c]),H=r.useMemo(()=>m==="all"?c:c.filter(s=>j(s.key)===m),[c,m]);r.useEffect(()=>{o?(v(o.label||""),N(o.preferredModel||"")):(v(""),N("")),S(!1)},[o]);const G=()=>{n&&(p.mutate({key:n,data:{label:M.trim()||null,preferredModel:L.trim()||null}}),S(!1))},W=async()=>{if(!n)return;await P({title:t("sessionsClearHistory")+"?",variant:"destructive",confirmLabel:t("sessionsClearHistory")})&&p.mutate({key:n,data:{clearHistory:!0}})},Y=async()=>{if(!n)return;await P({title:t("sessionsDeleteConfirm")+"?",variant:"destructive",confirmLabel:t("sessionsDeleteConfirm")})&&_.mutate({key:n},{onSuccess:()=>b(null)})};return e.jsxs(pe,{fullHeight:!0,children:[e.jsx(je,{title:t("sessionsPageTitle"),description:t("sessionsPageDescription")}),e.jsxs("div",{className:"flex-1 flex gap-6 min-h-0 relative",children:[e.jsxs("div",{className:"w-[320px] flex flex-col shrink-0 bg-white rounded-2xl shadow-sm border border-gray-200 overflow-hidden",children:[e.jsxs("div",{className:"px-4 py-4 border-b border-gray-100 bg-white z-10 shrink-0 space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("span",{className:"text-[11px] font-semibold text-gray-400 uppercase tracking-wider",children:[c.length," ",t("sessionsListTitle")]}),e.jsx(f,{variant:"ghost",size:"icon",className:"h-7 w-7 rounded-lg text-gray-400 hover:text-gray-700 hover:bg-gray-100",onClick:()=>g.refetch(),children:e.jsx(I,{className:i("h-3.5 w-3.5",g.isFetching&&"animate-spin")})})]}),e.jsxs(de,{value:m,onValueChange:q,children:[e.jsx(ce,{className:"w-full h-8.5 rounded-lg bg-gray-50/50 hover:bg-gray-100 border-gray-200 focus:ring-0 shadow-none text-xs font-medium text-gray-700",children:e.jsx(xe,{placeholder:t("sessionsAllChannels")})}),e.jsxs(me,{className:"rounded-xl shadow-lg border-gray-100 max-w-[280px]",children:[e.jsx(U,{value:"all",className:"rounded-lg text-xs",children:t("sessionsAllChannels")}),$.map(s=>e.jsx(U,{value:s,className:"rounded-lg text-xs truncate pr-6",children:C(s)},s))]})]}),e.jsxs("div",{className:"relative w-full",children:[e.jsx(J,{className:"h-3.5 w-3.5 absolute left-3 top-2.5 text-gray-400"}),e.jsx(k,{value:a,onChange:s=>l(s.target.value),placeholder:t("sessionsSearchPlaceholder"),className:"pl-8 h-8.5 rounded-lg bg-gray-50/50 border-gray-200 focus-visible:bg-white text-xs"})]})]}),e.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-1 pb-10 custom-scrollbar relative",children:g.isLoading?e.jsx("div",{className:"text-sm text-gray-400 p-4 text-center",children:t("sessionsLoading")}):H.length===0?e.jsxs("div",{className:"text-sm text-gray-400 p-4 text-center border-2 border-dashed border-gray-100 rounded-xl mt-4",children:[e.jsx(T,{className:"w-8 h-8 mx-auto mb-2 text-gray-300"}),t("sessionsEmpty")]}):H.map(s=>e.jsx(Ne,{session:s,channel:j(s.key),runStatus:V.get(s.key),isSelected:n===s.key,onSelect:()=>b(s.key)},s.key))})]}),e.jsxs("div",{className:"flex-1 min-w-0 flex flex-col overflow-hidden relative bg-white rounded-2xl shadow-sm border border-gray-200",children:[(p.isPending||_.isPending)&&e.jsx("div",{className:"absolute top-0 left-0 w-full h-1 bg-primary/20 overflow-hidden z-20",children:e.jsx("div",{className:"h-full bg-primary animate-pulse w-1/3 rounded-r-full"})}),n&&o?e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"shrink-0 border-b border-gray-100 bg-white px-8 py-5 z-10 space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("div",{className:"h-12 w-12 rounded-[14px] bg-gray-50 border border-gray-100 flex items-center justify-center text-gray-400 shrink-0",children:e.jsx(X,{className:"h-6 w-6"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2.5 mb-1.5",children:[e.jsx("h3",{className:"text-lg font-bold text-gray-900 tracking-tight",children:o.label||o.key.split(":").pop()||o.key}),e.jsx("span",{className:"text-[10px] font-bold px-2 py-0.5 rounded-full bg-gray-100 text-gray-500 uppercase tracking-widest",children:C(j(o.key))})]}),e.jsx("div",{className:"text-xs text-gray-500 font-mono break-all line-clamp-1 opacity-70",title:n,children:n})]})]}),e.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[e.jsxs(f,{variant:"outline",size:"sm",onClick:()=>S(!w),className:i("h-8.5 rounded-lg shadow-none border-gray-200 transition-all text-xs font-semibold",w?"bg-gray-100 text-gray-900":"hover:bg-gray-50 hover:text-gray-900"),children:[e.jsx(Z,{className:"w-3.5 h-3.5 mr-1.5"}),t("sessionsMetadata")]}),e.jsx(f,{variant:"outline",size:"sm",onClick:W,className:"h-8.5 rounded-lg shadow-none hover:bg-gray-50 hover:text-gray-900 border-gray-200 text-xs font-semibold text-gray-500",children:t("sessionsClearHistory")}),e.jsx(f,{variant:"outline",size:"sm",onClick:Y,className:"h-8.5 rounded-lg shadow-none hover:bg-red-50 hover:text-red-600 hover:border-red-200 border-gray-200 text-xs font-semibold text-red-500",children:t("delete")})]})]}),w&&e.jsxs("div",{className:"flex items-center gap-3 bg-gray-50/50 p-3 rounded-lg border border-gray-100 animate-slide-in",children:[e.jsx(k,{placeholder:t("sessionsLabelPlaceholder"),value:M,onChange:s=>v(s.target.value),className:"h-8 text-sm bg-white"}),e.jsx(k,{placeholder:t("sessionsModelPlaceholder"),value:L,onChange:s=>N(s.target.value),className:"h-8 text-sm bg-white"}),e.jsx(f,{size:"sm",onClick:G,className:"h-8 px-4 shrink-0 shadow-none",disabled:p.isPending,children:t("sessionsSaveMeta")})]})]}),e.jsxs("div",{className:`flex-1 overflow-y-auto p-6 relative
2
- [&::-webkit-scrollbar]:w-2 [&::-webkit-scrollbar-thumb]:bg-gray-300/80 [&::-webkit-scrollbar-thumb]:rounded-full`,children:[u.isLoading&&e.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-gray-50/50 backdrop-blur-sm z-10",children:e.jsxs("div",{className:"flex flex-col items-center gap-3 animate-pulse",children:[e.jsx(I,{className:"w-6 h-6 text-primary animate-spin"}),e.jsx("span",{className:"text-sm font-medium text-gray-500",children:t("sessionsHistoryLoading")})]})}),u.error&&e.jsx("div",{className:"text-center p-6 bg-red-50 rounded-xl text-red-600 border border-red-100 text-sm",children:u.error.message}),!u.isLoading&&((K=u.data)==null?void 0:K.messages.length)===0&&e.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-gray-400",children:[e.jsx(Q,{className:"w-12 h-12 mb-3 text-gray-300"}),e.jsx("p",{className:"text-sm",children:t("sessionsEmpty")})]}),e.jsx("div",{className:"max-w-3xl mx-auto",children:(((R=u.data)==null?void 0:R.messages)??[]).map((s,h)=>e.jsx(we,{message:s},`${s.timestamp}-${h}`))})]})]}):e.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center text-gray-400 p-8 h-full bg-white",children:[e.jsx("div",{className:"w-20 h-20 bg-gray-50 rounded-3xl flex items-center justify-center mb-6 border border-gray-100 shadow-[0_2px_8px_-2px_rgba(0,0,0,0.02)] rotate-3",children:e.jsx(T,{className:"h-8 w-8 text-gray-300 -rotate-3"})}),e.jsx("h3",{className:"text-lg font-bold text-gray-900 mb-2",children:t("sessionsNoSelectionTitle")}),e.jsx("p",{className:"text-sm text-center max-w-sm leading-relaxed",children:t("sessionsNoSelectionDescription")})]})]})]}),e.jsx(O,{})]})}export{De as SessionsConfig};
@@ -1,3 +0,0 @@
1
- import{j as u,ae as m}from"./vendor-CNhxtHCf.js";import{t as p,c as g}from"./index-BulnQWr6.js";const l={queued:1,running:2};function o(t){return t==="queued"||t==="running"?t:null}function y(t){const n=Date.parse(t??"");return Number.isFinite(n)?n:0}function d(t,n){const e=o(t.state),r=o(n.state);if(!e||!r)return!1;const s=l[e],i=l[r];return i!==s?i>s:y(n.requestedAt)>=y(t.requestedAt)}function R(t){var e;const n=new Map;for(const r of t){const s=(e=r.sessionKey)==null?void 0:e.trim();if(!s||!o(r.state))continue;const i=n.get(s);(!i||d(i,r))&&n.set(s,r)}return n}function A(t){const n=new Map;for(const[e,r]of t.entries()){const s=o(r.state);s&&n.set(e,s)}return n}function j({status:t,className:n}){const e=t==="running"?p("sessionsRunStatusRunning"):p("sessionsRunStatusQueued");return u.jsxs("span",{className:g("inline-flex h-3.5 w-3.5 items-center justify-center text-gray-400",n),title:e,"aria-label":e,children:[u.jsx(m,{className:"h-3 w-3 animate-spin"}),u.jsx("span",{className:"sr-only",children:e})]})}const h=["cmd","command","query","q","path","url","to","channel","agentId","sessionKey"];function c(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function f(t,n=2400){return t.length<=n?t:`${t.slice(0,n)}
2
- …`}function a(t){if(typeof t=="string")return t;if(typeof t=="number"||typeof t=="boolean")return String(t);if(t==null)return"";try{return f(JSON.stringify(t,null,2))}catch{return String(t)}}function S(t){if(c(t))return t;if(typeof t!="string")return null;const n=t.trim();if(!n.startsWith("{")&&!n.startsWith("["))return null;try{const e=JSON.parse(n);return c(e)?e:null}catch{return null}}function T(t){const n=S(t);if(!n){const r=a(t).trim();return r?f(r,120):void 0}const e=[];for(const r of h){const s=n[r];if(typeof s=="string"&&s.trim()?e.push(`${r}: ${s.trim()}`):(typeof s=="number"||typeof s=="boolean")&&e.push(`${r}: ${String(s)}`),e.length>=2)break}return e.length>0?e.join(" · "):f(a(n),140)}function N(t){if(typeof t=="string")return t;if(Array.isArray(t)){const n=[];for(const e of t){if(typeof e=="string"){n.push(e);continue}if(c(e)){if(typeof e.text=="string"){n.push(e.text);continue}typeof e.content=="string"&&n.push(e.content)}}if(n.length>0)return n.join(`
3
- `)}return a(t)}export{j as S,A as a,R as b,a as c,N as e,T as s};
@@ -1 +0,0 @@
1
- *,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:hsl(var(--gray-200))}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:var(--font-sans);font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--font-mono);font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:hsl(var(--gray-400))}input::placeholder,textarea::placeholder{opacity:1;color:hsl(var(--gray-400))}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}:root{--brand-50: 94 20% 95%;--brand-100: 94 20% 90%;--brand-200: 94 18% 80%;--brand-300: 94 16% 65%;--brand-400: 94 16% 50%;--brand-500: 94 13% 37%;--brand-600: 94 13% 30%;--brand-700: 94 15% 25%;--brand-800: 94 20% 18%;--brand-900: 94 25% 12%;--gray-50: 45 25% 97%;--gray-100: 45 14% 94%;--gray-200: 45 14% 88%;--gray-300: 45 10% 80%;--gray-400: 45 10% 60%;--gray-500: 45 10% 50%;--gray-600: 45 3% 39%;--gray-700: 45 5% 25%;--gray-800: 45 5% 20%;--gray-900: 45 5% 12%;--background: var(--gray-50);--background-secondary: var(--gray-100);--background-tertiary: var(--gray-200);--foreground: var(--gray-800);--foreground-secondary: var(--gray-700);--foreground-tertiary: var(--gray-500);--foreground-muted: var(--gray-400);--primary: var(--brand-500);--primary-hover: var(--brand-600);--primary-active: var(--brand-700);--primary-foreground: 0 0% 100%;--secondary: var(--gray-100);--secondary-hover: var(--gray-200);--secondary-foreground: var(--gray-800);--accent: var(--brand-50);--accent-foreground: var(--brand-700);--muted: var(--gray-100);--muted-foreground: var(--gray-500);--destructive: 0 84% 60%;--destructive-foreground: 0 0% 98%;--success: 142 76% 36%;--success-foreground: 0 0% 100%;--warning: 38 92% 50%;--warning-foreground: 0 0% 100%;--card: 0 0% 100%;--card-foreground: var(--gray-800);--card-border: var(--gray-200);--popover: 0 0% 100%;--popover-foreground: var(--gray-800);--border: var(--gray-200);--border-hover: var(--gray-300);--border-active: var(--brand-500);--input: 0 0% 100%;--input-border: var(--gray-200);--input-focus: var(--brand-500);--ring: var(--brand-500);--ring-offset: var(--gray-50);--space-0: 0px;--space-1: 4px;--space-2: 8px;--space-3: 12px;--space-4: 16px;--space-5: 20px;--space-6: 24px;--space-8: 32px;--space-10: 40px;--space-12: 48px;--space-16: 64px;--space-20: 80px;--space-24: 96px;--radius-sm: 6px;--radius-md: 8px;--radius-lg: 12px;--radius-xl: 16px;--radius-2xl: 20px;--radius-3xl: 24px;--radius-full: 9999px;--shadow-xs: 0 1px 2px 0 rgb(30 20 10 / .04);--shadow-sm: 0 1px 3px 0 rgb(30 20 10 / .06), 0 1px 2px -1px rgb(30 20 10 / .04);--shadow-md: 0 4px 6px -1px rgb(30 20 10 / .06), 0 2px 4px -2px rgb(30 20 10 / .04);--shadow-lg: 0 10px 15px -3px rgb(30 20 10 / .06), 0 4px 6px -4px rgb(30 20 10 / .04);--shadow-xl: 0 20px 25px -5px rgb(30 20 10 / .08), 0 8px 10px -6px rgb(30 20 10 / .04);--shadow-2xl: 0 25px 50px -12px rgb(30 20 10 / .15);--shadow-card: 0 0 8px 0 rgba(0, 0, 0, .04);--shadow-card-hover: 0 0 16px 0 rgba(0, 0, 0, .06);--font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;--font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;--text-xs: 12px;--text-sm: 14px;--text-base: 16px;--text-lg: 18px;--text-xl: 20px;--text-2xl: 24px;--text-3xl: 30px;--text-4xl: 36px;--text-5xl: 48px;--font-normal: 400;--font-medium: 500;--font-semibold: 600;--font-bold: 700;--leading-tight: 1.25;--leading-snug: 1.375;--leading-normal: 1.5;--leading-relaxed: 1.625;--tracking-tight: -.025em;--tracking-normal: 0;--tracking-wide: .025em;--transition-fast: .15s ease;--transition-base: .2s ease;--transition-slow: .3s ease;--z-dropdown: 100;--z-sticky: 200;--z-fixed: 300;--z-modal-backdrop: 400;--z-modal: 500;--z-popover: 600;--z-tooltip: 700}:root[data-theme=cool]{--brand-50: 214 100% 97%;--brand-100: 214 95% 93%;--brand-200: 213 97% 87%;--brand-300: 212 96% 78%;--brand-400: 213 94% 68%;--brand-500: 217 91% 60%;--brand-600: 221 83% 53%;--brand-700: 224 76% 48%;--brand-800: 226 71% 40%;--brand-900: 224 64% 33%;--gray-50: 210 20% 98%;--gray-100: 220 14% 96%;--gray-200: 220 13% 91%;--gray-300: 216 12% 84%;--gray-400: 218 11% 65%;--gray-500: 220 9% 46%;--gray-600: 215 14% 34%;--gray-700: 217 19% 27%;--gray-800: 220 26% 18%;--gray-900: 224 39% 11%;--background: var(--gray-50);--background-secondary: var(--gray-100);--background-tertiary: var(--gray-200);--foreground: var(--gray-800);--foreground-secondary: var(--gray-700);--foreground-tertiary: var(--gray-500);--foreground-muted: var(--gray-400);--primary: var(--brand-500);--primary-hover: var(--brand-600);--primary-active: var(--brand-700);--secondary: var(--gray-100);--secondary-hover: var(--gray-200);--secondary-foreground: var(--gray-800);--accent: var(--brand-50);--accent-foreground: var(--brand-700);--muted: var(--gray-100);--muted-foreground: var(--gray-500);--card: 0 0% 100%;--card-foreground: var(--gray-800);--card-border: var(--gray-200);--popover: 0 0% 100%;--popover-foreground: var(--gray-800);--border: var(--gray-200);--border-hover: var(--gray-300);--border-active: var(--brand-500);--input: 0 0% 100%;--input-border: var(--gray-200);--input-focus: var(--brand-500);--ring: var(--brand-500);--ring-offset: var(--gray-50);--shadow-xs: 0 1px 2px 0 rgb(15 23 42 / .04);--shadow-sm: 0 1px 3px 0 rgb(15 23 42 / .06), 0 1px 2px -1px rgb(15 23 42 / .04);--shadow-md: 0 4px 6px -1px rgb(15 23 42 / .06), 0 2px 4px -2px rgb(15 23 42 / .04);--shadow-lg: 0 10px 15px -3px rgb(15 23 42 / .06), 0 4px 6px -4px rgb(15 23 42 / .04);--shadow-xl: 0 20px 25px -5px rgb(15 23 42 / .08), 0 8px 10px -6px rgb(15 23 42 / .04);--shadow-2xl: 0 25px 50px -12px rgb(15 23 42 / .14)}:root{--radius: .75rem}*{border-color:hsl(var(--border))}html{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}body{background-color:hsl(var(--background));color:hsl(var(--foreground));font-family:var(--font-sans);overflow:hidden}*{scrollbar-width:thin;scrollbar-color:hsl(var(--gray-300)) transparent}.\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.sticky{position:sticky}.inset-0{top:0;right:0;bottom:0;left:0}.inset-y-0{top:0;bottom:0}.bottom-0{bottom:0}.bottom-full{bottom:100%}.left-0{left:0}.left-3{left:.75rem}.left-\[50\%\]{left:50%}.right-0{right:0}.right-2{right:.5rem}.right-3{right:.75rem}.right-4{right:1rem}.top-0{top:0}.top-1\/2{top:50%}.top-2\.5{top:.625rem}.top-4{top:1rem}.top-\[50\%\]{top:50%}.z-10{z-index:10}.z-20{z-index:20}.z-30{z-index:30}.z-50{z-index:50}.z-\[70\]{z-index:70}.z-\[var\(--z-popover\,50\)\]{z-index:var(--z-popover,50)}.z-\[var\(--z-tooltip\)\]{z-index:var(--z-tooltip)}.m-2{margin:.5rem}.-mx-1{margin-left:-.25rem;margin-right:-.25rem}.mx-4{margin-left:1rem;margin-right:1rem}.mx-\[2px\]{margin-left:2px;margin-right:2px}.mx-auto{margin-left:auto;margin-right:auto}.my-1{margin-top:.25rem;margin-bottom:.25rem}.mb-0{margin-bottom:0}.mb-0\.5{margin-bottom:.125rem}.mb-1{margin-bottom:.25rem}.mb-1\.5{margin-bottom:.375rem}.mb-2{margin-bottom:.5rem}.mb-3{margin-bottom:.75rem}.mb-4{margin-bottom:1rem}.mb-6{margin-bottom:1.5rem}.mb-8{margin-bottom:2rem}.ml-0\.5{margin-left:.125rem}.ml-3{margin-left:.75rem}.ml-auto{margin-left:auto}.mr-1{margin-right:.25rem}.mr-1\.5{margin-right:.375rem}.mr-2{margin-right:.5rem}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.mt-2{margin-top:.5rem}.mt-3{margin-top:.75rem}.mt-4{margin-top:1rem}.mt-6{margin-top:1.5rem}.mt-auto{margin-top:auto}.line-clamp-1{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}.line-clamp-2{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2}.block{display:block}.inline-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.table{display:table}.grid{display:grid}.hidden{display:none}.aspect-square{aspect-ratio:1 / 1}.h-0{height:0px}.h-1{height:.25rem}.h-1\.5{height:.375rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-16{height:4rem}.h-2{height:.5rem}.h-2\.5{height:.625rem}.h-20{height:5rem}.h-24{height:6rem}.h-28{height:7rem}.h-3{height:.75rem}.h-3\.5{height:.875rem}.h-4{height:1rem}.h-5{height:1.25rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-9{height:2.25rem}.h-\[17px\]{height:17px}.h-\[180px\]{height:180px}.h-\[18px\]{height:18px}.h-\[22px\]{height:22px}.h-\[2px\]{height:2px}.h-\[calc\(100vh-80px\)\]{height:calc(100vh - 80px)}.h-\[var\(--radix-select-trigger-height\)\]{height:var(--radix-select-trigger-height)}.h-auto{height:auto}.h-full{height:100%}.h-px{height:1px}.h-screen{height:100vh}.max-h-60{max-height:15rem}.max-h-80{max-height:20rem}.max-h-96{max-height:24rem}.max-h-\[188px\]{max-height:188px}.max-h-\[320px\]{max-height:320px}.min-h-0{min-height:0px}.min-h-7{min-height:1.75rem}.min-h-\[120px\]{min-height:120px}.min-h-\[220px\]{min-height:220px}.min-h-\[240px\]{min-height:240px}.min-h-\[280px\]{min-height:280px}.min-h-\[42px\]{min-height:42px}.min-h-\[520px\]{min-height:520px}.min-h-\[60px\]{min-height:60px}.min-h-\[84px\]{min-height:84px}.min-h-screen{min-height:100vh}.w-1\.5{width:.375rem}.w-1\/3{width:33.333333%}.w-10{width:2.5rem}.w-12{width:3rem}.w-16{width:4rem}.w-2{width:.5rem}.w-2\.5{width:.625rem}.w-2\/3{width:66.666667%}.w-20{width:5rem}.w-24{width:6rem}.w-28{width:7rem}.w-3{width:.75rem}.w-3\.5{width:.875rem}.w-32{width:8rem}.w-36{width:9rem}.w-4{width:1rem}.w-48{width:12rem}.w-5{width:1.25rem}.w-6{width:1.5rem}.w-64{width:16rem}.w-7{width:1.75rem}.w-72{width:18rem}.w-8{width:2rem}.w-80{width:20rem}.w-9{width:2.25rem}.w-\[150px\]{width:150px}.w-\[160px\]{width:160px}.w-\[17px\]{width:17px}.w-\[180px\]{width:180px}.w-\[220px\]{width:220px}.w-\[240px\]{width:240px}.w-\[280px\]{width:280px}.w-\[320px\]{width:320px}.w-\[360px\]{width:360px}.w-\[62\%\]{width:62%}.w-\[78\%\]{width:78%}.w-\[84\%\]{width:84%}.w-auto{width:auto}.w-fit{width:-moz-fit-content;width:fit-content}.w-full{width:100%}.w-px{width:1px}.min-w-0{min-width:0px}.min-w-20{min-width:5rem}.min-w-\[100px\]{min-width:100px}.min-w-\[140px\]{min-width:140px}.min-w-\[150px\]{min-width:150px}.min-w-\[180px\]{min-width:180px}.min-w-\[18px\]{min-width:18px}.min-w-\[220px\]{min-width:220px}.min-w-\[240px\]{min-width:240px}.min-w-\[56px\]{min-width:56px}.min-w-\[8rem\]{min-width:8rem}.min-w-\[var\(--radix-select-trigger-width\)\]{min-width:var(--radix-select-trigger-width)}.max-w-2xl{max-width:42rem}.max-w-3xl{max-width:48rem}.max-w-6xl{max-width:72rem}.max-w-\[100px\]{max-width:100px}.max-w-\[140px\]{max-width:140px}.max-w-\[200px\]{max-width:200px}.max-w-\[220px\]{max-width:220px}.max-w-\[240px\]{max-width:240px}.max-w-\[280px\]{max-width:280px}.max-w-\[300px\]{max-width:300px}.max-w-\[320px\]{max-width:320px}.max-w-\[400px\]{max-width:400px}.max-w-\[420px\]{max-width:420px}.max-w-\[70\%\]{max-width:70%}.max-w-\[85\%\]{max-width:85%}.max-w-\[92\%\]{max-width:92%}.max-w-\[92px\]{max-width:92px}.max-w-\[calc\(100vw-1\.5rem\)\]{max-width:calc(100vw - 1.5rem)}.max-w-\[min\(100\%\,17rem\)\]{max-width:min(100%,17rem)}.max-w-\[min\(1120px\,100\%\)\]{max-width:min(1120px,100%)}.max-w-full{max-width:100%}.max-w-lg{max-width:32rem}.max-w-md{max-width:28rem}.max-w-sm{max-width:24rem}.max-w-xl{max-width:36rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.basis-\[240px\]{flex-basis:240px}.-translate-y-1\/2{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-0{--tw-translate-x: 0px;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-5{--tw-translate-x: 1.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-x-\[-50\%\]{--tw-translate-x: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.translate-y-\[-50\%\]{--tw-translate-y: -50%;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.-rotate-3{--tw-rotate: -3deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-3{--tw-rotate: 3deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.rotate-\[-45deg\]{--tw-rotate: -45deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}@keyframes fadeIn{0%{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}.animate-fade-in{animation:fadeIn .4s cubic-bezier(.16,1,.3,1) forwards}@keyframes pulse{50%{opacity:.5}}.animate-pulse{animation:pulse 2s cubic-bezier(.4,0,.6,1) infinite}@keyframes slideIn{0%{opacity:0;transform:translate(-12px)}to{opacity:1;transform:translate(0)}}.animate-slide-in{animation:slideIn .35s cubic-bezier(.16,1,.3,1) forwards}@keyframes spin{to{transform:rotate(360deg)}}.animate-spin{animation:spin 1s linear infinite}.cursor-default{cursor:default}.cursor-ew-resize{cursor:ew-resize}.cursor-grab{cursor:grab}.cursor-not-allowed{cursor:not-allowed}.cursor-ns-resize{cursor:ns-resize}.cursor-pointer{cursor:pointer}.cursor-se-resize{cursor:se-resize}.cursor-text{cursor:text}.select-none{-webkit-user-select:none;-moz-user-select:none;user-select:none}.resize-none{resize:none}.list-none{list-style-type:none}.grid-cols-1{grid-template-columns:repeat(1,minmax(0,1fr))}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.grid-cols-\[1fr_auto\]{grid-template-columns:1fr auto}.grid-cols-\[minmax\(0\,1fr\)_0\.875rem\]{grid-template-columns:minmax(0,1fr) .875rem}.grid-cols-\[minmax\(220px\,300px\)_minmax\(0\,1fr\)\]{grid-template-columns:minmax(220px,300px) minmax(0,1fr)}.flex-col{flex-direction:column}.flex-col-reverse{flex-direction:column-reverse}.flex-wrap{flex-wrap:wrap}.items-start{align-items:flex-start}.items-end{align-items:flex-end}.items-center{align-items:center}.items-baseline{align-items:baseline}.justify-start{justify-content:flex-start}.justify-end{justify-content:flex-end}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-0\.5{gap:.125rem}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-2\.5{gap:.625rem}.gap-3{gap:.75rem}.gap-3\.5{gap:.875rem}.gap-4{gap:1rem}.gap-5{gap:1.25rem}.gap-6{gap:1.5rem}.gap-8{gap:2rem}.space-y-0\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.125rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.125rem * var(--tw-space-y-reverse))}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-1\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.375rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.375rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-2\.5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.625rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.625rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.space-y-5>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.25rem * var(--tw-space-y-reverse))}.space-y-6>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1.5rem * var(--tw-space-y-reverse))}.space-y-8>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(2rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(2rem * var(--tw-space-y-reverse))}.self-stretch{align-self:stretch}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.overflow-x-hidden{overflow-x:hidden}.overscroll-contain{overscroll-behavior:contain}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-nowrap{white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-words{overflow-wrap:break-word}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:calc(var(--radius) + 8px)}.rounded-3xl{border-radius:1.5rem}.rounded-\[1\.25rem\]{border-radius:1.25rem}.rounded-\[14px\]{border-radius:14px}.rounded-\[2px\]{border-radius:2px}.rounded-full{border-radius:9999px}.rounded-lg{border-radius:var(--radius)}.rounded-md{border-radius:calc(var(--radius) - 2px)}.rounded-sm{border-radius:calc(var(--radius) - 4px)}.rounded-xl{border-radius:calc(var(--radius) + 4px)}.rounded-l-md{border-top-left-radius:calc(var(--radius) - 2px);border-bottom-left-radius:calc(var(--radius) - 2px)}.rounded-r-full{border-top-right-radius:9999px;border-bottom-right-radius:9999px}.rounded-r-md{border-top-right-radius:calc(var(--radius) - 2px);border-bottom-right-radius:calc(var(--radius) - 2px)}.rounded-tl-sm{border-top-left-radius:calc(var(--radius) - 4px)}.rounded-tr-sm{border-top-right-radius:calc(var(--radius) - 4px)}.border{border-width:1px}.border-0{border-width:0px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-b-0{border-bottom-width:0px}.border-l{border-left-width:1px}.border-r{border-right-width:1px}.border-t{border-top-width:1px}.border-dashed{border-style:dashed}.border-\[\#dde0ea\]{--tw-border-opacity: 1;border-color:rgb(221 224 234 / var(--tw-border-opacity, 1))}.border-amber-200{--tw-border-opacity: 1;border-color:rgb(253 230 138 / var(--tw-border-opacity, 1))}.border-amber-200\/70{border-color:#fde68ab3}.border-amber-200\/80{border-color:#fde68acc}.border-blue-200{--tw-border-opacity: 1;border-color:rgb(191 219 254 / var(--tw-border-opacity, 1))}.border-blue-300{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity, 1))}.border-border\/40{border-color:hsl(var(--border) / .4)}.border-emerald-200{--tw-border-opacity: 1;border-color:rgb(167 243 208 / var(--tw-border-opacity, 1))}.border-gray-100{border-color:hsl(var(--gray-100))}.border-gray-100\/50{border-color:hsl(var(--gray-100) / .5)}.border-gray-200{border-color:hsl(var(--gray-200))}.border-gray-200\/40{border-color:hsl(var(--gray-200) / .4)}.border-gray-200\/50{border-color:hsl(var(--gray-200) / .5)}.border-gray-200\/60{border-color:hsl(var(--gray-200) / .6)}.border-gray-200\/70{border-color:hsl(var(--gray-200) / .7)}.border-gray-200\/80{border-color:hsl(var(--gray-200) / .8)}.border-gray-300{border-color:hsl(var(--gray-300))}.border-gray-400{border-color:hsl(var(--gray-400))}.border-orange-200\/80{border-color:#fed7aacc}.border-primary{border-color:hsl(var(--primary))}.border-primary\/20{border-color:hsl(var(--primary) / .2)}.border-primary\/25{border-color:hsl(var(--primary) / .25)}.border-primary\/30{border-color:hsl(var(--primary) / .3)}.border-red-100{--tw-border-opacity: 1;border-color:rgb(254 226 226 / var(--tw-border-opacity, 1))}.border-rose-100{--tw-border-opacity: 1;border-color:rgb(255 228 230 / var(--tw-border-opacity, 1))}.border-rose-200{--tw-border-opacity: 1;border-color:rgb(254 205 211 / var(--tw-border-opacity, 1))}.border-slate-200\/80{border-color:#e2e8f0cc}.border-slate-300{--tw-border-opacity: 1;border-color:rgb(203 213 225 / var(--tw-border-opacity, 1))}.border-transparent{border-color:transparent}.border-white\/80{border-color:#fffc}.bg-\[\#dddfe6\]{--tw-bg-opacity: 1;background-color:rgb(221 223 230 / var(--tw-bg-opacity, 1))}.bg-amber-100{--tw-bg-opacity: 1;background-color:rgb(254 243 199 / var(--tw-bg-opacity, 1))}.bg-amber-100\/40{background-color:#fef3c766}.bg-amber-400{--tw-bg-opacity: 1;background-color:rgb(251 191 36 / var(--tw-bg-opacity, 1))}.bg-amber-50{--tw-bg-opacity: 1;background-color:rgb(255 251 235 / var(--tw-bg-opacity, 1))}.bg-amber-50\/60{background-color:#fffbeb99}.bg-amber-50\/70{background-color:#fffbebb3}.bg-amber-600{--tw-bg-opacity: 1;background-color:rgb(217 119 6 / var(--tw-bg-opacity, 1))}.bg-background{background-color:hsl(var(--background))}.bg-black\/40{background-color:#0006}.bg-blue-50{--tw-bg-opacity: 1;background-color:rgb(239 246 255 / var(--tw-bg-opacity, 1))}.bg-card\/40{background-color:hsl(var(--card) / .4)}.bg-cyan-600{--tw-bg-opacity: 1;background-color:rgb(8 145 178 / var(--tw-bg-opacity, 1))}.bg-destructive{background-color:hsl(var(--destructive))}.bg-emerald-100{--tw-bg-opacity: 1;background-color:rgb(209 250 229 / var(--tw-bg-opacity, 1))}.bg-emerald-50{--tw-bg-opacity: 1;background-color:rgb(236 253 245 / var(--tw-bg-opacity, 1))}.bg-emerald-500{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.bg-emerald-600{--tw-bg-opacity: 1;background-color:rgb(5 150 105 / var(--tw-bg-opacity, 1))}.bg-gray-100\/80{background-color:hsl(var(--gray-100) / .8)}.bg-gray-200{background-color:hsl(var(--gray-200))}.bg-gray-200\/80{background-color:hsl(var(--gray-200) / .8)}.bg-gray-300{background-color:hsl(var(--gray-300))}.bg-gray-50\/50{background-color:hsl(var(--gray-50) / .5)}.bg-gray-50\/70{background-color:hsl(var(--gray-50) / .7)}.bg-gray-50\/80{background-color:hsl(var(--gray-50) / .8)}.bg-gray-700{background-color:hsl(var(--gray-700))}.bg-muted{background-color:hsl(var(--muted))}.bg-orange-50\/70{background-color:#fff7edb3}.bg-orange-500{--tw-bg-opacity: 1;background-color:rgb(249 115 22 / var(--tw-bg-opacity, 1))}.bg-popover{background-color:hsl(var(--popover))}.bg-primary{background-color:hsl(var(--primary))}.bg-primary-50\/40{background-color:hsl(var(--brand-50) / .4)}.bg-primary-50\/50{background-color:hsl(var(--brand-50) / .5)}.bg-primary-700\/60{background-color:hsl(var(--brand-700) / .6)}.bg-primary\/10{background-color:hsl(var(--primary) / .1)}.bg-primary\/20{background-color:hsl(var(--primary) / .2)}.bg-primary\/5{background-color:hsl(var(--primary) / .05)}.bg-red-50{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.bg-rose-50{--tw-bg-opacity: 1;background-color:rgb(255 241 242 / var(--tw-bg-opacity, 1))}.bg-rose-500{--tw-bg-opacity: 1;background-color:rgb(244 63 94 / var(--tw-bg-opacity, 1))}.bg-secondary{background-color:hsl(var(--secondary))}.bg-slate-100{--tw-bg-opacity: 1;background-color:rgb(241 245 249 / var(--tw-bg-opacity, 1))}.bg-slate-200{--tw-bg-opacity: 1;background-color:rgb(226 232 240 / var(--tw-bg-opacity, 1))}.bg-slate-50{--tw-bg-opacity: 1;background-color:rgb(248 250 252 / var(--tw-bg-opacity, 1))}.bg-stone-600{--tw-bg-opacity: 1;background-color:rgb(87 83 78 / var(--tw-bg-opacity, 1))}.bg-teal-600{--tw-bg-opacity: 1;background-color:rgb(13 148 136 / var(--tw-bg-opacity, 1))}.bg-transparent{background-color:transparent}.bg-violet-500{--tw-bg-opacity: 1;background-color:rgb(139 92 246 / var(--tw-bg-opacity, 1))}.bg-white{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.bg-white\/80{background-color:#fffc}.bg-white\/85{background-color:#ffffffd9}.bg-white\/90{background-color:#ffffffe6}.bg-white\/95{background-color:#fffffff2}.bg-yellow-600{--tw-bg-opacity: 1;background-color:rgb(202 138 4 / var(--tw-bg-opacity, 1))}.bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--tw-gradient-stops))}.bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--tw-gradient-stops))}.bg-gradient-to-l{background-image:linear-gradient(to left,var(--tw-gradient-stops))}.from-gray-50\/60{--tw-gradient-from: hsl(var(--gray-50) / .6) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--gray-50) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-primary-50\/70{--tw-gradient-from: hsl(var(--brand-50) / .7) var(--tw-gradient-from-position);--tw-gradient-to: hsl(var(--brand-50) / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.from-transparent{--tw-gradient-from: transparent var(--tw-gradient-from-position);--tw-gradient-to: rgb(0 0 0 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to)}.via-white{--tw-gradient-to: rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops: var(--tw-gradient-from), #fff var(--tw-gradient-via-position), var(--tw-gradient-to)}.to-emerald-50\/60{--tw-gradient-to: rgb(236 253 245 / .6) var(--tw-gradient-to-position)}.to-white{--tw-gradient-to: #fff var(--tw-gradient-to-position)}.to-white\/10{--tw-gradient-to: rgb(255 255 255 / .1) var(--tw-gradient-to-position)}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.p-0{padding:0}.p-0\.5{padding:.125rem}.p-1{padding:.25rem}.p-1\.5{padding:.375rem}.p-2{padding:.5rem}.p-2\.5{padding:.625rem}.p-3{padding:.75rem}.p-3\.5{padding:.875rem}.p-4{padding:1rem}.p-5{padding:1.25rem}.p-6{padding:1.5rem}.p-8{padding:2rem}.px-0{padding-left:0;padding-right:0}.px-1{padding-left:.25rem;padding-right:.25rem}.px-1\.5{padding-left:.375rem;padding-right:.375rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-2\.5{padding-left:.625rem;padding-right:.625rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-3\.5{padding-left:.875rem;padding-right:.875rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.px-6{padding-left:1.5rem;padding-right:1.5rem}.px-8{padding-left:2rem;padding-right:2rem}.py-0{padding-top:0;padding-bottom:0}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-1\.5{padding-top:.375rem;padding-bottom:.375rem}.py-10{padding-top:2.5rem;padding-bottom:2.5rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.py-5{padding-top:1.25rem;padding-bottom:1.25rem}.py-6{padding-top:1.5rem;padding-bottom:1.5rem}.py-8{padding-top:2rem;padding-bottom:2rem}.pb-0{padding-bottom:0}.pb-10{padding-bottom:2.5rem}.pb-16{padding-bottom:4rem}.pb-2{padding-bottom:.5rem}.pb-3{padding-bottom:.75rem}.pb-4{padding-bottom:1rem}.pb-5{padding-bottom:1.25rem}.pb-8{padding-bottom:2rem}.pl-2{padding-left:.5rem}.pl-8{padding-left:2rem}.pl-9{padding-left:2.25rem}.pr-1{padding-right:.25rem}.pr-10{padding-right:2.5rem}.pr-12{padding-right:3rem}.pr-2{padding-right:.5rem}.pr-3{padding-right:.75rem}.pr-6{padding-right:1.5rem}.pr-8{padding-right:2rem}.pt-0{padding-top:0}.pt-0\.5{padding-top:.125rem}.pt-1{padding-top:.25rem}.pt-3{padding-top:.75rem}.pt-4{padding-top:1rem}.pt-5{padding-top:1.25rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.align-baseline{vertical-align:baseline}.font-mono{font-family:var(--font-mono)}.font-sans{font-family:var(--font-sans)}.text-2xl{font-size:1.5rem;line-height:2rem}.text-\[10px\]{font-size:10px}.text-\[11px\]{font-size:11px}.text-\[12px\]{font-size:12px}.text-\[13px\]{font-size:13px}.text-\[14px\]{font-size:14px}.text-\[15px\]{font-size:15px}.text-base{font-size:1rem;line-height:1.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xl{font-size:1.25rem;line-height:1.75rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-normal{font-weight:400}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.capitalize{text-transform:capitalize}.leading-4{line-height:1rem}.leading-5{line-height:1.25rem}.leading-6{line-height:1.5rem}.leading-none{line-height:1}.leading-relaxed{line-height:1.625}.leading-tight{line-height:1.25}.tracking-\[-0\.01em\]{letter-spacing:-.01em}.tracking-\[0\.16em\]{letter-spacing:.16em}.tracking-\[0\.24em\]{letter-spacing:.24em}.tracking-tight{letter-spacing:-.025em}.tracking-wide{letter-spacing:.025em}.tracking-wider{letter-spacing:.05em}.tracking-widest{letter-spacing:.1em}.text-amber-600{--tw-text-opacity: 1;color:rgb(217 119 6 / var(--tw-text-opacity, 1))}.text-amber-700{--tw-text-opacity: 1;color:rgb(180 83 9 / var(--tw-text-opacity, 1))}.text-amber-700\/80{color:#b45309cc}.text-amber-800{--tw-text-opacity: 1;color:rgb(146 64 14 / var(--tw-text-opacity, 1))}.text-amber-800\/90{color:#92400ee6}.text-amber-900{--tw-text-opacity: 1;color:rgb(120 53 15 / var(--tw-text-opacity, 1))}.text-amber-900\/80{color:#78350fcc}.text-blue-700{--tw-text-opacity: 1;color:rgb(29 78 216 / var(--tw-text-opacity, 1))}.text-card-foreground{color:hsl(var(--card-foreground))}.text-destructive-foreground{color:hsl(var(--destructive-foreground))}.text-emerald-600{--tw-text-opacity: 1;color:rgb(5 150 105 / var(--tw-text-opacity, 1))}.text-emerald-700{--tw-text-opacity: 1;color:rgb(4 120 87 / var(--tw-text-opacity, 1))}.text-emerald-800{--tw-text-opacity: 1;color:rgb(6 95 70 / var(--tw-text-opacity, 1))}.text-foreground{color:hsl(var(--foreground))}.text-gray-300{color:hsl(var(--gray-300))}.text-gray-400{color:hsl(var(--gray-400))}.text-gray-500\/90{color:hsl(var(--gray-500) / .9)}.text-gray-700{color:hsl(var(--gray-700))}.text-gray-800{color:hsl(var(--gray-800))}.text-popover-foreground{color:hsl(var(--popover-foreground))}.text-primary{color:hsl(var(--primary))}.text-primary-100{color:hsl(var(--brand-100))}.text-primary-200{color:hsl(var(--brand-200))}.text-primary-50{color:hsl(var(--brand-50))}.text-primary-foreground{color:hsl(var(--primary-foreground))}.text-primary\/70{color:hsl(var(--primary) / .7)}.text-red-500{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.text-red-600{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.text-rose-500{--tw-text-opacity: 1;color:rgb(244 63 94 / var(--tw-text-opacity, 1))}.text-rose-600{--tw-text-opacity: 1;color:rgb(225 29 72 / var(--tw-text-opacity, 1))}.text-rose-700{--tw-text-opacity: 1;color:rgb(190 18 60 / var(--tw-text-opacity, 1))}.text-slate-500{--tw-text-opacity: 1;color:rgb(100 116 139 / var(--tw-text-opacity, 1))}.text-slate-600{--tw-text-opacity: 1;color:rgb(71 85 105 / var(--tw-text-opacity, 1))}.text-slate-700{--tw-text-opacity: 1;color:rgb(51 65 85 / var(--tw-text-opacity, 1))}.text-slate-800{--tw-text-opacity: 1;color:rgb(30 41 59 / var(--tw-text-opacity, 1))}.text-transparent{color:transparent}.text-white{--tw-text-opacity: 1;color:rgb(255 255 255 / var(--tw-text-opacity, 1))}.underline-offset-2{text-underline-offset:2px}.underline-offset-4{text-underline-offset:4px}.opacity-0{opacity:0}.opacity-100{opacity:1}.opacity-50{opacity:.5}.opacity-70{opacity:.7}.opacity-75{opacity:.75}.opacity-90{opacity:.9}.mix-blend-multiply{mix-blend-mode:multiply}.shadow{--tw-shadow: 0 1px 3px 0 rgb(0 0 0 / .1), 0 1px 2px -1px rgb(0 0 0 / .1);--tw-shadow-colored: 0 1px 3px 0 var(--tw-shadow-color), 0 1px 2px -1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-2xl{--tw-shadow: 0 25px 50px -12px rgb(0 0 0 / .25);--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_0_0_2px_rgba\(148\,163\,184\,0\.14\)\]{--tw-shadow: 0 0 0 2px rgba(148,163,184,.14);--tw-shadow-colored: 0 0 0 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_1px_2px_rgba\(0\,0\,0\,0\.02\)\]{--tw-shadow: 0 1px 2px rgba(0,0,0,.02);--tw-shadow-colored: 0 1px 2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[0_2px_8px_-2px_rgba\(0\,0\,0\,0\.02\)\]{--tw-shadow: 0 2px 8px -2px rgba(0,0,0,.02);--tw-shadow-colored: 0 2px 8px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-\[inset_0_0_0_1px_rgba\(17\,24\,39\,0\.06\)\]{--tw-shadow: inset 0 0 0 1px rgba(17,24,39,.06);--tw-shadow-colored: inset 0 0 0 1px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-card{--tw-shadow: var(--shadow-card);--tw-shadow-colored: var(--shadow-card);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-card-hover{--tw-shadow: var(--shadow-card-hover);--tw-shadow-colored: var(--shadow-card-hover);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1);--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color), 0 4px 6px -4px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-md{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-none{--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 2px 0 rgb(0 0 0 / .05);--tw-shadow-colored: 0 1px 2px 0 var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1);--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color), 0 8px 10px -6px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-card{--tw-shadow-color: hsl(var(--card));--tw-shadow: var(--tw-shadow-colored)}.outline-none{outline:2px solid transparent;outline-offset:2px}.outline{outline-style:solid}.ring-0{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-black\/5{--tw-ring-color: rgb(0 0 0 / .05)}.ring-offset-background{--tw-ring-offset-color: hsl(var(--background))}.ring-offset-white{--tw-ring-offset-color: #fff}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.backdrop-blur-md{--tw-backdrop-blur: blur(12px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.backdrop-blur-sm{--tw-backdrop-blur: blur(4px);-webkit-backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia);backdrop-filter:var(--tw-backdrop-blur) var(--tw-backdrop-brightness) var(--tw-backdrop-contrast) var(--tw-backdrop-grayscale) var(--tw-backdrop-hue-rotate) var(--tw-backdrop-invert) var(--tw-backdrop-opacity) var(--tw-backdrop-saturate) var(--tw-backdrop-sepia)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-\[border-color\,background-color\,box-shadow\,color\]{transition-property:border-color,background-color,box-shadow,color;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-all{transition-property:all;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-shadow{transition-property:box-shadow;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-150{transition-duration:.15s}.duration-200,.duration-base{transition-duration:.2s}.duration-fast{transition-duration:.15s}.duration-slow{transition-duration:.3s}@keyframes enter{0%{opacity:var(--tw-enter-opacity, 1);transform:translate3d(var(--tw-enter-translate-x, 0),var(--tw-enter-translate-y, 0),0) scale3d(var(--tw-enter-scale, 1),var(--tw-enter-scale, 1),var(--tw-enter-scale, 1)) rotate(var(--tw-enter-rotate, 0))}}@keyframes exit{to{opacity:var(--tw-exit-opacity, 1);transform:translate3d(var(--tw-exit-translate-x, 0),var(--tw-exit-translate-y, 0),0) scale3d(var(--tw-exit-scale, 1),var(--tw-exit-scale, 1),var(--tw-exit-scale, 1)) rotate(var(--tw-exit-rotate, 0))}}.animate-in{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.fade-in-0{--tw-enter-opacity: 0}.zoom-in-95{--tw-enter-scale: .95}.duration-150{animation-duration:.15s}.duration-200,.duration-base{animation-duration:.2s}.duration-fast{animation-duration:.15s}.duration-slow{animation-duration:.3s}.running{animation-play-state:running}.paused{animation-play-state:paused}.bg-brand-50{background-color:hsl(var(--brand-50))}.text-brand-600{color:hsl(var(--brand-600))}.bg-gray-50{background-color:hsl(var(--gray-50))}.bg-gray-100{background-color:hsl(var(--gray-100))}.bg-gray-900{background-color:hsl(var(--gray-900))}.text-gray-500{color:hsl(var(--gray-500))}.text-gray-600{color:hsl(var(--gray-600))}.text-gray-900{color:hsl(var(--gray-900))}.shadow-card{box-shadow:var(--shadow-card)}.shadow-card-hover{box-shadow:var(--shadow-card-hover)}.custom-scrollbar::-webkit-scrollbar{width:5px;height:5px}.custom-scrollbar::-webkit-scrollbar-track{background:transparent}.custom-scrollbar::-webkit-scrollbar-thumb{background:hsl(var(--gray-300));border-radius:6px}.custom-scrollbar::-webkit-scrollbar-thumb:hover{background:hsl(var(--gray-400))}.shadow-card{box-shadow:0 1px 3px -1px #1e140a08,0 1px 2px -1px #1e140a05}.shadow-card-hover{box-shadow:0 8px 20px -4px #1e140a0f,0 4px 8px -4px #1e140a08}@keyframes fadeIn{0%{opacity:0;transform:translateY(8px)}to{opacity:1;transform:translateY(0)}}@keyframes slideIn{0%{opacity:0;transform:translate(-8px)}to{opacity:1;transform:translate(0)}}@keyframes scaleIn{0%{opacity:0;transform:scale(.98)}to{opacity:1;transform:scale(1)}}@keyframes pulse-soft{0%,to{opacity:1}50%{opacity:.85}}.animate-fade-in{animation:fadeIn .35s cubic-bezier(.16,1,.3,1) forwards}.animate-slide-in{animation:slideIn .3s cubic-bezier(.16,1,.3,1) forwards}.animate-scale-in{animation:scaleIn .3s cubic-bezier(.16,1,.3,1) forwards}.animate-pulse-soft{animation:pulse-soft 3s ease-in-out infinite}.chat-markdown{--md-text: #0f172a;--md-muted: #334155;--md-border: rgba(148, 163, 184, .34);--md-link: hsl(var(--primary));--md-inline-code-bg: rgba(15, 23, 42, .08);--md-inline-code-color: #1e293b;--md-blockquote-border: rgba(14, 165, 233, .45);--md-blockquote-bg: rgba(14, 165, 233, .08);--md-code-surface: #0b1220;--md-code-toolbar-bg: rgba(15, 23, 42, .56);--md-code-toolbar-border: rgba(148, 163, 184, .3);--md-code-text: #e5e7eb;--md-table-head-bg: rgba(148, 163, 184, .14);color:var(--md-text);font-size:.925rem;line-height:1.72;word-break:break-word}.chat-markdown-user{--md-text: rgba(255, 255, 255, .97);--md-muted: rgba(219, 234, 254, .92);--md-border: rgba(191, 219, 254, .35);--md-link: #dbeafe;--md-inline-code-bg: rgba(15, 23, 42, .35);--md-inline-code-color: #eff6ff;--md-blockquote-border: rgba(191, 219, 254, .8);--md-blockquote-bg: rgba(15, 23, 42, .2);--md-code-surface: rgba(2, 6, 23, .92);--md-code-toolbar-bg: rgba(2, 6, 23, .88);--md-code-toolbar-border: rgba(191, 219, 254, .26);--md-code-text: #e2e8f0;--md-table-head-bg: rgba(191, 219, 254, .16)}.chat-markdown>*+*{margin-top:.72rem}.chat-markdown p,.chat-markdown li,.chat-markdown blockquote{color:var(--md-text)}.chat-markdown h1,.chat-markdown h2,.chat-markdown h3,.chat-markdown h4,.chat-markdown h5,.chat-markdown h6{margin:.2rem 0 0;font-weight:700;line-height:1.35;letter-spacing:-.01em}.chat-markdown h1{font-size:1.22rem}.chat-markdown h2{font-size:1.12rem}.chat-markdown h3{font-size:1.02rem}.chat-markdown h4,.chat-markdown h5,.chat-markdown h6{font-size:.96rem}.chat-markdown ul,.chat-markdown ol{margin:.35rem 0;padding-left:1.5rem;list-style-position:outside}.chat-markdown ul{list-style-type:disc}.chat-markdown ol{list-style-type:decimal}.chat-markdown ul ul{list-style-type:circle}.chat-markdown ul ul ul{list-style-type:square}.chat-markdown ol ol{list-style-type:lower-alpha}.chat-markdown ol ol ol{list-style-type:lower-roman}.chat-markdown li{display:list-item}.chat-markdown li::marker{color:#334155e6;font-weight:600}.chat-markdown li+li{margin-top:.25rem}.chat-markdown li>p{margin:0}.chat-markdown ul.contains-task-list,.chat-markdown ol.contains-task-list{list-style:none;padding-left:.2rem}.chat-markdown li.task-list-item{display:flex;align-items:flex-start;gap:.52rem}.chat-markdown-user li::marker{color:#dbeafef2}.chat-markdown .chat-task-checkbox{position:relative;top:.2rem;width:.92rem;height:.92rem;cursor:default}.chat-markdown hr{border:0;border-top:1px solid var(--md-border);margin:.92rem 0}.chat-markdown a{color:var(--md-link);text-decoration-line:underline;text-decoration-thickness:1.2px;text-underline-offset:2px;word-break:break-all}.chat-markdown .chat-link-invalid{color:var(--md-muted);text-decoration-line:underline;text-decoration-style:dotted}.chat-markdown code{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:.82rem}.chat-markdown .chat-inline-code,.chat-markdown :not(pre)>code{padding:.1rem .35rem;border-radius:.4rem;background:var(--md-inline-code-bg);color:var(--md-inline-code-color);border:1px solid var(--md-border);font-weight:520}.chat-codeblock{margin:.2rem 0 .1rem;border:1px solid var(--md-code-toolbar-border);border-radius:.78rem;overflow:hidden;background:var(--md-code-surface)}.chat-codeblock-toolbar{display:flex;align-items:center;justify-content:space-between;gap:.5rem;padding:.43rem .58rem;background:var(--md-code-toolbar-bg);border-bottom:1px solid var(--md-code-toolbar-border)}.chat-codeblock-language{font-size:.68rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:var(--md-code-text);opacity:.8}.chat-codeblock-copy{display:inline-flex;align-items:center;gap:.3rem;font-size:.7rem;font-weight:600;color:var(--md-code-text);border:1px solid var(--md-code-toolbar-border);border-radius:.48rem;padding:.18rem .36rem;background:transparent;cursor:pointer;transition:background-color .15s ease,border-color .15s ease}.chat-codeblock-copy:hover{background:#94a3b833}.chat-codeblock pre{margin:0;padding:.75rem .82rem .8rem;overflow-x:auto;background:transparent}.chat-codeblock code{display:block;min-width:-moz-max-content;min-width:max-content;white-space:pre;line-height:1.58;color:var(--md-code-text)}.chat-table-wrap{margin:.15rem 0;border:1px solid var(--md-border);border-radius:.72rem;overflow-x:auto}.chat-markdown table{width:100%;min-width:420px;border-collapse:separate;border-spacing:0;font-size:.82rem}.chat-markdown thead{background:var(--md-table-head-bg)}.chat-markdown th,.chat-markdown td{padding:.45rem .58rem;border-bottom:1px solid var(--md-border);text-align:left;vertical-align:top}.chat-markdown th+th,.chat-markdown td+td{border-left:1px solid var(--md-border)}.chat-markdown tbody tr:last-child td{border-bottom:none}.chat-markdown th,.chat-markdown strong{font-weight:650}.chat-markdown img{max-width:100%;border-radius:.75rem;border:1px solid var(--md-border)}.chat-markdown blockquote{margin:.2rem 0;border-left:3px solid var(--md-blockquote-border);border-radius:0 .55rem .55rem 0;padding:.45rem .72rem;background:var(--md-blockquote-bg);color:var(--md-muted)}.file\:border-0::file-selector-button{border-width:0px}.file\:bg-transparent::file-selector-button{background-color:transparent}.file\:text-sm::file-selector-button{font-size:.875rem;line-height:1.25rem}.file\:font-medium::file-selector-button{font-weight:500}.placeholder\:font-normal::-moz-placeholder{font-weight:400}.placeholder\:font-normal::placeholder{font-weight:400}.placeholder\:text-gray-300::-moz-placeholder{color:hsl(var(--gray-300))}.placeholder\:text-gray-300::placeholder{color:hsl(var(--gray-300))}.placeholder\:text-gray-400::-moz-placeholder{color:hsl(var(--gray-400))}.placeholder\:text-gray-400::placeholder{color:hsl(var(--gray-400))}.placeholder\:text-muted-foreground::-moz-placeholder{color:hsl(var(--muted-foreground))}.placeholder\:text-muted-foreground::placeholder{color:hsl(var(--muted-foreground))}.empty\:before\:pointer-events-none:empty:before{content:var(--tw-content);pointer-events:none}.empty\:before\:text-gray-400:empty:before{content:var(--tw-content);color:hsl(var(--gray-400))}.empty\:before\:content-\[attr\(data-placeholder\)\]:empty:before{--tw-content: attr(data-placeholder);content:var(--tw-content)}.hover\:border-blue-300:hover{--tw-border-opacity: 1;border-color:rgb(147 197 253 / var(--tw-border-opacity, 1))}.hover\:border-blue-300\/80:hover{border-color:#93c5fdcc}.hover\:border-gray-200:hover{border-color:hsl(var(--gray-200))}.hover\:border-gray-300:hover{border-color:hsl(var(--gray-300))}.hover\:border-primary\/40:hover{border-color:hsl(var(--primary) / .4)}.hover\:border-red-200:hover{--tw-border-opacity: 1;border-color:rgb(254 202 202 / var(--tw-border-opacity, 1))}.hover\:border-rose-200:hover{--tw-border-opacity: 1;border-color:rgb(254 205 211 / var(--tw-border-opacity, 1))}.hover\:bg-black\/10:hover{background-color:#0000001a}.hover\:bg-destructive\/90:hover{background-color:hsl(var(--destructive) / .9)}.hover\:bg-gray-100\/70:hover{background-color:hsl(var(--gray-100) / .7)}.hover\:bg-gray-100\/80:hover{background-color:hsl(var(--gray-100) / .8)}.hover\:bg-gray-200:hover{background-color:hsl(var(--gray-200))}.hover\:bg-gray-200\/60:hover{background-color:hsl(var(--gray-200) / .6)}.hover\:bg-gray-200\/80:hover{background-color:hsl(var(--gray-200) / .8)}.hover\:bg-gray-300\/80:hover{background-color:hsl(var(--gray-300) / .8)}.hover\:bg-gray-50\/70:hover{background-color:hsl(var(--gray-50) / .7)}.hover\:bg-gray-50\/80:hover{background-color:hsl(var(--gray-50) / .8)}.hover\:bg-primary:hover{background-color:hsl(var(--primary))}.hover\:bg-primary-600:hover{background-color:hsl(var(--brand-600))}.hover\:bg-primary\/10:hover{background-color:hsl(var(--primary) / .1)}.hover\:bg-red-50:hover{--tw-bg-opacity: 1;background-color:rgb(254 242 242 / var(--tw-bg-opacity, 1))}.hover\:bg-rose-50:hover{--tw-bg-opacity: 1;background-color:rgb(255 241 242 / var(--tw-bg-opacity, 1))}.hover\:bg-white:hover{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.hover\:bg-white\/50:hover{background-color:#ffffff80}.hover\:text-destructive:hover{color:hsl(var(--destructive))}.hover\:text-gray-700:hover{color:hsl(var(--gray-700))}.hover\:text-gray-800:hover{color:hsl(var(--gray-800))}.hover\:text-primary:hover{color:hsl(var(--primary))}.hover\:text-primary-foreground:hover{color:hsl(var(--primary-foreground))}.hover\:text-primary\/80:hover{color:hsl(var(--primary) / .8)}.hover\:text-red-300:hover{--tw-text-opacity: 1;color:rgb(252 165 165 / var(--tw-text-opacity, 1))}.hover\:text-red-500:hover{--tw-text-opacity: 1;color:rgb(239 68 68 / var(--tw-text-opacity, 1))}.hover\:text-red-600:hover{--tw-text-opacity: 1;color:rgb(220 38 38 / var(--tw-text-opacity, 1))}.hover\:underline:hover{text-decoration-line:underline}.hover\:opacity-100:hover{opacity:1}.hover\:shadow-card-hover:hover{--tw-shadow: var(--shadow-card-hover);--tw-shadow-colored: var(--shadow-card-hover);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:shadow-md:hover{--tw-shadow: 0 4px 6px -1px rgb(0 0 0 / .1), 0 2px 4px -2px rgb(0 0 0 / .1);--tw-shadow-colored: 0 4px 6px -1px var(--tw-shadow-color), 0 2px 4px -2px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.hover\:bg-gray-50:hover{background-color:hsl(var(--gray-50))}.hover\:bg-gray-100:hover{background-color:hsl(var(--gray-100))}.hover\:text-gray-500:hover{color:hsl(var(--gray-500))}.hover\:text-gray-600:hover{color:hsl(var(--gray-600))}.hover\:text-gray-900:hover{color:hsl(var(--gray-900))}.hover\:shadow-card-hover:hover{box-shadow:var(--shadow-card-hover);box-shadow:0 8px 20px -4px #1e140a0f,0 4px 8px -4px #1e140a08}.focus\:border-primary\/40:focus{border-color:hsl(var(--primary) / .4)}.focus\:text-accent-foreground:focus{color:hsl(var(--accent-foreground))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-0:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(0px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-primary\/30:focus{--tw-ring-color: hsl(var(--primary) / .3)}.focus\:ring-primary\/40:focus{--tw-ring-color: hsl(var(--primary) / .4)}.focus\:bg-gray-100:focus{background-color:hsl(var(--gray-100))}.focus-visible\:bg-white:focus-visible{--tw-bg-opacity: 1;background-color:rgb(255 255 255 / var(--tw-bg-opacity, 1))}.focus-visible\:outline-none:focus-visible{outline:2px solid transparent;outline-offset:2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-primary:focus-visible{--tw-ring-color: hsl(var(--primary))}.focus-visible\:ring-ring:focus-visible{--tw-ring-color: hsl(var(--ring))}.focus-visible\:ring-offset-2:focus-visible{--tw-ring-offset-width: 2px}.focus-visible\:ring-offset-white:focus-visible{--tw-ring-offset-color: #fff}.active\:cursor-grabbing:active{cursor:grabbing}.active\:bg-primary-700:active{background-color:hsl(var(--brand-700))}.disabled\:pointer-events-none:disabled{pointer-events:none}.disabled\:cursor-not-allowed:disabled{cursor:not-allowed}.disabled\:text-gray-400:disabled{color:hsl(var(--gray-400))}.disabled\:opacity-30:disabled{opacity:.3}.disabled\:opacity-40:disabled{opacity:.4}.disabled\:opacity-50:disabled{opacity:.5}.group[open] .group-open\:rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group\/session:focus-within .group-focus-within\/session\:opacity-100{opacity:1}.group\/action:hover .group-hover\/action\:translate-x-0\.5{--tw-translate-x: .125rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:scale-110{--tw-scale-x: 1.1;--tw-scale-y: 1.1;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.group:hover .group-hover\:text-gray-700{color:hsl(var(--gray-700))}.group:hover .group-hover\:text-gray-800{color:hsl(var(--gray-800))}.group:hover .group-hover\:text-primary{color:hsl(var(--primary))}.group\/session:hover .group-hover\/session\:opacity-100,.group:hover .group-hover\:opacity-100{opacity:1}.peer:disabled~.peer-disabled\:cursor-not-allowed{cursor:not-allowed}.peer:disabled~.peer-disabled\:opacity-70{opacity:.7}.data-\[disabled\]\:pointer-events-none[data-disabled]{pointer-events:none}.data-\[side\=bottom\]\:translate-y-1[data-side=bottom]{--tw-translate-y: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=left\]\:-translate-x-1[data-side=left]{--tw-translate-x: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=right\]\:translate-x-1[data-side=right]{--tw-translate-x: .25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[side\=top\]\:-translate-y-1[data-side=top]{--tw-translate-y: -.25rem;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.data-\[state\=checked\]\:bg-emerald-500[data-state=checked]{--tw-bg-opacity: 1;background-color:rgb(16 185 129 / var(--tw-bg-opacity, 1))}.data-\[disabled\]\:opacity-50[data-disabled]{opacity:.5}.data-\[state\=open\]\:animate-in[data-state=open]{animation-name:enter;animation-duration:.15s;--tw-enter-opacity: initial;--tw-enter-scale: initial;--tw-enter-rotate: initial;--tw-enter-translate-x: initial;--tw-enter-translate-y: initial}.data-\[state\=closed\]\:animate-out[data-state=closed]{animation-name:exit;animation-duration:.15s;--tw-exit-opacity: initial;--tw-exit-scale: initial;--tw-exit-rotate: initial;--tw-exit-translate-x: initial;--tw-exit-translate-y: initial}.data-\[state\=closed\]\:fade-out-0[data-state=closed]{--tw-exit-opacity: 0}.data-\[state\=open\]\:fade-in-0[data-state=open]{--tw-enter-opacity: 0}.data-\[state\=closed\]\:zoom-out-95[data-state=closed]{--tw-exit-scale: .95}.data-\[state\=open\]\:zoom-in-95[data-state=open]{--tw-enter-scale: .95}.data-\[side\=bottom\]\:slide-in-from-top-2[data-side=bottom]{--tw-enter-translate-y: -.5rem}.data-\[side\=left\]\:slide-in-from-right-2[data-side=left]{--tw-enter-translate-x: .5rem}.data-\[side\=right\]\:slide-in-from-left-2[data-side=right]{--tw-enter-translate-x: -.5rem}.data-\[side\=top\]\:slide-in-from-bottom-2[data-side=top]{--tw-enter-translate-y: .5rem}.data-\[state\=closed\]\:slide-out-to-left-1\/2[data-state=closed]{--tw-exit-translate-x: -50%}.data-\[state\=closed\]\:slide-out-to-top-\[48\%\][data-state=closed]{--tw-exit-translate-y: -48%}.data-\[state\=open\]\:slide-in-from-left-1\/2[data-state=open]{--tw-enter-translate-x: -50%}.data-\[state\=open\]\:slide-in-from-top-\[48\%\][data-state=open]{--tw-enter-translate-y: -48%}@media not all and (min-width:1024px){.max-lg\:w-full{width:100%}}@media(min-width:640px){.sm\:inline-flex{display:inline-flex}.sm\:w-\[38\%\]{width:38%}.sm\:min-w-\[170px\]{min-width:170px}.sm\:max-w-\[220px\]{max-width:220px}.sm\:flex-1{flex:1 1 0%}.sm\:flex-row{flex-direction:row}.sm\:items-center{align-items:center}.sm\:justify-end{justify-content:flex-end}.sm\:gap-0{gap:0px}.sm\:gap-3{gap:.75rem}.sm\:text-left{text-align:left}}@media(min-width:768px){.md\:max-w-sm{max-width:24rem}.md\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.md\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.md\:flex-row{flex-direction:row}.md\:items-start{align-items:flex-start}.md\:items-center{align-items:center}.md\:justify-between{justify-content:space-between}.md\:opacity-0{opacity:0}.group:focus-within .md\:group-focus-within\:opacity-100{opacity:1}.group:hover .md\:group-hover\:opacity-100{opacity:1}}@media(min-width:1024px){.lg\:grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.lg\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.lg\:flex-row{flex-direction:row}.lg\:items-start{align-items:flex-start}.lg\:justify-between{justify-content:space-between}}@media(min-width:1280px){.xl\:flex{display:flex}.xl\:h-\[calc\(100vh-180px\)\]{height:calc(100vh - 180px)}.xl\:h-full{height:100%}.xl\:max-h-\[860px\]{max-height:860px}.xl\:min-h-0{min-height:0px}.xl\:min-h-\[600px\]{min-height:600px}.xl\:flex-1{flex:1 1 0%}.xl\:grid-cols-\[1\.2fr_0\.8fr\]{grid-template-columns:1.2fr .8fr}.xl\:grid-cols-\[340px_minmax\(0\,1fr\)\]{grid-template-columns:340px minmax(0,1fr)}.xl\:flex-col{flex-direction:column}.xl\:overflow-hidden{overflow:hidden}.xl\:pb-0{padding-bottom:0}}@media(min-width:1536px){.\32xl\:grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}}.\[\&\:\:-webkit-scrollbar-thumb\]\:rounded-full::-webkit-scrollbar-thumb{border-radius:9999px}.\[\&\:\:-webkit-scrollbar-thumb\]\:bg-gray-300\/80::-webkit-scrollbar-thumb{background-color:hsl(var(--gray-300) / .8)}.\[\&\:\:-webkit-scrollbar\]\:w-2::-webkit-scrollbar{width:.5rem}.\[\&\>\:last-child\]\:hidden>:last-child{display:none}.\[\&\>span\]\:line-clamp-1>span{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:1}
@@ -1 +0,0 @@
1
- import{r as l,aK as L,j as c,aL as z,aM as G,aN as A,aO as O,aP as P,aQ as _,aR as w,aS as b,aT as H,aU as K,aV as U,aW as V,aX as W,aY as Z,aZ as Q,a_ as X,a$ as Y,b0 as q}from"./vendor-CNhxtHCf.js";import{c as B}from"./index-BulnQWr6.js";var m="Popover",[E]=K(m,[w]),g=w(),[J,d]=E(m),j=e=>{const{__scopePopover:n,children:t,open:a,defaultOpen:o,onOpenChange:r,modal:s=!1}=e,i=g(n),p=l.useRef(null),[u,h]=l.useState(!1),[C,f]=L({prop:a,defaultProp:o??!1,onChange:r,caller:m});return c.jsx(z,{...i,children:c.jsx(J,{scope:n,contentId:G(),triggerRef:p,open:C,onOpenChange:f,onOpenToggle:l.useCallback(()=>f(x=>!x),[f]),hasCustomAnchor:u,onCustomAnchorAdd:l.useCallback(()=>h(!0),[]),onCustomAnchorRemove:l.useCallback(()=>h(!1),[]),modal:s,children:t})})};j.displayName=m;var N="PopoverAnchor",y=l.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,o=d(N,t),r=g(t),{onCustomAnchorAdd:s,onCustomAnchorRemove:i}=o;return l.useEffect(()=>(s(),()=>i()),[s,i]),c.jsx(_,{...r,...a,ref:n})});y.displayName=N;var F="PopoverTrigger",S=l.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,o=d(F,t),r=g(t),s=A(n,o.triggerRef),i=c.jsx(O.button,{type:"button","aria-haspopup":"dialog","aria-expanded":o.open,"aria-controls":o.contentId,"data-state":I(o.open),...a,ref:s,onClick:P(e.onClick,o.onOpenToggle)});return o.hasCustomAnchor?i:c.jsx(_,{asChild:!0,...r,children:i})});S.displayName=F;var R="PopoverPortal",[ee,oe]=E(R,{forceMount:void 0}),M=e=>{const{__scopePopover:n,forceMount:t,children:a,container:o}=e,r=d(R,n);return c.jsx(ee,{scope:n,forceMount:t,children:c.jsx(b,{present:t||r.open,children:c.jsx(H,{asChild:!0,container:o,children:a})})})};M.displayName=R;var v="PopoverContent",T=l.forwardRef((e,n)=>{const t=oe(v,e.__scopePopover),{forceMount:a=t.forceMount,...o}=e,r=d(v,e.__scopePopover);return c.jsx(b,{present:a||r.open,children:r.modal?c.jsx(re,{...o,ref:n}):c.jsx(ne,{...o,ref:n})})});T.displayName=v;var te=W("PopoverContent.RemoveScroll"),re=l.forwardRef((e,n)=>{const t=d(v,e.__scopePopover),a=l.useRef(null),o=A(n,a),r=l.useRef(!1);return l.useEffect(()=>{const s=a.current;if(s)return U(s)},[]),c.jsx(V,{as:te,allowPinchZoom:!0,children:c.jsx(D,{...e,ref:o,trapFocus:t.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:P(e.onCloseAutoFocus,s=>{var i;s.preventDefault(),r.current||(i=t.triggerRef.current)==null||i.focus()}),onPointerDownOutside:P(e.onPointerDownOutside,s=>{const i=s.detail.originalEvent,p=i.button===0&&i.ctrlKey===!0,u=i.button===2||p;r.current=u},{checkForDefaultPrevented:!1}),onFocusOutside:P(e.onFocusOutside,s=>s.preventDefault(),{checkForDefaultPrevented:!1})})})}),ne=l.forwardRef((e,n)=>{const t=d(v,e.__scopePopover),a=l.useRef(!1),o=l.useRef(!1);return c.jsx(D,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:r=>{var s,i;(s=e.onCloseAutoFocus)==null||s.call(e,r),r.defaultPrevented||(a.current||(i=t.triggerRef.current)==null||i.focus(),r.preventDefault()),a.current=!1,o.current=!1},onInteractOutside:r=>{var p,u;(p=e.onInteractOutside)==null||p.call(e,r),r.defaultPrevented||(a.current=!0,r.detail.originalEvent.type==="pointerdown"&&(o.current=!0));const s=r.target;((u=t.triggerRef.current)==null?void 0:u.contains(s))&&r.preventDefault(),r.detail.originalEvent.type==="focusin"&&o.current&&r.preventDefault()}})}),D=l.forwardRef((e,n)=>{const{__scopePopover:t,trapFocus:a,onOpenAutoFocus:o,onCloseAutoFocus:r,disableOutsidePointerEvents:s,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onInteractOutside:h,...C}=e,f=d(v,t),x=g(t);return Z(),c.jsx(Q,{asChild:!0,loop:!0,trapped:a,onMountAutoFocus:o,onUnmountAutoFocus:r,children:c.jsx(X,{asChild:!0,disableOutsidePointerEvents:s,onInteractOutside:h,onEscapeKeyDown:i,onPointerDownOutside:p,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:c.jsx(Y,{"data-state":I(f.open),role:"dialog",id:f.contentId,...x,...C,ref:n,style:{...C.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),k="PopoverClose",ae=l.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,o=d(k,t);return c.jsx(O.button,{type:"button",...a,ref:n,onClick:P(e.onClick,()=>o.onOpenChange(!1))})});ae.displayName=k;var se="PopoverArrow",ce=l.forwardRef((e,n)=>{const{__scopePopover:t,...a}=e,o=g(t);return c.jsx(q,{...o,...a,ref:n})});ce.displayName=se;function I(e){return e?"open":"closed"}var ie=j,ve=y,le=S,pe=M,$=T;const Pe=ie,ge=le,ue=l.forwardRef(({className:e,sideOffset:n=8,align:t="start",...a},o)=>c.jsx(pe,{children:c.jsx($,{ref:o,sideOffset:n,align:t,className:B("z-[var(--z-popover,50)] w-72 overflow-hidden rounded-2xl border border-gray-200/50 bg-white p-4 shadow-lg animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",e),...a})}));ue.displayName=$.displayName;export{ve as A,$ as C,pe as P,ie as R,le as T,Pe as a,ge as b,ue as c};
@@ -1 +0,0 @@
1
- import{r as c,j as e,e as M}from"./vendor-CNhxtHCf.js";import{a9 as O,aa as R,ab as I,ac as B,ad as _,C as u,a6 as h,a7 as x,t as s,a8 as m,J as p,B as j,I as l}from"./index-BulnQWr6.js";import{L as o}from"./label-C7yzBvzK.js";import{S as G}from"./switch-l1P0ev4D.js";import{P as J,a as V}from"./page-layout-DF0xpax2.js";const W=8;function A(r){return r.trim().length>=W}function L(r,n){return r!==n?(M.error(s("authPasswordMismatch")),!1):!0}function q(){const r=O(),n=R(),S=I(),g=B(),y=_(),[f,U]=c.useState(""),[i,N]=c.useState(""),[w,b]=c.useState(""),[d,v]=c.useState(""),[P,C]=c.useState(""),t=r.data,E=f.trim().length>0&&A(i)&&i===w&&!n.isPending,D=A(d)&&d===P&&!g.isPending,T=async()=>{if(L(i,w))try{await n.mutateAsync({username:f.trim(),password:i}),N(""),b("")}catch{}},F=async()=>{if(L(d,P))try{await g.mutateAsync({password:d}),v(""),C("")}catch{}},H=async a=>{try{await S.mutateAsync({enabled:a})}catch{}},k=async()=>{try{await y.mutateAsync()}catch{}};return r.isLoading&&!t?e.jsxs(u,{children:[e.jsxs(h,{children:[e.jsx(x,{children:s("authSecurityTitle")}),e.jsx(m,{children:s("authSecurityDescription")})]}),e.jsx(p,{className:"text-sm text-gray-500",children:s("loading")})]}):r.isError||!t?e.jsxs(u,{children:[e.jsxs(h,{children:[e.jsx(x,{children:s("authSecurityTitle")}),e.jsx(m,{children:s("authSecurityDescription")})]}),e.jsxs(p,{className:"space-y-4",children:[e.jsx("p",{className:"text-sm text-gray-500",children:s("authStatusLoadFailed")}),e.jsx(j,{variant:"outline",onClick:()=>{r.refetch()},children:s("authRetryStatus")})]})]}):t.configured?e.jsxs(u,{children:[e.jsxs(h,{children:[e.jsx(x,{children:s("authSecurityTitle")}),e.jsx(m,{children:s("authSecurityDescription")})]}),e.jsxs(p,{className:"space-y-6",children:[e.jsxs("div",{className:"rounded-xl border border-gray-200 p-4",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-start md:justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s("authStatusLabel")}),e.jsx("p",{className:"text-sm text-gray-600",children:s("authStatusConfiguredUser").replace("{username}",t.username??"")}),e.jsx("p",{className:"text-xs text-gray-500",children:s("authUsernameFixedHelp")})]}),e.jsx("span",{className:"inline-flex items-center rounded-full bg-gray-100 px-3 py-1 text-xs font-medium text-gray-700",children:t.enabled?s("enabled"):s("disabled")})]}),e.jsxs("div",{className:"mt-4 flex flex-col gap-4 border-t border-gray-200 pt-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s("authEnableLabel")}),e.jsx("p",{className:"text-xs text-gray-500",children:t.enabled?s("authEnableOnHelp"):s("authEnableOffHelp")})]}),e.jsx(G,{checked:t.enabled,disabled:S.isPending,onCheckedChange:a=>{H(a)}})]})]}),e.jsxs("div",{className:"rounded-xl border border-gray-200 p-4 space-y-4",children:[e.jsxs("div",{className:"space-y-1",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s("authPasswordSectionTitle")}),e.jsx("p",{className:"text-xs text-gray-500",children:s("authPasswordSectionDescription")})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"auth-password-next",children:s("authPassword")}),e.jsx(l,{id:"auth-password-next",type:"password",value:d,onChange:a=>v(a.target.value),placeholder:s("authPasswordPlaceholder")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"auth-password-confirm",children:s("authConfirmPassword")}),e.jsx(l,{id:"auth-password-confirm",type:"password",value:P,onChange:a=>C(a.target.value),placeholder:s("authConfirmPasswordPlaceholder")})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.jsx(j,{type:"button",disabled:!D,onClick:()=>void F(),children:g.isPending?s("authPasswordUpdating"):s("authPasswordAction")}),t.enabled&&t.authenticated?e.jsx(j,{type:"button",variant:"outline",disabled:y.isPending,onClick:()=>void k(),children:y.isPending?s("authLoggingOut"):s("authLogoutAction")}):null]}),e.jsx("p",{className:"text-xs text-gray-500",children:s("authSessionMemoryNotice")})]})]})]}):e.jsxs(u,{children:[e.jsxs(h,{children:[e.jsx(x,{children:s("authSecurityTitle")}),e.jsx(m,{children:s("authSecurityDescription")})]}),e.jsxs(p,{className:"space-y-5",children:[e.jsxs("div",{className:"rounded-xl border border-dashed border-gray-200 bg-gray-50/70 p-4",children:[e.jsx("p",{className:"text-sm font-medium text-gray-900",children:s("authSetupTitle")}),e.jsx("p",{className:"mt-1 text-sm text-gray-500",children:s("authSetupDescription")})]}),e.jsxs("div",{className:"grid gap-4 md:grid-cols-2",children:[e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"auth-setup-username",children:s("authUsername")}),e.jsx(l,{id:"auth-setup-username",value:f,onChange:a=>U(a.target.value),placeholder:s("authUsernamePlaceholder")})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"auth-setup-password",children:s("authPassword")}),e.jsx(l,{id:"auth-setup-password",type:"password",value:i,onChange:a=>N(a.target.value),placeholder:s("authPasswordPlaceholder")})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsx(o,{htmlFor:"auth-setup-confirm",children:s("authConfirmPassword")}),e.jsx(l,{id:"auth-setup-confirm",type:"password",value:w,onChange:a=>b(a.target.value),placeholder:s("authConfirmPasswordPlaceholder")}),e.jsx("p",{className:"text-xs text-gray-500",children:s("authPasswordMinLengthHint")})]}),e.jsx(j,{type:"button",disabled:!E,onClick:()=>void T(),children:n.isPending?s("authSettingUp"):s("authSetupAction")})]})]})}function Z(){return e.jsxs(J,{className:"space-y-6",children:[e.jsx(V,{title:s("authSecurityTitle"),description:s("authSecurityDescription")}),e.jsx(q,{})]})}export{Z as SecurityConfig};
@@ -1 +0,0 @@
1
- import{j as t}from"./vendor-CNhxtHCf.js";import{c as o}from"./index-BulnQWr6.js";function m({className:e,...s}){return t.jsx("div",{className:o("animate-pulse rounded-md bg-slate-200",e),...s})}export{m as S};
@@ -1 +0,0 @@
1
- import{j as e}from"./vendor-CNhxtHCf.js";import{as as m,c as s}from"./index-BulnQWr6.js";function c({tabs:a,activeTab:i,onChange:o,className:n}){return e.jsx("div",{className:s("flex items-center gap-6 border-b border-gray-200/60 mb-6",n),children:a.map(t=>{const r=i===t.id;return e.jsxs("button",{onClick:()=>o(t.id),className:s("relative pb-3 text-[14px] font-medium transition-all duration-fast flex items-center gap-1.5",r?"text-gray-900":"text-gray-600 hover:text-gray-900"),children:[t.label,t.count!==void 0&&e.jsx("span",{className:s("text-[11px] font-medium","text-gray-500"),children:m(t.count)}),r&&e.jsx("div",{className:"absolute bottom-0 left-0 right-0 h-[2px] bg-primary rounded-full"})]},t.id)})})}export{c as T};
@@ -1 +0,0 @@
1
- import{j as a,r as t}from"./vendor-CNhxtHCf.js";import{am as p,an as C,ao as h,ap as x,aq as g,ar as D,B as d,t as i}from"./index-BulnQWr6.js";const j=({open:l,onOpenChange:r,title:c,description:o,confirmLabel:s=i("confirm"),cancelLabel:e=i("cancel"),variant:n="default",onConfirm:u,onCancel:f})=>{const m=()=>{u(),r(!1)},v=()=>{f(),r(!1)};return a.jsx(p,{open:l,onOpenChange:r,children:a.jsxs(C,{className:"[&>:last-child]:hidden",onCloseAutoFocus:b=>b.preventDefault(),children:[a.jsxs(h,{children:[a.jsx(x,{children:c}),o?a.jsx(g,{children:o}):null]}),a.jsxs(D,{className:"gap-2 sm:gap-0",children:[a.jsx(d,{type:"button",variant:"outline",onClick:v,children:e}),a.jsx(d,{type:"button",variant:n==="destructive"?"destructive":"default",onClick:m,children:s})]})]})})},L={open:!1,title:"",description:"",confirmLabel:i("confirm"),cancelLabel:i("cancel"),variant:"default",resolve:null};function y(){const[l,r]=t.useState(L),c=t.useCallback(e=>new Promise(n=>{r({open:!0,title:e.title,description:e.description??"",confirmLabel:e.confirmLabel??i("confirm"),cancelLabel:e.cancelLabel??i("cancel"),variant:e.variant??"default",resolve:u=>{n(u),r(f=>({...f,open:!1,resolve:null}))}})}),[]),o=t.useCallback(e=>{r(n=>(!e&&n.resolve&&n.resolve(!1),{...n,open:e,resolve:e?n.resolve:null}))},[]),s=t.useCallback(()=>a.jsx(j,{open:l.open,onOpenChange:o,title:l.title,description:l.description||void 0,confirmLabel:l.confirmLabel,cancelLabel:l.cancelLabel,variant:l.variant,onConfirm:()=>{var e;return(e=l.resolve)==null?void 0:e.call(l,!0)},onCancel:()=>{var e;return(e=l.resolve)==null?void 0:e.call(l,!1)}}),[l,o]);return{confirm:c,ConfirmDialog:s}}export{y as u};