import{k as e,U as r,al as a,an as t,E as n,a0 as o,q as i,a2 as s}from"./index-WdfADTOW.js";import{I as m}from"./ImageWithError-X3f_wfYd.js";import{O as d}from"./icon-BWzmfBge.js";import"./index-U4ybYyYy.js";import"./Layout-Dnkreiah.js";import"./useTitle-BZYCQV-b.js";import"./FolderTree-CfW3CiDF.js";import"./index-DOl0PLGi.js";import"./ModalInput-3A_h28-x.js";import"./index-B42M_jG_.js";import"./share-DuMdNkZH.js";import"./index-BpGVr_Gk.js";const l=l=>{const j=i(),{replace:g}=e();let p=l.images||r.objs.filter(e=>e.type===d.IMAGE);0===p.length&&(p=[r.obj]);const f=e=>{"ArrowLeft"===e.key?(()=>{const e=p.findIndex(e=>e.name===r.obj.name);e>0&&(l.navigate?l.navigate(p[e-1].name):g(p[e-1].name))})():"ArrowRight"===e.key&&(()=>{const e=p.findIndex(e=>e.name===r.obj.name);e<p.length-1&&(l.navigate?l.navigate(p[e+1].name):g(p[e+1].name))})()};return a(()=>{window.addEventListener("keydown",f)}),t(()=>{window.removeEventListener("keydown",f)}),n(m,{maxH:"75vh",rounded:"$lg",get src(){return r.raw_url},get fallback(){return n(s,{})},get fallbackErr(){return n(o,{get msg(){return j("home.preview.failed_load_img")}})}})};export{l as default};
