1"use strict";(self.webpackChunkcomfama_portalservicios_archetype=self.webpackChunkcomfama_portalservicios_archetype||[]).push([[1983],{499:function(e,t,a){var n=a(4240),s=a(45871),o=a(74848);t.A=({content:e})=>{const t={renderNode:{[s.BLOCKS.PARAGRAPH]:(e,t)=>(0,o.jsx)("p",{children:t}),[s.BLOCKS.OL_LIST]:(e,t)=>(0,o.jsx)("ol",{type:"1",children:t}),[s.INLINES.HYPERLINK]:(e,t)=>{var a,n,s,i,r;return(0,o.jsx)("a",{href:null==e||null===(a=e.data)||void 0===a?void 0:a.uri,rel:"noopener noreferrer",target:null!=e&&null!==(n=e.data)&&void 0!==n&&null!==(s=n.uri)&&void 0!==s&&s.includes("www")||null!=e&&null!==(i=e.data)&&void 0!==i&&null!==(r=i.uri)&&void 0!==r&&r.includes("https")?"_blank":"_self",title:t,children:t})}}};return(0,o.jsx)("div",{className:"a-to-be-aware",children:(0,o.jsx)("div",{children:e&&e.raw&&(0,n.i)(JSON.parse(null==e?void 0:e.raw),t)})})}},3026:function(e,t,a){var n=a(34164),s=a(74848);t.A=({itemList:e,currentIndex:t,title:a,subtitle:o,titleType:i,isTwo:r})=>{const c=e=>(0,n.A)("m-payment-stepper__item",{"--past":t>e,__active:t===e,"--pre-past":1===e&&.9===t}),l=(0,n.A)("m-payment-stepper__progress-bar-wrapper",{"--first":0===t,"--medium":1===t||r,"--next":.9===t,"--last":2===t,"--two":!!r,"two--left":r}),u=(0,n.A)("m-payment-stepper__content",{"stepper-two":!!r}),d=(0,n.A)("m-payment-stepper__item-name",{"--two":!!r}),m=(0,n.A)("m-payment-stepper",{"--two":!!r});return(0,s.jsxs)("div",{className:m,children:[a&&o&&(0,s.jsx)("div",{className:"m-payment-stepper__headings",children:"h1"===i?(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h1",{className:"m-payment-stepper__headings__title",children:a}),(0,s.jsx)("h2",{className:"m-payment-stepper__headings__sub-title",children:o})]}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)("h2",{className:"m-payment-stepper__headings__title",children:a}),(0,s.jsx)("h3",{className:"m-payment-stepper__headings__sub-title",children:o})]})}),(0,s.jsxs)("div",{className:u,children:[e.map((e,t)=>(0,s.jsxs)("div",{className:c(t),children:[(0,s.jsx)("div",{className:"m-payment-stepper__item-number",children:(0,s.jsx)("span",{children:t+1})}),(0,s.jsx)("span",{className:d,children:e})]},`m-payment-stepper__item${t}`)),(0,s.jsx)("div",{className:l,children:(0,s.jsx)("div",{className:"m-payment-stepper__progress-bar"})})]})]})}},3887:function(e,t,a){var n=a(32936),s=a(74848);const o=({label:e,name:t,id:a,type:o,placeholder:i,register:r,validationRules:c,error:l,maxLength:u,setValue:d,onChange:m,onBlurEvent:p,onFocusEvent:f,square:_,required:h,tooltip:v,onTypeValidation:g,disabled:x,role:b})=>{const j=(0,n.A)();return(0,s.jsxs)("div",{className:"f-a-input",children:[(0,s.jsxs)("div",{className:"f-a-input__label-wrapper "+(_?" __square":""),children:[(0,s.jsx)("label",{id:t+e,htmlFor:t,className:"f-a-input__label "+(h?" __required":""),children:e}),v&&(0,s.jsxs)("div",{className:"f-a-input__tooltip",children:[(0,s.jsx)("i",{"data-testid":"icon",className:"icon icon-question-circle",onClick:()=>{if(j){const e=document.getElementById("f-a-input__tooltip-box-wrapper");e&&e.classList.add("__open")}}}),(0,s.jsx)("div",{className:"f-a-input__tooltip-box-wrapper",id:"f-a-input__tooltip-box-wrapper",onClick:()=>{if(j){const e=document.getElementById("f-a-input__tooltip-box-wrapper");e&&e.classList.remove("__open")}},children:(0,s.jsx)("div",{className:"f-a-input__tooltip-box",children:v})})]})]}),(0,s.jsx)("div",{id:t,className:`f-a-input__box ${l?"__error":""}${_?" __square":""}`,children:g?(0,s.jsx)("input",{"data-testid":"input",tabIndex:"0",name:t,maxLength:u,placeholder:i,type:o,...r(t,c),onFocus:()=>{f&&f()},onBlur:()=>{p&&p()},id:a||`input${t}`,disabled:x||!1,role:b}):(0,s.jsx)("input",{"data-testid":"input",tabIndex:"0",name:t,maxLength:u,placeholder:i,type:o,...r(t,c),onChange:e=>{if(" "===e.target.value)d(t,"");else if(m(e),"number"===o){const a=e.target.value.replace(/\D/g,"");d(t,a)}else d(t,e.target.value.replace(/ {2}/g," "))},onFocus:()=>{f&&f()},onBlur:()=>{p&&p()},id:a||`input${t}`,disabled:x||!1,role:b})}),l&&(0,s.jsx)("span",{className:"f-a-input__error",children:l.message})]})};
1o.defaultProps={onChange:()=>{}},t.A=o},5290:function(e,t,a){a.d(t,{Lr:function(){return Q},AL:function(){return Z},d2:function(){return W},Bk:function(){return J},Y5:function(){return G},hp:function(){return Y},XJ:function(){return z},DB:function(){return R},u7:function(){return M},ji:function(){return B},Pt:function(){return L},UX:function(){return P},ex:function(){return m},CX:function(){return S},qc:function(){return k},GG:function(){return _},uJ:function(){return h},hn:function(){return j},QS:function(){return N},VY:function(){return $},r4:function(){return q},pR:function(){return T},xW:function(){return C},ZY:function(){return K},gw:function(){return f},vw:function(){return b},Xt:function(){return H},he:function(){return E},n6:function(){return I},Ft:function(){return y},cl:function(){return F},aG:function(){return g},lg:function(){return v},iy:function(){return x},mO:function(){return D},M:function(){return X},K2:function(){return w},ko:function(){return O},Dc:function(){return p},WU:function(){return V},ui:function(){return A},_8:function(){return U}});var n=a(84166),s=a(48314),o=a(89179),i=a(51145);const r=n.A.create(),c=new i.A;r.interceptors.response.use(e=>e,e=>{const t=e.config,{response:{status:a}}=e;
1return 403===a||401===a?l(t):Promise.reject(e)});const l=async e=>{try{e._retry=!0,await u(e)}catch(t){console.log(t)}},u=async e=>{const t=c.get("token"),a={headers:{apikey:`${s.aE}`}},o={action:"getJWT"};try{const i=await n.A.post(`${t}`,o,a);if(200===i.status)return e.headers.Authorization=`Bearer ${i.data.data.id_token}`,e.headers.apikey=`${s.gQ}`,e}catch(i){console.log(i)}},d=s.oX+"/afiliaciones/api/v1/",m=async(e,t,a,n="",s="")=>o.S.get(`${d}consultaCertificado?numeroDocumento=${e}&tipoDocumento=${t}&tipoDocumentoEmpresa=${s}&numeroDocumentoEmpresa=${n}`,{headers:{Authorization:`${a}`}}),p=async(e,t,a,n,s="",i="")=>o.S.get(`${d}consultarAfiliacionRetirado${n?"Empresa":""}?tipoDocumentoEmpresa=${i}&numeroDocumentoEmpresa=${s}&tipoDocumento=${t}&numeroDocumento=${e}`,{headers:{Authorization:`${a}`}}),f=async(e,t,a)=>o.S.get(`${s.oX}/certificados/proveedores/api/v1/CertificadoExperiencia?numeroDocumento=${e}&tipoDocumento=${t}`,{headers:{Authorization:`${a}`}}),_=async(e,t,a="",n="")=>o.S.get(`${d}consultarCarnetPdfAfiliacionTitularTrabajador?numeroDocumento=${e}&tipoDocumento=${t}&tipoDocumentoEmpresa=${n}&numeroDocumentoEmpresa=${a}`),h=async(e,t,a="",n="")=>o.S.get(`${d}consultarCarnetPdfAfiliacionPacTrabajador?numeroDocumento=${e}&tipoDocumento=${t}&tipoDocumentoEmpresa=${n}&numeroDocumentoEmpresa=${a}`),v=async(e,t)=>o.S.post(`${d}${t}`,e),g=async e=>o.S.post(`${d}descargarMasivoAfiliacion`,e),x=async e=>o.S.post(`${d}descargarMasivoAfiliacionCarnet`,e),b=async(e,t,a,n)=>o.S.get(`${d}consultarTrabajadorMasivoHistorico?numeroDocumento=${e}&numeroDocumentoEmpresa=${a}&tipoDocumento=${t}&tipoDocumentoEmpresa=${n}`),j=async(e,t,a,n,i,r,c)=>o.S.get(`${s.oX}/reportecompensacion/api/v1/consultaReporteCompensacion?anyo=${n}${i&&`&documentoContable=${i}`}${r&&`&fechaDesde=${r}`}${c&&`&fechaHasta=${c}`}&numeroDocumento=${e}&tipoConsulta=${a}&tipoDocumento=${t}`),y=async(e,t,a)=>o.S.get(`${d}listarAfiliadosCarnet?numeroDocumento=${e}&tipoDocumento=${t}`,{headers:{Authorization:`${a}`}}),$=async(e,t,a)=>o.S.get(`${d}consultarCarnetPdfAfiliacionTitular?numeroDocumento=${e}&tipoDocumento=${t}`,{headers:{Authorization:`${a}`}}),N=async(e,t,a)=>o.S.get(`${d}consultarCarnetPdfAfiliacionPac?numeroDocumentoPac=${e}&tipoDocumentoPac=${t}`,{headers:{Authorization:`${a}`}}),S=async(e="",t="",a)=>o.S.get(`${d}consultaCertificadoEmpleador?tipoDocumento=${t}&numeroDocumento=${e}`,{headers:{Authorization:`${a}`}}),C=async(e,t)=>o.S.get(`${s.oX}/certificadodeudas/api/v1/consultaCertificadoPersona?numeroDocumento=${e}&tipoDocumento=${t}`),A=async(e,t,a)=>o.S.get(`${s.oX}/entregasubsidio/api/v1/consultaEntregaSubsidio?numeroDocumento=${e}&periodo=${a}&tipoDocumento=${t}`),D=async(e,t,a,n)=>o.S.get(`${s.oX}/cuotamonetaria/api/v1/consultaCuotaMonetaria?numeroDocumento=${e}&periodoFinal=${a}&periodoInicial=${t}&tipoDocumento=${n}`),w=async(e,t,a,n)=>o.S.get(`${s.oX}/aportes/api/v1/consultaCertificadoPagoAporte?numeroDocumento=${e}&tipoDocumento=${n}&periodoInicio=${t}&periodoFin=${a}`),E=async(e,t,a)=>o.S.get(`${s.oX}/postulacionvivienda/api/v1/consultaEstadoPostulacion?numeroDocumento=${e}&tipoDocumento=${t}${a&&`&numeroFormulario=${a}`}`),k=async(e,t)=>o.S.get(`${s.oX}/cesde/api/v1/getStudentByIdentification/${t}?identificationType=${e}`),q=async(e,t)=>o.S.get(`${s.oX}/certificadodeudas/api/v1/consultaCertificadoEmpresa?numeroDocumento=${e}&tipoDocumento=${t}`),I=async e=>o.S.get(`${s.oX}/declaracionrenta/api/v1/certificado/${e}`),T=async(e,t,a,n)=>o.S.get(`${s.oX}/certificadodeudas/api/v1/consultaCertificadoTrabajador?numeroDocumento=${e}&numeroDocumentoEmpresa=${a}&tipoDocumento=${t}&tipoDocumentoEmpresa=${n}`),B=async({numeroDocumento:e,periodoAnyos:t,tipoDocumento:a})=>o.S.get(`${d}consultaCertificadoFosfec?numeroDocumento=${e}&periodoAnyos=${t}&tipoDocumento=${a}&applicationId=1`),L=async({numeroDocumento:e,tipoDocumento:t})=>o.S.get(`${s.oX}/declaracionrentasubsidio/api/v1/declaracionRentaSubsidio?numeroDocumento=${e}&tipoDocumento=${t}&applicationId=1`),P=async({anyo:e,bimester:t,id:a,certificateType:n,idType:i})=>o.S.get(`${s.U$}consultarCertificadoRetencion?anyo=${e}&bimestre=${t}&numeroDocumento=${a}&tipoCertificado=${n}&tipoDocumento=${i}`),O=async()=>o.S.get(`${s.U$}listarPeriodosIva`),V=async()=>o.S.get(`${s.U$}listarTiposCertificados`),R=async({tipoDocumento:e,numeroDocumento:t,jwt:a,isBussinesTab:o})=>{const i={headers:{Authorization:`Bearer ${a}`}},r=`${s.oX}/aportes/api/v1/estado-cuenta-o-certificado`.concat(o?"":"-indUPensionado",`?numeroDocumento=${t}&tipoDocumento=${e}`);return n.A.get(r,i)},X=async({tipoDocumento:e,numeroDocumento:t})=>o.S.get(`${s.oX}/afiliaciones/api/v1/consultarCertificadoNoAfiliado?tipoDocumento=${e}&numeroDocumento=${t}`),z=async({documentType:e,documentNumber:t,jwt:a})=>{const n={headers:{apikey:`${s.hV}`,Authorization:`Bearer ${a}`}};return r.get(`${s.xQ}${e}/${t}`,n)},F=async(e,t,a)=>
1o.S.get(`${s.ht}listarEventosAsistencia?anyo=${e}&numeroDocumento=${t}&tipoDocumento=${a}`),M=async(e,t,a,n)=>o.S.get(`${s.ht}consultarCertificadoAsistencia?curso=${e}&numeroDocumento=${a}&fechaInicio=${t}&tipoDocumento=${n}`),U=async(e,t,a)=>{const n={document:e,documentType:t,email:a,id:6};return o.S.post(`${s.MR}`,n)},J=async(e,t)=>o.S.get(`${s.oX}/creditoestadocuenta/api/v1/consultaCreditoEstadoCuenta?numeroDocumento=${e}&tipoDocumento=${t}`),G=async(e,t,a)=>o.S.get(`${s.oX}/creditoestadocuenta/api/v1/certificadoCreditoEstadoCuenta?numeroDocumento=${e}&tipoDocumento=${t}&numeroCredito=${a}`),H=async(e,t,a,n,i,r)=>o.S.get(`${s.oX}/afiliaciones/api/v1/consultarAfiliacionHistorico?fechaFin=${r}&fechaInicio=${i}&numeroDocumento=${e}${""!==a?`&numeroDocumentoEmpresa=${a}`:""}&tipoDocumento=${t}${""!==n?`&tipoDocumentoEmpresa=${n}`:""}`),K=async(e,t,a,n)=>{const i=`?documentType=${t}&documentNumber=${e}&creditNumber=${a}&user=${n}`,r=`${s.oX}/certificadocredito/api/v1/credits/receipt-payment${i}`;return o.S.get(r)},W=(e,t,a)=>{const n=`?documentType=${t}&documentNumber=${e}&page=1&pageSize=10&user=${a}`,i=`${s.oX}/certificadocredito/api/v1/credits/peacedmind-pdf${n}`;return o.S.get(i)},Y=async(e,t)=>{const a=`?documentType=${t}&page=1&documentNumber=${e}&pageSize=50`,n=`${s.oX}/certificadocredito/api/v1/credits/account-status${a}`;return o.S.get(n)},Q=e=>o.S.post(`${s.oX}/certificadocredito/api/v1/credits/account-pdf`,e),Z=e=>o.S.post(`${s.oX}/certificadocredito/api/v1/credits/debt-pdf`,e)},18395:function(e){e.exports=JSON.parse('[{"name":"Cédula de Ciudadania","id":"1","typaDocSAP":"CO1C"},{"name":"Documento Extranjero","id":"0","typaDocSAP":"CO1D"},{"name":"Cédula ExtranjerÃa","id":"5","typaDocSAP":"CO1E"},{"name":"Registro Civil","id":"3","typaDocSAP":"CO1L"},{"name":"Nit","id":"6","typaDocSAP":"CO1N"},{"name":"Pasaporte","id":"8","typaDocSAP":"CO1P"},{"name":"Salvoconducto de permanencia","id":"0","typaDocSAP":"CO1R"},{"name":"Sin identificacion del","id":"0","typaDocSAP":"CO1S"},{"name":"Tarjeta de identidad","id":"2","typaDocSAP":"CO1T"},{"name":"Numero Unico de Iden","id":"7","typaDocSAP":"CO1U"},{"name":"Permiso especial de permanencia","id":"9","typaDocSAP":"CO1V"},{"name":"Tarjeta de ExtranjerÃa","id":"2","typaDocSAP":"CO1X"},{"name":"Permiso por Protección Temporal","id":"11","typaDocSAP":"CO1W"}]')},18875:function(e,t,a){var n=a(96540),s=a(17325),o=a(20320),i=a(64691),r=a(68667),c=a(19871),l=a(88767),u=a(79771),d=a(499),m=a(74848);t.A=({children:e,desiredTab:t,subRoute:a,buttonCopy:p,buttonEvent:f,breadCrum:_,title:h,subtitle:v,secondTitle:g,secondSubtitle:x,note:b,disableButton:j,loader:y,notePosition:$,isSecondButton:N,buttonCopyTwo:S,buttonEventTwo:C,disableButtonTwo:A,loaderSecondButton:D,historicButton:w,historicButtonClass:E,historicButtonOnClickAction:k,historicButtonDisable:q,historicButtonText:I,showFirstButton:T=!0})=>{const{window:B,localStorage:L}=(0,c.A)(),{selectedTab:P}=(0,n.useContext)(i.A);(0,n.useEffect)(()=>{const e=L.getItem("CURRENT_TAB");t&&"none"!==t&&e&&"undefined"!==e&&("personas"===t?e===r.m.BUSINESS&&(location.href=B&&"localhost"===(null==B?void 0:B.location.hostname)?O("/empresas/"):O("/portal-servicios/empresas/")):location.href=B&&"localhost"===(null==B?void 0:B.location.hostname)?O("/personas/"):O("/portal-servicios/personas/"))},[null==P?void 0:P.get]);const O=e=>a?e+a:e;return(0,m.jsxs)("div",{className:"o-form-and-note-template",children:[_&&(0,m.jsx)(l.A,{content:_}),h||v?(0,m.jsxs)("div",{className:"o-form-and-note-template__headings",children:[(0,m.jsxs)("div",{className:"o-form-and-note-template__headings__titles",children:[h&&(0,m.jsx)("h1",{className:"o-form-and-note-template__headings__titles__title",children:h}),v&&(0,m.jsx)("p",{className:"o-form-and-note-template__headings__titles__subtitle",children:v})]}),(0,m.jsx)("div",{className:"o-form-and-note-template__headings__button",children:w&&(0,m.jsx)(s.A,{text:I||"Historico",isDisabled:q,classname:E,onClickAction:k,type:"button"})})]}):(0,m.jsx)("div",{className:"o-form-and-note-template__spacer"}),(0,m.jsx)("div",{className:"o-form-and-note-template__content",children:(0,m.jsxs)("div",{className:"o-form-and-note-template__content__body ",children:["left"===$?(0,m.jsx)(o.A,{image:b.image,title:b.title,content:b.content}):(0,m.jsx)(d.A,{content:b}),(0,m.jsxs)("div",{className:"o-form-and-note-template__content__body__form "+("left"===$?"--invert":""),children:[(g||x)&&(0,m.jsxs)("div",{className:"o-form-and-note-template__content__body__form__info",children:[g&&(0,m.jsx)("h3",{className:"o-form-and-note-template__content__body__form__info__title",children:g}),x&&(0,m.jsx)("span",{className:"o-form-and-note-template__content__body__form__info__subtitle",children:x})]}),e&&(0,m.jsx)("div",{className:"o-form-and-note-template__content__body__form__row",children:e}),(0,m.jsxs)("div",{className:"o-form-and-note-template__content__form__buttons",children:[N&&(0,m.jsx)("button",{className:"o-form-and-note-template__content__form__secondButton",disabled:D||A,onClick:()=>{C&&C()},children:D?(0,m.jsx)(u.A,{size:"__small"}):S||"Volver"}),T&&(0,m.jsx)("button",{className:"o-form-and-note-template__content__form__button",disabled:y||j,onClick:()=>{f&&f()},children:y?(0,m.jsx)(u.A,{size:"__small"}):p||"Aceptar"})]}),j&&location.pathname.startsWith("empresas")&&(0,m.jsx)("p",{className:"o-form-and-note-template__error",children:"* debes elegir una empresa en el menú"})]})]})})]})}},20320:function(e,t,a){var n=a(4240),s=a(45871),o=a(5588),i=a(29390),r=a(74848);t.A=({image:e,title:t,content:a})=>{const c={renderNode:{[s.BLOCKS.PARAGRAPH]:(e,t)=>(0,r.jsx)("p",{children:t}),[s.BLOCKS.OL_LIST]:(e,t)=>(0,r.jsx)("ol",{type:"1",children:t}),[s.INLINES.HYPERLINK]:(e,t)=>{var a,n,s,o,i;return(0,r.jsx)("a",{href:null==e||null===(a=e.data)||void 0===a?void 0:a.uri,rel:"noopener noreferrer",target:null!=e&&null!==(n=e.data)&&void 0!==n&&null!==(s=n.uri)&&void 0!==s&&s.includes("www")||null!=e&&null!==(o=e.data)&&void 0!==o&&null!==(i=o.uri)&&void 0!==i&&i.includes("https")?"_blank":"_self",title:t,children:t})}}};return(0,r.jsxs)("div",{className:"a-to-be-aware-image",children:[(0,r.jsx)("div",{className:"a-to-be-aware-image__left",children:e&&e.gatsbyImage?(0,r.jsx)(o.G,{className:"a-to-be-aware-image__left__img",image:e.gatsbyImage,loading:"eager",alt:e.description?e.descripcion:e.title||"Imagen ¡Estamos para ayudarte!",title:e.description?e.descripcion:e.title||"Imagen ¡Estamos para ayudarte!"}):(null==e?void 0:e.file)&&(null==e?void 0:e.file.url)&&(0,r.jsx)("img",{src:(0,i.s)(e),alt:e.description?e.descripcion:e.title||"Imagen ¡Estamos para ayudarte!",title:e.description?e.descripcion:e.title||"Imagen ¡Estamos para ayudarte!",className:"a-to-be-aware-image__left__img"})}),(0,r.jsxs)("div",{className:"a-to-be-aware-image__right",children:[t&&(0,r.jsx)("h2",{children:t}),a&&a.raw&&(0,n.i)(JSON.parse(null==a?void 0:a.raw),c)]})]})}},33320:function(e){e.exports=JSON.parse('[{"name":"Cédula de Ciudadania","id":"1","typaDocSAP":"CO1C","legal":"02"},{"name":"Cédula ExtranjerÃa","id":"5","typaDocSAP":"CO1E","legal":"03"},{"name":"NIT","id":"6","typaDocSAP":"CO1N","legal":"06"},{"name":"Pasaporte","id":"8","typaDocSAP":"CO1P","legal":"05"},{"name":"Permiso especial de permanencia","id":"9","typaDocSAP":"CO1V","legal":"15"},{"name":"Permiso por Protección Temporal","id":"11","typaDocSAP":"CO1W"},{"name":"Registro Civil","id":"3","typaDocSAP":"CO1L","legal":"11"},{"name":"Tarjeta de identidad","id":"2","typaDocSAP":"CO1T","legal":"04"}]')},54775:function(e,t,a){var n=a(34164),s=a(74848);t.A=e=>{const{checkActive:t,checkClick:a,square:o,className:i}=e,r=(0,n.A)({"a-checkbox":!0,square:o,[i]:i,"square--active":o&&t});return(0,s.jsx)("div",{className:r,onClick:a,"data-testid":"checkbox",children:o&&t?(0,s.jsx)("i",{className:"icon-check1"}):(0,s.jsx)(s.Fragment,{children:t&&(0,s.jsx)("div",{className:"a-checkbox--active"})})})}},70072:function(e,t,a){a.r(t),a.d(t,{default:function(){return M}});var n=a(96540),s=a(49785),o=a(51145),i=a(88767),r=a(44063),c=a(79771),l=a(40587),u=a(4240),d=a(74848);var m=({description:e,url:t,title:a})=>((0,n.useEffect)(()=>{const e=document.querySelector(".a-card-description__subtitle a");null==e||e.setAttribute("target","_blank")},[]),(0,d.jsxs)("aside",{className:"a-card-description",children:[(0,d.jsx)("figure",{className:"a-card-description__figure",children:(0,d.jsx)("img",{className:"image",src:t,alt:"alt_image","data-testid":"image_card",id:"image_card"})}),(0,d.jsx)("h3",{className:"a-card-description__title",children:a}),(0,d.jsx)("div",{className:"a-card-description__subtitle",children:(0,u.i)(JSON.parse(e.raw))})]})),p=a(29390);
1var f=({title:e,subtitle:t,listChannels:a})=>(0,d.jsx)("article",{className:"m-communication-channels",children:(0,d.jsxs)("aside",{className:"m-communication-channels__content",children:[(0,d.jsxs)("div",{className:"m-communication-channels__content__header",children:[(0,d.jsx)("h2",{className:"title",children:e}),(0,d.jsx)("p",{className:"subtitle",children:t})]}),(0,d.jsx)("div",{className:"m-communication-channels__content__list",children:a.map((e,t)=>(0,d.jsx)(m,{title:e.titulo,description:e.descripcion,url:(0,p.s)(e.icono)},t))})]})}),_=a(17325);const h=e=>{if(0===e||null===e)return"0:00";const t=Math.floor(e/3600),a=Math.floor((e-3600*t)/60),n=e-3600*t-60*a;return t?t+" horas "+a+" minutos "+n+" segundos ":a+" minutos "+n+" segundos"};var v=a(93231);var g=({onClose:e,modalContent:t,onCancel:a,onAccept:s,onAcceptCancel:o,isAccept:i,loader:r,listInfo:c})=>{var l,m,f,g,x,b,j,y,$,N,S;const C=i?t[1]:t[0],[A,D]=(0,n.useState)(!1),[w,E]=(0,n.useState)((null===(l=c.info)||void 0===l||null===(m=l.wait_metrics)||void 0===m?void 0:m.waiting_time)||(null===(f=c.info)||void 0===f||null===(g=f.wait_metrics)||void 0===g?void 0:g.wait_estimate)||0);(0,n.useEffect)(()=>{setTimeout(()=>{e()},1e4)},[]);const k=(0,n.useCallback)(()=>setInterval(()=>{w>0?E(w-1):D(!0)},1e3),[w]);return(0,n.useEffect)(()=>{const e=k();return 0===w&&(D(!0),clearInterval(e)),()=>{clearInterval(e)}},[A,w]),(0,d.jsxs)("div",{className:"m-modal-request-shift",children:[(0,d.jsx)("figure",{className:"m-modal-request-shift__closeBtn",onClick:e,children:(0,d.jsx)("img",{src:v.A,alt:"closeButton"})}),(0,d.jsxs)("article",{className:"m-modal-request-shift__content",children:[(0,d.jsx)("figure",{className:"m-modal-request-shift__content__img",children:(0,d.jsx)("img",{src:(0,p.s)(C.imagen[0]),alt:C.imagen[0].file.title})}),(0,d.jsx)("aside",{className:"m-modal-request-shift__content__title",children:(0,d.jsxs)("h2",{children:[C.titulo," ",i&&(null===(x=c.info)||void 0===x?void 0:x.name)]})}),(0,d.jsx)("aside",{className:"m-modal-request-shift__content__subtitle",children:(0,d.jsx)("h2",{children:C.subtitulo})}),i&&(0,d.jsx)("aside",{className:"m-modal-request-shift__content__wait",children:(0,d.jsxs)("p",{children:[w>300?C.nombre:" "," ",w>300?h(w):"Tu turno esta proximo a ser llamado, acercate a la sede lo mas pronto posible"]})}),i?(0,d.jsxs)("aside",{className:"m-modal-request-shift__content__address",children:[(0,d.jsxs)("div",{className:"branch",children:[(0,d.jsx)("h2",{children:C.lista[0]}),(0,d.jsxs)("div",{children:[(0,d.jsx)("p",{className:"branch__name",children:null===(b=c.info)||void 0===b||null===(j=b.branch)||void 0===j?void 0:j.name}),(0,d.jsx)("p",{className:"branch__address",children:null===(y=c.info)||void 0===y||null===($=y.branch)||void 0===$?void 0:$.address})]})]}),(0,d.jsxs)("div",{className:"service",children:[(0,d.jsx)("h2",{className:"service__title",children:C.lista[1]}),(0,d.jsx)("p",{children:null===(N=c.info)||void 0===N||null===(S=N.current_line)||void 0===S?void 0:S.name})]})]}):(0,d.jsx)("aside",{className:"m-modal-request-shift__content__description",children:(0,d.jsxs)("h2",{children:[" ",(0,u.i)(JSON.parse(C.descripcion.raw))]})}),(0,d.jsx)("aside",{className:"m-modal-request-shift__content__buttons",children:!i&&(0,d.jsxs)(d.Fragment,{children:[(0,d.jsx)(_.A,{type:"button",classname:"secondary accept",text:C.boton[1].copy,onClickAction:i?s:o,isDisabled:!1,loader:r}),(0,d.jsx)(_.A,{type:"button",classname:"primary cancel",text:C.boton[0].copy,onClickAction:a,isDisabled:!1})]})})]})]})},x=a(3026),b=a(34164),j=a(54775),y=a(64691),$=a(18395),N=a(72062),S=a(3887),C=a(83793);var A=({contentInfo:e,register:t,setValue:a,handleSubmit:s,errors:o,getValues:i,reset:r,setIsChecksReady:c})=>{var l;const u=e.referencias[1],{gigyaContext:m}=(0,n.useContext)(y.A),[p,f]=(0,n.useState)(!1),[_,h]=(0,n.useState)(!1),[v,g]=(0,n.useState)(!1),[x,A]=(0,n.use
1State)(""),D=e=>{"one"===e?(h(!_),a("termsOne",!_)):(g(!v),a("termsTwo",!v))},w=(0,b.A)({"m-request-form-shift__checkbox__size":!0,"m-request-form-shift__checkbox--error":o.terms}),E=e=>{"one"===e?(h(!_),a("termsOne",!_)):(g(!v),a("termsTwo",!v))};(0,n.useEffect)(()=>{var e,t,n,s,o,c,l,u,d,p;const _=i("terms");if(a("terms",null!=_&&_),null==m||!m.gigyaAccount)return f(!1),void r();f(!0);const h=$.find(e=>{var t,a;return e.typaDocSAP===(null==m||null===(t=m.gigyaAccount)||void 0===t||null===(a=t.data)||void 0===a?void 0:a.docType)});A(null==h?void 0:h.name),a("name",(0,N.d)(`${null==m||null===(e=m.gigyaAccount)||void 0===e||null===(t=e.profile)||void 0===t?void 0:t.firstName} ${null==m||null===(n=m.gigyaAccount)||void 0===n||null===(s=n.data)||void 0===s?void 0:s.secondName}`)),a("lastName",(0,N.d)(`${null==m||null===(o=m.gigyaAccount)||void 0===o||null===(c=o.profile)||void 0===c?void 0:c.lastName} ${null==m||null===(l=m.gigyaAccount)||void 0===l||null===(u=l.data)||void 0===u?void 0:u.secondLastName}`)),a("documentType",h),a("docNumber",(0,N.d)(null==m||null===(d=m.gigyaAccount)||void 0===d||null===(p=d.data)||void 0===p?void 0:p.docNumber))},[null==m?void 0:m.gigyaAccount]),(0,n.useEffect)(()=>{c(!0===_&&!0===v)},[_,v]);return(0,n.useEffect)(()=>{null!=m&&m.gigyaAccount&&c(!0)},[null==m?void 0:m.gigyaAccount]),(0,d.jsxs)("form",{onSubmit:s,className:"m-request-form-shift",children:[u.referencias&&u.referencias[0]&&(0,d.jsx)("div",{className:"m-request-form-shift__input",children:(0,d.jsx)(S.A,{label:u.referencias[0].titulo?u.referencias[0].titulo:"Nombres",name:"name",maxLength:"100",type:"text",square:!0,placeholder:u.referencias[0].subtitulo?u.referencias[0].subtitulo:"Escribe tus nombres",register:t,validationRules:{required:{value:!0,message:"Campo requerido"},pattern:{value:/^[A-Za-zÃ-ÿ ,.'-]+$/,message:"No se permiten caracteres especiales"},minLength:{value:2,message:"El nombre debe tener al menos 2 caracteres"}},setValue:a,required:!0,error:o.name,disabled:p})}),u.referencias&&u.referencias[1]&&(0,d.jsx)("div",{className:"m-request-form-shift__input",children:(0,d.jsx)(S.A,{label:u.referencias[1].titulo?u.referencias[1].titulo:"Apellidos",name:"lastName",maxLength:"100",type:"text",square:!0,placeholder:u.referencias[1].subtitulo?u.referencias[1].subtitulo:"Escribe tus apellidos",register:t,validationRules:{required:{value:!0,message:"Campo requerido"},pattern:{value:/^[A-Za-zÃ-ÿ ,.'-]+$/,message:"No se permiten caracteres especiales"},minLength:{value:2,message:"El nombre debe tener al menos 2 caracteres"}},setValue:a,required:!0,error:o.lastName,disabled:p})}),u.referencias&&u.referencias[2]&&(0,d.jsx)("div",{className:"m-request-form-shift__input",children:(0,d.jsx)(C.A,{label:u.referencias[1].titulo?u.referencias[2].titulo:"Tipo de documento",name:"documentType",id:"m-request-form__document-type",register:t,options:u.referencias[2].listaJson?u.referencias[2].listaJson:[{name:u.referencias[2]&&u.referencias[2].subtitulo?u.referencias[2].subtitulo:"Selecciona un tipo de documento",value:""}],setValue:a,square:!0,validationRules:{required:{value:!0,message:"Campo requerido"}},defaultValue:{name:u.referencias[2]&&u.referencias[2].subtitulo?u.referencias[2].subtitulo:"Selecciona un tipo de documento",value:""},...x&&{forceChangeValue:{name:x,value:(e=>e?{CO1C:"CC",CO1T:"TI",CO1E:"CE"}[e]:"NU")(null==m||null===(l=m.gigyaAccount)||void 0===l?void 0:l.data.docType)}},error:o.documentType,required:!0,disabled:p})}),u.referencias&&u.referencias[3]&&(0,d.jsx)("div",{className:"m-request-form-shift__input",children:(0,d.jsx)(S.A,{label:u.referencias[3].titulo?u.referencias[3].titulo:"Número de documento",name:"docNumber",maxLength:"25",type:"number",square:!0,placeholder:u.referencias[3].subtitulo?u.referencias[3].subtitulo:"Escribe tu número de documento",register:t,validationRules:{required:{value:!0,message:"Campo requerido"},pattern:{value:/^[{0-9}]+$/,message:"No se permiten caracteres especiales"},maxLength:{value:25,message:"El documento no debe superar los 25 dÃgitos"},minLength:{value:5,message:"El documento debe tener al menos 5 dÃgitos"}},setValue:a,required:!0,error:o.docNumber,disabled:p})}),!p&&(0,d.jsxs)("div",{className:"m-request-form-shift__checkContainer",children:[(0,d.jsxs)("aside",{className:"m-request-form-shift__checkContainer__checkbox",children:[(0,d.jsx)("input",{className:"checkbox",type:"checkbox",...t("termsOne",{required:{value:!0,message:"Campo requerido"}})}),(0,d.jsx)(j.A,{square:!0,checkActive:_,checkClick:()=>D("one"),className:w}),(0,d.jsxs)("label",{className:"label",onClick:()=>E("one"),children:[`${u.referencias[4].titulo} `,(0,d.jsx)("a",{className:"link",href:u.referencias[4].redireccion,target:"_blank",rel:"noopener noreferrer",children:u.referencias[4].copyBoton}),` ${u.referencias[4].subtitulo}`]})]}),(0,d.jsxs)("aside",{className:"m-request-form-shift__checkContainer__checkbox",children:[(0,d.jsx)("input",{className:"checkbox",type:"checkbox",...t("termsTwo",{required:{value:!0,message:"Campo requerido"}})}),(0,d.jsx)(j.A,{square:!0,checkActive:v,checkClick:()=>D("two"),className:w}),(0,d.jsxs)("label",{className:"label",onClick:()=>E("two"),children:[`${u.referencias[5].titulo} `,(0,d.jsx)("a",{className:"link",href:u.referencias[5].redireccion,target:"_blank",rel:"noopener noreferrer",children:u.referencias[5].copyBoton}),` ${u.referencias[5].subtitulo}`]})]})]})]})};
1const D=({name:e,options:t,label:a,register:s,validationRules:o,error:i,id:r,onChange:c,setValue:l,defaultValue:u,onDisplayEvent:m,onSelectEvent:p,forceChangeValue:f,required:_,square:h,role:v,disabled:g=!1,isDefaultValue:x=!1,placeholder:b})=>{const[j,y]=(0,n.useState)(),[$,N]=(0,n.useState)(),[S,C]=(0,n.useState)(!1),[A,D]=(0,n.useState)("");(0,n.useEffect)(()=>{t.length&&(t[0]&&l(e,t[0].value),y(t[0].name))},[]),(0,n.useEffect)(()=>{x&&y(u.name),u?(u&&j===u.name||!j)&&(l(e,u.value),y(u.name)):(l(e,t[0].value),y(t[0].name))},[u]),(0,n.useEffect)(()=>{f&&w(f.name,f.value)},[f]),(0,n.useLayoutEffect)(()=>{"requestType"===e&&(y("Selecciona"),l("requestType",""))},[t]);const w=(t,a)=>{l(e,a),y(t),c(t,a),C(!1)},E=()=>{const t=document.getElementById(`${r}select`),n=document.getElementById(`${r}options`),s=document.getElementById(`${r}currentOption`);if(a){const t=document.getElementById(e+a);t&&t.classList.toggle("__visible")}t&&n&&s&&(t.classList.toggle("__active"),n.classList.toggle("__active"),s.classList.toggle("__active"))};return(0,d.jsxs)("div",{className:"f-a-selectBox "+(h?" __square":""),role:v,children:[a&&(0,d.jsx)("label",{id:e+a,htmlFor:e,className:"f-a-selectBox__label"+(_?" __required":""),children:a}),S&&(0,d.jsx)("div",{"data-testid":"btn1",className:"f-a-selectBox__background",onClick:()=>{g||(E(),C(!1))}}),(0,d.jsx)("div",{"data-testid":"btn2",tabIndex:0,className:"f-a-selectBox__select "+(i?"__error":""),id:`${r}select`,onClick:()=>{g||(m&&m(),C(!S),E())},children:(0,d.jsxs)("div",{className:"f-a-selectBox__select-inner",children:[(0,d.jsx)("div",{className:"f-a-selectBox__select-content",children:(0,d.jsx)("input",{"data-testid":"btn3",type:"text",id:`${r}currentOption`,name:e,autoComplete:"off",placeholder:b,defaultValue:$,value:$,onClick:()=>C(!0),onChange:e=>{D(e.target.value),N(e.target.value)}})}),h?S?(0,d.jsx)("span",{className:"icon-caret-up f-a-selectBox__icon"}):(0,d.jsx)("span",{className:"icon-caret-down f-a-selectBox__icon"}):S?(0,d.jsx)("span",{className:"icon-chevron-up f-a-selectBox__icon"}):(0,d.jsx)("span",{className:"icon-chevron-down1 f-a-selectBox__icon"})]})}),(0,d.jsx)("ul",{className:"f-a-selectBox__option-container",id:`${r}options`,children:t&&(()=>{if(A.length>=4){const e=t.filter(e=>e.name.toLocaleLowerCase().includes(A.toLocaleLowerCase()));if(""===A)return t;if(e.length>0)return e}return t})().map((t,n)=>(0,d.jsx)("li",{className:"f-a-selectBox__option",onClick:()=>{p&&p(),((t,n)=>{const s=document.getElementById(`${r}select`),o=document.getElementById(`${r}options`),i=document.getElementById(`${r}currentOption`);if(s&&o&&i&&(s.classList.toggle("__active"),s.classList.remove("__error"),o.classList.toggle("__active"),i.classList.toggle("__active")),l(e,n),y(t),c(t,n),a){const t=document.getElementById(e+a);t&&t.classList.remove("__visible")}C(!1)})(t.name,t.value),N(t.name),D("")},children:(0,d.jsx)("p",{children:t.name})},n))}),(0,d.jsx)("input",{type:"hidden",name:e,id:e,...s(e,o)}),i&&(0,d.jsx)("span",{className:"f-a-selectBox__error",children:i.message})]})};D.defaultProps={id:"f-a-",onChange:()=>{}};var w=D,E=a(48314),k=a(89179);const q=async({branchId:e})=>k.S.get(`${E.ed}/get_lines/${e}`);var I=n.memo(({handleSubmit:e,register:t,setValue:a,errors:s,getValues:o,listBranch:i,isLoadingSelectBranch:l,setListInfoService:u})=>{const[m,p]=(0,n.useState)([]),[f,_]=(0,n.useState)(!1),[h,v]=(0,n.use
1State)(!1),[g,x]=(0,n.useState)(!1),b=e=>v((0,d.jsx)(r.A,{message:e,position:"up-right-small",setActiveToast:v,size:"small"})),j=async e=>{if(e){_(!0);try{var t;const a=await q({branchId:e});if(200!==a.data.status)return void b(a.data.userMessage);const n=null===(t=a.data.data)||void 0===t?void 0:t.lines.map(e=>({value:e.id,name:e.name,...e})).sort((e,t)=>e.name.localeCompare(t.name));p(n),u(n)}catch(a){console.error(a);const e=a;b((null==e?void 0:e.message)||"Error al obtener los servicios"),setTimeout(()=>{window.location.reload()},2e3)}finally{_(!1)}}};return(0,d.jsxs)("form",{onSubmit:e,className:"m-shift-service-branch",children:[h&&(0,d.jsx)(d.Fragment,{children:h}),(0,d.jsx)("div",{className:"m-shift-service-branch__input",children:(0,d.jsx)(w,{label:"Sede",name:"sede",id:"m-request-form__sede",register:t,options:i.length?i:[{name:"Selecciona una sede",value:""}],setValue:a,square:!0,validationRules:{required:{value:!0,message:"Campo requerido"}},error:s.sede,required:!0,onChange:()=>(()=>{const e=o("sede");p([]),x(!0),j(e)})(),loader:l,disabled:l,placeholder:"Selecciona una sede"})}),f?(0,d.jsx)("div",{className:"m-shift-service-branch__loader",children:(0,d.jsx)(c.A,{size:"medium"})}):(0,d.jsx)("div",{className:"m-shift-service-branch__input",children:(0,d.jsx)(w,{label:"Servicio",name:"service",id:"m-request-form__service",register:t,options:m.length?m:[{name:"Selecciona un servicio",value:""}],setValue:a,square:!0,validationRules:{required:{value:!0,message:"Campo requerido"}},defaultValue:{name:"Selecciona un servicio",value:""},error:s.service,required:!0,loader:f,disabled:f,isDefaultValue:g,placeholder:"Selecciona un servicio"})})]})}),T=a(5588);var B=(0,n.memo)(({turnText:e,textTimerStatus:t,image:a,shiftInfoTitle:s,shiftInfoSubtitle:o,listContent:i,listResponse:r,ticketsOnFront:c,onClickPrevious:l,onClickNext:u,loaderAccept:m,ticketId:p})=>{var f,v,g,x,b,j,y;const[$,N]=(0,n.useState)((null===(f=r.info)||void 0===f||null===(v=f.wait_metrics)||void 0===v?void 0:v.waiting_time)||(null===(g=r.info)||void 0===g||null===(x=g.wait_metrics)||void 0===x?void 0:x.wait_estimate)||0),[S,C]=(0,n.useState)(!1),A=(0,n.useCallback)(()=>setInterval(()=>{$>0?N($-1):C(!0)},1e3),[$]);return(0,n.useEffect)(()=>{const e=A();return 0===$&&(C(!0),clearInterval(e)),()=>{clearInterval(e)}},[S,$]),(0,d.jsxs)("div",{className:"o-shift-request-result",children:[(0,d.jsxs)("article",{className:"o-shift-request-result__card",children:[(0,d.jsx)("figure",{className:"o-shift-request-result__image",children:(0,d.jsx)(T.G,{image:a.gatsbyImage[0],alt:a.title,title:a.title,loading:"eager"})}),(0,d.jsxs)("p",{children:[(0,d.jsx)("span",{className:"o-shift-request-result__text",children:e}),(0,d.jsx)("span",{className:"o-shift-request-result__name",children:r.info.name})]}),(0,d.jsx)("p",{className:"o-shift-request-result__cardOne",children:(0,d.jsx)("span",{className:"o-shift-request-result__request",children:r.success?"Solicitud activa":"Solicitud finalizada"})}),(0,d.jsxs)("p",{children:[(0,d.jsx)("span",{className:"o-shift-request-result__timer",children:$>120?t:""}),(0,d.jsx)("span",{className:"o-shift-request-result__timer --number",children:$>120?h($):"Tu turno esta proximo a ser llamado, acercate a la sede lo mas pronto posible"})]})]}),(0,d.jsxs)("article",{className:"o-shift-request-result__card cardTwo",children:[(0,d.jsx)("h2",{className:"o-shift-request-result__title",children:s}),(0,d.jsx)("p",{className:"o-shift-request-result__subtitle",children:o}),(0,d.jsx)("hr",{className:"o-shift-request-result__line"}),(0,d.jsxs)("aside",{className:"o-shift-request-result__listInfo",children:[(0,d.jsxs)("p",{children:[(0,d.jsx)("span",{className:"header",children:i.lista[0]}),(0,d.jsx)("span",{className:"content",children:c})]}),(0,d.jsxs)("p",{children:[(0,d.jsx)("span",{className:"header",children:i.lista[1]}),(0,d.jsxs)("span",{className:"content",children:[null===(b=r.info)||void 0===b?void 0:b.branch.name," "]}),(0,d.jsx)("span",{className:"content address",children:null===(j=r.info)||void 0===j||null===(y=j.branch)||void 0===y?void 0:y.address})]}),(0,d.jsxs)("p",{children:[(0,d.jsx)("span",{className:"header",children:i.lista[2]}),(0,d.jsx)("span",{className:"content",children:r.info.current_line.name})]})]}
1),(0,d.jsxs)("aside",{className:"o-shift-request-result__buttons",children:[!p&&(null!=i&&i.boton[1]?(0,d.jsx)(_.A,{type:"button",classname:"one",text:i.boton[1].copy,onClickAction:u,isDisabled:!1,loader:m}):(0,d.jsx)(_.A,{type:"button",classname:"one",text:"Tomar turno",onClickAction:u,isDisabled:!1,loader:m,gtmMark:"gtmClickBotonCancelarTurnoPresencial"})),(0,d.jsx)("button",{type:"button",className:"two",onClick:l,children:i.boton[0].copy})]})]})]})}),L=a(68667),P=a(29900),O=a(5290),V=a(33320),R=a(18875);var X=(0,n.memo)(({contentInfo:e})=>{const{selectedTab:t,gigyaContext:a,userInfoContext:u}=(0,n.useContext)(y.A),[m,p]=(0,n.useState)(""),[_,h]=(0,n.useState)(!1),[v,b]=(0,n.useState)(0),[j,$]=(0,n.useState)(!1),[S,C]=(0,n.useState)(!1),[D,w]=(0,n.useState)(!1),[T,X]=(0,n.useState)(!1),[z,F]=(0,n.useState)(!1),[M,U]=(0,n.useState)(!1),[J,G]=(0,n.useState)(0),[H,K]=(0,n.useState)(0),[W,Y]=(0,n.useState)(!1),[Q,Z]=(0,n.useState)([]),[ee,te]=(0,n.useState)(!1),[ae,ne]=(0,n.useState)([]),[se,oe]=(0,n.useState)(!1),ie=new o.A,[re,ce]=(0,n.useState)({success:!1,info:{}}
1),[le,ue]=(0,n.useState)({sede:"",service:"",docNumber:"",documentType:"",lastName:"",name:""}),{register:de,setValue:me,handleSubmit:pe,formState:{errors:fe},reset:_e,getValues:he,clearErrors:ve}=(0,s.mN)(),ge=e.referencias[2],xe=e.referencias[3],be=e.referencias[4],je=e.modal,ye=[...e.lista].slice(0,2),$e=(e,t)=>Y((0,d.jsx)(r.A,{message:e,position:"up-right-small",setActiveToast:Y,size:"small",isOk:null!=t&&t})),Ne=async()=>{F(!0),te(!0);try{var e;const t=await(async()=>k.S.get(`${E.ed}/get_branches`))();if(200!==t.status)return F(!1),te(!1),$e("Error al cargar las sedes");if(200!==t.data.status)return F(!1),te(!1),$e(t.data.userMessage);500!==t.data&&500!==t.data.status||(F(!1),te(!1),window.location.reload());const a=null===(e=t.data.data)||void 0===e?void 0:e.sites.map(e=>({...e,value:e.id,name:null==e?void 0:e.name_customed})).sort((e,t)=>e.name.localeCompare(t.name));Z(a),F(!1),te(!1)}catch(t){F(!1),te(!1);const e=t;$e((null==e?void 0:e.message)||"Error al obtener las sedes")}};(0,n.useEffect)(()=>(Ne(),()=>{Z([])}),[]),(0,n.useEffect)(()=>{a.gigyaAccount&&oe(!0)},[]),(0,n.useEffect)(()=>{var e,t,a,n;const s=ae.find(e=>e.value===he("service")),o=Q.find(e=>e.id===he("sede")),i={success:null==s?void 0:s.enabled,info:{name:"",branch:{id:he("sede"),name:null==o?void 0:o.name,address:null==o||null===(e=o.location)||void 0===e?void 0:e.address},current_line:{name:null==s?void 0:s.name,id:""},wait_metrics:{wait_estimate:null!==(t=null==s||null===(a=s.metrics)||void 0===a?void 0:a.waiting_time_estimation)&&void 0!==t?t:0,tickets_in_front:null!==(n=null==s?void 0:s.waiting_tickets)&&void 0!==n?n:0}}};ce(i)},[he("service")]),(0,n.useEffect)(()=>{if(!localStorage.getItem("ticketId")){let e=0,t=0;ae.forEach(a=>{e+=a.waiting_tickets,t+=a.metrics.waiting_time_estimation}),G(e),K(t)}},[ae]);const Se=async e=>{var t,n;const s=await(null==Object||null===(t=Object.entries(L.K))||void 0===t||null===(n=t.find(t=>(null==t?void 0:t[0])===(null==e?void 0:e.documentType)))||void 0===n?void 0:n[0]);if(se)ue(e);else{var o,i,r;const t=null==Object||null===(o=Object.entries(L.K))||void 0===o||null===(i=o.find(t=>(null==t?void 0:t[0])===(null==e?void 0:e.documentType)))||void 0===i?void 0:i[1];e.documentType=t,ue(e);const a=null===(r=V.find(e=>e.typaDocSAP===t))||void 0===r?void 0:r.legal;(0,O._8)(e.docNumber,a,"[email protected]")}var c,l,d,m,p,f,_,h,g;0!==v?b(2):(se?(0,P.A)(`${null==a||null===(c=a.gigyaAccount)||void 0===c?void 0:c.profile.firstName} ${null!=a&&null!==(l=a.gigyaAccount)&&void 0!==l&&l.data.secondName?`${a.gigyaAccount.data.secondName} `:""}${null==a||null===(d=a.gigyaAccount)||void 0===d?void 0:d.profile.lastName}${null!=a&&null!==(m=a.gigyaAccount)&&void 0!==m&&m.data.secondLastName?` ${null==a||null===(p=a.gigyaAccount)||void 0===p?void 0:p.data.secondLastName}`:""}`,null==a||null===(f=a.gigyaAccount)||void 0===f?void 0:f.data.docNumber,null==a||null===(_=a.gigyaAccount)||void 0===_?void 0:_.data.docType,null==a||null===(h=a.gigyaAccount)||void 0===h?void 0:h.profile.email,"click","SolicitudDeTurnos :: SolicitudDeTurnos :: } ClickBotonContinuar",null===(g=u.data)||void 0===g?void 0:g.userJwt):s&&(0,P.A)(`${e.name} ${e.lastName}`,e.docNumber,s,"[email protected]","click","SolicitudDeTurnos :: SolicitudDeTurnos :: } ClickBotonContinuar",ie.get("token")),b(.9))},Ce=async()=>{try{if(!m)return;X(!0);const e=await(async e=>k.S.put(`${E.ed}/cancel_ticket/${e}`,void 0))(m),{data:t}=e;if(200!==t.status)return $e(t.userMessage);localStorage.removeItem("ticketId")}catch(e){console.error(e);const t=e;$e((null==t?void 0:t.message)||"Error al cancelar el turno")}finally{null!=a&&a.gigyaAccount||_e(),$(!1),b(0),ce({success:!1,info:{}}),p(""),h(!1),X(!1)}},Ae=async()=>{try{var e,t,a;if(m)return $e("Ya tienes un turno creado",!0);C(!0),w(!0);const n=await(async e=>k.S.post(`${E.ed}/create_ticket`,e))({branch_id:null==le?void 0:le.sede,line_id:null==le?void 0:le.service,customer:{doc_id:null==le?void 0:le.docNumber,doc_type:null==le?void 0:le.documentType,last_name:(0,N.d)(null==le?void 0:le.lastName),name:null==le?void 0:le.name}}),{data:s}=n;
1if(200!==s.status)return $e(s.userMessage);$(!0),ce({...re,info:{...re.info,name:null===(e=s.data)||void 0===e?void 0:e.ticket_name}}),p(null===(t=s.data)||void 0===t?void 0:t.ticket_id),localStorage.setItem("ticketId",null===(a=s.data)||void 0===a?void 0:a.ticket_id),h(!0)}catch(n){console.error(n);const e=n;$e((null==e?void 0:e.message)||"Error al crear el turno")}finally{w(!1)}},De={0:{title:e.referencias[1].titulo,subtitle:e.referencias[1].subtitulo},.9:{title:e.referencias[2].titulo,subtitle:e.referencias[2].subtitulo}};(0,n.useEffect)(()=>{const e=localStorage.getItem("CURRENT_TAB");var t,a;e?e===L.m.BUSINESS&&(location.href="localhost"===(null===(t=window)||void 0===t?void 0:t.location.hostname)?"/empresas":"/portal-servicios/empresas"):location.href="localhost"===(null===(a=window)||void 0===a?void 0:a.location.hostname)?"/personas":"/portal-servicios/personas"},[null==t?void 0:t.get]),(0,n.useEffect)(()=>{var e;null===(e=window)||void 0===e||e.scroll(0,0);const t=localStorage.getItem("ticketId");t&&(te(!0),p(t),(async e=>k.S.get(`${E.ed}/get_ticket/${e}`))(t).then(e=>{200===e.status&&200===e.data.status&&("WAITING"===e.data.data.info.status?(q({branchId:e.data.data.info.branch.id}).then(e=>{let t=0,a=0;e.data.data.lines.forEach(e=>{t+=e.waiting_tickets,a+=e.metrics.waiting_time_estimation}),G(t),K(a)}),G(e.data.data.info.branch.waiting_tickets),h(!0),ce(e.data.data),b(2),te(!1)):(te(!1),localStorage.removeItem("ticketId"))),500===e.data&&window.location.reload()}).catch(e=>{console.log(e)}))},[]);return(0,d.jsxs)("div",{className:"o-request-shifts-content",children:[W&&(0,d.jsx)(d.Fragment,{children:W}),(0,d.jsxs)("div",{className:"o-request-shifts-content__header",children:[(0,d.jsx)(i.A,{content:e.migaDePan}),(0,d.jsx)(x.A,{itemList:ye,currentIndex:0===v||.1===v?0:v,title:e.nombre,subtitle:e.subtitulo,titleType:"h1",isTwo:!0})]}),v<1&&!ee?(0,d.jsx)(R.A,{buttonCopy:e.referencias[1].boton[0].copy,buttonTwo:e.referencias[2].boton[0].copy,buttonEvent:()=>{pe(Se)(),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"pushEventGA",category:"HomePersonas",action:"ClicSolicitudTurnos",label:`Paso ${.9===v?"1":"2"} continuar`})},buttonEventTwo:()=>{b(0),window.dataLayer=window.dataLayer||[],window.dataLayer.push({event:"pushEventGA",category:"HomePersonas",action:"ClicSolicitudTurnos",label:"Paso 2 Volver"})},secondTitle:De[v].title,secondSubtitle:De[v].subtitle,note:{image:e.referencias[0].imagen[0],title:e.referencias[0].titulo,content:e.referencias[0].descripcion},notePosition:"left",disableButton:!M,isSecondButton:.9===v,subRoute:"solicitud-de-turnos",children:{0:(0,d.jsx)(A,{contentInfo:e,register:de,setValue:me,handleSubmit:pe,errors:fe,getValues:he,reset:_e,setIsChecksReady:U}),.9:(0,d.jsx)(I,{handleSubmit:pe,register:de,setValue:me,errors:fe,getValues:he,listBranch:Q,isLoadingSelectBranch:z,setListInfoService:ne,clearErrors:ve})}[v]}):v<1&&(0,d.jsx)(c.A,{size:"medium"}),.9===v&&(0,d.jsx)(f,{listChannels:ge.secciones[0].referencias,title:ge.secciones[0].titulo,subtitle:ge.secciones[0].subtitulo}),2===v&&(0,d.jsx)(d.Fragment,{children:ee?(0,d.jsx)(c.A,{size:"big"}):(0,d.jsx)(B,{turnText:xe.titulo,textTimerStatus:xe.subtitulo,image:xe.imagen[0],shiftInfoTitle:be.titulo,shiftInfoSubtitle:be.subtitulo,listContent:be,listResponse:re,onClickNext:()=>Ae(),onClickPrevious:()=>{m?($(!0),C(!1)):b(0)},loaderAccept:D,ticketsOnFront:J,timerOnFront:H,ticketId:_})}),j&&(0,d.jsx)(l.A,{open:j,onClose:()=>{$(!1)},children:(0,d.jsx)(g,{modalContent:je,onClose:()=>{$(!1)},onCancel:()=>$(!1),onAccept:()=>$(!1),onAcceptCancel:()=>Ce(),isAccept:S,loader:T,listInfo:re})})]})}),z=a(68315),F=a(64810);var M=()=>{var e,t,a;const n=(0,F.useStaticQuery)("3547669040"),s=null==n||null===(e=n.allContentfulTemplate)||void 0===e||null===(t=e.nodes[0])||void 0===t?void 0:t.metaInfo[0],o=null==n||null===(a=n.allContentfulTemplate)||void 0===a?void 0:a.nodes[0];return(0,d.jsx)(z.A,{data:s,hasLoader:!0,hideSide:!0,isPrivate:!1,isActive:null==o?void 0:o.estaActivo,children:(0,d.jsx)(X,{contentInfo:o})})}},72062:function(e,t,a){a.d(t,{d:function(){return n}});const n=e=>null==e?"":e.includes("null")?e.replace("null",""):e.includes("undefined")?e.replace("undefined",""):e},83793:function(e,t,a){var n=a(96540),s=a(79771),o=a(74848);const i=({name:e,options:t,label:a,register:i,validationRules:r,error:c,id:l,onChange:u,setValue:d,defaultValue:m,onDisplayEvent:p,onSelectEvent:f,forceChangeValue:_,required:h,square:v,loader:g,role:x,disabled:b=!1,isDefaultValue:j=!1})=>
1{const[y,$]=(0,n.useState)(),[N,S]=(0,n.useState)(!1);(0,n.useEffect)(()=>{t.length&&(t[0]&&d(e,t[0].value),$(t[0].name))},[]),(0,n.useEffect)(()=>{j&&$(m.name),m?(m&&y===m.name||!y)&&(d(e,m.value),$(m.name)):(d(e,t[0].value),$(t[0].name))},[m]),(0,n.useEffect)(()=>{_&&C(_.name,_.value)},[_]),(0,n.useLayoutEffect)(()=>{"requestType"===e&&($("Selecciona"),d("requestType",""))},[t]);const C=(t,a)=>{d(e,a),$(t),u(t,a),S(!1)},A=()=>{const t=document.getElementById(`${l}select`),n=document.getElementById(`${l}options`),s=document.getElementById(`${l}currentOption`);if(a){const t=document.getElementById(e+a);t&&t.classList.toggle("__visible")}t&&n&&s&&(t.classList.toggle("__active"),n.classList.toggle("__active"),s.classList.toggle("__active"))};return(0,o.jsxs)("div",{className:"f-a-selectBox "+(v?" __square":""),role:x,"data-testid":"selectBox",children:[a&&(0,o.jsx)("label",{id:e+a,htmlFor:e,className:"f-a-selectBox__label"+(h?" __required":""),children:a}),N&&(0,o.jsx)("div",{className:"f-a-selectBox__background",onClick:()=>{b||(A(),S(!1))}}),(0,o.jsx)("div",{"data-testid":"select",tabIndex:0,className:"f-a-selectBox__select "+(c?"__error":""),id:`${l}select`,onClick:()=>{b||(p&&p(),S(!N),A())},children:(0,o.jsxs)("div",{className:"f-a-selectBox__select-inner",children:[(0,o.jsxs)("div",{className:"f-a-selectBox__select-content",children:[g&&(0,o.jsx)("div",{className:"f-a-selectBox__select-content__loader",children:(0,o.jsx)(s.A,{size:"__small"})}),(0,o.jsx)("p",{"data-testid":"currentOption",id:`${l}currentOption`,className:m&&y!==m.name?"__green":"",children:y})]}),v?N?(0,o.jsx)("span",{className:"icon-caret-up f-a-selectBox__icon"}):(0,o.jsx)("span",{className:"icon-caret-down f-a-selectBox__icon"}):N?(0,o.jsx)("span",{className:"icon-chevron-up f-a-selectBox__icon"}):(0,o.jsx)("span",{className:"icon-chevron-down1 f-a-selectBox__icon"})]})}),(0,o.jsx)("ul",{className:"f-a-selectBox__option-container",id:`${l}options`,"data-testid":"options",children:t&&t.map((t,n)=>(0,o.jsx)("li",{className:"f-a-selectBox__option",onClick:()=>{f&&f(),((t,n)=>{const s=document.getElementById(`${l}select`),o=document.getElementById(`${l}options`),i=document.getElementById(`${l}currentOption`);if(s&&o&&i&&(s.classList.toggle("__active"),s.classList.remove("__error"),o.classList.toggle("__active"),i.classList.toggle("__active")),d(e,n),$(t),u(t,n),a){const t=document.getElementById(e+a);t&&t.classList.remove("__visible")}S(!1)})(t.name,t.value)},children:(0,o.jsx)("p",{children:t.name})},n))}),(0,o.jsx)("input",{type:"hidden",name:e,id:e,...i(e,r)}),c&&(0,o.jsx)("span",{className:"f-a-selectBox__error",children:c.message})]})};i.defaultProps={id:"f-a-",onChange:()=>{}},t.A=i},88767:function(e,t,a){var n=a(64810),s=a(19871),o=a(74848);t.A=e=>{const{content:t}=e,{isBrowser:a}=(0,s.A)();return(0,o.jsx)("nav",{itemType:"https://schema.org/Breadcrumb",className:"miga-de-pan",children:(0,o.jsx)("ul",{className:"a-breadcrumb"+(e.specialEvent?" a-breadcrumb--special-event":""),children:a&&(t=>{const a=t.split("/").map(e=>e.trim()).filter(Boolean);return a.map((t,s)=>{const i=`/${a.slice(1,s+1).map(e=>e.toLowerCase().includes("certificados y consultas")?"certificados":e.replace(/\s+/g,"-").toLowerCase()).join("/")}`;return(0,o.jsx)("li",{itemProp:"url",className:`crumb url-${s}${e.specialEvent?" --special-event":""}`,children:(0,o.jsx)(n.Link,{title:t,to:i.toLocaleLowerCase(),rel:"noopener noreferrer",children:(0,o.jsx)("span",{itemProp:"title",children:t})})},s)})})(t)})})}}}]); 2//# sourceMappingURL=component---src-pages-personas-solicitud-de-turnos-tsx-2d1a3eeea25c5bf82740.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.