{"version":3,"file":"providerStatusStore.cjs","names":["Store","listProviders"],"sources":["../../../src/web/stores/providerStatusStore.ts"],"sourcesContent":["import { Store } from '@tanstack/store';\n\nimport { listProviders } from '../lib/authApi';\n\n/** Whether a model provider is connected; undefined until read, and when the hub cannot say. */\nexport const providerStatusStore = new Store<{ connected: boolean | undefined }>({ connected: undefined });\n\n/** Reads the hub's providers once; Home asks for one only when it is sure none is connected. */\nexport async function refreshProviderStatus(): Promise<void> {\n  const result = await listProviders();\n  providerStatusStore.setState(() => ({\n    connected:\n      'providers' in result\n        ? result.providers.some((provider) => provider.kind !== 'po-feature' && provider.authenticated !== undefined)\n        : undefined,\n  }));\n}\n"],"mappings":";;;AAKA,MAAa,sBAAsB,K,yBAAIA,EAAAA,CAAAA,MAA0C,EAAE,WAAW,KAAA,EAAU,CAAC;;AAGzG,eAAsB,wBAAuC;CAC3D,MAAM,SAAS,MAAMC,gBAAAA,cAAc;CACnC,oBAAoB,gBAAgB,EAClC,WACE,eAAe,SACX,OAAO,UAAU,MAAM,aAAa,SAAS,SAAS,gBAAgB,SAAS,kBAAkB,KAAA,CAAS,IAC1G,KAAA,EACR,EAAE;AACJ"}