@soba-so/react 0.0.24 → 0.0.25
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/index.mjs +121 -8
- package/dist/styles.css +113 -0
- package/package.json +9 -8
package/dist/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use client"
|
|
2
|
-
var jt={ready:{arc:!0},serving:{arc:!0,slot:"stream"},paused:{arc:!1,slot:"zzz"},thinking:{arc:!1,slot:"dots"},connecting:{arc:!1,slot:"orbit"},attention:{arc:!1,slot:"bang"},gone:{arc:!1,slot:"cross"},snap:{arc:!1,slot:"snap"},listening:{arc:!1,slot:"bars"},permission:{arc:!1,slot:"ring"},ai:{arc:!1,slot:"sparks"}};var qt="105 162 420 420",Zt="M407.1 308.9 A158 158 0 1 0 407.1 491.1 A116 116 0 0 1 407.1 308.9 Z",dn="M448.5 320 A110 110 0 0 1 448.5 480";import{Fragment as jn,jsx as R,jsxs as qe}from"react/jsx-runtime";function je({kind:e,size:n=44,className:t}){let r=jt[e];return qe("svg",{className:`bx${t?` ${t}`:""}`,"data-expression":e,viewBox:qt,overflow:"visible",width:n,height:n,"aria-hidden":"true",children:[R("path",{d:Zt,fill:"currentColor"}),R("path",{className:"bx-arc",d:dn,fill:"none",stroke:"currentColor",strokeWidth:17,strokeLinecap:"round"}),r.slot==="stream"&&R(vo,{}),r.slot==="zzz"&&R(ko,{}),r.slot==="dots"&&R(No,{}),r.slot==="bang"&&R(xo,{}),r.slot==="orbit"&&R(Mo,{}),r.slot==="cross"&&R(So,{}),r.slot==="snap"&&R(Po,{}),r.slot==="bars"&&R(Ro,{}),r.slot==="ring"&&R(Eo,{}),r.slot==="sparks"&&R(Io,{})]})}function vo(){return R("path",{className:"bx-st",d:"M475.3 290.3 A150 150 0 0 1 475.3 509.7",fill:"none",stroke:"currentColor",strokeWidth:"15",strokeLinecap:"round",strokeDasharray:"0.1 31"})}function ko(){return qe(jn,{children:[R("g",{className:"bx-z1",children:R("path",{d:"M444 372 H496 L444 436 H496",fill:"none",stroke:"currentColor",strokeWidth:"20",strokeLinecap:"round",strokeLinejoin:"round"})}),R("g",{className:"bx-z2",children:R("path",{d:"M492 300 H522 L492 338 H522",fill:"none",stroke:"currentColor",strokeWidth:"15",strokeLinecap:"round",strokeLinejoin:"round"})})]})}function No(){return qe(jn,{children:[R("circle",{className:"bx-th",cx:"463.1",cy:"336.9",r:"21",fill:"currentColor"}),R("circle",{className:"bx-th bx-th2",cx:"483",cy:"400",r:"21",fill:"currentColor"}),R("circle",{className:"bx-th bx-th3",cx:"463.1",cy:"463.1",r:"21",fill:"currentColor"})]})}function xo(){return qe("g",{className:"bx-at",children:[R("line",{x1:"490",y1:"312",x2:"490",y2:"414",stroke:"currentColor",strokeWidth:"46",strokeLinecap:"round"}),R("circle",{cx:"490",cy:"484",r:"28",fill:"currentColor"})]})}function Mo(){return qe("g",{className:"bx-ob",children:[R("path",{d:dn,fill:"none",stroke:"var(--tile-bg, transparent)",strokeWidth:41,strokeLinecap:"round"}),R("path",{d:dn,fill:"none",stroke:"currentColor",strokeWidth:17,strokeLinecap:"round"})]})}function So(){return qe(jn,{children:[R("path",{className:"bx-xa",d:dn,fill:"none",stroke:"currentColor",strokeWidth:17,strokeLinecap:"round"}),R("g",{className:"bx-xx",children:R("path",{d:"M442 364 L514 436 M514 364 L442 436",fill:"none",stroke:"currentColor",strokeWidth:"24",strokeLinecap:"round"})})]})}function Po(){return R("path",{className:"bx-snap",d:dn,fill:"none",stroke:"currentColor",strokeWidth:17,strokeLinecap:"round"})}function Ro(){return qe("g",{stroke:"currentColor",strokeWidth:"17",strokeLinecap:"round",children:[R("line",{className:"bx-vb",x1:"452",y1:"370",x2:"452",y2:"430"}),R("line",{className:"bx-vb bx-vb2",x1:"482",y1:"330",x2:"482",y2:"470"}),R("line",{className:"bx-vb bx-vb3",x1:"512",y1:"355",x2:"512",y2:"445"})]})}function Eo(){return R(jn,{children:[[450,366],[474,376],[484,400],[474,424],[450,434],[426,424],[416,400],[426,376]].map(([n,t],r)=>R("circle",{className:"bx-w",cx:n,cy:t,r:"11",fill:"currentColor",style:{animationDelay:`${-1.2+r*.15}s`}},r))})}function Io(){return qe(jn,{children:[R("g",{className:"bx-sp",children:R("path",{d:"M460 300 Q465.4 324.6 490 330 Q465.4 335.4 460 360 Q454.6 335.4 430 330 Q454.6 324.6 460 300 Z",fill:"currentColor"})}),R("g",{className:"bx-sp bx-sp2",children:R("path",{d:"M486 356 Q493.92 392.08 530 400 Q493.92 407.92 486 444 Q478.08 407.92 442 400 Q478.08 392.08 486 356 Z",fill:"currentColor"})}),R("g",{className:"bx-sp bx-sp3",children:R("path",{d:"M460 440 Q465.4 464.6 490 470 Q465.4 475.4 460 500 Q454.6 475.4 430 470 Q454.6 464.6 460 440 Z",fill:"currentColor"})})]})}var Oo={"claude-code":{small:"haiku",large:"opus"}};function Nt(e){let n=Oo[e];return!!(n?.small||n?.large)}import{useEffect as Zo,useRef as Xo,useState as Et}from"react";var Pn=class extends Error{status;constructor(n,t){super(n),this.name="ConnectError",this.status=t}},Lo=5*6e4,qn=class{session;baseUrl;doFetch;lastMachines=null;machinesUrl=null;gatewayBackUntil=0;constructor(n){this.session=n.session,this.baseUrl=(n.baseUrl??"").replace(/\/+$/,""),this.doFetch=n.fetchImpl??fetch.bind(globalThis)}async context(){let n=await this.request("GET","/v1/connect");return this.setMachinesUrl(n.machines_url),n}setMachinesUrl(n){typeof n=="string"&&/^https?:\/\//.test(n)&&(this.machinesUrl=n)}async machines(){let n=this.lastMachines,t=n?`?v=${encodeURIComponent(n.version)}`:"",r;if(this.machinesUrl&&Date.now()>=this.gatewayBackUntil)try{r=await this.request("GET",`${this.machinesUrl}${t}`)}catch(o){if(o instanceof Pn&&o.status===401)throw o;this.gatewayBackUntil=Date.now()+Lo}if(r??=await this.request("GET",`/v1/machines${t}`),r.unchanged&&n)return n.machines;let s=Array.isArray(r.machines)?r.machines:[];return this.lastMachines=typeof r.version=="string"?{version:r.version,machines:s}:null,s}async runs(){let n=await this.request("GET","/v1/machines/runs");return Array.isArray(n.runs)?n.runs:[]}async stopRun(n){let t=this.machinesUrl?.replace(/\/v1\/machines$/,"");if(!t)throw new Pn("This page can't stop runs yet: it hasn't been told where Soba's gateway is.",501);await this.request("POST",`${t}/v1/runs/${encodeURIComponent(n)}/stop`,{})}lookup(n){return this.request("GET",`/v1/device/lookup?code=${encodeURIComponent(n)}`)}approve(n){return this.request("POST","/v1/device/approve",{user_code:n})}claim(n){return this.request("POST","/v1/device/claim",{pairing_nonce:n})}deny(n){return this.request("POST","/v1/device/deny",{user_code:n})}plans(){return this.request("GET","/v1/plans")}selectPlan(n){return this.request("POST","/v1/plans/select",{plan:n})}checkoutPlan(n,t){return this.request("POST","/v1/plans/checkout",{plan:n,...t?.successUrl?{success_url:t.successUrl}:{},...t?.cancelUrl?{cancel_url:t.cancelUrl}:{}})}leavePlan(){return this.request("DELETE","/v1/plans/select")}hosted(){return this.request("GET","/v1/hosted")}startHosted(){return this.request("POST","/v1/hosted/start")}disconnectHosted(n){return this.request("DELETE",n?`/v1/hosted?provider=${encodeURIComponent(n)}`:"/v1/hosted")}approveRuntime(n,t){return this.request("POST","/v1/runtimes/approve",{machine_id:n,runtime_id:t})}preferRuntime(n,t){return this.request("POST","/v1/runtimes/prefer",{machine_id:n,runtime_id:t})}async request(n,t,r){let s=await this.doFetch(/^https?:\/\//.test(t)?t:`${this.baseUrl}${t}`,{method:n,headers:{authorization:`Bearer ${this.session}`,...r?{"content-type":"application/json"}:{}},...r?{body:JSON.stringify(r)}:{}}),o={};try{o=await s.json()}catch{}if(!s.ok){let a=typeof o.error=="string"?o.error:`Request failed (${s.status})`;throw new Pn(a,s.status)}return o}};function Zn(e){let n=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!n?.[1])return"#ffffff";let t=n[1].length===3?[...n[1]].map(o=>o+o).join(""):n[1],r=o=>{let a=Number.parseInt(t.slice(o*2,o*2+2),16)/255;return a<=.04045?a/12.92:((a+.055)/1.055)**2.4};return .2126*r(0)+.7152*r(1)+.0722*r(2)>.45?"#101012":"#ffffff"}function Xt(e){let n=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!n?.[1])return null;let t=n[1].length===3?[...n[1]].map(r=>r+r).join(""):n[1];return[0,1,2].map(r=>Number.parseInt(t.slice(r*2,r*2+2),16))}function Sn(e,n,t){let r=Xt(e),s=Xt(n);return!r||!s?e:`#${r.map((a,l)=>Math.round(a+(s[l]-a)*t)).map(a=>a.toString(16).padStart(2,"0")).join("")}`}function pn(e,n){if(!Xt(e))return{};let t=Zn(e),r=n?.trim();return{"--sc-ground":e,"--sc-shell":e,"--sc-sheet":Sn(e,t,.07),"--sc-raised":Sn(e,t,.13),"--sc-line":Sn(e,t,.18),"--sc-line-2":Sn(e,t,.28),"--sc-text":t,"--sc-text-2":Sn(t,e,.15),"--sc-muted":Sn(t,e,.38),...r?{"--sc-accent":r,"--sc-accent-fg":Zn(r)}:{"--sc-accent":t,"--sc-accent-fg":e}}}function We(e){return e.authenticated===!0?{tone:"ok",text:"signed in"}:e.authenticated===!1?{tone:"warn",text:e.auth_hint??"signed out on that machine"}:{tone:"unknown",text:"could not tell"}}function Xn(e){let{platform:n,arch:t}=e;if(!n)return null;let r=n==="darwin"||n==="macos",s=r?"Mac":n==="win32"||n==="windows"?"Windows PC":"Linux machine";return r?`${t==="aarch64"||t==="arm64"?"Apple silicon ":""}${s}`:s}function mn(e){return e.find(n=>n.state==="offline")??null}function Kt(e){return e.state==="busy"?{tone:"busy",text:`serving ${e.active} of ${e.capacity}`}:e.state==="online"?{tone:"ok",text:"connected"}:{tone:"off",text:"asleep or offline"}}function j(e){let n=e.label?.trim(),t=e.name?.trim();return n&&(!t||n!==t)?n:(t??n??"").replace(/\.(local|lan|home|internal)$/i,"").replace(/[-_]+/g," ").trim()||n||"This machine"}function xt(e,n){let t=s=>s.state==="busy"?0:s.state==="online"?1:2,r=s=>s.last_seen_at?Date.parse(s.last_seen_at):0;return t(e)-t(n)||r(n)-r(e)}function He(e){return[...e].sort(xt)[0]??null}function hn(e){return e?e.state==="busy"?{tone:"busy",word:"Serving"}:e.state==="online"?{tone:"ok",word:"Connected"}:e.pairing_lost?{tone:"off",word:"Not connected"}:{tone:"off",word:"Asleep"}:{tone:"off",word:"No compute"}}function Rn(e){let n=hn(e);return{label:e?n.word:"Connect compute",ariaLabel:e?e.pairing_lost?`${j(e)} is not connected`:`${n.word} on ${j(e)}`:"Connect compute",connected:e!==null,state:n}}function Ve(e){return e.state==="online"||e.state==="busy"}function Kn(e){if(!e)return"never seen";let n=Date.parse(e);if(Number.isNaN(n))return"never seen";let t=Date.now()-n,r=6e4;return t<2*r?"just now":t<60*r?`${Math.floor(t/r)} min ago`:t<24*60*r?`${Math.floor(t/(60*r))} hr ago`:`${Math.floor(t/(24*60*r))} days ago`}function _t(e){return e.runtimes.filter(n=>n.id!=="shell")}function Ne(e){return e.runtimes.filter(n=>n.id!=="shell"&&!n.quarantined&&!n.absent)}function he(e){let n=a=>a?e.runtimes.find(l=>l.id===a)??null:null;if(e.requested_runtime)return{by:"app",runtimeId:e.requested_runtime,runtime:n(e.requested_runtime)};let t=Ne(e),r=t.find(a=>a.id===e.preferred_runtime);if(r)return{by:"you",runtimeId:r.id,runtime:r};let s=a=>a.id==="claude-code"?0:a.id==="codex"?1:2,o=[...t].sort((a,l)=>s(a)-s(l))[0]??null;return{by:"default",runtimeId:o?.id??null,runtime:o}}var $t="soba";function _n(){return`${$t}://show`}function $n(e,n,t){let r=`${$t}://connect?url=${encodeURIComponent(e)}`;return n&&(r+=`&nonce=${encodeURIComponent(n)}`),t&&(r+=`&want=${encodeURIComponent(t)}`),r}function et(){let e=globalThis.crypto;if(!e?.getRandomValues)return null;let n=e.getRandomValues(new Uint8Array(32)),t="";for(let r of n)t+=String.fromCharCode(r);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var To=1600;function er(e={}){return tr(e)}async function nr(e,n={}){if(typeof window>"u"||typeof document>"u")return"unknown";let t=tr(n);try{window.location.href=$n(e,n.nonce,n.want)}catch{return"absent"}return t}async function gn(e={}){if(typeof window>"u"||typeof document>"u")return"unknown";let n=tr(e);try{window.location.href=_n()}catch{return"absent"}return n}async function tr(e){if(typeof window>"u"||typeof document>"u")return"unknown";let n=e.graceMs??To,t=document.visibilityState==="visible"&&document.hasFocus(),r=!1,s=()=>{r=!0},o=()=>{document.visibilityState==="hidden"&&(r=!0)};return window.addEventListener("blur",s),window.addEventListener("pagehide",s),document.addEventListener("visibilitychange",o),await new Promise(a=>setTimeout(a,n)),window.removeEventListener("blur",s),window.removeEventListener("pagehide",s),document.removeEventListener("visibilitychange",o),t?r?"opened":"absent":"unknown"}var gs={"claude-code":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAARGVYSWZNTQAqAAAACAABh2kABAAAAAEAAAAaAAAAAAADoAEAAwAAAAEAAQAAoAIABAAAAAEAAABAoAMABAAAAAEAAABAAAAAAEZRQrAAAAHLaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA2LjAuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT4xPC9leGlmOkNvbG9yU3BhY2U+Ci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PTyfEThuJQXiR57UohES4hk6CT86NPg0ttlEi68SPQ19Jg+OUszwD1xSFYOM4FJh2MhDLbkM90Iwa4Sk6ub4Gwp+NYThrDsOISD4WGNKRNW+Tu6gaHxd1wUXaFFlQHMDSdgiHDyuAyyvKHmSiv/2oHbpROzC0wlv5HMEN/IKTy2aGOdWDyAOT8zJzBPMqcayXzD2PGmU2peR0hZT40CMeW4JvjFUmdhTAD9U3dsK/ATHYYo6Aa9i3D0sf9gaBxVDEFAc/kQbHvKoSuRObV/QgNkcwD5jARsuQIWyRUfHgHJWB64dFWAYnun9QnXGRshc1SRcdGGXBTYPyMyn3k5F7v/h8qtgDnL6/wjvBQNWPSchPg1GXgvCWeIr+GjXj44OIn2Oo2e4z7u9oJo1qTXeWuHGJXQ91vI+YW5NAQrbWT9czryZ/OB3LdmMDFUGiPQm85+OMP6Ul+i323zeItTiodoFLQBcWTXwGzxn0BijiYgzGcTQWguIgdoz8sWQSMR3A0hMCPb5owh4whw+YR7MJ6ktMo+EciiobYAFJqDE4zPhtDRKVwF5DSuQcnOKR2AP8Cui93e4Bz9uMXV0/FBGGZ/BaqmGMFGWMFNw7QyOZML4XaHNc3OnIDZkE7cOUzf5QfCGN8C6GkgqwSeXP8HIxHP4MmOI/a321n07gV9IjNBy7QnyZrED37ivv4/PQyO8w10e8KcphEWKSNuIPY8QfKrR4Ye+yCnB3kPeGZiJkLwBzq+EZK2GxGe7nRW12PSGeADM/EmtjG4qej4OQ90YuRN/rYcWzMU8ZPuWbyCHPgbYT3vQ4Pp0/OM7QYx6VGXgMbdGN/AVNIT3cAadkl50K7+QtmgFGBskwuuGBL+EfnaxNQFH3ihDqM12j6lTyyVn4H4E6hAx4NkYwy1G0DlAmsUN8ESX6/+H/GpiUBv4FSyLhydRRp0cAAAAASUVORK5CYII="};import{useEffect as fs,useRef as Bo}from"react";import{Fragment as Ho,jsx as xe,jsxs as rr}from"react/jsx-runtime";function nt({anchor:e,label:n,options:t,current:r,onClose:s,onPick:o}){let a=Bo(null);return fs(()=>{let i=a.current,c=e.current;if(!i||!c)return;try{typeof i.showPopover=="function"&&i.showPopover()}catch{}let u=c.getBoundingClientRect();u.width>i.offsetWidth&&(i.style.width=`${Math.round(u.width)}px`);let m=i.offsetWidth,A=i.offsetHeight,g=u.width>248?u.left:u.right-m,h=Math.max(8,Math.min(g,window.innerWidth-m-8)),y=u.bottom+6,S=y+A>window.innerHeight-8&&u.top-6-A>8?u.top-6-A:y;i.style.left=`${Math.round(h)}px`,i.style.top=`${Math.round(S)}px`,i.querySelector('[aria-checked="true"]')?.focus()},[e]),fs(()=>{let i=c=>{let u=c.target;!u||a.current?.contains(u)||e.current?.contains(u)||s()};return document.addEventListener("pointerdown",i,!0),()=>document.removeEventListener("pointerdown",i,!0)},[e,s]),xe("div",{ref:a,role:"menu","aria-label":n,className:"sc-menu",popover:"manual",onKeyDown:i=>{let c=[...a.current?.querySelectorAll("[role=menuitemradio]")??[]],u=c.indexOf(document.activeElement);if(i.key==="Escape")i.stopPropagation(),i.nativeEvent.stopImmediatePropagation(),s(),e.current?.focus();else if(i.key==="ArrowDown"||i.key==="ArrowUp"){i.preventDefault();let m=i.key==="ArrowDown"?1:-1;c[(u+m+c.length)%c.length]?.focus()}else i.key==="Tab"&&s()},children:t.map(i=>xe(Go,{option:i,checked:r===i.id,onClose:s,onPick:o},i.id??""))})}function Go({option:e,checked:n,onClose:t,onPick:r}){return rr(Ho,{children:[e.heading?xe("div",{className:"sc-menu-head",role:"presentation",children:e.heading}):e.rule?xe("div",{className:"sc-menu-sep"}):null,rr("button",{type:"button",role:"menuitemradio","aria-checked":n,className:"sc-menu-item",onClick:()=>{e.onChoose?(e.onChoose(),t()):n?t():r(e.id)},children:[e.glyph,rr("span",{className:"sc-menu-text",children:[xe("span",{className:"sc-menu-label",children:e.label}),e.note&&xe("span",{className:"sc-menu-note",children:e.note})]}),e.trailing?xe("span",{className:"sc-menu-act",children:e.trailing}):n&&xe(Wo,{})]})]})}function Wo(){return xe("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-menu-check",children:xe("path",{d:"M5 12.5l4.5 4.5L19 7.5",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function En({open:e}){return xe("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e?"sc-chev sc-chev-open":"sc-chev",children:xe("path",{d:"M9 6l6 6-6 6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}import{useRef as Uo,useState as Fo}from"react";var Do={haiku:"Haiku",sonnet:"Sonnet",opus:"Opus",fable:"Fable"};function fn(e){return Do[e]??e}function tt(e){let n=[...e].sort(xt),t=He([...e]),r=t?he(t):null,o=[{id:"auto",kind:"auto",label:"Automatic",model:"auto",...r?.runtime?{note:r.runtime.default_model?`Uses ${fn(r.runtime.default_model)}`:`Uses ${r.runtime.display_name}`}:{}}];n.some(u=>Ne(u).some(m=>Nt(m.id)))&&o.push({id:"small",kind:"size",label:"Fast",note:"quick and cheap",model:"small"},{id:"large",kind:"size",label:"Best",note:"the most capable",model:"large"});let l=new Map;for(let u of n)for(let m of Ne(u))for(let A of m.models){if(!A)continue;let g=`${m.id}/${A}`,h=l.get(g);if(h){h.machines.add(j(u));continue}l.set(g,{option:{id:g,kind:"named",label:fn(A),model:A,runtime:m.id,runtimeName:m.display_name,costClass:m.cost_class},machines:new Set([j(u)])})}let i=new Set;for(let{machines:u}of l.values())for(let m of u)i.add(m);let c=i.size>1;for(let{option:u,machines:m}of l.values()){let A=c&&m.size===1?[...m][0]:void 0;o.push(A?{...u,machine:A}:u)}return o}function rt(e){let n=[],t=[];for(let r of e){if(r.kind!=="named"){n.push(r);continue}let s=r.runtimeName??r.runtime??"",o=t.find(a=>a.heading===s);o?o.options.push(r):t.push({heading:s,options:[r]})}return n.length?[{heading:null,options:n},...t]:t}function sr(e,n){let t=e.find(s=>s.kind==="auto")??{id:"auto",kind:"auto",label:"Automatic",model:"auto"};if(!n||n==="auto")return{selected:t,unavailable:null};let r=e.find(s=>s.id===n);return r?{selected:r,unavailable:null}:{selected:t,unavailable:n}}function or(e){return e.runtime?{model:e.model,runtime:e.runtime}:{model:e.model}}function An(e){return e.length>1}import{jsx as Mt,jsxs as As}from"react/jsx-runtime";function st({options:e,selected:n,onPick:t,caption:r,disabled:s,className:o}){let[a,l]=Fo(!1),i=Uo(null);if(!An(e))return null;let c=o?`sc-mp ${o}`:"sc-mp";return As("span",{className:c,children:[r&&Mt("span",{className:"sc-mp-cap",children:r}),As("button",{ref:i,type:"button",className:"sc-mp-btn","aria-haspopup":"menu","aria-expanded":a,"aria-label":`Model: ${n.label}. Change`,disabled:s,onClick:()=>l(u=>!u),children:[Mt("span",{className:"sc-mp-label",children:n.label}),Mt(En,{open:!0})]}),a&&Mt(nt,{anchor:i,label:"Which model answers",options:Qo(e),current:n.id,onClose:()=>l(!1),onPick:u=>{l(!1),u&&t(u)}})]})}function Qo(e){let n=[];for(let t of rt(e))t.options.forEach((r,s)=>{let o=Vo(r);n.push({id:r.id,label:r.label,...o?{note:o}:{},...t.heading&&s===0?{heading:t.heading}:{},...!t.heading&&r.kind==="size"&&s===1?{rule:!0}:{}})});return n}function Vo(e){return e.kind!=="named"?e.note:e.machine?`on ${e.machine}`:void 0}import{jsx as Me,jsxs as Yo}from"react/jsx-runtime";function oe({className:e}){return Yo("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:[Me("path",{d:"M18.125 7.039A8.6 8.6 0 1 0 18.125 16.961A6 6 0 0 1 18.125 7.039Z",fill:"currentColor"}),Me("path",{d:"M19.925 7.039A8.6 8.6 0 0 1 19.925 16.961A6 6 0 0 0 19.925 7.039Z",fill:"currentColor"})]})}function bs({className:e}){return Me("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:Me("path",{fill:"currentColor",d:"M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z"})})}function bn({className:e}){return Me("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:Me("path",{fill:"currentColor",d:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"})})}function St({className:e}){return Me("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:Me("path",{d:"M4 5h16v11H4zM9 20h6M12 16v4",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Jo({className:e}){return Me("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:Me("path",{d:"M5 7l5 5-5 5M12 18h7",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function ar({className:e}){return Me("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:Me("path",{d:"M5 6h14v10H5zM2.5 19.5h19",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var Ze={claude:bs,chatgpt:bn,local:St},ys={shell:Jo};function Cs(e,n){return n<2*6e4?e:n<10*6e4?Math.max(e,6e4):n<30*6e4?Math.max(e,3*6e4):Math.max(e,10*6e4)}var zo=3e3,jo=2*6e4,Pt=Date.now(),Rt=new Set,ws=!1;function qo(){if(ws||typeof window>"u")return;ws=!0;let e=()=>{let t=Pt;if(Pt=Date.now(),Pt-t>jo)for(let r of Rt)r()};for(let t of["pointerdown","keydown","wheel","touchstart"])window.addEventListener(t,e,{capture:!0,passive:!0});let n=()=>{if(!document.hidden)for(let t of Rt)t()};window.addEventListener("focus",n),document.addEventListener("visibilitychange",n)}function Se(e,n,t={}){qo();let r,s=t.immediate===!1?Date.now():0,o=!1,a=!1,l=()=>{a||(r=setTimeout(i,t.idle===!1?n:Cs(n,Date.now()-Pt)))},i=async()=>{if(clearTimeout(r),!(a||o)){if(typeof document>"u"||!document.hidden){o=!0,s=Date.now();try{await e()}catch{}finally{o=!1}}l()}},c=()=>{Date.now()-s>Math.min(n,zo)&&i()};return Rt.add(c),t.immediate===!1?l():i(),()=>{a=!0,clearTimeout(r),Rt.delete(c)}}var ge=[{id:"claude",costClass:"user-subscription",short:"Claude Code",label:"Continue with Claude",title:"The Claude plan you already pay for",cost:"Nothing beyond the plan",prerequisite:"Claude Code installed and signed in",hint:"Install it from claude.ai/code, then run `claude` once and sign in.",install:"https://claude.com/product/claude-code",expects:["claude-code"]},{id:"chatgpt",costClass:"user-subscription",short:"Codex",label:"Continue with ChatGPT",title:"The ChatGPT plan you already pay for",cost:"Nothing beyond the plan",prerequisite:"Codex installed and signed in",hint:"Install Codex, then run `codex` once and sign in.",install:"https://learn.chatgpt.com/codex/cli",expects:["codex"]},{id:"local",costClass:"user-hardware",short:"Local models",label:"Use a model on this machine",title:"A model on your own machine",cost:"Free. You bought the hardware",prerequisite:"Ollama running, with a model pulled",hint:"Install Ollama, then `ollama pull` a model before pairing.",install:"https://ollama.com",expects:["ollama","openai-api"]}],vs=["claude","chatgpt"];function ir(){return ge.filter(e=>vs.includes(e.id))}function lr(e){return ge.filter(n=>n.costClass===e)}function cr(e){return ge.find(n=>n.expects.includes(e))??null}import{Fragment as ot,jsx as p,jsxs as k}from"react/jsx-runtime";function yn({machines:e,hosted:n=[],onApproveRuntime:t,onPreferRuntime:r,onDisconnectHosted:s,onPair:o,onWake:a,onOpenApp:l,onRefresh:i,refreshing:c,busy:u,appName:m,model:A,onPickModel:g,error:h,runs:y,loadRuns:S,loading:I,machineMenu:E,machineNote:T,onReconnect:J,openApp:O=!0,children:M,onStopRun:B}){let C=He(e),ue=e.filter(w=>w.id!==C?.id),_=C?.state==="online",[Ae,$]=Et(()=>_?[]:null),[Pe,Le]=Et("no"),ee=y===void 0&&!!S,Te=ee?Ae:y??(_?[]:null),q=y!==void 0||!!S,ne=!!(C&&Ve(C));Zo(()=>{if(!ee||!S||!ne)return;let w=!0,v=Se(async()=>{let Fe=await S();w&&$(Fe)},3e3);return()=>{w=!1,v()}},[ee,S,ne]);let Z=(C?_t(C):[]).filter(w=>w.quarantined&&!w.absent),X=C?he(C).runtime:null,be=X?.cost_class==="user-hardware"?X:null,ye=be?pa(be.default_model):null,pe=!!C&&!Ve(C),z=(()=>{if(!C||pe||!X||We(X).tone!=="warn")return null;let v=j(C);return{title:`${X.display_name} is signed out`,detail:`Sign in on ${v} so Soba can start runs.`}})(),te=()=>{l?.(),Le("going"),gn().then(w=>Le(w==="absent"?"absent":"no"))},re=()=>{te(),a?.()},Be={label:Pe==="going"?"Opening Soba\u2026":"Open Soba",onPress:te,spin:Pe==="going"},Q=C?Be:o?{label:"Connect to Soba",onPress:o}:null,Ge=!!C&&Q===Be,K=Ge&&!!i,U=i&&p("button",{type:"button",className:"sc-disc",onClick:i,disabled:c,"aria-label":"Refresh",title:"Refresh",children:p(fa,{spinning:!!c})});return!C&&n.length===0&&!o?p("p",{className:"sc-note",children:"Nothing connected yet."}):k("div",{className:"sc-tray",children:[C&&k(Ee,{title:"This machine",action:(i&&!K||O||E)&&k("span",{className:"sc-cap-acts",children:[!K&&U,O&&p(aa,{}),E]}),children:[p(Ko,{machine:C}),T]}),C&&pe&&!C.pairing_lost&&p(Ee,{title:"Soba",children:k("div",{className:"sc-away",children:[p("span",{className:"sc-away-mark","aria-hidden":"true",children:p(je,{kind:"paused",size:30})}),k("span",{className:"sc-away-say",children:[p("span",{className:"sc-away-title",children:"Wake it up"}),k("span",{className:"sc-away-body",children:["Soba on ",j(C)," is not answering. Waking it opens the app there."]})]}),p("button",{type:"button",className:"sc-away-go",onClick:re,disabled:u||Pe==="going",children:Pe==="going"?"Waking\u2026":"Wake"})]})}),C?.pairing_lost&&!Ve(C)&&p(Ee,{title:"Soba",children:k("div",{className:"sc-away",children:[p("span",{className:"sc-away-mark","aria-hidden":"true",children:p(je,{kind:"gone",size:30})}),k("span",{className:"sc-away-say",children:[p("span",{className:"sc-away-title",children:"Connect it again"}),p("span",{className:"sc-away-body",children:"Its pairing has ended, so it cannot take runs until it is connected again."})]}),J&&p("button",{type:"button",className:"sc-away-go",onClick:J,disabled:u,children:"Connect"})]})}),C&&!pe&&p(Ee,{title:"Runs on",children:X?p(ca,{machine:C,appName:m,busy:u,...A?{model:A}:{},...g?{onPickModel:g}:{},...r?{onPick:w=>r(C.id,w)}:{},...t?{onApprove:w=>t(C.id,w)}:{}}):k("div",{className:"sc-blank",children:[p("span",{className:"sc-blank-mark","aria-hidden":"true",children:p(ea,{})}),k("span",{className:"sc-blank-say",children:[p("span",{className:"sc-blank-title",children:I?"Looking\u2026":"No agent on this machine"}),p("span",{className:"sc-blank-body",children:I?"Reading what it can run.":"Install Claude Code, Codex or Ollama there and it will appear here."})]}),!I&&O&&k("a",{className:"sc-blank-act",href:_n(),children:[p("span",{children:"Add agents"}),p(ur,{})]})]})}),C&&(z||ye)&&k(Ee,{title:"Needs attention",children:[z&&k("div",{className:"sc-alarm",children:[p("span",{className:"sc-alarm-mark","aria-hidden":"true",children:p(Ns,{})}),k("span",{className:"sc-alarm-say",children:[p("span",{className:"sc-alarm-title",children:z.title}),p("span",{className:"sc-alarm-body",children:z.detail})]})]}),ye&&k("div",{className:"sc-alarm sc-alarm-warn",children:[p("span",{className:"sc-alarm-mark","aria-hidden":"true",children:p(Ns,{})}),k("span",{className:"sc-alarm-say",children:[p("span",{className:"sc-alarm-title",children:"A large model on this computer"}),k("span",{className:"sc-alarm-body",children:["Your ",ye," model can take all this computer's memory while it answers."]})]})]})]}),C&&q&&!pe&&p($o,{machine:C,runs:Te,...B?{onStop:B}:{}}),C&&p(ot,{children:Z.length>0&&!pe&&!(r&&t&&he(C).by!=="app")&&p(Ee,{title:"New on this machine",children:Z.map(w=>p(la,{runtime:w,...t?{onApprove:()=>t(C.id,w.id)}:{}},w.id))})}),n.length>0&&p(Ee,{title:n.length>1?"Connected plans":"Connected plan",children:n.map(w=>p(ha,{credential:w,appName:m,busy:u,...s?{onDisconnect:()=>s(w.provider)}:{}},w.provider))}),ue.length>0&&p(Ee,{title:"Your other machines",children:ue.map(w=>p(ia,{machine:w},w.id))}),!C&&o&&p(Ee,{title:"Your machines",children:k("button",{type:"button",className:"sc-pair",onClick:o,children:[p("span",{className:"sc-otile","aria-hidden":"true",children:p(ga,{})}),p("span",{className:"sc-oname",children:"Connect a machine"})]})}),Q&&k("div",{className:"sc-acts",children:[Ge&&Q?k("div",{className:"sc-acts-row",children:[K?U:p("span",{}),k("button",{type:"button",className:"sc-act-small",onClick:Q.onPress,disabled:u||Q.spin,"data-spin":Q.spin?"true":void 0,children:[Q.spin&&p(xs,{}),Q.label,!Q.spin&&p(ur,{})]})]}):Q&&k("button",{type:"button",className:"sc-act-go",onClick:Q.onPress,disabled:u||Q.spin,"data-spin":Q.spin?"true":void 0,children:[Q.spin&&p(xs,{}),Q.label]}),Pe==="absent"&&k("p",{className:"sc-act-miss",children:["Nothing opened here. ",C?j(C):"That machine"," may be a different computer, or the Soba app is not installed on this one."]})]}),M,h&&p("p",{className:"sc-error sc-tray-error",children:h})]})}function Ee({title:e,action:n,children:t}){return k("section",{className:"sc-group",children:[k("div",{className:"sc-group-cap",children:[p("p",{className:"sc-group-title",children:e}),n]}),p("div",{className:"sc-group-card",children:t})]})}function Ko({machine:e,onToggle:n,open:t}){let r=Ve(e),s=[r?null:e.pairing_lost?"Not connected to Soba":"Soba is asleep",r?Xn(e):null,e.always_on?"always on":null].filter(Boolean),o=r&&e.capacity>0?e.active>0?`${e.active} of ${e.capacity} running`:null:Kn(e.last_seen_at),a=k(ot,{children:[k("span",{className:"sc-mtile","aria-hidden":"true",children:[p(Ms,{}),p("span",{className:`sc-mbadge sc-mbadge-${r?hn(e).tone:e.pairing_lost?"off":"away"}`})]}),k("span",{className:"sc-mid",children:[p("span",{className:"sc-mname",children:j(e)}),k("span",{className:"sc-mmeta",children:[p("span",{className:"sc-mmeta-is",children:s.map((l,i)=>k("span",{children:[i>0&&p("span",{className:"sc-mmeta-sep",children:"\xB7"}),l]},l))}),o&&p("span",{className:"sc-mmeta-now",children:o})]})]})]});return!n||!r?p("div",{className:"sc-mrow",children:a}):k("button",{type:"button",className:"sc-mrow sc-mrow-btn",onClick:n,"aria-expanded":!!t,title:t?"Hide what it is running":"See what it is running",children:[a,p(En,{open:!!t})]})}function _o(e,n){return e.filter(t=>t.machine_id===n.id||t.machine_id===null)}function $o({machine:e,runs:n,onStop:t}){let r=n?_o(n,e):[],[s,o]=Et(new Set),a=async i=>{o(c=>new Set(c).add(i));try{await t?.(i)}catch{o(c=>{let u=new Set(c);return u.delete(i),u})}},l=()=>{for(let i of r)a(i.id)};return p(Ee,{title:"Active runs",...t&&r.length>1?{action:p("button",{type:"button",className:"sc-cap-link",onClick:l,children:"Stop all"})}:{},children:n===null?p("p",{className:"sc-row-note",children:"Looking\u2026"}):r.length===0?k("p",{className:"sc-nilrow",children:[p("span",{className:"sc-nilrow-mark","aria-hidden":"true",children:p(na,{})}),"Nothing running"]}):r.map(i=>p(ta,{run:i,stopping:s.has(i.id),...t?{onStop:()=>void a(i.id)}:{}},i.id))})}function ea(){return k("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-blank-glyph",children:[p("rect",{x:"3",y:"4.5",width:"18",height:"15",rx:"2.5",fill:"none",stroke:"currentColor",strokeWidth:"1.8"}),p("path",{d:"M7.5 10l2.5 2.2-2.5 2.2M12.5 14.6h4",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function na(){return k("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-blank-glyph",children:[p("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:"currentColor",strokeWidth:"1.8"}),p("path",{d:"M9 12.5l2.2 2.2L15.5 9.8",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function ta({run:e,stopping:n,onStop:t}){return k("div",{className:"sc-rrow",children:[p("span",{className:n?"sc-rdot":"sc-rdot sc-rdot-live","aria-hidden":"true"}),k("span",{className:"sc-mid",children:[p("span",{className:"sc-rtitle",children:ks(e)}),p("span",{className:"sc-rstep",children:n?"Stopping\u2026":`${sa(e)} \xB7 ${oa(e.started_at)}`})]}),t&&p("button",{type:"button",className:"sc-rstop",onClick:t,disabled:n,"aria-label":`Stop ${ks(e)}`,children:p("span",{className:"sc-rstop-ring",children:p(Aa,{})})})]})}function ra(e){let n=cr(e);return(n?Ze[n.id]:null)??ys[e]??null}function ks(e){if(e.label)return e.label;if(e.task){let n=e.task.replace(/[_-]+/g," ").trim();return n.charAt(0).toUpperCase()+n.slice(1)}return"A run"}function sa(e){if(e.status==="queued")return"Waiting for a free slot";if(e.step)return e.step;switch(e.phase?.kind){case"thinking":return"Thinking";case"writing":return"Writing";case"tool":return e.phase.tool?`Using ${e.phase.tool}`:"Using a tool";case"approval":return e.phase.tool?`Waiting for you to allow ${e.phase.tool}`:"Waiting for your approval";default:return e.first_output_at?"Working":"Starting"}}function oa(e){let n=Math.max(0,Math.round((Date.now()-new Date(e).getTime())/1e3));if(n<60)return`${n}s`;let t=Math.floor(n/60);return t<60?`${t}m ${String(n%60).padStart(2,"0")}s`:`${Math.floor(t/60)}h ${String(t%60).padStart(2,"0")}m`}function aa(){return p("a",{className:"sc-disc sc-open-app",href:_n(),"aria-label":"Open Soba App",title:"Open Soba App",children:p(ur,{})})}function ur(){return p("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-dglyph",children:p("path",{d:"M14 4h6v6M20 4l-8.5 8.5M18 14.5V19a1 1 0 01-1 1H5a1 1 0 01-1-1V7a1 1 0 011-1h4.5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function ia({machine:e}){let n=hn(e);return k("div",{className:"sc-orow",children:[p("span",{className:"sc-otile","aria-hidden":"true",children:p(Ms,{})}),p("span",{className:"sc-oname",children:j(e)}),p("span",{className:"sc-oword",children:n.word}),p("span",{className:`sc-dot sc-dot-${n.tone}`,"aria-hidden":"true"})]})}function la({runtime:e,onApprove:n}){return k("div",{className:"sc-mrow",children:[p("span",{className:"sc-mtile sc-atile","aria-hidden":"true",children:p(It,{id:e.id,name:e.display_name})}),k("span",{className:"sc-mid",children:[p("span",{className:"sc-mname",children:e.display_name}),p("span",{className:"sc-mmeta",children:e.version??"waiting to be let in"})]}),n?p("button",{type:"button",className:"sc-row-act",onClick:n,children:"Let it serve"}):p("span",{className:"sc-averdict sc-tone-warn",children:"not serving yet"})]})}function dr({id:e,name:n}){return p("span",{className:"sc-runtime-tile","aria-hidden":"true",children:p(It,{id:e,...n?{name:n}:{}})})}function It({id:e,name:n}){if(!e)return null;let t=gs[e];if(t)return p("img",{src:t,alt:"",className:"sc-runtime-logo"});let r=ra(e);return r?p(r,{className:"sc-runtime-mark"}):n?p("span",{className:"sc-runtime-letter",children:n.slice(0,1).toUpperCase()}):null}function ca({machine:e,appName:n,busy:t,onPick:r,model:s,onPickModel:o,onApprove:a}){let l=he(e),i=Ne(e),c=a?e.runtimes.filter(M=>M.quarantined&&!M.absent):[],[u,m]=Et(!1),A=Xo(null);if(l.by!=="app"&&i.length===0)return null;let g=M=>M?p(dr,{id:M.id,name:M.display_name}):null,h=l.runtime?.display_name??l.runtimeId??"\u2014",y=l.by!=="app"&&!!r&&(i.length>=2||c.length>0),S=l.runtime?.id??l.runtimeId,I=!Ve(e),E=l.runtime&&We(l.runtime).tone==="warn"?"Signed out":null,T=s?tt([e]).filter(M=>M.kind==="named"?M.runtime===S:M.kind==="size"?!!S&&Nt(S):!0):[],J=(()=>{if(!s)return;if(s.kind!=="auto")return s;let M=l.runtime?.default_model;if(!M)return s;let B=fn(M);return{...s,label:B.length>16?B:`${s.label} \xB7 ${B}`}})(),O=l.by==="app"?`Set by ${n??"the app"}`:l.runtime?da(l.runtime):null;return k(ot,{children:[y?k("button",{ref:A,type:"button",className:I?"sc-runs-agent sc-runs-dim":"sc-runs-agent","aria-haspopup":"menu","aria-expanded":u,"aria-label":`Runs go to ${h}. Change`,disabled:t,onClick:()=>m(M=>!M),children:[p("span",{className:"sc-runs-tile","aria-hidden":"true",children:p(It,{id:S??null,name:h})}),k("span",{className:"sc-runs-said-name",children:[p("span",{className:"sc-runs-name",children:h}),E&&p("span",{className:"sc-runs-ill",children:E})]}),p(En,{open:!1})]}):k("span",{className:I?"sc-runs-agent sc-runs-fixed sc-runs-dim":"sc-runs-agent sc-runs-fixed",children:[p("span",{className:"sc-runs-tile","aria-hidden":"true",children:p(It,{id:S??null,name:h})}),k("span",{className:"sc-runs-said-name",children:[p("span",{className:"sc-runs-name",children:h}),E&&p("span",{className:"sc-runs-ill",children:E})]}),l.by==="app"&&k("span",{className:"sc-runs-told",children:["set by ",n??"the app"]})]}),J&&o&&An(T)?k(ot,{children:[p("span",{className:"sc-runs-rule","aria-hidden":"true"}),p(st,{options:T,selected:J,onPick:o,caption:"Model",className:I?"sc-runs-model sc-runs-dim":"sc-runs-model",...t?{disabled:t}:{}})]}):O&&k(ot,{children:[p("span",{className:"sc-runs-rule","aria-hidden":"true"}),k("span",{className:"sc-runs-said",children:[p("span",{className:"sc-runs-key",children:"Model"}),p("span",{className:"sc-runs-val",children:O})]})]}),u&&r&&p(ua,{anchor:A,machine:e,tile:g,waiting:c,...a?{onApprove:a}:{},onClose:()=>m(!1),onPick:M=>{m(!1),r(M)}})]})}function ua({anchor:e,machine:n,tile:t,waiting:r,onApprove:s,onClose:o,onPick:a}){let l=he(n),i=he({...n,preferred_runtime:null}).runtime,c=l.by==="you"?l.runtimeId:null,u=[{id:null,label:"Automatic",...i?{note:`Uses ${i.display_name}`}:{},glyph:t(i)},...Ne(n).map((m,A)=>{let g=ma(m);return{id:m.id,label:m.display_name,glyph:t(m),...g?{note:g}:{},...A===0?{rule:!0}:{}}}),...s?r.map((m,A)=>({id:`waiting:${m.id}`,label:m.display_name,glyph:t(m),...m.version?{note:m.version}:{},trailing:"Let it serve",onChoose:()=>s(m.id),...A===0?{heading:"New on this machine"}:{}})):[]];return p(nt,{anchor:e,label:"Which agent runs go to",options:u,current:c,onClose:o,onPick:a})}function da(e){let n=We(e);return n.tone==="warn"?n.text:e.default_model?fn(e.default_model):"Automatic"}function pa(e){if(!e)return null;let n=/(\d+(?:\.\d+)?)\s*b\b/i.exec(e),t=n?.[1]?Number(n[1]):Number.NaN;return!Number.isFinite(t)||t<20?null:`${n?.[1]}B`}function ma(e){let n=We(e);return n.tone==="warn"?n.text:e.default_model?fn(e.default_model):e.cost_class==="user-hardware"?"In this machine's memory":n.tone!=="ok"?n.text:e.version??void 0}function ha({credential:e,appName:n,busy:t,onDisconnect:r}){return k("div",{className:"sc-hrow",children:[k("div",{className:"sc-orow",children:[p("span",{className:"sc-otile","aria-hidden":"true",children:p(bn,{className:"sc-omark"})}),k("span",{className:"sc-mid",children:[p("span",{className:"sc-oname",children:e.provider==="openai-chatgpt"?"ChatGPT plan":e.provider}),p("span",{className:"sc-mmeta",children:e.account_label??"signed in"})]}),r&&p("button",{type:"button",className:"sc-row-act",onClick:r,disabled:t,children:"Disconnect"})]}),r&&k("p",{className:"sc-row-note",children:[n??"This app"," stops using it. To withdraw the grant entirely, remove it in your OpenAI settings."]})]})}function Ms(){return k("svg",{viewBox:"0 0 32 24","aria-hidden":"true",focusable:"false",className:"sc-mglyph",children:[p("rect",{x:"4",y:"1.5",width:"24",height:"15",rx:"2.5",fill:"var(--sc-sheet, #ffffff)",stroke:"currentColor",strokeWidth:"2"}),p("rect",{x:"1",y:"19.5",width:"30",height:"2.5",rx:"1.25",fill:"currentColor"})]})}function ga(){return p("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-oglyph",children:p("path",{d:"M12 5v14M5 12h14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}function Ns(){return k("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-hglyph",children:[p("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:"currentColor",strokeWidth:"2"}),p("path",{d:"M12 7.5v5.5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),p("circle",{cx:"12",cy:"16.5",r:"1.15",fill:"currentColor"})]})}function xs(){return k("svg",{className:"sc-act-glyph sc-spin",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[p("circle",{cx:"8",cy:"8",r:"6.2",fill:"none",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),p("path",{d:"M8 1.8a6.2 6.2 0 0 1 6.2 6.2",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function fa({spinning:e}){return p("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e?"sc-dglyph sc-spin":"sc-dglyph",children:p("path",{d:"M21 12a9 9 0 1 1-2.64-6.36M21 3v6h-6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Aa(){return p("svg",{className:"sc-dglyph",viewBox:"0 0 14 14","aria-hidden":"true",children:p("rect",{x:"2",y:"2",width:"10",height:"10",rx:"2",fill:"currentColor"})})}import{jsx as ba}from"react/jsx-runtime";function pr({machines:e,onApproveRuntime:n,model:t,onPickModel:r}){return ba(yn,{machines:e,...n?{onApproveRuntime:n}:{},...t?{model:t}:{},...r?{onPickModel:r}:{}})}import{useCallback as ae,useEffect as fe,useId as va,useMemo as Xe,useRef as In,useState as Y}from"react";var at=[{slug:"mac-arm",label:"macOS, Apple silicon"},{slug:"mac-intel",label:"macOS, Intel"},{slug:"windows",label:"Windows"},{slug:"linux",label:"Linux"}];function it(e){if(!e)return"";try{return new URL(e).origin}catch{return""}}var Ss="soba.connect.choice",ya=180*24*60*60*1e3;function mr(e){let n=2166136261;for(let t=0;t<e.length;t++)n^=e.charCodeAt(t),n=Math.imul(n,16777619);return(n>>>0).toString(36)}function hr(e,n){return e?n?`${Ss}.${e}.${mr(n)}`:`${Ss}.${e}`:null}function gr(e){if(!e||typeof localStorage>"u")return null;try{let n=localStorage.getItem(e);if(!n)return null;let t=JSON.parse(n);if(Date.now()-Date.parse(t.at)>ya)return null;let r=ge.find(s=>s.id===t.choice);return r?r.id:null}catch{return null}}function fr(e,n){if(!(!e||typeof localStorage>"u"))try{localStorage.setItem(e,JSON.stringify({choice:n,at:new Date().toISOString()}))}catch{}}var Ps="soba.connect.model",wa=180*24*60*60*1e3;function Ar(e,n){return e?n?`${Ps}.${e}.${mr(n)}`:`${Ps}.${e}`:null}function Ot(e){if(!e||typeof localStorage>"u")return null;try{let n=localStorage.getItem(e);if(!n)return null;let t=JSON.parse(n);if(Date.now()-Date.parse(t.at)>wa)return null;let r=t.choice;return typeof r!="string"||!r||r.length>120?null:/^[\w.:@+-]+(\/[\w.:@+-]+)?$/.test(r)?r:null}catch{return null}}function br(e,n){if(!(!e||typeof localStorage>"u"))try{localStorage.setItem(e,JSON.stringify({choice:n,at:new Date().toISOString()}))}catch{}}var Rs="soba.connect.dismissed",Ca=30*24*60*60*1e3;function yr(e,n){return e?n?`${Rs}.${e}.${mr(n)}`:`${Rs}.${e}`:null}function wr(e){if(!e||typeof localStorage>"u")return!1;try{let n=localStorage.getItem(e);if(!n)return!1;let t=JSON.parse(n);return Date.now()-Date.parse(t.at)<Ca}catch{return!1}}function Cr(e){if(!(!e||typeof localStorage>"u"))try{localStorage.setItem(e,JSON.stringify({at:new Date().toISOString()}))}catch{}}import{Fragment as Ln,jsx as d,jsxs as P}from"react/jsx-runtime";var vr=2e3,ka=1e4,Na=9e4,xa=6e4;function kr(e,n,t,r=[],s){return e?"code":n&&(t.length>0||r.length>0)?"manage":s?"launch":"choose"}function Es(e){return Ve(e)&&!e.pairing_lost}function Lt(e){return new Map(e.map(n=>[n.id,Es(n)]))}function Ma(e){let n=Math.max(0,Math.round(e/1e3));return`${Math.floor(n/60)}:${String(n%60).padStart(2,"0")}`}function Mr({client:e,initialCode:n,initialChoice:t,onConnected:r,showStatus:s=!0,initialContext:o=null,initialMachines:a,onClose:l,headingId:i,theme:c,reason:u,active:m=!0}){let A=!!o&&a!==void 0,[g,h]=Y(A?kr(n,s,a??[],[],t):"loading"),[y,S]=Y(o),[I,E]=Y(a??[]),[T,J]=Y(n??""),[O,M]=Y(null),[B,C]=Y(null),[ue,_]=Y(!1),[Ae,$]=Y(0),[Pe,Le]=Y("app"),[ee,Te]=Y(()=>Date.now()),[q,ne]=Y(null),[Nn,Z]=Y(!1),[X,be]=Y(!1),[ye,pe]=Y("browser"),[z,te]=Y(null),[re,Be]=Y([]),[Q,Ge]=Y(0),[K,U]=Y(null),w=In(null),[v,Fe]=Y(t??null),[en,we]=Y(null),nn=Xe(()=>{let f=y?.accent?.trim(),x=y?.background?.trim();if(!(!f&&!x))return x?{...pn(x,f),background:x,borderRadius:"inherit"}:{"--sc-accent":f,"--sc-accent-fg":Zn(f)}},[y?.accent,y?.background]),wt=va(),Ce=i??wt,tn=In(null);fe(()=>{if(!e||A)return;let f=!0;return Promise.all([e.context(),e.machines()]).then(([x,H])=>{f&&(S(x),E(H),h(kr(n,s,H)))}).catch(x=>{f&&(C(x.message),h("choose"))}),()=>{f=!1}},[e,n,s,A]),fe(()=>{g!=="loading"||!A||h(kr(n,s,a??[]))},[g,A,n,s,a]),fe(()=>{a&&E(a)},[a]),fe(()=>{o&&S(o)},[o]);let ze=In(!1),rn=In(g);rn.current=g;let Qn=In(re);Qn.current=re;let sn=!!y?.hosted_available;fe(()=>{!s&&rn.current==="manage"&&h("choose")},[s]),fe(()=>{if(!e||!m||g!=="manage")return;let f=!0,x=Se(async()=>{try{let H=await e.machines();if(!f)return;E(H);let V=!sn||ze.current;H.length===0&&Qn.current.length===0&&V&&rn.current==="manage"&&h("choose")}catch{}},ka,{immediate:!1});return()=>{f=!1,x()}},[g,e,sn,m]);let on=hr(y?.publishable_key??null);fe(()=>{we(gr(on))},[on]),fe(()=>{if(!e||!sn)return;let f=!0;return e.hosted().then(x=>{f&&(Be(x.credentials),!ze.current&&(ze.current=!0,x.credentials.length>0&&s&&rn.current==="choose"&&h("manage")))}).catch(()=>{}),()=>{f=!1}},[e,sn,s]),fe(()=>{if(!e||!m||g!=="hosted")return;let f=!0,x=async()=>{try{let ke=await e.hosted();if(!f)return!1;if(Be(ke.credentials),ke.credentials.length>0)return h("hosted_connected"),U(null),!0}catch{}return!1},H=async()=>{w.current?.closed&&(w.current=null,!await x()&&f&&h("choose"))},V=Se(x,vr,{immediate:!1}),cn=setInterval(H,400),un=ke=>{let Yn=ke.data;Yn?.source==="soba"&&Yn.type==="hosted_result"&&x()};return window.addEventListener("message",un),()=>{f=!1,V(),clearInterval(cn),window.removeEventListener("message",un),w.current=null}},[e,g,m]);let Vt=ae(()=>{if(!e)return;let f=window.open("","soba-connect-plan","width=520,height=760,noopener=no");w.current=f,h("hosted"),Ge(Date.now()),U(null),C(null),e.startHosted().then(({url:x})=>{if(f&&!f.closed){f.location.href=x;return}U(x)}).catch(x=>{f?.close(),w.current=null,C(x.message),h("choose")})},[e]),xn=ae(async f=>{if(e){_(!0);try{await e.disconnectHosted(f),Be((await e.hosted()).credentials)}catch(x){C(x.message)}finally{_(!1)}}},[e]);fe(()=>{if(!e||!m||g!=="waiting")return;let f=!0,x=Se(async()=>{try{let H=await e.machines();if(!f)return;E(H);let V=tn.current;if(!V)return;let cn=H.filter(ke=>!V.has(ke.id)||V.get(ke.id)===!1&&Es(ke)),un=cn.find(ke=>ke.state!=="offline")??cn[0];if(un){te(un.id),v&&fr(on,v);let ke=ge.find(zt=>zt.id===v)?.expects??[],Yn=Ne(un).find(zt=>ke.includes(zt.id));Yn&&e.preferRuntime(un.id,Yn.id).catch(()=>{}),h("connected"),r?.(H)}}catch{}},vr,{immediate:!1});return()=>{f=!1,x()}},[g,e,r,v,on,m]);let Ct=ae(async()=>{if(e){C(null),_(!0);try{let f=await e.lookup(T);M(f),h("confirm")}catch(f){C(f.message)}finally{_(!1)}}},[e,T]),Vn=ae(async()=>{if(e){C(null),_(!0);try{try{tn.current=Lt(await e.machines())}catch{tn.current=Lt(I)}await e.approve(T),Le("code"),h("waiting"),$(Date.now())}catch(f){C(f.message)}finally{_(!1)}}},[e,T,I]),vt=ae(async()=>{if(e){_(!0);try{await e.deny(T),pe("browser"),h("denied")}catch(f){C(f.message)}finally{_(!1)}}},[e,T]),F=Xe(()=>y?.connect_url??null,[y]),[me,Jn]=Y(()=>et()),Jt=Xe(()=>F?$n(F,me??void 0,v??void 0):null,[F,me,v]),N=Xe(()=>it(F),[F]),se=ae(f=>{if(I.length===0)return null;let x=ge.find(V=>V.id===f);if(!x)return null;let H=I.flatMap(V=>V.runtimes??[]).filter(V=>x.expects.includes(V.id));return H.length===0?{tone:"dim",text:"not installed"}:H.some(V=>V.authenticated===!0)?{tone:"ok",text:"ready"}:H.every(V=>V.authenticated===!1)?{tone:"warn",text:"needs signing in"}:{tone:"dim",text:"installed"}},[I]),ve=ae((f=null)=>{Fe(f),C(null),ne(null),Z(!1),be(!1),Mn.current=!1,Jn(et()),h("launch")},[]),Mn=In(!!t);fe(()=>{g!=="launch"||!F||Mn.current||(Mn.current=!0,Z(!0),nr(F,{...me?{nonce:me}:{},...v?{want:v}:{}}).then(ne))},[g,F,me,v]);let Re=ae(()=>{Z(!0),er().then(ne)},[]),Yt=ae(f=>{if(X){let x=et();be(!1),Jn(x),F&&(f.preventDefault(),window.location.href=$n(F,x??void 0,v??void 0))}Re()},[X,Re,F,v]),Qe=Xe(()=>{let f=y?.runtimes;return f?ge.filter(x=>f.includes(x.id)):ir()},[y?.runtimes]),de=Xe(()=>{let f=ge.find(x=>x.id===v);return f?{choice:f,Mark:Ze[f.id]??null}:null},[v]),an=Xe(()=>I.find(f=>f.id===z),[I,z]),kt=ae(()=>{h("manage"),l?.()},[l]);fe(()=>{let f=me;if(!e||!m||g!=="launch"||!f)return;let x=!1,H=Date.now()+15e4,V=()=>{};return V=Se(async()=>{if(Date.now()>H){V(),be(!0);return}try{let cn=await e.claim(f);if(x)return;if(cn.declined){V(),ne(null),pe("machine"),h("denied");return}if(!cn.claimed)return;V();try{tn.current=Lt(await e.machines())}catch{tn.current=Lt(I)}Le("app"),h("waiting"),$(Date.now())}catch{}},vr,{immediate:!1,idle:!1}),()=>{x=!0,V()}},[e,g,I,me,m]);let ln=Xe(()=>{if(!O)return null;if(O.approved||O.denied)return"answered";let f=O.expires_at?Date.parse(O.expires_at):Number.NaN;return Number.isFinite(f)&&f<=ee?"expired":"live"},[O,ee]);fe(()=>{if(!(g==="confirm"&&ln==="live"||g==="waiting"||g==="hosted"))return;let x=setInterval(()=>Te(Date.now()),1e3);return()=>clearInterval(x)},[g,ln]);let wo=ae(async(f,x)=>{if(e)try{await e.approveRuntime(f,x),E(await e.machines())}catch(H){C(H.message)}},[e]),Co=ae(async(f,x)=>{if(e)try{await e.preferRuntime(f,x),E(await e.machines())}catch(H){C(H.message)}},[e]);return g==="loading"?d("div",{className:"soba-connect",...c?{"data-theme":c}:{},style:nn,children:d("div",{className:"sc-card",children:d("p",{className:"sc-note",children:"Loading\u2026"})})}):P("div",{className:"soba-connect",...c?{"data-theme":c}:{},style:nn,children:[l&&d("button",{type:"button",className:"sc-modal-close",onClick:l,"aria-label":"Close",children:"\xD7"}),g==="manage"&&P("div",{className:"sc-card",children:[d("h2",{className:"sc-title",id:Ce,children:"Your compute"}),P("p",{className:"sc-sub",children:[d(Tt,{context:y})," ",I.length>0&&re.length>0?"runs on your connected plan, and on these machines while they are awake.":re.length>0?"runs on the plan you connected. Nothing here is charged to you.":"runs on these machines, while they are awake."]}),d(yn,{machines:I,hosted:re,onApproveRuntime:wo,onPreferRuntime:(f,x)=>void Co(f,x),onDisconnectHosted:f=>void xn(f),onPair:()=>h("choose"),busy:ue,...y?.app.name?{appName:y.app.name}:{}}),B&&d("p",{className:"sc-error",children:B})]}),g==="choose"&&P("div",{className:"sc-card",children:[d(Pa,{context:y}),d("h2",{className:"sc-h",id:Ce,children:u==="payment_required"?"Carry on with your own AI":u==="no_compute"?"This run needs a machine":"Connect your AI"}),d("p",{className:"sc-p",children:"Use compute you already have."}),F&&Qe.length>0&&P(Ln,{children:[d("div",{className:"sc-opts",children:Qe.map(f=>{let x=Ze[f.id];return P("button",{type:"button",className:"sc-opt",onClick:()=>ve(f.id),children:[d("span",{className:"sc-opt-tile","aria-hidden":"true",children:x&&d(x,{className:"sc-opt-mark"})}),d("span",{className:"sc-opt-text",children:d("span",{className:"sc-opt-label",children:f.label})}),(()=>{let H=se(f.id);return H?d("span",{className:`sc-opt-has sc-opt-has-${H.tone}`,children:H.text}):en===f.id?d("span",{className:"sc-opt-last",children:"last used"}):d(Nr,{className:"sc-opt-go"})})()]},f.id)})}),P("p",{className:"sc-opt-note",children:["Your accounts stay there. ",Is(y)," never sees them."]})]}),(!F||Qe.length===0)&&d("p",{className:"sc-error",style:{marginTop:16},children:"This app has no publishable key yet, so there is nothing to pair against."}),B&&d("p",{className:"sc-error",children:B}),F&&y?.show_code===!0&&d("div",{className:"sc-opt-alt",children:d("button",{type:"button",className:"sc-alt-link",onClick:()=>h("code"),children:"I have a code"})})]}),g==="launch"&&P("div",{className:"sc-card",children:[P("div",{className:"sc-head",children:[d(On,{onClick:()=>h("choose")}),d("p",{className:"sc-head-title",children:"Soba App"})]}),d(Bt,{mark:de?.Mark??oe,still:X||!Nn&&q===null}),d("h2",{className:"sc-h",id:Ce,children:X?"No answer from this machine":q==="absent"?"Nothing opened":q===null?"Opening Soba App\u2026":"Approve it on this machine"}),X?d("p",{className:"sc-p",children:"The Soba app did not answer. It may not be open, or nobody was there. Try again when you are ready."}):q==="absent"?d("p",{className:"sc-p",children:"Nothing opened on this machine. Open it yourself below, or install it if it is not here yet."}):d("p",{className:"sc-p",children:q===null?"Approve it there and this page does the rest.":"This page finishes on its own."}),de&&P("p",{className:"sc-prereq",children:[de.Mark&&d(de.Mark,{className:"sc-rt-mark"}),"Needs ",de.choice.prerequisite]}),P("div",{className:"sc-stack",style:{marginTop:18},children:[d("a",{className:q==="absent"||X?"sc-btn sc-btn-primary":"sc-btn",href:Jt??"#",onClick:Yt,children:X?"Try again":q==="absent"?"Open Soba App":"Open it again"}),d("p",{className:"sc-note",children:q===null?"Your browser will ask permission first.":"Your browser asks permission the first time."}),de&&q==="absent"&&d("p",{className:"sc-note",children:d(Ea,{text:de.choice.hint})}),P("div",{className:"sc-foot-strip",children:[d("span",{children:"Not installed on this machine?"}),P("button",{type:"button",className:"sc-foot-go",onClick:()=>h("get"),children:["Get it",d(Nr,{})]})]})]})]}),g==="get"&&P("div",{className:"sc-card",children:[P("div",{className:"sc-head",children:[d(On,{onClick:()=>h("launch")}),d("p",{className:"sc-head-title",children:"Get Soba App"})]}),d("div",{className:"sc-opts",children:at.map(f=>P("a",{className:"sc-opt",href:`${N}/download/${f.slug}`,target:"_blank",rel:"noreferrer noopener",children:[d("span",{className:"sc-opt-tile","aria-hidden":"true",children:d(ar,{className:"sc-opt-mark"})}),d("span",{className:"sc-opt-text",children:d("span",{className:"sc-opt-label",children:f.label})}),d(Nr,{className:"sc-opt-go"})]},f.slug))}),d("p",{className:"sc-opt-note",children:"Install it, then come back here and press the row you started with."})]}),g==="code"&&P("div",{className:"sc-card",children:[P("div",{className:"sc-head",children:[d(On,{onClick:()=>h("choose")}),d("p",{className:"sc-head-title",children:"Soba App"})]}),d("h2",{className:"sc-h",id:Ce,children:"Enter the code from that machine"}),d("p",{className:"sc-p",children:"Eight characters, shown by the Soba app once you paste the link."}),P("form",{className:"sc-stack",style:{marginTop:16},onSubmit:f=>{f.preventDefault(),Ct()},children:[d("input",{className:"sc-input",value:T,onChange:f=>J(f.target.value),placeholder:"ACDE-F234",autoComplete:"off",autoFocus:!0,"aria-label":"Pairing code"}),B&&d("p",{className:"sc-error",children:B}),d("button",{type:"submit",className:"sc-btn sc-btn-primary",disabled:ue||T.length<8,children:ue?"Checking\u2026":"Continue"})]})]}),g==="confirm"&&O&&P("div",{className:"sc-card",children:[P("div",{className:"sc-head",children:[d(On,{onClick:()=>h("code")}),d("p",{className:"sc-head-title",children:"Soba App"})]}),d("h2",{className:"sc-title",children:"Attach this machine to your account?"}),P("p",{className:"sc-sub",children:[d(Tt,{context:y})," may send your runs to it once you approve. It can never see the account or the keys on it."]}),P("ul",{className:"sc-facts",children:[d(lt,{k:"Code",v:O.user_code}),d(lt,{k:"Machine",v:O.hostname??"not stated"}),d(lt,{k:"System",v:[O.platform,O.arch].filter(Boolean).join(" / ")||"not stated"}),d(lt,{k:"Asked by",v:O.client??"not stated"}),O.labels.length>0&&d(lt,{k:"Labels",v:O.labels.join(", ")})]}),d("p",{className:"sc-note",style:{marginTop:12},children:"Every line above is what that machine said about itself. If none of it looks like a computer of yours, say no."}),ln==="expired"&&d("p",{className:"sc-error",children:"That code has expired. Ask the machine for a new one. It prints a fresh code each time it starts."}),ln==="answered"&&d("p",{className:"sc-error",children:"That code has already been answered. If it was not you, deny the next one."}),B&&d("p",{className:"sc-error",children:B}),P("div",{className:"sc-row",style:{marginTop:16},children:[d("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>void Vn(),disabled:ue||ln!=="live",children:"Approve"}),d("button",{type:"button",className:"sc-btn",onClick:()=>void vt(),disabled:ue||ln==="answered",children:"No, deny it"})]}),ln==="live"&&O.expires_at&&P("p",{className:"sc-note",style:{marginTop:10},children:["This code expires in ",Ma(Date.parse(O.expires_at)-ee),"."]})]}),g==="waiting"&&P("div",{className:"sc-card",children:[P("div",{className:"sc-head",children:[d(On,{onClick:()=>h("choose")}),d("p",{className:"sc-head-title",children:de?.choice.short??"Soba App"})]}),d(Bt,{mark:de?.Mark??oe}),d("h2",{className:"sc-h",id:Ce,children:"Approved. Waiting for it to connect"}),d("p",{className:"sc-p",children:"Nothing more to do here. This page changes when it arrives."}),Ae>0&&ee-Ae>Na&&P("ol",{className:"sc-stall",children:[Pe==="app"?P(Ln,{children:[d(Gt,{done:!0,title:"Soba Connect opened",line:"On this machine"}),d(Gt,{done:!0,title:"You approved it",line:"In Soba Connect"})]}):d(Gt,{done:!0,title:"You approved the code",line:"On this page"}),d(Gt,{title:`Still nothing from ${O?.hostname??"that machine"}`,line:"Look at Soba Connect on that machine: it says what it is doing. This keeps watching either way.",children:d("button",{type:"button",className:"sc-btn sc-stall-act",onClick:()=>void gn(),children:"Open Soba Connect"})})]})]}),g==="connected"&&P("div",{className:"sc-card",children:[d(xr,{tone:"ok"}),d("h2",{className:"sc-h",id:Ce,children:an?.label?`${an.label} is connected`:"Connected"}),P("p",{className:"sc-p",children:[d(Tt,{context:y})," will use ",an?.label?"it":"this machine"," from now on, while it is awake."]}),s&&P(Ln,{children:[an&&d(Ra,{machine:an}),d("button",{type:"button",className:"sc-btn sc-btn-primary sc-btn-wide",style:{marginTop:14},onClick:kt,children:"Done"})]})]}),g==="hosted"&&P("div",{className:"sc-card",children:[P("div",{className:"sc-head",children:[d(On,{onClick:()=>h("choose")}),d("p",{className:"sc-head-title",children:"ChatGPT"})]}),K?d(Bt,{mark:bn,still:!0}):d(Bt,{mark:bn}),d("h2",{className:"sc-h",id:Ce,children:K?"Your browser blocked the window":"Finish signing in to ChatGPT"}),d("p",{className:"sc-p",children:K?"Nothing opened. Open the sign-in yourself below. A link you click is allowed where a window we open is not.":"Approve it in the window that opened."}),P("div",{className:"sc-stack",style:{marginTop:18},children:[K&&d("a",{className:"sc-btn sc-btn-primary",href:K,target:"soba-connect-plan",rel:"noreferrer",children:"Open the ChatGPT sign-in"}),B&&d("p",{className:"sc-error",children:B}),Q>0&&ee-Q>xa&&d("p",{className:"sc-note sc-tone-warn",children:"Still nothing. The window may have been closed before it finished, or the sign-in may have been declined. This keeps watching either way."})]})]}),g==="hosted_connected"&&P("div",{className:"sc-card",children:[d(xr,{tone:"ok"}),d("h2",{className:"sc-h",id:Ce,children:"ChatGPT is connected"}),P("p",{className:"sc-p",children:[d(Tt,{context:y})," will run on your ChatGPT plan",re[0]?.account_label?` (${re[0].account_label})`:"",". Nothing more to pay, nothing to install."]}),d("p",{className:"sc-opt-note",style:{textAlign:"center"},children:"It runs on our side, so it has no access to your files or your terminal."}),s&&P(Ln,{children:[d("button",{type:"button",className:"sc-btn sc-btn-wide",style:{marginTop:16},onClick:kt,children:"Done"}),d("div",{className:"sc-opt-alt",children:d("button",{type:"button",className:"sc-alt-link",onClick:()=>h("choose"),children:"Connect a machine too"})})]})]}),g==="denied"&&P("div",{className:"sc-card",children:[d(xr,{tone:"off"}),d("h2",{className:"sc-h",id:Ce,children:"Declined"}),d("p",{className:"sc-p",children:ye==="machine"?"Nothing was connected. You can ask again whenever you like.":"That machine was not attached to your account, and the terminal has been told so."}),d("button",{type:"button",className:"sc-btn sc-btn-wide",style:{marginTop:16},onClick:()=>h("choose"),children:"Back to the start"})]})]})}function Is(e){return e?.app.name??"this app"}function Sa(e){let n=e?.app.icon_urls;if(n?.length)return n;let t=e?.app.icon_url;return t?[t]:[]}function Os(e){let n=Sa(e),[t,r]=Y([]),s=ae(l=>{l&&r(i=>i.includes(l)?i:[...i,l])},[]),o=ae(l=>s(l.currentTarget.getAttribute("src")),[s]),a=ae(l=>{l?.complete&&l.naturalWidth===0&&s(l.getAttribute("src"))},[s]);return{icon:n.find(l=>!t.includes(l)),onError:o,ref:a}}function Pa({context:e}){let{icon:n,onError:t,ref:r}=Os(e);return e?.app.mark==="soba"?d(oe,{className:"sc-app-mark"}):n?d("img",{className:"sc-app-mark",src:n,alt:"","aria-hidden":"true",ref:r,onError:t}):null}function Tt({context:e}){let{icon:n,onError:t,ref:r}=Os(e),s=e?.app.mark==="soba";return P("span",{className:"sc-app",children:[s&&d(oe,{className:"sc-app-icon"}),!s&&n&&d("img",{className:"sc-app-icon",src:n,alt:"",ref:r,onError:t}),Is(e)]})}function On({onClick:e}){return d("button",{type:"button",className:"sc-head-back",onClick:e,"aria-label":"Back",children:d("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:d("path",{d:"M15 5 8 12l7 7",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}function Nr({className:e}){return d("svg",{className:e,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:d("path",{d:"M9 5l7 7-7 7",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Bt({mark:e,still:n}){return P("span",{className:"sc-waiting","aria-hidden":"true",children:[!n&&d("svg",{className:"sc-waiting-orbit",viewBox:"0 0 100 100","aria-hidden":"true",focusable:"false",children:d("circle",{className:"sc-waiting-arc",cx:"50",cy:"50",r:"46"})}),d(e,{className:"sc-waiting-mark"})]})}function xr({tone:e}){return d("span",{className:`sc-result sc-result-${e}`,"aria-hidden":"true",children:d(je,{kind:e==="ok"?"snap":"gone",size:84})})}function Ra({machine:e}){let{runtime:n}=he(e);if(!n)return null;let t=We(n);return P("div",{className:"sc-arrived",children:[d(dr,{id:n.id,name:n.display_name}),d("span",{className:"sc-arrived-name",children:n.display_name}),P("span",{className:`sc-arrived-auth${t.tone==="warn"?" sc-tone-warn":""}`,children:[t.tone==="ok"&&d("i",{className:"sc-arrived-dot","aria-hidden":"true"}),t.tone==="ok"?"Signed in":t.tone==="warn"?"Signed out":"Could not tell"]})]})}function Gt({done:e,title:n,line:t,children:r}){return P("li",{className:"sc-stall-step",children:[P("svg",{viewBox:"0 0 20 20",className:e?"sc-stall-ok":"sc-stall-open","aria-hidden":"true",children:[d("circle",{cx:"10",cy:"10",r:"9"}),e?d("path",{d:"M6 10.3 8.7 13 14 7.5"}):P(Ln,{children:[d("path",{d:"M10 5.5v5.5"}),d("circle",{className:"sc-stall-pt",cx:"10",cy:"14.3",r:"1.2"})]})]}),d("span",{className:"sc-stall-title",children:n}),d("span",{className:"sc-stall-line",children:t}),r&&d("span",{className:"sc-stall-more",children:r})]})}function Ea({text:e}){return d(Ln,{children:e.split("`").map((n,t)=>t%2===1?d("code",{className:"sc-inline-code",children:n},t):n)})}function lt({k:e,v:n}){return P("li",{className:"sc-fact",children:[d("span",{className:"sc-fact-key",children:e}),d("span",{children:n})]})}import{forwardRef as Ia}from"react";import{jsx as Sr,jsxs as Pr}from"react/jsx-runtime";var Rr=Ia(function({machine:n,className:t,...r},s){if(!n)return null;let{ariaLabel:o,state:a}=Rn(n);return Pr("button",{ref:s,type:"button","aria-label":o,className:["sc-btn","sc-btn-connected",t].filter(Boolean).join(" "),...r,children:[Sr("span",{className:"sc-pill-tile","aria-hidden":"true",children:Sr(je,{kind:a.tone==="busy"?"serving":a.tone==="ok"?"ready":n.pairing_lost?"gone":"paused",size:16,className:"sc-pill-mark"})}),Pr("span",{className:"sc-btn-connected-text",children:[a.word,!n.pairing_lost&&Pr("span",{className:"sc-btn-connected-where",children:[" on ",j(n)]})]}),Sr("i",{className:`sc-dot sc-dot-${a.tone}`,"aria-hidden":"true"})]})});import{useEffect as Oa,useRef as Ir}from"react";var Wt=0,Er=null;function Ls(){if(typeof document>"u")return()=>{};Wt===0&&(Er=document.body.style.overflow,document.body.style.overflow="hidden"),Wt+=1;let e=!1;return()=>{e||(e=!0,Wt-=1,Wt===0&&(document.body.style.overflow=Er??"",Er=null))}}import{jsx as Ts}from"react/jsx-runtime";function ct({open:e,onClose:n,labelledBy:t,theme:r,style:s,children:o}){let a=Ir(null),l=Ir(null),i=Ir(null);return Oa(()=>{let c=a.current;if(c){if(!e){c.open&&c.close();return}return c.open||c.showModal(),document.activeElement===c&&l.current?.focus(),Ls()}},[e]),Ts("dialog",{ref:a,className:"soba-connect sc-modal","aria-labelledby":t,...r?{"data-theme":r}:{},style:s,onCancel:c=>{c.preventDefault(),n()},onPointerDown:c=>{i.current=c.target},onClick:c=>{c.target===c.currentTarget&&i.current===c.currentTarget&&n()},children:Ts("div",{className:"sc-modal-sheet",ref:l,tabIndex:-1,children:o})})}import{useEffect as Or,useRef as La}from"react";import{jsx as Ta}from"react/jsx-runtime";var wn=8;function Lr({open:e,onClose:n,anchor:t,label:r,theme:s,style:o,children:a}){let l=La(null);return Or(()=>{let i=l.current;if(!(!i||!(typeof i.showPopover=="function")))try{e?i.showPopover():i.hidePopover()}catch{}},[e]),Or(()=>{if(!e)return;let i=()=>{let u=l.current,m=t.current;if(!u||!m)return;let A=m.getBoundingClientRect(),g=u.offsetWidth,h=u.offsetHeight,y=window.innerWidth-g-wn,S=Math.max(wn,Math.min(A.right-g,Math.max(wn,y))),I=A.bottom+wn,E=A.top-wn-h,T=I+h>window.innerHeight-wn&&E>wn?E:I;u.style.left=`${Math.round(S)}px`,u.style.top=`${Math.round(T)}px`};i();let c=requestAnimationFrame(i);return window.addEventListener("scroll",i,!0),window.addEventListener("resize",i),()=>{cancelAnimationFrame(c),window.removeEventListener("scroll",i,!0),window.removeEventListener("resize",i)}},[e,t]),Or(()=>{if(!e)return;let i=u=>{u.key==="Escape"&&n()},c=u=>{let m=u.target;m&&(l.current?.contains(m)||t.current?.contains(m)||n())};return document.addEventListener("keydown",i),document.addEventListener("pointerdown",c,!0),()=>{document.removeEventListener("keydown",i),document.removeEventListener("pointerdown",c,!0)}},[e,n,t]),Ta("div",{ref:l,role:"dialog","aria-label":r,className:"soba-connect sc-pop",...s?{"data-theme":s}:{},popover:"manual",hidden:!e,style:o,children:a})}var ut=new Map,Tn=new Map,Bs=!1;function Ba(){Bs||typeof window>"u"||(Bs=!0,window.addEventListener("storage",e=>{!e.key||!ut.has(e.key)||(Tn.set(e.key,Ot(e.key)),Tr(e.key))}))}function Tr(e){for(let n of ut.get(e)??[])n()}function dt(e){return e??""}function Br(e,n){let t=dt(e);Ba();let r=ut.get(t)??new Set;return r.add(n),ut.set(t,r),()=>{r.delete(n),r.size===0&&ut.delete(t)}}function Ht(e){let n=dt(e),t=Tn.get(n);if(t!==void 0)return t;let r=e?Ot(e):null;return Tn.set(n,r),r}function Gr(){return null}function Wr(e,n){Ht(e)===null&&(Tn.set(dt(e),n),Tr(dt(e)))}function Hr(e,n){let t=dt(e);Tn.get(t)!==n&&(Tn.set(t,n),br(e,n),Tr(t))}function Je(e){let n=`${e.unit}s`;return e.reward==="unlimited"?`Unlimited ${n} on your own AI`:e.reward==="included"&&e.includedUnits!==null?`${Wa(e.includedUnits)} ${n} a month once you connect`:e.reward==="credit"&&e.creditMicros>0?`${Ga(e.creditMicros)} back each month you stay connected`:null}function Ye(e){return e==="unlimited"||e==="included"}var Ws=new Set(["user-hardware","user-subscription"]),Gs=new Set(["open-weights","frontier"]);function Ie(e){return e===null||e.length===0?!1:e.every(n=>Ws.has(n))}var Ga=e=>(e/1e6).toLocaleString("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}),Wa=e=>e.toLocaleString("en-US");function Dr(e,n){if(!(n===null||n.some(o=>Gs.has(o))))return!1;let r=e.findIndex(o=>Ws.has(o));if(r===-1)return!1;let s=e.findIndex(o=>Gs.has(o));return s===-1||r<s}import{createContext as Hs,useContext as Ds}from"react";var Ur=Hs(null);function Bn(){return Ds(Ur)}var Fr=Hs({context:null,machines:void 0,theme:"light"});function G(){return Ds(Fr)}import{useMemo as Ua}from"react";import{createContext as Ha,useContext as Da}from"react";var Qr=Ha(null);function D(){let e=Da(Qr);if(!e)throw new Error("useSoba() must be used inside a <SobaProvider>.");return e}function pt(){let{compute:e}=D();return Ua(()=>{let n=e.machines,t=[...n].sort((o,a)=>He([o,a])===o?-1:1).map(Fa),r=He([...n]),s=mn(n);return{view:t.length?"machines":e.loading?"loading":e.error?"error":"empty",machines:t,primary:r?t.find(o=>o.machine.id===r.id)??null:null,connected:e.connected,online:e.online,stalled:e.connected&&!e.online&&s?t.find(o=>o.machine.id===s.id)??null:null,loading:e.loading,error:e.error,refresh:e.refresh}},[e])}function Fa(e){let n=he(e);return{machine:e,name:j(e),state:hn(e),status:Kt(e),hardware:Xn(e),lastSeen:e.state==="offline"?Kn(e.last_seen_at):null,runtimes:Ne(e).map(t=>({runtime:t,name:t.display_name,auth:We(t),quarantined:!!t.quarantined})),runsOn:{by:n.by,name:n.runtime?.display_name??null}}}import{useCallback as Vr,useEffect as Qa,useMemo as Jr,useSyncExternalStore as Va}from"react";function Cn(e={}){let{compute:n,connect:t}=D(),{value:r,onChange:s,defaultValue:o,remember:a=!0,user:l}=e,i=r!==void 0,c=a&&!i?Ar(t.publishableKey,l):null,u=Vr(E=>Br(c,E),[c]),m=Va(u,Vr(()=>Ht(c),[c]),Gr),A=Jr(()=>tt(n.machines),[n.machines]),g=Jr(()=>rt(A),[A]);Qa(()=>{i||!o||Wr(c,o)},[i,o,c]);let h=i?r:m??o??null,{selected:y,unavailable:S}=Jr(()=>sr(A,h??null),[A,h]),I=Vr(E=>{i||Hr(c,E),s?.(E)},[i,c,s]);return{options:A,groups:g,selected:y,select:I,run:or(y),unavailable:S,pickable:An(A),loading:n.loading&&!n.machines.length}}import{jsx as mt}from"react/jsx-runtime";function Ja({className:e}){let{theme:n}=G(),t=e?`soba-connect ${e}`:"soba-connect";return mt("div",{className:t,"data-theme":n,children:mt(Yr,{})})}function Yr(){let e=pt(),n=Cn();return e.view==="loading"?mt("p",{className:"sc-note",children:"Loading\u2026"}):e.view==="error"?mt("p",{className:"sc-error",children:e.error?.message}):mt(pr,{machines:e.machines.map(t=>t.machine),model:n.selected,onPickModel:n.select})}import{useCallback as gt,useEffect as Zr,useMemo as _a,useRef as Xr,useState as Wn}from"react";import{useId as Ya}from"react";import{jsx as Gn,jsxs as Dt}from"react/jsx-runtime";function ht({open:e,onOpenChange:n,initialCode:t,onConnected:r,showStatus:s,reason:o}){let{error:a}=D(),l=Bn(),i=G(),c=()=>n(!1),u=Ya(),m=i.context?.background?.trim(),A=m?pn(m,i.context?.accent):void 0;return Dt(ct,{open:e,onClose:c,labelledBy:u,theme:i.theme,style:A,children:[a?Dt("div",{className:"sc-card",children:[Gn("h2",{className:"sc-title",id:u,children:"Could not start"}),Gn("p",{className:"sc-error",children:a.message})]}):!l&&!i.context?Dt("div",{className:"sc-card",children:[Gn("h2",{className:"sc-title",id:u,children:"One moment"}),Gn("p",{className:"sc-note",children:"Getting your compute\u2026"})]}):Gn(Mr,{client:l,active:e,onClose:c,headingId:u,theme:i.theme,initialContext:i.context,...i.machines!==void 0?{initialMachines:i.machines}:{},...t?{initialCode:t}:{},...r?{onConnected:r}:{},...s===void 0?{}:{showStatus:s},...o?{reason:o}:{}}),Dt("p",{className:"sc-modal-foot",children:[Gn(oe,{className:"sc-foot-mark"}),"Secured by Soba"]})]})}import{forwardRef as za}from"react";import{jsx as ja}from"react/jsx-runtime";var zr=za(function(n,t){let{theme:r}=G();return ja(Rr,{ref:t,"data-theme":r,...n})});import{useCallback as qa}from"react";function Za(){let{connect:e}=D(),n=pt(),t=qa(()=>e.open("manual"),[e]);return{...Rn(n.primary?.machine??null),machine:n.primary,open:t,canOpen:e.hasModal,loading:n.view==="loading"}}function jr(e){return Rn(e)}import{useCallback as Us,useEffect as Xa,useState as Ka}from"react";function qr({enabled:e=!0,intervalMs:n=3e3}={}){let t=Bn(),[r,s]=Ka(null),o=Us(async()=>{t&&s(await t.runs())},[t]);Xa(()=>{if(!e||!t)return;let l=!0,i=Se(async()=>{let c=await t.runs();l&&s(c)},n);return()=>{l=!1,i()}},[e,t,n]);let a=Us(async l=>{if(!t)throw new Error("Stopping a run needs <SobaProvider>.");await t.stopRun(l),await o().catch(()=>{})},[t,o]);return{runs:r,refresh:o,stop:a}}import{Fragment as Fs,jsx as Hn,jsxs as Qs}from"react/jsx-runtime";function vn({children:e,variant:n,className:t,initialCode:r,onConnected:s,defaultOpen:o,open:a,onOpenChange:l,showConnected:i=!0}){let{compute:c,connect:u}=D(),m=G(),{theme:A}=m,g=Bn(),[h,y]=Wn(o??!!r),S=Xr(null),I=a!==void 0,E=!I&&!o&&!r&&u.hasModal,T=I?a:E?u.isOpen:h,J=w=>{E?w?u.open("manual"):u.close():I||y(w),l?.(w)},O=Xr(T);Zr(()=>{O.current&&!T&&S.current?.focus(),O.current=T},[T]);let[M,B]=Wn(!1),{runs:C,stop:ue}=qr({enabled:M}),_=Cn(),Ae=_a(()=>M&&C?$a(c.machines,C):c.machines,[c.machines,M,C]),$=He(Ae),Pe=i&&jr($).connected,Le=gt(()=>B(!1),[]),[ee,Te]=Wn(!1),q=gt(async()=>{Te(!0);try{await c.refresh()}finally{Te(!1)}},[c]),ne=Xr(q);ne.current=q,Zr(()=>{M&&ne.current()},[M]);let[Nn,Z]=Wn(!1),[X,be]=Wn([]),ye=!!m.context?.hosted_available;Zr(()=>{if(!M||!g||!ye)return;let w=!0;return g.hosted().then(v=>{w&&be(v.credentials)}).catch(()=>{}),()=>{w=!1}},[M,g,ye]);let[pe,z]=Wn(null),te=gt(async(w,v)=>{if(g){z(null);try{await g.approveRuntime(w,v),await c.refresh()}catch(Fe){z(Fe.message)}}},[g,c]),re=gt(async(w,v)=>{if(g){z(null);try{await g.preferRuntime(w,v),await c.refresh()}catch(Fe){z(Fe.message)}}},[g,c]),Be=gt(async w=>{if(g){z(null);try{await g.disconnectHosted(w),be((await g.hosted()).credentials)}catch(v){z(v.message)}}},[g]),Q=m.context?.background?.trim(),Ge=Q?pn(Q,m.context?.accent):void 0,K=Pe&&!e,U=()=>{if(K&&!I&&!o&&!r){B(w=>!w);return}J(!0)};return Qs(Fs,{children:[K?Hn(zr,{ref:S,machine:$,"aria-haspopup":"dialog","aria-expanded":M,onClick:U,...t?{className:t}:{}}):Hn("button",{ref:S,type:"button","data-theme":A,className:["sc-btn","sc-btn-icon",n==="primary"?"sc-btn-primary":"",t].filter(Boolean).join(" "),onClick:U,children:e??Qs(Fs,{children:[Hn(oe,{className:"sc-btn-mark"}),"Connect compute"]})}),Hn(Lr,{open:M,onClose:Le,anchor:S,label:"Your compute",theme:A,...Ge?{style:Ge}:{},children:Hn(yn,{machines:Ae,hosted:X,onApproveRuntime:(w,v)=>void te(w,v),onPreferRuntime:(w,v)=>void re(w,v),onDisconnectHosted:w=>void Be(w),onRefresh:()=>void q(),refreshing:ee,model:_.selected,onPickModel:_.select,error:pe,runs:C,onStopRun:async w=>{z(null);try{await ue(w)}catch(v){throw z(v.message),v}},onPair:()=>{B(!1),E?u.open("pair"):(Z(!0),J(!0))},...m.context?.app.name?{appName:m.context.app.name}:{}})}),!E&&Hn(ht,{open:T,onOpenChange:w=>{w||Z(!1),J(w)},...Nn?{showStatus:!1}:{},...r?{initialCode:r}:{},...s?{onConnected:s}:{}})]})}function $a(e,n){return e.map(t=>{if(t.state==="offline")return t;let r=n.filter(s=>s.machine_id===t.id).length;return{...t,active:r,state:r>0?"busy":"online"}})}import{jsx as Kr,jsxs as ni}from"react/jsx-runtime";function ei({initialCode:e,onConnected:n,className:t,showStatus:r=!0}){let{theme:s}=G();return ni("div",{className:t?`soba-connect ${t}`:"soba-connect","data-theme":s,children:[r&&Kr(Yr,{}),Kr("div",{className:"sc-compute-act",children:Kr(vn,{...e?{initialCode:e}:{},...n?{onConnected:n}:{}})})]})}import{useId as mi,useState as hi}from"react";import{useCallback as $r,useEffect as js,useState as qs}from"react";import{useCallback as ti,useState as ri}from"react";function ft(){let[e,n]=ri(null);return{open:ti(()=>{n(null),gn().then(n)},[]),launch:e,note:e==="absent"?"Nothing opened here. That machine may be a different computer, or asleep.":null}}import{useCallback as Vs,useMemo as Js}from"react";function kn(e){if(!e)return null;if(typeof e=="string")return e;if(typeof Response<"u"&&e instanceof Response)return Ys(e.status);let n=e,t=n.error;return typeof t?.code=="string"?t.code:typeof t?.type=="string"?t.type:typeof n.code=="string"?n.code:typeof n.status=="number"?Ys(n.status):n.cause&&n.cause!==e?kn(n.cause):null}function Ys(e){return e===402?"payment_required":e===409?"no_compute":null}function _r(...e){let[n,t]=e,{plan:r,compute:s,connect:o}=D(),a=t?.predict??e.length===0,l=oi(si(n),s)??(a?ai(r,s):null),i=r.plan,c=r.plans,u=Js(()=>{if(l!=="payment_required")return null;let h=i?.price??0,y=i?.included_units??0;return c.find(S=>S.id!==i?.id&&S.price>h&&(S.included_units===null||S.included_units>y))??null},[l,c,i]),m=Vs(async()=>{if(!u)return;if(u.selectable){await r.select(u.id);return}let h=await r.checkout(u.id);window.location.assign(h)},[u,r]),A=o.open,g=Vs(()=>{l&&A(l)},[A,l]);return Js(()=>{if(!l)return null;let h=i?Je({unit:i.unit,reward:i.connected_reward,includedUnits:i.connected_included_units,creditMicros:i.connected_credit*1e6}):null,y=i&&Ye(i.connected_reward)?h:null;return{reason:l,...ii(l,{connectOffer:y,connected:s.connected,online:s.online,machine:mn(s.machines)?.label??null,unit:i?.unit??"message",interval:i?.interval??"month",upgrade:u!==null,resets:r.current?.period_end??null}),connectOffer:y,upgradeTo:u,connect:g,upgrade:m}},[l,i,s,u,g,m,r.current?.period_end])}function si(e){let n=kn(e);return n==="payment_required"||n==="no_compute"?n:null}function oi(e,n){return e==="no_compute"&&n.connected&&n.online?null:e}function ai(e,n){let t=e.plan;return!t||n.loading?null:Ie(t.route_allow)&&!n.online?"no_compute":e.remaining===0&&t.overage==="stop"?"payment_required":null}function ii(e,n){if(e==="payment_required"){let t=`No ${n.unit}s left this ${n.interval}`;return n.connectOffer&&!n.connected?{title:t,body:`${n.connectOffer}. Connecting takes a minute and costs nothing.`}:n.connectOffer&&!n.online?{title:t,body:`${n.connectOffer}. Waking ${n.machine??"your machine"} is enough.`}:n.upgrade?{title:t,body:n.resets?`A larger plan carries on now. This one comes back on ${zs(n.resets)}.`:"A larger plan carries on now, or wait for this one to renew."}:{title:t,body:n.resets?`Your allowance comes back on ${zs(n.resets)}.`:"Your allowance comes back at the start of the next period."}}return n.connected&&!n.online?{title:`${n.machine??"Your machine"} can't be reached`,body:"This run needs it awake and connected. Open Soba App on that machine, or connect another one."}:{title:"Nothing connected yet",body:"This app runs on AI you already pay for, on a machine of your own. Connect one and this run has somewhere to go."}}function zs(e){let n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleDateString(void 0,{day:"numeric",month:"long"})}function li(e){let{plan:n,allowance:t,connected:r,online:s,quiet:o,error:a,predict:l,at:i,waved:c}=e;if(!n)return null;let u=e.allow!==void 0?e.allow:n.route_allow;if(r){if(s)return null;let y=Ie(u);return{reason:"stalled",title:`${o??"Your machine"} can\u2019t be reached`,detail:y?"The Soba app there has stopped reporting in, so runs have nowhere to go until it is back.":"The Soba app there has stopped reporting in, so nothing will run on your own AI until it is back.",meter:null,dismissible:!1,atTheWall:!1,ownCompute:y}}let m=kn(a),A=m==="payment_required"||m==="no_compute",g=n.ask_to_connect!==!1&&Dr(n.route_prefer,u);if(!l&&!A&&!g)return null;let h=Ie(u)?ci(n.unit,Ie(n.route_allow)):Ye(n.connected_reward)?di(t,n,i):g?ui(n.unit):null;return!h||h.dismissible&&c?null:{...h,dismissible:!!h.dismissible,ownCompute:!1,atTheWall:!h.dismissible&&(!l||h.meter!==null&&h.meter.left===0)}}function es(e={}){let{at:n=.25,error:t,allow:r}=e,s=e.predict??!(e.errorGiven??t!==void 0),{plan:o,compute:a,connect:l}=D(),i=yr(l.publishableKey),[c,u]=qs(!1);js(()=>{u(wr(i))},[i]);let m=$r(()=>{u(!0),Cr(i)},[i]),A=$r(()=>l.open("manual"),[l]),g=$r(()=>l.open("no_compute"),[l]),h=ft(),[y,S]=qs(!1),{refresh:I}=a,{launch:E}=h;js(()=>{if(E===null||E==="absent")return;S(!1);let B=setInterval(()=>void I(),3e3),C=setTimeout(()=>{clearInterval(B),S(!0)},2e4);return()=>{clearInterval(B),clearTimeout(C)}},[E,I]);let T=pi(l.app?.name,it(l.connectUrl)),J=o.loading||a.loading,O=mn(a.machines),M=J?null:li({plan:o.plan,allowance:{remaining:o.remaining,included:o.included},connected:a.connected,online:a.online,quiet:O?j(O):null,error:t,predict:s,...r!==void 0?{allow:r}:{},at:n,waved:c});return{reason:M?.reason??null,visible:M!==null,title:M?.title??null,detail:M?.detail??null,meter:M?.meter??null,dismissible:M?.dismissible??!1,dismissed:c,dismiss:m,open:A,atTheWall:M?.atTheWall??!1,steps:T,stalled:M?.reason==="stalled"?{machine:O?j(O):null,ownCompute:M.ownCompute,wake:h.open,launch:h.launch,note:h.note,stuck:y,connectAnother:g}:null,loading:J}}function ci(e,n){return{reason:"needed",title:n?"This plan runs on your own AI.":`These ${e}s run on your own AI.`,detail:`Connect a machine and your ${e}s run there, free, on access you already have.`,meter:null}}function ui(e){return{reason:"preferred",title:"This plan prefers your own AI.",detail:`Connect a machine and your ${e}s run there instead, on access you already have.`,meter:null,dismissible:!0}}function di(e,n,t){let{remaining:r,included:s}=e;if(r===null||s===null||s===0||r>Math.ceil(s*t))return null;let o=Je({unit:n.unit,reward:n.connected_reward,includedUnits:n.connected_included_units,creditMicros:n.connected_credit*1e6});return o?{reason:"running",title:r===0?`No ${n.unit}s left this month.`:`${r} ${n.unit}${r===1?"":"s"} left this month.`,detail:`${o}.`,meter:{left:r,of:s}}:null}function pi(e,n){return[{lead:"Download Soba App",detail:"",...n?{linksLead:"Get it for"}:{},links:n?at.map(t=>({label:t.label,href:`${n}/download/${t.slug}`})):[]},{lead:"Connect compute",detail:"Press this, then approve the pairing when the app asks.",opens:!0,links:[]},{lead:"Let your AIs serve",detail:`It finds what is installed on that machine. Allow one, and ${e??"this app"} sends every run there.`,linksLead:"Nothing on it yet?",links:ge.map(t=>({label:t.short,href:t.install}))}]}import{Fragment as Xs,jsx as L,jsxs as Ke}from"react/jsx-runtime";function gi(e){let{className:n,fallback:t=null}=e,r=es({...e.at===void 0?{}:{at:e.at},...e.predict===void 0?{}:{predict:e.predict},...e.allow===void 0?{}:{allow:e.allow},error:e.error,errorGiven:"error"in e}),{connect:s}=D(),{theme:o}=G(),[a,l]=hi(null),i=mi(),c=L(Xs,{children:t});if(!r.visible)return c;if(r.stalled)return L(Zs,{className:n,theme:o,stalled:!0,children:L(fi,{title:r.title??"",detail:r.detail??"",stalled:r.stalled})});let u=a??r.atTheWall;return Ke(Zs,{className:n,theme:o,children:[Ke("div",{className:"sc-nudge-top",children:[Ke("div",{className:"sc-nudge-say",children:[L("p",{className:"sc-nudge-title",children:r.title}),L("p",{className:"sc-nudge-detail",children:r.detail}),Ke("button",{type:"button",className:"sc-btn sc-btn-quiet sc-nudge-more","aria-expanded":u,"aria-controls":i,onClick:()=>l(!u),children:[u?"Hide the details":"How it works",L(bi,{})]})]}),r.dismissible?L("button",{type:"button",className:"sc-nudge-dismiss","aria-label":"Dismiss",title:"Dismiss",onClick:r.dismiss,children:L(Ai,{})}):null]}),u?L("ol",{className:"sc-nudge-steps",id:i,children:r.steps.map(m=>Ke("li",{children:[m.opens?L("button",{type:"button",className:"sc-step-lead",onClick:()=>s.open("manual"),children:m.lead}):L("strong",{children:m.lead}),m.detail?L("span",{children:m.detail}):null,m.links.length>0?Ke("span",{className:"sc-step-links",children:[m.linksLead,m.links.map(A=>L("a",{href:A.href,target:"_blank",rel:"noreferrer noopener",children:A.label},A.href))]}):null]},m.lead))}):null,L(vn,{variant:"primary"})]})}function Zs({className:e,theme:n,stalled:t,children:r}){return L("div",{className:e?`soba-connect sc-fill ${e}`:"soba-connect sc-fill","data-theme":n,children:L("div",{className:t?"sc-nudge sc-nudge-stalled":"sc-nudge",children:r})})}function fi({title:e,detail:n,stalled:t}){return Ke(Xs,{children:[L("div",{className:"sc-nudge-top",children:Ke("div",{className:"sc-nudge-say",children:[L("p",{className:"sc-nudge-title",children:e}),L("p",{className:"sc-nudge-detail",children:n}),t.note&&L("p",{className:"sc-nudge-note",children:t.note}),t.stuck&&L("p",{className:"sc-nudge-note",children:"The Soba app is open, but this machine still isn\u2019t reporting in. It may no longer be connected to this app."}),(t.launch==="absent"||t.stuck)&&L("button",{type:"button",className:"sc-btn sc-btn-quiet sc-nudge-more",onClick:t.connectAnother,children:t.stuck?"Connect it again":"Connect another machine"})]})}),L("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:t.wake,children:"Open Soba App"})]})}function Ai(){return L("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",className:"sc-nudge-x",children:L("path",{d:"m4.8 4.8 6.4 6.4M11.2 4.8l-6.4 6.4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}function bi(){return L("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",className:"sc-nudge-chev",children:L("path",{d:"M4.5 6.5 8 10l3.5-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}var yi=new Set(["delta","thinking","status","done","error"]);function Dn(e){let n;try{n=JSON.parse(e)}catch{return null}if(!n||typeof n!="object")return null;let t=n,r=t.type==="event"?t.event:t;if(!r||typeof r!="object")return null;let s=r;if(typeof s.type!="string"||!yi.has(s.type))return null;let o={type:s.type};return typeof s.text=="string"&&(o.text=s.text),typeof s.message=="string"&&(o.message=s.message),typeof s.tool=="string"&&(o.tool=s.tool),typeof s.tier=="string"&&(o.tier=s.tier),s.usage&&typeof s.usage=="object"&&(o.usage=s.usage),typeof s.session=="string"&&(o.session=s.session),typeof s.toolInput=="string"&&(o.toolInput=s.toolInput),s.git&&typeof s.git=="object"&&(o.git=s.git),s.turn&&typeof s.turn=="object"&&typeof s.turn.text=="string"&&(o.turn={text:s.turn.text}),typeof s.reason=="string"&&(o.reason=s.reason),typeof s.retryable=="boolean"&&(o.retryable=s.retryable),(s.state==="interrupted"||s.state==="resumed")&&(o.state=s.state),o}async function*ns(e){let n=e.body;if(!n)throw new Error("That run response had no body to stream.");let t=(e.headers.get("content-type")??"").includes("ndjson"),r=n.getReader(),s=new TextDecoder,o="",a=[];try{for(;;){let i=await r.read();if(i.done)break;for(o+=s.decode(i.value,{stream:!0});;){let c=o.indexOf(`
|
|
3
|
-
`);if(
|
|
4
|
-
`);if(
|
|
5
|
-
`);if(
|
|
2
|
+
var Zt={ready:{arc:!0},serving:{arc:!0,slot:"stream"},paused:{arc:!1,slot:"zzz"},thinking:{arc:!1,slot:"dots"},connecting:{arc:!1,slot:"orbit"},attention:{arc:!1,slot:"bang"},gone:{arc:!1,slot:"cross"},snap:{arc:!1,slot:"snap"},listening:{arc:!1,slot:"bars"},permission:{arc:!1,slot:"ring"},ai:{arc:!1,slot:"sparks"}};var Xt="105 162 420 420",Kt="M407.1 308.9 A158 158 0 1 0 407.1 491.1 A116 116 0 0 1 407.1 308.9 Z",hn="M448.5 320 A110 110 0 0 1 448.5 480";import{Fragment as qn,jsx as S,jsxs as Xe}from"react/jsx-runtime";function Ze({kind:e,size:n=44,className:t}){let r=Zt[e];return Xe("svg",{className:`bx${t?` ${t}`:""}`,"data-expression":e,viewBox:Xt,overflow:"visible",width:n,height:n,"aria-hidden":"true",children:[S("path",{d:Kt,fill:"currentColor"}),S("path",{className:"bx-arc",d:hn,fill:"none",stroke:"currentColor",strokeWidth:17,strokeLinecap:"round"}),r.slot==="stream"&&S(Io,{}),r.slot==="zzz"&&S(Oo,{}),r.slot==="dots"&&S(Lo,{}),r.slot==="bang"&&S(To,{}),r.slot==="orbit"&&S(Bo,{}),r.slot==="cross"&&S(Go,{}),r.slot==="snap"&&S(Wo,{}),r.slot==="bars"&&S(Ho,{}),r.slot==="ring"&&S(Do,{}),r.slot==="sparks"&&S(Uo,{})]})}function Io(){return S("path",{className:"bx-st",d:"M475.3 290.3 A150 150 0 0 1 475.3 509.7",fill:"none",stroke:"currentColor",strokeWidth:"15",strokeLinecap:"round",strokeDasharray:"0.1 31"})}function Oo(){return Xe(qn,{children:[S("g",{className:"bx-z1",children:S("path",{d:"M444 372 H496 L444 436 H496",fill:"none",stroke:"currentColor",strokeWidth:"20",strokeLinecap:"round",strokeLinejoin:"round"})}),S("g",{className:"bx-z2",children:S("path",{d:"M492 300 H522 L492 338 H522",fill:"none",stroke:"currentColor",strokeWidth:"15",strokeLinecap:"round",strokeLinejoin:"round"})})]})}function Lo(){return Xe(qn,{children:[S("circle",{className:"bx-th",cx:"463.1",cy:"336.9",r:"21",fill:"currentColor"}),S("circle",{className:"bx-th bx-th2",cx:"483",cy:"400",r:"21",fill:"currentColor"}),S("circle",{className:"bx-th bx-th3",cx:"463.1",cy:"463.1",r:"21",fill:"currentColor"})]})}function To(){return Xe("g",{className:"bx-at",children:[S("line",{x1:"490",y1:"312",x2:"490",y2:"414",stroke:"currentColor",strokeWidth:"46",strokeLinecap:"round"}),S("circle",{cx:"490",cy:"484",r:"28",fill:"currentColor"})]})}function Bo(){return Xe("g",{className:"bx-ob",children:[S("path",{d:hn,fill:"none",stroke:"var(--tile-bg, transparent)",strokeWidth:41,strokeLinecap:"round"}),S("path",{d:hn,fill:"none",stroke:"currentColor",strokeWidth:17,strokeLinecap:"round"})]})}function Go(){return Xe(qn,{children:[S("path",{className:"bx-xa",d:hn,fill:"none",stroke:"currentColor",strokeWidth:17,strokeLinecap:"round"}),S("g",{className:"bx-xx",children:S("path",{d:"M442 364 L514 436 M514 364 L442 436",fill:"none",stroke:"currentColor",strokeWidth:"24",strokeLinecap:"round"})})]})}function Wo(){return S("path",{className:"bx-snap",d:hn,fill:"none",stroke:"currentColor",strokeWidth:17,strokeLinecap:"round"})}function Ho(){return Xe("g",{stroke:"currentColor",strokeWidth:"17",strokeLinecap:"round",children:[S("line",{className:"bx-vb",x1:"452",y1:"370",x2:"452",y2:"430"}),S("line",{className:"bx-vb bx-vb2",x1:"482",y1:"330",x2:"482",y2:"470"}),S("line",{className:"bx-vb bx-vb3",x1:"512",y1:"355",x2:"512",y2:"445"})]})}function Do(){return S(qn,{children:[[450,366],[474,376],[484,400],[474,424],[450,434],[426,424],[416,400],[426,376]].map(([n,t],r)=>S("circle",{className:"bx-w",cx:n,cy:t,r:"11",fill:"currentColor",style:{animationDelay:`${-1.2+r*.15}s`}},r))})}function Uo(){return Xe(qn,{children:[S("g",{className:"bx-sp",children:S("path",{d:"M460 300 Q465.4 324.6 490 330 Q465.4 335.4 460 360 Q454.6 335.4 430 330 Q454.6 324.6 460 300 Z",fill:"currentColor"})}),S("g",{className:"bx-sp bx-sp2",children:S("path",{d:"M486 356 Q493.92 392.08 530 400 Q493.92 407.92 486 444 Q478.08 407.92 442 400 Q478.08 392.08 486 356 Z",fill:"currentColor"})}),S("g",{className:"bx-sp bx-sp3",children:S("path",{d:"M460 440 Q465.4 464.6 490 470 Q465.4 475.4 460 500 Q454.6 475.4 430 470 Q454.6 464.6 460 440 Z",fill:"currentColor"})})]})}var ws={"claude-code":{small:"haiku",large:"opus"}};function Cs(e){return e==="small"||e==="large"}function vs(e,n){return ws[e]?.[n]}function Mt(e){let n=ws[e];return!!(n?.small||n?.large)}import{useEffect as la,useRef as ca,useState as at}from"react";var Pn=class extends Error{status;constructor(n,t){super(n),this.name="ConnectError",this.status=t}},Fo=5*6e4,Zn=class{session;baseUrl;doFetch;lastMachines=null;machinesUrl=null;gatewayBackUntil=0;constructor(n){this.session=n.session,this.baseUrl=(n.baseUrl??"").replace(/\/+$/,""),this.doFetch=n.fetchImpl??fetch.bind(globalThis)}async context(){let n=await this.request("GET","/v1/connect");return this.setMachinesUrl(n.machines_url),n}setMachinesUrl(n){typeof n=="string"&&/^https?:\/\//.test(n)&&(this.machinesUrl=n)}async machines(){let n=this.lastMachines,t=n?`?v=${encodeURIComponent(n.version)}`:"",r;if(this.machinesUrl&&Date.now()>=this.gatewayBackUntil)try{r=await this.request("GET",`${this.machinesUrl}${t}`)}catch(a){if(a instanceof Pn&&a.status===401)throw a;this.gatewayBackUntil=Date.now()+Fo}if(r??=await this.request("GET",`/v1/machines${t}`),r.unchanged&&n)return n.machines;let s=Array.isArray(r.machines)?r.machines:[];return this.lastMachines=typeof r.version=="string"?{version:r.version,machines:s}:null,s}async runs(){let n=await this.request("GET","/v1/machines/runs");return Array.isArray(n.runs)?n.runs:[]}async stopRun(n){let t=this.machinesUrl?.replace(/\/v1\/machines$/,"");if(!t)throw new Pn("This page can't stop runs yet: it hasn't been told where Soba's gateway is.",501);await this.request("POST",`${t}/v1/runs/${encodeURIComponent(n)}/stop`,{})}lookup(n){return this.request("GET",`/v1/device/lookup?code=${encodeURIComponent(n)}`)}approve(n){return this.request("POST","/v1/device/approve",{user_code:n})}claim(n){return this.request("POST","/v1/device/claim",{pairing_nonce:n})}deny(n){return this.request("POST","/v1/device/deny",{user_code:n})}plans(){return this.request("GET","/v1/plans")}selectPlan(n){return this.request("POST","/v1/plans/select",{plan:n})}checkoutPlan(n,t){return this.request("POST","/v1/plans/checkout",{plan:n,...t?.successUrl?{success_url:t.successUrl}:{},...t?.cancelUrl?{cancel_url:t.cancelUrl}:{}})}leavePlan(){return this.request("DELETE","/v1/plans/select")}hosted(){return this.request("GET","/v1/hosted")}startHosted(){return this.request("POST","/v1/hosted/start")}disconnectHosted(n){return this.request("DELETE",n?`/v1/hosted?provider=${encodeURIComponent(n)}`:"/v1/hosted")}approveRuntime(n,t){return this.request("POST","/v1/runtimes/approve",{machine_id:n,runtime_id:t})}preferRuntime(n,t){return this.request("POST","/v1/runtimes/prefer",{machine_id:n,runtime_id:t})}async request(n,t,r){let s=await this.doFetch(/^https?:\/\//.test(t)?t:`${this.baseUrl}${t}`,{method:n,headers:{authorization:`Bearer ${this.session}`,...r?{"content-type":"application/json"}:{}},...r?{body:JSON.stringify(r)}:{}}),a={};try{a=await s.json()}catch{}if(!s.ok){let i=typeof a.error=="string"?a.error:`Request failed (${s.status})`;throw new Pn(i,s.status)}return a}};function Xn(e){let n=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!n?.[1])return"#ffffff";let t=n[1].length===3?[...n[1]].map(a=>a+a).join(""):n[1],r=a=>{let i=Number.parseInt(t.slice(a*2,a*2+2),16)/255;return i<=.04045?i/12.92:((i+.055)/1.055)**2.4};return .2126*r(0)+.7152*r(1)+.0722*r(2)>.45?"#101012":"#ffffff"}function _t(e){let n=/^#?([0-9a-f]{3}|[0-9a-f]{6})$/i.exec(e.trim());if(!n?.[1])return null;let t=n[1].length===3?[...n[1]].map(r=>r+r).join(""):n[1];return[0,1,2].map(r=>Number.parseInt(t.slice(r*2,r*2+2),16))}function Rn(e,n,t){let r=_t(e),s=_t(n);return!r||!s?e:`#${r.map((i,c)=>Math.round(i+(s[c]-i)*t)).map(i=>i.toString(16).padStart(2,"0")).join("")}`}function gn(e,n){if(!_t(e))return{};let t=Xn(e),r=n?.trim();return{"--sc-ground":e,"--sc-shell":e,"--sc-sheet":Rn(e,t,.07),"--sc-raised":Rn(e,t,.13),"--sc-line":Rn(e,t,.18),"--sc-line-2":Rn(e,t,.28),"--sc-text":t,"--sc-text-2":Rn(t,e,.15),"--sc-muted":Rn(t,e,.38),...r?{"--sc-accent":r,"--sc-accent-fg":Xn(r)}:{"--sc-accent":t,"--sc-accent-fg":e}}}function De(e){return e.authenticated===!0?{tone:"ok",text:"signed in"}:e.authenticated===!1?{tone:"warn",text:e.auth_hint??"signed out on that machine"}:{tone:"unknown",text:"could not tell"}}function Kn(e){let{platform:n,arch:t}=e;if(!n)return null;let r=n==="darwin"||n==="macos",s=r?"Mac":n==="win32"||n==="windows"?"Windows PC":"Linux machine";return r?`${t==="aarch64"||t==="arm64"?"Apple silicon ":""}${s}`:s}function fn(e){return e.find(n=>n.state==="offline")??null}function $t(e){return e.state==="busy"?{tone:"busy",text:`serving ${e.active} of ${e.capacity}`}:e.state==="online"?{tone:"ok",text:"connected"}:{tone:"off",text:"asleep or offline"}}function q(e){let n=e.label?.trim(),t=e.name?.trim();return n&&(!t||n!==t)?n:(t??n??"").replace(/\.(local|lan|home|internal)$/i,"").replace(/[-_]+/g," ").trim()||n||"This machine"}function St(e,n){let t=s=>s.state==="busy"?0:s.state==="online"?1:2,r=s=>s.last_seen_at?Date.parse(s.last_seen_at):0;return t(e)-t(n)||r(n)-r(e)}function Ue(e){return[...e].sort(St)[0]??null}function An(e){return e?e.state==="busy"?{tone:"busy",word:"Serving"}:e.state==="online"?{tone:"ok",word:"Connected"}:e.pairing_lost?{tone:"off",word:"Not connected"}:{tone:"off",word:"Asleep"}:{tone:"off",word:"No compute"}}function En(e){let n=An(e);return{label:e?n.word:"Connect compute",ariaLabel:e?e.pairing_lost?`${q(e)} is not connected`:`${n.word} on ${q(e)}`:"Connect compute",connected:e!==null,state:n}}function Ye(e){return e.state==="online"||e.state==="busy"}function _n(e){if(!e)return"never seen";let n=Date.parse(e);if(Number.isNaN(n))return"never seen";let t=Date.now()-n,r=6e4;return t<2*r?"just now":t<60*r?`${Math.floor(t/r)} min ago`:t<24*60*r?`${Math.floor(t/(60*r))} hr ago`:`${Math.floor(t/(24*60*r))} days ago`}function er(e){return e.runtimes.filter(n=>n.id!=="shell")}function ge(e){return e.runtimes.filter(n=>n.id!=="shell"&&!n.quarantined&&!n.absent)}function Ne(e){let n=i=>i?e.runtimes.find(c=>c.id===i)??null:null;if(e.requested_runtime)return{by:"app",runtimeId:e.requested_runtime,runtime:n(e.requested_runtime)};let t=ge(e),r=t.find(i=>i.id===e.preferred_runtime);if(r)return{by:"you",runtimeId:r.id,runtime:r};let s=i=>i.id==="claude-code"?0:i.id==="codex"?1:2,a=[...t].sort((i,c)=>s(i)-s(c))[0]??null;return{by:"default",runtimeId:a?.id??null,runtime:a}}var nr="soba";function $n(){return`${nr}://show`}function et(e,n,t){let r=`${nr}://connect?url=${encodeURIComponent(e)}`;return n&&(r+=`&nonce=${encodeURIComponent(n)}`),t&&(r+=`&want=${encodeURIComponent(t)}`),r}function nt(){let e=globalThis.crypto;if(!e?.getRandomValues)return null;let n=e.getRandomValues(new Uint8Array(32)),t="";for(let r of n)t+=String.fromCharCode(r);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}var Qo=1600;function tr(e={}){return sr(e)}async function rr(e,n={}){if(typeof window>"u"||typeof document>"u")return"unknown";let t=sr(n);try{window.location.href=et(e,n.nonce,n.want)}catch{return"absent"}return t}async function bn(e={}){if(typeof window>"u"||typeof document>"u")return"unknown";let n=sr(e);try{window.location.href=$n()}catch{return"absent"}return n}async function sr(e){if(typeof window>"u"||typeof document>"u")return"unknown";let n=e.graceMs??Qo,t=document.visibilityState==="visible"&&document.hasFocus(),r=!1,s=()=>{r=!0},a=()=>{document.visibilityState==="hidden"&&(r=!0)};return window.addEventListener("blur",s),window.addEventListener("pagehide",s),document.addEventListener("visibilitychange",a),await new Promise(i=>setTimeout(i,n)),window.removeEventListener("blur",s),window.removeEventListener("pagehide",s),document.removeEventListener("visibilitychange",a),t?r?"opened":"absent":"unknown"}var ks={"claude-code":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAABGdBTUEAALGPC/xhBQAAACBjSFJNAAB6JgAAgIQAAPoAAACA6AAAdTAAAOpgAAA6mAAAF3CculE8AAAARGVYSWZNTQAqAAAACAABh2kABAAAAAEAAAAaAAAAAAADoAEAAwAAAAEAAQAAoAIABAAAAAEAAABAoAMABAAAAAEAAABAAAAAAEZRQrAAAAHLaVRYdFhNTDpjb20uYWRvYmUueG1wAAAAAAA8eDp4bXBtZXRhIHhtbG5zOng9ImFkb2JlOm5zOm1ldGEvIiB4OnhtcHRrPSJYTVAgQ29yZSA2LjAuMCI+CiAgIDxyZGY6UkRGIHhtbG5zOnJkZj0iaHR0cDovL3d3dy53My5vcmcvMTk5OS8wMi8yMi1yZGYtc3ludGF4LW5zIyI+CiAgICAgIDxyZGY6RGVzY3JpcHRpb24gcmRmOmFib3V0PSIiCiAgICAgICAgICAgIHhtbG5zOmV4aWY9Imh0dHA6Ly9ucy5hZG9iZS5jb20vZXhpZi8xLjAvIj4KICAgICAgICAgPGV4aWY6Q29sb3JTcGFjZT4xPC9leGlmOkNvbG9yU3BhY2U+CiAgICAgICAgIDxleGlmOlBpeGVsWERpbWVuc2lvbj4yNTY8L2V4aWY6UGl4ZWxYRGltZW5zaW9uPgogICAgICAgICA8ZXhpZjpQaXhlbFlEaW1lbnNpb24+MjU2PC9leGlmOlBpeGVsWURpbWVuc2lvbj4KICAgICAgPC9yZGY6RGVzY3JpcHRpb24+CiAgIDwvcmRmOlJERj4KPC94OnhtcG1ldGE+CuYattQAABdYSURBVHgB7VpplF1Vld73vqmqXs1VqaQqEwFCiAjYytiCpqFBBVwiTSCsBmVpQ69mob3Qpl3dy9Wy+oc03T/8IYqNA4LaC8OgMgQJCDIKSBjDFAkhqaQqqXl69epN9/b3fefeStGpW0GX/zoneXc4wz57f3s4+5xbZofKIQQOIXAIgUMI/P9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o1qTXeWuHGJXQ91vI+YW5NAQrbWT9czryZ/OB3LdmMDFUGiPQm85+OMP6Ul+i323zeItTiodoFLQBcWTXwGzxn0BijiYgzGcTQWguIgdoz8sWQSMR3A0hMCPb5owh4whw+YR7MJ6ktMo+EciiobYAFJqDE4zPhtDRKVwF5DSuQcnOKR2AP8Cui93e4Bz9uMXV0/FBGGZ/BaqmGMFGWMFNw7QyOZML4XaHNc3OnIDZkE7cOUzf5QfCGN8C6GkgqwSeXP8HIxHP4MmOI/a321n07gV9IjNBy7QnyZrED37ivv4/PQyO8w10e8KcphEWKSNuIPY8QfKrR4Ye+yCnB3kPeGZiJkLwBzq+EZK2GxGe7nRW12PSGeADM/EmtjG4qej4OQ90YuRN/rYcWzMU8ZPuWbyCHPgbYT3vQ4Pp0/OM7QYx6VGXgMbdGN/AVNIT3cAadkl50K7+QtmgFGBskwuuGBL+EfnaxNQFH3ihDqM12j6lTyyVn4H4E6hAx4NkYwy1G0DlAmsUN8ESX6/+H/GpiUBv4FSyLhydRRp0cAAAAASUVORK5CYII="};import{useEffect as Ns,useRef as Vo}from"react";import{Fragment as zo,jsx as xe,jsxs as or}from"react/jsx-runtime";function tt({anchor:e,label:n,options:t,current:r,onClose:s,onPick:a}){let i=Vo(null);return Ns(()=>{let o=i.current,l=e.current;if(!o||!l)return;try{typeof o.showPopover=="function"&&o.showPopover()}catch{}let u=l.getBoundingClientRect();u.width>o.offsetWidth&&(o.style.width=`${Math.round(u.width)}px`);let m=o.offsetWidth,f=o.offsetHeight,g=u.width>248?u.left:u.right-m,h=Math.max(8,Math.min(g,window.innerWidth-m-8)),y=u.bottom+6,M=y+f>window.innerHeight-8&&u.top-6-f>8?u.top-6-f:y;o.style.left=`${Math.round(h)}px`,o.style.top=`${Math.round(M)}px`,o.querySelector('[aria-checked="true"]')?.focus()},[e]),Ns(()=>{let o=l=>{let u=l.target;!u||i.current?.contains(u)||e.current?.contains(u)||s()};return document.addEventListener("pointerdown",o,!0),()=>document.removeEventListener("pointerdown",o,!0)},[e,s]),xe("div",{ref:i,role:"menu","aria-label":n,className:"sc-menu",popover:"manual",onKeyDown:o=>{let l=[...i.current?.querySelectorAll("[role=menuitemradio]")??[]],u=l.indexOf(document.activeElement);if(o.key==="Escape")o.stopPropagation(),o.nativeEvent.stopImmediatePropagation(),s(),e.current?.focus();else if(o.key==="ArrowDown"||o.key==="ArrowUp"){o.preventDefault();let m=o.key==="ArrowDown"?1:-1;l[(u+m+l.length)%l.length]?.focus()}else o.key==="Tab"&&s()},children:t.map(o=>xe(Jo,{option:o,checked:r===o.id,onClose:s,onPick:a},o.id??""))})}function Jo({option:e,checked:n,onClose:t,onPick:r}){return or(zo,{children:[e.heading?xe("div",{className:"sc-menu-head",role:"presentation",children:e.heading}):e.rule?xe("div",{className:"sc-menu-sep"}):null,or("button",{type:"button",role:"menuitemradio","aria-checked":n,className:"sc-menu-item",onClick:()=>{e.onChoose?(e.onChoose(),t()):n?t():r(e.id)},children:[e.glyph,or("span",{className:"sc-menu-text",children:[xe("span",{className:"sc-menu-label",children:e.label}),e.note&&xe("span",{className:"sc-menu-note",children:e.note})]}),e.trailing?xe("span",{className:"sc-menu-act",children:e.trailing}):n&&xe(Yo,{})]})]})}function Yo(){return xe("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-menu-check",children:xe("path",{d:"M5 12.5l4.5 4.5L19 7.5",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function In({open:e}){return xe("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e?"sc-chev sc-chev-open":"sc-chev",children:xe("path",{d:"M9 6l6 6-6 6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}import{useRef as Zo,useState as Xo}from"react";var jo={haiku:"Haiku",sonnet:"Sonnet",opus:"Opus",fable:"Fable"};function yn(e){return jo[e]??e}function rt(e){let n=[...e].sort(St),t=Ue([...e]),r=t?Ne(t):null,a=[{id:"auto",kind:"auto",label:"Automatic",model:"auto",...r?.runtime?{note:r.runtime.default_model?`Uses ${yn(r.runtime.default_model)}`:`Uses ${r.runtime.display_name}`}:{}}];n.some(u=>ge(u).some(m=>Mt(m.id)))&&a.push({id:"small",kind:"size",label:"Fast",note:"quick and cheap",model:"small"},{id:"large",kind:"size",label:"Best",note:"the most capable",model:"large"});let c=new Map;for(let u of n)for(let m of ge(u))for(let f of m.models){if(!f)continue;let g=`${m.id}/${f}`,h=c.get(g);if(h){h.machines.add(q(u));continue}c.set(g,{option:{id:g,kind:"named",label:yn(f),model:f,runtime:m.id,runtimeName:m.display_name,costClass:m.cost_class},machines:new Set([q(u)])})}let o=new Set;for(let{machines:u}of c.values())for(let m of u)o.add(m);let l=o.size>1;for(let{option:u,machines:m}of c.values()){let f=l&&m.size===1?[...m][0]:void 0;a.push(f?{...u,machine:f}:u)}return a}function st(e){let n=[],t=[];for(let r of e){if(r.kind!=="named"){n.push(r);continue}let s=r.runtimeName??r.runtime??"",a=t.find(i=>i.heading===s);a?a.options.push(r):t.push({heading:s,options:[r]})}return n.length?[{heading:null,options:n},...t]:t}function ar(e,n){let t=e.find(s=>s.kind==="auto")??{id:"auto",kind:"auto",label:"Automatic",model:"auto"};if(!n||n==="auto")return{selected:t,unavailable:null};let r=e.find(s=>s.id===n);return r?{selected:r,unavailable:null}:{selected:t,unavailable:n}}function ir(e){return e.runtime?{model:e.model,runtime:e.runtime}:{model:e.model}}function Ke(e){return e.length>1}var qo={opus:"Most capable. Best for hard, multi-step work.",sonnet:"Balanced speed and quality for everyday runs.",haiku:"Fastest. Best for quick, simple runs."};function lr(e){if(e.kind==="auto"){let t=e.note?.replace(/^Uses /,"");return t?`Soba picks the model for each run. Currently using ${t}.`:"Soba picks the model for each run."}if(e.kind==="size")return e.id==="small"?"Quick and cheap. Whichever small model the agent serving has.":"The most capable model the agent serving has.";let n=qo[e.model];return n?e.machine?`${n} On ${e.machine}.`:n:e.machine?`On ${e.machine}.`:void 0}import{jsx as Rt,jsxs as xs}from"react/jsx-runtime";function ot({options:e,selected:n,onPick:t,caption:r,onOpen:s,disabled:a,className:i}){let[c,o]=Xo(!1),l=Zo(null);if(!Ke(e))return null;let u=i?`sc-mp ${i}`:"sc-mp";return xs("span",{className:u,children:[r&&Rt("span",{className:"sc-mp-cap",children:r}),xs("button",{ref:l,type:"button",className:"sc-mp-btn",...s?{}:{"aria-haspopup":"menu","aria-expanded":c},"aria-label":`Model: ${n.label}. Change`,disabled:a,onClick:s??(()=>o(m=>!m)),children:[Rt("span",{className:"sc-mp-label",children:n.label}),Rt(In,{open:!s})]}),c&&!s&&Rt(tt,{anchor:l,label:"Which model answers",options:Ko(e),current:n.id,onClose:()=>o(!1),onPick:m=>{o(!1),m&&t(m)}})]})}function Ko(e){let n=[];for(let t of st(e))t.options.forEach((r,s)=>{let a=_o(r);n.push({id:r.id,label:r.label,...a?{note:a}:{},...t.heading&&s===0?{heading:t.heading}:{},...!t.heading&&r.kind==="size"&&s===1?{rule:!0}:{}})});return n}function _o(e){return e.kind!=="named"?e.note:e.machine?`on ${e.machine}`:void 0}import{useEffect as $o,useRef as ea}from"react";import{jsx as pe,jsxs as Pt}from"react/jsx-runtime";function cr({options:e,selected:n,onPick:t,onClose:r,busy:s}){let a=ea(null);return $o(()=>{(a.current?.querySelector('[aria-checked="true"]')??a.current?.querySelector("[role=radio]"))?.focus()},[]),Pt("div",{className:"sc-tray sc-screen",onKeyDown:o=>{o.key==="Escape"&&(o.stopPropagation(),r())},children:[Pt("div",{className:"sc-screen-head",children:[pe("button",{type:"button",className:"sc-back","aria-label":"Back",onClick:r,disabled:s,children:pe(na,{})}),pe("h2",{className:"sc-screen-title",children:"Model"})]}),pe("div",{ref:a,role:"radiogroup","aria-label":"Model",className:"sc-group-card sc-mopts",onKeyDown:o=>{if(!["ArrowDown","ArrowRight","ArrowUp","ArrowLeft"].includes(o.key)||s)return;o.preventDefault();let u=e.findIndex(g=>g.id===n),m=o.key==="ArrowDown"||o.key==="ArrowRight"?1:-1,f=e[((u<0?0:u)+m+e.length)%e.length];f&&t(f.id)},children:e.map(o=>{let l=o.id===n,u=lr(o);return Pt("button",{type:"button",role:"radio","aria-checked":l,tabIndex:l?0:-1,className:"sc-mopt",disabled:s,onClick:()=>t(o.id),children:[Pt("span",{className:"sc-mopt-say",children:[pe("span",{className:"sc-mopt-name",children:o.label}),u&&pe("span",{className:"sc-mopt-desc",children:u})]}),pe("span",{className:l?"sc-ring sc-ring-on":"sc-ring","aria-hidden":"true",children:l&&pe(ta,{})})]},o.id)})}),pe("p",{className:"sc-screen-foot",children:"Applies to new runs. Runs already in progress keep the model they started with."}),pe("button",{type:"button",className:"sc-act-go",onClick:r,disabled:s,children:"Done"})]})}function na(){return pe("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-back-glyph",children:pe("path",{d:"M15 6l-6 6 6 6",fill:"none",stroke:"currentColor",strokeWidth:"2.2",strokeLinecap:"round",strokeLinejoin:"round"})})}function ta(){return pe("svg",{viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",className:"sc-ring-tick",children:pe("path",{d:"M5 10.5l3.2 3.2L15 6.5",fill:"none",stroke:"currentColor",strokeWidth:"2.6",strokeLinecap:"round",strokeLinejoin:"round"})})}import{jsx as Me,jsxs as sa}from"react/jsx-runtime";function re({className:e}){return sa("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:[Me("path",{d:"M18.125 7.039A8.6 8.6 0 1 0 18.125 16.961A6 6 0 0 1 18.125 7.039Z",fill:"currentColor"}),Me("path",{d:"M19.925 7.039A8.6 8.6 0 0 1 19.925 16.961A6 6 0 0 0 19.925 7.039Z",fill:"currentColor"})]})}function Ms({className:e}){return Me("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:Me("path",{fill:"currentColor",d:"M17.3041 3.541h-3.6718l6.696 16.918H24Zm-10.6082 0L0 20.459h3.7442l1.3693-3.5527h7.0052l1.3693 3.5528h3.7442L10.5363 3.5409Zm-.3712 10.2232 2.2914-5.9456 2.2914 5.9456Z"})})}function wn({className:e}){return Me("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:Me("path",{fill:"currentColor",d:"M22.2819 9.8211a5.9847 5.9847 0 0 0-.5157-4.9108 6.0462 6.0462 0 0 0-6.5098-2.9A6.0651 6.0651 0 0 0 4.9807 4.1818a5.9847 5.9847 0 0 0-3.9977 2.9 6.0462 6.0462 0 0 0 .7427 7.0966 5.98 5.98 0 0 0 .511 4.9107 6.051 6.051 0 0 0 6.5146 2.9001A5.9847 5.9847 0 0 0 13.2599 24a6.0557 6.0557 0 0 0 5.7718-4.2058 5.9894 5.9894 0 0 0 3.9977-2.9001 6.0557 6.0557 0 0 0-.7475-7.0729zm-9.022 12.6081a4.4755 4.4755 0 0 1-2.8764-1.0408l.1419-.0804 4.7783-2.7582a.7948.7948 0 0 0 .3927-.6813v-6.7369l2.02 1.1686a.071.071 0 0 1 .038.052v5.5826a4.504 4.504 0 0 1-4.4945 4.4944zm-9.6607-4.1254a4.4708 4.4708 0 0 1-.5346-3.0137l.142.0852 4.783 2.7582a.7712.7712 0 0 0 .7806 0l5.8428-3.3685v2.3324a.0804.0804 0 0 1-.0332.0615L9.74 19.9502a4.4992 4.4992 0 0 1-6.1408-1.6464zM2.3408 7.8956a4.485 4.485 0 0 1 2.3655-1.9728V11.6a.7664.7664 0 0 0 .3879.6765l5.8144 3.3543-2.0201 1.1685a.0757.0757 0 0 1-.071 0l-4.8303-2.7865A4.504 4.504 0 0 1 2.3408 7.872zm16.5963 3.8558L13.1038 8.364 15.1192 7.2a.0757.0757 0 0 1 .071 0l4.8303 2.7913a4.4944 4.4944 0 0 1-.6765 8.1042v-5.6772a.79.79 0 0 0-.407-.667zm2.0107-3.0231l-.142-.0852-4.7735-2.7818a.7759.7759 0 0 0-.7854 0L9.409 9.2297V6.8974a.0662.0662 0 0 1 .0284-.0615l4.8303-2.7866a4.4992 4.4992 0 0 1 6.6802 4.66zM8.3065 12.863l-2.02-1.1638a.0804.0804 0 0 1-.038-.0567V6.0742a4.4992 4.4992 0 0 1 7.3757-3.4537l-.142.0805L8.704 5.459a.7948.7948 0 0 0-.3927.6813zm1.0976-2.3654l2.602-1.4998 2.6069 1.4998v2.9994l-2.5974 1.4997-2.6067-1.4997Z"})})}function Et({className:e}){return Me("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:Me("path",{d:"M4 5h16v11H4zM9 20h6M12 16v4",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function ra({className:e}){return Me("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:Me("path",{d:"M5 7l5 5-5 5M12 18h7",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function ur({className:e}){return Me("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e,children:Me("path",{d:"M5 6h14v10H5zM2.5 19.5h19",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}var _e={claude:Ms,chatgpt:wn,local:Et},Ss={shell:ra};function Ps(e,n){return n<2*6e4?e:n<10*6e4?Math.max(e,6e4):n<30*6e4?Math.max(e,3*6e4):Math.max(e,10*6e4)}var oa=3e3,aa=2*6e4,It=Date.now(),Ot=new Set,Rs=!1;function ia(){if(Rs||typeof window>"u")return;Rs=!0;let e=()=>{let t=It;if(It=Date.now(),It-t>aa)for(let r of Ot)r()};for(let t of["pointerdown","keydown","wheel","touchstart"])window.addEventListener(t,e,{capture:!0,passive:!0});let n=()=>{if(!document.hidden)for(let t of Ot)t()};window.addEventListener("focus",n),document.addEventListener("visibilitychange",n)}function Se(e,n,t={}){ia();let r,s=t.immediate===!1?Date.now():0,a=!1,i=!1,c=()=>{i||(r=setTimeout(o,t.idle===!1?n:Ps(n,Date.now()-It)))},o=async()=>{if(clearTimeout(r),!(i||a)){if(typeof document>"u"||!document.hidden){a=!0,s=Date.now();try{await e()}catch{}finally{a=!1}}c()}},l=()=>{Date.now()-s>Math.min(n,oa)&&o()};return Ot.add(l),t.immediate===!1?c():o(),()=>{i=!0,clearTimeout(r),Ot.delete(l)}}var fe=[{id:"claude",costClass:"user-subscription",short:"Claude Code",label:"Continue with Claude",title:"The Claude plan you already pay for",cost:"Nothing beyond the plan",prerequisite:"Claude Code installed and signed in",hint:"Install it from claude.ai/code, then run `claude` once and sign in.",install:"https://claude.com/product/claude-code",expects:["claude-code"]},{id:"chatgpt",costClass:"user-subscription",short:"Codex",label:"Continue with ChatGPT",title:"The ChatGPT plan you already pay for",cost:"Nothing beyond the plan",prerequisite:"Codex installed and signed in",hint:"Install Codex, then run `codex` once and sign in.",install:"https://learn.chatgpt.com/codex/cli",expects:["codex"]},{id:"local",costClass:"user-hardware",short:"Local models",label:"Use a model on this machine",title:"A model on your own machine",cost:"Free. You bought the hardware",prerequisite:"Ollama running, with a model pulled",hint:"Install Ollama, then `ollama pull` a model before pairing.",install:"https://ollama.com",expects:["ollama","openai-api"]}],Es=["claude","chatgpt"];function dr(){return fe.filter(e=>Es.includes(e.id))}function pr(e){return fe.filter(n=>n.costClass===e)}function mr(e){return fe.find(n=>n.expects.includes(e))??null}import{Fragment as it,jsx as d,jsxs as v}from"react/jsx-runtime";function Cn({machines:e,hosted:n=[],onApproveRuntime:t,onPreferRuntime:r,onDisconnectHosted:s,onPair:a,onWake:i,onOpenApp:c,onRefresh:o,refreshing:l,busy:u,appName:m,model:f,onPickModel:g,error:h,runs:y,loadRuns:M,loading:E,machineMenu:R,machineNote:G,onReconnect:Y,openApp:O=!0,children:L,onStopRun:T}){let w=Ue(e),le=e.filter(I=>I.id!==w?.id),$=w?.state==="online",[be,ee]=at(()=>$?[]:null),[Re,Be]=at("no"),[me,Pe]=at(!1),j=y===void 0&&!!M,ce=j?be:y??($?[]:null),rn=y!==void 0||!!M,Z=!!(w&&Ye(w));la(()=>{if(!j||!M||!Z)return;let I=!0,Ee=Se(async()=>{let ue=await M();I&&ee(ue)},3e3);return()=>{I=!1,Ee()}},[j,M,Z]);let we=(w?er(w):[]).filter(I=>I.quarantined&&!I.absent),ne=fr(w,f).runtime,Ge=ne?.cost_class==="user-hardware"?ne:null,X=Ge?Ma(xa(Ge,f)):null,K=!!w&&!Ye(w),_=(()=>{if(!w||K||!ne||De(ne).tone!=="warn")return null;let Ee=q(w);return{title:`${ne.display_name} is signed out`,detail:`Sign in on ${Ee} so Soba can start runs.`}})(),We=()=>{c?.(),Be("going"),bn().then(I=>Be(I==="absent"?"absent":"no"))},Ve=()=>{We(),i?.()},He={label:Re==="going"?"Opening Soba\u2026":"Open Soba",onPress:We,spin:Re==="going"},B=w?He:a?{label:"Connect to Soba",onPress:a}:null,Q=!!w&&B===He,P=Q&&!!o,C=o&&d("button",{type:"button",className:"sc-disc",onClick:o,disabled:l,"aria-label":"Refresh",title:"Refresh",children:d(Ea,{spinning:!!l})});if(!w&&n.length===0&&!a)return d("p",{className:"sc-note",children:"Nothing connected yet."});if(me&&w&&f&&g){let I=Ts(w,f);if(Ke(I.options))return d(cr,{options:I.options,selected:f.id,onPick:g,onClose:()=>Pe(!1),...u?{busy:u}:{}})}return v("div",{className:"sc-tray",children:[w&&v(Oe,{title:"This machine",action:(o&&!P||O||R)&&v("span",{className:"sc-cap-acts",children:[!P&&C,O&&d(ya,{}),R]}),children:[d(ua,{machine:w}),G]}),w&&K&&!w.pairing_lost&&d(Oe,{title:"Soba",children:v("div",{className:"sc-away",children:[d("span",{className:"sc-away-mark","aria-hidden":"true",children:d(Ze,{kind:"paused",size:30})}),v("span",{className:"sc-away-say",children:[d("span",{className:"sc-away-title",children:"Wake it up"}),v("span",{className:"sc-away-body",children:["Soba on ",q(w)," is not answering. Waking it opens the app there."]})]}),d("button",{type:"button",className:"sc-away-go",onClick:Ve,disabled:u||Re==="going",children:Re==="going"?"Waking\u2026":"Wake"})]})}),w?.pairing_lost&&!Ye(w)&&d(Oe,{title:"Soba",children:v("div",{className:"sc-away",children:[d("span",{className:"sc-away-mark","aria-hidden":"true",children:d(Ze,{kind:"gone",size:30})}),v("span",{className:"sc-away-say",children:[d("span",{className:"sc-away-title",children:"Connect it again"}),d("span",{className:"sc-away-body",children:"Its pairing has ended, so it cannot take runs until it is connected again."})]}),Y&&d("button",{type:"button",className:"sc-away-go",onClick:Y,disabled:u,children:"Connect"})]})}),w&&!K&&d(Oe,{title:"Runs on",children:ne?d(va,{machine:w,appName:m,busy:u,...f?{model:f}:{},...g?{onPickModel:g,onOpenModels:()=>Pe(!0)}:{},...r?{onPick:I=>r(w.id,I)}:{},...t?{onApprove:I=>t(w.id,I)}:{}}):v("div",{className:"sc-blank",children:[d("span",{className:"sc-blank-mark","aria-hidden":"true",children:d(ma,{})}),v("span",{className:"sc-blank-say",children:[d("span",{className:"sc-blank-title",children:E?"Looking\u2026":"No agent on this machine"}),d("span",{className:"sc-blank-body",children:E?"Reading what it can run.":"Install Claude Code, Codex or Ollama there and it will appear here."})]}),!E&&O&&v("a",{className:"sc-blank-act",href:$n(),children:[d("span",{children:"Add agents"}),d(hr,{})]})]})}),w&&(_||X)&&v(Oe,{title:"Needs attention",children:[_&&v("div",{className:"sc-alarm",children:[d("span",{className:"sc-alarm-mark","aria-hidden":"true",children:d(Os,{})}),v("span",{className:"sc-alarm-say",children:[d("span",{className:"sc-alarm-title",children:_.title}),d("span",{className:"sc-alarm-body",children:_.detail})]})]}),X&&v("div",{className:"sc-alarm sc-alarm-warn",children:[d("span",{className:"sc-alarm-mark","aria-hidden":"true",children:d(Os,{})}),v("span",{className:"sc-alarm-say",children:[d("span",{className:"sc-alarm-title",children:"A large model on this computer"}),v("span",{className:"sc-alarm-body",children:["Your ",X," model can take all this computer's memory while it answers."]})]})]})]}),w&&rn&&!K&&d(pa,{machine:w,runs:ce,...T?{onStop:T}:{}}),w&&d(it,{children:we.length>0&&!K&&!(r&&t&&Ne(w).by!=="app")&&d(Oe,{title:"New on this machine",children:we.map(I=>d(Ca,{runtime:I,...t?{onApprove:()=>t(w.id,I.id)}:{}},I.id))})}),n.length>0&&d(Oe,{title:n.length>1?"Connected plans":"Connected plan",children:n.map(I=>d(Ra,{credential:I,appName:m,busy:u,...s?{onDisconnect:()=>s(I.provider)}:{}},I.provider))}),le.length>0&&d(Oe,{title:"Your other machines",children:le.map(I=>d(wa,{machine:I},I.id))}),!w&&a&&d(Oe,{title:"Your machines",children:v("button",{type:"button",className:"sc-pair",onClick:a,children:[d("span",{className:"sc-otile","aria-hidden":"true",children:d(Pa,{})}),d("span",{className:"sc-oname",children:"Connect a machine"})]})}),B&&v("div",{className:"sc-acts",children:[Q&&B?v("div",{className:"sc-acts-row",children:[P?C:d("span",{}),v("button",{type:"button",className:"sc-act-small",onClick:B.onPress,disabled:u||B.spin,"data-spin":B.spin?"true":void 0,children:[B.spin&&d(Ls,{}),B.label,!B.spin&&d(hr,{})]})]}):B&&v("button",{type:"button",className:"sc-act-go",onClick:B.onPress,disabled:u||B.spin,"data-spin":B.spin?"true":void 0,children:[B.spin&&d(Ls,{}),B.label]}),Re==="absent"&&v("p",{className:"sc-act-miss",children:["Nothing opened here. ",w?q(w):"That machine"," may be a different computer, or the Soba app is not installed on this one."]})]}),L,h&&d("p",{className:"sc-error sc-tray-error",children:h})]})}function Oe({title:e,action:n,children:t}){return v("section",{className:"sc-group",children:[v("div",{className:"sc-group-cap",children:[d("p",{className:"sc-group-title",children:e}),n]}),d("div",{className:"sc-group-card",children:t})]})}function ua({machine:e,onToggle:n,open:t}){let r=Ye(e),s=[r?null:e.pairing_lost?"Not connected to Soba":"Soba is asleep",r?Kn(e):null,e.always_on?"always on":null].filter(Boolean),a=r&&e.capacity>0?e.active>0?`${e.active} of ${e.capacity} running`:null:_n(e.last_seen_at),i=v(it,{children:[v("span",{className:"sc-mtile","aria-hidden":"true",children:[d(Bs,{}),d("span",{className:`sc-mbadge sc-mbadge-${r?An(e).tone:e.pairing_lost?"off":"away"}`})]}),v("span",{className:"sc-mid",children:[d("span",{className:"sc-mname",children:q(e)}),v("span",{className:"sc-mmeta",children:[d("span",{className:"sc-mmeta-is",children:s.map((c,o)=>v("span",{children:[o>0&&d("span",{className:"sc-mmeta-sep",children:"\xB7"}),c]},c))}),a&&d("span",{className:"sc-mmeta-now",children:a})]})]})]});return!n||!r?d("div",{className:"sc-mrow",children:i}):v("button",{type:"button",className:"sc-mrow sc-mrow-btn",onClick:n,"aria-expanded":!!t,title:t?"Hide what it is running":"See what it is running",children:[i,d(In,{open:!!t})]})}function da(e,n){return e.filter(t=>t.machine_id===n.id||t.machine_id===null)}function pa({machine:e,runs:n,onStop:t}){let r=n?da(n,e):[],[s,a]=at(new Set),i=async o=>{a(l=>new Set(l).add(o));try{await t?.(o)}catch{a(l=>{let u=new Set(l);return u.delete(o),u})}},c=()=>{for(let o of r)i(o.id)};return d(Oe,{title:"Active runs",...t&&r.length>1?{action:d("button",{type:"button",className:"sc-cap-link",onClick:c,children:"Stop all"})}:{},children:n===null?d("p",{className:"sc-row-note",children:"Looking\u2026"}):r.length===0?v("p",{className:"sc-nilrow",children:[d("span",{className:"sc-nilrow-mark","aria-hidden":"true",children:d(ha,{})}),"Nothing running"]}):r.map(o=>d(ga,{run:o,stopping:s.has(o.id),...t?{onStop:()=>void i(o.id)}:{}},o.id))})}function ma(){return v("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-blank-glyph",children:[d("rect",{x:"3",y:"4.5",width:"18",height:"15",rx:"2.5",fill:"none",stroke:"currentColor",strokeWidth:"1.8"}),d("path",{d:"M7.5 10l2.5 2.2-2.5 2.2M12.5 14.6h4",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function ha(){return v("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-blank-glyph",children:[d("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:"currentColor",strokeWidth:"1.8"}),d("path",{d:"M9 12.5l2.2 2.2L15.5 9.8",fill:"none",stroke:"currentColor",strokeWidth:"1.8",strokeLinecap:"round",strokeLinejoin:"round"})]})}function ga({run:e,stopping:n,onStop:t}){return v("div",{className:"sc-rrow",children:[d("span",{className:n?"sc-rdot":"sc-rdot sc-rdot-live","aria-hidden":"true"}),v("span",{className:"sc-mid",children:[d("span",{className:"sc-rtitle",children:Is(e)}),d("span",{className:"sc-rstep",children:n?"Stopping\u2026":`${Aa(e)} \xB7 ${ba(e.started_at)}`})]}),t&&d("button",{type:"button",className:"sc-rstop",onClick:t,disabled:n,"aria-label":`Stop ${Is(e)}`,children:d("span",{className:"sc-rstop-ring",children:d(Ia,{})})})]})}function fa(e){let n=mr(e);return(n?_e[n.id]:null)??Ss[e]??null}function Is(e){if(e.label)return e.label;if(e.task){let n=e.task.replace(/[_-]+/g," ").trim();return n.charAt(0).toUpperCase()+n.slice(1)}return"A run"}function Aa(e){if(e.status==="queued")return"Waiting for a free slot";if(e.step)return e.step;switch(e.phase?.kind){case"thinking":return"Thinking";case"writing":return"Writing";case"tool":return e.phase.tool?`Using ${e.phase.tool}`:"Using a tool";case"approval":return e.phase.tool?`Waiting for you to allow ${e.phase.tool}`:"Waiting for your approval";default:return e.first_output_at?"Working":"Starting"}}function ba(e){let n=Math.max(0,Math.round((Date.now()-new Date(e).getTime())/1e3));if(n<60)return`${n}s`;let t=Math.floor(n/60);return t<60?`${t}m ${String(n%60).padStart(2,"0")}s`:`${Math.floor(t/60)}h ${String(t%60).padStart(2,"0")}m`}function ya(){return d("a",{className:"sc-disc sc-open-app",href:$n(),"aria-label":"Open Soba App",title:"Open Soba App",children:d(hr,{})})}function hr(){return d("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-dglyph",children:d("path",{d:"M14 4h6v6M20 4l-8.5 8.5M18 14.5V19a1 1 0 01-1 1H5a1 1 0 01-1-1V7a1 1 0 011-1h4.5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function wa({machine:e}){let n=An(e);return v("div",{className:"sc-orow",children:[d("span",{className:"sc-otile","aria-hidden":"true",children:d(Bs,{})}),d("span",{className:"sc-oname",children:q(e)}),d("span",{className:"sc-oword",children:n.word}),d("span",{className:`sc-dot sc-dot-${n.tone}`,"aria-hidden":"true"})]})}function Ca({runtime:e,onApprove:n}){return v("div",{className:"sc-mrow",children:[d("span",{className:"sc-mtile sc-atile","aria-hidden":"true",children:d(Lt,{id:e.id,name:e.display_name})}),v("span",{className:"sc-mid",children:[d("span",{className:"sc-mname",children:e.display_name}),d("span",{className:"sc-mmeta",children:e.version??"waiting to be let in"})]}),n?d("button",{type:"button",className:"sc-row-act",onClick:n,children:"Let it serve"}):d("span",{className:"sc-averdict sc-tone-warn",children:"not serving yet"})]})}function gr({id:e,name:n}){return d("span",{className:"sc-runtime-tile","aria-hidden":"true",children:d(Lt,{id:e,...n?{name:n}:{}})})}function Lt({id:e,name:n}){if(!e)return null;let t=ks[e];if(t)return d("img",{src:t,alt:"",className:"sc-runtime-logo"});let r=fa(e);return r?d(r,{className:"sc-runtime-mark"}):n?d("span",{className:"sc-runtime-letter",children:n.slice(0,1).toUpperCase()}):null}function Ts(e,n){if(!n)return{options:[]};let t=fr(e,n),r=t.runtime?.id??t.runtimeId,s=rt([e]).filter(c=>c.kind==="named"?c.runtime===r:c.kind==="size"?!!r&&Mt(r):!0),a=t.runtime?.default_model;if(n.kind!=="auto"||!a)return{options:s,shown:n};let i=yn(a);return{options:s,shown:{...n,label:i.length>16?i:`${n.label} \xB7 ${i}`}}}function va({machine:e,appName:n,busy:t,onPick:r,model:s,onPickModel:a,onOpenModels:i,onApprove:c}){let o=fr(e,s),l=ge(e),u=c?e.runtimes.filter(T=>T.quarantined&&!T.absent):[],[m,f]=at(!1),g=ca(null);if(o.by!=="app"&&l.length===0)return null;let h=T=>T?d(gr,{id:T.id,name:T.display_name}):null,y=o.runtime?.display_name??o.runtimeId??"\u2014",M=o.by!=="app"&&o.by!=="model"&&!!r&&(l.length>=2||u.length>0),E=o.runtime?.id??o.runtimeId,R=!Ye(e),G=o.runtime&&De(o.runtime).tone==="warn"?"Signed out":null,{options:Y,shown:O}=Ts(e,s),L=o.by==="app"?`Set by ${n??"the app"}`:o.runtime?Na(o.runtime):null;return v(it,{children:[M?v("button",{ref:g,type:"button",className:R?"sc-runs-agent sc-runs-dim":"sc-runs-agent","aria-haspopup":"menu","aria-expanded":m,"aria-label":`Runs go to ${y}. Change`,disabled:t,onClick:()=>f(T=>!T),children:[d("span",{className:"sc-runs-tile","aria-hidden":"true",children:d(Lt,{id:E??null,name:y})}),v("span",{className:"sc-runs-said-name",children:[d("span",{className:"sc-runs-name",children:y}),G&&d("span",{className:"sc-runs-ill",children:G})]}),d(In,{open:!1})]}):v("span",{className:R?"sc-runs-agent sc-runs-fixed sc-runs-dim":"sc-runs-agent sc-runs-fixed",children:[d("span",{className:"sc-runs-tile","aria-hidden":"true",children:d(Lt,{id:E??null,name:y})}),v("span",{className:"sc-runs-said-name",children:[d("span",{className:"sc-runs-name",children:y}),G&&d("span",{className:"sc-runs-ill",children:G})]}),o.by==="app"&&v("span",{className:"sc-runs-told",children:["set by ",n??"the app"]}),o.by==="model"&&d("span",{className:"sc-runs-told",children:"set by the model"})]}),O&&a&&Ke(Y)?v(it,{children:[d("span",{className:"sc-runs-rule","aria-hidden":"true"}),d(ot,{options:Y,selected:O,onPick:a,caption:"Model",...i?{onOpen:i}:{},className:R?"sc-runs-model sc-runs-dim":"sc-runs-model",...t?{disabled:t}:{}})]}):L&&v(it,{children:[d("span",{className:"sc-runs-rule","aria-hidden":"true"}),v("span",{className:"sc-runs-said",children:[d("span",{className:"sc-runs-key",children:"Model"}),d("span",{className:"sc-runs-val",children:L})]})]}),m&&r&&d(ka,{anchor:g,machine:e,tile:h,waiting:u,...c?{onApprove:c}:{},onClose:()=>f(!1),onPick:T=>{f(!1),r(T)}})]})}function ka({anchor:e,machine:n,tile:t,waiting:r,onApprove:s,onClose:a,onPick:i}){let c=Ne(n),o=Ne({...n,preferred_runtime:null}).runtime,l=c.by==="you"?c.runtimeId:null,u=[{id:null,label:"Automatic",...o?{note:`Uses ${o.display_name}`}:{},glyph:t(o)},...ge(n).map((m,f)=>{let g=Sa(m);return{id:m.id,label:m.display_name,glyph:t(m),...g?{note:g}:{},...f===0?{rule:!0}:{}}}),...s?r.map((m,f)=>({id:`waiting:${m.id}`,label:m.display_name,glyph:t(m),...m.version?{note:m.version}:{},trailing:"Let it serve",onChoose:()=>s(m.id),...f===0?{heading:"New on this machine"}:{}})):[]];return d(tt,{anchor:e,label:"Which agent runs go to",options:u,current:l,onClose:a,onPick:i})}function Na(e){let n=De(e);return n.tone==="warn"?n.text:e.default_model?yn(e.default_model):"Automatic"}function fr(e,n){if(!e)return{by:"default",runtimeId:null,runtime:null};let t=Ne(e);if(t.by==="app"||n?.kind!=="named"||!n.runtime)return t;let r=ge(e).find(s=>s.id===n.runtime);return!r||r.id===t.runtimeId?t:{by:"model",runtimeId:r.id,runtime:r}}function xa(e,n){return!n||n.kind==="auto"?e.default_model:n.kind==="size"?(Cs(n.model)?vs(e.id,n.model):void 0)??e.default_model:n.runtime===e.id?n.model:e.default_model}function Ma(e){if(!e)return null;let n=/(\d+(?:\.\d+)?)\s*b\b/i.exec(e),t=n?.[1]?Number(n[1]):Number.NaN;return!Number.isFinite(t)||t<20?null:`${n?.[1]}B`}function Sa(e){let n=De(e);return n.tone==="warn"?n.text:e.default_model?yn(e.default_model):e.cost_class==="user-hardware"?"In this machine's memory":n.tone!=="ok"?n.text:e.version??void 0}function Ra({credential:e,appName:n,busy:t,onDisconnect:r}){return v("div",{className:"sc-hrow",children:[v("div",{className:"sc-orow",children:[d("span",{className:"sc-otile","aria-hidden":"true",children:d(wn,{className:"sc-omark"})}),v("span",{className:"sc-mid",children:[d("span",{className:"sc-oname",children:e.provider==="openai-chatgpt"?"ChatGPT plan":e.provider}),d("span",{className:"sc-mmeta",children:e.account_label??"signed in"})]}),r&&d("button",{type:"button",className:"sc-row-act",onClick:r,disabled:t,children:"Disconnect"})]}),r&&v("p",{className:"sc-row-note",children:[n??"This app"," stops using it. To withdraw the grant entirely, remove it in your OpenAI settings."]})]})}function Bs(){return v("svg",{viewBox:"0 0 32 24","aria-hidden":"true",focusable:"false",className:"sc-mglyph",children:[d("rect",{x:"4",y:"1.5",width:"24",height:"15",rx:"2.5",fill:"var(--sc-sheet, #ffffff)",stroke:"currentColor",strokeWidth:"2"}),d("rect",{x:"1",y:"19.5",width:"30",height:"2.5",rx:"1.25",fill:"currentColor"})]})}function Pa(){return d("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-oglyph",children:d("path",{d:"M12 5v14M5 12h14",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})})}function Os(){return v("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:"sc-hglyph",children:[d("circle",{cx:"12",cy:"12",r:"9",fill:"none",stroke:"currentColor",strokeWidth:"2"}),d("path",{d:"M12 7.5v5.5",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"}),d("circle",{cx:"12",cy:"16.5",r:"1.15",fill:"currentColor"})]})}function Ls(){return v("svg",{className:"sc-act-glyph sc-spin",viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",children:[d("circle",{cx:"8",cy:"8",r:"6.2",fill:"none",stroke:"currentColor",strokeWidth:"2",opacity:"0.3"}),d("path",{d:"M8 1.8a6.2 6.2 0 0 1 6.2 6.2",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]})}function Ea({spinning:e}){return d("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",className:e?"sc-dglyph sc-spin":"sc-dglyph",children:d("path",{d:"M21 12a9 9 0 1 1-2.64-6.36M21 3v6h-6",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Ia(){return d("svg",{className:"sc-dglyph",viewBox:"0 0 14 14","aria-hidden":"true",children:d("rect",{x:"2",y:"2",width:"10",height:"10",rx:"2",fill:"currentColor"})})}import{jsx as Oa}from"react/jsx-runtime";function Ar({machines:e,onApproveRuntime:n,model:t,onPickModel:r}){return Oa(Cn,{machines:e,...n?{onApproveRuntime:n}:{},...t?{model:t}:{},...r?{onPickModel:r}:{}})}import{useCallback as se,useEffect as Ae,useId as Ga,useMemo as $e,useRef as On,useState as z}from"react";var lt=[{slug:"mac-arm",label:"macOS, Apple silicon"},{slug:"mac-intel",label:"macOS, Intel"},{slug:"windows",label:"Windows"},{slug:"linux",label:"Linux"}];function ct(e){if(!e)return"";try{return new URL(e).origin}catch{return""}}var Gs="soba.connect.choice",La=180*24*60*60*1e3;function br(e){let n=2166136261;for(let t=0;t<e.length;t++)n^=e.charCodeAt(t),n=Math.imul(n,16777619);return(n>>>0).toString(36)}function yr(e,n){return e?n?`${Gs}.${e}.${br(n)}`:`${Gs}.${e}`:null}function wr(e){if(!e||typeof localStorage>"u")return null;try{let n=localStorage.getItem(e);if(!n)return null;let t=JSON.parse(n);if(Date.now()-Date.parse(t.at)>La)return null;let r=fe.find(s=>s.id===t.choice);return r?r.id:null}catch{return null}}function Cr(e,n){if(!(!e||typeof localStorage>"u"))try{localStorage.setItem(e,JSON.stringify({choice:n,at:new Date().toISOString()}))}catch{}}var Ws="soba.connect.model",Ta=180*24*60*60*1e3;function vr(e,n){return e?n?`${Ws}.${e}.${br(n)}`:`${Ws}.${e}`:null}function Tt(e){if(!e||typeof localStorage>"u")return null;try{let n=localStorage.getItem(e);if(!n)return null;let t=JSON.parse(n);if(Date.now()-Date.parse(t.at)>Ta)return null;let r=t.choice;return typeof r!="string"||!r||r.length>120?null:/^[\w.:@+-]+(\/[\w.:@+-]+)?$/.test(r)?r:null}catch{return null}}function kr(e,n){if(!(!e||typeof localStorage>"u"))try{localStorage.setItem(e,JSON.stringify({choice:n,at:new Date().toISOString()}))}catch{}}var Hs="soba.connect.dismissed",Ba=30*24*60*60*1e3;function Nr(e,n){return e?n?`${Hs}.${e}.${br(n)}`:`${Hs}.${e}`:null}function xr(e){if(!e||typeof localStorage>"u")return!1;try{let n=localStorage.getItem(e);if(!n)return!1;let t=JSON.parse(n);return Date.now()-Date.parse(t.at)<Ba}catch{return!1}}function Mr(e){if(!(!e||typeof localStorage>"u"))try{localStorage.setItem(e,JSON.stringify({at:new Date().toISOString()}))}catch{}}import{Fragment as Tn,jsx as p,jsxs as x}from"react/jsx-runtime";var Sr=2e3,Wa=1e4,Ha=9e4,Da=6e4;function Rr(e,n,t,r=[],s){return e?"code":n&&(t.length>0||r.length>0)?"manage":s?"launch":"choose"}function Ds(e){return Ye(e)&&!e.pairing_lost}function Bt(e){return new Map(e.map(n=>[n.id,Ds(n)]))}function Ua(e){let n=Math.max(0,Math.round(e/1e3));return`${Math.floor(n/60)}:${String(n%60).padStart(2,"0")}`}function Ir({client:e,initialCode:n,initialChoice:t,onConnected:r,showStatus:s=!0,initialContext:a=null,initialMachines:i,onClose:c,headingId:o,theme:l,reason:u,active:m=!0}){let f=!!a&&i!==void 0,[g,h]=z(f?Rr(n,s,i??[],[],t):"loading"),[y,M]=z(a),[E,R]=z(i??[]),[G,Y]=z(n??""),[O,L]=z(null),[T,w]=z(null),[le,$]=z(!1),[be,ee]=z(0),[Re,Be]=z("app"),[me,Pe]=z(()=>Date.now()),[j,ce]=z(null),[rn,Z]=z(!1),[ye,we]=z(!1),[ne,Ge]=z("browser"),[X,K]=z(null),[_,We]=z([]),[Ve,He]=z(0),[B,Q]=z(null),P=On(null),[C,I]=z(t??null),[Ee,ue]=z(null),sn=$e(()=>{let A=y?.accent?.trim(),N=y?.background?.trim();if(!(!A&&!N))return N?{...gn(N,A),background:N,borderRadius:"inherit"}:{"--sc-accent":A,"--sc-accent-fg":Xn(A)}},[y?.accent,y?.background]),vt=Ga(),Ce=o??vt,on=On(null);Ae(()=>{if(!e||f)return;let A=!0;return Promise.all([e.context(),e.machines()]).then(([N,U])=>{A&&(M(N),R(U),h(Rr(n,s,U)))}).catch(N=>{A&&(w(N.message),h("choose"))}),()=>{A=!1}},[e,n,s,f]),Ae(()=>{g!=="loading"||!f||h(Rr(n,s,i??[]))},[g,f,n,s,i]),Ae(()=>{i&&R(i)},[i]),Ae(()=>{a&&M(a)},[a]);let qe=On(!1),an=On(g);an.current=g;let Vn=On(_);Vn.current=_;let ln=!!y?.hosted_available;Ae(()=>{!s&&an.current==="manage"&&h("choose")},[s]),Ae(()=>{if(!e||!m||g!=="manage")return;let A=!0,N=Se(async()=>{try{let U=await e.machines();if(!A)return;R(U);let J=!ln||qe.current;U.length===0&&Vn.current.length===0&&J&&an.current==="manage"&&h("choose")}catch{}},Wa,{immediate:!1});return()=>{A=!1,N()}},[g,e,ln,m]);let cn=yr(y?.publishable_key??null);Ae(()=>{ue(wr(cn))},[cn]),Ae(()=>{if(!e||!ln)return;let A=!0;return e.hosted().then(N=>{A&&(We(N.credentials),!qe.current&&(qe.current=!0,N.credentials.length>0&&s&&an.current==="choose"&&h("manage")))}).catch(()=>{}),()=>{A=!1}},[e,ln,s]),Ae(()=>{if(!e||!m||g!=="hosted")return;let A=!0,N=async()=>{try{let ke=await e.hosted();if(!A)return!1;if(We(ke.credentials),ke.credentials.length>0)return h("hosted_connected"),Q(null),!0}catch{}return!1},U=async()=>{P.current?.closed&&(P.current=null,!await N()&&A&&h("choose"))},J=Se(N,Sr,{immediate:!1}),pn=setInterval(U,400),mn=ke=>{let zn=ke.data;zn?.source==="soba"&&zn.type==="hosted_result"&&N()};return window.addEventListener("message",mn),()=>{A=!1,J(),clearInterval(pn),window.removeEventListener("message",mn),P.current=null}},[e,g,m]);let Yt=se(()=>{if(!e)return;let A=window.open("","soba-connect-plan","width=520,height=760,noopener=no");P.current=A,h("hosted"),He(Date.now()),Q(null),w(null),e.startHosted().then(({url:N})=>{if(A&&!A.closed){A.location.href=N;return}Q(N)}).catch(N=>{A?.close(),P.current=null,w(N.message),h("choose")})},[e]),Mn=se(async A=>{if(e){$(!0);try{await e.disconnectHosted(A),We((await e.hosted()).credentials)}catch(N){w(N.message)}finally{$(!1)}}},[e]);Ae(()=>{if(!e||!m||g!=="waiting")return;let A=!0,N=Se(async()=>{try{let U=await e.machines();if(!A)return;R(U);let J=on.current;if(!J)return;let pn=U.filter(ke=>!J.has(ke.id)||J.get(ke.id)===!1&&Ds(ke)),mn=pn.find(ke=>ke.state!=="offline")??pn[0];if(mn){K(mn.id),C&&Cr(cn,C);let ke=fe.find(qt=>qt.id===C)?.expects??[],zn=ge(mn).find(qt=>ke.includes(qt.id));zn&&e.preferRuntime(mn.id,zn.id).catch(()=>{}),h("connected"),r?.(U)}}catch{}},Sr,{immediate:!1});return()=>{A=!1,N()}},[g,e,r,C,cn,m]);let kt=se(async()=>{if(e){w(null),$(!0);try{let A=await e.lookup(G);L(A),h("confirm")}catch(A){w(A.message)}finally{$(!1)}}},[e,G]),Jn=se(async()=>{if(e){w(null),$(!0);try{try{on.current=Bt(await e.machines())}catch{on.current=Bt(E)}await e.approve(G),Be("code"),h("waiting"),ee(Date.now())}catch(A){w(A.message)}finally{$(!1)}}},[e,G,E]),Nt=se(async()=>{if(e){$(!0);try{await e.deny(G),Ge("browser"),h("denied")}catch(A){w(A.message)}finally{$(!1)}}},[e,G]),V=$e(()=>y?.connect_url??null,[y]),[he,Yn]=z(()=>nt()),zt=$e(()=>V?et(V,he??void 0,C??void 0):null,[V,he,C]),k=$e(()=>ct(V),[V]),te=se(A=>{if(E.length===0)return null;let N=fe.find(J=>J.id===A);if(!N)return null;let U=E.flatMap(J=>J.runtimes??[]).filter(J=>N.expects.includes(J.id));return U.length===0?{tone:"dim",text:"not installed"}:U.some(J=>J.authenticated===!0)?{tone:"ok",text:"ready"}:U.every(J=>J.authenticated===!1)?{tone:"warn",text:"needs signing in"}:{tone:"dim",text:"installed"}},[E]),ve=se((A=null)=>{I(A),w(null),ce(null),Z(!1),we(!1),Sn.current=!1,Yn(nt()),h("launch")},[]),Sn=On(!!t);Ae(()=>{g!=="launch"||!V||Sn.current||(Sn.current=!0,Z(!0),rr(V,{...he?{nonce:he}:{},...C?{want:C}:{}}).then(ce))},[g,V,he,C]);let Ie=se(()=>{Z(!0),tr().then(ce)},[]),jt=se(A=>{if(ye){let N=nt();we(!1),Yn(N),V&&(A.preventDefault(),window.location.href=et(V,N??void 0,C??void 0))}Ie()},[ye,Ie,V,C]),Je=$e(()=>{let A=y?.runtimes;return A?fe.filter(N=>A.includes(N.id)):dr()},[y?.runtimes]),de=$e(()=>{let A=fe.find(N=>N.id===C);return A?{choice:A,Mark:_e[A.id]??null}:null},[C]),un=$e(()=>E.find(A=>A.id===X),[E,X]),xt=se(()=>{h("manage"),c?.()},[c]);Ae(()=>{let A=he;if(!e||!m||g!=="launch"||!A)return;let N=!1,U=Date.now()+15e4,J=()=>{};return J=Se(async()=>{if(Date.now()>U){J(),we(!0);return}try{let pn=await e.claim(A);if(N)return;if(pn.declined){J(),ce(null),Ge("machine"),h("denied");return}if(!pn.claimed)return;J();try{on.current=Bt(await e.machines())}catch{on.current=Bt(E)}Be("app"),h("waiting"),ee(Date.now())}catch{}},Sr,{immediate:!1,idle:!1}),()=>{N=!0,J()}},[e,g,E,he,m]);let dn=$e(()=>{if(!O)return null;if(O.approved||O.denied)return"answered";let A=O.expires_at?Date.parse(O.expires_at):Number.NaN;return Number.isFinite(A)&&A<=me?"expired":"live"},[O,me]);Ae(()=>{if(!(g==="confirm"&&dn==="live"||g==="waiting"||g==="hosted"))return;let N=setInterval(()=>Pe(Date.now()),1e3);return()=>clearInterval(N)},[g,dn]);let Po=se(async(A,N)=>{if(e)try{await e.approveRuntime(A,N),R(await e.machines())}catch(U){w(U.message)}},[e]),Eo=se(async(A,N)=>{if(e)try{await e.preferRuntime(A,N),R(await e.machines())}catch(U){w(U.message)}},[e]);return g==="loading"?p("div",{className:"soba-connect",...l?{"data-theme":l}:{},style:sn,children:p("div",{className:"sc-card",children:p("p",{className:"sc-note",children:"Loading\u2026"})})}):x("div",{className:"soba-connect",...l?{"data-theme":l}:{},style:sn,children:[c&&p("button",{type:"button",className:"sc-modal-close",onClick:c,"aria-label":"Close",children:"\xD7"}),g==="manage"&&x("div",{className:"sc-card",children:[p("h2",{className:"sc-title",id:Ce,children:"Your compute"}),x("p",{className:"sc-sub",children:[p(Gt,{context:y})," ",E.length>0&&_.length>0?"runs on your connected plan, and on these machines while they are awake.":_.length>0?"runs on the plan you connected. Nothing here is charged to you.":"runs on these machines, while they are awake."]}),p(Cn,{machines:E,hosted:_,onApproveRuntime:Po,onPreferRuntime:(A,N)=>void Eo(A,N),onDisconnectHosted:A=>void Mn(A),onPair:()=>h("choose"),busy:le,...y?.app.name?{appName:y.app.name}:{}}),T&&p("p",{className:"sc-error",children:T})]}),g==="choose"&&x("div",{className:"sc-card",children:[p(Qa,{context:y}),p("h2",{className:"sc-h",id:Ce,children:u==="payment_required"?"Carry on with your own AI":u==="no_compute"?"This run needs a machine":"Connect your AI"}),p("p",{className:"sc-p",children:"Use compute you already have."}),V&&Je.length>0&&x(Tn,{children:[p("div",{className:"sc-opts",children:Je.map(A=>{let N=_e[A.id];return x("button",{type:"button",className:"sc-opt",onClick:()=>ve(A.id),children:[p("span",{className:"sc-opt-tile","aria-hidden":"true",children:N&&p(N,{className:"sc-opt-mark"})}),p("span",{className:"sc-opt-text",children:p("span",{className:"sc-opt-label",children:A.label})}),(()=>{let U=te(A.id);return U?p("span",{className:`sc-opt-has sc-opt-has-${U.tone}`,children:U.text}):Ee===A.id?p("span",{className:"sc-opt-last",children:"last used"}):p(Pr,{className:"sc-opt-go"})})()]},A.id)})}),x("p",{className:"sc-opt-note",children:["Your accounts stay there. ",Us(y)," never sees them."]})]}),(!V||Je.length===0)&&p("p",{className:"sc-error",style:{marginTop:16},children:"This app has no publishable key yet, so there is nothing to pair against."}),T&&p("p",{className:"sc-error",children:T}),V&&y?.show_code===!0&&p("div",{className:"sc-opt-alt",children:p("button",{type:"button",className:"sc-alt-link",onClick:()=>h("code"),children:"I have a code"})})]}),g==="launch"&&x("div",{className:"sc-card",children:[x("div",{className:"sc-head",children:[p(Ln,{onClick:()=>h("choose")}),p("p",{className:"sc-head-title",children:"Soba App"})]}),p(Wt,{mark:de?.Mark??re,still:ye||!rn&&j===null}),p("h2",{className:"sc-h",id:Ce,children:ye?"No answer from this machine":j==="absent"?"Nothing opened":j===null?"Opening Soba App\u2026":"Approve it on this machine"}),ye?p("p",{className:"sc-p",children:"The Soba app did not answer. It may not be open, or nobody was there. Try again when you are ready."}):j==="absent"?p("p",{className:"sc-p",children:"Nothing opened on this machine. Open it yourself below, or install it if it is not here yet."}):p("p",{className:"sc-p",children:j===null?"Approve it there and this page does the rest.":"This page finishes on its own."}),de&&x("p",{className:"sc-prereq",children:[de.Mark&&p(de.Mark,{className:"sc-rt-mark"}),"Needs ",de.choice.prerequisite]}),x("div",{className:"sc-stack",style:{marginTop:18},children:[p("a",{className:j==="absent"||ye?"sc-btn sc-btn-primary":"sc-btn",href:zt??"#",onClick:jt,children:ye?"Try again":j==="absent"?"Open Soba App":"Open it again"}),p("p",{className:"sc-note",children:j===null?"Your browser will ask permission first.":"Your browser asks permission the first time."}),de&&j==="absent"&&p("p",{className:"sc-note",children:p(Ja,{text:de.choice.hint})}),x("div",{className:"sc-foot-strip",children:[p("span",{children:"Not installed on this machine?"}),x("button",{type:"button",className:"sc-foot-go",onClick:()=>h("get"),children:["Get it",p(Pr,{})]})]})]})]}),g==="get"&&x("div",{className:"sc-card",children:[x("div",{className:"sc-head",children:[p(Ln,{onClick:()=>h("launch")}),p("p",{className:"sc-head-title",children:"Get Soba App"})]}),p("div",{className:"sc-opts",children:lt.map(A=>x("a",{className:"sc-opt",href:`${k}/download/${A.slug}`,target:"_blank",rel:"noreferrer noopener",children:[p("span",{className:"sc-opt-tile","aria-hidden":"true",children:p(ur,{className:"sc-opt-mark"})}),p("span",{className:"sc-opt-text",children:p("span",{className:"sc-opt-label",children:A.label})}),p(Pr,{className:"sc-opt-go"})]},A.slug))}),p("p",{className:"sc-opt-note",children:"Install it, then come back here and press the row you started with."})]}),g==="code"&&x("div",{className:"sc-card",children:[x("div",{className:"sc-head",children:[p(Ln,{onClick:()=>h("choose")}),p("p",{className:"sc-head-title",children:"Soba App"})]}),p("h2",{className:"sc-h",id:Ce,children:"Enter the code from that machine"}),p("p",{className:"sc-p",children:"Eight characters, shown by the Soba app once you paste the link."}),x("form",{className:"sc-stack",style:{marginTop:16},onSubmit:A=>{A.preventDefault(),kt()},children:[p("input",{className:"sc-input",value:G,onChange:A=>Y(A.target.value),placeholder:"ACDE-F234",autoComplete:"off",autoFocus:!0,"aria-label":"Pairing code"}),T&&p("p",{className:"sc-error",children:T}),p("button",{type:"submit",className:"sc-btn sc-btn-primary",disabled:le||G.length<8,children:le?"Checking\u2026":"Continue"})]})]}),g==="confirm"&&O&&x("div",{className:"sc-card",children:[x("div",{className:"sc-head",children:[p(Ln,{onClick:()=>h("code")}),p("p",{className:"sc-head-title",children:"Soba App"})]}),p("h2",{className:"sc-title",children:"Attach this machine to your account?"}),x("p",{className:"sc-sub",children:[p(Gt,{context:y})," may send your runs to it once you approve. It can never see the account or the keys on it."]}),x("ul",{className:"sc-facts",children:[p(ut,{k:"Code",v:O.user_code}),p(ut,{k:"Machine",v:O.hostname??"not stated"}),p(ut,{k:"System",v:[O.platform,O.arch].filter(Boolean).join(" / ")||"not stated"}),p(ut,{k:"Asked by",v:O.client??"not stated"}),O.labels.length>0&&p(ut,{k:"Labels",v:O.labels.join(", ")})]}),p("p",{className:"sc-note",style:{marginTop:12},children:"Every line above is what that machine said about itself. If none of it looks like a computer of yours, say no."}),dn==="expired"&&p("p",{className:"sc-error",children:"That code has expired. Ask the machine for a new one. It prints a fresh code each time it starts."}),dn==="answered"&&p("p",{className:"sc-error",children:"That code has already been answered. If it was not you, deny the next one."}),T&&p("p",{className:"sc-error",children:T}),x("div",{className:"sc-row",style:{marginTop:16},children:[p("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:()=>void Jn(),disabled:le||dn!=="live",children:"Approve"}),p("button",{type:"button",className:"sc-btn",onClick:()=>void Nt(),disabled:le||dn==="answered",children:"No, deny it"})]}),dn==="live"&&O.expires_at&&x("p",{className:"sc-note",style:{marginTop:10},children:["This code expires in ",Ua(Date.parse(O.expires_at)-me),"."]})]}),g==="waiting"&&x("div",{className:"sc-card",children:[x("div",{className:"sc-head",children:[p(Ln,{onClick:()=>h("choose")}),p("p",{className:"sc-head-title",children:de?.choice.short??"Soba App"})]}),p(Wt,{mark:de?.Mark??re}),p("h2",{className:"sc-h",id:Ce,children:"Approved. Waiting for it to connect"}),p("p",{className:"sc-p",children:"Nothing more to do here. This page changes when it arrives."}),be>0&&me-be>Ha&&x("ol",{className:"sc-stall",children:[Re==="app"?x(Tn,{children:[p(Ht,{done:!0,title:"Soba Connect opened",line:"On this machine"}),p(Ht,{done:!0,title:"You approved it",line:"In Soba Connect"})]}):p(Ht,{done:!0,title:"You approved the code",line:"On this page"}),p(Ht,{title:`Still nothing from ${O?.hostname??"that machine"}`,line:"Look at Soba Connect on that machine: it says what it is doing. This keeps watching either way.",children:p("button",{type:"button",className:"sc-btn sc-stall-act",onClick:()=>void bn(),children:"Open Soba Connect"})})]})]}),g==="connected"&&x("div",{className:"sc-card",children:[p(Er,{tone:"ok"}),p("h2",{className:"sc-h",id:Ce,children:un?.label?`${un.label} is connected`:"Connected"}),x("p",{className:"sc-p",children:[p(Gt,{context:y})," will use ",un?.label?"it":"this machine"," from now on, while it is awake."]}),s&&x(Tn,{children:[un&&p(Va,{machine:un}),p("button",{type:"button",className:"sc-btn sc-btn-primary sc-btn-wide",style:{marginTop:14},onClick:xt,children:"Done"})]})]}),g==="hosted"&&x("div",{className:"sc-card",children:[x("div",{className:"sc-head",children:[p(Ln,{onClick:()=>h("choose")}),p("p",{className:"sc-head-title",children:"ChatGPT"})]}),B?p(Wt,{mark:wn,still:!0}):p(Wt,{mark:wn}),p("h2",{className:"sc-h",id:Ce,children:B?"Your browser blocked the window":"Finish signing in to ChatGPT"}),p("p",{className:"sc-p",children:B?"Nothing opened. Open the sign-in yourself below. A link you click is allowed where a window we open is not.":"Approve it in the window that opened."}),x("div",{className:"sc-stack",style:{marginTop:18},children:[B&&p("a",{className:"sc-btn sc-btn-primary",href:B,target:"soba-connect-plan",rel:"noreferrer",children:"Open the ChatGPT sign-in"}),T&&p("p",{className:"sc-error",children:T}),Ve>0&&me-Ve>Da&&p("p",{className:"sc-note sc-tone-warn",children:"Still nothing. The window may have been closed before it finished, or the sign-in may have been declined. This keeps watching either way."})]})]}),g==="hosted_connected"&&x("div",{className:"sc-card",children:[p(Er,{tone:"ok"}),p("h2",{className:"sc-h",id:Ce,children:"ChatGPT is connected"}),x("p",{className:"sc-p",children:[p(Gt,{context:y})," will run on your ChatGPT plan",_[0]?.account_label?` (${_[0].account_label})`:"",". Nothing more to pay, nothing to install."]}),p("p",{className:"sc-opt-note",style:{textAlign:"center"},children:"It runs on our side, so it has no access to your files or your terminal."}),s&&x(Tn,{children:[p("button",{type:"button",className:"sc-btn sc-btn-wide",style:{marginTop:16},onClick:xt,children:"Done"}),p("div",{className:"sc-opt-alt",children:p("button",{type:"button",className:"sc-alt-link",onClick:()=>h("choose"),children:"Connect a machine too"})})]})]}),g==="denied"&&x("div",{className:"sc-card",children:[p(Er,{tone:"off"}),p("h2",{className:"sc-h",id:Ce,children:"Declined"}),p("p",{className:"sc-p",children:ne==="machine"?"Nothing was connected. You can ask again whenever you like.":"That machine was not attached to your account, and the terminal has been told so."}),p("button",{type:"button",className:"sc-btn sc-btn-wide",style:{marginTop:16},onClick:()=>h("choose"),children:"Back to the start"})]})]})}function Us(e){return e?.app.name??"this app"}function Fa(e){let n=e?.app.icon_urls;if(n?.length)return n;let t=e?.app.icon_url;return t?[t]:[]}function Fs(e){let n=Fa(e),[t,r]=z([]),s=se(c=>{c&&r(o=>o.includes(c)?o:[...o,c])},[]),a=se(c=>s(c.currentTarget.getAttribute("src")),[s]),i=se(c=>{c?.complete&&c.naturalWidth===0&&s(c.getAttribute("src"))},[s]);return{icon:n.find(c=>!t.includes(c)),onError:a,ref:i}}function Qa({context:e}){let{icon:n,onError:t,ref:r}=Fs(e);return e?.app.mark==="soba"?p(re,{className:"sc-app-mark"}):n?p("img",{className:"sc-app-mark",src:n,alt:"","aria-hidden":"true",ref:r,onError:t}):null}function Gt({context:e}){let{icon:n,onError:t,ref:r}=Fs(e),s=e?.app.mark==="soba";return x("span",{className:"sc-app",children:[s&&p(re,{className:"sc-app-icon"}),!s&&n&&p("img",{className:"sc-app-icon",src:n,alt:"",ref:r,onError:t}),Us(e)]})}function Ln({onClick:e}){return p("button",{type:"button",className:"sc-head-back",onClick:e,"aria-label":"Back",children:p("svg",{viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:p("path",{d:"M15 5 8 12l7 7",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})})}function Pr({className:e}){return p("svg",{className:e,viewBox:"0 0 24 24","aria-hidden":"true",focusable:"false",children:p("path",{d:"M9 5l7 7-7 7",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}function Wt({mark:e,still:n}){return x("span",{className:"sc-waiting","aria-hidden":"true",children:[!n&&p("svg",{className:"sc-waiting-orbit",viewBox:"0 0 100 100","aria-hidden":"true",focusable:"false",children:p("circle",{className:"sc-waiting-arc",cx:"50",cy:"50",r:"46"})}),p(e,{className:"sc-waiting-mark"})]})}function Er({tone:e}){return p("span",{className:`sc-result sc-result-${e}`,"aria-hidden":"true",children:p(Ze,{kind:e==="ok"?"snap":"gone",size:84})})}function Va({machine:e}){let{runtime:n}=Ne(e);if(!n)return null;let t=De(n);return x("div",{className:"sc-arrived",children:[p(gr,{id:n.id,name:n.display_name}),p("span",{className:"sc-arrived-name",children:n.display_name}),x("span",{className:`sc-arrived-auth${t.tone==="warn"?" sc-tone-warn":""}`,children:[t.tone==="ok"&&p("i",{className:"sc-arrived-dot","aria-hidden":"true"}),t.tone==="ok"?"Signed in":t.tone==="warn"?"Signed out":"Could not tell"]})]})}function Ht({done:e,title:n,line:t,children:r}){return x("li",{className:"sc-stall-step",children:[x("svg",{viewBox:"0 0 20 20",className:e?"sc-stall-ok":"sc-stall-open","aria-hidden":"true",children:[p("circle",{cx:"10",cy:"10",r:"9"}),e?p("path",{d:"M6 10.3 8.7 13 14 7.5"}):x(Tn,{children:[p("path",{d:"M10 5.5v5.5"}),p("circle",{className:"sc-stall-pt",cx:"10",cy:"14.3",r:"1.2"})]})]}),p("span",{className:"sc-stall-title",children:n}),p("span",{className:"sc-stall-line",children:t}),r&&p("span",{className:"sc-stall-more",children:r})]})}function Ja({text:e}){return p(Tn,{children:e.split("`").map((n,t)=>t%2===1?p("code",{className:"sc-inline-code",children:n},t):n)})}function ut({k:e,v:n}){return x("li",{className:"sc-fact",children:[p("span",{className:"sc-fact-key",children:e}),p("span",{children:n})]})}import{forwardRef as Ya}from"react";import{jsx as Or,jsxs as Lr}from"react/jsx-runtime";var Tr=Ya(function({machine:n,className:t,...r},s){if(!n)return null;let{ariaLabel:a,state:i}=En(n);return Lr("button",{ref:s,type:"button","aria-label":a,className:["sc-btn","sc-btn-connected",t].filter(Boolean).join(" "),...r,children:[Or("span",{className:"sc-pill-tile","aria-hidden":"true",children:Or(Ze,{kind:i.tone==="busy"?"serving":i.tone==="ok"?"ready":n.pairing_lost?"gone":"paused",size:16,className:"sc-pill-mark"})}),Lr("span",{className:"sc-btn-connected-text",children:[i.word,!n.pairing_lost&&Lr("span",{className:"sc-btn-connected-where",children:[" on ",q(n)]})]}),Or("i",{className:`sc-dot sc-dot-${i.tone}`,"aria-hidden":"true"})]})});import{useEffect as za,useRef as Gr}from"react";var Dt=0,Br=null;function Qs(){if(typeof document>"u")return()=>{};Dt===0&&(Br=document.body.style.overflow,document.body.style.overflow="hidden"),Dt+=1;let e=!1;return()=>{e||(e=!0,Dt-=1,Dt===0&&(document.body.style.overflow=Br??"",Br=null))}}import{jsx as Vs}from"react/jsx-runtime";function dt({open:e,onClose:n,labelledBy:t,theme:r,style:s,children:a}){let i=Gr(null),c=Gr(null),o=Gr(null);return za(()=>{let l=i.current;if(l){if(!e){l.open&&l.close();return}return l.open||l.showModal(),document.activeElement===l&&c.current?.focus(),Qs()}},[e]),Vs("dialog",{ref:i,className:"soba-connect sc-modal","aria-labelledby":t,...r?{"data-theme":r}:{},style:s,onCancel:l=>{l.preventDefault(),n()},onPointerDown:l=>{o.current=l.target},onClick:l=>{l.target===l.currentTarget&&o.current===l.currentTarget&&n()},children:Vs("div",{className:"sc-modal-sheet",ref:c,tabIndex:-1,children:a})})}import{useEffect as Wr,useRef as ja}from"react";import{jsx as qa}from"react/jsx-runtime";var vn=8;function Hr({open:e,onClose:n,anchor:t,label:r,theme:s,style:a,children:i}){let c=ja(null);return Wr(()=>{let o=c.current;if(!(!o||!(typeof o.showPopover=="function")))try{e?o.showPopover():o.hidePopover()}catch{}},[e]),Wr(()=>{if(!e)return;let o=()=>{let u=c.current,m=t.current;if(!u||!m)return;let f=m.getBoundingClientRect(),g=u.offsetWidth,h=u.offsetHeight,y=window.innerWidth-g-vn,M=Math.max(vn,Math.min(f.right-g,Math.max(vn,y))),E=f.bottom+vn,R=f.top-vn-h,G=E+h>window.innerHeight-vn&&R>vn?R:E;u.style.left=`${Math.round(M)}px`,u.style.top=`${Math.round(G)}px`};o();let l=requestAnimationFrame(o);return window.addEventListener("scroll",o,!0),window.addEventListener("resize",o),()=>{cancelAnimationFrame(l),window.removeEventListener("scroll",o,!0),window.removeEventListener("resize",o)}},[e,t]),Wr(()=>{if(!e)return;let o=u=>{u.key==="Escape"&&n()},l=u=>{let m=u.target;m&&(c.current?.contains(m)||t.current?.contains(m)||n())};return document.addEventListener("keydown",o),document.addEventListener("pointerdown",l,!0),()=>{document.removeEventListener("keydown",o),document.removeEventListener("pointerdown",l,!0)}},[e,n,t]),qa("div",{ref:c,role:"dialog","aria-label":r,className:"soba-connect sc-pop",...s?{"data-theme":s}:{},popover:"manual",hidden:!e,style:a,children:i})}var pt=new Map,Bn=new Map,Js=!1;function Za(){Js||typeof window>"u"||(Js=!0,window.addEventListener("storage",e=>{!e.key||!pt.has(e.key)||(Bn.set(e.key,Tt(e.key)),Dr(e.key))}))}function Dr(e){for(let n of pt.get(e)??[])n()}function mt(e){return e??""}function Ur(e,n){let t=mt(e);Za();let r=pt.get(t)??new Set;return r.add(n),pt.set(t,r),()=>{r.delete(n),r.size===0&&pt.delete(t)}}function Ut(e){let n=mt(e),t=Bn.get(n);if(t!==void 0)return t;let r=e?Tt(e):null;return Bn.set(n,r),r}function Fr(){return null}function Qr(e,n){Ut(e)===null&&(Bn.set(mt(e),n),Dr(mt(e)))}function Vr(e,n){let t=mt(e);Bn.get(t)!==n&&(Bn.set(t,n),kr(e,n),Dr(t))}function ze(e){let n=`${e.unit}s`;return e.reward==="unlimited"?`Unlimited ${n} on your own AI`:e.reward==="included"&&e.includedUnits!==null?`${Ka(e.includedUnits)} ${n} a month once you connect`:e.reward==="credit"&&e.creditMicros>0?`${Xa(e.creditMicros)} back each month you stay connected`:null}function je(e){return e==="unlimited"||e==="included"}var zs=new Set(["user-hardware","user-subscription"]),Ys=new Set(["open-weights","frontier"]);function Le(e){return e===null||e.length===0?!1:e.every(n=>zs.has(n))}var Xa=e=>(e/1e6).toLocaleString("en-US",{style:"currency",currency:"USD",minimumFractionDigits:2,maximumFractionDigits:2}),Ka=e=>e.toLocaleString("en-US");function Jr(e,n){if(!(n===null||n.some(a=>Ys.has(a))))return!1;let r=e.findIndex(a=>zs.has(a));if(r===-1)return!1;let s=e.findIndex(a=>Ys.has(a));return s===-1||r<s}import{createContext as js,useContext as qs}from"react";var Yr=js(null);function Gn(){return qs(Yr)}var zr=js({context:null,machines:void 0,theme:"light"});function H(){return qs(zr)}import{useMemo as ei}from"react";import{createContext as _a,useContext as $a}from"react";var jr=_a(null);function F(){let e=$a(jr);if(!e)throw new Error("useSoba() must be used inside a <SobaProvider>.");return e}function ht(){let{compute:e}=F();return ei(()=>{let n=e.machines,t=[...n].sort((a,i)=>Ue([a,i])===a?-1:1).map(ni),r=Ue([...n]),s=fn(n);return{view:t.length?"machines":e.loading?"loading":e.error?"error":"empty",machines:t,primary:r?t.find(a=>a.machine.id===r.id)??null:null,connected:e.connected,online:e.online,stalled:e.connected&&!e.online&&s?t.find(a=>a.machine.id===s.id)??null:null,loading:e.loading,error:e.error,refresh:e.refresh}},[e])}function ni(e){let n=Ne(e);return{machine:e,name:q(e),state:An(e),status:$t(e),hardware:Kn(e),lastSeen:e.state==="offline"?_n(e.last_seen_at):null,runtimes:ge(e).map(t=>({runtime:t,name:t.display_name,auth:De(t),quarantined:!!t.quarantined})),runsOn:{by:n.by,name:n.runtime?.display_name??null}}}import{useCallback as qr,useEffect as ti,useMemo as Zr,useSyncExternalStore as ri}from"react";function kn(e={}){let{compute:n,connect:t}=F(),{value:r,onChange:s,defaultValue:a,remember:i=!0,user:c}=e,o=r!==void 0,l=i&&!o?vr(t.publishableKey,c):null,u=qr(R=>Ur(l,R),[l]),m=ri(u,qr(()=>Ut(l),[l]),Fr),f=Zr(()=>rt(n.machines),[n.machines]),g=Zr(()=>st(f),[f]);ti(()=>{o||!a||Qr(l,a)},[o,a,l]);let h=o?r:m??a??null,{selected:y,unavailable:M}=Zr(()=>ar(f,h??null),[f,h]),E=qr(R=>{o||Vr(l,R),s?.(R)},[o,l,s]);return{options:f,groups:g,selected:y,select:E,run:ir(y),unavailable:M,pickable:Ke(f),loading:n.loading&&!n.machines.length}}import{jsx as gt}from"react/jsx-runtime";function si({className:e}){let{theme:n}=H(),t=e?`soba-connect ${e}`:"soba-connect";return gt("div",{className:t,"data-theme":n,children:gt(Xr,{})})}function Xr(){let e=ht(),n=kn();return e.view==="loading"?gt("p",{className:"sc-note",children:"Loading\u2026"}):e.view==="error"?gt("p",{className:"sc-error",children:e.error?.message}):gt(Ar,{machines:e.machines.map(t=>t.machine),model:n.selected,onPickModel:n.select})}import{useCallback as At,useEffect as es,useMemo as pi,useRef as ns,useState as Hn}from"react";import{useId as oi}from"react";import{jsx as Wn,jsxs as Ft}from"react/jsx-runtime";function ft({open:e,onOpenChange:n,initialCode:t,onConnected:r,showStatus:s,reason:a}){let{error:i}=F(),c=Gn(),o=H(),l=()=>n(!1),u=oi(),m=o.context?.background?.trim(),f=m?gn(m,o.context?.accent):void 0;return Ft(dt,{open:e,onClose:l,labelledBy:u,theme:o.theme,style:f,children:[i?Ft("div",{className:"sc-card",children:[Wn("h2",{className:"sc-title",id:u,children:"Could not start"}),Wn("p",{className:"sc-error",children:i.message})]}):!c&&!o.context?Ft("div",{className:"sc-card",children:[Wn("h2",{className:"sc-title",id:u,children:"One moment"}),Wn("p",{className:"sc-note",children:"Getting your compute\u2026"})]}):Wn(Ir,{client:c,active:e,onClose:l,headingId:u,theme:o.theme,initialContext:o.context,...o.machines!==void 0?{initialMachines:o.machines}:{},...t?{initialCode:t}:{},...r?{onConnected:r}:{},...s===void 0?{}:{showStatus:s},...a?{reason:a}:{}}),Ft("p",{className:"sc-modal-foot",children:[Wn(re,{className:"sc-foot-mark"}),"Secured by Soba"]})]})}import{forwardRef as ai}from"react";import{jsx as ii}from"react/jsx-runtime";var Kr=ai(function(n,t){let{theme:r}=H();return ii(Tr,{ref:t,"data-theme":r,...n})});import{useCallback as li}from"react";function ci(){let{connect:e}=F(),n=ht(),t=li(()=>e.open("manual"),[e]);return{...En(n.primary?.machine??null),machine:n.primary,open:t,canOpen:e.hasModal,loading:n.view==="loading"}}function _r(e){return En(e)}import{useCallback as Zs,useEffect as ui,useState as di}from"react";function $r({enabled:e=!0,intervalMs:n=3e3}={}){let t=Gn(),[r,s]=di(null),a=Zs(async()=>{t&&s(await t.runs())},[t]);ui(()=>{if(!e||!t)return;let c=!0,o=Se(async()=>{let l=await t.runs();c&&s(l)},n);return()=>{c=!1,o()}},[e,t,n]);let i=Zs(async c=>{if(!t)throw new Error("Stopping a run needs <SobaProvider>.");await t.stopRun(c),await a().catch(()=>{})},[t,a]);return{runs:r,refresh:a,stop:i}}import{Fragment as Xs,jsx as Dn,jsxs as Ks}from"react/jsx-runtime";function Nn({children:e,variant:n,className:t,initialCode:r,onConnected:s,defaultOpen:a,open:i,onOpenChange:c,showConnected:o=!0}){let{compute:l,connect:u}=F(),m=H(),{theme:f}=m,g=Gn(),[h,y]=Hn(a??!!r),M=ns(null),E=i!==void 0,R=!E&&!a&&!r&&u.hasModal,G=E?i:R?u.isOpen:h,Y=P=>{R?P?u.open("manual"):u.close():E||y(P),c?.(P)},O=ns(G);es(()=>{O.current&&!G&&M.current?.focus(),O.current=G},[G]);let[L,T]=Hn(!1),{runs:w,stop:le}=$r({enabled:L}),$=kn(),be=pi(()=>L&&w?mi(l.machines,w):l.machines,[l.machines,L,w]),ee=Ue(be),Re=o&&_r(ee).connected,Be=At(()=>T(!1),[]),[me,Pe]=Hn(!1),j=At(async()=>{Pe(!0);try{await l.refresh()}finally{Pe(!1)}},[l]),ce=ns(j);ce.current=j,es(()=>{L&&ce.current()},[L]);let[rn,Z]=Hn(!1),[ye,we]=Hn([]),ne=!!m.context?.hosted_available;es(()=>{if(!L||!g||!ne)return;let P=!0;return g.hosted().then(C=>{P&&we(C.credentials)}).catch(()=>{}),()=>{P=!1}},[L,g,ne]);let[Ge,X]=Hn(null),K=At(async(P,C)=>{if(g){X(null);try{await g.approveRuntime(P,C),await l.refresh()}catch(I){X(I.message)}}},[g,l]),_=At(async(P,C)=>{if(g){X(null);try{await g.preferRuntime(P,C),await l.refresh()}catch(I){X(I.message)}}},[g,l]),We=At(async P=>{if(g){X(null);try{await g.disconnectHosted(P),we((await g.hosted()).credentials)}catch(C){X(C.message)}}},[g]),Ve=m.context?.background?.trim(),He=Ve?gn(Ve,m.context?.accent):void 0,B=Re&&!e,Q=()=>{if(B&&!E&&!a&&!r){T(P=>!P);return}Y(!0)};return Ks(Xs,{children:[B?Dn(Kr,{ref:M,machine:ee,"aria-haspopup":"dialog","aria-expanded":L,onClick:Q,...t?{className:t}:{}}):Dn("button",{ref:M,type:"button","data-theme":f,className:["sc-btn","sc-btn-icon",n==="primary"?"sc-btn-primary":"",t].filter(Boolean).join(" "),onClick:Q,children:e??Ks(Xs,{children:[Dn(re,{className:"sc-btn-mark"}),"Connect compute"]})}),Dn(Hr,{open:L,onClose:Be,anchor:M,label:"Your compute",theme:f,...He?{style:He}:{},children:Dn(Cn,{machines:be,hosted:ye,onApproveRuntime:(P,C)=>void K(P,C),onPreferRuntime:(P,C)=>void _(P,C),onDisconnectHosted:P=>void We(P),onRefresh:()=>void j(),refreshing:me,model:$.selected,onPickModel:$.select,error:Ge,runs:w,onStopRun:async P=>{X(null);try{await le(P)}catch(C){throw X(C.message),C}},onPair:()=>{T(!1),R?u.open("pair"):(Z(!0),Y(!0))},...m.context?.app.name?{appName:m.context.app.name}:{}})}),!R&&Dn(ft,{open:G,onOpenChange:P=>{P||Z(!1),Y(P)},...rn?{showStatus:!1}:{},...r?{initialCode:r}:{},...s?{onConnected:s}:{}})]})}function mi(e,n){return e.map(t=>{if(t.state==="offline")return t;let r=n.filter(s=>s.machine_id===t.id).length;return{...t,active:r,state:r>0?"busy":"online"}})}import{jsx as ts,jsxs as gi}from"react/jsx-runtime";function hi({initialCode:e,onConnected:n,className:t,showStatus:r=!0}){let{theme:s}=H();return gi("div",{className:t?`soba-connect ${t}`:"soba-connect","data-theme":s,children:[r&&ts(Xr,{}),ts("div",{className:"sc-compute-act",children:ts(Nn,{...e?{initialCode:e}:{},...n?{onConnected:n}:{}})})]})}import{useId as Si,useState as Ri}from"react";import{useCallback as ss,useEffect as to,useState as ro}from"react";import{useCallback as fi,useState as Ai}from"react";function bt(){let[e,n]=Ai(null);return{open:fi(()=>{n(null),bn().then(n)},[]),launch:e,note:e==="absent"?"Nothing opened here. That machine may be a different computer, or asleep.":null}}import{useCallback as _s,useMemo as $s}from"react";function xn(e){if(!e)return null;if(typeof e=="string")return e;if(typeof Response<"u"&&e instanceof Response)return eo(e.status);let n=e,t=n.error;return typeof t?.code=="string"?t.code:typeof t?.type=="string"?t.type:typeof n.code=="string"?n.code:typeof n.status=="number"?eo(n.status):n.cause&&n.cause!==e?xn(n.cause):null}function eo(e){return e===402?"payment_required":e===409?"no_compute":null}function rs(...e){let[n,t]=e,{plan:r,compute:s,connect:a}=F(),i=t?.predict??e.length===0,c=yi(bi(n),s)??(i?wi(r,s):null),o=r.plan,l=r.plans,u=$s(()=>{if(c!=="payment_required")return null;let h=o?.price??0,y=o?.included_units??0;return l.find(M=>M.id!==o?.id&&M.price>h&&(M.included_units===null||M.included_units>y))??null},[c,l,o]),m=_s(async()=>{if(!u)return;if(u.selectable){await r.select(u.id);return}let h=await r.checkout(u.id);window.location.assign(h)},[u,r]),f=a.open,g=_s(()=>{c&&f(c)},[f,c]);return $s(()=>{if(!c)return null;let h=o?ze({unit:o.unit,reward:o.connected_reward,includedUnits:o.connected_included_units,creditMicros:o.connected_credit*1e6}):null,y=o&&je(o.connected_reward)?h:null;return{reason:c,...Ci(c,{connectOffer:y,connected:s.connected,online:s.online,machine:fn(s.machines)?.label??null,unit:o?.unit??"message",interval:o?.interval??"month",upgrade:u!==null,resets:r.current?.period_end??null}),connectOffer:y,upgradeTo:u,connect:g,upgrade:m}},[c,o,s,u,g,m,r.current?.period_end])}function bi(e){let n=xn(e);return n==="payment_required"||n==="no_compute"?n:null}function yi(e,n){return e==="no_compute"&&n.connected&&n.online?null:e}function wi(e,n){let t=e.plan;return!t||n.loading?null:Le(t.route_allow)&&!n.online?"no_compute":e.remaining===0&&t.overage==="stop"?"payment_required":null}function Ci(e,n){if(e==="payment_required"){let t=`No ${n.unit}s left this ${n.interval}`;return n.connectOffer&&!n.connected?{title:t,body:`${n.connectOffer}. Connecting takes a minute and costs nothing.`}:n.connectOffer&&!n.online?{title:t,body:`${n.connectOffer}. Waking ${n.machine??"your machine"} is enough.`}:n.upgrade?{title:t,body:n.resets?`A larger plan carries on now. This one comes back on ${no(n.resets)}.`:"A larger plan carries on now, or wait for this one to renew."}:{title:t,body:n.resets?`Your allowance comes back on ${no(n.resets)}.`:"Your allowance comes back at the start of the next period."}}return n.connected&&!n.online?{title:`${n.machine??"Your machine"} can't be reached`,body:"This run needs it awake and connected. Open Soba App on that machine, or connect another one."}:{title:"Nothing connected yet",body:"This app runs on AI you already pay for, on a machine of your own. Connect one and this run has somewhere to go."}}function no(e){let n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleDateString(void 0,{day:"numeric",month:"long"})}function vi(e){let{plan:n,allowance:t,connected:r,online:s,quiet:a,error:i,predict:c,at:o,waved:l}=e;if(!n)return null;let u=e.allow!==void 0?e.allow:n.route_allow;if(r){if(s)return null;let y=Le(u);return{reason:"stalled",title:`${a??"Your machine"} can\u2019t be reached`,detail:y?"The Soba app there has stopped reporting in, so runs have nowhere to go until it is back.":"The Soba app there has stopped reporting in, so nothing will run on your own AI until it is back.",meter:null,dismissible:!1,atTheWall:!1,ownCompute:y}}let m=xn(i),f=m==="payment_required"||m==="no_compute",g=n.ask_to_connect!==!1&&Jr(n.route_prefer,u);if(!c&&!f&&!g)return null;let h=Le(u)?ki(n.unit,Le(n.route_allow)):je(n.connected_reward)?xi(t,n,o):g?Ni(n.unit):null;return!h||h.dismissible&&l?null:{...h,dismissible:!!h.dismissible,ownCompute:!1,atTheWall:!h.dismissible&&(!c||h.meter!==null&&h.meter.left===0)}}function os(e={}){let{at:n=.25,error:t,allow:r}=e,s=e.predict??!(e.errorGiven??t!==void 0),{plan:a,compute:i,connect:c}=F(),o=Nr(c.publishableKey),[l,u]=ro(!1);to(()=>{u(xr(o))},[o]);let m=ss(()=>{u(!0),Mr(o)},[o]),f=ss(()=>c.open("manual"),[c]),g=ss(()=>c.open("no_compute"),[c]),h=bt(),[y,M]=ro(!1),{refresh:E}=i,{launch:R}=h;to(()=>{if(R===null||R==="absent")return;M(!1);let T=setInterval(()=>void E(),3e3),w=setTimeout(()=>{clearInterval(T),M(!0)},2e4);return()=>{clearInterval(T),clearTimeout(w)}},[R,E]);let G=Mi(c.app?.name,ct(c.connectUrl)),Y=a.loading||i.loading,O=fn(i.machines),L=Y?null:vi({plan:a.plan,allowance:{remaining:a.remaining,included:a.included},connected:i.connected,online:i.online,quiet:O?q(O):null,error:t,predict:s,...r!==void 0?{allow:r}:{},at:n,waved:l});return{reason:L?.reason??null,visible:L!==null,title:L?.title??null,detail:L?.detail??null,meter:L?.meter??null,dismissible:L?.dismissible??!1,dismissed:l,dismiss:m,open:f,atTheWall:L?.atTheWall??!1,steps:G,stalled:L?.reason==="stalled"?{machine:O?q(O):null,ownCompute:L.ownCompute,wake:h.open,launch:h.launch,note:h.note,stuck:y,connectAnother:g}:null,loading:Y}}function ki(e,n){return{reason:"needed",title:n?"This plan runs on your own AI.":`These ${e}s run on your own AI.`,detail:`Connect a machine and your ${e}s run there, free, on access you already have.`,meter:null}}function Ni(e){return{reason:"preferred",title:"This plan prefers your own AI.",detail:`Connect a machine and your ${e}s run there instead, on access you already have.`,meter:null,dismissible:!0}}function xi(e,n,t){let{remaining:r,included:s}=e;if(r===null||s===null||s===0||r>Math.ceil(s*t))return null;let a=ze({unit:n.unit,reward:n.connected_reward,includedUnits:n.connected_included_units,creditMicros:n.connected_credit*1e6});return a?{reason:"running",title:r===0?`No ${n.unit}s left this month.`:`${r} ${n.unit}${r===1?"":"s"} left this month.`,detail:`${a}.`,meter:{left:r,of:s}}:null}function Mi(e,n){return[{lead:"Download Soba App",detail:"",...n?{linksLead:"Get it for"}:{},links:n?lt.map(t=>({label:t.label,href:`${n}/download/${t.slug}`})):[]},{lead:"Connect compute",detail:"Press this, then approve the pairing when the app asks.",opens:!0,links:[]},{lead:"Let your AIs serve",detail:`It finds what is installed on that machine. Allow one, and ${e??"this app"} sends every run there.`,linksLead:"Nothing on it yet?",links:fe.map(t=>({label:t.short,href:t.install}))}]}import{Fragment as oo,jsx as W,jsxs as en}from"react/jsx-runtime";function Pi(e){let{className:n,fallback:t=null}=e,r=os({...e.at===void 0?{}:{at:e.at},...e.predict===void 0?{}:{predict:e.predict},...e.allow===void 0?{}:{allow:e.allow},error:e.error,errorGiven:"error"in e}),{connect:s}=F(),{theme:a}=H(),[i,c]=Ri(null),o=Si(),l=W(oo,{children:t});if(!r.visible)return l;if(r.stalled)return W(so,{className:n,theme:a,stalled:!0,children:W(Ei,{title:r.title??"",detail:r.detail??"",stalled:r.stalled})});let u=i??r.atTheWall;return en(so,{className:n,theme:a,children:[en("div",{className:"sc-nudge-top",children:[en("div",{className:"sc-nudge-say",children:[W("p",{className:"sc-nudge-title",children:r.title}),W("p",{className:"sc-nudge-detail",children:r.detail}),en("button",{type:"button",className:"sc-btn sc-btn-quiet sc-nudge-more","aria-expanded":u,"aria-controls":o,onClick:()=>c(!u),children:[u?"Hide the details":"How it works",W(Oi,{})]})]}),r.dismissible?W("button",{type:"button",className:"sc-nudge-dismiss","aria-label":"Dismiss",title:"Dismiss",onClick:r.dismiss,children:W(Ii,{})}):null]}),u?W("ol",{className:"sc-nudge-steps",id:o,children:r.steps.map(m=>en("li",{children:[m.opens?W("button",{type:"button",className:"sc-step-lead",onClick:()=>s.open("manual"),children:m.lead}):W("strong",{children:m.lead}),m.detail?W("span",{children:m.detail}):null,m.links.length>0?en("span",{className:"sc-step-links",children:[m.linksLead,m.links.map(f=>W("a",{href:f.href,target:"_blank",rel:"noreferrer noopener",children:f.label},f.href))]}):null]},m.lead))}):null,W(Nn,{variant:"primary"})]})}function so({className:e,theme:n,stalled:t,children:r}){return W("div",{className:e?`soba-connect sc-fill ${e}`:"soba-connect sc-fill","data-theme":n,children:W("div",{className:t?"sc-nudge sc-nudge-stalled":"sc-nudge",children:r})})}function Ei({title:e,detail:n,stalled:t}){return en(oo,{children:[W("div",{className:"sc-nudge-top",children:en("div",{className:"sc-nudge-say",children:[W("p",{className:"sc-nudge-title",children:e}),W("p",{className:"sc-nudge-detail",children:n}),t.note&&W("p",{className:"sc-nudge-note",children:t.note}),t.stuck&&W("p",{className:"sc-nudge-note",children:"The Soba app is open, but this machine still isn\u2019t reporting in. It may no longer be connected to this app."}),(t.launch==="absent"||t.stuck)&&W("button",{type:"button",className:"sc-btn sc-btn-quiet sc-nudge-more",onClick:t.connectAnother,children:t.stuck?"Connect it again":"Connect another machine"})]})}),W("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:t.wake,children:"Open Soba App"})]})}function Ii(){return W("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",className:"sc-nudge-x",children:W("path",{d:"m4.8 4.8 6.4 6.4M11.2 4.8l-6.4 6.4",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"})})}function Oi(){return W("svg",{viewBox:"0 0 16 16","aria-hidden":"true",focusable:"false",className:"sc-nudge-chev",children:W("path",{d:"M4.5 6.5 8 10l3.5-3.5",fill:"none",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}var Li=new Set(["delta","thinking","status","done","error"]);function Un(e){let n;try{n=JSON.parse(e)}catch{return null}if(!n||typeof n!="object")return null;let t=n,r=t.type==="event"?t.event:t;if(!r||typeof r!="object")return null;let s=r;if(typeof s.type!="string"||!Li.has(s.type))return null;let a={type:s.type};return typeof s.text=="string"&&(a.text=s.text),typeof s.message=="string"&&(a.message=s.message),typeof s.tool=="string"&&(a.tool=s.tool),typeof s.tier=="string"&&(a.tier=s.tier),s.usage&&typeof s.usage=="object"&&(a.usage=s.usage),typeof s.session=="string"&&(a.session=s.session),typeof s.toolInput=="string"&&(a.toolInput=s.toolInput),s.git&&typeof s.git=="object"&&(a.git=s.git),s.turn&&typeof s.turn=="object"&&typeof s.turn.text=="string"&&(a.turn={text:s.turn.text}),typeof s.reason=="string"&&(a.reason=s.reason),typeof s.retryable=="boolean"&&(a.retryable=s.retryable),(s.state==="interrupted"||s.state==="resumed")&&(a.state=s.state),a}async function*as(e){let n=e.body;if(!n)throw new Error("That run response had no body to stream.");let t=(e.headers.get("content-type")??"").includes("ndjson"),r=n.getReader(),s=new TextDecoder,a="",i=[];try{for(;;){let o=await r.read();if(o.done)break;for(a+=s.decode(o.value,{stream:!0});;){let l=a.indexOf(`
|
|
3
|
+
`);if(l===-1)break;let u=io(a.slice(0,l));if(a=a.slice(l+1),t){let m=u.trim()?Un(u):null;m&&(yield m);continue}if(u===""){let m=i.join(`
|
|
4
|
+
`);if(i=[],m==="[DONE]")return;let f=m?Un(m):null;f&&(yield f);continue}ao(u,i)}}!t&&a&&ao(io(a),i);let c=t?a.trim():i.join(`
|
|
5
|
+
`);if(c&&c!=="[DONE]"){let o=Un(c);o&&(yield o)}}finally{r.cancel().catch(()=>{})}}function ao(e,n){if(!e||e.startsWith(":"))return;let t=e.indexOf(":");if(t===-1||e.slice(0,t)!=="data")return;let r=e.slice(t+1);n.push(r.startsWith(" ")?r.slice(1):r)}function io(e){return e.endsWith("\r")?e.slice(0,-1):e}async function Ti(e){let n="";for await(let t of e)if(t.type==="delta"&&t.text&&(n+=t.text),t.type==="error")throw new Error(t.message??"The run ended with an error.");return n}import{jsx as lo}from"react/jsx-runtime";function Bi({caption:e,disabled:n,className:t,...r}){let{theme:s}=H(),{options:a,selected:i,select:c,pickable:o}=kn(r);return o?lo("span",{className:"soba-connect sc-inline","data-theme":s,children:lo(ot,{options:a,selected:i,onPick:c,...e?{caption:e}:{},...n?{disabled:n}:{},...t?{className:t}:{}})}):null}import{useEffect as Gi}from"react";var co="data-soba-react",uo=!1;function yt(){if(uo||typeof document>"u"||(uo=!0,document.querySelector(`style[${co}]`)))return;let e=document.createElement("style");e.setAttribute(co,""),e.textContent=`.soba-connect {
|
|
6
6
|
--sc-ground: #ffffff;
|
|
7
7
|
--sc-sheet: #ffffff;
|
|
8
8
|
--sc-raised: #f6f6f7;
|
|
@@ -862,6 +862,119 @@ a.sc-btn {
|
|
|
862
862
|
text-align: center;
|
|
863
863
|
}
|
|
864
864
|
|
|
865
|
+
.sc-screen-head {
|
|
866
|
+
display: flex;
|
|
867
|
+
align-items: center;
|
|
868
|
+
gap: calc(12px * var(--sc-scale, 1));
|
|
869
|
+
}
|
|
870
|
+
|
|
871
|
+
.sc-back {
|
|
872
|
+
flex: none;
|
|
873
|
+
display: grid;
|
|
874
|
+
place-items: center;
|
|
875
|
+
width: calc(36px * var(--sc-scale, 1));
|
|
876
|
+
height: calc(36px * var(--sc-scale, 1));
|
|
877
|
+
padding: 0;
|
|
878
|
+
border: 0;
|
|
879
|
+
border-radius: 50%;
|
|
880
|
+
background: var(--sc-tray-card, #ffffff);
|
|
881
|
+
color: var(--sc-text, #1b1b1a);
|
|
882
|
+
font: inherit;
|
|
883
|
+
cursor: pointer;
|
|
884
|
+
box-shadow: var(--sc-shadow-1);
|
|
885
|
+
transition: background-color 120ms ease;
|
|
886
|
+
}
|
|
887
|
+
.sc-back:hover:not(:disabled) {
|
|
888
|
+
background: var(--sc-tray-sunk, #efefed);
|
|
889
|
+
}
|
|
890
|
+
.sc-back:disabled {
|
|
891
|
+
cursor: default;
|
|
892
|
+
opacity: 0.5;
|
|
893
|
+
}
|
|
894
|
+
.sc-back-glyph {
|
|
895
|
+
width: calc(15px * var(--sc-scale, 1));
|
|
896
|
+
height: calc(15px * var(--sc-scale, 1));
|
|
897
|
+
}
|
|
898
|
+
.sc-screen-title {
|
|
899
|
+
margin: 0;
|
|
900
|
+
font-size: calc(var(--sc-font-size, 15px) * 1.3333);
|
|
901
|
+
font-weight: 600;
|
|
902
|
+
color: var(--sc-text, #1b1b1a);
|
|
903
|
+
}
|
|
904
|
+
|
|
905
|
+
.sc-group-card.sc-mopts {
|
|
906
|
+
padding: 0 calc(16px * var(--sc-scale, 1));
|
|
907
|
+
}
|
|
908
|
+
.sc-mopt {
|
|
909
|
+
display: flex;
|
|
910
|
+
align-items: center;
|
|
911
|
+
gap: calc(14px * var(--sc-scale, 1));
|
|
912
|
+
width: 100%;
|
|
913
|
+
padding: calc(16px * var(--sc-scale, 1)) 0;
|
|
914
|
+
border: 0;
|
|
915
|
+
background: transparent;
|
|
916
|
+
font: inherit;
|
|
917
|
+
color: inherit;
|
|
918
|
+
text-align: left;
|
|
919
|
+
cursor: pointer;
|
|
920
|
+
}
|
|
921
|
+
.sc-mopt + .sc-mopt {
|
|
922
|
+
box-shadow: inset 0 1px 0 var(--sc-line, #e9e9e7);
|
|
923
|
+
}
|
|
924
|
+
.sc-mopt:disabled {
|
|
925
|
+
cursor: default;
|
|
926
|
+
opacity: 0.5;
|
|
927
|
+
}
|
|
928
|
+
.sc-mopt-say {
|
|
929
|
+
display: flex;
|
|
930
|
+
flex: 1;
|
|
931
|
+
min-width: 0;
|
|
932
|
+
flex-direction: column;
|
|
933
|
+
gap: calc(2px * var(--sc-scale, 1));
|
|
934
|
+
}
|
|
935
|
+
.sc-mopt-name {
|
|
936
|
+
|
|
937
|
+
overflow-wrap: anywhere;
|
|
938
|
+
font-size: calc(var(--sc-font-size, 15px) * 1.0667);
|
|
939
|
+
font-weight: 600;
|
|
940
|
+
}
|
|
941
|
+
.sc-mopt-desc {
|
|
942
|
+
font-size: calc(var(--sc-font-size, 15px) * 0.9333);
|
|
943
|
+
line-height: calc(20px * var(--sc-scale, 1));
|
|
944
|
+
color: var(--sc-muted, #6b6b69);
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
.sc-ring {
|
|
948
|
+
flex: none;
|
|
949
|
+
box-sizing: border-box;
|
|
950
|
+
display: grid;
|
|
951
|
+
place-items: center;
|
|
952
|
+
width: calc(22px * var(--sc-scale, 1));
|
|
953
|
+
height: calc(22px * var(--sc-scale, 1));
|
|
954
|
+
border: 2px solid var(--sc-line-2, #cfcfcb);
|
|
955
|
+
border-radius: 50%;
|
|
956
|
+
color: var(--sc-accent-fg, #ffffff);
|
|
957
|
+
transition:
|
|
958
|
+
background-color 120ms ease,
|
|
959
|
+
border-color 120ms ease;
|
|
960
|
+
}
|
|
961
|
+
.sc-ring-on {
|
|
962
|
+
border-color: var(--sc-accent, #1b1b1a);
|
|
963
|
+
background: var(--sc-accent, #1b1b1a);
|
|
964
|
+
}
|
|
965
|
+
.sc-ring-tick {
|
|
966
|
+
width: calc(13px * var(--sc-scale, 1));
|
|
967
|
+
height: calc(13px * var(--sc-scale, 1));
|
|
968
|
+
}
|
|
969
|
+
|
|
970
|
+
.sc-screen-foot {
|
|
971
|
+
margin: 0;
|
|
972
|
+
padding: 0 calc(4px * var(--sc-scale, 1));
|
|
973
|
+
font-size: max(12px, calc(var(--sc-font-size, 15px) * 0.8667));
|
|
974
|
+
line-height: 1.5;
|
|
975
|
+
color: var(--sc-muted, #6b6b69);
|
|
976
|
+
}
|
|
977
|
+
|
|
865
978
|
.sc-arow {
|
|
866
979
|
display: flex;
|
|
867
980
|
align-items: center;
|
|
@@ -3898,7 +4011,7 @@ li.sc-plan-row.sc-plan-current {
|
|
|
3898
4011
|
transform: none;
|
|
3899
4012
|
}
|
|
3900
4013
|
}
|
|
3901
|
-
`,document.head.appendChild(e)}import{jsx as De,jsxs as bt}from"react/jsx-runtime";function to(e){if(!e)return null;let n=kn(e);if(n==="payment_required"||n==="no_compute")return null;if(typeof e=="string")return e||null;let t=e,r=t.error?.message;return typeof r=="string"&&r?r:typeof t.message=="string"&&t.message?t.message:"The run ended with an error."}function ki(){return bt("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[De("path",{d:"M8 5v4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),De("circle",{cx:"8",cy:"11.6",r:"0.9",fill:"currentColor"}),De("circle",{cx:"8",cy:"8",r:"6.4",stroke:"currentColor",strokeWidth:"1.3"})]})}function Ni({error:e,onRetry:n,onDismiss:t,title:r,className:s}){let o=to(e),a=G();return vi(()=>At(),[]),o?De("div",{className:s?`soba-connect ${s}`:"soba-connect","data-theme":a.theme,role:"alert",children:bt("div",{className:"sc-card sc-limit sc-run-error",children:[bt("div",{className:"sc-limit-head",children:[De("span",{className:"sc-limit-mark sc-run-error-mark","aria-hidden":"true",children:De(ki,{})}),bt("div",{children:[De("h2",{className:"sc-limit-title",children:r??"That run did not finish"}),De("p",{className:"sc-limit-body sc-run-error-message",children:o})]})]}),(t||n)&&bt("div",{className:"sc-limit-actions",children:[t&&De("button",{type:"button",className:"sc-btn sc-btn-quiet",onClick:t,children:"Dismiss"}),n&&De("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:n,children:"Try again"})]})]})}):null}import{useId as xi,useState as ro}from"react";import{jsx as ie,jsxs as Ut}from"react/jsx-runtime";function Mi({reason:e}){return ie("span",{className:"sc-limit-mark","aria-hidden":"true",children:e==="no_compute"?ie(St,{}):ie(oe,{})})}function Si(e){let{error:n,variant:t="card",onDismiss:r,className:s}=e,o=_r(n,{predict:e.predict??!("error"in e)}),a=xi(),l=G();if(!o)return null;let i=ie(Pi,{offer:o,headingId:a,onDismiss:r});return t==="dialog"?ie(ct,{open:!0,onClose:()=>r?.(),labelledBy:a,theme:l.theme,children:i}):ie("div",{className:s?`soba-connect ${s}`:"soba-connect","data-theme":l.theme,children:i})}function Pi({offer:e,headingId:n,onDismiss:t}){let{compute:r}=D(),[s,o]=ro(!1),[a,l]=ro(null),i=e.reason==="no_compute"&&r.connected&&!r.online,c=i||e.connectOffer!==null||!r.connected,u=ft();async function m(){o(!0),l(null);try{await e.upgrade()}catch(A){l(A.message)}finally{o(!1)}}return Ut("div",{className:"sc-card sc-limit",children:[Ut("div",{className:"sc-limit-head",children:[ie(Mi,{reason:e.reason}),Ut("div",{children:[ie("h2",{className:"sc-limit-title",id:n,children:e.title}),ie("p",{className:"sc-limit-body",children:e.body})]})]}),a&&ie("p",{className:"sc-error",children:a}),i&&u.note&&ie("p",{className:"sc-limit-note",children:u.note}),Ut("div",{className:"sc-limit-actions",children:[t&&ie("button",{type:"button",className:"sc-btn sc-btn-quiet",onClick:t,disabled:s,children:"Not now"}),e.upgradeTo&&ie("button",{type:"button",className:c?"sc-btn":"sc-btn sc-btn-primary",onClick:()=>void m(),disabled:s,children:s?"Opening\u2026":e.upgradeTo.selectable?`Switch to ${e.upgradeTo.name}`:`${e.upgradeTo.name} for $${e.upgradeTo.price.toLocaleString()}/${e.upgradeTo.interval}`}),c&&ie("button",{type:"button",className:i?"sc-btn":"sc-btn sc-btn-primary",onClick:e.connect,disabled:s,children:i?"Connect another machine":"Connect compute"}),i&&ie("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:u.open,disabled:s,children:"Open Soba App"})]})]})}import{useMemo as Ri}from"react";function yt(){let{plan:e,compute:n,connect:t}=D();return Ri(()=>{let r=e.plan,s=e.current,o={plan:r,assignment:s,loading:e.loading,error:e.error,periodEnd:s?.period_end?new Date(s.period_end):null};if(!r)return{...o,state:"none",trialDaysLeft:null,ceiling:null,raised:!1,uncounted:!1,used:0,remaining:null,percent:null,unlimited:!1,reward:null,summary:"Nothing is assigned to this account, so runs are bounded by whatever the app allows."};let a=Oi(s?.trial_ends_at??null),l=r.connected_reward==="included"&&n.connected&&r.connected_included_units!==null,i=l?r.connected_included_units:r.included_units,c=r.connected_reward==="unlimited"&&n.connected,u=i===null,m=e.used??0,A=i===null?null:Math.max(0,i-m),g=i&&i>0?Math.min(100,Math.round(m/i*100)):null,h=i!==null&&m>=i,y=a!==null?"trial":u?"unlimited":h?r.overage==="meter"?"metered":"spent":"within";return{...o,state:y,trialDaysLeft:a,ceiling:i,raised:l,uncounted:c,used:m,remaining:A,percent:g,unlimited:u,reward:Ei(r,l||c,n.connected,()=>t.open("manual")),summary:Ii({plan:r,assignment:s,used:m,ceiling:i,trialDaysLeft:a,raised:l,uncounted:c,state:y})}},[e,n.connected,t])}function Ei(e,n,t,r){let s=Je({unit:e.unit,reward:e.connected_reward,includedUnits:e.connected_included_units,creditMicros:e.connected_credit*1e6});return s?{line:s,inForce:n,required:!1,connected:t,actionable:Ye(e.connected_reward)&&!t,open:r}:Ie(e.route_allow)&&!t?{line:"Nothing connected yet, so nothing can run.",inForce:!1,required:!0,connected:t,actionable:!0,open:r}:null}function Ii(e){let{plan:n,assignment:t,used:r,ceiling:s,trialDaysLeft:o,raised:a,uncounted:l,state:i}=e,c=`${n.unit}${r===1?"":"s"}`,u=l?" Runs your own AI serves do not count toward it.":"";if(i==="trial"&&o!==null){let g=n.price===0?"it continues free":`it is $${n.price.toLocaleString()} a ${n.interval}`;return`${o} ${o===1?"day":"days"} left of your trial, then ${g}.`}if(i==="unlimited")return`${r.toLocaleString()} ${c} this period. No ceiling on this plan.`;if(i==="metered"){let g=r-(s??0);return n.overage_per_unit>0?`${g.toLocaleString()} past the allowance, billed at $${n.overage_per_unit} a ${n.unit}.${u}`:`${g.toLocaleString()} past the allowance.${u}`}if(i==="spent")return t?.period_end?`Allowance spent. It comes back on ${so(t.period_end)}.${u}`:`Allowance spent. It comes back at the start of the next period.${u}`;let m=Math.max(0,(s??0)-r),A=a?` Raised from ${(n.included_units??0).toLocaleString()} while your own AI is connected.`:t?.period_end?` Resets ${so(t.period_end)}.`:"";return`${m.toLocaleString()} of ${(s??0).toLocaleString()} ${n.unit}s left.${A}${u}`}function Oi(e){if(!e)return null;let n=new Date(e).getTime()-Date.now();return Number.isNaN(n)||n<=0?null:Math.max(1,Math.ceil(n/864e5))}function so(e){let n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleDateString(void 0,{day:"numeric",month:"long"})}import{Fragment as Ti,jsx as le,jsxs as Oe}from"react/jsx-runtime";function ts({heading:e="Current plan",showUsage:n=!0,showName:t=!0,className:r}){let s=yt(),{theme:o}=G(),a=A=>le("section",{className:r?`soba-connect sc-fill ${r}`:"soba-connect sc-fill","data-theme":o,children:Oe("div",{className:"sc-card sc-current",children:[e&&le("h2",{className:"sc-section-title",children:e}),A]})});if(s.error)return a(le("p",{className:"sc-error",children:s.error.message}));if(s.loading)return a(le("p",{className:"sc-note",children:"Loading\u2026"}));if(!s.plan)return a(Oe("div",{className:"sc-current-main",children:[le("p",{className:"sc-current-name",children:"No plan"}),le("p",{className:"sc-sub",children:s.summary})]}));let{plan:l,trialDaysLeft:i,percent:c,unlimited:u,reward:m}=s;return a(Oe(Ti,{children:[Oe("div",{className:"sc-current-grid",children:[(t||i!==null)&&Oe("div",{className:"sc-current-main",children:[t?Oe("p",{className:"sc-current-name",children:[l.name,i!==null&&Oe("span",{className:"sc-trial-badge",children:[i," ",i===1?"day":"days"," left"]})]}):i!==null&&le("p",{className:"sc-current-trial",children:Oe("span",{className:"sc-trial-badge",children:[i," ",i===1?"day":"days"," left"]})}),t&&l.description&&le("p",{className:"sc-sub",children:l.description})]}),n&&Oe("div",{className:"sc-usage",children:[Oe("div",{className:"sc-row-between",children:[le("span",{className:"sc-fact-key",children:"Usage"}),le("span",{className:c!==null&&c>=100?"sc-usage-figure sc-usage-over":"sc-usage-figure",children:u?"Unlimited":c===null?"Metered":`${c}% used`})]}),c!==null&&le("div",{className:"sc-meter",role:"presentation",children:c>0&&le("span",{className:c>=100?"sc-meter-fill sc-meter-full":"sc-meter-fill",style:{width:`${c}%`}})}),le("p",{className:"sc-usage-line",children:s.summary})]})]}),m&&Oe("div",{className:"sc-current-foot",children:[le("p",{className:m.required?"sc-plan-reward-line sc-plan-reward-need":m.inForce?"sc-plan-reward-line":"sc-plan-reward-line sc-plan-reward-open",children:m.required?m.line:m.inForce?`In force: ${Li(m.line)}.`:m.line}),(m.actionable||m.connected)&&le(vn,{})]})]}))}var Li=e=>e.charAt(0).toLowerCase()+e.slice(1);import{useCallback as Bi,useMemo as Gi,useState as oo}from"react";var Wi={"user-hardware":"your own machine","user-subscription":"your own AI subscription","open-weights":"open models we host",frontier:"frontier models"},Hi=new Set(["user-hardware","user-subscription"]);function rs(e={}){let{plan:n,compute:t,connect:r}=D(),[s,o]=oo(null),[a,l]=oo(null),{featured:i,onSelect:c,successUrl:u,cancelUrl:m}=e,A=Bi(async h=>{o(h.id),l(null);try{if(h.selectable)await n.select(h.id);else if(c)c(h);else{let y=await n.checkout(h.id,{...u?{successUrl:u}:{},...m?{cancelUrl:m}:{}});window.location.assign(y);return}}catch(y){throw l(y.message),y}finally{(h.selectable||c)&&o(null)}},[n,c,u,m]),g=Gi(()=>n.plans.map(h=>{let y=n.current?.plan_id===h.id;return{plan:h,current:y,featured:i===h.id&&!y,price:Di(h),allowance:h.included_units===null?`Unlimited ${h.unit}s`:`${h.included_units.toLocaleString()} ${h.unit}${h.included_units===1?"":"s"}`,allowanceNote:Ui(h),computeLabel:h.route_allow===null?"any compute":h.route_allow.length===0?"no compute":null,compute:(h.route_allow??[]).map(S=>({costClass:S,label:Wi[S]??S,owned:Hi.has(S),runtimes:lr(S).map(I=>I.id)})),connect:Fi(h,y,t.connected,()=>r.open("manual")),cta:{label:Qi(h,y,s===h.id),disabled:y||s!==null,busy:s===h.id,take:()=>A(h)}}}),[n.plans,n.current,i,t.connected,r,s,A]);return{offers:g,current:g.find(h=>h.current)??null,loading:n.loading,error:n.error,failed:a}}function Di(e){return e.price===0?{amount:"Free",interval:null,free:!0}:{amount:`$${e.price.toLocaleString()}`,interval:e.interval,free:!1}}function Ui(e){let n=[];return e.included_units===null?n.push("No ceiling on this plan"):(n.push(`Included each ${e.interval}`),e.overage==="meter"&&e.overage_per_unit>0?n.push(`then $${e.overage_per_unit} a ${e.unit}`):e.included_units>0&&n.push(`then ${e.unit}s stop`)),e.trial_days>0&&n.push(`${e.trial_days}-day trial`),n.join(" \xB7 ")}function Fi(e,n,t,r){let s=Je({unit:e.unit,reward:e.connected_reward,includedUnits:e.connected_included_units,creditMicros:e.connected_credit*1e6}),o=Ie(e.route_allow)&&!t;if(!s&&!o)return null;let a=Ye(e.connected_reward);return{key:s?"Connect your own":"To use this",line:s??(n?"Nothing connected yet, so nothing can run.":"Runs only on compute you connect."),reward:s!==null,actionable:n&&(a||o)&&!t,open:r}}function Qi(e,n,t){return n?"Your plan":t?e.selectable?"Switching\u2026":"Opening\u2026":e.selectable?"Choose":`Subscribe for $${e.price.toLocaleString()}/${e.interval}`}import{jsx as b,jsxs as W}from"react/jsx-runtime";function Ft(e){return e?`soba-connect sc-fill ${e}`:"soba-connect sc-fill"}function ss({onSelect:e,successUrl:n,cancelUrl:t,showCompute:r=!0,showConnect:s=!1,variant:o="cards",featured:a,className:l}){let{offers:i,loading:c,error:u,failed:m}=rs({...a?{featured:a}:{},...e?{onSelect:e}:{},...n?{successUrl:n}:{},...t?{cancelUrl:t}:{}}),{theme:A}=G();if(u)return b("div",{className:Ft(l),"data-theme":A,children:b("div",{className:"sc-card",children:b("p",{className:"sc-error",children:u.message})})});if(c)return b("div",{className:Ft(l),"data-theme":A,children:b("div",{className:"sc-card",children:b("p",{className:"sc-note",children:"Loading plans\u2026"})})});if(i.length===0)return b("div",{className:Ft(l),"data-theme":A,children:b("div",{className:"sc-card",children:b("p",{className:"sc-note",children:"This app has no plans yet."})})});let g={showCompute:r,showConnect:s};return W("div",{className:Ft(l),"data-theme":A,"data-variant":o,children:[o==="rows"?b(Ji,{offers:i,shelf:g}):o==="table"?b(Yi,{offers:i,shelf:g}):b(Vi,{offers:i,shelf:g}),m&&b("p",{className:"sc-error",children:m})]})}function Vi({offers:e,shelf:n}){return b("div",{className:"sc-plans",children:e.map(t=>W("div",{className:ao("sc-plan",t),children:[W("div",{className:"sc-row-between",children:[b("span",{className:"sc-title",children:t.plan.name}),b(os,{offer:t})]}),b("p",{className:"sc-sub",children:t.plan.description}),b(as,{price:t.price,free:"forever"}),b(cs,{offer:t,shelf:n}),b(io,{offer:t}),b("div",{className:"sc-plan-band",children:n.showCompute&&b(ls,{offer:t})}),b("div",{className:"sc-plan-band",children:b(is,{offer:t})})]},t.plan.id))})}function Ji({offers:e,shelf:n}){return b("ul",{className:"sc-plan-rows",children:e.map(t=>W("li",{className:ao("sc-plan-row",t),children:[W("div",{className:"sc-row-main",children:[W("span",{className:"sc-row-name",children:[b("span",{className:"sc-title",children:t.plan.name}),b(os,{offer:t})]}),t.plan.description&&b("p",{className:"sc-sub",children:t.plan.description}),b(io,{offer:t}),n.showCompute&&b(ls,{offer:t,inline:!0}),b(is,{offer:t,inline:!0})]}),W("div",{className:"sc-row-side",children:[b(as,{price:t.price,free:"forever",small:!0}),b(cs,{offer:t,shelf:n})]})]},t.plan.id))})}function Yi({offers:e,shelf:n}){let t=e.some(a=>a.plan.overage_per_unit>0),r=e.some(a=>a.plan.trial_days>0),s=e.some(a=>a.connect!==null),o=a=>[a.current?"sc-col-current":"",a.featured?"sc-col-featured":""].filter(Boolean).join(" ")||void 0;return b("div",{className:"sc-table-scroll",children:W("table",{className:"sc-plan-table",children:[b("thead",{children:W("tr",{children:[b("td",{}),e.map(a=>W("th",{scope:"col",className:o(a),children:[W("span",{className:"sc-row-name",children:[b("span",{className:"sc-title",children:a.plan.name}),b(os,{offer:a})]}),b(as,{price:a.price,small:!0})]},a.plan.id))]})}),W("tbody",{children:[W("tr",{children:[b("th",{scope:"row",children:"Included"}),e.map(a=>b("td",{className:o(a),children:a.allowance},a.plan.id))]}),t&&W("tr",{children:[b("th",{scope:"row",children:"Then"}),e.map(a=>b("td",{className:o(a),children:a.plan.overage_per_unit>0?`$${a.plan.overage_per_unit} / ${a.plan.unit}`:b("span",{className:"sc-muted-cell",children:"Stops"})},a.plan.id))]}),r&&W("tr",{children:[b("th",{scope:"row",children:"Trial"}),e.map(a=>b("td",{className:o(a),children:a.plan.trial_days>0?`${a.plan.trial_days} days`:b("span",{className:"sc-muted-cell",children:"None"})},a.plan.id))]}),n.showCompute&&W("tr",{children:[b("th",{scope:"row",children:"Runs on"}),e.map(a=>b("td",{className:o(a),children:b(ls,{offer:a,bare:!0})},a.plan.id))]}),s&&W("tr",{children:[b("th",{scope:"row",children:"Connect your own"}),e.map(a=>b("td",{className:o(a),children:b(is,{offer:a,bare:!0})},a.plan.id))]}),W("tr",{className:"sc-table-buy",children:[b("td",{}),e.map(a=>b("td",{className:o(a),children:b(cs,{offer:a,shelf:n})},a.plan.id))]})]})]})})}function ao(e,n){return[e,n.current?"sc-plan-current":"",n.featured?"sc-plan-featured":""].filter(Boolean).join(" ")}function os({offer:e}){return e.current?b("span",{className:"sc-plan-badge",children:"Current"}):e.featured?b("span",{className:"sc-plan-badge-soft",children:"Recommended"}):null}function as({price:e,small:n,free:t}){return W("p",{className:n?"sc-plan-price sc-plan-price-sm":"sc-plan-price",children:[b("span",{className:"sc-plan-amount",children:e.amount}),e.interval?W("span",{className:"sc-plan-interval",children:["/",e.interval]}):t&&b("span",{className:"sc-plan-interval sc-plan-after",children:t})]})}function io({offer:e}){return W("p",{className:"sc-plan-allowance",children:[b("span",{className:"sc-plan-figure",children:e.allowance}),b("span",{className:"sc-plan-qualifier",children:e.allowanceNote})]})}function is({offer:e,inline:n,bare:t}){let r=e.connect;if(!r)return t?b("span",{className:"sc-muted-cell",children:"None"}):null;let s=r.reward?"sc-plan-reward-line":"sc-plan-reward-line sc-plan-reward-need",o=r.actionable?W("button",{type:"button",className:`${s} sc-plan-reward-act`,"aria-label":"Connect compute",onClick:r.open,children:[b("span",{className:"sc-reward-said",children:r.line}),W("span",{className:"sc-reward-do","aria-hidden":!0,children:[b(oe,{className:"sc-reward-mark"}),"Connect compute"]})]}):b("p",{className:s,children:r.line});return t?o:b("div",{className:n?"sc-plan-reward sc-plan-reward-inline":"sc-plan-reward",children:o})}function ls({offer:e,inline:n,bare:t}){let r=e.computeLabel?b("ul",{className:n?"sc-compute sc-compute-inline":"sc-compute",children:b("li",{children:e.computeLabel})}):b("ul",{className:n?"sc-compute sc-compute-inline":"sc-compute",children:e.compute.map(s=>W("li",{className:s.owned?"sc-compute-own":void 0,children:[s.label,b(zi,{runtimes:s.runtimes})]},s.costClass))});return t?r:W("div",{className:n?"sc-plan-compute sc-plan-compute-inline":"sc-plan-compute",children:[b("span",{className:"sc-fact-key",children:"Runs on"}),r]})}function cs({offer:e,shelf:n}){let t=e.connect;return n.showConnect&&t?.actionable?W("button",{type:"button",className:"sc-btn sc-btn-primary sc-btn-icon",onClick:t.open,children:[b(oe,{className:"sc-btn-mark"}),"Connect compute"]}):b("button",{type:"button",className:e.current?"sc-btn":"sc-btn sc-btn-primary",disabled:e.cta.disabled,onClick:()=>void e.cta.take().catch(()=>{}),children:e.cta.label})}function zi({runtimes:e}){return e.length===0?null:b("span",{className:"sc-compute-marks",children:e.map(n=>{let t=Ze[n];return t?b(t,{className:"sc-rt-mark"},n):null})})}import{jsx as us,jsxs as lo}from"react/jsx-runtime";function ji({heading:e,plansHeading:n,showUsage:t=!0,showName:r=!0,className:s,...o}){let{plan:a,loading:l}=yt(),{theme:i}=G(),c=n??(l?"Plans":a?"Change plan":"Choose a plan");return lo("div",{className:s?`soba-connect sc-fill sc-billing ${s}`:"soba-connect sc-fill sc-billing","data-theme":i,children:[us(ts,{...e===void 0?{}:{heading:e},showUsage:t,showName:r}),lo("section",{className:"sc-billing-plans",children:[c&&us("h2",{className:"sc-section-title",children:c}),us(ss,{...o})]})]})}import{useCallback as co,useState as uo}from"react";function ds({plan:e,successUrl:n,cancelUrl:t,label:r}){let{plan:s}=D(),[o,a]=uo(!1),[l,i]=uo(null),c=co(()=>s.checkout(e.id,{...n?{successUrl:n}:{},...t?{cancelUrl:t}:{}}),[s,e.id,n,t]),u=co(async()=>{a(!0),i(null);try{window.location.assign(await c())}catch(m){i(m.message),a(!1)}},[c]);return{label:o?"Opening\u2026":r??`Subscribe for $${e.price.toLocaleString()}/${e.interval}`,busy:o,error:l,buy:u,session:c}}import{jsx as po,jsxs as Zi}from"react/jsx-runtime";function qi({plan:e,successUrl:n,cancelUrl:t,label:r,className:s}){let{theme:o}=G(),a=ds({plan:e,...n?{successUrl:n}:{},...t?{cancelUrl:t}:{},...r?{label:r}:{}});return Zi("div",{className:s?`soba-connect ${s}`:"soba-connect","data-theme":o,children:[po("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:a.busy,onClick:()=>void a.buy(),children:a.label}),a.error&&po("p",{className:"sc-error",children:a.error})]})}import{useCallback as Ue,useEffect as _e,useMemo as Fn,useRef as $e,useState as ce}from"react";var Xi="soba.session:";function mo(e){return!e.cacheKey||!e.endpoint?null:Xi+JSON.stringify([e.endpoint,e.user??null,e.cacheKey])}function Ki(e){try{let n=globalThis.localStorage?.getItem(e);if(!n)return null;let t=JSON.parse(n);return typeof t.token!="string"||typeof t.expiresAt!="number"?null:{token:t.token,expiresAt:t.expiresAt}}catch{return null}}function _i(e,n){try{n?globalThis.localStorage?.setItem(e,JSON.stringify(n)):globalThis.localStorage?.removeItem(e)}catch{}}var ho=6e4,$i=1e4,Qt=class{#e;#n=null;#r=null;#t;#s=new Set;constructor(n){this.#t=n,this.#e=n.token??null;let t=mo(n),r=t&&!this.#e?Ki(t):null;r&&r.expiresAt-ho>Date.now()&&(this.#e=r.token,this.#n=r.expiresAt)}get token(){return this.#e}get expiresAt(){return this.#n}get canRefresh(){return!!this.#t.endpoint}get refreshAt(){return!this.canRefresh||this.#n===null?null:Math.max(Date.now()+$i,this.#n-ho)}subscribe(n){return this.#s.add(n),()=>this.#s.delete(n)}async ensure(){return this.#e?this.#e:this.refresh()}async refresh(){if(this.#r)return this.#r;let n=this.#t.endpoint;if(!n)throw new Error("This Soba session cannot be refreshed. Pass `sessionEndpoint` so the provider can mint a new one.");let t=this.#t.fetchImpl??fetch.bind(globalThis);this.#r=(async()=>{let r=await t(n,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify(this.#t.user?{user:this.#t.user}:{})});if(!r.ok)throw new Error(`Could not start a Soba session (${r.status} from ${n}).`);let s=await r.json(),o=s.session??s.token;if(!o)throw new Error(`${n} answered without a \`session\`. See @soba-so/react's README.`);let a=s.expires_in??s.expiresIn;this.#e=o,this.#n=typeof a=="number"?Date.now()+a*1e3:null;let l=mo(this.#t);l&&_i(l,this.#n===null?null:{token:o,expiresAt:this.#n});for(let i of this.#s)i();return o})();try{return await this.#r}finally{this.#r=null}}},Un=new Map,go=new WeakMap,el=1;function nl(e){if(e.token||!e.endpoint)return null;let n=0;return e.fetchImpl&&(n=go.get(e.fetchImpl)??el++,go.set(e.fetchImpl,n)),JSON.stringify([e.endpoint,e.user??null,n,e.cacheKey??null])}function fo(e){let n=nl(e);if(!n)return new Qt(e);let t=Un.get(n)??{holder:new Qt(e),users:0};return Un.set(n,t),t.holder}function Ao(e){for(let n of Un.values())n.holder===e&&n.users++}function bo(e){for(let[n,t]of Un)if(t.holder===e){setTimeout(()=>{--t.users<=0&&Un.get(n)===t&&Un.delete(n)},0);return}}function yo(e,n=fetch.bind(globalThis)){return async(t,r)=>{let s=await n(t,r);if(s.status!==401||!e.canRefresh)return s;let o;try{o=await e.refresh()}catch{return s}return n(t,tl(r,o))}}function tl(e,n){let t=new Headers(e?.headers);return t.set("authorization",`Bearer ${n}`),{...e,headers:t}}import{jsx as ps,jsxs as al}from"react/jsx-runtime";var rl="https://soba.so",sl=3e4;function ol(e){let{children:n,session:t,sessionEndpoint:r,user:s,sessionCacheKey:o,runEndpoint:a,theme:l,initialMachines:i,initialConnect:c=null,initialPlans:u,initialCurrentPlan:m=null,baseUrl:A=rl,pollMs:g=sl,injectStyles:h=!0,modal:y=!0,fetchImpl:S,onError:I}=e,[E,T]=ce(t??null),[J,O]=ce(null),[M,B]=ce(c),[C,ue]=ce(null),[_,Ae]=ce(c===null),[$,Pe]=ce(i??[]),[Le,ee]=ce(null),[Te,q]=ce(i===void 0),[ne,Nn]=ce(u??[]),[Z,X]=ce(m),[be,ye]=ce(null),[pe,z]=ce(u===void 0),[te,re]=ce(null),[Be,Q]=ce(!1),Ge=$e(I);Ge.current=I;let K=Ue(N=>{O(N),Ge.current?.(N)},[]);_e(()=>{h&&At()},[h]);let U=Fn(()=>fo({...t?{token:t}:{},...r?{endpoint:r}:{},...s?{user:s}:{},...S?{fetchImpl:S}:{},...o?{cacheKey:o}:{}}),[t,r,s,S,o]);_e(()=>{let N=!0;Ao(U);let se=U.subscribe(()=>{N&&T(U.token)});return!U.token&&!U.canRefresh?K(new Error("<SobaProvider> needs a `session` or a `sessionEndpoint`. A browser cannot mint one: that takes your secret key.")):U.ensure().then(()=>N&&T(U.token),ve=>N&&K(ve)),()=>{N=!1,se(),bo(U)}},[U,K]),_e(()=>{J&&(Ae(!1),q(!1),z(!1),ue(N=>N??J),ee(N=>N??J),ye(N=>N??J))},[J]),_e(()=>{let N=U.refreshAt;if(N===null)return;let se=()=>{U.refresh().catch(Re=>K(Re))},ve=()=>{document.hidden||(document.removeEventListener("visibilitychange",ve),se())},Mn=setTimeout(()=>{typeof document<"u"&&document.hidden?document.addEventListener("visibilitychange",ve):se()},Math.max(0,N-Date.now()));return()=>{clearTimeout(Mn),typeof document<"u"&&document.removeEventListener("visibilitychange",ve)}},[U,K,E]);let w=$e(c?.machines_url??null),v=Fn(()=>{if(!E)return null;let N=new qn({session:E,baseUrl:A,fetchImpl:yo(U,S??fetch.bind(globalThis))});return N.setMachinesUrl(w.current),N},[E,A,U,S]),Fe=$e(c!==null);_e(()=>{if(!v||Fe.current)return;let N=!0;return Ae(!0),v.context().then(se=>{N&&(B(se),ue(null),Ae(!1))},se=>{N&&(ue(se),Ae(!1))}),()=>{N=!1}},[v]);let en=Ue(async()=>{if(v)try{let N=await v.machines();Pe(Array.isArray(N)?N:[]),ee(null)}catch(N){ee(N)}finally{q(!1)}},[v]),we=Ue(async()=>{if(v)try{let N=await v.plans();Nn(N.plans),X(N.current),ye(null)}catch(N){ye(N)}finally{z(!1)}},[v]),nn=$e(!1),[wt,Ce]=ce(!1),tn=$e(u!==void 0),ze=$e(!1),rn=Ue(()=>{nn.current||(nn.current=!0,ze.current&&queueMicrotask(()=>{ze.current&&Ce(!0)}))},[]);_e(()=>(ze.current=!0,nn.current&&Ce(!0),()=>{ze.current=!1}),[]),_e(()=>{!v||!wt||tn.current||we()},[v,wt,we]);let Qn=Ue(async N=>{if(!v)throw new Error("No session yet.");await v.selectPlan(N),await we()},[v,we]),sn=Ue(async(N,se)=>{if(!v)throw new Error("No session yet.");let ve=await v.checkoutPlan(N,se);if(!ve.url)throw new Error("Checkout could not be started.");return ve.url},[v]),on=Ue(async()=>{if(!v)throw new Error("No session yet.");await v.leavePlan(),await we()},[v,we]),Vt=$e(i!==void 0);_e(()=>{if(!v)return;let N=Se(en,g,{immediate:!Vt.current});return Vt.current=!1,N},[v,en,g]);let xn=Ue((N="manual")=>{y&&(Q(!0),re(N))},[y]),Ct=Ue(()=>re(null),[]),Vn=$e($);Vn.current=$;let vt=Ue(async N=>{if(!a)throw new Error("Pass `runEndpoint` to <SobaProvider> to start runs from the browser. It is your own route: it holds your secret key, calls soba.run(), and forwards the stream.");let{signal:se,...ve}=N,Re=await(S??fetch.bind(globalThis))(a,{method:"POST",headers:{"content-type":"application/json",accept:"text/event-stream"},credentials:"same-origin",body:JSON.stringify(ve),...se?{signal:se}:{}});if(!Re.ok){let Qe=await Re.json().catch(()=>null),de=new Error(Qe?.error?.message??`${a} answered ${Re.status}.`);de.status=Re.status,Qe?.error?.code&&(de.code=Qe.error.code),Qe?.error&&(de.error=Qe.error);let an=Vn.current.length>0&&!Vn.current.some(kt=>kt.state!=="offline");throw Re.status===409&&an&&xn("no_compute"),de}let Yt=ns(Re);return async function*(){try{yield*Yt}finally{nn.current&&we()}}()},[a,S,we,xn]),F=Fn(()=>Z?ne.find(N=>N.id===Z.plan_id)??null:null,[ne,Z]),me=Fn(()=>F?F.connected_reward==="included"&&$.length>0&&F.connected_included_units!==null?F.connected_included_units:F.included_units:null,[F,$]),Jn=Fn(()=>({plans:ne,current:Z,plan:F,used:Z?.units_used??null,included:me,remaining:me!==null&&Z?Math.max(0,me-Z.units_used):null,unlimited:F!==null&&me===null,loading:pe,error:be,select:Qn,checkout:sn,leave:on,refresh:we}),[ne,Z,F,me,pe,be,Qn,sn,on,we]),Jt=Fn(()=>({session:E,client:v,error:J,get plan(){return rn(),Jn},compute:{machines:$,connected:$.length>0,online:$.some(N=>N.state!=="offline"),loading:Te,error:Le,refresh:en},connect:{app:M?.app??null,command:M?.command??null,connectUrl:M?.connect_url??null,publishableKey:M?.publishable_key??null,loading:_,error:C,open:xn,close:Ct,isOpen:te!==null,hasModal:y},run:vt}),[E,v,J,Jn,rn,te,xn,Ct,y,$,Te,Le,en,M,_,C,vt]);return ps(Ur.Provider,{value:v,children:ps(Fr.Provider,{value:{context:M,machines:Te?void 0:$,theme:l??M?.theme??"light"},children:al(Qr.Provider,{value:Jt,children:[n,y&&Be&&ps(ht,{open:te!==null,onOpenChange:N=>re(N?te??"manual":null),onConnected:()=>{en()},...te==="payment_required"||te==="no_compute"?{reason:te}:{},...te==="pair"?{showStatus:!1}:{}})]})})})}function il(e){return e?ll[e]??e:null}var ll={"user-hardware":"your own computer","user-subscription":"your own AI plan","user-api-key":"your own API key","open-weights":"open models we host",frontier:"a frontier model we pay for"};async function cl(e,n,t){let r=n.local;if(!r?.session||n.after)return null;let s=/\/v1\/runs\/([^/]+)\/events/.exec(e.url)?.[1];if(!s)return null;let o=`http://127.0.0.1:${r.port??47321}/v1/runs/${s}/events`,a=new AbortController,l=()=>a.abort();n.signal?.addEventListener("abort",l);let i=setTimeout(()=>a.abort(),r.timeoutMs??3e3);try{let c=await t(o,{headers:{authorization:`Bearer ${r.session}`,accept:"text/event-stream"},signal:a.signal});return c.ok?{url:o,bearer:r.session,open:c}:null}catch{return null}finally{clearTimeout(i),n.signal?.removeEventListener("abort",l)}}async function*ul(e){let n=e.body;if(!n)return;let t=n.getReader(),r=new TextDecoder,s="",o=null,a=[];try{for(;;){let l=await t.read();if(l.done)return;s+=r.decode(l.value,{stream:!0});for(let i=s.indexOf(`
|
|
3902
|
-
`);
|
|
3903
|
-
`)){let
|
|
3904
|
-
`)}),
|
|
4014
|
+
`,document.head.appendChild(e)}import{jsx as Fe,jsxs as wt}from"react/jsx-runtime";function po(e){if(!e)return null;let n=xn(e);if(n==="payment_required"||n==="no_compute")return null;if(typeof e=="string")return e||null;let t=e,r=t.error?.message;return typeof r=="string"&&r?r:typeof t.message=="string"&&t.message?t.message:"The run ended with an error."}function Wi(){return wt("svg",{viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[Fe("path",{d:"M8 5v4",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round"}),Fe("circle",{cx:"8",cy:"11.6",r:"0.9",fill:"currentColor"}),Fe("circle",{cx:"8",cy:"8",r:"6.4",stroke:"currentColor",strokeWidth:"1.3"})]})}function Hi({error:e,onRetry:n,onDismiss:t,title:r,className:s}){let a=po(e),i=H();return Gi(()=>yt(),[]),a?Fe("div",{className:s?`soba-connect ${s}`:"soba-connect","data-theme":i.theme,role:"alert",children:wt("div",{className:"sc-card sc-limit sc-run-error",children:[wt("div",{className:"sc-limit-head",children:[Fe("span",{className:"sc-limit-mark sc-run-error-mark","aria-hidden":"true",children:Fe(Wi,{})}),wt("div",{children:[Fe("h2",{className:"sc-limit-title",children:r??"That run did not finish"}),Fe("p",{className:"sc-limit-body sc-run-error-message",children:a})]})]}),(t||n)&&wt("div",{className:"sc-limit-actions",children:[t&&Fe("button",{type:"button",className:"sc-btn sc-btn-quiet",onClick:t,children:"Dismiss"}),n&&Fe("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:n,children:"Try again"})]})]})}):null}import{useId as Di,useState as mo}from"react";import{jsx as oe,jsxs as Qt}from"react/jsx-runtime";function Ui({reason:e}){return oe("span",{className:"sc-limit-mark","aria-hidden":"true",children:e==="no_compute"?oe(Et,{}):oe(re,{})})}function Fi(e){let{error:n,variant:t="card",onDismiss:r,className:s}=e,a=rs(n,{predict:e.predict??!("error"in e)}),i=Di(),c=H();if(!a)return null;let o=oe(Qi,{offer:a,headingId:i,onDismiss:r});return t==="dialog"?oe(dt,{open:!0,onClose:()=>r?.(),labelledBy:i,theme:c.theme,children:o}):oe("div",{className:s?`soba-connect ${s}`:"soba-connect","data-theme":c.theme,children:o})}function Qi({offer:e,headingId:n,onDismiss:t}){let{compute:r}=F(),[s,a]=mo(!1),[i,c]=mo(null),o=e.reason==="no_compute"&&r.connected&&!r.online,l=o||e.connectOffer!==null||!r.connected,u=bt();async function m(){a(!0),c(null);try{await e.upgrade()}catch(f){c(f.message)}finally{a(!1)}}return Qt("div",{className:"sc-card sc-limit",children:[Qt("div",{className:"sc-limit-head",children:[oe(Ui,{reason:e.reason}),Qt("div",{children:[oe("h2",{className:"sc-limit-title",id:n,children:e.title}),oe("p",{className:"sc-limit-body",children:e.body})]})]}),i&&oe("p",{className:"sc-error",children:i}),o&&u.note&&oe("p",{className:"sc-limit-note",children:u.note}),Qt("div",{className:"sc-limit-actions",children:[t&&oe("button",{type:"button",className:"sc-btn sc-btn-quiet",onClick:t,disabled:s,children:"Not now"}),e.upgradeTo&&oe("button",{type:"button",className:l?"sc-btn":"sc-btn sc-btn-primary",onClick:()=>void m(),disabled:s,children:s?"Opening\u2026":e.upgradeTo.selectable?`Switch to ${e.upgradeTo.name}`:`${e.upgradeTo.name} for $${e.upgradeTo.price.toLocaleString()}/${e.upgradeTo.interval}`}),l&&oe("button",{type:"button",className:o?"sc-btn":"sc-btn sc-btn-primary",onClick:e.connect,disabled:s,children:o?"Connect another machine":"Connect compute"}),o&&oe("button",{type:"button",className:"sc-btn sc-btn-primary",onClick:u.open,disabled:s,children:"Open Soba App"})]})]})}import{useMemo as Vi}from"react";function Ct(){let{plan:e,compute:n,connect:t}=F();return Vi(()=>{let r=e.plan,s=e.current,a={plan:r,assignment:s,loading:e.loading,error:e.error,periodEnd:s?.period_end?new Date(s.period_end):null};if(!r)return{...a,state:"none",trialDaysLeft:null,ceiling:null,raised:!1,uncounted:!1,used:0,remaining:null,percent:null,unlimited:!1,reward:null,summary:"Nothing is assigned to this account, so runs are bounded by whatever the app allows."};let i=zi(s?.trial_ends_at??null),c=r.connected_reward==="included"&&n.connected&&r.connected_included_units!==null,o=c?r.connected_included_units:r.included_units,l=r.connected_reward==="unlimited"&&n.connected,u=o===null,m=e.used??0,f=o===null?null:Math.max(0,o-m),g=o&&o>0?Math.min(100,Math.round(m/o*100)):null,h=o!==null&&m>=o,y=i!==null?"trial":u?"unlimited":h?r.overage==="meter"?"metered":"spent":"within";return{...a,state:y,trialDaysLeft:i,ceiling:o,raised:c,uncounted:l,used:m,remaining:f,percent:g,unlimited:u,reward:Ji(r,c||l,n.connected,()=>t.open("manual")),summary:Yi({plan:r,assignment:s,used:m,ceiling:o,trialDaysLeft:i,raised:c,uncounted:l,state:y})}},[e,n.connected,t])}function Ji(e,n,t,r){let s=ze({unit:e.unit,reward:e.connected_reward,includedUnits:e.connected_included_units,creditMicros:e.connected_credit*1e6});return s?{line:s,inForce:n,required:!1,connected:t,actionable:je(e.connected_reward)&&!t,open:r}:Le(e.route_allow)&&!t?{line:"Nothing connected yet, so nothing can run.",inForce:!1,required:!0,connected:t,actionable:!0,open:r}:null}function Yi(e){let{plan:n,assignment:t,used:r,ceiling:s,trialDaysLeft:a,raised:i,uncounted:c,state:o}=e,l=`${n.unit}${r===1?"":"s"}`,u=c?" Runs your own AI serves do not count toward it.":"";if(o==="trial"&&a!==null){let g=n.price===0?"it continues free":`it is $${n.price.toLocaleString()} a ${n.interval}`;return`${a} ${a===1?"day":"days"} left of your trial, then ${g}.`}if(o==="unlimited")return`${r.toLocaleString()} ${l} this period. No ceiling on this plan.`;if(o==="metered"){let g=r-(s??0);return n.overage_per_unit>0?`${g.toLocaleString()} past the allowance, billed at $${n.overage_per_unit} a ${n.unit}.${u}`:`${g.toLocaleString()} past the allowance.${u}`}if(o==="spent")return t?.period_end?`Allowance spent. It comes back on ${ho(t.period_end)}.${u}`:`Allowance spent. It comes back at the start of the next period.${u}`;let m=Math.max(0,(s??0)-r),f=i?` Raised from ${(n.included_units??0).toLocaleString()} while your own AI is connected.`:t?.period_end?` Resets ${ho(t.period_end)}.`:"";return`${m.toLocaleString()} of ${(s??0).toLocaleString()} ${n.unit}s left.${f}${u}`}function zi(e){if(!e)return null;let n=new Date(e).getTime()-Date.now();return Number.isNaN(n)||n<=0?null:Math.max(1,Math.ceil(n/864e5))}function ho(e){let n=new Date(e);return Number.isNaN(n.getTime())?e:n.toLocaleDateString(void 0,{day:"numeric",month:"long"})}import{Fragment as qi,jsx as ae,jsxs as Te}from"react/jsx-runtime";function is({heading:e="Current plan",showUsage:n=!0,showName:t=!0,className:r}){let s=Ct(),{theme:a}=H(),i=f=>ae("section",{className:r?`soba-connect sc-fill ${r}`:"soba-connect sc-fill","data-theme":a,children:Te("div",{className:"sc-card sc-current",children:[e&&ae("h2",{className:"sc-section-title",children:e}),f]})});if(s.error)return i(ae("p",{className:"sc-error",children:s.error.message}));if(s.loading)return i(ae("p",{className:"sc-note",children:"Loading\u2026"}));if(!s.plan)return i(Te("div",{className:"sc-current-main",children:[ae("p",{className:"sc-current-name",children:"No plan"}),ae("p",{className:"sc-sub",children:s.summary})]}));let{plan:c,trialDaysLeft:o,percent:l,unlimited:u,reward:m}=s;return i(Te(qi,{children:[Te("div",{className:"sc-current-grid",children:[(t||o!==null)&&Te("div",{className:"sc-current-main",children:[t?Te("p",{className:"sc-current-name",children:[c.name,o!==null&&Te("span",{className:"sc-trial-badge",children:[o," ",o===1?"day":"days"," left"]})]}):o!==null&&ae("p",{className:"sc-current-trial",children:Te("span",{className:"sc-trial-badge",children:[o," ",o===1?"day":"days"," left"]})}),t&&c.description&&ae("p",{className:"sc-sub",children:c.description})]}),n&&Te("div",{className:"sc-usage",children:[Te("div",{className:"sc-row-between",children:[ae("span",{className:"sc-fact-key",children:"Usage"}),ae("span",{className:l!==null&&l>=100?"sc-usage-figure sc-usage-over":"sc-usage-figure",children:u?"Unlimited":l===null?"Metered":`${l}% used`})]}),l!==null&&ae("div",{className:"sc-meter",role:"presentation",children:l>0&&ae("span",{className:l>=100?"sc-meter-fill sc-meter-full":"sc-meter-fill",style:{width:`${l}%`}})}),ae("p",{className:"sc-usage-line",children:s.summary})]})]}),m&&Te("div",{className:"sc-current-foot",children:[ae("p",{className:m.required?"sc-plan-reward-line sc-plan-reward-need":m.inForce?"sc-plan-reward-line":"sc-plan-reward-line sc-plan-reward-open",children:m.required?m.line:m.inForce?`In force: ${ji(m.line)}.`:m.line}),(m.actionable||m.connected)&&ae(Nn,{})]})]}))}var ji=e=>e.charAt(0).toLowerCase()+e.slice(1);import{useCallback as Zi,useMemo as Xi,useState as go}from"react";var Ki={"user-hardware":"your own machine","user-subscription":"your own AI subscription","open-weights":"open models we host",frontier:"frontier models"},_i=new Set(["user-hardware","user-subscription"]);function ls(e={}){let{plan:n,compute:t,connect:r}=F(),[s,a]=go(null),[i,c]=go(null),{featured:o,onSelect:l,successUrl:u,cancelUrl:m}=e,f=Zi(async h=>{a(h.id),c(null);try{if(h.selectable)await n.select(h.id);else if(l)l(h);else{let y=await n.checkout(h.id,{...u?{successUrl:u}:{},...m?{cancelUrl:m}:{}});window.location.assign(y);return}}catch(y){throw c(y.message),y}finally{(h.selectable||l)&&a(null)}},[n,l,u,m]),g=Xi(()=>n.plans.map(h=>{let y=n.current?.plan_id===h.id;return{plan:h,current:y,featured:o===h.id&&!y,price:$i(h),allowance:h.included_units===null?`Unlimited ${h.unit}s`:`${h.included_units.toLocaleString()} ${h.unit}${h.included_units===1?"":"s"}`,allowanceNote:el(h),computeLabel:h.route_allow===null?"any compute":h.route_allow.length===0?"no compute":null,compute:(h.route_allow??[]).map(M=>({costClass:M,label:Ki[M]??M,owned:_i.has(M),runtimes:pr(M).map(E=>E.id)})),connect:nl(h,y,t.connected,()=>r.open("manual")),cta:{label:tl(h,y,s===h.id),disabled:y||s!==null,busy:s===h.id,take:()=>f(h)}}}),[n.plans,n.current,o,t.connected,r,s,f]);return{offers:g,current:g.find(h=>h.current)??null,loading:n.loading,error:n.error,failed:i}}function $i(e){return e.price===0?{amount:"Free",interval:null,free:!0}:{amount:`$${e.price.toLocaleString()}`,interval:e.interval,free:!1}}function el(e){let n=[];return e.included_units===null?n.push("No ceiling on this plan"):(n.push(`Included each ${e.interval}`),e.overage==="meter"&&e.overage_per_unit>0?n.push(`then $${e.overage_per_unit} a ${e.unit}`):e.included_units>0&&n.push(`then ${e.unit}s stop`)),e.trial_days>0&&n.push(`${e.trial_days}-day trial`),n.join(" \xB7 ")}function nl(e,n,t,r){let s=ze({unit:e.unit,reward:e.connected_reward,includedUnits:e.connected_included_units,creditMicros:e.connected_credit*1e6}),a=Le(e.route_allow)&&!t;if(!s&&!a)return null;let i=je(e.connected_reward);return{key:s?"Connect your own":"To use this",line:s??(n?"Nothing connected yet, so nothing can run.":"Runs only on compute you connect."),reward:s!==null,actionable:n&&(i||a)&&!t,open:r}}function tl(e,n,t){return n?"Your plan":t?e.selectable?"Switching\u2026":"Opening\u2026":e.selectable?"Choose":`Subscribe for $${e.price.toLocaleString()}/${e.interval}`}import{jsx as b,jsxs as D}from"react/jsx-runtime";function Vt(e){return e?`soba-connect sc-fill ${e}`:"soba-connect sc-fill"}function cs({onSelect:e,successUrl:n,cancelUrl:t,showCompute:r=!0,showConnect:s=!1,variant:a="cards",featured:i,className:c}){let{offers:o,loading:l,error:u,failed:m}=ls({...i?{featured:i}:{},...e?{onSelect:e}:{},...n?{successUrl:n}:{},...t?{cancelUrl:t}:{}}),{theme:f}=H();if(u)return b("div",{className:Vt(c),"data-theme":f,children:b("div",{className:"sc-card",children:b("p",{className:"sc-error",children:u.message})})});if(l)return b("div",{className:Vt(c),"data-theme":f,children:b("div",{className:"sc-card",children:b("p",{className:"sc-note",children:"Loading plans\u2026"})})});if(o.length===0)return b("div",{className:Vt(c),"data-theme":f,children:b("div",{className:"sc-card",children:b("p",{className:"sc-note",children:"This app has no plans yet."})})});let g={showCompute:r,showConnect:s};return D("div",{className:Vt(c),"data-theme":f,"data-variant":a,children:[a==="rows"?b(sl,{offers:o,shelf:g}):a==="table"?b(ol,{offers:o,shelf:g}):b(rl,{offers:o,shelf:g}),m&&b("p",{className:"sc-error",children:m})]})}function rl({offers:e,shelf:n}){return b("div",{className:"sc-plans",children:e.map(t=>D("div",{className:fo("sc-plan",t),children:[D("div",{className:"sc-row-between",children:[b("span",{className:"sc-title",children:t.plan.name}),b(us,{offer:t})]}),b("p",{className:"sc-sub",children:t.plan.description}),b(ds,{price:t.price,free:"forever"}),b(hs,{offer:t,shelf:n}),b(Ao,{offer:t}),b("div",{className:"sc-plan-band",children:n.showCompute&&b(ms,{offer:t})}),b("div",{className:"sc-plan-band",children:b(ps,{offer:t})})]},t.plan.id))})}function sl({offers:e,shelf:n}){return b("ul",{className:"sc-plan-rows",children:e.map(t=>D("li",{className:fo("sc-plan-row",t),children:[D("div",{className:"sc-row-main",children:[D("span",{className:"sc-row-name",children:[b("span",{className:"sc-title",children:t.plan.name}),b(us,{offer:t})]}),t.plan.description&&b("p",{className:"sc-sub",children:t.plan.description}),b(Ao,{offer:t}),n.showCompute&&b(ms,{offer:t,inline:!0}),b(ps,{offer:t,inline:!0})]}),D("div",{className:"sc-row-side",children:[b(ds,{price:t.price,free:"forever",small:!0}),b(hs,{offer:t,shelf:n})]})]},t.plan.id))})}function ol({offers:e,shelf:n}){let t=e.some(i=>i.plan.overage_per_unit>0),r=e.some(i=>i.plan.trial_days>0),s=e.some(i=>i.connect!==null),a=i=>[i.current?"sc-col-current":"",i.featured?"sc-col-featured":""].filter(Boolean).join(" ")||void 0;return b("div",{className:"sc-table-scroll",children:D("table",{className:"sc-plan-table",children:[b("thead",{children:D("tr",{children:[b("td",{}),e.map(i=>D("th",{scope:"col",className:a(i),children:[D("span",{className:"sc-row-name",children:[b("span",{className:"sc-title",children:i.plan.name}),b(us,{offer:i})]}),b(ds,{price:i.price,small:!0})]},i.plan.id))]})}),D("tbody",{children:[D("tr",{children:[b("th",{scope:"row",children:"Included"}),e.map(i=>b("td",{className:a(i),children:i.allowance},i.plan.id))]}),t&&D("tr",{children:[b("th",{scope:"row",children:"Then"}),e.map(i=>b("td",{className:a(i),children:i.plan.overage_per_unit>0?`$${i.plan.overage_per_unit} / ${i.plan.unit}`:b("span",{className:"sc-muted-cell",children:"Stops"})},i.plan.id))]}),r&&D("tr",{children:[b("th",{scope:"row",children:"Trial"}),e.map(i=>b("td",{className:a(i),children:i.plan.trial_days>0?`${i.plan.trial_days} days`:b("span",{className:"sc-muted-cell",children:"None"})},i.plan.id))]}),n.showCompute&&D("tr",{children:[b("th",{scope:"row",children:"Runs on"}),e.map(i=>b("td",{className:a(i),children:b(ms,{offer:i,bare:!0})},i.plan.id))]}),s&&D("tr",{children:[b("th",{scope:"row",children:"Connect your own"}),e.map(i=>b("td",{className:a(i),children:b(ps,{offer:i,bare:!0})},i.plan.id))]}),D("tr",{className:"sc-table-buy",children:[b("td",{}),e.map(i=>b("td",{className:a(i),children:b(hs,{offer:i,shelf:n})},i.plan.id))]})]})]})})}function fo(e,n){return[e,n.current?"sc-plan-current":"",n.featured?"sc-plan-featured":""].filter(Boolean).join(" ")}function us({offer:e}){return e.current?b("span",{className:"sc-plan-badge",children:"Current"}):e.featured?b("span",{className:"sc-plan-badge-soft",children:"Recommended"}):null}function ds({price:e,small:n,free:t}){return D("p",{className:n?"sc-plan-price sc-plan-price-sm":"sc-plan-price",children:[b("span",{className:"sc-plan-amount",children:e.amount}),e.interval?D("span",{className:"sc-plan-interval",children:["/",e.interval]}):t&&b("span",{className:"sc-plan-interval sc-plan-after",children:t})]})}function Ao({offer:e}){return D("p",{className:"sc-plan-allowance",children:[b("span",{className:"sc-plan-figure",children:e.allowance}),b("span",{className:"sc-plan-qualifier",children:e.allowanceNote})]})}function ps({offer:e,inline:n,bare:t}){let r=e.connect;if(!r)return t?b("span",{className:"sc-muted-cell",children:"None"}):null;let s=r.reward?"sc-plan-reward-line":"sc-plan-reward-line sc-plan-reward-need",a=r.actionable?D("button",{type:"button",className:`${s} sc-plan-reward-act`,"aria-label":"Connect compute",onClick:r.open,children:[b("span",{className:"sc-reward-said",children:r.line}),D("span",{className:"sc-reward-do","aria-hidden":!0,children:[b(re,{className:"sc-reward-mark"}),"Connect compute"]})]}):b("p",{className:s,children:r.line});return t?a:b("div",{className:n?"sc-plan-reward sc-plan-reward-inline":"sc-plan-reward",children:a})}function ms({offer:e,inline:n,bare:t}){let r=e.computeLabel?b("ul",{className:n?"sc-compute sc-compute-inline":"sc-compute",children:b("li",{children:e.computeLabel})}):b("ul",{className:n?"sc-compute sc-compute-inline":"sc-compute",children:e.compute.map(s=>D("li",{className:s.owned?"sc-compute-own":void 0,children:[s.label,b(al,{runtimes:s.runtimes})]},s.costClass))});return t?r:D("div",{className:n?"sc-plan-compute sc-plan-compute-inline":"sc-plan-compute",children:[b("span",{className:"sc-fact-key",children:"Runs on"}),r]})}function hs({offer:e,shelf:n}){let t=e.connect;return n.showConnect&&t?.actionable?D("button",{type:"button",className:"sc-btn sc-btn-primary sc-btn-icon",onClick:t.open,children:[b(re,{className:"sc-btn-mark"}),"Connect compute"]}):b("button",{type:"button",className:e.current?"sc-btn":"sc-btn sc-btn-primary",disabled:e.cta.disabled,onClick:()=>void e.cta.take().catch(()=>{}),children:e.cta.label})}function al({runtimes:e}){return e.length===0?null:b("span",{className:"sc-compute-marks",children:e.map(n=>{let t=_e[n];return t?b(t,{className:"sc-rt-mark"},n):null})})}import{jsx as gs,jsxs as bo}from"react/jsx-runtime";function il({heading:e,plansHeading:n,showUsage:t=!0,showName:r=!0,className:s,...a}){let{plan:i,loading:c}=Ct(),{theme:o}=H(),l=n??(c?"Plans":i?"Change plan":"Choose a plan");return bo("div",{className:s?`soba-connect sc-fill sc-billing ${s}`:"soba-connect sc-fill sc-billing","data-theme":o,children:[gs(is,{...e===void 0?{}:{heading:e},showUsage:t,showName:r}),bo("section",{className:"sc-billing-plans",children:[l&&gs("h2",{className:"sc-section-title",children:l}),gs(cs,{...a})]})]})}import{useCallback as yo,useState as wo}from"react";function fs({plan:e,successUrl:n,cancelUrl:t,label:r}){let{plan:s}=F(),[a,i]=wo(!1),[c,o]=wo(null),l=yo(()=>s.checkout(e.id,{...n?{successUrl:n}:{},...t?{cancelUrl:t}:{}}),[s,e.id,n,t]),u=yo(async()=>{i(!0),o(null);try{window.location.assign(await l())}catch(m){o(m.message),i(!1)}},[l]);return{label:a?"Opening\u2026":r??`Subscribe for $${e.price.toLocaleString()}/${e.interval}`,busy:a,error:c,buy:u,session:l}}import{jsx as Co,jsxs as cl}from"react/jsx-runtime";function ll({plan:e,successUrl:n,cancelUrl:t,label:r,className:s}){let{theme:a}=H(),i=fs({plan:e,...n?{successUrl:n}:{},...t?{cancelUrl:t}:{},...r?{label:r}:{}});return cl("div",{className:s?`soba-connect ${s}`:"soba-connect","data-theme":a,children:[Co("button",{type:"button",className:"sc-btn sc-btn-primary",disabled:i.busy,onClick:()=>void i.buy(),children:i.label}),i.error&&Co("p",{className:"sc-error",children:i.error})]})}import{useCallback as Qe,useEffect as nn,useMemo as Qn,useRef as tn,useState as ie}from"react";var ul="soba.session:";function vo(e){return!e.cacheKey||!e.endpoint?null:ul+JSON.stringify([e.endpoint,e.user??null,e.cacheKey])}function dl(e){try{let n=globalThis.localStorage?.getItem(e);if(!n)return null;let t=JSON.parse(n);return typeof t.token!="string"||typeof t.expiresAt!="number"?null:{token:t.token,expiresAt:t.expiresAt}}catch{return null}}function pl(e,n){try{n?globalThis.localStorage?.setItem(e,JSON.stringify(n)):globalThis.localStorage?.removeItem(e)}catch{}}var ko=6e4,ml=1e4,Jt=class{#e;#n=null;#r=null;#t;#s=new Set;constructor(n){this.#t=n,this.#e=n.token??null;let t=vo(n),r=t&&!this.#e?dl(t):null;r&&r.expiresAt-ko>Date.now()&&(this.#e=r.token,this.#n=r.expiresAt)}get token(){return this.#e}get expiresAt(){return this.#n}get canRefresh(){return!!this.#t.endpoint}get refreshAt(){return!this.canRefresh||this.#n===null?null:Math.max(Date.now()+ml,this.#n-ko)}subscribe(n){return this.#s.add(n),()=>this.#s.delete(n)}async ensure(){return this.#e?this.#e:this.refresh()}async refresh(){if(this.#r)return this.#r;let n=this.#t.endpoint;if(!n)throw new Error("This Soba session cannot be refreshed. Pass `sessionEndpoint` so the provider can mint a new one.");let t=this.#t.fetchImpl??fetch.bind(globalThis);this.#r=(async()=>{let r=await t(n,{method:"POST",headers:{"content-type":"application/json"},credentials:"same-origin",body:JSON.stringify(this.#t.user?{user:this.#t.user}:{})});if(!r.ok)throw new Error(`Could not start a Soba session (${r.status} from ${n}).`);let s=await r.json(),a=s.session??s.token;if(!a)throw new Error(`${n} answered without a \`session\`. See @soba-so/react's README.`);let i=s.expires_in??s.expiresIn;this.#e=a,this.#n=typeof i=="number"?Date.now()+i*1e3:null;let c=vo(this.#t);c&&pl(c,this.#n===null?null:{token:a,expiresAt:this.#n});for(let o of this.#s)o();return a})();try{return await this.#r}finally{this.#r=null}}},Fn=new Map,No=new WeakMap,hl=1;function gl(e){if(e.token||!e.endpoint)return null;let n=0;return e.fetchImpl&&(n=No.get(e.fetchImpl)??hl++,No.set(e.fetchImpl,n)),JSON.stringify([e.endpoint,e.user??null,n,e.cacheKey??null])}function xo(e){let n=gl(e);if(!n)return new Jt(e);let t=Fn.get(n)??{holder:new Jt(e),users:0};return Fn.set(n,t),t.holder}function Mo(e){for(let n of Fn.values())n.holder===e&&n.users++}function So(e){for(let[n,t]of Fn)if(t.holder===e){setTimeout(()=>{--t.users<=0&&Fn.get(n)===t&&Fn.delete(n)},0);return}}function Ro(e,n=fetch.bind(globalThis)){return async(t,r)=>{let s=await n(t,r);if(s.status!==401||!e.canRefresh)return s;let a;try{a=await e.refresh()}catch{return s}return n(t,fl(r,a))}}function fl(e,n){let t=new Headers(e?.headers);return t.set("authorization",`Bearer ${n}`),{...e,headers:t}}import{jsx as As,jsxs as wl}from"react/jsx-runtime";var Al="https://soba.so",bl=3e4;function yl(e){let{children:n,session:t,sessionEndpoint:r,user:s,sessionCacheKey:a,runEndpoint:i,theme:c,initialMachines:o,initialConnect:l=null,initialPlans:u,initialCurrentPlan:m=null,baseUrl:f=Al,pollMs:g=bl,injectStyles:h=!0,modal:y=!0,fetchImpl:M,onError:E}=e,[R,G]=ie(t??null),[Y,O]=ie(null),[L,T]=ie(l),[w,le]=ie(null),[$,be]=ie(l===null),[ee,Re]=ie(o??[]),[Be,me]=ie(null),[Pe,j]=ie(o===void 0),[ce,rn]=ie(u??[]),[Z,ye]=ie(m),[we,ne]=ie(null),[Ge,X]=ie(u===void 0),[K,_]=ie(null),[We,Ve]=ie(!1),He=tn(E);He.current=E;let B=Qe(k=>{O(k),He.current?.(k)},[]);nn(()=>{h&&yt()},[h]);let Q=Qn(()=>xo({...t?{token:t}:{},...r?{endpoint:r}:{},...s?{user:s}:{},...M?{fetchImpl:M}:{},...a?{cacheKey:a}:{}}),[t,r,s,M,a]);nn(()=>{let k=!0;Mo(Q);let te=Q.subscribe(()=>{k&&G(Q.token)});return!Q.token&&!Q.canRefresh?B(new Error("<SobaProvider> needs a `session` or a `sessionEndpoint`. A browser cannot mint one: that takes your secret key.")):Q.ensure().then(()=>k&&G(Q.token),ve=>k&&B(ve)),()=>{k=!1,te(),So(Q)}},[Q,B]),nn(()=>{Y&&(be(!1),j(!1),X(!1),le(k=>k??Y),me(k=>k??Y),ne(k=>k??Y))},[Y]),nn(()=>{let k=Q.refreshAt;if(k===null)return;let te=()=>{Q.refresh().catch(Ie=>B(Ie))},ve=()=>{document.hidden||(document.removeEventListener("visibilitychange",ve),te())},Sn=setTimeout(()=>{typeof document<"u"&&document.hidden?document.addEventListener("visibilitychange",ve):te()},Math.max(0,k-Date.now()));return()=>{clearTimeout(Sn),typeof document<"u"&&document.removeEventListener("visibilitychange",ve)}},[Q,B,R]);let P=tn(l?.machines_url??null),C=Qn(()=>{if(!R)return null;let k=new Zn({session:R,baseUrl:f,fetchImpl:Ro(Q,M??fetch.bind(globalThis))});return k.setMachinesUrl(P.current),k},[R,f,Q,M]),I=tn(l!==null);nn(()=>{if(!C||I.current)return;let k=!0;return be(!0),C.context().then(te=>{k&&(T(te),le(null),be(!1))},te=>{k&&(le(te),be(!1))}),()=>{k=!1}},[C]);let Ee=Qe(async()=>{if(C)try{let k=await C.machines();Re(Array.isArray(k)?k:[]),me(null)}catch(k){me(k)}finally{j(!1)}},[C]),ue=Qe(async()=>{if(C)try{let k=await C.plans();rn(k.plans),ye(k.current),ne(null)}catch(k){ne(k)}finally{X(!1)}},[C]),sn=tn(!1),[vt,Ce]=ie(!1),on=tn(u!==void 0),qe=tn(!1),an=Qe(()=>{sn.current||(sn.current=!0,qe.current&&queueMicrotask(()=>{qe.current&&Ce(!0)}))},[]);nn(()=>(qe.current=!0,sn.current&&Ce(!0),()=>{qe.current=!1}),[]),nn(()=>{!C||!vt||on.current||ue()},[C,vt,ue]);let Vn=Qe(async k=>{if(!C)throw new Error("No session yet.");await C.selectPlan(k),await ue()},[C,ue]),ln=Qe(async(k,te)=>{if(!C)throw new Error("No session yet.");let ve=await C.checkoutPlan(k,te);if(!ve.url)throw new Error("Checkout could not be started.");return ve.url},[C]),cn=Qe(async()=>{if(!C)throw new Error("No session yet.");await C.leavePlan(),await ue()},[C,ue]),Yt=tn(o!==void 0);nn(()=>{if(!C)return;let k=Se(Ee,g,{immediate:!Yt.current});return Yt.current=!1,k},[C,Ee,g]);let Mn=Qe((k="manual")=>{y&&(Ve(!0),_(k))},[y]),kt=Qe(()=>_(null),[]),Jn=tn(ee);Jn.current=ee;let Nt=Qe(async k=>{if(!i)throw new Error("Pass `runEndpoint` to <SobaProvider> to start runs from the browser. It is your own route: it holds your secret key, calls soba.run(), and forwards the stream.");let{signal:te,...ve}=k,Ie=await(M??fetch.bind(globalThis))(i,{method:"POST",headers:{"content-type":"application/json",accept:"text/event-stream"},credentials:"same-origin",body:JSON.stringify(ve),...te?{signal:te}:{}});if(!Ie.ok){let Je=await Ie.json().catch(()=>null),de=new Error(Je?.error?.message??`${i} answered ${Ie.status}.`);de.status=Ie.status,Je?.error?.code&&(de.code=Je.error.code),Je?.error&&(de.error=Je.error);let un=Jn.current.length>0&&!Jn.current.some(xt=>xt.state!=="offline");throw Ie.status===409&&un&&Mn("no_compute"),de}let jt=as(Ie);return async function*(){try{yield*jt}finally{sn.current&&ue()}}()},[i,M,ue,Mn]),V=Qn(()=>Z?ce.find(k=>k.id===Z.plan_id)??null:null,[ce,Z]),he=Qn(()=>V?V.connected_reward==="included"&&ee.length>0&&V.connected_included_units!==null?V.connected_included_units:V.included_units:null,[V,ee]),Yn=Qn(()=>({plans:ce,current:Z,plan:V,used:Z?.units_used??null,included:he,remaining:he!==null&&Z?Math.max(0,he-Z.units_used):null,unlimited:V!==null&&he===null,loading:Ge,error:we,select:Vn,checkout:ln,leave:cn,refresh:ue}),[ce,Z,V,he,Ge,we,Vn,ln,cn,ue]),zt=Qn(()=>({session:R,client:C,error:Y,get plan(){return an(),Yn},compute:{machines:ee,connected:ee.length>0,online:ee.some(k=>k.state!=="offline"),loading:Pe,error:Be,refresh:Ee},connect:{app:L?.app??null,command:L?.command??null,connectUrl:L?.connect_url??null,publishableKey:L?.publishable_key??null,loading:$,error:w,open:Mn,close:kt,isOpen:K!==null,hasModal:y},run:Nt}),[R,C,Y,Yn,an,K,Mn,kt,y,ee,Pe,Be,Ee,L,$,w,Nt]);return As(Yr.Provider,{value:C,children:As(zr.Provider,{value:{context:L,machines:Pe?void 0:ee,theme:c??L?.theme??"light"},children:wl(jr.Provider,{value:zt,children:[n,y&&We&&As(ft,{open:K!==null,onOpenChange:k=>_(k?K??"manual":null),onConnected:()=>{Ee()},...K==="payment_required"||K==="no_compute"?{reason:K}:{},...K==="pair"?{showStatus:!1}:{}})]})})})}function Cl(e){return e?vl[e]??e:null}var vl={"user-hardware":"your own computer","user-subscription":"your own AI plan","user-api-key":"your own API key","open-weights":"open models we host",frontier:"a frontier model we pay for"};async function kl(e,n,t){let r=n.local;if(!r?.session||n.after)return null;let s=/\/v1\/runs\/([^/]+)\/events/.exec(e.url)?.[1];if(!s)return null;let a=`http://127.0.0.1:${r.port??47321}/v1/runs/${s}/events`,i=new AbortController,c=()=>i.abort();n.signal?.addEventListener("abort",c);let o=setTimeout(()=>i.abort(),r.timeoutMs??3e3);try{let l=await t(a,{headers:{authorization:`Bearer ${r.session}`,accept:"text/event-stream"},signal:i.signal});return l.ok?{url:a,bearer:r.session,open:l}:null}catch{return null}finally{clearTimeout(o),n.signal?.removeEventListener("abort",c)}}async function*Nl(e){let n=e.body;if(!n)return;let t=n.getReader(),r=new TextDecoder,s="",a=null,i=[];try{for(;;){let c=await t.read();if(c.done)return;s+=r.decode(c.value,{stream:!0});for(let o=s.indexOf(`
|
|
4015
|
+
`);o!==-1;o=s.indexOf(`
|
|
4016
|
+
`)){let l=s.slice(0,o).replace(/\r$/,"");if(s=s.slice(o+1),l==="")i.length&&(yield{id:a,data:i.join(`
|
|
4017
|
+
`)}),a=null,i=[];else if(l.startsWith("id:")){let u=Number(l.slice(3).trim());a=Number.isFinite(u)?u:null}else if(l.startsWith("data:")){let u=l.slice(5);i.push(u.startsWith(" ")?u.slice(1):u)}}}}finally{t.cancel().catch(()=>{})}}var bs=(e,n)=>new Promise(t=>{let r=setTimeout(t,e);n?.addEventListener("abort",()=>{clearTimeout(r),t()})});async function*xl(e,n={}){let t=n.fetchImpl??fetch.bind(globalThis),r=await kl(e,n,t)??{url:e.url,bearer:e.token,open:null},s=n.maxRetries??6,a=n.after??0,i=0;for(;;){if(n.signal?.aborted)return;let c;try{c=r.open??await t(r.url,{headers:{authorization:`Bearer ${r.bearer}`,accept:"text/event-stream",...a?{"last-event-id":String(a)}:{}},...n.signal?{signal:n.signal}:{}}),r.open=null}catch(o){if(n.signal?.aborted)return;if(++i>s)throw o;await bs(1e3*i,n.signal);continue}if(c.status===503&&i<s){i++,await bs(Number(c.headers.get("retry-after")??3)*1e3,n.signal);continue}if(!c.ok){let o=`Could not read this run (${c.status}).`;try{let l=await c.json();l.error?.message&&(o=l.error.message)}catch{}throw new Error(o)}for await(let o of Nl(c)){o.id!==null&&(a=o.id),i=0;let l=Un(o.data);if(l&&(yield l,l.type==="done"||l.type==="error"))return}if(n.signal?.aborted)return;if(++i>s)throw new Error("Lost this run's stream and could not get it back.");await bs(1e3*i,n.signal)}}export{si as ComputeStatus,Nn as ConnectButton,hi as ConnectCompute,ft as ConnectModal,Pi as ConnectNudge,Kr as ConnectPill,Bi as ModelPicker,Hi as RunError,Fi as RunLimit,il as SobaBilling,ll as SobaCheckout,is as SobaCurrentPlan,cs as SobaPlans,yl as SobaProvider,Ti as collectText,_r as connectSays,yt as injectStyles,Un as parseEvent,as as readEvents,po as runErrorMessage,xn as sobaErrorCode,Cl as tierLabel,fs as useCheckout,ht as useCompute,ci as useConnectButton,os as useConnectNudge,Ct as useCurrentPlan,$r as useMachineRuns,kn as useModel,bt as useOpenSobaConnect,ls as usePlans,rs as useRunLimit,F as useSoba,xl as watchRun};
|
package/dist/styles.css
CHANGED
|
@@ -858,6 +858,119 @@ a.sc-btn {
|
|
|
858
858
|
text-align: center;
|
|
859
859
|
}
|
|
860
860
|
|
|
861
|
+
.sc-screen-head {
|
|
862
|
+
display: flex;
|
|
863
|
+
align-items: center;
|
|
864
|
+
gap: calc(12px * var(--sc-scale, 1));
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
.sc-back {
|
|
868
|
+
flex: none;
|
|
869
|
+
display: grid;
|
|
870
|
+
place-items: center;
|
|
871
|
+
width: calc(36px * var(--sc-scale, 1));
|
|
872
|
+
height: calc(36px * var(--sc-scale, 1));
|
|
873
|
+
padding: 0;
|
|
874
|
+
border: 0;
|
|
875
|
+
border-radius: 50%;
|
|
876
|
+
background: var(--sc-tray-card, #ffffff);
|
|
877
|
+
color: var(--sc-text, #1b1b1a);
|
|
878
|
+
font: inherit;
|
|
879
|
+
cursor: pointer;
|
|
880
|
+
box-shadow: var(--sc-shadow-1);
|
|
881
|
+
transition: background-color 120ms ease;
|
|
882
|
+
}
|
|
883
|
+
.sc-back:hover:not(:disabled) {
|
|
884
|
+
background: var(--sc-tray-sunk, #efefed);
|
|
885
|
+
}
|
|
886
|
+
.sc-back:disabled {
|
|
887
|
+
cursor: default;
|
|
888
|
+
opacity: 0.5;
|
|
889
|
+
}
|
|
890
|
+
.sc-back-glyph {
|
|
891
|
+
width: calc(15px * var(--sc-scale, 1));
|
|
892
|
+
height: calc(15px * var(--sc-scale, 1));
|
|
893
|
+
}
|
|
894
|
+
.sc-screen-title {
|
|
895
|
+
margin: 0;
|
|
896
|
+
font-size: calc(var(--sc-font-size, 15px) * 1.3333);
|
|
897
|
+
font-weight: 600;
|
|
898
|
+
color: var(--sc-text, #1b1b1a);
|
|
899
|
+
}
|
|
900
|
+
|
|
901
|
+
.sc-group-card.sc-mopts {
|
|
902
|
+
padding: 0 calc(16px * var(--sc-scale, 1));
|
|
903
|
+
}
|
|
904
|
+
.sc-mopt {
|
|
905
|
+
display: flex;
|
|
906
|
+
align-items: center;
|
|
907
|
+
gap: calc(14px * var(--sc-scale, 1));
|
|
908
|
+
width: 100%;
|
|
909
|
+
padding: calc(16px * var(--sc-scale, 1)) 0;
|
|
910
|
+
border: 0;
|
|
911
|
+
background: transparent;
|
|
912
|
+
font: inherit;
|
|
913
|
+
color: inherit;
|
|
914
|
+
text-align: left;
|
|
915
|
+
cursor: pointer;
|
|
916
|
+
}
|
|
917
|
+
.sc-mopt + .sc-mopt {
|
|
918
|
+
box-shadow: inset 0 1px 0 var(--sc-line, #e9e9e7);
|
|
919
|
+
}
|
|
920
|
+
.sc-mopt:disabled {
|
|
921
|
+
cursor: default;
|
|
922
|
+
opacity: 0.5;
|
|
923
|
+
}
|
|
924
|
+
.sc-mopt-say {
|
|
925
|
+
display: flex;
|
|
926
|
+
flex: 1;
|
|
927
|
+
min-width: 0;
|
|
928
|
+
flex-direction: column;
|
|
929
|
+
gap: calc(2px * var(--sc-scale, 1));
|
|
930
|
+
}
|
|
931
|
+
.sc-mopt-name {
|
|
932
|
+
|
|
933
|
+
overflow-wrap: anywhere;
|
|
934
|
+
font-size: calc(var(--sc-font-size, 15px) * 1.0667);
|
|
935
|
+
font-weight: 600;
|
|
936
|
+
}
|
|
937
|
+
.sc-mopt-desc {
|
|
938
|
+
font-size: calc(var(--sc-font-size, 15px) * 0.9333);
|
|
939
|
+
line-height: calc(20px * var(--sc-scale, 1));
|
|
940
|
+
color: var(--sc-muted, #6b6b69);
|
|
941
|
+
}
|
|
942
|
+
|
|
943
|
+
.sc-ring {
|
|
944
|
+
flex: none;
|
|
945
|
+
box-sizing: border-box;
|
|
946
|
+
display: grid;
|
|
947
|
+
place-items: center;
|
|
948
|
+
width: calc(22px * var(--sc-scale, 1));
|
|
949
|
+
height: calc(22px * var(--sc-scale, 1));
|
|
950
|
+
border: 2px solid var(--sc-line-2, #cfcfcb);
|
|
951
|
+
border-radius: 50%;
|
|
952
|
+
color: var(--sc-accent-fg, #ffffff);
|
|
953
|
+
transition:
|
|
954
|
+
background-color 120ms ease,
|
|
955
|
+
border-color 120ms ease;
|
|
956
|
+
}
|
|
957
|
+
.sc-ring-on {
|
|
958
|
+
border-color: var(--sc-accent, #1b1b1a);
|
|
959
|
+
background: var(--sc-accent, #1b1b1a);
|
|
960
|
+
}
|
|
961
|
+
.sc-ring-tick {
|
|
962
|
+
width: calc(13px * var(--sc-scale, 1));
|
|
963
|
+
height: calc(13px * var(--sc-scale, 1));
|
|
964
|
+
}
|
|
965
|
+
|
|
966
|
+
.sc-screen-foot {
|
|
967
|
+
margin: 0;
|
|
968
|
+
padding: 0 calc(4px * var(--sc-scale, 1));
|
|
969
|
+
font-size: max(12px, calc(var(--sc-font-size, 15px) * 0.8667));
|
|
970
|
+
line-height: 1.5;
|
|
971
|
+
color: var(--sc-muted, #6b6b69);
|
|
972
|
+
}
|
|
973
|
+
|
|
861
974
|
.sc-arow {
|
|
862
975
|
display: flex;
|
|
863
976
|
align-items: center;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@soba-so/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.25",
|
|
4
4
|
"description": "Connect the AI your users already pay for, from your own React app.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://soba.so/docs/components",
|
|
@@ -19,13 +19,18 @@
|
|
|
19
19
|
"!dist/**/*.map",
|
|
20
20
|
"README.md"
|
|
21
21
|
],
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "node ../../scripts/build-react.mjs",
|
|
24
|
+
"typecheck": "tsc -p tsconfig.json",
|
|
25
|
+
"prepublishOnly": "node ../../scripts/build-react.mjs"
|
|
26
|
+
},
|
|
22
27
|
"peerDependencies": {
|
|
23
28
|
"react": ">=18"
|
|
24
29
|
},
|
|
25
30
|
"devDependencies": {
|
|
31
|
+
"@soba-so/connect-ui": "workspace:*",
|
|
26
32
|
"@types/react": "^19.0.0",
|
|
27
|
-
"typescript": "^7.0.2"
|
|
28
|
-
"@soba-so/connect-ui": "0.1.0"
|
|
33
|
+
"typescript": "^7.0.2"
|
|
29
34
|
},
|
|
30
35
|
"engines": {
|
|
31
36
|
"node": ">=22"
|
|
@@ -39,9 +44,5 @@
|
|
|
39
44
|
],
|
|
40
45
|
"publishConfig": {
|
|
41
46
|
"access": "public"
|
|
42
|
-
},
|
|
43
|
-
"scripts": {
|
|
44
|
-
"build": "node ../../scripts/build-react.mjs",
|
|
45
|
-
"typecheck": "tsc -p tsconfig.json"
|
|
46
47
|
}
|
|
47
|
-
}
|
|
48
|
+
}
|