@antseed/gateway-console 0.1.10 → 0.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{Activity-jZYZ0SDm.js → Activity-BcXN_DqV.js} +1 -1
- package/dist/assets/Audit-nk0K4aQy.js +1 -0
- package/dist/assets/BrandIcon-6gq42Dg-.js +1 -0
- package/dist/assets/{ChainGate-In51TI2h.js → ChainGate-Do1wYOPQ.js} +1 -1
- package/dist/assets/{ChannelClose-D8CcISX0.js → ChannelClose-CdHUKMFm.js} +1 -1
- package/dist/assets/{Charts-doK0mDVf.js → Charts-BMsoEfDr.js} +1 -1
- package/dist/assets/Chat-C4DsUQG-.js +225 -0
- package/dist/assets/{ConnectWallet-DQ0PC6SO.js → ConnectWallet-BYdqZipy.js} +1 -1
- package/dist/assets/{DataTable-BTwj5g1m.js → DataTable-BCgVRqY6.js} +1 -1
- package/dist/assets/Disclosure-CQMtWM0M.js +1 -0
- package/dist/assets/KeyHolder-JK1zjm4r.js +1 -0
- package/dist/assets/Keys-BndDLQdj.js +1 -0
- package/dist/assets/Logs-DfacvRY6.js +1 -0
- package/dist/assets/Members-pSSyfBFp.js +1 -0
- package/dist/assets/{Migrate-BQYY5ty3.js → Migrate-Bqnu-HEP.js} +1 -1
- package/dist/assets/ModelDetails-Sgq3MjfG.js +1 -0
- package/dist/assets/Models-C6QzCAh4.js +1 -0
- package/dist/assets/{OperatorActions-DrRpfDBV.js → OperatorActions-DWX4uK6I.js} +1 -1
- package/dist/assets/{OperatorGateAlert-D92zhyXC.js → OperatorGateAlert-cpvsO9yT.js} +1 -1
- package/dist/assets/{Overview-CJmp6b7M.js → Overview-C4Bu8z8u.js} +1 -1
- package/dist/assets/{PeerPicker-BJfjL7Dy.js → PeerPicker-CcMSXxY3.js} +1 -1
- package/dist/assets/PolicyEditor-COREmE0O.js +1 -0
- package/dist/assets/PolicyField-ldIq_Yw-.js +1 -0
- package/dist/assets/Presets-DFKw93HK.js +4 -0
- package/dist/assets/Providers-D_0V31og.js +1 -0
- package/dist/assets/RequestLog-ChzJA1hM.js +1 -0
- package/dist/assets/{Rewards-DNNxx3NO.js → Rewards-Cgw7r3bc.js} +2 -2
- package/dist/assets/{RewardsClaim-nstcyJvi.js → RewardsClaim-Df0QQMHb.js} +1 -1
- package/dist/assets/Routing-KpWxzlwc.js +1 -0
- package/dist/assets/{Segmented-BelxPFkk.js → Segmented-DYnoemT9.js} +1 -1
- package/dist/assets/{SelectField-BWyF8Ku8.js → SelectField-m1sMIgMa.js} +1 -1
- package/dist/assets/Settings-D2MkmqAU.js +7 -0
- package/dist/assets/SidePanel-BFQArkoa.js +1 -0
- package/dist/assets/{Staking-DHwoflHG.js → Staking-2rSdK2Ob.js} +1 -1
- package/dist/assets/{StakingDashboard-DtOKTmys.js → StakingDashboard-DvLxJ1j4.js} +1 -1
- package/dist/assets/Switch-Db8Sm64J.js +1 -0
- package/dist/assets/{Tabs-yVL4Cd6z.js → Tabs-CCabxVNK.js} +1 -1
- package/dist/assets/{TextAreaField-B6jcl4RR.js → TextAreaField-BCi-qMua.js} +1 -1
- package/dist/assets/{UsageByModel-DhTF-c1H.js → UsageByModel-Fb68pvpD.js} +1 -1
- package/dist/assets/VerificationLinks-CWyl6ZEp.js +1 -0
- package/dist/assets/{Wallet-QXhhg_E-.js → Wallet-BVuVEAB5.js} +7 -7
- package/dist/assets/{WalletConfirm-CgWBuaMN.js → WalletConfirm-Bs7CFRaa.js} +1 -1
- package/dist/assets/{WalletFunding-Ydd9gD2t.js → WalletFunding-w9MlXB0t.js} +1 -1
- package/dist/assets/{WalletSignIn-DvVSFW4u.js → WalletSignIn-CFxQjhbw.js} +1 -1
- package/dist/assets/Workspaces-DktyLm08.js +1 -0
- package/dist/assets/{add-ChFb9YAz.js → add-CWU7ACA6.js} +1 -1
- package/dist/assets/{all-wallets-rdNweGUd.js → all-wallets-C7xN3fay.js} +1 -1
- package/dist/assets/{app-store-s294A1qn.js → app-store-C9LYdcrl.js} +1 -1
- package/dist/assets/{apple-Cs8Kx1eO.js → apple-DyeheYaR.js} +1 -1
- package/dist/assets/{arrow-bottom-BMmCEQIa.js → arrow-bottom-C-Ld0QTs.js} +1 -1
- package/dist/assets/{arrow-bottom-circle-CThmnDp3.js → arrow-bottom-circle-CBZDZ8Ab.js} +1 -1
- package/dist/assets/{arrow-left-BJxgCTi0.js → arrow-left-DpJrY7yH.js} +1 -1
- package/dist/assets/{arrow-right-CnLYkBsH.js → arrow-right-C12AYUbo.js} +1 -1
- package/dist/assets/{arrow-top-Dc0DLP-U.js → arrow-top-DTpoR1JD.js} +1 -1
- package/dist/assets/{bank-CSWOYeMW.js → bank-Ce19qcX5.js} +1 -1
- package/dist/assets/{basic-BHdv4O5I.js → basic-xSJded8g.js} +1 -1
- package/dist/assets/{browser-mp33aPgo.js → browser-efLjW-nE.js} +1 -1
- package/dist/assets/{bundle-full-CDQ5iC5h.js → bundle-full-Bo_XusKG.js} +1 -1
- package/dist/assets/{card-BcVuRQiM.js → card-C5hP1T57.js} +1 -1
- package/dist/assets/{ccip-O1XLvWon.js → ccip-B61TPyfu.js} +1 -1
- package/dist/assets/{checkmark-CQVJIWW1.js → checkmark-D6TDn2nt.js} +1 -1
- package/dist/assets/{checkmark-bold-DDU5XQfq.js → checkmark-bold-D6Dl_7lL.js} +1 -1
- package/dist/assets/{chevron-bottom-Bqi9FW2q.js → chevron-bottom-BN93pLQ-.js} +1 -1
- package/dist/assets/{chevron-left-Vd5st0yB.js → chevron-left-BRtPfxLq.js} +1 -1
- package/dist/assets/{chevron-right-BVwFrlss.js → chevron-right-q6ckJ6mb.js} +1 -1
- package/dist/assets/{chevron-top-D5dQ2xFn.js → chevron-top-C1AX5sm6.js} +1 -1
- package/dist/assets/{chrome-store-C9C4k8IO.js → chrome-store-Bo_BoLHJ.js} +1 -1
- package/dist/assets/{clock-Cuvc7bNo.js → clock-BhAO_7G0.js} +1 -1
- package/dist/assets/{close-fW1pJ13b.js → close-BtzdVDHu.js} +1 -1
- package/dist/assets/code-block-DqMh9vFo.js +3 -0
- package/dist/assets/{coinPlaceholder-CKymvNA8.js → coinPlaceholder-Di1b8fYJ.js} +1 -1
- package/dist/assets/{compass-D3h_6fr8.js → compass-C10lNmou.js} +1 -1
- package/dist/assets/{copy-CNGN_cOz.js → copy-B5e38uFc.js} +1 -1
- package/dist/assets/{core-LDeQm5nv.js → core-B0f6zAPS.js} +3 -3
- package/dist/assets/{cursor-transparent-BblOfv3t.js → cursor-transparent-DzGICXfN.js} +1 -1
- package/dist/assets/cursor-zACYQT2t.js +3 -0
- package/dist/assets/{desktop-gpVOlZ1-.js → desktop-DSb6a3DL.js} +1 -1
- package/dist/assets/{disconnect-C_phPN0_.js → disconnect-DRzHq1ok.js} +1 -1
- package/dist/assets/{discord-Dk_2Plhc.js → discord-c_RQc3fB.js} +1 -1
- package/dist/assets/{en_US-Y4ZOVFV4-CmhP8GU2.js → en_US-Y4ZOVFV4-Bkc-z49M.js} +4 -4
- package/dist/assets/{etherscan-Cyrh-2Lr.js → etherscan-CQGvGKJu.js} +1 -1
- package/dist/assets/{exclamation-triangle-SeeDwZ6A.js → exclamation-triangle-CPWxzsHw.js} +1 -1
- package/dist/assets/{extension-e_11O0GI.js → extension-ytWXOqXr.js} +1 -1
- package/dist/assets/{external-link-Dl0AqCn3.js → external-link-BYoSE2u3.js} +1 -1
- package/dist/assets/{facebook-Cp_-Axbh.js → facebook-CMBv0nnN.js} +1 -1
- package/dist/assets/{farcaster-Zwu26KYL.js → farcaster-CJmfWTQP.js} +1 -1
- package/dist/assets/{filters-CdkpWvgi.js → filters-DEiNVvyn.js} +1 -1
- package/dist/assets/{github-DuPUePDJ.js → github-CdMwJkf8.js} +1 -1
- package/dist/assets/{google-DlKW7Gx7.js → google-CHI5gfH8.js} +1 -1
- package/dist/assets/{help-circle-19xLhjPt.js → help-circle-dA36a8fM.js} +1 -1
- package/dist/assets/highlighted-body-KQOG7T2V-BFlyrf-z.js +1 -0
- package/dist/assets/{id-B4PjxpL6.js → id-Dm0-1g1D.js} +1 -1
- package/dist/assets/{image-CHz8w95r.js → image-BL3ODVX_.js} +1 -1
- package/dist/assets/{index-CfhMI0GY.css → index-BAcoKUeC.css} +1 -1
- package/dist/assets/{index-CAflmCbT.js → index-BRgGxCKs.js} +3 -3
- package/dist/assets/{index-CgyFWy7G.js → index-BXzZZOmS.js} +1 -1
- package/dist/assets/{index-CZbdRW9K.js → index-CHeO_lLD.js} +1 -1
- package/dist/assets/{index-BYZ6CM-r.js → index-D1OXThJP.js} +1 -1
- package/dist/assets/{index-DIcymBxc.js → index-DPXW_JSn.js} +25 -25
- package/dist/assets/{index.es-0kjt2ETS.js → index.es-XdMmjy3e.js} +3 -3
- package/dist/assets/{info-CFnwPck_.js → info-BbBzpLWs.js} +1 -1
- package/dist/assets/{info-circle-DNYjRzmq.js → info-circle-CKgnYdF-.js} +1 -1
- package/dist/assets/{lightbulb-DPrYcwVp.js → lightbulb-B6Xv9kMK.js} +1 -1
- package/dist/assets/{limits-D8_oE0N-.js → limits-uCwhqY-O.js} +1 -1
- package/dist/assets/{mail-Do_T12XQ.js → mail-BdCMypwE.js} +1 -1
- package/dist/assets/{mermaid-MCJ5UELQ-Cr83KTfF.js → mermaid-MCJ5UELQ-BaHsArCB.js} +3 -3
- package/dist/assets/{metamask-sdk-CHSvqgLD.js → metamask-sdk-BL7QLxcU.js} +1 -1
- package/dist/assets/{mobile-2wdwD-gm.js → mobile-F_82dhUb.js} +1 -1
- package/dist/assets/{more-CugjlKbm.js → more-CtMTtAsM.js} +1 -1
- package/dist/assets/{network-placeholder-D0CvRN9Z.js → network-placeholder-BRs4Lylz.js} +1 -1
- package/dist/assets/{nftPlaceholder-CjCtJ3VF.js → nftPlaceholder-DONTHyad.js} +1 -1
- package/dist/assets/{off-CjwzxGqC.js → off-Bwru40fy.js} +1 -1
- package/dist/assets/{play-store-ts_mM-L7.js → play-store-CDeNquGq.js} +1 -1
- package/dist/assets/{plus-CayVcA5r.js → plus-EcrYfJFM.js} +1 -1
- package/dist/assets/{qr-code-BJFXX7Ga.js → qr-code-CF-SIZQq.js} +1 -1
- package/dist/assets/{recycle-horizontal-Dxd_xbuW.js → recycle-horizontal-CQAPujmy.js} +1 -1
- package/dist/assets/{refresh-2tSMiCzO.js → refresh-BErGEy2b.js} +1 -1
- package/dist/assets/{reown-logo-C3tg9yiK.js → reown-logo-Ge2o4AAI.js} +1 -1
- package/dist/assets/{search-By38_AjN.js → search-Ca88O9BA.js} +1 -1
- package/dist/assets/selection-BV37SUs_.js +1 -0
- package/dist/assets/{send-DhLEHc2T.js → send-VS1TUwft.js} +1 -1
- package/dist/assets/{sendTransaction-CqpP3CZj.js → sendTransaction-k8aDYfd4.js} +1 -1
- package/dist/assets/stored-e0tX90bC.js +1 -0
- package/dist/assets/{swapHorizontal-BSy_Qzqy.js → swapHorizontal-UNJ9wJ3Z.js} +1 -1
- package/dist/assets/{swapHorizontalBold-B4pOkOa-.js → swapHorizontalBold-eQTpC4fd.js} +1 -1
- package/dist/assets/{swapHorizontalMedium-BbDDLHs6.js → swapHorizontalMedium-DaFWQu14.js} +1 -1
- package/dist/assets/{swapHorizontalRoundedBold-MzTdSarg.js → swapHorizontalRoundedBold-BbRZUmJZ.js} +1 -1
- package/dist/assets/{swapVertical-D0uKM7wm.js → swapVertical-CrZ6Be2R.js} +1 -1
- package/dist/assets/{telegram-Q_WwsPzx.js → telegram-CDAYT0ej.js} +1 -1
- package/dist/assets/{three-dots-Cpl_X23E.js → three-dots-CK__4w5S.js} +1 -1
- package/dist/assets/{twitch-B7x-eAo9.js → twitch-BS50nSpU.js} +1 -1
- package/dist/assets/{twitterIcon-BRMMjDzW.js → twitterIcon-BtVx5zJI.js} +1 -1
- package/dist/assets/{usage-DktoZRc8.js → usage-DQGKL0DJ.js} +1 -1
- package/dist/assets/{useInfiniteQuery-NenQ5Num.js → useInfiniteQuery-CAj47QRO.js} +1 -1
- package/dist/assets/{useTx-WkiDSW_A.js → useTx-DzRlz7Ez.js} +1 -1
- package/dist/assets/{verify-filled-CaKhO-hp.js → verify-filled-E4LyUumx.js} +1 -1
- package/dist/assets/{verify-BxTMhyZY.js → verify-hRAQBjoS.js} +1 -1
- package/dist/assets/{w3m-modal-DZ2_0Ukm.js → w3m-modal-CLSVKDRP.js} +1 -1
- package/dist/assets/{waitForCallsStatus-CtriTPoz.js → waitForCallsStatus-C51Vv8Tt.js} +1 -1
- package/dist/assets/{wallet-BeZF3I-Z.js → wallet-D-TGx4VA.js} +1 -1
- package/dist/assets/{wallet-placeholder-BDvuTJ6r.js → wallet-placeholder-SjwHckDA.js} +1 -1
- package/dist/assets/{walletconnect-U8tnyg6m.js → walletconnect-7nuI2nwG.js} +1 -1
- package/dist/assets/{warning-circle-Dg69jmuZ.js → warning-circle-BI2BfSeD.js} +1 -1
- package/dist/assets/{writeContract-DrAWt0yz.js → writeContract-CaMlmKcK.js} +1 -1
- package/dist/assets/{x-CJ-uWPue.js → x-DoGk7CZD.js} +1 -1
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/dist/assets/Audit-C-dFTX_u.js +0 -1
- package/dist/assets/Chat-CaImcsH1.js +0 -220
- package/dist/assets/KeyHolder-D90Uu-Jv.js +0 -1
- package/dist/assets/Keys-B5LppZtn.js +0 -1
- package/dist/assets/Logs-Dw4sZ9lo.js +0 -1
- package/dist/assets/Members-CnaHKFut.js +0 -1
- package/dist/assets/Models-zIuHewdV.js +0 -1
- package/dist/assets/PolicyEditor-BpoV34ra.js +0 -1
- package/dist/assets/PolicyField-CfRYcr_J.js +0 -1
- package/dist/assets/Presets-c1J4UwX0.js +0 -4
- package/dist/assets/Providers-B0LuYcAw.js +0 -1
- package/dist/assets/RequestLog-D2YGgG1C.js +0 -1
- package/dist/assets/Routing-B79eDIZL.js +0 -1
- package/dist/assets/Settings-Cws5Z--R.js +0 -7
- package/dist/assets/Switch-BwBYBnSS.js +0 -1
- package/dist/assets/Workspaces-DuxGwCQ2.js +0 -1
- package/dist/assets/code-block-Djv3iQ0G.js +0 -3
- package/dist/assets/cursor-CTNYpsWo.js +0 -3
- package/dist/assets/highlighted-body-KQOG7T2V-D7DB9nBd.js +0 -1
- package/dist/assets/models-CLos5_p0.js +0 -1
- package/dist/assets/stored-CFfx95Ep.js +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{am as b,an as N,e as g,q,j as e,ao as k,ap as x,aq as w,B as R,I as S,P as B,v as y,ar as E,S as P,as as _,g as n,l as d,Q as A,X as I,h as D,at as K,au as L,A as O,m as c,f as j,av as T}from"./index-DIcymBxc.js";import{R as F}from"./RequestLog-D2YGgG1C.js";import{r as M,e as Q}from"./usage-DktoZRc8.js";import{B as $}from"./Charts-doK0mDVf.js";import"./useInfiniteQuery-NenQ5Num.js";import"./PeerPicker-BJfjL7Dy.js";import"./DataTable-BTwj5g1m.js";function J(){var m;const h=b(),u=N(),s=((m=u.data)==null?void 0:m.kind)==="key"?u.data.me.key:null,l=Date.now(),o=M("30d",l),f=g({queryKey:q.usage({key:s==null?void 0:s.id,from:o,groupBy:"day"}),queryFn:()=>j.usage.report({key:s.id,from:o,to:l,groupBy:"day"}),enabled:!!s}),v=g({queryKey:["key-periods",s==null?void 0:s.id],enabled:!!s,queryFn:async()=>{const a=await Promise.all(["daily","weekly","monthly"].map(async i=>{const t=await j.usage.report({key:s.id,from:T(i,l)});return[i,c(t.totals.spent)]}));return Object.fromEntries([...a,["total",c(s.usage.spent)]])}});return e.jsxs("div",{className:"gc-keyholder",children:[e.jsxs("header",{className:"gc-topbar",children:[e.jsxs("div",{className:"gc-topbar__inner",children:[e.jsx(k,{to:null,tagged:!0}),e.jsx("div",{className:"gc-topbar__spacer"}),e.jsx(x,{className:"gc-endpoint--inline"}),e.jsx(w,{}),e.jsx(R,{variant:"outline",size:"sm",leadingIcon:e.jsx(S.logout,{size:14}),onClick:()=>void h(),children:"Sign out"})]}),e.jsx("div",{className:"gc-topbar__strip",children:e.jsx(x,{})})]}),e.jsx("main",{className:"gc-main",id:"gc-main",children:s&&e.jsxs("div",{className:"gc-page",children:[e.jsx(B,{title:s.label,description:e.jsxs(e.Fragment,{children:["Key ",e.jsx("code",{children:s.hint})," · ",s.status==="active"?e.jsx(y,{tone:"success",children:"Active"}):e.jsx(y,{tone:"danger",children:"Revoked"})]})}),e.jsx("div",{className:"gc-grid gc-grid--4",children:E.map(a=>{var p;const i=s.limits[a],t=((p=v.data)==null?void 0:p[a])??null,r=i===null?null:c(i);return e.jsx(P,{label:`${_[a]} spend`,value:t===null?"…":n(t),sub:r===null?"No limit":`${n(Math.max(r-(t??0),0))} left of ${n(r)}`,meter:r&&t!==null?t/r:null},a)})}),e.jsx(d,{title:"Spend, last 30 days",children:e.jsx(A,{query:f,rows:1,children:a=>e.jsx($,{format:n,label:"Daily spend",points:Q(a,o,l)})})}),e.jsx(d,{title:"Key details",children:e.jsx(I,{items:[["Requests",D(s.usage.requests)],["Spent in total",n(s.usage.spent)],["Last used",K(s.lastUsedAt)],["Expires",s.expiresAt?L(s.expiresAt):"Never"],["Top-ups",s.topupEnabled?"Allowed":"Off"],["Routing",O(s.routingPolicy)]]})}),e.jsx(d,{flush:!0,title:"Requests",children:e.jsx(F,{filter:{key:s.id},showKey:!1})})]})})]})}export{J as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{aC as ke,r as m,b0 as je,b1 as fe,j as s,C as ne,b2 as ve,Y as Se,B as S,u as le,a as Ce,i as ce,d as de,c as Pe,t as ie,P as Le,I as K,T as U,l as Ne,Q as Ae,b3 as Ee,z as ue,b4 as X,A as me,g as ye,m as Te,at as Re,E as Z,b5 as pe,D as De,q as F,f as C,v,au as J,e as Ie,b6 as Me,b7 as Ke,b8 as Ue,b9 as ee,o as Fe,X as _e}from"./index-DIcymBxc.js";import{u as se,a as Oe,P as Ye}from"./PolicyField-CfRYcr_J.js";import{T as Be}from"./Tabs-yVL4Cd6z.js";import{l as te,d as ae,L as qe}from"./limits-D8_oE0N-.js";import{t as ze}from"./dates-Pi3-Ywng.js";import{r as We,e as $e}from"./usage-DktoZRc8.js";import{S as he}from"./Switch-BwBYBnSS.js";import{D as Ve,u as He,P as Qe}from"./DataTable-BTwj5g1m.js";import{b as Ge}from"./Charts-doK0mDVf.js";import{S as Xe}from"./SelectField-BWyF8Ku8.js";import"./PolicyEditor-BpoV34ra.js";import"./PeerPicker-BJfjL7Dy.js";import"./Segmented-BelxPFkk.js";import"./roving-DkptacxO.js";function Ze({result:e,onClose:l}){var r;const o=ke(),[c,y]=m.useState("curl"),d=je((r=o.data)==null?void 0:r.publicUrl,window.location.origin),i=e?fe(d,e.secret):[],a=i.find(h=>h.id===c);return s.jsx(ne,{isOpen:e!==null,onClose:l,size:"lg",eyebrow:"API key",title:e?`${e.key.label} is ready`:"",children:e&&s.jsxs("div",{className:"gc-stack",children:[s.jsx(ve,{secret:e.secret}),s.jsxs("div",{children:[s.jsx("div",{className:"as-field__label",children:"Use it"}),s.jsxs("p",{className:"gc-muted",children:["Base URL ",s.jsxs("code",{children:[d,"/v1"]}),". Replace ",s.jsx("code",{children:"<model>"})," with a model from the Models page."]})]}),s.jsx(Be,{value:c,onChange:y,tabs:i.map(h=>({id:h.id,label:h.label}))}),a&&s.jsx(Se,{code:a.code}),s.jsx("div",{className:"gc-actions",children:s.jsx(S,{onClick:l,children:"Done"})})]})})}const Je="30d";function es({keyId:e}){const[l]=m.useState(()=>Date.now()),o=We(Je,l),c=Ie({queryKey:F.usage({key:e,from:o,groupBy:"day",spark:!0}),queryFn:()=>C.usage.report({key:e,from:o,to:l,groupBy:"day"}),staleTime:6e4});return c.data?s.jsx(Ge,{label:"Daily spend, last 30 days",format:ye,per:"a day",emptyText:"no spend",values:$e(c.data,o,l).map(y=>y.value)}):s.jsx("span",{className:"as-spark as-spark--empty","aria-hidden":"true"})}function ss(e){return e.status==="revoked"?s.jsx(v,{tone:"danger",children:"Revoked"}):e.expiresAt&&e.expiresAt<Date.now()?s.jsx(v,{tone:"warning",children:"Expired"}):e.expiresAt?s.jsxs(v,{tone:"neutral",title:`Expires ${J(e.expiresAt)}`,children:["Until ",J(e.expiresAt)]}):s.jsx(v,{tone:"success",children:"Active"})}function re({title:e,note:l,limits:o,policy:c}){return s.jsxs("div",{className:"gc-layer gc-layer--readonly",children:[s.jsxs("div",{className:"gc-inline gc-inline--between",children:[s.jsx("div",{className:"as-field__label",children:e}),s.jsx(v,{children:"Read only"})]}),s.jsx(_e,{items:[["Spend limits",ue(o??null)],["Routing",me(c??null)]]}),s.jsx("p",{className:"gc-fineprint",children:l})]})}function oe({title:e,idPrefix:l,limits:o,onLimitsChange:c,limitsNote:y,policy:d}){return s.jsxs("div",{className:"gc-layer",children:[e&&s.jsx("div",{className:"as-field__label",children:e}),s.jsxs("div",{children:[s.jsx("div",{className:"as-field__label gc-label-row",children:"Spend limits (USD)"}),s.jsx(qe,{idPrefix:l,value:o,onChange:c}),s.jsx("p",{className:"gc-fineprint",children:y})]}),s.jsx(Ye,{draft:d.draft,setDraft:d.setDraft})]})}function ts({initial:e,layeredHint:l,onSaved:o,onCancel:c}){var W;const{workspace:y,viewer:d,me:i}=le(),a=ce(d),r=pe(e)?e:null,[h,k]=m.useState((e==null?void 0:e.label)??""),[x,P]=m.useState(te(e==null?void 0:e.limits)),[L,N]=m.useState(te(r?r.ownerLimits:e==null?void 0:e.limits)),[j,A]=m.useState(ze((e==null?void 0:e.expiresAt)??null)),[g,E]=m.useState((e==null?void 0:e.topupEnabled)??!1),[n,b]=m.useState((e==null?void 0:e.ownerMemberId)??i.member.id),w=se(e==null?void 0:e.routingPolicy),t=se(r?r.ownerRoutingPolicy:e==null?void 0:e.routingPolicy),p=Me(e,{memberId:i.member.id,workspaceAdmin:a},l),be=Ke(y.id,a),_=((e==null?void 0:e.buyerIdentity)??((W=be.data)==null?void 0:W.buyerIdentity))==="default",O=de(y.id,a&&!e),R=Oe(),[Y,B]=m.useState(null),D=p.admin,q=e?p.owner&&(p.layered||!p.admin):!p.admin,T=e!==null&&p.layered;let z=null;T&&(z=p.admin?"Your restrictions as the key owner":"Your restrictions");const ge=e?"Save":"Create key",xe=p.layered||!e?"UTC periods; weeks start Monday. Workspace, member and admin limits apply too.":"You can only tighten your key: a higher or cleared limit is ignored.",I=ie({mutationFn:async()=>{const u=j?Date.parse(`${j}T23:59:59Z`):null,$=D?w.build():null,V=q?t.build():null,H=ae(x),Q=ae(L);if(e){const f=Ue(p,e,{label:h.trim(),expiresAt:u,topupEnabled:g,adminLimits:H,adminPolicy:$,ownerLimits:Q,ownerPolicy:V}),G=await R.save([f.routingPolicy,f.ownerRoutingPolicy],we=>C.keys.update(e.id,f,we));return G===ee?ee:{key:G}}const M={label:h.trim(),workspaceId:y.id,limits:p.admin?H:Q,routingPolicy:p.admin?$:V,topupEnabled:p.admin?g:!1,expiresAt:u};return p.admin&&(M.ownerMemberId=n||null),R.save([M.routingPolicy],f=>C.keys.create(M,f))},onSuccess:o,invalidate:[F.group("keys")],toast:u=>u.secret?null:"Key saved",onError:B});return s.jsxs("form",{className:"gc-stack",onSubmit:u=>{u.preventDefault(),B(null),I.mutate()},children:[s.jsx(U,{label:"Name",required:!0,placeholder:"e.g. Production backend",value:h,onChange:u=>k(u.target.value)}),!e&&a&&O.data&&s.jsx(Xe,{label:"Owner",value:n,onChange:b,options:O.data.map(({member:u})=>({value:u.id,label:u.id===i.member.id?`${u.label} (you)`:u.label}))}),D&&s.jsx(oe,{title:T?"Workspace admin restrictions":null,idPrefix:"key-limit",limits:x,onLimitsChange:P,limitsNote:"UTC periods; weeks start Monday. The workspace and member budgets apply too.",policy:w}),!D&&T&&s.jsx(re,{title:"Set by workspace admins",limits:e.limits,policy:e.routingPolicy,note:"These always apply to this key. Your own restrictions below can only add to them."}),q&&s.jsx(oe,{title:z,idPrefix:"key-owner-limit",limits:L,onLimitsChange:N,limitsNote:xe,policy:t}),T&&!p.owner&&s.jsx(re,{title:"Set by the key owner",limits:r==null?void 0:r.ownerLimits,policy:r==null?void 0:r.ownerRoutingPolicy,note:"Only the key's owner changes these. They apply on top of yours."}),s.jsx(U,{label:"Expires",type:"date",value:j,onChange:u=>A(u.target.value),hint:a?"Leave blank for no expiry.":"You can set or bring forward an expiry; only an admin can extend or remove it."}),a&&s.jsx(he,{checked:g,onChange:E,disabled:_&&!g,label:"Allow top-ups",description:_?"Keys paid from the default wallet cannot be topped up.":"Let the key holder add funds to this key with USDC (x402)."}),Y?s.jsx(Fe,{error:Y,title:"Could not save the key"}):null,s.jsxs("div",{className:"gc-actions",children:[s.jsx(S,{variant:"ghost",onClick:c,children:"Cancel"}),s.jsx(S,{type:"submit",disabled:I.isPending||!h.trim(),children:I.isPending?"Saving…":ge})]}),R.dialog]})}const as=25;function rs({list:e,search:l,showRevoked:o,ownerLabel:c,render:y}){const d=l.trim().toLowerCase(),i=m.useMemo(()=>e.filter(r=>(o||r.status==="active")&&(!d||r.label.toLowerCase().includes(d)||r.hint.toLowerCase().includes(d)||c(r).toLowerCase().includes(d))),[e,o,d,c]),a=He(i,as,`${d}|${o}`);return s.jsxs(s.Fragment,{children:[y(a.items,i.length===0&&e.length>0),s.jsx(Qe,{pager:a,noun:"keys"})]})}function os(e){return(e==null?void 0:e.kind)==="rotate"?{title:"Rotate this key?",confirmLabel:"Rotate key",tone:"primary",body:s.jsxs(s.Fragment,{children:["The current secret for ",s.jsx("strong",{children:e.key.label})," stops working now. You get a new secret to replace it."]})}:{title:"Revoke this key?",confirmLabel:"Revoke key",tone:"danger",body:s.jsxs(s.Fragment,{children:["Requests with ",s.jsx("strong",{children:e==null?void 0:e.key.label})," fail from now on. This cannot be undone."]})}}function ks(){const{workspace:e,me:l,viewer:o}=le(),c=Ce(),y=ce(o),d=de(e.id,y),[i,a]=m.useState(()=>new URLSearchParams(window.location.search).get("new")==="1"?"new":null),[r,h]=m.useState(null),[k,x]=m.useState(null),[P,L]=m.useState(!1),[N,j]=m.useState(""),A=Pe(c),g=ie({mutationFn:async({kind:n,key:b})=>{n==="rotate"?h(await C.keys.rotate(b.id)):await C.keys.revoke(b.id)},onSuccess:()=>x(null),invalidate:[F.group("keys")],toast:(n,{kind:b})=>b==="revoke"?"Key revoked":null}),E=n=>{var b,w;return n.ownerMemberId?n.ownerMemberId===l.member.id?"You":((w=(b=d.data)==null?void 0:b.find(({member:t})=>t.id===n.ownerMemberId))==null?void 0:w.member.label)??"Another member":"—"};return s.jsxs("div",{className:"gc-page",children:[s.jsx(Le,{title:"API keys",description:`Keys for the ${e.name} workspace. Each key spends from this workspace's wallet.`,actions:s.jsx(S,{variant:"brand",leadingIcon:s.jsx(K.plus,{size:14}),onClick:()=>a("new"),children:"Create key"})}),s.jsxs("div",{className:"gc-toolbar",children:[s.jsx(U,{size:"sm",type:"search","aria-label":"Search keys",placeholder:"Search name, hint or owner",value:N,onChange:n=>j(n.target.value)}),s.jsx(he,{checked:P,onChange:L,label:"Show revoked"})]}),s.jsx(Ne,{flush:!0,children:s.jsx(Ae,{query:A,children:n=>s.jsx(rs,{list:n,search:N,showRevoked:P,ownerLabel:E,render:(b,w)=>s.jsx(Ve,{label:"API keys",rows:b,rowKey:t=>t.id,rowLabel:t=>t.label,onRowClick:t=>t.status==="active"&&a(t),actions:t=>t.status==="active"?[{label:"Edit",onSelect:()=>a(t)},{label:"Rotate secret",onSelect:()=>x({kind:"rotate",key:t})},{label:"Revoke",tone:"danger",onSelect:()=>x({kind:"revoke",key:t})}]:[],empty:w?s.jsx(Z,{icon:s.jsx(K.keys,{size:18}),title:"No keys match",body:"Try another search, or show revoked keys."}):s.jsx(Z,{icon:s.jsx(K.keys,{size:18}),title:"No keys yet",body:"Create a key to call models through this gateway.",action:s.jsx(S,{onClick:()=>a("new"),children:"Create key"})}),columns:[{key:"label",header:"Name",sortValue:t=>t.label,render:t=>s.jsx(Ee,{name:t.label,hint:t.hint})},{key:"owner",header:"Owner",secondary:!0,render:E},{key:"limits",header:"Limits",secondary:!0,optional:!0,render:t=>s.jsx("span",{className:"gc-muted",children:ue(X(t).limits)})},{key:"policy",header:"Routing",secondary:!0,optional:!0,render:t=>s.jsx("span",{className:"gc-muted",children:me(X(t).policy)})},...y?[{key:"trend",header:"30 days",secondary:!0,render:t=>s.jsx(es,{keyId:t.id})}]:[],{key:"month",header:"This month",align:"right",sortValue:t=>Te(t.usage.spentThisMonth),render:t=>ye(t.usage.spentThisMonth)},{key:"used",header:"Last used",secondary:!0,optional:!0,sortValue:t=>t.lastUsedAt,render:t=>Re(t.lastUsedAt)},{key:"status",header:"Status",secondary:!0,render:ss}]})})})}),s.jsx(ne,{isOpen:i!==null,onClose:()=>a(null),size:"lg",title:i==="new"?"Create API key":"Edit API key",children:i!==null&&s.jsx(ts,{initial:i==="new"?null:i,layeredHint:(A.data??[]).some(pe),onCancel:()=>a(null),onSaved:n=>{a(null),n.secret&&h({key:n.key,secret:n.secret})}})}),s.jsx(Ze,{result:r,onClose:()=>h(null)}),s.jsx(De,{isOpen:k!==null,busy:g.isPending,error:g.error,onClose:()=>{x(null),g.reset()},onConfirm:()=>k&&g.mutate(k),...os(k)})]})}export{ks as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as s,a as q,c as M,a$ as N,b as P,j as e,P as A,B as z,I as B,f as L,T as v,l as K}from"./index-DIcymBxc.js";import{R as _}from"./RequestLog-D2YGgG1C.js";import{f as k}from"./dates-Pi3-Ywng.js";import{p as H}from"./PeerPicker-BJfjL7Dy.js";import{S as h}from"./SelectField-BWyF8Ku8.js";import"./useInfiniteQuery-NenQ5Num.js";import"./usage-DktoZRc8.js";import"./DataTable-BTwj5g1m.js";function w(a,o=300){const[i,r]=s.useState(a);return s.useEffect(()=>{const n=window.setTimeout(()=>r(a),o);return()=>window.clearTimeout(n)},[a,o]),i}function Y(){const a=q(),[o,i]=s.useState(""),[r,n]=s.useState(""),[l,g]=s.useState(""),[u,x]=s.useState(""),[b,f]=s.useState(""),[c,y]=s.useState(""),[d,S]=s.useState(""),D=M(a),E=N(a),U=P(),j=w(r.trim()),C=w(b.trim()),m=k(c,"start"),p=k(d,"end"),I=m!==void 0&&p!==void 0&&m>p,F=s.useMemo(()=>({...a,key:o||void 0,model:j||void 0,router:l||void 0,status:u||void 0,q:C||void 0,from:m,to:p}),[a.workspace,a.member,o,j,l,u,C,m,p]),R=!!(o||r||l||u||b||c||d),T=E.data??[];return e.jsxs("div",{className:"gc-page",children:[e.jsx(A,{title:"Logs",description:"Every request through this workspace's keys.",actions:e.jsx(z,{variant:"outline",size:"sm",href:L.usage.exportUrl(F),download:!0,leadingIcon:e.jsx(B.download,{size:14}),children:"Export CSV"})}),e.jsxs("div",{className:"gc-toolbar",children:[e.jsx(v,{size:"sm",type:"search","aria-label":"Search requests",placeholder:"Search model, key, end user or error",value:b,onChange:t=>f(t.target.value),className:"gc-toolbar__grow"}),e.jsx(h,{size:"sm","aria-label":"Filter by key",value:o,onChange:i,options:[{value:"",label:"All keys"},...(D.data??[]).map(t=>({value:t.id,label:t.label}))]}),e.jsx(v,{size:"sm","aria-label":"Filter by model",placeholder:"Model",value:r,onChange:t=>n(t.target.value)}),(T.length>0||l)&&e.jsx(h,{size:"sm","aria-label":"Filter by router",value:l,onChange:g,options:[{value:"",label:"Any router"},...T.map(t=>({value:t,label:H(U.data,t)}))]}),e.jsx(h,{size:"sm","aria-label":"Filter by status",value:u,onChange:x,options:[{value:"",label:"Any status"},{value:"success",label:"Succeeded"},{value:"error",label:"Failed"}]}),e.jsx(v,{size:"sm",type:"date","aria-label":"From date (UTC)",title:"From (UTC)",value:c,max:d||void 0,onChange:t=>y(t.target.value)}),e.jsx(v,{size:"sm",type:"date","aria-label":"To date (UTC)",title:"To (UTC)",value:d,min:c||void 0,onChange:t=>S(t.target.value),error:I?"Ends before it starts":void 0}),R&&e.jsx(z,{variant:"ghost",size:"sm",onClick:()=>{i(""),n(""),g(""),x(""),f(""),y(""),S("")},children:"Clear filters"})]}),e.jsx(K,{flush:!0,children:e.jsx(_,{filter:F})})]})}export{Y as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as W,n as V,r as d,d as ce,U as G,t as N,j as e,P as de,B as f,I as q,l as H,Q,ba as _,z as me,A as ue,E as ae,C as B,D as T,f as w,G as ge,q as P,aF as be,v as D,au as se,bb as ne,bc as he,at as J,T as I,ah as X,o as ie,b2 as pe,aN as ve}from"./index-DIcymBxc.js";import{u as xe,a as je,P as ye}from"./PolicyField-CfRYcr_J.js";import{l as ke,d as fe,L as we}from"./limits-D8_oE0N-.js";import{D as Y}from"./DataTable-BTwj5g1m.js";import{S as M}from"./SelectField-BWyF8Ku8.js";import"./PolicyEditor-BpoV34ra.js";import"./PeerPicker-BJfjL7Dy.js";import"./Segmented-BelxPFkk.js";import"./roving-DkptacxO.js";import"./Switch-BwBYBnSS.js";const z=(s,t)=>!!s&&!!t&&s.trim().toLowerCase()===t.trim().toLowerCase();function Ce(s,t,o){const n=[],m=Date.now();for(const i of t)z(i.email,s.email)?n.push(`${i.label} already uses ${i.email}.`):z(i.label,s.label)&&n.push(`A member named ${i.label} already exists${i.status==="invited"?" (invited, not joined yet)":""}.`);for(const i of o)i.expiresAt<m||(z(i.email,s.email)?n.push(`A pending invite already goes to ${i.email}.`):z(i.label,s.label)&&n.push(`A pending invite for ${i.label} already exists.`));return[...new Set(n)]}const F=[P.group("members"),P.group("workspaces"),P.group("keys")],K=[...F,P.group("invites")],te=[{value:"member",label:"Member"},{value:"admin",label:"Admin"}];function U(s){return s.status==="disabled"?e.jsx(D,{tone:"danger",children:"Disabled"}):s.status==="invited"?e.jsx(D,{tone:"warning",children:"Invited"}):e.jsx(D,{tone:"success",children:"Active"})}function le(s,t){return s==="owner"?["member","admin","owner"]:t?["member","admin"]:["member"]}function re(s){return s.map(t=>({value:t,label:_[t]}))}function Se({onCreated:s,onCancel:t}){const{me:o,viewer:n,workspace:m}=W(),i=V(n),C=o.workspaces.filter(a=>i||a.role==="admin").map(a=>a.workspace),[c,u]=d.useState(""),[g,p]=d.useState(""),[v,R]=d.useState("member"),[j,E]=d.useState("72"),[y,b]=d.useState({[m.id]:"member"}),S=G(i),L=ne(),x=Ce({label:c,email:g},S.data??[],L.data??[]),h=N({mutationFn:()=>{const a={label:c.trim(),email:g.trim()||null,orgRole:v,workspaces:Object.entries(y).filter(([,k])=>k).map(([k,O])=>({workspaceId:k,role:O})),expiresInHours:Number(j)||72};return w.invites.create(a)},onSuccess:s,invalidate:K}),l=x.length?"Create anyway":"Create invite link";return e.jsxs("form",{className:"gc-stack",onSubmit:a=>{a.preventDefault(),h.mutate()},children:[e.jsxs("div",{className:"gc-grid gc-grid--2",children:[e.jsx(I,{label:"Name",required:!0,value:c,onChange:a=>u(a.target.value)}),e.jsx(I,{label:"Email (optional)",type:"email",value:g,onChange:a=>p(a.target.value),hint:"Required when they will sign in with your identity provider."})]}),e.jsxs("div",{className:"gc-grid gc-grid--2",children:[e.jsx(M,{label:"Organization role",value:v,onChange:a=>R(a),options:re(le(o.member.orgRole,i)),hint:v==="member"?"Sees only the workspaces below.":"Can manage every workspace."}),e.jsx(M,{label:"Link expires after",value:j,onChange:E,options:[{value:"24",label:"1 day"},{value:"72",label:"3 days"},{value:"168",label:"7 days"}]})]}),e.jsxs("fieldset",{className:"gc-checks",children:[e.jsx("legend",{className:"as-field__label",children:"Workspaces"}),C.map(a=>e.jsxs("div",{className:"gc-inline gc-inline--between",children:[e.jsx("span",{children:a.name}),e.jsx(M,{"aria-label":`Role in ${a.name}`,value:y[a.id]??"",onChange:k=>b({...y,[a.id]:k}),options:[{value:"",label:"No access"},...te]})]},a.id))]}),x.length>0&&e.jsx(X,{tone:"warning",title:"Possible duplicate",children:e.jsx("ul",{className:"gc-list",children:x.map(a=>e.jsx("li",{children:a},a))})}),h.error?e.jsx(ie,{error:h.error,title:"Could not create the invite"}):null,e.jsxs("div",{className:"gc-actions",children:[e.jsx(f,{variant:"ghost",onClick:t,children:"Cancel"}),e.jsx(f,{type:"submit",disabled:h.isPending||!c.trim(),children:h.isPending?"Creating…":l})]})]})}function Ne({member:s,onDone:t}){const{me:o,viewer:n}=W(),m=V(n),[i,C]=d.useState(s.label),[c,u]=d.useState(s.email??""),[g,p]=d.useState(s.orgRole),[v,R]=d.useState(ke(s.limits)),[j,E]=d.useState(s.maxKeys===null?"":String(s.maxKeys)),y=xe(s.routingPolicy),[b,S]=d.useState(null),[L,x]=d.useState(!1),h=je(),l=N({mutationFn:async()=>{const r=j.trim()===""?null:Number(j);if(r!==null&&(!Number.isInteger(r)||r<0))throw new Error("Key limit must be a whole number.");const ee={label:i.trim(),email:c.trim()||null,limits:fe(v),maxKeys:r,routingPolicy:y.build(),...m?{orgRole:g}:{}};return h.save([ee.routingPolicy],oe=>w.members.update(s.id,ee,oe))},onSuccess:t,invalidate:F,toast:"Member saved"}),a=N({mutationFn:()=>s.status==="disabled"?w.members.enable(s.id):w.members.disable(s.id),onSuccess:()=>{x(!1),t()},invalidate:F}),k=N({mutationFn:r=>w.members.removeCredential(s.id,r),onSuccess:()=>{S(null),t()},invalidate:F}),O=s.id===o.member.id,A=s.status==="disabled",$=m&&(s.orgRole!=="owner"||o.member.orgRole==="owner"),Z=O&&s.credentials.length<=1;return e.jsxs("form",{className:"gc-stack",onSubmit:r=>{r.preventDefault(),l.mutate()},children:[e.jsxs("div",{className:"gc-grid gc-grid--2",children:[e.jsx(I,{label:"Name",value:i,onChange:r=>C(r.target.value)}),e.jsx(I,{label:"Email",type:"email",value:c,onChange:r=>u(r.target.value)})]}),e.jsxs("div",{className:"gc-grid gc-grid--2",children:[m&&e.jsx(M,{label:"Organization role",value:g,disabled:O||s.orgRole==="owner"&&o.member.orgRole!=="owner",onChange:r=>p(r),options:re(le(o.member.orgRole,!0))}),e.jsx(I,{label:"Keys they may create",inputMode:"numeric",placeholder:"No limit",value:j,onChange:r=>E(r.target.value)})]}),e.jsxs("div",{children:[e.jsx("div",{className:"as-field__label gc-label-row",children:"Spend limits across their keys (USD)"}),e.jsx(we,{idPrefix:"member-limit",value:v,onChange:R})]}),e.jsx(ye,{draft:y.draft,setDraft:y.setDraft}),e.jsxs("div",{children:[e.jsx("div",{className:"as-field__label gc-label-row",children:"Sign-in methods"}),s.credentials.length===0?e.jsx("p",{className:"gc-muted",children:"None yet."}):e.jsx("ul",{className:"gc-list",children:s.credentials.map(r=>e.jsxs("li",{className:"gc-inline gc-inline--between",children:[e.jsxs("span",{children:[e.jsx(D,{children:r.kind})," ",r.label," ",e.jsxs("span",{className:"gc-muted",children:["· last used ",J(r.lastUsedAt)]})]}),$&&e.jsx(f,{variant:"ghost",size:"sm",disabled:Z,title:Z?"Add another sign-in method first":void 0,onClick:()=>S(r),children:"Remove"})]},r.id))})]}),!$&&e.jsx(X,{tone:"info",children:"Only an owner can change an owner's profile, status or sign-in methods."}),l.error?e.jsx(ie,{error:l.error,title:"Could not save"}):null,e.jsxs("div",{className:"gc-actions gc-actions--split",children:[$&&!O?e.jsx(f,{variant:A?"outline":"danger",size:"sm",onClick:()=>x(!0),children:A?"Enable member":"Disable member"}):e.jsx("span",{}),e.jsxs("div",{className:"gc-actions",children:[e.jsx(f,{variant:"ghost",onClick:t,children:"Cancel"}),$&&e.jsx(f,{type:"submit",disabled:l.isPending,children:l.isPending?"Saving…":"Save"})]})]}),e.jsx(T,{isOpen:L,busy:a.isPending,error:a.error,onClose:()=>x(!1),onConfirm:()=>a.mutate(),title:A?"Enable this member?":"Disable this member?",tone:A?"primary":"danger",confirmLabel:A?"Enable":"Disable",body:A?`${s.label} can sign in again. Their revoked keys stay revoked.`:`${s.label} is signed out and all of their keys are revoked.`}),e.jsx(T,{isOpen:b!==null,busy:k.isPending,error:k.error,onClose:()=>S(null),onConfirm:()=>b&&k.mutate(b.id),title:"Remove this sign-in method?",confirmLabel:"Remove",body:`${(b==null?void 0:b.label)??""} can no longer be used to sign in as ${s.label}.`}),h.dialog]})}function Re({member:s,role:t}){const{workspace:o,me:n}=W(),m=ge(),i=N({mutationFn:c=>w.workspaces.setMember(o.id,s.id,c),invalidate:s.id===n.member.id?[P.workspaceMembers(o.id),P.me]:[P.workspaceMembers(o.id)],toast:(c,u)=>`${s.label} is now a workspace ${u}`,onError:c=>m(`Could not change ${s.label}'s role: ${be(c)}`,"danger")}),C=s.orgRole!=="member";return e.jsx("div",{onClick:c=>c.stopPropagation(),children:e.jsx(M,{size:"sm","aria-label":`Workspace role for ${s.label}`,value:t,disabled:i.isPending||C,title:C?"Organization admins administer every workspace":void 0,onChange:c=>i.mutate(c),options:te})})}function Pe({onEdit:s}){const t=G();return e.jsx(H,{flush:!0,title:"Everyone in the organization",children:e.jsx(Q,{query:t,children:o=>e.jsx(Y,{label:"All members",rows:o,rowKey:n=>n.id,onRowClick:s,rowLabel:n=>n.label,actions:n=>[{label:"Edit member",onSelect:()=>s(n)}],columns:[{key:"name",header:"Name",sortValue:n=>n.label,render:n=>e.jsxs("span",{className:"gc-strong",children:[n.label,n.status!=="active"&&e.jsxs("span",{className:"gc-narrow-only",children:[" ",U(n)]})]})},{key:"email",header:"Email",secondary:!0,render:n=>n.email??"—"},{key:"role",header:"Role",render:n=>_[n.orgRole]},{key:"keys",header:"Key limit",secondary:!0,optional:!0,render:n=>n.maxKeys??"No limit"},{key:"since",header:"Joined",secondary:!0,sortValue:n=>n.createdAt,render:n=>n.status==="invited"?e.jsxs("span",{className:"gc-muted",children:["Invited ",se(n.createdAt)]}):se(n.createdAt)},{key:"status",header:"Status",secondary:!0,render:U}]})})})}function Ee(){const s=ne(),[t,o]=d.useState(null),n=N({mutationFn:m=>w.invites.revoke(m.id),onSuccess:()=>o(null),invalidate:K});return e.jsxs(H,{flush:!0,title:"Pending invites",children:[e.jsx(Q,{query:s,children:m=>e.jsx(Y,{label:"Pending invites",rows:m,rowKey:i=>i.id,rowLabel:i=>`invite for ${i.label}`,empty:e.jsx(ae,{icon:e.jsx(q.members,{size:18}),title:"No pending invites"}),actions:i=>[{label:"Revoke invite",tone:"danger",onSelect:()=>o(i)}],columns:[{key:"name",header:"Name",render:i=>e.jsx("span",{className:"gc-strong",children:i.label})},{key:"email",header:"Email",secondary:!0,render:i=>i.email??"—"},{key:"role",header:"Role",render:i=>_[i.orgRole]},{key:"expires",header:"Expires",secondary:!0,render:i=>e.jsx(he,{at:i.expiresAt,format:J})}]})}),e.jsx(T,{isOpen:t!==null,busy:n.isPending,error:n.error,onClose:()=>o(null),onConfirm:()=>t&&n.mutate(t),title:"Revoke this invite?",confirmLabel:"Revoke",body:"The link stops working."})]})}function Ae({invite:s,onClose:t}){return e.jsx(B,{isOpen:s!==null,onClose:t,title:"Invite link",size:"lg",children:s&&e.jsxs("div",{className:"gc-stack",children:[s.url?e.jsxs(e.Fragment,{children:[e.jsxs("p",{children:["Send this link to ",e.jsx("strong",{children:s.label}),". It works once and expires ",J(s.expiresAt),"."]}),e.jsx(pe,{secret:s.url,note:"This link is shown only once. Anyone with it can join as this member."})]}):e.jsx(X,{tone:"warning",children:"The gateway did not return a link for this invite."}),e.jsxs("div",{className:"gc-actions",children:[s.url&&e.jsx(ve,{value:s.url,label:"Copy link",size:"md"}),e.jsx(f,{onClick:t,children:"Done"})]})]})})}function We(){var h;const{viewer:s,workspace:t,me:o}=W(),n=V(s),[m,i]=d.useState(!1),[C,c]=d.useState(null),[u,g]=d.useState(null),[p,v]=d.useState(null),[R,j]=d.useState(""),E=ce(t.id),y=G(n),b=N({mutationFn:l=>w.workspaces.removeMember(t.id,l.id),onSuccess:()=>v(null),invalidate:K,toast:"Removed from workspace"}),S=N({mutationFn:l=>w.workspaces.setMember(t.id,l,"member"),onSuccess:()=>j(""),invalidate:K,toast:"Added to workspace"}),L=new Set((h=E.data)==null?void 0:h.map(({member:l})=>l.id)),x=(y.data??[]).filter(l=>!L.has(l.id)&&l.status==="active");return e.jsxs("div",{className:"gc-page",children:[e.jsx(de,{title:"Members",description:"Who can use this gateway, their budgets and routing.",actions:e.jsx(f,{variant:"brand",leadingIcon:e.jsx(q.plus,{size:14}),onClick:()=>i(!0),children:"Invite member"})}),e.jsx(H,{flush:!0,title:`${t.name} workspace`,actions:n&&x.length>0?e.jsxs("div",{className:"gc-inline",children:[e.jsx(M,{size:"sm","aria-label":"Add an existing member",value:R,onChange:j,options:[{value:"",label:"Add existing member…"},...x.map(l=>({value:l.id,label:l.label}))]}),e.jsx(f,{size:"sm",variant:"outline",disabled:!R||S.isPending,onClick:()=>S.mutate(R),children:"Add"})]}):void 0,children:e.jsx(Q,{query:E,children:l=>e.jsx(Y,{label:"Workspace members",rows:l,rowKey:a=>a.member.id,onRowClick:n?a=>g(a.member):void 0,rowLabel:a=>a.member.label,actions:a=>[n&&{label:"Edit member",onSelect:()=>g(a.member)},a.member.id!==o.member.id&&{label:"Remove from workspace",tone:"danger",onSelect:()=>v(a.member)}],empty:e.jsx(ae,{icon:e.jsx(q.members,{size:18}),title:"No members in this workspace"}),columns:[{key:"name",header:"Name",sortValue:a=>a.member.label,render:a=>e.jsxs("div",{children:[e.jsx("div",{className:"gc-strong",children:a.member.label}),e.jsx("div",{className:"gc-muted",children:a.member.email??_[a.member.orgRole]})]})},{key:"role",header:"Workspace role",render:a=>e.jsx(Re,{member:a.member,role:a.role})},{key:"limits",header:"Limits",secondary:!0,optional:!0,render:a=>e.jsx("span",{className:"gc-muted",children:me(a.member.limits)})},{key:"policy",header:"Routing",secondary:!0,optional:!0,render:a=>e.jsx("span",{className:"gc-muted",children:ue(a.member.routingPolicy)})},{key:"status",header:"Status",secondary:!0,render:a=>U(a.member)}]})})}),n&&e.jsx(Pe,{onEdit:g}),e.jsx(Ee,{}),e.jsx(B,{isOpen:m,onClose:()=>i(!1),size:"lg",title:"Invite a member",children:m&&e.jsx(Se,{onCancel:()=>i(!1),onCreated:l=>{i(!1),c(l)}})}),e.jsx(Ae,{invite:C,onClose:()=>c(null)}),e.jsx(B,{isOpen:u!==null,onClose:()=>g(null),size:"lg",title:(u==null?void 0:u.label)??"",eyebrow:"Member",children:u&&e.jsx(Ne,{member:u,onDone:()=>g(null)},u.id)}),e.jsx(T,{isOpen:p!==null,busy:b.isPending,error:b.error,onClose:()=>v(null),onConfirm:()=>p&&b.mutate(p),title:"Remove from workspace?",confirmLabel:"Remove",body:`${(p==null?void 0:p.label)??""} loses access to ${t.name}. Their keys in this workspace stop working.`})]})}export{We as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s,bW as k1,r as f,c0 as b1,Y as l1,bY as L1,O as V,aB as y1,I as v,R as I1,bZ as B1,c1 as S1,c2 as E1,c3 as N1,c4 as P1,bg as T1,L as D1,E as _,l as $,Q as z1,B as G,P as G1,T as O1,y as e1,b_ as R1,M as p,h as W1,g as r1,bx as B,b$ as Q,w as E,aN as O,v as m,X as R,bU as s1,c5 as Y1,aw as H1,ax as F1,az as V1,k as Q1}from"./index-DIcymBxc.js";import{T as Z1,a as U1}from"./Tabs-yVL4Cd6z.js";import{M as W,f as K1,S as J1,V as c1,P as b,T as Y,C as q1,a as X1,p as _1}from"./models-CLos5_p0.js";import{s as $1,l as e2}from"./stored-CFfx95Ep.js";import{D as s2}from"./DataTable-BTwj5g1m.js";import{S as t2}from"./SelectField-BWyF8Ku8.js";import"./roving-DkptacxO.js";function i2({size:e}){return s.jsx("svg",{width:e,height:e,viewBox:"0 0 508 508",fill:"currentColor","aria-hidden":"true",children:s.jsx("path",{d:"M321.997 150.712C321.401 150.568 320.844 150.299 320.363 149.925C319.883 149.551 319.491 149.08 319.215 148.544C318.938 148.008 318.783 147.42 318.76 146.821C318.738 146.22 318.848 145.624 319.084 145.07C327.226 125.716 330.819 110.23 325.021 103.747C309.666 86.5471 248.085 120.749 228.451 132.333C227.925 132.642 227.337 132.837 226.728 132.903C226.118 132.969 225.501 132.906 224.918 132.719C224.336 132.531 223.801 132.223 223.351 131.815C222.902 131.407 222.548 130.909 222.313 130.356C214.06 111.043 205.384 97.6094 196.589 97.0268C173.279 95.4688 154.491 162.187 148.991 183.932C148.844 184.515 148.57 185.06 148.188 185.528C147.805 185.998 147.323 186.381 146.775 186.651C146.227 186.921 145.626 187.072 145.012 187.094C144.399 187.116 143.788 187.009 143.221 186.778C123.406 178.825 107.545 175.316 100.914 180.98C83.305 195.978 118.315 256.126 130.175 275.304C130.492 275.816 130.692 276.391 130.76 276.987C130.829 277.582 130.765 278.186 130.573 278.755C130.381 279.325 130.065 279.847 129.647 280.286C129.228 280.725 128.718 281.07 128.15 281.298C108.384 289.359 94.6306 297.834 94.0272 306.424C92.439 329.192 160.74 347.544 183.01 352.916C183.605 353.061 184.16 353.33 184.64 353.704C185.118 354.077 185.509 354.548 185.785 355.083C186.061 355.618 186.215 356.205 186.237 356.803C186.26 357.402 186.151 357.998 185.916 358.551C177.773 377.905 174.181 393.398 179.979 399.874C195.334 417.074 256.921 382.877 276.556 371.293C277.081 370.984 277.67 370.789 278.28 370.722C278.889 370.655 279.507 370.717 280.09 370.905C280.673 371.093 281.207 371.402 281.657 371.81C282.106 372.219 282.46 372.717 282.694 373.271C290.947 392.578 299.616 406.012 308.417 406.601C331.728 408.153 350.516 341.44 356.009 319.688C356.157 319.106 356.432 318.562 356.816 318.094C357.2 317.625 357.682 317.243 358.231 316.974C358.779 316.705 359.381 316.554 359.995 316.533C360.608 316.511 361.219 316.619 361.786 316.85C381.601 324.803 397.455 328.304 404.093 322.648C421.702 307.65 386.684 247.495 374.825 228.317C374.51 227.804 374.312 227.229 374.245 226.634C374.177 226.039 374.242 225.436 374.434 224.868C374.626 224.299 374.941 223.777 375.358 223.338C375.775 222.899 376.284 222.552 376.85 222.323C396.623 214.261 410.376 205.786 410.973 197.196C412.568 174.428 344.26 156.078 321.997 150.712ZM295.254 128.885C299.734 136.73 276.646 189 259.474 225.561C259.186 226.172 258.715 226.682 258.121 227.024C257.528 227.365 256.842 227.521 256.155 227.47C255.468 227.419 254.814 227.164 254.28 226.739C253.746 226.314 253.358 225.739 253.169 225.093C246.234 201.322 238.306 173.392 229.824 149.683C229.491 148.752 229.508 147.736 229.871 146.817C230.235 145.897 230.921 145.133 231.808 144.662C252.989 133.363 289.234 118.358 295.254 128.885ZM193.746 135.355C202.589 137.807 224.103 190.714 238.424 228.426C238.664 229.056 238.699 229.742 238.527 230.393C238.354 231.044 237.983 231.627 237.461 232.065C236.939 232.503 236.292 232.775 235.608 232.844C234.923 232.913 234.234 232.775 233.632 232.45C211.501 220.453 185.694 206.159 162.529 195.253C161.622 194.823 160.901 194.093 160.493 193.192C160.085 192.292 160.018 191.279 160.303 190.335C167.12 167.736 181.865 132.069 193.746 135.355ZM126.652 210.04C134.676 205.664 188.197 228.216 225.621 244.989C226.248 245.269 226.771 245.73 227.12 246.31C227.47 246.889 227.629 247.56 227.577 248.23C227.524 248.901 227.264 249.54 226.828 250.062C226.393 250.582 225.805 250.962 225.143 251.147C200.813 257.921 172.211 265.664 147.937 273.949C146.985 274.272 145.946 274.255 145.007 273.9C144.067 273.545 143.286 272.876 142.805 272.011C131.257 251.322 115.867 215.92 126.652 210.04ZM133.275 309.188C135.779 300.551 189.952 279.537 228.562 265.548C229.207 265.315 229.91 265.28 230.576 265.448C231.243 265.617 231.84 265.98 232.288 266.49C232.736 266.999 233.015 267.631 233.085 268.299C233.155 268.968 233.015 269.641 232.682 270.23C220.392 291.846 205.758 317.053 194.592 339.672C194.156 340.561 193.409 341.269 192.486 341.668C191.563 342.068 190.525 342.134 189.557 341.853C166.42 335.235 129.905 320.792 133.275 309.188ZM209.739 374.722C205.252 366.884 228.347 314.608 245.519 278.054C245.806 277.442 246.279 276.931 246.872 276.59C247.465 276.249 248.151 276.093 248.838 276.144C249.525 276.194 250.179 276.45 250.713 276.875C251.247 277.3 251.634 277.874 251.824 278.521C258.759 302.285 266.686 330.222 275.169 353.932C275.499 354.862 275.481 355.877 275.117 356.795C274.752 357.713 274.064 358.475 273.178 358.945C252.004 370.223 215.752 385.256 209.76 374.722H209.739ZM311.247 368.252C302.397 365.807 280.883 312.894 266.562 275.182C266.322 274.55 266.285 273.862 266.458 273.21C266.63 272.559 267.003 271.974 267.526 271.536C268.049 271.097 268.697 270.826 269.382 270.758C270.068 270.69 270.759 270.83 271.361 271.157C293.485 283.154 319.299 297.455 342.457 308.362C343.366 308.789 344.089 309.519 344.497 310.42C344.905 311.321 344.971 312.335 344.683 313.28C337.872 335.912 323.128 371.544 311.247 368.252ZM378.341 293.566C370.31 297.949 316.795 275.391 279.365 258.618C278.738 258.338 278.215 257.877 277.866 257.297C277.516 256.718 277.357 256.047 277.409 255.377C277.461 254.706 277.722 254.067 278.158 253.546C278.593 253.025 279.181 252.646 279.843 252.461C304.18 245.687 332.775 237.943 357.049 229.658C358.003 229.335 359.043 229.353 359.984 229.709C360.925 230.065 361.706 230.737 362.188 231.603C373.729 252.285 389.119 287.693 378.341 293.566ZM371.718 194.419C369.207 203.063 315.041 224.077 276.431 238.066C275.784 238.3 275.08 238.335 274.413 238.167C273.746 237.999 273.148 237.635 272.698 237.124C272.249 236.613 271.972 235.98 271.903 235.31C271.833 234.641 271.975 233.966 272.311 233.377C284.594 211.768 299.228 186.554 310.394 163.935C310.833 163.048 311.58 162.343 312.502 161.945C313.425 161.546 314.462 161.481 315.429 161.76C338.566 168.413 375.081 182.815 371.718 194.419Z"})})}function n2({size:e}){return s.jsxs("svg",{width:e,height:e,viewBox:"0 0 200 200",fill:"currentColor","aria-hidden":"true",children:[s.jsx("path",{d:"M49.483 106.958c1.059-.325 2.375.167 3.109 1.192.233.317.3.767.383 1.167.025.116-.167.275-.333.416-1.034-.816-2-1.616-2.95-2.425-.092-.083-.134-.225-.209-.35m20.484-28.525c1.625-.266 3.25-.5 4.9-.416a4.5 4.5 0 0 1 1.233.216c1.683.592 3.35 1.225 5.008 1.867.234.083.417.3.625.458l-.108.225a66 66 0 0 1-2.167-.741c-.958-.317-1.775-.642-2.625-.817-2.083-.417-2.083-.383-2.433-.117l4.783 1.2c2.292 1.159 4.584 2.3 6.859 3.475.35.184.75.475.891.817.217.5.525.633.975.6.55-.05 1.1-.142 1.775-.225l-.333.717c.425.666 1.183.166 1.8.533-.617 1.083-2.058.75-2.783 1.658l.508.617-1 .725c0 .883-.317 1.4-2.55 2.025l.217.708-1.634.35.584 1.034h-2.084l-.058 1.141c-.675-.083-1.342-.15-2.033-.225l-.442 1.025c-.225-.066-.433-.091-.608-.191-.559-.317-1.067-.467-1.625.05-.159.141-.525.116-.775.066-.217-.05-.417-.241-.584-.35-.916.792-.916.792-1.733.025-.475.384-1 .617-1.55.092-.525.225-1.025-.167-1.483-.117-.584.059-.809-.291-1.109-.583l-1.083.275c-.108-1.967-1.617-1.583-2.833-1.692.041-.6.416-.766.791-.783.45-.017.9.05 1.325.183 1.367.417 2.667 1 4.134 1.15 1.691.175 3.375.242 5.008-.125 2.208-.491 4.333-1.241 5.892-3.041.408-.467.691-1.059.975-1.625.158-.317.166-.7-.167-.967a11.7 11.7 0 0 0-3.183-1.808c.2 1-.259 1.516-.959 1.841 0 .117-.033.209 0 .25.667.959.7 1.334-.058 2.225-.542.65-1.15 1.242-1.817 1.759-1.608 1.258-3.941 1.075-5.341-.417-.4-.392-.767-.817-1.109-1.267-.65-.891-.633-.9-.275-1.966-1.375-.667-1.066-1.884-.866-3.034.066-.416.233-.8.408-1.358-.333.117-.558.142-.725.267a7.44 7.44 0 0 0-2.633 2.975c-.059.133-.084.283-.167.391-.1.125-.283.317-.375.292-.167-.05-.308-.225-.417-.375-.066-.1-.058-.267-.1-.475h-1.05l.442-1.433c-.108-.134-.217-.275-.325-.409l.917-2.366c-.5.216-.759.366-1.034.425-.25.058-.533 0-.791 0 0-.259-.084-.584.033-.767 1.242-1.833 2.542-3.567 4.942-3.967"}),s.jsx("path",{d:"M67.167 89.9c-.025-.317-.034-.625.308-.517.133.05.283.4.233.559-.083.333-.316.266-.533-.042z"}),s.jsx("path",{d:"M99.842.075c1.883-.1 3.775-.092 5.658 0 2.058.083 4.125.2 6.167.517a79 79 0 0 1 9.916 2.275c3.859 1.15 7.667 2.491 11.3 4.258a60.93 60.93 0 0 1 24.567 22.017c2.433 3.908 4.467 8.025 6.158 12.325 1.825 4.633 3.717 9.25 5.192 14.025 1.7 5.45 2.742 11.05 3.817 16.641.808 4.2 1.516 8.417 2.416 12.592 1.3 6.017 2.742 12 4.117 18 1.55 6.767 3.333 13.458 5.25 20.125.85 2.958 1.608 5.942 2.35 8.933.917 3.634 1.683 7.3 2.117 11.025.258 2.317.55 4.642.608 6.975.092 2.442.05 4.892-.142 7.334-.308 3.441-.833 6.816-1.883 10.1a41.9 41.9 0 0 1-7.625 13.741l-1.083 1.3.15.192c.358-.192.733-.342 1.058-.567 1.667-1.15 3.108-2.558 4.425-4.083 3.333-3.833 6.008-8.108 8.125-12.742 2.075-4.483 3-9.408 2.708-14.333-.2-3.533-.808-6.95-2.5-10.108-.108-.225-.125-.5-.25-1.009.417.292.684.4.842.6.892 1.084 1.833 2.15 2.625 3.317 2.75 4.117 3.833 8.767 4.05 13.667a31.3 31.3 0 0 1-3.917 16.416c-3 5.459-7.391 9.5-12.716 12.55-1.609.925-3.284 1.75-4.959 2.567-1.308.65-2.066 1.758-2.65 3.042a4.35 4.35 0 0 0-.275 3.383c.109.375.15.767.109 1.158-.042.642-.642 1.292-1.167 1.35-.45.05-1.042-.358-1.25-.966a9.8 9.8 0 0 1-.5-1.942c-.333-2.617-1.292-5-2.567-7.25a32.4 32.4 0 0 0-6.083-7.583 17.7 17.7 0 0 0-7.475-4.367 34.7 34.7 0 0 0-5.767-1.092c-.625-.066-1.25-.333-1.833.084 1.5.5 3.025.916 4.483 1.5 3.617 1.441 6.834 3.583 9.834 6.066 2.566 2.125 4.833 4.525 6.616 7.367.817 1.292 1.55 2.625 1.892 4.133.225 1.025.35 2.084.558 3.125.109.517-.016.909-.441 1.2-.392.275-1.017.284-1.359-.083a3.8 3.8 0 0 1-.666-1.167c-.25-.608-.317-1.325-.65-1.875a60.9 60.9 0 0 0-11.859-13.866c-1.333-1.142-2.741-2.167-4.475-2.692-3.133-.95-6.275-1.692-9.583-1.283-1.775.208-3.558.266-5.333.441a13.36 13.36 0 0 0-6.134 2.317 42.6 42.6 0 0 0-6.95 6c-2.741 2.85-5.35 5.825-7.958 8.792-1.133 1.291-2.2 2.658-2.617 4.425l-.1.425a.8.8 0 0 1-.75.633h-2.583c-.383 0-.683-.4-.6-.783.192-.9.375-1.8.583-2.7.625-2.709 1.584-5.292 3.067-7.642.2-.325.333-.733.867-.667l.083.409.225.641c2.333-3.625 4.758-6.95 8.3-9.458 2.358-1.7 4.867-3.15 7.417-4.583a1.6 1.6 0 0 0-.817-.017c-1.35.358-2.708.7-4.042 1.117-3.35 1.033-6.366 2.75-9.25 4.716-1.225.834-2.483 1.609-3.45 2.775a60.9 60.9 0 0 0-8.916 14.725c-.134.325-.25.659-.334 1a.62.62 0 0 1-.6.467h-4.116c-.334 0-.517-.425-.3-.683 1.025-1.167 2.05-2.35 3.141-3.459 2.292-2.341 4.834-4.433 6.475-7.366.225-.4.525-.75.792-1.125 1.983-2.775 4.5-5.059 6.817-7.517.683-.717 1.458-1.333 2.166-2 .242-.225.442-.475.659-.708l-.15-.209-1.125.342c-.284.142-.584.258-.85.417-2.067 1.2-4.117 2.433-6.192 3.608-3.4 1.917-6.875 3.658-10.075 5.925-2.342 1.667-4.925 2.983-7.408 4.442-.167.1-.367.125-.667.233-.125-1.125 1.192-1.675.9-2.8-.275.117-.533.167-.708.317-.925.8-1.892 1.583-2.734 2.466-1.233 1.309-2.366 2.709-3.541 4.067-1.042 1.192-2.084 2.383-3.109 3.592-.233.283-.575.45-.941.458h-9.4c.05-.117.1-.233.133-.35.233-.75.708-1.433.692-2.333-.759-.15-1.35.008-1.767.641a36 36 0 0 0-1.133 1.792c-.084.133-.2.25-.35.25h-.775c-.159 0-.242-.183-.142-.308.592-.734 1.167-1.484 1.742-2.234.008-.016-.05-.1-.1-.2-.117.034-.25.05-.375.109-1.467.75-2.934 1.508-4.392 2.283a3 3 0 0 1-1.4.35h-21.8c-.217 0-.325-.3-.158-.442 1.75-1.483 3.35-3.116 4.65-5.041 2.791-4.134 4.483-8.725 5.558-13.575.033-.167-.025-.359-.05-.759-.308.4-.492.6-.633.834a16.2 16.2 0 0 1-2.784 3.458c-2.333 2.15-4.916 3.733-8.191 3.867-2.475.1-4.9 0-7.209-1.059-3.833-1.75-6.016-4.75-6.616-8.933-.209-1.417-.142-1.425-1.517-1.825-3.608-.967-7-2.617-9.983-4.858a19.1 19.1 0 0 1-6.734-9.417 29.8 29.8 0 0 1-1.333-10.375c.017-.283.133-.558.2-.833.267.191.383.358.417.55.275 1.275.491 2.566.8 3.833.716 2.958 2.141 5.533 4.3 7.667 2.15 2.133 4.758 3.491 7.583 4.433 2.983.983 5.975 1.15 8.917-.133a15.7 15.7 0 0 0 5.175-3.767c2.733-2.9 4.441-6.333 5.4-10.192.075-.283.041-.591.058-.916-.125.05-.217.05-.25.091-.258.417-.533.834-.775 1.267-2.367 4.183-5.658 7.392-9.967 9.458-2.925 1.417-5.983 2.125-9.25 1.325a13.4 13.4 0 0 1-8.091-5.333 16.7 16.7 0 0 1-3.067-7.7 24.1 24.1 0 0 1 .167-7.383c.416-3.659 3.883-9.75 6.183-10.592-.167.525-.292.933-.442 1.333-.358.967-.808 1.892-1.083 2.875a15.9 15.9 0 0 0-.417 6.834c.275 1.766.75 3.466 1.7 5 1.225 1.966 2.884 3.391 5.167 3.875.917.191 1.875.116 2.817.15a4.8 4.8 0 0 0 3.216-1.092c1.367-1.067 2.35-2.433 3.05-4.008 1.4-3.125 2-6.475 2.575-9.825.417-2.467.775-4.95 1.109-7.442.325-2.342.591-4.692.866-7.042.217-1.933.4-3.866.617-5.8.2-1.9.433-3.791.633-5.691.2-1.892.392-3.792.575-5.692.109-1.167.184-2.333.284-3.5l.308-3.475c.183-2.083.342-4.167.542-6.233.066-.684-.167-1.1-.75-1.475a20.5 20.5 0 0 1-4.1-3.484c-.834-.908-1.567-1.9-2.35-2.85-.292-.35-.467-.808-.967-.983.5 1.767 1.267 3.45 2.292 4.975.5.767 1.091 1.467 1.633 2.208.525.717 1.517.959 1.95 1.884-.233.025-.383.083-.5.05-.617-.142-1.225-.3-1.833-.475a22.54 22.54 0 0 1-10.725-6.825c-3.625-4.059-5.467-8.967-5.917-14.359-.258-2.941-.225-5.9.117-8.833.6-5.017 1.833-9.883 3.75-14.542 1.291-3.133 2.816-6.175 4.383-9.183 1.708-3.275 3.883-6.25 6.375-8.967 4.267-4.658 9.2-8.533 14.383-12.066 5.975-4.084 12.317-7.484 18.975-10.275 4.317-1.817 8.675-3.45 13.2-4.6C83.042 2.733 88.5 1.367 94.1.658c1.908-.25 3.817-.483 5.733-.583zM84.45 190.242c-.583.5-1.225.925-1.725 1.5-1.983 2.25-3.867 4.575-5.567 7.241l-.366.9c.3-.075.575-.241.775-.475 1.45-1.583 2.925-3.15 4.325-4.783.866-1.017 1.625-2.125 2.4-3.217.2-.283.25-.666.383-1zM98.2 159.45a45.7 45.7 0 0 0-5.442 4.942l-3.083 3.216a8 8 0 0 1-3.142 2.084 11.5 11.5 0 0 1-3.891.75c-.367 0-.725.05-1.259.1.234.483.359.808.534 1.091 1.25 2.017 2.508 4.017 3.75 6.034 1.133 1.833 2.3 3.65 3.325 5.55.566 1.041.875 2.225 1.3 3.366.641.225 1.166-.15 1.683-.4 2.417-1.125 4.825-2.283 7.225-3.433 1.775-.842 3.642-1.55 5.3-2.583 2.892-1.792 5.667-3.792 8.483-5.709.125-.083.217-.233.35-.383-.191-.158-.316-.308-.466-.367-2.392-.925-4.392-2.5-6.417-4.016a45 45 0 0 1-4.217-3.5 14.8 14.8 0 0 1-3.416-5.442c-.159-.408-.375-.792-.625-1.3zm-48.725 2.2c-.5.8-.808 1.617-1.1 2.442a28.2 28.2 0 0 1-4.625 8.416c-1.667 2.084-3.792 3.434-6.35 4.109-1.917.5-3.867.633-5.833.583-.4-.017-.809.017-1.317.042.133.333.175.55.292.708.833 1.208 1.916 2.05 3.333 2.458 1.308.384 2.633.284 4.15.192a9 9 0 0 0 4.042-1.95c1.983-1.658 3.35-3.783 4.466-6.1 1.459-3.025 2.2-6.258 2.85-9.533.084-.442.067-.917.092-1.367m124.542-38.217c.066.242.133.475.225.892.2 1.292.425 2.583.6 3.867.25 1.825.558 3.641.65 5.475.141 2.866.225 5.741-.117 8.608-.308 2.625-.525 5.275-.967 7.883a51.2 51.2 0 0 1-3.833 12.65c-.067.15-.083.325-.167.684.392-.25.642-.35.817-.534.708-.691 1.417-1.391 2.067-2.125 2.258-2.541 3.816-5.5 4.966-8.691 1.5-4.15 1.9-8.425 1.209-12.759-.859-5.416-2.75-10.525-4.975-15.675-.067-.15-.134-.308-.2-.458zM48.308 69.083c-.083.434-.025.875.15 1.275a366 366 0 0 0 3.159 6.25c.208.409.55.75.25 1.359-2.367.5-4.817.991-7.334 2.125.492.316.809.5 1.1.725.35.266.934.483.75 1-.083.275-.625.4-.975.6.142.083.359.175.559.3 1.383.85 2.75 1.725 3.725 3.066 1.15 1.6 1.908 3.367 1.566 5.367-.658 3.908-2.55 7.083-5.75 9.433-.45.334-.883.692-1.341 1.017-.667.45-1 1.25-.859 2.042.084.558.234 1.108.459 1.625.691 1.633 1.833 2.916 3.125 4.1a12.3 12.3 0 0 1 1.85 2.141c.641.925.716 2.134.208 3.142-.192.417-.417.825-.633 1.233-.25.5-.234.925.183 1.35.342.35.667.742.933 1.15.317.484.65.659 1.225.417a4.07 4.07 0 0 1 2.775-.05c1.334.383 2.517 1.05 3.7 1.75 1.084.642 2.2 1.242 3.334 1.825.558.292 1.166.417 1.825.217.591-.184 1.033.083 1.208.633.167.533-.025.9-.617 1.158-.583.25-1.141.525-1.741.734-.834.291-1.675.608-2.617.641-.108-.891.917-.733 1.058-1.325-1.716-1.05-5.358-1.208-6.675-.283.525.933.292 1.75-.8 2.608-1.083-.833-.208-1.683.017-2.5a1.7 1.7 0 0 0-.358-.033c-.85 0-1.575.617-1.717 1.45-.125.842.558 1.8 1.483 1.867.9.058 1.817-.042 2.717-.1.5-.042 1-.225 1.658 0-.858 1.025-2.066 1.058-2.975 1.583.017.417.584.717.159 1.092-.442.4-.792-.009-1.1-.25-.667-.525-1.334-1.05-1.925-1.642a3.95 3.95 0 0 1-1.309-2.592 4.3 4.3 0 0 0-.358-1.433c-.267-.617-.267-1.142.275-1.583-.15-.25-.233-.442-.375-.6a10.3 10.3 0 0 1-1.633-3.075c-.442-1.142-.384-2.2.4-3.175.2-.25.416-.5.533-.792a5.5 5.5 0 0 0 .392-1.4c.141-1.375-.534-2.392-1.517-3.225-1.55-1.3-3-2.683-3.833-4.592-.042-.091-.2-.141-.309-.216-.091.141-.2.225-.208.316-.158 1.542-.375 3.084-.433 4.642-.117 3.142.483 6.192 1.35 9.2.983 3.417 2.408 6.65 4.066 9.775a904 904 0 0 0 6.767 12.5c.458.817 1.083 1.575 1.733 2.25 1.65 1.683 3.767 2.267 6.034 2.275 1.683 0 3.366-.05 5.041-.217 2.459-.25 4.917-.608 7.367-.941 1.525-.209 3.042-.475 4.567-.667 1.75-.217 3.166.608 4.35 1.75 1.333 1.3 2.541 2.725 3.725 4.167 1.833 2.208 3.308 4.666 4.616 7.225.417.816.584.833 1.225.25 1.084-1.009 2.167-2.017 3.284-3 .558-.492.733-1 .558-1.775a29.6 29.6 0 0 1-.708-6.634c.016-1.308.05-2.616.15-3.925.125-1.866.25-3.75.5-5.6.883-6.4 1.883-12.783 3.016-19.15.725-4.108 1.517-8.2 2.234-12.308.5-2.892.983-5.783 1.35-8.692.283-2.275.458-4.583.525-6.875.091-2.766.025-5.541.016-8.316 0-.642.034-1.292-.083-1.917-.233-1.183-.083-1.292-1.35-1.583a49 49 0 0 0-5.058-.892c-1.217-.15-1.725-.442-1.842-1.583-.05-.409-.208-.817-.342-1.217-.075-.208-.2-.4-.383-.75l-.208 2.2c-.075.8-.242.967-1.059.958-.458 0-.916-.066-1.366-.066-3.967 0-7.934-.067-11.884.266-.791.067-1.441-.125-1.883-.858-.333-.55-.733-1.05-1.117-1.55-.525-.7-.716-.775-1.516-.5-1.625.567-3.234 1.15-4.85 1.75a22.7 22.7 0 0 0-5.625 3.283 8.1 8.1 0 0 1-2.692 1.4c-.275.084-.583.067-1.058.109.166-.55.2-.95.391-1.25.534-.875 1.125-1.709 1.709-2.55.191-.275.408-.525.608-.792l-.125-.192-1.675.309c-1.217.333-2.467.583-3.642 1.016-1.233.442-2.216.192-3.216-.6a30.2 30.2 0 0 1-6.109-6.55zm71.6 74.692-1.225.75c-1.833 1.117-3.666 2.217-5.491 3.35-.775.483-1.534 1-2.25 1.567-.709.583-1.034 1.341-.6 2.266.391.834.775 1.667 1.225 2.45.391.667 1.033 1.15 1.775 1.225.916.084 1.9.1 2.8-.1 1.808-.416 3.1-1.708 4.4-2.975a2.42 2.42 0 0 0 .725-2.566c-.384-1.5-.659-3.042-.984-4.559-.091-.433-.225-.858-.375-1.408m-2.141-20.075c-1 2.425-1.709 4.975-2.709 7.583a342 342 0 0 0-3.625 11.025c.3-.083.45-.083.559-.15 2.175-1.333 4.35-2.7 6.541-4.033.45-.275.592-.65.542-1.15-.1-1.083-.2-2.183-.283-3.275l-.567-7.383c-.067-.859-.167-1.717-.242-2.584-.075 0-.141-.016-.216-.033m25.675-67.75.825 2.375a291 291 0 0 1 2 5.95l4.833 16.267c1.558 5.25 3.1 10.516 4.65 15.775.95 3.183 1.958 6.35 2.858 9.55.6 2.141 1.05 4.325 1.55 6.658.367 1.717.725 3.442 1.059 5.333.283.884.191 1.884.641 2.709l.209-.05-.567-3.017c-.317-1.717-.642-3.433-.942-5.317-.125-.583-.241-1.175-.383-1.758-.792-3.3-1.475-6.633-2.417-9.892-1.633-5.708-3.441-11.366-5.15-17.05-1.375-4.575-2.683-9.166-4.066-13.733-.575-1.892-1.25-3.75-1.884-5.792l-.975-2.8c-.308-.891-.625-1.8-.958-2.683s-.7-1.75-1.058-2.617c-.075.025-.15.059-.225.084zM51.875 119.2c-.525-.008-.958.117-1.117.692a2.92 2.92 0 0 0 3.417.1 37 37 0 0 0-2.3-.792m-8.292-19.367c-.216-.225-.475-.4-.625.017-.1.267-.058.583-.083.942.683-.309.683-.309.708-.959m.517-9.908c-.3.05-.558.217-.733.467-.159.275-.234.6-.209.916.042 1.267.084 2.55.217 3.809.092.633.275 1.241.55 1.816.508 1.134 1.308 1.392 2.4.842.458-.225.5-.45.208-.917a38 38 0 0 1-1.075-1.758c-.125-.567-.55-1.092-.275-1.725.334-.75-.633-.967-.616-1.583v-1.175c-.025-.317-.05-.725-.467-.692m-.142-8.067a7.2 7.2 0 0 0-3.891 1.059c-.634.375-.7.583-.417 1.316.283.725.583 1.442.958 2.117.534.975.75 1.042 1.75.642a5.47 5.47 0 0 1 2.8-.442c1.684.183 2.975 1.133 4.2 2.2l.767.642c.058-.05.117-.109.183-.15-.158-.875-.291-1.884-1.241-2.2-1.309-.442-2.7-.625-4.234-.975l-2-.042c2-1.408 3.767-.367 5.725.075-.525-.958-1.275-1.225-1.916-1.608-.684-.417-1.417-.767-2.084-1.2-.5-.309-1-.667-.6-1.434m85.275 2.709c-1.916-.084-3.558.666-5.066 1.758-.284.217-.5.542-.875.975.725.217 1.25.383 1.933.542.367-.125.733-.25 1.083-.384 2.55-.95 5.084-.958 7.534.259 1.05.525 1.975.333 3.05-.042-.167-.258-.25-.45-.375-.592a8.2 8.2 0 0 0-3.734-2.275c-1.166-.366-2.366-.2-3.55-.25zm-62.65-30.542c-.075.367-.066.742.017 1.108.667 2.675 1.3 5.359 2.017 8.017.866 3.225 2.25 6.25 3.8 9.192.166.308.508.666.816.725a3.38 3.38 0 0 0 2.109-.425l-3.934-7c-1.916-3.734-3.375-7.667-4.825-11.617M86.642 4.142a26.7 26.7 0 0 0-5.025.283 47 47 0 0 0-5.834 1.267c-2.391.666-4.741 1.5-7.1 2.275-.333.108-.616.316-.916.483.233.117.416.15.583.117 2.392-.567 4.833-.709 7.275-.75 1.117-.017 2.242.075 3.35.208 1.583.2 3.183.4 4.75.75 3.8.867 7.283 2.5 10.542 4.633 3.866 2.55 7.4 5.5 10.475 8.984 1.708 1.933 3.291 3.958 4.666 6.158 1.417 2.283 2.625 4.675 3.742 7.133 2.275 5.009 3.8 10.267 5 15.634.333 1.441.583 2.9.833 4.366.142.867.542 1.392 1.417 1.584 1.017.233 1.667.875 1.833 2.091-.025.85-.5 1.45-1.075 2a8.8 8.8 0 0 0-2.233 2.984c.258-.042.5-.15.692-.325.666-.717 1.35-1.434 1.958-2.209a4.66 4.66 0 0 0 1.083-2.775c.075-.416.184-.833.2-1.25.059-1.033-.141-1.25-1.191-1.4-.209-.033-.409-.116-.609-.125-.683-.058-1.041-.525-1.141-1.091-.275-1.65-.034-2.959 2.058-3.4.717-.15 1.45-.25 2.167-.35 1.316-.192 2.625-.442 3.941-.559 1.167-.1 1.584.275 1.884 1.392.066.242.15.475.175.725.158 1.492-.067 1.875-1.175 2.4-.225.108-.459.2-.65.35a1.23 1.23 0 0 0-.425.558c-.325 1.2.608 3.184 1.716 3.709l5.609 2.666c.191.092.416.125.625.192l.15-.217c-.125-.066-.267-.108-.367-.2a19.2 19.2 0 0 0-4.533-2.666 44 44 0 0 0-1.442-.625 1.71 1.71 0 0 1-1.05-1.592c-.025-.708.375-1.283 1.067-1.558l.491-.209c.825-.366.984-.633.934-1.558a4 4 0 0 0-.067-.525c-.558-2.45-1.025-4.917-1.708-7.333a79 79 0 0 0-6.884-16.967 62.2 62.2 0 0 0-11.583-15.042 37.8 37.8 0 0 0-9.808-6.866 30.6 30.6 0 0 0-8.467-2.734 52 52 0 0 0-5.933-.616m55.991 49.625c.084.116.15.233.317.283l-.183-.367zM34.192 32.642a.47.47 0 0 1-.25.1 4 4 0 0 1-.334.325 4 4 0 0 1-.375.333l-3.025 2.95c-.733.708-1.416 1.483-2.216 2.108-2.367 1.834-3.542 4.417-4.534 7.125a1.1 1.1 0 0 0-.058.592c.108.458.275.9.433 1.4l.617.217c-.142.466-.25.875-.392 1.266-.483 1.367-.983 2.725-1.458 4.092-.042.125.067.3.158.642.667-1.459 1.317-2.75 1.875-4.075 1.9-4.534 4.034-8.95 6.825-13.009a85 85 0 0 1 2.359-3.341c.033-.05.058-.109.183-.25.008-.134.025-.267.125-.334zm108.133 20.066c.05.042.075.1.075.159-.017.025-.033.058-.05.083.017.058.033.108.058.167l.15.183c.017-.058.059-.133.042-.175-.025-.083-.1-.15-.167-.317-.033-.033-.075-.066-.108-.1M34.992 37.333c-.025.034-.067.067-.225.117-.042.108-.092.208-.259.392-.325.483-.666.941-1.033 1.391-.4.584-.967.459-1.508.342-1.117-.233-1.9.133-2.392 1.192-.742 1.558-1.558 3.083-2.275 4.666-.408.9-.917 1.8-.983 3 .675.025 1.283.059 1.9.067h1.9c-.184.742-.4 1.475-.659 2.2-.083.433-.183.858-.275 1.292l.167.033c.15-.383.308-.767.558-1.275.55-1.183 1.084-2.375 1.667-3.55.167-.333.283-.833.967-.767 0 .359.033.7 0 1.034-.042.375-.142.75-.234 1.191 1.175.359.717 1.45.959 2.242.85-.183.866-1.625 2.066-1.2v1.708l.142.017 3.658-8.825c-1.083 0-2.05-.167-2.983.275-.2.092-.483-.008-.9-.033.625-1.25 1.158-2.317 1.758-3.475.05-.109.125-.217.209-.3 0-.125-.009-.25.066-.317l.05-.167c-.041.05-.083.092-.233.142-.033.1-.075.2-.217.375a.7.7 0 0 1-.266.275c-1.025 1.308-.75 1.367-2.15.883-.659-.225-.65-.233-.392-1.2.233-.383.467-.775.817-1.25 0-.133-.009-.266.058-.35l.05-.125zm17.275-5.583c-.025.05-.059.092-.225.133-.784 1.042-1.617 2.05-2.334 3.142-1.291 1.983-2.508 4.008-3.758 6.025-1.167 1.867-2.875 3.067-4.792 4.008-.141.067-.333.05-.658.092.1-.492.133-.908.275-1.275a51 51 0 0 1 1.908-4.317l-.058-.166a1 1 0 0 1-.292.208c-.233.417-.458.833-.775 1.367-2.166 3.533-3.691 6.808-3.683 7.916.2.034.4.092.608.109 1.475.108 1.567.058 2.167-1.375.25-.584.642-1 1.225-1.25l1.458-.584c.367-.15.709-.475 1.217-.266.025.416-.083.916.117 1.208.35.517.366 1.042.391 1.608.017.409.142.817.217 1.225.242-.283.325-.541.417-.808C46.875 45.5 48 42.233 49.258 39c.834-2.133 1.834-4.2 2.75-6.3.109-.25.109-.558.25-.767v-.183zm33.225-2.833c0 .375.083.7.175 1.025.35 1.333.783 2.65 1.033 4 .2 1.108.192 2.25.233 3.383 0 .275-.158.558-.266.917-.784-.484-.392-1.317-.884-1.792h-1.041c-.125.6-.084 1.267-.384 1.667-.55.708-1.291 1.283-1.966 1.891-.359.317-.65.15-.859-.208l-.383-.725c-.542.292-.975.575-1.433.775-.967.425-1.959.792-2.917 1.225-.708.317-.75.442-.583 1.225.116.625.283 1.233.391 1.858.109.6.417.909 1.025 1.034 1.942.416 3.85.958 5.475 2.208.484-.85.484-.85 1.4-1.258.25-.117.5-.25.767-.35.667-.25.958-.142 1.25.5.192.4.342.816.55 1.316.5-1.166-.35-2.225.142-3.466 1.308 1.5 2 3.25 3.125 4.725a2 2 0 0 0 .183-.817c.017-1.033 0-2.058.017-3.092 0-.283.108-.558.166-.833l.267-.025c.917 1.292 1.083 2.95 1.883 4.333a25 25 0 0 0-.083-3.266c-.033-.375 0-.617.417-.734.666.3.966 1.167 1.791 1.317-.25-2.292-3.525-9.475-6.65-13.625-.95-1.058-1.666-2.333-2.833-3.217zm-22.225 5.8c-.159.283-.25.416-.309.558-.508 1.542-1.041 3.083-1.5 4.633-.258.875-.725 1.409-1.625 1.584-.75.158-1.483.433-2.233.608-.317.075-.742.125-.983-.025-.2-.133-.209-.575-.3-.883-.534.633-.684.725-1.417.391-1.108-.516-2.183-1.125-3.275-1.675-.4-.208-.775-.525-1.417-.25-.358 1-.758 2.084-1.141 3.184-.825 2.333-.725 2.016.791 3.775.384.4.85.25 1.284.191.45-.075.883-.25 1.333-.3 1.083-.108 2.167-.666 3.058-.125 1.7-.533 3.225-1.016 4.759-1.483.416-.125.741.042.95.45.183.35.283.775.683 1.008.317-.466-.108-1.066.525-1.483l1.167 2.008zm2.316 2.983c-.8-.083-.891.083-.916.9-.017.317-.025.65.016.958.25 1.667.825 3.217 1.45 4.75.017.05.1.084.184.125l.65-.416c.433.3.675.733 1.275.733 1.708-.017 3.416.117 5.133.1.825-.008 1.317.35 1.708 1 .15.25.2.642.734.55l-.667-3.283c-.417-1.625-.708-3.292-1.433-4.909-.475.475-.95.567-1.5.384a5.7 5.7 0 0 0-1.125-.234c-1.834-.233-3.667-.491-5.5-.666zm85.45-14.392c.742 1.359 1.292 2.634 1.159 4.092-.134 1.4.216 2.85-.367 4.3-.392-.275-.733-.683-.933-.625-.975.292-1.367-.475-1.892-.958a41 41 0 0 1-2.383-2.417l-.867-.942c-.067.05-.125.109-.192.159.292.383.584.775.917 1.3.333.533.7 1.058 1.017 1.608.283.483.541.983.258 1.708-.683-.083-1.367-.158-2.05-.266-.5-.084-.842 0-1.033.583-.259.817-.309.8-1.25.75.166.35.3.667.475.967.341.616.25 1.15-.25 1.633-.5.5-.984 1.017-1.484 1.508a1.46 1.46 0 0 1-1.541.384c-1.85-.509-3.725-.942-5.584-1.45-.266-.075-.525-.334-.716-.567-.25-.333-.434-.725-.667-1.083-.367-.584-.75-1.15-1.133-1.725a1.5 1.5 0 0 0-.117.875c.1 1.058.25 2.108.292 3.166.041.834-.2 1-1.009.867-.866-.142-1.716-.333-2.583-.483-.533-.1-1.092-.234-1.683.25l.675 1.733c.75 0 1.383-.083 1.975.017 1.466.258 2.808 1 3.816 2.091.65.692 1.284 1.4 2.009 2.167l.15-.042c-.034-.05-.067-.108-.084-.333.117-.467-.516-.983.15-1.483.259.25.534.475.734.75.483.65.925 1.325 1.408 2.141l.742 1.175.2-.108c-1.184-2.592-2.375-5.192-3.559-7.783.459.058.692.058.9.133 1.609.583 3.209 1.183 4.809 1.8.616.233 1.225.5 1.825.783.516.234.933.15 1.308-.275.417-.466.85-.933 1.283-1.391.417-.425.792-.384 1.1.116.134.209.217.442.334.667.591 1.15 1.191 2.308 1.808 3.608l1.325 2.567.208-.092c-.366-.883-.583-1.816-1.15-2.783-.475-1.517-1.4-2.883-1.716-4.542 1.133.284 3.016 2.717 4.725 6.1l.475.617.15-.092c-.159-.35-.309-.7-.434-1.058-.383-1.208-.808-2.417-1.133-3.633-.183-.692-.3-1.442.183-2.167l.909.483-.217-1.725.225-.133c.183.167.417.3.542.5.608.9 1.191 1.833 1.791 2.75.084.133.242.242.359.358-.3-1.808-1.667-3.166-1.909-5.216l1.292.933c.117-1.383.1-2.658.35-3.875.267-1.317-.192-2.475-.525-3.708.2.033.3.05.458.208.767 1.033 1.525 2.075 2.309 3.092.166.225.416.391.575.725l.333.525.158-.125a2.5 2.5 0 0 1-.441-.684 234 234 0 0 1-2.767-4.083c-1.842-2.592-3.025-3.892-4.042-4.342m-54.75 2.725c-.025 1.342.767 2.292.575 3.459l-3.066.725c.75 1.158.266 1.975-.434 2.758-.416.475-.766 1.017-1.191 1.483-.309.334-.384.65-.15 1.05L93.35 37.8c.242.4.6.55 1.067.533.633-.025 1.266 0 1.9-.008.966-.025 1.8.183 2.291 1.142.05.116.167.2.367.433.033-.492-.025-.817.083-1.083.134-.334.334-.825.6-.9.7-.192 1.442-.2 2.167-.25.108-.009.225.15.333.241l.592.542c.158-.917-.683-1.65-.2-2.583l1.05.333c-.217-1.025-.583-2.042-.592-3.05 0-1.025.425-2.025.959-3 .891.517 1.333 1.3 1.95 2.108 1.525 2.209 3 4.442 4.116 6.95 1.375-.65 2.25.567 3.392.734-.025-.884-1.108-3.675-1.642-4.1a1.2 1.2 0 0 0-.85-.234c-.5.092-.991.325-1.591.525-.209-.325-.467-.65-.642-1.016a33 33 0 0 0-3.942-6.525c-.633-.784-1.333-1.517-1.9-2.167L99.6 28.8c-.408.292-.783.25-1.1-.142l-1.408-1.725c-.209-.25-.442-.491-.809-.9"})]})}const a2="#D97757",l2="#FF60B8",r2="#084CCF",c2="#4D6BFE",o2="#3859FF",d2="#4285F4",h2="#FA500F",u2="#0668E1",g2="#26A5E4",C2=new URL("data:image/svg+xml,%3csvg%20fill='%23F38020'%20role='img'%20viewBox='0%200%2024%2024'%20xmlns='http://www.w3.org/2000/svg'%3e%3ctitle%3eCloudflare%3c/title%3e%3cpath%20d='M16.5088%2016.8447c.1475-.5068.0908-.9707-.1553-1.3154-.2246-.3164-.6045-.499-1.0615-.5205l-8.6592-.1123a.1559.1559%200%200%201-.1333-.0713c-.0283-.042-.0351-.0986-.021-.1553.0278-.084.1123-.1484.2036-.1562l8.7359-.1123c1.0351-.0489%202.1601-.8868%202.5537-1.9136l.499-1.3013c.0215-.0561.0293-.1128.0147-.168-.5625-2.5463-2.835-4.4453-5.5499-4.4453-2.5039%200-4.6284%201.6177-5.3876%203.8614-.4927-.3658-1.1187-.5625-1.794-.499-1.2026.119-2.1665%201.083-2.2861%202.2856-.0283.31-.0069.6128.0635.894C1.5683%2013.171%200%2014.7754%200%2016.752c0%20.1748.0142.3515.0352.5273.0141.083.0844.1475.1689.1475h15.9814c.0909%200%20.1758-.0645.2032-.1553l.12-.4268zm2.7568-5.5634c-.0771%200-.1611%200-.2383.0112-.0566%200-.1054.0415-.127.0976l-.3378%201.1744c-.1475.5068-.0918.9707.1543%201.3164.2256.3164.6055.498%201.0625.5195l1.8437.1133c.0557%200%20.1055.0263.1329.0703.0283.043.0351.1074.0214.1562-.0283.084-.1132.1485-.204.1553l-1.921.1123c-1.041.0488-2.1582.8867-2.5527%201.914l-.1406.3585c-.0283.0713.0215.1416.0986.1416h6.5977c.0771%200%20.1474-.0489.169-.126.1122-.4082.1757-.837.1757-1.2803%200-2.6025-2.125-4.727-4.7344-4.727'/%3e%3c/svg%3e",import.meta.url).href,m2=new URL("data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20256%20256'%20role='img'%3e%3ctitle%3engrok%3c/title%3e%3cpath%20fill='%231F1E37'%20d='M210.695%2058.494c-3.381-4.044-7.198-7.535-11.288-10.637-3.654-2.715-7.525-5.098-11.724-7.037-2.018-.942-4.144-1.717-6.38-2.438-3.217-1.052-6.707-1.773-10.306-2.382h-45.369L95.636%2070.739V36.72H32V220h63.637V96.336H155.4l4.963-.11v123.719H224V105.312q0-14.627-2.781-26.096c-1.854-7.59-5.344-14.46-10.524-20.722'/%3e%3c/svg%3e",import.meta.url).href,A2="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAABY2lDQ1BrQ0dDb2xvclNwYWNlRGlzcGxheVAzAAAokX2QsUvDUBDGv1aloHUQHRwcMolDlJIKuji0FURxCFXB6pS+pqmQxkeSIgU3/4GC/4EKzm4Whzo6OAiik+jm5KTgouV5L4mkInqP435877vjOCA5bnBu9wOoO75bXMorm6UtJfWMBL0gDObxnK6vSv6uP+P9PvTeTstZv///jcGK6TGqn5QZxl0fSKjE+p7PJe8Tj7m0FHFLshXyieRyyOeBZ71YIL4mVljNqBC/EKvlHt3q4brdYNEOcvu06WysyTmUE1jEDjxw2DDQhAId2T/8s4G/gF1yN+FSn4UafOrJkSInmMTLcMAwA5VYQ4ZSk3eO7ncX3U+NtYMnYKEjhLiItZUOcDZHJ2vH2tQ8MDIEXLW54RqB1EeZrFaB11NguASM3lDPtlfNauH26Tww8CjE2ySQOgS6LSE+joToHlPzA3DpfAEDp2ITpJYOWwAAAARjSUNQDA0AAW4D4+8AAAA4ZVhJZk1NACoAAAAIAAGHaQAEAAAAAQAAABoAAAAAAAKgAgAEAAAAAQAAAECgAwAEAAAAAQAAAEAAAAAAZZlgigAAAZ9pVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IlhNUCBDb3JlIDYuMC4wIj4KICAgPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4KICAgICAgPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIKICAgICAgICAgICAgeG1sbnM6ZXhpZj0iaHR0cDovL25zLmFkb2JlLmNvbS9leGlmLzEuMC8iPgogICAgICAgICA8ZXhpZjpQaXhlbFhEaW1lbnNpb24+MTAyNDwvZXhpZjpQaXhlbFhEaW1lbnNpb24+CiAgICAgICAgIDxleGlmOlBpeGVsWURpbWVuc2lvbj4xMDI0PC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+ClWCY1gAABW4SURBVHgB7VprkFzFdT4zc+e1O/t+SrBCAgkJZF6GhJeQREhFVkCRoQCXE2xSpsgfp1KVsl1JHLtMyomVYMqucqWKskmKKmNbGCMSyhjCwwhHEg8bYgtYIRBCKwm9diTN7s7uzuvOvfm+07dn7j6uQIF/Ue/e6b79OH3Od06fPt0zImfSGQTOIHAGgTMI/P9FIPZRRb/nnnsyfX2L+txYvN9zvS7XddvcWr3F8/xsrS5O3auL53lSrzMX5J54aKixDrlbd6Xu4r0uph/bUK7V0A9jg9ytuW7Jdb1pt1ovVmvVQtUbG53M78yPjIyUP4oMpwsA+/v33HNbavDsjdedODm5MX987OoThcLiqeJ0R6lSTUJ4AaP6UHDfN+xpjjJz8/gmByi+gKwfm5GbPqjjeI4hGeakKX4Nz3jMkxHf91+SWPXxXa8/vA09qniUR3b/MOl0AFDC9z/w0NpDRwtfH9615/p39x6IHRvNS2m6LB40awThtDGJxYJH4spHjDnqtI08sh1/8XgcRQd5AjmfuMSZaz3agnHsa/5JwyT2TWBcIuH7SSex1fOr39z95sMvoJWdFDPTM/qzSS26j7bcdpskrl794Fdef3PPN7bt+E3m0OGjOgsZj4MRKxDnNswGeei90cY6BYjCY3zcCXIDgAWCAvJpjmsyCc3THGAhtCRPnIQjqaRTdhzvH4bf+PG30RML6YPThwEgtnbt2sSNN9+xacfLO7/8/NYdUq1WgTqYVe0aQSkQGW0wG2hY322b6iTQOkGA4FbzFgS1ALUGI7y1gAZdzACR8WEeCq8PHQzqM+mMOE79vl1v/uTvUEEQdFbk86bEvLXNSkrkf/Gvv/Y3L7688+vPPvffaurxBE0zQljWq/Bh0ycVkWw2K8lkEv6hbrRO6yEIavLUPt9NzmWhlqB9gja0W9p2fgKjj3IK5+nWJBFLXjMwsLKcz79Jv8CWyPRBAMi3v/vAHwy/9d4DT/7XVofrnMJz3VEBlgmr/XnfA0tQU4aj81RztAIIFQhnAAhbgwFCl1cIAF0SsDqdj1YVFs3qGfSxE4FPZ1Vv79IXT5zYvS9SejQYNc3fI7Zhw4aWwtgE1vyraZo958y15qSvr1e3LA6zQhtu+Eau5n+4FXIbVEF0fVOzFCicG20b7cMK1D8QHPuE2hvj7HLB7KDHJVKt1tOxWPYbCxcubAkYIrtz0qkA8K+57lOr396zf9VhODw6GRKfLE7K0aOjagVhFcSJDtPMzL4GuQGIdEAM/3w3GjVABIIQFGqeS4JPYC12STR2CPbjwz/OrzwYmnUshbrrr2rLXrEaXFn7UBbDH1EAqAorNW/jnnf3E9JmwiRGWJ0W9dirPV8u+sQK6enugmVwM9Thc3IyaBlVwRvmbAVnuylzZ9GyLgH6CWMBxloCi+EMMwTnzEEdOIO1wXAyG5XJhmqaorAUBYCsX7++7WRh/Kqjx/LQgO0WqBeTNBKKZPSdPftkfLwY6tvo0SiYUSEmGxozdWRHrQL0TNnGBLQCLoeQ4ORhzvgmX6RTR5Tp+bGruru72xpMzCpYyWZVi1xyyZX9hcLEolKpZFDmhLCEGBwZweSfzTlZuVQx6ztUTwbD/Wx/5rY8W4ONNo7FY/oF1qDjUBWRTG9Dgcz6CKVhnYtaWpb3RwyJtAA/k8v0Fyen2xmnK0kKfwoGDLNR04TrZ1OZ+U4hGilYer4Eez32fN1+bAe2B320CjuA57kqOC0m4aRpNe3pRBsBCPe0FMRplGYVYrF0V6VSdcx2h0Zog/t3rVpDkYZDxsHubC2H3wMNhvvGYyYGiMe5pXqIDRKILeC1XQRXqDPOD23xOsp0vG5jPgpvAh9qFqBQwz7LdR2bSmWku3+ptPecLemWDokhWEulHKc0+V7X3v3PzJLQvEYC4Nf9tlrNDQYZ4Vecv0R+7/KL1NGxwQBgSsGbAsJyo9320wqOgDmrh49jfYo8v3UnQMjImtWXokdg6tYBEkCWA3pq1qp1EwLj/AjhWVGXN4bHxcksk5b2bqgaJ0kA48UQGba2ojwZ6QMiAQDdLDVuUxWaX7v6SvnOvX9rqz6G3JdVa/9SBvq75bv3ffEj0bvve2/IW29PSDoL64TgLuKNqekKhMeu5CeyUcQjAXDrfosBoKlNetWPM2GJqSnz3P/Rkift7Unp6c1IKs1wWW1Ferys+PGM5EfHGQzNmyIBwEWGo1GbDmuCMC+V/2Mlt1dzmpvXP50G1RgCNTxOHCdC+BRoXS9iwHZrS1KkJxcpZ2SDhxsZ4zfNCuRnBcugiEiwrievufzlsN4cZ+bxolyuCB/1hzrEgMliBeG13vqAbj5/kj5OUzKRNgV8WmgIVDwek67uuZHtkaNFGc1X4Aix92PZGgBw4wQ+67icOZWFRQOgHlavOJSZTCYtj//8edm2/TXjeELenlwmIPjmH90rF16wtME8Cz979Gn5x2/9OxwdhSKMAACOzdwhJOT48aIcO1aQP1z3JbWG8wcvk4VdS6WOdcz+PpGDpXjI7vjCclm1ZgnJNlKhMCWbH9knhQJOgU5MagCKAHjYMutwZG4KgMAfRKVTAEBPy2GYmWwjm5wsycT4VPCOClYyMEI/B6ZHRzk7FYvTsn//UWlpyWh/+nTCqidAxPkOjsfcVkdHj0tv7izJ+QtkYqwEP44+SUfSrSmMi8tNN58j165ZPIP8NG6ifrz5XTl4oCROipEf9oUGAFgGACGFKzqEBpEpEgCaj966NIaSaShDTdxq0uQEysGeaxPHNQIjjOGy0PaQ1ehItMGcdBjPF4t7ztd+LhnPONjCUgILluuuH5AbNy6lGuwUuCytycOb35G3dk1IMh2XaoXCUxeBBSCnDLW0OYE2Bs4qRALgAk6zx5oRzambpRm0aC18gtQAwZiRqWV7MJyMqvCwbaxSySRbpDPbrfF7AtaUSsWlPF2Ty67ul1v/7AKsgibA3OO3PPq2vPLycWgewpdJQSkqCywbP+ADKJpF9C4TCQCdB3nXwIUBCjkPmG9qgvUmGY0bBBrCo0nlN9Wmo5ZJmEuBWqpJS7JVBtuGxInDY9MisKwmsQzOvbBLPnf3xZJOp9QaOQe34sce2SWPbzkgLbAQzzeH1bjjwOS5/0NxmMk6wlrVRIlm8rmfkQCo41A+IaRGYxxsxG0CgBKYMi0zT80WBJubMRYuAuPj6iouy/suknO6l0saFsA1y+RWEMFh57rrrz4p7R0t8OKmXtvg5RcsbJXVa/rld789LsfzNSwBxP1JnPzQgYIrAPikJfCaPgFco1I0ALoLUFFk3fwZIkYUBQPy2Dd958xIVmjzwpbQ2UErzcfFg1fKku7zhWtehYSTIfscn8kkpFO3PPNuh6VSKewE5+E5FzvIpDz+2Nvy1FOHcBfIcwQYIg1kxjcbhhqneUsklEceh/mNDKlgwzIWQCBoCeFcl0azPURXheA7WVD4dBxpmHvBBTD5RZ3n4VsgEwvYm11zhIXnDrZhhQ8S2DsJgkOwePHS25uTu/7icvn8ncuwzGuYEzqn86bFBHkM/e3YMH+2HG0BGkDQD0AEEIvDy5OutQgyxsR3SkkhtS/qmGs9OwRlYwWsQMwAhzZRLsi2kacbY0wLPwEQ9u3+Yhf29mvUR1DYJBxja2sLruMd8EGACASoQuMbPr1CdmzbJo8+/CtJZ7BtKhWzHMYH+mVgEFtwRIoGANpNZzulvdOVZCot6ZQj42Mnxa1OY1/Ffg/B9a7OAhHknMcCYcoGHALUTLhAcUtSqk03qsKtBPTgoaLcfutXNWAixul0UoaGBuTTt6yRjTdfrwBzHgLh4Nj8mc9eI4/99BcyNYEbYQ5A4i5Wbo2D5/bGPLMLkQAsOHeVpPtz0jlUgLPCNThNCmZWLU/CQx+RQn6vTBTeh1euYUJcVQEwGotNDRBoAcGfbWOuFjFD6mYr+ae1HRg51qwEneE39snTT74iY4WifOHuWzQW4Dy8bV62/Bw5b9mQDO98D04v2DIRTdJiHCfaC0b6AMSVQBlRGoWiEOCKNywtuV4ZHLpUVlx6s6z85O3SN7BCmTQCGwQawkOVGKpjdemAhsnhN2b90d/YP7UZ9E1iazNPAksAgRG2Q45/ZPNzUqnwfGEQpE9II1QfHOxuhL0WW3ZJnMILRloAD0Ph7YdmaW5jTE6pW9sGZNnKG6WrZ7e8v2+7cT4qtAECPYkeHiMwx5gErsy/vtJUHXzhUqnQmgh0M+jhvqCdmyMDSzO7A8EmEKRhgVfhMYzK48z8MicqRQLA7+8tUZCWJK+XYFo8ciZ0QtzDuNhn4SwHFlyIWL8LjGcUJE5GZsxjxVe2QnxQ3ybxDPGlr31Ozws/uP8/5eD+URUqAcbpwdmPtPAjAVXK7Z+9AT4hDcBwn0ATA39TU9Ny9PBxo21WBYnghKNIW2/zaABgAaTdlstIZ3sW+zKCjYAZKkXnBep0QrWqJx0di2CGOWWQTKlWkGsZIvCPQHKgYZpsE0RPli47W+7885tw1O2UDRuvk18+8xt5Yetrsuftg1I4WdS7SDrhcxYPyp9+/lNyy203hISHpiHkO7tHZGTvkcZxXEHDDGgCAFbcuXkkAC2Irrq623Hdze8CjYNTf0Aa5JyygDgnT2SwY+A0xvMQhWsIiLL2xQe3riQsJJNpR1/eG+B4jPapyaLcdfefqPDlchl7e5fcceeNEHS9FCem8F3DpGo+g+2tp7dTNc/7BTsHLcTFrvTwQ8/gW6sS6MNPkD8m5ASelhSVIgFoa8+6PKqWS4YQ1ybiICWoQnESCgsQaAXAWucIA8AzOd9zrX3Ywj4BS1oIAVp1VyGTvA1esDAlt35mLY7SFAphMEJdexdJYbLZXtUi6XCeUqmMuTgb/pQnX7bAKf58y3YAm4SyGC9kcWyfVI4YJyCAizwQRwKA3+GUYri2VmHBrU4IERltMuSkAD6k580rRef5nQwpRGQMRWq9q2uRrFy5AVdTuJ/j3sYgBqc5Rmj0MVOTIr96do9ccc1C6ejMgYr55ploUmDe+M5OVAY1Pz09LT/7yTPynW9t1qVETXvYEmk57MPxtF4n4VON86ZIAGrTlRJ+aKBEKJaPH+SQKKUlCDZpUetwZQYTLhbHoUEIipRMQpx4CswietMLVQMWhWcCb4glavLD+3fL1qf2y+U4+l54SS+caju22zSWCb8P5Ndi6KiA0+m6iAMm5Hf/84789KFnZdvzOxV47iI22Z2DvBEU8H7aAMTK1UoxSa/L6ySGnBCe11N8PDwkbj5RUIFi8sRTh40foOZQh25y7NA0NMDe6G/k1rJaFkqUjddjh0ZKcnAvAp0t+6WnPyX9g1nkWYmnKlIsjcJaABZuow4dHJU9u9+XA/uOwfm6uAVGvAI6BlMDsOWMvCawa+HrvCKnZzc8M1KkBRTHT4xlWodwvPYdH5xTaG5IKjxIUXhS5ANUlGj+uNk6yQ3NG7YOC8L2iRubOs7lyqThVOLmRetoEQne6kJbLn7/dfRAWY7sQ5hMEog03xrZIScmDgEofjnK2yc4ZnhcjfsDelbrZMTwZHhEAOVWa6UxZXCejygAYgePvpPv7r94Asu2m85M1xSFBnWWZwDAKcEsmdDJ9YUVDHBienFRrJbAMH7IhBscmiX74tsnnCtwZQVw8Ps/tTaO5+UPfwNAdOI4h6w890p5/b2tAkHU3EneJBbMjJrNqDcRIC5zJ4pT+IrbdGz0CAhEfzf42gtb8hdesPEgHF0392oKTbYJgHF4hiKBUHmVIgCwU1AzLCPP4m4+neIFKM3RWIexEFoM1iiAIRC1kivVEo61AIaDKRodZzadk6He5bL3yG9RB2C0gX1Q0DKKTKEyZtEtM5fLHHxx+BUCMG+KsgCZmHi/WC5P/dpJdFxSd/E7QAsAyBCEpgVwVjO3miH40hoFAC/kEwlHi8CfsC5YIuyDZUIwSI8XoVwKlSncEfAuLxjM3aSvY0gOn9yL7xKmtK/GIAFt08/wYcvcNjs6EXO0JH49PDxMHzBvarrOmc0k7RWOjTyBr5s9enX9WWuwR5tfgtpfhMKE2U5T1jxUhgPlt0s8rXFvN78RMqaup8tAeALAd549CG4aFpOAtVB+A6ovKQROPblBYGekVstDqyYOCpXZA7NI71mdXsWfeAKv3JbMQBTC6VQAxJ578l+212qll7iV2QDFgEEhQ4IGwmubBYKCow/wU81zN9FHBQUYjAf0McGSykUgWMCTxJKJc/dQtk1dJwIq/emM2gAgQLOxRFPGaAiOpeTXpAtR48Bg50svvvqL7RCYCM0LQOQSwAAPy2Ayf2TXpv7BS7fg9iXN06DuBAFFjcRs2eYBw6qTUNmaOkHwFQywi5zC8okjozAaaAW0uIURVLLOnSibyikABI7Xc0yAFc1wptwnWSJ4OP8vv2BxpRab3ATzR6ilFsDuc1Lz3DmnidNKfM9bzx5YuvyPYplM15oaTl96RGYLFyEe/clMULZ1HEl+GOrSu1fh3MpwbhU8tTIcXQW/EMceXueRWy3GLh/zy3EuN/oAjQRVMIJD8PmbAuq4LhV3Gr84x2+jyQYnZA7hqZSLL1kh/Qtzm77/4Dd/BE7pTOaGk6hkOhUAbFcQdr3+H6+tWHljazrd9fsUyICN1VnHQwXRdHVLM8dj3dYq+MU4nnqVbaRE/Sqf5NSUoVVbp8uY7UGbLgUsFxXOTKKDu3P90t92lnS39oNMXSarE8ql0byjwg8t6fnXHz7y95twZ8Jfj8/9vg6VNn0QAOyn+h7e+ej285evq6bSHVf59bjDH04a7Vl/wDUOrcFkzRbHYeSZWmFO89ZP/T5Aw2ntYkzXbJ8BIADBjMWnBYsVrA/ask5W+nILJYO8MJ2Xzq4OufSyFZWBs9s2fe8HX6XwDH8pvCHG8fMkKuDDJC44Xrc669b98w09fSu/7HvOtT72xnoNQDDOD5hTgTllwKjG/XgP17PMf52cWqaGsa41xzgzxoBBOgTHjAnKGMgvVXj66+rqlHq26JdSozuq/th933/wn36J2Xn6o/aJ7inThwWARNiXt4u0mo51f3zvtZ1ti9c78ewVMO8haL0dDhJfUDf/iBq1rznK1HqjLig3nB7eDUiQFnxbwGLBMmFgiABSaTjJmJtOOxOILA866fqrhdKxp/7toa/sGMnnxzGYC+4DNY8+mjDtaSX2pwzcPTTHL8Dbl597U19H55K+bEt7pxNP5/Br7WzKyWQAh97H6oFHT3UYBPiSqDB1OKqqYHhHva0jYZZ1fZq+rufXyl69WqrWa5OlUmHs8NhI/vlXH8ufeP8EnIBqnNqm5s2aQuHDpNMFwNLkOD7kkfzOpjP7HV0+lkTzCCdjLkbrLM9uD/edt/xxMWrp2JyThcvzTn6alWHhbNnmp0nqTPczCJxB4AwCBoH/BUpsi0FkIPhrAAAAAElFTkSuQmCC",x2="data:image/png;base64,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",p2={anthropic:({size:e})=>s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:s.jsxs("g",{stroke:a2,strokeWidth:2,strokeLinecap:"round",children:[s.jsx("path",{d:"M12 3v18"}),s.jsx("path",{d:"M3 12h18"}),s.jsx("path",{d:"M5.6 5.6l12.8 12.8"}),s.jsx("path",{d:"M18.4 5.6L5.6 18.4"})]})}),openai:({size:e})=>s.jsx("svg",{width:e,height:e,viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:s.jsx("path",{d:"M12.9851 6.93777C13.1163 6.54364 13.1618 6.12607 13.1186 5.71295C13.0754 5.29983 12.9444 4.90072 12.7344 4.54231C12.4232 4.00021 11.9478 3.57101 11.3768 3.31664C10.8058 3.06227 10.1687 2.99589 9.55751 3.12706C9.28184 2.81639 8.943 2.56818 8.56362 2.39905C8.18425 2.22993 7.77314 2.14379 7.3578 2.1464C6.73292 2.1449 6.1237 2.34187 5.61797 2.70892C5.11225 3.07598 4.73616 3.59415 4.54391 4.18873C4.13684 4.27206 3.75225 4.44139 3.41591 4.68539C3.07957 4.92938 2.79924 5.24241 2.59368 5.60352C2.27994 6.14413 2.14602 6.77039 2.21123 7.39205C2.27644 8.01367 2.5374 8.59851 2.95649 9.06224C2.82527 9.45637 2.77975 9.87394 2.82297 10.2871C2.8662 10.7002 2.99718 11.0993 3.20713 11.4577C3.51841 11.9998 3.99385 12.4289 4.56484 12.6833C5.13584 12.9377 5.77289 13.0041 6.38407 12.8729C6.65975 13.1836 6.99862 13.4318 7.37796 13.601C7.75734 13.7701 8.16844 13.8562 8.58379 13.8536C9.20899 13.8552 9.81853 13.6582 10.3244 13.2909C10.8304 12.9236 11.2065 12.4051 11.3986 11.8101C11.8057 11.7268 12.1903 11.5575 12.5266 11.3135C12.8629 11.0695 13.1433 10.7564 13.3488 10.3953C13.6622 9.85477 13.7958 9.22866 13.7304 8.60726C13.6651 7.98587 13.4041 7.40129 12.9851 6.93777ZM8.58472 13.0883C8.0715 13.089 7.57441 12.9093 7.18031 12.5805C7.19808 12.5708 7.22925 12.5537 7.24956 12.5413L9.58061 11.1948C9.63911 11.1615 9.6877 11.1133 9.72136 11.055C9.75505 10.9967 9.77258 10.9305 9.77217 10.8632V7.57684L10.7575 8.14576C10.7626 8.14834 10.7671 8.15214 10.7704 8.15685C10.7738 8.16157 10.7759 8.16704 10.7766 8.17275V10.8943C10.7759 11.4756 10.5448 12.0329 10.1339 12.4441C9.72308 12.8554 9.16599 13.087 8.58472 13.0883ZM3.87091 11.075C3.61385 10.6309 3.5212 10.1105 3.60918 9.60485C3.62649 9.61524 3.65673 9.6337 3.67842 9.64617L6.00947 10.9926C6.06756 11.0266 6.13365 11.0445 6.20094 11.0445C6.2682 11.0445 6.33428 11.0266 6.39238 10.9926L9.23834 9.34936V10.4872C9.23867 10.493 9.23755 10.4988 9.23509 10.5041C9.23264 10.5094 9.22892 10.5139 9.22427 10.5174L6.86782 11.878C6.36379 12.1683 5.76516 12.2467 5.20333 12.0962C4.64148 11.9457 4.1623 11.5784 3.87091 11.075ZM3.25768 5.98617C3.51363 5.54141 3.91789 5.2009 4.39966 5.02421C4.39966 5.04429 4.39851 5.07985 4.39851 5.10452V7.79747C4.3981 7.86473 4.41561 7.93087 4.44924 7.98915C4.48287 8.04739 4.5314 8.09563 4.58984 8.1289L7.4358 9.77197L6.45054 10.3409C6.44568 10.3441 6.44009 10.346 6.43429 10.3465C6.4285 10.3471 6.42265 10.3462 6.41729 10.3439L4.06062 8.98216C3.55747 8.69077 3.19039 8.21176 3.03987 7.65013C2.88935 7.08853 2.96768 6.49014 3.25768 5.98617ZM11.3527 7.86994L8.50669 6.22667L9.49198 5.65799C9.49684 5.6548 9.50243 5.65283 9.50823 5.65231C9.51402 5.65178 9.51985 5.65272 9.5252 5.655L11.8819 7.01554C12.2429 7.2241 12.5371 7.53119 12.7299 7.90087C12.9228 8.27056 13.0063 8.68752 12.9707 9.10295C12.9351 9.51839 12.7819 9.91509 12.5291 10.2466C12.2762 10.5781 11.9341 10.8307 11.5428 10.9749C11.5428 10.9546 11.5428 10.919 11.5428 10.8943V8.20137C11.5434 8.13423 11.5261 8.06814 11.4926 8.0099C11.4592 7.95165 11.4109 7.90336 11.3527 7.86994ZM12.3333 6.394C12.316 6.38337 12.2858 6.36514 12.2641 6.3527L9.93303 5.00621C9.87493 4.97232 9.80887 4.95444 9.74158 4.95444C9.67432 4.95444 9.60824 4.97232 9.55014 5.00621L6.70418 6.64951V5.51167C6.70386 5.50585 6.70497 5.50005 6.70743 5.49479C6.70988 5.48952 6.7136 5.48492 6.71826 5.48144L9.0747 4.12203C9.4357 3.91387 9.84853 3.81281 10.2649 3.83068C10.6812 3.84856 11.0838 3.98462 11.4257 4.22296C11.7675 4.46129 12.0344 4.79204 12.1951 5.17652C12.3559 5.56099 12.4038 5.98327 12.3333 6.394ZM6.16851 8.42203L5.18299 7.85311C5.17784 7.85053 5.17336 7.84673 5.17002 7.84202C5.16668 7.8373 5.16455 7.83183 5.16385 7.82609V5.10452C5.16411 4.6877 5.28311 4.27956 5.5069 3.9279C5.73071 3.57623 6.05006 3.29559 6.42756 3.11883C6.80507 2.94206 7.22509 2.87649 7.63851 2.92977C8.05195 2.98306 8.44163 3.153 8.76197 3.41971C8.74421 3.42941 8.71327 3.44649 8.69272 3.45895L6.36168 4.80542C6.30317 4.83867 6.25462 4.8869 6.22093 4.94516C6.18727 5.0034 6.16974 5.06958 6.17012 5.13683L6.16851 8.42203ZM6.70371 7.26803L7.97126 6.53595L9.23878 7.26757V8.73127L7.97126 9.46292L6.70371 8.73127V7.26803Z",fill:"currentColor"})}),codex:({size:e})=>s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[s.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"4.5",stroke:"currentColor",strokeWidth:1.7}),s.jsxs("g",{stroke:"currentColor",strokeWidth:1.7,strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("path",{d:"M7.2 9.2l3.2 2.8-3.2 2.8"}),s.jsx("path",{d:"M12.8 15.2h4"})]})]}),opencode:({size:e})=>s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[s.jsx("rect",{x:"3.5",y:"3.5",width:"17",height:"17",rx:"3.5",stroke:"currentColor",strokeWidth:1.8}),s.jsx("rect",{x:"8.5",y:"8.5",width:"7",height:"7",rx:"1.5",fill:"currentColor"})]}),t3code:({size:e})=>s.jsx("svg",{width:e,height:e,viewBox:"0 0 64 64","aria-hidden":"true",children:s.jsx("image",{width:"64",height:"64",href:A2})}),pi:({size:e})=>s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:s.jsx("path",{d:"M6 4.5h10.5v10.5h-5.25V19.5H6V4.5zm3.5 3.5v3.5H13V8H9.5z",fill:"currentColor",fillRule:"evenodd"})}),crush:({size:e})=>s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:s.jsx("path",{d:"M12 20.2S4 15.2 4 9.6C4 6.9 6 5 8.4 5c1.5 0 2.8.7 3.6 1.9C12.8 5.7 14.1 5 15.6 5 18 5 20 6.9 20 9.6c0 5.6-8 10.6-8 10.6z",fill:l2})}),goose:({size:e})=>s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:s.jsx("path",{d:"M15.2 3.5c1.5 0 2.6 1.1 2.6 2.5 0 .4-.1.8-.3 1.2l2.5 1-2.3 1c-.1 2.6-1.2 4-2.7 5.2-1.1.9-1.8 1.6-2 2.9h3.3v2.2H6.2c-1.9 0-3.2-1.3-3.2-3 0-1.8 1.4-3 3.3-3h2.9c.9 0 1.6-.4 2.2-1 .9-.9 1.5-1.9 1.6-3.4-.9-.4-1.5-1.3-1.5-2.4 0-1.8 1.5-3.2 3.7-3.2z",fill:"currentColor"})}),zed:({size:e})=>s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[s.jsx("rect",{x:"2.5",y:"2.5",width:"19",height:"19",rx:"5",fill:r2}),s.jsx("path",{d:"M7.5 7.5H16.5L7.5 16.5H16.5",stroke:"#fff",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]}),deepseek:({size:e})=>s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[s.jsx("path",{d:"M3 13.5c3.2 0 4.6-1.6 6.2-3.4 1.5-1.7 3-3.4 6.3-3.4 2 0 3.4.7 4.5 1.7-.6 2.1-1.7 3.3-3.2 4-1.9.9-3 .3-4.6 1.2C15.8 15 13.9 17.5 10 17.5c-4 0-7-2-7-4z",fill:c2}),s.jsx("circle",{cx:"16.3",cy:"9.4",r:"0.9",fill:"#fff"})]}),qwen:({size:e})=>s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:s.jsx("path",{d:"M12 2.5l3.4 6h-6.8L12 2.5zM4.2 8.2h6.8l-3.4 6-3.4-6zM13 8.2h6.8l-3.4 6-3.4-6zM8.6 15.5h6.8L12 21.5l-3.4-6z",stroke:"currentColor",strokeWidth:1.5,strokeLinejoin:"round"})}),kimi:({size:e})=>s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[s.jsx("rect",{x:"2.5",y:"2.5",width:"19",height:"19",rx:"5.5",fill:"#141416"}),s.jsx("rect",{x:"2.5",y:"2.5",width:"19",height:"19",rx:"5.5",stroke:"currentColor",strokeOpacity:.25,strokeWidth:.75}),s.jsxs("g",{stroke:"#fff",strokeWidth:2.1,strokeLinecap:"round",strokeLinejoin:"round",children:[s.jsx("path",{d:"M8.2 6.8v10.4"}),s.jsx("path",{d:"M8.2 13.4l7-6.6"}),s.jsx("path",{d:"M10.6 11.4l5 5.8"})]})]}),glm:({size:e})=>s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[s.jsx("rect",{x:"2.5",y:"2.5",width:"19",height:"19",rx:"6",fill:o2}),s.jsx("path",{d:"M8.5 8.2h7l-7 7.6h7",stroke:"#fff",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round"})]}),gemini:({size:e})=>s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:s.jsx("path",{d:"M12 2.5c.6 5.3 4.2 8.9 9.5 9.5-5.3.6-8.9 4.2-9.5 9.5-.6-5.3-4.2-8.9-9.5-9.5 5.3-.6 8.9-4.2 9.5-9.5z",fill:d2})}),grok:({size:e})=>s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:s.jsxs("g",{stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",children:[s.jsx("path",{d:"M5 5l14 14"}),s.jsx("path",{d:"M19 5l-5.6 5.6"})]})}),mistral:({size:e})=>s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:s.jsx("path",{d:"M4 19V5h3l5 6 5-6h3v14h-3v-8.6l-5 6-5-6V19H4z",fill:h2})}),minimax:({size:e})=>s.jsx("svg",{width:e,height:e,viewBox:"0 0 32 32","aria-hidden":"true",children:s.jsx("image",{width:"32",height:"32",href:x2})}),llama:({size:e})=>s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:s.jsx("path",{d:"M7 8.5c-4.5 0-4.5 7 0 7 4.5 0 5.5-7 10-7 4.5 0 4.5 7 0 7-4.5 0-5.5-7-10-7z",stroke:u2,strokeWidth:1.8})}),telegram:({size:e})=>s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:s.jsx("path",{d:"M11.944 0A12 12 0 0 0 0 12a12 12 0 0 0 12 12 12 12 0 0 0 12-12A12 12 0 0 0 12 0a12 12 0 0 0-.056 0zm4.962 7.224c.1-.002.321.023.465.14a.506.506 0 0 1 .171.325c.016.093.036.306.02.472-.18 1.898-.962 6.502-1.36 8.627-.168.9-.499 1.201-.82 1.23-.696.065-1.225-.46-1.9-.902-1.056-.693-1.653-1.124-2.678-1.8-1.185-.78-.417-1.21.258-1.91.177-.184 3.247-2.977 3.307-3.23.007-.032.014-.15-.056-.212s-.174-.041-.249-.024c-.106.024-1.793 1.14-5.061 3.345-.48.33-.913.49-1.302.48-.428-.008-1.252-.241-1.865-.44-.752-.245-1.349-.374-1.297-.789.027-.216.325-.437.893-.663 3.498-1.524 5.83-2.529 6.998-3.014 3.332-1.386 4.025-1.627 4.476-1.635z",fill:g2})}),hermes:n2,droid:i2,cursor:({size:e})=>s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:s.jsx("path",{fill:"currentColor",d:"M11.503.131 1.891 5.678a.84.84 0 0 0-.42.726v11.188c0 .3.162.575.42.724l9.609 5.55a1 1 0 0 0 .998 0l9.61-5.55a.84.84 0 0 0 .42-.724V6.404a.84.84 0 0 0-.42-.726L12.497.131a1.01 1.01 0 0 0-.996 0M2.657 6.338h18.55c.263 0 .43.287.297.515L12.23 22.918c-.062.107-.229.064-.229-.06V12.335a.59.59 0 0 0-.295-.51l-9.11-5.257c-.109-.063-.064-.23.061-.23"})}),cloudflare:({size:e})=>s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:s.jsx("image",{width:"24",height:"24",href:C2})}),ngrok:({size:e})=>s.jsx("svg",{width:e,height:e,viewBox:"0 0 24 24","aria-hidden":"true",children:s.jsx("image",{width:"24",height:"24",href:m2})}),generic:({size:e})=>s.jsxs("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none","aria-hidden":"true",children:[s.jsx("rect",{x:"4",y:"4",width:"16",height:"16",rx:"4",stroke:"currentColor",strokeWidth:1.7}),s.jsx("circle",{cx:"12",cy:"12",r:"2.4",fill:"currentColor"})]})},j2=[["cloudflare",/cloudflare/i],["ngrok",/ngrok/i],["kimi",/(kimi|moonshot)/i],["glm",/(glm|zhipu)/i],["deepseek",/deep-?seek/i],["qwen",/(qwen|tongyi)/i],["gemini",/(gemini|gemma|google)/i],["grok",/(grok|(^|[^a-z0-9])x-?ai([^a-z0-9]|$))/i],["mistral",/(mistral|mixtral|magistral|devstral|codestral)/i],["minimax",/mini[-\s]?max/i],["llama",/llama/i],["telegram",/telegram/i],["hermes",/^(?:hermes(?:-agent)?)(?: hermes(?: agent)?)?$/i],["droid",/(^|[^a-z0-9])(droid|factory)([^a-z0-9]|$)/i],["cursor",/(^|[^a-z0-9])cursor([^a-z0-9]|$)/i],["anthropic",/(anthropic|claude)/i],["codex",/codex/i],["openai",/(openai|chatgpt|gpt|gpt-)/i],["opencode",/(opencode|open-code)/i],["t3code",/(^|[^a-z0-9])t3[ -]?code([^a-z0-9]|$)/i],["crush",/crush/i],["goose",/goose/i],["zed",/(^|[^a-z0-9])zed([^a-z0-9]|$)/i],["pi",/(gooey-?pi|(^|[^a-z0-9])pi([^a-z0-9]|$))/i]],f2=4096,L=new Map;function o1(...e){const t=e.filter(Boolean).join(" ");if(!t)return"generic";const n=L.get(t);if(n)return n;let c="generic";for(const[d,l]of j2)if(l.test(t)){c=d;break}return L.size>=f2&&L.clear(),L.set(t,c),c}function d1({name:e,hints:t,brand:n,size:c=20,className:d,style:l}){const o=n??o1(e,...t??[]),i=p2[o];return s.jsx("span",{className:d,style:{display:"inline-flex",...l},"aria-hidden":"true",children:s.jsx(i,{size:c})})}const v2={anthropic:"Anthropic",openai:"OpenAI",codex:"OpenAI",gemini:"Google",kimi:"Moonshot",glm:"Z.ai",deepseek:"DeepSeek",qwen:"Qwen",grok:"xAI",mistral:"Mistral",minimax:"MiniMax",llama:"Meta"};function t1(e){return v2[o1(e.provider,e.label)]??null}function h1({model:e,format:t,id:n="gc-api-call",unsupported:c}){const d=k1(),[l,o]=f.useState("curl");if(!t)return s.jsx("p",{className:"gc-fineprint",children:c??"The gateway does not serve this model through its API."});const i=b1(d,e,t),h=i.find(g=>g.id===l)??i[0];return s.jsxs("div",{className:"gc-stack gc-stack--tight",children:[s.jsx(Z1,{id:n,label:"Request examples",value:h.id,onChange:o,className:"gc-connect-tabs",tabs:i.map(g=>({id:g.id,label:g.label}))}),s.jsx(U1,{tabsId:n,tab:h.id,children:s.jsx(l1,{code:h.code,label:h.label})}),s.jsxs("p",{className:"gc-fineprint",children:["Set ",s.jsx("code",{children:L1})," to one of your API keys first. ",s.jsx(V,{to:"keys",children:"API keys"})]})]})}function i1({label:e,values:t,options:n,onChange:c,width:d=240}){const l=new Set(t),o=i=>c(l.has(i)?t.filter(h=>h!==i):[...t,i]);return s.jsx(y1,{label:`Filter by ${e.toLowerCase()}`,multiple:!0,align:"start",width:d,triggerStyle:"plain",className:"as-button as-button--outline as-button--sm gc-filter-menu",trigger:s.jsxs(s.Fragment,{children:[s.jsx("span",{children:e}),t.length>0&&s.jsx("span",{className:"gc-filter-menu__count",children:t.length}),s.jsx(v.down,{size:14})]}),items:[...n.map(i=>({label:i.label,checked:l.has(i.value),...i.icon?{icon:i.icon}:{},...i.section?{section:i.section}:{},onSelect:()=>o(i.value)})),t.length>0&&{label:"Clear",section:" ",onSelect:()=>c([])}]})}const H={search:"",types:[],tags:[],families:[],free:!1,tee:!1},F={...W,router:"Router"},w2=["text","image","video","decision","router"];function M2(e,t){return[...e.map(n=>({kind:"model",key:n.id,model:n})),...t.map(n=>({kind:"router",key:n.id,router:n}))]}function S(e){return e.kind==="router"?"router":e.model.type}function y(e){return e.kind==="router"?e.router.name:e.model.name}function u1(e){return e.kind==="router"?[]:e.model.tags}function k2(e){return e.kind==="router"?e.router.free:e.model.free}function b2(e){return e.kind==="model"&&e.model.teeSellers>0}function Z(e){var t;return e.kind==="router"?null:{provider:((t=e.model.offers[0])==null?void 0:t.provider)??"",label:`${e.model.name} ${e.model.id}`}}function L2(e){if(e.kind==="router"){const{router:n}=e;return[n.name,n.id,n.serviceId,n.provider,n.sellerName??"",n.protocol,"router routing"].join(" ").toLowerCase()}const{model:t}=e;return[t.id,t.name,...t.aliases,...t.tags,...t.offers.map(n=>n.provider),F[t.type]].join(" ").toLowerCase()}function y2(e,t){const n=new Set(e.map(S)),c=new Set(e.flatMap(u1)),d=new Set(e.flatMap(l=>{const o=Z(l),i=o?t(o):null;return i?[i]:[]}));return{types:w2.filter(l=>n.has(l)),tags:[...c].sort((l,o)=>l.localeCompare(o)),families:[...d].sort((l,o)=>l.localeCompare(o))}}function I2(e,t,n){const c=t.search.trim().toLowerCase(),d=new Set(t.types),l=new Set(t.families);return e.filter(o=>{if(d.size>0&&!d.has(S(o))||t.free&&!k2(o)||t.tee&&!b2(o))return!1;if(t.tags.length>0){const i=new Set(u1(o));if(!t.tags.every(h=>i.has(h)))return!1}if(l.size>0){const i=Z(o),h=i?n(i):null;if(!h||!l.has(h))return!1}return!c||L2(o).includes(c)})}function B2(e){return!!(e.search.trim()||e.types.length||e.tags.length||e.families.length||e.free||e.tee)}function S2(e,t){return t.flatMap(n=>{const c=n.toLowerCase(),d=e.find(l=>l.key.toLowerCase()===c)??e.find(l=>l.kind==="model"&&l.model.aliases.some(o=>o.toLowerCase()===c));return d?[d]:[]})}function n1(e){return e.kind==="router"?1:e.model.sellers}function E2(e){var t;return e.kind==="router"?e.router.priceUsdPerRequest:((t=e.model.inputUsdPerMillion)==null?void 0:t.min)??null}const g1="antseed-console-models:filter",z="Favorites";function C1(e){return e===null?"—":String(Math.round(e))}function m1(e){return e===null?"—":Q1(e)}function A1(e){return e.fullTeeSellers>0?"end-to-end":e.offers.some(t=>t.teeScope==="seller-node")?"seller-node":null}function I(e){return e.displayName??E(e.peerId,8,4)}function x1(e){return e.sellerName??E(e.peerId,8,4)}function N2(e){return e.priceUsdPerRequest===null?"No price advertised":e.free?"Free":`${r1(e.priceUsdPerRequest)} per ranking`}function P2(){const e=e2(g1,{});return{...H,...e,search:""}}function T2({entry:e}){const t=Z(e);return s.jsx("span",{className:"gc-model-name__mark","aria-hidden":"true",children:t?s.jsx(d1,{name:t.provider,hints:[t.label],size:18}):s.jsx(v.routing,{size:16})})}function D2({entry:e}){if(e.kind==="router")return s.jsxs("div",{className:"gc-badges",children:[s.jsx(m,{children:"Router"}),e.router.free&&s.jsx(m,{tone:"success",children:"Free"})]});const{model:t}=e;return s.jsxs("div",{className:"gc-badges",children:[t.free&&s.jsx(m,{tone:"success",children:"Free"}),s.jsx(Y,{tee:t.teeSellers>0,scope:A1(t)}),t.tags.slice(0,3).map(n=>s.jsx(m,{children:n},n))]})}function a1({id:e,name:t,starred:n,onToggle:c}){return s.jsx(V1,{size:"sm",className:"gc-star",label:n?`Unstar ${t}`:`Star ${t}`,"aria-pressed":n,onClick:d=>{d.stopPropagation(),c(e,!n)},children:n?s.jsx(v.starFilled,{size:15}):s.jsx(v.star,{size:15})})}function Z2(){const e=I1(),t=B1(e.rest),n=S1(),c=E1(),d=N1(),l=P1(),[o,i]=f.useState(P2),h=T1();f.useEffect(()=>{$1(g1,{...o,search:""})},[o]);const g=(r,j)=>i(A=>({...A,[r]:j})),x=f.useMemo(()=>M2(n.data??[],c.data??[]),[n.data,c.data]),N=f.useMemo(()=>y2(x,t1),[x]),U=f.useMemo(()=>new Set((d.data??[]).map(r=>r.toLowerCase())),[d.data]),P=r=>U.has(r.key.toLowerCase()),T=(r,j)=>l.mutate({id:r,favorite:j}),u=t?(c.data??[]).find(r=>r.id.toLowerCase()===t.toLowerCase())??null:null,C=t&&!u?K1(n.data,t):null,w=(u==null?void 0:u.id)??(C==null?void 0:C.id)??null,p1=t===null?null:{eyebrow:u?"Router":"Model",title:(u==null?void 0:u.name)??(C==null?void 0:C.name)??t,actions:w?s.jsx(a1,{id:w,name:(u==null?void 0:u.name)??(C==null?void 0:C.name)??w,starred:U.has(w.toLowerCase()),onToggle:T}):void 0,body:n.isLoading||c.isLoading?s.jsx(D1,{rows:6}):u?s.jsx(O2,{router:u},u.id):C?s.jsx(z2,{model:C},C.id):s.jsx(_,{icon:s.jsx(v.models,{size:18}),title:"Model not found",body:`No provider on the network offers ${t} right now.`})},D=B2(o),K=I2(x,o,t1),M=D?[]:S2(x,d.data??[]),j1=M.length?K.filter(r=>!M.includes(r)):K,f1=[...N.types.map(r=>({value:`type:${r}`,label:F[r],section:"Type"})),{value:"free",label:"Free",section:"Price and privacy"},{value:"tee",label:"TEE",section:"Price and privacy"},...N.tags.map(r=>({value:`tag:${r}`,label:r,section:"Tags"}))],v1=[...o.types.map(r=>`type:${r}`),...o.free?["free"]:[],...o.tee?["tee"]:[],...o.tags.map(r=>`tag:${r}`)],w1=r=>i(j=>({...j,types:r.filter(A=>A.startsWith("type:")).map(A=>A.slice(5)),tags:r.filter(A=>A.startsWith("tag:")).map(A=>A.slice(4)),free:r.includes("free"),tee:r.includes("tee")})),J=N.families.map(r=>({value:r,label:r,icon:s.jsx(d1,{name:r,hints:[r],size:16})})),q=(r,j,A)=>s.jsx(s2,{label:r,rows:j,rowKey:a=>a.key,selectedKey:w,onRowClick:a=>e1(Q("models",a.key)),rowLabel:y,actions:a=>[{label:a.kind==="router"?"Copy router model id":"Copy model id",onSelect:()=>void h(a.key)},{label:P(a)?"Unstar":"Star",onSelect:()=>T(a.key,!P(a))}],initialSort:r===z?void 0:{key:"sellers",direction:"desc"},empty:A,columns:[{key:"model",header:"Model",sortValue:a=>y(a).toLowerCase(),render:a=>s.jsxs("div",{className:"gc-model-name",children:[s.jsx(T2,{entry:a}),s.jsxs("div",{className:"gc-cell-lines",children:[s.jsx("div",{className:"gc-strong gc-ellipsis",title:a.key,children:y(a)}),a.kind==="router"?s.jsxs("div",{className:"gc-muted gc-ellipsis",children:["by ",x1(a.router)," · ",s.jsx(p,{children:a.router.serviceId})]}):a.model.name!==a.model.id&&s.jsx("div",{className:"gc-muted gc-ellipsis",children:s.jsx(p,{children:a.model.id})}),s.jsx(D2,{entry:a})]})]}),after:a=>s.jsxs(s.Fragment,{children:[s.jsx(a1,{id:a.key,name:y(a),starred:P(a),onToggle:T}),s.jsx(R1,{value:a.key,label:`Copy model id ${a.key}`})]})},{key:"type",header:"Type",secondary:!0,sortValue:S,render:a=>s.jsx("span",{className:"gc-muted",children:F[S(a)]})},{key:"sellers",header:"Providers",align:"right",sortValue:n1,render:a=>W1(n1(a))},{key:"input",header:"Input $/M",align:"right",sortValue:E2,render:a=>a.kind==="router"?s.jsx("span",{className:"gc-muted",children:a.router.free?"Free":a.router.priceUsdPerRequest===null?"—":`${r1(a.router.priceUsdPerRequest)}/ranking`}):B(a.model.inputUsdPerMillion)},{key:"output",header:"Output $/M",align:"right",secondary:!0,sortValue:a=>{var X;return a.kind==="model"?((X=a.model.outputUsdPerMillion)==null?void 0:X.min)??null:null},render:a=>a.kind==="model"?B(a.model.outputUsdPerMillion):"—"},{key:"context",header:"Context",align:"right",secondary:!0,optional:!0,sortValue:a=>a.kind==="model"?a.model.contextLength:null,render:a=>a.kind==="model"?m1(a.model.contextLength):"—"}]}),M1=s.jsxs("div",{className:"gc-stack",children:[M.length>0&&s.jsx($,{flush:!0,title:z,children:q(z,M,null)}),s.jsx($,{flush:!0,title:M.length>0?"All models":void 0,children:s.jsx(z1,{query:n,rows:8,children:()=>q("Models",j1,s.jsx(_,{icon:s.jsx(v.models,{size:18}),title:x.length?"No models match these filters":"No models found yet",body:x.length?void 0:"The buyer is still discovering the network. Check back in a minute.",action:D?s.jsx(G,{variant:"outline",size:"sm",onClick:()=>i(H),children:"Clear filters"}):void 0}))})})]});return s.jsxs("div",{className:"gc-page",children:[s.jsx(G1,{title:"Models",description:"Every model and router on the network. Star the ones you use; open one to see its providers, copy its id and get a ready-to-run API call."}),s.jsxs("div",{className:"gc-toolbar",children:[s.jsx(O1,{size:"sm",type:"search","aria-label":"Search models or routers",placeholder:"Search models or routers",value:o.search,onChange:r=>g("search",r.target.value)}),s.jsx(i1,{label:"Type",values:v1,options:f1,onChange:w1}),J.length>0&&s.jsx(i1,{label:"Family",values:o.families,options:J,onChange:r=>g("families",r)}),D&&s.jsx(G,{variant:"ghost",size:"sm",onClick:()=>i(H),children:"Clear filters"})]}),s.jsx(J1,{list:M1,panel:p1,onClose:()=>e1("models"),closeLabel:"Close model"})]})}function k(e){return`${e.peerId}:${e.serviceId}`}function z2({model:e}){const[t,n]=f.useState(""),c=e.offers.find(i=>k(i)===t)??null,d=c?s1(c.peerId,c.serviceId):e.id,l=Y1(e.type,c),o=e.offers.some(i=>i.usdPerImage!==null);return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"gc-stack gc-stack--tight",children:[s.jsxs("span",{className:"gc-seller__meta",children:[s.jsxs("span",{className:"gc-peer-id",children:[s.jsx(p,{title:e.id,children:e.id}),s.jsx(O,{iconOnly:!0,value:e.id,label:"Copy model id"})]}),s.jsx(m,{children:W[e.type]}),e.free&&s.jsx(m,{tone:"success",children:"Free"}),s.jsx(Y,{tee:e.teeSellers>0,scope:A1(e)})]}),s.jsx(R,{items:[["Context",m1(e.contextLength)],["Capabilities",e.capabilities.length?s.jsx("span",{className:"gc-badges",children:e.capabilities.map(i=>s.jsx(m,{children:q1[i]},i))}):"—"],["Tags",e.tags.length?s.jsx("span",{className:"gc-badges",children:e.tags.map(i=>s.jsx(m,{children:i},i))}):"—"],["Aliases",e.aliases.length?s.jsx(p,{children:e.aliases.join(", ")}):"—"],...o?[]:[["Input $/M",B(e.inputUsdPerMillion)],["Output $/M",B(e.outputUsdPerMillion)]]]})]}),s.jsx(b,{title:`Providers (${e.offers.length})`,children:e.offers.length===0?s.jsx("p",{className:"gc-fineprint",children:"No provider offers this model right now."}):s.jsx("ul",{className:"gc-panel-rows","aria-label":"Providers offering this model",children:e.offers.map(i=>{var x;const h=s1(i.peerId,i.serviceId),g=t===k(i);return s.jsx(X1,{selected:g,title:s.jsx(V,{to:Q("providers",i.peerId),children:I(i)}),meta:s.jsxs(s.Fragment,{children:[s.jsx("span",{children:_1(i)}),s.jsxs("span",{children:["Trust ",C1(i.trustScore)]}),i.firstTokenMsP50!==null&&s.jsxs("span",{children:[H1(i.firstTokenMsP50)," first token"]}),i.tokensPerSecondP50!==null&&s.jsx("span",{children:F1(i.tokensPerSecondP50)}),i.serviceId!==e.id&&s.jsx(p,{children:i.serviceId})]}),badges:(((x=i.verificationLinks)==null?void 0:x.length)||i.tee||i.free)&&s.jsxs("div",{className:"gc-badges",children:[s.jsx(c1,{links:i.verificationLinks}),s.jsx(Y,{tee:i.tee,scope:i.teeScope}),i.free&&s.jsx(m,{tone:"success",children:"Free"})]}),actions:s.jsxs(s.Fragment,{children:[s.jsx(O,{iconOnly:!0,value:h,label:`Copy ${I(i)}'s model id (peer@model)`}),s.jsx(G,{size:"sm",variant:g?"outline":"ghost","aria-pressed":g,title:"Use this provider in the API call below",onClick:()=>n(g?"":k(i)),children:g?"Pinned":"Pin"})]})},k(i))})})}),s.jsxs(b,{title:"API call",actions:e.offers.length>0&&s.jsx(t2,{size:"sm","aria-label":"Route the call",value:t,onChange:n,options:[{value:"",label:"Best provider (automatic)"},...e.offers.map(i=>({value:k(i),label:I(i)}))]}),children:[s.jsx("p",{className:"gc-fineprint",children:c?s.jsxs(s.Fragment,{children:["Pinned to ",I(c)," with ",s.jsx("code",{children:E(d,10,12)}),"."]}):s.jsxs(s.Fragment,{children:["The gateway picks the best provider for ",s.jsx("code",{children:e.id})," under your routing policy."]})}),s.jsx(h1,{id:"gc-model-call",model:d,format:l,unsupported:`${W[e.type]} models are not served through the gateway's /v1 API.`})]})]})}function G2(e){return e.default===void 0?"—":String(e.default)}function O2({router:e}){var d;const t=((d=e.models)==null?void 0:d.includes("*"))??!1,n=(e.models??[]).filter(l=>l!=="*"),c=e.options.some(l=>l.key==="cost_quality_tradeoff")?JSON.stringify({model:e.id,routing:{cost_quality_tradeoff:3},messages:[{role:"user",content:"Hello"}]},null,2):null;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"gc-stack gc-stack--tight",children:[s.jsxs("span",{className:"gc-seller__meta",children:[s.jsxs("span",{className:"gc-peer-id",children:[s.jsx(p,{title:e.id,children:E(e.id,10,16)}),s.jsx(O,{iconOnly:!0,value:e.id,label:"Copy router model id"})]}),s.jsx(m,{children:"Router"}),e.free&&s.jsx(m,{tone:"success",children:"Free"})]}),s.jsxs("p",{className:"gc-fineprint",children:["Send ",s.jsx("code",{children:e.id})," as the model: the router ranks the models your key's routing policy allows and the gateway sends the request to its pick, falling back to the next one if a seller refuses. Logs show the router and the model it picked."]}),s.jsx(R,{items:[["Offered by",s.jsx(V,{to:Q("providers",e.peerId),children:x1(e)},"s")],["Service",s.jsx(p,{children:e.serviceId},"v")],["Protocol",s.jsx(p,{children:e.protocol||"—"},"p")],["Price",N2(e)],["Trust",C1(e.trustScore)],...e.verificationLinks.length?[["Verified",s.jsx(c1,{links:e.verificationLinks},"l")]]:[]]})]}),e.options.length>0&&s.jsxs(b,{title:"Settings",children:[s.jsx(R,{items:e.options.map(l=>[l.label,s.jsxs("div",{className:"gc-stack gc-stack--tight",children:[s.jsxs("span",{children:[s.jsx(p,{children:l.key})," · default ",G2(l),"minimum"in l&&l.minimum!==void 0&&"maximum"in l&&l.maximum!==void 0?` · ${l.minimum}–${l.maximum}`:""]}),l.description&&s.jsx("span",{className:"gc-muted",children:l.description})]},l.key)])}),c&&s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"gc-fineprint",children:["Set them per request in a ",s.jsx("code",{children:"routing"})," object; they never reach the seller."]}),s.jsx(l1,{code:c,label:"Request body"})]})]}),s.jsx(b,{title:"Models it ranks",children:e.models===null?s.jsx("p",{className:"gc-fineprint",children:"This router did not list its models."}):t?s.jsx("p",{className:"gc-fineprint",children:"Any model: it ranks every model your key allows."}):n.length===0?s.jsx("p",{className:"gc-fineprint",children:"None listed."}):s.jsx("span",{className:"gc-badges",children:n.map(l=>s.jsx(m,{children:l},l))})}),s.jsx(b,{title:"API call",children:s.jsx(h1,{id:"gc-router-call",model:e.id,format:"openai-chat-completions"})})]})}export{Z2 as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as y,a3 as G,a4 as J,a5 as K,a6 as B,u as X,a7 as Z,j as e,a8 as ee,a9 as se,aa as le,ab as A,B as j,ac as ie,ad as F,T as z,D as ne,ae as E,I as ae,af as te,ag as re,ah as ce,ai as oe,aj as de,ak as me,al as he}from"./index-DIcymBxc.js";import{P as k,C as ue}from"./PeerPicker-BJfjL7Dy.js";import{S}from"./SelectField-BWyF8Ku8.js";import{S as v}from"./Segmented-BelxPFkk.js";import{S as T,D as R}from"./Switch-BwBYBnSS.js";function pe({draft:l,parent:d,above:t,peers:c,lists:m}){const n=y.useMemo(()=>{if(!c||c.length===0)return null;let h;try{h=te(l,m)}catch{return null}return{matched:re(B(d,h),c,m).length,total:c.length}},[l,d,c,m]);return n?n.matched===0?e.jsxs(ce,{tone:"warning",title:"No seller matches this policy",children:["With ",t?`${t} and `:"","these settings, none of the ",n.total," sellers this gateway sees can serve a request. Requests will fail until you loosen it."]}):e.jsxs("p",{className:"gc-muted","aria-live":"polite",children:["Matches ",n.matched," of ",n.total," sellers",t?` after ${t}`:"","."]}):null}function be({value:l,onChange:d,peers:t,lists:c,showTemplates:m=!0,parent:n,disabled:h}){const[x,b]=y.useState(""),[o,p]=y.useState(null),a=(s,r)=>d({...l,[s]:r}),N=G(t),I=c.map(s=>({value:s.id,label:`${s.name} (${s.peerIds.length})`})),g=J(K().data),i=y.useMemo(()=>g||n?B(g,n):null,[g,n]),D=g&&n?"the buyer config and the levels above":g?"the buyer config":n?"the levels above":"",w=s=>(g==null?void 0:g[s])!==void 0&&g[s]===(i==null?void 0:i[s])?"The buyer config":"The levels above",{viewer:W}=X(),Y=Z("settings",W)?e.jsx("a",{className:"gc-link",href:se("settings?tab=buyer"),onClick:ee("settings?tab=buyer"),children:"Change"}):null,O=s=>w(s)==="The buyer config"?Y:null,H=le(t)||l.minReputation!==""||(i==null?void 0:i.minReputation)!==void 0;function q(s){var $;let r;if(s==="own"){const C=c.find(Q=>Q.id===x);if(!C)return;r={allowMode:"only",allowedPeerIds:[],allowedListIds:[C.id]}}else r=oe(de(s));const u=me(l,r),f=(($=A.find(C=>C.id===s))==null?void 0:$.label)??s;u.length>0?p({label:f,template:r,conflicts:u}):d(E(l,r))}function P(s,r){a("routes",l.routes.map((u,f)=>f===s?r:u))}const M=[l.maxInputUsdPerMillion,l.maxOutputUsdPerMillion,l.maxCachedInputUsdPerMillion,l.maxImageUsdPerImage].filter(s=>s.trim()!=="").length,_=(s,r)=>e.jsx(z,{size:"sm",className:"gc-num",label:r,inputMode:"decimal",value:l[s],placeholder:(i==null?void 0:i[s])!==void 0?`≤ ${he(i[s])} above`:"No cap",onChange:u=>a(s,u.target.value)}),L=e.jsxs(e.Fragment,{children:[e.jsx(pe,{draft:l,parent:i,above:D,peers:t,lists:c}),m&&!h&&e.jsxs("div",{className:"gc-policy__templates",children:[e.jsx("span",{className:"gc-muted",children:"Start from"}),A.filter(s=>s.id!=="own").map(s=>e.jsx(j,{size:"sm",variant:"outline",title:s.description,onClick:()=>q(s.id),children:s.label},s.id)),c.length>0&&e.jsxs("span",{className:"gc-inline",children:[e.jsx(S,{size:"sm","aria-label":"Peer list for Own peers only",value:x,onChange:b,options:[{value:"",label:"Own peer list…"},...I]}),e.jsx(j,{size:"sm",variant:"outline",disabled:!x,onClick:()=>q("own"),children:"Use"})]}),e.jsx(j,{size:"sm",variant:"link",className:"gc-policy__clear",onClick:()=>d(ie()),children:"Clear policy"})]}),e.jsxs("div",{className:"gc-policy__cols",children:[e.jsxs("section",{className:"gc-policy__section",children:[e.jsx("h3",{children:"Sellers"}),e.jsx(v,{label:"Which sellers may serve",value:l.allowMode,onChange:s=>a("allowMode",s),options:[{value:"any",label:"Any seller"},{value:"only",label:"Only these"}]}),l.allowMode==="only"&&e.jsxs(e.Fragment,{children:[e.jsx(k,{label:"Allowed sellers",value:l.allowedPeerIds,onChange:s=>a("allowedPeerIds",s),peers:t}),e.jsx(V,{label:"Allowed peer lists",lists:c,value:l.allowedListIds,onChange:s=>a("allowedListIds",s)}),l.allowedPeerIds.length===0&&l.allowedListIds.length===0&&e.jsx("p",{className:"gc-warn",children:"An empty allow list means no seller can serve."})]}),e.jsx(k,{label:"Blocked sellers",value:l.blockedPeerIds,onChange:s=>a("blockedPeerIds",s),peers:t}),e.jsx(V,{label:"Blocked peer lists",lists:c,value:l.blockedListIds,onChange:s=>a("blockedListIds",s)})]}),e.jsxs("section",{className:"gc-policy__section",children:[e.jsx("h3",{children:"Quality and ranking"}),e.jsx(U,{label:"Minimum trust score",value:l.minTrustScore,onChange:s=>a("minTrustScore",s),floor:i==null?void 0:i.minTrustScore,floorSource:w("minTrustScore"),floorAction:O("minTrustScore")}),e.jsxs("div",{className:"gc-policy__switches",children:[e.jsx(T,{checked:l.requireTee||!!(i!=null&&i.requireTee),disabled:!!(i!=null&&i.requireTee),onChange:s=>a("requireTee",s),label:"TEE sellers only"}),e.jsx(T,{checked:l.requireVerified||!!(i!=null&&i.requireVerified),disabled:!!(i!=null&&i.requireVerified),onChange:s=>a("requireVerified",s),label:"Verified sellers only"})]}),((i==null?void 0:i.requireTee)||(i==null?void 0:i.requireVerified))&&e.jsxs("span",{className:"as-field__hint",children:[i.requireTee&&i.requireVerified?"TEE and verified sellers are":i.requireTee?"TEE sellers are":"Verified sellers are"," already required above."]}),e.jsxs("div",{className:"gc-policy__pair",children:[e.jsx(S,{size:"sm",label:"Sort by",value:l.sort,onChange:s=>a("sort",s),options:[{value:"",label:"Inherit"},...Object.keys(F).map(s=>({value:s,label:F[s]}))]}),e.jsx(S,{size:"sm",label:"Free sellers first",value:l.preferFreePeers,onChange:s=>a("preferFreePeers",s),options:[{value:"inherit",label:"Inherit"},{value:"yes",label:"Yes"},{value:"no",label:"No"}]})]}),e.jsx(v,{label:"Which models may be used",value:l.modelsMode,onChange:s=>a("modelsMode",s),options:[{value:"any",label:"Any model"},{value:"only",label:"Only these models"}]}),l.modelsMode==="only"&&e.jsx(ue,{label:"Allowed models",value:l.allowedModels,onChange:s=>a("allowedModels",s),suggestions:N,placeholder:"Model id"})]})]}),e.jsxs("div",{className:"gc-policy__advanced",children:[e.jsx(R,{title:"Price caps",summary:M?`${M} set`:"None",defaultOpen:h&&M>0,children:e.jsxs("div",{className:"gc-policy__caps",children:[_("maxInputUsdPerMillion","Input $/M"),_("maxOutputUsdPerMillion","Output $/M"),_("maxCachedInputUsdPerMillion","Cached input $/M"),_("maxImageUsdPerImage","$ per image")]})}),e.jsxs(R,{title:"Fallback chains",summary:l.routes.length?`${l.routes.length} chain${l.routes.length===1?"":"s"}`:"None",defaultOpen:h&&l.routes.length>0,children:[e.jsx("p",{className:"gc-fineprint",children:"Sellers to try first for a model, in order. After the chain, normal ranking continues unless the chain is strict."}),l.routes.map((s,r)=>e.jsxs("div",{className:"gc-route",children:[e.jsxs("div",{className:"gc-inline",children:[e.jsx(z,{size:"sm",label:"Model",list:"gc-policy-models",value:s.model,placeholder:"Model id",onChange:u=>P(r,{...s,model:u.target.value})}),e.jsx(T,{checked:s.strict,onChange:u=>P(r,{...s,strict:u}),label:"Strict"}),e.jsx(j,{variant:"ghost",size:"sm",onClick:()=>a("routes",l.routes.filter((u,f)=>f!==r)),children:"Remove"})]}),e.jsx(k,{label:"Sellers, in order",ordered:!0,value:s.peerIds,onChange:u=>P(r,{...s,peerIds:u}),peers:t})]},r)),e.jsx("datalist",{id:"gc-policy-models",children:N.map(s=>e.jsx("option",{value:s},s))}),e.jsx("div",{children:e.jsx(j,{variant:"outline",size:"sm",onClick:()=>a("routes",[...l.routes,{model:"",peerIds:[],strict:!1}]),children:"Add fallback chain"})})]}),H&&e.jsx(R,{title:"Reputation",summary:l.minReputation!==""?`≥ ${l.minReputation}`:(i==null?void 0:i.minReputation)!==void 0?`Inherit (≥ ${i.minReputation})`:"Inherit",defaultOpen:h&&l.minReputation!=="",children:e.jsx(U,{label:"Minimum reputation",value:l.minReputation,onChange:s=>a("minReputation",s),floor:i==null?void 0:i.minReputation,floorSource:w("minReputation"),floorAction:O("minReputation")})})]}),e.jsx(ne,{isOpen:o!==null,tone:"primary",title:`Apply “${(o==null?void 0:o.label)??""}”?`,confirmLabel:"Replace and apply",body:e.jsxs(e.Fragment,{children:["This template changes settings you already set: ",e.jsx("strong",{children:o==null?void 0:o.conflicts.join(", ")}),". Your other settings stay."]}),onClose:()=>p(null),onConfirm:()=>{o&&d(E(l,o.template)),p(null)}})]});return h?e.jsx("fieldset",{className:"gc-policy gc-policy--readonly",disabled:!0,children:L}):e.jsx("div",{className:"gc-policy",children:L})}function U({label:l,value:d,onChange:t,clearable:c=!0,hint:m,floor:n,floorSource:h="The levels above",floorAction:x}){const b=y.useId(),o=d!=="",p=n!==void 0&&n>0,a=p&&o&&Number(d)<=n,N=a?String(n):o?d:p?`${n} inherited`:"Inherit";return e.jsxs("div",{className:"gc-slider",children:[e.jsxs("div",{className:"gc-slider__head",children:[e.jsx("span",{className:"as-field__label",id:b,children:l}),e.jsx("span",{className:o?"gc-slider__value":"gc-slider__value gc-slider__value--inherit",children:N})]}),e.jsxs("div",{className:"gc-inline",children:[e.jsx("input",{type:"range",min:0,max:100,step:5,value:o?Math.max(Number(d),p?n:0):p?n:0,"aria-labelledby":b,onChange:I=>t(String(Math.max(Number(I.target.value),p?n:0)))}),c&&o&&e.jsx(j,{variant:"ghost",size:"sm",onClick:()=>t(""),children:"Clear"})]}),p&&(o&&!a?e.jsxs("span",{className:"as-field__hint",children:[h," requires ≥ ",n,". Only a higher value narrows it."]}):e.jsxs("span",{className:"as-field__hint gc-override",children:[e.jsx(ae.lock,{size:12})," Locked at ",n," by ",h.replace(/^The /,"the "),".",x?e.jsxs(e.Fragment,{children:[" ",x]}):null]})),m&&e.jsx("span",{className:"as-field__hint",children:m})]})}function V({label:l,lists:d,value:t,onChange:c}){return d.length===0?null:e.jsxs("fieldset",{className:"gc-checks",children:[e.jsx("legend",{className:"as-field__label",children:l}),d.map(m=>e.jsxs("label",{className:"gc-check",children:[e.jsx("input",{type:"checkbox",checked:t.includes(m.id),onChange:n=>c(n.target.checked?[...t,m.id]:t.filter(h=>h!==m.id))}),m.name," ",e.jsxs("span",{className:"gc-muted",children:["(",m.peerIds.length,")"]})]},m.id))]})}export{be as P,U as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{bj as m,r as d,j as e,D as p,bu as x,bv as v,bw as b,v as j,bn as f,bm as w,af as y,b as C,B as h,C as k}from"./index-DIcymBxc.js";import{P}from"./PolicyEditor-BpoV34ra.js";function B(){const l=m(),[s,n]=d.useState(null),a=d.useRef(null),r=t=>new Promise(u=>{a.current=u,n(t)}),o=t=>{var u;n(null),(u=a.current)==null||u.call(a,t),a.current=null},i=(t,u)=>x(t.some(g=>v(g,l.data??null)),u,r),c=(s==null?void 0:s.kind)==="narrowed"?e.jsx(p,{isOpen:!0,tone:"primary",title:"The levels above allow less",confirmLabel:"Save anyway",cancelLabel:"Go back",onClose:()=>o(!1),onConfirm:()=>o(!0),body:e.jsxs("div",{className:"gc-stack gc-stack--tight",children:[e.jsx("span",{children:"Part of this change has no effect, because a workspace, member or admin restriction above it is tighter. Saving stores it as you entered it; only what the levels above allow applies."}),s.lines.length>0&&e.jsx("ul",{className:"gc-list",children:s.lines.map(t=>e.jsx("li",{children:t},t))})]})}):e.jsx(p,{isOpen:(s==null?void 0:s.kind)==="empty",tone:"danger",title:"Save an empty allow list?",confirmLabel:"Save anyway",cancelLabel:"Go back",onClose:()=>o(!1),onConfirm:()=>o(!0),body:e.jsxs(e.Fragment,{children:["With this allow list ",e.jsx("strong",{children:"no seller can serve"})," requests here (it names no seller, or none the levels above allow), so they fail until you change it. To let any seller serve, choose “Any seller” instead."]})});return{save:i,dialog:c}}function S({policy:l,invalid:s,empty:n="Inherits everything"}){if(s)return e.jsx("span",{className:"gc-warn",children:"Has an invalid setting; open it to fix."});const a=b(l);return a.length===0?e.jsx("span",{className:"gc-muted",children:n}):e.jsx("span",{className:"gc-chiprow",children:a.map(r=>e.jsx(j,{children:r},r))})}function D(l){const[s,n]=d.useState(()=>f(l)),a=m();return{draft:s,setDraft:n,reset:r=>n(f(r)),build:()=>w(y(s,a.data??null))}}function N(l,s){try{return{policy:y(l,s),error:null}}catch(n){return{policy:null,error:n instanceof Error?n.message:String(n)}}}function O({draft:l,setDraft:s,title:n="Routing policy"}){const a=C(),r=m(),[o,i]=d.useState(null),c=N(l,r.data??null),t=()=>{o&&s(o),i(null)};return e.jsxs("div",{className:"gc-policy-row",children:[e.jsxs("div",{className:"gc-policy-row__text",children:[e.jsx("span",{className:"as-field__label",children:n}),e.jsx(S,{policy:c.policy,invalid:c.error!==null})]}),e.jsx(h,{size:"sm",variant:"outline",onClick:()=>i(l),children:"Edit"}),e.jsx(k,{isOpen:o!==null,onClose:()=>i(null),size:"xl",title:n,subtitle:"Blank settings inherit from the level above, which this can only narrow. Saved with the form.",footer:e.jsxs(e.Fragment,{children:[c.error&&e.jsx("span",{className:"gc-warn gc-footer-note",children:c.error}),e.jsx(h,{variant:"ghost",onClick:t,children:"Cancel"}),e.jsx(h,{onClick:()=>i(null),children:"Done"})]}),children:e.jsx(P,{value:l,onChange:s,peers:a.data,lists:r.data??[]})})]})}export{O as P,B as a,S as b,N as d,D as u};
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
import{u as A,i as J,bf as B,r as n,t as E,j as e,P as $,B as y,I as k,l as L,Q as R,M as Q,aN as U,v as C,A as V,E as W,n as F,C as G,D as H,b as K,T as j,a3 as _,o as X,q as O,f as v}from"./index-DIcymBxc.js";import{u as Y,a as Z,P as ee}from"./PolicyField-CfRYcr_J.js";import{D as se}from"./DataTable-BTwj5g1m.js";import{S as re}from"./SelectField-BWyF8Ku8.js";import{T as N}from"./TextAreaField-B6jcl4RR.js";import"./PolicyEditor-BpoV34ra.js";import"./PeerPicker-BJfjL7Dy.js";import"./Segmented-BelxPFkk.js";import"./roving-DkptacxO.js";import"./Switch-BwBYBnSS.js";function D(s){return s.toLowerCase().trim().replace(/[^a-z0-9]+/g,"-").replace(/^-+|-+$/g,"").slice(0,48)}function te(s){return/^[a-z0-9][a-z0-9-]{0,47}$/.test(s)}function ae(s){if(!s.trim())return{};let a;try{a=JSON.parse(s)}catch{throw new Error("Parameters must be valid JSON.")}if(!a||typeof a!="object"||Array.isArray(a))throw new Error('Parameters must be a JSON object, like {"temperature": 0.2}.');return a}function oe({initial:s,prefill:a,onDone:m}){const{workspace:p,viewer:c}=A(),u=K(),[o,g]=n.useState((s==null?void 0:s.name)??(a==null?void 0:a.name)??""),[l,d]=n.useState((s==null?void 0:s.slug)??(a?D(a.name):"")),[t,q]=n.useState(!!s),[h,I]=n.useState((s==null?void 0:s.model)??(a==null?void 0:a.model)??""),[b,M]=n.useState(s?s.workspaceId??"":p.id),[S,T]=n.useState((s==null?void 0:s.systemPrompt)??""),[w,z]=n.useState(s&&Object.keys(s.params).length?JSON.stringify(s.params,null,2):""),x=Y(s==null?void 0:s.routingPolicy),P=Z(),i=E({mutationFn:()=>{if(!te(l))throw new Error("Slug must be lowercase letters, numbers and dashes.");const r={name:o.trim(),slug:l,model:h.trim(),workspaceId:b||null,systemPrompt:S.trim()||null,params:ae(w),routingPolicy:x.build()};return P.save([r.routingPolicy],f=>s?v.presets.update(s.id,r,f):v.presets.create(r,f))},onSuccess:r=>m(r),invalidate:[O.group("presets")],toast:"Preset saved"});return e.jsxs("form",{className:"gc-stack",onSubmit:r=>{r.preventDefault(),i.mutate()},children:[e.jsxs("div",{className:"gc-grid gc-grid--2",children:[e.jsx(j,{label:"Name",required:!0,value:o,onChange:r=>{g(r.target.value),t||d(D(r.target.value))}}),e.jsx(j,{label:"Slug",required:!0,value:l,onChange:r=>{q(!0),d(r.target.value)},hint:e.jsxs(e.Fragment,{children:["Called as ",e.jsxs("code",{children:["@preset/",l||"slug"]})]})})]}),e.jsxs("div",{className:"gc-grid gc-grid--2",children:[e.jsx(j,{label:"Model",required:!0,list:"gc-preset-models",value:h,onChange:r=>I(r.target.value)}),e.jsx("datalist",{id:"gc-preset-models",children:_(u.data).map(r=>e.jsx("option",{value:r},r))}),e.jsx(re,{label:"Available in",value:b,onChange:M,options:[{value:p.id,label:`${p.name} workspace`},...F(c)?[{value:"",label:"All workspaces"}]:[]]})]}),e.jsx(N,{label:"System prompt",rows:4,value:S,onChange:r=>T(r.target.value),hint:"Added before the client's messages."}),e.jsx(N,{label:"Parameters (JSON)",rows:4,mono:!0,value:w,placeholder:`{
|
|
2
|
-
"temperature": 0.2,
|
|
3
|
-
"max_tokens": 2048
|
|
4
|
-
}`,onChange:r=>z(r.target.value),hint:"Defaults merged under the client's own parameters."}),e.jsx(ee,{draft:x.draft,setDraft:x.setDraft}),i.error?e.jsx(X,{error:i.error,title:"Could not save the preset"}):null,e.jsxs("div",{className:"gc-actions",children:[e.jsx(y,{variant:"ghost",onClick:()=>m(),children:"Cancel"}),e.jsx(y,{type:"submit",disabled:i.isPending||!o.trim()||!h.trim(),children:i.isPending?"Saving…":"Save preset"})]}),P.dialog]})}function xe(){const{workspace:s,viewer:a}=A(),m=J(a),p=B(s.id),[c,u]=n.useState(null),[o,g]=n.useState(null),l=E({mutationFn:d=>v.presets.remove(d.id),onSuccess:()=>g(null),invalidate:[O.group("presets")]});return e.jsxs("div",{className:"gc-page",children:[e.jsx($,{title:"Presets",description:e.jsxs(e.Fragment,{children:["A saved model, prompt, parameters and routing. Use one by sending ",e.jsx("code",{children:'"model": "@preset/<slug>"'}),"."]}),actions:m&&e.jsx(y,{variant:"brand",leadingIcon:e.jsx(k.plus,{size:14}),onClick:()=>u("new"),children:"New preset"})}),e.jsx(L,{flush:!0,children:e.jsx(R,{query:p,children:d=>e.jsx(se,{label:"Presets",rows:d,rowKey:t=>t.id,rowLabel:t=>t.name,actions:t=>m&&(t.workspaceId||F(a))?[{label:"Edit",onSelect:()=>u(t)},{label:"Delete",tone:"danger",onSelect:()=>g(t)}]:[],empty:e.jsx(W,{icon:e.jsx(k.presets,{size:18}),title:"No presets yet",body:"Presets let every client share one tuned setup without changing code."}),columns:[{key:"name",header:"Name",render:t=>e.jsx("span",{className:"gc-strong",children:t.name})},{key:"usage",header:"Use as model",render:t=>e.jsxs("span",{className:"gc-inline gc-inline--wrap",children:[e.jsxs(Q,{children:["@preset/",t.slug]}),e.jsx(U,{value:`@preset/${t.slug}`})]})},{key:"model",header:"Model",secondary:!0,render:t=>t.model},{key:"scope",header:"Scope",secondary:!0,render:t=>t.workspaceId?e.jsx(C,{children:"Workspace"}):e.jsx(C,{tone:"info",children:"All workspaces"})},{key:"policy",header:"Routing",secondary:!0,optional:!0,render:t=>e.jsx("span",{className:"gc-muted",children:V(t.routingPolicy)})}]})})}),e.jsx(G,{isOpen:c!==null,onClose:()=>u(null),size:"lg",title:c==="new"?"New preset":"Edit preset",children:c!==null&&e.jsx(oe,{initial:c==="new"?null:c,onDone:()=>u(null)})}),e.jsx(H,{isOpen:o!==null,busy:l.isPending,error:l.error,onClose:()=>g(null),onConfirm:()=>o&&l.mutate(o),title:"Delete this preset?",confirmLabel:"Delete preset",body:e.jsxs(e.Fragment,{children:["Requests that use ",e.jsxs("code",{children:["@preset/",o==null?void 0:o.slug]})," will fail."]})})]})}export{oe as PresetForm,xe as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{bQ as Ke,ay as pe,b5 as Ge,u as Z,a as fe,F as Qe,G as Ye,n as we,i as ye,r as p,U as He,c as be,e as Je,bR as We,bo as Ze,$ as U,bS as Xe,bT as es,f as A,aF as ss,j as s,C as X,ah as Q,o as ee,B as k,L as ve,A as ts,bj as rs,t as ke,q as xe,l as je,Q as Pe,E as W,I as V,D as ns,T as q,w as F,M as Se,aN as Ce,v as L,at as as,bO as N,aw as Ie,ax as Ne,h as $e,Z as os,bU as Ae,bV as Fe,bW as ls,bf as is,bX as cs,Y as ds,bY as us,O as ms,R as hs,bZ as gs,b as ps,a3 as fs,aa as ws,bg as ys,b_ as bs,bx as ce,bh as vs,y as de,b$ as ks,P as xs}from"./index-DIcymBxc.js";import{p as Y,P as js}from"./PeerPicker-BJfjL7Dy.js";import{S as $}from"./SelectField-BWyF8Ku8.js";import{D as Le}from"./DataTable-BTwj5g1m.js";import{V as Te,T as Me,P as De,a as Ps,p as Ss,S as Cs}from"./models-CLos5_p0.js";import{f as Is}from"./ants-B38m9Phv.js";import{PresetForm as Ns}from"./Presets-c1J4UwX0.js";import{T as $s,a as As}from"./Tabs-yVL4Cd6z.js";import{S as H}from"./Switch-BwBYBnSS.js";import"./PolicyField-CfRYcr_J.js";import"./PolicyEditor-BpoV34ra.js";import"./Segmented-BelxPFkk.js";import"./roving-DkptacxO.js";import"./TextAreaField-B6jcl4RR.js";function Ee(e,t="admin"){return t==="owner"&&Ge(e)?"ownerRoutingPolicy":"routingPolicy"}async function Oe(e,t){const r=(await e.keys.list({workspace:t.workspaceId})).find(a=>a.id===t.keyId);if(!r)throw new Error("That key no longer exists.");return r}async function Re(e,t){switch(t.kind){case"gateway":return e.network.gatewayPolicy();case"workspace-org":return(await e.workspaces.get(t.workspaceId)).orgRoutingPolicy;case"workspace":return(await e.workspaces.get(t.workspaceId)).routingPolicy;case"member":{const r=(await e.members.list()).find(a=>a.id===t.memberId);if(!r)throw new Error("That member no longer exists.");return r.routingPolicy}case"key":{const r=await Oe(e,t);return r[Ee(r,t.layer)]??null}}}async function Fs(e,t,r,a){const o=a!=null&&a.confirmEmpty||a!=null&&a.acceptNarrowed?[a]:[];switch(t.kind){case"gateway":await e.network.setGatewayPolicy(r??{},...o);return;case"workspace-org":await e.workspaces.update(t.workspaceId,{orgRoutingPolicy:r},...o);return;case"workspace":await e.workspaces.update(t.workspaceId,{routingPolicy:r},...o);return;case"member":await e.members.update(t.memberId,{routingPolicy:r},...o);return;case"key":{const i=t.layer==="owner"?Ee(await Oe(e,t),"owner"):"routingPolicy";await e.keys.update(t.keyId,{[i]:r},...o);return}}}const ue=e=>JSON.stringify(e??{},Object.keys(e??{}).sort());async function Ls(e,t,r,a,o,i){const m=await Re(e,t),c=Ke(m,r,a,o),g=ue(m)!==ue(c)||JSON.stringify(m??{})!==JSON.stringify(c);return g&&await Fs(e,t,c,i),{before:m,after:c,changed:g}}function Ts(e,t,r){return e.kind==="key"?{model:t,key:e.keyId,workspace:e.workspaceId}:e.kind==="member"?{model:t,member:e.memberId,workspace:r}:e.kind==="gateway"?{model:t,workspace:r}:{model:t,workspace:e.workspaceId}}const Ms={allow:"Allowed",block:"Blocked",prefer:"Preferred"};function Ds(e){const{action:t,name:r,scopeLabel:a,changed:o,model:i,preview:m,peerId:c}=e,g=Ms[t],f=t==="prefer"?`already first for ${i}`:`already ${g.toLowerCase()}`,l=o?`${g} ${r} ${t==="prefer"?`for ${i} `:""}on ${a}`:`${r} was ${f} on ${a}; nothing changed`;if(!m)return t==="block"?{tone:o?"success":"info",text:`${l}.`}:{tone:"info",text:`${l}. ${e.previewError?`Could not check whether it can serve: ${e.previewError}`:"Could not check whether it can serve."}`};const u=m.candidates.find(b=>pe(b.peerId,c));if(t==="block")return u!=null&&u.eligible?{tone:"warning",text:`${l}, but the route preview still lists it as eligible for ${i}. Reload and check the policy.`}:{tone:o?"success":"info",text:`${l}.`};if(!m.modelAllowed)return{tone:"warning",text:`${l}, but ${i} is not an allowed model here, so it still cannot serve it.`};if(!u)return{tone:"info",text:`${l}. It does not offer ${i} right now, so the preview cannot show its rank.`};if(!u.eligible){const b=u.reasons.length?u.reasons.join("; "):"another level excludes it";return{tone:"warning",text:`${l}, but it still cannot serve ${i} here: ${b}.`}}return t==="prefer"&&u.rank!==null&&u.rank>1?{tone:"warning",text:`${l}, but it ranks #${u.rank} for ${i}: a fallback chain on another level comes first.`}:{tone:o?"success":"info",text:`${l}.${u.rank?` It ranks #${u.rank} for ${i}.`:""}`}}function Es(e,t,r,a){return e==="gateway"?{kind:e}:e==="workspace"||e==="workspace-org"?{kind:e,workspaceId:r}:t?e==="member"?{kind:e,memberId:t}:{kind:"key",keyId:t,workspaceId:r,layer:a?"admin":"owner"}:null}function Os(e){return e.canForce?"Not allowed above":e.tone==="warning"?"Check the result":"Done"}function Rs({fetching:e,error:t,ready:r,policy:a}){return e?s.jsx(ve,{rows:1}):t?s.jsx(ee,{error:t,title:"Could not load this scope's policy"}):r?s.jsxs("p",{className:"gc-muted",children:["Current policy: ",ts(a)]}):null}const me={allow:{title:"Allow seller",verb:"Allow"},block:{title:"Block seller",verb:"Block"},prefer:{title:"Prefer seller",verb:"Prefer"}};function Be({peer:e,action:t,onClose:r,peers:a}){var te,re,ne,ae;const{viewer:o,workspace:i,me:m}=Z(),c=fe(),g=Qe(),f=Ye(),l=we(o),u=ye(o),b=[...l?[{value:"gateway",label:"Gateway default (everyone)"}]:[],...l?[{value:"workspace-org",label:`${i.name}: organization policy`}]:[],...u?[{value:"workspace",label:`${i.name}: workspace policy`}]:[],...l?[{value:"member",label:"A member"}]:[],{value:"key",label:"An API key"}],[y,h]=p.useState(b[0].value),[n,v]=p.useState(""),[x,E]=p.useState(""),O=He(y==="member"),R=be(c,y==="key");p.useEffect(()=>{v("")},[y]),p.useEffect(()=>{var d;E(((d=e==null?void 0:e.services[0])==null?void 0:d.service)??"")},[e]);const w=(R.data??[]).filter(d=>d.status==="active"&&(u||d.ownerMemberId===m.member.id)),j=Es(y,n,i.id,u),[C,M]=p.useState(null);p.useEffect(()=>{M(null)},[y,n,e]);const B=Je({queryKey:["routing","scope-policy",j],queryFn:()=>Re(A,j),enabled:j!==null&&e!==null,staleTime:0}),z=j!==null&&B.isSuccess&&(t!=="prefer"||x!==""),I=B.data??null,Ve=t==="allow"&&z&&!(I!=null&&I.allowedPeerIds)&&!(I!=null&&I.allowedPeerLists),qe=t==="block"&&z&&e!==null&&We(I,e.peerId);let D=((te=b.find(d=>d.value===y))==null?void 0:te.label.replace(/^A[n]? /,"the "))??"this scope";y==="key"&&(D=`key “${((re=w.find(d=>d.id===n))==null?void 0:re.label)??n}”`),y==="member"&&(D=`member “${((ae=(ne=O.data)==null?void 0:ne.find(d=>d.id===n))==null?void 0:ae.label)??n}”`);const P=Ze({mutationFn:async(d={})=>{var ie;if(!e||!j)return null;const S=x||((ie=e.services[0])==null?void 0:ie.service)||"",{changed:G}=await Ls(A,j,t,e.peerId,x||void 0,d);let oe=null,le=null;if(S)try{oe=await A.network.routePreview(Ts(j,S,i.id))}catch(_e){le=ss(_e)}return Ds({action:t,name:Y(a,e.peerId),scopeLabel:D,changed:G,model:S,preview:oe,peerId:e.peerId,previewError:le})},onSuccess:d=>{for(const S of es)g.invalidateQueries({queryKey:[S]});d&&(d.tone==="success"?(f(d.text),r()):M(d))},onError:d=>{const S=e?Y(a,e.peerId):"this seller";if(U(d,"narrowed"))M({tone:"warning",canForce:!0,text:`Nothing changed yet. The levels above ${D} do not allow ${S}, so saving this would not let it serve. ${Xe(d.details).join(" ")}`.trim()});else if(U(d,"empty_allow_list")){const G=t==="block"?`Blocking ${S}`:`Allowing only ${S}`;M({tone:"warning",text:`Nothing changed. ${G} on ${D} would leave no seller that the levels above allow, so requests would fail. Change the policy on the Routing page if you really want that.`})}}}),K=e?Y(a,e.peerId):"";return s.jsx(X,{isOpen:e!==null,onClose:r,title:me[t].title,subtitle:K,children:s.jsxs("div",{className:"gc-stack",children:[s.jsx($,{label:"Apply to",value:y,onChange:d=>h(d),options:b}),y==="member"&&s.jsx($,{label:"Member",value:n,onChange:v,options:[{value:"",label:"Choose a member"},...(O.data??[]).filter(d=>d.status!=="disabled").map(d=>({value:d.id,label:d.label}))]}),y==="key"&&s.jsx($,{label:"Key",value:n,onChange:v,options:[{value:"",label:w.length?"Choose a key":"No keys you can edit"},...w.map(d=>({value:d.id,label:d.label}))]}),t==="prefer"&&e&&s.jsx($,{label:"For model",value:x,onChange:E,options:e.services.map(d=>({value:d.service,label:d.service})),hint:"The seller goes first in this model's fallback chain."}),s.jsx(Rs,{fetching:B.isFetching,error:B.error,ready:z,policy:I}),Ve&&s.jsxs(Q,{tone:"warning",children:["This scope has no allow list yet. Allowing ",K," creates one, so only allowed sellers can serve it."]}),qe&&s.jsxs(Q,{tone:"warning",title:"This is the only allowed seller",children:["Blocking ",K," empties this scope's allow list, so the allow list is removed: any seller that is not blocked may serve it again."]}),t==="block"&&s.jsx("p",{className:"gc-muted",children:"Blocked sellers never serve this scope or anything under it."}),y==="key"&&!u&&s.jsx("p",{className:"gc-muted",children:"This changes your own restrictions on the key. Restrictions a workspace admin set still apply."}),P.error&&!U(P.error,"narrowed")&&!U(P.error,"empty_allow_list")?s.jsx(ee,{error:P.error,title:"Could not update the policy"}):null,C?s.jsxs(s.Fragment,{children:[s.jsx(Q,{tone:C.tone,title:Os(C),children:C.text}),s.jsxs("div",{className:"gc-actions",children:[C.canForce&&s.jsx(k,{variant:"ghost",disabled:P.isPending,onClick:()=>{M(null),P.mutate({acceptNarrowed:!0})},children:"Save it anyway"}),s.jsx(k,{onClick:r,children:C.canForce?"Cancel":"Done"})]})]}):s.jsxs("div",{className:"gc-actions",children:[s.jsx(k,{variant:"ghost",onClick:r,children:"Cancel"}),s.jsx(k,{variant:t==="block"?"danger":"primary",disabled:!z||P.isPending,onClick:()=>P.mutate({}),children:P.isPending?"Saving…":me[t].verb})]})]})})}function Bs({initial:e,peers:t,onDone:r}){const[a,o]=p.useState((e==null?void 0:e.name)??""),[i,m]=p.useState((e==null?void 0:e.description)??""),[c,g]=p.useState((e==null?void 0:e.peerIds)??[]),f=ke({mutationFn:()=>{const l={name:a.trim(),description:i.trim()||null,peerIds:c};return e?A.network.updatePeerList(e.id,l):A.network.createPeerList(l)},onSuccess:r,invalidate:[xe.peerLists]});return s.jsxs("form",{className:"gc-stack",onSubmit:l=>{l.preventDefault(),f.mutate()},children:[s.jsx(q,{label:"Name",required:!0,placeholder:"e.g. Our own sellers",value:a,onChange:l=>o(l.target.value)}),s.jsx(q,{label:"Description",value:i,onChange:l=>m(l.target.value)}),s.jsx(js,{label:"Sellers",value:c,onChange:g,peers:t}),s.jsx("p",{className:"gc-fineprint",children:"Policies refer to a list by name, so editing it changes every policy that uses it."}),f.error?s.jsx(ee,{error:f.error,title:"Could not save the list"}):null,s.jsxs("div",{className:"gc-actions",children:[s.jsx(k,{variant:"ghost",onClick:r,children:"Cancel"}),s.jsx(k,{type:"submit",disabled:f.isPending||!a.trim(),children:f.isPending?"Saving…":"Save list"})]})]})}function zs({peers:e}){const{viewer:t}=Z(),r=we(t),a=rs(),[o,i]=p.useState(null),[m,c]=p.useState(null),g=ke({mutationFn:f=>A.network.removePeerList(f.id),onSuccess:()=>c(null),invalidate:[xe.peerLists]});return s.jsxs(je,{flush:!0,title:"Peer lists",description:"Named groups of sellers to allow or block in one step.",actions:r&&s.jsx(k,{size:"sm",variant:"outline",leadingIcon:s.jsx(V.plus,{size:14}),onClick:()=>i("new"),children:"New list"}),children:[s.jsx(Pe,{query:a,children:f=>s.jsx(Le,{label:"Peer lists",rows:f,rowKey:l=>l.id,rowLabel:l=>l.name,actions:l=>r?[{label:"Edit",onSelect:()=>i(l)},{label:"Delete",tone:"danger",onSelect:()=>c(l)}]:[],empty:s.jsx(W,{icon:s.jsx(V.network,{size:18}),title:"No peer lists",body:"Group sellers you trust, or ones you run yourself."}),columns:[{key:"name",header:"Name",render:l=>s.jsx("span",{className:"gc-strong",children:l.name})},{key:"desc",header:"Description",secondary:!0,render:l=>s.jsx("span",{className:"gc-muted",children:l.description??"—"})},{key:"count",header:"Sellers",align:"right",render:l=>l.peerIds.length}]})}),s.jsx(X,{isOpen:o!==null,onClose:()=>i(null),title:o==="new"?"New peer list":"Edit peer list",size:"lg",children:o!==null&&s.jsx(Bs,{initial:o==="new"?null:o,peers:e,onDone:()=>i(null)})}),s.jsx(ns,{isOpen:m!==null,busy:g.isPending,error:g.error,onClose:()=>c(null),onConfirm:()=>m&&g.mutate(m),title:"Delete this list?",confirmLabel:"Delete",body:"Policies refer to lists by reference: once deleted, the list adds no sellers to them. An allow list made only of deleted lists lets no seller serve."})]})}function ze(e,t){return t?e.services.filter(r=>r.service===t):e.services}function _(e,t,r=""){const a=ze(e,r).map(o=>o[t]).filter(o=>o!==null);return a.length?{min:Math.min(...a),max:Math.max(...a)}:null}function Us(e,t=""){var r;return((r=_(e,"inputUsdPerMillion",t))==null?void 0:r.min)??null}function Vs(e,t=""){var r;return((r=_(e,"outputUsdPerMillion",t))==null?void 0:r.min)??null}function se(e,t=""){return ze(e,t).some(r=>r.inputUsdPerMillion===0&&(r.outputUsdPerMillion??0)===0)}function qs(e,t){const r=t.search.trim().toLowerCase();return e.filter(a=>{var o;return!(r&&!a.peerId.toLowerCase().includes(r)&&!(a.displayName??"").toLowerCase().includes(r)&&!a.services.some(i=>i.service.toLowerCase().includes(r))||t.model&&!a.services.some(i=>i.service===t.model)||t.tee&&!a.tee||t.linked&&!((o=a.verificationLinks)!=null&&o.length)||t.free&&!se(a,t.model))})}const Ue={"openai-chat-completions":"Chat completions","openai-responses":"Responses","anthropic-messages":"Messages","openai-images":"Images"};function he(e){return e===null?"—":String(Math.round(e))}function J(e){return e.displayName??F(e.peerId,8,4)}function T(e){return`${e.provider}:${e.service}`}function _s({peer:e}){const t=(e.health.coolingDownUntil??0)>Date.now();return s.jsxs("span",{className:"gc-seller__meta",children:[s.jsxs("span",{className:"gc-peer-id",children:[s.jsx(Se,{title:e.peerId,children:F(e.peerId,6,4)}),s.jsx(Ce,{iconOnly:!0,value:e.peerId,label:"Copy peer id"})]}),s.jsx(Te,{links:e.verificationLinks}),s.jsx(Me,{tee:e.tee,scope:e.teeScope}),se(e,"")&&s.jsx(L,{tone:"success",children:"Free"}),e.washFlagged&&s.jsx(L,{tone:"danger",children:"Flagged"}),t&&s.jsx(L,{tone:"warning",children:"Cooling down"}),s.jsxs("span",{className:"gc-muted",children:["Last seen ",as(e.lastSeen)]})]})}function Ks({peer:e,showReputation:t}){const r=(e.health.coolingDownUntil??0)>Date.now();return s.jsxs("div",{className:"gc-grid gc-grid--2 gc-figures gc-panel-figures",children:[s.jsx(N,{label:"Trust score",value:he(e.trustScore)}),t&&s.jsx(N,{label:"Reputation",value:he(e.reputationScore)}),s.jsx(N,{label:"Stake",value:e.stakeAnts?Is(e.stakeAnts):"—"}),s.jsx(N,{label:"Network usage share",value:e.usageShareBps===null?"—":`${(e.usageShareBps/100).toFixed(2)}%`}),s.jsx(N,{label:"First token p50 (this gateway)",value:Ie(e.firstTokenMsP50)}),s.jsx(N,{label:"Speed p50 (this gateway)",value:Ne(e.tokensPerSecondP50)}),s.jsx(N,{label:"Requests, 24h (this gateway)",value:$e(e.requests24h)}),s.jsx(N,{label:"Failure streak",value:r?`${e.health.failureStreak}, cooling down until ${os(e.health.coolingDownUntil)}`:String(e.health.failureStreak)})]})}function Gs({peer:e,selected:t,onSelect:r}){const[a,o]=p.useState(""),i=a.trim().toLowerCase(),m=e.services.filter(c=>!i||c.service.toLowerCase().includes(i));return s.jsx(De,{title:`Models (${e.services.length})`,actions:e.services.length>6&&s.jsx(q,{size:"sm",type:"search","aria-label":"Search this provider's models",placeholder:"Search models",value:a,onChange:c=>o(c.target.value)}),children:m.length===0?s.jsx("p",{className:"gc-fineprint",children:i?"No models match.":"This provider lists no models."}):s.jsx("ul",{className:"gc-panel-rows","aria-label":"Models and prices",children:m.map(c=>{const g=t!==null&&T(t)===T(c);return s.jsx(Ps,{selected:g,title:s.jsx("span",{className:"gc-strong",children:c.service}),meta:s.jsxs(s.Fragment,{children:[s.jsx("span",{children:Ss(c)}),s.jsx("span",{children:Ue[Fe(c)]})]}),actions:s.jsxs(s.Fragment,{children:[s.jsx(Ce,{iconOnly:!0,value:Ae(e.peerId,c.service),label:`Copy ${c.service} pinned to this provider (peer@model)`}),s.jsx(k,{size:"sm",variant:g?"outline":"ghost","aria-pressed":g,title:"Show the API call for this model",onClick:()=>r(c),children:"API call"})]})},T(c))})})})}function Qs({peer:e,service:t,onSelect:r}){var R;const{workspace:a,viewer:o}=Z(),i=fe(),m=ls(),c=be(i),g=is(a.id),[f,l]=p.useState("curl"),[u,b]=p.useState(!1),y=Fe(t),h=Ae(e.peerId,t.service),n=((R=g.data)==null?void 0:R.find(w=>w.model===h))??null,v=cs(m,e.peerId,t.service,y,n?`@preset/${n.slug}`:null),x=v.find(w=>w.id===f)??v[0],E=(c.data??[]).some(w=>w.status==="active"),O=ye(o);return s.jsxs(De,{title:"API call",actions:e.services.length>1&&s.jsx($,{size:"sm","aria-label":"Model",value:T(t),onChange:w=>{const j=e.services.find(C=>T(C)===w);j&&r(j)},options:e.services.map(w=>({value:T(w),label:w.service}))}),children:[s.jsxs("p",{className:"gc-fineprint",children:["Pinned to this provider with ",s.jsx("code",{children:F(h,10,12)}),"."]}),s.jsx($s,{id:"gc-connect",label:"Ways to connect",value:x.id,onChange:l,className:"gc-connect-tabs",tabs:v.map(w=>({id:w.id,label:w.label}))}),s.jsxs(As,{tabsId:"gc-connect",tab:x.id,className:"gc-stack",children:[x.id==="codex"&&s.jsxs("div",{className:"gc-summary-row",children:[s.jsx("p",{className:"gc-fineprint gc-summary-row__text",children:n?s.jsxs(s.Fragment,{children:["Uses the preset ",s.jsxs("code",{children:["@preset/",n.slug]})," for this model. Codex needs a preset: with a raw GPT model name it switches to a tool format some sellers drop."]}):s.jsx(s.Fragment,{children:"Codex needs a preset, not a raw model name: with a GPT model name it switches to a tool format some sellers drop. Create one for this model, then use its slug."})}),!n&&O&&s.jsx(k,{size:"sm",variant:"outline",onClick:()=>b(!0),children:"Create preset for this model"})]}),x.id==="claude-code"&&y!=="anthropic-messages"&&s.jsxs("p",{className:"gc-fineprint",children:["This model speaks ",Ue[y],"; the gateway translates Claude Code's requests for it."]}),s.jsx(ds,{code:x.code,label:`${t.service} · ${x.label}`})]}),s.jsxs("p",{className:"gc-fineprint",children:["Set ",s.jsx("code",{children:us})," to one of your API keys first."," ",c.data&&!E&&s.jsx(ms,{to:"keys",children:"Create an API key"})]}),s.jsx(X,{isOpen:u,onClose:()=>b(!1),size:"lg",title:"New preset",children:u&&s.jsx(Ns,{initial:null,prefill:{name:t.service,model:h},onDone:w=>{b(!1),w&&l("codex")}})})]})}function Ys({peer:e,peers:t,showReputation:r}){const[a,o]=p.useState(null),[i,m]=p.useState(null),c=p.useRef(null),g=i??e.services[0]??null,f=l=>{var u;m(l),(u=c.current)==null||u.scrollIntoView({behavior:"smooth",block:"start"})};return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"gc-stack",children:[s.jsx(_s,{peer:e}),s.jsxs("div",{className:"gc-panel-actions",children:[s.jsx(k,{size:"sm",variant:"outline",onClick:()=>o("allow"),children:"Allow"}),s.jsx(k,{size:"sm",variant:"outline",onClick:()=>o("prefer"),children:"Prefer"}),s.jsx(k,{size:"sm",variant:"danger",onClick:()=>o("block"),children:"Block"})]}),s.jsx(Ks,{peer:e,showReputation:r})]}),s.jsx(Gs,{peer:e,selected:g,onSelect:f}),g&&s.jsx("div",{ref:c,className:"gc-scroll-target",children:s.jsx(Qs,{peer:e,service:g,onSelect:m})}),a&&s.jsx(Be,{peer:e,action:a,peers:t,onClose:()=>o(null)})]})}function ge(e){return e===null?"—":String(Math.round(e))}function Hs({peer:e,model:t}){const r=(e.health.coolingDownUntil??0)>Date.now();return s.jsxs("div",{className:"gc-badges",children:[s.jsx(Me,{tee:e.tee,scope:e.teeScope}),se(e,t)&&s.jsx(L,{tone:"success",children:"Free"}),e.washFlagged&&s.jsx(L,{tone:"danger",children:"Flagged"}),r&&s.jsx(L,{tone:"warning",children:"Cooling down"})]})}function dt(){const e=hs(),t=gs(e.rest),r=ps(),a=p.useMemo(()=>{var h;return t?((h=r.data)==null?void 0:h.find(n=>pe(n.peerId,t)))??null:null},[r.data,t]),[o,i]=p.useState({search:"",model:"",tee:!1,linked:!1,free:!1}),[m,c]=p.useState(null),g=p.useMemo(()=>fs(r.data),[r.data]),f=ws(r.data),l=ys(),u=(h,n)=>i(v=>({...v,[h]:n})),b=t===null?null:{eyebrow:"Provider",title:a?J(a):F(t,8,6),body:r.isLoading?s.jsx(ve,{rows:6}):a?s.jsx(Ys,{peer:a,peers:r.data,showReputation:f},a.peerId):s.jsx(W,{icon:s.jsx(V.providers,{size:18}),title:"Provider not found",body:`This gateway does not see ${F(t,8,6)} right now.`})},y=s.jsxs("div",{className:"gc-page",children:[s.jsx(je,{flush:!0,children:s.jsx(Pe,{query:r,rows:8,children:h=>s.jsx(Le,{label:"Providers",rows:qs(h,o),rowKey:n=>n.peerId,selectedKey:(a==null?void 0:a.peerId)??null,onRowClick:n=>de(ks("providers",n.peerId)),rowLabel:n=>J(n),actions:n=>[o.model!==""&&vs(l,n.peerId,o.model),{label:"Allow…",onSelect:()=>c({peer:n,kind:"allow"})},{label:"Prefer…",onSelect:()=>c({peer:n,kind:"prefer"})},{label:"Block…",tone:"danger",onSelect:()=>c({peer:n,kind:"block"})}],initialSort:{key:"trust",direction:"desc"},empty:s.jsx(W,{icon:s.jsx(V.providers,{size:18}),title:h.length?"No providers match these filters":"No providers found yet",body:h.length?void 0:"The buyer is still discovering the network. Check back in a minute."}),columns:[{key:"name",header:"Provider",sortValue:n=>n.displayName??n.peerId,render:n=>s.jsxs("div",{className:"gc-cell-lines",children:[s.jsx("div",{className:"gc-strong gc-ellipsis",title:n.displayName??n.peerId,children:J(n)}),n.displayName&&s.jsx("div",{className:"gc-muted gc-ellipsis",children:s.jsx(Se,{title:n.peerId,children:F(n.peerId,6,4)})}),s.jsx(Hs,{peer:n,model:o.model})]}),after:n=>s.jsx(bs,{value:n.peerId,label:`Copy peer id ${n.peerId}`})},{key:"identity",header:"Domain / GitHub",secondary:!0,render:n=>{var v;return(v=n.verificationLinks)!=null&&v.length?s.jsx(Te,{links:n.verificationLinks}):s.jsx("span",{className:"gc-muted",children:"—"})}},{key:"models",header:"Models",secondary:!0,optional:!0,render:n=>s.jsx("span",{className:"gc-muted",children:n.services.length})},{key:"input",header:"Input $/M",align:"right",sortValue:n=>Us(n,o.model),render:n=>ce(_(n,"inputUsdPerMillion",o.model))},{key:"output",header:"Output $/M",align:"right",secondary:!0,sortValue:n=>Vs(n,o.model),render:n=>ce(_(n,"outputUsdPerMillion",o.model))},{key:"trust",header:"Trust",align:"right",sortValue:n=>n.trustScore,render:n=>ge(n.trustScore)},...f?[{key:"reputation",header:"Reputation",align:"right",secondary:!0,optional:!0,sortValue:n=>n.reputationScore,render:n=>ge(n.reputationScore)}]:[],{key:"firstToken",header:"First token",align:"right",secondary:!0,optional:!0,sortValue:n=>n.firstTokenMsP50,render:n=>Ie(n.firstTokenMsP50)},{key:"speed",header:"Speed",align:"right",secondary:!0,optional:!0,sortValue:n=>n.tokensPerSecondP50,render:n=>Ne(n.tokensPerSecondP50)},{key:"usage",header:"Your 24h",align:"right",secondary:!0,sortValue:n=>n.requests24h,render:n=>$e(n.requests24h)}]})})}),s.jsx(zs,{peers:r.data})]});return s.jsxs("div",{className:"gc-page",children:[s.jsx(xs,{title:"Providers",description:"Providers on the network this gateway can route to. Open one to copy its models and an API call, or allow, block or prefer it for any scope."}),s.jsxs("div",{className:"gc-toolbar",children:[s.jsx(q,{size:"sm",type:"search","aria-label":"Search providers",placeholder:"Search name, peer id or model",value:o.search,onChange:h=>u("search",h.target.value)}),s.jsx($,{size:"sm","aria-label":"Filter by model",value:o.model,onChange:h=>u("model",h),options:[{value:"",label:"All models"},...g.map(h=>({value:h,label:h}))]}),s.jsx(H,{checked:o.linked,onChange:h=>u("linked",h),label:"Domain or GitHub"}),s.jsx(H,{checked:o.tee,onChange:h=>u("tee",h),label:"TEE"}),s.jsx(H,{checked:o.free,onChange:h=>u("free",h),label:"Free"})]}),s.jsx(Cs,{list:y,panel:b,onClose:()=>de("providers"),closeLabel:"Close provider"}),m&&s.jsx(Be,{peer:m.peer,action:m.kind,peers:r.data,onClose:()=>c(null)})]})}export{dt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{r as M,j as e,L as j,o as y,Z as f,aw as c,ax as k,h as i,E as I,I as w,B as C,W as L,f as N,q,v as d,b as v,M as l,g as u,e as A,$ as D,ah as E,X as $,Y as O}from"./index-DIcymBxc.js";import{u as K}from"./useInfiniteQuery-NenQ5Num.js";import{p as b}from"./PeerPicker-BJfjL7Dy.js";import{f as h,h as _}from"./usage-DktoZRc8.js";import{D as z}from"./DataTable-BTwj5g1m.js";const J=50;function g(s){return s===null?e.jsx(d,{tone:"info",children:"In flight"}):s<400?e.jsx(d,{tone:"success",children:s}):s<500?e.jsx(d,{tone:"warning",children:s}):e.jsx(d,{tone:"danger",children:s})}function R({entry:s}){const n=h(s,Date.now());return n==="video-charged"?e.jsx("span",{className:"gc-muted",title:"Charged on the request that downloaded this video",children:u(s.video.charged)}):n==="on-delivery"?e.jsx("span",{className:"gc-muted",title:"A video is charged when its finished file is downloaded",children:"on delivery"}):n==="not-charged"?e.jsx("span",{className:"gc-muted",title:"A video status check is not charged",children:"—"}):n==="free"?e.jsx("span",{className:"gc-muted",title:"Served by a free seller: $0",children:"Free"}):n==="pending"?e.jsx("span",{className:"gc-muted",title:"The buyer reports spend a moment after the response",children:"pending"}):n==="not-recorded"?e.jsx("span",{className:"gc-muted",title:"No spend was reported for this request: the buyer lost it",children:"not recorded"}):e.jsx(e.Fragment,{children:u(s.spent)})}function S({peerId:s,full:n=!1}){const t=v(),o=b(t.data,s);return n?e.jsxs("div",{className:"gc-stack gc-stack--tight",children:[e.jsx("span",{children:o}),e.jsx(l,{children:s})]}):e.jsx("span",{className:"gc-ellipsis",title:s,children:o})}function T({entry:s}){return s.servedModel?e.jsxs(e.Fragment,{children:[s.model??"—"," ",e.jsxs("span",{className:"gc-muted",children:["→ ",s.servedModel]})]}):e.jsx(e.Fragment,{children:s.model??"—"})}function Q(s){const n=s.model??"Request";return s.servedModel?`${n} → ${s.servedModel}`:n}function U({router:s,status:n}){const t=v();return e.jsxs("div",{className:"gc-stack gc-stack--tight",children:[e.jsx("span",{children:b(t.data,s.peerId)}),e.jsx(l,{children:s.peerId}),e.jsxs("span",{className:"gc-muted",children:[s.service?`${s.service} · `:"",_(s.rank,n)]})]})}function Z({entry:s}){if(s.routingSpent)return e.jsx(e.Fragment,{children:u(s.routingSpent)});const n=h(s,Date.now());return n==="pending"?e.jsx("span",{className:"gc-muted",children:"pending"}):n==="spent"||n==="free"?e.jsx("span",{className:"gc-muted",title:"The router reported no charge for this ranking",children:"Free"}):e.jsx("span",{className:"gc-muted",children:"—"})}function G(s){try{return JSON.stringify(JSON.parse(s),null,2)}catch{return s}}function x({title:s,body:n}){return e.jsxs("div",{className:"gc-stack gc-stack--tight",children:[e.jsx("div",{className:"as-field__label",children:s}),e.jsx(O,{code:G(n)})]})}function V({detail:s}){return!s.requestBody&&!s.responseBody?e.jsx("p",{className:"gc-fineprint",children:"Bodies are not stored for this request. Turn on content logging under Settings → Observability to keep them."}):e.jsxs(e.Fragment,{children:[s.requestBody&&e.jsx(x,{title:"Request body",body:s.requestBody}),s.responseBody&&e.jsx(x,{title:"Response body",body:s.responseBody})]})}function W({entry:s}){const n=A({queryKey:q.request(s.tag),queryFn:()=>N.usage.request(s.tag),retry:!1,staleTime:6e4}),t=n.data??s,o=D(n.error)&&n.error.status===404;return e.jsxs(e.Fragment,{children:[t.errorCode||t.errorMessage?e.jsx(E,{tone:"danger",title:t.errorCode??"Request failed",children:t.errorMessage??"No message was returned."}):null,e.jsx($,{items:[["Status",g(t.status)],["Request",e.jsxs(l,{children:[t.method," ",t.path]},"p")],["Model",e.jsx(T,{entry:t},"m")],["Key",t.keyLabel],["End user",t.endUser??"—"],...t.router?[["Router",e.jsx(U,{router:t.router,status:t.status},"r")]]:[],["Seller",t.sellerPeerId?e.jsx(S,{peerId:t.sellerPeerId,full:!0},"s"):"—"],["First token",c(t.firstTokenMs)],["Speed",k(t.tokensPerSecond)],["Duration",t.finishedAt?c(t.finishedAt-t.startedAt):"—"],["Input tokens",i(t.inputTokens)],["Cached input",i(t.cachedInputTokens)],["Output tokens",i(t.outputTokens)],["Cost",e.jsx(R,{entry:t},"c")],...t.router?[["Routing fee",e.jsx(Z,{entry:t},"f")]]:[],["Tag",e.jsx(l,{children:t.tag},"t")]]}),n.isLoading&&e.jsx(j,{rows:2}),n.error&&!o?e.jsx(y,{error:n.error,title:"Could not load the bodies"}):null,n.data&&e.jsx(V,{detail:n.data})]})}function te({filter:s,showKey:n=!0}){var m;const[t,o]=M.useState(null),a=K({queryKey:q.requests(s),queryFn:({pageParam:r})=>N.usage.requests({...s,before:r??void 0,limit:J}),initialPageParam:null,getNextPageParam:r=>r.nextBefore,refetchInterval:r=>{var p;return(p=r.state.data)!=null&&p.pages.some(F=>F.requests.some(P=>h(P,Date.now())==="pending"))?5e3:!1}});if(a.isLoading)return e.jsx(j,{rows:8});if(a.error)return e.jsx(y,{error:a.error,onRetry:()=>void a.refetch()});const B=((m=a.data)==null?void 0:m.pages.flatMap(r=>r.requests))??[];return e.jsxs(e.Fragment,{children:[e.jsx(z,{label:"Request log",rows:B,rowKey:r=>r.tag,onRowClick:o,rowLabel:r=>`request ${r.tag}`,empty:e.jsx(I,{icon:e.jsx(w.logs,{size:18}),title:"No requests found",body:"Requests appear here as soon as a key is used. Check the filters if you expected some."}),columns:[{key:"time",header:"Time",render:r=>e.jsx("span",{className:"gc-nowrap",children:f(r.startedAt)})},...n?[{key:"key",header:"Key",secondary:!0,render:r=>r.keyLabel}]:[],{key:"model",header:"Model",render:r=>e.jsxs("span",{className:"gc-ellipsis",children:[r.model?e.jsx(T,{entry:r}):e.jsxs("span",{className:"gc-muted",children:[r.method," ",r.path]}),r.status!==null&&r.status>=400?e.jsxs("span",{className:"gc-narrow-only",children:[" ",g(r.status)]}):null]})},{key:"seller",header:"Seller",render:r=>r.sellerPeerId?e.jsx(S,{peerId:r.sellerPeerId}):"—"},{key:"status",header:"Status",secondary:!0,render:r=>e.jsx("span",{title:r.errorMessage??void 0,children:g(r.status)})},{key:"firstToken",header:"First token",align:"right",secondary:!0,optional:!0,render:r=>c(r.firstTokenMs)},{key:"speed",header:"Speed",align:"right",secondary:!0,optional:!0,render:r=>k(r.tokensPerSecond)},{key:"tokens",header:"Tokens",align:"right",secondary:!0,render:r=>`${i(r.inputTokens)} → ${i(r.outputTokens)}`},{key:"cost",header:"Cost",align:"right",render:r=>e.jsx(R,{entry:r})}]}),a.hasNextPage&&e.jsx("div",{className:"gc-load-more",children:e.jsx(C,{variant:"outline",size:"sm",disabled:a.isFetchingNextPage,onClick:()=>void a.fetchNextPage(),children:a.isFetchingNextPage?"Loading…":"Load older requests"})}),e.jsx(L,{isOpen:t!==null,onClose:()=>o(null),title:t?Q(t):"Request",subtitle:t?f(t.startedAt):void 0,eyebrow:"Request",children:t&&e.jsx(W,{entry:t},t.tag)})]})}export{te as R};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as C,a as se,b as O,a3 as ae,n as $,r as u,c as te,d as re,bf as ie,e as ne,j as e,l as D,T as le,B as b,L as G,o as z,bg as oe,ah as q,A as N,v as A,al as K,E as ce,bh as de,f as T,q as W,P as ue,a5 as pe,bi as ge,F as V,bj as H,b7 as ye,bk as X,bl as M,a6 as _,bm as Q,i as me,G as he,bn as R,bo as we,af as fe,b9 as ve,C as xe}from"./index-DIcymBxc.js";import{b as Z,a as je,d as be}from"./PolicyField-CfRYcr_J.js";import{P as ke}from"./PolicyEditor-BpoV34ra.js";import{p as U}from"./PeerPicker-BJfjL7Dy.js";import{S as Y}from"./SelectField-BWyF8Ku8.js";import{D as Pe}from"./DataTable-BTwj5g1m.js";import{T as Se,a as Ne}from"./Tabs-yVL4Cd6z.js";import"./Segmented-BelxPFkk.js";import"./roving-DkptacxO.js";import"./Switch-BwBYBnSS.js";function P({level:a,children:t,result:i}){return e.jsxs("div",{className:i?"gc-source gc-source--result":"gc-source",children:[e.jsx("div",{className:"gc-source__level",children:a}),e.jsx("div",{className:"gc-source__policy",children:t})]})}function Ce(a,t,i,n){return a==="key"?(t??[]).filter(r=>r.status==="active").map(r=>({value:r.id,label:r.label})):a==="member"?(i??[]).map(({member:r})=>({value:r.id,label:r.label})):a==="preset"?(n??[]).map(r=>({value:r.slug,label:r.name})):[]}function Le(){const{workspace:a,viewer:t}=C(),i=se(),n=O(),r=ae(n.data),p=$(t),[s,c]=u.useState("workspace"),[l,g]=u.useState(""),[y,w]=u.useState(""),[f,v]=u.useState(null),m=te(i,s==="key"),d=re(a.id,s==="member"),L=ie(a.id,s==="preset"),h=ne({queryKey:W.routePreview(f??{}),queryFn:()=>T.network.routePreview(f),enabled:f!==null}),j=Ce(s,m.data,d.data,L.data);function x(){const o={model:y.trim(),workspace:a.id};s!=="workspace"&&l&&(o[s]=l),v(o)}return e.jsxs(D,{title:"Route preview",description:"See which sellers a request would go to, and why.",children:[e.jsxs("form",{className:"gc-toolbar",onSubmit:o=>{o.preventDefault(),x()},children:[e.jsx(Y,{size:"sm","aria-label":"Preview for",value:s,onChange:o=>{c(o),g("")},options:[{value:"workspace",label:`Workspace: ${a.name}`},{value:"key",label:"A key"},...p?[{value:"member",label:"A member"}]:[],{value:"preset",label:"A preset"}]}),s!=="workspace"&&e.jsx(Y,{size:"sm","aria-label":`Choose a ${s}`,value:l,onChange:g,options:[{value:"",label:`Choose a ${s}`},...j]}),e.jsx(le,{size:"sm","aria-label":"Model",placeholder:"Model id",list:"gc-preview-models",value:y,onChange:o=>w(o.target.value)}),e.jsx("datalist",{id:"gc-preview-models",children:r.map(o=>e.jsx("option",{value:o},o))}),e.jsx(b,{type:"submit",size:"sm",disabled:!y.trim()||s!=="workspace"&&!l,children:"Preview"})]}),h.isFetching&&e.jsx(G,{rows:4}),h.error?e.jsx(z,{error:h.error}):null,h.data&&!h.isFetching&&e.jsx(Re,{preview:h.data})]})}const Ee={buyer:"Buyer",gateway:"Gateway","workspace-org":"Workspace (org policy)",workspace:"Workspace",member:"Member",key:"Key (admin)","key-owner":"Key (owner)",preset:"Preset"};function Me(a){return a.policy!==null?N(a.policy):e.jsx("span",{className:"gc-muted",children:a.level==="buyer"?"No hard limits":"Inherits"})}function Re({preview:a}){const{me:t}=C(),i=O(),n=oe(),r=a.candidates.filter(s=>s.eligible).length,p=s=>{var c;return s.id?s.level==="workspace"||s.level==="workspace-org"?((c=t.workspaces.find(l=>l.workspace.id===s.id))==null?void 0:c.workspace.name)??s.id:s.id:null};return e.jsxs("div",{className:"gc-stack",children:[!a.modelAllowed&&e.jsxs(q,{tone:"danger",title:"Model not allowed",children:["The policy does not allow ",a.model,". Requests for it get a 403."]}),e.jsxs("div",{className:"gc-sources",children:[a.sources.map((s,c)=>e.jsx(P,{level:e.jsxs(e.Fragment,{children:[Ee[s.level],p(s)?e.jsxs("span",{className:"gc-muted",children:[" · ",p(s)]}):null]}),children:Me(s)},`${s.level}-${c}`)),e.jsx(P,{level:"Effective",result:!0,children:N(a.policy)})]}),e.jsxs("p",{className:"gc-muted",children:[r," of ",a.candidates.length," sellers eligible."]}),r===0&&a.candidates.length>0&&e.jsxs(q,{tone:"warning",title:"No eligible seller",children:["Requests for ",a.model," fail with this policy. The reasons below show what excludes each seller."]}),e.jsx(Pe,{label:"Candidates",rows:[...a.candidates].sort((s,c)=>(s.rank??1e9)-(c.rank??1e9)),rowKey:s=>s.peerId,rowLabel:s=>s.displayName??U(i.data,s.peerId),actions:s=>[de(n,s.peerId,a.model)],empty:e.jsx(ce,{title:"No seller offers this model"}),columns:[{key:"rank",header:"#",render:s=>s.rank??"—",width:"3rem"},{key:"seller",header:"Seller",render:s=>s.displayName??U(i.data,s.peerId)},{key:"eligible",header:"Eligible",render:s=>s.eligible?e.jsx(A,{tone:"success",children:"Yes"}):e.jsx(A,{tone:"neutral",children:"No"})},{key:"reasons",header:"Why",render:s=>e.jsx("span",{className:"gc-muted",children:s.reasons.join(" · ")||"—"})},{key:"input",header:"Input $/M",align:"right",secondary:!0,render:s=>K(s.inputUsdPerMillion)},{key:"output",header:"Output $/M",align:"right",secondary:!0,render:s=>K(s.outputUsdPerMillion)},{key:"trust",header:"Trust",align:"right",secondary:!0,render:s=>s.trustScore===null?"—":Math.round(s.trustScore)}]})]})}const S={gateway:{title:"Gateway default",description:()=>"Applies to every request through this gateway. Workspaces, members, keys and presets can only narrow it."},org:{title:"Organization policy",description:a=>`Set by organization admins for ${a}. Workspace admins can only narrow it.`},workspace:{title:"Workspace policy",description:a=>`Set by ${a}'s admins, on top of the gateway default and the organization policy.`}},B=(a,t)=>JSON.stringify(a)===JSON.stringify(t);function qe(a,t){if(!a)return e.jsx(A,{children:"Read only"});if(t)return e.jsx(A,{tone:"warning",children:"Unsaved changes"})}function I({layer:a,source:t,parent:i,canEdit:n,onSave:r}){const{workspace:p}=C(),s=he(),c=O(),l=H(),g=je(),[y,w]=u.useState(()=>R(t)),[f,v]=u.useState(()=>R(t)),[m,d]=u.useState(null),[L,h]=u.useState(!1),j=u.useMemo(()=>R(t),[t]),x=!B(y,f);u.useEffect(()=>{B(j,f)||(!x||B(j,y)?(w(j),v(j),d(null)):d(j))},[j]);const o=we({mutationFn:async()=>{const k=fe(y,l.data??null);return await g.save([k],ee=>r(k,ee))===ve?null:k},onSuccess:k=>{if(!k)return;const F=R(k);w(F),v(F),d(null),h(!1),s(`${S[a].title} saved`)}}),E=be(y,l.data??null);return e.jsxs(D,{title:S[a].title,description:S[a].description(p.name),actions:qe(n,x),children:[e.jsxs("div",{className:"gc-policy-row",children:[e.jsxs("div",{className:"gc-policy-row__text",children:[e.jsx(Z,{policy:x?E.policy:t,invalid:x&&E.error!==null}),x&&e.jsx("span",{className:"gc-fineprint",children:"Showing your unsaved edits."})]}),e.jsx(b,{size:"sm",variant:"outline",onClick:()=>h(!0),children:n?"Edit":"View"})]}),m&&n&&!L&&e.jsx(q,{tone:"warning",title:"Changed elsewhere",children:"Someone saved this policy while you were editing it. Open it to reload theirs or keep yours."}),e.jsx(xe,{isOpen:L,onClose:()=>h(!1),size:"xl",title:S[a].title,subtitle:S[a].description(p.name),footer:n?e.jsxs(e.Fragment,{children:[E.error&&e.jsx("span",{className:"gc-warn gc-footer-note",children:E.error}),e.jsx(b,{variant:"ghost",disabled:!x,onClick:()=>{w(f),d(null)},children:"Discard changes"}),e.jsx(b,{disabled:o.isPending||!x,onClick:()=>o.mutate(),children:o.isPending?"Saving…":"Save policy"})]}):e.jsx(b,{variant:"outline",onClick:()=>h(!1),children:"Close"}),children:e.jsxs("div",{className:"gc-stack",children:[m&&n&&e.jsx(q,{tone:"warning",title:"Changed elsewhere",action:e.jsxs("div",{className:"gc-inline gc-inline--wrap",children:[e.jsx(b,{size:"sm",variant:"outline",onClick:()=>{w(m),v(m),d(null)},children:"Reload"}),e.jsx(b,{size:"sm",variant:"ghost",onClick:()=>{v(m),d(null)},children:"Keep editing"})]}),children:"Someone saved this policy while you were editing it. Reload to see their version (your edits are dropped), or keep editing and save to replace it."}),o.error?e.jsx(z,{error:o.error,title:"Could not save"}):null,e.jsx(ke,{value:y,onChange:w,peers:c.data,lists:l.data??[],parent:i,disabled:!n})]})}),g.dialog]})}function Ae(){const a=V(),t=X();return t.isLoading?e.jsx(G,{rows:6}):t.error?e.jsx(z,{error:t.error,onRetry:()=>void t.refetch()}):e.jsx(I,{layer:"gateway",source:t.data??null,parent:null,canEdit:!0,onSave:async(i,n)=>{await T.network.setGatewayPolicy(i,n),await a.invalidateQueries({queryKey:W.group("routing")})}})}function J(){var f,v;const{workspace:a,viewer:t}=C(),i=V(),n=H(),r=ye(a.id),p=X(),s=n.data??[],c=p.data?M(p.data,s):null,l=((f=r.data)==null?void 0:f.orgRoutingPolicy)??null,g=((v=r.data)==null?void 0:v.routingPolicy)??null,y=u.useMemo(()=>_(c,l&&M(l,s),g&&M(g,s)),[c,l,g,s]);if(r.isLoading)return e.jsx(G,{rows:6});if(r.error)return e.jsx(z,{error:r.error,onRetry:()=>void r.refetch()});const w=async()=>{await i.invalidateQueries({queryKey:W.group("workspaces")}),await i.invalidateQueries({queryKey:W.group("routing")})};return e.jsxs("div",{className:"gc-stack",children:[e.jsx(D,{title:"Effective for this workspace",description:"What keys in this workspace get before member, key and preset policies narrow it further.",children:e.jsxs("div",{className:"gc-sources",children:[e.jsx(P,{level:"Gateway default",children:N(p.data)}),e.jsx(P,{level:"Organization",children:N(l)}),e.jsx(P,{level:"Workspace",children:N(g)}),e.jsx(P,{level:"Effective",result:!0,children:e.jsx(Z,{policy:y})})]})}),e.jsx(I,{layer:"org",source:l,parent:c,canEdit:$(t),onSave:async(m,d)=>{await T.workspaces.update(a.id,{orgRoutingPolicy:Q(m)},d),await w()}}),e.jsx(I,{layer:"workspace",source:g,parent:_(c,l&&M(l,s)),canEdit:me(t),onSave:async(m,d)=>{await T.workspaces.update(a.id,{routingPolicy:Q(m)},d),await w()}})]})}function Te(){const a=pe();if(!a.data)return null;const t=ge(a.data);return e.jsxs("p",{className:"gc-fineprint",children:["Buyer config, which every policy here can only narrow: ",t.length>0?t.join(" · "):"none","."]})}function We(){const{viewer:a}=C(),t=$(a),[i,n]=u.useState(t?"gateway":"workspace");return t?e.jsxs(e.Fragment,{children:[e.jsx(Se,{id:"gc-routing-level",label:"Policy level",value:i,onChange:n,tabs:[{id:"gateway",label:"Gateway default"},{id:"workspace",label:"This workspace"}]}),e.jsx(Ne,{tabsId:"gc-routing-level",tab:i,children:i==="gateway"?e.jsx(Ae,{}):e.jsx(J,{})})]}):e.jsx(J,{})}function Qe(){return e.jsxs("div",{className:"gc-page",children:[e.jsx(ue,{title:"Routing",description:"Which sellers serve your requests and how they are ranked. Each level can only narrow the one above."}),e.jsx(Te,{}),e.jsx(We,{}),e.jsx(Le,{})]})}export{Qe as default};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import{F as re,G as ne,b as ge,bj as xe,r as d,bo as ae,q as U,f as E,ag as ve,a6 as be,al as K,g as ye,j as t,ah as D,aa as fe,T as O,B as f,o as $,D as ie,e as Se,P as je,by as we,Q as z,aC as ke,l as A,X as le,M as Pe,v as M,u as Re,V as Ce,t as Q,b3 as Ne,au as W,bc as Me,at as Ie,E as Ue,I as G,C as J,b2 as qe,$ as Te}from"./index-DIcymBxc.js";import{P as Y}from"./PeerPicker-BJfjL7Dy.js";import{S as X}from"./PolicyEditor-BpoV34ra.js";import{S as Oe}from"./Segmented-BelxPFkk.js";import{S as I,D as F}from"./Switch-BwBYBnSS.js";import{T as oe}from"./TextAreaField-B6jcl4RR.js";import{T as Ee,a as Ae}from"./Tabs-yVL4Cd6z.js";import{D as Fe}from"./DataTable-BTwj5g1m.js";import{S as B}from"./SelectField-BWyF8Ku8.js";import"./roving-DkptacxO.js";function De(e){return Object.entries(e).map(([s,r])=>`${s}: ${r}`).join(`
|
|
2
|
-
`)}function $e(e){const s={};for(const[r,n]of e.split(`
|
|
3
|
-
`).entries()){if(!n.trim())continue;const c=n.indexOf(":");if(c<=0)throw new Error(`Line ${r+1}: use "Name: value".`);const u=n.slice(0,c).trim();if(!/^[A-Za-z0-9!#$%&'*+.^_`|~-]+$/.test(u))throw new Error(`Line ${r+1}: "${u}" is not a valid header name.`);s[u]=n.slice(c+1).trim()}return s}const ce="••••";function _e(e){return e.split(`
|
|
4
|
-
`).map(s=>{const r=s.indexOf(":");return r>0&&s.slice(r+1).trim()===ce?s.slice(0,r).trim():null}).filter(s=>!!s)}function Z(e){return e.split(`
|
|
5
|
-
`).map(s=>{const r=s.indexOf(":");return r>0&&s.slice(r+1).trim()===ce?`${s.slice(0,r)}: `:s}).join(`
|
|
6
|
-
`)}function Le(e,s){if(!e||!s)return!1;try{return new URL(e).origin!==new URL(s).origin}catch{return e!==s}}function Be(e){const s={},r=(n,c,u)=>{const a=e[n].trim();if(a===""){c&&(s[n]="Required.");return}const h=Number(a);!Number.isFinite(h)||h<0?s[n]="Use a number of 0 or more.":u!==void 0&&h>u&&(s[n]=`At most ${u}.`)};return r("input",!0),r("output",!0),r("cached",!1),r("reputation",!0,100),s}function w(e,s={}){const r=e.trim();if(r==="")return s.required?"Required.":void 0;const n=Number(r),c=s.min??0;if(!Number.isFinite(n))return"Use a number.";if(s.integer&&!Number.isInteger(n))return"Use a whole number.";if(n<c)return`Use ${c} or more.`;if(s.max!==void 0&&n>s.max)return`At most ${s.max}.`}function V(e){return e.split(/[\n,]/).map(s=>s.trim()).filter(Boolean)}function ee(e){const s=e.find(r=>!/^(?:0x)?[0-9a-f]{40}$/i.test(r));return s?`"${s}" is not a 40-character hex seller id.`:void 0}function te(e){const s=e.find(r=>!/^https?:\/\/\S+$/.test(r));return s?`"${s}" is not an http(s) URL.`:void 0}function ue(e,s){return e.some(r=>r===s||s.startsWith(`${r}.`)||r.startsWith(`${s}.`))}function Ve(){return t.jsxs("span",{className:"gc-override",children:[t.jsx("span",{className:"gc-attention","aria-hidden":"true"}),"Overridden by the buyer's environment or start flags"]})}function se(e){const s=e.routingPreferences,r=n=>n===null?"":String(n);return{allowMode:s.allowedPeerIds.length>0?"only":"any",allowedPeerIds:[...s.allowedPeerIds],blockedPeerIds:[...s.blockedPeerIds],minTrustScore:String(s.minTrustScore),minReputation:String(e.minPeerReputation),preferFree:s.preferFreePeers,softInputCap:String(s.maxInputUsdPerMillion),maxInput:String(e.maxPricing.inputUsdPerMillion),maxOutput:String(e.maxPricing.outputUsdPerMillion),maxCached:r(e.maxPricing.cachedInputUsdPerMillion),verify:e.verifier.enabled,requireVerified:e.verifier.require,verifiers:e.verifier.prefer.join(", "),sampleRate:r(e.evidence.sampleRate),maxSampleBytes:r(e.evidence.maxSampleBytes),autoSweep:e.payments.autoSweep,maxPerRequest:String(e.payments.maxPerRequestUsdc),maxReserve:String(e.payments.maxReserveUsdc),rpcUrl:e.payments.rpcUrl??"",fallbackRpcUrls:e.payments.fallbackRpcUrls.join(`
|
|
7
|
-
`),peerRefreshMs:String(e.network.peerRefreshIntervalMs),metadataTimeoutMs:String(e.network.metadataFetchTimeoutMs),requestTimeoutMs:String(e.network.requestTimeoutMs),maxStreamMs:String(e.network.maxStreamDurationMs),perServiceMetadata:!e.network.disableMetadataV2Services}}function ze(e){const s=Be({input:e.maxInput,output:e.maxOutput,cached:e.maxCached,reputation:e.minReputation}),r={maxInput:s.input,maxOutput:s.output,maxCached:s.cached,softInputCap:w(e.softInputCap,{required:!0}),allowedPeerIds:e.allowMode==="only"?ee(e.allowedPeerIds):void 0,blockedPeerIds:ee(e.blockedPeerIds),sampleRate:w(e.sampleRate,{max:1}),maxSampleBytes:w(e.maxSampleBytes,{min:1,integer:!0}),maxPerRequest:w(e.maxPerRequest,{required:!0,min:1e-6}),maxReserve:w(e.maxReserve,{required:!0,min:1e-6}),rpcUrl:e.rpcUrl.trim()?te([e.rpcUrl.trim()]):void 0,fallbackRpcUrls:te(V(e.fallbackRpcUrls)),peerRefreshMs:w(e.peerRefreshMs,{required:!0,min:1e3,integer:!0}),metadataTimeoutMs:w(e.metadataTimeoutMs,{required:!0,min:100,integer:!0}),requestTimeoutMs:w(e.requestTimeoutMs,{required:!0,min:1,integer:!0}),maxStreamMs:w(e.maxStreamMs,{required:!0,min:1,integer:!0})};return Object.fromEntries(Object.entries(r).filter(([,n])=>n))}function He(e){const s=r=>r.trim()?Number(r):null;return{routingPreferences:{minTrustScore:Number(e.minTrustScore),maxInputUsdPerMillion:Number(e.softInputCap),preferFreePeers:e.preferFree,allowedPeerIds:e.allowMode==="only"?e.allowedPeerIds:[],blockedPeerIds:e.blockedPeerIds},maxPricing:{inputUsdPerMillion:Number(e.maxInput),outputUsdPerMillion:Number(e.maxOutput),cachedInputUsdPerMillion:s(e.maxCached)},minPeerReputation:Number(e.minReputation),verifier:{enabled:e.verify,require:e.verify&&e.requireVerified,prefer:e.verify?V(e.verifiers):[]},evidence:{sampleRate:s(e.sampleRate),maxSampleBytes:s(e.maxSampleBytes)},payments:{autoSweep:e.autoSweep,maxPerRequestUsdc:Number(e.maxPerRequest),maxReserveUsdc:Number(e.maxReserve),rpcUrl:e.rpcUrl.trim()||null,fallbackRpcUrls:V(e.fallbackRpcUrls)},network:{peerRefreshIntervalMs:Number(e.peerRefreshMs),metadataFetchTimeoutMs:Number(e.metadataTimeoutMs),requestTimeoutMs:Number(e.requestTimeoutMs),maxStreamDurationMs:Number(e.maxStreamMs),disableMetadataV2Services:!e.perServiceMetadata}}}const Ke=["allowMode","allowedPeerIds","blockedPeerIds","minTrustScore","preferFree","softInputCap"];function L(e,s){return Object.keys(s).filter(r=>JSON.stringify(e[r])!==JSON.stringify(s[r]))}function Qe(e){const s=r=>r.trim()&&Number.isFinite(Number(r))?Number(r):void 0;return{...e.allowMode==="only"&&e.allowedPeerIds.length>0?{allowedPeerIds:e.allowedPeerIds}:{},...e.blockedPeerIds.length>0?{blockedPeerIds:e.blockedPeerIds}:{},...s(e.minTrustScore)?{minTrustScore:s(e.minTrustScore)}:{},...s(e.minReputation)?{minReputation:s(e.minReputation)}:{},...s(e.maxInput)!==void 0?{maxInputUsdPerMillion:s(e.maxInput)}:{},...s(e.maxOutput)!==void 0?{maxOutputUsdPerMillion:s(e.maxOutput)}:{},...s(e.maxCached)!==void 0?{maxCachedInputUsdPerMillion:s(e.maxCached)}:{}}}function We({buyer:e}){const s=re(),r=ne(),n=ge(),c=xe(),u=d.useMemo(()=>se(e),[e]),[a,h]=d.useState(u),[k,P]=d.useState(u),[v,S]=d.useState(null),[b,p]=d.useState(!1),[j,g]=d.useState(!1),l=(i,R)=>h(C=>({...C,[i]:R})),m=i=>{h(i),P(i),S(null)},o=ze(a),q=L(k,a);d.useEffect(()=>{L(k,u).length!==0&&(q.length===0||L(u,a).length===0?m(u):S(u))},[u]);const _=q.some(i=>!Ke.includes(i)),N=i=>ue(e.overrides,i)?t.jsx(Ve,{}):void 0,H=(i,R)=>N(i)??R,y=ae({mutationFn:()=>E.settings.updateBuyer(He(a)),onSuccess:i=>{const{restartRequired:R,...C}=i;s.setQueryData(U.settings,C),m(se(C.buyer)),s.invalidateQueries({queryKey:U.buyerLimits}),p(!1),g(R===!0),r(_?R?"Saved. Restart the buyer to apply them.":"Saved. The buyer is restarting.":"Saved. The buyer applies these at once.")}}),T=d.useMemo(()=>!n.data||n.data.length===0?null:{matched:ve(be(Qe(a)),n.data,c.data??[]).length,total:n.data.length},[a,n.data,c.data]),de=`${K(Number(a.maxInput))} in · ${K(Number(a.maxOutput))} out`,me=a.verify?a.requireVerified?"Required":"On":"Off",pe=`${a.autoSweep?"Auto-sweep on":"Auto-sweep off"} · ${ye(Number(a.maxPerRequest))} per request`,x=(i,R,C={})=>t.jsx(O,{size:"sm",className:C.className??"gc-num",label:R,inputMode:"decimal",placeholder:C.placeholder,value:a[i],error:o[i],hint:C.hint,onChange:he=>l(i,he.target.value)});return t.jsxs("div",{className:"gc-stack",children:[t.jsxs("div",{className:"gc-policy",children:[T&&(T.matched===0?t.jsxs(D,{tone:"warning",title:"No seller matches these settings",children:["None of the ",T.total," sellers this gateway sees passes them, so every request will fail."]}):t.jsxs("p",{className:"gc-muted","aria-live":"polite",children:["Matches ",T.matched," of ",T.total," sellers. Every key can only narrow this."]})),t.jsxs("div",{className:"gc-policy__cols",children:[t.jsxs("section",{className:"gc-policy__section",children:[t.jsx("h3",{children:"Sellers"}),t.jsx(Oe,{label:"Which sellers may serve",value:a.allowMode,onChange:i=>l("allowMode",i),options:[{value:"any",label:"Any seller"},{value:"only",label:"Only these"}]}),a.allowMode==="only"&&t.jsxs(t.Fragment,{children:[t.jsx(Y,{label:"Allowed sellers",value:a.allowedPeerIds,onChange:i=>l("allowedPeerIds",i),peers:n.data}),o.allowedPeerIds&&t.jsx("p",{className:"gc-warn",children:o.allowedPeerIds}),a.allowedPeerIds.length===0&&t.jsx("p",{className:"gc-fineprint",children:"With no sellers listed, any seller may serve."})]}),t.jsx(Y,{label:"Blocked sellers",value:a.blockedPeerIds,onChange:i=>l("blockedPeerIds",i),peers:n.data}),o.blockedPeerIds&&t.jsx("p",{className:"gc-warn",children:o.blockedPeerIds}),t.jsx("p",{className:"gc-fineprint",children:"Blocked here means blocked for every key."})]}),t.jsxs("section",{className:"gc-policy__section",children:[t.jsx("h3",{children:"Quality and ranking"}),t.jsx(X,{label:"Minimum trust score",clearable:!1,value:a.minTrustScore,onChange:i=>l("minTrustScore",i),hint:"Keys can raise it, not lower it."}),(fe(n.data)||a.minReputation!=="0")&&t.jsx(X,{label:"Minimum reputation",clearable:!1,value:a.minReputation,onChange:i=>l("minReputation",i),hint:H("minPeerReputation","Applies to pinned sellers too.")}),t.jsx("div",{className:"gc-policy__switches",children:t.jsx(I,{checked:a.preferFree,onChange:i=>l("preferFree",i),label:"Free sellers first"})}),x("softInputCap","Soft input price limit $/M",{hint:"Pricier sellers rank lower; none is excluded.",className:"gc-num gc-num--wide"})]})]}),t.jsxs("div",{className:"gc-policy__advanced",children:[t.jsxs(F,{title:"Price caps",summary:de,children:[t.jsx("p",{className:"gc-fineprint",children:"Hard limits for every request, pinned sellers included."}),t.jsxs("div",{className:"gc-policy__caps",children:[x("maxInput","Input $/M",{hint:N("maxPricing.inputUsdPerMillion")}),x("maxOutput","Output $/M",{hint:N("maxPricing.outputUsdPerMillion")}),x("maxCached","Cached input $/M",{placeholder:"Same as input"})]})]}),t.jsxs(F,{title:"Verification",summary:me,children:[N("verifier"),t.jsxs("div",{className:"gc-policy__switches",children:[t.jsx(I,{checked:a.verify,onChange:i=>l("verify",i),label:"Verify sellers"}),t.jsx(I,{checked:a.verify&&a.requireVerified,disabled:!a.verify,onChange:i=>l("requireVerified",i),label:"Require verification"})]}),t.jsx(O,{size:"sm",label:"Verifiers",value:a.verifiers,disabled:!a.verify,placeholder:"Seller's trusted default",hint:"Ordered, comma-separated verifier ids, e.g. TEE attestation.",onChange:i=>l("verifiers",i.target.value)}),t.jsxs("div",{className:"gc-policy__caps",children:[x("sampleRate","Evidence sample rate",{placeholder:"Default",hint:"Share of responses kept, 0 to 1."}),x("maxSampleBytes","Largest sample (bytes)",{placeholder:"Default",className:"gc-num gc-num--wide"})]})]}),t.jsxs(F,{title:"Payments",summary:pe,children:[t.jsx(I,{checked:a.autoSweep,onChange:i=>l("autoSweep",i),label:"Sweep deposits automatically",description:"Move USDC that arrives in the workspace wallets into their deposits."}),t.jsxs("div",{className:"gc-policy__caps",children:[x("maxPerRequest","Max per request (USDC)",{className:"gc-num gc-num--wide"}),x("maxReserve","Max channel reserve (USDC)",{className:"gc-num gc-num--wide"})]}),t.jsx(O,{size:"sm",label:"Base RPC URL",value:a.rpcUrl,error:o.rpcUrl,placeholder:"Chain default",hint:H("payments.rpcUrl","Your own endpoint avoids public rate limits. Saved URLs show without their path; leave them as they are to keep them."),onChange:i=>l("rpcUrl",i.target.value)}),t.jsx(oe,{label:"Fallback RPC URLs",rows:2,mono:!0,value:a.fallbackRpcUrls,error:o.fallbackRpcUrls,hint:"One per line, tried in order.",onChange:i=>l("fallbackRpcUrls",i.target.value)})]}),t.jsxs(F,{title:"Network and timeouts",summary:`Refresh ${Math.round(Number(a.peerRefreshMs)/1e3)} s`,children:[t.jsxs("div",{className:"gc-policy__caps",children:[x("peerRefreshMs","Peer refresh (ms)",{className:"gc-num gc-num--wide"}),x("metadataTimeoutMs","Metadata timeout (ms)",{className:"gc-num gc-num--wide",hint:N("network.metadataFetchTimeoutMs")}),x("requestTimeoutMs","Response start timeout (ms)",{className:"gc-num gc-num--wide"}),x("maxStreamMs","Longest stream (ms)",{className:"gc-num gc-num--wide",hint:N("network.maxStreamDurationMs")})]}),t.jsx(I,{checked:a.perServiceMetadata,onChange:i=>l("perServiceMetadata",i),label:"Per-service attribution in signed metadata",description:N("network.disableMetadataV2Services")??"Tells sellers which service each request used."})]})]})]}),j&&t.jsxs(D,{tone:"warning",title:"Restart the buyer to apply",children:["Saved, but this buyer was not restarted automatically. Restart it (for example ",t.jsx("code",{children:"systemctl restart antseed-buyer"}),", or stop and start ",t.jsx("code",{children:"antseed buyer start"}),") to use the new settings."]}),v&&t.jsx(D,{tone:"warning",title:"Changed elsewhere",action:t.jsxs("div",{className:"gc-inline gc-inline--wrap",children:[t.jsx(f,{size:"sm",variant:"outline",onClick:()=>m(v),children:"Reload"}),t.jsx(f,{size:"sm",variant:"ghost",onClick:()=>{P(v),S(null)},children:"Keep editing"})]}),children:"Someone saved the buyer settings while you were editing them. Reload to see their version (your edits are dropped), or keep editing and save to replace it."}),!b&&y.error?t.jsx($,{error:y.error,title:"Could not save"}):null,t.jsxs("div",{className:"gc-actions",children:[t.jsx("span",{className:"gc-fineprint gc-actions__note",children:q.length===0?"No changes.":_?"Saving restarts the buyer.":"Applies at once, without a restart."}),t.jsx(f,{variant:"ghost",disabled:q.length===0||y.isPending,onClick:()=>m(v??k),children:"Reset"}),t.jsx(f,{disabled:q.length===0||Object.keys(o).length>0||y.isPending,onClick:()=>_?p(!0):y.mutate(),children:y.isPending?"Saving…":"Save"})]}),t.jsx(ie,{isOpen:b,busy:y.isPending,error:y.error,onClose:()=>{p(!1),y.reset()},onConfirm:()=>y.mutate(),title:"Restart the buyer?",confirmLabel:"Save and restart",tone:"primary",body:"These changes need a buyer restart. Requests in flight finish first; new requests wait a few seconds while it reconnects."})]})}const Ge=["general","buyer","observability","tokens","auth"];function Je(){const e=ke();return t.jsx(A,{title:"Gateway",children:t.jsx(z,{query:e,children:s=>t.jsx(le,{items:[["Public URL",s.publicUrl?t.jsx(Pe,{children:s.publicUrl},"u"):t.jsx("span",{className:"gc-muted",children:"Not set. Clients use this console's address."})],["Buyer",s.buyer.reachable?t.jsx(M,{tone:"success",children:"Connected"},"b"):t.jsx(M,{tone:"danger",children:"Unreachable"},"b")],["Sellers seen",String(s.buyer.peers)],["Spend feed",s.spendFeed],["USDC top-ups (x402)",s.x402?"On":"Off"]]})})})}function Ye({settings:e}){const s=e.buyer;return t.jsx(A,{title:"Buyer",description:t.jsxs(t.Fragment,{children:["The top of every routing policy: workspaces, members, keys and presets can only narrow it. Saved to the config file of the buyer on port ",s.proxyPort,ue(s.overrides,"proxyPort")?" (set by its start flags)":"","."]}),children:t.jsx(We,{buyer:s})})}function Xe({settings:e}){const s=re(),r=ne(),n=e.observability,[c,u]=d.useState(n.otlpEndpoint??""),[a,h]=d.useState(De(n.otlpHeaders)),[k,P]=d.useState(n.logContent),[v,S]=d.useState(n.retentionDays===null?"":String(n.retentionDays)),b=c.trim()&&!/^https?:\/\/\S+$/.test(c.trim())?"Use an http:// or https:// URL.":void 0,p=Le(n.otlpEndpoint,c.trim()||null)?_e(a):[],j=p.length?`Enter the value of ${p.join(", ")} again: saved values are not sent to a new endpoint.`:void 0,g=ae({mutationFn:()=>{if(b)throw new Error(b);if(j)throw new Error(j);const l=v===""?null:Number(v);return E.settings.setObservability({otlpEndpoint:c.trim()||null,otlpHeaders:$e(a),logContent:k,retentionDays:l})},onSuccess:l=>{const{restartRequired:m,...o}=l;s.setQueryData(U.settings,o),r(m?"Observability saved. Restart the gateway to apply it.":"Observability saved")},onError:l=>{Te(l,"otlp_headers_required")&&h(Z(a))}});return t.jsx(A,{title:"Observability",description:"Send one OpenTelemetry trace per request, and choose what the request log keeps.",children:t.jsxs("form",{className:"gc-stack",onSubmit:l=>{l.preventDefault(),g.mutate()},children:[t.jsx(O,{label:"OTLP/HTTP endpoint",placeholder:"https://otel.example.com/v1/traces",value:c,error:b,onChange:l=>u(l.target.value)}),t.jsx(oe,{label:"Headers",rows:3,mono:!0,placeholder:"Authorization: Bearer …",value:a,onChange:l=>h(l.target.value),error:j,hint:"One per line, as Name: value. Saved values show as ••••; leave them as they are to keep them (for the same endpoint only)."}),p.length>0&&t.jsx("div",{children:t.jsx(f,{size:"sm",variant:"outline",onClick:()=>h(Z(a)),children:"Clear saved values to re-enter them"})}),t.jsx(I,{checked:k,onChange:P,label:"Store request and response bodies",description:"Off by default. Bodies can contain personal data; only turn this on if you need it."}),t.jsx(B,{label:"Keep the request log for",value:v,onChange:S,options:[{value:"7",label:"7 days"},{value:"30",label:"30 days"},{value:"90",label:"90 days"},{value:"365",label:"1 year"},{value:"",label:"Forever"}]}),g.error?t.jsx($,{error:g.error,title:"Could not save"}):null,t.jsx("div",{className:"gc-actions",children:t.jsx(f,{type:"submit",disabled:g.isPending,children:g.isPending?"Saving…":"Save"})})]})})}function Ze(){const{me:e}=Re(),s=e.member.orgRole==="owner",r=Ce(),[n,c]=d.useState(!1),[u,a]=d.useState(""),[h,k]=d.useState("read"),[P,v]=d.useState("90"),[S,b]=d.useState(null),[p,j]=d.useState(null),g=Q({mutationFn:()=>E.adminTokens.create(u.trim(),h,P==="never"?null:Number(P)),onSuccess:m=>{c(!1),a(""),b(m.secret)},invalidate:[U.adminTokens]}),l=Q({mutationFn:m=>E.adminTokens.revoke(m.id),onSuccess:()=>j(null),invalidate:[U.adminTokens]});return t.jsxs(A,{flush:!0,title:"Management tokens",description:t.jsxs(t.Fragment,{children:["For scripts and CI. Send as ",t.jsx("code",{children:"Authorization: Bearer …"})," to ",t.jsx("code",{children:"/console/api"}),"."]}),actions:t.jsx(f,{size:"sm",leadingIcon:t.jsx(G.plus,{size:14}),onClick:()=>c(!0),children:"New token"}),children:[t.jsx(z,{query:r,children:m=>t.jsx(Fe,{label:"Management tokens",rows:m,rowKey:o=>o.id,rowLabel:o=>o.label,actions:o=>[{label:"Revoke",tone:"danger",onSelect:()=>j(o)}],empty:t.jsx(Ue,{icon:t.jsx(G.keys,{size:18}),title:"No management tokens"}),columns:[{key:"label",header:"Name",render:o=>t.jsx(Ne,{name:o.label,hint:o.hint})},{key:"scope",header:"Scope",render:o=>o.scope==="admin"?t.jsx(M,{tone:"warning",children:"Admin"}):t.jsx(M,{children:"Read only"})},{key:"created",header:"Created",secondary:!0,optional:!0,render:o=>W(o.createdAt)},{key:"expires",header:"Expires",secondary:!0,render:o=>t.jsx(Me,{at:o.expiresAt,format:W})},{key:"used",header:"Last used",secondary:!0,optional:!0,render:o=>Ie(o.lastUsedAt)}]})}),t.jsx(J,{isOpen:n,onClose:()=>c(!1),title:"New management token",children:t.jsxs("form",{className:"gc-stack",onSubmit:m=>{m.preventDefault(),g.mutate()},children:[t.jsx(O,{label:"Name",required:!0,value:u,onChange:m=>a(m.target.value),placeholder:"e.g. Terraform"}),t.jsx(B,{label:"Scope",value:h,onChange:m=>k(m),options:[{value:"read",label:"Read only (GET requests)"},{value:"admin",label:"Admin (everything an org admin can do)"}]}),t.jsx(B,{label:"Expires after",value:P,onChange:v,options:[{value:"30",label:"30 days"},{value:"90",label:"90 days"},{value:"365",label:"1 year"},...s?[{value:"never",label:"Never"}]:[]],hint:"Short-lived tokens limit the damage if one leaks."}),g.error?t.jsx($,{error:g.error,title:"Could not create the token"}):null,t.jsxs("div",{className:"gc-actions",children:[t.jsx(f,{variant:"ghost",onClick:()=>c(!1),children:"Cancel"}),t.jsx(f,{type:"submit",disabled:g.isPending||!u.trim(),children:"Create token"})]})]})}),t.jsx(J,{isOpen:S!==null,onClose:()=>b(null),title:"Token created",children:S&&t.jsxs("div",{className:"gc-stack",children:[t.jsx(qe,{secret:S}),t.jsx("div",{className:"gc-actions",children:t.jsx(f,{onClick:()=>b(null),children:"Done"})})]})}),t.jsx(ie,{isOpen:p!==null,busy:l.isPending,error:l.error,onClose:()=>j(null),onConfirm:()=>p&&l.mutate(p),title:"Revoke this token?",confirmLabel:"Revoke",body:`Anything using ${(p==null?void 0:p.label)??"this token"} loses access immediately.`})]})}function et({settings:e}){const s=e.auth,r=n=>n?t.jsx(M,{tone:"success",children:"On"}):t.jsx(M,{children:"Off"});return t.jsx(A,{title:"Sign-in methods",description:"Configured on the gateway host with environment variables. Read only here.",children:t.jsxs("div",{className:"gc-stack",children:[t.jsx(le,{items:[["Passkeys",r(s.passkey)],["Wallet (Sign-In with Ethereum)",r(s.wallet)],["OpenID Connect",s.oidc?t.jsx(M,{tone:"success",children:s.oidc.label},"o"):r(!1)],["Cloudflare Access",r(s.cloudflareAccess)],["API key view for key holders",r(s.apiKeyLogin)]]}),t.jsx(D,{tone:"info",title:"Using your own identity provider",children:"Set the OpenID Connect issuer, client id and secret in the gateway's environment and restart it, or put the console behind Cloudflare Access and enable trusted Access headers. The gateway docs list the exact variables. Antseed runs no sign-in service of its own."})]})})}function tt({tab:e,settings:s}){return e==="buyer"?t.jsx(Ye,{settings:s}):e==="observability"?t.jsx(Xe,{settings:s}):t.jsx(et,{settings:s})}function mt(){const[e,s]=d.useState(()=>{const n=new URLSearchParams(window.location.search).get("tab");return Ge.includes(n)?n:"general"}),r=Se({queryKey:U.settings,queryFn:E.settings.get});return d.useEffect(()=>{var n;(n=window.scrollTo)==null||n.call(window,0,0)},[e]),t.jsxs("div",{className:"gc-page",children:[t.jsx(je,{title:"Settings"}),t.jsx(Ee,{id:"gc-settings",label:"Settings sections",value:e,onChange:s,tabs:[{id:"general",label:"General"},{id:"buyer",label:"Buyer"},{id:"observability",label:"Observability"},{id:"tokens",label:"Management tokens"},{id:"auth",label:"Sign-in"}]}),t.jsxs(Ae,{tabsId:"gc-settings",tab:e,className:"gc-stack",children:[e==="general"&&t.jsxs(t.Fragment,{children:[t.jsx(Je,{}),t.jsx(we,{})]}),e==="tokens"&&t.jsx(Ze,{}),(e==="buyer"||e==="observability"||e==="auth")&&t.jsx(z,{query:r,children:n=>t.jsx(tt,{tab:e,settings:n})}),r.error&&e==="general"?t.jsx($,{error:r.error}):null]})]})}export{mt as default};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{j as s,r as n}from"./index-DIcymBxc.js";function h({title:e,summary:a,children:c,defaultOpen:i,className:t}){return s.jsxs("details",{className:["as-disclosure",t].filter(Boolean).join(" "),open:i,children:[s.jsxs("summary",{className:"as-disclosure__summary",children:[s.jsx("span",{className:"as-disclosure__title",children:e}),a!=null&&a!==""&&s.jsx("span",{className:"as-disclosure__meta",children:a}),s.jsx("svg",{className:"as-disclosure__chevron",width:"12",height:"12",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:s.jsx("path",{d:"M4 6l4 4 4-4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})]}),s.jsx("div",{className:"as-disclosure__body",children:c})]})}function _({checked:e,onChange:a,label:c,description:i,disabled:t,className:o}){const l=n.useId(),r=n.useId();return s.jsxs("div",{className:["as-switch",o].filter(Boolean).join(" "),children:[s.jsx("button",{id:l,type:"button",role:"switch","aria-checked":e,"aria-describedby":i?r:void 0,disabled:t,className:e?"as-switch__track as-switch__track--on":"as-switch__track",onClick:()=>a(!e),children:s.jsx("span",{className:"as-switch__thumb"})}),s.jsxs("label",{htmlFor:l,className:"as-switch__text",children:[s.jsx("span",{className:"as-switch__label",children:c}),i&&s.jsx("span",{id:r,className:"as-switch__desc",children:i})]})]})}export{h as D,_ as S};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{u as S,n as W,p as L,s as I,r as p,t as A,j as s,P as O,B as b,I as z,l as B,Q as F,v as w,M as C,w as N,x as M,y as D,z as E,A as T,C as q,D as V,q as f,f as v,T as P,o as R}from"./index-DIcymBxc.js";import{u as K,a as Q,P as _}from"./PolicyField-CfRYcr_J.js";import{l as G,d as H,L as U}from"./limits-D8_oE0N-.js";import{D as J}from"./DataTable-BTwj5g1m.js";import"./PolicyEditor-BpoV34ra.js";import"./PeerPicker-BJfjL7Dy.js";import"./SelectField-BWyF8Ku8.js";import"./Segmented-BelxPFkk.js";import"./roving-DkptacxO.js";import"./Switch-BwBYBnSS.js";function X({initial:r,onDone:d}){const{viewer:g}=S(),h=W(g),[i,k]=p.useState((r==null?void 0:r.name)??""),[y,x]=p.useState(G(r==null?void 0:r.limits)),[m,c]=p.useState(""),n=K(r==null?void 0:r.routingPolicy),o=Q(),l=A({mutationFn:()=>{const t={name:i.trim(),limits:H(y),routingPolicy:n.build()};return o.save([t.routingPolicy],e=>{if(r){const{limits:a,...j}=t;return v.workspaces.update(r.id,h?{...j,limits:a}:j,e)}return v.workspaces.create(m.trim()?{...t,buyerIdentity:m.trim()}:t,e)})},onSuccess:d,invalidate:[f.group("workspaces"),f.me],toast:r?"Workspace saved":"Workspace created"}),u=r?"Save":"Create workspace";return s.jsxs("form",{className:"gc-stack",onSubmit:t=>{t.preventDefault(),l.mutate()},children:[s.jsx(P,{label:"Name",required:!0,value:i,onChange:t=>k(t.target.value)}),!r&&s.jsx(P,{label:"Buyer identity (optional)",value:m,onChange:t=>c(t.target.value),hint:"Leave blank to create a new wallet for this workspace. Enter an existing identity name to reuse its wallet."}),h?s.jsxs("div",{children:[s.jsx("div",{className:"as-field__label gc-label-row",children:"Workspace budgets (USD)"}),s.jsx(U,{idPrefix:"ws-limit",value:y,onChange:x})]}):s.jsxs("p",{className:"gc-muted",children:["Budgets: ",E(r==null?void 0:r.limits),". Organization admins set them."]}),s.jsx(_,{draft:n.draft,setDraft:n.setDraft}),l.error?s.jsx(R,{error:l.error,title:"Could not save"}):null,s.jsxs("div",{className:"gc-actions",children:[s.jsx(b,{variant:"ghost",onClick:d,children:"Cancel"}),s.jsx(b,{type:"submit",disabled:l.isPending||!i.trim(),children:l.isPending?"Saving…":u})]}),o.dialog]})}function le(){const{viewer:r,setWorkspaceId:d,workspace:g,me:h}=S(),i=W(r),k=t=>i||h.workspaces.some(e=>e.workspace.id===t.id&&e.role==="admin"),y=L(),x=I(),m=t=>{var e;return(e=x.data)==null?void 0:e.find(a=>a.workspaceId===t.id)},[c,n]=p.useState(null),[o,l]=p.useState(null),u=A({mutationFn:t=>v.workspaces.remove(t.id),onSuccess:()=>l(null),invalidate:[f.group("workspaces"),f.me]});return s.jsxs("div",{className:"gc-page",children:[s.jsx(O,{title:"Workspaces",description:"Each workspace has its own wallet, budgets, routing policy, members and keys.",actions:i&&s.jsx(b,{variant:"brand",leadingIcon:s.jsx(z.plus,{size:14}),onClick:()=>n("new"),children:"New workspace"})}),s.jsx(B,{flush:!0,children:s.jsx(F,{query:y,children:t=>s.jsx(J,{label:"Workspaces",rows:t,rowKey:e=>e.id,rowLabel:e=>e.name,onRowClick:e=>k(e)&&n(e),actions:e=>[e.id!==g.id&&{label:"Open",onSelect:()=>d(e.id)},{label:"Members",onSelect:()=>{d(e.id),D("members")}},k(e)&&{label:"Edit",onSelect:()=>n(e)},i&&!e.isDefault&&{label:"Delete",tone:"danger",onSelect:()=>l(e)}],columns:[{key:"name",header:"Name",sortValue:e=>e.name,render:e=>s.jsxs("span",{className:"gc-strong",children:[e.name," ",e.isDefault&&s.jsx(w,{children:"Default"})," ",e.id===g.id&&s.jsx(w,{tone:"info",children:"Open"})]})},{key:"wallet",header:"Wallet",secondary:!0,render:e=>e.walletAddress?s.jsx(C,{title:e.walletAddress,children:N(e.walletAddress)}):s.jsx("span",{className:"gc-muted",children:e.buyerIdentity})},{key:"operator",header:"Authorized wallet",secondary:!0,render:e=>{const a=m(e);return a?a.relation===null?s.jsx("span",{className:"gc-muted",title:"The wallet or the chain could not be read",children:"unknown"}):M(a)?s.jsxs("span",{className:"gc-inline",children:[s.jsx(w,{tone:"warning",children:"Not set"}),a.canAuthorize&&s.jsx(b,{variant:"link",size:"sm",onClick:j=>{j.stopPropagation(),d(e.id),D("wallet")},children:"Authorize"})]}):a.relation==="self"?s.jsx("span",{className:"gc-muted",children:"Workspace wallet"}):s.jsx(C,{title:a.operator??void 0,children:N(a.operator)}):s.jsx("span",{className:"gc-muted",children:x.isLoading?"…":"—"})}},{key:"members",header:"Members",align:"right",secondary:!0,sortValue:e=>e.memberCount,render:e=>e.memberCount},{key:"keys",header:"Keys",align:"right",sortValue:e=>e.keyCount,render:e=>e.keyCount},{key:"limits",header:"Budgets",secondary:!0,optional:!0,render:e=>s.jsx("span",{className:"gc-muted",children:E(e.limits)})},{key:"policy",header:"Routing",secondary:!0,optional:!0,render:e=>s.jsx("span",{className:"gc-muted",children:T(e.routingPolicy)})}]})})}),s.jsx(q,{isOpen:c!==null,onClose:()=>n(null),size:"lg",title:c==="new"?"New workspace":"Edit workspace",children:c!==null&&s.jsx(X,{initial:c==="new"?null:c,onDone:()=>n(null)})}),s.jsx(V,{isOpen:o!==null,busy:u.isPending,error:u.error,onClose:()=>{l(null),u.reset()},onConfirm:()=>o&&u.mutate(o),title:"Delete this workspace?",confirmLabel:"Delete workspace",body:s.jsxs(s.Fragment,{children:["Deleting ",s.jsx("strong",{children:o==null?void 0:o.name})," is only possible once it has no active keys and no balance. Withdraw funds and revoke keys first."]})})]})}export{le as default};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{j as n,r as i}from"./index-DIcymBxc.js";import{c as f}from"./Chat-CaImcsH1.js";import{c as C}from"./bundle-full-CDQ5iC5h.js";import"./clsx-B-dksMZM.js";import"./stored-CFfx95Ep.js";const j=e=>e&&e&1,v=e=>e&&e&2,N=e=>e&&e&4,T=e=>e.map((t,o)=>({key:`line-${o}`,tokens:t.map((s,r)=>({key:`line-${o}-${r}`,token:s}))})),w=({token:e})=>n.jsx("span",{className:"dark:!bg-[var(--shiki-dark-bg)] dark:!text-[var(--shiki-dark)]",style:{backgroundColor:e.bgColor,color:e.color,fontStyle:j(e.fontStyle)?"italic":void 0,fontWeight:v(e.fontStyle)?"bold":void 0,textDecoration:N(e.fontStyle)?"underline":void 0,...e.htmlStyle},children:e.content}),S=f("block","before:content-[counter(line)]","before:inline-block","before:[counter-increment:line]","before:w-8","before:mr-4","before:text-right","before:text-muted-foreground/50","before:font-mono","before:select-none"),B=({keyedLine:e,showLineNumbers:t})=>n.jsx("span",{className:t?S:"block",children:e.tokens.length===0?`
|
|
2
|
-
`:e.tokens.map(({token:o,key:s})=>n.jsx(w,{token:o},s))}),k=new Map,g=new Map,h=new Map,M=(e,t)=>{const o=e.slice(0,100),s=e.length>100?e.slice(-100):"";return`${t}:${e.length}:${o}:${s}`},L=e=>{const t=k.get(e);if(t)return t;const o=C({langs:[e],themes:["github-light","github-dark"]});return k.set(e,o),o},$=e=>({bg:"transparent",fg:"inherit",tokens:e.split(`
|
|
3
|
-
`).map(t=>t===""?[]:[{color:"inherit",content:t}])}),p=(e,t,o)=>{var c;const s=M(e,t),r=g.get(s);return r||(o&&(h.has(s)||h.set(s,new Set),(c=h.get(s))==null||c.add(o)),L(t).then(a=>{const u=a.getLoadedLanguages().includes(t)?t:"text",l=a.codeToTokens(e,{lang:u,themes:{dark:"github-dark",light:"github-light"}}),m={bg:l.bg??"transparent",fg:l.fg??"inherit",tokens:l.tokens};g.set(s,m);const b=h.get(s);if(b){for(const y of b)y(m);h.delete(s)}}).catch(a=>{console.error("Failed to highlight code:",a),h.delete(s)}),null)},x=i.memo(({tokenized:e,showLineNumbers:t,className:o})=>{const s=i.useMemo(()=>({backgroundColor:e.bg,color:e.fg}),[e.bg,e.fg]),r=i.useMemo(()=>T(e.tokens),[e.tokens]);return n.jsx("pre",{className:f("dark:!bg-[var(--shiki-dark-bg)] dark:!text-[var(--shiki-dark)] m-0 p-4 text-sm",o),style:s,children:n.jsx("code",{className:f("font-mono text-sm",t&&"[counter-increment:line_0] [counter-reset:line]"),children:r.map(c=>n.jsx(B,{keyedLine:c,showLineNumbers:t},c.key))})})},(e,t)=>e.tokenized===t.tokenized&&e.showLineNumbers===t.showLineNumbers&&e.className===t.className);x.displayName="CodeBlockBody";const E=({className:e,language:t,style:o,...s})=>n.jsx("div",{className:f("group relative w-full overflow-hidden rounded-md border bg-background text-foreground",e),"data-language":t,style:{containIntrinsicSize:"auto 200px",contentVisibility:"auto",...o},...s}),R=({code:e,language:t,showLineNumbers:o=!1})=>{const s=i.useMemo(()=>$(e),[e]),r=i.useMemo(()=>p(e,t)??s,[e,t,s]),[c,a]=i.useState(null),d=i.useRef({code:e,language:t});(d.current.code!==e||d.current.language!==t)&&(d.current={code:e,language:t},a(null)),i.useEffect(()=>{let l=!1;return p(e,t,m=>{l||a(m)}),()=>{l=!0}},[e,t]);const u=c??r;return n.jsx("div",{className:"relative overflow-auto",children:n.jsx(x,{showLineNumbers:o,tokenized:u})})},I=({code:e,language:t,showLineNumbers:o=!1,className:s,children:r,...c})=>n.jsxs(E,{className:s,language:t,...c,children:[r,n.jsx(R,{code:e,language:t,showLineNumbers:o})]});export{I as CodeBlock};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{w as o}from"./core-LDeQm5nv.js";import"./index-DIcymBxc.js";import"./index.es-0kjt2ETS.js";import"./events-DQ172AOg.js";import"./en_US-Y4ZOVFV4-CmhP8GU2.js";import"./clsx-B-dksMZM.js";import"./index-BhwNCc8y.js";const n=o` <svg fill="none" viewBox="0 0 13 4">
|
|
2
|
-
<path fill="currentColor" d="M.5 0h12L8.9 3.13a3.76 3.76 0 0 1-4.8 0L.5 0Z" />
|
|
3
|
-
</svg>`;export{n as cursorSvg};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{S as d,F as H,a as N}from"./mermaid-MCJ5UELQ-Cr83KTfF.js";import{r as s,j}from"./index-DIcymBxc.js";import"./bundle-full-CDQ5iC5h.js";import"./clsx-B-dksMZM.js";import"./Chat-CaImcsH1.js";import"./stored-CFfx95Ep.js";var F=({code:i,isIncomplete:o=!1,language:e,maxHeight:u,raw:t,className:g,startLine:p,lineNumbers:c,...h})=>{let{shikiTheme:m}=s.useContext(d),r=H(),[x,a]=s.useState(t);return s.useEffect(()=>{if(!r){a(t);return}let l=!0,n=r.highlight({code:i,isIncomplete:o,language:e,themes:m},f=>{l&&a(f)});return n&&a(n),()=>{l=!1}},[i,o,e,m,r,t]),j.jsx(N,{className:g,language:e,lineNumbers:c,maxHeight:u,result:x,startLine:p,...h})};export{F as HighlightedCodeBlockBody};
|