1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[2820],{96018:function(e,l,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/admin/content-managment/home-content/[id]",function(){return n(92936)}])},92288:function(e,l,n){"use strict";n.d(l,{Z:function(){return BlankWrapper}});var a=n(85893),t=n(80166);function BlankWrapper(e){let{title:l,children:n,show:i=!0,url:s}=e;return(0,a.jsxs)("div",{className:"flex flex-col max-w-screen-xl",children:[(0,a.jsx)("div",{className:"",children:(0,a.jsxs)("h1",{className:"titulo-pagina flex gap-[0.5rem] items-center",children:[l,(0,a.jsx)(t.Z,{url:s,show:i})]})}),(0,a.jsx)("hr",{className:"border-1 my-6 mt-1"}),(0,a.jsx)("div",{className:"-my-2 ",children:(0,a.jsx)("div",{className:"py-2 align-middle inline-block min-w-full sm:px-6 lg:px-8",children:(0,a.jsx)("div",{className:"border-b border-gray-200 sm:rounded-lg",children:(0,a.jsx)("div",{className:"overflow-x-auto",children:(0,a.jsx)("div",{className:"bg-white px-[1rem] sm:px-[3rem]",children:n})})})})})]})}},20677:function(e,l,n){"use strict";n.d(l,{Z:function(){return LandingPagesForm}});var a=n(85893),t=n(42746),i=n(99971),s=n(15333),r=n(25675),o=n.n(r);function LandingPagesForm(e){let{save:l,imageBlobUrl:n,uploadedFile:r,uploadedFileError:d,handleImageRemove:u,handleUploadButtonClick:c,fileInputRef:v,handleImageUpload:g,payload:m,set:p,errorMessages:h,isSL:x,edit:f}=e,b=(0,t.useTranslations)("tables"),j=(0,t.useTranslations)("lang"),w=(0,t.useTranslations)("buttons"),y=(0,t.useTranslations)("toast");return(0,a.jsxs)("form",{onSubmit:l,className:"mt-[2rem] py-5 grid grid-cols-1 xl:grid-cols-2 gap-2",children:[null==m?void 0:m.map((e,l)=>{var n,t,i,r,o,d,u,c;return(0,a.jsxs)("div",{className:"p-[1rem] flex flex-col gap-[0.3rem] border border-[#ad8b19] rounded-xl",children:[(0,a.jsx)("label",{className:"font-[700] text-[#2B434E]",htmlFor:e,children:j(null===(n=m[l])||void 0===n?void 0:n.langLandingPage.toLowerCase())}),(0,a.jsx)("input",{readOnly:!0,type:"text",value:null===(t=m[l])||void 0===t?void 0:t.langLandingPage,className:"information_input !p-[0rem] md:!p-[0.375rem] hidden"}),(0,a.jsx)(s.II,{type:"text",onChange:e=>p(e,l),label:b("title"),value:null===(i=m[l])||void 0===i?void 0:i.title,name:"title",twClass:"inputFormClass !w-full "}),(null===(r=h[l])||void 0===r?void 0:r.title)&&(0,a.jsx)("p",{className:"text-red-500 pl-1",children:null===(o=h[l])||void 0===o?void 0:o.title}),(0,a.jsx)(s.Kx,{cols:"40",rows:"4",onChange:e=>p(e,l),label:b("description"),value:null===(d=m[l])||void 0===d?void 0:d.description,name:"description",twClass:"w-full"}),(null===(u=h[l])||void 0===u?void 0:u.description)&&(0,a.jsx)("p",{className:"text-red-500 pl-1",children:null===(c=h[l])||void 0===c?void 0:c.description})]},e.langLandingPage)}),(0,a.jsxs)("div",{className:"p-[1rem] mt-[1rem] flex flex-col",children:[n&&(0,a.jsx)("div",{className:"ml-[0.3rem]",children:(0,a.jsx)(o(),{src:n,alt:"Uploaded Image",width:287,height:195,style:{width:"287px",height:"195px"}})}),(0,a.jsxs)("div",{className:"flex gap-2 my-[0.5rem] ml-[0.5rem] items-center font-[500]",children:[null!==r&&d&&d!==y("filePdf")&&(0,a.jsx)(o(),{width:13,height:16,src:"/eliminar.svg",alt:"SVG",className:"hover:cursor-pointer mt-[0.1rem]",onClick:u}),d&&(0,a.jsx)("p",{className:d===y("filePdf")?"text-red-500":"text-[#2B434E]",children:d})]}),(0,a.jsx)(i.z,{type:"button",action:c,name:w("uploadImage"),twClass:"!text-[#AD8B19] !bg-white !max-w-[18rem] !border !border-[#AD8B19] !text-base drop-shadow-xl"}),(0,a.jsx)("input",{type:"file",ref:v,style:{display:"none"},onChange:g})]}),(0,a.jsx)("div",{className:"information_button ",children:(0,a.jsx)(i.z,{loading:x,action:()=>{},name:w("save"),twClass:"!text-white !text-base drop-shadow-xl"})})]})}},80166:function(e,l,n){"use strict";var a=n(85893),t=n(42746),i=n(25675),s=n.n(i),r=n(11163);l.Z=e=>{let{show:l,url:n}=e,i=(0,r.useRouter)(),o=(0,t.useTranslations)("buttons"),handleClick=()=>{n?i.replace(n):i.back()};return l?(0,a.jsx)("button",{onClick:()=>{handleClick()},className:"text-green-500 hover:text-green-700",title:o("return"),children:(0,a.jsx)(s(),{width:20,height:15,src:"/icon/redirectDark.svg",alt:"SVG",className:"!text-pink-500"})}):null}},92936:function(e,l,n){"use strict";n.r(l);var a=n(85893),t=n(92288),i=n(20677),s=n(4023),r=n(30727),o=n(87066),d=n(42746),u=n(11163),c=n(67294),v=n(22920);l.default=()=>{let{token:e,APIURL:l}=(0,s.qD)(),n=(0,d.useTranslations)("sideBar"),g=(0,d.useTranslations)("titles"),m=(0,d.useTranslations)("toast"),p=(0,u.useRouter)(),h=(0,c.useMemo)(()=>new r.Z(l,e),[e,l]),[x,f]=(0,c.useState)([]),[b,j]=(0,c.useState)(!1),[w,y]=(0,c.useState)(null),[N,D]=(0,c.useState)(""),[k,C]=(0,c.useState)(null),E=(0,c.useRef)(null),[L,P]=(0,c.useState)(""),[S,_]=(0,c.useState)([{id:"",title:"",description:"",langLandingPage:""},{id:"",title:"",description:"",langLandingPage:""},{id:"",title:"",description:"",langLandingPage:""}]);(0,c.useEffect)(()=>{null==h||h.getById(String(p.query.id),"landing-pages").then(n=>{var a;f(null==n?void 0:null===(a=n.data)||void 0===a?void 0:a.landingPageDescs.map(e=>({id:e.id||"",title:e.title||"",description:e.description||"",langLandingPage:e.langLandingPage||""}))),P(n.data.id);let t="".concat(l,"/landing-pages/files/").concat(n.data.landingPageImage.id);o.Z.get(t,{responseType:"blob",headers:{Authorization:"Bearer ".concat(e),"Content-Type":"application/octet-stream"}}).then(e=>{let l=new Blob([e.data],{type:"image/jpeg"}),n=window.URL.createObjectURL(l);C(n)}).catch(e=>{console.error("Error downloading file:",e)})})},[h,p.query.id]);let updateErrorMessages=()=>{let e=[...S];for(let l=0;l<x.length;l++)for(let n in x[l])""===x[l][n]&&(e[l]={...e[l],[n]:m("mandatoryError")});return e},save=async e=>{e.preventDefault();let l=updateErrorMessages();_(l);let n=l.every(e=>Object.values(e).every(e=>""===e));if(null===w&&D(m("mandatoryError")),!0===n&&null===w){j(!0);try{null==h||h.updatObject(String(p.query.id),"landing-pages",x).then(e=>{(0,v.Am)(m("updateDone")),p.back(),j(!1)}).catch(e=>{var l,n,a,t,i,s,r,o,d,u,c;j(!1);let g=Array.isArray(null==e?void 0:null===(a=e.response)||void 0===a?void 0:null===(n=a.data)||void 0===n?void 0:null===(l=n.errorsDetails)||void 0===l?void 0:l.debugMessage)?null==e?void 0:null===(o=e.response)||void 0===o?void 0:null===(r=o.data)||void 0===r?void 0:null===(s=r.errorsDetails)||void 0===s?void 0:null===(i=s.debugMessage)||void 0===i?void 0:null===(t=i[0])||void 0===t?void 0:t.message:null==e?void 0:null===(c=e.response)||void 0===c?void 0:null===(u=c.data)||void 0===u?void 0:null===(d=u.errorsDetails)||void 0===d?void 0:d.debugMessage;v.Am.error(g)})}catch(e){}}!0===n&&null!==w&&(null==h||h.updatObject(String(p.query.id),"landing-pages",x).then(e=>{let l=new FormData;l.append("contentImage",w),null==h||h.uploadFormData(L,"landing-pages",l,"files").then(e=>{j(!1),(0,v.Am)(m("createDone")),p.back()}).catch(e=>{var l,n,a,t,i,s,r,o,d;j(!1),v.Am.error((null===(t=e.response)||void 0===t?void 0:null===(a=t.data)||void 0===a?void 0:null===(n=a.errorsDetails)||void 0===n?void 0:null===(l=n.debugMessage[0])||void 0===l?void 0:l.message)||(null===(r=e.response)||void 0===r?void 0:null===(s=r.data)||void 0===s?void 0:null===(i=s.errorsDetails)||void 0===i?void 0:i.debugMessage)||(null===(d=e.response)||void 0===d?void 0:null===(o=d.data)||void 0===o?void 0:o.message))})}).catch(l=>{var n,a,t,i,s,r,o,d,u;e.preventDefault(),j(!1),console.log("newsletterDataError",l),v.Am.error((null===(i=l.response)||void 0===i?void 0:null===(t=i.data)||void 0===t?void 0:null===(a=t.errorsDetails)||void 0===a?void 0:null===(n=a.debugMessage[0])||void 0===n?void 0:n.message)||(null===(o=l.response)||void 0===o?void 0:null===(r=o.data)||void 0===r?void 0:null===(s=r.errorsDetails)||void 0===s?void 0:s.debugMessage)||(null===(u=l.response)||void 0===u?void 0:null===(d=u.data)||void 0===d?void 0:d.message))}))};return(0,a.jsx)(t.Z,{title:"".concat(g("new")," ").concat(n("start")),children:(0,a.jsx)(i.Z,{errorMessages:S,payload:x,set:(e,l)=>{let{name:n,value:a}=e.target,t=[...x];t[l]={...t[l],[n]:a},f(t);let i=[...S];a.trim()?i[l]={...i[l],[n]:""}:i[l]={...i[l],[n]:m("mandatoryError")},_(i)},save:save,imageBlobUrl:k,uploadedFile:w,uploadedFileError:N,handleImageRemove:e=>{e.preventDefault(),y(null),C(null),D("")},handleUploadButtonClick:()=>{E.current&&E.current.click()},fileInputRef:E,handleImageUpload:e=>{var l,n;if(e.preventDefault(),D(""),null==E?void 0:null===(n=E.current)||void 0===n?void 0:null===(l=n.files)||void 0===l?void 0:l.length){let e=E.current.files[0];y(e),D(e.name);let l=URL.createObjectURL(e);C(l)}},edit:!0,isSL:b})})}}},function(e){e.O(0,[9774,2888,179],function(){return e(e.s=96018)}),_N_E=e.O()}]);
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.