import{REDOCLY_TEAMS_RBAC as r}from"@redocly/config";import{getTemplatePath as l}from"./get-template-path.js";import{getDevOnboardingRbacConfig as o}from"./utils.js";import{telemetryTraceStep as u}from"../../../cli/telemetry/helpers/trace-step.js";const c="apigee-";async function f({contentDir:d}){return{id:"Developer Onboarding",requiredEntitlements:["devOnboarding"],async processContent(e,{getConfig:t}){await u("build.plugin.dev_onboarding",async()=>{const a=await t();if(!a.developerOnboarding)return;const n=e.createTemplate(c,l("./template/index.js"));e.addRoute({duplicateInAllLocales:!0,excludeFromSidebar:!0,slug:"/apps/",fsPath:"",templateId:n,hasClientRoutes:!0,[r]:a?.rbac&&o(a?.rbac),getNavText:()=>Promise.resolve("My Apps"),getStaticData:async()=>({props:{proxyUrl:"https://api.enterprise.apigee.com/v1/organizations/ORGNAME/apis",seo:{title:"My Apps"}}})})})},async afterRoutesCreated(e){const t=e.getConfig();if(!t.developerOnboarding)return;const n=e.getGlobalData().userMenu||{},i={type:"link",link:"/apps/",label:"My Apps",[r]:t?.rbac&&o(t?.rbac),labelTranslationKey:"userMenu.devOnboardingLabel"},s=n?.menu||[],p={...n,menu:[...s,i]};e.setGlobalData({userMenu:p})}}}export{f as apiKeyMgmtPlugin};
