import{Z as e,$ as s,a0 as a,a1 as u}from"./e.03a03bfd.js";async function r(r,i){const l=new e,n=await s(r),d=`/hacsfiles/${i.full_name.split("/")[1]}`,o=`${d}/${i.file_name}`,t=n.find((e=>e.url.includes(d)));l.debug({namespace:d,url:o,exsisting:t},"updateLovelaceResources"),t&&t.url!==o?(l.debug(`Updating exsusting resource for ${d}`),a(r,{url:o,resource_id:t.id,res_type:t.type})):n.map((e=>e.url)).includes(o)||(l.debug(`Adding ${o} to Lovelace resources`),u(r,{url:o,res_type:"module"}))}export{r as u};
