import{r as f,S as b,j as e,a as I}from"./app-BZJf8lgN.js";import{L as F}from"./layout-DZ5xjWdd.js";import{I as r}from"./inputtext.esm-B1lZn37a.js";import{P as N,F as s}from"./fileupload.esm-CWt4e-Qk.js";import{I as l}from"./InputLabel-Dd3VnoK3.js";import{I as i}from"./image.esm-DhzuK4QZ.js";import{T as S}from"./toast.esm-CYGIlaDH.js";import{B as L}from"./button.esm-D_cwsnQR.js";import{C as _}from"./CustomCKEditor-BpmNiC9B.js";import"./hooks.esm-UVLztt_0.js";import"./CSSTransition-DBuKQJwM.js";import"./index.esm-Ckth6fI3.js";import"./index.esm-hRnQzR_k.js";import"./csstransition.esm-BNRxTMOa.js";import"./index.esm-CygY3Qsw.js";import"./index.esm-B5zYYMSp.js";const M=({inicio:a})=>{const m=f.useRef(null),{data:c,setData:t,post:d,processing:n,reset:u}=b({titulo:a.titulo,texto:a.texto,imagenFile:null,titulo_2:a.titulo_2,iconoFile:null,icono2File:null,imagenFondoFile:null}),p=o=>{a.imagen=o.files[0].objectURL,t("imagenFile",o.files[0])},x=o=>{a.imagen_fondo=o.files[0].objectURL,t("imagenFondoFile",o.files[0])},h=o=>{a.icono=o.files[0].objectURL,t("iconoFile",o.files[0])},j=o=>{a.icono_2=o.files[0].objectURL,t("icono2File",o.files[0])},g=o=>{o.preventDefault(),d(route("inicio.update",{_method:"put"}),{onSuccess:()=>{m.current.show({severity:"success",summary:"Exito",detail:"Contenido Actualizado",life:3e3}),u(),location.reload()}})};return e.jsxs(F,{children:[n&&e.jsxs(N,{value:n.percentage,max:"100",children:[n.percentage,"%"]}),e.jsx(I,{title:"Editar Inicio"}),e.jsx("div",{className:"grid",children:e.jsx("div",{className:"col-12",children:e.jsxs("div",{className:"card",children:[e.jsx(S,{ref:m}),e.jsxs("section",{className:"max-w-xl",children:[e.jsxs("header",{children:[e.jsx("h2",{className:"text-lg font-medium text-gray-900",children:"Editar Inicio"}),e.jsx("p",{className:"mt-1 text-sm text-gray-600",children:"Editar Contenido del Inicio."})]}),e.jsxs("form",{className:"mt-4 space-y-6",onSubmit:g,encType:"multipart/form-data",children:[e.jsx(r,{id:"title",name:"title",placeholder:"Titulo",className:"w-full mb-4",value:c.titulo,onChange:o=>t("titulo",o.target.value)}),e.jsx(_,{data:c.texto||"",onChange:o=>t("texto",o),placeholder:"Escribe aquí..."}),e.jsx(s,{mode:"basic",name:"img",className:"mt-3",accept:"image/*",chooseLabel:"Subir Imagen",onSelect:p}),e.jsx(l,{children:"Resolucion recomendada 670px * 600px"}),e.jsx(i,{src:a.imagen,alt:"Image",width:"600"}),e.jsx(r,{id:"titulo_2",name:"titulo_2",placeholder:"Titulo 2",className:"w-full mb-4",value:c.titulo_2,onChange:o=>t("titulo_2",o.target.value)}),e.jsx(s,{mode:"basic",name:"icono",className:"mt-3",accept:"image/*",chooseLabel:"Subir Icono",onSelect:h}),e.jsx(l,{children:"Icono"}),e.jsx(i,{src:a.icono,alt:"Icono",width:"100"}),e.jsx(s,{mode:"basic",name:"icono2",className:"mt-3",accept:"image/*",chooseLabel:"Subir Icono 2",onSelect:j}),e.jsx(l,{children:"Icono 2"}),e.jsx(i,{src:a.icono_2,alt:"Icono 2",width:"100"}),e.jsx(s,{mode:"basic",name:"imgFondo",className:"mt-3",accept:"image/*",chooseLabel:"Subir Imagen de Fondo",onSelect:x}),e.jsx(l,{children:"Resolucion recomendada 1366px * 414px"}),e.jsx(i,{src:a.imagen_fondo,alt:"Imagen de Fondo",width:"600"}),e.jsx(L,{className:"mt-5",style:{display:"block",margin:"auto"},type:"submit",children:"Modificar"})]})]})]})})})]})};export{M as default};
//# sourceMappingURL=Inicio-b4HTMp5N.js.map
