import{Minimatch as p}from"minimatch";import{isProductionMode as m}from"../../../../shared/env.js";import{buildScripts as a}from"./build-scripts.js";import{resolveBrowserHooksPath as l}from"./resolve-browser-hooks.js";async function g(){return{id:"Amplitude Analytics",requiredEntitlements:["analytics"],async processContent(o,{getConfig:n}){const e=(await n())?.analytics?.amplitude;if(!e?.apiKey||!m()&&!e.includeInDevelopment)return;let t=[];typeof e.exclude<"u"&&e.exclude.map(d=>{const r=new p(d);t.push(r.makeRe())});const{headComponents:i,postBodyComponents:s}=a(e,t);o.addSsrComponents(i,"head"),o.addSsrComponents(s,"postBody"),o.addBrowserPlugin(l())}}}export{g as amplitudeAnalyticsPlugin};
