import{f as m,i as f}from"./chunk-IRH6IGFT.js";import{d as s}from"./chunk-ELIH6GCC.js";import{$ as c,Ta as r,qa as h,wa as l}from"./chunk-EYDNSYYE.js";import{d as o}from"./chunk-773TIA5M.js";import{g as a}from"./chunk-VKWPEFWQ.js";a();async function b(t,i){let n=t?.path??"",e=o(i,n);if(!await r(e))throw new s(`
The extension is not available for ${t?.value}`);return e}async function k({name:t,app:i}){let n=c(t),e=o(i.directory,f.extensions.directoryName,n);if(await r(e))throw new s(`
A directory with this name (${n}) already exists.
Choose a new name for your extension.`);return await l(e),await h(o(e,m.lockFile)),e}async function v({localApp:t,developerPlatformClient:i,apiKey:n,organizationId:e}){let{dashboardManagedExtensionRegistrations:x}=(await i.appExtensionRegistrations({id:n,apiKey:n,organizationId:e})).app;return x.length>0||t.allExtensions.filter(u=>u.isThemeExtension).length>0||t.allExtensions.length>0}export{b as a,k as b,v as c};
