(this.webpackJsonpportal_facturacion=this.webpackJsonpportal_facturacion||[]).push([[0],{330:function(e,a,t){},331:function(e,a,t){},422:function(e,a,t){"use strict";t.r(a);var n=t(0),i=t.n(n),c=t(22),r=t.n(c),s=(t(330),t(331),t(26)),o=t(94),l=t(101),d=t(29),u=t.n(d),j=t(47),b=t(57),m=t(8),p=t(130),h=t.n(p),O=t(46),g="https://www.servicioscorona.mx/WSBAMAPV/Service.asmx",f={baseURL:g,mode:"no-cors",method:"post",dataType:"text/xml",headers:{Accept:"application/xml","Content-Type":"text/xml;charset=utf-8","Access-Control-Allow-Origin":"*",SOAPAction:"http://tempuri.org/GetInfoCliente"}},x=(t.n(O).a.create(f),t(161)),v=t.n(x),C=t(52),y=t(27),S=t(515),F=t(527),_=t(284),k=t(522),E=t(523),T=t(142),A=t(134),w=t(526),N=t(509),D=t(441),I=t(437),P=t(104),R=t(528),M=t(529),B=t(434),U=t(209),q=t(141),W=t(534),J=t(530),z=t(524),$=t(533),V=t(519),L=t(517),G=t(518),H=t(508),Y=t(520),Z=t(532),X=t(516),K=t(253),Q=t.n(K),ee=t(87),ae=t(103),te=t(274),ne=t.n(te),ie=t(137),ce=t.n(ie),re=t(273),se=t.n(re),oe=t(115),le=t.n(oe),de=(t(371),t(124)),ue=t(190),je=t(188),be=t(96),me=t(430),pe=(t(382),t(260)),he=t(248),Oe=t(276),ge={aws_project_region:"us-east-1",oauth:{},aws_appsync_graphqlEndpoint:"https://7dblk23lorhdzmowv5aier4k3u.appsync-api.us-east-1.amazonaws.com/graphql",aws_appsync_region:"us-east-1",aws_appsync_authenticationType:"API_KEY",aws_appsync_apiKey:"da2-wvrcduvkrngdzmonftwih77c7y"},fe="\n mutation Bamaws(\n $service_config: AWSJSON\n $update_database_size: AWSJSON\n $confirm_update: AWSJSON\n $get_sync: AWSJSON\n $get_sync_time: AWSJSON\n $get_status_daily_sync: AWSJSON\n $get_script: AWSJSON\n $sync: AWSJSON\n $sync_str: AWSJSON\n $check_version: AWSJSON\n $sync_sales_dailys_conviene: AWSJSON\n $params: AWSJSON\n $InsertBreakdownCash: AWSJSON\n ) {\n bamaws(\n service_config: $service_config\n update_database_size: $update_database_size\n confirm_update: $confirm_update\n get_sync: $get_sync\n get_sync_time: $get_sync_time\n get_status_daily_sync: $get_status_daily_sync\n get_script: $get_script\n sync: $sync\n sync_str: $sync_str\n check_version: $check_version\n sync_sales_dailys_conviene: $sync_sales_dailys_conviene\n params: $params\n InsertBreakdownCash: $InsertBreakdownCash\n )\n }\n";pe.default.configure(ge);var xe=function(){var e=Object(b.a)(u.a.mark((function e(a,t){var n;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,he.a.graphql(Object(Oe.b)(fe,{service_config:JSON.stringify({url:g,method:a,headers:{"Content-Type":"text/xml;charset=UTF-8"}}),params:JSON.stringify(t)}));case 2:return n=e.sent,e.abrupt("return",n);case 4:case"end":return e.stop()}}),e)})));return function(a,t){return e.apply(this,arguments)}}(),ve=function e(a,t,n){return new Promise((function(i,c){he.a.graphql(Object(Oe.b)(a,t)).then((function(c){var r=Object.keys(c.data);n=c.data[r]&&"string"!==typeof c.data[r]&&"items"in c.data[r]?Array.isArray(n)?n.concat(c.data[r].items):c.data[r].items:c.data[r],c.data[r]&&"string"!==typeof c.data[r]&&c.data[r].nextToken?i(e(a,Object(o.a)(Object(o.a)({},t),{},{nextToken:c.data[r].nextToken}),n)):i(n)})).catch((function(r){if(r.data){var s=Object.keys(r.data);n=r.data[s]&&"string"!==typeof r.data[s]&&"items"in r.data[s]?Array.isArray(n)?n.concat(r.data[s].items):r.data[s].items:r.data[s],r.data[s]&&"string"!==typeof r.data[s]&&r.data[s].nextToken?i(e(a,Object(o.a)(Object(o.a)({},t),{},{nextToken:r.data[s].nextToken}),n)):i(n)}else c(r.errors)}))}))},Ce=t(511),ye=t(512),Se=t(513),Fe=t(514),_e=t(2),ke=function(e){var a=Object.assign({},e).handleFormError,t=i.a.useState(!0),n=Object(m.a)(t,2),c=n[0],r=n[1],s=function(){a(),r(!1)};return Object(_e.jsx)("div",{children:Object(_e.jsxs)(Ce.a,{open:c,onClose:function(){return s()},"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(_e.jsx)(ye.a,{id:"alert-dialog-title",children:Object(_e.jsxs)($.a,{sx:{display:"flex",p:1,m:1,borderRadius:10,bgcolor:"#0939B0",justifyContent:"center"},children:[Object(_e.jsx)("img",{alt:"logo",style:{padding:1,maxHeight:60,maxWidth:60},src:"https://ilacad.com/BO/img/empresa/Mexico_TiendasBama_Logo.png"}),Object(_e.jsx)($.a,{sx:{p:1,m:1,color:"#EDEFF3",fontSize:20,fontWeight:"bold"},children:"Facturaci\xf3n"})]})}),Object(_e.jsx)(Se.a,{dividers:!0,children:Object(_e.jsx)(T.a,{gutterBottom:!0,children:"Favor de completar los campos obligatorios para poder continuar"})}),Object(_e.jsx)(Fe.a,{children:Object(_e.jsx)(P.a,{variant:"contained",color:"primary",onClick:function(){return s()},autoFocus:!0,children:"Aceptar"})})]})})},Ee=function(e){var a=Object.assign({},e),t=a.confirmationAccepted,i=a.handleConfirmation,c=Object(n.useState)(!0),r=Object(m.a)(c,2),s=r[0],o=r[1],l=function(){o(!1),i()};return Object(_e.jsx)("div",{children:Object(_e.jsxs)(Ce.a,{open:s,onClose:function(){return l()},children:[Object(_e.jsx)(ye.a,{children:Object(_e.jsxs)($.a,{sx:{display:"flex",p:1,m:1,borderRadius:10,bgcolor:"#0939B0",justifyContent:"center"},children:[Object(_e.jsx)("img",{alt:"logo",style:{padding:1,maxHeight:60,maxWidth:60},src:"https://ilacad.com/BO/img/empresa/Mexico_TiendasBama_Logo.png"}),Object(_e.jsx)($.a,{sx:{p:1,m:1,color:"#EDEFF3",fontSize:20,fontWeight:"bold"},children:"Confirmaci\xf3n de datos"})]})}),Object(_e.jsxs)(Se.a,{dividers:!0,children:[Object(_e.jsx)(T.a,{gutterBottom:!0,children:"\xbfEsta seguro de que desea continuar con la facturacion?."}),Object(_e.jsx)(T.a,{gutterBottom:!0,children:"Favor de revisar que los datos sean correctos antes de continuar."})]}),Object(_e.jsxs)(Fe.a,{children:[Object(_e.jsx)(P.a,{variant:"contained",color:"primary",onClick:function(){return l()},autoFocus:!0,children:"Cancelar"}),Object(_e.jsx)(P.a,{variant:"contained",color:"primary",onClick:function(){return l(),void t()},autoFocus:!0,children:"Continuar"})]})]})})},Te=function(e){var a=Object.assign({},e),t=a.person,i=a.setPerson,c=a.isUpd,r=(a.exist,a.type),s=a.setExistRFC,o=a.setIsUpd,l=a.company,d=a.setNoChangeSave,p=a.setUpdateDone,h=a.setFormError,O=a.setCurrent,f=Object(ee.b)().enqueueSnackbar,x=a.getInfo,v=Object(n.useState)(0),C=Object(m.a)(v,2),y=(C[0],C[1],Object(n.useState)(!1)),F=Object(m.a)(y,2),_=F[0],k=F[1],E=Object(n.useState)(null),T=Object(m.a)(E,2),w=(T[0],T[1]),N=Object(n.useState)(!1),D=Object(m.a)(N,2),I=D[0],R=D[1],M=Object(n.useState)(!1),U=Object(m.a)(M,2),q=U[0],W=U[1],J=Object(n.useState)(!1),z=Object(m.a)(J,2),$=z[0],V=z[1],L=Object(n.useState)(!1),G=Object(m.a)(L,2),H=(G[0],G[1],Object(n.useState)(!1)),Y=Object(m.a)(H,2),Z=Y[0],X=Y[1],K=Object(n.useState)(!0),Q=Object(m.a)(K,2),ae=Q[0],te=Q[1],ne=Object(n.useState)(!1),ie=Object(m.a)(ne,2),ce=ie[0],re=ie[1],se=Object(n.useState)(null),oe=Object(m.a)(se,2),le=oe[0],pe=oe[1],he=Object(n.useState)(!1),Oe=Object(m.a)(he,2),ge=Oe[0],xe=Oe[1],Ce=Object(n.useState)(!1),ye=Object(m.a)(Ce,2),Se=ye[0],Fe=ye[1],ke=Object(n.useState)(null),Te=Object(m.a)(ke,2),Ae=Te[0],we=Te[1],Ne=Object(n.useState)(!0),De=Object(m.a)(Ne,2),Ie=De[0],Pe=De[1],Re=Object(n.useState)([]),Me=Object(m.a)(Re,2),Be=Me[0],Ue=Me[1],qe=Object(n.useState)([]),We=Object(m.a)(qe,2),Je=We[0],ze=We[1],$e=Object(n.useState)(!1),Ve=Object(m.a)($e,2),Le=Ve[0],Ge=Ve[1],He=Object(n.useState)(!1),Ye=Object(m.a)(He,2),Ze=Ye[0],Xe=Ye[1],Ke=Object(n.useState)(!1),Qe=Object(m.a)(Ke,2),ea=Qe[0],aa=Qe[1],ta=Object(n.useState)(!1),na=Object(m.a)(ta,2),ia=na[0],ca=na[1],ra=[{clave:"601",descripcion:"General de Ley Personas Morales",fisica:!1,moral:!0},{clave:"603",descripcion:"Personas Morales con Fines no Lucrativos",fisica:!1,moral:!0},{clave:"605",descripcion:"Sueldos y Salarios e Ingresos Asimilados a Salarios",fisica:!0,moral:!1},{clave:"606",descripcion:"Arrendamiento",fisica:!0,moral:!1},{clave:"607",descripcion:"R\xe9gimen de Enajenaci\xf3n o Adquisici\xf3n de Bienes",fisica:!0,moral:!1},{clave:"608",descripcion:"Dem\xe1s ingresos",fisica:!0,moral:!1},{clave:"609",descripcion:"Consolidaci\xf3n",fisica:!0,moral:!0},{clave:"610",descripcion:"Residentes en el Extranjero sin Establecimiento Permanente en M\xe9xico",fisica:!0,moral:!0},{clave:"611",descripcion:"Ingresos por Dividendos (socios y accionistas)",fisica:!0,moral:!1},{clave:"612",descripcion:"Personas F\xedsicas con Actividades Empresariales y Profesionales",fisica:!0,moral:!1},{clave:"614",descripcion:"Ingresos por intereses",fisica:!0,moral:!1},{clave:"615",descripcion:"R\xe9gimen de los ingresos por obtenci\xf3n de premios",fisica:!0,moral:!1},{clave:"616",descripcion:"Sin obligaciones fiscales",fisica:!0,moral:!1},{clave:"620",descripcion:"Sociedades Cooperativas de Producci\xf3n que optan por diferir sus ingresos",fisica:!1,moral:!0},{clave:"621",descripcion:"Incorporaci\xf3n Fiscal",fisica:!0,moral:!1},{clave:"622",descripcion:"Actividades Agr\xedcolas, Ganaderas, Silv\xedcolas y Pesqueras",fisica:!1,moral:!0},{clave:"623",descripcion:"Opcional para Grupos de Sociedades",fisica:!1,moral:!0},{clave:"624",descripcion:"Coordinados",fisica:!1,moral:!0},{clave:"625",descripcion:"R\xe9gimen de las Actividades Empresariales con ingresos a trav\xe9s de Plataformas Tecnol\xf3gicas",fisica:!0,moral:!1},{clave:"626",descripcion:"R\xe9gimen Simplificado de Confianza",fisica:!0,moral:!0},{clave:"628",descripcion:"Hidrocarburos",fisica:!0,moral:!0},{clave:"629",descripcion:"De los Reg\xedmenes Fiscales Preferentes y de las Empresas Multinacionales",fisica:!0,moral:!0},{clave:"630",descripcion:"Enajenaci\xf3n de acciones en bolsa de valores",fisica:!0,moral:!0}],sa=[{clave:"G01",descripcion:"Adquisici\xf3n de mercancias",fisica:!0,moral:!0,clavesRegimen:["601","603","606","612","620","621","622","623","624","625","626"]},{clave:"G02",descripcion:"Devoluciones, descuentos o bonificaciones",fisica:!0,moral:!0,clavesRegimen:["601","603","606","612","620","621","622","623","624","625","626"]},{clave:"G03",descripcion:"Gastos en general",fisica:!0,moral:!0,clavesRegimen:["601","603","606","612","620","621","622","623","624","625","626"]},{clave:"I01",descripcion:"Construcciones",fisica:!0,moral:!0,clavesRegimen:["601","603","606","612","620","621","622","623","624","625","626"]},{clave:"I02",descripcion:"Mobilario y equipo de oficina por inversiones",fisica:!0,moral:!0,clavesRegimen:["601","603","606","612","620","621","622","623","624","625","626"]},{clave:"I03",descripcion:"Equipo de transporte",fisica:!0,moral:!0,clavesRegimen:["601","603","606","612","620","621","622","623","624","625","626"]},{clave:"I04",descripcion:"Equipo de computo y accesorios",fisica:!0,moral:!0,clavesRegimen:["601","603","606","612","620","621","622","623","624","625","626"]},{clave:"I05",descripcion:"Dados, troqueles, moldes, matrices y herramental",fisica:!0,moral:!0,clavesRegimen:["601","603","606","612","620","621","622","623","624","625","626"]},{clave:"I06",descripcion:"Comunicaciones telef\xf3nicas",fisica:!0,moral:!0,clavesRegimen:["601","603","606","612","620","621","622","623","624","625","626"]},{clave:"I07",descripcion:"Comunicaciones satelitales",fisica:!0,moral:!0,clavesRegimen:["601","603","606","612","620","621","622","623","624","625","626"]},{clave:"I08",descripcion:"Otra maquinaria y equipo",fisica:!0,moral:!0,clavesRegimen:["601","603","606","612","620","621","622","623","624","625","626"]},{clave:"D01",descripcion:"Honorarios m\xe9dicos, dentales y gastos hospitalarios",fisica:!0,moral:!1,clavesRegimen:["605","606","607","608","611","612","614","615","625"]},{clave:"D02",descripcion:"Gastos m\xe9dicos por incapacidad o discapacidad",fisica:!0,moral:!1,clavesRegimen:["605","606","607","608","611","612","614","615","625"]},{clave:"D03",descripcion:"Gastos funerales",fisica:!0,moral:!1,clavesRegimen:["605","606","607","608","611","612","614","615","625"]},{clave:"D04",descripcion:"Donativos",fisica:!0,moral:!1,clavesRegimen:["605","606","607","608","611","612","614","615","625"]},{clave:"D05",descripcion:"Intereses reales efectivamente pagados por cr\xe9ditos hipotecarios (casa habitaci\xf3n)",fisica:!0,moral:!1,clavesRegimen:["605","606","607","608","611","612","614","615","625"]},{clave:"D06",descripcion:"Aportaciones voluntarias al SAR",fisica:!0,moral:!1,clavesRegimen:["605","606","607","608","611","612","614","615","625"]},{clave:"D07",descripcion:"Primas por seguros de gastos m\xe9dicos",fisica:!0,moral:!1,clavesRegimen:["605","606","607","608","611","612","614","615","625"]},{clave:"D08",descripcion:"Gastos de transportaci\xf3n escolar obligatoria",fisica:!0,moral:!1,clavesRegimen:["605","606","607","608","611","612","614","615","625"]},{clave:"D09",descripcion:"Dep\xf3sitos en cuentas para el ahorro, primas que tengan como base planes de pensiones",fisica:!0,moral:!1,clavesRegimen:["605","606","607","608","611","612","614","615","625"]},{clave:"D10",descripcion:"Pagos por servicios educativos (colegiaturas)",fisica:!0,moral:!1,clavesRegimen:["605","606","607","608","611","612","614","615","625"]},{clave:"S01",descripcion:"Sin efectos fiscales",fisica:!0,moral:!0,clavesRegimen:["601","603","605","606","607","608","610","611","612","614","615","616","620","621","622","623","624","625","626"]},{clave:"CP01",descripcion:"Pagos",fisica:!0,moral:!0,clavesRegimen:["601","603","605","606","607","608","610","611","612","614","615","616","620","621","622","623","624","625","626"]},{clave:"CN01",descripcion:"N\xf3mina",fisica:!0,moral:!1,clavesRegimen:["605"]}];function oa(){var e;!da(t)&&t.Regimen&&(e=t.Regimen,"fisica"==r?ze(sa.filter((function(a){return a.clavesRegimen.includes(e)&&1==a.fisica}))):"moral"==r&&ze(sa.filter((function(a){return a.clavesRegimen.includes(e)&&1==a.moral}))))}Object(n.useEffect)((function(){da(t)||Ze||("fisica"==r?Ue(ra.filter((function(e){return 1==e.fisica}))):"moral"==r&&Ue(ra.filter((function(e){return 1==e.moral}))),ma(),Xe(!0))}),[a.person,Je,ea,ia]);var la=function(e,a){"Regimen"===e&&(ca(!0),te(!1)),"CatUsoCFDI_SAT"===e&&(aa(!0),Pe(!1));var n=t;try{n[e]=a}catch(c){console.log(c)}i(n),w(a),ma()},da=function(e){return!e||!Object.keys(e).length},ua=function(){var e;return"fisica"===r&&(e=t.NomPropio.trim()+" "+t.ApPaterno.trim()+" "+t.ApMaterno.trim()),"undefined"!==t.EntreCalles&&void 0!==t.EntreCalles||(t.EntreCalles=""),"undefined"!==t.Tel&&void 0!==t.Tel&&"NaN"!==t.Tel||(t.Tel=""),"undefined"!==t.Calle&&void 0!==t.Calle||(t.Calle=""),"undefined"!==t.NomDelegacion&&void 0!==t.NomDelegacion||(t.NomDelegacion=""),"undefined"!==t.Col&&void 0!==t.Col||(t.Col=""),"undefined"!==t.ClaCd&&void 0!==t.ClaCd||(t.ClaCd=""),"undefined"!==t.NomEdo&&void 0!==t.NomEdo||(t.NomEdo=""),c?JSON.stringify({infoFactura4_0:{NomConsi:"fisica"===r?e.toUpperCase().trim():t.NomConsi.toUpperCase().trim(),Calle:t.Calle.toUpperCase().trim(),Col:t.Col.toUpperCase().trim(),ClaCd:t.ClaCd.toUpperCase().trim(),NomDelegacion:t.NomDelegacion.toUpperCase().trim(),NomEdo:t.NomEdo.toUpperCase().trim(),Cp:t.CP,Rfc:t.RFC,Email:t.EMail,UsoCFDI:t.CatUsoCFDI_SAT,ClaConsi:t.ClaConsi,ClaEmp:1,Regimen:t.Regimen,EntreCalles:t.EntreCalles.toUpperCase().trim(),Tel:t.Tel,NomPropio:"fisica"===r?t.NomPropio.toUpperCase().trim():"",Ap:"fisica"===r?t.ApPaterno.toUpperCase().trim():"",Am:"fisica"===r?t.ApMaterno.toUpperCase().trim():"",DesglosaIEPSSiNo:t.DesglosaIEPSSiNo,TipoCteSHCP:t.TipoCteSHCP},sEmpresa:l}):JSON.stringify({infoFactura4_0:{ClaEmp:1,ClaConsi:t.ClaConsi,NomConsi:"fisica"===r?e.toUpperCase().trim():t.NomConsi.toUpperCase().trim(),Calle:t.Calle.toUpperCase().trim(),Col:t.Col.toUpperCase().trim(),ClaCd:t.ClaCd.toUpperCase().trim(),NomDelegacion:t.NomDelegacion.toUpperCase().trim(),NomEdo:t.NomEdo.toUpperCase().trim(),Cp:t.CP,EntreCalles:t.EntreCalles.toUpperCase().trim(),Tel:t.Tel,Rfc:t.RFC,ClaAgeVta:2029,ClaZona:4,ClaRutaEmb:1,ClaGiroCom:1,TipoCteSHCP:t.TipoCteSHCP,Ap:"fisica"===r?t.ApPaterno.toUpperCase().trim():"",Am:"fisica"===r?t.ApMaterno.toUpperCase().trim():"",NomPropio:"fisica"===r?t.NomPropio.toUpperCase().trim():"",Email:t.EMail,Regimen:t.Regimen,UsoCFDI:t.CatUsoCFDI_SAT,DesglosaIEPSSiNo:t.DesglosaIEPSSiNo,ClaPlantilla:0,TipoPrograma:0},sEmpresa:l})},ja=function(e){if(e){e.trim();return e.replace(/(\s{2,})/g," ")}},ba=function(e){return/^\s*$/.test(e)},ma=function(){(oa(),t&&t.RFC&&""!==t.RFC)?new RegExp("^[A-Z,\xd1,&]{3,4}[0-9]{2}[0-1][0-9][0-3][0-9][A-Z,0-9]?[A-Z,0-9]?[0-9,A-Z]?$").test(t.RFC)?X(!1):(we("Ingresa un RFC valido"),X(!0)):(X(!0),we("Campo obligatorio"));ia&&(t&&t.Regimen&&""!==t.Regimen?te(!1):te(!0)),ea&&(t&&t.CatUsoCFDI_SAT&&""!==t.CatUsoCFDI_SAT?Pe(!1):Pe(!0)),"fisica"===r?t&&t.NomPropio&&""!==t.NomPropio&&" "!==t.NomPropio&&!ba(t.NomPropio)?R(!1):R(!0):t&&t.NomConsi&&""!==t.NomConsi&&" "!==t.NomConsi&&!ba(t.NomConsi)?W(!1):W(!0),10===t.TipoCteSHCP&&(!t.ApPaterno||""===t.ApPaterno||" "===t.ApPaterno||ba(t.ApPaterno)?V(!0):V(!1)),!t||1!==parseInt(t.DesglosaIEPSSiNo)&&0!==parseInt(t.DesglosaIEPSSiNo)||""===t.DesglosaIEPSSiNo?Fe(!0):Fe(!1),t&&t.EMail&&""!==t.EMail?/^(([^<>()[\]\\.,;:\s@\"]+(\.[^<>()[\]\\.,;:\s@\"]+)*)|(\".+\"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t.EMail)?(re(!1),pe("")):(re(!0),pe("Ingresa un email valido")):(re(!0),pe("Campo obligatorio")),t&&t.CP&&""!==t.CP?xe(!1):xe(!0)},pa=function(){var e=0;return Z&&e++,ge&&e++,"fisica"===r?I&&e++:q&&e++,10===t.TipoCteSHCP&&$&&e++,ae&&e++,Ie&&e++,Se&&e++,ce&&e++,e>0?(h(!0),!1):(h(!1),!0)},ha=function(){var e=Object(b.a)(u.a.mark((function e(){var a,n,i;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,pa();case 2:if(e.sent){e.next=5;break}return e.abrupt("return");case 5:a=ua(),console.log("XMLdata: "+a),c?(k(!0),n={service_config:JSON.stringify({url:g,method:"UpdateCustomerRenew",headers:Object(j.a)({},"Content-Type","text/xml;charset=UTF-8")}),params:a},ve(fe,n).then((function(e){var a=JSON.parse(e);try{a?(f("Informaci\xf3n guardada correctamente",{variant:"success"}),O(t),s(!0),o(!0),d(!1),p(!0),x()):f("Ocurrio un error al intentar guardar la informaci\xf3n",{variant:"error"})}catch(n){f("Ocurrio un error al intentar guardar la informaci\xf3n",{variant:"error"})}finally{k(!1)}}))):(k(!0),i={service_config:JSON.stringify({url:g,method:"InsertCustomerRenew",headers:Object(j.a)({},"Content-Type","text/xml;charset=UTF-8")}),params:a},ve(fe,i).then((function(e){var a=JSON.parse(e);try{a?(f("Informaci\xf3n guardada correctamente",{variant:"success"}),O(t),s(!0),o(!0),d(!1),p(!0),x()):f("Ocurrio un error al intentar guardar la informaci\xf3n",{variant:"error"})}catch(n){f("Ocurrio un error al intentar guardar la informaci\xf3n",{variant:"error"})}finally{k(!1)}})));case 8:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();function Oa(){ma(),Ge(!Le)}return Object(_e.jsxs)(S.a,{container:!0,style:{marginTop:20,margin:0,width:"100%"},spacing:3,direction:"row",justifyContent:"space-between",children:[Object(_e.jsx)(S.a,{item:!0,xs:12,md:"fisica"===r?3:9,children:Object(_e.jsx)(A.a,{disabled:_,required:!0,error:"fisica"===r?I:q,fullWidth:!0,id:"first_name",label:"fisica"===r?"Nombre (s)":"Raz\xf3n social",onChange:"fisica"===r?function(e){return la("NomPropio",e.target.value)}:function(e){return la("NomConsi",e.target.value)},defaultValue:da(t)?"":ja("fisica"===r?t.NomPropio:t.NomConsi),helperText:("fisica"===r?I:q)&&"Campo obligatorio"})}),"fisica"===r&&Object(_e.jsx)(S.a,{item:!0,xs:12,md:3,children:Object(_e.jsx)(A.a,{disabled:_,required:!0,error:$,helperText:$&&"Campo obligatorio",fullWidth:!0,id:"flast_name",label:"Apellido Paterno",onChange:function(e){return la("ApPaterno",e.target.value)},defaultValue:null!==t?ja(t.ApPaterno):""})}),"fisica"===r&&Object(_e.jsx)(S.a,{item:!0,xs:12,md:3,children:Object(_e.jsx)(A.a,{disabled:_,fullWidth:!0,id:"plast_name",label:"Apellido Materno",onChange:function(e){return la("ApMaterno",e.target.value)},defaultValue:null!==t?ja(t.ApMaterno):""})}),Object(_e.jsx)(S.a,{item:!0,xs:12,md:3,children:Object(_e.jsx)(A.a,{disabled:c,required:!0,fullWidth:!0,error:Z,helperText:Z&&Ae,id:"rfc",label:"RFC",InputProps:{readOnly:c},onChange:function(e){return la("RFC",e.target.value)},defaultValue:!da(t)&&t.RFC})}),Object(_e.jsx)(S.a,{item:!0,xs:12,md:1,children:Object(_e.jsxs)(de.a,{style:{width:"100%"},error:Se,children:[Object(_e.jsx)(ue.a,{required:!0,id:"label-select-IEPS",children:"Desglose de IEPS"}),Object(_e.jsxs)(je.a,{disabled:_,error:Se,labelId:"select-IEPS",id:"id-Select-IEPS",defaultValue:da(t)?"":t.DesglosaIEPSSiNo,value:da(t)?1:t.DesglosaIEPSSiNo,onChange:function(e){return la("DesglosaIEPSSiNo",e.target.value)},children:[Object(_e.jsx)(be.a,{value:1,children:"SI"}),Object(_e.jsx)(be.a,{value:0,children:"NO"})]}),Se&&Object(_e.jsx)(me.a,{children:"Campo obligatorio"})]})}),Object(_e.jsx)(S.a,{item:!0,xs:12,md:4,children:Object(_e.jsxs)(de.a,{style:{width:"100%"},error:Se,children:[Object(_e.jsx)(ue.a,{required:!0,id:"label-select-IEPS",children:"R\xe9gimen Fiscal"}),Object(_e.jsxs)(je.a,{disabled:_,error:ae,labelId:"select-IEPS",id:"id-Select-IEPS",onChange:function(e){return la("Regimen",e.target.value)},children:[Object(_e.jsx)(be.a,{value:"",selected:!0,disabled:!0,children:"Selecciona una opci\xf3n"},"empty"),Be.map((function(e){return Object(_e.jsx)(be.a,{value:e.clave,children:e.descripcion},e.clave)}))]}),ae&&Object(_e.jsx)(me.a,{children:"Campo obligatorio"})]})}),Object(_e.jsx)(S.a,{item:!0,xs:12,md:4,children:Object(_e.jsxs)(de.a,{style:{width:"100%"},error:Se,children:[Object(_e.jsx)(ue.a,{required:!0,id:"label-select-IEPS",children:"Uso CFDI"}),Object(_e.jsxs)(je.a,{disabled:_,error:Ie,labelId:"select-IEPS",id:"id-Select-IEPS",defaultValue:function(){Pe(!0)},onChange:function(e){return la("CatUsoCFDI_SAT",e.target.value)},children:[Object(_e.jsx)(be.a,{value:"",selected:!0,disabled:!0,children:"Selecciona una opci\xf3n"},"empty"),!da(t)&&t.Regimen&&Je&&Je.map((function(e){return Object(_e.jsx)(be.a,{value:e.clave,children:e.descripcion},e.clave)}))]}),Ie&&Object(_e.jsx)(me.a,{children:"Campo obligatorio"})]})}),Object(_e.jsx)(S.a,{item:!0,xs:12,md:3,children:Object(_e.jsx)(A.a,{disabled:_,required:!0,error:ce,helperText:le,id:"email",label:"Correo electr\xf3nico",fullWidth:!0,onChange:function(e){return la("EMail",e.target.value)},defaultValue:null!==t?t.EMail:""})}),Object(_e.jsx)(S.a,{item:!0,xs:12,md:3,children:Object(_e.jsx)(A.a,{disabled:_,id:"tel",label:"Tel\xe9fono",fullWidth:!0,onChange:function(e){return la("Tel",e.target.value)},defaultValue:null!==t&&"NaN"!==t.Tel?t.Tel:"",onInput:function(e){var a=new RegExp("[0-9]+");e.target.value&&a.test(e.target.value)?e.target.value=Math.max(0,parseInt(e.target.value)).toString().slice(0,10):e.target.value=""}})}),Object(_e.jsx)(S.a,{item:!0,xs:12,md:3,children:Object(_e.jsx)(A.a,{disabled:_,fullWidth:!0,id:"addres",label:"Calle",onChange:function(e){return la("Calle",e.target.value)},defaultValue:null!==t?t.Calle:"",onInput:function(e){e.target.value&&void 0!==e.target.value&&"undefined"!==e.target.value?e.target.value=e.target.value:e.target.value=""}})}),Object(_e.jsx)(S.a,{item:!0,xs:12,md:3,children:Object(_e.jsx)(A.a,{disabled:_,fullWidth:!0,id:"Between_streets",label:"Entre calles",onChange:function(e){return la("EntreCalles",e.target.value)},defaultValue:null!==t&&"undefined"!==t.EntreCalles?t.EntreCalles:"",onInput:function(e){e.target.value&&void 0!==e.target.value&&"undefined"!==e.target.value?e.target.value=e.target.value:e.target.value=""}})}),Object(_e.jsx)(S.a,{item:!0,xs:12,md:3,children:Object(_e.jsx)(A.a,{disabled:_,fullWidth:!0,id:"delegacion",label:"Delegaci\xf3n \xf3 Municipio",onChange:function(e){return la("NomDelegacion",e.target.value)},defaultValue:null!==t?t.NomDelegacion:"",onInput:function(e){e.target.value&&void 0!==e.target.value&&"undefined"!==e.target.value?e.target.value=e.target.value:e.target.value=""}})}),Object(_e.jsx)(S.a,{item:!0,xs:12,md:3,children:Object(_e.jsx)(A.a,{disabled:_,fullWidth:!0,id:"colony",label:"Colonia",onChange:function(e){return la("Col",e.target.value)},defaultValue:null!==t?t.Col:"",onInput:function(e){e.target.value&&void 0!==e.target.value&&"undefined"!==e.target.value?e.target.value=e.target.value:e.target.value=""}})}),Object(_e.jsx)(S.a,{item:!0,xs:12,md:3,children:Object(_e.jsx)(A.a,{disabled:_,fullWidth:!0,id:"city",label:"Ciudad",onChange:function(e){return la("ClaCd",e.target.value)},defaultValue:null!==t?t.ClaCd:"",onInput:function(e){e.target.value&&void 0!==e.target.value&&"undefined"!==e.target.value?e.target.value=e.target.value:e.target.value=""}})}),Object(_e.jsx)(S.a,{item:!0,xs:12,md:2,children:Object(_e.jsx)(A.a,{disabled:_,fullWidth:!0,id:"state",label:"Estado",onChange:function(e){return la("NomEdo",e.target.value)},defaultValue:null!==t?t.NomEdo:"",onInput:function(e){e.target.value&&void 0!==e.target.value&&"undefined"!==e.target.value?e.target.value=e.target.value:e.target.value=""}})}),Object(_e.jsx)(S.a,{item:!0,xs:12,md:1,children:Object(_e.jsx)(A.a,{disabled:_,required:!0,error:ge,helperText:ge&&"Campo obligatorio",fullWidth:!0,id:"cp",label:"C.P",onChange:function(e){return la("CP",e.target.value)},defaultValue:null!==t?t.CP:"",onInput:function(e){var a=new RegExp("[0-9]+");e.target.value&&a.test(e.target.value)?e.target.value=e.target.value.toString().slice(0,5):e.target.value=""}})}),Object(_e.jsx)(S.a,{item:!0,style:{textAlign:"right",display:"flex"},children:Object(_e.jsxs)(P.a,{disabled:_,loading:_,variant:"contained",color:"primary",style:{marginTop:"auto"},onClick:function(){return Oa()},children:[c?"Siguiente":"Guardar informaci\xf3n",_&&Object(_e.jsx)(B.a,{size:25,style:{marginLeft:15}})]})}),Le&&Object(_e.jsx)(Ee,{confirmationAccepted:function(){ha()},handleConfirmation:Oa})]})},Ae=t(211),we=t(521),Ne=t(271),De=t.n(Ne),Ie=t(272),Pe=t.n(Ie),Re=function(e){var a=e.rows,t=e.remove,i=e.selected,c=e.setSelected,r=Object(l.a)(e,["rows","remove","selected","setSelected"]),s=Object(n.useState)([]),o=Object(m.a)(s,2),d=(o[0],o[1]);Object(n.useEffect)((function(){r.list&&r.selected&&(d(r.rows),c(r.selected))}),[]);var u=[{id:"FolioDo",numeric:!1,label:"Folio"},{id:"FecEmi",numeric:!1,label:"Fecha de emisi\xf3n"},{id:"SubTotal",numeric:!1,label:"SubTotal"},{id:"IVA",numeric:!1,label:"IVA"},{id:"Total",numeric:!1,label:"Total"},{id:"Facturado",numeric:!1,label:"Facturado"},{id:"pdf",numeric:!1,label:"PDF"},{id:"xml",numeric:!1,label:"XML"},{id:"Acciones",numeric:!1,label:"Acciones"}],j=function(e){if(e.target.checked){var t=[];return a.map((function(e){"0"===e.FacturadoSiNo&&t.push(e.FolioDocCte)})),void c(t)}c([])},b=function(e){var a=e.item,t=e.type,n=(Object(l.a)(e,["item","type"]),le()(a.FecHoraFac,"YYYY/MM/DD")),i=n.format("MMMM").substring(0,3).toUpperCase(),c=n.format("YYYY"),r="https://z6z3as6qstptmgitgsj7imv63a0wxvxd.lambda-url.us-east-1.on.aws/?url=http://documents.bamaglobal.com.mx/Facturas/".concat(i).concat(c,"/").concat(a.NomArch,".").concat(t);return console.log("urlDownload :::: ",a,r),a.NomArch?Object(_e.jsx)(ae.a,{children:Object(_e.jsx)(X.a,{target:"_blank",href:r,download:a.NomArch+"."+t,color:"inherit",style:{display:"flex"},children:Object(_e.jsx)(ce.a,{style:{margin:"auto"}})})}):Object(_e.jsx)(U.a,{title:"Archivo no disponible - Te sugerimos acudir a tu Tienda BAMA m\xe1s cercana para resolver este inconveniente.",placement:"top-start",children:Object(_e.jsx)(ae.a,{children:Object(_e.jsx)(De.a,{style:{margin:"auto"}})})})},p=function(e){var t=0;return a.map((function(e){"1"!==e.FacturadoSiNo&&t++})),Object(_e.jsx)(L.a,{children:Object(_e.jsxs)(G.a,{children:[Object(_e.jsx)(H.a,{padding:"checkbox",children:Object(_e.jsx)(Ae.a,{indeterminate:i.length>0&&i.length0&&i.length===t,onChange:j,inputProps:{"aria-label":"select all desserts"}})}),u.map((function(e){return Object(_e.jsx)(H.a,{align:"center",padding:e.disablePadding?"none":"default",children:e.label},e.id)}))]})})};return Object(_e.jsxs)(V.a,{"aria-labelledby":"tableTitle","aria-label":"enhanced table",children:[Object(_e.jsx)(p,{numSelected:i.length}),Object(_e.jsx)(Y.a,{children:a.map((function(e,a){var n="enhanced-table-checkbox-".concat(a),r=function(e){return-1!==i.indexOf(e.FolioDocCte)}(e);return Object(_e.jsxs)(G.a,{role:"checkbox","aria-checked":e.checked,tabIndex:-1,children:[Object(_e.jsx)(H.a,{padding:"checkbox",children:"1"!==e.FacturadoSiNo&&Object(_e.jsx)(Ae.a,{onChange:function(){return function(e){var a=i.indexOf(e.FolioDocCte),t=[];-1===a?t=t.concat(i,e.FolioDocCte):0===a?t=t.concat(i.slice(1)):a===i.length-1?t=t.concat(i.slice(0,-1)):a>0&&(t=t.concat(i.slice(0,a),i.slice(a+1))),c(t)}(e)},checked:r,disabled:"1"===e.FacturadoSiNo,inputProps:{"aria-labelledby":n}})}),Object(_e.jsx)(H.a,{component:"th",id:n,scope:"row",padding:"none",children:e.FolioDocCte}),Object(_e.jsx)(H.a,{align:"center",children:le()(e.FecEmi).format("DD/MM/YYYY")}),Object(_e.jsx)(H.a,{align:"center",children:"1"===e.FacturadoSiNo?"-":"$"+e.SubTotal}),Object(_e.jsx)(H.a,{align:"center",children:"1"===e.FacturadoSiNo?"-":"$"+e.IVA}),Object(_e.jsx)(H.a,{align:"center",children:"1"===e.FacturadoSiNo?"-":"$"+e.Total}),Object(_e.jsx)(H.a,{align:"center",children:"1"===e.FacturadoSiNo&&Object(_e.jsx)(we.a,{})}),Object(_e.jsx)(H.a,{align:"center",children:"1"===e.FacturadoSiNo&&Object(_e.jsx)(b,{item:e,type:"pdf"})}),Object(_e.jsx)(H.a,{align:"center",children:"1"===e.FacturadoSiNo&&Object(_e.jsx)(b,{item:e,type:"xml"})}),Object(_e.jsx)(H.a,{align:"center",children:Object(_e.jsx)(U.a,{title:"Remover",children:Object(_e.jsx)(ae.a,{children:Object(_e.jsx)(Pe.a,{onClick:function(){return t(e.FolioDocCte)}})})})})]},e.FolioDocCte)}))})]})},Me=function(e){var a=e.checkIn,t=e.rows,i=e.setRows,c=e.selected,r=e.setSelected,s=e.verifyCaptcha,o=e.chekCaptchaChekIn,d=e.errorCaptcha,j=e.showChaptchaChekIn,p=e.company,O=e.validateChanges,g=(Object(l.a)(e,["checkIn","rows","setRows","selected","setSelected","verifyCaptcha","chekCaptchaChekIn","errorCaptcha","showChaptchaChekIn","company","validateChanges"]),Object(ee.b)().enqueueSnackbar),f=Object(n.useState)(null),x=Object(m.a)(f,2),C=x[0],y=x[1],F=Object(n.useState)(null),_=Object(m.a)(F,2),w=_[0],N=_[1],D=Object(n.useState)(!1),I=Object(m.a)(D,2),R=I[0],M=I[1],U=function(e){return t.find((function(a){return a.FolioDocCte===e}))},q=function(){y(""),N("")},W=function(){var e=Object(b.a)(u.a.mark((function e(){var a,n,c,r,s,o;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(O()){e.next=3;break}return e.abrupt("return");case 3:if(!U(C.trim())){e.next=8;break}return g("Este folio ya se ha agregado!",{variant:"warning"}),q(),e.abrupt("return");case 8:return a=t,M(!0),n='\n \n \n \n *FOLIO*\n *company*\n 1\n \n \n'.replace("*FOLIO*",C.trim()).replace("*company*",p),e.prev=12,e.next=15,xe("GetInfoTicket",n);case 15:c=e.sent,r=(new h.a).parseFromString(c.data.bamaws),s=r.children[0].children[0].children[0].children[1].children[0].children[1==r.children[0].children[0].children[0].children[1].children[0].children.length?0:r.children[0].children[0].children[0].children[1].children[0].children.length-1].children,o={},s.forEach((function(e){o[e.name]=e.value})),o.id=o.FolioDocCte,o.cheked=!0,"0"===o.FacturadoSiNo?parseFloat(o.Total)===parseFloat(w)?(a.push(o),i(a),g("Ticket agregado correctamente!",{variant:"success"}),q()):g("Ticket no encontrado!",{variant:"error"}):(a.push(o),i(a),g("Ticket agregado correctamente!",{variant:"success"}),q()),e.next=28;break;case 25:e.prev=25,e.t0=e.catch(12),g("No se encontraron datos",{variant:"error"});case 28:return e.prev=28,M(!1),e.finish(28);case 31:case"end":return e.stop()}}),e,null,[[12,25,28,31]])})));return function(){return e.apply(this,arguments)}}(),J=function(){var e=Object(b.a)(u.a.mark((function e(a){var n,c;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=[],-1!==(c=t.findIndex((function(e){return e.FolioDocCte===a})))&&t.splice(c,1),n=n.concat(t),i(n),q();case 6:case"end":return e.stop()}}),e)})));return function(a){return e.apply(this,arguments)}}();return Object(_e.jsx)(k.a,{style:{marginTop:30},children:Object(_e.jsxs)(E.a,{children:[Object(_e.jsx)(T.a,{color:"textPrimary",gutterBottom:!0,children:Object(_e.jsx)("strong",{children:"Tickets a facturar"})}),Object(_e.jsx)(z.a,{}),Object(_e.jsxs)(S.a,{container:!0,style:{marginTop:20},spacing:3,children:[Object(_e.jsx)(S.a,{item:!0,xs:3,children:Object(_e.jsx)(A.a,{label:"Folio",name:"folio",fullWidth:!0,disabled:R,value:C,onChange:function(e){return y(e.target.value)}})}),Object(_e.jsx)(S.a,{item:!0,xs:3,children:Object(_e.jsx)(A.a,{label:"Monto",name:"monto",fullWidth:!0,disabled:R,value:w,onChange:function(e){return N(e.target.value)}})}),Object(_e.jsxs)(S.a,{item:!0,xs:3,style:{display:"flex",position:"relative"},children:[Object(_e.jsx)(P.a,{variant:"contained",color:"primary",fullWidth:!0,disabled:R||!C&&!w,style:{marginTop:"auto"},onClick:function(){return W()},children:"Agregar Ticket"}),R&&Object(_e.jsx)(B.a,{size:24,style:{position:"absolute",top:"55%",left:"50%",marginTop:-12,marginLeft:-12}})]}),Object(_e.jsx)(S.a,{item:!0,xs:9,children:Object(_e.jsx)(Re,{rows:t,remove:J,selected:c,setSelected:r})}),Object(_e.jsxs)(S.a,{item:!0,xs:4,children:[Object(_e.jsx)("form",{method:"POST",className:d?"captchaError":null,children:j&&Object(_e.jsx)(v.a,{sitekey:"300a1762-be85-481e-9591-7aec78e6408b",onVerify:function(e,a){return s(e,a)}})}),d&&Object(_e.jsx)(T.a,{variant:"caption",display:"block",gutterBottom:!0,style:{color:"red"},children:"*Debes indicar que eres humano*"}),t.lenght,Object(_e.jsx)(P.a,{variant:"contained",color:"primary",fullWidth:!0,disabled:c.length<1||!o,style:{marginTop:10},onClick:a,children:"Facturar"})]})]})]})})};function Be(){var e=n.useState(!0),a=Object(m.a)(e,2),t=a[0],i=a[1],c=function(){i(!t)};return Object(_e.jsx)("div",{children:Object(_e.jsxs)(Ce.a,{open:t,onClose:c,"aria-labelledby":"alert-dialog-title","aria-describedby":"alert-dialog-description",children:[Object(_e.jsx)(ye.a,{id:"alert-dialog-title",children:Object(_e.jsxs)($.a,{sx:{display:"flex",p:1,m:1,borderRadius:10,bgcolor:"#0939B0",border:"5px dashed #F1EE0C",justifyContent:"center"},children:[Object(_e.jsx)("img",{alt:"logo",style:{paddingTop:5,paddingBottom:5,maxHeight:120,maxWidth:120},src:"https://ilacad.com/BO/img/empresa/Mexico_TiendasBama_Logo.png"}),Object(_e.jsx)($.a,{sx:{p:5,m:1,color:"#EDEFF3",fontSize:20,fontWeight:"bold"},children:"COMUNICADO CFDI 4.0"})]})}),Object(_e.jsxs)(Se.a,{dividers:!0,children:[Object(_e.jsx)(T.a,{gutterBottom:!0,children:"A partir del 1ro de enero de 2023, nuestro portal de facturaci\xf3n se actualiza a la nueva versi\xf3n 4.0 de conformidad con las nuevas disposiciones fiscales publicadas por el SAT, por lo tanto, es requerido validar que sus datos fiscales obligatorios se capturen conforme a la constancia de situaci\xf3n fiscal: RFC, Nombre o Raz\xf3n Social, c\xf3digo postal y uso de CFDI."}),Object(_e.jsx)(T.a,{gutterBottom:!0,children:Object(_e.jsxs)($.a,{sx:{p:1,m:1,color:"#0535AD",fontSize:11,fontWeight:"Light",textAlign:"center"},children:[Object(_e.jsx)("strong",{children:"NOTA:"})," Usted podr\xe1 descargar y consultar sus datos fiscales directamente de la p\xe1gina del SAT ingresando con su RFC y contrase\xf1a o firma electr\xf3nica, en la opci\xf3n \u201cGenera tu constancia de Situaci\xf3n Fisca",Object(_e.jsx)("p",{children:Object(_e.jsx)(X.a,{href:"https://www.sat.gob.mx/aplicacion/53027/genera-tu-constancia-de-situacion-fiscal",target:"_blank",children:"https://www.sat.gob.mx/aplicacion/53027/genera-tu-constancia-de-situacion-fiscal"})})]})})]}),Object(_e.jsx)(Fe.a,{children:Object(_e.jsx)(P.a,{variant:"contained",color:"primary",autoFocus:!0,onClick:c,children:"Aceptar"})})]})})}var Ue='\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n *folios*\n \n \n \n 1\n 1\n *claconsi*\n *company*\n \n \n',qe=t(531),We=t(535),Je=t(525);function ze(e){var a=Object.assign({},e),t=a.msg,n=a.type,i=a.link;return Object(_e.jsx)("div",{children:function(){switch(n){case 0:return Object(_e.jsxs)(We.a,{variant:"outlined",severity:"error",children:[Object(_e.jsx)(Je.a,{children:"Error"}),t]});case 1:return i?Object(_e.jsxs)(We.a,{variant:"outlined",severity:"info",children:[Object(_e.jsx)(Je.a,{children:"Nota"}),t,Object(_e.jsx)("p",{children:Object(_e.jsx)(X.a,{href:"https://www.sat.gob.mx/aplicacion/53027/genera-tu-constancia-de-situacion-fiscal",target:"_blank",children:"https://www.sat.gob.mx/aplicacion/53027/genera-tu-constancia-de-situacion-fiscal"})})]}):Object(_e.jsxs)(We.a,{variant:"outlined",severity:"info",children:[Object(_e.jsx)(Je.a,{children:"Nota"}),t]});case 2:return Object(_e.jsxs)(We.a,{variant:"outlined",severity:"warning",children:[Object(_e.jsx)(Je.a,{children:"Alerta"}),t]});case 3:return Object(_e.jsxs)(We.a,{variant:"outlined",severity:"success",children:[Object(_e.jsx)(Je.a,{children:"\xc9xito"}),t]});default:return null}}()})}var $e=Object(C.a)((function(e){return{modal:{display:"flex",alignItems:"center",justifyContent:"center"},paper:{backgroundColor:e.palette.background.paper,boxShadow:e.shadows[5],padding:e.spacing(2,4,3),"&:hover":{outline:"none"},"&:focus":{outline:"none"}}}})),Ve=function(e){le.a.lang("es",{months:"Enero_Febrero_Marzo_Abril_Mayo_Junio_Julio_Agosto_Septiembre_Octubre_Noviembre_Diciembre".split("_"),monthsShort:"Enero._Feb._Mar_Abr._May_Jun_Jul._Ago_Sept._Oct._Nov._Dec.".split("_"),weekdays:"Domingo_Lunes_Martes_Miercoles_Jueves_Viernes_Sabado".split("_"),weekdaysShort:"Dom._Lun._Mar._Mier._Jue._Vier._Sab.".split("_"),weekdaysMin:"Do_Lu_Ma_Mi_Ju_Vi_Sa".split("_")});var a=$e(),t=Object(y.a)(),c=Object(n.useState)(!1),r=Object(m.a)(c,2),s=r[0],d=r[1],p=Object(n.useState)(!1),O=Object(m.a)(p,2),f=O[0],x=O[1],C=Object(n.useState)(10),K=Object(m.a)(C,2),te=K[0],ie=K[1],re=Object(n.useState)(null),oe=Object(m.a)(re,2),de=oe[0],ue=oe[1],je=Object(n.useState)([]),be=Object(m.a)(je,2),me=be[0],pe=be[1],he=Object(n.useState)(!1),Oe=Object(m.a)(he,2),ge=Oe[0],Ee=Oe[1],Ae=Object(n.useState)(!1),we=Object(m.a)(Ae,2),Ne=we[0],De=we[1],Ie=Object(n.useState)(1),Pe=Object(m.a)(Ie,2),Re=Pe[0],We=Pe[1],Je=Object(n.useState)(null),Ve=Object(m.a)(Je,2),Le=Ve[0],Ge=Ve[1],He=Object(n.useState)(null),Ye=Object(m.a)(He,2),Ze=Ye[0],Xe=Ye[1],Ke=Object(n.useState)(null),Qe=Object(m.a)(Ke,2),ea=(Qe[0],Qe[1]),aa=Object(n.useState)(null),ta=Object(m.a)(aa,2),na=ta[0],ia=ta[1],ca=Object(n.useState)(null),ra=Object(m.a)(ca,2),sa=(ra[0],ra[1]),oa=Object(n.useState)(null),la=Object(m.a)(oa,2),da=(la[0],la[1]),ua=Object(n.useState)(null),ja=Object(m.a)(ua,2),ba=ja[0],ma=ja[1],pa=Object(n.useState)(null),ha=Object(m.a)(pa,2),Oa=(ha[0],ha[1]),ga=Object(n.useState)(null),fa=Object(m.a)(ga,2),xa=(fa[0],fa[1]),va=Object(n.useState)(null),Ca=Object(m.a)(va,2),ya=(Ca[0],Ca[1]),Sa=Object(n.useState)(null),Fa=Object(m.a)(Sa,2),_a=(Fa[0],Fa[1]),ka=Object(n.useState)(null),Ea=Object(m.a)(ka,2),Ta=(Ea[0],Ea[1]),Aa=Object(n.useState)(null),wa=Object(m.a)(Aa,2),Na=(wa[0],wa[1]),Da=Object(n.useState)(null),Ia=Object(m.a)(Da,2),Pa=(Ia[0],Ia[1]),Ra=Object(n.useState)(null),Ma=Object(m.a)(Ra,2),Ba=Ma[0],Ua=Ma[1],qa=Object(n.useState)({}),Wa=Object(m.a)(qa,2),Ja=Wa[0],za=Wa[1],$a=Object(n.useState)(!1),Va=Object(m.a)($a,2),La=Va[0],Ga=Va[1],Ha=Object(n.useState)(null),Ya=Object(m.a)(Ha,2),Za=Ya[0],Xa=Ya[1],Ka=Object(n.useState)(null),Qa=Object(m.a)(Ka,2),et=(Qa[0],Qa[1],Object(n.useState)(null)),at=Object(m.a)(et,2),tt=at[0],nt=at[1],it=Object(n.useState)(null),ct=Object(m.a)(it,2),rt=ct[0],st=ct[1],ot=Object(n.useState)(!0),lt=Object(m.a)(ot,2),dt=lt[0],ut=lt[1],jt=Object(n.useState)(!1),bt=Object(m.a)(jt,2),mt=bt[0],pt=bt[1],ht=Object(n.useState)([]),Ot=Object(m.a)(ht,2),gt=Ot[0],ft=Ot[1],xt=Object(n.useState)(""),vt=Object(m.a)(xt,2),Ct=vt[0],yt=vt[1],St=Object(n.useState)(!1),Ft=Object(m.a)(St,2),_t=Ft[0],kt=Ft[1],Et=Object(n.useState)(!1),Tt=Object(m.a)(Et,2),At=Tt[0],wt=Tt[1],Nt=Object(n.useState)(!1),Dt=Object(m.a)(Nt,2),It=Dt[0],Pt=Dt[1],Rt=Object(n.useState)(!0),Mt=Object(m.a)(Rt,2),Bt=(Mt[0],Mt[1],Object(n.useState)(!1)),Ut=Object(m.a)(Bt,2),qt=Ut[0],Wt=Ut[1],Jt=Object(n.useState)(!1),zt=Object(m.a)(Jt,2),$t=zt[0],Vt=zt[1],Lt=Object(n.useState)(!1),Gt=Object(m.a)(Lt,2),Ht=Gt[0],Yt=Gt[1],Zt=Object(n.useState)(null),Xt=Object(m.a)(Zt,2),Kt=Xt[0],Qt=Xt[1],en=Object(n.useState)(!1),an=Object(m.a)(en,2),tn=an[0],nn=an[1],cn=Object(n.useState)(!1),rn=Object(m.a)(cn,2),sn=rn[0],on=rn[1],ln=Object(n.useState)(!1),dn=Object(m.a)(ln,2),un=dn[0],jn=dn[1],bn=Object(n.useState)(!0),mn=Object(m.a)(bn,2),pn=mn[0],hn=mn[1],On=Object(n.useState)(!1),gn=Object(m.a)(On,2),fn=gn[0],xn=gn[1],vn=Object(n.useState)(null),Cn=Object(m.a)(vn,2),yn=Cn[0],Sn=Cn[1],Fn=Object(n.useState)(!0),_n=Object(m.a)(Fn,2),kn=_n[0],En=_n[1],Tn=Object(n.useState)(!1),An=Object(m.a)(Tn,2),wn=An[0],Nn=An[1],Dn=Object(n.useState)(!1),In=Object(m.a)(Dn,2),Pn=In[0],Rn=In[1],Mn=Object(ee.b)().enqueueSnackbar,Bn=('\n \n \n \n '.concat(Ct,"\n ").concat(Re,"\n 1\n \n \n "),function(e){return!e||!Object.keys(e).length}),Un=function(){var e=Object(b.a)(u.a.mark((function e(){var a,t;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a={};try{t={service_config:JSON.stringify({url:g,method:"GetInfoClientRenew",headers:Object(j.a)({},"Content-Type","text/xml;charset=UTF-8")}),params:JSON.stringify({infoCliente:{RFC:Ct,Empresa:Re,ClaEmp:1}})},ve(fe,t).then((function(e){e&&(a=JSON.parse(e),console.log(a),za(a),qn(a))}))}catch(n){console.log("error",n)}case 2:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),qn=function(e){10===Ja.TipoCteSHCP?Ge(e.NomPropio):Ge(e.NomConsi),Xe(e.ApPaterno),ea(e.ApMaterno),ia(e.DesglosaIEPSSiNo),sa(e.CatUsoCFDI_SAT),da(e.RegimenFiscal),ma(e.EMail),Oa(e.Tel),xa(e.Calle),ya(e.EntreCalles),_a(e.NomDelegacion),Ta(e.Col),Na(e.ClaCd),Pa(e.NomEdo),Ua(e.CP)},Wn=function(){var e=Object(b.a)(u.a.mark((function e(){var a,t;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a={},pt(!0),Wt(!1),za(null),ie(0),ft([]);try{t={service_config:JSON.stringify({url:g,method:"GetInfoClientRenew",headers:Object(j.a)({},"Content-Type","text/xml;charset=UTF-8")}),params:JSON.stringify({infoCliente:{RFC:Ct,Empresa:Re,ClaEmp:1}})},ve(fe,t).then((function(e){console.log(e),e&&'""'!=e?(a=JSON.parse(e),za(a),console.log("DATA: "+JSON.stringify(a)),qn(a),Wt(!0),Pt(!0),Ee(!0),ie("10"===a.TipoCteSHCP?0:1)):null===e?(za({RFC:Ct,TipoCteSHCP:10}),qn({}),wt(!0),Wt(!1),Pt(!1)):kt(!1)}))}catch(n){console.log(n)}finally{ut(!1),kt(!0),pt(!1)}case 7:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),Jn=function(){var e=Object(b.a)(u.a.mark((function e(){var a,t,n;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!_t){e.next=8;break}return Vt(!1),Yt(!1),nn(!1),En(!0),Ee(!1),kt(!1),wt(!1),Nn(!1),Pt(!1),e.abrupt("return");case 8:if(ft([]),Yt(!1),za(null),kt(!1),wt(!1),nn(!1),Qt(null),""!==Ct){e.next=21;break}return Yt(!0),Qt("Este campo es requerido"),e.abrupt("return");case 21:return a=Yn(Ct),t=Hn(Ct),e.next=25,zn();case 25:if(n=e.sent,En(!a&&!t&&0==n.filter((function(e){return e===Ct})).length),a||t||0!=n.filter((function(e){return e===Ct})).length){e.next=31;break}return Qt("Ingresa un RFC valido"),Yt(!0),e.abrupt("return");case 31:$t?(Wn(),En(!1)):(En(!0),nn(!0));case 32:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),zn=function(){return new Promise((function(e,a){ve("\n query GetParam($id: ID!) {\n getParam(id: $id) {\n id\n param\n value\n startDate\n endDate\n paramType\n keyFilter\n _version\n _deleted\n _lastChangedAt\n createdAt\n updatedAt\n }\n }\n",{id:"a2ed1f6a-d6ad-4a68-8e99-1f5023fc18a5"}).then((function(a){console.log(a),e(a.keyFilter)})).catch((function(e){console.log(e)}))}))};Object(n.useEffect)((function(){ut(!1)}),[]);var $n=function(){d(!1),x(!1),nt(null),st(null)},Vn=function(){var e=Object(b.a)(u.a.mark((function e(){var a,t,n,i,c,r,s,o,l,d,j,b;return u.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return De(!0),a="",me.map((function(e,t){a+='\n \'').concat(e,"'\n ")})),t=Ue.replace("*folios*",a).replace("*claconsi*",Ja.ClaConsi).replace("*company*",Re),e.prev=4,hn(!1),e.next=8,xe("BillingTickets",t);case 8:n=e.sent,i=(new h.a).parseFromString(n.data.bamaws),c=i.children[0].children[0].children[0].children[1].children[0].children[0].children[0].value,r=i.children[0].children[0].children[0].children[1].children[0].children[0].children[1].value,s=i.children[0].children[0].children[0].children[1].children[0].children[0].children[2].value,Xa(s),o=le()(r,"DD/MM/YYYY"),l=o.format("MMMM").substring(0,3).toUpperCase(),d=o.format("YYYY"),j="https://z6z3as6qstptmgitgsj7imv63a0wxvxd.lambda-url.us-east-1.on.aws/?url=http://documents.bamaglobal.com.mx/Facturas/".concat(l).concat(d,"/").concat(s,".pdf"),b="https://z6z3as6qstptmgitgsj7imv63a0wxvxd.lambda-url.us-east-1.on.aws/?url=http://documents.bamaglobal.com.mx/Facturas/".concat(l).concat(d,"/").concat(s,".xml"),"1900/01/01"!==r?(nt(j),st(b),ue(c),Xa(s),xn(!0),Sn(null)):(xn(!1),Sn(c)),setTimeout((function(){ft([]),pe([]),Ln()}),3e3),e.next=26;break;case 23:e.prev=23,e.t0=e.catch(4),Mn("No se puedo generar el documento!",{variant:"error"});case 26:return e.prev=26,hn(!0),e.finish(26);case 29:case"end":return e.stop()}}),e,null,[[4,23,26,29]])})));return function(){return e.apply(this,arguments)}}(),Ln=function(){d(!1),x(!0),De(!1),on(!1)};function Gn(e){var a=e.children,t=(e.value,e.index),n=Object(l.a)(e,["children","value","index"]);return Object(_e.jsx)("div",Object(o.a)(Object(o.a)({role:"tabpanel",id:"full-width-tabpanel-".concat(t),"aria-labelledby":"full-width-tab-".concat(t)},n),{},{children:a}))}function Hn(e){var a;if(a=e,12==e.length)var t="^(([A-Z]|[a-z]){3})([0-9]{6})((([A-Z]|[a-z]|[0-9]){3}))";else t="^(([A-Z]|[a-z]|s){1})(([A-Z]|[a-z]){3})([0-9]{6})((([A-Z]|[a-z]|[0-9]){3}))";var n=new RegExp(t);return null!=a.match(n)&&e}function Yn(e){var a=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],t=/^([A-Z\xd1&]{3,4}) ?(?:- ?)?(\d{2}(?:0[1-9]|1[0-2])(?:0[1-9]|[12]\d|3[01])) ?(?:- ?)?([A-Z\d]{2})([A\d])$/,n=e.match(t);if(!n)return!1;var i,c,r=n.pop(),s=n.slice(1).join(""),o=s.length,l="0123456789ABCDEFGHIJKLMN&OPQRSTUVWXYZ \xd1",d=o+1;i=12==o?0:481;for(var u=0;u0)||(Ga(!0),!1)}})]}):null]}),Object(_e.jsxs)(Ce.a,{disableBackdropClick:!0,disableEscapeKeyDown:!0,maxWidth:"xs","aria-labelledby":"alert-dialog-slide-title","aria-describedby":"alert-dialog-slide-description",open:s,children:[Object(_e.jsx)(ye.a,{id:"alert-dialog-slide-title",children:Ne?"Facturando...":Object(_e.jsx)(_e.Fragment,{children:"\xbfEst\xe1s seguro de facturar los tickets seleccionados?"})}),Object(_e.jsx)(Se.a,{children:Object(_e.jsxs)(qe.a,{id:"alert-dialog-slide-description",children:[Ne&&Object(_e.jsx)("div",{style:{width:"100%",textAlign:"center"},children:Object(_e.jsx)(B.a,{size:25,style:{margin:"auto"}})}),!Ne&&Object(_e.jsxs)(V.a,{"aria-labelledby":"tableTitle","aria-label":"enhanced table",children:[Object(_e.jsx)(L.a,{children:Object(_e.jsxs)(G.a,{children:[Object(_e.jsx)(H.a,{children:Object(_e.jsx)("strong",{children:"Folio"})},"title_Folio"),Object(_e.jsx)(H.a,{children:Object(_e.jsx)("strong",{children:"Total"})},"title_Total")]})}),Object(_e.jsx)(Y.a,{children:gt.map((function(e,a){if(me.includes(e.FolioDocCte))return Object(_e.jsxs)(G.a,{children:[Object(_e.jsx)(H.a,{component:"th",id:e.FolioDocCte,scope:"row",children:e.FolioDocCte}),Object(_e.jsxs)(H.a,{children:["$",e.Total]})]},e.FolioDocCte)}))})]})]})}),Object(_e.jsxs)(Fe.a,{children:[!Ne&&Object(_e.jsx)(P.a,{variant:"contained",color:"primary",style:{borderRadius:0},onClick:function(){return Vn()},disabled:Ne,children:"Aceptar"}),!Ne&&Object(_e.jsx)(P.a,{variant:"contained",style:{borderRadius:0},onClick:function(){return $n()},disabled:Ne,children:"Cancelar"})]})]}),Object(_e.jsx)(D.a,{"aria-labelledby":"transition-modal-title","aria-describedby":"transition-modal-description",className:a.modal,open:!1,onClose:$n,closeAfterTransition:!0,BackdropComponent:I.a,BackdropProps:{timeout:500},disableBackdropClick:!0,disableEscapeKeyDown:!0,children:Object(_e.jsx)(_.a,{in:s,children:Object(_e.jsxs)("div",{className:a.paper,children:[Object(_e.jsx)("h2",{id:"transition-modal-title",children:Ne?"Facturando...":Object(_e.jsxs)(_e.Fragment,{children:["\xbfEst\xe1s seguro de facturar ",Object(_e.jsx)("br",{}),"los tickets seleccionados?"]})}),Ne&&Object(_e.jsx)("div",{style:{width:"100%",textAlign:"center"},children:Object(_e.jsx)(B.a,{size:25,style:{margin:"auto"}})}),!Ne&&Object(_e.jsxs)(V.a,{"aria-labelledby":"tableTitle","aria-label":"enhanced table",children:[Object(_e.jsx)(L.a,{children:Object(_e.jsxs)(G.a,{children:[Object(_e.jsx)(H.a,{children:Object(_e.jsx)("strong",{children:"Folio"})},"title_Folio"),Object(_e.jsx)(H.a,{children:Object(_e.jsx)("strong",{children:"Total"})},"title_Total")]})}),Object(_e.jsx)(Y.a,{children:gt.map((function(e,a){if(me.includes(e.FolioDocCte))return Object(_e.jsxs)(G.a,{children:[Object(_e.jsx)(H.a,{component:"th",id:e.FolioDocCte,scope:"row",padding:"none",children:e.FolioDocCte}),Object(_e.jsxs)(H.a,{align:"center",children:["$",e.Total]})]},e.FolioDocCte)}))})]}),Object(_e.jsxs)(S.a,{container:!0,direction:"row",justify:"space-between",style:{marginTop:20},children:[!Ne&&Object(_e.jsx)(P.a,{variant:"contained",color:"primary",style:{borderRadius:0},onClick:function(){return Vn()},disabled:Ne,children:"Aceptar"}),!Ne&&Object(_e.jsx)(P.a,{variant:"contained",style:{borderRadius:0},onClick:function(){return $n()},disabled:Ne,children:"Cancelar"})]})]})})},"modalConfirm"),Object(_e.jsx)(D.a,{"aria-labelledby":"transition-modal-title","aria-describedby":"transition-modal-description",className:a.modal,open:f,onClose:$n,closeAfterTransition:!0,BackdropComponent:I.a,BackdropProps:{timeout:500},disableBackdropClick:!0,disableEscapeKeyDown:!0,children:Object(_e.jsx)(_.a,{in:f,children:Object(_e.jsxs)("div",{className:a.paper,children:[Object(_e.jsx)("h3",{id:"transition-modal-title",children:fn?"Factura generada con \xe9xito.":"Ocurrio un problema al timbrar la factura de los tickets seleccioados"}),!fn&&Object(_e.jsxs)(i.a.Fragment,{children:[Object(_e.jsx)(T.a,{variant:"body1",gutterBottom:!0,children:yn}),Object(_e.jsx)(T.a,{variant:"body1",gutterBottom:!0,children:"Te sugerimos acudir a tu Tienda BAMA m\xe1s cercana para resolver este inconveniente."})]}),Object(_e.jsx)(Z.a,{children:fn&&Object(_e.jsxs)(V.a,{children:[Object(_e.jsx)(L.a,{children:Object(_e.jsxs)(G.a,{children:[Object(_e.jsx)(H.a,{flex:1,children:"Folio"}),Object(_e.jsx)(H.a,{flex:.5,style:{textAlign:"center"},children:"PDF"}),Object(_e.jsx)(H.a,{flex:.5,style:{textAlign:"center"},children:"XML"})]})}),Object(_e.jsx)(Y.a,{children:Object(_e.jsxs)(G.a,{children:[Object(_e.jsx)(H.a,{style:{paddingBottom:10,paddingTop:10},children:de}),Object(_e.jsx)(H.a,{style:{textAlign:"center",paddingBottom:10,paddingTop:10},children:Object(_e.jsx)(X.a,{href:tt,download:Za+".pdf",target:"_blank",color:"inherit",style:{display:"flex"},children:Object(_e.jsx)(ce.a,{style:{margin:"auto"}})})}),Object(_e.jsx)(H.a,{style:{textAlign:"center",paddingBottom:10,paddingTop:10},children:Object(_e.jsx)(X.a,{href:rt,target:"_blank",download:Za+".xml",color:"inherit",style:{display:"flex"},children:Object(_e.jsx)(ce.a,{style:{margin:"auto"}})})})]},"")})]})}),Object(_e.jsx)(S.a,{container:!0,direction:"row",justify:"center",children:Object(_e.jsx)(P.a,{color:"primary",variant:"contained",style:{borderRadius:0,marginTop:20},onClick:function(){return $n()},children:"Aceptar"})})]})})},"modalSuccesAndDownload"),Object(_e.jsxs)(Ce.a,{disableBackdropClick:!0,disableEscapeKeyDown:!0,maxWidth:"xs","aria-labelledby":"alert-dialog-slide-title","aria-describedby":"alert-dialog-slide-description",open:La,children:[Object(_e.jsx)(ye.a,{id:"alert-dialog-slide-title",children:"\xa1\xa1Tienes cambios sin guardar!!"}),Object(_e.jsx)(Se.a,{children:Object(_e.jsx)(qe.a,{id:"alert-dialog-slide-description",children:"Tienes cambios sin guardar en la informaci\xf3n de facturaci\xf3n, por favor guarda tus cambios, o recarga la busqueda para continuar."})}),Object(_e.jsx)(Fe.a,{children:Object(_e.jsx)(P.a,{onClick:function(){return Ga(!1)},color:"primary",children:"Aceptar"})})]})]})},Le=t.p+"static/media/404.a5c1b5c6.png",Ge=function(){return Object(_e.jsx)("div",{style:{width:"100%",textAlign:"center",display:"flex",height:"100vh"},children:Object(_e.jsx)("img",{alt:"logo",src:Le,style:{padding:5,width:"50%",margin:"auto"}})})};var He=function(){return Object(_e.jsxs)(s.c,{children:[Object(_e.jsx)(s.a,{exact:!0,path:"/",component:Ve}),Object(_e.jsx)(s.a,{component:Ge})]})},Ye=function(e){e&&e instanceof Function&&t.e(3).then(t.bind(null,539)).then((function(a){var t=a.getCLS,n=a.getFID,i=a.getFCP,c=a.getLCP,r=a.getTTFB;t(e),n(e),i(e),c(e),r(e)}))},Ze=t(275),Xe=t.n(Ze),Ke=t(201);console.log("Checkpoint-Cambio-Prueba");var Qe=i.a.createRef(),ea=function(e){return function(){Qe.current.closeSnackbar(e)}};r.a.render(Object(_e.jsx)(i.a.StrictMode,{children:Object(_e.jsx)(ee.a,{maxSnack:3,autoHideDuration:3e3,ref:Qe,action:function(e){return Object(_e.jsx)(ae.a,{size:"small","aria-label":"close",color:"inherit",onClick:ea(e),children:Object(_e.jsx)(Xe.a,{fontSize:"small"})})},children:Object(_e.jsx)(Ke.a,{children:Object(_e.jsx)(He,{})})})}),document.getElementById("root")),Ye()}},[[422,1,2]]]); //# sourceMappingURL=main.1340a456.chunk.js.map