import{y as l}from"./BCLrUOBx.js";function L(r,n){const c=({index:o},a="home-hero")=>{r.value=o;const{getImageURL:e}=l(),t=s(o,a),d=()=>{t.style.opacity=1};t==null||t.addEventListener("load",d),t==null||t.addEventListener("error",()=>{t.style.opacity=1,t.src=e()})},u=(o=0,a="home-hero")=>{r.value=o;const e=s(o,a),t=()=>{n.value=!0,e.style.opacity=1};e==null||e.addEventListener("load",t),e==null||e.addEventListener("error",()=>{n.value=!0,e.style.opacity=1,e.src=getImageURL()})},s=(o=0,a="home-hero")=>{const e=document.getElementById(`${a}-${o}`);return e==null||e.setAttribute("src",e==null?void 0:e.getAttribute("data-src")),e};return{onChange:c,onFirstImageLoad:u}}export{L as u};
