import{o as e}from"./manifest-registry-_hxKCS2K-OL8KK_o4.mjs";import{t}from"./jiti-loader-cache-Bat69wam-DNIteTtO.mjs";import{a as n}from"./loader-708jrx4Y-BbJRXNlQ.mjs";import{o as r}from"./plugin-auto-enable-DdH3n9V8-Dr_bUXkG.mjs";import{n as i}from"./providers.runtime-Ba7tOlq7-B4t6ywCr.mjs";function a(){let e=new Map;return r=>{let i=t({cache:e,modulePath:r,importerUrl:import.meta.url,jitiFilename:import.meta.url});return n({pluginId:`(direct)`,source:r},`source-loader`,()=>i(r))}}function o(e){let t=e&&typeof e==`object`&&`default`in e&&e.default!==void 0?e.default:e;if(Array.isArray(t))return t;if(t&&typeof t==`object`&&`id`in t)return[t];if(e&&typeof e==`object`&&!Array.isArray(e)){let t=e;if(Array.isArray(t.providers))return t.providers;if(t.provider)return[t.provider]}return[]}function s(t){let n=r(t),i=new Set(n),s=e(t).plugins.filter(e=>e.providerDiscoverySource&&i.has(e.id));if(s.length===0||t.requireCompleteDiscoveryEntryCoverage&&s.length<i.size)return[];let c=a(),l=[];for(let e of s)try{let t=c(e.providerDiscoverySource);l.push(...o(t).map(t=>Object.assign({},t,{pluginId:e.id})))}catch{return[]}return l}function c(e){let t=s(e);return t.length>0?t:i({...e,bundledProviderAllowlistCompat:!0})}export{c as resolvePluginDiscoveryProvidersRuntime};