1import{_ as w}from"./B45PHMpG.js";import{_ as k}from"./MahnbzM2.js";import{d as $,r as m,c as s,o as a,b as t,i as n,A as u,n as j,s as B,a as g,h as C,f as z,F}from"./B9J_6V5w.js";const N={class:"flex justify-center mb-4"},I={key:1,class:"material-symbols-outlined text-[3rem] text-neutral-300 group-hover:text-emerald-400 transition-colors drop-shadow-sm"},V={class:"text-center font-bold text-neutral-500 group-hover:text-emerald-600 transition-colors"},D={key:0,class:"text-emerald-600"},H={key:1},T={key:1,class:"relative w-full h-80 group rounded-[2.5rem] p-1.5 overflow-hidden shadow-md border-[4px] border-white bg-white"},U={class:"absolute inset-x-0 bottom-0 p-8 z-20 flex justify-end gap-3 translate-y-4 opacity-0 group-hover:translate-y-0 group-hover:opacity-100 transition-all duration-300"},q={key:0,class:"absolute inset-1.5 rounded-[2rem] flex flex-col justify-center items-center bg-white/80 backdrop-blur-sm z-30"},M=$({__name:"HeroUpload",props:{image:{}},emits:["update:image"],setup(b,{emit:v}){const i=b,c=v,o=m(void 0),r=m(!1),d=m(!1);function f(){o.value?.click()}async function h(){if(o.value?.files&&o.value.files.length>0){r.value=!0;const l=new FormData;l.append("title","form_hero_"+o.value.files[0].name),l.append("folder","c7f09a2a-e3bc-41a9-9b34-893352e7eff2"),l.append("file",o.value.files[0]);try{const e=await $fetch("/api/cms/files",{method:"post",body:l});i.image&&await $fetch(`/api/cms/files/${i.image}`,{method:"delete"}),c("update:image",e.data.id)}finally{r.value=!1,o.value.value=""}}}function x(){i.image&&(d.value=!0,$fetch(`/api/cms/files/${i.image}`,{method:"delete"}).then(()=>{o.value.value="",c("update:image",null)}).finally(()=>d.value=!1))}return(l,e)=>{const p=w,y=k;return a(),s(F,null,[t("input",{id:"image",class:"hidden",ref_key:"file",ref:o,type:"file",accept:"image/jpeg,image/png,image/webp,image/svg+xml",onChange:e[0]||(e[0]=_=>h())},null,544),!l.image||n(r)?(a(),s("div",{key:0,class:j(["w-full py-24 bg-neutral-50 shadow-inner border-2 border-dashed border-neutral-200 hover:border-emerald-300 flex-col rounded-[2.5rem] flex justify-center items-center transition-colors group",n(r)?"cursor-default border-emerald-300 bg-emerald-50":"cursor-pointer"]),onClick:e[1]||(e[1]=u(_=>n(r)?"":f(),["prevent"]))},[t("div",N,[n(r)?(a(),B(p,{key:0,class:"text-emerald-500 w-12 h-12 animate-spin"})):(a(),s("span",I,"add_photo_alternate"))]),t("div",V,[n(r)?(a(),s("span",D,"Bild wird verarbeitet ...")):(a(),s("span",H,"Hier klicken, um ein Titelbild hochzuladen"))])],2)):(a(),s("div",T,[g(y,{class:"w-full h-full rounded-[2rem] object-cover transition-transform duration-700 group-hover:scale-105",provider:"directus",src:l.image,quality:"80",alt:"Form Hero Image",loading:"lazy"},null,8,["src"]),e[5]||(e[5]=t("div",{class:"absolute inset-1.5 rounded-[2rem] bg-gradient-to-t from-black/60 via-black/10 to-transparent z-10 pointer-events-none"},null,-1)),t("div",U,[t("button",{onClick:u(f,["prevent","stop"]),class:"bg-white/90 backdrop-blur-md flex items-center gap-2 text-sm text-neutral-800 font-bold px-6 py-3 rounded-full shadow-xl focus:ring-4 focus:ring-emerald-500/30 hover:bg-emerald-50 hover:text-emerald-700 transition-colors"},[...e[2]||(e[2]=[t("span",{class:"material-symbols-outlined text-[1.2rem]"},"upload",-1),z(" Bild ändern ",-1)])]),t("button",{onClick:u(x,["prevent","stop"]),class:"bg-white/90 backdrop-blur-md flex items-center justify-center text-red-600 font-bold w-12 h-12 rounded-full shadow-xl hover:bg-red-50 focus:ring-4 focus:ring-red-500/30 transition-colors"},[...e[3]||(e[3]=[t("span",{class:"material-symbols-outlined text-[1.2rem]"},"delete",-1)])])]),n(d)?(a(),s("div",q,[g(p,{class:"text-red-500 w-10 h-10 animate-spin mb-3"}),e[4]||(e[4]=t("span",{class:"text-neutral-800 font-bold text-lg"},"Bild wird entfernt ...",-1))])):C("",!0)]))],64)}}});export{M as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.