import{r as e}from"./install-fm-addon-DJ5bEmch.js";import{t}from"./logger-DOETxkOe.js";import{c as n,t as r}from"./utils-l-LeUg2v.js";import"./globalOptions-BzW3wHo-.js";import{n as i}from"./state-NQaDy_hK.js";async function a(e){if(e===`webviewer`||e===`auth`)return e;if(i())throw Error("Addon target is required in non-interactive mode. Use `proofkit add addon webviewer`.");return r(await n({message:`Which add-on do you want to install locally?`,options:[{value:`webviewer`,label:`Web Viewer`,hint:`ProofKit Web Viewer add-on`},{value:`auth`,label:`Auth`,hint:`ProofKit Auth add-on`}]}))}async function o(t){await e({addonName:await a(t)===`webviewer`?`wv`:`auth`})}const s="Only `proofkit add addon <target>` is supported.",c=async(e,n)=>{if(e===`addon`)return await o(n?.target);throw t.error(s),Error(s)};export{c as runAdd};
//# sourceMappingURL=add-lJKfAZap.js.map