import{isLocalLink as c}from"../../../utils/path/is-local-link.js";import{reporter as s}from"../../tools/notifiers/reporter.js";import{FileNotFoundError as l,copyStaticFile as m}from"../../utils/index.js";const d=async(e,a,i)=>{let o=e.image;if(o&&c(e.image))try{const t=await m(a,o,i);t&&(o=t)}catch(t){t instanceof l?await s.panicOnBuildContentError("Could not resolve SEO image: "+t.message):await s.panicOnBuild("Could not resolve SEO image: "+t.message)}return{...e,image:o,meta:await f(e.meta,a,i)}};async function f(e,a,i){if(!e)return;const o=[];for(const t of e){let n=t.content;if(c(n))try{const r=await m(a,n,i);r&&(n=r)}catch{}o.push({name:t.name,content:n})}return o}export{d as copySeoAssets};
