@antseed/gateway-console 0.1.1 → 0.1.2
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-aMw4GLn_.js → Activity-BHckTctH.js} +1 -1
- package/dist/assets/{Audit-CCre2vZ2.js → Audit-CheQE0ki.js} +1 -1
- package/dist/assets/{ChainGate-rOjMTVIg.js → ChainGate-BO2NzC31.js} +1 -1
- package/dist/assets/{ChannelClose-DkQxS0-Z.js → ChannelClose-ODGHySRH.js} +1 -1
- package/dist/assets/{Charts-NmIMcccv.js → Charts-CrCKBk_i.js} +1 -1
- package/dist/assets/{ConnectWallet-QN7kfDQq.js → ConnectWallet-BqD3R1R9.js} +1 -1
- package/dist/assets/{DataTable-D2QIQ-gI.js → DataTable-B36eMErM.js} +1 -1
- package/dist/assets/{Disclosure-h1MJg5Wn.js → Disclosure-DS6GTz8G.js} +1 -1
- package/dist/assets/{KeyHolder-DUhCBfBH.js → KeyHolder-CG5sSLQK.js} +1 -1
- package/dist/assets/{Keys-DIlH-qns.js → Keys-Cxz0K09V.js} +1 -1
- package/dist/assets/{Logs-BPrDGUHL.js → Logs-DV-trPqy.js} +1 -1
- package/dist/assets/{Members-Cud9TWBJ.js → Members-Cp_3A-Dy.js} +1 -1
- package/dist/assets/{Migrate-DEIQ12oJ.js → Migrate-BD-0-NY-.js} +1 -1
- package/dist/assets/{Models-DXI7RYae.js → Models-DHeLeAiN.js} +1 -1
- package/dist/assets/{OperatorActions-BC74iRfA.js → OperatorActions-Bety6436.js} +1 -1
- package/dist/assets/{OperatorGateAlert-CIQwPW1h.js → OperatorGateAlert-Jd5E0V_d.js} +1 -1
- package/dist/assets/{Overview-ipvNEEut.js → Overview-37mja3y-.js} +1 -1
- package/dist/assets/{PolicyEditor-CRhTwGq0.js → PolicyEditor-B5BAs2vC.js} +1 -1
- package/dist/assets/{PolicyField-0xAOIP4-.js → PolicyField-D7O5D7fl.js} +1 -1
- package/dist/assets/{Presets-DrJ48O3s.js → Presets-CgfFG3fw.js} +1 -1
- package/dist/assets/{Providers-CcIj0C5E.js → Providers-sZFgSVHV.js} +1 -1
- package/dist/assets/{RequestLog-CBZWWnHo.js → RequestLog-BbR8E_9_.js} +1 -1
- package/dist/assets/{Rewards-CUru480X.js → Rewards-CuWsg5m7.js} +2 -2
- package/dist/assets/{RewardsClaim-BjwCidx5.js → RewardsClaim-CRgTiF93.js} +1 -1
- package/dist/assets/{Routing-BO7JFJGH.js → Routing-BebcQMko.js} +1 -1
- package/dist/assets/{Segmented-BJmgB5-Y.js → Segmented-C9jux-Mr.js} +1 -1
- package/dist/assets/{SelectField-D_BPTzpT.js → SelectField-BSNXjRiC.js} +1 -1
- package/dist/assets/{Settings-qFQk36WV.js → Settings-BLIkiFNw.js} +1 -1
- package/dist/assets/{Switch-JCyfy3G5.js → Switch-hSHNLapF.js} +1 -1
- package/dist/assets/{Tabs-CGI9v1OW.js → Tabs-Dle_Eq4t.js} +1 -1
- package/dist/assets/{TextAreaField-4JuDDT4k.js → TextAreaField-9B3_7w3L.js} +1 -1
- package/dist/assets/{UsageByModel-jvNkVE4M.js → UsageByModel-6qZIqVRY.js} +1 -1
- package/dist/assets/{Wallet-tlCKFe2Q.js → Wallet-BbwYd9fm.js} +3 -3
- package/dist/assets/{WalletConfirm-Dz6gVYW9.js → WalletConfirm-Dm8Lr6DT.js} +1 -1
- package/dist/assets/{WalletFunding-NSKzSiY5.js → WalletFunding-CSVVBvPP.js} +1 -1
- package/dist/assets/{WalletSignIn-Bs_yxjak.js → WalletSignIn-DLX6sQbD.js} +1 -1
- package/dist/assets/{Workspaces-C79eSjJK.js → Workspaces-DZmGjFFI.js} +1 -1
- package/dist/assets/{add-CxYxphqt.js → add-DXI2Cp6k.js} +1 -1
- package/dist/assets/{all-wallets-BSHfFrwc.js → all-wallets-LQt3S9MV.js} +1 -1
- package/dist/assets/{app-store-DzDsfjeG.js → app-store-CRiNXiqm.js} +1 -1
- package/dist/assets/{apple-N_ET94Rt.js → apple-BXH3yGFL.js} +1 -1
- package/dist/assets/{arrow-bottom-U6RBQjWC.js → arrow-bottom-D3S4BxFo.js} +1 -1
- package/dist/assets/{arrow-bottom-circle-tDeqZ1Ky.js → arrow-bottom-circle-Zukia-8I.js} +1 -1
- package/dist/assets/{arrow-left-BShNPqIx.js → arrow-left-DHP2QErV.js} +1 -1
- package/dist/assets/{arrow-right-CNSfQOzD.js → arrow-right-Co_bi7Vn.js} +1 -1
- package/dist/assets/{arrow-top-DV_peLyo.js → arrow-top-D3hEtyvW.js} +1 -1
- package/dist/assets/{bank-CBIxfTrG.js → bank-CZ3b6K7o.js} +1 -1
- package/dist/assets/{basic-N6vekuGx.js → basic-nJtiapU4.js} +1 -1
- package/dist/assets/{browser-CSb6b6iQ.js → browser-CRgINMXV.js} +1 -1
- package/dist/assets/{card-DrFIu-YX.js → card-ZwByuY3V.js} +1 -1
- package/dist/assets/{ccip-kqAjTfpP.js → ccip-DpVxliwq.js} +1 -1
- package/dist/assets/{checkmark-CjzmzCYU.js → checkmark-BS_v4cXd.js} +1 -1
- package/dist/assets/{checkmark-bold-B66sPzPs.js → checkmark-bold-gJWlj_By.js} +1 -1
- package/dist/assets/{chevron-bottom--JM7vIl_.js → chevron-bottom-DB25HS1C.js} +1 -1
- package/dist/assets/{chevron-left-CPo0GZiC.js → chevron-left-nQo8fTuX.js} +1 -1
- package/dist/assets/{chevron-right-BgXTpiHp.js → chevron-right-D18s-hRU.js} +1 -1
- package/dist/assets/{chevron-top-BDxNAlrf.js → chevron-top-Dj1C_edY.js} +1 -1
- package/dist/assets/{chrome-store-BCPQdBXr.js → chrome-store-BM7Ft7N1.js} +1 -1
- package/dist/assets/{clock-B7Udw_0s.js → clock-Gp9Oq3uQ.js} +1 -1
- package/dist/assets/{close-ClhMnzas.js → close-CvZGqQc2.js} +1 -1
- package/dist/assets/{coinPlaceholder-Bsvaf8UD.js → coinPlaceholder-CxGDG0FR.js} +1 -1
- package/dist/assets/{compass-CtgRkLwG.js → compass-D_QgO5G3.js} +1 -1
- package/dist/assets/{copy-Cju_aL0g.js → copy-ClteGnkV.js} +1 -1
- package/dist/assets/{core-Dv4ivRNs.js → core-BGzEHhOa.js} +3 -3
- package/dist/assets/cursor-CrB_GPgJ.js +3 -0
- package/dist/assets/{cursor-transparent-A0O6SzCH.js → cursor-transparent-D2iBVjlE.js} +1 -1
- package/dist/assets/{desktop-CuYleYi9.js → desktop-C7ehLazj.js} +1 -1
- package/dist/assets/{disconnect-UdfoNj_d.js → disconnect-DfCN-2S3.js} +1 -1
- package/dist/assets/{discord-CBP0IyFM.js → discord-wpQmn3Vb.js} +1 -1
- package/dist/assets/{en_US-Y4ZOVFV4-3vDquI1C.js → en_US-Y4ZOVFV4-BuTiJwkw.js} +4 -4
- package/dist/assets/{etherscan-PHAlrHol.js → etherscan-2pj2VsLB.js} +1 -1
- package/dist/assets/{exclamation-triangle-udtYedHZ.js → exclamation-triangle-D3kTTS0o.js} +1 -1
- package/dist/assets/{extension-BSfnWZTn.js → extension-BaGxTMr_.js} +1 -1
- package/dist/assets/{external-link-BhINeBf6.js → external-link-DPkcev-7.js} +1 -1
- package/dist/assets/{facebook-DPMSywQV.js → facebook-B-3uuPNQ.js} +1 -1
- package/dist/assets/{farcaster-BgZocY3-.js → farcaster-CP4KBXgf.js} +1 -1
- package/dist/assets/{filters-H_ETj-7w.js → filters-DayLkPQN.js} +1 -1
- package/dist/assets/{github-Dnt_pb3p.js → github-nb58vW5j.js} +1 -1
- package/dist/assets/{google-Mu_8pwD-.js → google-Cbr4pP2d.js} +1 -1
- package/dist/assets/{help-circle-DRVJ-8K8.js → help-circle-dO8TgJbO.js} +1 -1
- package/dist/assets/{highlighted-body-KQOG7T2V-ClwcaYX1.js → highlighted-body-KQOG7T2V-D_9pxxPW.js} +1 -1
- package/dist/assets/{id-DXjcfKMm.js → id-FL_XAzzL.js} +1 -1
- package/dist/assets/{image-Bhqm-9NV.js → image-D0cgJ5JG.js} +1 -1
- package/dist/assets/{index-C21bvTBH.js → index-BjRmy3XE.js} +3 -3
- package/dist/assets/{index-BrcuwiCz.js → index-Bv4ef0pT.js} +1 -1
- package/dist/assets/{index-C9wUwD4n.js → index-CWuVUb-3.js} +3 -3
- package/dist/assets/{index-U4U6E7fq.css → index-CqEPMnZS.css} +1 -1
- package/dist/assets/{index-DNA9wtqn.js → index-DvqgpSC-.js} +1 -1
- package/dist/assets/{index-CR02SnS1.js → index-Vg8tZZdB.js} +1 -1
- package/dist/assets/index-iM-80gy8.js +1 -0
- package/dist/assets/{index.es-DX2eegnP.js → index.es-D7XOFxw2.js} +4 -4
- package/dist/assets/{info-BaRtFUwf.js → info-DtK2iYRv.js} +1 -1
- package/dist/assets/{info-circle-Bsl8G0Ii.js → info-circle-D7UwRt4U.js} +1 -1
- package/dist/assets/{lightbulb-BlV4kI0m.js → lightbulb-ClVdo2zx.js} +1 -1
- package/dist/assets/{limits-D_C7APR_.js → limits-BjBtkRFh.js} +1 -1
- package/dist/assets/{mail-BPcY_N8f.js → mail-D7xIfGjE.js} +1 -1
- package/dist/assets/{mermaid-MCJ5UELQ-DAirhLo4.js → mermaid-MCJ5UELQ-DTUKqcxP.js} +8 -8
- package/dist/assets/{metamask-sdk-B0WxSi8v.js → metamask-sdk-BFHzYYth.js} +1 -1
- package/dist/assets/{mobile-9_L4G6Kz.js → mobile-oyVoYDtW.js} +1 -1
- package/dist/assets/{models-BpLCh6Fr.js → models-D5AfPpBK.js} +1 -1
- package/dist/assets/{more-BMrrxkhZ.js → more-DWZmSEse.js} +1 -1
- package/dist/assets/{network-placeholder-CYXkxcyL.js → network-placeholder-DkrrPbIk.js} +1 -1
- package/dist/assets/{nftPlaceholder-CfIu_Ovu.js → nftPlaceholder-y-NnnMjT.js} +1 -1
- package/dist/assets/{off-BpqSEfQB.js → off-Bq6ESslh.js} +1 -1
- package/dist/assets/{play-store-BKqBXU1V.js → play-store-BVSRtmaK.js} +1 -1
- package/dist/assets/{plus-CSgT3KZh.js → plus-CiV0r3Hz.js} +1 -1
- package/dist/assets/{qr-code-edbLJ8Gf.js → qr-code-CQuLdjAg.js} +1 -1
- package/dist/assets/{recycle-horizontal-CuX0JB4-.js → recycle-horizontal-Dz6rR748.js} +1 -1
- package/dist/assets/{refresh-Dq45LHYF.js → refresh-DNo0Vden.js} +1 -1
- package/dist/assets/{reown-logo-CRobwYXY.js → reown-logo-sOWGngZq.js} +1 -1
- package/dist/assets/{search-gYoog0zk.js → search-rho6BP4J.js} +1 -1
- package/dist/assets/{secp256k1-uRM0t8uf.js → secp256k1-eMq7yeYD.js} +1 -1
- package/dist/assets/{send-Pm4IO0Hs.js → send-DxwNodDV.js} +1 -1
- package/dist/assets/{swapHorizontal-DhCZ210V.js → swapHorizontal-CJ1qgU06.js} +1 -1
- package/dist/assets/{swapHorizontalBold-DHO5cxVU.js → swapHorizontalBold-G3QDMS0U.js} +1 -1
- package/dist/assets/{swapHorizontalMedium-VGtbzLgi.js → swapHorizontalMedium-CRUvBpIN.js} +1 -1
- package/dist/assets/{swapHorizontalRoundedBold-6HTAC2Np.js → swapHorizontalRoundedBold-DOVIZTm_.js} +1 -1
- package/dist/assets/{swapVertical-Dg6bMEa-.js → swapVertical-KviDiZLh.js} +1 -1
- package/dist/assets/{telegram-CHXgC-Jw.js → telegram-96Q1zZ7u.js} +1 -1
- package/dist/assets/{three-dots-MixBEg-b.js → three-dots-CLIQcjDl.js} +1 -1
- package/dist/assets/{twitch-CWrx7ZD7.js → twitch-8bwY5wnt.js} +1 -1
- package/dist/assets/{twitterIcon-Vrp2iWQv.js → twitterIcon-yigFfTCz.js} +1 -1
- package/dist/assets/{usage-MPZYg7D2.js → usage-4421Rf6_.js} +1 -1
- package/dist/assets/{useInfiniteQuery-Bpu8bc5A.js → useInfiniteQuery-DXLHm6RI.js} +1 -1
- package/dist/assets/{useTx-Cp52G7Yo.js → useTx-JDF5s1ox.js} +1 -1
- package/dist/assets/{verify-Cv1Ie02p.js → verify-BvV_kZ_V.js} +1 -1
- package/dist/assets/{verify-filled-D4Of1TFY.js → verify-filled-D31I1gjO.js} +1 -1
- package/dist/assets/{w3m-modal-B8kvY5hN.js → w3m-modal-BSlq8p9f.js} +1 -1
- package/dist/assets/{wallet-uxpqh3A6.js → wallet-CBsAqlQ7.js} +1 -1
- package/dist/assets/{wallet-placeholder-C-l2svWA.js → wallet-placeholder-DHTeowzX.js} +1 -1
- package/dist/assets/{walletconnect-0CplSxZT.js → walletconnect-CR_egxhB.js} +1 -1
- package/dist/assets/{warning-circle-gLBXgr6A.js → warning-circle-BP-YPvjB.js} +1 -1
- package/dist/assets/{x-C17dW4I6.js → x-CpVuDSxb.js} +1 -1
- package/dist/index.html +3 -3
- package/package.json +3 -3
- package/dist/assets/cursor-D3NwpSI9.js +0 -3
- package/dist/assets/index-DqHGr8d4.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/WalletSignIn-
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/WalletSignIn-DLX6sQbD.js","assets/en_US-Y4ZOVFV4-BuTiJwkw.js","assets/clsx-B-dksMZM.js","assets/index-iM-80gy8.js","assets/index-BwpQbdIU.js","assets/en_US-Y4ZOVFV4-CcVPgXVa.css","assets/WalletConfirm-Dm8Lr6DT.js","assets/ConnectWallet-BqD3R1R9.js","assets/Overview-37mja3y-.js","assets/UsageByModel-6qZIqVRY.js","assets/usage-4421Rf6_.js","assets/Charts-CrCKBk_i.js","assets/Segmented-C9jux-Mr.js","assets/roving-DkptacxO.js","assets/mermaid-MCJ5UELQ-DTUKqcxP.js","assets/mermaid-MCJ5UELQ-BFJCTi2D.css","assets/Activity-BHckTctH.js","assets/SelectField-BSNXjRiC.js","assets/DataTable-B36eMErM.js","assets/Logs-DV-trPqy.js","assets/RequestLog-BbR8E_9_.js","assets/useInfiniteQuery-DXLHm6RI.js","assets/dates-Pi3-Ywng.js","assets/Keys-Cxz0K09V.js","assets/PolicyField-D7O5D7fl.js","assets/PolicyEditor-B5BAs2vC.js","assets/Switch-hSHNLapF.js","assets/Disclosure-DS6GTz8G.js","assets/Tabs-Dle_Eq4t.js","assets/limits-BjBtkRFh.js","assets/Members-Cp_3A-Dy.js","assets/Workspaces-DZmGjFFI.js","assets/Wallet-BbwYd9fm.js","assets/ChainGate-BO2NzC31.js","assets/dijkstra-COg3n3zL.js","assets/Rewards-CuWsg5m7.js","assets/ants-B38m9Phv.js","assets/Providers-sZFgSVHV.js","assets/models-D5AfPpBK.js","assets/Presets-CgfFG3fw.js","assets/TextAreaField-9B3_7w3L.js","assets/Models-DHeLeAiN.js","assets/Routing-BebcQMko.js","assets/Audit-CheQE0ki.js","assets/Settings-BLIkiFNw.js","assets/KeyHolder-CG5sSLQK.js"])))=>i.map(i=>d[i]);
|
|
2
2
|
var t1=Object.defineProperty;var Kh=t=>{throw TypeError(t)};var n1=(t,r,i)=>r in t?t1(t,r,{enumerable:!0,configurable:!0,writable:!0,value:i}):t[r]=i;var wu=(t,r,i)=>n1(t,typeof r!="symbol"?r+"":r,i),xu=(t,r,i)=>r.has(t)||Kh("Cannot "+i);var S=(t,r,i)=>(xu(t,r,"read from private field"),i?i.call(t):r.get(t)),re=(t,r,i)=>r.has(t)?Kh("Cannot add the same private member more than once"):r instanceof WeakSet?r.add(t):r.set(t,i),K=(t,r,i,a)=>(xu(t,r,"write to private field"),a?a.call(t,i):r.set(t,i),i),ce=(t,r,i)=>(xu(t,r,"access private method"),i);var Xs=(t,r,i,a)=>({set _(u){K(t,r,u,i)},get _(){return S(t,r,a)}});function r1(t,r){for(var i=0;i<r.length;i++){const a=r[i];if(typeof a!="string"&&!Array.isArray(a)){for(const u in a)if(u!=="default"&&!(u in t)){const d=Object.getOwnPropertyDescriptor(a,u);d&&Object.defineProperty(t,u,d.get?d:{enumerable:!0,get:()=>a[u]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const r=document.createElement("link").relList;if(r&&r.supports&&r.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))a(u);new MutationObserver(u=>{for(const d of u)if(d.type==="childList")for(const m of d.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&a(m)}).observe(document,{childList:!0,subtree:!0});function i(u){const d={};return u.integrity&&(d.integrity=u.integrity),u.referrerPolicy&&(d.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?d.credentials="include":u.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function a(u){if(u.ep)return;u.ep=!0;const d=i(u);fetch(u.href,d)}})();const i1="modulepreload",o1=function(t){return"/console/"+t},Qh={},Ve=function(r,i,a){let u=Promise.resolve();if(i&&i.length>0){let m=function(h){return Promise.all(h.map(y=>Promise.resolve(y).then(x=>({status:"fulfilled",value:x}),x=>({status:"rejected",reason:x}))))};document.getElementsByTagName("link");const v=document.querySelector("meta[property=csp-nonce]"),g=(v==null?void 0:v.nonce)||(v==null?void 0:v.getAttribute("nonce"));u=m(i.map(h=>{if(h=o1(h),h in Qh)return;Qh[h]=!0;const y=h.endsWith(".css"),x=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${h}"]${x}`))return;const C=document.createElement("link");if(C.rel=y?"stylesheet":i1,y||(C.as="script"),C.crossOrigin="",C.href=h,g&&C.setAttribute("nonce",g),document.head.appendChild(C),y)return new Promise((I,L)=>{C.addEventListener("load",I),C.addEventListener("error",()=>L(new Error(`Unable to preload CSS for ${h}`)))})}))}function d(m){const v=new Event("vite:preloadError",{cancelable:!0});if(v.payload=m,window.dispatchEvent(v),!v.defaultPrevented)throw m}return u.then(m=>{for(const v of m||[])v.status==="rejected"&&d(v.reason);return r().catch(d)})};var pk=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function s1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function mk(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var r=t.default;if(typeof r=="function"){var i=function a(){return this instanceof a?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};i.prototype=r.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(t).forEach(function(a){var u=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(i,a,u.get?u:{enumerable:!0,get:function(){return t[a]}})}),i}var Su={exports:{}},ko={},ku={exports:{}},pe={};/**
|
|
3
3
|
* @license React
|
|
4
4
|
* react.production.min.js
|
|
@@ -80,7 +80,7 @@ Error generating stack: `+c.message+`
|
|
|
80
80
|
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
81
81
|
`)},z0=0,ci=[];function $0(t){var r=R.useRef([]),i=R.useRef([0,0]),a=R.useRef(),u=R.useState(z0++)[0],d=R.useState(ev)[0],m=R.useRef(t);R.useEffect(function(){m.current=t},[t]),R.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(u));var _=ow([t.lockRef.current],(t.shards||[]).map(_p),!0).filter(Boolean);return _.forEach(function(M){return M.classList.add("allow-interactivity-".concat(u))}),function(){document.body.classList.remove("block-interactivity-".concat(u)),_.forEach(function(M){return M.classList.remove("allow-interactivity-".concat(u))})}}},[t.inert,t.lockRef.current,t.shards]);var v=R.useCallback(function(_,M){if("touches"in _&&_.touches.length===2||_.type==="wheel"&&_.ctrlKey)return!m.current.allowPinchZoom;var D=na(_),U=i.current,b="deltaX"in _?_.deltaX:U[0]-D[0],T="deltaY"in _?_.deltaY:U[1]-D[1],A,q=_.target,ie=Math.abs(b)>Math.abs(T)?"h":"v";if("touches"in _&&ie==="h"&&q.type==="range")return!1;var Q=window.getSelection(),ne=Q&&Q.anchorNode,ae=ne?ne===q||ne.contains(q):!1;if(ae)return!1;var V=Cp(ie,q);if(!V)return!0;if(V?A=ie:(A=ie==="v"?"h":"v",V=Cp(ie,q)),!V)return!1;if(!a.current&&"changedTouches"in _&&(b||T)&&(a.current=A),!A)return!0;var de=a.current||A;return A0(de,M,_,de==="h"?b:T)},[]),g=R.useCallback(function(_){var M=_;if(!(!ci.length||ci[ci.length-1]!==d)){var D="deltaY"in M?Ep(M):na(M),U=r.current.filter(function(A){return A.name===M.type&&(A.target===M.target||M.target===A.shadowParent)&&D0(A.delta,D)})[0];if(U&&U.should){M.cancelable&&M.preventDefault();return}if(!U){var b=(m.current.shards||[]).map(_p).filter(Boolean).filter(function(A){return A.contains(M.target)}),T=b.length>0?v(M,b[0]):!m.current.noIsolation;T&&M.cancelable&&M.preventDefault()}}},[]),h=R.useCallback(function(_,M,D,U){var b={name:_,delta:M,target:D,should:U,shadowParent:U0(D)};r.current.push(b),setTimeout(function(){r.current=r.current.filter(function(T){return T!==b})},1)},[]),y=R.useCallback(function(_){i.current=na(_),a.current=void 0},[]),x=R.useCallback(function(_){h(_.type,Ep(_),_.target,v(_,t.lockRef.current))},[]),C=R.useCallback(function(_){h(_.type,na(_),_.target,v(_,t.lockRef.current))},[]);R.useEffect(function(){return ci.push(d),t.setCallbacks({onScrollCapture:x,onWheelCapture:x,onTouchMoveCapture:C}),document.addEventListener("wheel",g,ui),document.addEventListener("touchmove",g,ui),document.addEventListener("touchstart",y,ui),function(){ci=ci.filter(function(_){return _!==d}),document.removeEventListener("wheel",g,ui),document.removeEventListener("touchmove",g,ui),document.removeEventListener("touchstart",y,ui)}},[]);var I=t.removeScrollBar,L=t.inert;return R.createElement(R.Fragment,null,L?R.createElement(d,{styles:F0(u)}):null,I?R.createElement(T0,{noRelative:t.noRelative,gapMode:t.gapMode}):null)}function U0(t){for(var r=null;t!==null;)t instanceof ShadowRoot&&(r=t.host,t=t.host),t=t.parentNode;return r}const B0=sw(Jm,$0);var Fc=R.forwardRef(function(t,r){return R.createElement(ka,rn({},t,{ref:r,sideCar:B0}))});Fc.classNames=ka.classNames;var iv=function(t){if(typeof document>"u")return null;var r=Array.isArray(t)?t[0]:t;return r.ownerDocument.body},di=new WeakMap,ra=new WeakMap,ia={},Mu=0,ov=function(t){return t&&(t.host||ov(t.parentNode))},H0=function(t,r){return r.map(function(i){if(t.contains(i))return i;var a=ov(i);return a&&t.contains(a)?a:(console.error("aria-hidden",i,"in not contained inside",t,". Doing nothing"),null)}).filter(function(i){return!!i})},sv=function(t,r,i,a){var u=H0(r,Array.isArray(t)?t:[t]);ia[i]||(ia[i]=new WeakMap);var d=ia[i],m=[],v=new Set,g=new Set(u),h=function(x){!x||v.has(x)||(v.add(x),h(x.parentNode))};u.forEach(h);var y=function(x){!x||g.has(x)||Array.prototype.forEach.call(x.children,function(C){if(v.has(C))y(C);else try{var I=C.getAttribute(a),L=I!==null&&I!=="false",_=(di.get(C)||0)+1,M=(d.get(C)||0)+1;di.set(C,_),d.set(C,M),m.push(C),_===1&&L&&ra.set(C,!0),M===1&&C.setAttribute(i,"true"),L||C.setAttribute(a,"true")}catch(D){console.error("aria-hidden: cannot operate on ",C,D)}})};return y(r),v.clear(),Mu++,function(){m.forEach(function(x){var C=di.get(x)-1,I=d.get(x)-1;di.set(x,C),d.set(x,I),C||(ra.has(x)||x.removeAttribute(a),ra.delete(x)),I||x.removeAttribute(i)}),Mu--,Mu||(di=new WeakMap,di=new WeakMap,ra=new WeakMap,ia={})}},W0=function(t,r,i){i===void 0&&(i="data-aria-hidden");var a=Array.from(Array.isArray(t)?t:[t]),u=r||iv(t);return u?(a.push.apply(a,Array.from(u.querySelectorAll("[aria-live], script"))),sv(a,u,i,"aria-hidden")):function(){return null}},V0=function(t,r,i){i===void 0&&(i="data-inert-ed");var a=r||iv(t);return a?sv(t,a,i,"inert"):function(){return null}},q0=function(){return typeof HTMLElement<"u"&&HTMLElement.prototype.hasOwnProperty("inert")},K0=function(t,r,i){return i===void 0&&(i="data-suppressed"),(q0()?V0:W0)(t,r,i)};let Nr=[];const oc=new Set;function av(){oc.forEach(t=>t())}function Q0(t){Nr=Nr.filter(r=>r!==t),Nr.push(t),av()}function G0(t){Nr=Nr.filter(r=>r!==t),av()}function Ou(t){return Nr[Nr.length-1]===t}function lv(t,r,i){const a=R.useRef(i),u=R.useRef(null),[d,m]=R.useState(!1);R.useEffect(()=>{a.current=i},[i]);const v=R.useCallback(()=>{const h=u.current;u.current=null,h&&document.contains(h)&&h.focus({preventScroll:!0})},[]),g=R.useCallback(()=>{a.current()},[]);return R.useEffect(()=>{if(!t)return;const h=r.current;if(!h)return;const y=h;u.current=document.activeElement instanceof HTMLElement?document.activeElement:null,Q0(y),m(Ou(y));function x(){m(Ou(y))}function C(I){if(!Ou(y))return;const L=I.target instanceof Element?I.target:null,_=L==null?void 0:L.closest('[role="dialog"]');_&&_!==y&&!y.contains(_)||I.key==="Escape"&&(I.preventDefault(),I.stopPropagation(),I.stopImmediatePropagation(),g())}return oc.add(x),window.addEventListener("keydown",C,!0),()=>{window.removeEventListener("keydown",C,!0),oc.delete(x),G0(y),v()}},[g,t,r,v]),R.useEffect(()=>{var x,C;if(!t||!d)return;const h=r.current;if(!h)return;const y=((C=(x=h.parentElement)==null?void 0:x.parentElement)==null?void 0:C.querySelectorAll("[data-focus-guard]"))??[];return K0([h,...y])},[t,d,r]),{closeDialog:g,isTopDialog:d}}const Y0={sm:"24rem",md:"28.75rem",lg:"35rem",xl:"52rem"};function Z0(){return f.jsx("svg",{width:"14",height:"14",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:f.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}function uv({bodyClassName:t,children:r,className:i,closeLabel:a="Close",eyebrow:u,footer:d,isOpen:m,onClose:v,overlayClassName:g,size:h="md",subtitle:y,title:x}){const C=R.useRef(null),I=R.useId(),L=R.useId(),{closeDialog:_,isTopDialog:M}=lv(m,C,v);if(!m)return null;const D=["as-modal-overlay",g].filter(Boolean).join(" "),U=["as-modal",`as-modal--${h}`,i].filter(Boolean).join(" "),b=["as-modal__body",t].filter(Boolean).join(" "),T={"--as-modal-width":Y0[h]};return f.jsx("div",{className:D,role:"presentation",onMouseDown:_,children:f.jsx(Fc,{allowPinchZoom:!0,className:"as-modal__scroll-lock",enabled:M,style:T,children:f.jsx(Dc,{autoFocus:!0,className:"as-modal__focus-lock",disabled:!M,focusOptions:{preventScroll:!0},returnFocus:!1,children:f.jsxs("div",{"aria-describedby":y?L:void 0,"aria-hidden":M?void 0:!0,"aria-labelledby":I,"aria-modal":M?"true":void 0,className:U,ref:C,role:"dialog",tabIndex:-1,onMouseDown:A=>A.stopPropagation(),children:[f.jsxs("header",{className:"as-modal__header",children:[f.jsxs("div",{className:"as-modal__titles",children:[u&&f.jsx("div",{className:"as-modal__eyebrow",children:u}),f.jsx("h2",{className:"as-modal__title",id:I,children:x}),y&&f.jsx("p",{className:"as-modal__subtitle",id:L,children:y})]}),f.jsx(X0,{label:a,className:"as-modal__close",onClick:_,children:f.jsx(Z0,{})})]}),f.jsx("div",{className:b,children:r}),d&&f.jsx("footer",{className:"as-modal__footer",children:d})]})})})})}function X0({children:t,className:r,label:i,onClick:a}){return f.jsx("button",{type:"button",className:r,onClick:a,"aria-label":i,children:t})}function J0(t){return t instanceof Error?t.message:typeof t=="string"?t:t&&typeof t=="object"&&"message"in t&&typeof t.message=="string"?t.message:"Something went wrong."}function e2({isOpen:t,title:r,body:i,confirmLabel:a="Confirm",cancelLabel:u="Cancel",busyLabel:d="Working…",tone:m="danger",busy:v,error:g,errorTitle:h="That did not work",confirmDisabled:y,onConfirm:x,onClose:C}){return f.jsx(uv,{isOpen:t,onClose:v?()=>{}:C,title:r,size:"sm",children:f.jsxs("div",{className:"as-confirm",children:[f.jsx("div",{className:"as-confirm__body",children:i}),g?f.jsx(at,{tone:"danger",title:h,children:J0(g)}):null,f.jsxs("div",{className:"as-confirm__actions",children:[f.jsx(De,{variant:"ghost",onClick:C,disabled:v,children:u}),f.jsx(De,{variant:m,onClick:x,disabled:v||y,children:v?d:a})]})]})})}function Uo({children:t,className:r,label:i,size:a="md",type:u="button",...d}){const m=["as-icon-button",a==="sm"?"as-icon-button--sm":null,r].filter(Boolean).join(" ");return f.jsx("button",{type:u,className:m,"aria-label":i,title:d.title??i,...d,children:t})}async function cv(t){try{return await navigator.clipboard.writeText(t),!0}catch{return!1}}function Pp(){return f.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[f.jsx("rect",{x:"9",y:"9",width:"12",height:"12",rx:"2"}),f.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h10"})]})}function bp(){return f.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:f.jsx("path",{d:"m5 12 5 5L20 7"})})}function zc({value:t,label:r="Copy",copiedLabel:i="Copied",size:a="sm",variant:u="outline",className:d,iconOnly:m,onCopied:v}){const[g,h]=R.useState(!1),y=R.useRef(void 0);R.useEffect(()=>()=>window.clearTimeout(y.current),[]);const x=async()=>{await cv(t)&&(h(!0),v==null||v(),window.clearTimeout(y.current),y.current=window.setTimeout(()=>h(!1),1500))};return m?f.jsx(Uo,{label:g?i:r,size:"sm",className:d,onClick:()=>void x(),children:g?f.jsx(bp,{}):f.jsx(Pp,{})}):f.jsx(De,{variant:u,size:a,className:d,leadingIcon:g?f.jsx(bp,{}):f.jsx(Pp,{}),"aria-live":"polite",onClick:()=>void x(),children:g?i:r})}function t2(){return f.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:f.jsx("path",{d:"M4 4L12 12M12 4L4 12",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}function n2({backdropClassName:t,bodyClassName:r,children:i,className:a,closeLabel:u="Close",eyebrow:d,isOpen:m,onClose:v,side:g="right",subtitle:h,title:y}){const x=R.useRef(null),C=R.useId(),I=R.useId(),{closeDialog:L,isTopDialog:_}=lv(m,x,v),M=m&&_,D=["as-drawer-backdrop",m?"as-drawer-backdrop--open":null,t].filter(Boolean).join(" "),U=["as-drawer",`as-drawer--${g}`,m?"as-drawer--open":null,a].filter(Boolean).join(" "),b=["as-drawer__body",r].filter(Boolean).join(" ");return R.useEffect(()=>{if(!m||!_)return;function T(A){const q=x.current;q&&(A.target instanceof Node&&q.contains(A.target)||A.target instanceof Element&&A.target.closest('[role="dialog"], [role="menu"]')!==null||L())}return document.addEventListener("pointerdown",T,!0),()=>document.removeEventListener("pointerdown",T,!0)},[L,m,_]),f.jsxs(f.Fragment,{children:[f.jsx("div",{"aria-hidden":!m,className:D,onClick:L}),f.jsx(Fc,{allowPinchZoom:!0,className:"as-drawer__scroll-lock",enabled:m&&_,children:f.jsx(Dc,{autoFocus:!0,className:"as-drawer__focus-lock",disabled:!m||!_,focusOptions:{preventScroll:!0},returnFocus:!1,children:f.jsxs("aside",{"aria-describedby":h?I:void 0,"aria-hidden":M?void 0:!0,"aria-labelledby":C,"aria-modal":M?"true":void 0,className:U,ref:x,role:"dialog",tabIndex:-1,children:[f.jsxs("header",{className:"as-drawer__header",children:[f.jsxs("div",{className:"as-drawer__titles",children:[d&&f.jsx("div",{className:"as-drawer__eyebrow",children:d}),f.jsx("h2",{className:"as-drawer__title",id:C,children:y}),h&&f.jsx("p",{className:"as-drawer__subtitle",id:I,children:h})]}),f.jsx("button",{type:"button",className:"as-drawer__close",onClick:L,"aria-label":u,children:f.jsx(t2,{})})]}),f.jsx("div",{className:b,children:i})]})})})]})}const r2=["M42.4461 10.2767H39.6752L35.9506 25.7053H38.2537L39.0994 21.902H43.0219L43.8495 25.7053H46.1346L42.4821 10.4203L42.4461 10.2767ZM42.59 19.9286H39.5132L41.0426 12.7525L42.59 19.9286Z","M53.9616 22.494L50.8668 10.2767H47.4841V25.7053H49.5893V13.506L52.6301 25.5618L52.6661 25.7053H56.0667V10.2767H53.9616V22.494Z","M57.7221 12.2681H61.1588V25.7053H63.3899V12.2681H66.8265V10.2767H57.7221V12.2681Z","M72.0265 16.7173H71.3788C70.9649 16.7173 70.6411 16.5917 70.3892 16.3226C70.1373 16.0535 70.0113 15.7485 70.0113 15.3359V13.7033C70.0113 13.3086 70.1552 12.9678 70.4611 12.6987C70.767 12.4116 71.1449 12.2681 71.6307 12.2681H75.1213V10.2767H71.8466C70.5511 10.2767 69.5435 10.5997 68.8418 11.2455C68.14 11.8914 67.7802 12.8601 67.7802 14.116V14.9412C67.7802 16.1791 68.104 17.1299 68.7518 17.7937C69.3995 18.4575 70.2992 18.7804 71.4148 18.7804H72.0625C72.4583 18.7804 72.7462 18.888 72.9262 19.1213C73.1241 19.3545 73.214 19.6595 73.214 20.0542V22.2967C73.214 22.6914 73.0701 23.0322 72.7642 23.3013C72.4583 23.5884 72.0805 23.7319 71.5947 23.7319H68.14V25.7233H71.3788C72.6743 25.7233 73.6819 25.4003 74.3836 24.7545C75.0853 24.1086 75.4452 23.1399 75.4452 21.8841V20.4668C75.4452 19.2289 75.1393 18.296 74.5455 17.6681C73.9518 17.0402 73.0881 16.7352 72.0265 16.7352V16.7173Z","M77.0825 25.7053H84.6576V23.7857H79.3317V18.7086H84.1178V16.7711H79.3317V12.2143H84.6576V10.2767H77.0825V25.7053Z","M86.3129 25.7053H93.888V23.7857H88.544V18.7086H93.3482V16.7711H88.544V12.2143H93.888V10.2767H86.3129V25.7053Z","M102.938 11.102C102.255 10.5459 101.211 10.2767 99.8976 10.2767H95.5253V25.7053H100.149C101.499 25.7053 102.489 25.4362 103.082 24.8801C103.694 24.3239 104 23.409 104 22.1173V13.811C104 12.5731 103.64 11.6581 102.938 11.102ZM100.347 23.7319H97.7564V12.2502H100.365C100.797 12.2502 101.121 12.3758 101.391 12.6269C101.643 12.8781 101.769 13.201 101.769 13.6316V22.3505C101.769 22.8349 101.661 23.1937 101.427 23.409C101.211 23.6243 100.833 23.7319 100.347 23.7319Z"],dv=["M12.5827 3.84445C13.2032 3.84445 13.7062 3.34146 13.7062 2.72099C13.7062 2.10052 13.2032 1.59753 12.5827 1.59753C11.9623 1.59753 11.4593 2.10052 11.4593 2.72099C11.4593 3.34146 11.9623 3.84445 12.5827 3.84445Z","M23.3679 3.84445C23.9884 3.84445 24.4914 3.34146 24.4914 2.72099C24.4914 2.10052 23.9884 1.59753 23.3679 1.59753C22.7474 1.59753 22.2445 2.10052 22.2445 2.72099C22.2445 3.34146 22.7474 3.84445 23.3679 3.84445Z","M8.0889 11.0346C8.70936 11.0346 9.21235 10.5316 9.21235 9.91112C9.21235 9.29065 8.70936 8.78766 8.0889 8.78766C7.46843 8.78766 6.96544 9.29065 6.96544 9.91112C6.96544 10.5316 7.46843 11.0346 8.0889 11.0346Z","M27.8617 11.0346C28.4822 11.0346 28.9852 10.5316 28.9852 9.91112C28.9852 9.29065 28.4822 8.78766 27.8617 8.78766C27.2413 8.78766 26.7383 9.29065 26.7383 9.91112C26.7383 10.5316 27.2413 11.0346 27.8617 11.0346Z","M6.29136 19.1235C6.91183 19.1235 7.41482 18.6205 7.41482 18C7.41482 17.3795 6.91183 16.8766 6.29136 16.8766C5.6709 16.8766 5.16791 17.3795 5.16791 18C5.16791 18.6205 5.6709 19.1235 6.29136 19.1235Z","M29.6593 19.1235C30.2797 19.1235 30.7827 18.6205 30.7827 18C30.7827 17.3795 30.2797 16.8766 29.6593 16.8766C29.0388 16.8766 28.5358 17.3795 28.5358 18C28.5358 18.6205 29.0388 19.1235 29.6593 19.1235Z","M7.19014 28.1111C7.81061 28.1111 8.31359 27.6081 8.31359 26.9877C8.31359 26.3672 7.81061 25.8642 7.19014 25.8642C6.56967 25.8642 6.06668 26.3672 6.06668 26.9877C6.06668 27.6081 6.56967 28.1111 7.19014 28.1111Z","M28.7605 28.1111C29.381 28.1111 29.884 27.6081 29.884 26.9877C29.884 26.3672 29.381 25.8642 28.7605 25.8642C28.14 25.8642 27.6371 26.3672 27.6371 26.9877C27.6371 27.6081 28.14 28.1111 28.7605 28.1111Z","M17.9753 12.3827C19.2163 12.3827 20.2222 11.2762 20.2222 9.91112C20.2222 8.54609 19.2163 7.43951 17.9753 7.43951C16.7344 7.43951 15.7284 8.54609 15.7284 9.91112C15.7284 11.2762 16.7344 12.3827 17.9753 12.3827Z","M17.9753 19.7975C19.7126 19.7975 21.121 18.188 21.121 16.2025C21.121 14.217 19.7126 12.6074 17.9753 12.6074C16.238 12.6074 14.8296 14.217 14.8296 16.2025C14.8296 18.188 16.238 19.7975 17.9753 19.7975Z","M17.9753 30.1333C20.209 30.1333 22.0198 27.719 22.0198 24.7408C22.0198 21.7625 20.209 19.3482 17.9753 19.3482C15.7416 19.3482 13.9309 21.7625 13.9309 24.7408C13.9309 27.719 15.7416 30.1333 17.9753 30.1333Z","M12.3264 2.40809C12.4993 2.26669 12.7542 2.29198 12.8956 2.4647L16.9401 7.40792C17.0815 7.58074 17.0562 7.83563 16.8835 7.9771C16.7106 8.1185 16.4558 8.09322 16.3143 7.92049L12.2698 2.97728C12.1284 2.80446 12.1537 2.54957 12.3264 2.40809Z","M23.055 2.4647C23.1965 2.29198 23.4514 2.26669 23.6242 2.40809C23.7969 2.54957 23.8222 2.80446 23.6808 2.97728L19.6364 7.92049C19.4949 8.09322 19.24 8.1185 19.0672 7.9771C18.8945 7.83563 18.8692 7.58074 19.0106 7.40792L23.055 2.4647Z","M7.73168 9.72198C7.83619 9.52458 8.08064 9.44939 8.27805 9.5539L15.9176 13.5983C16.1149 13.7029 16.1901 13.9473 16.0856 14.1447C15.9811 14.3421 15.7367 14.4173 15.5393 14.3128L7.89976 10.2683C7.70236 10.1638 7.62717 9.91938 7.73168 9.72198Z","M27.6726 9.5539C27.87 9.44939 28.1144 9.52458 28.219 9.72198C28.3235 9.91938 28.2483 10.1638 28.0509 10.2683L20.4114 14.3128C20.214 14.4173 19.9695 14.3421 19.865 14.1447C19.7605 13.9473 19.8357 13.7029 20.0331 13.5983L27.6726 9.5539Z","M14.7875 16.6988C15.0096 16.6756 15.2087 16.8371 15.2321 17.0591C15.2553 17.2812 15.0938 17.4803 14.8718 17.5037L6.3335 18.4024C6.11145 18.4257 5.91232 18.2642 5.88895 18.0421C5.8657 17.8201 6.02718 17.621 6.24924 17.5976L14.7875 16.6988Z","M21.1631 16.6988L29.7014 17.5976C29.9235 17.621 30.085 17.8201 30.0617 18.0421C30.0383 18.2642 29.8392 18.4257 29.6171 18.4024L21.0789 17.5037C20.8568 17.4803 20.6953 17.2812 20.7186 17.0591C20.742 16.8371 20.9411 16.6756 21.1631 16.6988Z","M15.1149 23.0231C15.319 22.9324 15.5578 23.0244 15.6485 23.2285C15.7392 23.4326 15.6472 23.6714 15.4432 23.7621L7.35427 27.3572C7.15017 27.4478 6.91133 27.3559 6.82063 27.1518C6.72997 26.9477 6.82192 26.7089 7.02601 26.6182L15.1149 23.0231Z","M20.3021 23.2285C20.3928 23.0244 20.6316 22.9324 20.8357 23.0231L28.9246 26.6182C29.1287 26.7089 29.2207 26.9477 29.13 27.1518C29.0393 27.3559 28.8005 27.4478 28.5964 27.3572L20.5075 23.7621C20.3034 23.6714 20.2114 23.4326 20.3021 23.2285Z"],fv="#10B981";function i2({height:t=24,className:r}){return f.jsxs("svg",{className:r,height:t,width:t*104/36,viewBox:"0 0 104 36",fill:"none",role:"img","aria-label":"Antseed",children:[dv.map(i=>f.jsx("path",{d:i,fill:fv},i)),r2.map(i=>f.jsx("path",{d:i,fill:"currentColor"},i))]})}function o2({size:t=24,className:r}){return f.jsx("svg",{className:r,height:t,width:t,viewBox:"4 0 28 32",fill:"none",role:"img","aria-label":"Antseed",children:dv.map(i=>f.jsx("path",{d:i,fill:fv},i))})}function Mo({className:t,height:r,radius:i,style:a,width:u,...d}){const m=["as-skeleton",t].filter(Boolean).join(" ");return f.jsx("div",{className:m,style:{...a,...r!==void 0?{height:r}:{},...i!==void 0?{borderRadius:i}:{},...u!==void 0?{width:u}:{}},...d})}function xk({title:t,description:r,actions:i}){return f.jsxs("header",{className:"as-page-header",children:[f.jsxs("div",{className:"as-page-header__text",children:[f.jsx("h1",{children:t}),r&&f.jsx("p",{children:r})]}),i&&f.jsx("div",{className:"as-page-header__actions",children:i})]})}function Sk({title:t,description:r,actions:i,children:a,flush:u,className:d}){return f.jsxs("section",{className:["as-panel",d].filter(Boolean).join(" "),children:[(t||i)&&f.jsxs("div",{className:"as-panel__head",children:[f.jsxs("div",{children:[t&&f.jsx("h2",{className:"as-panel__title",children:t}),r&&f.jsx("p",{className:"as-panel__desc",children:r})]}),i&&f.jsx("div",{className:"as-panel__actions",children:i})]}),f.jsx(Cc,{className:"as-panel__card",children:f.jsx("div",{className:u?"as-panel__body as-panel__body--flush":"as-panel__body",children:a})})]})}function s2(t){return t!==null&&t>=1?"danger":t!==null&&t>=.8?"warning":"default"}function kk({label:t,value:r,sub:i,meter:a,tone:u}){const d=a==null?null:Math.max(0,Math.min(1,a));return f.jsxs(Cc,{className:"as-stat",children:[f.jsx("div",{className:"as-stat__label",children:t}),f.jsx("div",{className:"as-stat__value",children:r}),i&&f.jsx("div",{className:"as-stat__sub",children:i}),d!==null&&f.jsx("div",{className:`as-meter as-meter--${u??s2(d)}`,role:"meter","aria-valuemin":0,"aria-valuemax":100,"aria-valuenow":Math.round(d*100),children:f.jsx("span",{style:{width:`${d*100}%`}})})]})}function Ck({title:t,body:r,action:i,icon:a}){return f.jsxs("div",{className:"as-empty",children:[a&&f.jsx("div",{className:"as-empty__icon","aria-hidden":"true",children:a}),f.jsx("div",{className:"as-empty__title",children:t}),r&&f.jsx("div",{className:"as-empty__body",children:r}),i&&f.jsx("div",{className:"as-empty__action",children:i})]})}function Mi({rows:t=4,height:r=28}){return f.jsx("div",{className:"as-loading","aria-busy":"true","aria-label":"Loading",children:Array.from({length:t},(i,a)=>f.jsx(Mo,{height:r},a))})}function Ek({items:t}){return f.jsx("dl",{className:"as-details",children:t.map(([r,i],a)=>f.jsxs("div",{className:"as-details__row",children:[f.jsx("dt",{children:r}),f.jsx("dd",{children:i})]},a))})}function _k({code:t,label:r}){return f.jsxs("div",{className:"as-code",children:[f.jsxs("div",{className:"as-code__bar",children:[f.jsx("span",{className:"as-code__label",children:r}),f.jsx(zc,{value:t})]}),f.jsx("pre",{children:f.jsx("code",{children:t})})]})}function Pk({secret:t,note:r="Copy it now. It will not be shown again."}){return f.jsxs("div",{className:"as-secret",children:[f.jsxs("div",{className:"as-secret__row",children:[f.jsx("code",{className:"as-secret__value",children:t}),f.jsx(zc,{value:t})]}),f.jsx("p",{className:"as-secret__note",children:r})]})}function a2(t,r){return["as-field",r==="sm"?"as-field--sm":null,t].filter(Boolean).join(" ")}function l2(t,r){return["as-field__input",t,r?"as-field__input--mono":null].filter(Boolean).join(" ")}function u2({error:t,hint:r}){return t?f.jsx("span",{className:"as-field__error",children:t}):r?f.jsx("span",{className:"as-field__hint",children:r}):null}function c2({className:t,error:r,hint:i,id:a,label:u,size:d,mono:m,...v}){const g=R.useId(),h=a??v.name??g;return f.jsxs("label",{className:a2(t,d),htmlFor:h,children:[u&&f.jsx("span",{className:"as-field__label",children:u}),f.jsx("input",{id:h,className:l2(void 0,m),"aria-invalid":r?!0:void 0,...v}),f.jsx(u2,{error:r,hint:i})]})}const hv=R.createContext(()=>{});function pv(){return R.useContext(hv)}let d2=1;function f2({children:t}){const[r,i]=R.useState([]),a=R.useCallback((u,d="success")=>{const m=d2++;i(v=>[...v.slice(-3),{id:m,tone:d,text:u}]),window.setTimeout(()=>i(v=>v.filter(g=>g.id!==m)),4e3)},[]);return f.jsxs(hv.Provider,{value:a,children:[t,f.jsx("div",{className:"as-toasts",role:"status","aria-live":"polite",children:r.map(u=>f.jsx("div",{className:`as-toast as-toast--${u.tone}`,children:u.text},u.id))})]})}const h2="/console/api",p2="x-antseed-console";class Ca extends Error{constructor(i,a,u,d={}){super(u);wu(this,"details");this.status=i,this.code=a,this.name="ConsoleApiError",this.details=d}}function Lr(t,r){return t instanceof Ca&&(r===void 0||t.code===r)}const jp={buyer_policy_unsupported:"The buyer behind this gateway cannot apply routing policies yet. Update Antseed on the buyer host and restart it.",restart_unsupported:"The buyer cannot restart itself here. The change is saved; restart the buyer yourself to apply it.",reauth_required:"For this action, sign in again first.",config_unreadable:"The gateway could not read the buyer configuration file, so nothing was changed. Check the file on the gateway host.",operator_not_yours:"That wallet is not one of your sign-in methods. Add it as a sign-in method first, then authorize it.",reauth_wrong_member:"That passkey or wallet belongs to someone else. Confirm with one of your own sign-in methods.",reauth_unavailable:"You are signed in through Cloudflare Access, which cannot confirm this action. Sign in with a passkey or wallet instead (add one under Your sign-in methods first if you have none), then retry.",access_reauth_required:"Your Cloudflare Access sign-in is more than 5 minutes old. Sign out of Cloudflare Access, sign in again, then retry.",reauth_other_credential:"Confirm with a different passkey or wallet than the one you are making the operator, then retry.",session_required:"Only an organization admin signed in to the console can change the export endpoint or content logging. Management tokens cannot.",otlp_headers_required:"You changed the endpoint, so the saved header values are not sent to it. Enter the header values again.",empty_allow_list:"This allow list is empty, so no seller could serve. Confirm to save it anyway.",last_credential:"You cannot remove your only sign-in method, or you could not sign in again. Add another passkey or wallet first.",credential_exists:"This passkey or wallet is already registered.",max_keys_reached:"You already have as many keys as you are allowed. Revoke one, or ask an admin to raise your limit."};function Ea(t){return t instanceof Ca&&Object.hasOwn(jp,t.code)?jp[t.code]:t instanceof Error?t.message:typeof t=="string"?t:"Something went wrong."}function yr(t,r){return{...t,...r!=null&&r.confirmEmpty?{confirmEmpty:!0}:{},...r!=null&&r.acceptNarrowed?{acceptNarrowed:!0}:{}}}function oa(t){if(!t)return"";const r=new URLSearchParams;for(const[a,u]of Object.entries(t))u==null||u===""||r.set(a,String(u));const i=r.toString();return i?`?${i}`:""}async function m2(t){let r=`http_${t.status}`,i=t.statusText||`Request failed (${t.status})`,a={};try{const u=await t.json();u!=null&&u.error&&typeof u.error.code=="string"&&(r=u.error.code),u!=null&&u.error&&typeof u.error.message=="string"&&(i=u.error.message),u&&typeof u=="object"&&(a={...u.error,...u})}catch{}return new Ca(t.status,r,i,a)}function v2(t=(i,a)=>fetch(i,a),r=h2){async function i(h,y,x={}){const C={accept:"application/json"};h!=="GET"&&h!=="HEAD"&&(C[p2]="1");let L;x.body!==void 0&&(C["content-type"]="application/json",L=JSON.stringify(x.body));let _;try{_=await t(`${r}${y}${oa(x.query)}`,{method:h,headers:C,body:L,credentials:"same-origin"})}catch{throw new Ca(0,"network_error","Could not reach the gateway.")}if(!_.ok)throw await m2(_);return _.status===204?void 0:(_.headers.get("content-type")??"").includes("json")?await _.json():await _.text()}const a=(h,y)=>i("GET",h,{query:y}),u=(h,y)=>i("POST",h,{body:y??{}}),d=(h,y)=>i("PATCH",h,{body:y}),m=(h,y)=>i("PUT",h,{body:y}),v=h=>i("DELETE",h),g=encodeURIComponent;return{request:i,auth:{config:()=>a("/auth/config"),me:()=>a("/auth/me"),setup:h=>u("/auth/setup",{token:h}),invite:h=>u("/auth/invite",{token:h}),passkeyRegisterOptions:h=>u("/auth/passkey/register/options",{enrollment:h}),passkeyRegisterVerify:(h,y)=>u("/auth/passkey/register/verify",{enrollment:y,response:h}),passkeyLoginOptions:()=>u("/auth/passkey/login/options",{}),passkeyLoginVerify:h=>u("/auth/passkey/login/verify",{response:h}),walletNonce:h=>u("/auth/wallet/nonce",{address:h}),walletVerify:(h,y,x)=>u("/auth/wallet/verify",{message:h,signature:y,enrollment:x}),oidcStartUrl:h=>`${r}/auth/oidc/start${oa({enrollment:h})}`,oidcLinkUrl:()=>`${r}/auth/oidc/start?link=1`,reauthPasskeyOptions:()=>u("/auth/reauth/passkey/options",{}),reauthPasskeyVerify:h=>u("/auth/reauth/passkey/verify",{response:h}),reauthWalletNonce:h=>u("/auth/reauth/wallet/nonce",{address:h}),reauthWalletVerify:(h,y)=>u("/auth/reauth/wallet/verify",{message:h,signature:y}),apiKey:h=>u("/auth/api-key",{key:h}),logout:()=>u("/auth/logout")},members:{list:()=>a("/members"),update:(h,y,x)=>d(`/members/${g(h)}`,yr(y,x)),disable:h=>u(`/members/${g(h)}/disable`),enable:h=>u(`/members/${g(h)}/enable`),removeCredential:(h,y)=>v(`/members/${g(h)}/credentials/${g(y)}`)},invites:{list:()=>a("/invites"),create:h=>u("/invites",h),revoke:h=>v(`/invites/${g(h)}`)},workspaces:{list:()=>a("/workspaces"),get:h=>a(`/workspaces/${g(h)}`),create:(h,y)=>u("/workspaces",yr(h,y)),update:(h,y,x)=>d(`/workspaces/${g(h)}`,yr(y,x)),remove:h=>v(`/workspaces/${g(h)}`),members:h=>a(`/workspaces/${g(h)}/members`),setMember:(h,y,x)=>m(`/workspaces/${g(h)}/members/${g(y)}`,{role:x}),removeMember:(h,y)=>v(`/workspaces/${g(h)}/members/${g(y)}`)},keys:{list:(h={})=>a("/keys",h),create:(h,y)=>u("/keys",yr(h,y)),update:(h,y,x)=>d(`/keys/${g(h)}`,yr(y,x)),rotate:h=>u(`/keys/${g(h)}/rotate`),revoke:h=>u(`/keys/${g(h)}/revoke`)},adminTokens:{list:()=>a("/admin-tokens"),create:(h,y,x)=>u("/admin-tokens",{label:h,scope:y,...x!==void 0?{expiresInDays:x}:{}}),revoke:h=>v(`/admin-tokens/${g(h)}`)},usage:{report:h=>a("/usage",h),requests:h=>a("/requests",h),request:h=>a(`/requests/${g(h)}`),exportUrl:h=>`${r}/usage/export.csv${oa(h)}`},audit:{list:h=>a("/audit",h)},wallet:{get:h=>a(`/workspaces/${g(h)}/wallet`),cardLink:(h,y,x)=>u(`/workspaces/${g(h)}/wallet/card-link`,{amountUsd:y,provider:x}),watch:(h,y)=>u(`/workspaces/${g(h)}/wallet/watch`,{mode:y}),operator:(h,y=!1)=>a(`/workspaces/${g(h)}/wallet/operator`,{fresh:y?1:void 0}),operators:()=>a("/wallet/operators"),operatorSync:(h,y)=>u(`/workspaces/${g(h)}/wallet/operator/sync`,y?{txHash:y}:{}),operatorAuth:(h,y)=>u(`/workspaces/${g(h)}/wallet/operator-auth`,{operator:y}),channels:(h,y=!1,x=!1)=>a(`/workspaces/${g(h)}/channels`,{all:y?1:void 0,fresh:x?1:void 0}),closeChannel:(h,y)=>u(`/workspaces/${g(h)}/channels/close`,{peerId:y}),rewards:h=>a(`/workspaces/${g(h)}/rewards`),chain:()=>a("/chain")},chat:{models:h=>a("/chat/models",{workspace:h}),context:h=>a("/chat/context",{workspace:h}),threads:h=>a("/chat/threads",{workspace:h}),thread:(h,y)=>a(`/chat/threads/${g(y)}`,{workspace:h}),deleteThread:(h,y)=>v(`/chat/threads/${g(y)}${oa({workspace:h})}`)},network:{peers:()=>a("/peers"),models:()=>a("/models"),routePreview:h=>a("/route-preview",h),gatewayPolicy:()=>a("/routing"),buyerLimits:()=>a("/routing/buyer-limits"),setGatewayPolicy:(h,y)=>i("PUT","/routing",{body:h,query:{confirmEmpty:y!=null&&y.confirmEmpty?1:void 0,acceptNarrowed:y!=null&&y.acceptNarrowed?1:void 0}}),peerLists:()=>a("/peer-lists"),createPeerList:h=>u("/peer-lists",h),updatePeerList:(h,y)=>d(`/peer-lists/${g(h)}`,y),removePeerList:h=>v(`/peer-lists/${g(h)}`)},presets:{list:h=>a("/presets",{workspace:h}),create:(h,y)=>u("/presets",yr(h,y)),update:(h,y,x)=>d(`/presets/${g(h)}`,yr(y,x)),remove:h=>v(`/presets/${g(h)}`)},settings:{status:()=>a("/status"),get:()=>a("/settings"),updateBuyer:h=>d("/settings/buyer",h),setObservability:h=>m("/settings/observability",h)}}}function mv(t){return!!t&&"ownerRoutingPolicy"in t}const he=v2();function _a(t){return t.orgRole==="owner"||t.orgRole==="admin"}function $c(t){return _a(t)||t.workspaceRole==="admin"}const Uc=[{id:"overview",label:"Overview",group:"Workspace",access:"member"},{id:"chat",label:"Chat",group:"Workspace",access:"member"},{id:"activity",label:"Activity",group:"Workspace",access:"member"},{id:"logs",label:"Logs",group:"Workspace",access:"member"},{id:"keys",label:"Keys",group:"Workspace",access:"member"},{id:"presets",label:"Presets",group:"Workspace",access:"member"},{id:"wallet",label:"Wallet & Funding",group:"Money",access:"workspaceAdmin"},{id:"rewards",label:"Rewards",group:"Money",access:"workspaceAdmin"},{id:"providers",label:"Providers",group:"Routing",access:"member"},{id:"models",label:"Models",group:"Routing",access:"member"},{id:"routing",label:"Routing",group:"Routing",access:"workspaceAdmin"},{id:"members",label:"Members",group:"Organization",access:"workspaceAdmin"},{id:"workspaces",label:"Workspaces",group:"Organization",access:"workspaceAdmin"},{id:"audit",label:"Audit log",group:"Organization",access:"orgAdmin"},{id:"settings",label:"Settings",group:"Organization",access:"orgAdmin"}];function Bc(t,r){const i=Uc.find(a=>a.id===t);return i?i.access==="orgAdmin"?_a(r):i.access==="workspaceAdmin"?$c(r):!0:!1}function g2(t){return Uc.filter(r=>Bc(r.id,t))}function y2(t,r){const i=t.me.workspaces.find(a=>a.workspace.id===r);return{orgRole:t.me.member.orgRole,workspaceRole:(i==null?void 0:i.role)??null}}const Hc={owner:"Owner",admin:"Admin",member:"Member"};function w2(t,r){return r?`${t}/${encodeURIComponent(r)}`:t}function x2(t){const r=t.join("/");return r===""?null:r}function S2(t,r){return t==="network"?w2("providers",x2(r)):null}const vv=R.createContext(null);function ir(){const t=R.useContext(vv);if(!t)throw new Error("useConsole outside the console shell");return t}const gv="antseed-console-workspace";function k2(){try{return localStorage.getItem(gv)}catch{return null}}function C2(t){try{localStorage.setItem(gv,t)}catch{}}function Tp(t,r){const i=t.workspaces.map(a=>a.workspace);return i.find(a=>a.id===r)??i.find(a=>a.isDefault)??i[0]??null}function bk(){const{workspace:t,viewer:r,me:i}=ir();return $c(r)?{workspace:t.id}:{workspace:t.id,member:i.member.id}}const sc="antseed-console-theme";function yv(){try{const t=localStorage.getItem(sc);return t==="light"||t==="dark"?t:"system"}catch{return"system"}}function E2(){const t=yv();t!=="system"&&(document.documentElement.dataset.theme=t)}function _2(){const[t,r]=R.useState(yv);return R.useEffect(()=>{t==="system"?delete document.documentElement.dataset.theme:document.documentElement.dataset.theme=t;try{t==="system"?localStorage.removeItem(sc):localStorage.setItem(sc,t)}catch{}},[t]),[t,r]}function P2(){var r;const t=document.documentElement.dataset.theme;return t?t==="dark":((r=window.matchMedia)==null?void 0:r.call(window,"(prefers-color-scheme: dark)").matches)??!1}const Oo="/console";function b2(t){try{return decodeURIComponent(t)}catch{return t}}function j2(t,r="",i=""){const u=(t.startsWith(Oo)?t.slice(Oo.length):t).split("/").filter(Boolean).map(b2);return{page:u[0]??"",rest:u.slice(1),query:new URLSearchParams(r),hash:i.replace(/^#/,"")}}function Rp(){return j2(window.location.pathname,window.location.search,window.location.hash)}const ac=new Set;function an(t,r={}){const i=t.startsWith("/")?`${Oo}${t}`:`${Oo}/${t}`;r.replace?window.history.replaceState(null,"",i):window.history.pushState(null,"",i),ac.forEach(a=>a())}function Wc(){const[t,r]=R.useState(Rp);return R.useEffect(()=>{const i=()=>r(Rp());return ac.add(i),window.addEventListener("popstate",i),()=>{ac.delete(i),window.removeEventListener("popstate",i)}},[]),t}function Pa(t){return`${Oo}/${t.replace(/^\//,"")}`}function Vc(t){return r=>{r.defaultPrevented||r.button!==0||r.metaKey||r.ctrlKey||r.shiftKey||r.altKey||(r.preventDefault(),an(t))}}const T2=6;function Ct(t){if(t==null||t==="")return 0;const r=Number(t);return Number.isFinite(r)?r:0}function R2(t,r={}){if(t==null)return"—";const i=typeof t=="number"?t:Ct(t),a=i<0?"-":"",u=Math.abs(i);return r.compact&&u>=1e4?`${a}$${new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(u)}`:u!==0&&u<1e-4?`${a}<$0.0001`:u!==0&&u<.01?`${a}$${u.toFixed(4).replace(/0+$/,"").replace(/\.$/,"")}`:`${a}$${u.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}function jk(t){const r=t.trim().replace(/^\$/,"").replace(/,/g,"");if(r==="")return null;const i=/^(\d+)(?:\.(\d{0,6}))?$/.exec(r);if(!i)throw new Error("Use a dollar amount like 5 or 12.50 (up to 6 decimals).");const a=i[1].replace(/^0+(?=\d)/,""),u=(i[2]??"").padEnd(T2,"0");return`${a}.${u}`}function Tk(t){return t==null?"":t.includes(".")?t.replace(/0+$/,"").replace(/\.$/,""):t}function N2(t,r={}){return t==null||!Number.isFinite(t)?"—":r.compact&&Math.abs(t)>=1e4?new Intl.NumberFormat("en-US",{notation:"compact",maximumFractionDigits:1}).format(t):t.toLocaleString("en-US")}function Rk(t){return N2(t,{compact:!0})}function wi(t){return t==null?"—":t===0?"Free":t<.01?`$${t.toLocaleString("en-US",{maximumSignificantDigits:2})}`:`$${t.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:t<1?3:2})}`}function Nk(t){return t?t.min===t.max?wi(t.min):`${t.min===0?"$0":wi(t.min)}–${wi(t.max)}`:"—"}function Ik(t){return t==null?"—":t>=1e3?`${(t/1e3).toFixed(t>=1e4?0:1)} s`:`${Math.round(t)} ms`}function Mk(t){if(t==null)return"—";const r=Math.floor(t/6e4);if(r<1)return"<1 min";if(r<60)return`${r} min`;const i=Math.floor(r/60);return i<48?`${i} h ${r%60} min`:`${Math.floor(i/24)} d ${i%24} h`}function I2(t){return t?new Date(t).toLocaleString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"—"}function M2(t){return t?new Date(t).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"—"}function Np(t,r=Date.now()){if(!t)return"Never";const i=r-t,a=i<0,u=Math.abs(i),d=6e4,m=60*d,v=24*m;let g;if(u<d)return a?"in a moment":"just now";if(u<m)g=`${Math.round(u/d)} min`;else if(u<v)g=`${Math.round(u/m)} h`;else if(u<30*v)g=`${Math.round(u/v)} d`;else return M2(t);return a?`in ${g}`:`${g} ago`}function sn(t,r=6,i=4){return t?t.length<=r+i+1?t:`${t.slice(0,r)}…${t.slice(-i)}`:"—"}const wv=["daily","weekly","monthly","total"],Ok={daily:"Daily",weekly:"Weekly",monthly:"Monthly",total:"Total"};function O2(t){if(!t)return"No limits";const r={daily:"/day",weekly:"/week",monthly:"/month",total:" total"},i=wv.filter(a=>t[a]!==null).map(a=>`${R2(t[a])}${r[a]}`);return i.length>0?i.join(" · "):"No limits"}function Lk(t,r=Date.now()){const i=new Date(r),a=Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),i.getUTCDate());if(t==="daily")return a;if(t==="monthly")return Date.UTC(i.getUTCFullYear(),i.getUTCMonth(),1);const u=(i.getUTCDay()+6)%7;return a-u*864e5}const L2=15*6e4;function A2(t){return t.status==="active"||t.status==="open"||t.status==="closing"||t.status==="withdrawable"}function Ak(t,r){return t.status==="withdrawable"?"withdraw":t.status!=="active"&&t.status!=="open"?"none":t.canCooperativeClose&&!r?"cooperative":"on-chain"}function D2(t){return t.closeRequestedAt===null?null:t.closeRequestedAt+L2}function F2(t,r=Date.now()){const i=Math.max(0,t-r);return i>=6e4?`${Math.ceil(i/6e4)} min`:`${Math.ceil(i/1e3)} s`}function Dk(t,r=Date.now()){if(t.status==="closing"){const i=D2(t);return i===null?"closing":`closing · ${F2(i,r)} left`}return t.status==="withdrawable"?"ready to withdraw":t.status==="timedout"?"withdrawn":t.status}function Fk(t){return t.status==="active"||t.status==="open"?"success":t.status==="withdrawable"?"warning":t.status==="closing"?"info":"neutral"}function z2(t){return Math.max(0,Ct(t.reserved)-Ct(t.spent))}function $2(t){const r=t.filter(i=>i.status==="withdrawable");return{count:r.length,amount:r.reduce((i,a)=>i+z2(a),0)}}function zk(t){return t.filter(A2).reduce((r,i)=>r+Math.max(0,Ct(i.spent)-Ct(i.settled??"0")),0)}function $k(t){return Ct(t.reserved)>0&&Ct(t.available)<=0&&Ct(t.walletUsdc)<=0}function Uk(t){const r=Ct(t.walletUsdc),i=t.creditLimit===null?0:Ct(t.creditLimit),a=Math.max(0,i-Ct(t.available)-Ct(t.reserved));return i>0&&r>a?"Credits are at or near the credit limit, so this USDC waits in the workspace wallet and tops the credits up as they are spent.":"This USDC is in the workspace wallet and moves into the credits automatically."}function Bk(t){const r=t.toLowerCase();return r.includes("already in flight")?"A close request to this seller is still waiting for an answer (it gives up after a minute). Close on chain instead, or try again shortly.":r.includes("busy")||r.includes("still processing")?"The seller is still processing a request. Try again shortly, or close on chain.":r.includes("pending_auth")||r.includes("latest payment authorization")?"The seller is waiting for the latest payment authorization. Try again shortly, or close on chain.":r.includes("no_channel")||r.includes("no longer has this channel")?"The seller no longer has this channel open. It may already be settled; refresh the list, or close on chain.":r.includes("did not answer")||r.includes("not connected")||r.includes("could not be found")||r.includes("disconnected")?"The seller did not answer. Close on chain instead: it does not need the seller.":r.includes("does not support cooperative close")?"This seller does not support a cooperative close. Close on chain instead.":`${t} The channel is unchanged; close on chain instead.`}const U2={usdc:["usdc","USDC","usdcToken"],deposits:["deposits","AntseedDeposits","antseedDeposits"],usageRewards:["usageRewards","AntseedUsageRewards","UsageRewards"],channels:["channels","AntseedChannels","antseedChannels"]};function Hk(t,r){if(!t)return null;const i=Object.entries(t.contracts);for(const a of U2[r]){const u=i.find(([d])=>d.toLowerCase()===a.toLowerCase());if(u&&/^0x[0-9a-fA-F]{40}$/.test(u[1]))return u[1]}return null}function Lo(t,r){return!!t&&!!r&&t.toLowerCase()===r.toLowerCase()}const B2="0x0000000000000000000000000000000000000000";function qc(t){return!!t&&/^0x[0-9a-fA-F]{40}$/.test(t)&&t.toLowerCase()!==B2}function Wk(t,r){return t!=null&&t.explorerUrl?`${t.explorerUrl.replace(/\/+$/,"")}/tx/${r}`:null}const Re={group:t=>[t],me:["me"],authConfig:["auth-config"],status:["status"],settings:["settings"],workspaces:["workspaces","list"],workspace:t=>["workspaces","detail",t],workspaceMembers:t=>["workspaces","members",t],members:["members","list"],invites:["invites"],keys:t=>["keys","list",t],usage:t=>["usage",t],requests:t=>["requests","list",t],request:t=>["requests","detail",t],audit:t=>["audit",t],wallet:t=>["wallet",t],channels:(t,r)=>["channels",t,r],operators:["wallet-operators"],rewards:t=>["rewards",t],chain:["chain"],chatModels:t=>["chat-models",t],chatContext:t=>["chat-context",t],chatThreads:t=>["chat-threads",t],chatThread:(t,r)=>["chat-thread",t,r],peers:["peers"],models:["models"],peerLists:["peer-lists"],gatewayPolicy:["routing","gateway"],buyerLimits:["routing","buyer-limits"],routePreview:t=>["routing","preview",t],presets:t=>["presets",t],adminTokens:["admin-tokens"]},Vk=["routing","workspaces","members","keys","presets"];function H2(t,r=he){return{queryKey:Re.workspace(t),queryFn:()=>r.workspaces.get(t)}}function qk(t,r=!0){return $e({...H2(t),enabled:r})}function Kk(t=!0){return $e({queryKey:Re.peers,queryFn:he.network.peers,staleTime:3e4,enabled:t})}function Qk(){return $e({queryKey:Re.models,queryFn:he.network.models,staleTime:3e4})}function Gk(t=!0){return $e({queryKey:Re.peerLists,queryFn:he.network.peerLists,staleTime:3e4,enabled:t})}function Yk(){return $e({queryKey:Re.workspaces,queryFn:he.workspaces.list})}function Zk(t,r=!0){return $e({queryKey:Re.workspaceMembers(t),queryFn:()=>he.workspaces.members(t),enabled:r})}function Xk(t=!0){return $e({queryKey:Re.members,queryFn:he.members.list,enabled:t})}function Jk(){return $e({queryKey:Re.invites,queryFn:he.invites.list})}function eC(t,r=!0){return $e({queryKey:Re.keys(t),queryFn:()=>he.keys.list(t),enabled:r})}function tC(t,r=!0){return $e({queryKey:Re.presets(t),queryFn:()=>he.presets.list(t),enabled:r})}function nC(t,r=!0){return $e({queryKey:Re.wallet(t),queryFn:()=>he.wallet.get(t),enabled:r})}function rC(){return $e({queryKey:Re.gatewayPolicy,queryFn:he.network.gatewayPolicy})}function iC(){return $e({queryKey:Re.buyerLimits,queryFn:he.network.buyerLimits})}function oC(){return $e({queryKey:Re.adminTokens,queryFn:he.adminTokens.list})}function W2(){return $e({queryKey:Re.me,queryFn:he.auth.me})}function Kc(t=!0){return $e({queryKey:Re.authConfig,queryFn:he.auth.config,enabled:t})}function xv(){return $e({queryKey:Re.status,queryFn:he.settings.status,refetchInterval:3e4})}function sC(t=!0){return $e({queryKey:Re.chain,queryFn:he.wallet.chain,staleTime:1/0,enabled:t})}function aC(t){const r=new Set;for(const i of t??[])for(const a of i.services)r.add(a.service);return[...r].sort()}const Sv=t=>["wallet-operator",t],kv={get:(t,r=!1)=>he.wallet.operator(t,r),sync:(t,r)=>he.wallet.operatorSync(t,r),authorize:(t,r)=>he.wallet.operatorAuth(t,r)};function lC(t,r=!0){return $e({queryKey:Sv(t),queryFn:()=>kv.get(t),staleTime:3e4,enabled:r})}function V2(t=!0){return $e({queryKey:Re.operators,queryFn:()=>he.wallet.operators(),staleTime:6e4,enabled:t})}function q2(t){return(t==null?void 0:t.relation)==="none"}function uC(t){const r=rr(),i=a=>{r.setQueryData(Sv(t),a),r.invalidateQueries({queryKey:Re.operators}),r.invalidateQueries({queryKey:Re.wallet(t)}),r.invalidateQueries({queryKey:Re.rewards(t)})};return{apply:i,refresh:async()=>i(await kv.get(t,!0))}}function cC(t,r){const i=t.operator,a=sn(i),u=qc(i)&&Lo(r,i),d=m=>u?{canManage:!0,manageHint:null}:{canManage:!1,manageHint:`Only ${m} can transfer or remove it: connect ${a} to do so.`};switch(t.relation){case"none":return{tone:"warning",badge:"Not set",title:"No authorized wallet",summary:t.canAuthorize?"Authorize one of your wallets to withdraw funds and claim ANTS rewards. Requests keep working meanwhile.":"Nobody can withdraw funds or claim ANTS rewards until the organization owner authorizes a wallet.",body:t.canAuthorize?"Nobody can withdraw this workspace's funds or claim its ANTS rewards until you authorize one of your wallets. Requests keep working meanwhile.":"Nobody can withdraw this workspace's funds or claim its ANTS rewards until one is authorized. Only the organization owner can authorize a wallet; requests keep working meanwhile.",canAuthorize:t.canAuthorize,canManage:!1,manageHint:null,canLink:!1};case"self":return{tone:"info",badge:"Workspace wallet",title:"The workspace wallet authorizes itself",summary:"Withdrawals and rewards stay in the wallet the gateway holds.",body:"Withdrawals and rewards stay in the wallet the gateway holds. To hand the role to a personal wallet, run `antseed gateway workspace operator transfer <workspace> <address>` on the gateway host (the workspace wallet pays the gas).",canAuthorize:!1,canManage:!1,manageHint:null,canLink:!1};case"yours":return{tone:"success",badge:"Your wallet",title:`Your wallet ${a}`,summary:"Withdrawals and ANTS rewards go to this wallet, and only it can transfer or remove the role.",body:"Withdrawals and ANTS rewards go to this wallet, and only it can transfer or remove the role.",canAuthorize:!1,canLink:!1,...d("this wallet")};case"member":{const m=t.memberLabel?`${t.memberLabel}'s wallet`:"Another member's wallet";return{tone:"info",badge:t.memberLabel?t.memberLabel:"Member",title:`${m} ${a}`,summary:"Withdrawals and ANTS rewards go to this wallet, and only it can transfer or remove the role.",body:"Withdrawals and ANTS rewards go to this wallet, and only it can transfer or remove the role.",canAuthorize:!1,canLink:!1,...d(t.memberLabel?`${t.memberLabel}'s wallet`:"that member's wallet")}}case"unknown":return{tone:"info",badge:"Not linked to a console member",title:`Authorized wallet ${a}`,summary:"Withdrawals and ANTS rewards go to this wallet. If it is yours, link it to your account to manage it here.",body:"No member of this gateway signs in with this address, yet withdrawals and ANTS rewards go to it, and only it can transfer or remove the role: not the gateway, not the organization owner. If nobody on your team controls it, do not add more than you plan to spend (the gateway can still spend the balance on requests, but it cannot be withdrawn). Ask whoever controls it to transfer the role, or move to a new workspace with a fresh wallet.",canAuthorize:!1,canLink:!0,...d("that wallet")}}}function dC(t,r,i){if(!t)return{ok:!1,reason:"Checking the authorized wallet…",operator:null};const a=qc(t.operator)?t.operator:null;return a?t.relation==="self"?{ok:!1,operator:a,reason:`This workspace's authorized wallet is the gateway-held wallet itself, so a browser wallet cannot ${i}. Use the antseed CLI on the gateway host, or transfer the role to a personal wallet.`}:r?Lo(r,a)?{ok:!0,operator:a,reason:null}:{ok:!1,operator:a,reason:`The connected wallet ${sn(r)} is not the authorized wallet ${sn(a)}. Switch to ${sn(a)} in your wallet to ${i}.`}:{ok:!1,operator:a,reason:`Connect the authorized wallet ${sn(a)} to ${i}. Funds go to that wallet.`}:{ok:!1,operator:null,reason:`Only the authorized wallet can ${i}, and none is set. ${t.canAuthorize?"Authorize one of your wallets under Authorized wallet.":"Ask the organization owner to authorize one."}`}}function fC(t,r=Date.now()){return t.eligibleWallets.map(i=>({...i,ready:i.eligibleAt<=r}))}function hC(t,r,i=Date.now()){if(!t.canAuthorize)return t.relation==="none"?"Only the organization owner can authorize a wallet.":"A wallet is already authorized; only it can transfer the role.";if(!r)return"Connect the wallet you want to authorize.";const a=t.eligibleWallets.find(u=>Lo(u.address,r));return a?a.eligibleAt>i?`${sn(r)} was added as a sign-in method recently. For your safety it can be authorized from ${I2(a.eligibleAt)}.`:null:`${sn(r)} is not one of your sign-in methods. Add it under Your sign-in methods first; it can be authorized 24 hours later.`}const Cv={OperatorAlreadySet:{message:"Another wallet was authorized in the meantime. The panel now shows the current authorized wallet.",refresh:!0},InvalidNonce:{message:"The authorization expired: the operator nonce changed on chain. Start again to get a fresh authorization.",refresh:!0},InvalidSignature:{message:"The contract rejected the gateway's signature. The gateway and your wallet may be on different chains or deposits contracts.",refresh:!1},NotAuthorized:{message:"The connected wallet is not (or no longer) the authorized wallet. The panel now shows the current one.",refresh:!0},NotRewardRecipient:{message:"Only the authorized wallet can claim. The panel now shows the current one.",refresh:!0},RewardRecipientUnavailable:{message:"No authorized wallet is set, so rewards cannot be claimed yet.",refresh:!0},InsufficientBalance:{message:"Not enough available balance; funds reserved in open channels cannot be withdrawn.",refresh:!0},InvalidAddress:{message:"The contract rejected the address.",refresh:!1},ChannelNotActive:{message:"This channel is already settled or closed; nothing is left to do. The list now shows it.",refresh:!0},CloseAlreadyRequested:{message:"A close was already requested for this channel. The list now shows when the reserve can be withdrawn.",refresh:!0},CloseNotReady:{message:"The 15-minute grace period has not ended yet. Withdraw once the countdown reaches zero.",refresh:!0}};function K2(t){const r=new Set;let i=t;for(;i&&typeof i=="object"&&!r.has(i);){r.add(i);const u=i.data;if(u&&typeof u.errorName=="string")return u.errorName;i=i.cause}const a=t instanceof Error?`${t.message} ${t.shortMessage??""}`:String(t??"");return Object.keys(Cv).find(u=>a.includes(u))??null}function pC(t){const r=K2(t);return r?Cv[r]??null:null}class Eo extends Error{constructor(r,i,a=!1){super(r),this.refresh=i,this.retryAuth=a,this.name="OperatorPreflightError"}}function mC(t,r,i){if(t.chainId!==void 0&&t.chainId!==i.chainId)throw new Eo(`The gateway signed for chain ${t.chainId} but the console is set up for chain ${i.chainId}.`,!1);if(t.depositsContract&&i.depositsContract&&!Lo(t.depositsContract,i.depositsContract))throw new Eo("The gateway signed for a different deposits contract than the one the console reports. Reload the page.",!1);if(t.operator&&!Lo(t.operator,i.operator))throw new Eo(`The authorization is for ${sn(t.operator)}, not ${sn(i.operator)}.`,!1);if(qc(r.operator))throw new Eo(`An authorized wallet is already set (${sn(r.operator)}). The panel now shows it.`,!0);if(r.nonce.toString()!==t.nonce)throw new Eo("The operator nonce changed since the gateway signed. Getting a fresh authorization…",!0,!0)}function Q2(t,r=!0){return $e({queryKey:Re.channels(t,!1),queryFn:()=>he.wallet.channels(t,!1),enabled:r})}function Ev(){const{workspace:t,viewer:r}=ir(),i=$c(r),a=V2(i),u=Q2(t.id,i),d=a.data??[],m=new Set(d.filter(q2).map(y=>y.workspaceId)),v=d.find(y=>y.workspaceId===t.id),g=$2(u.data??[]),h=m.has(t.id);return{missingOperator:m,currentMissingOperator:h,canAuthorize:(v==null?void 0:v.canAuthorize)??!1,withdrawable:g,wallet:h||g.count>0}}const _v=["pointerdown","mousedown","pointerup","mouseup","click"],lc=new WeakMap;function Pv(t,r,i){Qc(t);let a=u=>{let d=u.target;t.contains(d)&&((!i||i(d))&&(u.preventDefault(),u.stopPropagation(),u.stopImmediatePropagation()),u.type==="click"&&(r==null||r(u)))};for(let u of _v)document.addEventListener(u,a,!0);lc.set(t,a)}function Qc(t){let r=lc.get(t);if(r){for(let i of _v)document.removeEventListener(i,r,!0);lc.delete(t)}}function G2(t,r){let i=t.wrapper.getBoundingClientRect();return{width:i.width+r,height:i.height+r,realWidth:i.width,realHeight:i.height}}function Ip(t,r){let{elementDimensions:i,popoverDimensions:a,popoverPadding:u,popoverArrowDimensions:d}=r;return t==="start"?Math.max(Math.min(i.top-u,window.innerHeight-a.realHeight-d.width),d.width):t==="end"?Math.max(Math.min(i.top-(a==null?void 0:a.realHeight)+i.height+u,window.innerHeight-(a==null?void 0:a.realHeight)-d.width),d.width):t==="center"?Math.max(Math.min(i.top+i.height/2-(a==null?void 0:a.realHeight)/2,window.innerHeight-(a==null?void 0:a.realHeight)-d.width),d.width):0}function Mp(t,r){let{elementDimensions:i,popoverDimensions:a,popoverPadding:u,popoverArrowDimensions:d}=r;return t==="start"?Math.max(Math.min(i.left-u,window.innerWidth-a.realWidth-d.width),d.width):t==="end"?Math.max(Math.min(i.left-(a==null?void 0:a.realWidth)+i.width+u,window.innerWidth-(a==null?void 0:a.realWidth)-d.width),d.width):t==="center"?Math.max(Math.min(i.left+i.width/2-(a==null?void 0:a.realWidth)/2,window.innerWidth-(a==null?void 0:a.realWidth)-d.width),d.width):0}function Gc(t,r,i){let{align:a,side:u}=i,d=i.centered?"over":u,m=i.padding,v=G2(t,i.offset),g=t.arrow.getBoundingClientRect(),h=r.getBoundingClientRect(),y=h.top-v.height,x=y>=0,C=window.innerHeight-(h.bottom+v.height),I=C>=0,L=h.left-v.width,_=L>=0,M=window.innerWidth-(h.right+v.width),D=M>=0,U=!x&&!I&&!_&&!D,b=d;if(d==="top"&&x?D=_=I=!1:d==="bottom"&&I?D=_=x=!1:d==="left"&&_?D=x=I=!1:d==="right"&&D&&(_=x=I=!1),d==="over"){let T=window.innerWidth/2-v.realWidth/2,A=window.innerHeight/2-v.realHeight/2;t.wrapper.style.left=`${T}px`,t.wrapper.style.right="auto",t.wrapper.style.top=`${A}px`,t.wrapper.style.bottom="auto"}else if(U){let T=window.innerWidth/2-(v==null?void 0:v.realWidth)/2;t.wrapper.style.left=`${T}px`,t.wrapper.style.right="auto",t.wrapper.style.bottom="10px",t.wrapper.style.top="auto"}else if(_){let T=Math.min(L,window.innerWidth-(v==null?void 0:v.realWidth)-g.width),A=Ip(a,{elementDimensions:h,popoverDimensions:v,popoverPadding:m,popoverArrowDimensions:g});t.wrapper.style.left=`${T}px`,t.wrapper.style.top=`${A}px`,t.wrapper.style.bottom="auto",t.wrapper.style.right="auto",b="left"}else if(D){let T=Math.min(M,window.innerWidth-(v==null?void 0:v.realWidth)-g.width),A=Ip(a,{elementDimensions:h,popoverDimensions:v,popoverPadding:m,popoverArrowDimensions:g});t.wrapper.style.right=`${T}px`,t.wrapper.style.top=`${A}px`,t.wrapper.style.bottom="auto",t.wrapper.style.left="auto",b="right"}else if(x){let T=Math.min(y,window.innerHeight-v.realHeight-g.width),A=Mp(a,{elementDimensions:h,popoverDimensions:v,popoverPadding:m,popoverArrowDimensions:g});t.wrapper.style.top=`${T}px`,t.wrapper.style.left=`${A}px`,t.wrapper.style.bottom="auto",t.wrapper.style.right="auto",b="top"}else if(I){let T=Math.min(C,window.innerHeight-(v==null?void 0:v.realHeight)-g.width),A=Mp(a,{elementDimensions:h,popoverDimensions:v,popoverPadding:m,popoverArrowDimensions:g});t.wrapper.style.left=`${A}px`,t.wrapper.style.bottom=`${T}px`,t.wrapper.style.top="auto",t.wrapper.style.right="auto",b="bottom"}Z2(t,U?"over":b,a,r),[...t.wrapper.classList].filter(T=>T.startsWith("driver-popover-side-")||T.startsWith("driver-popover-align-")).forEach(T=>t.wrapper.classList.remove(T)),t.wrapper.classList.add(`driver-popover-side-${b}`),t.wrapper.classList.add(`driver-popover-align-${a}`)}function Op(t,r,i,a,u,d=10){let m=a-i;return t<=i&&r>=a?u==="start"?15+d/2:u==="end"?m-15-d/2:m/2:(Math.min(Math.max(t,i),a)+Math.min(Math.max(r,i),a))/2-i}function Lp(t,r,i=10){let a=r-15-i;if(a<15)return Math.max(0,(r-i)/2);let u=t-i/2;return Math.min(Math.max(u,15),a)}function Y2(t,r,i){return t==="left"||t==="right"?r.bottom>i.top&&r.top<i.bottom?t:r.bottom<=i.top?"bottom":"top":r.right>i.left&&r.left<i.right?t:r.right<=i.left?"right":"left"}function Z2(t,r,i,a){let u=t.arrow;if(u.className="driver-popover-arrow",u.style.top="",u.style.right="",u.style.bottom="",u.style.left="",r==="over"){u.classList.add("driver-popover-arrow-none");return}let d=a.getBoundingClientRect(),m=t.wrapper.getBoundingClientRect(),v=Y2(r,d,m);u.classList.add(`driver-popover-arrow-side-${v}`);let g=u.getBoundingClientRect().width||10;if(v==="left"||v==="right"){let h=Op(d.top,d.bottom,m.top,m.bottom,i,g);u.style.top=`${Lp(h,m.height,g)}px`}else{let h=Op(d.left,d.right,m.left,m.right,i,g);u.style.left=`${Lp(h,m.width,g)}px`}}function ya(t){return typeof t=="function"?t():typeof t=="string"?document.querySelector(t):t}function X2(t){let r=window.getComputedStyle(t);return[r.overflow,r.overflowX,r.overflowY].some(i=>i==="auto"||i==="scroll")}function sa(t,r,i,a){return(t/=a/2)<1?i/2*t*t+r:-i/2*(--t*(t-2)-1)+r}function bv(t){let r='a[href]:not([disabled]), button:not([disabled]), textarea:not([disabled]), input[type="text"]:not([disabled]), input[type="radio"]:not([disabled]), input[type="checkbox"]:not([disabled]), select:not([disabled])';return t.flatMap(i=>{let a=i.matches(r),u=Array.from(i.querySelectorAll(r));return[...a?[i]:[],...u]}).filter(i=>getComputedStyle(i).pointerEvents!=="none"&&tx(i))}function jv(t,r){if(!t||ex(t))return;let i=t.offsetHeight>window.innerHeight;t.scrollIntoView({behavior:!r||J2(t)?"auto":"smooth",inline:"center",block:i?"start":"center"})}function J2(t){if(!t||!t.parentElement)return;let r=t.parentElement;return r.scrollHeight>r.clientHeight}function ex(t){let r=t.getBoundingClientRect();return r.top>=0&&r.left>=0&&r.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&r.right<=(window.innerWidth||document.documentElement.clientWidth)}function tx(t){return!!(t.offsetWidth||t.offsetHeight||t.getClientRects().length)}function Tv(t){t&&(t.wrapper.style.display="none")}function nx(t,r){var _;let i=ix();document.body.appendChild(i.wrapper);let{title:a,description:u,showButtons:d,disableButtons:m,showProgress:v,nextBtnText:g,prevBtnText:h,progressText:y}=r;i.nextButton.innerHTML=g,i.previousButton.innerHTML=h,i.progress.innerHTML=y,i.closeButton.setAttribute("aria-label",r.closeBtnLabel),r.doneButton&&i.nextButton.classList.add("driver-popover-done-btn"),a?(i.title.innerHTML=a,i.title.style.display="block"):i.title.style.display="none",u?(i.description.innerHTML=u,i.description.style.display="block"):i.description.style.display="none";let x=d.includes("next")||d.includes("previous")||v;i.closeButton.style.display=d.includes("close")?"block":"none",x?(i.footer.style.display="flex",i.progress.style.display=v?"block":"none",i.nextButton.style.display=d.includes("next")?"block":"none",i.previousButton.style.display=d.includes("previous")?"block":"none"):i.footer.style.display="none",m.includes("next")&&(i.nextButton.disabled=!0,i.nextButton.classList.add("driver-popover-btn-disabled")),m.includes("previous")&&(i.previousButton.disabled=!0,i.previousButton.classList.add("driver-popover-btn-disabled")),m.includes("close")&&(i.closeButton.disabled=!0,i.closeButton.classList.add("driver-popover-btn-disabled"));let C=i.wrapper;C.style.display="block",C.style.left="",C.style.top="",C.style.bottom="",C.style.right="",C.id="driver-popover-content",C.setAttribute("role","dialog"),C.setAttribute("aria-labelledby","driver-popover-title"),C.setAttribute("aria-describedby","driver-popover-description");let I=i.arrow;I.className="driver-popover-arrow",C.className=`driver-popover ${r.popoverClass||""}`.trim(),Pv(i.wrapper,M=>{var U,b,T;let D=M.target;if(D.closest(".driver-popover-next-btn"))return(U=r.onNextClick)==null?void 0:U.call(r);if(D.closest(".driver-popover-prev-btn"))return(b=r.onPrevClick)==null?void 0:b.call(r);if(D.closest(".driver-popover-close-btn"))return(T=r.onCloseClick)==null?void 0:T.call(r)},M=>i.description.contains(M)||i.title.contains(M)?!1:!!M.closest(".driver-popover-prev-btn, .driver-popover-next-btn, .driver-popover-close-btn")),(_=r.onRender)==null||_.call(r,i),Gc(i,t,r.position),rx(i,t,r.position),jv(C,r.smoothScroll);let L=bv([C,t]);return L.length>0&&L[0].focus(),i}function rx(t,r,i){t.wrapper.querySelectorAll("img").forEach(a=>{if(a.complete)return;let u=()=>Gc(t,r,i);a.addEventListener("load",u,{once:!0}),a.addEventListener("error",u,{once:!0})})}function ix(){let t=document.createElement("div");t.classList.add("driver-popover");let r=document.createElement("div");r.classList.add("driver-popover-arrow");let i=document.createElement("header");i.id="driver-popover-title",i.classList.add("driver-popover-title"),i.style.display="none",i.innerText="Popover Title";let a=document.createElement("div");a.id="driver-popover-description",a.classList.add("driver-popover-description"),a.style.display="none",a.innerText="Popover description is here";let u=document.createElement("button");u.type="button",u.classList.add("driver-popover-close-btn"),u.innerHTML="×";let d=document.createElement("footer");d.classList.add("driver-popover-footer");let m=document.createElement("span");m.classList.add("driver-popover-progress-text"),m.innerText="";let v=document.createElement("span");v.classList.add("driver-popover-navigation-btns");let g=document.createElement("button");g.type="button",g.classList.add("driver-popover-prev-btn","driver-popover-footer-btn"),g.innerHTML="Previous";let h=document.createElement("button");return h.type="button",h.classList.add("driver-popover-next-btn","driver-popover-footer-btn"),h.innerHTML="Next",v.appendChild(g),v.appendChild(h),d.appendChild(m),d.appendChild(v),t.appendChild(u),t.appendChild(r),t.appendChild(i),t.appendChild(a),t.appendChild(d),{wrapper:t,arrow:r,title:i,description:a,footer:d,previousButton:g,nextButton:h,closeButton:u,footerButtons:v,progress:m}}function Rv(t){var r;t&&(Qc(t.wrapper),(r=t.wrapper.parentElement)==null||r.removeChild(t.wrapper))}function Nv(t,r){let i=window.innerWidth,a=window.innerHeight,u=r.padding,d=r.radius,m=t.width+u*2,v=t.height+u*2,g=Math.min(d,m/2,v/2),h=Math.floor(Math.max(g,0)),y=t.x-u+h,x=t.y-u,C=m-h*2,I=v-h*2;return`M${i},0L0,0L0,${a}L${i},${a}L${i},0Z
|
|
82
82
|
M${y},${x} h${C} a${h},${h} 0 0 1 ${h},${h} v${I} a${h},${h} 0 0 1 -${h},${h} h-${C} a${h},${h} 0 0 1 -${h},-${h} v-${I} a${h},${h} 0 0 1 ${h},-${h} z`}function ox(t,r,i,a,u){let d=t.getState("__activeStagePosition"),m=d||a.getBoundingClientRect(),v=u.getBoundingClientRect();d={x:sa(r,m.x,v.x-m.x,i),y:sa(r,m.y,v.y-m.y,i),width:sa(r,m.width,v.width-m.width,i),height:sa(r,m.height,v.height-m.height,i)},Mv(t,d),t.setState("__activeStagePosition",d)}function Iv(t,r){if(!r)return;let i=r.getBoundingClientRect(),a={x:i.x,y:i.y,width:i.width,height:i.height};t.setState("__activeStagePosition",a),Mv(t,a)}function sx(t){let r=t.getState("__activeStagePosition"),i=t.getState("__overlaySvg");if(!r)return;if(!i){console.warn("No stage svg found.");return}let a=window.innerWidth,u=window.innerHeight;i.setAttribute("viewBox",`0 0 ${a} ${u}`)}function ax(t,r){let i=lx(t,r);document.body.appendChild(i),Pv(i,a=>{a.target.tagName==="path"&&t.emit("overlayClick")}),t.setState("__overlaySvg",i)}function Mv(t,r){let i=t.getState("__overlaySvg");if(!i){ax(t,r);return}let a=i.firstElementChild;if((a==null?void 0:a.tagName)!=="path")throw Error("no path element found in stage svg");a.setAttribute("d",Nv(r,Ov(t)))}function Ov(t){var r;return((r=t.getState("activeElement"))==null?void 0:r.id)==="driver-dummy-element"?{padding:0,radius:0}:{padding:t.getConfig("stagePadding")||0,radius:t.getConfig("stageRadius")||0}}function lx(t,r){let i=window.innerWidth,a=window.innerHeight,u=document.createElementNS("http://www.w3.org/2000/svg","svg");u.classList.add("driver-overlay","driver-overlay-animated"),u.setAttribute("viewBox",`0 0 ${i} ${a}`),u.setAttribute("xmlSpace","preserve"),u.setAttribute("xmlnsXlink","http://www.w3.org/1999/xlink"),u.setAttribute("version","1.1"),u.setAttribute("preserveAspectRatio","xMinYMin slice"),u.style.fillRule="evenodd",u.style.clipRule="evenodd",u.style.strokeLinejoin="round",u.style.strokeMiterlimit="2",u.style.zIndex="10000",u.style.position="fixed",u.style.top="0",u.style.left="0",u.style.width="100%",u.style.height="100%";let d=document.createElementNS("http://www.w3.org/2000/svg","path");return d.setAttribute("d",Nv(r,Ov(t))),d.style.fill=t.getConfig("overlayColor")||"rgb(0,0,0)",d.style.opacity=`${t.getConfig("overlayOpacity")}`,d.style.pointerEvents="auto",d.style.cursor="auto",u.appendChild(d),u}function ux(t){let r=t.getState("__overlaySvg");r&&(Qc(r),r.remove())}const Lv="{{current}} of {{total}}";function Av(t,r){return!(r.skipMissingElement??t.getConfig("skipMissingElement"))||!r.element?!1:!ya(r.element)}function En(t,r,i){let a=t.getConfig("steps")||[];for(let u=r;u>=0&&u<a.length;u+=i)if(!Av(t,a[u]))return u}function ha(t,r){var d,m;let i=t.getState("activeIndex"),a=i!==void 0&&En(t,i+1,1)===void 0,u=((d=r==null?void 0:r.popover)==null?void 0:d.onDoneClick)||t.getConfig("onDoneClick");return a&&u?u:((m=r==null?void 0:r.popover)==null?void 0:m.onNextClick)||t.getConfig("onNextClick")}function Dv(t,r){var i;return((i=r==null?void 0:r.popover)==null?void 0:i.onPrevClick)||t.getConfig("onPrevClick")}function cx(t,r){var i;return((i=r==null?void 0:r.popover)==null?void 0:i.onCloseClick)||t.getConfig("onCloseClick")}function dx(t,r,i){let a=t.getConfig("steps")||[],u=a[r],d=u.popover||{},m=En(t,r+1,1)!==void 0,v=En(t,r-1,-1)!==void 0,g=d.doneBtnText||t.getConfig("doneBtnText")||"Done",h=t.getConfig("allowClose"),y=d.showProgress===void 0?t.getConfig("showProgress"):d.showProgress,x=(d.progressText||t.getConfig("progressText")||Lv).replace("{{current}}",`${r+1}`).replace("{{total}}",`${a.length}`),C=d.showButtons||t.getConfig("showButtons"),I=["next","previous",...h?["close"]:[]].filter(D=>!(C!=null&&C.length)||C.includes(D)),L=d.onNextClick||t.getConfig("onNextClick"),_=d.onPrevClick||t.getConfig("onPrevClick"),M=d.onCloseClick||t.getConfig("onCloseClick");return{...u,popover:{showButtons:I,nextBtnText:m?void 0:g,disableButtons:[...t.getConfig("disableButtons")||[],...v?[]:["previous"]],showProgress:y,onNextClick:L||i.onNextClick,onPrevClick:_||i.onPrevClick,onCloseClick:M||i.onCloseClick,...d,progressText:x}}}function uc(t,r){var i,a;return{showButtons:((i=r==null?void 0:r.popover)==null?void 0:i.showButtons)||t.getConfig("showButtons")||[],disableButtons:((a=r==null?void 0:r.popover)==null?void 0:a.disableButtons)||t.getConfig("disableButtons")||[]}}function Fv(t,r,i){var u,d;let a=t.getConfig("stagePadding")||0;return{side:((u=i.popover)==null?void 0:u.side)||"bottom",align:((d=i.popover)==null?void 0:d.align)||"start",offset:a+(t.getConfig("popoverOffset")||0),padding:a,centered:r.id==="driver-dummy-element"}}function fx(t,r,i){let a=i.popover||{},u=t.getState("activeIndex"),d=u!==void 0&&En(t,u+1,1)===void 0;return{title:a.title,description:a.description,...uc(t,i),showProgress:a.showProgress||t.getConfig("showProgress")||!1,progressText:a.progressText??(t.getConfig("progressText")||Lv),nextBtnText:a.nextBtnText??(t.getConfig("nextBtnText")||"Next"),prevBtnText:a.prevBtnText??(t.getConfig("prevBtnText")||"Previous"),closeBtnLabel:a.closeBtnLabel??(t.getConfig("closeBtnLabel")||"Close"),doneButton:d,popoverClass:a.popoverClass||t.getConfig("popoverClass")||"",smoothScroll:t.getConfig("smoothScroll"),onNextClick:()=>{let m=ha(t,i);return m?m(r,i,t.getHookOpts()):t.emit("nextClick")},onPrevClick:()=>{let m=Dv(t,i);return m?m(r,i,t.getHookOpts()):t.emit("prevClick")},onCloseClick:()=>{let m=cx(t,i);return m?m(r,i,t.getHookOpts()):t.emit("closeClick")},onRender:m=>{var v;t.setState("popover",m),(v=a.onPopoverRender||t.getConfig("onPopoverRender"))==null||v(m,t.getHookOpts())},position:Fv(t,r,i)}}function Ap(t,r,i){Rv(t.getState("popover")),nx(r,fx(t,r,i))}function hx(t,r,i){let a=t.getState("popover");a&&Gc(a,r,Fv(t,r,i))}const Dp={"aria-haspopup":"dialog","aria-expanded":"true","aria-controls":"driver-popover-content"},wa=new WeakMap;function px(t){if(!wa.has(t)){let r=Object.fromEntries(Object.keys(Dp).map(i=>[i,t.getAttribute(i)]));wa.set(t,r)}for(let[r,i]of Object.entries(Dp))t.setAttribute(r,i)}function zv(t){let r=wa.get(t);if(r){for(let[i,a]of Object.entries(r))a===null?t.removeAttribute(i):t.setAttribute(i,a);wa.delete(t)}}function mx(){let t=document.getElementById("driver-dummy-element");if(t)return t;let r=document.createElement("div");return r.id="driver-dummy-element",r.style.width="0",r.style.height="0",r.style.pointerEvents="none",r.style.opacity="0",r.style.position="fixed",r.style.top="50%",r.style.left="50%",document.body.appendChild(r),r}function Fp(t,r){let i=ya(r.element);i||(i=mx()),gx(t,i,r)}function vx(t){let r=t.getState("__activeElement"),i=t.getState("__activeStep");r&&(Iv(t,r),sx(t),hx(t,r,i))}function gx(t,r,i){let a=t.getConfig("duration")||400,u=Date.now(),d=t.getState("__activeStep"),m=t.getState("__activeElement")||r,v=!m||m===r,g=r.id==="driver-dummy-element",h=m.id==="driver-dummy-element",y=t.getConfig("animate"),x=i.onHighlightStarted||t.getConfig("onHighlightStarted"),C=(i==null?void 0:i.onHighlighted)||t.getConfig("onHighlighted"),I=(d==null?void 0:d.onDeselected)||t.getConfig("onDeselected"),L=t.getHookOpts();d&&d!==i&&I&&I(h?void 0:m,d,L),x&&x(g?void 0:r,i,L);let _=!v&&y,M=!1;Tv(t.getState("popover")),t.setState("previousStep",d),t.setState("previousElement",m),t.setState("activeStep",i),t.setState("activeElement",r);let D=()=>{if(t.getState("__transitionCallback")!==D)return;let b=Date.now()-u,T=a-b<=a/2;i.popover&&T&&!M&&_&&(Ap(t,r,i),M=!0),t.getConfig("animate")&&b<a?ox(t,b,a,m,r):(Iv(t,r),C&&C(g?void 0:r,i,t.getHookOpts()),t.setState("__transitionCallback",void 0),t.setState("__previousStep",d),t.setState("__previousElement",m),t.setState("__activeStep",i),t.setState("__activeElement",r)),window.requestAnimationFrame(D)};t.setState("__transitionCallback",D),window.requestAnimationFrame(D),jv(r,t.getConfig("smoothScroll")),!_&&i.popover&&Ap(t,r,i),document.querySelectorAll(".driver-active-element-parent").forEach(b=>{b.classList.remove("driver-active-element-parent","driver-active-element-parent-no-scroll")}),document.querySelectorAll(".driver-active-element").forEach(b=>{b.classList.remove("driver-active-element","driver-no-interaction"),zv(b)}),(i.disableActiveInteraction??t.getConfig("disableActiveInteraction"))&&r.classList.add("driver-no-interaction");let U=r.parentElement;U&&U!==document.body&&(U.classList.add("driver-active-element-parent"),X2(U)&&U.classList.add("driver-active-element-parent-no-scroll")),r.classList.add("driver-active-element"),px(r)}function yx(){var t;(t=document.getElementById("driver-dummy-element"))==null||t.remove(),document.querySelectorAll(".driver-active-element").forEach(r=>{let i=r.parentElement;i&&i!==document.body&&i.classList.remove("driver-active-element-parent","driver-active-element-parent-no-scroll"),r.classList.remove("driver-active-element","driver-no-interaction"),zv(r)})}function cc(t){let r=t.getState("__resizeTimeout");r&&window.cancelAnimationFrame(r),t.setState("__resizeTimeout",window.requestAnimationFrame(()=>vx(t)))}function wx(t,r){var v,g,h;if(!t.getState("isInitialized")||!(r.key==="Tab"||r.keyCode===9))return;let i=t.getState("__activeElement"),a=(v=t.getState("popover"))==null?void 0:v.wrapper,u=bv([...a?[a]:[],...i?[i]:[]]),d=u[0],m=u[u.length-1];r.preventDefault(),r.shiftKey?(g=u[u.indexOf(document.activeElement)-1]||m)==null||g.focus():(h=u[u.indexOf(document.activeElement)+1]||d)==null||h.focus()}function xx(t,r){(t.getConfig("allowKeyboardControl")??!0)&&(r.key==="Escape"?t.emit("escapePress"):r.key==="ArrowRight"?t.emit("arrowRightPress"):r.key==="ArrowLeft"&&t.emit("arrowLeftPress"))}function Sx(t,r){let i=t.getState("__activeElement"),a=r.target;!i||!a||!i.contains(a)||t.emit("activeElementClick")}function kx(t){let r=m=>xx(t,m),i=m=>wx(t,m),a=()=>cc(t),u=()=>cc(t),d=m=>Sx(t,m);t.setState("__events",{onKeyup:r,onKeydown:i,onResize:a,onScroll:u,onClick:d}),window.addEventListener("keyup",r,!1),window.addEventListener("keydown",i,!1),window.addEventListener("resize",a),window.addEventListener("scroll",u),document.addEventListener("click",d,!1)}function Cx(t){let r=t.getState("__events");r&&(window.removeEventListener("keyup",r.onKeyup),window.removeEventListener("keydown",r.onKeydown),window.removeEventListener("resize",r.onResize),window.removeEventListener("scroll",r.onScroll),document.removeEventListener("click",r.onClick,!1))}function Ex(){let t={};function r(i={}){t={animate:!0,duration:400,allowClose:!0,allowScroll:!0,overlayClickBehavior:"close",overlayOpacity:.7,smoothScroll:!1,disableActiveInteraction:!1,advanceOnClick:!1,skipMissingElement:!1,waitForElement:0,showProgress:!1,stagePadding:10,stageRadius:5,popoverOffset:10,showButtons:["next","previous","close"],disableButtons:[],overlayColor:"#000",...i}}return r(),{getConfig:(i=>i?t[i]:t),configure:r}}function _x(){let t={},r=(u=>u?t[u]:t),i=(u,d)=>{t[u]=d};function a(){t={}}return{getState:r,setState:i,resetState:a}}function Px(){let t={};function r(u,d){t[u]=d}function i(u){var d;(d=t[u])==null||d.call(t)}function a(){t={}}return{listen:r,emit:i,reset:a}}function bx(t={}){let r=Ex();r.configure(t);let i=_x(),a=Px(),u;return{getConfig:r.getConfig,setConfig:r.configure,getState:i.getState,setState:i.setState,resetState:i.resetState,listen:a.listen,emit:a.emit,resetEmitter:a.reset,getDriver:()=>u,setDriver:d=>{u=d},getHookOpts:d=>{let m=d||i.getState();return{config:r.getConfig(),state:m,driver:u,index:m.activeIndex}}}}let fi;function jx(t={}){let r=bx(t),i=()=>D(!1);function a(){r.getConfig("allowClose")&&D()}function u(){let{disableButtons:b}=uc(r,r.getState("__activeStep"));b.includes("close")||a()}function d(b){let{showButtons:T,disableButtons:A}=uc(r,r.getState("__activeStep"));return T.includes(b)&&!A.includes(b)}function m(){let b=r.getConfig("overlayClickBehavior");if(r.getConfig("allowClose")&&b==="close"){D();return}if(typeof b=="function"){let T=r.getState("__activeStep");b(r.getState("__activeElement"),T,r.getHookOpts());return}if(b==="nextStep"){let T=r.getState("activeStep"),A=r.getState("activeElement"),q=ha(r,T);if(q){q(A,T,r.getHookOpts());return}v()}}function v(){let b=r.getState("activeIndex"),T=r.getConfig("steps")||[];if(b===void 0)return;let A=b+1;T[A]?M(A):D()}function g(){let b=r.getState("activeIndex"),T=r.getConfig("steps")||[];if(b===void 0)return;let A=b-1;T[A]?M(A):D()}function h(b){(r.getConfig("steps")||[])[b]?M(b):D()}function y(){if(r.getState("__transitionCallback"))return;let b=r.getState("__activeStep");if(!b||!(b.advanceOnClick??r.getConfig("advanceOnClick")))return;let T=r.getState("__activeElement"),A=ha(r,b);if(A){A(T,b,r.getHookOpts());return}v()}function x(){if(r.getState("__transitionCallback"))return;let b=r.getState("activeIndex"),T=r.getState("__activeStep"),A=r.getState("__activeElement");if(b===void 0||T===void 0||!(r.getConfig("steps")||[])[b-1]||!d("previous"))return;let q=Dv(r,T);if(q)return q(A,T,r.getHookOpts());g()}function C(){if(r.getState("__transitionCallback"))return;let b=r.getState("activeIndex"),T=r.getState("__activeStep"),A=r.getState("__activeElement");if(b===void 0||T===void 0||!d("next"))return;let q=ha(r,T);if(q)return q(A,T,r.getHookOpts());v()}function I(){r.getState("isInitialized")||(fi&&fi!==i&&fi(),fi=i,r.setState("isInitialized",!0),document.body.classList.add("driver-active",r.getConfig("animate")?"driver-fade":"driver-simple"),r.getConfig("allowScroll")||document.body.classList.add("driver-no-scroll"),document.body.style.setProperty("--driver-animation-duration",`${r.getConfig("duration")||400}ms`),kx(r),r.listen("overlayClick",m),r.listen("activeElementClick",y),r.listen("escapePress",u),r.listen("closeClick",a),r.listen("arrowLeftPress",x),r.listen("arrowRightPress",C))}function L(){let b=r.getState("__pendingWaitCancel");b&&(r.setState("__pendingWaitCancel",void 0),b())}function _(b,T,A){let q=()=>{ie.disconnect(),window.clearTimeout(Q),r.setState("__pendingWaitCancel",void 0),A()},ie=new MutationObserver(()=>{ya(b.element)&&q()}),Q=window.setTimeout(q,T);r.setState("__pendingWaitCancel",()=>{ie.disconnect(),window.clearTimeout(Q)}),ie.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0})}function M(b=0,T=!1){L();let A=r.getConfig("steps");if(!A){console.error("No steps to drive through"),D();return}if(!A[b]){D();return}let q=A[b],ie=q.waitForElement??r.getConfig("waitForElement")??0;if(!T&&ie>0&&q.element&&!ya(q.element)){Tv(r.getState("popover")),_(q,ie,()=>M(b,!0));return}if(Av(r,q)){let ne=r.getState("activeIndex"),ae=typeof ne=="number"&&b<ne?-1:1;A[b+ae]?M(b+ae):ae===1&&D();return}r.setState("__activeOnDestroyed",document.activeElement),r.setState("activeIndex",b);let Q=A[b+1];Fp(r,dx(r,b,{onNextClick:()=>{Q?M(b+1):D()},onPrevClick:()=>{M(b-1)},onCloseClick:()=>{D()}}))}function D(b=!0){if(!r.getState("isInitialized"))return;let T=r.getState("__activeElement"),A=r.getState("__activeStep"),q=r.getState("__activeOnDestroyed"),ie=r.getConfig("onDestroyStarted");if(b&&ie){ie(!T||(T==null?void 0:T.id)==="driver-dummy-element"?void 0:T,A,r.getHookOpts());return}fi===i&&(fi=void 0);let Q=(A==null?void 0:A.onDeselected)||r.getConfig("onDeselected"),ne=r.getConfig("onDestroyed");document.body.classList.remove("driver-active","driver-fade","driver-simple","driver-no-scroll"),document.body.style.removeProperty("--driver-animation-duration"),L(),Cx(r),Rv(r.getState("popover")),yx(),ux(r),r.resetEmitter();let ae=r.getState();if(r.resetState(),T&&A){let V=T.id==="driver-dummy-element";Q&&Q(V?void 0:T,A,r.getHookOpts(ae)),ne&&ne(V?void 0:T,A,r.getHookOpts(ae))}q&&q.focus()}let U={isActive:()=>r.getState("isInitialized")||!1,refresh:()=>cc(r),drive:(b=0)=>{I(),M(b)},setConfig:r.setConfig,setSteps:b=>{L(),r.resetState(),r.setConfig({...r.getConfig(),steps:b})},getConfig:r.getConfig,getState:r.getState,getActiveIndex:()=>r.getState("activeIndex"),isFirstStep:()=>{let b=r.getState("activeIndex");return b!==void 0&&En(r,b-1,-1)===void 0},isLastStep:()=>{let b=r.getState("activeIndex");return b!==void 0&&En(r,b+1,1)===void 0},getActiveStep:()=>r.getState("activeStep"),getActiveElement:()=>r.getState("activeElement"),getPreviousElement:()=>r.getState("previousElement"),getPreviousStep:()=>r.getState("previousStep"),getNextStep:()=>{let b=r.getConfig("steps")||[],T=r.getState("activeIndex");if(T===void 0)return;let A=En(r,T+1,1);return A===void 0?void 0:b[A]},moveNext:v,movePrevious:g,moveTo:h,hasNextStep:()=>{let b=r.getState("activeIndex");return b!==void 0&&En(r,b+1,1)!==void 0},hasPreviousStep:()=>{let b=r.getState("activeIndex");return b!==void 0&&En(r,b-1,-1)!==void 0},highlight:b=>{I(),Fp(r,{...b,popover:b.popover?{showButtons:[],showProgress:!1,progressText:"",...b.popover}:void 0})},destroy:()=>{D(!1)}};return r.setDriver(U),U}const Tx="antseed-console:tour-seen",Rx=t=>`nav-${t}`;function Nx(t){const r=(i,a)=>Bc(i,t)?[{target:Rx(i),...a}]:[];return[{title:"Welcome to your gateway",description:"This console runs on your gateway. It decides who can call the API, which sellers on the Antseed network serve those calls, and what they cost. Here is where everything lives."},{target:"workspace",title:"Workspaces",description:"Each workspace has its own wallet, members, keys and budgets. Switch between them here."},...r("wallet",{title:"Fund the wallet",description:"Requests are paid in USDC from the workspace wallet. Add funds by card where available or by sending USDC, and authorize the wallet that may withdraw."}),...r("keys",{title:"API keys",description:"Create a key for each app or person. Each key can have daily, weekly, monthly and total budgets and its own routing policy. Clients call the gateway's /v1 address with the key."}),..._a(t)?r("settings",{title:"Buyer settings come first",description:"Settings → Buyer is the top of every routing policy: price caps, minimum trust (60 by default) and reputation, verification, payment limits and the RPC endpoint. If sellers you expect are missing, look here first."}):[],...r("routing",{title:"Routing policies",description:"Choose which sellers may serve: allow or block sellers, minimum trust, price caps, TEE only, fallback chains. Policies go from the buyer settings to the gateway default, workspaces, members, keys and presets, and each level can only narrow the one above. The route preview shows which sellers a request would use."}),...r("providers",{title:"Providers",description:"Every provider (seller) on the network this gateway sees, with prices, trust and the latency it measured. Open one to copy its models and an API call, or allow, block or prefer it."}),...r("activity",{title:"Usage and logs",description:"Spend and requests by model, key and member, and a searchable log of every request."}),...r("chat",{title:"Try it in Chat",description:"Chat with any model on the network, paid by your own Web chat key. Every answer shows which seller served it and what it cost."}),{target:"account",title:"That is the tour",description:"Replay it any time from your account menu."}]}function Ix(t){return t instanceof HTMLElement&&t.getClientRects().length>0}function Mx(t){var a;const r=t.target?document.querySelector(`[data-tour="${t.target}"]`):null,i=(a=t.target)!=null&&a.startsWith("nav-")?"right":"bottom";return{...Ix(r)?{element:r}:{},popover:{title:t.title,description:t.description,side:i,align:"start"}}}function $v(t){return`${Tx}:${t}`}function Ox(t){try{return localStorage.getItem($v(t))==="1"}catch{return!0}}function Lx(t){try{localStorage.setItem($v(t),"1")}catch{}}function zp(t,r){const i=Nx(t).map(Mx);jx({steps:i,showProgress:!0,progressText:"{{current}} of {{total}}",nextBtnText:"Next",prevBtnText:"Back",doneBtnText:"Done",popoverClass:"gc-tour",stagePadding:4,stageRadius:8,onDestroyed:()=>Lx(r)}).drive()}function on(t){const r=new Uint8Array(t);let i="";for(const u of r)i+=String.fromCharCode(u);return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function xa(t){const r=t.replace(/-/g,"+").replace(/_/g,"/"),i=(4-r.length%4)%4,a=r.padEnd(r.length+i,"="),u=atob(a),d=new ArrayBuffer(u.length),m=new Uint8Array(d);for(let v=0;v<u.length;v++)m[v]=u.charCodeAt(v);return d}function Bo(){return Ax.stubThis((globalThis==null?void 0:globalThis.PublicKeyCredential)!==void 0&&typeof globalThis.PublicKeyCredential=="function")}const Ax={stubThis:t=>t};function Uv(t){const{id:r}=t;return{...t,id:xa(r),transports:t.transports}}function Bv(t){return t==="localhost"||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(t)}class tt extends Error{constructor({message:r,code:i,cause:a,name:u}){super(r,{cause:a}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=u??a.name,this.code=i}}function Dx({error:t,options:r}){var a,u,d;const{publicKey:i}=r;if(!i)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(r.signal instanceof AbortSignal)return new tt({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((a=i.authenticatorSelection)==null?void 0:a.requireResidentKey)===!0)return new tt({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(r.mediation==="conditional"&&((u=i.authenticatorSelection)==null?void 0:u.userVerification)==="required")return new tt({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((d=i.authenticatorSelection)==null?void 0:d.userVerification)==="required")return new tt({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new tt({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new tt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return i.pubKeyCredParams.filter(v=>v.type==="public-key").length===0?new tt({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new tt({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const m=globalThis.location.hostname;if(Bv(m)){if(i.rp.id!==m)return new tt({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new tt({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new tt({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new tt({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return t}class Fx{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){const i=new Error("Cancelling existing WebAuthn API call for new one");i.name="AbortError",this.controller.abort(i)}const r=new AbortController;return this.controller=r,r.signal}cancelCeremony(){if(this.controller){const r=new Error("Manually cancelling existing WebAuthn API call");r.name="AbortError",this.controller.abort(r),this.controller=void 0}}}const Hv=new Fx,zx=["cross-platform","platform"];function Wv(t){if(t&&!(zx.indexOf(t)<0))return t}async function Vv(t){var L;!t.optionsJSON&&t.challenge&&(console.warn("startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),t={optionsJSON:t});const{optionsJSON:r,useAutoRegister:i=!1}=t;if(!Bo())throw new Error("WebAuthn is not supported in this browser");const a={...r,challenge:xa(r.challenge),user:{...r.user,id:xa(r.user.id)},excludeCredentials:(L=r.excludeCredentials)==null?void 0:L.map(Uv)},u={};i&&(u.mediation="conditional"),u.publicKey=a,u.signal=Hv.createNewAbortSignal();let d;try{d=await navigator.credentials.create(u)}catch(_){throw Dx({error:_,options:u})}if(!d)throw new Error("Registration was not completed");const{id:m,rawId:v,response:g,type:h}=d;let y;typeof g.getTransports=="function"&&(y=g.getTransports());let x;if(typeof g.getPublicKeyAlgorithm=="function")try{x=g.getPublicKeyAlgorithm()}catch(_){Lu("getPublicKeyAlgorithm()",_)}let C;if(typeof g.getPublicKey=="function")try{const _=g.getPublicKey();_!==null&&(C=on(_))}catch(_){Lu("getPublicKey()",_)}let I;if(typeof g.getAuthenticatorData=="function")try{I=on(g.getAuthenticatorData())}catch(_){Lu("getAuthenticatorData()",_)}return{id:m,rawId:on(v),response:{attestationObject:on(g.attestationObject),clientDataJSON:on(g.clientDataJSON),transports:y,publicKeyAlgorithm:x,publicKey:C,authenticatorData:I},type:h,clientExtensionResults:d.getClientExtensionResults(),authenticatorAttachment:Wv(d.authenticatorAttachment)}}function Lu(t,r){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${t}. You should report this error to them.
|
|
83
|
-
`,r)}function $x(){if(!Bo())return Au.stubThis(new Promise(r=>r(!1)));const t=globalThis.PublicKeyCredential;return(t==null?void 0:t.isConditionalMediationAvailable)===void 0?Au.stubThis(new Promise(r=>r(!1))):Au.stubThis(t.isConditionalMediationAvailable())}const Au={stubThis:t=>t};function Ux({error:t,options:r}){const{publicKey:i}=r;if(!i)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(r.signal instanceof AbortSignal)return new tt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new tt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const a=globalThis.location.hostname;if(Bv(a)){if(i.rpId!==a)return new tt({message:`The RP ID "${i.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new tt({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new tt({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return t}async function qv(t){var I,L;!t.optionsJSON&&t.challenge&&(console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),t={optionsJSON:t});const{optionsJSON:r,useBrowserAutofill:i=!1,verifyBrowserAutofillInput:a=!0}=t;if(!Bo())throw new Error("WebAuthn is not supported in this browser");let u;((I=r.allowCredentials)==null?void 0:I.length)!==0&&(u=(L=r.allowCredentials)==null?void 0:L.map(Uv));const d={...r,challenge:xa(r.challenge),allowCredentials:u},m={};if(i){if(!await $x())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete$='webauthn']").length<1&&a)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');m.mediation="conditional",d.allowCredentials=[]}m.publicKey=d,m.signal=Hv.createNewAbortSignal();let v;try{v=await navigator.credentials.get(m)}catch(_){throw Ux({error:_,options:m})}if(!v)throw new Error("Authentication was not completed");const{id:g,rawId:h,response:y,type:x}=v;let C;return y.userHandle&&(C=on(y.userHandle)),{id:g,rawId:on(h),response:{authenticatorData:on(y.authenticatorData),clientDataJSON:on(y.clientDataJSON),signature:on(y.signature),userHandle:C},type:x,clientExtensionResults:v.getClientExtensionResults(),authenticatorAttachment:Wv(v.authenticatorAttachment)}}function Ir(t){return t.trim().toLowerCase().replace(/^0x/,"")}function Kv(t,r){return Ir(t)===Ir(r)}const Bx={balanced:"Balanced",price:"Lowest price",latency:"Lowest latency",trust:"Highest trust"};function Yc(){return{allowMode:"any",allowedPeerIds:[],allowedListIds:[],blockedPeerIds:[],blockedListIds:[],minTrustScore:"",minReputation:"",requireVerified:!1,requireTee:!1,maxInputUsdPerMillion:"",maxOutputUsdPerMillion:"",maxCachedInputUsdPerMillion:"",maxImageUsdPerImage:"",preferFreePeers:"inherit",sort:"",modelsMode:"any",allowedModels:[],routes:[]}}function hi(t){return t===void 0?"":String(t)}function Hx(t){return t===void 0?"inherit":t?"yes":"no"}function Wx(t){const r=Yc();return t?{...r,allowMode:t.allowedPeerIds||t.allowedPeerLists?"only":"any",allowedPeerIds:[...t.allowedPeerIds??[]],allowedListIds:[...t.allowedPeerLists??[]],blockedPeerIds:[...t.blockedPeerIds??[]],blockedListIds:[...t.blockedPeerLists??[]],minTrustScore:hi(t.minTrustScore),minReputation:hi(t.minReputation),requireVerified:t.requireVerified===!0,requireTee:t.requireTee===!0,maxInputUsdPerMillion:hi(t.maxInputUsdPerMillion),maxOutputUsdPerMillion:hi(t.maxOutputUsdPerMillion),maxCachedInputUsdPerMillion:hi(t.maxCachedInputUsdPerMillion),maxImageUsdPerImage:hi(t.maxImageUsdPerImage),preferFreePeers:Hx(t.preferFreePeers),sort:t.sort??"",modelsMode:t.allowedModels?"only":"any",allowedModels:[...t.allowedModels??[]],routes:Object.entries(t.modelRoutes??{}).map(([i,a])=>({model:i,peerIds:[...a.peerIds],strict:a.strict===!0}))}:r}class Sa extends Error{}function Du(t,r,i){const a=r.trim();if(a==="")return;const u=Number(a);if(!Number.isFinite(u)||u<0)throw new Sa(`${t} must be a positive number.`);if(i!==void 0&&u>i)throw new Sa(`${t} must be at most ${i}.`);return u}function mi(t){return[...new Set(t.map(r=>r.trim()).filter(Boolean))]}function $p(t,r){const i=mi(t);return r?i.filter(a=>r.some(u=>u.id===a)):i}function vC(t,r=null){const i={};if(t.allowMode==="only"){const h=$p(t.allowedListIds,r),y=mi(t.allowedPeerIds);(y.length>0||h.length===0)&&(i.allowedPeerIds=y),h.length>0&&(i.allowedPeerLists=h)}const a=mi(t.blockedPeerIds);a.length>0&&(i.blockedPeerIds=a);const u=$p(t.blockedListIds,r);u.length>0&&(i.blockedPeerLists=u);const d=Du("Minimum trust",t.minTrustScore,100);d!==void 0&&(i.minTrustScore=d);const m=Du("Minimum reputation",t.minReputation,100);m!==void 0&&(i.minReputation=m),t.requireVerified&&(i.requireVerified=!0),t.requireTee&&(i.requireTee=!0);const v=[["maxInputUsdPerMillion","Input price cap"],["maxOutputUsdPerMillion","Output price cap"],["maxCachedInputUsdPerMillion","Cached input price cap"],["maxImageUsdPerImage","Image price cap"]];for(const[h,y]of v){const x=Du(y,t[h]);x!==void 0&&(i[h]=x)}t.preferFreePeers!=="inherit"&&(i.preferFreePeers=t.preferFreePeers==="yes"),t.sort&&(i.sort=t.sort),t.modelsMode==="only"&&(i.allowedModels=mi(t.allowedModels));const g=t.routes.filter(h=>h.model.trim()!=="");if(g.length>0){const h=new Set;i.modelRoutes={};for(const y of g){const x=y.model.trim();if(h.has(x))throw new Sa(`Model "${x}" has two fallback chains.`);h.add(x);const C=mi(y.peerIds);if(C.length===0)throw new Sa(`Add at least one seller to the "${x}" chain.`);i.modelRoutes[x]=y.strict?{peerIds:C,strict:!0}:{peerIds:C}}}return i}function Zc(t){return!t||Object.keys(t).length===0}function gC(t){return Zc(t)?null:t}function Vx(t){var a,u,d,m,v,g;if(Zc(t))return"Inherits";const r=t,i=[];if(r.allowedPeerIds||r.allowedPeerLists){const h=(a=r.allowedPeerLists)!=null&&a.length?` + ${r.allowedPeerLists.length} list${r.allowedPeerLists.length===1?"":"s"}`:"";i.push(`${((u=r.allowedPeerIds)==null?void 0:u.length)??0} allowed${h}`)}if((d=r.blockedPeerIds)!=null&&d.length||(m=r.blockedPeerLists)!=null&&m.length){const h=(v=r.blockedPeerLists)!=null&&v.length?` + ${r.blockedPeerLists.length} list${r.blockedPeerLists.length===1?"":"s"}`:"";i.push(`${((g=r.blockedPeerIds)==null?void 0:g.length)??0} blocked${h}`)}return r.requireTee&&i.push("TEE only"),r.requireVerified&&i.push("verified only"),r.minTrustScore!==void 0&&i.push(`trust ≥ ${r.minTrustScore}`),r.minReputation!==void 0&&i.push(`reputation ≥ ${r.minReputation}`),(r.maxInputUsdPerMillion!==void 0||r.maxOutputUsdPerMillion!==void 0)&&i.push("price caps"),r.allowedModels&&i.push(`${r.allowedModels.length} models`),r.modelRoutes&&i.push(`${Object.keys(r.modelRoutes).length} fallback chains`),r.sort&&i.push(Bx[r.sort].toLowerCase()),r.preferFreePeers&&i.push("free first"),i.join(" · ")||"Custom"}function yC(t){if(!t)return null;const r={};t.minPeerReputation>0&&(r.minReputation=t.minPeerReputation),t.requireVerifier&&(r.requireVerified=!0),t.maxPricing&&(r.maxInputUsdPerMillion=t.maxPricing.inputUsdPerMillion,r.maxOutputUsdPerMillion=t.maxPricing.outputUsdPerMillion,t.maxPricing.cachedInputUsdPerMillion!==null&&(r.maxCachedInputUsdPerMillion=t.maxPricing.cachedInputUsdPerMillion));const i=t.routingPreferences;return i&&(i.minTrustScore>0&&(r.minTrustScore=i.minTrustScore),i.allowedPeerIds.length>0&&(r.allowedPeerIds=[...i.allowedPeerIds]),i.blockedPeerIds.length>0&&(r.blockedPeerIds=[...i.blockedPeerIds])),r}function wC(t){const r=[];t.minPeerReputation>0&&r.push(`reputation ≥ ${t.minPeerReputation}`),t.requireVerifier&&r.push("verified sellers only"),t.maxPricing&&(r.push(`≤ ${wi(t.maxPricing.inputUsdPerMillion)}/M in`),r.push(`≤ ${wi(t.maxPricing.outputUsdPerMillion)}/M out`),t.maxPricing.cachedInputUsdPerMillion!==null&&r.push(`≤ ${wi(t.maxPricing.cachedInputUsdPerMillion)}/M cached`));const i=t.routingPreferences;return i&&(i.minTrustScore>0&&r.push(`trust ≥ ${i.minTrustScore}`),i.allowedPeerIds.length>0&&r.push(`only ${wn(i.allowedPeerIds.length,"allowed seller")}`),i.blockedPeerIds.length>0&&r.push(wn(i.blockedPeerIds.length,"blocked seller")),i.preferFreePeers&&r.push("free first")),r}const wn=(t,r)=>`${t} ${r}${t===1?"":"s"}`,qx={balanced:"balanced",price:"price",latency:"latency",trust:"trust"};function xC(t){var u,d,m,v,g,h,y;if(Zc(t))return[];const r=t,i=[],a=x=>x?` + ${wn(x,"list")}`:"";if(r.allowedPeerIds||r.allowedPeerLists){const x=((u=r.allowedPeerIds)==null?void 0:u.length)??0;i.push(x===0&&!((d=r.allowedPeerLists)!=null&&d.length)?"No seller allowed":`Allow ${x?wn(x,"seller"):""}${x?a((m=r.allowedPeerLists)==null?void 0:m.length):wn(r.allowedPeerLists.length,"list")}`)}if((v=r.blockedPeerIds)!=null&&v.length||(g=r.blockedPeerLists)!=null&&g.length){const x=((h=r.blockedPeerIds)==null?void 0:h.length)??0;i.push(`Block ${x?wn(x,"seller")+a((y=r.blockedPeerLists)==null?void 0:y.length):wn(r.blockedPeerLists.length,"list")}`)}return r.requireTee&&i.push("TEE only"),r.requireVerified&&i.push("Verified only"),r.minTrustScore!==void 0&&i.push(`Trust ≥ ${r.minTrustScore}`),r.minReputation!==void 0&&i.push(`Reputation ≥ ${r.minReputation}`),r.maxInputUsdPerMillion!==void 0&&i.push(`≤ $${r.maxInputUsdPerMillion}/M in`),r.maxOutputUsdPerMillion!==void 0&&i.push(`≤ $${r.maxOutputUsdPerMillion}/M out`),r.maxCachedInputUsdPerMillion!==void 0&&i.push(`≤ $${r.maxCachedInputUsdPerMillion}/M cached`),r.maxImageUsdPerImage!==void 0&&i.push(`≤ $${r.maxImageUsdPerImage}/image`),r.allowedModels&&i.push(r.allowedModels.length===0?"No model allowed":wn(r.allowedModels.length,"model")),r.modelRoutes&&Object.keys(r.modelRoutes).length>0&&i.push(wn(Object.keys(r.modelRoutes).length,"fallback chain")),r.sort&&i.push(`Sort: ${qx[r.sort]}`),r.preferFreePeers!==void 0&&i.push(r.preferFreePeers?"Free sellers first":"Free sellers not first"),i}const SC=[{id:"cheapest",label:"Cheapest",description:"Lowest price first, free sellers ahead."},{id:"trusted",label:"Most trusted",description:"Trust 70+ and reputation 60+, ranked by trust."},{id:"tee",label:"TEE only",description:"Only sellers running in a trusted execution environment."},{id:"own",label:"Own peers only",description:"Only sellers in one of your peer lists."}];function kC(t,r=[]){switch(t){case"cheapest":return{sort:"price",preferFreePeers:!0};case"trusted":return{sort:"trust",minTrustScore:70,minReputation:60};case"tee":return{requireTee:!0};case"own":return{allowedPeerIds:mi(r)}}}function CC(t,r,i,a){var m,v,g;const u=structuredClone(t??{}),d=h=>h==null?void 0:h.filter(y=>!Kv(y,i));if(r==="allow")u.allowedPeerIds=[...d(u.allowedPeerIds)??[],i],u.blockedPeerIds=d(u.blockedPeerIds);else if(r==="block")u.blockedPeerIds=[...d(u.blockedPeerIds)??[],i],u.allowedPeerIds&&(u.allowedPeerIds=d(u.allowedPeerIds)),((m=u.allowedPeerIds)==null?void 0:m.length)===0&&!((v=u.allowedPeerLists)!=null&&v.length)&&delete u.allowedPeerIds;else if(r==="prefer"){if(!a)throw new Error("Pick a model to prefer this seller for.");const h={...u.modelRoutes??{}},y=h[a];h[a]={...y??{},peerIds:[i,...d(y==null?void 0:y.peerIds)??[]]},u.modelRoutes=h,u.blockedPeerIds=d(u.blockedPeerIds)}else u.allowedPeerIds&&(u.allowedPeerIds=d(u.allowedPeerIds)),u.blockedPeerIds=d(u.blockedPeerIds),u.modelRoutes&&(u.modelRoutes=Object.fromEntries(Object.entries(u.modelRoutes).map(([h,y])=>[h,{...y,peerIds:d(y.peerIds)??[]}]).filter(([,h])=>h.peerIds.length>0)));return((g=u.blockedPeerIds)==null?void 0:g.length)===0&&delete u.blockedPeerIds,u.modelRoutes&&Object.keys(u.modelRoutes).length===0&&delete u.modelRoutes,u}function EC(t,r){var a;const i=t==null?void 0:t.allowedPeerIds;return!i||(a=t==null?void 0:t.allowedPeerLists)!=null&&a.length?!1:i.length>0&&i.every(u=>Kv(u,r))}const Kx={allowMode:"allowed sellers",minTrustScore:"minimum trust",minReputation:"minimum reputation",requireVerified:"verified only",requireTee:"TEE only",maxInputUsdPerMillion:"input price cap",maxOutputUsdPerMillion:"output price cap",maxCachedInputUsdPerMillion:"cached input price cap",maxImageUsdPerImage:"image price cap",preferFreePeers:"free sellers first",sort:"sort order",modelsMode:"allowed models"};function _C(t){const r=Wx(t),i=Yc(),a={};for(const u of Object.keys(r))JSON.stringify(r[u])!==JSON.stringify(i[u])&&(a[u]=r[u]);return(t.allowedPeerIds||t.allowedPeerLists)&&(a.allowMode="only",a.allowedPeerIds=r.allowedPeerIds,a.allowedListIds=r.allowedListIds),a}function PC(t,r){const i=Yc(),a=new Set;for(const u of Object.keys(r)){const d=JSON.stringify(t[u]);if(d===JSON.stringify(i[u])||d===JSON.stringify(r[u]))continue;const m=Kx[u]??(u==="allowedPeerIds"||u==="allowedListIds"?"allowed sellers":null);m&&a.add(m)}return[...a]}function bC(t,r){return{...t,...r}}function jC(t,r,i){const a=[...t],u=r+i;if(r<0||r>=a.length||u<0||u>=a.length)return a;const[d]=a.splice(r,1);return a.splice(u,0,d),a}function TC(t,r=null){if(!t||t.allowedPeerIds===void 0&&t.allowedPeerLists===void 0||(t.allowedPeerIds??[]).some(a=>a.trim()!==""))return!1;const i=t.allowedPeerLists??[];return i.length===0?!0:r?i.every(a=>{var u;return(((u=r.find(d=>d.id===a))==null?void 0:u.peerIds.length)??0)===0}):!1}function Qx(t,r){if(t===void 0)return r;if(r===void 0)return t;const i=new Set(r.map(Ir));return t.filter(a=>i.has(Ir(a)))}function Gx(t,r){return t===void 0?r:r===void 0?t:[...new Set([...t,...r])]}function Xc(t,r,i){return t===void 0?r:r===void 0?t:i(t,r)}const Up=(t,r)=>Xc(t,r,Math.max),aa=(t,r)=>Xc(t,r,Math.min),Yx=(t,r)=>t.filter(i=>r.some(a=>a.toLowerCase()===i.toLowerCase()));function Zx(t,r){const{allowedPeerLists:i,blockedPeerLists:a,...u}=t,d=v=>v.flatMap(g=>{var h;return((h=r.find(y=>y.id===g))==null?void 0:h.peerIds)??[]}),m={...u};return i!==void 0&&(m.allowedPeerIds=[...u.allowedPeerIds??[],...d(i)]),a!=null&&a.length&&(m.blockedPeerIds=[...u.blockedPeerIds??[],...d(a)]),m}function Xx(...t){let r={};for(const i of t){if(!i)continue;const a={allowedPeerIds:Qx(r.allowedPeerIds,i.allowedPeerIds),blockedPeerIds:Gx(r.blockedPeerIds,i.blockedPeerIds),minTrustScore:Up(r.minTrustScore,i.minTrustScore),minReputation:Up(r.minReputation,i.minReputation),requireVerified:r.requireVerified||i.requireVerified?!0:void 0,requireTee:r.requireTee||i.requireTee?!0:void 0,maxInputUsdPerMillion:aa(r.maxInputUsdPerMillion,i.maxInputUsdPerMillion),maxOutputUsdPerMillion:aa(r.maxOutputUsdPerMillion,i.maxOutputUsdPerMillion),maxCachedInputUsdPerMillion:aa(r.maxCachedInputUsdPerMillion,i.maxCachedInputUsdPerMillion),maxImageUsdPerImage:aa(r.maxImageUsdPerImage,i.maxImageUsdPerImage),preferFreePeers:i.preferFreePeers??r.preferFreePeers,sort:i.sort??r.sort,allowedModels:Xc(r.allowedModels,i.allowedModels,Yx),modelRoutes:i.modelRoutes||r.modelRoutes?{...r.modelRoutes??{},...i.modelRoutes??{}}:void 0};r=Object.fromEntries(Object.entries(a).filter(([,u])=>u!==void 0))}return r}function Jx(t,r){if(t.allowedModels&&!t.allowedModels.some(a=>a.toLowerCase()===r.service.toLowerCase()))return!1;const i=(a,u)=>u!==void 0&&a!==null&&a>u;return!(i(r.inputUsdPerMillion,t.maxInputUsdPerMillion)||i(r.outputUsdPerMillion,t.maxOutputUsdPerMillion)||i(r.cachedInputUsdPerMillion,t.maxCachedInputUsdPerMillion))}function RC(t,r,i=[]){const a=Zx(t,i),u=a.allowedPeerIds?new Set(a.allowedPeerIds.map(Ir)):null,d=new Set((a.blockedPeerIds??[]).map(Ir));return r.filter(m=>{const v=Ir(m.peerId);return d.has(v)||u&&!u.has(v)||a.minTrustScore!==void 0&&(m.trustScore??0)<a.minTrustScore||a.minReputation!==void 0&&(m.reputationScore??0)<a.minReputation||a.requireVerified&&!m.verified||a.requireTee&&!m.tee?!1:m.services.some(g=>Jx(a,g))})}function NC(t){return!!t&&t.some(r=>r.reputationScore!==null)}function IC(t,r,i=!1){const a=t?t.ownerMemberId===r.memberId:!0;return{admin:r.workspaceAdmin,owner:a,layered:t?mv(t):i}}function eS(t,r){return t===null?r:r===null||Ct(t)<=Ct(r)?t:r}function tS(t,r){const i={};for(const a of wv)i[a]=eS((t==null?void 0:t[a])??null,(r==null?void 0:r[a])??null);return i}function MC(t){const r=mv(t)?t:null;return{limits:tS(t.limits,r==null?void 0:r.ownerLimits),policy:Xx(t.routingPolicy,(r==null?void 0:r.ownerRoutingPolicy)??null)}}function OC(t,r,i){const a={label:i.label};return i.expiresAt!==r.expiresAt&&(a.expiresAt=i.expiresAt),t.admin&&(a.limits=i.adminLimits,a.routingPolicy=i.adminPolicy,i.topupEnabled!==r.topupEnabled&&(a.topupEnabled=i.topupEnabled)),t.owner&&t.layered?(a.ownerLimits=i.ownerLimits,a.ownerRoutingPolicy=i.ownerPolicy):t.owner&&!t.admin&&(a.limits=i.ownerLimits,a.routingPolicy=i.ownerPolicy),a}const nS={allowedPeerIds:"allowed sellers",allowedPeerLists:"allowed peer lists",allowedModels:"allowed models",modelRoutes:"fallback chains",maxInputUsdPerMillion:"input price cap",maxOutputUsdPerMillion:"output price cap",maxCachedInputUsdPerMillion:"cached input price cap",maxImageUsdPerImage:"image price cap",minTrustScore:"minimum trust",minReputation:"minimum reputation"};function rS(t){const[,r=t]=t.split(".");return/Limits$|^limits$/.test(t.split(".")[0]??"")?`${r} limit`:nS[r]??r}function iS(t){const r=[],i=t.fields;Array.isArray(i)&&i.length&&r.push(`Narrowed by the levels above: ${[...new Set(i.map(d=>rS(String(d))))].join(", ")}.`);const a=t.effectiveRoutingPolicy;a&&typeof a=="object"&&r.push(`Routing that would apply: ${Vx(a)}.`);const u=t.effectiveLimits;return u&&typeof u=="object"&&r.push(`Limits that would apply: ${O2(u)}.`),r}const pa=Symbol("cancelled");async function LC(t,r,i){const a={};if(t){if(!await i({kind:"empty"}))return pa;a.confirmEmpty=!0}for(;;)try{return await r({...a})}catch(u){if(Lr(u,"empty_allow_list")&&!a.confirmEmpty){if(!await i({kind:"empty"}))return pa;a.confirmEmpty=!0}else if(Lr(u,"narrowed")&&!a.acceptNarrowed){if(!await i({kind:"narrowed",message:u.message,lines:iS(u.details)}))return pa;a.acceptNarrowed=!0}else throw u}}function oS(t){const r=rr(),i=pv();return X1({mutationFn:t.mutationFn,onSuccess:(a,u)=>{var v;if(a===pa)return;const d=a;(v=t.onSuccess)==null||v.call(t,d,u);for(const g of t.invalidate??[])r.invalidateQueries({queryKey:g});const m=typeof t.toast=="function"?t.toast(d,u):t.toast;m&&i(m)},onError:t.onError})}async function sS(t=he){const r=await t.auth.reauthPasskeyOptions(),i=await qv({optionsJSON:r});return t.auth.reauthPasskeyVerify(i)}async function AC(t,r,i=he){const{message:a}=await i.auth.reauthWalletNonce(t);return i.auth.reauthWalletVerify(a,await r(a))}function aS(t,r){if(t.kind!=="member"||t.me.member.id!==r)throw new Error("That sign-in belongs to a different account. Reload the page and sign in as yourself.")}const dc="The passkey prompt was closed.";function fc(t){return t instanceof Error&&t.name==="NotAllowedError"}function Jc({error:t,onRetry:r,title:i="Could not load this"}){return f.jsx(at,{tone:"danger",title:i,action:r?f.jsx(De,{variant:"outline",size:"sm",onClick:r,children:"Retry"}):void 0,children:Ea(t)})}function DC({query:t,children:r,rows:i}){return t.isLoading?f.jsx(Mi,{rows:i}):t.error?f.jsx(Jc,{error:t.error,onRetry:()=>void t.refetch()}):t.data===void 0?null:f.jsx(f.Fragment,{children:r(t.data)})}function FC({children:t,title:r}){return f.jsx("code",{className:"gc-mono",title:r,children:t})}function zC({label:t,value:r,strong:i}){return f.jsxs("div",{className:"gc-figure",children:[f.jsx("div",{className:"gc-figure__label",children:t}),f.jsx("div",{className:i?"gc-figure__value gc-figure__value--strong":"gc-figure__value",children:r})]})}function $C({name:t,hint:r}){return f.jsxs("div",{children:[f.jsx("div",{className:"gc-strong",children:t}),f.jsx("code",{className:"gc-mono gc-muted",children:r})]})}function UC({at:t,format:r}){return t===null?f.jsx(f.Fragment,{children:"Never"}):t<Date.now()?f.jsx(xm,{tone:"warning",children:"Expired"}):f.jsx(f.Fragment,{children:r(t)})}const lS="Showing last known values — the chain RPC is busy.";function BC({stale:t}){return t?f.jsx("p",{className:"gc-muted",role:"status",children:lS}):null}function HC({to:t,children:r}){return f.jsx("a",{className:"gc-link",href:Pa(t),onClick:Vc(t),children:r})}const uS=R.lazy(()=>Ve(()=>import("./WalletSignIn-Bs_yxjak.js"),__vite__mapDeps([0,1,2,3,4,5]))),cS=R.lazy(()=>Ve(()=>import("./WalletConfirm-Dz6gVYW9.js"),__vite__mapDeps([6,7,1,2,3,4,5])));function dS({isOpen:t,onClose:r,startWith:i,intro:a,onCredentialAdded:u}){const{me:d}=ir(),m=rr(),v=Kc(t),[g,h]=R.useState("idle"),[y,x]=R.useState(i==="wallet"?"add":null),[C,I]=R.useState(null),[L,_]=R.useState(null),[M,D]=R.useState(!1),U=d.member.credentials,b=U.some(V=>V.kind==="passkey"),T=U.some(V=>V.kind==="wallet");function A(V){aS(V,d.member.id),m.setQueryData(Re.me,V)}function q(V){return Lr(V,"reauth_required")?(h("needed"),I(null)):I(V),!0}async function ie(){D(!0),I(null);try{const V=await he.auth.passkeyRegisterOptions(),de=await Vv({optionsJSON:V});A(await he.auth.passkeyRegisterVerify(de)),h("idle"),u==null||u()}catch(V){fc(V)?I(new Error(dc)):q(V)}finally{D(!1)}}async function Q(){D(!0),I(null);try{A(await sS()),h("done")}catch(V){I(fc(V)?new Error(dc):V)}finally{D(!1)}}const ne=oS({mutationFn:V=>he.members.removeCredential(d.member.id,V.id),onSuccess:()=>_(null),onError:V=>{Lr(V,"reauth_required")&&(_(null),h("needed"))},invalidate:[Re.me]}),ae=U.length<=1;return f.jsxs(uv,{isOpen:t,onClose:r,size:"lg",eyebrow:Hc[d.member.orgRole],title:d.member.label,subtitle:d.member.email??void 0,children:[f.jsxs("div",{className:"gc-stack",children:[a,f.jsxs("section",{className:"gc-stack gc-stack--tight",children:[f.jsx("div",{className:"as-field__label",children:"Your sign-in methods"}),U.length===0?f.jsx(at,{tone:"info",children:"You signed in through your organization's access proxy and have no passkey or wallet here. Add one to approve sensitive actions, such as authorizing a withdrawal wallet."}):f.jsx("ul",{className:"gc-list gc-credentials",children:U.map(V=>f.jsxs("li",{className:"gc-inline gc-inline--between",children:[f.jsxs("span",{className:"gc-credential",children:[f.jsx(xm,{children:V.kind})," ",f.jsx("span",{className:"gc-credential__label",children:V.label}),f.jsxs("span",{className:"gc-muted",children:[" · added ",Np(V.createdAt)," · last used ",Np(V.lastUsedAt)]})]}),f.jsx(De,{variant:"ghost",size:"sm",disabled:ae,title:ae?"Add another sign-in method first":void 0,onClick:()=>{ne.reset(),_(V)},children:"Remove"})]},V.id))}),ae&&U.length===1&&f.jsx("p",{className:"gc-fineprint",children:"This is your only sign-in method. Add another before removing it."})]}),g==="needed"&&f.jsx(at,{tone:"info",title:"Confirm it is you",children:f.jsxs("div",{className:"gc-stack gc-stack--tight",children:[f.jsx("span",{children:"Changing your sign-in methods needs a recent sign-in. Confirm with one you already have, then try again."}),f.jsxs("div",{className:"gc-inline gc-inline--wrap",children:[b&&f.jsx(De,{size:"sm",disabled:M,onClick:()=>void Q(),children:"Confirm with a passkey"}),T&&y!=="confirm"&&f.jsx(De,{size:"sm",variant:"outline",onClick:()=>x("confirm"),children:"Confirm with a wallet"})]}),y==="confirm"&&f.jsx(R.Suspense,{fallback:f.jsx(De,{size:"sm",disabled:!0,children:"Loading wallets…"}),children:f.jsx(cS,{onConfirmed:V=>{A(V),h("done"),x(null)}})}),!b&&!T&&f.jsx("span",{children:"Sign out and sign in again, then add it."})]})}),g==="done"&&f.jsx(at,{tone:"success",children:"Confirmed. Add or remove the sign-in method now."}),v.data&&f.jsxs("section",{className:"gc-stack gc-stack--tight",children:[f.jsx("div",{className:"as-field__label",children:"Add a sign-in method"}),f.jsxs("div",{className:"gc-inline gc-inline--wrap",children:[v.data.passkey&&f.jsx(De,{variant:"outline",size:"sm",disabled:M||!Bo(),onClick:()=>void ie(),children:M?"Waiting for your passkey…":"Add a passkey"}),v.data.wallet&&y!=="add"&&f.jsx(De,{variant:"outline",size:"sm",onClick:()=>x("add"),children:"Add a wallet"}),v.data.oidc&&f.jsxs(De,{variant:"outline",size:"sm",href:he.auth.oidcLinkUrl(),children:["Link ",v.data.oidc.label]})]}),y==="add"&&f.jsx(R.Suspense,{fallback:f.jsx(De,{size:"sm",disabled:!0,children:"Loading wallets…"}),children:f.jsx(uS,{autoConnect:!0,actionLabel:V=>`Add ${V} as a sign-in method`,onError:q,onSignedIn:V=>{A(V),x(null),h("idle"),u==null||u()}})}),f.jsx("p",{className:"gc-fineprint",children:"A wallet you add can become this workspace's withdrawal wallet only 24 hours later."})]}),C?f.jsx(at,{tone:"danger",children:Ea(C)}):null,f.jsx("div",{className:"gc-actions",children:f.jsx(De,{onClick:r,children:"Done"})})]}),f.jsx(e2,{isOpen:L!==null,busy:ne.isPending,error:ne.error,onClose:()=>{_(null),ne.reset()},onConfirm:()=>L&&ne.mutate(L),title:"Remove this sign-in method?",confirmLabel:"Remove",body:`You can no longer sign in with ${(L==null?void 0:L.label)??"it"}.`})]})}const fS="/console/assets/ant-icon-zZhiTevn.svg",hS=[213,217,215],pS=[197,208,203],mS=[150,156,153],vS=[150,160,155],Bp=[16,185,129],la=6,gS=1.7,wr=400,pi=Math.round(15.2738/18*wr),Hp=[-3,0,3];function yS(){const t=R.useRef(null);return R.useEffect(()=>{var q,ie;const r=t.current,i=r==null?void 0:r.getContext("2d");if(!r||!i)return;const a=((q=window.matchMedia)==null?void 0:q.call(window,"(prefers-reduced-motion: reduce)").matches)??!1;let u=[],d=0,m=0,v=0,g=!1;const h=document.createElement("canvas");h.width=pi,h.height=wr;const y=h.getContext("2d");let x=null;const C=(Q,ne)=>{if(!x)return 0;let ae=0,V=0;for(const de of Hp){const _e=Math.round(ne+de);if(!(_e<0||_e>=wr))for(const Me of Hp){const be=Math.round(Q+Me);be<0||be>=pi||(V+=1,x[(_e*pi+be)*4+3]>40&&(ae+=1))}}return V?ae/V:0},I=()=>{var Ue;const Q=r.getBoundingClientRect();d=Math.max(1,Math.round(Q.width)),m=Math.max(1,Math.round(Q.height));const ne=Math.min(window.devicePixelRatio||1,2);r.width=Math.round(d*ne),r.height=Math.round(m*ne),i.setTransform(ne,0,0,ne,0,0);const ae=(Ue=r.parentElement)==null?void 0:Ue.getBoundingClientRect(),V=ae?ae.left+ae.width/2-Q.left:d/2,de=.95*m/wr,_e=V-pi*de/2,Me=m-.75*wr*de,be=[];for(let Se=la/2;Se<m;Se+=la)for(let W=la/2;W<d;W+=la){const Z=C((W-_e)/de,(Se-Me)/de);be.push({x:W,y:Se,ant:Z,size:Z>0?(.45+.55*Z)*(.85+.3*Math.random()):.8,twinkleAt:Z>0&&Math.random()<.05?Math.random()*600:-1,twinkleEvery:420+Math.random()*480})}u=be},L=()=>{const Q=P2(),ne=Q?pS:hS,ae=Q?vS:mS;i.clearRect(0,0,d,m);for(const V of u){let de=0;if(V.twinkleAt>=0&&!a){const Z=(v-V.twinkleAt)%V.twinkleEvery;Z>=0&&Z<40&&(de=Math.sin(Z/40*Math.PI))}const _e=gS*V.size*(1+.5*de);de>.02&&(i.beginPath(),i.fillStyle=`rgba(${Bp.join(",")},${.18*de})`,i.arc(V.x,V.y,_e*(1+1.4*de),0,2*Math.PI),i.fill());const Me=de*.8,be=V.ant>0?ae:ne,[Ue,Se,W]=be.map((Z,Y)=>Math.round(Z+(Bp[Y]-Z)*Me));i.beginPath(),i.fillStyle=`rgba(${Ue},${Se},${W},${V.ant>0?.85+.15*de:Q?.16:.45})`,i.arc(V.x,V.y,_e,0,2*Math.PI),i.fill()}};let _=0,M=0;const D=Q=>{_=requestAnimationFrame(D),!(Q-M<33||document.visibilityState!=="visible")&&(M=Q,v+=1,L())},U=new Image;U.onload=()=>{g||!y||(y.drawImage(U,0,0,pi,wr),x=y.getImageData(0,0,pi,wr).data,I(),L(),a||(_=requestAnimationFrame(D)))},U.src=fS;const b=new ResizeObserver(()=>{I(),L()});b.observe(r);const T=new MutationObserver(()=>L());T.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});const A=(ie=window.matchMedia)==null?void 0:ie.call(window,"(prefers-color-scheme: dark)");return A==null||A.addEventListener("change",L),()=>{g=!0,cancelAnimationFrame(_),b.disconnect(),T.disconnect(),A==null||A.removeEventListener("change",L)}},[]),f.jsx("canvas",{ref:t,className:"gc-antdots","aria-hidden":"true"})}const Qv="antseed-console-exposure-dismissed";function wS(t,r,i){return!r||r.mode==="public"||i?!1:_a(t)}function Wp(t){if(!t)return!1;try{return sessionStorage.getItem(Qv)===t}catch{return!1}}function xS(t){try{sessionStorage.setItem(Qv,t)}catch{}}function SS(t){return t.mode==="local"?"This gateway runs on this computer":"This gateway is only reachable on your network"}function kS(t){return t.mode==="local"?"Keys only work while it's on and can't be reached from other machines.":t.personalComputer?"Keys only work while this computer is on, over plain HTTP, and not from outside your network.":"It has no public HTTPS address: keys travel over plain HTTP and do not work from outside your network."}const CS=/^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;function WC(t){const r=t.trim().toLowerCase().replace(/^https?:\/\//,"").replace(/[/:].*$/,"");return CS.test(r)?r:null}const ua="antseed-gateway.bundle";function VC(t){const r=t.domain??"llm.example.com",i=t.server.trim()||"user@your-server",a=`/tmp/${ua}`;return{exportBundle:`antseed gateway export --out ${ua}`,copy:`scp ${ua} ${i}:${a}`,install:`curl -fsSL https://antseed.com/install-gateway.sh | sudo bash -s -- --domain ${r} --import ${a}`,baseUrl:`https://${r}/v1`,stop:`rm ${ua}`,recover:"antseed gateway console-link --recover",tunnel:`CLOUDFLARED_TUNNEL_TOKEN=<tunnel-token> ANTSEED_TUNNEL_PUBLIC_URL=https://${r} \\
|
|
83
|
+
`,r)}function $x(){if(!Bo())return Au.stubThis(new Promise(r=>r(!1)));const t=globalThis.PublicKeyCredential;return(t==null?void 0:t.isConditionalMediationAvailable)===void 0?Au.stubThis(new Promise(r=>r(!1))):Au.stubThis(t.isConditionalMediationAvailable())}const Au={stubThis:t=>t};function Ux({error:t,options:r}){const{publicKey:i}=r;if(!i)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(r.signal instanceof AbortSignal)return new tt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new tt({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const a=globalThis.location.hostname;if(Bv(a)){if(i.rpId!==a)return new tt({message:`The RP ID "${i.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new tt({message:`${globalThis.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new tt({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return t}async function qv(t){var I,L;!t.optionsJSON&&t.challenge&&(console.warn("startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information."),t={optionsJSON:t});const{optionsJSON:r,useBrowserAutofill:i=!1,verifyBrowserAutofillInput:a=!0}=t;if(!Bo())throw new Error("WebAuthn is not supported in this browser");let u;((I=r.allowCredentials)==null?void 0:I.length)!==0&&(u=(L=r.allowCredentials)==null?void 0:L.map(Uv));const d={...r,challenge:xa(r.challenge),allowCredentials:u},m={};if(i){if(!await $x())throw Error("Browser does not support WebAuthn autofill");if(document.querySelectorAll("input[autocomplete$='webauthn']").length<1&&a)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');m.mediation="conditional",d.allowCredentials=[]}m.publicKey=d,m.signal=Hv.createNewAbortSignal();let v;try{v=await navigator.credentials.get(m)}catch(_){throw Ux({error:_,options:m})}if(!v)throw new Error("Authentication was not completed");const{id:g,rawId:h,response:y,type:x}=v;let C;return y.userHandle&&(C=on(y.userHandle)),{id:g,rawId:on(h),response:{authenticatorData:on(y.authenticatorData),clientDataJSON:on(y.clientDataJSON),signature:on(y.signature),userHandle:C},type:x,clientExtensionResults:v.getClientExtensionResults(),authenticatorAttachment:Wv(v.authenticatorAttachment)}}function Ir(t){return t.trim().toLowerCase().replace(/^0x/,"")}function Kv(t,r){return Ir(t)===Ir(r)}const Bx={balanced:"Balanced",price:"Lowest price",latency:"Lowest latency",trust:"Highest trust"};function Yc(){return{allowMode:"any",allowedPeerIds:[],allowedListIds:[],blockedPeerIds:[],blockedListIds:[],minTrustScore:"",minReputation:"",requireVerified:!1,requireTee:!1,maxInputUsdPerMillion:"",maxOutputUsdPerMillion:"",maxCachedInputUsdPerMillion:"",maxImageUsdPerImage:"",preferFreePeers:"inherit",sort:"",modelsMode:"any",allowedModels:[],routes:[]}}function hi(t){return t===void 0?"":String(t)}function Hx(t){return t===void 0?"inherit":t?"yes":"no"}function Wx(t){const r=Yc();return t?{...r,allowMode:t.allowedPeerIds||t.allowedPeerLists?"only":"any",allowedPeerIds:[...t.allowedPeerIds??[]],allowedListIds:[...t.allowedPeerLists??[]],blockedPeerIds:[...t.blockedPeerIds??[]],blockedListIds:[...t.blockedPeerLists??[]],minTrustScore:hi(t.minTrustScore),minReputation:hi(t.minReputation),requireVerified:t.requireVerified===!0,requireTee:t.requireTee===!0,maxInputUsdPerMillion:hi(t.maxInputUsdPerMillion),maxOutputUsdPerMillion:hi(t.maxOutputUsdPerMillion),maxCachedInputUsdPerMillion:hi(t.maxCachedInputUsdPerMillion),maxImageUsdPerImage:hi(t.maxImageUsdPerImage),preferFreePeers:Hx(t.preferFreePeers),sort:t.sort??"",modelsMode:t.allowedModels?"only":"any",allowedModels:[...t.allowedModels??[]],routes:Object.entries(t.modelRoutes??{}).map(([i,a])=>({model:i,peerIds:[...a.peerIds],strict:a.strict===!0}))}:r}class Sa extends Error{}function Du(t,r,i){const a=r.trim();if(a==="")return;const u=Number(a);if(!Number.isFinite(u)||u<0)throw new Sa(`${t} must be a positive number.`);if(i!==void 0&&u>i)throw new Sa(`${t} must be at most ${i}.`);return u}function mi(t){return[...new Set(t.map(r=>r.trim()).filter(Boolean))]}function $p(t,r){const i=mi(t);return r?i.filter(a=>r.some(u=>u.id===a)):i}function vC(t,r=null){const i={};if(t.allowMode==="only"){const h=$p(t.allowedListIds,r),y=mi(t.allowedPeerIds);(y.length>0||h.length===0)&&(i.allowedPeerIds=y),h.length>0&&(i.allowedPeerLists=h)}const a=mi(t.blockedPeerIds);a.length>0&&(i.blockedPeerIds=a);const u=$p(t.blockedListIds,r);u.length>0&&(i.blockedPeerLists=u);const d=Du("Minimum trust",t.minTrustScore,100);d!==void 0&&(i.minTrustScore=d);const m=Du("Minimum reputation",t.minReputation,100);m!==void 0&&(i.minReputation=m),t.requireVerified&&(i.requireVerified=!0),t.requireTee&&(i.requireTee=!0);const v=[["maxInputUsdPerMillion","Input price cap"],["maxOutputUsdPerMillion","Output price cap"],["maxCachedInputUsdPerMillion","Cached input price cap"],["maxImageUsdPerImage","Image price cap"]];for(const[h,y]of v){const x=Du(y,t[h]);x!==void 0&&(i[h]=x)}t.preferFreePeers!=="inherit"&&(i.preferFreePeers=t.preferFreePeers==="yes"),t.sort&&(i.sort=t.sort),t.modelsMode==="only"&&(i.allowedModels=mi(t.allowedModels));const g=t.routes.filter(h=>h.model.trim()!=="");if(g.length>0){const h=new Set;i.modelRoutes={};for(const y of g){const x=y.model.trim();if(h.has(x))throw new Sa(`Model "${x}" has two fallback chains.`);h.add(x);const C=mi(y.peerIds);if(C.length===0)throw new Sa(`Add at least one seller to the "${x}" chain.`);i.modelRoutes[x]=y.strict?{peerIds:C,strict:!0}:{peerIds:C}}}return i}function Zc(t){return!t||Object.keys(t).length===0}function gC(t){return Zc(t)?null:t}function Vx(t){var a,u,d,m,v,g;if(Zc(t))return"Inherits";const r=t,i=[];if(r.allowedPeerIds||r.allowedPeerLists){const h=(a=r.allowedPeerLists)!=null&&a.length?` + ${r.allowedPeerLists.length} list${r.allowedPeerLists.length===1?"":"s"}`:"";i.push(`${((u=r.allowedPeerIds)==null?void 0:u.length)??0} allowed${h}`)}if((d=r.blockedPeerIds)!=null&&d.length||(m=r.blockedPeerLists)!=null&&m.length){const h=(v=r.blockedPeerLists)!=null&&v.length?` + ${r.blockedPeerLists.length} list${r.blockedPeerLists.length===1?"":"s"}`:"";i.push(`${((g=r.blockedPeerIds)==null?void 0:g.length)??0} blocked${h}`)}return r.requireTee&&i.push("TEE only"),r.requireVerified&&i.push("verified only"),r.minTrustScore!==void 0&&i.push(`trust ≥ ${r.minTrustScore}`),r.minReputation!==void 0&&i.push(`reputation ≥ ${r.minReputation}`),(r.maxInputUsdPerMillion!==void 0||r.maxOutputUsdPerMillion!==void 0)&&i.push("price caps"),r.allowedModels&&i.push(`${r.allowedModels.length} models`),r.modelRoutes&&i.push(`${Object.keys(r.modelRoutes).length} fallback chains`),r.sort&&i.push(Bx[r.sort].toLowerCase()),r.preferFreePeers&&i.push("free first"),i.join(" · ")||"Custom"}function yC(t){if(!t)return null;const r={};t.minPeerReputation>0&&(r.minReputation=t.minPeerReputation),t.requireVerifier&&(r.requireVerified=!0),t.maxPricing&&(r.maxInputUsdPerMillion=t.maxPricing.inputUsdPerMillion,r.maxOutputUsdPerMillion=t.maxPricing.outputUsdPerMillion,t.maxPricing.cachedInputUsdPerMillion!==null&&(r.maxCachedInputUsdPerMillion=t.maxPricing.cachedInputUsdPerMillion));const i=t.routingPreferences;return i&&(i.minTrustScore>0&&(r.minTrustScore=i.minTrustScore),i.allowedPeerIds.length>0&&(r.allowedPeerIds=[...i.allowedPeerIds]),i.blockedPeerIds.length>0&&(r.blockedPeerIds=[...i.blockedPeerIds])),r}function wC(t){const r=[];t.minPeerReputation>0&&r.push(`reputation ≥ ${t.minPeerReputation}`),t.requireVerifier&&r.push("verified sellers only"),t.maxPricing&&(r.push(`≤ ${wi(t.maxPricing.inputUsdPerMillion)}/M in`),r.push(`≤ ${wi(t.maxPricing.outputUsdPerMillion)}/M out`),t.maxPricing.cachedInputUsdPerMillion!==null&&r.push(`≤ ${wi(t.maxPricing.cachedInputUsdPerMillion)}/M cached`));const i=t.routingPreferences;return i&&(i.minTrustScore>0&&r.push(`trust ≥ ${i.minTrustScore}`),i.allowedPeerIds.length>0&&r.push(`only ${wn(i.allowedPeerIds.length,"allowed seller")}`),i.blockedPeerIds.length>0&&r.push(wn(i.blockedPeerIds.length,"blocked seller")),i.preferFreePeers&&r.push("free first")),r}const wn=(t,r)=>`${t} ${r}${t===1?"":"s"}`,qx={balanced:"balanced",price:"price",latency:"latency",trust:"trust"};function xC(t){var u,d,m,v,g,h,y;if(Zc(t))return[];const r=t,i=[],a=x=>x?` + ${wn(x,"list")}`:"";if(r.allowedPeerIds||r.allowedPeerLists){const x=((u=r.allowedPeerIds)==null?void 0:u.length)??0;i.push(x===0&&!((d=r.allowedPeerLists)!=null&&d.length)?"No seller allowed":`Allow ${x?wn(x,"seller"):""}${x?a((m=r.allowedPeerLists)==null?void 0:m.length):wn(r.allowedPeerLists.length,"list")}`)}if((v=r.blockedPeerIds)!=null&&v.length||(g=r.blockedPeerLists)!=null&&g.length){const x=((h=r.blockedPeerIds)==null?void 0:h.length)??0;i.push(`Block ${x?wn(x,"seller")+a((y=r.blockedPeerLists)==null?void 0:y.length):wn(r.blockedPeerLists.length,"list")}`)}return r.requireTee&&i.push("TEE only"),r.requireVerified&&i.push("Verified only"),r.minTrustScore!==void 0&&i.push(`Trust ≥ ${r.minTrustScore}`),r.minReputation!==void 0&&i.push(`Reputation ≥ ${r.minReputation}`),r.maxInputUsdPerMillion!==void 0&&i.push(`≤ $${r.maxInputUsdPerMillion}/M in`),r.maxOutputUsdPerMillion!==void 0&&i.push(`≤ $${r.maxOutputUsdPerMillion}/M out`),r.maxCachedInputUsdPerMillion!==void 0&&i.push(`≤ $${r.maxCachedInputUsdPerMillion}/M cached`),r.maxImageUsdPerImage!==void 0&&i.push(`≤ $${r.maxImageUsdPerImage}/image`),r.allowedModels&&i.push(r.allowedModels.length===0?"No model allowed":wn(r.allowedModels.length,"model")),r.modelRoutes&&Object.keys(r.modelRoutes).length>0&&i.push(wn(Object.keys(r.modelRoutes).length,"fallback chain")),r.sort&&i.push(`Sort: ${qx[r.sort]}`),r.preferFreePeers!==void 0&&i.push(r.preferFreePeers?"Free sellers first":"Free sellers not first"),i}const SC=[{id:"cheapest",label:"Cheapest",description:"Lowest price first, free sellers ahead."},{id:"trusted",label:"Most trusted",description:"Trust 70+ and reputation 60+, ranked by trust."},{id:"tee",label:"TEE only",description:"Only sellers running in a trusted execution environment."},{id:"own",label:"Own peers only",description:"Only sellers in one of your peer lists."}];function kC(t,r=[]){switch(t){case"cheapest":return{sort:"price",preferFreePeers:!0};case"trusted":return{sort:"trust",minTrustScore:70,minReputation:60};case"tee":return{requireTee:!0};case"own":return{allowedPeerIds:mi(r)}}}function CC(t,r,i,a){var m,v,g;const u=structuredClone(t??{}),d=h=>h==null?void 0:h.filter(y=>!Kv(y,i));if(r==="allow")u.allowedPeerIds=[...d(u.allowedPeerIds)??[],i],u.blockedPeerIds=d(u.blockedPeerIds);else if(r==="block")u.blockedPeerIds=[...d(u.blockedPeerIds)??[],i],u.allowedPeerIds&&(u.allowedPeerIds=d(u.allowedPeerIds)),((m=u.allowedPeerIds)==null?void 0:m.length)===0&&!((v=u.allowedPeerLists)!=null&&v.length)&&delete u.allowedPeerIds;else if(r==="prefer"){if(!a)throw new Error("Pick a model to prefer this seller for.");const h={...u.modelRoutes??{}},y=h[a];h[a]={...y??{},peerIds:[i,...d(y==null?void 0:y.peerIds)??[]]},u.modelRoutes=h,u.blockedPeerIds=d(u.blockedPeerIds)}else u.allowedPeerIds&&(u.allowedPeerIds=d(u.allowedPeerIds)),u.blockedPeerIds=d(u.blockedPeerIds),u.modelRoutes&&(u.modelRoutes=Object.fromEntries(Object.entries(u.modelRoutes).map(([h,y])=>[h,{...y,peerIds:d(y.peerIds)??[]}]).filter(([,h])=>h.peerIds.length>0)));return((g=u.blockedPeerIds)==null?void 0:g.length)===0&&delete u.blockedPeerIds,u.modelRoutes&&Object.keys(u.modelRoutes).length===0&&delete u.modelRoutes,u}function EC(t,r){var a;const i=t==null?void 0:t.allowedPeerIds;return!i||(a=t==null?void 0:t.allowedPeerLists)!=null&&a.length?!1:i.length>0&&i.every(u=>Kv(u,r))}const Kx={allowMode:"allowed sellers",minTrustScore:"minimum trust",minReputation:"minimum reputation",requireVerified:"verified only",requireTee:"TEE only",maxInputUsdPerMillion:"input price cap",maxOutputUsdPerMillion:"output price cap",maxCachedInputUsdPerMillion:"cached input price cap",maxImageUsdPerImage:"image price cap",preferFreePeers:"free sellers first",sort:"sort order",modelsMode:"allowed models"};function _C(t){const r=Wx(t),i=Yc(),a={};for(const u of Object.keys(r))JSON.stringify(r[u])!==JSON.stringify(i[u])&&(a[u]=r[u]);return(t.allowedPeerIds||t.allowedPeerLists)&&(a.allowMode="only",a.allowedPeerIds=r.allowedPeerIds,a.allowedListIds=r.allowedListIds),a}function PC(t,r){const i=Yc(),a=new Set;for(const u of Object.keys(r)){const d=JSON.stringify(t[u]);if(d===JSON.stringify(i[u])||d===JSON.stringify(r[u]))continue;const m=Kx[u]??(u==="allowedPeerIds"||u==="allowedListIds"?"allowed sellers":null);m&&a.add(m)}return[...a]}function bC(t,r){return{...t,...r}}function jC(t,r,i){const a=[...t],u=r+i;if(r<0||r>=a.length||u<0||u>=a.length)return a;const[d]=a.splice(r,1);return a.splice(u,0,d),a}function TC(t,r=null){if(!t||t.allowedPeerIds===void 0&&t.allowedPeerLists===void 0||(t.allowedPeerIds??[]).some(a=>a.trim()!==""))return!1;const i=t.allowedPeerLists??[];return i.length===0?!0:r?i.every(a=>{var u;return(((u=r.find(d=>d.id===a))==null?void 0:u.peerIds.length)??0)===0}):!1}function Qx(t,r){if(t===void 0)return r;if(r===void 0)return t;const i=new Set(r.map(Ir));return t.filter(a=>i.has(Ir(a)))}function Gx(t,r){return t===void 0?r:r===void 0?t:[...new Set([...t,...r])]}function Xc(t,r,i){return t===void 0?r:r===void 0?t:i(t,r)}const Up=(t,r)=>Xc(t,r,Math.max),aa=(t,r)=>Xc(t,r,Math.min),Yx=(t,r)=>t.filter(i=>r.some(a=>a.toLowerCase()===i.toLowerCase()));function Zx(t,r){const{allowedPeerLists:i,blockedPeerLists:a,...u}=t,d=v=>v.flatMap(g=>{var h;return((h=r.find(y=>y.id===g))==null?void 0:h.peerIds)??[]}),m={...u};return i!==void 0&&(m.allowedPeerIds=[...u.allowedPeerIds??[],...d(i)]),a!=null&&a.length&&(m.blockedPeerIds=[...u.blockedPeerIds??[],...d(a)]),m}function Xx(...t){let r={};for(const i of t){if(!i)continue;const a={allowedPeerIds:Qx(r.allowedPeerIds,i.allowedPeerIds),blockedPeerIds:Gx(r.blockedPeerIds,i.blockedPeerIds),minTrustScore:Up(r.minTrustScore,i.minTrustScore),minReputation:Up(r.minReputation,i.minReputation),requireVerified:r.requireVerified||i.requireVerified?!0:void 0,requireTee:r.requireTee||i.requireTee?!0:void 0,maxInputUsdPerMillion:aa(r.maxInputUsdPerMillion,i.maxInputUsdPerMillion),maxOutputUsdPerMillion:aa(r.maxOutputUsdPerMillion,i.maxOutputUsdPerMillion),maxCachedInputUsdPerMillion:aa(r.maxCachedInputUsdPerMillion,i.maxCachedInputUsdPerMillion),maxImageUsdPerImage:aa(r.maxImageUsdPerImage,i.maxImageUsdPerImage),preferFreePeers:i.preferFreePeers??r.preferFreePeers,sort:i.sort??r.sort,allowedModels:Xc(r.allowedModels,i.allowedModels,Yx),modelRoutes:i.modelRoutes||r.modelRoutes?{...r.modelRoutes??{},...i.modelRoutes??{}}:void 0};r=Object.fromEntries(Object.entries(a).filter(([,u])=>u!==void 0))}return r}function Jx(t,r){if(t.allowedModels&&!t.allowedModels.some(a=>a.toLowerCase()===r.service.toLowerCase()))return!1;const i=(a,u)=>u!==void 0&&a!==null&&a>u;return!(i(r.inputUsdPerMillion,t.maxInputUsdPerMillion)||i(r.outputUsdPerMillion,t.maxOutputUsdPerMillion)||i(r.cachedInputUsdPerMillion,t.maxCachedInputUsdPerMillion))}function RC(t,r,i=[]){const a=Zx(t,i),u=a.allowedPeerIds?new Set(a.allowedPeerIds.map(Ir)):null,d=new Set((a.blockedPeerIds??[]).map(Ir));return r.filter(m=>{const v=Ir(m.peerId);return d.has(v)||u&&!u.has(v)||a.minTrustScore!==void 0&&(m.trustScore??0)<a.minTrustScore||a.minReputation!==void 0&&(m.reputationScore??0)<a.minReputation||a.requireVerified&&!m.verified||a.requireTee&&!m.tee?!1:m.services.some(g=>Jx(a,g))})}function NC(t){return!!t&&t.some(r=>r.reputationScore!==null)}function IC(t,r,i=!1){const a=t?t.ownerMemberId===r.memberId:!0;return{admin:r.workspaceAdmin,owner:a,layered:t?mv(t):i}}function eS(t,r){return t===null?r:r===null||Ct(t)<=Ct(r)?t:r}function tS(t,r){const i={};for(const a of wv)i[a]=eS((t==null?void 0:t[a])??null,(r==null?void 0:r[a])??null);return i}function MC(t){const r=mv(t)?t:null;return{limits:tS(t.limits,r==null?void 0:r.ownerLimits),policy:Xx(t.routingPolicy,(r==null?void 0:r.ownerRoutingPolicy)??null)}}function OC(t,r,i){const a={label:i.label};return i.expiresAt!==r.expiresAt&&(a.expiresAt=i.expiresAt),t.admin&&(a.limits=i.adminLimits,a.routingPolicy=i.adminPolicy,i.topupEnabled!==r.topupEnabled&&(a.topupEnabled=i.topupEnabled)),t.owner&&t.layered?(a.ownerLimits=i.ownerLimits,a.ownerRoutingPolicy=i.ownerPolicy):t.owner&&!t.admin&&(a.limits=i.ownerLimits,a.routingPolicy=i.ownerPolicy),a}const nS={allowedPeerIds:"allowed sellers",allowedPeerLists:"allowed peer lists",allowedModels:"allowed models",modelRoutes:"fallback chains",maxInputUsdPerMillion:"input price cap",maxOutputUsdPerMillion:"output price cap",maxCachedInputUsdPerMillion:"cached input price cap",maxImageUsdPerImage:"image price cap",minTrustScore:"minimum trust",minReputation:"minimum reputation"};function rS(t){const[,r=t]=t.split(".");return/Limits$|^limits$/.test(t.split(".")[0]??"")?`${r} limit`:nS[r]??r}function iS(t){const r=[],i=t.fields;Array.isArray(i)&&i.length&&r.push(`Narrowed by the levels above: ${[...new Set(i.map(d=>rS(String(d))))].join(", ")}.`);const a=t.effectiveRoutingPolicy;a&&typeof a=="object"&&r.push(`Routing that would apply: ${Vx(a)}.`);const u=t.effectiveLimits;return u&&typeof u=="object"&&r.push(`Limits that would apply: ${O2(u)}.`),r}const pa=Symbol("cancelled");async function LC(t,r,i){const a={};if(t){if(!await i({kind:"empty"}))return pa;a.confirmEmpty=!0}for(;;)try{return await r({...a})}catch(u){if(Lr(u,"empty_allow_list")&&!a.confirmEmpty){if(!await i({kind:"empty"}))return pa;a.confirmEmpty=!0}else if(Lr(u,"narrowed")&&!a.acceptNarrowed){if(!await i({kind:"narrowed",message:u.message,lines:iS(u.details)}))return pa;a.acceptNarrowed=!0}else throw u}}function oS(t){const r=rr(),i=pv();return X1({mutationFn:t.mutationFn,onSuccess:(a,u)=>{var v;if(a===pa)return;const d=a;(v=t.onSuccess)==null||v.call(t,d,u);for(const g of t.invalidate??[])r.invalidateQueries({queryKey:g});const m=typeof t.toast=="function"?t.toast(d,u):t.toast;m&&i(m)},onError:t.onError})}async function sS(t=he){const r=await t.auth.reauthPasskeyOptions(),i=await qv({optionsJSON:r});return t.auth.reauthPasskeyVerify(i)}async function AC(t,r,i=he){const{message:a}=await i.auth.reauthWalletNonce(t);return i.auth.reauthWalletVerify(a,await r(a))}function aS(t,r){if(t.kind!=="member"||t.me.member.id!==r)throw new Error("That sign-in belongs to a different account. Reload the page and sign in as yourself.")}const dc="The passkey prompt was closed.";function fc(t){return t instanceof Error&&t.name==="NotAllowedError"}function Jc({error:t,onRetry:r,title:i="Could not load this"}){return f.jsx(at,{tone:"danger",title:i,action:r?f.jsx(De,{variant:"outline",size:"sm",onClick:r,children:"Retry"}):void 0,children:Ea(t)})}function DC({query:t,children:r,rows:i}){return t.isLoading?f.jsx(Mi,{rows:i}):t.error?f.jsx(Jc,{error:t.error,onRetry:()=>void t.refetch()}):t.data===void 0?null:f.jsx(f.Fragment,{children:r(t.data)})}function FC({children:t,title:r}){return f.jsx("code",{className:"gc-mono",title:r,children:t})}function zC({label:t,value:r,strong:i}){return f.jsxs("div",{className:"gc-figure",children:[f.jsx("div",{className:"gc-figure__label",children:t}),f.jsx("div",{className:i?"gc-figure__value gc-figure__value--strong":"gc-figure__value",children:r})]})}function $C({name:t,hint:r}){return f.jsxs("div",{children:[f.jsx("div",{className:"gc-strong",children:t}),f.jsx("code",{className:"gc-mono gc-muted",children:r})]})}function UC({at:t,format:r}){return t===null?f.jsx(f.Fragment,{children:"Never"}):t<Date.now()?f.jsx(xm,{tone:"warning",children:"Expired"}):f.jsx(f.Fragment,{children:r(t)})}const lS="Showing last known values — the chain RPC is busy.";function BC({stale:t}){return t?f.jsx("p",{className:"gc-muted",role:"status",children:lS}):null}function HC({to:t,children:r}){return f.jsx("a",{className:"gc-link",href:Pa(t),onClick:Vc(t),children:r})}const uS=R.lazy(()=>Ve(()=>import("./WalletSignIn-DLX6sQbD.js"),__vite__mapDeps([0,1,2,3,4,5]))),cS=R.lazy(()=>Ve(()=>import("./WalletConfirm-Dm8Lr6DT.js"),__vite__mapDeps([6,7,1,2,3,4,5])));function dS({isOpen:t,onClose:r,startWith:i,intro:a,onCredentialAdded:u}){const{me:d}=ir(),m=rr(),v=Kc(t),[g,h]=R.useState("idle"),[y,x]=R.useState(i==="wallet"?"add":null),[C,I]=R.useState(null),[L,_]=R.useState(null),[M,D]=R.useState(!1),U=d.member.credentials,b=U.some(V=>V.kind==="passkey"),T=U.some(V=>V.kind==="wallet");function A(V){aS(V,d.member.id),m.setQueryData(Re.me,V)}function q(V){return Lr(V,"reauth_required")?(h("needed"),I(null)):I(V),!0}async function ie(){D(!0),I(null);try{const V=await he.auth.passkeyRegisterOptions(),de=await Vv({optionsJSON:V});A(await he.auth.passkeyRegisterVerify(de)),h("idle"),u==null||u()}catch(V){fc(V)?I(new Error(dc)):q(V)}finally{D(!1)}}async function Q(){D(!0),I(null);try{A(await sS()),h("done")}catch(V){I(fc(V)?new Error(dc):V)}finally{D(!1)}}const ne=oS({mutationFn:V=>he.members.removeCredential(d.member.id,V.id),onSuccess:()=>_(null),onError:V=>{Lr(V,"reauth_required")&&(_(null),h("needed"))},invalidate:[Re.me]}),ae=U.length<=1;return f.jsxs(uv,{isOpen:t,onClose:r,size:"lg",eyebrow:Hc[d.member.orgRole],title:d.member.label,subtitle:d.member.email??void 0,children:[f.jsxs("div",{className:"gc-stack",children:[a,f.jsxs("section",{className:"gc-stack gc-stack--tight",children:[f.jsx("div",{className:"as-field__label",children:"Your sign-in methods"}),U.length===0?f.jsx(at,{tone:"info",children:"You signed in through your organization's access proxy and have no passkey or wallet here. Add one to approve sensitive actions, such as authorizing a withdrawal wallet."}):f.jsx("ul",{className:"gc-list gc-credentials",children:U.map(V=>f.jsxs("li",{className:"gc-inline gc-inline--between",children:[f.jsxs("span",{className:"gc-credential",children:[f.jsx(xm,{children:V.kind})," ",f.jsx("span",{className:"gc-credential__label",children:V.label}),f.jsxs("span",{className:"gc-muted",children:[" · added ",Np(V.createdAt)," · last used ",Np(V.lastUsedAt)]})]}),f.jsx(De,{variant:"ghost",size:"sm",disabled:ae,title:ae?"Add another sign-in method first":void 0,onClick:()=>{ne.reset(),_(V)},children:"Remove"})]},V.id))}),ae&&U.length===1&&f.jsx("p",{className:"gc-fineprint",children:"This is your only sign-in method. Add another before removing it."})]}),g==="needed"&&f.jsx(at,{tone:"info",title:"Confirm it is you",children:f.jsxs("div",{className:"gc-stack gc-stack--tight",children:[f.jsx("span",{children:"Changing your sign-in methods needs a recent sign-in. Confirm with one you already have, then try again."}),f.jsxs("div",{className:"gc-inline gc-inline--wrap",children:[b&&f.jsx(De,{size:"sm",disabled:M,onClick:()=>void Q(),children:"Confirm with a passkey"}),T&&y!=="confirm"&&f.jsx(De,{size:"sm",variant:"outline",onClick:()=>x("confirm"),children:"Confirm with a wallet"})]}),y==="confirm"&&f.jsx(R.Suspense,{fallback:f.jsx(De,{size:"sm",disabled:!0,children:"Loading wallets…"}),children:f.jsx(cS,{onConfirmed:V=>{A(V),h("done"),x(null)}})}),!b&&!T&&f.jsx("span",{children:"Sign out and sign in again, then add it."})]})}),g==="done"&&f.jsx(at,{tone:"success",children:"Confirmed. Add or remove the sign-in method now."}),v.data&&f.jsxs("section",{className:"gc-stack gc-stack--tight",children:[f.jsx("div",{className:"as-field__label",children:"Add a sign-in method"}),f.jsxs("div",{className:"gc-inline gc-inline--wrap",children:[v.data.passkey&&f.jsx(De,{variant:"outline",size:"sm",disabled:M||!Bo(),onClick:()=>void ie(),children:M?"Waiting for your passkey…":"Add a passkey"}),v.data.wallet&&y!=="add"&&f.jsx(De,{variant:"outline",size:"sm",onClick:()=>x("add"),children:"Add a wallet"}),v.data.oidc&&f.jsxs(De,{variant:"outline",size:"sm",href:he.auth.oidcLinkUrl(),children:["Link ",v.data.oidc.label]})]}),y==="add"&&f.jsx(R.Suspense,{fallback:f.jsx(De,{size:"sm",disabled:!0,children:"Loading wallets…"}),children:f.jsx(uS,{autoConnect:!0,actionLabel:V=>`Add ${V} as a sign-in method`,onError:q,onSignedIn:V=>{A(V),x(null),h("idle"),u==null||u()}})}),f.jsx("p",{className:"gc-fineprint",children:"A wallet you add can become this workspace's withdrawal wallet only 24 hours later."})]}),C?f.jsx(at,{tone:"danger",children:Ea(C)}):null,f.jsx("div",{className:"gc-actions",children:f.jsx(De,{onClick:r,children:"Done"})})]}),f.jsx(e2,{isOpen:L!==null,busy:ne.isPending,error:ne.error,onClose:()=>{_(null),ne.reset()},onConfirm:()=>L&&ne.mutate(L),title:"Remove this sign-in method?",confirmLabel:"Remove",body:`You can no longer sign in with ${(L==null?void 0:L.label)??"it"}.`})]})}const fS="/console/assets/ant-icon-zZhiTevn.svg",hS=[213,217,215],pS=[197,208,203],mS=[150,156,153],vS=[150,160,155],Bp=[16,185,129],la=6,gS=1.7,wr=400,pi=Math.round(15.2738/18*wr),Hp=[-3,0,3];function yS(){const t=R.useRef(null);return R.useEffect(()=>{var q,ie;const r=t.current,i=r==null?void 0:r.getContext("2d");if(!r||!i)return;const a=((q=window.matchMedia)==null?void 0:q.call(window,"(prefers-reduced-motion: reduce)").matches)??!1;let u=[],d=0,m=0,v=0,g=!1;const h=document.createElement("canvas");h.width=pi,h.height=wr;const y=h.getContext("2d");let x=null;const C=(Q,ne)=>{if(!x)return 0;let ae=0,V=0;for(const de of Hp){const _e=Math.round(ne+de);if(!(_e<0||_e>=wr))for(const Me of Hp){const be=Math.round(Q+Me);be<0||be>=pi||(V+=1,x[(_e*pi+be)*4+3]>40&&(ae+=1))}}return V?ae/V:0},I=()=>{var Ue;const Q=r.getBoundingClientRect();d=Math.max(1,Math.round(Q.width)),m=Math.max(1,Math.round(Q.height));const ne=Math.min(window.devicePixelRatio||1,2);r.width=Math.round(d*ne),r.height=Math.round(m*ne),i.setTransform(ne,0,0,ne,0,0);const ae=(Ue=r.parentElement)==null?void 0:Ue.getBoundingClientRect(),V=ae?ae.left+ae.width/2-Q.left:d/2,de=.95*m/wr,_e=V-pi*de/2,Me=m-.75*wr*de,be=[];for(let Se=la/2;Se<m;Se+=la)for(let W=la/2;W<d;W+=la){const Z=C((W-_e)/de,(Se-Me)/de);be.push({x:W,y:Se,ant:Z,size:Z>0?(.45+.55*Z)*(.85+.3*Math.random()):.8,twinkleAt:Z>0&&Math.random()<.05?Math.random()*600:-1,twinkleEvery:420+Math.random()*480})}u=be},L=()=>{const Q=P2(),ne=Q?pS:hS,ae=Q?vS:mS;i.clearRect(0,0,d,m);for(const V of u){let de=0;if(V.twinkleAt>=0&&!a){const Z=(v-V.twinkleAt)%V.twinkleEvery;Z>=0&&Z<40&&(de=Math.sin(Z/40*Math.PI))}const _e=gS*V.size*(1+.5*de);de>.02&&(i.beginPath(),i.fillStyle=`rgba(${Bp.join(",")},${.18*de})`,i.arc(V.x,V.y,_e*(1+1.4*de),0,2*Math.PI),i.fill());const Me=de*.8,be=V.ant>0?ae:ne,[Ue,Se,W]=be.map((Z,Y)=>Math.round(Z+(Bp[Y]-Z)*Me));i.beginPath(),i.fillStyle=`rgba(${Ue},${Se},${W},${V.ant>0?.85+.15*de:Q?.16:.45})`,i.arc(V.x,V.y,_e,0,2*Math.PI),i.fill()}};let _=0,M=0;const D=Q=>{_=requestAnimationFrame(D),!(Q-M<33||document.visibilityState!=="visible")&&(M=Q,v+=1,L())},U=new Image;U.onload=()=>{g||!y||(y.drawImage(U,0,0,pi,wr),x=y.getImageData(0,0,pi,wr).data,I(),L(),a||(_=requestAnimationFrame(D)))},U.src=fS;const b=new ResizeObserver(()=>{I(),L()});b.observe(r);const T=new MutationObserver(()=>L());T.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme"]});const A=(ie=window.matchMedia)==null?void 0:ie.call(window,"(prefers-color-scheme: dark)");return A==null||A.addEventListener("change",L),()=>{g=!0,cancelAnimationFrame(_),b.disconnect(),T.disconnect(),A==null||A.removeEventListener("change",L)}},[]),f.jsx("canvas",{ref:t,className:"gc-antdots","aria-hidden":"true"})}const Qv="antseed-console-exposure-dismissed";function wS(t,r,i){return!r||r.mode==="public"||i?!1:_a(t)}function Wp(t){if(!t)return!1;try{return sessionStorage.getItem(Qv)===t}catch{return!1}}function xS(t){try{sessionStorage.setItem(Qv,t)}catch{}}function SS(t){return t.mode==="local"?"This gateway runs on this computer":"This gateway is only reachable on your network"}function kS(t){return t.mode==="local"?"Keys only work while it's on and can't be reached from other machines.":t.personalComputer?"Keys only work while this computer is on, over plain HTTP, and not from outside your network.":"It has no public HTTPS address: keys travel over plain HTTP and do not work from outside your network."}const CS=/^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?\.)+[a-z]{2,63}$/;function WC(t){const r=t.trim().toLowerCase().replace(/^https?:\/\//,"").replace(/[/:].*$/,"");return CS.test(r)?r:null}const ua="antseed-gateway.bundle";function VC(t){const r=t.domain??"llm.example.com",i=t.server.trim()||"user@your-server",a=`/tmp/${ua}`;return{exportBundle:`antseed gateway export --out ${ua}`,copy:`scp ${ua} ${i}:${a}`,install:`curl -fsSL https://antseed.com/install-gateway.sh | sudo bash -s -- --domain ${r} --import ${a}`,baseUrl:`https://${r}/v1`,stop:`rm ${ua}`,recover:"antseed gateway console-link --recover",tunnel:`CLOUDFLARED_TUNNEL_TOKEN=<tunnel-token> ANTSEED_TUNNEL_PUBLIC_URL=https://${r} \\
|
|
84
84
|
antseed tunnel start --provider cloudflare`}}function me({size:t=16,children:r,...i}){return f.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.8,strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",...i,children:r})}const lt={overview:t=>f.jsxs(me,{...t,children:[f.jsx("rect",{x:"3",y:"3",width:"7",height:"9",rx:"1.5"}),f.jsx("rect",{x:"14",y:"3",width:"7",height:"5",rx:"1.5"}),f.jsx("rect",{x:"14",y:"12",width:"7",height:"9",rx:"1.5"}),f.jsx("rect",{x:"3",y:"16",width:"7",height:"5",rx:"1.5"})]}),chat:t=>f.jsxs(me,{...t,children:[f.jsx("path",{d:"M4 5h16v11H9l-5 4z"}),f.jsx("path",{d:"M8 9.5h8M8 12.5h5"})]}),activity:t=>f.jsx(me,{...t,children:f.jsx("path",{d:"M3 12h4l3 8 4-16 3 8h4"})}),logs:t=>f.jsx(me,{...t,children:f.jsx("path",{d:"M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01"})}),keys:t=>f.jsxs(me,{...t,children:[f.jsx("circle",{cx:"8",cy:"15",r:"4"}),f.jsx("path",{d:"m10.8 12.2 9.2-9.2M17 6l3 3M14 9l2 2"})]}),members:t=>f.jsxs(me,{...t,children:[f.jsx("circle",{cx:"9",cy:"8",r:"3.5"}),f.jsx("path",{d:"M2.5 20a6.5 6.5 0 0 1 13 0M16 4.5a3.5 3.5 0 0 1 0 7M18 14.5a6.5 6.5 0 0 1 3.5 5.5"})]}),workspaces:t=>f.jsx(me,{...t,children:f.jsx("path",{d:"M3 7h18v13H3zM8 7V4h8v3"})}),wallet:t=>f.jsxs(me,{...t,children:[f.jsx("path",{d:"M3 7a2 2 0 0 1 2-2h13v4"}),f.jsx("rect",{x:"3",y:"7",width:"18",height:"13",rx:"2"}),f.jsx("circle",{cx:"16.5",cy:"13.5",r:"1.3"})]}),rewards:t=>f.jsxs(me,{...t,children:[f.jsx("path",{d:"M12 15a6 6 0 1 0 0-12 6 6 0 0 0 0 12Z"}),f.jsx("path",{d:"m8.5 14-1.5 7 5-3 5 3-1.5-7"})]}),providers:t=>f.jsxs(me,{...t,children:[f.jsx("circle",{cx:"12",cy:"5",r:"2.2"}),f.jsx("circle",{cx:"5",cy:"18",r:"2.2"}),f.jsx("circle",{cx:"19",cy:"18",r:"2.2"}),f.jsx("path",{d:"M11 7 6 16M13 7l5 9M7.2 18h9.6"})]}),network:t=>f.jsxs(me,{...t,children:[f.jsx("circle",{cx:"12",cy:"5",r:"2.2"}),f.jsx("circle",{cx:"5",cy:"18",r:"2.2"}),f.jsx("circle",{cx:"19",cy:"18",r:"2.2"}),f.jsx("path",{d:"M11 7 6 16M13 7l5 9M7.2 18h9.6"})]}),models:t=>f.jsxs(me,{...t,children:[f.jsx("path",{d:"m12 3 9 5-9 5-9-5z"}),f.jsx("path",{d:"m3 12.5 9 5 9-5M3 17l9 5 9-5"})]}),routing:t=>f.jsx(me,{...t,children:f.jsx("path",{d:"M6 3v6a4 4 0 0 0 4 4h8M14 9l4 4-4 4M6 21v-4"})}),presets:t=>f.jsxs(me,{...t,children:[f.jsx("path",{d:"M4 6h10M18 6h2M4 12h4M12 12h8M4 18h12M20 18h0"}),f.jsx("circle",{cx:"16",cy:"6",r:"2"}),f.jsx("circle",{cx:"10",cy:"12",r:"2"}),f.jsx("circle",{cx:"18",cy:"18",r:"2"})]}),settings:t=>f.jsxs(me,{...t,children:[f.jsx("circle",{cx:"12",cy:"12",r:"3"}),f.jsx("path",{d:"M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1Z"})]}),audit:t=>f.jsxs(me,{...t,children:[f.jsx("path",{d:"M9 4h6a1 1 0 0 1 1 1v1H8V5a1 1 0 0 1 1-1Z"}),f.jsx("path",{d:"M8 6H6a1 1 0 0 0-1 1v13a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V7a1 1 0 0 0-1-1h-2M9 12h6M9 16h4"})]}),copy:t=>f.jsxs(me,{...t,children:[f.jsx("rect",{x:"9",y:"9",width:"12",height:"12",rx:"2"}),f.jsx("path",{d:"M5 15V5a2 2 0 0 1 2-2h10"})]}),check:t=>f.jsx(me,{...t,children:f.jsx("path",{d:"m5 12 5 5L20 7"})}),right:t=>f.jsx(me,{...t,children:f.jsx("path",{d:"m9 6 6 6-6 6"})}),left:t=>f.jsx(me,{...t,children:f.jsx("path",{d:"m15 6-6 6 6 6"})}),qr:t=>f.jsxs(me,{...t,children:[f.jsx("rect",{x:"3",y:"3",width:"7",height:"7",rx:"1"}),f.jsx("rect",{x:"14",y:"3",width:"7",height:"7",rx:"1"}),f.jsx("rect",{x:"3",y:"14",width:"7",height:"7",rx:"1"}),f.jsx("path",{d:"M14 14h3v3M21 14v.01M14 21h3M20 18v3"})]}),lock:t=>f.jsxs(me,{...t,children:[f.jsx("rect",{x:"4",y:"10",width:"16",height:"11",rx:"2"}),f.jsx("path",{d:"M8 10V7a4 4 0 0 1 8 0v3"})]}),plus:t=>f.jsx(me,{...t,children:f.jsx("path",{d:"M12 5v14M5 12h14"})}),up:t=>f.jsx(me,{...t,children:f.jsx("path",{d:"m6 15 6-6 6 6"})}),down:t=>f.jsx(me,{...t,children:f.jsx("path",{d:"m6 9 6 6 6-6"})}),x:t=>f.jsx(me,{...t,children:f.jsx("path",{d:"M6 6l12 12M18 6 6 18"})}),menu:t=>f.jsx(me,{...t,children:f.jsx("path",{d:"M4 6h16M4 12h16M4 18h16"})}),sun:t=>f.jsxs(me,{...t,children:[f.jsx("circle",{cx:"12",cy:"12",r:"4"}),f.jsx("path",{d:"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"})]}),monitor:t=>f.jsxs(me,{...t,children:[f.jsx("rect",{x:"3",y:"4",width:"18",height:"12",rx:"2"}),f.jsx("path",{d:"M8 20h8M12 16v4"})]}),moon:t=>f.jsx(me,{...t,children:f.jsx("path",{d:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8Z"})}),external:t=>f.jsx(me,{...t,children:f.jsx("path",{d:"M14 4h6v6M20 4l-9 9M18 14v5a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7a1 1 0 0 1 1-1h5"})}),download:t=>f.jsx(me,{...t,children:f.jsx("path",{d:"M12 4v11M7 10l5 5 5-5M4 20h16"})}),more:t=>f.jsxs(me,{...t,children:[f.jsx("circle",{cx:"5",cy:"12",r:"1"}),f.jsx("circle",{cx:"12",cy:"12",r:"1"}),f.jsx("circle",{cx:"19",cy:"12",r:"1"})]}),shield:t=>f.jsxs(me,{...t,children:[f.jsx("path",{d:"M12 3 4 6v6c0 4.5 3.4 8.3 8 9 4.6-.7 8-4.5 8-9V6Z"}),f.jsx("path",{d:"m9 12 2 2 4-4"})]}),compass:t=>f.jsxs(me,{...t,children:[f.jsx("circle",{cx:"12",cy:"12",r:"9"}),f.jsx("path",{d:"m15.5 8.5-2 5-5 2 2-5z"})]}),logout:t=>f.jsx(me,{...t,children:f.jsx("path",{d:"M15 4h4a1 1 0 0 1 1 1v14a1 1 0 0 1-1 1h-4M10 17l5-5-5-5M15 12H3"})})};function ES(t){t.button!==0||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||(t.preventDefault(),an("migrate"))}function _S(){var d;const{viewer:t}=ir(),i=(d=xv().data)==null?void 0:d.exposure,[a,u]=R.useState(()=>Wp(i==null?void 0:i.mode));return!wS(t,i,a||Wp(i==null?void 0:i.mode))||!i?null:f.jsxs("div",{className:"gc-exposure",role:"region","aria-label":"Gateway reachability",children:[f.jsx("span",{className:"gc-exposure__icon","aria-hidden":"true",children:f.jsx(lt.monitor,{size:16})}),f.jsxs("div",{className:"gc-exposure__text",children:[f.jsxs("strong",{children:[SS(i),"."]})," ",f.jsx("span",{children:kS(i)})]}),f.jsxs("div",{className:"gc-exposure__actions",children:[f.jsxs(De,{size:"sm",variant:"outline",href:Pa("migrate"),onClick:ES,className:"gc-exposure__cta",children:["Move to a server ",f.jsx("span",{className:"gc-exposure__rec",children:"(recommended)"})]}),f.jsx(Uo,{label:"Dismiss for this session",className:"gc-exposure__close",onClick:()=>{xS(i.mode),u(!0)},children:f.jsx(lt.x,{size:14})})]})]})}function PS(t,r){return(t||r).replace(/\/+$/,"")}function bS(t){return`${t}/v1`}const ba="ANTSEED_API_KEY",ja={env:ba};function jS(t){return"secret"in t?t.secret:`$${t.env}`}function Gv(t){return"secret"in t?`'${t.secret}'`:`process.env.${t.env}`}function TS(t){return"secret"in t?`"${t.secret}"`:`os.environ["${t.env}"]`}function Yv(t,r){return`${t.trim().toLowerCase().replace(/^0x/,"")}@${r.trim()}`}function RS(t){const r=t.apiProtocols??[];if(r.includes("openai-chat-completions"))return"openai-chat-completions";if(r.includes("anthropic-messages"))return"anthropic-messages";if(r.includes("openai-responses"))return"openai-responses";if(r.includes("openai-images"))return"openai-images";const i=t.provider.toLowerCase();return i.includes("anthropic")||i.includes("claude")?"anthropic-messages":i.includes("responses")?"openai-responses":"openai-chat-completions"}const NS={"anthropic-messages":"/v1/messages","openai-responses":"/v1/responses","openai-chat-completions":"/v1/chat/completions","openai-images":"/v1/images/generations"};function qC(t,r){if(t==="image")return"openai-images";if(t!=="text")return null;if(!r)return"openai-chat-completions";const i=RS({provider:r.provider,apiProtocols:r.protocols});return i==="openai-images"?"openai-chat-completions":i}const ed="A lighthouse on a cliff at dawn, watercolor";function IS(t,r){return JSON.stringify(t==="anthropic-messages"?{model:r,max_tokens:1024,messages:[{role:"user",content:"Hello"}]}:t==="openai-responses"?{model:r,input:"Hello"}:t==="openai-images"?{model:r,prompt:ed,n:1}:{model:r,messages:[{role:"user",content:"Hello"}]})}function Zv(t,r,i="openai-chat-completions",a=ja){return[`curl ${t}${NS[i]} \\`,` -H "Authorization: Bearer ${jS(a)}" \\`,' -H "Content-Type: application/json" \\',` -d '${IS(i,r).replaceAll("'","'\\''")}'`].join(`
|
|
85
85
|
`)}function Xv(t,r,i="openai-chat-completions",a=ja){return["import OpenAI from 'openai'","","const client = new OpenAI({",` baseURL: '${t}/v1',`,` apiKey: ${Gv(a)},`,"})","",...i==="openai-images"?["const result = await client.images.generate({",` model: '${r}',`,` prompt: '${ed}',`,"})","console.log(result.data[0].url ?? result.data[0].b64_json)"]:i==="openai-responses"?["const reply = await client.responses.create({",` model: '${r}',`," input: 'Hello',","})","console.log(reply.output_text)"]:["const reply = await client.chat.completions.create({",` model: '${r}',`," messages: [{ role: 'user', content: 'Hello' }],","})","console.log(reply.choices[0].message.content)"]].join(`
|
|
86
86
|
`)}function MS(t,r,i="openai-chat-completions",a=ja){return[..."env"in a?["import os"]:[],"from openai import OpenAI","",`client = OpenAI(base_url="${t}/v1", api_key=${TS(a)})`,"",...i==="openai-images"?[`result = client.images.generate(model="${r}", prompt="${ed}")`,"print(result.data[0].url or result.data[0].b64_json)"]:i==="openai-responses"?[`reply = client.responses.create(model="${r}", input="Hello")`,"print(reply.output_text)"]:["reply = client.chat.completions.create(",` model="${r}",`,' messages=[{"role": "user", "content": "Hello"}],',")","print(reply.choices[0].message.content)"]].join(`
|
|
@@ -88,4 +88,4 @@ Error generating stack: `+c.message+`
|
|
|
88
88
|
`)}function OS(t,r){return["# ~/.codex/config.toml",`model = "${r}"`,'model_provider = "antseed"',"","[model_providers.antseed]",'name = "Antseed gateway"',`base_url = "${t}/v1"`,`env_key = "${ba}"`,'wire_api = "responses"'].join(`
|
|
89
89
|
`)}function LS(t,r){return[`export ANTHROPIC_BASE_URL="${t}"`,`export ANTHROPIC_AUTH_TOKEN="$${ba}"`,`export ANTHROPIC_MODEL="${r}"`,"claude"].join(`
|
|
90
90
|
`)}function AS(t,r){return[`Base URL: ${t}/v1`,`API key: $${ba} (your Antseed key)`,`Model: ${r}`].join(`
|
|
91
|
-
`)}function KC(t,r,i="<model>"){const a={secret:r};return[{id:"curl",label:"curl",code:Zv(t,i,"openai-chat-completions",a)},{id:"openai",label:"OpenAI SDK",code:Xv(t,i,"openai-chat-completions",a)},{id:"anthropic",label:"Anthropic SDK",code:Jv(t,i,a)}]}function DS(t,r,i){const a=[{id:"curl",label:"curl",language:"shell",code:Zv(t,r,i)},{id:"openai-python",label:"Python",language:"python",code:MS(t,r,i)},{id:"openai-js",label:"JavaScript",language:"javascript",code:Xv(t,r,i)}];return i==="anthropic-messages"&&a.push({id:"anthropic",label:"Anthropic SDK",language:"javascript",code:Jv(t,r)}),a}function QC(t,r,i,a,u){const d=Yv(r,i),m=DS(t,d,a);return a==="openai-images"||m.push({id:"codex",label:"Codex",language:"toml",code:OS(t,u??"@preset/<your-preset>")},{id:"claude-code",label:"Claude Code",language:"shell",code:LS(t,d)},{id:"openai-compatible",label:"Cursor / OpenAI-compatible",language:"text",code:AS(t,d)}),m}function FS(){var r;const t=xv();return PS((r=t.data)==null?void 0:r.publicUrl,window.location.origin)}function zS(){const t=pv();return async r=>{await cv(r)?t("Copied"):t("Could not copy to the clipboard","danger")}}function GC(t,r,i){return{label:"Copy model id",onSelect:()=>void t(Yv(r,i))}}function YC({value:t,label:r}){const i=zS();return f.jsx(Uo,{label:r,size:"sm",className:"gc-copy-id",onClick:a=>{a.stopPropagation(),i(t)},children:f.jsx(lt.copy,{size:13})})}function Vp({className:t}){const r=bS(FS());return f.jsxs("div",{className:["gc-endpoint",t].filter(Boolean).join(" "),title:`OpenAI-compatible base URL: ${r}`,children:[f.jsx("span",{className:"gc-endpoint__label",children:"API"}),f.jsx("code",{className:"gc-endpoint__url",children:r}),f.jsx(zc,{iconOnly:!0,value:r,label:"Copy the gateway API URL",className:"gc-endpoint__copy"})]})}const eg="https://antseed.com/docs/gateway",$S=R.lazy(()=>Ve(()=>import("./Migrate-DEIQ12oJ.js"),[]));function hc({to:t="overview",tagged:r,size:i=26}){const a=f.jsxs(f.Fragment,{children:[f.jsx(i2,{height:i,className:"gc-brand__full"}),f.jsx(o2,{size:26,className:"gc-brand__mark"}),f.jsx("span",{className:"gc-brand__tag",children:"Console"})]}),u=r?"gc-brand gc-brand--tagged":"gc-brand";return t===null?f.jsx("span",{className:u,children:a}):f.jsx("a",{className:u,href:Pa(t),onClick:Vc(t),"aria-label":"Antseed console home",children:a})}const pc="No authorized wallet: nobody can withdraw funds or claim ANTS rewards";function US(){const{me:t,workspace:r,setWorkspaceId:i}=ir(),{missingOperator:a,currentMissingOperator:u}=Ev(),d=u&&f.jsx("span",{className:"gc-attention",role:"img","aria-label":pc,title:pc});return t.workspaces.length<=1?f.jsxs("span",{className:"gc-ws",title:"Workspace","data-tour":"workspace",children:[f.jsx(lt.workspaces,{size:14}),f.jsx("span",{className:"gc-ws__name",children:r.name}),d]}):f.jsxs("label",{className:"gc-ws gc-ws--select","data-tour":"workspace",children:[f.jsx(lt.workspaces,{size:14}),f.jsx("select",{className:"gc-ws__select",value:r.id,onChange:m=>i(m.target.value),"aria-label":"Switch workspace",children:t.workspaces.map(({workspace:m,role:v})=>f.jsxs("option",{value:m.id,children:[m.name,v==="admin"?" (admin)":"",m.id!==r.id&&a.has(m.id)?" · no authorized wallet":""]},m.id))}),d,f.jsx(lt.down,{size:14,className:"gc-ws__chevron"})]})}function BS(t,r){return t!=="wallet"?null:r.currentMissingOperator?pc:r.withdrawable.count>0?`${r.withdrawable.count} channel${r.withdrawable.count===1?"":"s"} ready to withdraw`:null}function qp({current:t,onNavigate:r}){const{viewer:i}=ir(),a=Ev(),u=g2(i),d=[...new Set(u.map(m=>m.group))];return f.jsx("nav",{className:"gc-nav","aria-label":"Console",children:d.map(m=>f.jsxs("div",{className:"gc-nav__group",children:[f.jsx("div",{className:"gc-nav__heading",children:m}),u.filter(v=>v.group===m).map(v=>{const g=lt[v.id]??lt.overview;return f.jsxs("a",{href:Pa(v.id),"aria-current":v.id===t?"page":void 0,"data-tour":`nav-${v.id}`,className:v.id===t?"gc-nav__item gc-nav__item--on":"gc-nav__item",onClick:h=>{Vc(v.id)(h),r==null||r()},children:[f.jsx(g,{size:16}),f.jsx("span",{children:v.label}),(()=>{const h=BS(v.id,a);return h&&f.jsx("span",{className:"gc-attention gc-nav__attention",role:"img","aria-label":h,title:h})})()]},v.id)})]},m))})}const Kp={system:"System",dark:"Dark",light:"Light"},HS={system:"dark",dark:"light",light:"system"},WS={system:lt.monitor,dark:lt.moon,light:lt.sun};function tg(){const[t,r]=_2(),i=HS[t],a=WS[t];return f.jsx(Uo,{className:"gc-topbar__icon",label:`Color theme: ${Kp[t]}. Switch to ${Kp[i]}.`,onClick:()=>r(i),children:f.jsx(a,{size:16})})}function VS(){const t=rr();return async()=>{try{await he.auth.logout()}finally{t.clear(),an("login",{replace:!0})}}}function qS(t){var u;const r=t.trim().split(/\s+/).filter(Boolean),i=((u=r[0])==null?void 0:u[0])??"?",a=r.length>1?r[r.length-1][0]:"";return(i+a).toUpperCase()}function KS({onAccount:t,onTour:r,onSignOut:i}){const{me:a}=ir(),[u,d]=R.useState(!1),m=R.useRef(null),v=R.useRef(null);R.useEffect(()=>{var I,L;if(!u)return;const x=_=>{var M;(M=m.current)!=null&&M.contains(_.target)||d(!1)},C=_=>{var M;_.key==="Escape"&&(d(!1),(M=v.current)==null||M.focus())};return document.addEventListener("mousedown",x),document.addEventListener("keydown",C),(L=(I=m.current)==null?void 0:I.querySelector('[role="menuitem"]'))==null||L.focus(),()=>{document.removeEventListener("mousedown",x),document.removeEventListener("keydown",C)}},[u]);const g=x=>()=>{d(!1),x()},h=Hc[a.member.orgRole],y=a.member.email?`${a.member.email} · ${h}`:h;return f.jsxs("div",{className:"gc-account",ref:m,"data-tour":"account",children:[f.jsx("button",{ref:v,type:"button",className:"gc-user","aria-haspopup":"menu","aria-expanded":u,"aria-label":`Your account: ${a.member.label}`,onClick:()=>d(x=>!x),children:f.jsx("span",{className:"gc-avatar","aria-hidden":"true",children:qS(a.member.label)})}),u&&f.jsxs("div",{className:"gc-account__menu",role:"menu","aria-label":"Account",children:[f.jsxs("div",{className:"gc-account__who",children:[f.jsx("div",{className:"gc-account__name",children:a.member.label}),f.jsx("div",{className:"gc-account__meta",children:y})]}),f.jsxs("button",{type:"button",role:"menuitem",className:"gc-account__item",onClick:g(t),children:[f.jsx(lt.shield,{size:15}),"Account and sign-in"]}),f.jsxs("button",{type:"button",role:"menuitem",className:"gc-account__item",onClick:g(r),children:[f.jsx(lt.compass,{size:15}),"Take the tour"]}),f.jsxs("a",{role:"menuitem",className:"gc-account__item",href:eg,target:"_blank",rel:"noreferrer",onClick:()=>d(!1),children:[f.jsx(lt.external,{size:15}),"Documentation"]}),f.jsx("div",{className:"gc-account__sep"}),f.jsxs("button",{type:"button",role:"menuitem",className:"gc-account__item",onClick:g(i),children:[f.jsx(lt.logout,{size:15}),"Sign out"]})]})]})}function QS({page:t,children:r}){const[i,a]=R.useState(!1),[u,d]=R.useState(()=>new URLSearchParams(window.location.search).get("account")==="1"),m=VS(),v=Wc().page==="migrate",g=v?null:t,{me:h,viewer:y}=ir();return R.useEffect(()=>{if(v||Ox(h.member.id))return;const x=window.setTimeout(()=>zp(y,h.member.id),600);return()=>window.clearTimeout(x)},[h.member.id]),f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"gc-app","data-page":g??void 0,children:[f.jsx("a",{className:"gc-skip",href:"#gc-main",children:"Skip to content"}),f.jsxs("header",{className:"gc-topbar",children:[f.jsxs("div",{className:"gc-topbar__inner",children:[f.jsx(Uo,{label:"Open menu",className:"gc-topbar__menu gc-topbar__icon",onClick:()=>a(!0),children:f.jsx(lt.menu,{size:16})}),f.jsx(hc,{}),f.jsx("span",{className:"gc-topbar__sep","aria-hidden":"true",children:"/"}),f.jsx(US,{}),f.jsx("div",{className:"gc-topbar__spacer"}),f.jsx(Vp,{className:"gc-endpoint--inline"}),f.jsx("a",{className:"gc-topbar__link",href:eg,target:"_blank",rel:"noreferrer",children:"Docs"}),f.jsx(tg,{}),f.jsx(KS,{onAccount:()=>d(!0),onTour:()=>zp(y,h.member.id),onSignOut:()=>void m()})]}),f.jsx("div",{className:"gc-topbar__strip",children:f.jsx(Vp,{})})]}),f.jsxs("div",{className:"gc-body",children:[f.jsxs("aside",{className:"gc-rail",children:[f.jsx(qp,{current:g}),f.jsx(yS,{})]}),f.jsx("main",{id:"gc-main",className:"gc-main",tabIndex:-1,children:v?f.jsx(R.Suspense,{fallback:f.jsx(Mi,{rows:6}),children:f.jsx($S,{})}):f.jsxs(f.Fragment,{children:[f.jsx(_S,{}),r]})})]})]}),f.jsx(n2,{isOpen:i,onClose:()=>a(!1),side:"left",title:f.jsx(hc,{to:null}),className:"gc-mobile-nav",children:f.jsx(qp,{current:g,onNavigate:()=>a(!1)})}),f.jsx(dS,{isOpen:u,onClose:()=>d(!1)})]})}const GS=R.lazy(()=>Ve(()=>import("./WalletSignIn-Bs_yxjak.js"),__vite__mapDeps([0,1,2,3,4,5]))),Qp={not_invited:"This account has not been invited to this console. Ask an admin for an invite link.",invite_expired:"This invite link has expired. Ask an admin for a new one.",invite_used:"This invite link was already used. Sign in instead.",invalid_token:"This link is not valid. Check that you copied all of it.",setup_complete:"This console is already set up. Sign in instead.",member_disabled:"Your access to this console has been turned off.",unknown_credential:"This passkey or wallet is not registered here.",key_revoked:"This API key has been revoked.",invalid_key:"That API key is not valid.",rate_limited:"Too many attempts. Wait a minute and try again.",key_expired:"This API key has expired.",not_linked:"This account is not linked to a member yet. Sign in another way and link it from your profile, or use your invite link.",invalid_enrollment:"This sign-up link has expired. Open your invite link again, or ask for a new one.",unauthenticated:"Sign in first.",oidc_denied:"Single sign-on was cancelled.",oidc_state:"The single sign-on attempt expired. Try again.",oidc_failed:"Single sign-on could not be verified. Try again, or use another sign-in method.",oidc_unavailable:"The single sign-on provider could not be reached. Try again later.",reauth_required:"Linking a sign-in provider needs a fresh sign-in. Go back to the console, confirm it is you under Your sign-in methods, then link it again.",access_reauth_required:"Your Cloudflare Access sign-in is more than 5 minutes old. Sign out of Cloudflare Access, sign in again, then link the provider again.",credential_exists:"This single sign-on account is already linked to another member."},YS=new Set(["reauth_required","access_reauth_required","credential_exists"]);function ng(t){return Object.hasOwn(Qp,t)?Qp[t]:void 0}function td(t){return Lr(t)&&ng(t.code)||Ea(t)}function mc({title:t,subtitle:r,children:i}){return f.jsxs("div",{className:"gc-auth",children:[f.jsx("div",{className:"gc-auth__theme",children:f.jsx(tg,{})}),f.jsx("div",{className:"gc-auth__logo",children:f.jsx(hc,{to:null,tagged:!0,size:30})}),f.jsxs(Cc,{className:"gc-auth__card",children:[f.jsx("h1",{className:"gc-auth__title",children:t}),r&&f.jsx("p",{className:"gc-auth__subtitle",children:r}),i]}),f.jsx("p",{className:"gc-auth__foot",children:"Self-hosted Antseed gateway"})]})}function rg(){const t=rr();return r=>{t.setQueryData(Re.me,r),an(r.kind==="key"?"key":"overview",{replace:!0})}}function Gp({label:t,run:r,primary:i}){const[a,u]=R.useState(!1),[d,m]=R.useState(null),v=Bo();return f.jsxs("div",{className:"gc-stack gc-stack--tight",children:[f.jsx(De,{fullWidth:!0,variant:i?"primary":"outline",disabled:a||!v,onClick:async()=>{u(!0),m(null);try{await r()}catch(g){m(fc(g)?dc:td(g))}finally{u(!1)}},children:a?"Waiting for your passkey…":t}),!v&&f.jsx("p",{className:"gc-fineprint",children:"This browser does not support passkeys."}),d&&f.jsx(at,{tone:"danger",children:d})]})}function ZS({enrollment:t,onSignedIn:r}){const[i,a]=R.useState(!1);return i?f.jsx(R.Suspense,{fallback:f.jsx(De,{variant:"outline",fullWidth:!0,disabled:!0,children:"Loading wallets…"}),children:f.jsx(GS,{enrollment:t,onSignedIn:r,autoConnect:!0})}):f.jsx(De,{variant:"outline",fullWidth:!0,onClick:()=>a(!0),children:"Sign in with a wallet"})}function XS(){return f.jsx("div",{className:"gc-divider",children:f.jsx("span",{children:"or"})})}function JS({onSignedIn:t}){const[r,i]=R.useState(""),[a,u]=R.useState(!1),[d,m]=R.useState(null);return f.jsxs("form",{className:"gc-stack gc-stack--tight",onSubmit:async v=>{v.preventDefault(),u(!0),m(null);try{t(await he.auth.apiKey(r.trim()))}catch(g){m(td(g))}finally{u(!1)}},children:[f.jsx(c2,{label:"API key",type:"password",autoComplete:"off",placeholder:"Paste your key to see its usage",value:r,onChange:v=>i(v.target.value)}),f.jsx(De,{type:"submit",variant:"outline",fullWidth:!0,disabled:a||!r.trim(),children:a?"Checking…":"View key usage"}),d&&f.jsx(at,{tone:"danger",children:d})]})}function ek({mode:t,enrollment:r,onSignedIn:i}){return t==="login"?f.jsx(Gp,{primary:!0,label:"Sign in with a passkey",run:async()=>{const a=await he.auth.passkeyLoginOptions(),u=await qv({optionsJSON:a});i(await he.auth.passkeyLoginVerify(u))}}):f.jsx(Gp,{primary:!0,label:"Create a passkey",run:async()=>{const a=await he.auth.passkeyRegisterOptions(r),u=await Vv({optionsJSON:a});i(await he.auth.passkeyRegisterVerify(u,r))}})}function ig({config:t,enrollment:r,onSignedIn:i,mode:a}){const u=[];return t.passkey&&u.push(f.jsx(ek,{mode:a,enrollment:r,onSignedIn:i},"passkey")),t.wallet&&u.push(f.jsx(ZS,{enrollment:r,onSignedIn:i},"wallet")),t.oidc&&u.push(f.jsxs(De,{variant:"outline",fullWidth:!0,href:he.auth.oidcStartUrl(r),children:["Continue with ",t.oidc.label]},"oidc")),u.length===0?f.jsx(at,{tone:"warning",children:"No sign-in method is enabled on this gateway. Check the gateway's console auth settings."}):f.jsx("div",{className:"gc-stack",children:u})}function tk(){const t=Kc(),r=rg(),i=new URLSearchParams(window.location.search).get("error");return f.jsxs(mc,{title:"Sign in",subtitle:"Manage keys, budgets, routing and funding for this gateway.",children:[i&&f.jsx(at,{tone:"danger",action:YS.has(i)?f.jsx(De,{size:"sm",variant:"outline",onClick:()=>an("overview?account=1",{replace:!0}),children:"Back to the console"}):void 0,children:ng(i)??"Sign-in did not complete. Try again."}),t.isLoading&&f.jsxs("div",{className:"gc-stack",children:[f.jsx(Mo,{height:34}),f.jsx(Mo,{height:34})]}),t.error?f.jsx(at,{tone:"danger",title:"Could not reach the gateway",children:Ea(t.error)}):null,t.data&&f.jsxs("div",{className:"gc-stack",children:[t.data.setupRequired&&f.jsxs(at,{tone:"info",title:"Not set up yet",children:["Get a one-time setup link by running ",f.jsx("code",{children:"antseed gateway console-link"})," on the gateway, or ask the operator for it."]}),f.jsx(ig,{config:t.data,mode:"login",onSignedIn:r}),t.data.cloudflareAccess&&f.jsx("p",{className:"gc-fineprint",children:"This gateway also accepts Cloudflare Access. If you signed in there, reload this page."}),t.data.apiKeyLogin&&f.jsxs(f.Fragment,{children:[f.jsx(XS,{}),f.jsx(JS,{onSignedIn:r})]})]})]})}function nk({kind:t}){const[r,i]=R.useState(()=>window.location.hash.replace(/^#/,""));R.useEffect(()=>{const v=()=>{const g=window.location.hash.replace(/^#/,"");g&&(i(g),window.history.replaceState(null,"",window.location.pathname))};return v(),window.addEventListener("hashchange",v),()=>window.removeEventListener("hashchange",v)},[]);const a=rg(),u=Kc(),d=$e({queryKey:["enrollment",t,r],queryFn:()=>t==="setup"?he.auth.setup(r):t==="recover"?he.request("POST","/auth/recover",{body:{token:r}}):he.auth.invite(r),enabled:r!=="",retry:!1,staleTime:1/0}),m=t==="setup"?"Set up your Antseed console":t==="recover"?"Add a sign-in method":"You are invited";return r?f.jsxs(mc,{title:m,subtitle:d.data?t==="recover"?f.jsxs(f.Fragment,{children:["Welcome back, ",f.jsx("strong",{children:d.data.label}),". Add a passkey, wallet or single sign-on to sign in on this address."]}):f.jsxs(f.Fragment,{children:["Welcome, ",f.jsx("strong",{children:d.data.label}),". You will join as ",Hc[d.data.orgRole].toLowerCase(),". Choose how you sign in."]}):"Checking your link…",children:[(d.isLoading||u.isLoading)&&f.jsxs("div",{className:"gc-stack",children:[f.jsx(Mo,{height:34}),f.jsx(Mo,{height:34})]}),d.error?f.jsxs("div",{className:"gc-stack",children:[f.jsx(at,{tone:"danger",children:td(d.error)}),f.jsx(De,{variant:"ghost",onClick:()=>an("login"),children:"Go to sign in"})]}):null,d.data&&u.data&&f.jsxs("div",{className:"gc-stack",children:[f.jsx(ig,{config:u.data,mode:"enroll",enrollment:d.data.enrollment,onSignedIn:a}),f.jsx("p",{className:"gc-fineprint",children:"A passkey uses your device's screen lock or a security key. Nothing to remember."})]})]}):f.jsxs(mc,{title:m,children:[f.jsx(at,{tone:"danger",children:"This link is missing its token. Open the full link you were given."}),f.jsx(De,{variant:"ghost",onClick:()=>an("login"),children:"Go to sign in"})]})}const rk={overview:R.lazy(()=>Ve(()=>import("./Overview-ipvNEEut.js"),__vite__mapDeps([8,9,10,11,12,13]))),chat:R.lazy(()=>Ve(()=>import("./mermaid-MCJ5UELQ-DAirhLo4.js").then(t=>t.C),__vite__mapDeps([14,2,3,15]))),activity:R.lazy(()=>Ve(()=>import("./Activity-aMw4GLn_.js"),__vite__mapDeps([16,9,10,11,12,13,17,18,3]))),logs:R.lazy(()=>Ve(()=>import("./Logs-BPrDGUHL.js"),__vite__mapDeps([19,20,21,10,18,3,22,17]))),keys:R.lazy(()=>Ve(()=>import("./Keys-DIlH-qns.js"),__vite__mapDeps([23,24,25,17,12,13,26,27,28,29,22,10,18,3,11]))),members:R.lazy(()=>Ve(()=>import("./Members-Cud9TWBJ.js"),__vite__mapDeps([30,24,25,17,12,13,26,27,29,18,3]))),workspaces:R.lazy(()=>Ve(()=>import("./Workspaces-C79eSjJK.js"),__vite__mapDeps([31,24,25,17,12,13,26,27,29,18,3]))),wallet:R.lazy(()=>Ve(()=>import("./Wallet-tlCKFe2Q.js"),__vite__mapDeps([32,33,4,34,27,18,3,26]))),rewards:R.lazy(()=>Ve(()=>import("./Rewards-CUru480X.js"),__vite__mapDeps([35,33,36,18,3]))),providers:R.lazy(()=>Ve(()=>import("./Providers-CcIj0C5E.js"),__vite__mapDeps([37,25,17,12,13,26,27,18,3,38,36,39,24,40,28]))),models:R.lazy(()=>Ve(()=>import("./Models-DXI7RYae.js"),__vite__mapDeps([41,28,13,38,17,26,18,3]))),routing:R.lazy(()=>Ve(()=>import("./Routing-BO7JFJGH.js"),__vite__mapDeps([42,24,25,17,12,13,26,27,18,3,28]))),presets:R.lazy(()=>Ve(()=>import("./Presets-DrJ48O3s.js"),__vite__mapDeps([39,24,25,17,12,13,26,27,18,3,40]))),audit:R.lazy(()=>Ve(()=>import("./Audit-CCre2vZ2.js"),__vite__mapDeps([43,21,17,18,3]))),settings:R.lazy(()=>Ve(()=>import("./Settings-qFQk36WV.js"),__vite__mapDeps([44,25,17,12,13,26,27,40,28,18,3])))},ik=R.lazy(()=>Ve(()=>import("./KeyHolder-DUhCBfBH.js"),__vite__mapDeps([45,20,21,10,18,3,11]))),ok=new z1({defaultOptions:{queries:{staleTime:1e4,refetchOnWindowFocus:!1,retry:(t,r)=>!(Lr(r)&&r.status>=400&&r.status<500)&&t<2}}});class sk extends R.Component{constructor(){super(...arguments);wu(this,"state",{failed:!1})}static getDerivedStateFromError(i){return{failed:!0,error:i}}render(){return this.state.failed?f.jsx(Jc,{error:this.state.error,title:"This page failed to load",onRetry:()=>this.setState({failed:!1,error:void 0})}):this.props.children}}function ak(t){return Uc.some(r=>r.id===t)}function lk({me:t,page:r}){const[i,a]=R.useState(()=>{var C;return((C=Tp(t,k2()))==null?void 0:C.id)??null}),u=Tp(t,i),d=rr(),m=Wc(),v=S2(m.page,m.rest);R.useEffect(()=>{v&&an(v,{replace:!0})},[v]);const g=R.useMemo(()=>{if(!u)return null;const C=y2({me:t},u.id);return{me:t,workspace:u,workspaceRole:C.workspaceRole,viewer:C,setWorkspaceId:I=>{C2(I),a(I),d.invalidateQueries()}}},[t,u,d]);if(v)return f.jsx("div",{className:"gc-centered",children:f.jsx(Mi,{rows:3})});if(!g)return f.jsx("div",{className:"gc-centered",children:f.jsx(at,{tone:"warning",title:"No workspace",children:"You are not a member of any workspace yet. Ask an admin to add you."})});const h=ak(r)?r:"overview",y=Bc(h,g.viewer),x=rk[h];return f.jsx(vv.Provider,{value:g,children:f.jsx(QS,{page:h,children:f.jsx(sk,{children:f.jsx(R.Suspense,{fallback:f.jsx(Mi,{rows:6}),children:y?f.jsx(x,{}):f.jsx(at,{tone:"warning",title:"Not available",children:"Your role cannot open this page."})})},m.page)})})}function uk({page:t}){const r=W2(),i=Lr(r.error)&&r.error.status===401;return R.useEffect(()=>{i&&an("login",{replace:!0})},[i]),r.isLoading||i?f.jsx("div",{className:"gc-centered",children:f.jsx(Mi,{rows:3})}):r.error?f.jsxs("div",{className:"gc-centered gc-stack",children:[f.jsx(Jc,{error:r.error,title:"Could not open the console",onRetry:()=>void r.refetch()}),f.jsx(De,{variant:"ghost",onClick:()=>an("login"),children:"Go to sign in"})]}):r.data?r.data.kind==="key"?f.jsx(R.Suspense,{fallback:f.jsx(Mi,{rows:6}),children:f.jsx(ik,{})}):f.jsx(lk,{me:r.data.me,page:t}):null}function ck(){const t=Wc();return t.page==="login"?f.jsx(tk,{}):t.page==="setup"||t.page==="invite"||t.page==="recover"?f.jsx(nk,{kind:t.page}):f.jsx(uk,{page:t.page})}function dk(){return f.jsx($1,{client:ok,children:f.jsx(f2,{children:f.jsx(ck,{})})})}E2();async function fk(){const t=document.getElementById("root");if(!t)throw new Error("#root element is missing");m1.createRoot(t).render(f.jsx(R.StrictMode,{children:f.jsx(dk,{})}))}fk();export{u2 as $,uv as A,De as B,e2 as C,rr as D,Ck as E,pv as F,sC as G,lC as H,lt as I,BC as J,qc as K,Mi as L,FC as M,HC as N,Xk as O,xk as P,DC as Q,oC as R,kk as S,c2 as T,n2 as U,Ek as V,_k as W,I2 as X,Lr as Y,l2 as Z,Ve as _,bk as a,w2 as a$,a2 as a0,VS as a1,W2 as a2,hc as a3,Vp as a4,tg as a5,wv as a6,Ok as a7,Np as a8,M2 as a9,fc as aA,mC as aB,kv as aC,PS as aD,KC as aE,Pk as aF,$C as aG,MC as aH,mv as aI,IC as aJ,qk as aK,OC as aL,pa as aM,Hc as aN,Jk as aO,UC as aP,Tk as aQ,jk as aR,FS as aS,DS as aT,ba as aU,Wc as aV,x2 as aW,Qk as aX,zS as aY,YC as aZ,Nk as a_,Lk as aa,Ik as ab,at as ac,xv as ad,WC as ae,VC as af,Ea as ag,AC as ah,h1 as ai,uC as aj,Hk as ak,dC as al,D2 as am,z2 as an,F2 as ao,zc as ap,Eo as aq,L2 as ar,hC as as,fC as at,Lo as au,cC as av,B2 as aw,sS as ax,aS as ay,dc as az,eC as b,QC as b$,Yv as b0,qC as b1,Kk as b2,aC as b3,tC as b4,wi as b5,GC as b6,iC as b7,wC as b8,Gk as b9,TC as bA,xC as bB,Oi as bC,Qe as bD,ma as bE,lm as bF,U1 as bG,W1 as bH,Q1 as bI,V1 as bJ,q1 as bK,ht as bL,Y1 as bM,hp as bN,K1 as bO,Bc as bP,Vc as bQ,Pa as bR,nC as bS,Ev as bT,zC as bU,Mk as bV,CC as bW,EC as bX,iS as bY,Vk as bZ,RS as b_,rC as ba,Zx as bb,Xx as bc,gC as bd,Wx as be,X1 as bf,vC as bg,Kv as bh,Uo as bi,jC as bj,yC as bk,NC as bl,SC as bm,Yc as bn,Bx as bo,bC as bp,RC as bq,_C as br,kC as bs,PC as bt,I1 as bu,fp as bv,yk as bw,gk as bx,Z1 as by,LC as bz,Zk as c,Wk as c0,pC as c1,pk as c2,s1 as c3,Q2 as c4,zk as c5,dS as c6,$k as c7,Uk as c8,$2 as c9,Dk as ca,Fk as cb,A2 as cc,Ak as cd,Bk as ce,mk as cf,vk as cg,Fc as ch,W0 as ci,h2 as cj,p2 as ck,gc as cl,Pm as cm,Cm as cn,km as co,rn as cp,da as cq,fa as cr,ev as cs,ow as ct,T0 as cu,sw as cv,Jt as cw,P2 as cx,$e as d,he as e,R2 as f,N2 as g,Rk as h,$c as i,f as j,Sk as k,Ct as l,_a as m,Jc as n,Yk as o,V2 as p,Re as q,R as r,oS as s,xm as t,ir as u,sn as v,q2 as w,an as x,O2 as y,Vx as z};
|
|
91
|
+
`)}function KC(t,r,i="<model>"){const a={secret:r};return[{id:"curl",label:"curl",code:Zv(t,i,"openai-chat-completions",a)},{id:"openai",label:"OpenAI SDK",code:Xv(t,i,"openai-chat-completions",a)},{id:"anthropic",label:"Anthropic SDK",code:Jv(t,i,a)}]}function DS(t,r,i){const a=[{id:"curl",label:"curl",language:"shell",code:Zv(t,r,i)},{id:"openai-python",label:"Python",language:"python",code:MS(t,r,i)},{id:"openai-js",label:"JavaScript",language:"javascript",code:Xv(t,r,i)}];return i==="anthropic-messages"&&a.push({id:"anthropic",label:"Anthropic SDK",language:"javascript",code:Jv(t,r)}),a}function QC(t,r,i,a,u){const d=Yv(r,i),m=DS(t,d,a);return a==="openai-images"||m.push({id:"codex",label:"Codex",language:"toml",code:OS(t,u??"@preset/<your-preset>")},{id:"claude-code",label:"Claude Code",language:"shell",code:LS(t,d)},{id:"openai-compatible",label:"Cursor / OpenAI-compatible",language:"text",code:AS(t,d)}),m}function FS(){var r;const t=xv();return PS((r=t.data)==null?void 0:r.publicUrl,window.location.origin)}function zS(){const t=pv();return async r=>{await cv(r)?t("Copied"):t("Could not copy to the clipboard","danger")}}function GC(t,r,i){return{label:"Copy model id",onSelect:()=>void t(Yv(r,i))}}function YC({value:t,label:r}){const i=zS();return f.jsx(Uo,{label:r,size:"sm",className:"gc-copy-id",onClick:a=>{a.stopPropagation(),i(t)},children:f.jsx(lt.copy,{size:13})})}function Vp({className:t}){const r=bS(FS());return f.jsxs("div",{className:["gc-endpoint",t].filter(Boolean).join(" "),title:`OpenAI-compatible base URL: ${r}`,children:[f.jsx("span",{className:"gc-endpoint__label",children:"API"}),f.jsx("code",{className:"gc-endpoint__url",children:r}),f.jsx(zc,{iconOnly:!0,value:r,label:"Copy the gateway API URL",className:"gc-endpoint__copy"})]})}const eg="https://antseed.com/docs/gateway",$S=R.lazy(()=>Ve(()=>import("./Migrate-BD-0-NY-.js"),[]));function hc({to:t="overview",tagged:r,size:i=26}){const a=f.jsxs(f.Fragment,{children:[f.jsx(i2,{height:i,className:"gc-brand__full"}),f.jsx(o2,{size:26,className:"gc-brand__mark"}),f.jsx("span",{className:"gc-brand__tag",children:"Console"})]}),u=r?"gc-brand gc-brand--tagged":"gc-brand";return t===null?f.jsx("span",{className:u,children:a}):f.jsx("a",{className:u,href:Pa(t),onClick:Vc(t),"aria-label":"Antseed console home",children:a})}const pc="No authorized wallet: nobody can withdraw funds or claim ANTS rewards";function US(){const{me:t,workspace:r,setWorkspaceId:i}=ir(),{missingOperator:a,currentMissingOperator:u}=Ev(),d=u&&f.jsx("span",{className:"gc-attention",role:"img","aria-label":pc,title:pc});return t.workspaces.length<=1?f.jsxs("span",{className:"gc-ws",title:"Workspace","data-tour":"workspace",children:[f.jsx(lt.workspaces,{size:14}),f.jsx("span",{className:"gc-ws__name",children:r.name}),d]}):f.jsxs("label",{className:"gc-ws gc-ws--select","data-tour":"workspace",children:[f.jsx(lt.workspaces,{size:14}),f.jsx("select",{className:"gc-ws__select",value:r.id,onChange:m=>i(m.target.value),"aria-label":"Switch workspace",children:t.workspaces.map(({workspace:m,role:v})=>f.jsxs("option",{value:m.id,children:[m.name,v==="admin"?" (admin)":"",m.id!==r.id&&a.has(m.id)?" · no authorized wallet":""]},m.id))}),d,f.jsx(lt.down,{size:14,className:"gc-ws__chevron"})]})}function BS(t,r){return t!=="wallet"?null:r.currentMissingOperator?pc:r.withdrawable.count>0?`${r.withdrawable.count} channel${r.withdrawable.count===1?"":"s"} ready to withdraw`:null}function qp({current:t,onNavigate:r}){const{viewer:i}=ir(),a=Ev(),u=g2(i),d=[...new Set(u.map(m=>m.group))];return f.jsx("nav",{className:"gc-nav","aria-label":"Console",children:d.map(m=>f.jsxs("div",{className:"gc-nav__group",children:[f.jsx("div",{className:"gc-nav__heading",children:m}),u.filter(v=>v.group===m).map(v=>{const g=lt[v.id]??lt.overview;return f.jsxs("a",{href:Pa(v.id),"aria-current":v.id===t?"page":void 0,"data-tour":`nav-${v.id}`,className:v.id===t?"gc-nav__item gc-nav__item--on":"gc-nav__item",onClick:h=>{Vc(v.id)(h),r==null||r()},children:[f.jsx(g,{size:16}),f.jsx("span",{children:v.label}),(()=>{const h=BS(v.id,a);return h&&f.jsx("span",{className:"gc-attention gc-nav__attention",role:"img","aria-label":h,title:h})})()]},v.id)})]},m))})}const Kp={system:"System",dark:"Dark",light:"Light"},HS={system:"dark",dark:"light",light:"system"},WS={system:lt.monitor,dark:lt.moon,light:lt.sun};function tg(){const[t,r]=_2(),i=HS[t],a=WS[t];return f.jsx(Uo,{className:"gc-topbar__icon",label:`Color theme: ${Kp[t]}. Switch to ${Kp[i]}.`,onClick:()=>r(i),children:f.jsx(a,{size:16})})}function VS(){const t=rr();return async()=>{try{await he.auth.logout()}finally{t.clear(),an("login",{replace:!0})}}}function qS(t){var u;const r=t.trim().split(/\s+/).filter(Boolean),i=((u=r[0])==null?void 0:u[0])??"?",a=r.length>1?r[r.length-1][0]:"";return(i+a).toUpperCase()}function KS({onAccount:t,onTour:r,onSignOut:i}){const{me:a}=ir(),[u,d]=R.useState(!1),m=R.useRef(null),v=R.useRef(null);R.useEffect(()=>{var I,L;if(!u)return;const x=_=>{var M;(M=m.current)!=null&&M.contains(_.target)||d(!1)},C=_=>{var M;_.key==="Escape"&&(d(!1),(M=v.current)==null||M.focus())};return document.addEventListener("mousedown",x),document.addEventListener("keydown",C),(L=(I=m.current)==null?void 0:I.querySelector('[role="menuitem"]'))==null||L.focus(),()=>{document.removeEventListener("mousedown",x),document.removeEventListener("keydown",C)}},[u]);const g=x=>()=>{d(!1),x()},h=Hc[a.member.orgRole],y=a.member.email?`${a.member.email} · ${h}`:h;return f.jsxs("div",{className:"gc-account",ref:m,"data-tour":"account",children:[f.jsx("button",{ref:v,type:"button",className:"gc-user","aria-haspopup":"menu","aria-expanded":u,"aria-label":`Your account: ${a.member.label}`,onClick:()=>d(x=>!x),children:f.jsx("span",{className:"gc-avatar","aria-hidden":"true",children:qS(a.member.label)})}),u&&f.jsxs("div",{className:"gc-account__menu",role:"menu","aria-label":"Account",children:[f.jsxs("div",{className:"gc-account__who",children:[f.jsx("div",{className:"gc-account__name",children:a.member.label}),f.jsx("div",{className:"gc-account__meta",children:y})]}),f.jsxs("button",{type:"button",role:"menuitem",className:"gc-account__item",onClick:g(t),children:[f.jsx(lt.shield,{size:15}),"Account and sign-in"]}),f.jsxs("button",{type:"button",role:"menuitem",className:"gc-account__item",onClick:g(r),children:[f.jsx(lt.compass,{size:15}),"Take the tour"]}),f.jsxs("a",{role:"menuitem",className:"gc-account__item",href:eg,target:"_blank",rel:"noreferrer",onClick:()=>d(!1),children:[f.jsx(lt.external,{size:15}),"Documentation"]}),f.jsx("div",{className:"gc-account__sep"}),f.jsxs("button",{type:"button",role:"menuitem",className:"gc-account__item",onClick:g(i),children:[f.jsx(lt.logout,{size:15}),"Sign out"]})]})]})}function QS({page:t,children:r}){const[i,a]=R.useState(!1),[u,d]=R.useState(()=>new URLSearchParams(window.location.search).get("account")==="1"),m=VS(),v=Wc().page==="migrate",g=v?null:t,{me:h,viewer:y}=ir();return R.useEffect(()=>{if(v||Ox(h.member.id))return;const x=window.setTimeout(()=>zp(y,h.member.id),600);return()=>window.clearTimeout(x)},[h.member.id]),f.jsxs(f.Fragment,{children:[f.jsxs("div",{className:"gc-app","data-page":g??void 0,children:[f.jsx("a",{className:"gc-skip",href:"#gc-main",children:"Skip to content"}),f.jsxs("header",{className:"gc-topbar",children:[f.jsxs("div",{className:"gc-topbar__inner",children:[f.jsx(Uo,{label:"Open menu",className:"gc-topbar__menu gc-topbar__icon",onClick:()=>a(!0),children:f.jsx(lt.menu,{size:16})}),f.jsx(hc,{}),f.jsx("span",{className:"gc-topbar__sep","aria-hidden":"true",children:"/"}),f.jsx(US,{}),f.jsx("div",{className:"gc-topbar__spacer"}),f.jsx(Vp,{className:"gc-endpoint--inline"}),f.jsx("a",{className:"gc-topbar__link",href:eg,target:"_blank",rel:"noreferrer",children:"Docs"}),f.jsx(tg,{}),f.jsx(KS,{onAccount:()=>d(!0),onTour:()=>zp(y,h.member.id),onSignOut:()=>void m()})]}),f.jsx("div",{className:"gc-topbar__strip",children:f.jsx(Vp,{})})]}),f.jsxs("div",{className:"gc-body",children:[f.jsxs("aside",{className:"gc-rail",children:[f.jsx(qp,{current:g}),f.jsx(yS,{})]}),f.jsx("main",{id:"gc-main",className:"gc-main",tabIndex:-1,children:v?f.jsx(R.Suspense,{fallback:f.jsx(Mi,{rows:6}),children:f.jsx($S,{})}):f.jsxs(f.Fragment,{children:[f.jsx(_S,{}),r]})})]})]}),f.jsx(n2,{isOpen:i,onClose:()=>a(!1),side:"left",title:f.jsx(hc,{to:null}),className:"gc-mobile-nav",children:f.jsx(qp,{current:g,onNavigate:()=>a(!1)})}),f.jsx(dS,{isOpen:u,onClose:()=>d(!1)})]})}const GS=R.lazy(()=>Ve(()=>import("./WalletSignIn-DLX6sQbD.js"),__vite__mapDeps([0,1,2,3,4,5]))),Qp={not_invited:"This account has not been invited to this console. Ask an admin for an invite link.",invite_expired:"This invite link has expired. Ask an admin for a new one.",invite_used:"This invite link was already used. Sign in instead.",invalid_token:"This link is not valid. Check that you copied all of it.",setup_complete:"This console is already set up. Sign in instead.",member_disabled:"Your access to this console has been turned off.",unknown_credential:"This passkey or wallet is not registered here.",key_revoked:"This API key has been revoked.",invalid_key:"That API key is not valid.",rate_limited:"Too many attempts. Wait a minute and try again.",key_expired:"This API key has expired.",not_linked:"This account is not linked to a member yet. Sign in another way and link it from your profile, or use your invite link.",invalid_enrollment:"This sign-up link has expired. Open your invite link again, or ask for a new one.",unauthenticated:"Sign in first.",oidc_denied:"Single sign-on was cancelled.",oidc_state:"The single sign-on attempt expired. Try again.",oidc_failed:"Single sign-on could not be verified. Try again, or use another sign-in method.",oidc_unavailable:"The single sign-on provider could not be reached. Try again later.",reauth_required:"Linking a sign-in provider needs a fresh sign-in. Go back to the console, confirm it is you under Your sign-in methods, then link it again.",access_reauth_required:"Your Cloudflare Access sign-in is more than 5 minutes old. Sign out of Cloudflare Access, sign in again, then link the provider again.",credential_exists:"This single sign-on account is already linked to another member."},YS=new Set(["reauth_required","access_reauth_required","credential_exists"]);function ng(t){return Object.hasOwn(Qp,t)?Qp[t]:void 0}function td(t){return Lr(t)&&ng(t.code)||Ea(t)}function mc({title:t,subtitle:r,children:i}){return f.jsxs("div",{className:"gc-auth",children:[f.jsx("div",{className:"gc-auth__theme",children:f.jsx(tg,{})}),f.jsx("div",{className:"gc-auth__logo",children:f.jsx(hc,{to:null,tagged:!0,size:30})}),f.jsxs(Cc,{className:"gc-auth__card",children:[f.jsx("h1",{className:"gc-auth__title",children:t}),r&&f.jsx("p",{className:"gc-auth__subtitle",children:r}),i]}),f.jsx("p",{className:"gc-auth__foot",children:"Self-hosted Antseed gateway"})]})}function rg(){const t=rr();return r=>{t.setQueryData(Re.me,r),an(r.kind==="key"?"key":"overview",{replace:!0})}}function Gp({label:t,run:r,primary:i}){const[a,u]=R.useState(!1),[d,m]=R.useState(null),v=Bo();return f.jsxs("div",{className:"gc-stack gc-stack--tight",children:[f.jsx(De,{fullWidth:!0,variant:i?"primary":"outline",disabled:a||!v,onClick:async()=>{u(!0),m(null);try{await r()}catch(g){m(fc(g)?dc:td(g))}finally{u(!1)}},children:a?"Waiting for your passkey…":t}),!v&&f.jsx("p",{className:"gc-fineprint",children:"This browser does not support passkeys."}),d&&f.jsx(at,{tone:"danger",children:d})]})}function ZS({enrollment:t,onSignedIn:r}){const[i,a]=R.useState(!1);return i?f.jsx(R.Suspense,{fallback:f.jsx(De,{variant:"outline",fullWidth:!0,disabled:!0,children:"Loading wallets…"}),children:f.jsx(GS,{enrollment:t,onSignedIn:r,autoConnect:!0})}):f.jsx(De,{variant:"outline",fullWidth:!0,onClick:()=>a(!0),children:"Sign in with a wallet"})}function XS(){return f.jsx("div",{className:"gc-divider",children:f.jsx("span",{children:"or"})})}function JS({onSignedIn:t}){const[r,i]=R.useState(""),[a,u]=R.useState(!1),[d,m]=R.useState(null);return f.jsxs("form",{className:"gc-stack gc-stack--tight",onSubmit:async v=>{v.preventDefault(),u(!0),m(null);try{t(await he.auth.apiKey(r.trim()))}catch(g){m(td(g))}finally{u(!1)}},children:[f.jsx(c2,{label:"API key",type:"password",autoComplete:"off",placeholder:"Paste your key to see its usage",value:r,onChange:v=>i(v.target.value)}),f.jsx(De,{type:"submit",variant:"outline",fullWidth:!0,disabled:a||!r.trim(),children:a?"Checking…":"View key usage"}),d&&f.jsx(at,{tone:"danger",children:d})]})}function ek({mode:t,enrollment:r,onSignedIn:i}){return t==="login"?f.jsx(Gp,{primary:!0,label:"Sign in with a passkey",run:async()=>{const a=await he.auth.passkeyLoginOptions(),u=await qv({optionsJSON:a});i(await he.auth.passkeyLoginVerify(u))}}):f.jsx(Gp,{primary:!0,label:"Create a passkey",run:async()=>{const a=await he.auth.passkeyRegisterOptions(r),u=await Vv({optionsJSON:a});i(await he.auth.passkeyRegisterVerify(u,r))}})}function ig({config:t,enrollment:r,onSignedIn:i,mode:a}){const u=[];return t.passkey&&u.push(f.jsx(ek,{mode:a,enrollment:r,onSignedIn:i},"passkey")),t.wallet&&u.push(f.jsx(ZS,{enrollment:r,onSignedIn:i},"wallet")),t.oidc&&u.push(f.jsxs(De,{variant:"outline",fullWidth:!0,href:he.auth.oidcStartUrl(r),children:["Continue with ",t.oidc.label]},"oidc")),u.length===0?f.jsx(at,{tone:"warning",children:"No sign-in method is enabled on this gateway. Check the gateway's console auth settings."}):f.jsx("div",{className:"gc-stack",children:u})}function tk(){const t=Kc(),r=rg(),i=new URLSearchParams(window.location.search).get("error");return f.jsxs(mc,{title:"Sign in",subtitle:"Manage keys, budgets, routing and funding for this gateway.",children:[i&&f.jsx(at,{tone:"danger",action:YS.has(i)?f.jsx(De,{size:"sm",variant:"outline",onClick:()=>an("overview?account=1",{replace:!0}),children:"Back to the console"}):void 0,children:ng(i)??"Sign-in did not complete. Try again."}),t.isLoading&&f.jsxs("div",{className:"gc-stack",children:[f.jsx(Mo,{height:34}),f.jsx(Mo,{height:34})]}),t.error?f.jsx(at,{tone:"danger",title:"Could not reach the gateway",children:Ea(t.error)}):null,t.data&&f.jsxs("div",{className:"gc-stack",children:[t.data.setupRequired&&f.jsxs(at,{tone:"info",title:"Not set up yet",children:["Get a one-time setup link by running ",f.jsx("code",{children:"antseed gateway console-link"})," on the gateway, or ask the operator for it."]}),f.jsx(ig,{config:t.data,mode:"login",onSignedIn:r}),t.data.cloudflareAccess&&f.jsx("p",{className:"gc-fineprint",children:"This gateway also accepts Cloudflare Access. If you signed in there, reload this page."}),t.data.apiKeyLogin&&f.jsxs(f.Fragment,{children:[f.jsx(XS,{}),f.jsx(JS,{onSignedIn:r})]})]})]})}function nk({kind:t}){const[r,i]=R.useState(()=>window.location.hash.replace(/^#/,""));R.useEffect(()=>{const v=()=>{const g=window.location.hash.replace(/^#/,"");g&&(i(g),window.history.replaceState(null,"",window.location.pathname))};return v(),window.addEventListener("hashchange",v),()=>window.removeEventListener("hashchange",v)},[]);const a=rg(),u=Kc(),d=$e({queryKey:["enrollment",t,r],queryFn:()=>t==="setup"?he.auth.setup(r):t==="recover"?he.request("POST","/auth/recover",{body:{token:r}}):he.auth.invite(r),enabled:r!=="",retry:!1,staleTime:1/0}),m=t==="setup"?"Set up your Antseed console":t==="recover"?"Add a sign-in method":"You are invited";return r?f.jsxs(mc,{title:m,subtitle:d.data?t==="recover"?f.jsxs(f.Fragment,{children:["Welcome back, ",f.jsx("strong",{children:d.data.label}),". Add a passkey, wallet or single sign-on to sign in on this address."]}):f.jsxs(f.Fragment,{children:["Welcome, ",f.jsx("strong",{children:d.data.label}),". You will join as ",Hc[d.data.orgRole].toLowerCase(),". Choose how you sign in."]}):"Checking your link…",children:[(d.isLoading||u.isLoading)&&f.jsxs("div",{className:"gc-stack",children:[f.jsx(Mo,{height:34}),f.jsx(Mo,{height:34})]}),d.error?f.jsxs("div",{className:"gc-stack",children:[f.jsx(at,{tone:"danger",children:td(d.error)}),f.jsx(De,{variant:"ghost",onClick:()=>an("login"),children:"Go to sign in"})]}):null,d.data&&u.data&&f.jsxs("div",{className:"gc-stack",children:[f.jsx(ig,{config:u.data,mode:"enroll",enrollment:d.data.enrollment,onSignedIn:a}),f.jsx("p",{className:"gc-fineprint",children:"A passkey uses your device's screen lock or a security key. Nothing to remember."})]})]}):f.jsxs(mc,{title:m,children:[f.jsx(at,{tone:"danger",children:"This link is missing its token. Open the full link you were given."}),f.jsx(De,{variant:"ghost",onClick:()=>an("login"),children:"Go to sign in"})]})}const rk={overview:R.lazy(()=>Ve(()=>import("./Overview-37mja3y-.js"),__vite__mapDeps([8,9,10,11,12,13]))),chat:R.lazy(()=>Ve(()=>import("./mermaid-MCJ5UELQ-DTUKqcxP.js").then(t=>t.C),__vite__mapDeps([14,2,3,15]))),activity:R.lazy(()=>Ve(()=>import("./Activity-BHckTctH.js"),__vite__mapDeps([16,9,10,11,12,13,17,18,3]))),logs:R.lazy(()=>Ve(()=>import("./Logs-DV-trPqy.js"),__vite__mapDeps([19,20,21,10,18,3,22,17]))),keys:R.lazy(()=>Ve(()=>import("./Keys-Cxz0K09V.js"),__vite__mapDeps([23,24,25,17,12,13,26,27,28,29,22,10,18,3,11]))),members:R.lazy(()=>Ve(()=>import("./Members-Cp_3A-Dy.js"),__vite__mapDeps([30,24,25,17,12,13,26,27,29,18,3]))),workspaces:R.lazy(()=>Ve(()=>import("./Workspaces-DZmGjFFI.js"),__vite__mapDeps([31,24,25,17,12,13,26,27,29,18,3]))),wallet:R.lazy(()=>Ve(()=>import("./Wallet-BbwYd9fm.js"),__vite__mapDeps([32,33,4,34,27,18,3,26]))),rewards:R.lazy(()=>Ve(()=>import("./Rewards-CuWsg5m7.js"),__vite__mapDeps([35,33,36,18,3]))),providers:R.lazy(()=>Ve(()=>import("./Providers-sZFgSVHV.js"),__vite__mapDeps([37,25,17,12,13,26,27,18,3,38,36,39,24,40,28]))),models:R.lazy(()=>Ve(()=>import("./Models-DHeLeAiN.js"),__vite__mapDeps([41,28,13,38,17,26,18,3]))),routing:R.lazy(()=>Ve(()=>import("./Routing-BebcQMko.js"),__vite__mapDeps([42,24,25,17,12,13,26,27,18,3,28]))),presets:R.lazy(()=>Ve(()=>import("./Presets-CgfFG3fw.js"),__vite__mapDeps([39,24,25,17,12,13,26,27,18,3,40]))),audit:R.lazy(()=>Ve(()=>import("./Audit-CheQE0ki.js"),__vite__mapDeps([43,21,17,18,3]))),settings:R.lazy(()=>Ve(()=>import("./Settings-BLIkiFNw.js"),__vite__mapDeps([44,25,17,12,13,26,27,40,28,18,3])))},ik=R.lazy(()=>Ve(()=>import("./KeyHolder-CG5sSLQK.js"),__vite__mapDeps([45,20,21,10,18,3,11]))),ok=new z1({defaultOptions:{queries:{staleTime:1e4,refetchOnWindowFocus:!1,retry:(t,r)=>!(Lr(r)&&r.status>=400&&r.status<500)&&t<2}}});class sk extends R.Component{constructor(){super(...arguments);wu(this,"state",{failed:!1})}static getDerivedStateFromError(i){return{failed:!0,error:i}}render(){return this.state.failed?f.jsx(Jc,{error:this.state.error,title:"This page failed to load",onRetry:()=>this.setState({failed:!1,error:void 0})}):this.props.children}}function ak(t){return Uc.some(r=>r.id===t)}function lk({me:t,page:r}){const[i,a]=R.useState(()=>{var C;return((C=Tp(t,k2()))==null?void 0:C.id)??null}),u=Tp(t,i),d=rr(),m=Wc(),v=S2(m.page,m.rest);R.useEffect(()=>{v&&an(v,{replace:!0})},[v]);const g=R.useMemo(()=>{if(!u)return null;const C=y2({me:t},u.id);return{me:t,workspace:u,workspaceRole:C.workspaceRole,viewer:C,setWorkspaceId:I=>{C2(I),a(I),d.invalidateQueries()}}},[t,u,d]);if(v)return f.jsx("div",{className:"gc-centered",children:f.jsx(Mi,{rows:3})});if(!g)return f.jsx("div",{className:"gc-centered",children:f.jsx(at,{tone:"warning",title:"No workspace",children:"You are not a member of any workspace yet. Ask an admin to add you."})});const h=ak(r)?r:"overview",y=Bc(h,g.viewer),x=rk[h];return f.jsx(vv.Provider,{value:g,children:f.jsx(QS,{page:h,children:f.jsx(sk,{children:f.jsx(R.Suspense,{fallback:f.jsx(Mi,{rows:6}),children:y?f.jsx(x,{}):f.jsx(at,{tone:"warning",title:"Not available",children:"Your role cannot open this page."})})},m.page)})})}function uk({page:t}){const r=W2(),i=Lr(r.error)&&r.error.status===401;return R.useEffect(()=>{i&&an("login",{replace:!0})},[i]),r.isLoading||i?f.jsx("div",{className:"gc-centered",children:f.jsx(Mi,{rows:3})}):r.error?f.jsxs("div",{className:"gc-centered gc-stack",children:[f.jsx(Jc,{error:r.error,title:"Could not open the console",onRetry:()=>void r.refetch()}),f.jsx(De,{variant:"ghost",onClick:()=>an("login"),children:"Go to sign in"})]}):r.data?r.data.kind==="key"?f.jsx(R.Suspense,{fallback:f.jsx(Mi,{rows:6}),children:f.jsx(ik,{})}):f.jsx(lk,{me:r.data.me,page:t}):null}function ck(){const t=Wc();return t.page==="login"?f.jsx(tk,{}):t.page==="setup"||t.page==="invite"||t.page==="recover"?f.jsx(nk,{kind:t.page}):f.jsx(uk,{page:t.page})}function dk(){return f.jsx($1,{client:ok,children:f.jsx(f2,{children:f.jsx(ck,{})})})}E2();async function fk(){const t=document.getElementById("root");if(!t)throw new Error("#root element is missing");m1.createRoot(t).render(f.jsx(R.StrictMode,{children:f.jsx(dk,{})}))}fk();export{u2 as $,uv as A,De as B,e2 as C,rr as D,Ck as E,pv as F,sC as G,lC as H,lt as I,BC as J,qc as K,Mi as L,FC as M,HC as N,Xk as O,xk as P,DC as Q,oC as R,kk as S,c2 as T,n2 as U,Ek as V,_k as W,I2 as X,Lr as Y,l2 as Z,Ve as _,bk as a,w2 as a$,a2 as a0,VS as a1,W2 as a2,hc as a3,Vp as a4,tg as a5,wv as a6,Ok as a7,Np as a8,M2 as a9,fc as aA,mC as aB,kv as aC,PS as aD,KC as aE,Pk as aF,$C as aG,MC as aH,mv as aI,IC as aJ,qk as aK,OC as aL,pa as aM,Hc as aN,Jk as aO,UC as aP,Tk as aQ,jk as aR,FS as aS,DS as aT,ba as aU,Wc as aV,x2 as aW,Qk as aX,zS as aY,YC as aZ,Nk as a_,Lk as aa,Ik as ab,at as ac,xv as ad,WC as ae,VC as af,Ea as ag,AC as ah,h1 as ai,uC as aj,Hk as ak,dC as al,D2 as am,z2 as an,F2 as ao,zc as ap,Eo as aq,L2 as ar,hC as as,fC as at,Lo as au,cC as av,B2 as aw,sS as ax,aS as ay,dc as az,eC as b,QC as b$,Yv as b0,qC as b1,Kk as b2,aC as b3,tC as b4,wi as b5,GC as b6,iC as b7,wC as b8,Gk as b9,TC as bA,xC as bB,Oi as bC,Qe as bD,ma as bE,lm as bF,U1 as bG,W1 as bH,Q1 as bI,V1 as bJ,q1 as bK,ht as bL,Y1 as bM,hp as bN,K1 as bO,Bc as bP,Vc as bQ,Pa as bR,nC as bS,Ev as bT,zC as bU,Mk as bV,CC as bW,EC as bX,iS as bY,Vk as bZ,RS as b_,rC as ba,Zx as bb,Xx as bc,gC as bd,Wx as be,X1 as bf,vC as bg,Kv as bh,Uo as bi,jC as bj,yC as bk,NC as bl,SC as bm,Yc as bn,Bx as bo,bC as bp,RC as bq,_C as br,kC as bs,PC as bt,I1 as bu,fp as bv,yk as bw,gk as bx,Z1 as by,LC as bz,Zk as c,Wk as c0,pC as c1,pk as c2,s1 as c3,Q2 as c4,zk as c5,dS as c6,$k as c7,Uk as c8,$2 as c9,Dk as ca,Fk as cb,A2 as cc,Ak as cd,Bk as ce,mk as cf,vk as cg,Fc as ch,W0 as ci,h2 as cj,p2 as ck,gc as cl,Pm as cm,Cm as cn,km as co,rn as cp,da as cq,fa as cr,ev as cs,ow as ct,T0 as cu,sw as cv,Jt as cw,P2 as cx,$e as d,he as e,R2 as f,N2 as g,Rk as h,$c as i,f as j,Sk as k,Ct as l,_a as m,Jc as n,Yk as o,V2 as p,Re as q,R as r,oS as s,xm as t,ir as u,sn as v,q2 as w,an as x,O2 as y,Vx as z};
|