PageSourceSearch

https://enginyersgp.cat/admin/static/js/188.d121bb34.chunk.js

js enginyersgp.cat collected 2026-10-08 20:06:14 UTC 133,501 bytes, 2 lines download raw bytes

1"use strict";(self.webpackChunkapps=self.webpackChunkapps||[]).push([[188],{2019:function(e,a,i){i.d(a,{F:function(){return o},t:function(){return s}});var t=i(1413),n=i(6812),o={GET:{receive:{schema:function(e){var a,i,t;return e||(e={}),{id:e.idpersonaentidad||"",idpersona:e.idpersona||"",identidad:e.identidad||"",personasentidadesfechaalta:(0,n.Fe)(e.personasentidadesfechaalta),personasentidadesfechabaja:(0,n.Fe)(e.personasentidadesfechabaja),telefono1:e.telefono1||"",telefonomovil:e.telefonomovil||"",fechabaja:(0,n.Fe)(e.fechabaja),visador:e.visador?"Si":"No",email:e.email||"",identidadsede:e.identidadsede||"",nombresede:e.nombresede||"",direccionsede:e.direccionsede||"",municipiosede:e.municipiosede||"",idpaissede:e.idpaissede||"",cpsede:e.cpsede||"",sedecentral:e.sedecentral||"",observaciones:e.observaciones||"",nombreentidad:e.nombreentidad||"",nombrepersona:e.nombrepersona||"",tipoentidad:e.tipoentidad||"",idrelacion:e.idrelacion||"",relacion:e.relacion||"",persona_nombre:"".concat((null===(a=e.persona)||void 0===a?void 0:a.nombre)||""," ").concat((null===(i=e.persona)||void 0===i?void 0:i.apellido1)||""," ").concat((null===(t=e.persona)||void 0===t?void 0:t.apellido2)||"")||"",estado:e.fechabaja?"Baixa":"Alta",fechaestado:e.fechabaja?(0,n.Fe)(e.fechabaja):(0,n.Fe)(e.fechaalta)}},adapter:function(e){var a,i,t=this,n=null===e||void 0===e||null===(a=e.data)||void 0===a?void 0:a.data,o=null===n||void 0===n||null===(i=n.data)||void 0===i?void 0:i.map((function(e){return t.schema(e)}));return{data:{total:null===n||void 0===n?void 0:n.total,per_page:null===n||void 0===n?void 0:n.per_page,current_page:null===n||void 0===n?void 0:n.current_page,items:o},status:null===e||void 0===e?void 0:e.status}}}}},s={GET:{receive:{schema:function(e){var a,i,t;return e||(e={}),{idpersona:e.idpersona||"",idrelacion:e.idrelacion||"",identidad:e.identidad||"",identidadsede:e.identidadsede||"",nombreentidad:e.nombreentidad||"",fechaalta:(0,n.Fe)(e.personasentidadesfechaalta),permisoedicion:(0,n.Bm)(e.permisoedicion,"permisoedicion"),mostrarencatalogo:(0,n.Bm)(e.mostrarencatalogo,"mostrarencatalogo"),telefono1:e.telefono1||"",extension1:e.extension1||"",telefono2:e.telefono2||"",extension2:e.extension2||"",telefonomovil:e.telefonomovil||"",cargo:e.cargo||"",email:e.email||"",idcondicionpago:e.idcondicionpago||"",observaciones:e.observaciones||"",idpersonaentidad:e.idpersonaentidad||"",visador:(0,n.Bm)(e.visador,"visador"),porcentajeparticipacion:e.porcentajeparticipacion||"",direccionsede:e.direccionsede||"",cpsede:e.cpsede||"",idpaissede:e.idpaissede||"",idprovinciasede:e.idprovinciasede||"",municipiosede:e.municipiosede||"",persona_nombre:"".concat((null===(a=e.persona)||void 0===a?void 0:a.nombre)||""," ").concat((null===(i=e.persona)||void 0===i?void 0:i.apellido1)||""," ").concat((null===(t=e.persona)||void 0===t?void 0:t.apellido2)||"")||"",personasentidadesfechabaja:e.personasentidadesfechabaja||""}},adapter:function(e){var a,i=null===e||void 0===e||null===(a=e.data)||void 0===a?void 0:a.data,n=this.schema(i[0]);return{data:(0,t.Z)({},n),status:null===e||void 0===e?void 0:e.status}}}},POST:{receive:{schema:function(e){return e||(e={}),{message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){return e||(e={}),{idpersona:e.idpersona||"",idrelacion:e.idrelacion||"",identidad:e.identidad||"",identidadsede:e.identidadsede||"",nombreentidad:e.nombreentidad||"",fechaalta:e.fechaalta||"",permisoedicion:(0,n.i6)(e.permisoedicion),mostrarencatalogo:(0,n.i6)(e.mostrarencatalogo),telefono1:e.telefono1||"",extension1:e.extension1||"",telefono2:e.telefono2||"",extension2:e.extension2||"",telefonomovil:e.telefonomovil||"",cargo:e.cargo||"",email:e.email||"",idcondicionpago:e.idcondicionpago||"",observaciones:e.observaciones||"",idpersonaentidad:e.idpersonaentidad||"",visador:(0,n.i6)(e.visador),porcentajeparticipacion:e.porcentajeparticipacion||""}},adapter:function(e){var a=this.schema(e);return(0,t.Z)({},a)}}},PATCH:{receive:{schema:function(e){return e||(e={}),{message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){return e||(e={}),{idpersona:e.idpersona||"",idrelacion:e.idrelacion||"",identidad:e.identidad||"",identidadsede:e.identidadsede||"",nombreentidad:e.nombreentidad||"",permisoedicion:(0,n.i6)(e.permisoedicion),mostrarencatalogo:(0,n.i6)(e.mostrarencatalogo),telefono1:e.telefono1||"",extension1:e.extension1||"",telefono2:e.telefono2||"",extension2:e.extension2||"",telefonomovil:e.telefonomovil||"",cargo:e.cargo||"",email:e.email||"",idcondicionpago:e.idcondicionpago||"",observaciones:e.observaciones||"",idpersonaentidad:e.idpersonaentidad||"",visador:(0,n.i6)(e.visador),porcentajeparticipacion:e.porcentajeparticipacion||""}},adapter:function(e){var a=this.schema(e);return(0,t.Z)({},a)}}},PATCH_ALTA:{receive:{schema:function(e){return e||(e={}),{message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){return e||(e={}),{idpersona:e.idpersona||"",idrelacion:e.idrelacion||"",identidad:e.identidad||"",identidadsede:e.identidadsede||"",nombreentidad:e.nombreentidad||"",permisoedicion:(0,n.i6)(e.permisoedicion),mostrarencatalogo:(0,n.i6)(e.mostrarencatalogo),telefono1:e.telefono1||"",extension1:e.extension1||"",telefono2:e.telefono2||"",extension2:e.extension2||"",telefonomovil:e.telefonomovil||"",cargo:e.cargo||"",email:e.email||"",idcondicionpago:e.idcondicionpago||"",observaciones:e.observaciones||"",idpersonaentidad:e.idpersonaentidad||"",visador:(0,n.i6)(e.visador),porcentajeparticipacion:e.porcentajeparticipacion||"",personasentidadesfechabaja:e.personasentidadesfechabaja||"",fechabaja:e.fechabaja||""}},adapter:function(e){var a=this.schema(e);return(0,t.Z)({},a)}}},DELETE:{receive:{schema:function(e){return e||(e={}),{message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}}}}},8332:function(e,a,i){i.d(a,{Y:function(){return o},s:function(){return s}});var t=i(1153),n=i(2019),o={GET:function(){return(0,t.b)({method:"get",url:"/personasentidades",type:"json",adapters:n.F.GET})}},s={GET:function(e){return(0,t.b)({method:"get",url:"/personasentidades/".concat(e),type:"json",adapters:n.t.GET})},POST:function(){return(0,t.b)({method:"post",url:"/personasentidades",type:"json",adapters:n.t.POST})},PATCH:function(e){return(0,t.b)({method:"patch",url:"/personasentidades/".concat(e),type:"json",adapters:n.t.PATCH})},PATCH_ALTA:function(e){return(0,t.b)({method:"patch",url:"/personasentidades/".concat(e),type:"json",adapters:n.t.PATCH_ALTA})},DELETE:function(e){return(0,t.b)({method:"delete",url:"/personasentidades/".concat(e),type:"json",adapters:n.t.DELETE})}}},9758:function(e,a,i){i.r(a),i.d(a,{default:function(){return La}});var t=i(6871),n=i(4483),o=i(3174),s=i(9942),d=i(4477),r=i(4303),c=i(9439),l=i(2791),u=i(4251),m=(i(
15852),i(6094)),h=i(2426),v=i.n(h),p=i(1001),f=i(3433),x=i(1413),j=i(2766),g=i(9795),b=i(193),E=i(1533),N=i(2954),A=i(8386),Z=i(1153),T={GET:{receive:{schema:function(e){return e||(e={}),{descripcion:e.descripcion||"",fecha:e.fecha||""}},adapter:function(e){var a,i,t=this,n=null===e||void 0===e||null===(a=e.data)||void 0===a?void 0:a.data;return{data:{items:null===n||void 0===n||null===(i=n.data)||void 0===i?void 0:i.map((function(e){return t.schema(e)}))},status:null===e||void 0===e?void 0:e.status}}}}},y={GET:{receive:{schema:function(e){return e||(e={}),{id:e.idrelacion||"",codrelacion:e.codrelacion||"",relacion:e.relacion||"",tiporelacion:e.tiporelacion||""}},adapter:function(e){var a,i=null===e||void 0===e||null===(a=e.data)||void 0===a?void 0:a.data,t=this.schema(i);return{data:(0,x.Z)({},t),status:null===e||void 0===e?void 0:e.status}}}},POST:{receive:{schema:function(e){return e||(e={}),{message:e.message,status:e.status,data:e.data}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){return e||(e={}),{fecha:e.fecha||"",descripcion:e.descripcion||""}},adapter:function(e){var a=this.schema(e);return(0,x.Z)({},a)}}},PATCH:{receive:{schema:function(e){return e||(e={}),{message:e.message,status:e.status,data:e.data}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){return e||(e={}),{descripcion:e.descripcion||""}},adapter:function(e){var a=this.schema(e);return(0,x.Z)({},a)}}},DELETE:{receive:{schema:function(e){return e||(e={}),{message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}}}},D=function(){return(0,Z.b)({method:"post",url:"/maestros/allfechas",type:"json",adapters:T.GET})},_=function(){return(0,Z.b)({method:"post",url:"/maestros/fechas",type:"json",adapters:y.POST})},O=function(e){return(0,Z.b)({method:"patch",url:"/maestros/fechas/".concat(e,"/update"),type:"json",adapters:y.PATCH})},I=function(){return(0,Z.b)({method:"delete",url:"/maestros/fecha",type:"json",adapters:y.DELETE})},C=i(9697),S=i(763),R=i(184),w=function(e){var a,i,t,s=e.showModal_Evento,d=e.handleCloseModal_Evento,r=e.setEvents,u=e.events,h=(e.fetchSuccess,(0,p.useLang)()),v=(0,l.useState)(""),Z=(0,c.Z)(v,2),T=(Z[0],Z[1]),y=(0,N.c)({horainicio:"",horafin:"",title:h("EVENTO")}),D=(0,c.Z)(y,4),w=D[0],G=D[1],L=D[2],F=(D[3],(0,A.n)({descripcion:{isOk:!0,msgError:[h("ALERT_OBLIGATORIO_GENERICO")]}})),P=(0,c.Z)(F,3),M=P[0],k=P[1],V=(P[2],_()),Y=(0,c.Z)(V,2),U=Y[0],B=Y[1];(0,l.useEffect)((function(){if((0,m.iY)(B.status)){var e,a=null===(e=B.data)||void 0===e?void 0:e.data,i=new Date(a.fecha+"T00:00:00"),t=new Date(a.fecha+"T00:00:00");r((function(e){return[].concat((0,f.Z)(e),[{start:i,end:t,title:a.descripcion}])})),d()}}),[B]);var H=O(null===(a=s.payload)||void 0===a?void 0:a.fecha),z=(0,c.Z)(H,2),W=z[0],q=z[1];(0,l.useEffect)((function(){if((0,m.iY)(q.status)){var e=(0,S.cloneDeep)(u);e.forEach((function(e){var a;e.fecha!==(null===(a=s.payload)||void 0===a?void 0:a.fecha)||(e.title=w.descripcion)})),r(e),d()}}),[q]);var X=I(),J=(0,c.Z)(X,2),Q=J[0],$=J[1];return(0,l.useEffect)((function(){(0,m.iY)($.status)&&(r(null===u||void 0===u?void 0:u.filter((function(e){var a;return e.fecha!==(null===(a=s.payload)||void 0===a?void 0:a.fecha)}))),T(""),d())}),[$]),(0,l.useEffect)((function(){s.value&&L((0,x.Z)({},s.payload))}),[s.value]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(j.Z,{className:"ModalStatusServer",show:s.value,onHide:d,size:"lg",children:[(0,R.jsx)(j.Z.Header,{closeButton:!0,className:"border-0",children:(0,R.jsx)(j.Z.Title,{className:"h5",children:h("DIA_FESTIVO")})}),(0,R.jsx)(j.Z.Body,{className:"px-3 px-lg-4 pt-2",children:(0,R.jsx)("div",{className:"row",children:(0,R.jsx)(g.Z.Group,{className:"col-12",children:(0,R.jsx)(E.o,{label:h("DESCRIPCION")+":",name:"descripcion",value:w.descripcion,onChange:G,validation:M})})})}),(0,R.jsxs)(j.Z.Footer,{className:"border-0 d-flex justify-content-between",children:["EDIT"===(null===(i=s.payload)||void 0===i?void 0:i.action)&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(b.X,{variant:"danger",type:"button",className:"text-nowrap",handleSubmit:function(){var e,a;return a=null===(e=s.payload)||void 0===e?void 0:e.fecha,T(a),void Q({id:a})},fetchDataLoading:[$.loading],value:h("ELIMINAR"),icon:(0,R.jsx)(n.G,{icon:o.r6l,className:"me-1"})}),(0,R.jsx)(b.X,{variant:"secondary",type:"button",className:"text-nowrap",handleSubmit:function(){k(w)&&W({body:(0,x.Z)({},w)})},fetchDataLoading:[q.loading],value:h("GUARDAR"),icon:(0,R.jsx)(n.G,{icon:o.r6l,className:"me-1"})})]}),"CREATE"===(null===(t=s.payload)||void 0===t?void 0:t.action)&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("div",{}),(0,R.jsx)(b.X,{variant:"secondary",type:"button",className:"text-nowrap",handleSubmit:function(){return function(e){if(k(w)){var a=new Date(e.start);U({body:(0,x.Z)((0,x.Z)({},w),{},{fecha:(0,m.iG)(a)})})}}(s.payload)},fetchDataLoading:[B.loading],value:h("CREAR"),icon:(0,R.jsx)(n.G,{icon:o.r6l,className:"me-1"})})]})]})]}),(0,R.jsx)(C.D,{fetchData:B}),(0,R.jsx)(C.D,{fetchData:q}),(0,R.jsx)(C.D,{fetchData:$})]})},G=i(6812),L=i(2784),F=function(){return(0,R.jsx)("div",{className:"px-4 py-3",children:(0,R.jsxs)("div",{className:"row",children:[(0,R.jsx)("div",{className:"mb-3 col-12 col-sm-6 col-md-4 col-lg-4 col-xl-4 col-xxl-3",children:(0,R.jsx)(L.V,{className:"py-2",height:"2rem"})}),(0,R.jsx)("div",{className:"col-12"}),(0,R.jsx)("div",{className:"mb-3 col-12 col-sm-6 col-md-4 col-lg-4 col-xl-4 col-xxl-3",children:(0,R.jsx)(L.V,{className:"py-2 delay-1",height:"5rem"})}),(0,R.jsx)("div",{className:"mb-3 col-12 col-sm-6 col-md-4 col-lg-4 col-xl-4 col-xxl-3",children:(0,R.jsx)(L.V,{className:"py-2 delay-2",height:"5rem"})}),(0,R.jsx)("div",{className:"mb-3 col-12 col-sm-6 col-md-4 col-lg-4 col-xl-4 col-xxl-3",children:(0,R.jsx)(L.V,{className:"py-2 delay-3",height:"5rem"})}),(0,R.jsx)("div",{className:"mb-3 col-12 col-sm-6 col-md-4 col-lg-4 col-xl-4 col-xxl-3",children:(0,R.jsx)(L.V,{className:"py-2 delay-4",height:"5rem"})}),(0,R.jsx)("div",{className:"mb-3 col-12 col-sm-6 col-md-4 col-lg-4 col-xl-4 col-xxl-3",children:(0,R.jsx)(L.V,{className:"py-2 delay-5",height:"5rem"})})]})})},P=(0,u.Zt)(v());i(5710);var M=function(){var e=(0,p.useLang)(),a=(0,l.useState)([]),i=(0,c.Z)(a,2),t=i[0],n=i[1],o=new Date,s=new Date(o.getFullYear(),0,1),d=new Date(o.getFullYear(),11,31),r=(0,l.useState)(""),h=(0,c.Z)(r,2),v=(h[0],h[1],D()),f=(0,c.Z)(v,2),x=f[0],j=f[1];(0,l.useEffect)((function(){var e,a,i,t;(0,m.iY)(j.status)&&((null===j||void 0===j||null===(e=j.data)||void 0===e||null===(a=e.items)||void 0===a?void 0:a.length)>0&&n(null===j||void 0===j||null===(i=j.data)||void 0===i||null===(t=i.items)||void 0===t?void 0:t.map((function(e){return{start:new Date(e.fecha+"T00:00:00"),end:new Date(e.fecha+"T00:00:00"),title:e.descripcion,fecha:(0,G.Fe)(e.fecha)}}))))}),[j]);var g=(0,l.useCallback)((function(e){var a=e.start,i=e.end,t=e.title,n=String((0,m.iG)(new Date(a))||"");
1T({start:a,end:i,startinputdate:n,descripcion:t,action:"EDIT",fecha:n})}),[n]),b=(0,l.useCallback)((function(e){var a=e.start,i=e.end,n=(e.title,String((0,m.iG)(new Date(a))||""));null!==t&&void 0!==t&&t.find((function(e){return e.fecha===n}))||T({start:a,end:i,startinputdate:n,fecha:n,action:"CREATE"})}),[n,t]),E=(0,l.useState)({value:!1,payload:{}}),N=(0,c.Z)(E,2),A=N[0],Z=N[1],T=function(e){return Z({value:!0,payload:e})};return(0,l.useEffect)((function(){x({body:{fecha_desde:(0,m.iG)(s),fecha_hasta:(0,m.iG)(d),limit:100}})}),[]),(0,R.jsx)("div",{children:j.loading?(0,R.jsx)(F,{}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("h5",{className:"mb-3",children:e("DIAS_FESTIVOS")}),(0,R.jsx)(u.f,{localizer:P,events:t,startAccessor:"start",endAccessor:"end",style:{height:500},onSelectEvent:g,onSelectSlot:b,messages:{week:"Setmana",work_week:"Setmana de treball",day:"Dia",month:"Mes",previous:"<",next:">",today:"Avui",agenda:"El Diari",showMore:function(e){return"+".concat(e," m\xe9s")}},views:{month:!0},culture:"ca",selectable:!0}),(0,R.jsx)(w,{showModal_Evento:A,handleCloseModal_Evento:function(){return Z({value:!1,payload:{}})},handleShowModal_Evento:T,fetchSuccess:x,setEvents:n,events:t})]})})},k=function(){var e={dias_festivos:{title:(0,p.useLang)()("DIAS_FESTIVOS"),link:"dias-festivos"}};return(0,R.jsx)("div",{className:"container-fluid",children:(0,R.jsxs)("div",{className:"row",children:[(0,R.jsx)("div",{className:"col-12",children:(0,R.jsx)("div",{className:"d-flex justify-content-between align-items-center mb-1 Nav-top-DAPcon",children:(0,R.jsx)(d.i,{BreadcrumbLineItems:[{title:"Parametros",link:"/parametros"}]})})}),(0,R.jsx)("div",{className:"col-lg-3 mb-4",children:(0,R.jsx)(r.J,{values:e})}),(0,R.jsx)("div",{className:"col-lg-9 animate__animated animate__fadeInUp",children:(0,R.jsx)("div",{className:"p-2 card shadow-sm mt-4",children:(0,R.jsxs)(t.Z5,{children:[(0,R.jsx)(t.AW,{path:"dias-festivos",element:(0,R.jsx)(M,{})}),(0,R.jsx)(t.AW,{path:"*",element:(0,R.jsx)(t.Fg,{to:"dias-festivos",replace:!0})})]})})})]})})},V=i(3605),Y=i(2469),U=i(5983),B=(i(8838),i(6202),i(3342),i(5094),i(594),i(1182),i(1228),i(1108),i(7711),i(1207),function(){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("div",{className:"col-12 mb-4",children:(0,R.jsx)(L.V,{className:"py-2",height:"2rem"})}),(0,R.jsx)("div",{className:"col-12 mb-4",children:(0,R.jsx)(L.V,{className:"py-2",height:"2rem"})}),(0,R.jsx)("div",{className:"col-12 col-sm-6 col-lg-5 col-xl-4 mb-4",children:(0,R.jsx)(L.V,{className:"py-2",height:"2rem"})}),(0,R.jsx)("div",{className:"col-12 col-sm-6 col-lg-5 col-xl-4 mb-4",children:(0,R.jsx)(L.V,{className:"py-2",height:"2rem"})}),(0,R.jsx)("div",{className:"col-12 col-sm-12 col-lg-12 col-xl-10 mb-4",children:(0,R.jsx)(L.V,{className:"py-2",height:"2rem"})}),(0,R.jsx)("div",{className:"col-xl-8 mb-4",children:(0,R.jsx)(L.V,{className:"py-2",height:"8rem"})}),(0,R.jsx)("div",{className:"col-xl-4 mb-4",children:(0,R.jsx)(L.V,{className:"py-2",height:"4rem"})})]})}),H=i(2545),z=i(8659),W={GET:{receive:{schema:function(e){var a,i;return e||(e={}),{id:e.idproducto||"",adjuntos:e.adjuntos||[],fechaalta:e.fechaalta||"",fechabaja:e.fechabaja||"",idiomas:e.idiomas||[],idtienda:e.idtienda||"",logfecha:e.logfecha||"",logidpersona:e.logidpersona||"",producto:e.producto||"",rutaimagen:e.rutaimagen||"",rutaproducto:e.rutaproducto||"",tipoproducto:e.tipoproducto||"",descripcionidioma:null===(a=e.idiomas)||void 0===a||null===(i=a[0])||void 0===i?void 0:i.descripcionidioma,modelo:e.modelo||"",diasminimos:e.diasminimos||0,diasmaximos:e.diasmaximos||0,url_imagen:e.url_imagen||""}},adapter:function(e){var a,i=null===e||void 0===e||null===(a=e.data)||void 0===a?void 0:a.data,t=this.schema(i);return{data:(0,x.Z)({},t),status:null===e||void 0===e?void 0:e.status}}}},POST:{receive:{schema:function(e){return e||(e={}),{data:e.data,message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){return e||(e={}),{producto:e.producto||"",productoidioma:e.productoidioma||[],modelo:e.modelo||"",diasminimos:e.diasminimos||0,diasmaximos:e.diasmaximos||0}},adapter:function(e){var a=this.schema(e);return(0,x.Z)({},a)}}},PATCH:{receive:{schema:function(e){return e||(e={}),{data:e.data,message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){return e||(e={}),{producto:e.producto||"",productoidioma:e.productoidioma||[],modelo:e.modelo||"",tipoproducto:e.tipoproducto||"",diasminimos:e.diasminimos||0,diasmaximos:e.diasmaximos||0}},adapter:function(e){var a=this.schema(e);return(0,x.Z)({},a)}}},DELETE:{receive:{schema:function(e){return e||(e={}),{message:e.message||"",status:e.status||""}},adapter:function(e){var a,i=null===e||void 0===e||null===(a=e.data)||void 0===a?void 0:a.data,t=this.schema(i);return{data:(0,x.Z)({},t),status:null===e||void 0===e?void 0:e.status}}}},DELETE_BAJA:{receive:{schema:function(e){return e||(e={}),{message:e.message||"",status:e.status||""}},adapter:function(e){var a,i=null===e||void 0===e||null===(a=e.data)||void 0===a?void 0:a.data,t=this.schema(i);return{data:(0,x.Z)({},t),status:null===e||void 0===e?void 0:e.status}}}},POST_IMAGEN:{receive:{schema:function(e){return e||(e={}),{data:e.data,message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){return e||(e={}),{img:e.img||""}},adapter:function(e){var a=this.schema(e);return(0,G.Ex)(a)}}},DELETE_IMAGE:{receive:{schema:function(e){return e||(e={}),{message:e.message||"",status:e.status||""}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data,i=this.schema(a);return{data:(0,x.Z)({},i),status:null===e||void 0===e?void 0:e.status}}}}},q=function(){return(0,Z.b)({method:"get",url:"/slam/producto",type:"json",adapters:W.GET})},X=function(){return(0,Z.b)({method:"post",url:"/slam/producto",type:"json",adapters:W.POST})},J=function(e){return(0,Z.b)({method:"patch",url:"/slam/producto/".concat(e,"/update"),type:"json",adapters:W.PATCH})},Q=function(e){return(0,Z.b)({method:"DELETE",url:"/slam/producto/baja/".concat(e),type:"json",adapters:W.DELETE_BAJA})},$=function(e){return(0,Z.b)({method:"post",url:"/slam/img/".concat(e),type:"json",adapters:W.POST_IMAGEN})},K=function(e){return(0,Z.b)({method:"delete",url:"/slam/producto/delete/img/".concat(e),type:"json",adapters:W.GET})},ee=i(9669),ae=function(e){var a=e.idaparato,i=e.nuevo,s=e.formAparato,d=e.handleInputChangeAparato,r=e.handleFormChangeAparato,u=e.fetchAparatoGETData,h=e.fetchParamsIdiomasData,v=(0,p.useLang)(),f=((0,l.useRef)(null),(0,t.s0)()),j=(0,A.n)({producto:{isOk:!0,msgError:[v("ALERT_OBLIGATORIO_GENER
1ICO")]},descripcionidioma:{isOk:!0,msgError:[v("ALERT_OBLIGATORIO_GENERICO")]}}),N=(0,c.Z)(j,3),Z=N[0],T=N[1],y=(N[2],(0,l.useState)({value:!1,payload:{}})),D=(0,c.Z)(y,2),_=(D[0],D[1],(0,l.useState)([])),O=(0,c.Z)(_,2),I=O[0],S=O[1],w=(0,l.useState)({value:!1,payload:null}),G=(0,c.Z)(w,2),L=G[0],F=G[1],P=$(a),M=(0,c.Z)(P,2),k=M[0],W=(M[1],K(a)),q=(0,c.Z)(W,2),ae=q[0],ie=(q[1],X()),te=(0,c.Z)(ie,2),ne=te[0],oe=te[1];(0,l.useEffect)((function(){if((0,m.iY)(oe.status)){var e,a,i=null===(e=oe.data)||void 0===e||null===(a=e.data)||void 0===a?void 0:a.idproducto;f("/alquiler-aparatos-admin/aparatos/".concat(i))}}),[oe]);var se=J(a),de=(0,c.Z)(se,2),re=de[0],ce=de[1],le=Q(a),ue=(0,c.Z)(le,2),me=ue[0],he=ue[1],ve=(0,l.useState)(!1),pe=(0,c.Z)(ve,2),fe=pe[0],xe=pe[1];(0,l.useEffect)((function(){(0,m.iY)(he.status)&&(xe(!1),f("/alquiler-aparatos-admin/aparatos"))}),[he]);return(0,R.jsxs)("div",{className:"animate__animated animate__fadeInUp",children:[(0,R.jsx)("div",{className:"px-4 py-3 card mb-4",children:u.loading?(0,R.jsx)("div",{className:"card p-3",children:(0,R.jsx)(B,{})}):(0,R.jsx)(R.Fragment,{children:(0,R.jsxs)("div",{className:"row",children:[(0,R.jsx)("div",{className:"col-lg-8",children:(0,R.jsxs)("div",{className:"row",children:[(0,R.jsx)(g.Z.Group,{className:"col-12  mb-4",children:(0,R.jsx)(E.o,{label:"".concat(v("NOMBRE"),":"),name:"producto",value:s.producto,onChange:d,validation:Z})}),(0,R.jsxs)(g.Z.Group,{className:"col-12 mb-4",children:[(0,R.jsx)(g.Z.Label,{className:"fw-500",children:"".concat(v("DESCRIPCION"),":")}),(0,R.jsx)(U.M,{init:{skin:!1,branding:!1,content_css:!1,height:500,menubar:!1,plugins:["link image","table paste","code","lists"],toolbar:"undo redo | formatselect | bold italic underline backcolor forecolor | alignleft aligncenter alignright al
1ignjustify | bullist numlist outdent indent | removeformat | help code"},value:s.descripcionidioma,onEditorChange:function(e){d({target:{name:"descripcionidioma",value:e}})}}),(0,R.jsx)(ee.T,{obj:Z,name:"descripcionidioma"})]})]})}),(0,R.jsx)("div",{className:"col-lg-4",children:(0,R.jsxs)("div",{className:"row",children:[(0,R.jsx)(g.Z.Group,{className:"col-12  mb-4",children:(0,R.jsx)(E.o,{label:"".concat(v("MODELO"),":"),name:"modelo",value:s.modelo,onChange:d,validation:Z})}),(0,R.jsxs)(g.Z.Group,{className:"mb-3 col-12",children:[(0,R.jsx)(g.Z.Label,{className:"fw-500",children:"".concat(v("IMAGEN"),":")}),i?(0,R.jsx)(Y.Z,{variant:"danger",className:"mb-0 p-3 text-center",children:(0,R.jsx)("small",{children:v("ALERT_OPCION_DISPONIBLE_LUEGO_CREAR_APARATO")})}):(0,R.jsx)(H.Z,{width:"100%",height:"13rem",onChange:function(e){var a;e.target.files.length>0&&(a=e.target.files[0],F({value:!0,payload:a}))},InputFile:I,setInputFile:S,urlImage:s.url_imagen,handleEliminarImagen:function(){return"nuevo"!==a&&ae(),void r((0,x.Z)((0,x.Z)({},s),{},{url_imagen:""}))}})]})]})}),(0,R.jsx)("div",{className:"col-12",children:(0,R.jsx)("h5",{className:"h6 border-bottom pb-2 mb-3",children:v("CONDICIONES")})}),(0,R.jsx)(g.Z.Group,{className:"col-md-6 col-lg-4 mb-4",children:(0,R.jsx)(E.o,{label:v("DIAS_MINIMOS")+":",name:"diasminimos",value:s.diasminimos,onChange:d,validation:Z,type:"number"})}),(0,R.jsx)(g.Z.Group,{className:"col-md-6 col-lg-4 mb-4",children:(0,R.jsx)(E.o,{label:v("DIAS_MAXIMOS")+":",name:"diasmaximos",value:s.diasmaximos,onChange:d,validation:Z,type:"number"})}),(0,R.jsx)("div",{className:"col-12 mt-4 pt-3 d-flex justify-content-between border-top",children:i?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("div",{}),(0,R.jsx)(b.X,{variant:"secondary",type:"button",className:"",handleSubmit:function(){var e,a;T(s)&&ne({body:(0,x.Z)((0,x.Z)({},s),{},{productoidioma:[{ididioma:null===(e=h.data)||void 0===e||null===(a=e[0])||void 0===a?void 0:a.id,descripcionidioma:s.descripcionidioma,productoidioma:s.producto}]})})},fetchDataLoading:[oe.loading],value:v("GUARDAR"),icon:(0,R.jsx)(n.G,{icon:o.r6l,className:"me-1"})})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(b.X,{variant:"danger",type:"button",className:"",handleSubmit:function(){return xe(!0)},fetchDataLoading:[!1],value:v("DAR_DE_BAJA"),icon:(0,R.jsx)(n.G,{icon:o.$aW,className:"me-1"})}),(0,R.jsx)(b.X,{variant:"secondary",type:"button",className:"",handleSubmit:function(){var e,a,i,t;re({body:(0,x.Z)((0,x.Z)({},s),{},{productoidioma:[{ididioma:null===(e=h.data)||void 0===e||null===(a=e[0])||void 0===a?void 0:a.id,descripcionidioma:s.descripcionidioma,productoidioma:s.producto,idproductoidioma:null===(i=s.idiomas)||void 0===i||null===(t=i[0])||void 0===t?void 0:t.idproductoidioma}]})})},fetchDataLoading:[ce.loading],value:v("GUARDAR"),icon:(0,R.jsx)(n.G,{icon:o.r6l,className:"me-1"})})]})})]})})}),(0,R.jsx)(V.W,{handleClose:function(){return xe(!1)},show:fe,onClickOK:function(){me()},messageHTML:(0,R.jsx)("h5",{className:"text-center fw-normal",children:v("PARRAFO_SEGURO_ELIMINAR_ELEMENTO")}),textOnClickOk:"S\xed, eliminar",fetchData:he}),(0,R.jsx)(z.c,{show:L,handleClose:function(){return F({value:!1,payload:null})},height:"500px",setInputFile:S,handleSubirImagen:function(e,a){k({body:{img:a}})},tipo:"fotografia",escalas:[{x:10,y:10,label:"Cuadrado"}]}),(0,R.jsx)(C.D,{fetchData:oe}),(0,R.jsx)(C.D,{fetchData:ce})]})},ie=i(4942),te=i(4569),ne=i.n(te),oe=i(8825),se=i(2859),de=i(3360),re=i(2591),ce=i(2307),le=i(7612),ue=i(4426),me={GET:{receive:{schema:function(e){return e||(e={}),{id:e.idproductotarifa||"",idevento:e.idevento||"",idiva:e.idiva||"",idserviciolinea:e.idserviciolinea||"",importe:e.importe||"",label__importe:e.precio+" \u20ac"||0,importeiva:e.importeiva||"",label__importeiva:e.importeiva+" \u20ac"||0,precio:e.precio||"",tarifa:e.tarifa||"",tarifaaplicadaa:e.tarifaaplicadaa||"",diasprecios:e.dias_precios||[]}},adapter:function(e){var a,i,t=this,n=null===e||void 0===e||null===(a=e.data)||void 0===a?void 0:a.data;return{data:{items:null===n||void 0===n||null===(i=n.data)||void 0===i?void 0:i.map((function(e){return t.schema(e)}))},status:null===e||void 0===e?void 0:e.status}}}},POST:{receive:{schema:function(e){return e||(e={}),{data:e.data,message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){return e||(e={}),{idproducto:e.idproducto||"",idserviciolinea:e.idserviciolinea||"",tarifa:e.tarifa||"",tarifaaplicadaa:e.tarifaaplicadaa||"",precio:e.precio||"",idiva:e.idiva||"",importeiva:e.importeiva||"",importe:e.importe||"",diasprecios:e.diasprecios||[]}},adapter:function(e){var a=this.schema(e);return(0,x.Z)({},a)}}},PATCH:{receive:{schema:function(e){return e||(e={}),{data:e.data,message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){return e||(e={}),{idproductotarifa:e.id||"",idproducto:e.idproducto||"",idserviciolinea:e.idserviciolinea||"",tarifa:e.tarifa||"",tarifaaplicadaa:e.tarifaaplicadaa||"",precio:e.precio||"",idiva:e.idiva||"",importeiva:e.importeiva||"",importe:e.importe||"",diasprecios:e.diasprecios||[]}},adapter:function(e){var a=this.schema(e);return(0,x.Z)({},a)}}},DELETE:{receive:{schema:function(e){return e||(e={}),{message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}}}},he=function(e){return(0,Z.b)({method:"get",url:"/slam/productos-tarifas/".concat(e,"/show"),type:"json",adapters:me.GET})},ve=function(){return(0,Z.b)({method:"get",url:"/slam/productos-tarifas",type:"json",adapters:me.GET})},pe=function(){return(0,Z.b)({method:"post",url:"/slam/productos-tarifas/create",type:"json",adapters:me.POST})},fe=function(e){return(0,Z.b)({method:"patch",url:"/slam/productos-tarifas/".concat(e,"/update"),type:"json",adapters:me.PATCH})},xe=function(e){return(0,Z.b)({method:"delete",url:"/slam/productos-tarifas/".concat(e,"/delete"),type:"json",adapters:me.DELETE})},je=i(4424),ge=function(e){var a,i,t,s,d,r,u,h,v,Z,T=e.showModal_Documento,y=e.handleCloseModal_Documento,D=(e.fetchPersonaDatosEconomicosGET,e.urlParam
1s,e.fetchTarifasGET),_=e.list,O=(0,p.useLang)(),I=((0,l.useRef)(null),se.FP.GET()),w=(0,A.n)({tarifa:{isOk:!0,msgError:[O("ALERT_OBLIGATORIO_GENERICO")]},precio:{isOk:!0,msgError:[O("ALERT_OBLIGATORIO_GENERICO")]}}),G=(0,c.Z)(w,3),L=G[0],F=G[1],P=G[2],M=je.t.GET(),k=(0,c.Z)(M,2),V=k[0],U=k[1],H=ue.b.GET(),z=(0,c.Z)(H,2),W=z[0],q=z[1],X=(0,N.c)((0,x.Z)({},me.GET.receive.schema({}))),J=(0,c.Z)(X,4),Q=J[0],$=J[1],K=J[2],ee=J[3],ae=pe(),te=(0,c.Z)(ae,2),ne=te[0],oe=te[1];(0,l.useEffect)((function(){(0,m.iY)(oe.status)&&(D(),y())}),[oe]);var he=fe(null===(a=T.payload)||void 0===a||null===(i=a.form)||void 0===i?void 0:i.id),ve=(0,c.Z)(he,2),ge=ve[0],be=ve[1];(0,l.useEffect)((function(){(0,m.iY)(be.status)&&(D(),y())}),[be]);var Ee=xe(null===(t=T.payload)||void 0===t||null===(s=t.form)||void 0===s?void 0:s.id),Ne=(0,c.Z)(Ee,2),Ae=Ne[0],Ze=Ne[1];(0,l.useEffect)((function(){(0,m.iY)(Ze.status)&&(D(),y())}),[Ze]);var Te=(0,l.useState)([]),ye=(0,c.Z)(Te,2),De=ye[0],_e=ye[1];(0,l.useEffect)((function(){T.value?function(){var e,a,i,t,n;(U.data||V({params:{status:"activos"}}),q.data||W({params:{limit:200,codigo:"slam"}}),null!==(e=T.payload)&&void 0!==e&&e.form)&&(K((0,x.Z)({},null===(a=T.payload)||void 0===a?void 0:a.form)),Le(null===(i=T.payload)||void 0===i||null===(t=i.form)||void 0===t||null===(n=t.diasprecios)||void 0===n?void 0:n.map((function(e){return{dia:e.dia,precio:e.precio,idproductotarifa:e.idproductotarifa}}))));for(var o=(0,m.QM)(I),s=[],d=function(e){var a,i;null!==_&&void 0!==_&&_.find((function(a){return a.tarifaaplicadaa===o[e].id}))&&(null===(a=T.payload)||void 0===a||null===(i=a.form)||void 0===i?void 0:i.tarifaaplicadaa)!==o[e].id||s.push(o[e])},r=0;r<o.length;r++)d(r);_e(s)}():(ee(),P(),Le([]))}),[T.value]);var Oe=le.L.GET(),Ie=(0,c.Z)(Oe,2),Ce=Ie[0],Se=Ie[1];(0,l.useEffect)((function(){var e;4===(null===(e=Q.codbanco)||void 0===e?void 0:e.length)?Ce({params:{codbanco:Q.codbanco}}):K((0,x.Z)((0,x.Z)({},Q),{},{idbanco:""}))}),[Q.codbanco]),(0,l.useEffect)((function(){var e,a,i;K((0,x.Z)((0,x.Z)({},Q),{},{idbanco:(null===(e=Se.data)||void 0===e||null===(a=e.items)||void 0===a||null===(i=a[0])||void 0===i?void 0:i.id)||""}))}),[Se]);(0,l.useLayoutEffect)((function(){if(T.value){var e,a,i,t=(null===U||void 0===U||null===(e=U.data)||void 0===e||null===(a=e.items)||void 0===a?void 0:a.find((function(e){return e.id===Q.idiva})))||{},n=Number(null===t||void 0===t?void 0:t.porcentajeiva),o=Number(Q.precio),s=o*n/100||0;K((0,x.Z)((0,x.Z)({},Q),{},{importeiva:s.toFixed(2),importe:null===(i=o+Number(s.toFixed(2)))||void 0===i?void 0:i.toFixed(2),porcentajeiva:n}))}}),[Q.precio,Q.idiva,U,T.value]);var Re=(0,l.useState)([]),we=(0,c.Z)(Re,2),Ge=we[0],Le=we[1],Fe=function(e,a,i){var t=(0,S.cloneDeep)(Ge);t[e]=(0,x.Z)((0,x.Z)({},t[e]),{},(0,ie.Z)({},a,i)),Le(t)};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(j.Z,{show:T.value,onHide:y,size:"lg",id:"ModalRegistro",children:[(0,R.jsxs)(j.Z.Header,{className:"border-bottom-0 py-4",children:[(0,R.jsx)(j.Z.Title,{className:"h5",children:"EDIT"===(null===(d=T.payload)||void 0===d?void 0:d.action)?O("EDITAR_TARIFA"):O("NUEVA_TARIFA")}),(0,R.jsx)("button",{type:"button",className:"btn-close mx-0","aria-label":"Close",onClick:y})]}),q.loading||U.loading?(0,R.jsx)("div",{className:"p-3",children:(0,R.jsx)(B,{})}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(j.Z.Body,{className:"px-4 py-0",children:(0,R.jsxs)(g.Z,{className:"row",children:[(0,R.jsxs)(g.Z.Group,{className:"mb-3 col-12",children:[(0,R.jsx)(E.o,{label:O("TARIFA")+": *",name:"tarifa",value:Q.tarifa,onChange:$,validation:L,fetchData:"EDIT"===T.payload.action?be:oe}),(0,R.jsxs)("small",{className:"opacity-75",children:[O("P_MENSAJE_PUBLICO"),"."]})]}),(0,R.jsx)(g.Z.Group,{className:"mb-3 col-12 col-sm-6 col-md-6 col-lg-6 col-xl-6 col-xxl-6",children:(0,R.jsx)(ce.J,{label:"".concat(O("SERVICIO_LINEA"),": *"),name:"idserviciolinea",value:Q.idserviciolinea,onChange:function(e){var a,i,t,n=(null===q||void 0===q||null===(a=q.data)||void 0===a||null===(i=a.items)||void 0===i?void 0:i.find((function(a){var i;return a.id===(null===(i=e.target)||void 0===i?void 0:i.value)})))||{};K((0,x.Z)((0,x.Z)({},Q),{},(0,ie.Z)({idiva:(null===n||void 0===n||null===(t=n.iva)||void 0===t?void 0:t.idiva)||""},e.target.name,e.target.value)))},values:null===(r=q.data)||void 0===r||null===(u=r.items)||void 0===u?void 0:u.map((function(e){return{id:e.id,nombre:e.serviciolinea}})),fetchData:"EDIT"===T.payload.action?be:oe,validation:L})}),(0,R.jsx)(g.Z.Group,{className:"mb-3 col-12 col-sm-6 col-md-6 col-lg-4 col-xl-4 col-xxl-4",children:(0,R.jsx)(ce.J,{label:O("TARIFA_APLICADA_A")+": *",name:"tarifaaplicadaa",value:Q.tarifaaplicadaa,onChange:$,values:De,fetchData:"EDIT"===T.payload.action?be:oe,validation:L})}),(0,R.jsx)(g.Z.Group,{className:"mb-3 col-12 col-sm-6 col-md-6 col-lg-4 col-xl-4 col-xxl-4",children:(0,R.jsx)(ce.J,{label:"IVA:",name:"idiva",value:Q.idiva,onChange:$,values:(null===(h=U.data)||void 0===h||null===(v=h.items)||void 0===v?void 0:v.map((function(e){return{nombre:e.iva,id:e.id}})))||[],validation:L,fetchData:"EDIT"===T.payload.action?be:oe})}),(0,R.jsx)(g.Z.Group,{className:"mb-3 col-12 col-sm-6 col-md-6 col-lg-4 col-xl-4 col-xxl-4",children:(0,R.jsx)(E.o,{label:O("PRECIO")+":",name:"precio",type:"number",value:Q.precio,onChange:$,validation:L,fetchData:"EDIT"===T.payload.action?be:oe})}),(0,R.jsx)("div",{className:"col-12"}),(0,R.jsx)(g.Z.Group,{className:"mb-3 col-12 col-md-6 col-lg-4",children:(0,R.jsx)(E.o,{label:O("IMPORTE")+":",name:"importe",value:Q.importe+" \u20ac",onChange:$,readonly:!0})}),(0,R.jsx)(g.Z.Group,{className:"mb-3 col-12 col-md-6 col-lg-4",children:(0,R.jsx)(E.o,{label:O("IMPORTE_IVA")+":",name:"importeiva",value:Q.importeiva+" \u20ac",onChange:$,readonly:!0})}),(0,R.jsx)("div",{className:"col-12",children:(0,R.jsx)(Y.Z,{variant:"info",className:"py-2",children:"Si no existeix un dia definit, es far\xe0 servir el preu per defecte"})}),(0,R.jsx)("div",{className:"col-12 mt-2",children:(0,R.jsx)("div",{className:"card p-2 p-lg-4",children:(0,R.jsxs)("div",{className:"row",children:[(0,R.jsx)("div",{className:"col-12 mb-3",children:(0,R.jsx)("div",{className:"d-flex justify-content-end",children:(0,R.jsxs)(de.Z,{variant:"primary",size:"sm",className:"",onClick:function(){var e,a=!0;Ge.length>0&&(a=null===(e=Ge[Ge.length-1])||void 0===e?void 0:e.precio);a&&Le([].concat((0,f.Z)(Ge),[{dia:(null===Ge||void 0===Ge?void 0:Ge.length)+1,precio:""}]))},children:[(0,R.jsx)(n.G,{icon:o.r8p})," ",O("PRECIO_POR_DIA")]})})}),(0,R.jsx)("div",{className:"col-12",children:(0,R.jsxs)(re.Z,{children:[(0,R.jsx)("thead",{children:(0,R.jsxs)("tr",{children:[(0,R.jsx)("th",{children:(0,R.jsx)("small",{children:O("DIA")})}),(0,R.jsx)("th",{children:(0,R.jsx)("small",{children:O("PRECIO")})}),(0,R.jsx)("th",{children:(0,R.jsx)("small",{className:"d-block text-center",children:O("IMPORTE")})}),(0,R.jsx)("th",{children:(0,R.jsx)("small",{className:"d-block text-center",children:O("IMPORTE_IVA")})}),(0,R.jsx)("th",{})]})}),(0,R.jsxs)("tbody",{children:[Ge.map((function(e,a){var i,t,s;return(0,R.jsxs)("tr",{children:[(0,R.jsx)("td",{valign:"middle",children:(0,R.jsx)(g.Z.Group,{className:"col-12",children:(0,R.jsx)(E.o,{name:"dia",value:e.dia,onChange:function(e){return Fe(a,"dia",e.target.value)}})})}),(0,R.jsx)("td",{valign:"middle",children:(0,R.jsx)(g.Z.Group,{className:"col-12",children:(0,R.jsx)(E.o,{name:"precio",value:e.precio,onChange:function(e){return Fe(a,"precio",e.target.value)}})})}),(0,R.jsx)("td",{valign:"middle",children:(0,R.jsx)("div",{className:"mx-4 text-nowrap",children:(0,R.jsx)(E.o,{name:"dia",value:(null===(i=Number(e.precio)+Number(null===(t=Number(Number(e.precio)*Q.porcentajeiva/100))||void 0===t?void 0:t.toFixed(2)))||void 0===i?void 0:i.toFixed(2))+" \u20ac",readonly:!0})})}),(0,R.jsx)("td",{valign:"middle",children:(0,R.jsx)("div",{className:"mx-4 text-nowrap",children:(0,R.jsx)(E.o,{name:"dia",value:(null===(s=e.precio*Q.porcentajeiva/100)||void 0===s?void 0:s.toFixed(2))+" \u20ac",readonly:!0})})}),(0,R.jsx)("td",{className:"text-center shrink-td",children:(0,R.jsx)("div",{className:"m-2",children:(0,R.jsx)(de.Z,{variant:"danger",size:"sm",className:"",onClick:function(){return function(e){var a=(0,S.cloneDeep)(Ge).filter((function(a,i){return i!==e}));Le(a)}(a)},children:(0,R.jsx)(n.G,{icon:o.$aW})})})})]})})),0===Ge.length&&(0,R.jsx)("tr",{children:(0,R.jsx)("td",{colSpan:20,className:"text-center py-5",children:O("PARRAFO_NO_HAY_DATOS_PARA_MOSTRAR")})})]})]})})]})})})]})}),(0,R.jsx)(j.Z.Footer,{className:"border-0 d-flex justify-content-between",children:"CREATE"===(null===(Z=T.payload)||void 0===Z?void 0:Z.action)?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("div",{}),(0,R.jsx)(b.X,{variant:"secondary",type:"submit",className:"me-2",handleSubmit:function(){var e;F(Q)&&ne({body:(0,x.Z)((0,x.Z)({},Q),{},{idproducto:null===(e=T.payload)||void 0===e?void 0:e.idaparato,diasprecios:Ge})})},fetchDataLoading:[oe.loading],value:O("GUARDAR"),icon:(0,R.jsx)(n.G,{icon:o.r6l})})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(b.X,{variant:"danger",type:"submit",className:"ms-2",handleSubmit:function(){Ae()},fetchDataLoading:[Ze.loading],value:O("ELIMINAR"),icon:(0,R.jsx)(n.G,{icon:o.$aW,className:"me-1"})}),(0,R.jsx)(b.X,{variant:"secondary",type:"submit",className:"me-2",handleSubmit:function(){var e;F(Q)&&ge({body:(0,x.Z)((0,x.Z)({},Q),{},{idproducto:null===(e=T.payload)||void 0===e?void 0:e.idaparato,diasprecios:Ge})})},fetchDataLoading:[be.loading],value:O("GUARDAR"),icon:(0,R.jsx)(n.G,{icon:o.r6l})})]})})]})]}),(0,R.jsx)(C.D,{fetchData:oe}),(0,R.jsx)(C.D,{fetchData:Ze}),(0,R.jsx)(C.D,{fetchData:be})]})},be=function(e){var a=e.data,i=e.loading,t=e.total,s=e.perPage,d=e.handleFormChange,r=e.formValuesSearch,u=e.setdataExcluidos,m=(e.setimportesChangeList,e.importesChangeList,e.checkAll),h=(e.setCheckAll,e.setIncluidos),v=e.setExcluidos,f=e.excluidos,x=e.incluidos,j=(e.handleInputChangeSearch,e.urlParam
1s,e.idevento,e.fetchTarifasGET),g=e.idaparato,b=(0,p.useLang)(),E=se.FP.GET(),N=[{label:(0,R.jsxs)("span",{className:"me-2",children:[(0,R.jsx)(n.G,{icon:o.r8p,className:"me-2"}),b("NUEVA_TARIFA")]}),variant:"primary",action:function(){return L({action:"CREATE",idaparato:g})}}],A=[{label:(0,R.jsx)(n.G,{icon:o.FL8,className:""}),action:function(e){return L({form:e,action:"EDIT",idaparato:g})},withoutID:!0}];(0,l.useEffect)((function(){u(f)}),[f]);var Z=[(0,R.jsx)("small",{children:b("TARIFA")}),(0,R.jsx)("small",{children:b("TARIFA_APLICADA_A")}),(0,R.jsx)("small",{children:b("IMPORTE_POR_DEFECTO")}),""],T=[{className:"",name:"tarifa"},{className:"",name:"tarifaaplicadaa",adapter:E},{className:"",name:"label__importe"}],y=(0,l.useState)({data:null,loading:null,error:null,status:null}),D=(0,c.Z)(y,2),_=D[0],O=D[1],I=(0,l.useRef)(!0);(0,l.useEffect)((function(){return function(){I.current=!1}}),[]);(0,l.useEffect)((function(){if(_.data){var e,a,i,t=_.data,n=null===t||void 0===t||null===(e=t.headers)||void 0===e||null===(a=e["content-disposition"])||void 0===a||null===(i=a.split("filename="))||void 0===i?void 0:i[1],o=null===t||void 0===t?void 0:t.data,s=new Blob([o]),d=new Date,r=window.URL.createObjectURL(s),c=document.createElement("a");c.href=r,c.setAttribute("download","".concat(d.getDate(),"/").concat(d.getMonth()+1,"/").concat(d.getFullYear(),"_").concat(n)),document.body.appendChild(c),c.click(),c.parentNode.removeChild(c),O({data:null,loading:!0,error:null,status:null})}}),[_]);var C=(0,l.useState)({value:!1,payload:{}}),S=(0,c.Z)(C,2),w=S[0],G=S[1],L=function(e){return G({value:!0,payload:e})};return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(oe.Z,{children:[(0,R.jsx)(oe.Z.Head,{title:b("NUEVA_TARIFA"),allActions:N}),(0,R.jsx)(oe.Z.Body,{headers:Z,dataLineTable:T,data:a,isLoading:i,excluidos:f,incluidos:x,setExcluidos:v,setIncluidos:h,checkAll:m,allActionsPerLine:A,checkMultiples:!1}),(0,R.jsx)(oe.Z.Footer,{total:t,handleFormChange:d,formValuesSearch:r,perPage:s})]}),(0,R.jsx)(ge,{showModal_Documento:w,handleCloseModal_Documento:function(){return G({value:!1,payload:{}})},fetchTarifasGET:j,list:a})]})},Ee=function(e){e.formData;var a,i,t,n,o=e.idaparato,s=e.fetchAparatoGETData,d=(0,p.useLang)(),r=(0,N.c)({page:1,limit:"",order:"",idserviciolinea:"",fecharegistrodesde:"",fecharegistrohasta:"",solo_pendientes:""}),u=(0,c.Z)(r,4),h=u[0],v=u[1],f=u[2],j=(u[3],(0,l.useState)([])),g=(0,c.Z)(j,2),b=g[0],E=g[1],Z=(0,l.useState)([]),T=(0,c.Z)(Z,2),y=T[0],D=T[1],_=(0,l.useState)(!1),O=(0,c.Z)(_,2),I=O[0],C=O[1],S=(0,N.c)({}),w=(0,c.Z)(S,4),G=(w[0],w[1],w[2]),L=(w[3],(0,A.n)({descripcion:{isOk:!0,msgError:[d("ALERT_OBLIGATORIO_GENERICO")]}})),F=(0,c.Z)(L,3),P=(F[0],F[1],F[2],he(o)),M=(0,c.Z)(P,2),k=M[0],V=M[1];(0,l.useEffect)((function(){k()}),[]),(0,l.useEffect)((function(){(0,m.iY)(V.status)&&G((0,x.Z)({},V.data))}),[V]);var U=(0,l.useState)([]),H=(0,c.Z)(U,2),z=(H[0],H[1]);return(0,R.jsx)("div",{children:V.loading||s.loading?(0,R.jsx)("div",{className:"card p-3 mt-3 ",children:(0,R.jsx)(B,{})}):(0,R.jsx)(R.Fragment,{children:"true"!==(null===s||void 0===s||null===(a=s.data)||void 0===a?void 0:a.gratuito)?(0,R.jsx)("div",{className:"row mt-3 mb-3",children:(0,R.jsx)("div",{className:"col-12",children:(0,R.jsx)(be,{data:null===(i=V.data)||void 0===i?void 0:i.items,loading:V.loading,total:null===(t=V.data)||void 0===t?void 0:t.total,perPage:null===(n=V.data)||void 0===n?void 0:n.per_page,formValuesSearch:h,handleFormChange:f,handleInputChangeSearch:v,setdataExcluidos:z,checkAll:I,setCheckAll:C,setIncluidos:D,setExcluidos:E,excluidos:b,incluidos:y,urlParam
1s:(0,m.Lw)(h),fetchTarifasGET:k,idaparato:o})})}):(0,R.jsx)(Y.Z,{variant:"info",className:"mt-3 text-center",children:"Nom\xe9s podeu afegir tarifes a un esdeveniment no gratu\xeft"})})})},Ne={GET:{receive:{schema:function(e){var a,i,t;return e||(e={}),{id:e.idpedido||"",numeropedido:e.numeropedido||"",fechapedido:(0,G.Nc)((0,G.Fe)(e.fechapedido)),idpersona:e.idpersona||"",idpersonaentidad:e.idpersonaentidad||"",estado:e.estado||"",abona:e.abona||"",fechadesde:(0,G.Nc)((0,G.Fe)(e.fechadesde)),fechahasta:(0,G.Nc)((0,G.Fe)(e.fechahasta)),fechaentrega:(0,G.Nc)((0,G.Fe)(e.fechaentrega)),destinatarioenvio:e.destinatarioenvio||"",direccionenvio:e.direccionenvio||"",observacionesenvio:e.observacionesenvio||"",municipioenvio:e.municipioenvio||"",idpaisenvio:e.idpaisenvio||"",idprovinciaenvio:e.idprovinciaenvio||"",cpenvio:e.cpenvio||"",titularcuenta:e.titularcuenta||"",idbanco:e.idbanco||"",sucursal:e.sucursal||"",digitocontrol:e.digitocontrol||"",cuentacorriente:e.cuentacorriente||"",iban:e.iban||"",observaciones:e.observaciones||"",idsolicitud:e.idsolicitud||"",idcondicionpago:e.idcondicionpago||"",porcentajedescuento:e.porcentajedescuento||"",importetotal:e.importetotal||"",email:e.email||"",facturado:e.facturado||"",producto:(null===(a=e.pedidos_productos)||void 0===a||null===(i=a[0])||void 0===i||null===(t=i.producto)||void 0===t?void 0:t.producto)||"",nombrepersona:e.nombrepersona||""}},adapter:function(e){var a,i,t=this,n=null===e||void 0===e||null===(a=e.data)||void 0===a?void 0:a.data,o=null===n||void 0===n||null===(i=n.data)||void 0===i?void 0:i.map((function(e){return t.schema(e)}));return{data:{total:null===n||void 0===n?void 0:n.total,per_page:null===n||void 0===n?void 0:n.per_page,current_page:null===n||void 0===n?void 0:n.current_page,items:o},status:null===e||void 0===e?void 0:e.status}}}},GET_CHECK_DISPONIBILIDAD:{receive:{schema:function(e){return e||(e={}),{data:e.data,error:e.error,message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){return e||(e={}),{idproducto:e.idproducto||"",fechadesde:e.fechadesde||"",fechahasta:e.fechahasta||"",idpersona:e.idpersona||""}},adapter:function(e){var a=this.schema(e);return(0,x.Z)({},a)}}},GET_TARIFAS_CONDICIONES_PAGO:{receive:{schema:function(e){return e||(e={}),{cantidaddiascobro:e.cantidaddiascobro||"",condicionespagos:e.condicionespagos||{},tarifas:e.tarifas||{},totalimportebase:e.totalimportebase||"",totalimporteiva:e.totalimporteiva||"",totalimportetotal:e.totalimportetotal||"",iva:e.iva||{}}},adapter:function(e){var a,i=null===e||void 0===e||null===(a=e.data)||void 0===a?void 0:a.data;return{data:this.schema(i),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){return e||(e={}),{idproducto:e.idproducto||"",fechadesde:e.fechadesde||"",fechahasta:e.fechahasta||"",idpersona:e.idpersona||""}},adapter:function(e){var a=this.schema(e);return(0,x.Z)({},a)}}},GET_CONDICIONES_PAGO:{receive:{schema:function(e){return e||(e={}),{condicionespagos:e.condicionespagos||{}}},adapter:function(e){var a,i=null===e||void 0===e||null===(a=e.data)||void 0===a?void 0:a.data;return{data:this.schema(i),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){return e||(e={}),{idproducto:e.idproducto||"",fechadesde:e.fechadesde||"",fechahasta:e.fechahasta||"",idpersona:e.idpersona||""}},adapter:function(e){var a=this.schema(e);return(0,x.Z)({},a)}}}},Ae={GET:{receive:{schema:function(e){var a,i,t,n,o;return e||(e={}),{id:e.idpedido||"",condicionpago:e.condicionpago||"",cuentacorriente:e.cuentacorriente||"",digitocontrol:e.digitocontrol||"",email:e.email||"",estado:e.estado||"",facturado:e.facturado||"",facturas:e.facturas||[],fechadesde:(0,G.Fe)(e.fechadesde),fechaentrega:e.fechaentrega||"",fechahasta:(0,G.Fe)(e.fechahasta),fechapedido:e.fechapedido||"",iban:e.iban||"",idbanco:e.idbanco||"",idcondicionpago:e.idcondicionpago||"",idpedido:e.idpedido||"",idpersona:e.idpersona||"",idpersonaentidad:e.idpersonaentidad||"",idsolicitud:e.idsolicitud||"",importetotal:e.importetotal||"",nombrepersona:e.nombrepersona||"",numeropedido:e.numeropedido||"",observaciones:e.observaciones||"",observacionesenvio:e.observacionesenvio||"",porcentajedescuento:e.porcentajedescuento||"",sucursal:e.sucursal||"",titularcuenta:e.titularcuenta||"",abona:e.idpersonaentidad?"
1E":"P",idproducto:(null===(a=e.pedidos_productos)||void 0===a||null===(i=a[0])||void 0===i?void 0:i.idproducto)||"",producto:(null===(t=e.pedidos_productos)||void 0===t||null===(n=t[0])||void 0===n||null===(o=n.producto)||void 0===o?void 0:o.producto)||"",idproductotarifa:e.idproductotarifa||"",pedidos_productos:e.pedidos_productos||[]}},adapter:function(e){var a,i=null===e||void 0===e||null===(a=e.data)||void 0===a?void 0:a.data,t=this.schema(null===i||void 0===i?void 0:i[0]);return{data:(0,x.Z)({},t),status:null===e||void 0===e?void 0:e.status}}}},POST:{receive:{schema:function(e){return e||(e={}),{data:e.data,message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){e||(e={});var a={idproducto:e.idproducto||"",idpersonaentidad:e.idpersonaentidad||"",idpersona:e.idpersona||"",idcondicionpago:e.idcondicionpago||"",idproductotarifa:e.idproductotarifa||"",observacionesenvio:e.observacionesenvio||"",fechadesde:e.fechadesde||"",fechahasta:e.fechahasta||"",comunicar:(0,G.i6)(e.comunicar),facturar:(0,G.i6)(e.facturar),inputtotalimportebase:e.inputtotalimportebase||"0",inputtotalimporteiva:e.inputtotalimporteiva||"0",idiva:e.idiva||""};return a.idpersonaentidad||delete a.idpersonaentidad,a},adapter:function(e){var a=this.schema(e);return(0,x.Z)({},a)}}},PATCH:{receive:{schema:function(e){return e||(e={}),{message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){return e||(e={}),{idproducto:e.idproducto||"",idproductotarifa:e.idproductotarifa||"",idpersonaentidad:e.idpersonaentidad||"",idpersona:e.idpersona||"",idcondicionpago:e.idcondicionpago||"",observacionesenvio:e.observacionesenvio||"",fechadesde:e.fechadesde||"",fechahasta:e.fechahasta||"",comunicar:(0,G.i6)(e.comunicar),inputtotalimportebase:e.inputtotalimportebase||"0",inputtotalimporteiva:e.inputtotalimporteiva||"0",idiva:e.idiva||""}},adapter:function(e){var a=this.schema(e);return(0,x.Z)({},a)}}},PATCH_CAMBIAR_ESTADO:{receive:{schema:function(e){return e||(e={}),{message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){return e||(e={}),{estado:e.estado||"",comunicar:e.comunicar||!1}},adapter:function(e){var a=this.schema(e);return(0,x.Z)({},a)}}},POST_GENERAR_FACTURA:{receive:{schema:function(e){return e||(e={}),{data:e.data,message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){e||(e={});var a={idproducto:e.idproducto||"",idpersonaentidad:e.idpersonaentidad||"",idpersona:e.idpersona||"",idcondicionpago:e.idcondicionpago||"",idproductotarifa:e.idproductotarifa||"",observacionesenvio:e.observacionesenvio||"",fechadesde:e.fechadesde||"",fechahasta:e.fechahasta||"",comunicar:(0,G.i6)(e.comunicar),facturar:(0,G.i6)(e.facturar),idpedido:e.id||""};return a.idpersonaentidad||delete a.idpersonaentidad,a},adapter:function(e){var a=this.schema(e);return(0,x.Z)({},a)}}}},Ze=function(){return(0,Z.b)({method:"get",url:"/slam/pedidos",type:"json",adapters:Ne.GET})},Te=function(){return(0,Z.b)({method:"GET",url:"/slam/pedidos/check-disponibility",type:"json",adapters:Ne.GET_CHECK_DISPONIBILIDAD})},ye=function(){return(0,Z.b)({method:"GET",url:"/slam/pedidos/get-tarifas-condicionespagos",type:"json",adapters:Ne.GET_TARIFAS_CONDICIONES_PAGO})},De=function(e){return(0,Z.b)({method:"get",url:"/slam/pedidos/".concat(e),type:"json",adapters:Ae.GET})},_e=function(){return(0,Z.b)({method:"post",url:"/slam/pedidos-admin/create",type:"json",adapters:Ae.POST})},Oe=function(e){return(0,Z.b)({method:"patch",url:"/slam/pedidos/".concat(e,"/update"),type:"json",adapters:Ae.PATCH})},Ie=function(e){return(0,Z.b)({method:"patch",url:"/slam/pedidos/".concat(e,"/change-state"),type:"json",adapters:Ae.PATCH_CAMBIAR_ESTADO})},Ce=function(){return(0,Z.b)({method:"post",url:"/slam/pedidos/generar-factura",type:"json",adapters:Ae.POST_GENERAR_FACTURA})},Se=i(4849),Re=(0,u.Zt)(v());i(5710);var we=function(e){var a=e.idaparato,i=((0,p.useLang)(),(0,l.useState)([])),t=(0,c.Z)(i,2),n=t[0],o=(t[1],(0,l.useState)({})),s=(0,c.Z)(o,2),d=s[0],r=s[1],h=(0,l.useState)({}),f=(0,c.Z)(h,2),j=f[0],g=f[1],b=(0,l.useState)({start:"",end:""}),E=(0,c.Z)(b,2),N=E[0],A=(E[1],function(e){var a=v()(new Date(e.getFullYear(),e.getMonth(),1)).format("YYYY-MM-DD"),i=v()(new Date(e.getFullYear(),e.getMonth()+1,0)).format("YYYY-MM-DD");r({fechainicio:a,fechafin:i})}),Z=(0,l.useCallback)((function(e){A(e)}),[]),T=Te(),y=(0,c.Z)(T,2),D=y[0],_=y[1];(0,l.useEffect)((function(){var e;(0,m.iY)(_.status)&&g(null===(e=_.data)||void 0===e?void 0:e.data)}),[_]),(0,l.useEffect)((function(){d.fechainicio&&d.fechafin&&D({params:{fechadesde:d.fechainicio,fechahasta:d.fechafin,idproducto:a,estr
1icto:!1}})}),[d.fechainicio,d.fechafin]);var O=(0,l.useCallback)((function(e){var a,i,t,n,o=e.children,s=e.value,r="",c=(v()(new Date(s)).format("YYYY-MM-DD"),(0,S.cloneDeep)(N)),u=c.start,m=c.end;return m||(m=u),(null===(a=new Date(s))||void 0===a?void 0:a.getTime())>=(null===(i=new Date(u+"T00:00:00"))||void 0===i?void 0:i.getTime())&&(null===(t=new Date(s))||void 0===t?void 0:t.getTime())<=(null===(n=new Date(m+"T00:00:00"))||void 0===n?void 0:n.getTime())&&(r="#b0efbf"),I(s,d,j)&&(r="#ffe6e6"),l.cloneElement(l.Children.only(o),{style:(0,x.Z)((0,x.Z)({},o.style),{},{backgroundColor:r})})}),[d,N,j]),I=function(e,a,i){var t=new Date(e),n=v()(new Date(e)).format("YYYY-MM-DD"),o=new Date(a.fechainicio),s=new Date(a.fechafin);return!!((null===o||void 0===o?void 0:o.getTime())<=t.getTime()&&t.getTime()<=(null===s||void 0===s?void 0:s.getTime())&&(6===t.getDay()||0===t.getDay()||i[n]&&"diadecobro"!==i[n]))};return(0,l.useEffect)((function(){A(new Date)}),[]),(0,R.jsx)(R.Fragment,{children:(0,R.jsxs)("section",{className:"position-relative",children:[(0,R.jsx)(u.f,{localizer:Re,events:n,startAccessor:"start",endAccessor:"end",style:{height:400},culture:"ca",messages:{week:"Setmana",work_week:"Setmana de treball",day:"Dia",month:"Mes",previous:"<",next:">",today:"Avui",agenda:"El Diari",showMore:function(e){return"+".concat(e," m\xe9s")}},views:{month:!0},selectable:!0,components:{dateCellWrapper:O},onNavigate:Z}),_.loading&&(0,R.jsx)("div",{className:"d-flex py-5 justify-content-center align-items-center OverlayCalendar__Loading",children:(0,R.jsx)(Se.Z,{animation:"border",role:"status",children:(0,R.jsx)("span",{className:"visually-hidden",children:"Loading..."})})})]})})},Ge=i(6249),Le=i(6794),Fe=i(5678),Pe={GET:{receive:{schema:function(e){return e||(e={}),{id:e.idadjunto||"",documento:e.documento||"",idevento:e.idevento||"",idinscripcion:e.idinscripcion||"",idplantilla:e.idplantilla||"",logfecha:e.logfecha||"",logidpersona:e.logidpersona||"",publicaweb:"0"===e.publicaweb?"false":"true",rutaarchivo:e.rutaarchivo||"",rutathumbnail:e.rutathumbnail||"",tipo:e.tipo||"",url_adjunto:e.url_adjunto||"",nombre:e.nombre||""}},adapter:function(e){var a,i=this,t=null===e||void 0===e||null===(a=e.data)||void 0===a?void 0:a.data;return{data:{items:null===t||void 0===t?void 0:t.map((function(e){return i.schema(e)}))},status:null===e||void 0===e?void 0:e.status}}}},POST:{receive:{schema:function(e){return e||(e={}),{data:e.data,message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){return e||(e={}),{idproducto:e.idproducto||"",archivo:e.archivo||"",nombre:e.nombre||""}},adapter:function(e){var a=this.schema(e);return(0,G.Ex)(a)}}},PATCH:{receive:{schema:function(e){return e||(e={}),{data:e.data,message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){return e||(e={}),{idevento:e.idevento||"",documento:e.documento||"",tipo:e.tipo||"D",publicaweb:"true"===e.publicaweb?"1":"0"}},adapter:function(e){var a=this.schema(e);return(0,x.Z)({},a)}}},DELETE:{receive:{schema:function(e){return e||(e={}),{message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}}}},Me=function(e){return(0,Z.b)({method:"get",url:"/slam/archivos/".concat(e),type:"json",adapters:Pe.GET})},ke=function(){return(0,Z.b)({method:"post",url:"/slam/archivo",type:"json",adapters:Pe.POST})},Ve=function(e){return(0,Z.b)({method:"patch",url:"/slam/archivo/".concat(e),type:"json",adapters:Pe.PATCH})},Ye=function(e){return(0,Z.b)({method:"delete",url:"/slam/archivo/".concat(e),type:"json",adapters:Pe.DELETE})},Ue=function(e){var a,i,t,s,d=e.showModal_Documento,r=e.handleCloseModal_Documento,u=(e.fetchPersonaDatosEconomicosGET,e.urlParams,e.fetchDocumentosGET),h=(0,p.useLang)(),v=(0,l.useRef)(null),f=(0,A.n)({nombre:{isOk:!0,msgError:[h("ALERT_OBLIGATORIO_GENER
1ICO")]}}),Z=(0,c.Z)(f,3),T=Z[0],y=Z[1],D=Z[2],_=(0,N.c)((0,x.Z)({},Pe.GET.receive.schema({}))),O=(0,c.Z)(_,4),I=O[0],S=O[1],w=O[2],G=O[3],L=ke(),F=(0,c.Z)(L,2),P=F[0],M=F[1];(0,l.useEffect)((function(){(0,m.iY)(M.status)&&(u(),r())}),[M]);var k=Ve(null===(a=d.payload)||void 0===a?void 0:a.id),V=(0,c.Z)(k,2),Y=(V[0],V[1]);(0,l.useEffect)((function(){(0,m.iY)(Y.status)&&(u(),r())}),[Y]);var U=Ye(null===(i=d.payload)||void 0===i?void 0:i.id),B=(0,c.Z)(U,2),H=B[0],z=B[1];(0,l.useEffect)((function(){(0,m.iY)(z.status)&&(u(),r())}),[z]);var W=(0,l.useState)({value:!1,payload:{}}),q=(0,c.Z)(W,2),X=(q[0],q[1],(0,l.useState)({id:"",nombre:"",sedes:[]})),J=(0,c.Z)(X,2),Q=J[0],$=J[1];(0,l.useEffect)((function(){var e,a;w((0,x.Z)((0,x.Z)({},I),{},{identidad:Q.id,entidad:Q.nombre,identidadsede:1===(null===(e=Q.sedes)||void 0===e?void 0:e.length)?null===(a=Q.sedes[0])||void 0===a?void 0:a.identidadsede:""}))}),[Q]),(0,l.useEffect)((function(){I.identidad||$({id:"",nombre:"",sedes:[]})}),[I.identidad]),(0,l.useEffect)((function(){var e,a;d.value?null!==(e=d.payload)&&void 0!==e&&e.form&&w((0,x.Z)({},null===(a=d.payload)||void 0===a?void 0:a.form)):(G(),D())}),[d.value]);var K=le.L.GET(),ee=(0,c.Z)(K,2),ae=ee[0],ie=ee[1];(0,l.useEffect)((function(){var e;4===(null===(e=I.codbanco)||void 0===e?void 0:e.length)?ae({params:{codbanco:I.codbanco}}):w((0,x.Z)((0,x.Z)({},I),{},{idbanco:""}))}),[I.codbanco]),(0,l.useEffect)((function(){var e,a,i;w((0,x.Z)((0,x.Z)({},I),{},{idbanco:(null===(e=ie.data)||void 0===e||null===(a=e.items)||void 0===a||null===(i=a[0])||void 0===i?void 0:i.id)||""}))}),[ie]);return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(j.Z,{show:d.value,onHide:r,size:"lg",id:"ModalRegistro",children:[(0,R.jsxs)(j.Z.Header,{className:"border-bottom-0 py-4",children:[(0,R.jsx)(j.Z.Title,{className:"h5",children:"EDIT"===(null===(t=d.payload)||void 0===t?void 0:t.action)?h("EDITAR_DOCUMENTO"):h("NUEVO_DOCUMENTO")}),(0,R.jsx)("button",{type:"button",className:"btn-close mx-0","aria-label":"Close",onClick:r})]}),(0,R.jsx)(j.Z.Body,{className:"px-4 py-0",children:(0,R.jsxs)(g.Z,{className:"row",children:[(0,R.jsx)(g.Z.Group,{className:"mb-3 col-12",children:(0,R.jsx)(E.o,{label:h("NOMBRE_DOCUMENTO"),name:"nombre",value:I.nombre,onChange:S,validation:T,fetchData:"EDIT"===d.payload.action?Y:M,readonly:"EDIT"===d.payload.action})}),I.url_adjunto?(0,R.jsxs)(g.Z.Group,{className:"mb-3 col-12",children:[(0,R.jsxs)(g.Z.Label,{className:"fw-500",children:[h("FICHERO_ADJUNTO"),":"]}),(0,R.jsx)(Fe._,{list:[{titulo:h("FICHERO_ADJUNTO"),url:I.url_adjunto}],withToken:!0})]}):(0,R.jsxs)(g.Z.Group,{className:"mb-3 col-12",children:[(0,R.jsxs)(g.Z.Label,{className:"fw-500",children:[h("DOCUMENTO"),":"]}),(0,R.jsx)(Le.h,{name:"file",onChange:S,referencia:v})]})]})}),(0,R.jsx)(j.Z.Footer,{className:"border-0 d-flex justify-content-between",children:"CREATE"===(null===(s=d.payload)||void 0===s?void 0:s.action)?(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("div",{}),(0,R.jsx)(b.X,{variant:"secondary",type:"submit",className:"me-2",handleSubmit:function(){var e,a;y(I)&&P({body:(0,x.Z)((0,x.Z)({},I),{},{idproducto:null===(e=d.payload)||void 0===e?void 0:e.idaparato,archivo:null===(a=v.current)||void 0===a?void 0:a.files[0]})})},fetchDataLoading:[M.loading],value:h("GUARDAR"),icon:(0,R.jsx)(n.G,{icon:o.r6l})})]}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(b.X,{variant:"danger",type:"submit",className:"ms-2",handleSubmit:function(){H()},fetchDataLoading:[z.loading],value:h("ELIMINAR"),icon:(0,R.jsx)(n.G,{icon:o.$aW,className:"me-1"})}),(0,R.jsx)("div",{})]})})]}),(0,R.jsx)(C.D,{fetchData:M}),(0,R.jsx)(C.D,{fetchData:z}),(0,R.jsx)(C.D,{fetchData:Y})]})},Be=function(){return(0,R.jsx)("div",{className:"card px-4 py-3",children:(0,R.jsxs)("div",{className:"row",children:[(0,R.jsx)("div",{className:"mb-3 col-12",children:(0,R.jsx)(L.V,{className:"py-2",height:"2rem"})}),(0,R.jsx)("div",{className:"mb-3 col-12 col-sm-6 col-md-4 col-lg-4 col-xl-4 col-xxl-3",children:(0,R.jsx)(L.V,{className:"py-2",height:"2rem"})}),(0,R.jsx)("div",{className:"mb-3 col-12 col-sm-6 col-md-4 col-lg-4 col-xl-4 col-xxl-3",children:(0,R.jsx)(L.V,{className:"py-2",height:"2rem"})}),(0,R.jsx)("div",{className:"mb-3 col-12 col-sm-6 col-md-4 col-lg-4 col-xl-4 col-xxl-3",children:(0,R.jsx)(L.V,{className:"py-2",height:"2rem"})}),(0,R.jsx)("div",{className:"mb-3 col-12 col-sm-6 col-md-4 col-lg-4 col-xl-4 col-xxl-3",children:(0,R.jsx)(L.V,{className:"py-2",height:"2rem"})}),(0,R.jsx)("div",{className:"mb-3 col-12",children:(0,R.jsx)(L.V,{className:"py-2",height:"2rem"})}),(0,R.jsx)("div",{className:"mb-3 col-12 col-sm-6 col-md-4 col-lg-4 col-xl-4 col-xxl-3",children:(0,R.jsx)(L.V,{className:"py-2",height:"2rem"})}),(0,R.jsx)("div",{className:"mb-3 col-12 col-sm-6 col-md-4 col-lg-4 col-xl-4 col-xxl-3",children:(0,R.jsx)(L.V,{className:"py-2",height:"2rem"})}),(0,R.jsx)("div",{className:"mb-3 col-12 col-sm-6 col-md-4 col-lg-4 col-xl-4 col-xxl-3",children:(0,R.jsx)(L.V,{className:"py-2",height:"2rem"})}),(0,R.jsx)("div",{className:"col-12 mt-0 pt-3 d-flex justify-content-end border-top",children:(0,R.jsx)(L.V,{className:"py-0 me-0",height:"2rem",width:"5rem"})})]})})},He=i(9434),ze=function(e){e.formData;var a,i,s,d,r=e.idaparato,u=(e.fetchSuccess,(0,p.useLang)()),h=(0,N.c)({}),v=(0,c.Z)(h,4),f=(v[0],v[1],v[2]),j=(v[3],(0,A.n)({descripcion:{isOk:!0,msgError:[u("ALERT_OBLIGATORIO_GENER
1ICO")]}})),g=(0,c.Z)(j,3),E=(g[0],g[1],g[2],Me(r)),Z=(0,c.Z)(E,2),T=Z[0],y=Z[1];(0,l.useEffect)((function(){T()}),[]),(0,l.useEffect)((function(){(0,m.iY)(y.status)&&f((0,x.Z)({},y.data))}),[y]);(0,t.s0)(),se.t7.GET();var D=(0,l.useState)({value:!1,payload:{}}),_=(0,c.Z)(D,2),O=_[0],I=_[1],C=function(e){return I({value:!0,payload:e})},S=(0,l.useState)({data:null,loading:null,error:null,status:null}),w=(0,c.Z)(S,2),G=w[0],L=w[1],F=(0,l.useRef)(!0);(0,l.useEffect)((function(){return function(){F.current=!1}}),[]);var P=(0,He.v9)((function(e){return e.auth})).auth;(0,l.useEffect)((function(){if(G.data){var e,a,i,t=G.data,n=null===t||void 0===t||null===(e=t.headers)||void 0===e||null===(a=e["content-disposition"])||void 0===a||null===(i=a.split("filename="))||void 0===i?void 0:i[1],o=null===t||void 0===t?void 0:t.data,s=new Blob([o]),d=new Date,r=window.URL.createObjectURL(s),c=document.createElement("a");c.href=r,c.setAttribute("download","".concat(d.getDate(),"/").concat(d.getMonth()+1,"/").concat(d.getFullYear(),"_").concat(n)),document.body.appendChild(c),c.click(),c.parentNode.removeChild(c),L({data:null,loading:!0,error:null,status:null})}}),[G]);var M=(0,l.useState)("-"),k=(0,c.Z)(M,2),V=k[0],Y=k[1],U=function(e){!function(e){L({data:null,loading:!0,error:null,status:null});var a={responseType:"blob",headers:{Authorization:"Bearer ".concat(P.token)}};ne().get(e,a).then((function(e){L({loading:!1,error:null,data:e,status:e}),Y("-")}))}(e.url_adjunto),Y(e.url_adjunto)};return(0,R.jsxs)("div",{children:[(0,R.jsxs)("div",{className:"d-flex align-items-center justify-content-between mt-3",children:[(0,R.jsx)("h5",{className:"mb-0",children:u("DOCUMENTOS")}),(0,R.jsx)("div",{className:"d-flex justify-content-end",children:(0,R.jsxs)(de.Z,{variant:"primary",size:"sm",onClick:function(){return C({action:"CREATE",idaparato:r})},children:[(0,R.jsx)(n.G,{icon:o.r8p,className:"me-1"})," ",u("NUEVO_DOCUMENTO")]})})]}),y.loading?(0,R.jsx)("div",{className:"mt-3 ",children:(0,R.jsx)(Be,{})}):(0,R.jsx)("div",{className:"row mt-3 mb-3",children:(0,R.jsx)("div",{className:"col-12",children:(0,R.jsxs)(re.Z,{bordered:!0,responsive:!0,children:[(0,R.jsx)("thead",{children:(0,R.jsxs)("tr",{children:[(0,R.jsx)("th",{children:u("TITULO")}),(0,R.jsx)("th",{className:"text-center"})]})}),(0,R.jsxs)("tbody",{children:[null===(a=y.data)||void 0===a||null===(i=a.items)||void 0===i?void 0:i.map((function(e){return(0,R.jsxs)("tr",{children:[(0,R.jsx)("td",{children:e.nombre}),(0,R.jsxs)("td",{className:"text-center text-nowrap",valign:"middle",children:[(0,R.jsx)(b.X,{variant:"outline-primary",type:"submit",size:"sm",handleSubmit:function(){return U(e)},fetchDataLoading:[V===e.url_adjunto&&G.loading],icon:(0,R.jsx)(n.G,{icon:o.gMD})}),(0,R.jsx)(de.Z,{onClick:function(){return C({action:"EDIT",id:e.id,form:e})},size:"sm",className:"text-nowrap ms-3",children:(0,R.jsx)(n.G,{icon:o.FL8})})]})]})})),0===(null===(s=y.data)||void 0===s||null===(d=s.items)||void 0===d?void 0:d.length)&&(0,R.jsx)("tr",{children:(0,R.jsx)("td",{colSpan:20,className:"text-center py-5",children:u("PARRAFO_NO_HAY_DATOS_PARA_MOSTRAR")})})]})]})})}),(0,R.jsx)(Ue,{showModal_Documento:O,handleCloseModal_Documento:function(){return I({value:!1,payload:{}})},fetchDocumentosGET:T})]})},We=function(e){e.pathName;var a,i=(0,t.UO)(),n=String(i.id)||"",o="nuevo"===n,s=(0,p.useLang)(),u=(0,N.c)((0,x.Z)({},W.GET.receive.schema({}))),h=(0,c.Z)(u,4),v=h[0],f=h[1],j=h[2],g=h[3],b=[{title:s("APARATOS"),link:"/alquiler-aparatos-admin/aparatos"},{title:"".concat(o?s("APARATOS"):v.producto),link:"/".concat(n)}],E=q(),A=(0,c.Z)(E,2),Z=A[0],T=A[1];(0,l.useEffect)((function(){"nuevo"!==n&&(g(),Z({id:n}))}),[n]),(0,l.useEffect)((function(){(0,m.iY)(T.status)&&j((0,x.Z)({},T.data))}),[T]);var y={datosGenerales:{title:s("DATOS_GENERALES"),link:"datos-generales"},documentos:{title:s("DOCUMENTOS"),link:"documentos"},tarifas:{title:s("TARIFAS"),link:"tarifas"}},D={verCalendario:{title:s("VER_CALENDARIO"),link:"ver-calendario"}},_=(0,l.useState)({value:!1,payload:{}}),O=(0,c.Z)(_,2),I=O[0],C=O[1],S=Ge.c.GET(),w=(0,c.Z)(S,2),G=w[0],L=w[1];return(0,l.useEffect)((function(){G({params:{idiomas:!0,filterfield:"idiomas.co
1didioma",filtervalue:["N"],filtertype:"incluir"}})}),[]),(0,R.jsxs)("div",{className:"container-fluid",children:[(0,R.jsxs)("div",{className:"row justify-content-center",children:[(0,R.jsx)("div",{className:"col-12",children:(0,R.jsx)("div",{className:"d-flex justify-content-between align-items-center mb-1 flex-wrap",children:(0,R.jsx)(d.i,{BreadcrumbLineItems:b})})}),!o&&(0,R.jsxs)("div",{className:"col-lg-3 mb-4",children:[(0,R.jsx)(r.J,{values:y}),(0,R.jsx)("div",{className:"py-2"}),(0,R.jsx)(r.J,{values:D})]}),(0,R.jsx)("div",{className:"col-lg-9 animate__animated animate__fadeInUp",children:L.loading?(0,R.jsx)("div",{className:"card p-3",children:(0,R.jsx)(B,{})}):(0,R.jsxs)(t.Z5,{children:[(0,R.jsx)(t.AW,{path:"datos-generales",element:(0,R.jsx)(ae,{idaparato:n,nuevo:o,formAparato:v,handleInputChangeAparato:f,fetchAparatoGETData:T,handleFormChangeAparato:j,fetchParamsIdiomasData:L})}),(0,R.jsx)(t.AW,{path:"documentos",element:(0,R.jsx)(ze,{idaparato:n})}),(0,R.jsx)(t.AW,{path:"tarifas",element:(0,R.jsx)(Ee,{idaparato:n,fetchAparatoGETData:T})}),(0,R.jsx)(t.AW,{path:"ver-calendario",element:(0,R.jsx)(we,{idaparato:n})}),(0,R.jsx)(t.AW,{path:"*",element:(0,R.jsx)(t.Fg,{to:"datos-generales",replace:!0})})]})})]}),(0,R.jsx)(V.W,{handleClose:function(){return C({value:!1,payload:{}})},show:I.value,messageHTML:(0,R.jsxs)("h5",{className:"text-center fw-normal",children:[s("PARRAFO_SEGURO_CAMBIAR_ESTADO_EVENTO_A")," ",null===(a=I.payload)||void 0===a?void 0:a.nombre,"?"]}),textOnClickOk:s("SI_CAMBIAR")})]})},qe=i(4245),Xe=i(6825),Je=function(e){var a=e.formValuesSearch,i=e.handleInputChangeSearch,t=(e.showFilter,e.fetchParamsMultipleData,(0,p.useLang)()),n=se.UY.GET();return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(g.Z.Group,{className:"col-12 col-sm-6 col-md-4 col-lg-4 col-xl-4 col-xxl-4",children:(0,R.jsx)(E.o,{label:t("APARATO")+":",name:"producto",value:a.producto,size:"sm",onChange:i})}),(0,R.jsx)(g.Z.Group,{className:"col-12 col-sm-6 col-md-4 col-lg-3 col-xl-3 col-xxl-2",children:(0,R.jsx)(ce.J,{label:t("ESTADO")+":",name:"status",value:a.status,onChange:i,size:"sm",values:(0,m.QM)(n)})})]})},Qe={GET:{receive:{schema:function(e){return e||(e={}),{id:e.idproducto||"",producto:e.producto||"",tipoproducto:e.tipoproducto||"",rutaimagen:e.rutaimagen||"",rutaproducto:e.rutaproducto||"",idtienda:e.idtienda||"",fechaalta:(0,G.Nc)((0,G.Fe)(e.fechaalta)),fechabaja:(0,G.Nc)((0,G.Fe)(e.fechabaja)),logidpersona:e.logidpersona||"",logfecha:e.logfecha||"",modelo:(0,G.Bx)(e.modelo||""),descripcion:(0,G.Bx)(e.descripcion||"")}},adapter:function(e){var a,i,t=this,n=null===e||void 0===e||null===(a=e.data)||void 0===a?void 0:a.data,o=null===n||void 0===n||null===(i=n.data)||void 0===i?void 0:i.map((function(e){return t.schema(e)}));return{data:{total:null===n||void 0===n?void 0:n.total,per_page:null===n||void 0===n?void 0:n.per_page,current_page:null===n||void 0===n?void 0:n.current_page,items:o},status:null===e||void 0===e?void 0:e.status}}}}},$e=function(){return(0,Z.b)({method:"get",url:"/slam/productos",type:"json",adapters:Qe.GET})},Ke=function(e){var a=e.data,i=e.loading,s=e.total,d=e.perPage,r=e.handleFormChange,u=e.formValuesSearch,m=(0,t.s0)(),h=(0,p.useLang)(),v=(0,l.useState)([]),f=(0,c.Z)(v,2),x=f[0],j=f[1],g=(0,l.useState)([]),b=(0,c.Z)(g,2),E=b[0],N=b[1],A=(0,l.useState)(!1),Z=(0,c.Z)(A,2),T=Z[0],y=(Z[1],[{label:(0,R.jsxs)("span",{children:[(0,R.jsx)(n.G,{icon:o.r8p,className:"me-2"}),h("NUEVO_APARATO")]}),action:function(){return m("./nuevo")}}]),D=[{label:(0,R.jsx)(n.G,{icon:o.FL8,className:"me"}),action:function(e){return m("./".concat(e))}}],_=[(0,R.jsx)("small",{children:h("APARATO")}),(0,R.jsx)("small",{children:h("MODELO")}),(0,R.jsx)("small",{children:h("DESCRIPCION")}),""],O=(0,l.useState)({value:!1,payload:{}}),I=(0,c.Z)(O,2),C=(I[0],I[1],(0,l.useState)({value:!1,payload:{}})),S=(0,c.Z)(C,2);S[0],S[1];return(0,R.jsx)(R.Fragment,{children:(0,R.jsxs)(oe.Z,{children:[(0,R.jsx)(oe.Z.Head,{title:h("APARATOS"),allActions:y}),(0,R.jsx)(oe.Z.Body,{headers:_,dataLineTable:[{className:"",name:"producto"},{className:"",name:"modelo"},{className:"",name:"descripcion"}],data:a,isLoading:i,excluidos:x,incluidos:E,setExcluidos:j,setIncluidos:N,checkAll:T,allActionsPerLine:D,checkMultiples:!1,classNameRow:function(e){return e.fechabaja?"tr-td-transparent tr-red":""}}),(0,R.jsx)(oe.Z.Footer,{total:s,handleFormChange:r,formValuesSearch:u,perPage:d})]})})},ea=function(){var e,a,i,n=(0,p.useLang)(),o=(0,t.TH)(),s=[{title:n("APARATOS"),link:"/aparatos"}],r=$e(),u=(0,c.Z)(r,2),h=u[0],v=u[1],f={producto:"",status:"activos",idtipoevento:""},j={page:1,limit:"",order:""},g={page:1,limit:"",order:"",fechainicioinscripcion:"",fechafininscripcion:""},b=(0,x.Z)((0,x.Z)((0,x.Z)({},j),g),f),E=qe.parse(o.search),A=(0,N.c)({page:Number(E.page)||b.page,limit:E.limit||b.limit,producto:E.producto||b.producto,order:E.order||b.order,idtipoevento:E.idtipoevento||b.idtipoevento,fechainicioinscripcion:E.fechainicioinscripcion||b.fechainicioinscripcion,fechafininscripcion:E.fechafininscripcion||b.fechafininscripcion,status:E.status||b.status}),Z=(0,c.Z)(A,4),T=Z[0],y=Z[1],D=Z[2],_=Z[3];return(0,l.useEffect)((function(){var e=(0,m.Lw)(T),a=(0,m.IZ)(e);window.history.replaceState(null,"","?".concat(a)),h({params:(0,x.Z)({},e)})}),[T.page,T.order,T.limit]),(0,R.jsx)("div",{className:"container-fluid",children:(0,R.jsxs)("div",{className:"row",children:[(0,R.jsx)("div",{className:"col-12",children:(0,R.jsx)("div",{className:"d-flex justify-content-between align-items-center mb-1 Nav-top-DAPcon",children:(0,R.jsx)(d.i,{BreadcrumbLineItems:s})})}),(0,R.jsx)("div",{className:"col-12 mb-4",children:(0,R.jsxs)(Xe.Z,{handleSearch:function(e,a){e&&e.preventDefault();var i=(0,m.Lw)(a),t=(0,m.IZ)(i);if(window.history.replaceState(null,"","?".concat(t)),1!==a.page)D((0,x.Z)((0,x.Z)({},a),{},{page:1}));else{var n=(0,x.Z)({},a);
1Object.keys(n).forEach((function(e){return""===n[e]&&delete n[e]})),h({params:(0,x.Z)({},n)})}},formValuesSearch:T,handleInputChangeSearch:y,fetchData:v,resetformValuesSearch:_,defaultValuesSearchSimple:j,defaultValuesSearchAdvanced:g,defaultValuesSearchAlways:f,handleFormChange:D,children:[(0,R.jsx)(Xe.Z.Head,{label:n("BUSCADOR"),children:(0,R.jsx)(Je,{})}),(0,R.jsx)(Xe.Z.Body,{})]})}),(0,R.jsx)("div",{className:"col-12",children:(0,R.jsx)(Ke,{data:null===(e=v.data)||void 0===e?void 0:e.items,loading:v.loading,total:null===(a=v.data)||void 0===a?void 0:a.total,perPage:null===(i=v.data)||void 0===i?void 0:i.per_page,formValuesSearch:T,handleFormChange:D})})]})})},aa=i(3935),ia=i(1662),ta=i(9410),na=i(7847),oa=i(3979),sa=i(8332),da=function(e){var a,i,t,s,d=e.formInscripcion,r=e.handleInputInscripcion,u=e.handleFormInscripcion,m=e.valuesValidationPersona,h=e.valuesValidationEntidad,v=e.isGratuito,f=e.idpedido,j=(0,p.useLang)(),b=(0,l.useState)({value:!1,payload:{}}),N=(0,c.Z)(b,2),A=N[0],Z=N[1],T=(0,l.useState)({id:d.idpersona||"",nombre:d.nombre_completo||""}),y=(0,c.Z)(T,2),D=y[0],_=y[1];(0,l.useEffect)((function(){u((0,x.Z)((0,x.Z)({},d),{},{idpersona:D.id,nombre_completo:D.nombre}))}),[D]),(0,l.useEffect)((function(){d.idpersona||_({id:"",nombre:""})}),[d.idpersona]);var O=sa.Y.GET(),I=(0,c.Z)(O,3),C=I[0],S=I[1],w=I[2];(0,l.useEffect)((function(){d.idpersona?C({params:{idpersona:d.idpersona,statuspersonaentidad:"activos"}}):w()}),[d.idpersona]),(0,l.useEffect)((function(){"P"===d.abona&&u((0,x.Z)((0,x.Z)({},d),{},{idpersonaentidad:""}))}),[d.abona]);var G=$e(),L=(0,c.Z)(G,2),F=L[0],P=L[1];return(0,l.useEffect)((function(){F({params:{limit:100,status:"activos"}})}),[]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(g.Z.Group,{className:"mb-3 mb-sm-0 col-12 col-sm-6 col-md-6 col-lg-6 col-xl-6 col-xxl-6",children:[(0,R.jsx)(g.Z.Label,{className:"fw-500",children:j("PERSONA")}),(0,R.jsxs)(ta.Z,{children:[(0,R.jsx)(E.o,{name:"persona",value:D.nombre,onChange:function(){return _({id:"",nombre:""})}}),(0,R.jsx)(ta.Z.Text,{id:"basic-addon2",className:"btn btn-secondary",onClick:function(e){return Z({value:!0,payload:e})},children:(0,R.jsx)(n.G,{icon:o.ILF,className:""})})]}),!m.idpersona.isOk&&(0,R.jsx)(g.Z.Text,{className:"text-danger d-block",children:j("VALIDACION_PERSONA_OBLIGATORIA")}),f&&(0,R.jsx)("small",{children:(0,R.jsxs)("u",{onClick:function(){return window.open("https://enginyersgp.cat/admin"+"/administracion/personas/".concat(D.id))},className:"color-primary fw-500 pointer",children:[j("VER_FICHA_PERSONA")," ",(0,R.jsx)(n.G,{icon:o.gJF,className:""})]})})]}),!v&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(g.Z.Group,{className:"col-12 col-sm-6 col-md-6 col-lg-6 col-xl-4 col-xxl-4",children:[(0,R.jsxs)(g.Z.Label,{className:"fw-500 d-block",children:[j("ABONA"),":"]}),(0,R.jsx)(na.O,{className:"",name:"abona",value:d.abona,values:[{id:"P",nombre:j("PERSONA")},{id:"E",nombre:j("ENTIDAD")}],onChange:r})]}),(0,R.jsx)("div",{className:"col-12"}),"E"===d.abona&&(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(g.Z.Group,{className:"mt-3 col-12 col-sm-6 col-md-6 col-lg-6",children:(0,R.jsx)(ce.J,{label:"".concat(j("ENTIDAD"),":"),name:"idpersonaentidad",value:d.idpersonaentidad,onChange:r,values:(null===(a=S.data)||void 0===a||null===(i=a.items)||void 0===i?void 0:i.map((function(e){return{id:e.id,nombre:e.nombreentidad}})))||[],validation:h})}),(0,R.jsx)("div",{className:"col-12 col-sm-6 col-md-6 col-lg-6 col-xl-4 col-xxl-4"})]}),!f&&(0,R.jsx)(g.Z.Group,{className:"mt-3 mb-sm-0 col-12 col-sm-6 col-md-6 col-lg-6 col-xl-6 col-xxl-6",children:(0,R.jsx)(ce.J,{label:j("PARRAFO_SELECCIONE_APARATO_MEDIDA"),name:"idproducto",value:d.idproducto,onChange:r,values:(null===(t=P.data)||void 0===t||null===(s=t.items)||void 0===s?void 0:s.map((function(e){return{id:e.id,nombre:e.producto}})))||[]})}),(0,R.jsx)("div",{className:"col-12 col-sm-6 col-md-6 col-lg-6 col-xl-4 col-xxl-4"})]}),(0,R.jsx)(oa.c,{showModal_FiltroPersonas:A,handleCloseModal_FiltroPersonas:function(){return Z({value:!1,payload:{}})},setFilterPersona:_,params:{statuspersona:"vigente"}})]})},ra=i(4094),ca=function(e){var a,i,t,n=e.formInscripcion,o=e.handleInputInscripcion,s=e.valuesValidationStep2,d=e.handleFormInscripcion,r=e.currentTarifa,u=e.setcurrentTarifa,h=e.isGratuito,v=e.idpedido,f=e.changeTarifaFlag,j=e.setchangeTarifaFlag,b=(0,p.useLang)(),N=ve(),A=(0,c.Z)(N,2),Z=A[0],T=A[1];(0,l.useEffect)((function(){n.idproducto&&Z({id:n.idproducto+"/show"})}),[n.idproducto]);
1var y=ye(),D=(0,c.Z)(y,2),_=D[0],O=D[1],I=function(e){var a={idpersona:n.idpersona,idpersonaentidad:n.idpersonaentidad,idproducto:n.idproducto,fechadesde:n.fechadesde,fechahasta:n.fechahasta,idpedido:n.idpedido,idproductotarifa:e||n.idproductotarifa};a.idpersonaentidad||delete a.idpersonaentidad,a.idpedido||delete a.idpedido,a.idproductotarifa||delete a.idproductotarifa,_({params:a})};(0,l.useEffect)((function(){(n.idpersona||n.idpersonaentidad)&&I()}),[n.idpersona,n.fechadesde,n.fechahasta,n.idpersonaentidad]),(0,l.useEffect)((function(){var e,a,i,t,o,s,r,c,l,h,p,j,g,b;(0,m.iY)(O.status)&&(v?(d((0,x.Z)({},n)),f&&u({totalimportebase:Number((null===(e=O.data)||void 0===e?void 0:e.totalimportebase)||0),importeiva:Number((null===(a=O.data)||void 0===a||null===(i=a.iva)||void 0===i?void 0:i.porcentajeiva)||0),totalimportetotal:Number((null===(t=O.data)||void 0===t?void 0:t.totalimportetotal)||0),idiva:(null===(o=O.data)||void 0===o||null===(s=o.iva)||void 0===s?void 0:s.idiva)||""})):(d((0,x.Z)((0,x.Z)({},n),{},{idproductotarifa:null===(r=O.data)||void 0===r||null===(c=r.tarifas)||void 0===c?void 0:c.idproductotarifa})),u({totalimportebase:Number((null===(l=O.data)||void 0===l?void 0:l.totalimportebase)||0),importeiva:Number((null===(h=O.data)||void 0===h||null===(p=h.iva)||void 0===p?void 0:p.porcentajeiva)||0),totalimportetotal:Number((null===(j=O.data)||void 0===j?void 0:j.totalimportetotal)||0),idiva:(null===(g=O.data)||void 0===g||null===(b=g.iva)||void 0===b?void 0:b.idiva)||""})))}),[O]);return(0,R.jsx)(R.Fragment,{children:null!==T&&void 0!==T&&T.loading?(0,R.jsx)(la,{}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(C.D,{fetchData:O,onlyError:!0}),(0,R.jsx)(g.Z.Group,{className:"mb-3 col-12 ".concat(v?"col-sm-4":"col-sm-5"),children:(0,R.jsx)(ce.J,{label:"".concat(b("TARIFA"),": ").concat(h?"":"*"),name:"idproductotarifa",value:n.idproductotarifa,onChange:function(e){o(e),function(e){j(!0),I(e.target.value)}(e)},values:(null===(a=T.data)||void 0===a||null===(i=a.items)||void 0===i?void 0:i.map((function(e){return{id:e.id,nombre:e.tarifa}})))||[],validation:s})}),(0,R.jsx)(g.Z.Group,{className:"mb-3 col-12 col-sm-4",children:(0,R.jsx)(ce.J,{label:"".concat(b("CONDICION_DE_PAGO"),": ").concat(h?"":"*"),name:"idcondicionpago",value:n.idcondicionpago,onChange:o,values:(0,ra.x)((null===(t=O.data)||void 0===t?void 0:t.condicionespagos)||{})||[],validation:s})}),(0,R.jsx)("div",{className:"col-12"}),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(g.Z.Group,{className:"mb-3 col-12 col-sm-6 col-md-6 col-lg-4 col-xl-4 col-xxl-4",children:[(0,R.jsx)(g.Z.Label,{className:"fw-500",children:b("IMPORTE_BASE")+":"}),(0,R.jsxs)("div",{className:"d-flex align-items-center",children:[(0,R.jsx)(E.o,{name:"totalimportebase",type:"number",value:(null===r||void 0===r?void 0:r.totalimportebase)||"",onChange:function(e){var a=e.target.value,i=null===r||void 0===r?void 0:r.importeiva,t=null===r||void 0===r?void 0:r.idiva,n=a?Number((Number(a)+i/100*Number(a)).toFixed(2)):0;u({idiva:t,totalimportebase:a,importeiva:i,totalimportetotal:n})}}),(0,R.jsx)("strong",{className:"ms-2 me-2",children:"\u20ac"})]})]}),(0,R.jsx)(g.Z.Group,{className:"mb-3 col-12 col-md-6 col-lg-2",children:(0,R.jsx)(E.o,{label:"IVA:",name:"importe",value:((null===r||void 0===r?void 0:r.importeiva)||"")+" %",onChange:o,readonly:!0})}),(0,R.jsx)(g.Z.Group,{className:"mb-3 col-12 col-md-6 col-lg-3",children:(0,R.jsx)(E.o,{label:b("IMPORTE_TOTAL")+":",name:"totalimportetotal",value:((null===r||void 0===r?void 0:r.totalimportetotal)||"")+" \u20ac",onChange:o,readonly:!0})})]})]})})},la=function(){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(L.V,{width:"50%",height:"2rem",className:"mb-3"}),(0,R.jsx)(L.V,{width:"50%",height:"2rem",className:"mb-3 delay-1"}),(0,R.jsx)(L.V,{width:"50%",height:"2rem",className:""}),(0,R.jsx)(L.V,{width:"50%",height:"2rem",className:"delay-1"})]})},ua=function(e){var a=e.formInscripcion,i=e.handleInputInscripcion,t=(e.handleFormInscripcion,e.isEdit,e.hideGenerarFactura,e.idpedido),n=(0,p.useLang)();return(0,R.jsxs)(R.Fragment,{children:[t&&a.observaciones&&(0,R.jsx)(g.Z.Group,{className:"mb-3 col-12",children:(0,R.jsx)(E.o,{label:n("OBSERVACIONES_DEL_CLIENTE")+":",value:a.observaciones||"-",readonly:!0})}),(0,R.jsx)(g.Z.Group,{className:"mb-3 col-12",children:(0,R.jsx)(E.o,{label:n("OBSERVACIONES_USO_INTERNO")+":",name:"observacionesenvio",asParam:"textarea",rows:3,value:a.observacionesenvio,onChange:i})})]})},ma=(0,u.Zt)(v());i(5710);var ha=function(e){var a=e.handleFormInscripcion,i=e.formInscripcion,t=void 0===i?{}:i,n=e.setmessageValid,o=e.messageValid,s=(0,p.useLang)(),d=(0,l.useState)([]),r=(0,c.Z)(d,2),h=r[0],f=(r[1],(0,N.c)({title:s("EVENTO")})),j=(0,c.Z)(f,4),g=j[0],b=(j[1],j[2],j[3],(0,A.n)({horainicio:{isOk:!0,msgError:[s("ALERT_OBLIGATORIO_GENER
1ICO")]},horafin:{isOk:!0,msgError:[s("ALERT_OBLIGATORIO_GENERICO")]}})),E=(0,c.Z)(b,3),Z=(E[0],E[1],E[2],(0,l.useState)({})),T=(0,c.Z)(Z,2),y=T[0],D=T[1],_=(0,l.useState)({}),O=(0,c.Z)(_,2),I=O[0],C=O[1],w=(0,l.useState)({start:"",end:""}),L=(0,c.Z)(w,2),F=L[0],P=L[1],M=function(e){var a=v()(new Date(e.getFullYear(),e.getMonth(),1)).format("YYYY-MM-DD"),i=v()(new Date(e.getFullYear(),e.getMonth()+1,0)).format("YYYY-MM-DD");D({fechainicio:a,fechafin:i})},k=(0,l.useCallback)((function(e){M(e)}),[]),V=(0,l.useCallback)((function(e){var a,i,t,n,o=e.children,s=e.value,d="",r=v()(new Date(s)).format("YYYY-MM-DD");g.horainicio===r&&(d="#6bebb0");var c=(0,S.cloneDeep)(F),u=c.start,m=c.end;return m||(m=u),(null===(a=new Date(s))||void 0===a?void 0:a.getTime())>=(null===(i=new Date(u+"T00:00:00"))||void 0===i?void 0:i.getTime())&&(null===(t=new Date(s))||void 0===t?void 0:t.getTime())<=(null===(n=new Date(m+"T00:00:00"))||void 0===n?void 0:n.getTime())&&(d="#b0efbf"),U(s,y,I)&&(d="#ffe6e6"),l.cloneElement(l.Children.only(o),{style:(0,x.Z)((0,x.Z)({},o.style),{},{backgroundColor:d})})}),[y,g.horainicio,F,I]),U=function(e,a,i){var t=new Date(e),n=v()(new Date(e)).format("YYYY-MM-DD"),o=new Date(a.fechainicio),s=new Date(a.fechafin);return!!((null===o||void 0===o?void 0:o.getTime())<=t.getTime()&&t.getTime()<=(null===s||void 0===s?void 0:s.getTime())&&(6===t.getDay()||0===t.getDay()||i[n]&&"diadecobro"!==i[n]))};(0,l.useEffect)((function(){M(new Date),n({status:0,message:""})}),[]);var B=(0,l.useCallback)((function(e){var i,n,o=e.start,s=(e.end,e.title,String((0,m.iG)(new Date(o))||""));(F.start||F.end||P((0,x.Z)((0,x.Z)({},F),{},{start:s})),F.start&&!F.end)&&(F.start===s?P({start:"",end:""}):(null===(i=new Date(F.start))||void 0===i?void 0:i.getTime())<=(null===(n=new Date(o))||void 0===n?void 0:n.getTime())?(P((0,x.Z)((0,x.Z)({},F),{},{end:s})),a((0,x.Z)((0,x.Z)({},t),{},{fechadesde:F.start,fechahasta:s}))):P({start:s,end:""}));F.start&&F.end,F.start&&F.end&&P({start:s,end:""})}),[F]),H=Te(),z=(0,c.Z)(H,2),W=z[0],q=z[1];(0,l.useEffect)((function(){var e;(0,m.iY)(q.status)&&C(null===(e=q.data)||void 0===e?void 0:e.data)}),[q]);var X=Te(),J=(0,c.Z)(X,2),Q=J[0],$=J[1];return(0,l.useEffect)((function(){y.fechainicio&&y.fechafin&&W({params:{fechadesde:y.fechainicio,fechahasta:y.fechafin,idproducto:null===t||void 0===t?void 0:t.idproducto,estricto:!1}})}),[y.fechainicio,y.fechafin]),(0,l.useEffect)((function(){F.start&&F.end&&Q({params:{fechadesde:F.start,fechahasta:F.end,idproducto:null===t||void 0===t?void 0:t.idproducto,estricto:!0}})}),[F.start,F.end]),(0,l.useEffect)((function(){var e;((0,m.iY)($.status)&&n({status:200,message:"Les dates seleccionades s\xf3n correctes"}),(0,m._y)($.status))&&n({status:400,message:null===$||void 0===$||null===(e=$.error)||void 0===e?void 0:e.message})}),[$]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("div",{className:"col-12 mb-4",children:(0,R.jsx)(Y.Z,{variant:"info",className:"my-0 py-2",children:"Feu clic sobre un dia per seleccionar el dia d'inici, feu un segon clic per seleccionar el dia final"})}),(0,R.jsx)("div",{className:"col-12",children:(0,R.jsxs)("section",{className:"position-relative",children:[(0,R.jsx)(u.f,{localizer:ma,events:h,startAccessor:"start",endAccessor:"end",style:{height:400},onSelectSlot:B,culture:"ca",messages:{week:"Setmana",work_week:"Setmana de treball",day:"Dia",month:"Mes",previous:"<",next:">",today:"Avui",agenda:"El Diari",showMore:function(e){return"+".concat(e," m\xe9s")}},views:{month:!0},selectable:!0,components:{dateCellWrapper:V},onNavigate:k}),q.loading&&(0,R.jsx)("div",{className:"d-flex py-5 justify-content-center align-items-center OverlayCalendar__Loading",children:(0,R.jsx)(Se.Z,{animation:"border",role:"status",children:(0,R.jsx)("span",{className:"visually-hidden",children:"Loading..."})})})]})}),(0,R.jsx)("div",{className:"text-center",children:$.loading?(0,R.jsx)("div",{className:"pt-4",children:(0,R.jsx)(Se.Z,{animation:"border",role:"status",children:(0,R.jsx)("span",{className:"visually-hidden",children:"Loading..."})})}):(0,R.jsx)(R.Fragment,{children:o.message?(0,R.jsx)("div",{className:"col-12 mt-4",children:(0,R.jsxs)(Y.Z,{variant:200===(null===o||void 0===o?void 0:o.status)?"success":"danger",className:"my-0 py-2 text-center",children:[null===o||void 0===o?void 0:o.message,": ",(0,G.Nc)((0,G.Fe)(t.fechadesde))," - ",(0,G.Nc)((0,G.Fe)(t.fechahasta))]})}):(0,R.jsx)(R.Fragment,{})})})]})},va=function(e){var a=e.formInscripcion,i=e.handleInputInscripcion,t=(e.fetchAlquileresGET,e.formValuesSearch,e.handleFormInscripcion),s=e.isGratuito,d=e.fetchPersonaEntidadPOST,r=e.fetchPersonaEntidadPOSTData,u=(0,p.useLang)(),m=(0,l.useState)({}),h=(0,c.Z)(m,2),v=h[0],f=h[1],g=[u("DATOS_GENERALES"),u("FECHAS"),u("FACTURACION"),u("OTROS_DATOS")],E=(0,l.useState)(0),N=(0,c.Z)(E,2),Z=N[0],T=N[1],y=(0,A.n)({idpersona:{isOk:!0,msgError:["La persona es obligatoria."]}}
1),D=(0,c.Z)(y,3),_=D[0],O=(D[1],D[2],(0,A.n)({idpersonaentidad:{isOk:!0,msgError:["La entidad es obligatoria."]}})),I=(0,c.Z)(O,3);I[0],I[1],I[2];function C(){T((function(e){return s?e+2:e+1}))}var S=(0,l.useState)({status:0,message:""}),w=(0,c.Z)(S,2),G=w[0],L=w[1],F=(0,l.useState)(!1),P=(0,c.Z)(F,2),M=P[0],k=P[1];return(0,R.jsx)(R.Fragment,{children:(0,R.jsxs)(ia.Z,{children:[(0,R.jsx)(ia.Z.Header,{listWizard:g,indexFocusWizard:Z,setIndexFocusWizard:T}),(0,R.jsxs)(ia.Z.Body,{indexFocusWizard:Z,children:[(0,R.jsxs)("section",{className:"bg-white overflow-hidden",children:[(0,R.jsx)("div",{className:"container animate__faster animate__animated animate__fadeInLeftModal border-start border-bottom border-end",children:(0,R.jsx)("div",{className:"row py-3 py-lg-3 px-3 justify-content-center bg-FAFAFA",children:(0,R.jsx)("div",{className:"col-12",children:(0,R.jsx)("div",{className:"row my-3 justify-content-center",children:(0,R.jsx)(da,{formInscripcion:a,valuesValidationPersona:_,handleFormInscripcion:t,handleInputInscripcion:i})})})})}),(0,R.jsxs)(j.Z.Footer,{className:"border-0 d-flex justify-content-between",children:[(0,R.jsx)("div",{}),(0,R.jsx)(b.X,{variant:"secondary",type:"submit",className:"me-2",handleSubmit:C,fetchDataLoading:[!1],value:u("CONTINUAR")})]})]}),(0,R.jsxs)("section",{className:"bg-white overflow-hidden",children:[(0,R.jsx)("div",{className:"container animate__faster animate__animated animate__fadeInLeftModal border-start border-bottom border-end",children:(0,R.jsx)("div",{className:"row py-3 py-lg-3 px-3 justify-content-center bg-FAFAFA",children:(0,R.jsx)("div",{className:"col-12",children:(0,R.jsx)("div",{className:"row my-3",children:(0,R.jsx)(ha,{handleFormInscripcion:t,formInscripcion:a,messageValid:G,setmessageValid:L})})})})}),(0,R.jsxs)(j.Z.Footer,{className:"border-0 d-flex justify-content-between",children:[(0,R.jsx)(de.Z,{variant:"outline-secondary",onClick:function(){return T((function(e){return e-1}))},className:"px-3",children:u("VOLVER")}),(0,R.jsx)(b.X,{variant:"secondary",type:"submit",className:"me-2",handleSubmit:C,fetchDataLoading:[!1],value:u("CONTINUAR"),disabled:200!==G.status})]})]}),(0,R.jsxs)("section",{className:"bg-white overflow-hidden",children:[(0,R.jsx)("div",{className:"container animate__faster animate__animated animate__fadeInLeftModal border-start border-bottom border-end",children:(0,R.jsx)("div",{className:"row py-3 py-lg-3 px-3 justify-content-center bg-FAFAFA",children:(0,R.jsx)("div",{className:"col-12",children:(0,R.jsx)("div",{className:"row my-3",children:(0,R.jsx)(ca,{formInscripcion:a,valuesValidationPersona:_,handleFormInscripcion:t,handleInputInscripcion:i,currentTarifa:v,setcurrentTarifa:f,changeTarifaFlag:M,setchangeTarifaFlag:k})})})})}),(0,R.jsxs)(j.Z.Footer,{className:"border-0 d-flex justify-content-between",children:[(0,R.jsx)(de.Z,{variant:"outline-secondary",onClick:function(){return T((function(e){return e-1}))},className:"px-3",children:u("VOLVER")}),(0,R.jsx)(b.X,{variant:"secondary",type:"submit",className:"me-2",handleSubmit:function(){T((function(e){return e+1}))},fetchDataLoading:[!1],value:u("CONTINUAR")})]})]}),(0,R.jsxs)("section",{className:"bg-white overflow-hidden",children:[(0,R.jsx)("div",{className:"container animate__faster animate__animated animate__fadeInLeftModal border-start border-bottom border-end",children:(0,R.jsx)("div",{className:"row py-3 py-lg-3 px-3 justify-content-center bg-FAFAFA",children:(0,R.jsx)("div",{className:"col-12",children:(0,R.jsx)("div",{className:"row my-3",children:(0,R.jsx)(ua,{formInscripcion:a,valuesValidationPersona:_,handleFormInscripcion:t,handleInputInscripcion:i})})})})}),(0,R.jsxs)(j.Z.Footer,{className:"border-0 d-flex justify-content-between",children:[(0,R.jsx)(de.Z,{variant:"outline-secondary",onClick:function(){return T((function(e){return s?e-2:e-1}))},className:"px-3",children:u("VOLVER")}),(0,R.jsx)(b.X,{variant:"secondary",type:"submit",className:"me-2",handleSubmit:function(){d({body:(0,x.Z)((0,x.Z)({},a),{},{inputtotalimportebase:v.totalimportebase,inputtotalimporteiva:(v.importeiva/100*Number(v.totalimportebase)).toFixed(2),idiva:v.idiva})})},fetchDataLoading:[null===r||void 0===r?void 0:r.loading],value:u("GUARDAR"),icon:(0,R.jsx)(n.G,{icon:o.r6l})})]})]})]})]})})},pa=function(e){var a,i,t=e.showModal_Alquiler,n=e.handleCloseModal_Alquiler,o=e.fetchAlquileresGET,s=e.formValuesSearch,d=(e.fetchPersonaDatosEconomicosGET,e.urlParam
1s),r=e.idevento,u=(e.isGratuito,e.fetchPersonaEntidadPOST),h=e.fetchPersonaEntidadPOSTData,v=(0,p.useLang)(),f=(0,N.c)({idpersona:"",idevento:r,idpersonaentidad:"",idcondicionpago:"",ideventotarifa:"",observaciones:"",nombre_completo:"",abona:"P",comunicar:[],facturar:[]}),g=(0,c.Z)(f,4),b=g[0],E=g[1],Z=g[2],T=g[3],y=aa.q.GET(),D=(0,c.Z)(y,2),_=(D[0],D[1]);(0,l.useEffect)((function(){(0,m.iY)(_.status)&&Z((0,x.Z)({},_.data))}),[_]);var O=aa.q.PATCH(null===(a=t.payload)||void 0===a?void 0:a.id),I=(0,c.Z)(O,2),S=(I[0],I[1]);(0,l.useEffect)((function(){(0,m.iY)(S.status)&&(o({params:(0,x.Z)({},d)}),n())}),[S]);var w=aa.q.DELETE(null===(i=t.payload)||void 0===i?void 0:i.id),G=(0,c.Z)(w,2),L=(G[0],G[1]);(0,l.useEffect)((function(){(0,m.iY)(L.status)&&(o({params:(0,x.Z)({},d)}),n())}),[L]);(0,l.useEffect)((function(){var e;t.value?null!==(e=t.payload)&&void 0!==e&&e.id:T()}),[t.value]);var F=(0,A.n)({idpersona:{isOk:!0,msgError:["La persona es obligatoria."]}}),P=(0,c.Z)(F,3),M=(P[0],P[1],P[2],(0,A.n)({idpersonaentidad:{isOk:!0,msgError:["La entidad es obligatoria."]}})),k=(0,c.Z)(M,3),V=(k[0],k[1],k[2],(0,A.n)({idcondicionpago:{isOk:!0,msgError:[v("ALERT_OBLIGATORIO_GENERICO")]},ideventotarifa:{isOk:!0,msgError:[v("ALERT_OBLIGATORIO_GENERICO")]}})),Y=(0,c.Z)(V,3);Y[0],Y[1],Y[2];return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(j.Z,{show:t.value,onHide:n,size:"lg",children:[(0,R.jsxs)(j.Z.Header,{className:"border-bottom-0 py-4",children:[(0,R.jsx)(j.Z.Title,{className:"h5",children:v("NUEVO_ALQUILER")}),(0,R.jsx)("button",{type:"button",className:"btn-close mx-0","aria-label":"Close",onClick:n})]}),(0,R.jsx)(va,{formInscripcion:b,handleFormInscripcion:Z,handleInputInscripcion:E,formValuesSearch:s,fetchAlquileresGET:o,handleCloseModal_Alquiler:n,fetchPersonaEntidadPOST:u,fetchPersonaEntidadPOSTData:h})]}),(0,R.jsx)(C.D,{fetchData:L}),(0,R.jsx)(C.D,{fetchData:S})]})},fa=(0,u.Zt)(v());i(5710);var xa=function(e){var a,i,t=e.showModal_Alquileres,n=e.handleCloseModal_Alquileres,o=(0,p.useLang)(),s=(0,l.useState)([]),d=(0,c.Z)(s,2),r=d[0],h=(d[1],(0,l.useState)({})),f=(0,c.Z)(h,2),b=f[0],E=f[1],Z=(0,l.useState)({}),T=(0,c.Z)(Z,2),y=T[0],D=T[1],_=(0,l.useState)({start:"",end:""}),O=(0,c.Z)(_,2),I=O[0],C=(O[1],(0,N.c)({title:o("EVENTO"),idaparato:""})),w=(0,c.Z)(C,4),G=w[0],L=w[1],F=(w[2],w[3],function(e){var a=v()(new Date(e.getFullYear(),e.getMonth(),1)).format("YYYY-MM-DD"),i=v()(new Date(e.getFullYear(),e.getMonth()+1,0)).format("YYYY-MM-DD");E({fechainicio:a,fechafin:i})}),P=(0,l.useCallback)((function(e){F(e)}),[]),M=Te(),k=(0,c.Z)(M,2),V=k[0],Y=k[1];(0,l.useEffect)((function(){var e;(0,m.iY)(Y.status)&&D(null===(e=Y.data)||void 0===e?void 0:e.data)}),[Y]),(0,l.useEffect)((function(){b.fechainicio&&b.fechafin&&G.idaparato&&V({params:{fechadesde:b.fechainicio,fechahasta:b.fechafin,idproducto:G.idaparato,estricto:!1}})}),[b.fechainicio,b.fechafin,G.idaparato]);var U=(0,l.useCallback)((function(e){var a,i,t,n,o=e.children,s=e.value,d="",r=(v()(new Date(s)).format("YYYY-MM-DD"),(0,S.cloneDeep)(I)),c=r.start,u=r.end;return u||(u=c),(null===(a=new Date(s))||void 0===a?void 0:a.getTime())>=(null===(i=new Date(c+"T00:00:00"))||void 0===i?void 0:i.getTime())&&(null===(t=new Date(s))||void 0===t?void 0:t.getTime())<=(null===(n=new Date(u+"T00:00:00"))||void 0===n?void 0:n.getTime())&&(d="#b0efbf"),B(s,b,y)&&(d="#ffe6e6"),l.cloneElement(l.Children.only(o),{style:(0,x.Z)((0,x.Z)({},o.style),{},{backgroundColor:d})})}),[b,I,y]),B=function(e,a,i){var t=new Date(e),n=v()(new Date(e)).format("YYYY-MM-DD"),o=new Date(a.fechainicio),s=new Date(a.fechafin);return!!((null===o||void 0===o?void 0:o.getTime())<=t.getTime()&&t.getTime()<=(null===s||void 0===s?void 0:s.getTime())&&(6===t.getDay()||0===t.getDay()||i[n]&&"diadecobro"!==i[n]))};(0,l.useEffect)((function(){F(new Date)}),[]);var H=(0,A.n)({horainicio:{isOk:!0,msgError:[o("ALERT_OBLIGATORIO_GENERICO")]},horafin:{isOk:!0,msgError:[o("ALERT_OBLIGATORIO_GENERICO")]}}),z=(0,c.Z)(H,3),W=(z[0],z[1],z[2],$e()),q=(0,c.Z)(W,2),X=q[0],J=q[1];return(0,l.useEffect)((function(){t.value&&X({params:{limit:100,status:"activos"}})}),[t.value]),(0,R.jsx)(R.Fragment,{children:(0,R.jsxs)(j.Z,{show:t.value,onHide:n,dialogClassName:"modal-70vw",id:"ModalRegistro",children:[(0,R.jsxs)(j.Z.Header,{className:"border-bottom-0 py-4",children:[(0,R.jsx)(j.Z.Title,{className:"h5",children:o("VER_CALENDARIO")}),(0,R.jsx)(g.Z.Group,{className:"col-lg-4",children:(0,R.jsxs)("div",{className:"d-flex align-items-center",children:[(0,R.jsxs)("span",{className:"pe-3",children:[o("APARATO"),": "]}),(0,R.jsx)(ce.J,{name:"idaparato",size:"sm",value:G.idaparato,values:(null===(a=J.data)||void 0===a||null===(i=a.items)||void 0===i?void 0:i.map((function(e){return{id:e.id,nombre:e.producto}})))||[],onChange:L})]})})]}),(0,R.jsx)(j.Z.Body,{className:"px-4 py-0",children:(0,R.jsxs)("section",{className:"position-relative",children:[(0,R.jsx)(u.f,{localizer:fa,events:r,startAccessor:"start",endAccessor:"end",style:{height:400},culture:"ca",messages:{week:"Setmana",work_week:"Setmana de treball",day:"Dia",month:"Mes",previous:"<",next:">",today:"Avui",agenda:"El Diari",showMore:function(e){return"+".concat(e," m\xe9s")}},views:{month:!0},selectable:!0,components:{dateCellWrapper:U},onNavigate:P}),Y.loading&&(0,R.jsx)("div",{className:"d-flex py-5 justify-content-center align-items-center OverlayCalendar__Loading",children:(0,R.jsx)(Se.Z,{animation:"border",role:"status",children:(0,R.jsx)("span",{className:"visually-hidden",children:"Loading..."})})})]})}),(0,R.jsx)(j.Z.Footer,{className:"border-0 d-flex justify-content-between"})]})})},ja=i(8568),ga=function(e){var a=e.data,i=e.loading,s=e.total,d=e.perPage,r=e.handleFormChange,u=e.formValuesSearch,h=e.fetchAlquileresGET,v=e.handleInputChangeSearch,f=(0,t.s0)(),x=(0,p.useLang)(),j=se.P9.GET(),g=(0,l.useState)([]),b=(0,c.Z)(g,2),E=b[0],N=b[1],A=(0,l.useState)([]),Z=(0,c.Z)(A,2),T=Z[0],y=Z[1],D=(0,l.useState)(!1),_=(0,c.Z)(D,2),O=_[0],I=(_[1],[{variant:"outline-primary",label:(0,R.jsxs)("span",{children:[(0,R.jsx)(n.G,{icon:o.fT7,className:"me-2"}),x("VER_CALENDARIO")]}),action:function(){return H({action:"CREATE"})}},{label:(0,R.jsxs)("span",{children:[(0,R.jsx)(n.G,{icon:o.r8p,className:"me-2"}),x("NUEVO_ALQUILER")]}),action:function(){return k({action:"CREATE"})}}]),S=[{label:(0,R.jsx)(n.G,{icon:o.FL8,className:"me"}),action:function(e){return f("./".concat(e))}}
1],w=[(0,R.jsx)("small",{children:(0,R.jsx)(ja.Z,{label:x("NUMERO_DE_PEDIDO"),id:"numeropedido",className:"text-center",handleInputChange:v,formValuesSearch:u})}),(0,R.jsx)("small",{children:x("APARATO")}),(0,R.jsx)("small",{children:x("PERSONA")}),(0,R.jsx)("small",{className:"d-block text-center",children:(0,R.jsx)(ja.Z,{label:x("FECHA_DESDE"),id:"fechadesde",className:"text-center",handleInputChange:v,formValuesSearch:u})}),(0,R.jsx)("small",{className:"d-block text-center",children:(0,R.jsx)(ja.Z,{label:x("FECHA_HASTA"),id:"fechahasta",className:"text-center",handleInputChange:v,formValuesSearch:u})}),(0,R.jsx)("small",{className:"d-block text-center",children:x("ESTADO")}),""],G=[{className:"",name:"numeropedido"},{className:"",name:"producto"},{className:"",name:"nombrepersona"},{className:"text-center tex-nowrap",name:"fechadesde"},{className:"text-center tex-nowrap",name:"fechahasta"},{className:"text-center tex-nowrap",name:"estado",adapter:j}],L=(0,l.useState)({value:!1,payload:{}}),F=(0,c.Z)(L,2),P=F[0],M=F[1],k=function(e){return M({value:!0,payload:e})},V=(0,l.useState)({value:!1,payload:{}}),Y=(0,c.Z)(V,2),U=Y[0],B=Y[1],H=function(e){return B({value:!0,payload:e})},z=_e(),W=(0,c.Z)(z,2),q=W[0],X=W[1];return(0,l.useEffect)((function(){var e,a;(0,m.iY)(X.status)&&f("./".concat(null===X||void 0===X||null===(e=X.data)||void 0===e||null===(a=e.data)||void 0===a?void 0:a.idpedido))}),[X]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(oe.Z,{children:[(0,R.jsx)(oe.Z.Head,{title:x("ALQUILERES"),allActions:I}),(0,R.jsx)(oe.Z.Body,{headers:w,dataLineTable:G,data:a,isLoading:i,excluidos:E,incluidos:T,setExcluidos:N,setIncluidos:y,checkAll:O,allActionsPerLine:S,checkMultiples:!1}),(0,R.jsx)(oe.Z.Footer,{total:s,handleFormChange:r,formValuesSearch:u,perPage:d})]}),(0,R.jsx)(xa,{showModal_Alquileres:U,handleCloseModal_Alquileres:function(){return B({value:!1,payload:{}})},fetchAlquileresGET:h}),(0,R.jsx)(pa,{showModal_Alquiler:P,handleCloseModal_Alquiler:function(){return M({value:!1,payload:{}})},fetchAlquileresGET:h,formValuesSearch:u,fetchPersonaEntidadPOST:q,fetchPersonaEntidadPOSTData:X}),(0,R.jsx)(C.D,{fetchData:X})]})},ba=function(e){var a=e.formValuesSearch,i=e.handleInputChangeSearch,t=(e.showFilter,e.fetchParamsMultipleData,(0,p.useLang)()),n=se.P9.GET();return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)(g.Z.Group,{className:"col-12 col-sm-6 col-md-4 col-lg-4 col-xl-3 col-xxl-3",children:(0,R.jsx)(E.o,{label:t("NUMERO_DE_PEDIDO")+":",name:"numeropedido",value:a.numeropedido,size:"sm",onChange:i})}),(0,R.jsx)(g.Z.Group,{className:"col-12 col-sm-6 col-md-4 col-lg-4 col-xl-4 col-xxl-4",children:(0,R.jsx)(E.o,{label:t("PERSONA"),name:"nombreyapellidos",value:a.nombreyapellidos,size:"sm",onChange:i})}),(0,R.jsx)(g.Z.Group,{className:"col-12 col-sm-6 col-md-4 col-lg-3 col-xl-3 col-xxl-2",children:(0,R.jsx)(ce.J,{label:t("ESTADO")+":",name:"estado",value:a.estado,onChange:i,size:"sm",values:(0,m.QM)(n)})})]})},Ea=function(e){var a=e.handleSearch,i=e.formValuesSearch,t=e.handleInputChangeSearch,s=e.fetchData,d=(e.resetformValuesSearch,e.defaultValuesSearchSimple),r=e.defaultValuesSearchAdvanced,c=e.handleFormChange,l=e.defaultValuesSearchAlways,u=(e.formNamesFilters,(0,p.useLang)());return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("div",{className:"border-bottom mb-3 mt-1"}),(0,R.jsx)(g.Z.Group,{className:"mb-3 col-12 col-sm-6 col-md-4 col-lg-3 col-xl-3 col-xxl-2",children:(0,R.jsx)(E.o,{label:"".concat(u("FECHA_RECOGIDA_DESDE"),":"),type:"date",name:"fechadesdeinicio",value:i.fechadesdeinicio,onChange:t,size:"sm"})}),(0,R.jsx)(g.Z.Group,{className:"mb-3 col-12 col-sm-6 col-md-4 col-lg-3 col-xl-3 col-xxl-2",children:(0,R.jsx)(E.o,{label:"".concat(u("FECHA_RECOGIDA_HASTA"),":"),type:"date",name:"fechadesdefin",value:i.fechadesdefin,onChange:t,size:"sm"})}),(0,R.jsx)(g.Z.Group,{className:"mb-3 col-12 col-sm-6 col-md-4 col-lg-3 col-xl-3 col-xxl-2 ms-lg-4",children:(0,R.jsx)(E.o,{label:"".concat(u("FECHA_DEVOLUCION_DESDE"),":"),type:"date",name:"fechahastainicio",value:i.fechahastainicio,onChange:t,size:"sm"})}),(0,R.jsx)(g.Z.Group,{className:"mb-3 col-12 col-sm-6 col-md-4 col-lg-3 col-xl-3 
1col-xxl-2",children:(0,R.jsx)(E.o,{label:"".concat(u("FECHA_DEVOLUCION_HASTA"),":"),type:"date",name:"fechahastafin",value:i.fechahastafin,onChange:t,size:"sm"})}),(0,R.jsx)("div",{className:"ms-auto col-12 col-sm-6 col-md-4 col-lg-3 col-xl-3 col-xxl-3 mb-3",children:(0,R.jsxs)("div",{className:"d-flex align-items-end justify-content-end h-100",children:[(0,R.jsx)(b.X,{variant:"outline-secondary",type:"submit",size:"sm",className:"me-2",handleSubmit:function(){var e=(0,x.Z)((0,x.Z)((0,x.Z)({},d),r),l);c(e)},fetchDataLoading:[!1],value:u("LIMPIAR"),icon:(0,R.jsx)(n.G,{icon:o.Z$V})}),(0,R.jsx)(b.X,{variant:"secondary",type:"submit",size:"sm",className:"",handleSubmit:function(){var e=(0,x.Z)((0,x.Z)({},i),d);c(e),a(null,e)},fetchDataLoading:[s.loading],value:u("BUSCAR"),icon:(0,R.jsx)(n.G,{icon:o.wn1,className:"me-1"})})]})})]})},Na=function(){var e,a,i,n=(0,p.useLang)(),o=(0,t.TH)(),s=[{title:n("ALQUILERES"),link:"/cuotas"}],r=Ze(),u=(0,c.Z)(r,2),h=u[0],v=u[1],f={numeropedido:"",estado:"",idtipoevento:""},j={page:1,limit:"",order:"numeropedido desc"},g={page:1,limit:"",order:"numeropedido desc",fechadesdeinicio:"",fechadesdefin:"",fechahastainicio:"",fechahastafin:""},b=(0,x.Z)((0,x.Z)((0,x.Z)({},j),g),f),E=qe.parse(o.search),A=(0,N.c)({page:Number(E.page)||b.page,limit:E.limit||b.limit,numeropedido:E.numeropedido||b.numeropedido,order:E.order||b.order,idtipoevento:E.idtipoevento||b.idtipoevento,fechadesdeinicio:E.fechadesdeinicio||b.fechadesdeinicio,fechadesdefin:E.fechadesdefin||b.fechadesdefin,fechahastainicio:E.fechahastainicio||b.fechahastainicio,fechahastafin:E.fechahastafin||b.fechahastafin,estado:E.estado||b.estado}),Z=(0,c.Z)(A,4),T=Z[0],y=Z[1],D=Z[2],_=Z[3];return(0,l.useEffect)((function(){var e=(0,m.Lw)(T),a=(0,m.IZ)(e);window.history.replaceState(null,"","?".concat(a)),h({params:(0,x.Z)({},e)})}),[T.page,T.order,T.limit]),(0,R.jsx)("div",{className:"container-fluid",children:(0,R.jsxs)("div",{className:"row",children:[(0,R.jsx)("div",{className:"col-12",children:(0,R.jsx)("div",{className:"d-flex justify-content-between align-items-center mb-1 Nav-top-DAPcon",children:(0,R.jsx)(d.i,{BreadcrumbLineItems:s})})}),(0,R.jsx)("div",{className:"col-12 mb-4",children:(0,R.jsxs)(Xe.Z,{handleSearch:function(e,a){e&&e.preventDefault();var i=(0,m.Lw)(a),t=(0,m.IZ)(i);if(window.history.replaceState(null,"","?".concat(t)),1!==a.page)D((0,x.Z)((0,x.Z)({},a),{},{page:1}));else{var n=(0,x.Z)({},a);Object.keys(n).forEach((function(e){return""===n[e]&&delete n[e]})),h({params:(0,x.Z)({},n)})}},formValuesSearch:T,handleInputChangeSearch:y,fetchData:v,resetformValuesSearch:_,defaultValuesSearchSimple:j,defaultValuesSearchAdvanced:g,defaultValuesSearchAlways:f,handleFormChange:D,expand:!0,children:[(0,R.jsx)(Xe.Z.Head,{label:n("BUSCADOR"),children:(0,R.jsx)(ba,{})}),(0,R.jsx)(Xe.Z.Body,{children:(0,R.jsx)(Ea,{})})]})}),(0,R.jsx)("div",{className:"col-12",children:(0,R.jsx)(ga,{data:null===(e=v.data)||void 0===e?void 0:e.items,loading:v.loading,total:null===(a=v.data)||void 0===a?void 0:a.total,perPage:null===(i=v.data)||void 0===i?void 0:i.per_page,formValuesSearch:T,handleFormChange:D,handleInputChangeSearch:y,fetchAlquileresGET:h})})]})})},Aa=function(){return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("div",{className:"col-12 mb-4",children:(0,R.jsx)(L.V,{className:"py-2",height:"2rem"})}),(0,R.jsx)("div",{className:"col-12 mb-4",children:(0,R.jsx)(L.V,{className:"py-2",height:"2rem"})}),(0,R.jsx)("div",{className:"col-12 col-sm-6 col-lg-5 col-xl-4 mb-4",children:(0,R.jsx)(L.V,{className:"py-2",height:"2rem"})}),(0,R.jsx)("div",{className:"col-12 col-sm-6 col-lg-5 col-xl-4 mb-4",children:(0,R.jsx)(L.V,{className:"py-2",height:"2rem"})}),(0,R.jsx)("div",{className:"col-12 col-sm-12 col-lg-12 col-xl-10 mb-4",children:(0,R.jsx)(L.V,{className:"py-2",height:"2rem"})}),(0,R.jsx)("div",{className:"col-xl-8 mb-4",children:(0,R.jsx)(L.V,{className:"py-2",height:"8rem"})}),(0,R.jsx)("div",{className:"col-xl-4 mb-4",children:(0,R.jsx)(L.V,{className:"py-2",height:"4rem"})})]})},Za=i(9546),Ta=i(5353),ya=i(6161),Da=i(7175),_a=function(e){var a=e.data,i=e.handleClose,t=e.handleSubmitPedidoGenerar,s=e.fetchPedidoGenerarPOSTData,d=e.formInscripcion,r=e.currentTarifa,u=e.idpedido,h=e.fetchCondicionPagosGETData,v=e.formCobro,f=e.handleInputChangeCobro,N=e.handleFormInscripcion,Z=e.resetformCobro,T=(0,p.useLang)(),y=(0,A.n)({fechacobro:{isOk:!0,msgError:[T("ALERT_OBLIGATORIO_GENER
1ICO")]}}),D=(0,c.Z)(y,3),_=D[0],O=D[1],I=(D[2],Oe(u)),C=(0,c.Z)(I,3),w=C[0],G=C[1];C[2];(0,l.useEffect)((function(){(0,m.iY)(G.status)&&t()}),[G]);var L=(0,l.useState)(""),F=(0,c.Z)(L,2),P=F[0],M=F[1];(0,l.useEffect)((function(){if(a.value&&h){var e,i,t,n=null===h||void 0===h||null===(e=h.data)||void 0===e||null===(i=e.items)||void 0===i||null===(t=i.find((function(e){return e.id===d.idcondicionpago})))||void 0===t?void 0:t.tipocondicionpago;M(n)}else M(""),Z()}),[a.value,h]);return(0,R.jsx)(R.Fragment,{children:(0,R.jsxs)(j.Z,{show:a.value,onHide:i,id:"ModalRegistro",children:[(0,R.jsx)(j.Z.Header,{closeButton:!0,className:"border-bottom-0 py-4",children:(0,R.jsx)(j.Z.Title,{className:"h5",children:T("GENERAR_FACTURA")})}),(0,R.jsx)(j.Z.Body,{className:"px-4 py-0",children:(0,R.jsxs)("section",{className:"row justify-content-center",children:["remesa"===P?(0,R.jsx)(R.Fragment,{}):(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(g.Z.Group,{className:"mb-3 col-12 text-center",children:[(0,R.jsx)(g.Z.Label,{className:"fw-500 d-block",children:T("PARRAFO_FACTURA_HA_SIDO_PAGADA")}),(0,R.jsx)(na.O,{className:"",name:"estado",value:v.estado,values:[{id:"P",nombre:"No"},{id:"C",nombre:"Si"}],onChange:f})]}),"C"===v.estado?(0,R.jsx)(g.Z.Group,{className:"mb-3 col-12 col-md-7 col-lg-6 col-xl-7",children:(0,R.jsx)(E.o,{label:"".concat(T("FECHA_COBRO"),":"),type:"date",name:"fechacobro",value:v.fechacobro,onChange:f,validation:_})}):(0,R.jsx)(R.Fragment,{children:"transferencia"===P&&(0,R.jsx)(g.Z.Group,{className:"mb-3 col-12 col-md-7 col-lg-6 col-xl-7",children:(0,R.jsx)(E.o,{label:T("FECHA_VENCIMIENTO")+":",type:"date",name:"fechavencimiento",value:v.fechavencimiento,onChange:f})})})]}),(0,R.jsx)(g.Z.Group,{className:"mb-3 col-12",children:(0,R.jsx)("div",{className:"row justify-content-center",children:(0,R.jsx)(Da.u,{classNameContainer:"d-inline-block me-4 col flex-grow-0 text-nowrap mt-2",name:"comunicar",value:d.comunicar,values:[{id:"comunicar",nombre:T("NOTIFICAR_POR_EMAIL")}],onChange:function(e){return function(e,a){var i=(0,S.cloneDeep)(d[a]);e.target.checked?i.push(e.target.name):i=i.filter((function(a){return a!==e.target.name})),N((0,x.Z)((0,x.Z)({},d),{},(0,ie.Z)({},a,i)))}(e,"comunicar")}})})})]})}),(0,R.jsxs)(j.Z.Footer,{className:"border-0 d-flex justify-content-between",children:[(0,R.jsx)(de.Z,{variant:"outline-primary",onClick:i,children:T("SALIR")}),(0,R.jsx)(b.X,{variant:"secondary",type:"button",className:"ms-auto",handleSubmit:function(){("C"!==v.estado||O(v))&&w({body:(0,x.Z)((0,x.Z)({},d),{},{inputtotalimportebase:r.totalimportebase,inputtotalimporteiva:(r.importeiva/100*Number(r.totalimportebase)).toFixed(2),idiva:r.idiva})})},fetchDataLoading:[s.loading,G.loading],value:T("GENERAR_FACTURA"),icon:(0,R.jsx)(n.G,{icon:o.r6l,className:"me-1"})})]})]})})},Oa=i(7251),Ia=i(13),Ca=(0,u.Zt)(v());i(5710);var Sa=function(e){var a=e.data,i=e.handleClose,t=e.handleShow,s=e.idpedido,d=e.idproducto,r=e.handleUpdateDates,h=(0,l.useState)({status:0,message:""}),f=(0,c.Z)(h,2),g=f[0],b=f[1],E=(0,p.useLang)(),Z=(0,l.useState)([]),T=(0,c.Z)(Z,2),y=T[0],D=(T[1],(0,N.c)({fechadesde:"",fechahasta:""})),_=(0,c.Z)(D,4),O=_[0],I=(_[1],_[2]),C=_[3],w=(0,N.c)({title:E("EVENTO")}),L=(0,c.Z)(w,4),F=L[0],P=(L[1],L[2],L[3],(0,A.n)({horainicio:{isOk:!0,msgError:[E("ALERT_OBLIGATORIO_GENERICO")]},horafin:{isOk:!0,msgError:[E("ALERT_OBLIGATORIO_GENERICO")]}})),M=(0,c.Z)(P,3),k=(M[0],M[1],M[2],(0,l.useState)({})),V=(0,c.Z)(k,2),U=V[0],B=V[1],H=(0,l.useState)({}),z=(0,c.Z)(H,2),W=z[0],q=z[1],X=(0,l.useState)({start:"",end:""}),J=(0,c.Z)(X,2),Q=J[0],$=J[1],K=function(e){var a=v()(new Date(e.getFullYear(),e.getMonth(),1)).format("YYYY-MM-DD"),i=v()(new Date(e.getFullYear(),e.getMonth()+1,0)).format("YYYY-MM-DD");B({fechainicio:a,fechafin:i})},ee=(0,l.useCallback)((function(e){K(e)}),[]),ae=(0,l.useCallback)((function(e){var a,i,t,n,o=e.children,s=e.value,d="",r=v()(new Date(s)).format("YYYY-MM-DD");F.horainicio===r&&(d="#6bebb0");var c=(0,S.cloneDeep)(Q),u=c.start,m=c.end;return m||(m=u),(null===(a=new Date(s))||void 0===a?void 0:a.getTime())>=(null===(i=new Date(u+"T00:00:00"))||void 0===i?void 0:i.getTime())&&(null===(t=new Date(s))||void 0===t?void 0:t.getTime())<=(null===(n=new Date(m+"T00:00:00"))||void 0===n?void 0:n.getTime())&&(d="#b0efbf"),ie(s,U,W)&&(d="#ffe6e6"),l.cloneElement(l.Children.only(o),{style:(0,x.Z)((0,x.Z)({},o.style),{},{backgroundColor:d})})}),[U,F.horainicio,Q,W]),ie=function(e,a,i){var t=new Date(e),n=v()(new Date(e)).format("YYYY-MM-DD"),o=new Date(a.fechainicio),s=new Date(a.fechafin);return!!((null===o||void 0===o?void 0:o.getTime())<=t.getTime()&&t.getTime()<=(null===s||void 0===s?void 0:s.getTime())&&(6===t.getDay()||0===t.getDay()||i[n]&&"diadecobro"!==i[n]))},te=(0,l.useCallback)((function(e){var a,i,t=e.start,n=(e.end,e.title,String((0,m.iG)(new Date(t))||""));(Q.start||Q.end||$((0,x.Z)((0,x.Z)({},Q),{},{start:n})),Q.start&&!Q.end)&&(Q.start===n?$({start:"",end:""}):(null===(a=new Date(Q.start))||void 0===a?void 0:a.getTime())<=(null===(i=new Date(t))||void 0===i?void 0:i.getTime())?($((0,x.Z)((0,x.Z)({},Q),{},{end:n})),I((0,x.Z)((0,x.Z)({},O),{},{fechadesde:Q.start,fechahasta:n}))):$({start:n,end:""}));Q.start&&Q.end,Q.start&&Q.end&&$({start:n,end:""})}),[Q]),ne=Te(),oe=(0,c.Z)(ne,2),se=oe[0],re=oe[1];(0,l.useEffect)((function(){var e;
1(0,m.iY)(re.status)&&q(null===(e=re.data)||void 0===e?void 0:e.data)}),[re]);var ce=Te(),le=(0,c.Z)(ce,2),ue=le[0],me=le[1];return(0,l.useEffect)((function(){U.fechainicio&&U.fechafin&&se({params:{fechadesde:U.fechainicio,fechahasta:U.fechafin,estricto:!1,idpedido:s,idproducto:d}})}),[U.fechainicio,U.fechafin]),(0,l.useEffect)((function(){Q.start&&Q.end&&ue({params:{fechadesde:Q.start,fechahasta:Q.end,estricto:!0,idpedido:s,idproducto:d}})}),[Q.start,Q.end]),(0,l.useEffect)((function(){var e;((0,m.iY)(me.status)&&b({status:200,message:"Les dates seleccionades s\xf3n correctes"}),(0,m._y)(me.status))&&b({status:400,message:null===me||void 0===me||null===(e=me.error)||void 0===e?void 0:e.message})}),[me]),(0,l.useEffect)((function(){a.value?(K(new Date),b({status:0,message:""})):(C(),B({}),q({}),$({start:"",end:""}))}),[a.value]),(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)(de.Z,{onClick:t,children:[(0,R.jsx)(n.G,{icon:o.fT7,className:"me-1"})," ",E("CAMBIAR_FECHAS")]}),(0,R.jsxs)(j.Z,{show:a.value,onHide:i,id:"ModalRegistro",size:"lg",children:[(0,R.jsx)(j.Z.Header,{closeButton:!0,className:"border-bottom-0 py-4",children:(0,R.jsx)(j.Z.Title,{className:"h5",children:E("GENERAR_FACTURA")})}),(0,R.jsx)(j.Z.Body,{className:"px-4 py-0",children:(0,R.jsxs)("section",{className:"row justify-content-center",children:[(0,R.jsx)("div",{className:"col-12",children:(0,R.jsxs)("section",{className:"position-relative",children:[(0,R.jsx)(u.f,{localizer:Ca,events:y,startAccessor:"start",endAccessor:"end",style:{height:400},onSelectSlot:te,culture:"ca",messages:{week:"Setmana",work_week:"Setmana de treball",day:"Dia",month:"Mes",previous:"<",next:">",today:"Avui",agenda:"El Diari",showMore:function(e){return"+".concat(e," m\xe9s")}},views:{month:!0},selectable:!0,components:{dateCellWrapper:ae},onNavigate:ee}),re.loading&&(0,R.jsx)("div",{className:"d-flex py-5 justify-content-center align-items-center OverlayCalendar__Loading",children:(0,R.jsx)(Se.Z,{animation:"border",role:"status",children:(0,R.jsx)("span",{className:"visually-hidden",children:"Loading..."})})})]})}),(0,R.jsx)("div",{className:"text-center",children:me.loading?(0,R.jsx)("div",{className:"pt-4",children:(0,R.jsx)(Se.Z,{animation:"border",role:"status",children:(0,R.jsx)("span",{className:"visually-hidden",children:"Loading..."})})}):(0,R.jsx)(R.Fragment,{children:g.message?(0,R.jsx)("div",{className:"col-12 mt-4",children:(0,R.jsxs)(Y.Z,{variant:200===(null===g||void 0===g?void 0:g.status)?"success":"danger",className:"my-0 py-2 text-center",children:[null===g||void 0===g?void 0:g.message,": ",(0,G.Nc)((0,G.Fe)(O.fechadesde))," - ",(0,G.Nc)((0,G.Fe)(O.fechahasta))]})}):(0,R.jsx)(R.Fragment,{})})})]})}),(0,R.jsxs)(j.Z.Footer,{className:"border-0 d-flex justify-content-between",children:[(0,R.jsx)("div",{}),200===(null===g||void 0===g?void 0:g.status)&&(0,R.jsxs)(de.Z,{className:"btn btn-primary",onClick:function(){r(Q.start,Q.end)},children:[(0,R.jsx)(n.G,{icon:o.r6l,className:"me-1"}),E("GUARDAR")]})]})]})]})},Ra=function(e){var a,i=e.idpedido,t=(e.handleFetchSuccess,e.formInscripcion),s=e.handleFormInscripcion,d=e.handleInputInscripcion,r=e.fetchPedidoGET,u=e.setcurrentTarifa,h=e.currentTarifa,v=(0,p.useLang)(),f=new Date;f.setDate(f.getDate()+30);var j="".concat(f.getFullYear(),"-").concat(("0"+(f.getMonth()+1)).slice(-2),"-").concat(("0"+f.getDate()).slice(-2)),Z=(0,N.c)({fechacobro:"",estado:"P",fechavencimiento:j,comunicar:[]}),T=(0,c.Z)(Z,4),y=T[0],D=T[1],_=(T[2],T[3]),O=(0,ya.U)(),I=(0,c.Z)(O,3),w=I[0],G=I[1],L=I[2],F=(0,ya.U)(),P=(0,c.Z)(F,3),M=P[0],k=P[1],U=P[2],B=(0,N.c)({}),H=(0,c.Z)(B,4),z=H[0],W=(H[1],H[2],H[3],(0,N.c)({comunicar:[]})),q=(0,c.Z)(W,4),X=q[0],J=(q[1],q[2]),Q=(q[3],v("ALQUILER"),"".concat(z.descripcion),"/".concat(i),(0,A.n)({idpersona:{isOk:!0,msgError:["La persona es obligatoria."]}})),$=(0,c.Z)(Q,3),K=$[0],ee=($[1],$[2],(0,A.n)({idpersonaentidad:{isOk:!0,msgError:["La entidad es obligatoria."]}})),ae=(0,c.Z)(ee,3),te=(ae[0],ae[1],ae[2],(0,A.n)({idcondicionpago:{isOk:!0,msgError:[v("ALERT_OBLIGATORIO_GENERICO")]}
1,ideventotarifa:{isOk:!0,msgError:[v("ALERT_OBLIGATORIO_GENERICO")]}})),ne=(0,c.Z)(te,3),oe=ne[0],de=(ne[1],ne[2],se.P9.GET()),re=(0,ya.U)(),ce=(0,c.Z)(re,3),le=ce[0],ue=ce[1],me=ce[2],he=Ie(i),ve=(0,c.Z)(he,3),pe=ve[0],fe=ve[1];ve[2];(0,l.useEffect)((function(){(0,m.iY)(fe.status)&&(r(),me())}),[fe]);var xe=Oe(i),je=(0,c.Z)(xe,3),ge=je[0],be=je[1];je[2];(0,l.useEffect)((function(){i&&(0,m.iY)(be.status)&&window.location.reload()}),[be]);var Ee=Ce(),Ne=(0,c.Z)(Ee,3),Ae=Ne[0],Ze=Ne[1],Te=(Ne[2],Oa.R.GET()),ye=(0,c.Z)(Te,2),De=ye[0],_e=ye[1];(0,l.useEffect)((function(){De({params:{limit:200}})}),[]);var Se=Ia.J.PATCH_CAMBIAR_ESTADO(),Re=(0,c.Z)(Se,2),we=Re[0],Ge=Re[1];(0,l.useEffect)((function(){var e,a,i,t,n,o;(0,m.iY)(Ze.status)&&(!function(e){we({id:e+"/actualizar",body:y})}((null===Ze||void 0===Ze||null===(e=Ze.data)||void 0===e||null===(a=e.data)||void 0===a||null===(i=a.facturas)||void 0===i||null===(t=i[0])||void 0===t||null===(n=t.cobros)||void 0===n||null===(o=n[0])||void 0===o?void 0:o.idcobro)||""),L())}),[Ze]),(0,l.useEffect)((function(){(0,m.iY)(Ge.status)&&(window.location.href="https://enginyersgp.cat/admin/alquiler-aparatos-admin/alquileres/"+i+"/facturas")}),[Ge]);var Le=(0,l.useState)(!1),Fe=(0,c.Z)(Le,2),Pe=Fe[0],Me=Fe[1];return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("div",{className:"d-flex justify-content-between align-items-center",children:[(0,R.jsxs)("div",{className:"d-flex align-items-center",children:[(0,R.jsx)("h5",{className:"mb-3 mb-lg-0 ",children:v("DATOS_ALQUILER")}),(0,R.jsx)(Y.Z,{variant:"info",className:"my-0 py-1 px-2 ms-2",children:de[null===t||void 0===t?void 0:t.estado]||""})]}),(0,R.jsx)(Za.Z,{align:"end",variant:"outline-primary",title:(0,R.jsx)("span",{className:"me-1",children:v("CAMBIAR_ESTADO")}),id:"dropdown-menu-align-end",className:"ms-auto",children:null===(a=(0,ra.x)(de))||void 0===a?void 0:a.map((function(e){return(0,R.jsx)(Ta.Z.Item,{onClick:function(){return ue({id:e.id})},children:e.nombre})}))})]}),(0,R.jsxs)("div",{className:"py-3 px-4 card mt-3 mb-5",children:[(0,R.jsxs)("div",{className:"row",children:[(0,R.jsx)(da,{formInscripcion:t,valuesValidationPersona:K,handleFormInscripcion:s,handleInputInscripcion:d,idpedido:i}),(0,R.jsx)("div",{className:"col-12 py-2"}),(0,R.jsx)(g.Z.Group,{className:"mb-3 col-12 col-sm-6 col-md-4",children:(0,R.jsx)(E.o,{label:"".concat(v("FECHA_DESDE"),":"),type:"date",name:"fechadesde",value:t.fechadesde,onChange:d,readonly:!0})}),(0,R.jsx)(g.Z.Group,{className:"mb-3 col-12 col-sm-6 col-md-4",children:(0,R.jsx)(E.o,{label:"".concat(v("FECHA_HASTA"),":"),type:"date",name:"fechahasta",value:t.fechahasta,onChange:d,readonly:!0})}),(0,R.jsx)("div",{className:"col mb-3 d-flex align-items-end",children:i&&(0,R.jsx)(Sa,{handleShow:k,handleClose:U,data:M,idpedido:i,idproducto:t.idproducto,handleUpdateDates:function(e,a){e&&a&&(Me(!0),s((0,x.Z)((0,x.Z)({},t),{},{fechadesde:e,fechahasta:a})),U())}})}),(0,R.jsx)("div",{className:"col-12"}),(0,R.jsx)(ca,{formInscripcion:t,valuesValidationPersona:K,handleFormInscripcion:s,handleInputInscripcion:d,valuesValidationStep2:oe,idpedido:i,importetotal:t.importetotal,currentTarifa:h,setcurrentTarifa:u,setchangeTarifaFlag:Me,changeTarifaFlag:Pe}),(0,R.jsx)(ua,{formInscripcion:t,valuesValidationPersona:K,handleFormInscripcion:s,handleInputInscripcion:d,idpedido:i})]}),(0,R.jsxs)("div",{className:"d-flex justify-content-between border-top pt-3 flex-wrap mt-3",children:[t.facturado?(0,R.jsx)("p",{className:"mb-0",children:v("P_GUARDAR_NO_GENERAR")}):(0,R.jsx)(b.X,{variant:"outline-secondary",type:"button",className:"me-auto",handleSubmit:G,value:v("GENERAR_FACTURA"),icon:(0,R.jsx)(n.G,{icon:o.UO1,className:"me-1"})}),(0,R.jsx)(b.X,{variant:"secondary",type:"submit",className:"ms-auto",handleSubmit:function(){ge({body:(0,x.Z)((0,x.Z)({},t),{},{inputtotalimportebase:h.totalimportebase,inputtotalimporteiva:(h.importeiva/100*Number(h.totalimportebase)).toFixed(2),idiva:h.idiva})})},fetchDataLoading:[be.loading],value:v("GUARDAR"),icon:(0,R.jsx)(n.G,{icon:o.r6l})})]})]}),(0,R.jsx)(V.W,{handleClose:me,show:le.value,onClickOK:function(){pe({body:{estado:le.id,comunicar:0===X.comunicar.length}})},messageHTML:(0,R.jsxs)(R.Fragment,{children:[(0,R.jsxs)("h5",{className:"text-center fw-normal fs-115 mb-4 pb-2",children:[v("PARRAFO_SEGURO_CAMBIAR_ESTADO_A"),": ",de[le.id],"?"]}),(0,R.jsx)(g.Z.Group,{className:"mb-0 col-12",children:(0,R.jsx)("div",{className:"row justify-content-center",children:(0,R.jsx)(Da.u,{name:"comunicar",value:X.comunicar,values:[{id:"comunicar",nombre:v("NO_COMUNICAR")}],onChange:function(e){return function(e,a){var i=(0,S.cloneDeep)(X[a]);e.target.checked?i.push(e.target.name):i=i.filter((function(a){return a!==e.target.name})),J((0,x.Z)((0,x.Z)({}
1,X),{},(0,ie.Z)({},a,i)))}(e,"comunicar")},classNameContainer:"d-inline-block me-4 w-auto"})})})]}),textOnClickOk:v("SI_CAMBIAR_ESTADO"),fetchData:fe,disableBtnClose:!0}),(0,R.jsx)(C.D,{fetchData:Ze}),(0,R.jsx)(C.D,{fetchData:fe}),(0,R.jsx)(C.D,{fetchData:be}),(0,R.jsx)(_a,{data:w,handleClose:L,handleSubmitPedidoGenerar:function(){Ae({body:t})},fetchPedidoGenerarPOSTData:Ze,currentTarifa:h,formInscripcion:t,handleFormInscripcion:s,idpedido:i,fetchCondicionPagosGETData:_e,handleInputChangeCobro:D,resetformCobro:_,formCobro:y})]})},wa=function(e){e.idpedido;var a,i,s=e.formInscripcion,d=(0,p.useLang)(),r=(0,t.s0)();return(0,R.jsxs)(R.Fragment,{children:[(0,R.jsx)("h5",{className:"mb-3",children:d("FACTURAS")}),(0,R.jsxs)(re.Z,{bordered:!0,responsive:!0,children:[(0,R.jsx)("thead",{children:(0,R.jsxs)("tr",{children:[(0,R.jsx)("th",{children:(0,R.jsx)("small",{children:d("FACTURA")})}),(0,R.jsx)("th",{children:(0,R.jsx)("small",{children:d("FECHA_FACTURA")})}),(0,R.jsx)("th",{children:(0,R.jsx)("small",{children:d("ESTADO")})}),(0,R.jsx)("th",{className:"text-center"})]})}),(0,R.jsxs)("tbody",{children:[null===(a=s.facturas)||void 0===a?void 0:a.map((function(e){return(0,R.jsxs)("tr",{children:[(0,R.jsx)("td",{children:(0,R.jsx)("small",{children:e.numerofactura||e.numeroproforma||""})}),(0,R.jsx)("td",{children:(0,R.jsx)("small",{children:(0,G.Nc)((0,G.Fe)(e.fechafactura))})}),(0,R.jsx)("td",{children:(0,R.jsx)("small",{children:e.estado})}),(0,R.jsx)("td",{className:"text-center text-nowrap",valign:"middle",children:(0,R.jsx)(de.Z,{onClick:function(){return r("/facturacion/facturas/".concat(e.idfactura))},className:"",size:"sm",children:(0,R.jsx)(n.G,{icon:o.gJF,className:"mx-1"})})})]})})),0===(null===(i=s.facturas)||void 0===i?void 0:i.length)&&(0,R.jsx)("tr",{children:(0,R.jsx)("td",{colSpan:20,className:"text-center py-5",children:d("PARRAFO_NO_HAY_DATOS_PARA_MOSTRAR")})})]})]})]})},Ga=function(e){e.pathName;var a,i=(0,t.UO)(),n=(0,l.useState)({}),o=(0,c.Z)(n,2),s=o[0],u=o[1],h=String(i.id)||"",v="nuevo"===h,f=(0,p.useLang)(),j=(0,N.c)({idpersona:"",idproducto:"",idpersonaentidad:"",idcondicionpago:"",ideventotarifa:"",observaciones:"",nombre_completo:"",abona:"P",comunicar:[],facturar:[],fechadesde:"",fechahasta:"",idproductotarifa:"",idpedido:h||"",nombrepersona:""}),g=(0,c.Z)(j,4),b=g[0],E=g[1],A=g[2],Z=g[3],T=[{title:f("ALQUILERES"),link:"/alquiler-aparatos-admin/alquileres"},{title:"".concat(f("APARATO"),": ").concat(b.producto||""),link:"/".concat(h)}],y=De(h),D=(0,c.Z)(y,2),_=D[0],O=D[1],I=function(){Z(),_()};(0,l.useEffect)((function(){I()}),[h]),(0,l.useEffect)((function(){var e,a,i,t,n,o,s,d,r,c,l,h,v,p;(0,m.iY)(O.status)&&(A((0,x.Z)((0,x.Z)((0,x.Z)({},b),O.data),{},{nombre_completo:null===(e=O.data)||void 0===e?void 0:e.nombrepersona})),u({totalimportebase:Number((null===(a=O.data)||void 0===a||null===(i=a.pedidos_productos)||void 0===i||null===(t=i[0])||void 0===t?void 0:t.precio)||0),importeiva:Number((null===(n=O.data)||void 0===n||null===(o=n.pedidos_productos)||void 0===o||null===(s=o[0])||void 0===s||null===(d=s.iva)||void 0===d?void 0:d.porcentajeiva)||0),totalimportetotal:Number((null===(r=O.data)||void 0===r||null===(c=r.pedidos_productos)||void 0===c||null===(l=c[0])||void 0===l?void 0:l.importetotal)||0),idiva:(null===(h=O.data)||void 0===h||null===(v=h.pedidos_productos)||void 0===v||null===(p=v[0])||void 0===p?void 0:p.idiva)||""}))}),[O]);var C={datosGenerales:{title:f("DATOS_ALQUILER"),link:"datos-generales"},facturas:{title:f("FACTURAS"),link:"facturas"}},S=(0,l.useState)({value:!1,payload:{}}),w=(0,c.Z)(S,2),G=w[0],L=w[1],F=(0,l.useState)(!1),P=(0,c.Z)(F,2),M=P[0],k=P[1];return(0,l.useEffect)((function(){b.idpedido&&(b.idpersona||b.idpersonaentidad)&&k(!0)}),[b]),(0,R.jsxs)("div",{className:"container-fluid",children:[(0,R.jsxs)("div",{className:"row justify-content-center",children:[(0,R.jsx)("div",{className:"col-12",children:(0,R.jsx)("div",{className:"d-flex justify-content-between align-items-center mb-1 flex-wrap",children:(0,R.jsx)(d.i,{BreadcrumbLineItems:T})})}),!v&&(0,R.jsx)("div",{className:"col-lg-3 mb-4",children:(0,R.jsx)(r.J,{values:C})}),(0,R.jsx)("div",{className:"col-lg-9 animate__animated animate__fadeInUp",children:O.loading||!M?(0,R.jsx)("div",{className:"card p-3",children:(0,R.jsx)(Aa,{})}):(0,R.jsxs)(t.Z5,{children:[(0,R.jsx)(t.AW,{path:"datos-generales",element:(0,R.jsx)(Ra,{idpedido:h,nuevo:v,formInscripcion:b,handleInputInscripcion:E,fetchPedidoGET:_,fetchPedidoGETData:O,handleFormInscripcion:A,currentTarifa:s,setcurrentTarifa:u,handleFetchSuccess:I})}),(0,R.jsx)(t.AW,{path:"facturas",element:(0,R.jsx)(wa,{idpedido:h,formInscripcion:b})}),(0,R.jsx)(t.AW,{path:"*",element:(0,R.jsx)(t.Fg,{to:"datos-generales",replace:!0})})]})})]}),(0,R.jsx)(V.W,{handleClose:function(){return L({value:!1,payload:{}})},show:G.value,messageHTML:(0,R.jsxs)("h5",{className:"text-center fw-normal",children:[f("PARRAFO_SEGURO_CAMBIAR_ESTADO_EVENTO_A")," ",null===(a=G.payload)||void 0===a?void 0:a.nombre,"?"]}),textOnClickOk:f("SI_CAMBIAR")})]})};function La(e){var a=e.pathRoot,i=(0,p.useLang)(),d=[{icon:(0,R.jsx)(n.G,{icon:o.SZw}),title:i("ALQUILERES"),link:"".concat(a,"/alquileres")},{icon:(0,R.jsx)(n.G,{icon:o.klh}),title:i("APARATOS"),link:"".concat(a,"/aparatos")},{icon:(0,R.jsx)(n.G,{icon:o.b7W}),title:i("PARAMETROS"),link:"".concat(a,"/parametros")}];return(0,R.jsx)("section",{className:"LayoutMain animate__animated animate__fadeIn",children:(0,R.jsxs)(s.Z,{label:i("GESTOR_DE_CONTENIDOS"),children:[(0,R.jsx)(s.Z.NavLinks,{navLinks:d}),(0,R.jsx)(s.Z.Body,{children:(0,R.jsxs)(t.Z5,{children:[(0,R.jsx)(t.AW,{path:"alquileres",element:(0,R.jsx)(Na,{})}),(0,R.jsx)(t.AW,{path:"alquileres/:id/*",element:(0,R.jsx)(Ga,{})}),(0,R.jsx)(t.AW,{path:"aparatos",element:(0,R.jsx)(ea,{})}),(0,R.jsx)(t.AW,{path:"aparatos/:id/*",element:(0,R.jsx)(We,{pathName:"aparatos"})}),(0,R.jsx)(t.AW,{path:"Parametros/*",element:(0,R.jsx)(k,{})}),(0,R.jsx)(t.AW,{path:"*",element:(0,R.jsx)(t.Fg,{to:"".concat(a,"/alquileres"),replace:!0})})]})})]})})}},3935:function(e,a,i){i.d(a,{q:function(){return c},C:function(){return r}});var t=i(1153),n=i(1413),o=i(6812),s={GET:{receive:{schema:function(e){var a;return e||(e={}),{id:e.idinscripcion||"",estado:e.estado||"",fecha:(0,o.Nc)((0,o.Fe)(e.fecha)),importe:e.importe||"",label__importe:e.importe?e.importe+" \u20ac":"",nombre_completo:(null===(a=e.persona)||void 0===a?void 0:a.nombre_completo)||"",habilitarcertificado:e.habilitarcertificado||!1}},adapter:function(e){var a,i,t=this,n=null===e||void 0===e||null===(a=e.data)||void 0===a?void 0:a.data,o=null===n||void 0===n||null===(i=n.data)||void 0===i?void 0:i.map((function(e){return t.schema(e)}));return{data:{total:null===n||void 0===n?void 0:n.total,per_page:null===n||void 0===n?void 0:n.per_page,current_page:null===n||void 0===n?void 0:n.current_page,items:o},status:null===e||void 0===e?void 0:e.status}}}},GET_EXCEL:{receive:{schema:function(e){return e||(e={}),{data:e.data,headers:e.headers}},adapter:function(e){var a=e;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){e||(e={});return{}},adapter:function(e){var a=this.schema(e);return(0,n.Z)({},a)}}},POST:{receive:{schema:function(e){return e||(e={}),{data:e.data,message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){return e||(e={}),{idpersona:e.idpersona||"",idevento:e.idevento||"",idpersonaentidad:e.idpersonaentidad||"",idcondicionpago:e.idcondicionpago||"",ideventotarifa:e.ideventotarifa||"",observaciones:e.observaciones||""}},adapter:function(e){var a=this.schema(e);return(0,n.Z)({},a)}}},PATCH:{receive:{schema:function(e){return e||(e={}),{data:e.data,message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){return e||(e={}),{ideventotarifa:e.id||"",idevento:e.idevento||"",idserviciolinea:e.idserviciolinea||"",tarifa:e.tarifa||"",tarifaaplicadaa:e.tarifaaplicadaa||"",precio:e.precio||"",idiva:e.idiva||"",importeiva:e.importeiva||"",importe:e.importe||""}},adapter:function(e){var a=this.schema(e);return(0,n.Z)({},a)}}},DELETE:{receive:{schema:function(e){return e||(e={}),{message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}}},POST_ENVIAR_EMAILS_MASIVOS:{receive:{schema:function(e){return e||(e={}),{message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){e||(e={});var a={comunicacion:e.comunicacion||"",asunto:e.asunto||"",tipo:e.tipo||"",idtiponotificacion:e.idtiponotificacion||"",idweb:e.idweb||"",remitentenombre:e.remitentenombre||"",remitenteemail:e.remitenteemail||"",filtros:e.filtros||{},lista_ids:e.lista_ids||{},lista_exclusion:e.lista_exclusion||{},adjunto:e.adjunto||""};return(0,o.JD)(a)},adapter:function(e){var a=this.schema(e);return(0,n.Z)({},a)}}},PATCH_ACTUALIZAR_CERTIFICADO:{receive:{schema:function(e){return e||(e={}),{data:e.data,message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){return e||(e={}),{lista:e.lista||{}}},adapter:function(e){var a=this.schema(e);return(0,n.Z)({},a)}}}},d={GET:{receive:{schema:function(e){var a,i;return e||(e={}),{id:e.idinscripcion||"",idpersona:e.idpersona||"",abona:e.abona||"",idevento:e.idevento||"",idpersonaentidad:e.idpersonaentidad||"",idcondicionpago:(null===(a=e.condicion_pago)||void 0===a?void 0:a.idcondicionpago)||"",ideventotarifa:e.ideventotarifa||"",observaciones:e.observaciones||"",facturas_lineas:e.facturas_lineas||[],nombre_completo:(null===(i=e.persona)||void 0===i?void 0:i.nombre_completo)||"",estado:e.estado||"",facturar:(0,o.Bm)(e.facturar,"facturar"),comunicar:(0,o.Bm)(e.comunicar,"comunicar")}},adapter:function(e){var a,i=null===e||void 0===e||null===(a=e.data)||void 0===a?void 0:a.data,t=this.schema(i);return{data:(0,n.Z)({},t),status:null===e||void 0===e?void 0:e.status}}}},POST:{receive:{schema:function(e){return e||(e={}),{data:e.data,message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){return e||(e={}),{idpersona:e.idpersona||"",idevento:e.idevento||"",idpersonaentidad:e.idpersonaentidad||"",idcondicionpago:e.idcondicionpago||"",ideventotarifa:e.ideventotarifa||"",observaciones:e.observaciones||"",facturar:(0,o.i6)(e.facturar),comunicar:(0,o.i6)(e.comunicar)}},adapter:function(e){var a=this.schema(e);return(0,n.Z)({},a)}}},PATCH:{receive:{schema:function(e){return e||(e={}),{data:e.data,message:e.message,status:e.status}},adapter:function(e){var a=null===e||void 0===e?void 0:e.data;return{data:this.schema(a),status:null===e||void 0===e?void 0:e.status}}},send:{schema:function(e){return e||(e={}),{idpersona:e.idpersona||"",idevento:e.idevento||"",idpersonaentidad:e.idpersonaentidad||"",idcondicionpago:e.idcondicionpago||"",ideventotarifa:e.ideventotarifa||"",observaciones:e.observaciones||"",estado:e.estado||"",facturar:(0,o.i6)(e.facturar),comunicar:(0,o.i6)(e.comunicar)}},adapter:function(e){var a=this.schema(e);return(0,n.Z)({},a)}}}},r={GET:function(e){return(0,t.b)({method:"get",url:"/inscripciones/inscripciones",type:"json",adapters:s.GET})},GET_EXCEL:function(){return(0,t.b)({method:"get",url:"/inscripciones/inscripciones",type:"blob",adapters:s.GET_EXCEL})},POST:function(){return(0,t.b)({method:"post",url:"/inscripciones/inscripcion-admin",type:"json",adapters:s.POST})},PATCH:function(e){return(0,t.b)({method:"patch",url:"/inscripciones/inscripcion-admin/".concat(e),type:"json",adapters:s.PATCH})},DELETE:function(e){return(0,t.b)({method:"delete",url:"/inscripciones/inscripcion-admin/".concat(e),type:"json",adapters:s.DELETE})},POST_ENVIAR_EMAILS_MASIVOS:function(){return(0,t.b)({method:"post",url:"/inscripciones/inscripciones-admin/notificaciones/enviar",type:"json",adapters:s.POST_ENVIAR_EMAILS_MASIVOS})},PATCH_ACTUALIZAR_CERTIFICADO:function(){return(0,t.b)({method:"patch",url:"/inscripciones/plantillas-certificados/inscripciones-status/update",type:"json",adapters:s.PATCH_ACTUALIZAR_CERTIFICADO})}},c={GET:function(){return(0,t.b)({method:"get",url:"/inscripciones/inscripciones",type:"json",adapters:d.GET})},POST:function(){return(0,t.b)({method:"post",url:"/inscripciones/inscripcion-admin",type:"json",adapters:d.POST})},PATCH:function(e){return(0,t.b)({method:"patch",url:"/inscripciones/inscripcion-admin/".concat(e),type:"json",adapters:d.PATCH})},DELETE:function(e){return(0,t.b)({method:"delete",url:"/inscripciones/inscripcion-admin/".concat(e),type:"json",adapters:s.DELETE})}}},5852:function(){}}]);
2//# sourceMappingURL=188.d121bb34.chunk.js.map

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.