widget-web-component 1.4.0-rc.0-rc → 1.4.0-rc.1-rc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +1 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
});
|
|
64
64
|
observer.observe(document.documentElement, { childList: true, subtree: true });
|
|
65
65
|
})();
|
|
66
|
-
"use strict";if((self.webpackChunkvex=self.webpackChunkvex||[]).push([[281,970],{9943:(e,t,n)=>{n.d(t,{J:()=>d});var i=n(1135),s=n(1931),r=n(5762),o=n(2340),a=n(182),l=n(4650),c=n(8460);let d=(()=>{class e{constructor(e){this.customizationStoreService=e,this.labels=s.S.es,this.socket=null,this.currentHeight=0,this._request=new i.X({...new r.l,status_code:"created"}),this._request_status=new i.X(null),this.request$=this._request.asObservable(),this.request_status$=this._request_status.asObservable()}setGlobalVariables(){this.REQUEST=this._request.value,this.REQUEST_STATUS=this.REQUEST?.status_code,this.REQUEST_ID=this.REQUEST?.request_id,this._request_status.next(this.REQUEST_STATUS)}setRequest(e){this._request.next({...e}),this.setGlobalVariables()}patch(e){this._request.next({...this._request.value,...e}),this.setGlobalVariables()}setRequestStatus(e){this._request.next({...this._request.value,status_code:e}),this.setGlobalVariables()}setRequestID(e){this._request.next({...this._request.value,request_id:e}),this.setGlobalVariables()}updateRequestID(e){this.REQUEST_ID=e,this.setRequestID(e)}subscribeWS(e){if(this.socket)return;const t=e||this.REQUEST_ID||this._request.value?.request_id;if(!t)return;let n="wss://notifications.dev.belender.net";"qa"==o.N.env&&(n="wss://notifications.qa.belender.net"),"pro"==o.N.env&&(n="wss://notifications.belender.net"),o.N.notificationsBaseUrl&&(n=o.N.notificationsBaseUrl),this.socket=new WebSocket(`${n}?requests_id=${t}&user_id=${this.customizationStoreService.USER_ID}`);const i=this;this.socket.onopen=function(){console.log("Conexión establecida")},this.socket.onmessage=function(e){const t=JSON.parse(e.data);i.handlePusherNotification(t)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e),console.error(e)},this.socket.onclose=function(){console.log("Conexión cerrada"),i.socket=null}}handlePusherNotification(e){if(!e||a.t.shouldIgnoreWebhookStatus(e.status_code))return;this.sendMessageToParent({type:"websocket",data:e}),console.warn("message from ws: ",e);const t=e.status_code;if(t){if(t.startsWith("failed"))return this.disconnectWebsocket(),void this.setRequestStatus(t);if(t.startsWith("abandoned"))return this.disconnectWebsocket(),void this.setRequestStatus(t);if("consent_process_completed"===t)return this.disconnectWebsocket(),void this.patch({status_code:t});this.patch({status_code:t})}}sendMessageToParent(e){if(e&&e.type&&"widgetHeight"===e.type){if(e.data===this.currentHeight)return;this.currentHeight=e.data}console.log("Message to parent:",e),window.top.postMessage(e,"*")}disconnectWebsocket(){this.socket&&this.socket.close(),this.socket=null}}return e.ɵfac=function(t){return new(t||e)(l.LFG(c.r))},e.ɵprov=l.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},871:(e,t,n)=>{n.d(t,{S:()=>s,q:()=>i});const i={FORM:"form",LOADING:"loading",PASSWORD:"password",OTP:"otp",AUTOFIRMA:"autofirma",SUCCESS:"success",FAILED:"failed",ABANDONED:"abandoned",NO_SERVICE:"no-service",ERROR_DATA:"error-data"},s={created:i.FORM,form:i.FORM,prerequest:i.FORM,terms_and_conditions:i.FORM,widget_opened:i.FORM,waiting_terms_and_conditions:i.FORM,waiting_login_seguridad_social:i.LOADING,saved_otp:i.LOADING,waiting_otp_seguridad_social:i.OTP,waiting_otp:i.OTP,invalid_otp_seguridad_social:i.OTP,waiting_password:i.PASSWORD,waiting_acceptance_file_signed:i.AUTOFIRMA,abandoned_after_bad_phone:i.ABANDONED,abandoned_after_invalid_otp_seguridad_social:i.ABANDONED,abandoned_after_terms_and_conditions:i.ABANDONED,abandoned_after_waiting_otp_seguridad_social:i.ABANDONED,all_documents_downloaded:i.SUCCESS,partial_documents_downloaded:i.SUCCESS,consent_process_completed:i.SUCCESS,waiting_certificate:i.SUCCESS,waiting_documents:i.SUCCESS,partial_documents_downloaded_and_deleted:i.SUCCESS,all_documents_downloaded_and_deleted:i.SUCCESS,bad_phone:i.ERROR_DATA,phone_not_exist_otp:i.ERROR_DATA,failed_with_retry:i.FAILED,failed_without_retry:i.FAILED,failed_documents_downloaded:i.FAILED,failed_login_otp:i.FAILED,consent_process_canceled:i.FAILED,no_service:i.NO_SERVICE}},6281:(e,t,n)=>{n.r(t),n.d(t,{ClientCertModule:()=>gt});var i=n(6895),s=n(6383),r=n(5592),o=n(8739),a=n(7155),l=n(6308),c=n(6709),d=n(7392),u=n(9101),h=n(1561),p=n(4006),m=n(266),f=n(4385),g=n(811),_=n(5601),b=n(3798),v=n(9391),y=n(1572),w=n(182),x=n(4144),S=n(7367),C=n(9602),T=n(3238),k=n(5895),M=n(6257),I=n(1948),E=n(4246),A=n(8594),O=n(6e3),L=n(5861),D=n(7582),P=n(9549),N=n(9933),q=n(5762),R=n(8259),Y=n(2340),F=n(1363),U=n(1931),Z=n(871),H=n(4650),j=n(8467),z=n(5412),B=n(7308),J=n(9943),V=n(4302),Q=n(6830),W=n(3731);function G(e,t){if(1&e&&(H.TgZ(0,"span"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij("¿No has recibido el código? Solicítalo de nuevo en ",e.secsCount," segundos")}}function $(e,t){if(1&e&&(H.TgZ(0,"span"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.AsE("¿No has recibido el código en el teléfono acabado en ",e.lastNumberPhone,"? Solicítalo de nuevo en ",e.secsCount," segundos")}}const K=function(e,t,n){return{color:e,border:t,background:n}};function X(e,t){if(1&e&&(H.ynx(0),H.TgZ(1,"small",11),H.YNc(2,G,2,1,"span",5),H.YNc(3,$,2,2,"span",5),H.qZA(),H.BQk()),2&e){const e=H.oxw();H.xp6(1),H.Q6J("ngStyle",H.kEZ(3,K,e.data.styles.colors.accentColor,"1px solid "+e.data.styles.colors.accentColor,e.data.styles.colors.accentBgColor)),H.xp6(1),H.Q6J("ngIf",!e.lastNumberPhone),H.xp6(1),H.Q6J("ngIf",e.lastNumberPhone)}}function ee(e,t){1&e&&(H.TgZ(0,"span"),H._uU(1," ¿No has recibido el código en tu teléfono? "),H.qZA())}function te(e,t){if(1&e&&(H.TgZ(0,"span"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij(" ¿No has recibido el código en el teléfono acabado en ",e.lastNumberPhone,"? ")}}const ne=function(e,t){return{color:e,background:t}};function ie(e,t){if(1&e){const e=H.EpF();H.ynx(0),H.TgZ(1,"small",11),H.YNc(2,ee,2,0,"span",5),H.YNc(3,te,2,1,"span",5),H.TgZ(4,"a",12),H.NdJ("click",(function(){H.CHM(e);const t=H.oxw();return H.KtG(t.resendOTP())})),H._uU(5,"Reenviar"),H.qZA()(),H.BQk()}if(2&e){const e=H.oxw();H.xp6(1),H.Q6J("ngStyle",H.kEZ(4,K,e.data.styles.colors.dangerColor,"1px solid "+e.data.styles.colors.dangerColor,e.data.styles.colors.dangerBgColor)),H.xp6(1),H.Q6J("ngIf",!e.lastNumberPhone),H.xp6(1),H.Q6J("ngIf",e.lastNumberPhone),H.xp6(1),H.Q6J("ngStyle",H.WLB(8,ne,e.data.styles.colors.dangerTextButtonColor,e.data.styles.colors.dangerColor))}}let se=(()=>{class e{constructor(e,t,n,i){this.fb=e,this.utils=t,this.solucitudesService=n,this.activeRoute=i,this.next=new H.vpe(null),this.errPhone=new H.vpe(null),this.resendO=new H.vpe(null),this.secsCount=60,this.lastNumberPhone="XXX"}ngOnInit(){this.form=this.fb.group({code1:[null,[p.kI.required,p.kI.maxLength(6),p.kI.minLength(6)]]}),this.initSecsInterval(),this.activeRoute.queryParams.subscribe((e=>{e&&e.request_id&&(this.requestID=e.request_id)}),(e=>{console.error(e)})),this.solicitud&&this.solicitud.person_phone&&this.setPhone(this.solicitud.person_phone)}setPhone(e){let t="XXX";e&&(t=(""+e).slice(-3)),this.lastNumberPhone=t}initSecsInterval(){this.interv=setInterval((()=>{this.secsCount--,this.secsCount<=0&&this.finishSecsInterval()}),1e3)}finishSecsInterval(){this.interv&&clearInterval(this.interv)}nextStep(){let e={code:this.getCode()};this.next.emit(e)}getCode(){return this.form.get("code1").value}capturePasteEvent(e){return(0,L.Z)((function*(){}))()}errorStep(){this.errPhone.emit(!0)}setInputEvent(e){""!=e.target.value?R(e.target).next().focus():"Backspace"==e.code&&R(e.target).prev().focus()}resendOTP(){this.resendO.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(H.Y36(p.QS),H.Y36(j.F),H.Y36(_.M),H.Y36(A.gz))},e.ɵcmp=H.Xpm({type:e,selectors:[["belender-otp-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud"},outputs:{next:"nextStep",errPhone:"errorPhone",resendO:"resendOTP"},decls:16,vars:20,consts:[[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"title","py-2"],[4,"ngIf"],[1,"flex","gap-2","items-center","justify-start","w-full","max-w-[200px]"],["appearance","outline",1,"w-full","flex-1"],["tabindex","1","maxlength","6","minlength","1","formControlName","code1","type","text","matInput","",3,"change","keyup"],[1,"flex","items-center","justify-end","gap-2","p-4"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"info-time","w-fit",3,"ngStyle"],[1,"ml-4",3,"ngStyle","click"]],template:function(e,t){1&e&&(H.TgZ(0,"form",0)(1,"div",1),H._UZ(2,"div",2)(3,"div",3),H.ALo(4,"safeHtml"),H.TgZ(5,"div",4),H.YNc(6,X,4,7,"ng-container",5),H.YNc(7,ie,6,11,"ng-container",5),H.qZA(),H.TgZ(8,"div",6)(9,"mat-form-field",7)(10,"mat-label"),H._uU(11," Código OTP "),H.qZA(),H.TgZ(12,"input",8),H.NdJ("change",(function(e){return t.capturePasteEvent(e)}))("keyup",(function(e){return t.setInputEvent(e)})),H.qZA()()()(),H.TgZ(13,"div",9)(14,"button",10),H.NdJ("click",(function(){return t.nextStep()})),H._uU(15,"Siguiente"),H.qZA()()()),2&e&&(H.Q6J("formGroup",t.form),H.xp6(2),H.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),H.Q6J("innerHTML",t.texts.otp.title,H.oJD),H.xp6(1),H.Udp("color",t.data.styles.colors.text),H.Q6J("innerHTML",H.lcZ(4,18,t.texts.otp.description||""),H.oJD),H.xp6(3),H.Q6J("ngIf",t.secsCount&&t.secsCount>0),H.xp6(1),H.Q6J("ngIf",!t.secsCount||t.secsCount<=0),H.xp6(7),H.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),H.Q6J("disabled",t.form.invalid))},dependencies:[i.O5,i.PC,u.lW,P.KE,P.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.nD,p.sg,p.u,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function re(e,t){if(1&e&&(H.TgZ(0,"div",1),H._UZ(1,"div",2)(2,"div",3),H.ALo(3,"safeHtml"),H.qZA()),2&e){const e=H.oxw();H.xp6(1),H.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),H.Q6J("innerHTML",e.texts.success.title,H.oJD),H.xp6(1),H.Udp("color",e.data.styles.colors.text),H.Q6J("innerHTML",H.lcZ(3,8,e.texts.success.description||""),H.oJD)}}let oe=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s}ngOnInit(){}save(){}}return e.ɵfac=function(t){return new(t||e)(H.Y36(p.QS),H.Y36(j.F),H.Y36(_.M),H.Y36(v.o),H.Y36(k.T))},e.ɵcmp=H.Xpm({type:e,selectors:[["belender-success-step"]],inputs:{data:"data",texts:"texts"},decls:1,vars:1,consts:[["class"," pt-4 pb-8 flex flex-col animated fadeIn",4,"ngIf"],[1,"pt-4","pb-8","flex","flex-col","animated","fadeIn"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&H.YNc(0,re,4,10,"div",0),2&e&&H.Q6J("ngIf",!t.data.config.infiniteLoopInCompleted)},dependencies:[i.O5,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function ae(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"div",5)(1,"button",6),H.NdJ("click",(function(){H.CHM(e);const t=H.oxw();return H.KtG(t.retry())})),H._uU(2,"Intentarlo nuevamente"),H.qZA()()}if(2&e){const e=H.oxw();H.xp6(1),H.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px")}}function le(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"div",5)(1,"button",7),H.NdJ("click",(function(){H.CHM(e);const t=H.oxw();return H.KtG(t.newRequest())})),H._uU(2,"Crear nueva solicitud"),H.qZA()()}if(2&e){const e=H.oxw();H.xp6(1),H.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px")}}let ce=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.retryOp=new H.vpe(null),this.newReq=new H.vpe(null)}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}newRequest(){this.newReq.emit(this.solicitud.request_id)}getIfRetryIsAllowed(){return"failed_with_retry"==this.solicitud}getIfNewRequestIsAllowed(){return"failed_documents_downloaded"==this.solicitud}}return e.ɵfac=function(t){return new(t||e)(H.Y36(p.QS),H.Y36(j.F),H.Y36(_.M),H.Y36(v.o),H.Y36(k.T))},e.ɵcmp=H.Xpm({type:e,selectors:[["belender-fail-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud"},outputs:{retryOp:"retry",newReq:"newRequest"},decls:7,vars:8,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"text-red-500","title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","flex items-center justify-end gap-2 p-4",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8",3,"click"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(H.TgZ(0,"div",0)(1,"div",1),H._UZ(2,"div",2)(3,"div",3),H.ALo(4,"safeHtml"),H.qZA(),H.YNc(5,ae,3,6,"div",4),H.YNc(6,le,3,6,"div",4),H.qZA()),2&e&&(H.xp6(2),H.Q6J("innerHTML",t.texts.fail.title,H.oJD),H.xp6(1),H.Udp("color",t.data.styles.colors.text),H.Q6J("innerHTML",H.lcZ(4,6,t.texts.fail.description),H.oJD),H.xp6(2),H.Q6J("ngIf",t.solicitud&&"failed_with_retry"==t.solicitud.status_code),H.xp6(1),H.Q6J("ngIf",t.solicitud&&"failed_documents_downloaded"==t.solicitud.status_code))},dependencies:[i.O5,u.lW,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();n(6866);var de=n(769),ue=n(3848),he=n(1763),pe=n(5696);function me(e,t){if(1&e&&(H.TgZ(0,"mat-error"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij(" ",e.labels.warnings.requiredName," ")}}function fe(e,t){if(1&e&&(H.TgZ(0,"mat-error"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij(" ",e.labels.warnings.requiredFirstSurname," ")}}function ge(e,t){if(1&e&&(H.TgZ(0,"mat-error"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij(" ",e.labels.warnings.requiredSecondSurname," ")}}function _e(e,t){if(1&e&&(H.TgZ(0,"mat-error"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij(" ",e.labels.warnings.needDNI," ")}}function be(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"div",22)(1,"belender-checkbox",20),H.NdJ("changeCheckbox",(function(t){H.CHM(e);const n=H.oxw(2);return H.KtG(n.setTerms2(t))})),H.TgZ(2,"belender-terms-and-policy-links",23),H.NdJ("goToTerms",(function(t){H.CHM(e);const n=H.oxw(2);return H.KtG(n.gotoTermsAndConditions(t))})),H.qZA()()()}if(2&e){const e=H.oxw(2);H.xp6(1),H.Q6J("color",e.data.styles.colors.title),H.xp6(1),H.Q6J("userId",e.userId)("linkType","terms")}}function ve(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"div",22)(1,"belender-checkbox",20),H.NdJ("changeCheckbox",(function(t){H.CHM(e);const n=H.oxw(2);return H.KtG(n.setAssignment(t))})),H._UZ(2,"div",24),H.qZA()()}if(2&e){const e=H.oxw(2);H.xp6(1),H.Q6J("color",e.data.styles.colors.title),H.xp6(1),H.Q6J("innerHTML",(null==e.data[e.flowName]||null==e.data[e.flowName].texts?null:e.data[e.flowName].texts.dataAssignmentText)||(null==e.data[e.flowName]||null==e.data[e.flowName].config_translate?null:e.data[e.flowName].config_translate.dataAssignmentText)||(null==e.data||null==e.data.config?null:e.data.config.dataAssignmentText)||"",H.oJD)}}function ye(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"div",11)(1,"mat-form-field",12)(2,"mat-label"),H._uU(3),H.qZA(),H._UZ(4,"input",13),H.YNc(5,me,2,1,"mat-error",8),H.qZA(),H.TgZ(6,"mat-form-field",12)(7,"mat-label"),H._uU(8),H.qZA(),H._UZ(9,"input",14),H.YNc(10,fe,2,1,"mat-error",8),H.qZA(),H.TgZ(11,"mat-form-field",12)(12,"mat-label"),H._uU(13),H.qZA(),H._UZ(14,"input",15),H.YNc(15,ge,2,1,"mat-error",8),H.qZA(),H.TgZ(16,"mat-form-field",16)(17,"mat-label"),H._uU(18),H.qZA(),H._UZ(19,"input",17),H.YNc(20,_e,2,1,"mat-error",8),H.qZA(),H.YNc(21,be,3,3,"div",18),H.TgZ(22,"div",19)(23,"belender-checkbox",20),H.NdJ("changeCheckbox",(function(t){H.CHM(e);const n=H.oxw();return H.KtG(n.setTerms(t))})),H._uU(24),H.TgZ(25,"a",21),H.NdJ("click",(function(t){H.CHM(e);const n=H.oxw();return H.KtG(n.gotoTermsAndConditionsCertificate(t))})),H.TgZ(26,"u"),H._uU(27),H.qZA()(),H._uU(28),H.qZA()(),H.YNc(29,ve,3,2,"div",18),H.qZA()}if(2&e){const e=H.oxw();let t,n,i,s;H.xp6(3),H.Oqu(e.labels.flowCommon.name),H.xp6(2),H.Q6J("ngIf",null==(t=e.form.get("name"))?null:t.hasError("required")),H.xp6(3),H.Oqu(e.labels.flowCommon.firstSurname),H.xp6(2),H.Q6J("ngIf",null==(n=e.form.get("lastname"))?null:n.hasError("required")),H.xp6(3),H.Oqu(e.labels.flowCommon.secondSurname),H.xp6(2),H.Q6J("ngIf",null==(i=e.form.get("lastname2"))?null:i.hasError("required")),H.xp6(3),H.Oqu(e.labels.nieOrDni),H.xp6(1),H.s9C("placeholder",e.labels.certificate.dniPlaceholder),H.xp6(1),H.Q6J("ngIf",null==(s=e.form.get("dni"))?null:s.hasError("required")),H.xp6(1),H.Q6J("ngIf",!e.data.config.hideCheckLegal),H.xp6(2),H.Q6J("color",e.data.styles.colors.title),H.xp6(1),H.hij(" ",e.labels.flowCommon.certTermsBefore," "),H.xp6(3),H.Oqu(e.labels.flowCommon.certTermsLink),H.xp6(1),H.hij(" ",e.labels.flowCommon.certTermsAfter," "),H.xp6(1),H.Q6J("ngIf",null==e.data?null:e.data.config.dataAssignmentCheck)}}function we(e,t){if(1&e&&(H.TgZ(0,"mat-error"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij(" ",e.labels.warnings.requiredName," ")}}function xe(e,t){if(1&e&&(H.TgZ(0,"mat-error"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij(" ",e.labels.warnings.requiredFirstSurname," ")}}function Se(e,t){if(1&e&&(H.TgZ(0,"mat-error"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij(" ",e.labels.warnings.requiredSecondSurname," ")}}function Ce(e,t){if(1&e&&(H.TgZ(0,"mat-error"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij(" ",e.labels.warnings.needDNI," ")}}function Te(e,t){if(1&e&&(H.TgZ(0,"mat-error"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij(" ",e.labels.warnings.requiredCompanyName," ")}}function ke(e,t){if(1&e&&(H.TgZ(0,"mat-error"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij(" ",e.labels.warnings.requiredCIF," ")}}function Me(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"div",22)(1,"belender-checkbox",20),H.NdJ("changeCheckbox",(function(t){H.CHM(e);const n=H.oxw(2);return H.KtG(n.setTerms2(t))})),H.TgZ(2,"belender-terms-and-policy-links",23),H.NdJ("goToTerms",(function(t){H.CHM(e);const n=H.oxw(2);return H.KtG(n.gotoTermsAndConditions(t))})),H.qZA()()()}if(2&e){const e=H.oxw(2);H.xp6(1),H.Q6J("color",e.data.styles.colors.title),H.xp6(1),H.Q6J("userId",e.userId)("linkType","terms")}}function Ie(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"div",22)(1,"belender-checkbox",20),H.NdJ("changeCheckbox",(function(t){H.CHM(e);const n=H.oxw(2);return H.KtG(n.setAssignment(t))})),H._UZ(2,"div",24),H.qZA()()}if(2&e){const e=H.oxw(2);H.xp6(1),H.Q6J("color",e.data.styles.colors.title),H.xp6(1),H.Q6J("innerHTML",(null==e.data[e.flowName]||null==e.data[e.flowName].texts?null:e.data[e.flowName].texts.dataAssignmentText)||(null==e.data[e.flowName]||null==e.data[e.flowName].config_translate?null:e.data[e.flowName].config_translate.dataAssignmentText)||(null==e.data||null==e.data.config?null:e.data.config.dataAssignmentText)||"",H.oJD)}}function Ee(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"div",11)(1,"mat-form-field",12)(2,"mat-label"),H._uU(3),H.qZA(),H._UZ(4,"input",25),H.YNc(5,we,2,1,"mat-error",8),H.qZA(),H.TgZ(6,"mat-form-field",12)(7,"mat-label"),H._uU(8),H.qZA(),H._UZ(9,"input",26),H.YNc(10,xe,2,1,"mat-error",8),H.qZA(),H.TgZ(11,"mat-form-field",12)(12,"mat-label"),H._uU(13),H.qZA(),H._UZ(14,"input",27),H.YNc(15,Se,2,1,"mat-error",8),H.qZA(),H.TgZ(16,"mat-form-field",16)(17,"mat-label"),H._uU(18),H.qZA(),H._UZ(19,"input",28),H.YNc(20,Ce,2,1,"mat-error",8),H.qZA(),H.TgZ(21,"mat-form-field",16)(22,"mat-label"),H._uU(23),H.qZA(),H._UZ(24,"input",29),H.YNc(25,Te,2,1,"mat-error",8),H.qZA(),H.TgZ(26,"mat-form-field",16)(27,"mat-label"),H._uU(28),H.qZA(),H._UZ(29,"input",30),H.YNc(30,ke,2,1,"mat-error",8),H.qZA(),H.YNc(31,Me,3,3,"div",18),H.TgZ(32,"div",19)(33,"belender-checkbox",20),H.NdJ("changeCheckbox",(function(t){H.CHM(e);const n=H.oxw();return H.KtG(n.setTerms(t))})),H._uU(34),H.TgZ(35,"a",21),H.NdJ("click",(function(t){H.CHM(e);const n=H.oxw();return H.KtG(n.gotoTermsAndConditionsCertificate(t))})),H.TgZ(36,"u"),H._uU(37),H.qZA()(),H._uU(38),H.qZA()(),H.YNc(39,Ie,3,2,"div",18),H.TgZ(40,"h1"),H._uU(41,"safdsfds"),H.qZA()()}if(2&e){const e=H.oxw();let t,n,i,s,r,o;H.xp6(3),H.Oqu(e.labels.flowCommon.name),H.xp6(2),H.Q6J("ngIf",null==(t=e.form.get("name"))?null:t.hasError("required")),H.xp6(3),H.Oqu(e.labels.flowCommon.firstSurname),H.xp6(2),H.Q6J("ngIf",null==(n=e.form.get("lastname"))?null:n.hasError("required")),H.xp6(3),H.Oqu(e.labels.flowCommon.secondSurname),H.xp6(2),H.Q6J("ngIf",null==(i=e.form.get("lastname2"))?null:i.hasError("required")),H.xp6(3),H.Oqu(e.labels.nieOrDni),H.xp6(1),H.s9C("placeholder",e.labels.certificate.dniPlaceholder),H.xp6(1),H.Q6J("ngIf",null==(s=e.form.get("dni"))?null:s.hasError("required")),H.xp6(3),H.Oqu(e.labels.certificate.companyName),H.xp6(1),H.s9C("placeholder",e.labels.certificate.companyPlaceholder),H.xp6(1),H.Q6J("ngIf",null==(r=e.form.get("razon"))?null:r.hasError("required")),H.xp6(3),H.Oqu(e.labels.cif),H.xp6(1),H.s9C("placeholder",e.labels.certificate.cifPlaceholder),H.xp6(1),H.Q6J("ngIf",null==(o=e.form.get("cif"))?null:o.hasError("required")),H.xp6(1),H.Q6J("ngIf",!e.data.config.hideCheckLegal),H.xp6(2),H.Q6J("color",e.data.styles.colors.title),H.xp6(1),H.hij(" ",e.labels.flowCommon.certTermsBefore," "),H.xp6(3),H.Oqu(e.labels.flowCommon.certTermsLink),H.xp6(1),H.hij(" ",e.labels.flowCommon.certTermsAfter," "),H.xp6(1),H.Q6J("ngIf",null==e.data?null:e.data.config.dataAssignmentCheck)}}function Ae(e,t){if(1&e&&(H.TgZ(0,"div",31),H._UZ(1,"mat-icon",32),H._uU(2),H.qZA()),2&e){const e=H.oxw();H.xp6(2),H.hij(" ",e.labels.warnings.readAndAcceptBothTerms," ")}}function Oe(e,t){if(1&e&&(H.ynx(0),H.TgZ(1,"div",31),H._UZ(2,"mat-icon",32),H._uU(3),H.qZA(),H.BQk()),2&e){const e=H.oxw();H.xp6(3),H.hij(" ",e.labels.warnings.acceptPowerTerms," ")}}const Le={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let De=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.next=new H.vpe(null),this.goTerms=new H.vpe(null),this.goTermsCert=new H.vpe(null),this.acceptTerms=!1,this.acceptTerms2=!1,this.termsReaded=!1,this.terms2Readed=!1,this.step=0,this.assignment=!1,this.submitAttempted=!1}ngOnInit(){console.error(this.solicitud),this.setForm(this.solicitud?this.solicitud:null)}tabChanged(e){this.step=e,this.setForm(null)}setForm(e){let t=e?e.person_document_number||e.phone:null,n=e&&e.razon_social?e.razon_social:null,i=e&&e.cif?e.cif:null,s=e&&e.person_name?e.person_name:null,r=e&&e.person_last_name?e.person_last_name:null;this.form=this.fb.group(this.step&&0!=this.step?{name:[s||null,[p.kI.required]],lastname:[r||null,[p.kI.required]],lastname2:[r||null,[p.kI.required]],dni:[t||null,[p.kI.required,p.kI.maxLength(9),p.kI.minLength(9)]],razon:[n||null,[p.kI.required]],cif:[i||null,[p.kI.required]]}:{name:[s||null,[p.kI.required]],lastname:[r||null,[p.kI.required]],lastname2:[r||null,[p.kI.required]],dni:[t||null,[p.kI.required,p.kI.maxLength(9),p.kI.minLength(9)]]})}nextStep(){if(this.form.invalid||!this.getIsValid()||!this.getAssignmentValidation())return void(0,de.J)(this);let e;e=this.step&&0!=this.step?{name:this.form.get("name").value,lastname:this.form.get("lastname").value,lastname2:this.form.get("lastname2").value,dni:this.form.get("dni").value,razon:this.form.get("razon").value,cif:this.form.get("cif").value}:{name:this.form.get("name").value,lastname:this.form.get("lastname").value,lastname2:this.form.get("lastname2").value,dni:this.form.get("dni").value},this.next.emit(e)}gotoTermsAndConditions(e){e.preventDefault(),e.stopPropagation(),this.termsReaded=!0,this.goTerms.emit(!0)}gotoTermsAndConditionsCertificate(e){e.preventDefault(),e.stopPropagation(),this.terms2Readed=!0,this.goTermsCert.emit(!0)}setAssignment(e){this.assignment=e}getAssignmentValidation(){return!(this.data.config.forceChecks&&(!this.data.config.hideCheckLegal&&!this.termsReaded||!this.terms2Readed))&&(!this.data.config.dataAssignmentCheck||this.assignment)}setTerms(e){this.acceptTerms=e}setTerms2(e){this.acceptTerms2=e}getIsValid(){return(this.data.config.hideCheckLegal||this.acceptTerms)&&this.acceptTerms2}}return e.ɵfac=function(t){return new(t||e)(H.Y36(p.QS),H.Y36(j.F))},e.ɵcmp=H.Xpm({type:e,selectors:[["belender-form-step"]],inputs:{userId:"userId",flowName:"flowName",data:"data",texts:"texts",labels:"labels",solicitud:"solicitud"},outputs:{next:"nextStep",goTerms:"goToTerms",goTermsCert:"goToTermsCertificate"},features:[H._Bn([{provide:T.sG,useValue:Le},{provide:H.soG,useValue:"es-ES"}])],decls:15,vars:25,consts:[[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4","custom-html",3,"innerHTML"],[3,"selectedIndex","selectedIndexChange"],[3,"label"],["class","my-3 flex flex-col md:flex-row flex-wrap gap-2 md:justify-between",4,"ngIf"],["class","px-2 flex items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500",4,"ngIf"],[4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"],[1,"my-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["id","form-name","aria-label","Nombre","formControlName","name","matInput",""],["id","form-lastname","aria-label","Primer apellido","formControlName","lastname","matInput",""],["id","form-lastname2","aria-label","Segundo apellido","formControlName","lastname2","matInput",""],["appearance","outline",1,"mb-4","w-full","flex-1","belender-form-field"],["id","form-dni","aria-label","DNI","formControlName","dni","maxlength","9","matInput","",3,"placeholder"],["class","flex justify-start items-center w-full flex-100",4,"ngIf"],[1,"mt-3","flex","justify-start","items-center","w-full","flex-100"],[3,"color","changeCheckbox"],["target","_blank",1,"text-sm","hover:text-blue-500",3,"click"],[1,"flex","justify-start","items-center","w-full","flex-100"],[3,"userId","linkType","goToTerms"],[1,"custom-html",3,"innerHTML"],["id","form-name-legal","aria-label","Nombre","formControlName","name","matInput",""],["id","form-lastname-legal","aria-label","Primer apellido","formControlName","lastname","matInput",""],["id","form-lastname2-legal","aria-label","Segundo apellido","formControlName","lastname2","matInput",""],["id","form-dni-legal","aria-label","DNI","formControlName","dni","maxlength","9","matInput","",3,"placeholder"],["id","form-razon","aria-label","Razón social","formControlName","razon","type","text","matInput","",3,"placeholder"],["id","form-cif","aria-label","CIF","formControlName","cif","type","text","matInput","",3,"placeholder"],[1,"px-2","flex","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"],["svgIcon","mat:warning",1,"text-xs","w-4","h-4"]],template:function(e,t){1&e&&(H.TgZ(0,"form",0)(1,"div",1),H._UZ(2,"div",2)(3,"div",3),H.ALo(4,"safeHtml"),H.qZA(),H.TgZ(5,"mat-tab-group",4),H.NdJ("selectedIndexChange",(function(e){return t.tabChanged(e)})),H.TgZ(6,"mat-tab",5),H.YNc(7,ye,30,15,"div",6),H.qZA(),H.TgZ(8,"mat-tab",5),H.YNc(9,Ee,42,21,"div",6),H.qZA()(),H.YNc(10,Ae,3,1,"div",7),H.YNc(11,Oe,4,1,"ng-container",8),H.TgZ(12,"div",9)(13,"button",10),H.NdJ("click",(function(){return t.nextStep()})),H._uU(14),H.qZA()()()),2&e&&(H.Q6J("formGroup",t.form),H.xp6(2),H.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),H.Q6J("innerHTML",t.texts.form.title,H.oJD),H.xp6(1),H.Udp("color",t.data.styles.colors.text),H.Q6J("innerHTML",H.lcZ(4,23,t.texts.form.description||""),H.oJD),H.xp6(2),H.Q6J("selectedIndex",t.step),H.xp6(1),H.Q6J("label",t.labels.naturalPerson),H.xp6(1),H.Q6J("ngIf",0==t.step),H.xp6(1),H.Q6J("label",t.labels.legalPerson),H.xp6(1),H.Q6J("ngIf",1==t.step),H.xp6(1),H.Q6J("ngIf",t.submitAttempted&&(!t.acceptTerms2||!t.data.config.hideCheckLegal&&!t.acceptTerms)),H.xp6(1),H.Q6J("ngIf",(null==t.data?null:t.data.config.activatePower)&&!(null!=t.solicitud&&t.solicitud.power_activate)),H.xp6(2),H.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),H.xp6(1),H.hij(" ",t.labels.actions.next," "))},dependencies:[i.O5,d.Hw,u.lW,P.TO,P.KE,P.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.nD,p.sg,p.u,ue.SP,ue.uX,he.b,pe.T,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Pe=n(5145);let Ne=(()=>{class e{constructor(e){this.utils=e,this.status="",this.label="Cargando datos.."}ngOnInit(){this.data.config&&this.data.config.infiniteLoopInCompleted?this.label="":Pe.Z.forEach((e=>{e.text==this.status&&(this.label=e.label)}))}}return e.ɵfac=function(t){return new(t||e)(H.Y36(j.F))},e.ɵcmp=H.Xpm({type:e,selectors:[["belender-loading-step"]],inputs:{status:"status",data:"data"},decls:5,vars:1,consts:[[1,"fixed-content","h-full"],[1,"h-full","py-10","flex","flex-col","items-center"]],template:function(e,t){1&e&&(H.TgZ(0,"div",0)(1,"div",1),H._UZ(2,"mat-progress-spinner"),H.TgZ(3,"p"),H._uU(4),H.qZA()()()),2&e&&(H.xp6(4),H.Oqu(t.label))},dependencies:[y.Ou],styles:[".content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),qe=(()=>{class e{constructor(){}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=H.Xpm({type:e,selectors:[["belender-no-service-step"]],inputs:{data:"data",texts:"texts"},decls:5,vars:10,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&(H.TgZ(0,"form",0)(1,"div",1),H._UZ(2,"div",2)(3,"div",3),H.ALo(4,"safeHtml"),H.qZA()()),2&e&&(H.xp6(2),H.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),H.Q6J("innerHTML",t.texts.noService.title,H.oJD),H.xp6(1),H.Udp("color",t.data.styles.colors.text),H.Q6J("innerHTML",H.lcZ(4,8,t.texts.noService.description),H.oJD))},dependencies:[p._Y,p.JL,p.F,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),Re=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.retryOp=new H.vpe(null)}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}getTextStatus(){switch(this.solicitud.status_code){case"abandoned_after_waiting_otp_seguridad_social":return"Abandonado después de esperar OTP de Seguridad Social";case"abandoned_after_invalid_otp_seguridad_social":return"Abandonado despues de OTP inválido en Seguridad Social";case"abandoned_after_invalid_otp_aeat":return"Abandonado despues de OTP inválido en AEAT";case"abandoned_after_waiting_otp_aeat":return"Abandonado después de esperar OTP de AEAT";default:return this.solicitud.status_code}}}return e.ɵfac=function(t){return new(t||e)(H.Y36(p.QS),H.Y36(j.F),H.Y36(_.M),H.Y36(v.o),H.Y36(k.T))},e.ɵcmp=H.Xpm({type:e,selectors:[["belender-abandoned-step"]],inputs:{solicitud:"solicitud",data:"data",texts:"texts"},outputs:{retryOp:"retry"},decls:10,vars:17,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"p-1","px-2","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-md","mb-2","mt-2"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(H.TgZ(0,"div",0)(1,"div",1),H._UZ(2,"div",2)(3,"div",3),H.ALo(4,"safeHtml"),H.TgZ(5,"div",4),H._uU(6),H.qZA()(),H.TgZ(7,"div",5)(8,"button",6),H.NdJ("click",(function(){return t.retry()})),H._uU(9,"Intentarlo nuevamente"),H.qZA()()()),2&e&&(H.xp6(2),H.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),H.Q6J("innerHTML",t.texts.abandoned.title,H.oJD),H.xp6(1),H.Udp("color",t.data.styles.colors.text),H.Q6J("innerHTML",H.lcZ(4,15,t.texts.abandoned.description),H.oJD),H.xp6(3),H.hij(" Estado: ",t.getTextStatus()," "),H.xp6(2),H.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"))},dependencies:[u.lW,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Ye=n(1406);function Fe(e,t){1&e&&(H.TgZ(0,"mat-hint",12),H._uU(1," La contraseña es requerida "),H.qZA())}function Ue(e,t){1&e&&(H.TgZ(0,"mat-hint",12),H._uU(1," La contraseña debe tener al menos 8 carácteres "),H.qZA())}const Ze={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let He=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.form=new p.cw({}),this.next=new H.vpe(null)}ngOnInit(){this.setForm()}get f(){return this.form.controls}submit(){this.nextStep()}setForm(){this.form=this.fb.group({password:["",[p.kI.required]]})}nextStep(){let e={password:this.form.get("password").value};this.next.emit(e)}}return e.ɵfac=function(t){return new(t||e)(H.Y36(p.qu),H.Y36(j.F))},e.ɵcmp=H.Xpm({type:e,selectors:[["belender-password-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud"},outputs:{next:"nextStep"},features:[H._Bn([{provide:T.sG,useValue:Ze},{provide:H.soG,useValue:"es-ES"}])],decls:17,vars:20,consts:[[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"my-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],[1,"w-full","mb-3"],["label","Seleccione archivo de certificado (.p12)",1,"w-full"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["formControlName","password","minlength","8","type","password","matInput",""],["class","text-red-500",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"text-red-500"]],template:function(e,t){1&e&&(H.TgZ(0,"form",0)(1,"div",1),H._UZ(2,"div",2)(3,"div",3),H.ALo(4,"safeHtml"),H.qZA(),H.TgZ(5,"div",4)(6,"div",5),H._UZ(7,"app-file-upload",6),H.qZA(),H.TgZ(8,"mat-form-field",7)(9,"mat-label"),H._uU(10,"Contraseña"),H.qZA(),H._UZ(11,"input",8),H.YNc(12,Fe,2,0,"mat-hint",9),H.YNc(13,Ue,2,0,"mat-hint",9),H.qZA()(),H.TgZ(14,"div",10)(15,"button",11),H.NdJ("click",(function(){return t.nextStep()})),H._uU(16," Guardar "),H.qZA()()()),2&e&&(H.Q6J("formGroup",t.form),H.xp6(2),H.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),H.Q6J("innerHTML",t.texts.password.title,H.oJD),H.xp6(1),H.Udp("color",t.data.styles.colors.text),H.Q6J("innerHTML",H.lcZ(4,18,t.texts.password.description),H.oJD),H.xp6(9),H.Q6J("ngIf",t.f.password.touched&&t.f.password.invalid&&t.f.password.errors.required),H.xp6(1),H.Q6J("ngIf",t.f.password.invalid&&t.f.password.errors.minlength),H.xp6(2),H.Udp("color",t.form.invalid?"":t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),H.Q6J("disabled",t.form.invalid))},dependencies:[i.O5,u.lW,P.KE,P.bx,P.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.sg,p.u,Ye.Y,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function je(e,t){if(1&e&&(H.TgZ(0,"div",12),H._UZ(1,"img",13),H.qZA()),2&e){const e=H.oxw(3);H.xp6(1),H.Q6J("src",e.data.styles.logoUrl,H.LSH)}}function ze(e,t){if(1&e&&(H.TgZ(0,"div",9),H.YNc(1,je,2,1,"div",6),H.TgZ(2,"div",10)(3,"p",11)(4,"strong"),H._uU(5,"Uso exclusivo en ordenadores o portátiles"),H.qZA()(),H.TgZ(6,"p",11),H._uU(7," Para garantizar la correcta finalización de este proceso, el acceso está habilitado únicamente desde "),H.TgZ(8,"strong"),H._uU(9,"ordenadores de sobremesa o portátiles."),H.qZA()(),H.TgZ(10,"p",11),H._uU(11," Actualmente, el servicio no es compatible con dispositivos móviles o tablets. Te recomendamos que vuelvas a iniciar el proceso desde un ordenador o portátil. "),H.qZA()()()),2&e){const e=H.oxw(2);H.Udp("color",e.data.styles.colors.text),H.xp6(1),H.Q6J("ngIf",e.data.styles.withLogo)}}function Be(e,t){if(1&e&&(H.TgZ(0,"div",12),H._UZ(1,"img",13),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.Q6J("src",e.data.styles.logoUrl,H.LSH)}}function Je(e,t){if(1&e&&H._UZ(0,"belender-loading-step",22),2&e){const e=H.oxw(3);H.Q6J("status",null==e.solicitud?null:e.solicitud.status_code)("data",e.data)}}function Ve(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"belender-form-step",23),H.NdJ("goToTerms",(function(){H.CHM(e);const t=H.oxw(3);return H.KtG(t.gotoTermsAndConditions())}))("goToTermsCertificate",(function(){H.CHM(e);const t=H.oxw(3);return H.KtG(t.gotoTermsAndConditionsCertificate())}))("nextStep",(function(t){H.CHM(e);const n=H.oxw(3);return H.KtG(n.gotoPassword(t))})),H.qZA()}if(2&e){const e=H.oxw(3);H.Q6J("userId",e.userId)("data",e.data)("flowName",e.flowName)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("labels",e.labels)("solicitud",e.solicitud)}}function Qe(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"belender-password-step",24),H.NdJ("nextStep",(function(t){H.CHM(e);const n=H.oxw(3);return H.KtG(n.sendPassword(t))})),H.qZA()}if(2&e){const e=H.oxw(3);H.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function We(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"belender-otp-step",25),H.NdJ("resendOTP",(function(t){H.CHM(e);const n=H.oxw(3);return H.KtG(n.resendOTP(t))}))("errorPhone",(function(){H.CHM(e);const t=H.oxw(3);return H.KtG(t.setRequestStatus("failed_login_otp"))}))("nextStep",(function(t){H.CHM(e);const n=H.oxw(3);return H.KtG(n.requestOTP(t))})),H.qZA()}if(2&e){const e=H.oxw(3);H.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function Ge(e,t){if(1&e&&H._UZ(0,"belender-success-step",26),2&e){const e=H.oxw(3);H.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function $e(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"belender-fail-step",27),H.NdJ("retry",(function(t){H.CHM(e);const n=H.oxw(3);return H.KtG(n.retryRequest(t))}))("newRequest",(function(t){H.CHM(e);const n=H.oxw(3);return H.KtG(n.newRequest(t))})),H.qZA()}if(2&e){const e=H.oxw(3);H.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function Ke(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"belender-abandoned-step",28),H.NdJ("retry",(function(t){H.CHM(e);const n=H.oxw(3);return H.KtG(n.retryRequest(t))})),H.qZA()}if(2&e){const e=H.oxw(3);H.Q6J("solicitud",e.solicitud)("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function Xe(e,t){if(1&e&&H._UZ(0,"belender-no-service-step",29),2&e){const e=H.oxw(3);H.Q6J("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("data",e.data)}}function et(e,t){if(1&e&&(H.ynx(0),H.YNc(1,Je,1,2,"belender-loading-step",14),H.YNc(2,Ve,1,6,"belender-form-step",15),H.YNc(3,Qe,1,3,"belender-password-step",16),H.YNc(4,We,1,3,"belender-otp-step",17),H.YNc(5,Ge,1,2,"belender-success-step",18),H.YNc(6,$e,1,3,"belender-fail-step",19),H.YNc(7,Ke,1,3,"belender-abandoned-step",20),H.YNc(8,Xe,1,2,"belender-no-service-step",21),H.BQk()),2&e){const e=H.oxw(2);H.xp6(1),H.Q6J("ngIf","loading"==e.requestStatus),H.xp6(1),H.Q6J("ngIf","form"==e.requestStatus&&!e.loading),H.xp6(1),H.Q6J("ngIf","password"==e.requestStatus),H.xp6(1),H.Q6J("ngIf","otp"==e.requestStatus),H.xp6(1),H.Q6J("ngIf","success"==e.requestStatus),H.xp6(1),H.Q6J("ngIf","failed"==e.requestStatus),H.xp6(1),H.Q6J("ngIf","abandoned"==e.requestStatus),H.xp6(1),H.Q6J("ngIf","no-service"==e.requestStatus)}}function tt(e,t){1&e&&H._UZ(0,"belender-disabled-url")}function nt(e,t){if(1&e&&(H.TgZ(0,"div",30),H._UZ(1,"mat-progress-spinner",31),H.TgZ(2,"p",32),H._uU(3),H.qZA()()),2&e){const e=H.oxw(2);H.xp6(1),H.Q6J("value",e.spinnerValue)("mode",e.spinnerMode),H.xp6(2),H.Oqu(e.loading)}}function it(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"div",33)(1,"div",34)(2,"div",35),H._uU(3,"Error!"),H.qZA(),H._UZ(4,"div",36),H.qZA(),H.TgZ(5,"div",37)(6,"button",38),H.NdJ("click",(function(){H.CHM(e);const t=H.oxw(2);return H.KtG(t.error=!1)})),H._uU(7,"Ingresar manualmente"),H.qZA()()()}if(2&e){const e=H.oxw(2);H.xp6(4),H.Udp("color",e.data.styles.colors.text),H.Q6J("innerHTML",e.error,H.oJD)}}function st(e,t){if(1&e&&(H.TgZ(0,"div",3)(1,"div",4),H.YNc(2,ze,12,3,"div",5),H.YNc(3,Be,2,1,"div",6),H.YNc(4,et,9,8,"ng-container",2),H.YNc(5,tt,1,0,"belender-disabled-url",2),H.YNc(6,nt,4,3,"div",7),H.YNc(7,it,8,3,"div",8),H.qZA()()),2&e){const e=H.oxw();H.xp6(1),H.Udp("background",e.data.styles.colors.background),H.xp6(1),H.Q6J("ngIf",e.showMobileAutofirmaError),H.xp6(1),H.Q6J("ngIf",!e.showMobileAutofirmaError&&e.data.styles.withLogo&&"loading"!=e.requestStatus),H.xp6(1),H.Q6J("ngIf",!e.error&&!e.disableURL&&!e.showMobileAutofirmaError),H.xp6(1),H.Q6J("ngIf",!e.error&&e.disableURL&&!e.showMobileAutofirmaError),H.xp6(1),H.Q6J("ngIf",e.loading&&!e.error&&!e.showMobileAutofirmaError),H.xp6(1),H.Q6J("ngIf",!e.loading&&e.error&&!e.showMobileAutofirmaError)}}function rt(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"vex-terms",39),H.NdJ("accepted",(function(){H.CHM(e);const t=H.oxw();return H.KtG(t.handleTermsResponse(!0))}))("cancelled",(function(){H.CHM(e);const t=H.oxw();return H.KtG(t.handleTermsResponse(!1))})),H.qZA()}if(2&e){const e=H.oxw();H.Q6J("flow","presencial")("requestStatus",e.solicitud?e.solicitud.status_code:"")}}function ot(e,t){if(1&e&&(H.ynx(0),H.TgZ(1,"div",40),H._uU(2),H.qZA(),H.BQk()),2&e){const e=H.oxw();H.xp6(2),H.hij("TestMode ",e.testMode?"ON":"OFF","")}}let at=class{constructor(e,t,n,i,s,r,o,a,l,c){this.cd=e,this.Activatedroute=t,this.utils=n,this.solicitudesService=i,this.customizationService=s,this.notis=r,this.webhooksService=o,this.dialog=a,this.translationService=l,this.certificateUtils=c,this.data=null,this.disableActions=!1,this.step="created",this.waitingTime=15,this.loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1,this.disableURL=!1,this.flowName="ClientCertificate",this.showTermsDialog=!1,this.showMobileAutofirmaError=!1,this.currentLang="",this.labels=U.S.es,this.requestStatus=Z.q.FORM,this.intervalToAskBack=null,this.intervalCount=0,this.lastInvalidOtpAlertStatus=null}set solicitud(e){this._solicitudInput=e,e&&this.certificateUtils.setRequest(e)}get solicitud(){return this.certificateUtils.REQUEST||this._solicitudInput}ngOnInit(){const e=this;this.setTranslation(),this.loading="Obteniendo información de la solicitud",this.showMobileAutofirmaError=this.isMobileDevice(),this.certificateUtils.request_status$.subscribe((e=>{"invalid_otp_seguridad_social"===e&&this.lastInvalidOtpAlertStatus!==e&&(this.lastInvalidOtpAlertStatus=e,this.showAlert("Error!","Código inválido. Por favor, introduzca el código recibido por SMS")),this.setStatus()})),this.Activatedroute.params.subscribe((e=>{this.utils.setLoading(!1),e&&e.idUser?(this.userId=e.idUser,this.setInitialData(this.userId)):this.loading=!1,e&&e.packID&&(this.packId=e.packID)}),(e=>{this.loading=!1})),"pro"!=Y.N.env&&(R(document).keydown((function(t){16==t.which&&(this.shiftlIsPressed=!0),17==t.which&&(this.cntrlIsPressed=!0),84==t.which&&this.cntrlIsPressed&&this.shiftlIsPressed&&(e.testMode=!e.testMode,e.cd.markForCheck())})),R(document).keyup((function(e){16==e.which&&(this.shiftlIsPressed=!1),16==e.which&&(this.cntrlIsPressed=!1)})))}ngOnDestroy(){this.stopInterval(),this.certificateUtils.disconnectWebsocket()}isMobileDevice(){const e=navigator.userAgent||"";return/Android|iPhone|iPad|iPod|IEMobile|Opera Mini|Mobile/i.test(e)}sendMessageToParent(e){this.certificateUtils.sendMessageToParent(e)}setInitialData(e){this.customizationService.getCustomization(e).then((e=>{e&&(this.data=e,this.funderConfig=e.config,this.disableURL=e.config.disableUrlWidget,this.financiadorID=e.funder_id||"",this.validateRequestIdInUrl(),this.cd.markForCheck()),this.loading=!1}),(e=>{console.error(e),this.loading=!1}))}setTranslation(){const e=this.currentLang||localStorage.getItem("belender-language")||"es",t=this.translationService.getLabelsTranslated(e);t&&(this.labels=t,this.certificateUtils.labels=t)}validateRequestIdInUrl(){this.Activatedroute.queryParams.subscribe((e=>{e?.lang&&(this.currentLang=e.lang,this.setTranslation()),e&&e.acceptTerms&&(this.autoAcceptTerms=!0),e&&e.request_id?(this.disableURL=!1,this.requestID=e.request_id,this.setFormFromVcCode(e.request_id)):this.loading=!1}),(e=>{this.loading=!1}))}setFormFromVcCode(e){var t=this;return(0,L.Z)((function*(){t.loading="Obteniendo datos de la solicitud...",t.solicitudesService.getSolicitudByCode(e).then((n=>{if(n&&n.data){if(w.t.shouldIgnoreWebhookStatus(n.data.status_code))return t.certificateUtils.setRequest(t.certificateUtils.REQUEST?.status_code?{...n.data,status_code:t.certificateUtils.REQUEST.status_code}:n.data),t.certificateUtils.subscribeWS(e),t.loading="Estamos procesando su solicitud. Espere un momento por favor",t.skipCreationOfRequest=!0,void(t.autoAcceptTerms&&t.gotoPassword());t.certificateUtils.setRequest(n.data),t.certificateUtils.subscribeWS(e),t.setRequestStatus(t.certificateUtils.REQUEST.status_code),t.loading=!1,t.skipCreationOfRequest=!0,t.autoAcceptTerms&&t.gotoPassword()}else t.loading=!1})).catch((e=>{t.loading=!1}))}))()}setSubscriptionOfRequest(){this.certificateUtils.subscribeWS(this.requestID)}handlePusherNotification(e){this.certificateUtils.handlePusherNotification(e),e?.status_code&&"terms_and_conditions"!=e.status_code&&setTimeout((()=>{this.loading=!1,this.cd.markForCheck()}),500)}setSubscriptionOfRequestOld(){!this.financiadorID||!this.userId||!this.requestID||this.subscribed||(this.subscribed=!0,this.webhooksService.bindRequestChanges(this.financiadorID,this.userId,this.requestID),this.webhooksService.subscribeRequestChanges().subscribe((e=>{e&&this.handlePusherNotification(e)}),(e=>{this.loading=!1})))}resendOTP(e){let t={request_id:this.requestID,user_id:this.userId};this.loading="Reenviando OTP...",this.setSubscriptionOfRequest(),this.solicitudesService.resendOTP(t).then((e=>{e&&e.data&&(this.certificateUtils.setRequest(e.data),this.setRequestStatus(this.certificateUtils.REQUEST.status_code)),this.loading=!1})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=!1}))}gotoTerms(e){this.loading=this.labels.loadings.sendingData,e.package_id=this.packId,e.user_id=this.userId,this.testMode?setTimeout((()=>{this.certificateUtils.setRequest(new q.l),this.setRequestStatus("waiting_otp_seguridad_social"),this.loading=!1}),4e3):this.skipCreationOfRequest?(this.gotoPassword(),this.setSubscriptionOfRequest()):this.solicitudesService.addSolicitud(e).then((t=>{t&&t.status&&"error"==t.status?(this.certificateUtils.setRequest({...e,status_code:"form"}),t.message&&(400==t.code?"Birthdate incorrect"==t.message?(this.setRequestStatus("form"),this.showAlert("Error!","Fecha de nacimiento incorrecta")):(this.setRequestStatus("no_service"),this.loading=!1):(this.setRequestStatus("form"),this.showAlert("Error!",t.message)))):t&&t.status&&"success"==t.status?(this.requestID=t.data.request_id,this.certificateUtils.setRequest(t.data),this.sendMessageToParent(t.data),this.gotoPassword()):this.showAlert("Error!","Error desconocido: "+t)})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=!1}))}sendNewData(e){this.loading="Enviando información..",this.solicitudesService.fixData(this.requestID,e).then((e=>{e.status&&"error"==e.status?e.message&&(this.showAlert("Error!",e),this.loading=!1):e&&"success"==e.status&&(this.sendMessageToParent(e.data||e),this.initWaitingForResponse("Validando nuevos datos, espere por favor.."),this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=!1}))}showAlert(e,t){this.loading=!1,this.notis.showAlert(e,t)}gotoPassword(e){this.initWaitingForResponse("Iniciando el proceso de emisión de certificado.."),setTimeout((()=>{this.certificateUtils.setRequest(new q.l),this.setRequestStatus("waiting_password"),this.loading=!1}),2e3)}requestOTP(e){this.loading="Enviando información..",setTimeout((()=>{this.certificateUtils.setRequest(new q.l),this.setRequestStatus("waiting_password"),this.loading=!1}),2e3)}sendPassword(e){this.loading="Enviando información..",setTimeout((()=>{this.setRequestStatus("all_documents_downloaded"),this.loading=!1}),2e3)}initWaitingForResponse(e){this.loading=e||"Validando información, espere por favor..",setTimeout((()=>{this.loading&&this.askToBack()}),1e4)}askToBack(){this.askDetailToBack(this.requestID)}askDetailToBack(e){const t=this.certificateUtils.REQUEST?.status_code,n=e||this.requestID||this.certificateUtils.REQUEST?.request_id;n&&"consent_process_completed"!==t?this.solicitudesService.getSolicitudByCode(n).then((e=>{if(e&&e.data){if(w.t.shouldIgnoreWebhookStatus(e.data.status_code))return;t!=e.data.status_code&&(this.certificateUtils.setRequest(e.data),this.setRequestStatus(this.certificateUtils.REQUEST.status_code)),this.loading=!1}else this.loading=!1})).catch((e=>{this.loading=!1})):this.stopInterval()}initIntervalToAskBack(){!this.certificateUtils.REQUEST?.request_id&&!this.requestID||this.intervalToAskBack||(this.intervalToAskBack=setInterval((()=>{this.askDetailToBack(),this.intervalCount++,this.intervalCount>20&&this.stopInterval()}),5e3))}stopInterval(){this.intervalToAskBack&&clearInterval(this.intervalToAskBack),this.intervalToAskBack=null,this.intervalCount=0}gotoErrorPhone(){}setRequestStatus(e){this.certificateUtils.REQUEST||this.certificateUtils.setRequest(new q.l),this.certificateUtils.setRequestStatus(e),this.setStatus()}setStatus(){if(!this.certificateUtils.REQUEST)return;const e=Z.S[this.certificateUtils.REQUEST.status_code];if(e){if(e===Z.q.SUCCESS&&this.funderConfig?.infiniteLoopInCompleted)return this.requestStatus=Z.q.LOADING,this.loading=" ",void this.cd.markForCheck();if(e===Z.q.LOADING)return this.requestStatus=Z.q.LOADING,this.loading=this.labels.loadings?.validatingData||"Estamos procesando su solicitud. Espere un momento por favor",void this.cd.markForCheck();if(e===Z.q.ERROR_DATA)return this.requestStatus=Z.q.ERROR_DATA,this.loading=null,this.stopInterval(),void this.cd.markForCheck();this.requestStatus=e,this.loading=null,this.stopInterval()}else this.requestStatus=Z.q.LOADING,this.loading=this.labels.loadings?.validatingData||"Estamos procesando su solicitud. Espere un momento por favor",this.initIntervalToAskBack();this.cd.markForCheck()}retryRequest(e){let t={request_id:e,user_id:this.userId};this.loading="Reintentando enviar la solicitud...",this.setSubscriptionOfRequest(),this.solicitudesService.retryRequest(t).then((e=>{e&&e.data&&(this.certificateUtils.setRequest(e.data),this.setRequestStatus(this.certificateUtils.REQUEST.status_code)),this.loading=!1})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=!1}))}newRequest(e){this.setRequestStatus("created")}getStatus(){return this.requestStatus}sendRetry(){}gotoTermsAndConditions(){this.showTermsDialog=!0}handleTermsResponse(e){this.showTermsDialog=!1}gotoTermsAndConditionsCertificate(){this.dialog.open(F.v,{panelClass:"fullscreen-dialog",data:{flow:"presencial"}})}};at.ɵfac=function(e){return new(e||at)(H.Y36(H.sBO),H.Y36(A.gz),H.Y36(j.F),H.Y36(_.M),H.Y36(S.w),H.Y36(k.T),H.Y36(w.t),H.Y36(z.uw),H.Y36(B.D),H.Y36(J.J))},at.ɵcmp=H.Xpm({type:at,selectors:[["belender-widget-client-cert"]],inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud"},features:[H._Bn([{provide:P.o2,useValue:{appearance:"standard"}}])],decls:3,vars:3,consts:[["class","h-full widget-belender",4,"ngIf"],[3,"flow","requestStatus","accepted","cancelled",4,"ngIf"],[4,"ngIf"],[1,"h-full","widget-belender"],[1,"h-full","w-full","flex-auto","p-0","md:p-3"],["class","px-6 py-8 flex flex-col gap-4",3,"color",4,"ngIf"],["class","img-wrapper p-6 flex justify-center items-center",4,"ngIf"],["class","loading-wrapper animated fadeIn",4,"ngIf"],["class","animated fadeInRight",4,"ngIf"],[1,"px-6","py-8","flex","flex-col","gap-4"],[1,"subheading-1","flex","flex-col","gap-3"],[1,"m-0"],[1,"img-wrapper","p-6","flex","justify-center","items-center"],["alt","",1,"img-card",3,"src"],[3,"status","data",4,"ngIf"],[3,"userId","data","flowName","texts","labels","solicitud","goToTerms","goToTermsCertificate","nextStep",4,"ngIf"],[3,"data","texts","solicitud","nextStep",4,"ngIf"],[3,"data","texts","solicitud","resendOTP","errorPhone","nextStep",4,"ngIf"],[3,"data","texts",4,"ngIf"],[3,"data","texts","solicitud","retry","newRequest",4,"ngIf"],[3,"solicitud","data","texts","retry",4,"ngIf"],[3,"texts","data",4,"ngIf"],[3,"status","data"],[3,"userId","data","flowName","texts","labels","solicitud","goToTerms","goToTermsCertificate","nextStep"],[3,"data","texts","solicitud","nextStep"],[3,"data","texts","solicitud","resendOTP","errorPhone","nextStep"],[3,"data","texts"],[3,"data","texts","solicitud","retry","newRequest"],[3,"solicitud","data","texts","retry"],[3,"texts","data"],[1,"loading-wrapper","animated","fadeIn"],["color","accent","diameter","40",1,"spinner",3,"value","mode"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[1,"animated","fadeInRight"],[1,"px-6","py-4","flex","flex-col"],[1,"text-red-500","title","m-0"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"text-blue-500","bg-blue-50","px-8",3,"click"],[3,"flow","requestStatus","accepted","cancelled"],[1,"test-mode","px-10","py-2","bg-blue-500/10","text-blue-500","border-blue-500","border","rounded-md"]],template:function(e,t){1&e&&(H.YNc(0,st,8,8,"div",0),H.YNc(1,rt,1,2,"vex-terms",1),H.YNc(2,ot,3,1,"ng-container",2)),2&e&&(H.Q6J("ngIf",t.data),H.xp6(1),H.Q6J("ngIf",t.showTermsDialog),H.xp6(1),H.Q6J("ngIf",t.testMode))},dependencies:[i.O5,u.lW,y.Ou,V.q,Q.L,se,oe,ce,De,Ne,qe,Re,He],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative}.widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"]}),at=(0,D.gn)([(0,N.c)()],at);const lt=[{path:":idUser",component:at},{path:":idUser/:packID",component:at}];let ct=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=H.oAB({type:e}),e.ɵinj=H.cJS({imports:[A.Bz.forChild(lt),A.Bz,O.d8]}),e})();var dt=n(6981),ut=n(1129),ht=n(969),pt=n(3300),mt=n(865),ft=n(3295);let gt=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=H.oAB({type:e}),e.ɵinj=H.cJS({providers:[_.M,v.o,S.w,w.t,k.T,E.t,J.J,{provide:T.Ad,useValue:"es-ES"}],imports:[ct,i.ez,s.G,r.J,o.TU,a.p0,l.JX,c.p9,d.Ps,u.ot,h.Tx,x.c,p.u5,m.AV,p.UX,f.LD,g.vV,b.a,y.Cq,C.FA,T.XK,M.T5,I.Fk,dt.x,ue.Nh,c.p9,ut.n,ht.O,pt.C,mt.q,ft.g]}),e})()}}]),(self.webpackChunkvex=self.webpackChunkvex||[]).push([[298],{667:(e,t,n)=>{n.d(t,{$:()=>s});var i=n(7340);const s=(r=400,(0,i.X$)("fadeInUp",[(0,i.eR)(":enter",[(0,i.oB)({transform:"translateY(20px)",opacity:0}),(0,i.jt)(`${r}ms cubic-bezier(0.35, 0, 0.25, 1)`,(0,i.oB)({transform:"translateY(0)",opacity:1}))])]));var r},5592:(e,t,n)=>{n.d(t,{J:()=>a});var i=n(6895),s=n(8594),r=n(7392),o=n(4650);let a=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=o.oAB({type:e}),e.ɵinj=o.cJS({imports:[i.ez,s.Bz,r.Ps]}),e})()},1763:(e,t,n)=>{n.d(t,{b:()=>c});var i=n(4650),s=n(6895),r=n(7392);function o(e,t){1&e&&i._UZ(0,"mat-icon",3)}const a=function(e,t){return{background:e,"border-color":t}},l=["*"];let c=(()=>{class e{constructor(){this.text="",this.color="rgb(14, 197, 151)",this.changeCheckbox=new i.vpe,this.checked=!1}emitChange(){this.checked=!this.checked,this.changeCheckbox.emit(this.checked)}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-checkbox"]],inputs:{text:"text",color:"color",checked:"checked"},outputs:{changeCheckbox:"changeCheckbox"},ngContentSelectors:l,decls:5,vars:5,consts:[[1,"flex","items-start","gap-2","justify-start","w-fit","hover:bg-slate-700/10","py-2","rounded-sm","cursor-pointer",3,"click"],[1,"check-wrapper","w-5","h-5","border","mr-1","rounded-sm","flex","justify-center","items-center","p-0",3,"ngStyle"],["style","font-size: 5px","class","m-0 p-0 text-white","svgIcon","mat:check",4,"ngIf"],["svgIcon","mat:check",1,"m-0","p-0","text-white",2,"font-size","5px"]],template:function(e,t){1&e&&(i.F$t(),i.TgZ(0,"div",0),i.NdJ("click",(function(){return t.emitChange()})),i.TgZ(1,"div",1),i.YNc(2,o,1,0,"mat-icon",2),i.qZA(),i.TgZ(3,"div"),i.Hsn(4),i.qZA()()),2&e&&(i.xp6(1),i.Q6J("ngStyle",i.WLB(2,a,t.checked?t.color:"transparent",t.checked?t.color:"rgba(0,0,0,.7)")),i.xp6(1),i.Q6J("ngIf",t.checked))},dependencies:[s.O5,s.PC,r.Hw],styles:[".check-wrapper[_ngcontent-%COMP%]{transition:all .3s ease;min-width:1.25rem}"]}),e})()},1129:(e,t,n)=>{n.d(t,{n:()=>c});var i=n(6895),s=n(4006),r=n(9549),o=n(9101),a=n(7392),l=n(4650);let c=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=l.oAB({type:e}),e.ɵinj=l.cJS({imports:[i.ez,s.u5,s.UX,r.lN,o.ot,a.Ps]}),e})()},8008:(e,t,n)=>{n.d(t,{O:()=>o});var i=n(4650),s=n(6895);function r(e,t){if(1&e&&(i.O4$(),i.kcU(),i.TgZ(0,"p",4),i._uU(1),i.qZA()),2&e){const e=i.oxw();i.xp6(1),i.Oqu(e.text)}}let o=(()=>{class e{constructor(){this.text="",this.color="rgb(14, 197, 151)",this.zoom=1}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-spinner"]],inputs:{text:"text",color:"color",zoom:"zoom"},decls:4,vars:7,consts:[[1,"flex","w-full","justify-center","items-center","flex-col","gap-4"],["width","65px","height","65px","viewBox","0 0 66 66","xmlns","http://www.w3.org/2000/svg",1,"spinner"],["fill","none","stroke-width","6","stroke-linecap","round","cx","33","cy","33","r","30",1,"path"],["class","text-center",4,"ngIf"],[1,"text-center"]],template:function(e,t){1&e&&(i.TgZ(0,"div",0),i.O4$(),i.TgZ(1,"svg",1),i._UZ(2,"circle",2),i.qZA(),i.YNc(3,r,2,1,"p",3),i.qZA()),2&e&&(i.xp6(1),i.Jzz("zoom: ",t.zoom,"; "),i.xp6(1),i.Jzz("stroke: ",t.color,""),i.xp6(1),i.Q6J("ngIf",t.text))},dependencies:[s.O5],styles:[".spinner[_ngcontent-%COMP%]{animation:rotator 1.4s linear infinite}@keyframes rotator{0%{transform:rotate(0)}to{transform:rotate(270deg)}}.path[_ngcontent-%COMP%]{stroke-dasharray:187;stroke-dashoffset:0;transform-origin:center;animation:dash 1.4s ease-in-out infinite}@keyframes dash{0%{stroke-dashoffset:187}50%{stroke-dashoffset:46.75;transform:rotate(135deg)}to{stroke-dashoffset:187;transform:rotate(450deg)}}"]}),e})()},9476:(e,t,n)=>{n.d(t,{F:()=>c});var i=n(6895),s=n(4006),r=n(9549),o=n(9101),a=n(7392),l=n(4650);let c=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=l.oAB({type:e}),e.ɵinj=l.cJS({imports:[i.ez,s.u5,s.UX,r.lN,o.ot,a.Ps]}),e})()},833:(e,t,n)=>{n.d(t,{L:()=>d});var i=n(4650),s=n(8594),r=n(7367),o=n(8460),a=n(6895),l=n(9101);function c(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"div",5)(1,"button",6),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw();return i.KtG(t.accept())})),i._uU(2,"Cerrar"),i.qZA()()}if(2&e){const e=i.oxw();i.xp6(1),i.Udp("color",e.funderStyles.colors.btnText)("background",e.funderStyles.colors.btnBg)("border-radius",e.funderStyles.btnRound+"px")}}let d=(()=>{class e{constructor(e,t,n){this.Activatedroute=e,this.customizationService=t,this.customizationStoreService=n,this.loading=!0,this.hideButtons=!0,this.acceptTerms=new i.vpe(null),this.cancelTerms=new i.vpe(null)}ngOnInit(){this.loading=!0,this.userId&&this.flow?(this.userID=this.userId,this.flowName=this.flow,this.customizationStoreService.getFunderStyles().subscribe((e=>{this.funderStyles=e})),this.customizationService.getCustomizationByFlow(this.userID,this.flowName,this.customizationStoreService.LANG).then((e=>{this.flowConfig=e,this.terms_and_conditions=this.flowConfig&&this.flowConfig.terms_and_conditions?this.flowConfig.terms_and_conditions:`\n <div class="px-10 py-6 rounded-md text-center bg-orange-500/20 text-orange-600">\n <p>No hay términos y condiciones para el flujo <b>${this.flowName}</b></p> \n </div>`,this.loading=!1})).catch((e=>{this.loading=!1}))):this.Activatedroute.params.subscribe((e=>{e&&e.idUser?(this.userID=e.idUser,this.flowName=this.getParsedFlowName(e.flow),this.userID?this.customizationService.getCustomizationByFlow(this.userID,this.flowName,this.customizationStoreService.LANG).then((e=>{this.flowConfig=e,this.terms_and_conditions=this.flowConfig&&this.flowConfig.terms_and_conditions?this.flowConfig.terms_and_conditions:'\n <div class="px-10 py-6 rounded-md text-center bg-orange-500/20 text-orange-600">\n <p>No hay términos y condiciones para este flujo</p> \n </div>',this.loading=!1})).catch((e=>{this.loading=!1})):this.loading=!1):this.loading=!1}),(e=>{this.loading=!1}))}getParsedFlowName(e){switch(e){case"sms":case"Sms":return"SMS";case"clavepin":case"ClavePin":case"CLAVEPIN":return"ClavePin";case"videoid":return"VideoID";case"personal":case"presencial":case"client-cert":return"KnownClient";default:return e}}accept(){this.acceptTerms.emit(!0)}cancel(){this.cancelTerms.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(i.Y36(s.gz),i.Y36(r.w),i.Y36(o.r))},e.ɵcmp=i.Xpm({type:e,selectors:[["vex-power-cert"]],inputs:{flow:"flow",userId:"userId",hideButtons:"hideButtons"},outputs:{acceptTerms:"accept",cancelTerms:"cancel"},decls:33,vars:1,consts:[[1,"py-12","flex","flex-col","items-center","overflow-auto","max-h-[96vh]","terms-page"],[1,"max-w-xl","overflow-y-auto"],[1,"font-bold"],[1,"pt-6","font-bold"],["class","w-full max-w-xl flex items-center justify-end gap-2 p-4",4,"ngIf"],[1,"w-full","max-w-xl","flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8",3,"click"]],template:function(e,t){1&e&&(i.TgZ(0,"div",0)(1,"div",1)(2,"h1",2),i._uU(3,"HOJA DE ACEPTACIÓN DE CERTIFICADO ELECTRONICO CUALIFICADO RÉGIMEN OBLIGATORIO DE USO DEL CERTIFICADO ELECTRONICO: “CERTIFICADO DE PERSONA FÍSICA REPRESENTANTE DE EMPRESA EMITIDO EN SOFTWARE”"),i.qZA(),i.TgZ(4,"p"),i._uU(5," a) Que existen unas condiciones generales del servicio incorporadas en el texto de divulgación del certificado o PDS, y una declaración de prácticas de certificación, que regulan la emisión y utilización del certificado electrónico emitido porvinCAsign, cuyo texto íntegro se puede consultar en la dirección de Internet, https://policy.vincasign.net. "),i.qZA(),i.TgZ(6,"p"),i._uU(7," b) Que el certificado electrónico emitido y el resto de los elementos que forman parte de la identificación electrónica son únicos para cada usuario. El certificado debe ser protegido por un código secreto (PIN), que sólo conoce el titular y que le será entregado en el momento de la emisión del certificado. Para utilizar el certificado es imprescindible conocer este código. "),i.qZA(),i.TgZ(8,"p"),i._uU(9," c) Que este certificado permite al titular del certificado generar firmas electrónicas e identificarse de forma electrónica en aquellos sistemas de información que soporten este tipo de autenticación. "),i.qZA(),i.TgZ(10,"p"),i._uU(11," d) Que el FIRMANTE debe custodiar, de forma diligente, el PIN que permite utilizarlo, para evitar que otras personas puedan suplantar su identidad y firmar documentos en su nombre, o acceder a mensajes confidenciales o sistemas de información de acceso restringido. "),i.qZA(),i.TgZ(12,"p"),i._uU(13," e) Que, si el FIRMANTE detecta cualquier indicio de que su identificación electrónica ha podido ser utilizada por otras personas, tendrá que suspender el uso del certificado y notificarlo inmediatamente al responsable del servicio de certificación del SUSCRIPTOR, o a vinCAsign, para pedir la revocación del certificado y, en su caso, la emisión de uno nuevo. "),i.qZA(),i.TgZ(14,"p"),i._uU(15," f) Que ante cualquier necesidad de información adicional, respecto de la utilización de los certificados emitidos en nombre de vinCAsign, el FIRMANTE se podrá dirigir al SUSCRIPTOR, al responsable del servicio de certificación del SUSCRIPTOR, y/o a VINTEGRIS. "),i.qZA(),i.TgZ(16,"p"),i._uU(17," g) Que con el fin de obtener los correspondientes certificados, y dentro del marco del Reglamento (UE) 2016/679 del Parlamento Europeo y del Consejo de 27 de abril de 2016 relativo a la protección de las personas físicas en lo que respecta al tratamiento de datos personales y a la libre circulación de estos datos y por el que se deroga la Directiva 95/46/CE (Reglamento general de protección de datos), el SUSCRIPTOR ha comunicado a vinCAsign los datos identificativos del FIRMANTE con el fin de emitir y gestionar el certificado corporativo de persona física emitido en software, en el ámbito de la relación de trabajo entre dicho FIRMANTE y el SUSCRIPTOR, todo ello a los efectos de lo previsto en el artículo 28 del Reglamento general de protección de datos. "),i.qZA(),i.TgZ(18,"p"),i._uU(19," h) Que sabe que, en cumplimiento de lo establecido en los artículos 24.2 y 28 del Reglamento (UE) 910/2014 del Parlamento Europeo y del Consejo de 23 de julio de 2014, los datos contenidos en el certificado corporativo de persona física emitido en software están publicados en la página web de vinCAsign a efectos del Registro de Certificados y de las listas de revocación, toda vez que ha prestado su consentimiento durante el proceso de solicitud. "),i.qZA(),i.TgZ(20,"h1",3),i._uU(21," ACTO DE ACEPTACIÓN DEL CERTIFICADO ELECTRÓNICO "),i.qZA(),i.TgZ(22,"p"),i._uU(23," Firmo el presente documento para dejar constancia: "),i.qZA(),i.TgZ(24,"p"),i._uU(25," Que ha sido informado del contenido del texto de divulgación del certificado o PDS, en el que se incluyen las condiciones generales del servicio aplicable al certificado corporativo de persona física emitido en software. "),i.qZA(),i.TgZ(26,"p"),i._uU(27," Que ha sido informado del régimen obligatorio de uso del certificado emitido, sus condiciones de uso y sus responsabilidades. "),i.qZA(),i.TgZ(28,"p"),i._uU(29," Que ha sido informado de las circunstancias relativas al tratamiento de sus datos personales para la correcta emisión y gestión del certificado que se emite. "),i.qZA(),i.TgZ(30,"p"),i._uU(31," Firma de conformidad, en virtud de la cual ha leído y entiende las obligaciones y responsabilidades que asume. "),i.qZA()(),i.YNc(32,c,3,6,"div",4),i.qZA()),2&e&&(i.xp6(32),i.Q6J("ngIf",t.funderStyles&&!t.hideButtons))},dependencies:[a.O5,l.lW],styles:["h1[_ngcontent-%COMP%]{font-size:20px!important;font-weight:700}h2[_ngcontent-%COMP%]{font-size:20px!important;font-weight:700;line-height:25px;margin:15px 0}p[_ngcontent-%COMP%]{margin:10px 0}.terms-page[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100vw;background:white;z-index:9999999!important;height:100vh;max-height:100vh}"]}),e})()},2266:(e,t,n)=>{n.d(t,{L:()=>g});var i=n(8594),s=n(833),r=n(6e3),o=n(4650);const a=[{path:":flow",component:s.L},{path:":flow/:idUser",component:s.L}];let l=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=o.oAB({type:e}),e.ɵinj=o.cJS({imports:[i.Bz.forChild(a),i.Bz,r.d8]}),e})();var c=n(7533),d=n(1572),u=n(7367),h=n(6383),p=n(6895),m=n(4006),f=n(9101);let g=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=o.oAB({type:e}),e.ɵinj=o.cJS({providers:[u.w],imports:[l,c.q,d.Cq,h.G,p.ez,m.u5,f.ot]}),e})()},1145:(e,t,n)=>{n.d(t,{j:()=>l});var i=n(4650),s=n(6895);let r=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=i.oAB({type:e}),e.ɵinj=i.cJS({imports:[[s.ez]]}),e})();var o=n(7392),a=n(4006);let l=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=i.oAB({type:e}),e.ɵinj=i.cJS({imports:[s.ez,a.u5,r,o.Ps]}),e})()},4302:(e,t,n)=>{n.d(t,{q:()=>a});var i=n(7582),s=n(9933),r=n(667),o=n(4650);let a=class{constructor(){}};a.ɵfac=function(e){return new(e||a)},a.ɵcmp=o.Xpm({type:a,selectors:[["belender-disabled-url"]],decls:6,vars:1,consts:[[1,"p-2","w-full","flex","justify-start","flex-wrap"],[1,"py-4","px-6","w-full","rounded-md","bg-red-500/10","text-red-600","flex","flex-col","gap-3"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0)(1,"div",1)(2,"h2"),o._uU(3,"Servicio desactivado"),o.qZA(),o.TgZ(4,"p"),o._uU(5,"El servicio que intenta acceder está desactivado. "),o.qZA()()()),2&e&&o.Q6J("@fadeInUp",void 0)},data:{animation:[r.$]}}),a=(0,i.gn)([(0,s.c)()],a)},3300:(e,t,n)=>{n.d(t,{C:()=>o});var i=n(6895),s=n(4006),r=n(4650);let o=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=r.oAB({type:e}),e.ɵinj=r.cJS({imports:[i.ez,s.u5]}),e})()},342:(e,t,n)=>{n.d(t,{A:()=>y});var i=n(7582),s=n(9933),r=n(2340),o=n(8730),a=n(4650),l=n(4006),c=n(8467),d=n(5601),u=n(9617),h=n(8460),p=n(6895),m=n(7392),f=n(1572);function g(e,t){if(1&e&&(a.TgZ(0,"span",11),a._uU(1),a._UZ(2,"mat-progress-spinner",12),a.qZA()),2&e){const e=a.oxw().$implicit;a.xp6(1),a.hij(" ",e.document_name," ")}}function _(e,t){if(1&e&&(a.TgZ(0,"span",13),a._uU(1),a._UZ(2,"mat-icon",14),a.qZA()),2&e){const e=a.oxw().$implicit;a.xp6(1),a.hij(" ",e.document_name," ")}}function b(e,t){if(1&e){const e=a.EpF();a.TgZ(0,"span",15),a.NdJ("click",(function(){a.CHM(e);const t=a.oxw().$implicit,n=a.MAs(5);return a.oxw().setDocumentName(t.document_name),a.KtG(n.click())})),a._uU(1),a._UZ(2,"mat-icon",16),a.qZA()}if(2&e){const e=a.oxw().$implicit;a.xp6(1),a.hij(" ",e.document_name," ")}}function v(e,t){if(1&e){const e=a.EpF();a.ynx(0),a.YNc(1,g,3,1,"span",6),a.YNc(2,_,3,1,"span",7),a.YNc(3,b,3,1,"span",8),a.TgZ(4,"input",9,10),a.NdJ("change",(function(t){a.CHM(e);const n=a.oxw();return a.KtG(n.fileChange(t))})),a.qZA(),a.BQk()}if(2&e){const e=t.$implicit,n=a.oxw();a.xp6(1),a.Q6J("ngIf",!e.document_status_code),a.xp6(1),a.Q6J("ngIf",e.document_status_code&&"downloaded"===e.document_status_code&&!n.loadingDocs),a.xp6(1),a.Q6J("ngIf",e.document_status_code&&"failed_download"===e.document_status_code&&!n.loadingDocs),a.xp6(1),a.Q6J("accept",n.acceptFiles)}}let y=class{constructor(e,t,n,i,s,r){this.formBuilder=e,this.utils=t,this.solicitudesService=n,this.packsS=i,this.cd=s,this.customizationStoreService=r,this.totalDocuments=[],this.totalDownloaded=0,this.totalNotDownloaded=0,this.file=null,this.fileSize=0,this.acceptFiles="image/jpeg, image/jpg, application/pdf",this.loadingDocs=!0,this.toBase64=e=>new Promise(((t,n)=>{const i=new FileReader;i.readAsDataURL(e),i.onload=()=>t(i.result),i.onerror=n}))}ngOnInit(){this.setLabels(),this.customizationStoreService.lang$.pipe((0,s.t)(this)).subscribe((()=>this.setLabels())),this.loadingDocs=!0,this.uploadForm=this.formBuilder.group({file:[""]}),this.setPacksAndDocuments(),this.initIntervalDocs()}ngOnChanges(e){e.lang&&this.setLabels()}setLabels(){const e=(0,o.S)(this.lang,this.customizationStoreService.LANG);this.file||(this.fileName=e.noFileSelected)}initIntervalDocs(){this.intDocs=setInterval((()=>{this.setDocumentsFromPack()}),4e3)}setPacksAndDocuments(){this.packsS.getPacksByPackId(this.packId).then((e=>{this.totalDocuments=this.parseDocumentsFromPack(e.data.documents),this.setDocumentsFromPack()}))}setDocumentsFromPack(){this.solicitudesService.getDocumentsIds(this.requestID).then((e=>{e.data&&this.setDocumentsReports(e.data),this.loadingDocs=!1})).catch((()=>{this.loadingDocs=!1}))}setSubscriptionOfRequest(){if(this.socket)return;let e="wss://notifications.dev.belender.net";"qa"==r.N.env&&(e="wss://notifications.qa.belender.net"),"pro"==r.N.env&&(e="wss://notifications.belender.net"),r.N.notificationsBaseUrl&&(e=r.N.notificationsBaseUrl),this.socket=new WebSocket(`${e}?requests_id=${this.requestID}&user_id=${this.userId}`);var t=this;this.socket.onopen=function(e){console.log("Conexión establecida")},this.socket.onmessage=function(e){let n=JSON.parse(e.data);console.warn(n),n&&t.handlePusherNotification(n)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e),console.error(e)},this.socket.onclose=function(e){console.log("Conexión cerrada")}}handlePusherNotification(e){this.totalDocuments&&this.totalDocuments.forEach((t=>{t.document_name===e.document_name&&(t.document_status_code=e.document_status_code)})),this.cd.markForCheck()}parseDocumentsFromPack(e){let t=[];return e&&e.length&&e.forEach((e=>{t.push({document_name:e,document_status_code:null})})),t}setDocumentsReports(e){e&&e.length&&e.forEach((e=>{this.totalDocuments.forEach((t=>{t.document_name===e.document_name&&(t.document_status_code=e.document_status_code)}))})),this.checkIfAllReported(),this.cd.markForCheck()}checkIfAllReported(){this.totalDocuments.find((e=>!e.document_status_code||"downloaded"!=e.document_status_code))||this.intDocs&&clearInterval(this.intDocs)}fileChange(e){e.preventDefault(),e.stopPropagation();let t=e.target.files[0];this.file=t,this.fileName=t.name;const n=new FormData;n.append("file",t),n.append("request_id",this.requestID),n.append("document_name",this.docName),this.loadingDocs=!0,this.solicitudesService.uploadFileFromWidget(n).then((e=>{console.log("success"),this.setPacksAndDocuments()})).catch((e=>{console.error(e),this.setPacksAndDocuments()}))}setDocumentName(e){this.docName=e}};y.ɵfac=function(e){return new(e||y)(a.Y36(l.qu),a.Y36(c.F),a.Y36(d.M),a.Y36(u.U),a.Y36(a.sBO),a.Y36(h.r))},y.ɵcmp=a.Xpm({type:y,selectors:[["widget-documents"]],inputs:{packId:"packId",requestID:"requestID",userId:"userId",lang:"lang",acceptFiles:"acceptFiles"},features:[a.TTD],decls:7,vars:1,consts:[[1,"px-4","py-3","bg-slate-300/10","rounded-md"],[1,"w-full","flex","mb-4","justify-between","items-center"],[1,"text-xl","font-bold"],[1,"flex","justify-end","items-center"],[1,"flex","gap-1","flex-wrap","items-start","justify-start","w-full","flex-col"],[4,"ngFor","ngForOf"],["class","bg-black/10 items-center w-full h-8 gap-2 pr-4 pl-3 py-1 rounded-sm flex text-xs justify-between",4,"ngIf"],["class","bg-green-500/10 items-center text-green-500 w-full justify-between border border-green-500 gap-2 h-8 font-bold pr-4 pl-3 py-1 rounded-sm flex text-xs ",4,"ngIf"],["class","bg-red-500/10 items-center text-red-500 border border-red-500 gap-2 h-8 font-bold pr-4 pl-3 py-1 rounded-sm flex text-xs justify-between w-full cursor-pointer hover:bg-red-500 hover:text-red-50",3,"click",4,"ngIf"],["hidden","true","onclick","this.value=null","type","file","name","file",3,"accept","change"],["fileInput",""],[1,"bg-black/10","items-center","w-full","h-8","gap-2","pr-4","pl-3","py-1","rounded-sm","flex","text-xs","justify-between"],["color","accent","diameter","12","value","0","mode","indeterminate",1,"spinner"],[1,"bg-green-500/10","items-center","text-green-500","w-full","justify-between","border","border-green-500","gap-2","h-8","font-bold","pr-4","pl-3","py-1","rounded-sm","flex","text-xs"],["svgIcon","mat:check",1,"w-4"],[1,"bg-red-500/10","items-center","text-red-500","border","border-red-500","gap-2","h-8","font-bold","pr-4","pl-3","py-1","rounded-sm","flex","text-xs","justify-between","w-full","cursor-pointer","hover:bg-red-500","hover:text-red-50",3,"click"],["svgIcon","mat:upload",1,"w-4"]],template:function(e,t){1&e&&(a.TgZ(0,"div",0)(1,"div",1)(2,"p",2),a._uU(3,"Documentos: "),a.qZA(),a._UZ(4,"div",3),a.qZA(),a.TgZ(5,"div",4),a.YNc(6,v,6,4,"ng-container",5),a.qZA()()),2&e&&(a.xp6(6),a.Q6J("ngForOf",t.totalDocuments))},dependencies:[p.sg,p.O5,m.Hw,f.Ou]}),y=(0,i.gn)([(0,s.c)()],y)},3033:(e,t,n)=>{n.d(t,{d:()=>l});var i=n(6895),s=n(4006),r=n(7392),o=n(1572),a=n(4650);let l=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=a.oAB({type:e}),e.ɵinj=a.cJS({imports:[i.ez,r.Ps,s.UX,o.Cq]}),e})()},1406:(e,t,n)=>{n.d(t,{Y:()=>u});var i=n(7582),s=n(4650),r=n(9933),o=n(8730),a=n(4006),l=n(8460),c=n(9549),d=n(9101);let u=class{constructor(e,t){this.formBuilder=e,this.customizationStoreService=t,this.file=null,this.acceptFiles="image/png, image/jpeg, image/jpg, .pdf",this.newItemEvent=new s.vpe(null),this.uploadFile=new s.vpe(null),this.toBase64=e=>new Promise(((t,n)=>{const i=new FileReader;i.readAsDataURL(e),i.onload=()=>t(i.result),i.onerror=n}))}ngOnInit(){this.setLabels(),this.customizationStoreService.lang$.pipe((0,r.t)(this)).subscribe((()=>this.setLabels())),this.uploadForm=this.formBuilder.group({file:[""]})}ngOnChanges(e){e.lang&&this.setLabels()}setLabels(){const e=(0,o.S)(this.lang,this.customizationStoreService.LANG);this.selectFileLabel=e.selectFile,this.file||(this.fileName=e.noFileSelected)}fileChange(e){const t=e.target.files[0];this.file=t,this.uploadForm.patchValue({file:t}),this.uploadForm.get("file").updateValueAndValidity();const n=new FormData;let i=this.uploadForm.get("file").value;this.fileName=i.name,this.fileSize=+(+i.size/1e3).toFixed(1),n.append("file",i),this.newItemEvent.emit({file:n}),this.uploadFile.emit(i)}};u.ɵfac=function(e){return new(e||u)(s.Y36(a.qu),s.Y36(l.r))},u.ɵcmp=s.Xpm({type:u,selectors:[["app-file-upload"]],inputs:{label:"label",lang:"lang",acceptFiles:"acceptFiles"},outputs:{newItemEvent:"change",uploadFile:"fileUpload"},features:[s.TTD],decls:11,vars:6,consts:[[1,"flex","flex-col","w-full","items-start","input-file-wrapper","my-1",3,"formGroup"],["hidden","true","onclick","this.value=null","type","file","name","file",3,"accept","change"],["fileInput",""],[1,"flex","items-center","justify-start","mt-3"],["mat-flat-button","","color","accent",1,"btn-file",3,"click"]],template:function(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"form",0)(1,"mat-label"),s._uU(2),s.qZA(),s.TgZ(3,"input",1,2),s.NdJ("change",(function(e){return t.fileChange(e)})),s.qZA(),s.TgZ(5,"div",3)(6,"button",4),s.NdJ("click",(function(){s.CHM(e);const t=s.MAs(4);return s.KtG(t.click())})),s._uU(7),s.qZA(),s._uU(8," "),s.TgZ(9,"span"),s._uU(10),s.qZA()()()}2&e&&(s.Q6J("formGroup",t.uploadForm),s.xp6(2),s.Oqu(t.label),s.xp6(1),s.Q6J("accept",t.acceptFiles),s.xp6(4),s.Oqu(t.selectFileLabel),s.xp6(3),s.AsE("",t.fileName," ",t.fileSize?"("+t.fileSize+"Kb)":"",""))},dependencies:[a._Y,a.JL,a.sg,c.hX,d.lW],styles:["button[aria-pressed=true][_ngcontent-%COMP%]{color:red!important}.btn-file[_ngcontent-%COMP%]{max-width:200px}.input-file-wrapper[_ngcontent-%COMP%]{background:rgba(0,0,0,.0117647059);padding:.7rem .5rem .7rem 1rem;border-radius:5px;border:2px dashed rgba(0,0,0,.1)}"]}),u=(0,i.gn)([(0,r.c)()],u)},8730:(e,t,n)=>{n.d(t,{S:()=>r});var i=n(6390);const s={es:{selectFile:"Seleccionar archivo",noFileSelected:"No se ha seleccionado ningun archivo"},en:{selectFile:"Select file",noFileSelected:"No file selected"},pt:{selectFile:"Selecionar ficheiro",noFileSelected:"Nenhum ficheiro selecionado"},ca:{selectFile:"Seleccionar fitxer",noFileSelected:"No s'ha seleccionat cap fitxer"},it:{selectFile:"Seleziona file",noFileSelected:"Nessun file selezionato"},fr:{selectFile:"Sélectionner un fichier",noFileSelected:"Aucun fichier sélectionné"},de:{selectFile:"Datei auswählen",noFileSelected:"Keine Datei ausgewählt"}};function r(e,t){const n=(0,i.Ry)(e,t);return s[n]||s.es}},969:(e,t,n)=>{n.d(t,{O:()=>d});var i=n(6895),s=n(4006),r=n(9101),o=n(7392),a=n(4144),l=n(7009),c=n(4650);let d=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=c.oAB({type:e}),e.ɵinj=c.cJS({imports:[i.ez,l.ZX,o.Ps,s.UX,a.c,r.ot]}),e})()},4246:(e,t,n)=>{n.d(t,{t:()=>s});var i=n(4650);let s=(()=>{class e{constructor(){this.DNI_REGEX=/^(\d{8})([A-Z])$/,this.CIF_REGEX=/^([ABCDEFGHJKLMNPQRSUVW])(\d{7})([0-9A-J])$/,this.NIE_REGEX=/^[XYZ]\d{7,8}[A-Z]$/}convertObjectArrayToArray(e){return Object.keys(e).map((t=>{const n=e[t];return n.key=t,n}))}ValidateIDType(e){e=e.toUpperCase().replace(/\s/,"");var t=!1,n=this.spainIdType(e);switch(n){case"dni":t=this.validDNI(e);break;case"nie":t=this.validNIE(e)}return{type:n,valid:t}}spainIdType(e){return e.match(this.DNI_REGEX)?"dni":e.match(this.NIE_REGEX)?"nie":void 0}validDNI(e){return"TRWAGMYFPDXBNJZSQVHLCKE".charAt(parseInt(e,10)%23)==e.charAt(8)}validNIE(e){var t=e.charAt(0);switch(t){case"X":t=0;break;case"Y":t=1;break;case"Z":t=2}return this.validDNI(t+e.substr(1))}}return e.ɵfac=function(t){return new(t||e)},e.ɵprov=i.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},6292:(e,t,n)=>{n.r(t),n.d(t,{CertFlowChooserModule:()=>D});var i=n(6895),s=n(5601),r=n(9391),o=n(182),a=n(7367),l=n(3238),c=n(5895),d=n(4246),u=n(5710),h=n(8594),p=n(6e3),m=n(5861),f=n(7582),g=n(9549),_=n(9933),b=n(1135),v=n(4650),y=n(6554),w=n(9728);let x=(()=>{class e{constructor(e,t){this.localFetch=e,this.apiUrlService=t}getPreRequestData(e){return this.localFetch.getFetchWhitoutToken(this.apiUrlService.baseUrl+`/pre-request/cert-flow-chooser/${e}`)}}return e.ɵfac=function(t){return new(t||e)(v.LFG(y.r),v.LFG(w.i))},e.ɵprov=v.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})();var S=n(6209),C=n(8460),T=n(1572);function k(e,t){if(1&e&&(v.TgZ(0,"div",4),v._UZ(1,"mat-progress-spinner",5),v.TgZ(2,"p",6),v._uU(3),v.qZA()()),2&e){const e=v.oxw().ngIf,t=v.oxw();v.xp6(1),v.Q6J("mode",t.spinnerMode)("value",t.spinnerValue),v.xp6(2),v.Oqu(e.loading)}}function M(e,t){if(1&e&&(v.TgZ(0,"div",7)(1,"div",8)(2,"p"),v._uU(3),v.qZA()()()),2&e){const e=v.oxw().ngIf;v.xp6(3),v.Oqu(e.error)}}function I(e,t){if(1&e&&(v.ynx(0),v.YNc(1,k,4,3,"div",2),v.YNc(2,M,4,1,"div",3),v.BQk()),2&e){const e=t.ngIf;v.xp6(1),v.Q6J("ngIf",e.loading&&!e.error),v.xp6(1),v.Q6J("ngIf",e.error)}}let E=class{constructor(e,t,n,i,s){this.certService=e,this.autofirmaDetector=t,this.route=n,this.router=i,this.customizationStore=s,this.state=new b.X({loading:"Verificando datos, espera un momento...",error:null}),this.state$=this.state.asObservable(),this.requestId=null,this.userId=null,this.spinnerMode="indeterminate",this.spinnerValue=0}ngOnInit(){this.requestId=this.route.snapshot.queryParamMap.get("request_id"),this.userId=this.route.snapshot.paramMap.get("user_id"),this.requestId?this.initFlow():this.updateState({error:"Falta el ID de solicitud.",loading:null})}initFlow(){var e=this;return(0,m.Z)((function*(){try{const t=yield e.certService.getPreRequestData(e.requestId),n=t?.data;if("success"!==t?.status||!n)throw new Error("Invalid flow data");e.updateState({loading:"Verificando métodos disponibles..."}),e.userId=e.userId||n.user_id,yield e.resolveBestFlow(n)}catch{e.updateState({error:"No se han podido obtener los datos de certificación.",loading:null})}}))()}resolveBestFlow(e){var t=this;return(0,m.Z)((function*(){const{package_id_video_id:n,package_id_client_certificate:i}=e;return i&&(yield t.autofirmaDetector.getAutofirmaIsInstalled("9881,9882,9883",1e4))?t.redirect("client-certificate",i):n?t.redirect("videoid",n):void t.updateState({error:"No hay métodos de firma compatibles con tu equipo actual.",loading:null})}))()}redirect(e,t){const n=this.router.url.includes("widget-boxed")?"widget-boxed":"widget";this.customizationStore.setPackID(t),this.userId&&this.customizationStore.setUserID(this.userId),this.router.navigate([n,e,this.userId,t],{queryParams:{request_id:this.requestId,acceptTerms:!0}})}updateState(e){this.state.next({...this.state.value,...e})}};E.ɵfac=function(e){return new(e||E)(v.Y36(x),v.Y36(S.L),v.Y36(h.gz),v.Y36(h.F0),v.Y36(C.r))},E.ɵcmp=v.Xpm({type:E,selectors:[["belender-widget-cert-flow-chooser"]],features:[v._Bn([{provide:g.o2,useValue:{appearance:"outline"}}])],decls:3,vars:3,consts:[[1,"h-full","widget-belender"],[4,"ngIf"],["class","loading-wrapper",4,"ngIf"],["class","error-container",4,"ngIf"],[1,"loading-wrapper"],["color","accent","diameter","40",1,"spinner","mx-auto",3,"mode","value"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[1,"error-container"],[1,"px-10","py-6","rounded-md","text-center","bg-orange-500/20","text-orange-600"]],template:function(e,t){1&e&&(v.TgZ(0,"div",0),v.YNc(1,I,3,2,"ng-container",1),v.ALo(2,"async"),v.qZA()),2&e&&(v.xp6(1),v.Q6J("ngIf",v.lcZ(2,1,t.state$)))},dependencies:[i.O5,T.Ou,i.Ov],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative;min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.loading-wrapper[_ngcontent-%COMP%], .error-container[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}"]}),E=(0,f.gn)([(0,_.c)()],E);const A=[{path:":user_id",component:E}];let O=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=v.oAB({type:e}),e.ɵinj=v.cJS({imports:[h.Bz.forChild(A),h.Bz,p.d8]}),e})();var L=n(5028);let D=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=v.oAB({type:e}),e.ɵinj=v.cJS({providers:[s.M,r.o,a.w,o.t,c.T,d.t,u.S,x,{provide:l.Ad,useValue:"es-ES"}],imports:[i.ez,O,L.q]}),e})()},3364:(e,t,n)=>{n.d(t,{R:()=>l});var i=n(4650),s=(n(6866),n(8467)),r=n(8594),o=n(9101),a=n(3731);let l=(()=>{class e{constructor(e,t){this.utils=e,this.Activatedroute=t,this.goFlow=new i.vpe(null),this.goManual=new i.vpe(null)}ngOnInit(){console.error("data: ",this.data)}gotoFlow(){this.goFlow.emit(!0)}gotoManual(){this.goManual.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(i.Y36(s.F),i.Y36(r.gz))},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-intro-step"]],inputs:{data:"data",solicitud:"solicitud",flowName:"flowName"},outputs:{goFlow:"gotoFlow",goManual:"gotoManual"},decls:10,vars:18,consts:[[1,"flex","flex-col","justify-between","h-full","fixed-content"],[1,"flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-2"],["mat-flat-button","","type","button",1,"px-8","bg-slate-100","hover:bg-slate-200","text-slate-900",3,"click"],["mat-flat-button","","type","button",1,"px-8","hover:opacity-90",3,"click"]],template:function(e,t){1&e&&(i.TgZ(0,"div",0)(1,"div",1),i._UZ(2,"div",2)(3,"div",3),i.ALo(4,"safeHtml"),i.qZA(),i.TgZ(5,"div",4)(6,"button",5),i.NdJ("click",(function(){return t.gotoManual()})),i._uU(7,"Subida manual"),i.qZA(),i.TgZ(8,"button",6),i.NdJ("click",(function(){return t.gotoFlow()})),i._uU(9,"Subida automatica"),i.qZA()()()),2&e&&(i.xp6(2),i.Udp("color",t.data.styles.colors.title)("font-size",t.data.intro?t.data.intro.titleSize+"px":"30px"),i.Q6J("innerHTML",t.data.intro?t.data.intro.title:"Intro de descripción",i.oJD),i.xp6(1),i.Udp("color",t.data.styles.colors.text),i.Q6J("innerHTML",t.data.intro?t.data.intro.description:i.lcZ(4,16,"Descripcion de la intro"),i.oJD),i.xp6(3),i.Udp("border-radius",t.data.styles.btnRound+"px"),i.xp6(2),i.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"))},dependencies:[o.lW,a.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.dont-show-data[_ngcontent-%COMP%]{opacity:0!important;padding:0!important;overflow:hidden!important;height:0px!important;margin:0!important}"]}),e})()},8962:(e,t,n)=>{n.d(t,{A:()=>C});var i=n(6895),s=n(9101),r=n(1561),o=n(4006),a=n(5601),l=n(3798),c=n(9391),d=n(1572),u=n(182),h=n(4144),p=n(7367),m=n(9602),f=n(3238),g=n(5895),_=n(6257),b=n(1948),v=n(4246),y=n(6981),w=n(1129),x=n(9476),S=n(4650);let C=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=S.oAB({type:e}),e.ɵinj=S.cJS({providers:[a.M,c.o,p.w,u.t,g.T,v.t],imports:[i.ez,s.ot,r.Tx,h.c,o.u5,o.UX,l.a,d.Cq,m.FA,f.XK,_.T5,b.Fk,y.x,w.n,x.F]}),e})()},1760:(e,t,n)=>{n.d(t,{u:()=>T});var i=n(4650),s=(n(6866),n(4006)),r=n(8135),o=n(8467),a=n(9391),l=n(8594),c=n(9617),d=n(5895),u=n(2254),h=n(5601),p=n(6895),m=n(9101),f=n(9549),g=n(4144),_=n(8008),b=n(1406),v=n(3731);function y(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"form",1)(1,"div",2),i._UZ(2,"div",3)(3,"div",4),i.ALo(4,"safeHtml"),i.qZA(),i.TgZ(5,"div",5)(6,"div",6)(7,"mat-form-field",7)(8,"mat-label"),i._uU(9,"DNI / NIE"),i.qZA(),i._UZ(10,"input",8),i.qZA()()(),i.TgZ(11,"div",9)(12,"button",10),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw();return i.KtG(t.goBack())})),i._uU(13," Volver "),i.qZA(),i.TgZ(14,"button",11),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw();return i.KtG(t.gotoStep2())})),i._uU(15," Siguiente "),i.qZA()()()}if(2&e){const e=i.oxw();i.Q6J("formGroup",e.formDni),i.xp6(2),i.Udp("color",e.data.styles.colors.title)("font-size",e.data.Manual?e.data.Manual.titleSize+"px":"30px"),i.Q6J("innerHTML",e.data.Manual?e.data.Manual.title:"Manual de descripción",i.oJD),i.xp6(1),i.Udp("color",e.data.styles.colors.text),i.Q6J("innerHTML",e.data.Manual?e.data.Manual.description:i.lcZ(4,18,"Descripcion de la subida manual"),i.oJD),i.xp6(9),i.Udp("border-radius",e.data.styles.btnRound+"px"),i.xp6(2),i.Udp("color",e.formDni.invalid?"":e.data.styles.colors.btnText)("background",e.formDni.invalid?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),i.Q6J("disabled",e.formDni.invalid)}}function w(e,t){if(1&e){const e=i.EpF();i.ynx(0),i.TgZ(1,"app-file-upload",15),i.NdJ("fileUpload",(function(t){const n=i.CHM(e).$implicit,s=i.oxw(3);return i.KtG(s.setFile(n,t))})),i.qZA(),i.BQk()}if(2&e){const e=t.$implicit;i.xp6(1),i.s9C("label",e)}}function x(e,t){if(1&e&&(i.TgZ(0,"div",5),i.YNc(1,w,2,1,"ng-container",14),i.qZA()),2&e){const e=i.oxw(2);i.xp6(1),i.Q6J("ngForOf",e.pack.documents)}}function S(e,t){1&e&&(i.TgZ(0,"div",16),i._UZ(1,"belender-spinner",17),i.qZA()),2&e&&(i.xp6(1),i.Q6J("zoom",.6))}function C(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"form",1)(1,"div",2),i._UZ(2,"div",3)(3,"div",4),i.ALo(4,"safeHtml"),i.qZA(),i.YNc(5,x,2,1,"div",12),i.YNc(6,S,2,1,"div",13),i.TgZ(7,"div",9)(8,"button",10),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw();return i.KtG(t.goBack())})),i._uU(9," Volver "),i.qZA(),i.TgZ(10,"button",11),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw();return i.KtG(t.uploadFiles())})),i._uU(11," Subir archivos "),i.qZA()()()}if(2&e){const e=i.oxw();i.Q6J("formGroup",e.form),i.xp6(2),i.Udp("color",e.data.styles.colors.title)("font-size",e.data.Manual?e.data.Manual.titleSize+"px":"30px"),i.Q6J("innerHTML",e.data.Manual?e.data.Manual.title:"Manual de descripción",i.oJD),i.xp6(1),i.Udp("color",e.data.styles.colors.text),i.Q6J("innerHTML",e.data.Manual?e.data.Manual.description:i.lcZ(4,20,"Descripcion de la subida manual"),i.oJD),i.xp6(2),i.Q6J("ngIf",e.pack&&!e.loadingPack),i.xp6(1),i.Q6J("ngIf",e.loadingPack),i.xp6(2),i.Udp("border-radius",e.data.styles.btnRound+"px"),i.xp6(2),i.Udp("color",e.form.invalid?"":e.data.styles.colors.btnText)("background",e.form.invalid?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),i.Q6J("disabled",e.form.invalid)}}let T=(()=>{class e{constructor(e,t,n,s,r,o,a,l,c){this.smsComponent=e,this.fb=t,this.utils=n,this.attachmentsS=s,this.ar=r,this.packsS=o,this.notis=a,this.smsFlowService=l,this.solicitudesService=c,this.upload=new i.vpe(null),this.back=new i.vpe(null),this.sendDNI=new i.vpe(null),this.loadingPack=!1,this.step=1}ngOnInit(){this.form=this.fb.group({}),console.warn("data: ",this.data),this.loadingPack=!0,this.packsS.getPackagesByUserID(this.userId).then((e=>{console.warn(e),e&&e.data?this.setPack(e.data):this.loadingPack=!1})).catch((e=>{console.error(e),this.loadingPack=!1})),this.formDni=this.fb.group({dni:[null,[s.kI.required,s.kI.maxLength(9)]]}),console.error(this.smsFlowService.REQUEST),this.smsFlowService.REQUEST&&this.smsFlowService.REQUEST.request_id&&(this.step=2)}setRequestStep(){}gotoStep2(){"SMS"===this.flowName?this.createSmsRequestFromDNI(this.formDni.get("dni").value):this.sendDNI.emit(this.formDni.get("dni").value)}setPack(e){this.pack=e.find((e=>e.id==this.packId)),this.loadingPack=!1,this.setForm()}setForm(){this.pack&&this.pack.documents&&this.pack.documents.forEach((e=>{this.form.addControl(e,new s.NI("",s.kI.required))}))}uploadFiles(){this.upload.emit(!0)}goBack(){"SMS"===this.flowName?this.smsComponent.manual=!1:this.back.emit(!0)}fileChange(e){e.preventDefault(),e.stopPropagation()}setFile(e,t){const n=new FormData;n.append("file",t),n.append("request_id",this.smsFlowService.REQUEST.request_id),n.append("document_name",e),this.notis.showToast("Subiendo documento: "+e,6e3,"info"),this.attachmentsS.uploadFile(n).then((n=>{n&&n.status&&"error"!=n.status?(this.form.get(e).setValue(t),this.notis.showToast("Documento "+e+" subido correctamente",4e3,"success")):n&&n.status&&"error"==n.status&&this.notis.showToast("El documento "+e+" no se ha podido subir: "+n.message,4e3,"error")})).catch((t=>{console.error(t),this.notis.showToast("El documento "+e+" no se ha podido subir: "+t,4e3,"error")}))}createSmsRequestFromDNI(e){let t={document_number:e,user_id:this.userId,package_id:this.packId,check_legal:!0};this.solicitudesService.addSolicitud(t).then((e=>{e&&e.status&&"error"==e.status?(this.smsFlowService.setRequest(t),e.message&&(400==e.code?"Birthdate incorrect"==e.message?(this.smsComponent.setRequestStatus("form"),this.smsComponent.showAlert(this.labels.warnings.wrongDate,this.labels.warnings.wrongDateDesc)):"Incorrect date"==e.message?(this.smsComponent.setRequestStatus("form"),this.smsComponent.showAlert(this.labels.warnings.error,this.labels.warnings.wrongDate)):(this.smsComponent.setRequestStatus("no_service"),this.smsFlowService.setLoading(!1)):(this.smsComponent.setRequestStatus("form"),this.smsComponent.showAlert("Error!",e.message))),this.smsComponent.setStatus()):e&&e.status&&"success"==e.status?(this.smsFlowService.updateRequestID(e.data.request_id),this.smsFlowService.setRequest(e.data),this.smsComponent.setStatus(),this.smsFlowService.setSubscriptionOfRequest(),this.smsFlowService.sendMessageToParent({type:"response",data:e.data}),this.smsComponent.acceptTerms()):this.smsComponent.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+e)})).catch((e=>{e&&e.error&&this.smsComponent.showAlert("Error!",e.error),this.smsFlowService.setLoading(!1)}))}}return e.ɵfac=function(t){return new(t||e)(i.Y36(r.T,9),i.Y36(s.QS),i.Y36(o.F),i.Y36(a.o),i.Y36(l.gz),i.Y36(c.U),i.Y36(d.T),i.Y36(u.p),i.Y36(h.M))},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-manual-step"]],inputs:{data:"data",flowName:"flowName",packId:"packId",userId:"userId",labels:"labels"},outputs:{upload:"uploadFiles",back:"goBack",sendDNI:"dniChange"},decls:2,vars:2,consts:[["class","flex flex-col justify-between h-full fixed-content",3,"formGroup",4,"ngIf"],[1,"flex","flex-col","justify-between","h-full","fixed-content",3,"formGroup"],[1,"flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"py-4"],[1,"w-full"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["maxlength","9","formControlName","dni","type","text","placeholder","Ingresa tu DNI o NIE","matInput",""],[1,"flex","items-center","justify-end","gap-2","p-2"],["mat-flat-button","","type","button",1,"px-8","bg-slate-100","hover:bg-slate-200","text-slate-900",3,"click"],["mat-flat-button","","type","button",1,"px-8","hover:opacity-90",3,"disabled","click"],["class","py-4",4,"ngIf"],["class","py-10 px-4",4,"ngIf"],[4,"ngFor","ngForOf"],[3,"label","fileUpload"],[1,"py-10","px-4"],["text","Cargando documentos",3,"zoom"]],template:function(e,t){1&e&&(i.YNc(0,y,16,20,"form",0),i.YNc(1,C,12,22,"form",0)),2&e&&(i.Q6J("ngIf",1==t.step),i.xp6(1),i.Q6J("ngIf",2==t.step))},dependencies:[p.sg,p.O5,m.lW,f.KE,f.hX,g.Nt,s._Y,s.Fj,s.JJ,s.JL,s.nD,s.sg,s.u,_.O,b.Y,v.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.dont-show-data[_ngcontent-%COMP%]{opacity:0!important;padding:0!important;overflow:hidden!important;height:0px!important;margin:0!important}"]}),e})()},3468:(e,t,n)=>{n.d(t,{f:()=>T});var i=n(6895),s=n(9101),r=n(1561),o=n(4006),a=n(5601),l=n(3798),c=n(9391),d=n(1572),u=n(182),h=n(4144),p=n(7367),m=n(9602),f=n(3238),g=n(5895),_=n(6257),b=n(1948),v=n(4246),y=n(6981),w=n(1129),x=n(9476),S=n(969),C=n(4650);let T=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=C.oAB({type:e}),e.ɵinj=C.cJS({providers:[a.M,c.o,p.w,u.t,g.T,v.t],imports:[i.ez,s.ot,r.Tx,h.c,o.u5,o.UX,l.a,d.Cq,m.FA,f.XK,_.T5,b.Fk,y.x,w.n,x.F,S.O]}),e})()},5967:(e,t,n)=>{n.r(t),n.d(t,{PersonalModule:()=>St});var i=n(6895),s=n(6383),r=n(5592),o=n(8739),a=n(7155),l=n(6308),c=n(6709),d=n(7392),u=n(9101),h=n(1561),p=n(4006),m=n(266),f=n(4385),g=n(811),_=n(5601),b=n(3798),v=n(9391),y=n(1572),w=n(182),x=n(4144),S=n(7367),C=n(9602),T=n(3238),k=n(5895),M=n(6257),I=n(1948),E=n(4246),A=n(8594),O=n(6e3),L=n(5861),D=n(7582),P=n(9549),N=n(9933),q=n(5762),R=n(8259),Y=n(2340),F=n(1363),U=n(6305),Z=n(1931);const H={created:"form",form:"form",terms_and_conditions:"form",widget_opened:"form",prerequest:"form",waiting_terms_and_conditions:"form",waiting_login:"loading",saved_otp:"loading",waiting_otp:"otp",invalid_otp:"otp",waiting_otp_seguridad_social:"otp",invalid_otp_seguridad_social:"otp",waiting_login_seguridad_social:"loading",waiting_password:"password",abandoned_after_bad_phone:"abandoned",abandoned_after_invalid_otp:"abandoned",abandoned_after_terms_and_conditions:"abandoned",abandoned_after_waiting_otp:"abandoned",all_documents_downloaded:"success",certificate_created:"success",partial_documents_downloaded:"success",waiting_certificate:"success",consent_process_completed:"success",success_otp:"success",otp_success:"success",waiting_documents:"success",partial_documents_downloaded_and_deleted:"success",all_documents_downloaded_and_deleted:"success",bad_phone:"error-data",phone_not_exist_otp:"error-data",failed_with_retry:"failed",failed_without_retry:"failed",failed_documents_downloaded:"failed",failed_login_otp:"failed",consent_process_canceled:"failed",no_service:"no-service",no_known_client_service:"no-service"};var j=n(4650),z=n(8467),B=n(8460),J=n(6554),V=n(9728);let Q=(()=>{class e{constructor(e,t,n,i){this.utils=e,this.localFetch=t,this.solicitudesService=n,this.apiUrlService=i}addSolicitud(e){return new Promise(((t,n)=>{this.localFetch.postFileFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/known-client",e).then((e=>{e?(this.solicitudesService.markRequestOpenedIfNeeded(e),t(e)):n(e)})).catch((e=>{n(e)}))}))}addFiles(e){return new Promise(((t,n)=>{this.localFetch.postFile(this.apiUrlService.baseUrl+"/requests/known-client/upload-files",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}acceptTerms(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/known-client/terms",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendOtp(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/known-client/otp",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendPassword(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/known-client/password",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}preRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/pre-request/known-client",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendOTP(e){return new Promise(((t,n)=>{let i="/requests/known-client/otp";Y.N.scraperMock&&(i="/mockscrapper/requests/known-client/otp"),this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+i,e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}}return e.ɵfac=function(t){return new(t||e)(j.LFG(z.F),j.LFG(J.r),j.LFG(_.M),j.LFG(V.i))},e.ɵprov=j.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})();var W=n(5412),G=n(7308),$=n(1135);let K=(()=>{class e{constructor(e){this.customizationStoreService=e,this.labels=Z.S.es,this.socket=null,this.currentHeight=0,this._request=new $.X({...new q.l,status_code:"created"}),this._request_status=new $.X(null),this.request$=this._request.asObservable(),this.request_status$=this._request_status.asObservable()}setGlobalVariables(){this.REQUEST=this._request.value,this.REQUEST_STATUS=this.REQUEST?.status_code,this.REQUEST_ID=this.REQUEST?.request_id,this._request_status.next(this.REQUEST_STATUS)}setRequest(e){this._request.next({...e}),this.setGlobalVariables()}patch(e){this._request.next({...this._request.value,...e}),this.setGlobalVariables()}setRequestStatus(e){this._request.next({...this._request.value,status_code:e}),this.setGlobalVariables()}setRequestID(e){this._request.next({...this._request.value,request_id:e}),this.setGlobalVariables()}updateRequestID(e){this.REQUEST_ID=e,this.setRequestID(e)}subscribeWS(e){if(this.socket)return;const t=e||this.REQUEST_ID||this._request.value?.request_id;if(!t)return;let n="wss://notifications.dev.belender.net";"qa"==Y.N.env&&(n="wss://notifications.qa.belender.net"),"pro"==Y.N.env&&(n="wss://notifications.belender.net"),Y.N.notificationsBaseUrl&&(n=Y.N.notificationsBaseUrl),this.socket=new WebSocket(`${n}?requests_id=${t}&user_id=${this.customizationStoreService.USER_ID}`);const i=this;this.socket.onopen=function(){console.log("Conexión establecida")},this.socket.onmessage=function(e){const t=JSON.parse(e.data);i.handlePusherNotification(t)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e),console.error(e)},this.socket.onclose=function(){console.log("Conexión cerrada"),i.socket=null}}handlePusherNotification(e){if(!e||w.t.shouldIgnoreWebhookStatus(e.status_code))return;this.sendMessageToParent({type:"websocket",data:e}),console.warn("message from ws: ",e);const t=e.status_code;if(t){if(t.startsWith("failed"))return this.disconnectWebsocket(),void this.setRequestStatus(t);if(t.startsWith("abandoned"))return this.disconnectWebsocket(),void this.setRequestStatus(t);if("consent_process_completed"===t)return this.disconnectWebsocket(),void this.patch({status_code:t});this.patch({status_code:t})}}sendMessageToParent(e){if(e&&e.type&&"widgetHeight"===e.type){if(e.data===this.currentHeight)return;this.currentHeight=e.data}console.log("Message to parent:",e),window.top.postMessage(e,"*")}disconnectWebsocket(){this.socket&&this.socket.close(),this.socket=null}}return e.ɵfac=function(t){return new(t||e)(j.LFG(B.r))},e.ɵprov=j.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})();var X=n(6830),ee=n(833),te=n(4302),ne=n(8429),ie=n(3731);function se(e,t){if(1&e&&(j.TgZ(0,"span"),j._uU(1),j.qZA()),2&e){const e=j.oxw(2);j.xp6(1),j.HOy("",e.labels.otp.noReceivedCode," ",e.labels.certificate.requestAgainIn," ",e.secsCount," ",e.labels.certificate.seconds,"")}}function re(e,t){if(1&e&&(j.TgZ(0,"span"),j._uU(1),j.qZA()),2&e){const e=j.oxw(2);j.xp6(1),j.xDo("",e.labels.otp.noReceivedCode2," ",e.lastNumberPhone,"? ",e.labels.certificate.requestAgainIn," ",e.secsCount," ",e.labels.certificate.seconds,"")}}function oe(e,t){if(1&e&&(j.TgZ(0,"span"),j._uU(1),j.qZA()),2&e){const e=j.oxw(2);j.xp6(1),j.HOy("",e.labels.otp.noReceivedCode," ",e.labels.certificate.requestAgainIn," ",e.secsCount," ",e.labels.certificate.seconds,"")}}const ae=function(e,t,n){return{color:e,border:t,background:n}};function le(e,t){if(1&e&&(j.ynx(0),j.TgZ(1,"small",12),j.YNc(2,se,2,4,"span",6),j.YNc(3,re,2,5,"span",6),j.YNc(4,oe,2,4,"span",6),j.qZA(),j.BQk()),2&e){const e=j.oxw();j.xp6(1),j.Q6J("ngStyle",j.kEZ(4,ae,e.data.styles.colors.accentColor,"1px solid "+e.data.styles.colors.accentColor,e.data.styles.colors.accentBgColor)),j.xp6(1),j.Q6J("ngIf",!e.lastNumberPhone),j.xp6(1),j.Q6J("ngIf",e.lastNumberPhone&&!e.data.config.noRetryInBadPhone),j.xp6(1),j.Q6J("ngIf",e.lastNumberPhone&&e.data.config.noRetryInBadPhone)}}function ce(e,t){if(1&e&&(j.TgZ(0,"span"),j._uU(1),j.qZA()),2&e){const e=j.oxw(2);j.xp6(1),j.hij(" ",e.labels.otp.noReceivedCode," ")}}function de(e,t){if(1&e&&(j.TgZ(0,"span"),j._uU(1),j.qZA()),2&e){const e=j.oxw(2);j.xp6(1),j.AsE(" ",e.labels.otp.noReceivedCode2," ",e.lastNumberPhone,"? ")}}function ue(e,t){if(1&e&&(j.TgZ(0,"span"),j._uU(1),j.qZA()),2&e){const e=j.oxw(2);j.xp6(1),j.hij(" ",e.labels.otp.noReceivedCode," ")}}const he=function(e,t){return{color:e,background:t}};function pe(e,t){if(1&e){const e=j.EpF();j.ynx(0),j.TgZ(1,"small",12),j.YNc(2,ce,2,1,"span",6),j.YNc(3,de,2,2,"span",6),j.YNc(4,ue,2,1,"span",6),j.TgZ(5,"a",13),j.NdJ("click",(function(){j.CHM(e);const t=j.oxw();return j.KtG(t.resendOTP())})),j._uU(6),j.qZA()(),j.BQk()}if(2&e){const e=j.oxw();j.xp6(1),j.Q6J("ngStyle",j.kEZ(6,ae,e.data.styles.colors.dangerColor,"1px solid "+e.data.styles.colors.dangerColor,e.data.styles.colors.dangerBgColor)),j.xp6(1),j.Q6J("ngIf",!e.lastNumberPhone),j.xp6(1),j.Q6J("ngIf",e.lastNumberPhone&&!e.data.config.noRetryInBadPhone),j.xp6(1),j.Q6J("ngIf",e.data.config.noRetryInBadPhone),j.xp6(1),j.Q6J("ngStyle",j.WLB(10,he,e.data.styles.colors.dangerTextButtonColor,e.data.styles.colors.dangerColor)),j.xp6(1),j.Oqu(e.labels.actions.resend)}}let me=(()=>{class e{constructor(e,t,n,i){this.fb=e,this.utils=t,this.solucitudesService=n,this.activeRoute=i,this.next=new j.vpe(null),this.errPhone=new j.vpe(null),this.resendO=new j.vpe(null),this.labels=Z.S.es,this.secsCount=60,this.lastNumberPhone="XXX"}ngOnInit(){this.form=this.fb.group({code1:[null,[p.kI.required,p.kI.maxLength(6),p.kI.minLength(6)]]}),this.initSecsInterval(),this.activeRoute.queryParams.subscribe((e=>{e&&e.request_id&&(this.requestID=e.request_id)}),(e=>{console.error(e)})),this.solicitud&&this.solicitud.person_phone&&this.setPhone(this.solicitud.person_phone)}setPhone(e){let t="XXX";e&&(t=(""+e).slice(-3)),this.lastNumberPhone=t}initSecsInterval(){this.interv=setInterval((()=>{this.secsCount--,this.secsCount<=0&&this.finishSecsInterval()}),1e3)}finishSecsInterval(){this.interv&&clearInterval(this.interv)}nextStep(){let e={code:this.getCode()};this.next.emit(e)}getCode(){return this.form.get("code1").value}capturePasteEvent(e){return(0,L.Z)((function*(){}))()}errorStep(){this.errPhone.emit(!0)}setInputEvent(e){""!=e.target.value?R(e.target).next().focus():"Backspace"==e.code&&R(e.target).prev().focus()}resendOTP(){this.resendO.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(j.Y36(p.QS),j.Y36(z.F),j.Y36(_.M),j.Y36(A.gz))},e.ɵcmp=j.Xpm({type:e,selectors:[["belender-otp-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud",labels:"labels"},outputs:{next:"nextStep",errPhone:"errorPhone",resendO:"resendOTP"},decls:17,vars:24,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"title","py-2"],[4,"ngIf"],[1,"flex","gap-2","items-center","justify-start","w-full","max-w-[200px]"],["appearance","outline",1,"w-full","flex-1"],["tabindex","1","maxlength","6","minlength","1","formControlName","code1","type","text","matInput","",3,"change","keyup"],[1,"flex","items-center","justify-end","gap-2","p-4"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"info-time","w-fit",3,"ngStyle"],[1,"ml-4",3,"ngStyle","click"]],template:function(e,t){1&e&&(j._UZ(0,"belender-widget-step-logo",0),j.TgZ(1,"form",1)(2,"div",2),j._UZ(3,"div",3)(4,"div",4),j.ALo(5,"safeHtml"),j.TgZ(6,"div",5),j.YNc(7,le,5,8,"ng-container",6),j.YNc(8,pe,7,13,"ng-container",6),j.qZA(),j.TgZ(9,"div",7)(10,"mat-form-field",8)(11,"mat-label"),j._uU(12),j.qZA(),j.TgZ(13,"input",9),j.NdJ("change",(function(e){return t.capturePasteEvent(e)}))("keyup",(function(e){return t.setInputEvent(e)})),j.qZA()()()(),j.TgZ(14,"div",10)(15,"button",11),j.NdJ("click",(function(){return t.nextStep()})),j._uU(16),j.qZA()()()),2&e&&(j.Q6J("data",t.data)("customImage",t.texts.otp.customImage),j.xp6(1),j.Q6J("formGroup",t.form),j.xp6(2),j.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),j.Q6J("innerHTML",t.texts.otp.title,j.oJD),j.xp6(1),j.Udp("color",t.data.styles.colors.text),j.Q6J("innerHTML",j.lcZ(5,22,t.texts.otp.description||""),j.oJD),j.xp6(3),j.Q6J("ngIf",t.secsCount&&t.secsCount>0),j.xp6(1),j.Q6J("ngIf",!t.secsCount||t.secsCount<=0),j.xp6(4),j.Oqu(t.labels.otp.otpCode),j.xp6(3),j.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),j.Q6J("disabled",t.form.invalid),j.xp6(1),j.Oqu(t.labels.actions.next))},dependencies:[i.O5,i.PC,u.lW,P.KE,P.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.nD,p.sg,p.u,ne.y,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function fe(e,t){if(1&e&&(j.TgZ(0,"div",2),j._UZ(1,"div",3)(2,"div",4),j.ALo(3,"safeHtml"),j.qZA()),2&e){const e=j.oxw();j.xp6(1),j.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),j.Q6J("innerHTML",e.texts.success.title,j.oJD),j.xp6(1),j.Udp("color",e.data.styles.colors.text),j.Q6J("innerHTML",j.lcZ(3,8,e.texts.success.description||""),j.oJD)}}let ge=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.labels=Z.S.es}ngOnInit(){}save(){}}return e.ɵfac=function(t){return new(t||e)(j.Y36(p.QS),j.Y36(z.F),j.Y36(_.M),j.Y36(v.o),j.Y36(k.T))},e.ɵcmp=j.Xpm({type:e,selectors:[["belender-success-step"]],inputs:{data:"data",texts:"texts",labels:"labels"},decls:2,vars:3,consts:[[3,"data","customImage"],["class"," pt-4 pb-8 flex flex-col animated fadeIn",4,"ngIf"],[1,"pt-4","pb-8","flex","flex-col","animated","fadeIn"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&(j._UZ(0,"belender-widget-step-logo",0),j.YNc(1,fe,4,10,"div",1)),2&e&&(j.Q6J("data",t.data)("customImage",t.texts.success.customImage),j.xp6(1),j.Q6J("ngIf",!t.data.config.infiniteLoopInCompleted))},dependencies:[i.O5,ne.y,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function _e(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"div",6)(1,"button",7),j.NdJ("click",(function(){j.CHM(e);const t=j.oxw();return j.KtG(t.retry())})),j._uU(2),j.qZA()()}if(2&e){const e=j.oxw();j.xp6(1),j.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),j.xp6(1),j.Oqu(e.labels.actions.retry)}}function be(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"div",6)(1,"button",8),j.NdJ("click",(function(){j.CHM(e);const t=j.oxw();return j.KtG(t.newRequest())})),j._uU(2),j.qZA()()}if(2&e){const e=j.oxw();j.xp6(1),j.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),j.xp6(1),j.Oqu(e.labels.certificate.createNewRequest)}}let ve=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.labels=Z.S.es,this.retryOp=new j.vpe(null),this.newReq=new j.vpe(null)}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}newRequest(){this.newReq.emit(this.solicitud.request_id)}getIfRetryIsAllowed(){return"failed_with_retry"==this.solicitud}getIfNewRequestIsAllowed(){return"failed_documents_downloaded"==this.solicitud}}return e.ɵfac=function(t){return new(t||e)(j.Y36(p.QS),j.Y36(z.F),j.Y36(_.M),j.Y36(v.o),j.Y36(k.T))},e.ɵcmp=j.Xpm({type:e,selectors:[["belender-fail-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud",labels:"labels"},outputs:{retryOp:"retry",newReq:"newRequest"},decls:8,vars:10,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"text-red-500","title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","flex items-center justify-end gap-2 p-4",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8",3,"click"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(j._UZ(0,"belender-widget-step-logo",0),j.TgZ(1,"div",1)(2,"div",2),j._UZ(3,"div",3)(4,"div",4),j.ALo(5,"safeHtml"),j.qZA(),j.YNc(6,_e,3,7,"div",5),j.YNc(7,be,3,7,"div",5),j.qZA()),2&e&&(j.Q6J("data",t.data)("customImage",t.texts.fail.customImage),j.xp6(3),j.Q6J("innerHTML",t.texts.fail.title,j.oJD),j.xp6(1),j.Udp("color",t.data.styles.colors.text),j.Q6J("innerHTML",j.lcZ(5,8,t.texts.fail.description),j.oJD),j.xp6(2),j.Q6J("ngIf",t.solicitud&&"failed_with_retry"==t.solicitud.status_code),j.xp6(1),j.Q6J("ngIf",t.solicitud&&"failed_documents_downloaded"==t.solicitud.status_code))},dependencies:[i.O5,u.lW,ne.y,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();n(6866);var ye=n(769),we=n(1763),xe=n(5696);const Se=["termsCheckbox"],Ce=["policyCheckbox"],Te=["termsCertCheckbox"],ke=["assignmentCheckbox"];function Me(e,t){if(1&e&&(j.TgZ(0,"mat-error"),j._uU(1),j.qZA()),2&e){const e=j.oxw(2);j.xp6(1),j.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.requiredEmail," ")}}function Ie(e,t){if(1&e&&(j.TgZ(0,"mat-error"),j._uU(1),j.qZA()),2&e){const e=j.oxw(2);j.xp6(1),j.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.invalidEmail," ")}}function Ee(e,t){if(1&e&&(j.TgZ(0,"div",16)(1,"mat-form-field",17)(2,"mat-label"),j._uU(3),j.qZA(),j._UZ(4,"input",18),j.YNc(5,Me,2,1,"mat-error",19),j.YNc(6,Ie,2,1,"mat-error",19),j.qZA()()),2&e){const e=j.oxw();let t,n;j.xp6(3),j.Oqu(e.labels.email),j.xp6(1),j.Q6J("placeholder",e.labels.inputEmail),j.uIk("aria-label",e.labels.email),j.xp6(1),j.Q6J("ngIf",null==(t=e.form.get("email"))?null:t.hasError("required")),j.xp6(1),j.Q6J("ngIf",null==(n=e.form.get("email"))?null:n.hasError("email"))}}function Ae(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"div",9)(1,"belender-checkbox",20,21),j.NdJ("changeCheckbox",(function(t){j.CHM(e);const n=j.oxw();return j.KtG(n.setTerms(t))})),j.TgZ(3,"belender-terms-and-policy-links",22),j.NdJ("goToTerms",(function(){j.CHM(e);const t=j.oxw();return j.KtG(t.gotoTermsAndConditions())})),j.qZA()()()}if(2&e){const e=j.oxw();j.xp6(1),j.Q6J("color",e.data.styles.colors.title),j.xp6(2),j.Q6J("lang",e.lang)("userId",e.userId)("linkType","terms")("firstSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.firstSentence)("secondSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.secondSentence)("thirdSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.thirdSentence)("policyActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.policyActionText)("termsActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.termsActionText)("customTerms",e.data[e.flowName].customTerms)}}function Oe(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"div",9)(1,"belender-checkbox",23,24),j.NdJ("changeCheckbox",(function(t){j.CHM(e);const n=j.oxw();return j.KtG(n.setPolicy(t))})),j._UZ(3,"belender-terms-and-policy-links",25),j.qZA()()}if(2&e){const e=j.oxw();j.xp6(1),j.Q6J("color",e.data.styles.colors.title),j.xp6(2),j.Q6J("lang",e.lang)("userId",e.userId)("linkType","policy")("flowName",e.flowName)("data",e.data)("policyActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.policyActionText)}}function Le(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"div",26)(1,"belender-checkbox",10),j.NdJ("changeCheckbox",(function(t){j.CHM(e);const n=j.oxw();return j.KtG(n.setPower(t))})),j._uU(2),j.TgZ(3,"a",12),j.NdJ("click",(function(t){j.CHM(e);const n=j.oxw();return j.KtG(n.gotoPowerConditions(t))})),j.TgZ(4,"u"),j._uU(5),j.qZA()()()()}if(2&e){const e=j.oxw();j.xp6(1),j.Q6J("color",e.data.styles.colors.title),j.xp6(1),j.hij(" ",e.labels.certificate.powerConsentBefore,""),j.xp6(3),j.Oqu(e.labels.certificate.powerConsentHere)}}function De(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"div",9)(1,"belender-checkbox",10,27),j.NdJ("changeCheckbox",(function(t){j.CHM(e);const n=j.oxw();return j.KtG(n.setAssignment(t))})),j._UZ(3,"div",28),j.qZA()()}if(2&e){const e=j.oxw();j.xp6(1),j.Q6J("color",e.data.styles.colors.title),j.xp6(2),j.Q6J("innerHTML",(null==e.data[e.flowName]||null==e.data[e.flowName].texts?null:e.data[e.flowName].texts.dataAssignmentText)||(null==e.data[e.flowName]||null==e.data[e.flowName].config_translate?null:e.data[e.flowName].config_translate.dataAssignmentText)||(null==e.data||null==e.data.config?null:e.data.config.dataAssignmentText)||"",j.oJD)}}function Pe(e,t){if(1&e&&(j.TgZ(0,"div",29),j._UZ(1,"mat-icon",30),j._uU(2),j.qZA()),2&e){const e=j.oxw();j.xp6(2),j.hij(" ",e.labels.warnings.haveToReadTerms," ")}}const Ne={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let qe=(()=>{class e{constructor(e,t){this.utils=e,this.fb=t,this.requestID=null,this.labels=Z.S.es,this.lang="",this.next=new j.vpe(null),this.goTerms=new j.vpe(null),this.goTermsCert=new j.vpe(null),this.goPower=new j.vpe(null),this.acceptTerms=!1,this.acceptPolicy=!1,this.acceptTerms2=!1,this.termsReaded=!1,this.terms2Readed=!1,this.step=0,this.assignment=!1,this.powerActivate=!1,this.submitAttempted=!1}ngOnInit(){this.setForm(this.solicitud?this.solicitud:null)}tabChanged(e){this.step=e,this.setForm(null)}setForm(e){let t=e?e.person_email||e.email:null;this.form=this.fb.group(this.data.config.followMail?{email:[t,[p.kI.required,p.kI.email]]}:{email:[t]})}setTermsCheck(e){this.checkComponent.checked=e,this.acceptTerms=e}setTerms2Check(e){this.certCheckComponent.checked=e,this.acceptTerms2=e}setAssignmentCheck(e){this.assignmentCheckComponent.checked=e,this.assignment=e}setTerms(e){this.acceptTerms=e,this.acceptTerms&&(this.data?.config??{}).forceChecks?this.gotoTermsAndConditions():this.acceptTerms||(this.termsReaded=!1)}setPolicy(e){this.acceptPolicy=e}setTerms2(e){this.acceptTerms2=e,this.acceptTerms2&&(this.data?.config??{}).forceChecks?this.gotoTermsAndConditionsCertificate():this.acceptTerms2||(this.terms2Readed=!1)}setAssignment(e){this.assignment=e}nextStep(){if(this.form.invalid||!this.getIfValid())return void(0,ye.J)(this);let e={terms_and_conditions_service:this.acceptTerms,terms_and_conditions_certificate_emition:this.acceptTerms2,request_id:this.solicitud.request_id};this.data&&this.data.config&&this.data.config.followMail&&(e.email_copy=this.form.get("email").value),(this.data.config.activatePower||this.solicitud?.power_activate)&&(e.power_activate=!0,e.terms_and_conditions_power=this.powerActivate?1:0),this.next.emit(e)}gotoTermsAndConditions(){this.termsReaded=!0,this.goTerms.emit(!0)}gotoTermsAndConditionsCertificate(){this.terms2Readed=!0,this.goTermsCert.emit(!0)}getIfValid(){return!((this.requestID?this.solicitud?.power_activate:this.data?.config.activatePower)&&!this.powerActivate)&&this.getAssignmentValidation()}getAssignmentValidation(){if(this.data.config.forceChecks&&(!this.data.config.hideCheckLegal&&!this.termsReaded||!this.terms2Readed))return!1;this.data.config.hideCheckLegal&&(this.acceptTerms=!0),this.data?.config?.showPolicyLink||(this.acceptPolicy=!0);const e=!!this.data?.config?.showPolicyLink;return this.data.config.dataAssignmentCheck?this.acceptTerms&&(!e||this.acceptPolicy)&&this.acceptTerms2&&this.assignment:this.acceptTerms&&(!e||this.acceptPolicy)&&this.acceptTerms2}gotoPowerConditions(e){this.goPower.emit(!0)}setPower(e){this.powerActivate=e}}return e.ɵfac=function(t){return new(t||e)(j.Y36(z.F),j.Y36(p.QS))},e.ɵcmp=j.Xpm({type:e,selectors:[["belender-form-step"]],viewQuery:function(e,t){if(1&e&&(j.Gf(Se,5),j.Gf(Ce,5),j.Gf(Te,5),j.Gf(ke,5)),2&e){let e;j.iGM(e=j.CRH())&&(t.checkComponent=e.first),j.iGM(e=j.CRH())&&(t.policyCheckComponent=e.first),j.iGM(e=j.CRH())&&(t.certCheckComponent=e.first),j.iGM(e=j.CRH())&&(t.assignmentCheckComponent=e.first)}},inputs:{userId:"userId",flowName:"flowName",requestID:"requestID",data:"data",texts:"texts",solicitud:"solicitud",labels:"labels",lang:"lang",acceptTerms:"acceptTerms",acceptPolicy:"acceptPolicy",acceptTerms2:"acceptTerms2",termsReaded:"termsReaded",terms2Readed:"terms2Readed"},outputs:{next:"nextStep",goTerms:"goToTerms",goTermsCert:"goToTermsCertificate",goPower:"goToPower"},features:[j._Bn([{provide:T.sG,useValue:Ne},{provide:j.soG,useValue:"es-ES"}])],decls:24,vars:30,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4","custom-html",3,"innerHTML"],[1,"my-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["class","w-full",4,"ngIf"],["class","flex justify-start items-center w-full flex-100",4,"ngIf"],["class","flex justify-between items-center w-full flex-100",4,"ngIf"],[1,"flex","justify-start","items-center","w-full","flex-100"],[3,"color","changeCheckbox"],["termsCertCheckbox",""],["target","_blank",1,"text-sm","hover:text-blue-500",3,"click"],["class","px-2 flex items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"],[1,"w-full"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["id","form-email","formControlName","email","type","email","matInput","",3,"placeholder"],[4,"ngIf"],["id","termsCheckbox",3,"color","changeCheckbox"],["termsCheckbox",""],[3,"lang","userId","linkType","firstSentence","secondSentence","thirdSentence","policyActionText","termsActionText","customTerms","goToTerms"],["id","policyCheckbox",3,"color","changeCheckbox"],["policyCheckbox",""],[3,"lang","userId","linkType","flowName","data","policyActionText"],[1,"flex","justify-between","items-center","w-full","flex-100"],["assignmentCheckbox",""],[1,"custom-html",3,"innerHTML"],[1,"px-2","flex","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"],["svgIcon","mat:warning",1,"text-xs","w-4","h-4"]],template:function(e,t){1&e&&(j._UZ(0,"belender-widget-step-logo",0),j.TgZ(1,"form",1)(2,"div",2),j._UZ(3,"div",3)(4,"div",4),j.ALo(5,"safeHtml"),j.qZA(),j.TgZ(6,"div",5),j.YNc(7,Ee,7,5,"div",6),j.YNc(8,Ae,4,10,"div",7),j.YNc(9,Oe,4,7,"div",7),j.YNc(10,Le,6,3,"div",8),j.TgZ(11,"div",9)(12,"belender-checkbox",10,11),j.NdJ("changeCheckbox",(function(e){return t.setTerms2(e)})),j._uU(14),j.TgZ(15,"a",12),j.NdJ("click",(function(){return t.gotoTermsAndConditionsCertificate()})),j.TgZ(16,"u"),j._uU(17),j.qZA()(),j._uU(18),j.qZA()(),j.YNc(19,De,4,2,"div",7),j.YNc(20,Pe,3,1,"div",13),j.qZA(),j.TgZ(21,"div",14)(22,"button",15),j.NdJ("click",(function(){return t.nextStep()})),j._uU(23),j.qZA()()()),2&e&&(j.Q6J("data",t.data)("customImage",t.texts.form.customImage),j.xp6(1),j.Q6J("formGroup",t.form),j.xp6(2),j.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),j.Q6J("innerHTML",t.texts.form.title,j.oJD),j.xp6(1),j.Udp("color",t.data.styles.colors.text),j.Q6J("innerHTML",j.lcZ(5,28,t.texts.form.description||""),j.oJD),j.xp6(3),j.Q6J("ngIf",null==t.data||null==t.data.config?null:t.data.config.followMail),j.xp6(1),j.Q6J("ngIf",!t.data.config.hideCheckLegal),j.xp6(1),j.Q6J("ngIf",null==t.data||null==t.data.config?null:t.data.config.showPolicyLink),j.xp6(1),j.Q6J("ngIf",t.requestID?null==t.solicitud?null:t.solicitud.power_activate:null==t.data?null:t.data.config.activatePower),j.xp6(2),j.Q6J("color",t.data.styles.colors.title),j.xp6(2),j.hij(" ",t.labels.flowCommon.certTermsBefore," "),j.xp6(3),j.Oqu(t.labels.flowCommon.certTermsLink),j.xp6(1),j.hij(" ",t.labels.flowCommon.certTermsAfter," "),j.xp6(1),j.Q6J("ngIf",null==t.data?null:t.data.config.dataAssignmentCheck),j.xp6(1),j.Q6J("ngIf",t.submitAttempted&&(!t.acceptTerms2||!t.data.config.hideCheckLegal&&!t.acceptTerms)),j.xp6(2),j.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),j.xp6(1),j.hij(" ",t.labels.actions.next," "))},dependencies:[i.O5,d.Hw,u.lW,P.TO,P.KE,P.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.sg,p.u,we.b,ne.y,xe.T,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Re=n(5145);let Ye=(()=>{class e{constructor(e){this.utils=e,this.status="",this.labels=Z.S.es,this.label=""}ngOnInit(){this.data.config&&this.data.config.infiniteLoopInCompleted?this.label="":(this.label=this.labels.flowCommon.loadingData,Re.Z.forEach((e=>{e.text==this.status&&(this.label=e.label)})))}}return e.ɵfac=function(t){return new(t||e)(j.Y36(z.F))},e.ɵcmp=j.Xpm({type:e,selectors:[["belender-loading-step"]],inputs:{status:"status",labels:"labels",data:"data"},decls:5,vars:1,consts:[[1,"fixed-content","h-full"],[1,"h-full","py-10","flex","flex-col","items-center"]],template:function(e,t){1&e&&(j.TgZ(0,"div",0)(1,"div",1),j._UZ(2,"mat-progress-spinner"),j.TgZ(3,"p"),j._uU(4),j.qZA()()()),2&e&&(j.xp6(4),j.Oqu(t.label))},dependencies:[y.Ou],styles:[".content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),Fe=(()=>{class e{constructor(){this.labels=Z.S.es}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=j.Xpm({type:e,selectors:[["belender-no-service-step"]],inputs:{data:"data",texts:"texts",labels:"labels"},decls:6,vars:12,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&(j._UZ(0,"belender-widget-step-logo",0),j.TgZ(1,"form",1)(2,"div",2),j._UZ(3,"div",3)(4,"div",4),j.ALo(5,"safeHtml"),j.qZA()()),2&e&&(j.Q6J("data",t.data)("customImage",t.texts.noService.customImage),j.xp6(3),j.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),j.Q6J("innerHTML",t.texts.noService.title,j.oJD),j.xp6(1),j.Udp("color",t.data.styles.colors.text),j.Q6J("innerHTML",j.lcZ(5,10,t.texts.noService.description),j.oJD))},dependencies:[p._Y,p.JL,p.F,ne.y,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),Ue=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.retryOp=new j.vpe(null),this.labels=Z.S.es}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}getTextStatus(){switch(this.solicitud.status_code){case"abandoned_after_waiting_otp_seguridad_social":return this.labels.abandoned.afterWaitingOtpSS;case"abandoned_after_invalid_otp_seguridad_social":return this.labels.abandoned.afterInvalidOtpSS;case"abandoned_after_invalid_otp_aeat":return this.labels.abandoned.afterInvalidOtpAEAT;case"abandoned_after_waiting_otp_aeat":return this.labels.abandoned.afterWaitingOtpAEAT;default:return this.solicitud.status_message||this.solicitud.status_code}}}return e.ɵfac=function(t){return new(t||e)(j.Y36(p.QS),j.Y36(z.F),j.Y36(_.M),j.Y36(v.o),j.Y36(k.T))},e.ɵcmp=j.Xpm({type:e,selectors:[["belender-abandoned-step"]],inputs:{solicitud:"solicitud",data:"data",texts:"texts",labels:"labels"},outputs:{retryOp:"retry"},decls:11,vars:21,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"p-1","px-4","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm","mb-2","mt-6"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(j._UZ(0,"belender-widget-step-logo",0),j.TgZ(1,"div",1)(2,"div",2),j._UZ(3,"div",3)(4,"div",4),j.ALo(5,"safeHtml"),j.TgZ(6,"div",5),j._uU(7),j.qZA()(),j.TgZ(8,"div",6)(9,"button",7),j.NdJ("click",(function(){return t.retry()})),j._uU(10),j.qZA()()()),2&e&&(j.Q6J("data",t.data)("customImage",t.texts.abandoned.customImage),j.xp6(3),j.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),j.Q6J("innerHTML",t.texts.abandoned.title,j.oJD),j.xp6(1),j.Udp("color",t.data.styles.colors.text),j.Q6J("innerHTML",j.lcZ(5,19,t.texts.abandoned.description),j.oJD),j.xp6(3),j.AsE(" ",t.labels.certificate.status,": ",t.getTextStatus()," "),j.xp6(2),j.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),j.xp6(1),j.Oqu(t.labels.actions.retry))},dependencies:[u.lW,ne.y,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function Ze(e,t){return n=>{const i=n.controls[t];i.errors&&!i.errors.confirmedValidator||i.setErrors(n.controls[e].value!==i.value?{confirmedValidator:!0}:null)}}function He(e,t){if(1&e&&(j.TgZ(0,"mat-hint",13),j._uU(1),j.qZA()),2&e){const e=j.oxw();j.xp6(1),j.hij(" ",e.labels.certificate.password.required," ")}}function je(e,t){if(1&e&&(j.TgZ(0,"mat-hint",13),j._uU(1),j.qZA()),2&e){const e=j.oxw();j.xp6(1),j.hij(" ",e.labels.certificate.password.minLength," ")}}function ze(e,t){if(1&e&&(j.TgZ(0,"mat-hint",13),j._uU(1),j.qZA()),2&e){const e=j.oxw();j.xp6(1),j.hij(" ",e.labels.certificate.password.confirmRequired," ")}}function Be(e,t){if(1&e&&(j.TgZ(0,"mat-hint",13),j._uU(1),j.qZA()),2&e){const e=j.oxw();j.xp6(1),j.hij(" ",e.labels.certificate.password.mismatch," ")}}function Je(e,t){if(1&e&&(j.TgZ(0,"mat-hint",13),j._uU(1),j.qZA()),2&e){const e=j.oxw();j.xp6(1),j.hij(" ",e.labels.certificate.password.minLength," ")}}const Ve={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let Qe=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.labels=Z.S.es,this.form=new p.cw({}),this.next=new j.vpe(null)}ngOnInit(){this.setForm()}get f(){return this.form.controls}submit(){this.nextStep()}setForm(){this.form=this.fb.group({password:["",[p.kI.required]],confirm_password:["",[p.kI.required]]},{validator:Ze("password","confirm_password")})}nextStep(){let e={set_password_certificate:this.form.get("password").value};this.next.emit(e)}}return e.ɵfac=function(t){return new(t||e)(j.Y36(p.qu),j.Y36(z.F))},e.ɵcmp=j.Xpm({type:e,selectors:[["belender-password-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud",labels:"labels"},outputs:{next:"nextStep"},features:[j._Bn([{provide:T.sG,useValue:Ve},{provide:j.soG,useValue:"es-ES"}])],decls:23,vars:28,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"my-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["formControlName","password","minlength","8","type","password","matInput",""],["class","text-red-500",4,"ngIf"],["appearance","outline",1,"mb-4","w-full","flex-1","belender-form-field"],["formControlName","confirm_password","minlength","8","type","password","matInput",""],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"text-red-500"]],template:function(e,t){1&e&&(j._UZ(0,"belender-widget-step-logo",0),j.TgZ(1,"form",1)(2,"div",2),j._UZ(3,"div",3)(4,"div",4),j.ALo(5,"safeHtml"),j.qZA(),j.TgZ(6,"div",5)(7,"mat-form-field",6)(8,"mat-label"),j._uU(9),j.qZA(),j._UZ(10,"input",7),j.YNc(11,He,2,1,"mat-hint",8),j.YNc(12,je,2,1,"mat-hint",8),j.qZA(),j.TgZ(13,"mat-form-field",9)(14,"mat-label"),j._uU(15),j.qZA(),j._UZ(16,"input",10),j.YNc(17,ze,2,1,"mat-hint",8),j.YNc(18,Be,2,1,"mat-hint",8),j.YNc(19,Je,2,1,"mat-hint",8),j.qZA()(),j.TgZ(20,"div",11)(21,"button",12),j.NdJ("click",(function(){return t.nextStep()})),j._uU(22),j.qZA()()()),2&e&&(j.Q6J("data",t.data)("customImage",t.texts.password.customImage),j.xp6(1),j.Q6J("formGroup",t.form),j.xp6(2),j.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),j.Q6J("innerHTML",t.texts.password.title,j.oJD),j.xp6(1),j.Udp("color",t.data.styles.colors.text),j.Q6J("innerHTML",j.lcZ(5,26,t.texts.password.description),j.oJD),j.xp6(5),j.Oqu(t.labels.certificate.password.label),j.xp6(2),j.Q6J("ngIf",t.f.password.touched&&t.f.password.invalid&&t.f.password.errors.required),j.xp6(1),j.Q6J("ngIf",t.f.password.invalid&&t.f.password.errors.minlength),j.xp6(3),j.Oqu(t.labels.certificate.password.confirmLabel),j.xp6(2),j.Q6J("ngIf",t.f.confirm_password.touched&&t.f.confirm_password.touched&&t.f.confirm_password.invalid&&t.f.confirm_password.errors.required),j.xp6(1),j.Q6J("ngIf",t.f.confirm_password.touched&&t.f.confirm_password.touched&&t.f.confirm_password.invalid&&t.f.confirm_password.errors.confirmedValidator),j.xp6(1),j.Q6J("ngIf",t.f.confirm_password.invalid&&t.f.confirm_password.errors.minlength),j.xp6(2),j.Udp("color",t.form.invalid?"":t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),j.Q6J("disabled",t.form.invalid),j.xp6(1),j.hij(" ",t.labels.certificate.password.save," "))},dependencies:[i.O5,u.lW,P.KE,P.bx,P.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.sg,p.u,ne.y,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const We=["formStep"];function Ge(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"vex-power-cert",4),j.NdJ("accept",(function(){j.CHM(e);const t=j.oxw();return j.KtG(t.acceptPowerCert())})),j.qZA()}if(2&e){const e=j.oxw();j.Q6J("hideButtons",!1)("flow","KnownClient")("userId",e.userId)}}function $e(e,t){if(1&e&&j._UZ(0,"belender-loading-step",16),2&e){const e=j.oxw(3);j.Q6J("labels",e.labels)("status",null==e.solicitud?null:e.solicitud.status_code)("data",e.data)}}function Ke(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"belender-form-step",17,18),j.NdJ("goToTerms",(function(){j.CHM(e);const t=j.oxw(3);return j.KtG(t.gotoTermsAndConditions())}))("goToPower",(function(){j.CHM(e);const t=j.oxw(3);return j.KtG(t.gotoPowerConditions())}))("goToTermsCertificate",(function(){j.CHM(e);const t=j.oxw(3);return j.KtG(t.gotoTermsAndConditionsCertificate())}))("nextStep",(function(t){j.CHM(e);const n=j.oxw(3);return j.KtG(n.gotoPassword(t))})),j.qZA()}if(2&e){const e=j.oxw(3);j.Q6J("userId",e.userId)("requestID",e.requestID)("data",e.data)("flowName",e.flowName)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)("labels",e.labels)("lang",e.currentLang)}}function Xe(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"belender-password-step",19),j.NdJ("nextStep",(function(t){j.CHM(e);const n=j.oxw(3);return j.KtG(n.sendPassword(t))})),j.qZA()}if(2&e){const e=j.oxw(3);j.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function et(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"belender-otp-step",20),j.NdJ("resendOTP",(function(t){j.CHM(e);const n=j.oxw(3);return j.KtG(n.resendOTP(t))}))("errorPhone",(function(){j.CHM(e);const t=j.oxw(3);return j.KtG(t.setRequestStatus("failed_login_otp"))}))("nextStep",(function(t){j.CHM(e);const n=j.oxw(3);return j.KtG(n.requestOTP(t))})),j.qZA()}if(2&e){const e=j.oxw(3);j.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function tt(e,t){if(1&e&&j._UZ(0,"belender-success-step",21),2&e){const e=j.oxw(3);j.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function nt(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"belender-fail-step",22),j.NdJ("retry",(function(t){j.CHM(e);const n=j.oxw(3);return j.KtG(n.retryRequest(t))}))("newRequest",(function(t){j.CHM(e);const n=j.oxw(3);return j.KtG(n.newRequest(t))})),j.qZA()}if(2&e){const e=j.oxw(3);j.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function it(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"belender-abandoned-step",23),j.NdJ("retry",(function(t){j.CHM(e);const n=j.oxw(3);return j.KtG(n.retryRequest(t))})),j.qZA()}if(2&e){const e=j.oxw(3);j.Q6J("solicitud",e.solicitud)("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function st(e,t){if(1&e&&j._UZ(0,"belender-no-service-step",24),2&e){const e=j.oxw(3);j.Q6J("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("labels",e.labels)("data",e.data)}}function rt(e,t){if(1&e&&(j.ynx(0),j.YNc(1,$e,1,3,"belender-loading-step",8),j.YNc(2,Ke,2,8,"belender-form-step",9),j.YNc(3,Xe,1,4,"belender-password-step",10),j.YNc(4,et,1,4,"belender-otp-step",11),j.YNc(5,tt,1,3,"belender-success-step",12),j.YNc(6,nt,1,4,"belender-fail-step",13),j.YNc(7,it,1,4,"belender-abandoned-step",14),j.YNc(8,st,1,3,"belender-no-service-step",15),j.BQk()),2&e){const e=j.oxw(2);j.xp6(1),j.Q6J("ngIf","loading"==e.requestStatus&&!e.loading),j.xp6(1),j.Q6J("ngIf","form"==e.requestStatus&&!e.loading),j.xp6(1),j.Q6J("ngIf","password"==e.requestStatus),j.xp6(1),j.Q6J("ngIf","otp"==e.requestStatus),j.xp6(1),j.Q6J("ngIf","success"==e.requestStatus),j.xp6(1),j.Q6J("ngIf","failed"==e.requestStatus),j.xp6(1),j.Q6J("ngIf","abandoned"==e.requestStatus),j.xp6(1),j.Q6J("ngIf","no-service"==e.requestStatus)}}function ot(e,t){1&e&&j._UZ(0,"belender-disabled-url")}function at(e,t){if(1&e&&(j.TgZ(0,"div",25),j._UZ(1,"mat-progress-spinner",26),j.TgZ(2,"p",27),j._uU(3),j.qZA()()),2&e){const e=j.oxw(2);j.xp6(1),j.Q6J("value",e.spinnerValue)("mode",e.spinnerMode),j.xp6(2),j.Oqu(e.loading)}}function lt(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"div",28)(1,"div",29)(2,"div",30),j._uU(3),j.qZA(),j._UZ(4,"div",31),j.qZA(),j.TgZ(5,"div",32)(6,"button",33),j.NdJ("click",(function(){j.CHM(e);const t=j.oxw(2);return j.KtG(t.error=!1)})),j._uU(7),j.qZA()()()}if(2&e){const e=j.oxw(2);j.xp6(3),j.Oqu(e.labels.warnings.error),j.xp6(1),j.Udp("color",e.data.styles.colors.text),j.Q6J("innerHTML",e.error,j.oJD),j.xp6(3),j.Oqu(e.labels.manual)}}function ct(e,t){if(1&e&&(j.TgZ(0,"div",5)(1,"div"),j.YNc(2,rt,9,8,"ng-container",3),j.YNc(3,ot,1,0,"belender-disabled-url",3),j.YNc(4,at,4,3,"div",6),j.YNc(5,lt,8,5,"div",7),j.qZA()()),2&e){const e=j.oxw();j.xp6(1),j.Gre("h-full w-full flex-auto p-0 md:p-3 ",e.data.styles.typography,""),j.Udp("background",e.data.styles.colors.background),j.xp6(1),j.Q6J("ngIf",!e.error&&!e.disableURL),j.xp6(1),j.Q6J("ngIf",!e.error&&e.disableURL),j.xp6(1),j.Q6J("ngIf",e.loading&&!e.error),j.xp6(1),j.Q6J("ngIf",!e.loading&&e.error)}}function dt(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"vex-terms",34),j.NdJ("accepted",(function(){j.CHM(e);const t=j.oxw();return j.KtG(t.handleTermsResponse(!0))}))("cancelled",(function(){j.CHM(e);const t=j.oxw();return j.KtG(t.handleTermsResponse(!1))})),j.qZA()}if(2&e){const e=j.oxw();j.Q6J("flow","presencial")("lang",e.currentLang)("allData",e.data)("requestStatus",e.solicitud?e.solicitud.status_code:"")}}function ut(e,t){if(1&e&&(j.ynx(0),j.TgZ(1,"div",35),j._uU(2),j.qZA(),j.BQk()),2&e){const e=j.oxw();j.xp6(2),j.hij("TestMode ",e.testMode?"ON":"OFF","")}}let ht=class{constructor(e,t,n,i,s,r,o,a,l,c,d,u){this.cd=e,this.Activatedroute=t,this.utils=n,this.solicitudesService=i,this.customizationService=s,this.customizationStoreService=r,this.notis=o,this.webhooksService=a,this.knownService=l,this.dialog=c,this.translationService=d,this.personalUtils=u,this.data=null,this.disableActions=!1,this.step="created",this.waitingTime=15,this.loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1,this.viewPowerTerms=!1,this.disableURL=!1,this.flowName="KnownClient",this.showTermsDialog=!1,this.currentLang="",this.labels=Z.S.es,this.requestStatus="",this.intervalToAskBack=null,this.intervalCount=0,this.lastInvalidOtpAlertStatus=null}set solicitud(e){this._solicitudInput=e,e&&this.personalUtils.setRequest(e)}get solicitud(){return this.personalUtils.REQUEST||this._solicitudInput}ngOnInit(){const e=this;this.setTranslation(),this.loading=this.labels.certificate.loadings.gettingRequestInfo,this.userId=this.customizationStoreService.USER_ID,this.packId=this.customizationStoreService.PACK_ID,this.personalUtils.request_status$.subscribe((e=>{"invalid_otp"===e&&this.lastInvalidOtpAlertStatus!==e&&(this.lastInvalidOtpAlertStatus=e,this.showAlert("Error!","Código inválido. Por favor, introduzca el código recibido por SMS")),this.setStatus()})),this.userId?this.setInitialData(this.userId):this.loading=null,"pro"!=Y.N.env&&(R(document).keydown((function(t){16==t.which&&(this.shiftlIsPressed=!0),17==t.which&&(this.cntrlIsPressed=!0),84==t.which&&this.cntrlIsPressed&&this.shiftlIsPressed&&(e.testMode=!e.testMode,e.cd.markForCheck())})),R(document).keyup((function(e){16==e.which&&(this.shiftlIsPressed=!1),16==e.which&&(this.cntrlIsPressed=!1)})))}ngOnDestroy(){this.stopInterval(),this.personalUtils.disconnectWebsocket()}setInitialData(e){var t=this;return(0,L.Z)((function*(){const n=(0,U.cm)(yield t.getFlow(e));if(t.funderConfig=t.customizationStoreService.FUNDER_CONFIG,t.data={config:t.funderConfig,styles:t.customizationStoreService.FUNDER_STYLES,[t.flowName]:n},(0,U.bf)(t.data,t.flowName),!t.data.config||!t.data.config.funder_id)return t.notis.showAlert(t.labels.warnings.error,t.labels.warnings.noCustomization,"error"),t.loading=null,void t.cd.markForCheck();t.financiadorID=t.data.config.funder_id||"",t.disableURL=t.data.config.disableUrlWidget,t.validateRequestIdInUrl(),t.cd.markForCheck()}))()}getFlow(e){var t=this;return(0,L.Z)((function*(){return new Promise((n=>{t.customizationService.getCustomizationByFlow(e,t.flowName,t.customizationStoreService.LANG).then((e=>{n(e?.data?e.data:null)}),(e=>{n(null)}))}))}))()}sendMessageToParent(e){this.personalUtils.sendMessageToParent(e)}setTranslation(){const e=this.currentLang||this.customizationStoreService?.LANG||localStorage.getItem("belender-language")||"es",t=this.translationService.getLabelsTranslated(e);t&&(this.labels=t,this.personalUtils.labels=t)}validateRequestIdInUrl(){this.Activatedroute.queryParams.subscribe((e=>{e?.lang&&(this.currentLang=e.lang,this.setTranslation(),this.loading=this.translationService.getFirstLoading(this.currentLang)),e&&e.acceptTerms&&(this.autoAcceptTerms=!0),e&&e.request_id?(this.disableURL=!1,this.requestID=e.request_id,this.setFormFromVcCode(e.request_id)):this.loading=!1}),(e=>{this.loading=!1}))}setFormFromVcCode(e){var t=this;return(0,L.Z)((function*(){t.loading=t.labels.loadings.gettingData,t.solicitudesService.getSolicitudByCode(e).then((n=>{if(console.warn("solicitud: ",n.data),n&&n.data){if(w.t.shouldIgnoreWebhookStatus(n.data.status_code))return t.personalUtils.setRequest(t.personalUtils.REQUEST?.status_code?{...n.data,status_code:t.personalUtils.REQUEST.status_code}:n.data),t.personalUtils.subscribeWS(e),t.loading="Estamos procesando su solicitud. Espere un momento por favor",t.skipCreationOfRequest=!0,void(t.autoAcceptTerms&&t.gotoOTP());t.personalUtils.setRequest(n.data),t.personalUtils.subscribeWS(e),t.setRequestStatus(t.personalUtils.REQUEST.status_code),t.loading=!1,t.skipCreationOfRequest=t.personalUtils.REQUEST?.status_code&&"prerequest"!=t.personalUtils.REQUEST.status_code,t.autoAcceptTerms&&t.gotoOTP()}else t.loading=!1})).catch((e=>{t.loading=!1}))}))()}setSubscriptionOfRequest(){this.personalUtils.subscribeWS(this.requestID)}handlePusherNotification(e){this.personalUtils.handlePusherNotification(e),e?.status_code&&"terms_and_conditions"!=e.status_code&&setTimeout((()=>{this.loading=!1,this.cd.markForCheck()}),500)}resendOTP(e){let t={request_id:this.requestID,user_id:this.userId};this.loading=this.labels.loadings.resendingOtp,this.setSubscriptionOfRequest(),this.solicitudesService.resendOTP(t).then((e=>{e&&e.data&&(this.personalUtils.setRequest(e.data),this.setRequestStatus(this.personalUtils.REQUEST.status_code)),this.loading=!1})).catch((e=>{console.error(e),this.showAlert(this.labels.warnings.error,e.message||e),this.loading=!1}))}gotoTerms(e){this.loading=this.labels.loadings.sendingData,e.package_id=this.packId,e.user_id=this.userId,this.testMode?setTimeout((()=>{this.personalUtils.setRequest(new q.l),this.personalUtils.setRequestStatus("waiting_otp"),this.loading=!1}),4e3):this.skipCreationOfRequest?(this.gotoOTP(),this.setSubscriptionOfRequest()):this.solicitudesService.addSolicitud(e).then((t=>{t&&t.status&&"error"==t.status?(this.personalUtils.setRequest({...e,status_code:"form"}),t.message&&(400==t.code?"Birthdate incorrect"==t.message?(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongBirthday)):(this.setRequestStatus("no_service"),this.loading=!1):(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,t.message)))):t&&t.status&&"success"==t.status?(this.requestID=t.data.request_id,this.personalUtils.setRequest(t.data),this.personalUtils.sendMessageToParent({type:"response",data:t.data||t}),this.gotoOTP()):this.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+t)})).catch((e=>{e&&e.error&&this.showAlert(this.labels.warnings.error,e.error),this.loading=!1}))}setSubscriptionOfRequestOld(){!this.financiadorID||!this.userId||!this.requestID||this.subscribed||(this.subscribed=!0,this.webhooksService.bindRequestChanges(this.financiadorID,this.userId,this.requestID),this.webhooksService.subscribeRequestChanges().subscribe((e=>{e&&this.handlePusherNotification(e)}),(e=>{this.loading=!1})))}sendNewData(e){this.loading=this.labels.certificate.loadings.sendingInfo,this.solicitudesService.fixData(this.requestID,e).then((e=>{e.status&&"error"==e.status?e.message&&(this.showAlert(this.labels.warnings.error,e),this.loading=!1):e&&"success"==e.status&&(this.sendMessageToParent({type:"response",data:e.data||e}),this.initWaitingForResponse(this.labels.loadings.validatingData),this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert(this.labels.warnings.error,e.error),this.loading=!1}))}showAlert(e,t){this.loading=!1,this.notis.showAlert(e,t)}gotoPassword(e){this.loading=this.labels.certificate.loadings.startingEmission;let t=e;(this.data.config.activatePower||this.solicitud?.power_activate)&&(t.power_activate=!0,t.terms_and_conditions_power=e.terms_and_conditions_power),this.knownService.acceptTerms(t).then((e=>{e.status&&"error"==e.status?(this.showAlert(this.labels.warnings.error,e.message?e.message:e),this.loading=!1):e&&"success"==e.status?this.sendMessageToParent({type:"response",data:e.data||e}):this.loading=!1})).catch((e=>{t&&t.error&&this.showAlert(this.labels.warnings.error,t.error),this.loading=!1}))}gotoOTP(e){let t=e;t.request_id=this.requestID,t.user_id=this.userId,this.initWaitingForResponse(this.labels.certificate.loadings.startingEmission),setTimeout((()=>{this.personalUtils.setRequest(new q.l),this.personalUtils.setRequestStatus("waiting_otp"),this.loading=!1}),2e3)}requestOTP(e){let t={otp:e.code,request_id:this.solicitud.request_id};this.loading=this.labels.certificate.loadings.sendingOtp,this.knownService.sendOtp(t).then((e=>{e.status&&"error"==e.status?(this.showAlert(this.labels.warnings.error,e.message?e.message:e),this.loading=!1):e&&"success"==e.status?this.sendMessageToParent({type:"response",data:e.data||e}):this.loading=!1})).catch((e=>{e&&e.error&&this.showAlert(this.labels.warnings.error,e.error),this.loading=!1}))}sendPassword(e){let t={password:e.set_password_certificate,request_id:this.solicitud.request_id};this.loading=this.labels.flowCommon.sendingPassword,this.knownService.sendPassword(t).then((e=>{e.status&&"error"==e.status?(this.showAlert(this.labels.warnings.error,e.message?e.message:e),this.loading=!1):e&&"success"==e.status?this.sendMessageToParent({type:"response",data:e.data||e}):this.loading=!1})).catch((t=>{e&&e.error&&this.showAlert(this.labels.warnings.error,e.error),this.loading=!1}))}initWaitingForResponse(e){this.loading=e||this.labels.certificate.loadings.validatingInfo,setTimeout((()=>{this.loading&&this.askToBack()}),1e4)}askToBack(){this.askDetailToBack(this.requestID)}askDetailToBack(e){const t=this.personalUtils.REQUEST?.status_code,n=e||this.requestID||this.personalUtils.REQUEST?.request_id;n&&"consent_process_completed"!==t?this.solicitudesService.getSolicitudByCode(n).then((e=>{if(e&&e.data){if(w.t.shouldIgnoreWebhookStatus(e.data.status_code))return;const n=e.data;n.status_code=n.consent_process_completed?"consent_process_completed":n.status_code,t!=n.status_code&&(this.personalUtils.setRequest(n),this.setRequestStatus(this.personalUtils.REQUEST.status_code))}})).catch((()=>{this.loading=null})):this.stopInterval()}initIntervalToAskBack(){!this.personalUtils.REQUEST?.request_id&&!this.requestID||this.intervalToAskBack||(this.intervalToAskBack=setInterval((()=>{this.askDetailToBack(),this.intervalCount++,this.intervalCount>20&&this.stopInterval()}),5e3))}stopInterval(){this.intervalToAskBack&&clearInterval(this.intervalToAskBack),this.intervalToAskBack=null,this.intervalCount=0}gotoErrorPhone(){}setRequestStatus(e){this.personalUtils.REQUEST||this.personalUtils.setRequest(new q.l),this.personalUtils.setRequestStatus(e),this.setStatus()}setStatus(){if(!this.personalUtils.REQUEST)return;const e=H[this.personalUtils.REQUEST.status_code];if(e){if("success"===e&&this.funderConfig?.infiniteLoopInCompleted)return this.requestStatus="loading",this.loading=" ",void this.cd.markForCheck();if("error-data"===e)return this.requestStatus=this.data?.config?.noRetryInBadPhone?"otp":"error-data",this.loading=null,this.stopInterval(),void this.cd.markForCheck();if("loading"===e)return this.requestStatus="loading",this.loading=this.labels.loadings?.validatingData||"Estamos procesando su solicitud. Espere un momento por favor",void this.cd.markForCheck();this.requestStatus=e,this.loading=null,this.stopInterval()}else this.requestStatus="loading",this.loading=this.labels.loadings?.validatingData||"Estamos procesando su solicitud. Espere un momento por favor",this.initIntervalToAskBack();this.cd.markForCheck()}retryRequest(e){let t={request_id:e,user_id:this.userId};this.loading=this.labels.loadings.resendingRequest,this.setSubscriptionOfRequest(),this.solicitudesService.retryRequest(t).then((e=>{e&&e.data&&(this.personalUtils.setRequest(e.data),this.setRequestStatus(this.personalUtils.REQUEST.status_code)),this.loading=!1})).catch((e=>{console.error(e),this.showAlert(this.labels.warnings.error,e.message||e),this.loading=!1}))}newRequest(e){this.setRequestStatus("created")}getStatus(){return this.requestStatus}sendRetry(){}gotoTermsAndConditions(){this.showTermsDialog=!0}handleTermsResponse(e){this.showTermsDialog=!1,this.formComponent.setTermsCheck(e)}gotoTermsAndConditionsCertificate(){this.dialog.open(F.v,{panelClass:"fullscreen-dialog",data:{flow:"presencial",lang:this.currentLang||localStorage.getItem("belender-language")||"es"}}).afterClosed().subscribe((e=>{e&&this.formComponent.setTerms2Check(!0)}))}gotoPowerConditions(){this.viewPowerTerms=!0}acceptPowerCert(){this.viewPowerTerms=!1}get customImageForCurrentStep(){const e=this.data?.[this.flowName]?.texts;return e&&e[{failed:"fail","no-service":"noService",otp:"otpCC"}[this.requestStatus]??this.requestStatus]?.customImage||""}};ht.ɵfac=function(e){return new(e||ht)(j.Y36(j.sBO),j.Y36(A.gz),j.Y36(z.F),j.Y36(_.M),j.Y36(S.w),j.Y36(B.r),j.Y36(k.T),j.Y36(w.t),j.Y36(Q),j.Y36(W.uw),j.Y36(G.D),j.Y36(K))},ht.ɵcmp=j.Xpm({type:ht,selectors:[["belender-widget-personal"]],viewQuery:function(e,t){if(1&e&&j.Gf(We,5),2&e){let e;j.iGM(e=j.CRH())&&(t.formComponent=e.first)}},inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud"},features:[j._Bn([{provide:P.o2,useValue:{appearance:"standard"}}])],decls:4,vars:4,consts:[[3,"hideButtons","flow","userId","accept",4,"ngIf"],["class","h-full widget-belender",4,"ngIf"],[3,"flow","lang","allData","requestStatus","accepted","cancelled",4,"ngIf"],[4,"ngIf"],[3,"hideButtons","flow","userId","accept"],[1,"h-full","widget-belender"],["class","loading-wrapper animated fadeIn",4,"ngIf"],["class","animated fadeInRight",4,"ngIf"],[3,"labels","status","data",4,"ngIf"],[3,"userId","requestID","data","flowName","texts","solicitud","labels","lang","goToTerms","goToPower","goToTermsCertificate","nextStep",4,"ngIf"],[3,"data","labels","texts","solicitud","nextStep",4,"ngIf"],[3,"data","labels","texts","solicitud","resendOTP","errorPhone","nextStep",4,"ngIf"],[3,"data","labels","texts",4,"ngIf"],[3,"data","labels","texts","solicitud","retry","newRequest",4,"ngIf"],[3,"solicitud","data","labels","texts","retry",4,"ngIf"],[3,"texts","labels","data",4,"ngIf"],[3,"labels","status","data"],[3,"userId","requestID","data","flowName","texts","solicitud","labels","lang","goToTerms","goToPower","goToTermsCertificate","nextStep"],["formStep",""],[3,"data","labels","texts","solicitud","nextStep"],[3,"data","labels","texts","solicitud","resendOTP","errorPhone","nextStep"],[3,"data","labels","texts"],[3,"data","labels","texts","solicitud","retry","newRequest"],[3,"solicitud","data","labels","texts","retry"],[3,"texts","labels","data"],[1,"loading-wrapper","animated","fadeIn"],["color","accent","diameter","40",1,"spinner",3,"value","mode"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[1,"animated","fadeInRight"],[1,"px-6","py-4","flex","flex-col"],[1,"text-red-500","title","m-0"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"text-blue-500","bg-blue-50","px-8",3,"click"],[3,"flow","lang","allData","requestStatus","accepted","cancelled"],[1,"test-mode","px-10","py-2","bg-blue-500/10","text-blue-500","border-blue-500","border","rounded-md"]],template:function(e,t){1&e&&(j.YNc(0,Ge,1,3,"vex-power-cert",0),j.YNc(1,ct,6,9,"div",1),j.YNc(2,dt,1,4,"vex-terms",2),j.YNc(3,ut,3,1,"ng-container",3)),2&e&&(j.Q6J("ngIf",t.viewPowerTerms),j.xp6(1),j.Q6J("ngIf",t.data),j.xp6(1),j.Q6J("ngIf",t.showTermsDialog),j.xp6(1),j.Q6J("ngIf",t.testMode))},dependencies:[i.O5,u.lW,y.Ou,X.L,ee.L,te.q,me,ge,ve,qe,Ye,Fe,Ue,Qe],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative}.widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"]}),ht=(0,D.gn)([(0,N.c)()],ht);const pt=[{path:":idUser",component:ht},{path:":idUser/:packID",component:ht}];let mt=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=j.oAB({type:e}),e.ɵinj=j.cJS({imports:[A.Bz.forChild(pt),A.Bz,O.d8]}),e})();var ft=n(6981),gt=n(3848),_t=n(1129),bt=n(3295),vt=n(1258),yt=n(2266),wt=n(3300),xt=n(865);let St=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=j.oAB({type:e}),e.ɵinj=j.cJS({providers:[_.M,v.o,S.w,w.t,k.T,E.t,Q,K,{provide:T.Ad,useValue:"es-ES"}],imports:[mt,i.ez,s.G,r.J,o.TU,a.p0,l.JX,c.p9,d.Ps,u.ot,h.Tx,x.c,p.u5,m.AV,p.UX,f.LD,g.vV,b.a,y.Cq,C.FA,T.XK,M.T5,I.Fk,ft.x,gt.Nh,_t.n,bt.g,vt.H,yt.L,wt.C,xt.q]}),e})()},1742:(e,t,n)=>{n.d(t,{_:()=>u});var i=n(1931),s=n(1135),r=n(4707),o=n(5762),a=n(2340),l=n(182),c=n(4650),d=n(8460);let u=(()=>{class e{constructor(e){this.customizationStoreService=e,this.labels=i.S.es,this.socket=null,this._request=new s.X({...new o.l,status_code:"created"}),this._lastThreeNumbersPhone=new s.X(null),this._request_status=new s.X(null),this.currentHeight=0,this.autoAcceptSource=new r.t,this.autoAccept$=this.autoAcceptSource.asObservable(),this.request$=this._request.asObservable(),this.request_status$=this._request_status.asObservable(),this.lastThreeNumbersPhone$=this._lastThreeNumbersPhone.asObservable()}parseErrorResponse(e){if(Array.isArray(e)){let t="";return e.forEach((e=>{t+=e+" "})),{title:this.labels.warnings.errorSomeData,description:t}}return"does not have pin service"==e.toLowerCase()||"does not have clave pin service"==e.toLowerCase()?{title:"no-service",code:"no-service",description:this.labels.warnings.noPinService}:"document number invalid."==e.toLowerCase()?{title:this.labels.warnings.wrongDni,code:"dni",description:this.labels.warnings.wrongDniDesc}:"incorrect support number"==e.toLowerCase()?{title:this.labels.warnings.error,code:"sop",description:this.labels.warnings.wrongSupport}:"incorrect date"==e.toLowerCase()?{title:this.labels.warnings.wrongDate,code:"nac",description:this.labels.warnings.wrongDateDesc}:{title:"Error!",code:"unknown",description:e}}setGlobalVariables(){this.REQUEST=this._request.value,this.REQUEST_STATUS=this.REQUEST.status_code,this._request_status.next(this.REQUEST_STATUS)}setRequest(e){this._request.next({...e}),this.setGlobalVariables()}patch(e){this._request.next({...this._request.value,...e}),this.setGlobalVariables()}setParameter(e,t){this._request.next({...this._request.value,[e]:t}),this.setGlobalVariables()}setRequestStatus(e){this._request.next({...this._request.value,status_code:e}),this.setGlobalVariables()}setRequestID(e){this._request.next({...this._request.value,request_id:e}),this.setGlobalVariables()}subscribeWS(){if(this.socket)return;let e="wss://notifications.dev.belender.net";"qa"==a.N.env&&(e="wss://notifications.qa.belender.net"),"pro"==a.N.env&&(e="wss://notifications.belender.net"),a.N.notificationsBaseUrl&&(e=a.N.notificationsBaseUrl),this.socket=new WebSocket(`${e}?requests_id=${this._request.value.request_id}&user_id=${this.customizationStoreService.USER_ID}`);var t=this;this.socket.onopen=function(e){console.log("Conexión establecida")},this.socket.onmessage=function(e){let n=JSON.parse(e.data);t.handlePusherNotification(n)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e),console.error(e)},this.socket.onclose=function(e){console.log("Conexión cerrada")}}handlePusherNotification(e){if(!e||l.t.shouldIgnoreWebhookStatus(e.status_code))return;this.sendMessageToParent({type:"websocket",data:e}),console.warn("message from ws: ",e),e.person_last_three_phone_number&&this._lastThreeNumbersPhone.next(e.person_last_three_phone_number);const t=e.status_code;if(t){if(t.startsWith("failed"))return this.disconnectWebsocket(),void this.setRequestStatus(t);if(t.startsWith("abandoned"))return this.disconnectWebsocket(),void this.setRequestStatus(t);if("consent_process_completed"===t)return this.disconnectWebsocket(),void this.patch({status_code:t});this.patch({status_code:t})}}sendMessageToParent(e){if(e&&e.type&&"widgetHeight"===e.type){if(e.data===this.currentHeight)return;this.currentHeight=e.data}console.log("Message to parent:",e),window.top.postMessage(e,"*")}disconnectWebsocket(){this.socket&&this.socket.close(),this.socket=null}triggerAutoAccept(){this.autoAcceptSource.next()}clearAutoAccept(){this.autoAcceptSource=new r.t(1),this.autoAccept$=this.autoAcceptSource.asObservable()}}return e.ɵfac=function(t){return new(t||e)(c.LFG(d.r))},e.ɵprov=c.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},8593:(e,t,n)=>{n.d(t,{n:()=>Q});var i=n(5861),s=n(7582),r=n(9549),o=n(9933),a=n(5762),l=n(2340),c=n(667);const d={created:"form",form:"form",prerequest:"form",terms_and_conditions:"form",waiting_terms_and_conditions:"form",waiting_password:"form",waiting_otp_seguridad_social:"otp_ss",waiting_login_seguridad_social:"otp_ss",invalid_otp_seguridad_social:"otp_ss",waiting_otp_carpeta_ciudadana:"otp_cc",waiting_login_carpeta_ciudadana:"otp_cc",invalid_otp_carpeta_ciudadana:"otp_cc",waiting_otp_aeat:"otp_aeat",waiting_login_aeat:"otp_aeat",invalid_otp_aeat:"otp_aeat",waiting_login_bde:"otp_bde",waiting_otp_bde:"otp_bde",invalid_otp_bde:"otp_bde",abandoned_after_bad_phone:"abandoned",abandoned_after_terms_and_conditions:"abandoned",abandoned_after_invalid_otp_seguridad_social:"abandoned",abandoned_after_waiting_otp_seguridad_social:"abandoned",abandoned_after_invalid_otp_aeat:"abandoned",abandoned_after_waiting_otp_aeat:"abandoned",abandoned_after_waiting_otp_bde:"abandoned",abandoned_after_invalid_otp_bde:"abandoned",abandoned_after_waiting_otp_carpeta_ciudadana:"abandoned",abandoned_after_invalid_otp_carpeta_ciudadana:"abandoned",all_documents_downloaded:"success",partial_documents_downloaded:"success",consent_process_completed:"success",partial_documents_downloaded_and_deleted:"success",all_documents_downloaded_and_deleted:"success",failed_with_retry:"failed",failed_without_retry:"failed",failed_documents_downloaded:"failed",consent_process_canceled:"failed",failed_job_task_cirbe:"failed",no_service:"no-service",no_clave_pin_service:"no-service",no_cirbe_cp_service:"no-service",no_sms_service:"no-service",stand_by:"standby","no-phone":"no-phone","no-more-phone":"no-phone",bad_phone:"bad-phone",error_expiration_date:"error-expiration-date",error_birth_date:"error-birth-date",error_support_number:"error-support-number",duplicated:"duplicated"};var u=n(182),h=n(6305),p=n(4650),m=n(8594),f=n(8467),g=n(7489),_=n(8460),b=n(9045),v=n(7367),y=n(7308),w=n(1742),x=n(3687);const S=["formStep"],C=["otpStep"];function T(e,t){1&e&&(p.TgZ(0,"div",8),p._UZ(1,"mat-progress-spinner",9),p.qZA()),2&e&&(p.xp6(1),p.Q6J("value",0))}function k(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-form-step",20,21),p.NdJ("openTerms",(function(){p.CHM(e);const t=p.oxw(3);return p.KtG(t.showTermsDialog=!0)})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("skipCreationOfRequest",e.skipCreationOfRequest)("deviceInfoDetails",e.deviceInfoDetails)("flowName",e.flowName)("acceptCirbe",e.acceptCirbe)("requestIDFromURL",e.requestIDFromURL)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("data",e.data)("labels",e.labels)("lang",e.currentLang)("editable_dates",e.editable_dates)}}function M(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-shared-otp-step",22,23),p.NdJ("resendOTP",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.resendOTP(t))}))("errorPhone",(function(){p.CHM(e);const t=p.oxw(3);return p.KtG(t.setRequestStatus("failed_login_otp"))}))("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.requestOTP(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("otpType",e.getOtpType(e.requestStatus))("flowType",e.flowName)("data",e.data)("labels",e.labels)("minLength",e.getOTPMinLength())("logoCustom",e.getLogoCustom())("lastThreeNumbersPhone",e.lastThreeNumbersPhone)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function I(e,t){if(1&e&&p._UZ(0,"belender-success-step",24),2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("flowName",e.flowName)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function E(e,t){if(1&e&&p._UZ(0,"belender-duplicated-request-step",25),2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)}}function A(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-error-birthday-step",26),p.NdJ("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.setBirthDate(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function O(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-error-expiration-step",26),p.NdJ("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.setExpiration(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function L(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-error-support-number-step",26),p.NdJ("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.setSupportNumber(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function D(e,t){if(1&e&&p._UZ(0,"belender-fail-step",27),2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function P(e,t){if(1&e&&p._UZ(0,"belender-abandoned-step",27),2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function N(e,t){if(1&e&&p._UZ(0,"belender-no-service-step",28),2&e){const e=p.oxw(3);p.Q6J("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("data",e.data)}}function q(e,t){if(1&e&&p._UZ(0,"belender-standby-step",28),2&e){const e=p.oxw(3);p.Q6J("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("data",e.data)}}function R(e,t){if(1&e&&(p.TgZ(0,"div",29)(1,"div",30)(2,"h1",31),p._uU(3),p.qZA()(),p.TgZ(4,"div",32),p._uU(5),p.qZA()()),2&e){const e=p.oxw(3);p.xp6(3),p.Oqu(null==e.labels||null==e.labels.warnings?null:e.labels.warnings.requestNoExist),p.xp6(1),p.Udp("color",e.data.styles.colors.text),p.xp6(1),p.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.noRequests," ")}}function Y(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-cancel-request",33),p.NdJ("updateStatusCode",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.setCancel(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("flowType",e.flowName)("data",e.data)("labels",e.labels)("textColor",e.data.styles.colors.text)("customText",e.data.config.cancelRequestText)}}function F(e,t){if(1&e&&(p._UZ(0,"div",34),p.ALo(1,"safeHtml")),2&e){const e=p.oxw(3);p.Udp("color",e.data.styles.colors.text),p.Q6J("innerHTML",e.data[e.flowName]&&null!=e.data[e.flowName]&&null!=e.data[e.flowName].texts&&null!=e.data[e.flowName].texts.form&&e.data[e.flowName].texts.form.aditionalDescription?p.lcZ(1,3,(null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.aditionalDescription)||""):"",p.oJD)}}function U(e,t){if(1&e&&(p.ynx(0),p.YNc(1,k,2,10,"belender-form-step",10),p.YNc(2,M,2,8,"belender-shared-otp-step",11),p.YNc(3,I,1,4,"belender-success-step",12),p.YNc(4,E,1,2,"belender-duplicated-request-step",13),p.YNc(5,A,1,3,"belender-error-birthday-step",14),p.YNc(6,O,1,3,"belender-error-expiration-step",14),p.YNc(7,L,1,3,"belender-error-support-number-step",14),p.YNc(8,D,1,3,"belender-fail-step",15),p.YNc(9,P,1,3,"belender-abandoned-step",15),p.YNc(10,N,1,2,"belender-no-service-step",16),p.YNc(11,q,1,2,"belender-standby-step",16),p.YNc(12,R,6,4,"div",17),p.YNc(13,Y,1,5,"belender-cancel-request",18),p.YNc(14,F,2,5,"div",19),p.BQk()),2&e){const e=p.oxw(2);p.xp6(1),p.Q6J("ngIf","form"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","otp_ss"==e.requestStatus||"otp_aeat"==e.requestStatus||"otp_bde"==e.requestStatus||"otp_cc"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","success"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","duplicated"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","error-birth-date"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","error-expiration-date"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","error-support-number"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","failed"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","abandoned"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","no-service"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","standby"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","created"!=e.step),p.xp6(1),p.Q6J("ngIf",e.showCancelRequest&&e.data.config.cancelRequest),p.xp6(1),p.Q6J("ngIf","form"===e.requestStatus&&!e.loadingRequestData&&e.data[e.flowName]&&(null==e.data[e.flowName]?null:e.data[e.flowName].showAditionalDescription))}}function Z(e,t){1&e&&p._UZ(0,"belender-disabled-url")}function H(e,t){if(1&e&&(p.TgZ(0,"div",35),p._UZ(1,"div",36),p.qZA()),2&e){const e=p.oxw(2);p.xp6(1),p.Q6J("innerHTML",e.warning,p.oJD)}}function j(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"div",37)(1,"div",29)(2,"div",38),p._uU(3),p.qZA(),p._UZ(4,"div",39),p.qZA(),p.TgZ(5,"div",40)(6,"button",41),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw(2);return p.KtG(t.error=!1)})),p._uU(7),p.qZA()()()}if(2&e){const e=p.oxw(2);p.xp6(3),p.Oqu(null==e.labels||null==e.labels.warnings?null:e.labels.warnings.error),p.xp6(1),p.Udp("color",e.data.styles.colors.text),p.Q6J("innerHTML",e.error,p.oJD),p.xp6(3),p.hij(" ",null==e.labels?null:e.labels.manual," ")}}function z(e,t){if(1&e&&(p.TgZ(0,"div",3)(1,"div"),p.YNc(2,T,2,1,"div",4),p.YNc(3,U,15,14,"ng-container",5),p.YNc(4,Z,1,0,"belender-disabled-url",5),p.YNc(5,H,2,1,"div",6),p.YNc(6,j,8,5,"div",7),p.qZA()()),2&e){const e=p.oxw();p.xp6(1),p.Gre("h-full w-full relative flex-auto p-0 md:p-3 ",null==e.data||null==e.data.styles?null:e.data.styles.typography,""),p.Udp("background",null==e.data||null==e.data.styles||null==e.data.styles.colors?null:e.data.styles.colors.background),p.xp6(1),p.Q6J("ngIf",e.data.config.infiniteLoopInCompleted&&"success"===e.requestStatus),p.xp6(1),p.Q6J("ngIf",!e.error&&!e.disableURL),p.xp6(1),p.Q6J("ngIf",!e.error&&e.disableURL),p.xp6(1),p.Q6J("ngIf",!e.loading&&e.warning&&"success"!=e.requestStatus&&"abandoned"!=e.requestStatus&&"failed"!=e.requestStatus),p.xp6(1),p.Q6J("ngIf",!e.loading&&e.error)}}function B(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"vex-terms",42),p.NdJ("accepted",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.handleTermsResponse(!0))}))("cancelled",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.handleTermsResponse(!1))})),p.qZA()}if(2&e){const e=p.oxw();p.Q6J("flow",e.flowName)("lang",e.currentLang)("requestID",e.requestID)("requestStatus",e.solicitud?e.solicitud.status_code:"")("allData",e.data)}}function J(e,t){if(1&e&&(p.TgZ(0,"div",43),p._UZ(1,"mat-progress-spinner",44),p.TgZ(2,"p",45),p._uU(3),p.qZA()()),2&e){const e=p.oxw();p.xp6(3),p.hij(" ",e.loading||""," ")}}const V={"Seguridad Social":"waiting_otp_seguridad_social",AEAT:"waiting_otp_aeat","Banco de España":"waiting_otp_bde"};let Q=class{constructor(e,t,n,i,s,r,o,a,c,d){this.cd=e,this.Activatedroute=t,this.utils=n,this.pinService=i,this.customizationStoreService=s,this.deviceInfoService=r,this.customizationService=o,this.translationService=a,this.pinUtils=c,this.scrollService=d,this.data=null,this.disableActions=!1,this.step="created",this.clientEnviroment="belender",this.showCancelRequest=!1,this._loading=null,this.error=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1,this.lastThreeNumbersPhone=null,this.requestIDFromURL=!1,this.paramsSetted=!1,this.stopPropagationOfSuccess=!1,this.picturesTaken=[],this.disableURL=!1,this.selectedLanguage="es",this.loadingRequestData=!1,this.env=l.N,this.intervalToAskBack=null,this.requestedFromDetail=!1,this.intervalCount=0,this.requestStatus="",this.isScaled=!1,this.flowName="ClavePin",this.currentLang="",this.acceptCirbe=!1,this.showTermsDialog=!1,this.editable_dates=!1,this.termsOpened=!1,localStorage.getItem("belender-language")&&(this.selectedLanguage=localStorage.getItem("belender-language")),this.deviceInfoDetails$=this.deviceInfoService.deviceInfo$.subscribe((e=>{Object.keys(e).length>0&&(this.deviceInfoDetails=e)}))}ngOnInit(){this.labels=this.pinUtils.labels,this.loading=this.labels.loadings.gettingData,this.pinUtils.request_status$.subscribe((e=>{this.setStatus()})),this.checkClientUrl()}ngAfterViewInit(){this.initFunctions()}ngOnDestroy(){window.screen&&window.screen.orientation&&this.orientationChangeHandler&&window.screen.orientation.removeEventListener("change",this.orientationChangeHandler)}ngAfterViewChecked(){}isQA(){return"qa"===l.N.env}get loading(){return this._loading}set loading(e){this._loading=e,null!==e&&this.onLoadingChanged(e)}getLogoCustom(){switch(this.requestStatus){case"otp_ss":return this.data[this.flowName]?.texts?.otpSS?.customImage;case"otp_cc":return this.data[this.flowName]?.texts?.otpCC?.customImage;case"otp_aeat":return this.data[this.flowName]?.texts?.otpAEAT?.customImage;case"otp_bde":return this.data[this.flowName]?.texts?.otpBDE?.customImage}return this.data[this.flowName]?.texts?.otpSS?.customImage}onLoadingChanged(e){this.scrollUpContent()}initFunctions(){var e=this;return(0,i.Z)((function*(){var t;e.Activatedroute.queryParams.subscribe((t=(0,i.Z)((function*(t){t&&t.request_id&&(e.requestID=t.request_id,console.warn(e.requestID)),t.lang?(e.currentLang=t.lang,e.loading=e.translationService.getFirstLoading(e.currentLang),e.setTranslation()):e.loading=e.pinUtils.labels.loadings.gettingData,"true"===t.editable_dates&&(e.editable_dates=t.editable_dates),e.customizationStoreService.USER_ID?e.setInitialData(e.customizationStoreService.USER_ID):e.loading=null})),function(e){return t.apply(this,arguments)}))}))()}setTranslation(){let e=this.translationService.getLabelsTranslated(this.currentLang);e&&(this.pinUtils.labels=e,this.labels=e)}getWindowsScreenOrientation(){window.screen&&window.screen.orientation?window.screen.orientation.addEventListener("change",this.orientationChangeHandler):console.warn("Screen Orientation API not supported.")}getOtpType(e){switch(e){case"otp_ss":default:return"otpSS";case"otp_cc":return"otpCC";case"otp_aeat":return"otpAEAT";case"otp_bde":return"otpBDE"}}setRequestStatus(e){this.pinUtils?.REQUEST?this.pinUtils.setRequestStatus(e):this.pinUtils.setRequest(new a.l),this.setStatus()}checkClientUrl(){const e=window.location.href;this.clientEnviroment=this.getClientFromUrl(e)}getOTPMinLength(){return this.env?"dev"===this.env.env&&"belender"===this.clientEnviroment?6:"qa"===this.env.env||"dev"===this.env.env&&"opendata"===this.clientEnviroment?3:6:6}getClientFromUrl(e){return e.includes("opendata")?"opendata":"belender"}setInitialData(e){var t=this;return(0,i.Z)((function*(){if(yield t.validateRequestIdInUrl(),t.flowConfig=(0,h.cm)(yield t.getFlow(e)),t.funderConfig=t.customizationStoreService.FUNDER_CONFIG,t.funderStyles=t.customizationStoreService.FUNDER_STYLES,t.data={config:t.funderConfig,styles:t.funderStyles,[t.flowName]:t.flowConfig},(0,h.bf)(t.data,t.flowName),!t.data.config||!t.data.config.funder_id)return t.showAlert(t.pinUtils.labels.warnings.error,t.pinUtils.labels.warnings.noCustomization,"error"),t.loading=null,void t.cd.markForCheck();t.financiadorID=t.data.config.funder_id||"",t.customizationStoreService.setFunderID(t.financiadorID),t.disableURL=t.data.config.disableUrlWidget,t.loading=null,yield t.utils.preloadImages(t.flowConfig,t.funderStyles),t.cd.markForCheck(),t.pinUtils.sendMessageToParent({type:"widgetLoaded",data:{}})}))()}getFlow(e){var t=this;return(0,i.Z)((function*(){return new Promise((n=>{t.customizationService.getCustomizationByFlow(e,t.flowName,t.currentLang||t.customizationStoreService.LANG,t.requestID,t.solicitud?t.solicitud.status_code:"").then((e=>{n(e?.data?e.data:null)}),(e=>{n(null)}))}))}))()}validateRequestIdInUrl(){var e=this;return(0,i.Z)((function*(){return new Promise((t=>{var n;e.Activatedroute.queryParams.subscribe({next:(n=(0,i.Z)((function*(n){if(n&&n.acceptTerms&&(e.autoAcceptTerms=!0),n&&n.request_id){e.disableURL=!1,e.requestID=n.request_id;let i=yield e.setFormFromVcCode(n.request_id,n);e.requestIDFromURL=!0,t(i)}else n?(e.setParamsToRequest(n),t(null)):(e.loading=null,t(null))})),function(e){return n.apply(this,arguments)}),error:()=>{e.loading=null,t(null)}})}))}))()}syncAcceptCirbeFromRequestPayload(e){e&&!0===e.add_cirbe&&(this.acceptCirbe=!0)}setParamsToRequest(e){this.pinUtils?.REQUEST||this.pinUtils.setRequest(new a.l),e.success&&(this.stopPropagationOfSuccess=!0);const t=e.accept_cirbe??e.add_cirbe;(!0===t||"true"===t||"1"===t)&&(this.acceptCirbe=!0),(e.document_number||e.document)&&!this.pinUtils?.REQUEST.person_document_number&&(this.pinUtils.REQUEST.person_document_number=e.document_number||e.document,this.requestIDFromURL=!0),(e.birth_date||e.birthday)&&!this.pinUtils?.REQUEST.birth_date&&(this.pinUtils.REQUEST.birth_date=e.birth_date||e.birthday,this.requestIDFromURL=!0),(e.document_expiration_date||e.expiration)&&!this.pinUtils.REQUEST.person_document_expiration_date&&(this.pinUtils.REQUEST.person_document_expiration_date=e.document_expiration_date||e.expiration,this.requestIDFromURL=!0),(e.document_support||e.supportNumber)&&!this.pinUtils.REQUEST.document_support&&(this.pinUtils.REQUEST.document_support=e.document_support||e.supportNumber,this.requestIDFromURL=!0),e.email&&!this.pinUtils.REQUEST.email&&(this.pinUtils.REQUEST.email=e.email,this.requestIDFromURL=!0,this.paramsSetted=!0),this.paramsSetted=!0}setFormFromVcCode(e,t){var n=this;return(0,i.Z)((function*(){return n.loading=n.pinUtils.labels.loadings.gettingData,n.loadingRequestData=!0,new Promise((i=>{n.pinService.getSolicitudByCode(e).then((e=>{if(e&&e.data){let i=e.data;i.status_code=i.consent_process_completed?"consent_process_completed":i.status_code,u.t.shouldIgnoreWebhookStatus(i.status_code)&&n.pinUtils.REQUEST?.status_code&&(i={...i,status_code:n.pinUtils.REQUEST.status_code}),n.syncAcceptCirbeFromRequestPayload(i),n.pinUtils.setRequest(i),n.setRequestStatus(n.pinUtils.REQUEST.status_code),n.pinUtils.subscribeWS(),n.loading=null,n.skipCreationOfRequest=n.solicitud&&n.solicitud.status_code&&"prerequest"!=n.solicitud.status_code,n.autoAcceptTerms?n.pinUtils.triggerAutoAccept():n.setParamsToRequest(t)}else n.loading=null;n.loadingRequestData=!1,i(n.solicitud||null)})).catch((e=>{n.loading=null,n.loadingRequestData=!1,i(null)}))}))}))()}handleBadPhone(){this.pinUtils.disconnectWebsocket(),this.loading=this.pinUtils.labels.loadings.validatingData,this.pinService.noMatchPhone({request_id:this.pinUtils.REQUEST.request_id,user_id:this.customizationStoreService.USER_ID}).then((e=>{this.pinUtils.REQUEST||(this.pinUtils.setRequest(new a.l),this.setRequestStatus(this.pinUtils.REQUEST.status_code)),e&&e.data&&(this.pinUtils.setRequest(e.data),this.setRequestStatus(this.pinUtils.REQUEST.status_code)),this.loading=null})).catch((e=>{this.showAlert("Error!",e),setTimeout((()=>{this.pinUtils.REQUEST||(this.pinUtils.setRequest(new a.l),this.setRequestStatus(this.pinUtils.REQUEST.status_code)),this.setRequestStatus("failed_without_retry"),this.loading=null}),1e3)}))}sendNewData(e){this.loading=this.pinUtils.labels.loadings.sendingData,this.pinService.fixData(this.pinUtils.REQUEST.requestID,e).then((e=>{e.status&&"error"==e.status?e.message&&(this.showAlert("Error!",e,"error"),this.loading=null):e&&"success"==e.status&&(this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),this.loading=this.pinUtils.labels.loadings.validatingData,this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error,"error")}))}showAlert(e,t,n){this.loading=null,this.getFunderIconType(n),this.warning=e?`<div class="flex flex-col w-full items-start gap-0 pl-2 mr-1"><strong class="text-md" >${e}</strong><small>${t}</small></div>`:null}getFunderIconType(e){if(!e||!this.funderStyles)return"error";switch(e){case"error":return this.funderStyles.errorIcon||e;case"success":return this.funderStyles.successIcon||e;case"warning":return this.funderStyles.warningIcon||e;case"info":return this.funderStyles.infoIcon||e;default:return e}}isBdeStatus(){let e=this.pinUtils.REQUEST?this.pinUtils.REQUEST.status_code:null;return!!e&&("waiting_otp_bde"===e||"waiting_login_bde"===e||"invalid_otp_bde"===e)}sendOtpToBde(e){this.pinUtils.disconnectWebsocket(),this.pinService.sendOTPToBde(e,"qa"===l.N.env).then((e=>{e.status&&"error"==e.status?(e.message&&"Invalid request status: waiting_login_seguridad_social"==e.message?this.showAlert(this.pinUtils.labels.warnings.error,this.pinUtils.labels.warnings.noOtp):this.showAlert("Error!",e.message?e.message:e),this.loading=null):e?(console.warn("handle success!"),e.data?e.data.consent_process_completed=!0:e.consent_process_completed=!0,this.handleRequestStatus(e.data?e.data:e),this.cd.markForCheck()):this.loading=null})).catch((e=>{this.showAlert("Error!",e&&e.error?e.error:e),this.loading=null}))}requestOTP(e){var t=this;return(0,i.Z)((function*(){if(!e?.code)return void t.showAlert("Error",t.pinUtils.labels.warnings.wrongOtp);t.showAlert(null,null),t.loading=t.labels.loadings.sendingData;const n={user_id:t.customizationStoreService.USER_ID,request_id:t.pinUtils.REQUEST.request_id,code:e.code};try{if(t.isBdeStatus()){const e=yield t.sendOtpToBde(n);return void t.handleSendOtpResponse(e)}const e=yield t.pinService.sendOTP(n,t.isQA());t.handleSendOtpResponse(e)}catch(e){const n=e?.error??e?.message??String(e);t.showAlert("Error!",n)}finally{t.loading=null}}))()}handleSendOtpResponse(e){if(e)return"error"===e.status?"Invalid request status: waiting_login_seguridad_social"===e.message?void this.showAlert(this.pinUtils.labels.warnings.error,this.pinUtils.labels.warnings.noOtp):void this.showAlert("Error!",e.message??e):"success"===e.status?(this.handleRequestStatus(e.data??e),void this.cd.markForCheck()):void this.showAlert("Error!",this.pinUtils.labels.warnings.noOtp);this.showAlert("Error!",this.pinUtils.labels.warnings.noOtp)}handleRequestStatus(e){if(e.consent_process_completed)return this.requestedFromDetail=!0,this.pinUtils.sendMessageToParent({type:"response",data:{status_message:"El proceso de consentimiento ha finalizado",widget_url:this.pinUtils?.REQUEST?.widget_url||"",status_code:"consent_process_completed",user_id:this.customizationStoreService?.USER_ID||"",funder_id:this.customizationStoreService?.FUNDER_ID||"",request_id:this.pinUtils?.REQUEST?.request_id||"",widget_url_boxed:this.pinUtils?.REQUEST?.widget_url_boxed||""}}),this.pinUtils.setRequestStatus("consent_process_completed"),setTimeout((()=>this.pinUtils.disconnectWebsocket()),1e3),void(this.data[this.flowName].showDocumentsOnSuccess&&!this.intervalToAskBack&&this.initIntervalToAskBack());if(this.otpComponent?.resetOtpNumber(),!e.otp_status&&!e.next_step_detail)return this.pinUtils.setRequestStatus("failed"),void this.pinUtils.sendMessageToParent({type:"response",data:e});if("INVALID"===e.otp_status)return this.pinUtils.setRequestStatus(e.status_code??"failed"),this.showAlert(this.pinUtils.labels.warnings.error,this.pinUtils.labels.warnings.wrongOtp),void this.pinUtils.sendMessageToParent({type:"response",data:e});if("VALID"===e.otp_status){this.showAlert(null,null);const t=this.firstPortal(e.next_step_detail);return this.pinUtils.setRequestStatus(t&&V[t]||e.status_code||"failed"),void this.pinUtils.sendMessageToParent({type:"response",data:e})}this.pinUtils.setRequestStatus(e.status_code||"failed"),this.pinUtils.sendMessageToParent({type:"response",data:e})}firstPortal(e){return e?(Array.isArray(e)?e[0]:e)?.portal:void 0}askToBack(){this.pinService.getSolicitudByCode(this.pinUtils?.REQUEST?.request_id).then((e=>{if(e&&e.data){if(this.syncAcceptCirbeFromRequestPayload(e.data),u.t.shouldIgnoreWebhookStatus(e.data.status_code))return void(this.loading=null);this.pinUtils.setRequest(e.data),this.setRequestStatus(this.pinUtils.REQUEST.status_code),this.loading=null}else this.loading=null})).catch((e=>{this.loading=null}))}gotoErrorPhone(){}setBirthDate(e){}setExpiration(e){}setSupportNumber(e){}resendOTP(e){let t={request_id:this.pinUtils?.REQUEST?.request_id,user_id:this.customizationStoreService.USER_ID};this.loading="Reenviando OTP...",this.pinUtils.subscribeWS(),this.showAlert(null,null),this.pinService.resendOTP(t).then((e=>{e&&e.data&&(this.pinUtils.setRequest(e.data),this.setRequestStatus(this.pinUtils.REQUEST.status_code)),this.loading=null})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=null}))}initIntervalToAskBack(){!this.pinUtils?.REQUEST||!this.pinUtils?.REQUEST?.request_id||(this.intervalToAskBack=setInterval((()=>{this.askDetailToBack(this.pinUtils.REQUEST.request_id),this.intervalCount++,this.intervalCount>20&&this.stopInterval()}),5e3))}stopInterval(){this.intervalToAskBack&&clearInterval(this.intervalToAskBack)}askDetailToBack(e){let t=JSON.parse(JSON.stringify(this.pinUtils.REQUEST.status_code));(e||this.pinUtils?.REQUEST?.request_id)&&"consent_process_completed"!==t?this.pinService.getSolicitudByCode(e).then((e=>{if(e&&e.data){let n=e.data;if(n.status_code=n.consent_process_completed?"consent_process_completed":n.status_code,u.t.shouldIgnoreWebhookStatus(n.status_code))return;this.syncAcceptCirbeFromRequestPayload(n),t!=n.status_code&&(this.pinUtils.setRequest(n),this.setRequestStatus(this.pinUtils.REQUEST.status_code))}})).catch((e=>{this.loading=null,this.loadingRequestData=!1})):this.stopInterval()}setStatus(){if(console.error("set status"),this.showCancelRequest=!0,this.pinUtils?.REQUEST){let e=this.pinUtils?.REQUEST.status_code,t=d[e];t?("success"===t&&this.funderConfig&&this.funderConfig.infiniteLoopInCompleted&&(this.loading=" "),("abandoned"===t||"failed"===t)&&(this.showCancelRequest=!1),this.requestStatus=t,this.loading=null):(this.requestStatus="loading",this.loading=this.pinUtils.labels.loadings.validatingData,this.initIntervalToAskBack())}this.cd.markForCheck()}scrollUpContent(){setTimeout((()=>{this.scrollService.requestScrollMainTop()}),300)}sendRetry(){}setCancel(e){this.setRequestStatus(e)}pictureTaken(e){this.picturesTaken.push(e._imageAsDataUrl)}getIfShowLogo(){return("loading"!=this.requestStatus&&"success"!=this.requestStatus&&!this.loading||!this.funderConfig?.infiniteLoopInCompleted)&&this.funderStyles?.withLogo}handleTermsResponse(e){this.showTermsDialog=!1,this.termsOpened=e,this.formComponent.setTermsCheck(e)}};Q.ɵfac=function(e){return new(e||Q)(p.Y36(p.sBO),p.Y36(m.gz),p.Y36(f.F),p.Y36(g.v),p.Y36(_.r),p.Y36(b.H),p.Y36(v.w),p.Y36(y.D),p.Y36(w._),p.Y36(x.a))},Q.ɵcmp=p.Xpm({type:Q,selectors:[["belender-widget-pin"]],viewQuery:function(e,t){if(1&e&&(p.Gf(S,5),p.Gf(C,5),p.Gf(S,5)),2&e){let e;p.iGM(e=p.CRH())&&(t.formComponent=e.first),p.iGM(e=p.CRH())&&(t.otpComponent=e.first),p.iGM(e=p.CRH())&&(t.theDiv=e.first)}},inputs:{solicitud:"solicitud",data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID"},features:[p._Bn([{provide:r.o2,useValue:{appearance:"standard"}}])],decls:3,vars:3,consts:[["id","widget-wrapper","class","h-full widget-belender",4,"ngIf"],[3,"flow","lang","requestID","requestStatus","allData","accepted","cancelled",4,"ngIf"],["class","loading-wrapper animated fadeIn",4,"ngIf"],["id","widget-wrapper",1,"h-full","widget-belender"],["class","flex justify-center h-full min-h-[300px] items-center",4,"ngIf"],[4,"ngIf"],["class","animated w-full fadeInRight",4,"ngIf"],["class","animated fadeInRight",4,"ngIf"],[1,"flex","justify-center","h-full","min-h-[300px]","items-center"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],[3,"skipCreationOfRequest","deviceInfoDetails","flowName","acceptCirbe","requestIDFromURL","texts","data","labels","lang","editable_dates","openTerms",4,"ngIf"],[3,"otpType","flowType","data","labels","minLength","logoCustom","lastThreeNumbersPhone","texts","resendOTP","errorPhone","nextStep",4,"ngIf"],[3,"data","labels","flowName","texts",4,"ngIf"],[3,"data","labels",4,"ngIf"],[3,"data","labels","texts","nextStep",4,"ngIf"],[3,"data","labels","texts",4,"ngIf"],[3,"texts","data",4,"ngIf"],["class","px-6 py-4 flex flex-col",4,"ngIf"],[3,"flowType","data","labels","textColor","customText","updateStatusCode",4,"ngIf"],["class","subheading-1 p-4 custom-html",3,"color","innerHTML",4,"ngIf"],[3,"skipCreationOfRequest","deviceInfoDetails","flowName","acceptCirbe","requestIDFromURL","texts","data","labels","lang","editable_dates","openTerms"],["formStep",""],[3,"otpType","flowType","data","labels","minLength","logoCustom","lastThreeNumbersPhone","texts","resendOTP","errorPhone","nextStep"],["otpStep",""],[3,"data","labels","flowName","texts"],[3,"data","labels"],[3,"data","labels","texts","nextStep"],[3,"data","labels","texts"],[3,"texts","data"],[1,"px-6","py-4","flex","flex-col"],[1,"title","m-0"],[1,"text-red-500"],[1,"subheading-1","pt-4"],[3,"flowType","data","labels","textColor","customText","updateStatusCode"],[1,"subheading-1","p-4","custom-html",3,"innerHTML"],[1,"animated","w-full","fadeInRight"],[1,"px-6","py-4","w-full","bg-orange-500/10","rounded-md","flex","flex-col","text-orange-600",3,"innerHTML"],[1,"animated","fadeInRight"],[1,"text-red-500","title","m-0"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"text-blue-500","bg-blue-50","px-8",3,"click"],[3,"flow","lang","requestID","requestStatus","allData","accepted","cancelled"],[1,"loading-wrapper","animated","fadeIn"],["color","accent","diameter","40","value","0","mode","indeterminate",1,"spinner"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&(p.YNc(0,z,7,10,"div",0),p.YNc(1,B,1,5,"vex-terms",1),p.YNc(2,J,4,1,"div",2)),2&e&&(p.Q6J("ngIf",t.data&&t.data.styles&&t.data.styles.colors&&!t.loading&&"loading"!=t.requestStatus),p.xp6(1),p.Q6J("ngIf",t.showTermsDialog),p.xp6(1),p.Q6J("ngIf",("loading"===t.requestStatus||t.loading)&&!t.error))},styles:[".widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.card[_ngcontent-%COMP%]{transition:all .2s ease;overflow:hidden;width:500px;max-width:100%;margin:0 auto}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}.webcam-wrapper[_ngcontent-%COMP%]{position:relative}.webcam-overlay[_ngcontent-%COMP%]{position:absolute;z-index:99;width:500px;top:0;left:0;width:100%;height:100%;justify-content:center}.webcam-overlay[_ngcontent-%COMP%] .overlay[_ngcontent-%COMP%]{background:url(/assets/img/exclude.png);width:100%;height:100%;background-repeat:no-repeat;background-size:cover;opacity:.7;max-width:500px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;top:0;left:0;background:#fff}"],data:{animation:[c.$]}}),Q=(0,s.gn)([(0,o.c)()],Q)},8489:(e,t,n)=>{n.r(t),n.d(t,{PinModule:()=>rt});var i=n(6895),s=n(6383),r=n(5592),o=n(4006),a=n(3798),l=n(9391),c=n(182),d=n(4650),u=n(8467),h=n(5601),p=n(9617),m=n(8429),f=n(342),g=n(9101),_=n(3731);function b(e,t){if(1&e&&d._UZ(0,"widget-documents",7),2&e){const e=d.oxw(2);d.Q6J("userId",e.userId)("packId",e.packId)("requestID",e.requestID)}}function v(e,t){if(1&e&&(d.TgZ(0,"div",3),d._UZ(1,"div",4)(2,"div",5),d.ALo(3,"safeHtml"),d.YNc(4,b,1,3,"widget-documents",6),d.qZA()),2&e){const e=d.oxw();d.xp6(1),d.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),d.Q6J("innerHTML",e.texts.success.title,d.oJD),d.xp6(1),d.Udp("color",e.data.styles.colors.text),d.Q6J("innerHTML",d.lcZ(3,9,e.texts.success.description||""),d.oJD),d.xp6(2),d.Q6J("ngIf",e.showDocuments)}}const y=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function w(e,t){if(1&e){const e=d.EpF();d.TgZ(0,"div",8)(1,"button",9),d.NdJ("click",(function(){d.CHM(e);const t=d.oxw();return d.KtG(t.gotoRedirect())})),d._uU(2),d.qZA()()}if(2&e){const e=d.oxw();d.Q6J("ngClass",d.kEZ(8,y,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),d.xp6(1),d.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),d.xp6(1),d.hij(" ",e.data[e.flowName].btnTextCallBack||e.labels.actions.clickToFinish," ")}}let x=(()=>{class e{constructor(e,t,n,i,s){this.formBuilder=e,this.utils=t,this.solicitudesService=n,this.packsS=i,this.cd=s,this.showDocuments=!1}ngOnInit(){this.uploadForm=this.formBuilder.group({file:[""]}),this.data&&this.data[this.flowName]&&this.data[this.flowName].enableUrlCallBack&&this.data[this.flowName].automaticRedirectCallBack&&this.data[this.flowName].callBackUrl?setTimeout((()=>{location.assign(this.data[this.flowName].callBackUrl)}),2e3):this.data&&this.data[this.flowName]&&this.data[this.flowName].showDocumentsOnSuccess&&(this.showDocuments=!0)}save(){}gotoRedirect(){this.data&&this.data[this.flowName]&&this.data[this.flowName].enableUrlCallBack&&this.data[this.flowName].callBackUrl&&location.assign(this.data[this.flowName].callBackUrl)}getIfShowLogo(){return!this.data?.config?.infiniteLoopInCompleted&&this.data?.styles?.withLogo}}return e.ɵfac=function(t){return new(t||e)(d.Y36(o.qu),d.Y36(u.F),d.Y36(h.M),d.Y36(p.U),d.Y36(d.sBO))},e.ɵcmp=d.Xpm({type:e,selectors:[["belender-success-step"]],inputs:{data:"data",texts:"texts",packId:"packId",requestID:"requestID",userId:"userId",flowName:"flowName",labels:"labels"},decls:3,vars:5,consts:[[3,"data","customImage","withLogo"],["class"," pt-4 pb-8 flex flex-col animated fadeIn",4,"ngIf"],["class","flex items-center gap-2 py-4 flex-col md:flex-row",3,"ngClass",4,"ngIf"],[1,"pt-4","pb-8","flex","flex-col","animated","fadeIn"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[3,"userId","packId","requestID",4,"ngIf"],[3,"userId","packId","requestID"],[1,"flex","items-center","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(d._UZ(0,"belender-widget-step-logo",0),d.YNc(1,v,5,11,"div",1),d.YNc(2,w,3,12,"div",2)),2&e&&(d.Q6J("data",t.data)("customImage",t.texts.success.customImage)("withLogo",t.getIfShowLogo()),d.xp6(1),d.Q6J("ngIf",!t.data.config.infiniteLoopInCompleted),d.xp6(1),d.Q6J("ngIf",t.data&&t.data[t.flowName]&&t.data[t.flowName].enableUrlCallBack&&!t.data[t.flowName].automaticRedirectCallBack))},dependencies:[i.mk,i.O5,m.y,f.A,g.lW,_.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var S=n(7367),C=n(5762),T=n(8593),k=n(1742),M=n(8460),I=n(7489),E=n(1572);const A=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function O(e,t){if(1&e){const e=d.EpF();d.TgZ(0,"div",9)(1,"button",10),d.NdJ("click",(function(){d.CHM(e);const t=d.oxw(2);return d.KtG(t.retry())})),d._uU(2),d.qZA()()}if(2&e){const e=d.oxw(2);d.Q6J("ngClass",d.kEZ(8,A,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),d.xp6(1),d.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),d.xp6(1),d.hij(" ",null==e.labels||null==e.labels.actions?null:e.labels.actions.retry," ")}}function L(e,t){if(1&e){const e=d.EpF();d.TgZ(0,"div",9)(1,"button",11),d.NdJ("click",(function(){d.CHM(e);const t=d.oxw(2);return d.KtG(t.newRequest())})),d._uU(2),d.qZA()()}if(2&e){const e=d.oxw(2);d.Q6J("ngClass",d.kEZ(8,A,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),d.xp6(1),d.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),d.xp6(1),d.hij(" ",null==e.labels||null==e.labels.actions?null:e.labels.actions.newRequest," ")}}function D(e,t){if(1&e&&(d.TgZ(0,"div",3)(1,"div",4),d._UZ(2,"div",5)(3,"div",6),d.ALo(4,"safeHtml"),d.qZA(),d.YNc(5,O,3,12,"div",7),d.YNc(6,L,3,12,"div",8),d.qZA()),2&e){const e=d.oxw();d.xp6(2),d.Q6J("innerHTML",e.texts.fail.title,d.oJD),d.xp6(1),d.Udp("color",e.data.styles.colors.text),d.Q6J("innerHTML",d.lcZ(4,6,e.texts.fail.description),d.oJD),d.xp6(2),d.Q6J("ngIf",e.pinUtils.REQUEST&&"failed_with_retry"==e.pinUtils.REQUEST.status_code),d.xp6(1),d.Q6J("ngIf",e.pinUtils.REQUEST&&"failed_documents_downloaded"==e.pinUtils.REQUEST.status_code)}}function P(e,t){if(1&e&&(d.TgZ(0,"div",12),d._UZ(1,"mat-progress-spinner",13),d.TgZ(2,"p",14),d._uU(3),d.qZA()()),2&e){const e=d.oxw();d.xp6(1),d.Q6J("value",0),d.xp6(1),d.Udp("color",e.data.styles.colors.text),d.xp6(1),d.Oqu(e.loading)}}let N=(()=>{class e{constructor(e,t,n,i){this.pinComponent=e,this.pinUtils=t,this.customizationStoreService=n,this.pinService=i,this.loading=null}ngOnInit(){this.resolveLabels()}resolveLabels(){this.labels||(this.labels=this.pinUtils.labels)}save(){}retry(){this.pinComponent?.showAlert(null),this.retryRequest(this.pinUtils?.REQUEST?.request_id)}newRequest(){this.pinComponent&&this.pinComponent.showAlert(null),this.pinUtils.setRequest(new C.l)}retryRequest(e){const t={request_id:this.pinUtils?.REQUEST?.request_id||e,user_id:this.customizationStoreService.USER_ID};this.loading=this.labels.loadings.resendingRequest,this.pinUtils.subscribeWS(),this.pinService.retryRequest(t).then((e=>{e&&e.data&&(this.pinUtils.setRequest(e.data),this.pinUtils.setRequestStatus(this.pinUtils.REQUEST.status_code)),this.loading=null})).catch((e=>{console.error(e),this.loading=null,this.pinComponent?.showAlert(this.labels?.alerts?.retryRequestError||this.labels?.errors?.retryRequest||"No fue posible reenviar la solicitud. Intenta nuevamente.")}))}}return e.ɵfac=function(t){return new(t||e)(d.Y36(T.n,9),d.Y36(k._),d.Y36(M.r),d.Y36(I.v))},e.ɵcmp=d.Xpm({type:e,selectors:[["belender-fail-step"]],inputs:{data:"data",texts:"texts",labels:"labels"},decls:3,vars:4,consts:[[3,"data","customImage"],["class","animated fadeIn fixed-content",4,"ngIf"],["class","loading-wrapper flex flex-col items-center animated fadeIn",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"px-2","py-4","flex","flex-col"],[1,"text-red-500","title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","flex items-center gap-2 p-4",3,"ngClass",4,"ngIf"],["class","flex items-center gap-2 p-4",3,"ngClass",4,"ngIf"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8",3,"click"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"],[1,"loading-wrapper","flex","flex-col","items-center","animated","fadeIn"],["color","accent","diameter","40","mode","indeterminate","aria-labelledby","fail-step-loading-text",1,"spinner",3,"value"],["id","fail-step-loading-text",1,"mt-6","text-center"]],template:function(e,t){1&e&&(d._UZ(0,"belender-widget-step-logo",0),d.YNc(1,D,7,8,"div",1),d.YNc(2,P,4,4,"div",2)),2&e&&(d.Q6J("data",t.data)("customImage",t.texts.fail.customImage),d.xp6(1),d.Q6J("ngIf",!t.loading),d.xp6(1),d.Q6J("ngIf",t.loading))},dependencies:[i.mk,i.O5,m.y,g.lW,E.Ou,_.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var q=n(3238),R=n(5439),Y=n.n(R),F=n(3755),U=n(3746),Z=n(2932),H=n(769),j=n(4246),z=n(5412),B=n(5895),J=n(1763),V=n(5696),Q=n(1094),W=n(7392),G=n(9549),$=n(4144);const K=["termsCheckbox"],X=["policyCheckbox"],ee=["assignmentCheckbox"];function te(e,t){if(1&e&&(d.TgZ(0,"mat-error"),d._uU(1),d.qZA()),2&e){const e=d.oxw();d.xp6(1),d.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.needDNI," ")}}function ne(e,t){if(1&e&&(d.TgZ(0,"mat-error"),d._uU(1),d.qZA()),2&e){const e=d.oxw();d.xp6(1),d.hij(" ",e.labels.warnings.invalidNieOrDni," ")}}function ie(e,t){if(1&e){const e=d.EpF();d.TgZ(0,"mat-hint")(1,"a",20),d.NdJ("click",(function(t){d.CHM(e);const n=d.oxw(2);return d.KtG(n.gotoExpirationDate(t))})),d.TgZ(2,"u"),d._uU(3),d.qZA()()()}if(2&e){const e=d.oxw(2);d.xp6(3),d.Oqu(e.labels.findExpiration)}}function se(e,t){if(1&e&&(d.TgZ(0,"mat-error"),d._uU(1),d.qZA()),2&e){const e=d.oxw(2);d.xp6(1),d.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.needExpirationDate," ")}}function re(e,t){if(1&e&&(d.TgZ(0,"mat-error"),d._uU(1),d.qZA()),2&e){const e=d.oxw(2);d.xp6(1),d.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.invalidDateFormat," ")}}function oe(e,t){if(1&e&&(d.TgZ(0,"mat-error"),d._uU(1),d.qZA()),2&e){const e=d.oxw(2);d.xp6(1),d.hij(" ",e.labels.warnings.wrongDate," ")}}function ae(e,t){if(1&e&&(d.TgZ(0,"mat-form-field",7)(1,"mat-label"),d._uU(2),d.qZA(),d._UZ(3,"input",19),d.YNc(4,ie,4,1,"mat-hint",9),d.YNc(5,se,2,1,"mat-error",9),d.YNc(6,re,2,1,"mat-error",9),d.YNc(7,oe,2,1,"mat-error",9),d.qZA()),2&e){const e=d.oxw();let t,n,i;d.Gre("",e.disabledInputs.expiration?"disabled-input":""," w-full flex-1 belender-form-field"),d.xp6(2),d.Oqu(e.labels.expiration),d.xp6(1),d.s9C("tabindex",e.disabledInputs.expiration?-1:1),d.uIk("aria-label",e.labels.expiration),d.xp6(1),d.Q6J("ngIf",e.isDni),d.xp6(1),d.Q6J("ngIf",null==(t=e.form.get("expired_date"))?null:t.hasError("required")),d.xp6(1),d.Q6J("ngIf",null==(n=e.form.get("expired_date"))?null:n.hasError("invalidFormat")),d.xp6(1),d.Q6J("ngIf",null==(i=e.form.get("expired_date"))?null:i.hasError("invalidDate"))}}function le(e,t){if(1&e&&(d.TgZ(0,"mat-error"),d._uU(1),d.qZA()),2&e){const e=d.oxw(2);d.xp6(1),d.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.needDate," ")}}function ce(e,t){if(1&e&&(d.TgZ(0,"mat-error"),d._uU(1),d.qZA()),2&e){const e=d.oxw(2);d.xp6(1),d.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.invalidDateFormat," ")}}function de(e,t){if(1&e&&(d.TgZ(0,"mat-error"),d._uU(1),d.qZA()),2&e){const e=d.oxw(2);d.xp6(1),d.hij(" ",e.labels.warnings.wrongDate," ")}}function ue(e,t){if(1&e&&(d.TgZ(0,"mat-error"),d._uU(1),d.qZA()),2&e){const e=d.oxw(2);d.xp6(1),d.hij(" ",e.labels.warnings.wrongDate," ")}}function he(e,t){if(1&e&&(d.TgZ(0,"mat-form-field",7)(1,"mat-label"),d._uU(2),d.qZA(),d._UZ(3,"input",21),d.YNc(4,le,2,1,"mat-error",9),d.YNc(5,ce,2,1,"mat-error",9),d.YNc(6,de,2,1,"mat-error",9),d.YNc(7,ue,2,1,"mat-error",9),d.qZA()),2&e){const e=d.oxw();let t,n,i,s;d.Gre("",e.disabledInputs.birthday?"disabled-input":""," w-full flex-1 belender-form-field"),d.xp6(2),d.Oqu(e.labels.birthday),d.xp6(1),d.s9C("tabindex",e.disabledInputs.birthday?-1:1),d.uIk("aria-label",e.labels.birthday),d.xp6(1),d.Q6J("ngIf",null==(t=e.form.get("expired_date"))?null:t.hasError("required")),d.xp6(1),d.Q6J("ngIf",null==(n=e.form.get("expired_date"))?null:n.hasError("invalidFormat")),d.xp6(1),d.Q6J("ngIf",null==(i=e.form.get("expired_date"))?null:i.hasError("invalidDate")),d.xp6(1),d.Q6J("ngIf",null==(s=e.form.get("expired_date"))?null:s.hasError("underAge"))}}function pe(e,t){if(1&e&&(d.TgZ(0,"mat-error"),d._uU(1),d.qZA()),2&e){const e=d.oxw(2);d.xp6(1),d.hij(" ",e.labels.warnings.wrongSupport," ")}}function me(e,t){if(1&e){const e=d.EpF();d.TgZ(0,"mat-form-field",7)(1,"mat-label"),d._uU(2),d.qZA(),d._UZ(3,"input",22),d.YNc(4,pe,2,1,"mat-error",9),d.TgZ(5,"mat-hint")(6,"a",20),d.NdJ("click",(function(t){d.CHM(e);const n=d.oxw();return d.KtG(n.gotoSupportAclaration(t))})),d.TgZ(7,"u"),d._uU(8),d.qZA()()()()}if(2&e){const e=d.oxw();let t;d.Gre("",e.disabledInputs.supportNumber?"disabled-input":""," w-full flex-1 belender-form-field"),d.xp6(2),d.Oqu(e.labels.support),d.xp6(1),d.s9C("tabindex",e.disabledInputs.supportNumber?-1:1),d.uIk("aria-label",e.labels.support),d.xp6(1),d.Q6J("ngIf",null==(t=e.form.get("support_number"))?null:t.hasError("invalidSupportNumber")),d.xp6(4),d.Oqu(e.labels.findExpiration)}}function fe(e,t){if(1&e&&(d.TgZ(0,"div",23)(1,"mat-form-field",7)(2,"mat-label"),d._uU(3),d.qZA(),d._UZ(4,"input",24),d.qZA()()),2&e){const e=d.oxw();d.xp6(1),d.Gre("",e.disabledInputs.email?"disabled-input":""," w-full flex-1 belender-form-field"),d.xp6(2),d.Oqu(e.labels.email),d.xp6(1),d.s9C("tabindex",e.disabledInputs.email?-1:1),d.s9C("placeholder",null==e.labels?null:e.labels.inputEmail),d.uIk("aria-label",e.labels.email)}}function ge(e,t){if(1&e&&(d.TgZ(0,"div",25),d._UZ(1,"mat-icon",26),d._uU(2),d.qZA()),2&e){const e=d.oxw();d.xp6(2),d.hij(" ",e.labels.warnings.haveToReadTerms," ")}}function _e(e,t){if(1&e){const e=d.EpF();d.TgZ(0,"div",27)(1,"belender-checkbox",28,29),d.NdJ("changeCheckbox",(function(t){d.CHM(e);const n=d.oxw();return d.KtG(n.setTerms(t))})),d.TgZ(3,"belender-terms-and-policy-links",30),d.NdJ("goToTerms",(function(){d.CHM(e);const t=d.oxw();return d.KtG(t.gotoTermsAndConditions())})),d.qZA()()()}if(2&e){const e=d.oxw();d.xp6(1),d.Q6J("color",e.data.styles.colors.title),d.xp6(2),d.Q6J("lang",e.lang)("flowName",e.flowName)("data",e.data)("linkType","terms")("firstSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.firstSentence)("secondSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.secondSentence)("thirdSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.thirdSentence)("policyActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.policyActionText)("termsActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.termsActionText)("customTerms",e.data[e.flowName].customTerms)}}function be(e,t){if(1&e){const e=d.EpF();d.TgZ(0,"div",27)(1,"belender-checkbox",31,32),d.NdJ("changeCheckbox",(function(t){d.CHM(e);const n=d.oxw();return d.KtG(n.setPolicy(t))})),d._UZ(3,"belender-terms-and-policy-links",33),d.qZA()()}if(2&e){const e=d.oxw();d.xp6(1),d.Q6J("color",e.data.styles.colors.title),d.xp6(2),d.Q6J("lang",e.lang)("flowName",e.flowName)("data",e.data)("linkType","policy")("policyActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.policyActionText)}}function ve(e,t){if(1&e){const e=d.EpF();d.TgZ(0,"div",27)(1,"belender-checkbox",34,35),d.NdJ("changeCheckbox",(function(t){d.CHM(e);const n=d.oxw();return d.KtG(n.setAssignment(t))})),d._UZ(3,"div",36),d.qZA()()}if(2&e){const e=d.oxw();d.xp6(1),d.Q6J("color",e.data.styles.colors.title),d.xp6(2),d.Q6J("innerHTML",(null==e.data[e.flowName]||null==e.data[e.flowName].texts?null:e.data[e.flowName].texts.dataAssignmentText)||(null==e.data[e.flowName]||null==e.data[e.flowName].config_translate?null:e.data[e.flowName].config_translate.dataAssignmentText)||(null==e.data||null==e.data.config?null:e.data.config.dataAssignmentText)||"",d.oJD)}}function ye(e,t){if(1&e&&(d.TgZ(0,"div",37),d._UZ(1,"mat-icon",38)(2,"div",39),d.qZA()),2&e){const e=d.oxw();d.xp6(2),d.Q6J("innerHTML",e.error,d.oJD)}}const we=function(e){return{background:e}};function xe(e,t){if(1&e&&(d.TgZ(0,"div",40),d._UZ(1,"mat-spinner",41),d.TgZ(2,"p"),d._uU(3),d.qZA()()),2&e){const e=d.oxw();d.Q6J("ngStyle",d.VKq(2,we,e.data.styles.colors.background)),d.xp6(3),d.Oqu(e.loading||"Cargando, espere por favor...")}}const Se=function(e){return{"dont-show-data":e}},Ce=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}},Te={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let ke=(()=>{class e{constructor(e,t,n,i,s,r,o,a,l){this.fb=e,this.utils=t,this.cd=n,this.widgetUtils=i,this.dialog=s,this.pinService=r,this.pinUtils=o,this.notis=a,this.customizationStoreService=l,this.lang="",this.editable_dates=!1,this.next=new d.vpe(null),this.esDNI=new d.vpe(null),this.goTerms=new d.vpe(null),this.deviceInfoDetails={},this.skipCreationOfRequest=!1,this.openTerms=new d.vpe,this.acceptTerms=!1,this.acceptPolicy=!1,this.step=0,this.assignment=!1,this.termsReaded=!1,this.isDni=!1,this.isNie=!1,this.disabledInputs={dni:!1,birthday:!1,supportNumber:!1,email:!1,expiration:!1},this.noValidate=!1,this.termsOpened=!1,this.loading=!1,this.error="",this.submitAttempted=!1}ngOnInit(){this.resolveLabels(),this.pinUtils.REQUEST?(this.setBaseForm(this.pinUtils.REQUEST),this.noValidate="terms_and_conditions"==this.pinUtils.REQUEST.status_code):this.setBaseForm(null),this.autoAcceptSub=this.pinUtils.autoAccept$.subscribe((()=>{setTimeout((()=>{this.sendAcceptTerms(),this.pinUtils.clearAutoAccept()}),50)}))}ngOnDestroy(){this.subscribeRequest&&this.subscribeRequest.unsubscribe(),this.autoAcceptSub&&this.autoAcceptSub.unsubscribe()}resolveLabels(){this.labels||(this.labels=this.pinUtils.labels)}sendPestana(){window.parent.open("www.google.com","_blank")}setRegex(e){if(!e)return;let t=this.widgetUtils.ValidateIDType(e);t&&t.type?(this.isDni="dni"===t.type,this.isNie="nie"===t.type):(this.isDni=!1,this.isNie=!1),this.form?.get("expired_date").setValidators([(0,Z.s)({checkFormat:!0,checkDate:!0,checkAge:!this.isDni})]),this.cd.markForCheck()}normalizeRequest(e){return{dni:e?.person_document_number??e?.dni??e?.document_number??null,birth:e?.person_birth_date??e?.birth_date??null,expiration:e?.person_document_expiration_date??null,email:e?.person_email??e?.email??e?.email_copy??null,supportNumber:e?.person_document_support??e?.document_support??null}}setBaseForm(e){let t=this.normalizeRequest(e),n=t?.dni||null,i=t.birth?Y()(t.birth).format("DD/MM/YYYY"):null,s=t.expiration?Y()(t.expiration).format("DD/MM/YYYY"):null,r=t.supportNumber||null,a=t.email||null;const l=this.data?.config??{};n&&this.setRegex(n),this.form=this.fb.group(this.isDni?l.followMail?{dni:[n,this.noValidate?[]:[o.kI.required,o.kI.maxLength(9),this.regexDNI()]],email:[a],document_type:["dni"],expired_date:[s,[(0,Z.s)({checkFormat:!0,checkDate:!0})]],support_number:[null],person_phone:[]}:{dni:[n,this.noValidate?[]:[o.kI.required,o.kI.maxLength(9),this.regexDNI()]],document_type:["dni"],expired_date:[s,[(0,Z.s)({checkFormat:!0,checkDate:!0})]],support_number:[null]}:l.followMail?{dni:[n,[o.kI.required,o.kI.maxLength(9),this.regexDNI()]],expired_date:[i],document_type:["nie"],support_number:[r],email:[a]}:{dni:[n,[o.kI.required,o.kI.maxLength(9),this.regexDNI()]],expired_date:[i],document_type:["nie"],support_number:[r]}),this.form.get("expired_date").setValidators([o.kI.required,(0,Z.s)({checkFormat:!0,checkDate:!0,checkAge:!this.isDni})]),this.form.markAsUntouched(),this.form.updateValueAndValidity(),this.requestIDFromURL&&this.disableEnableInputs(n,i,s,r,a)}forceEnableDisableInputs(e,t,n,i,s){let r=t?t.value:this.disabledInputs.birthday,o=i?i.value:this.disabledInputs.supportNumber;this.isNie&&r&&!r.value&&(o={value:!1}),this.disableEnableInputs(e?e.value:this.disabledInputs.dni,r,n?n.value:this.disabledInputs.expiration,o,s?s.value:this.disabledInputs.email)}disableEnableInputs(e,t,n,i,s){this.disabledInputs={dni:e||!1,birthday:!this.editable_dates&&(t||!1),supportNumber:i||!1,email:!!s,expiration:!this.editable_dates&&(n||!1)},this.cd.markForCheck()}regexDNI(){return e=>{const t=e.value;return t?(this.setRegex(t),this.isDni||this.isNie?null:{regexDNI:!0}):null}}setTermsCheck(e){this.checkComponent.checked=e,this.acceptTerms=e,this.termsReaded=e}nextStep(){if(!this.getFormsValid()||!this.getIfValid()||!this.getAssignmentValidation())return void(0,H.J)(this,this.cd);let e;const t=this.data?.config??{};e=this.isDni?{document_number:this.form.get("dni").value.toUpperCase(),check_legal:!0,document_expiration_date:this.utils.formatDate(this.form.get("expired_date").value)}:{document_number:this.form.get("dni").value.toUpperCase(),birth_date:this.utils.formatDate(this.form.get("expired_date").value),check_legal:!0,document_support:this.form.get("support_number").value},t.followMail&&(e.email_copy=this.form?.get("email")?.value||""),e.document_type=this.isDni?"dni":"nie",this.validateRequest(e)}gotoSupportAclaration(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(F.$,{panelClass:"fullscreen-dialog"})}gotoExpirationDate(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(U.R,{panelClass:"fullscreen-dialog"})}setTerms(e){this.acceptTerms=e,this.acceptTerms&&(this.data?.config??{}).forceChecks?this.gotoTermsAndConditions():this.acceptTerms||(this.termsReaded=!1)}setPolicy(e){this.acceptPolicy=e}setAssignment(e){this.assignment=e}getFormsValid(){if(!this.form||this.form.invalid)return!1;if((this.data?.config??{}).dontShowDataInTerms&&"terms_and_conditions"===this.pinUtils?.REQUEST?.status_code)return!0;const e=this.form.get("dni")?.value?.toString().trim();if(!e)return!1;const{type:t,valid:n}=this.widgetUtils.ValidateIDType(e)||{},i="nie"===t;if("dni"!==t&&!i||!n)return!1;const s=this.form.get("support_number")?.value?.toString().trim();return!(i&&!s)}getIfValid(){const e=this.data?.config??{};if(e.dontShowDataInTerms&&this.pinUtils.REQUEST&&this.pinUtils.REQUEST.status_code&&"terms_and_conditions"===this.pinUtils.REQUEST.status_code&&(this.acceptTerms=!0,this.acceptPolicy=!0),this.isDni||this.isNie){if(e.hideCheckLegal)return!e.showPolicyLink||this.acceptPolicy;{const t=!!e.showPolicyLink;return this.acceptTerms&&(!t||this.acceptPolicy)}}this.form.get("dni")?.setErrors({dni:!0})}getAssignmentValidation(){const e=this.data?.config??{};return!(e.forceChecks&&!e.hideCheckLegal&&!this.termsReaded)&&(!e.dataAssignmentCheck||this.assignment)}gotoTermsAndConditions(){this.openTerms.emit(!0)}setFormError(e){switch(e){case"nac":case"expiration":this.form.get("expired_date")?.setErrors({invalidDate:!0});break;case"dni":this.form.get("dni")?.setErrors({invalidDniOrNie:!0});break;case"sop":this.form.get("support_number")?.setErrors({invalidSupportNumber:!0})}}validateRequest(e){e.user_id=this.customizationStoreService.USER_ID,e.package_id=this.customizationStoreService.PACK_ID,this.loading=this.labels.loadings.validatingData,this.forceEnableDisableInputs({value:!0},{value:!0},{value:!0},{value:!0},{value:!0}),this.pinService.checkService(e).then((t=>{if(t&&t.status&&"success"==t.status)this.gotoTerms(e);else if(t.message){let n=this.pinUtils.parseErrorResponse(t.message);"no-service"==n.code?this.setNoService(e):(this.setFormError(n.code),this.loading=null),this.handleDisableInputs(n.code)}else this.setNoService(e)})).catch((t=>{if(t.message){let n=this.pinUtils.parseErrorResponse(t.message);"no-service"!=n.title?(this.showAlert(n.title,n.description),this.loading=null):(this.pinService.addSolicitud(e).then((e=>{this.pinService.setNoService({request_id:this.pinUtils.REQUEST}).then((e=>{this.pinUtils.setRequestStatus("no_service"),this.loading=null})).catch((e=>{this.pinUtils.setRequestStatus("no_service"),this.loading=null}))})),this.loading=null,this.cd.markForCheck()),console.log("handle code: ",n.code),this.handleDisableInputs(n.code)}else this.showAlert(this.labels?.warnings?.undefinedError,t),this.loading=null,this.cd.markForCheck()}))}gotoTerms(e){e.user_id=this.customizationStoreService.USER_ID,e.package_id=this.customizationStoreService.PACK_ID,this.acceptCirbe&&(e.add_cirbe=!0),this.pinUtils.REQUEST.request_id&&(e.request_id=this.pinUtils.REQUEST.request_id),this.loading=this.labels.loadings.sendingData,this.skipCreationOfRequest=this.pinUtils.REQUEST&&this.pinUtils.REQUEST.request_id&&this.pinUtils.REQUEST.status_code&&"prerequest"!=this.pinUtils.REQUEST.status_code,this.skipCreationOfRequest?(this.sendAcceptTerms(),this.pinUtils.subscribeWS()):this.pinService.addSolicitud(e).then((t=>{t&&t.status&&"error"==t.status?t.message&&(this.pinUtils.setRequest(e),400==t.code&&"Does not have Pin service"==t.message?this.pinService.setNoService({request_id:this.pinUtils.REQUEST.request_id}).then((e=>{this.pinUtils.setRequestStatus("no_service"),this.loading=null})).catch((e=>{this.pinUtils.setRequestStatus("no_service"),this.loading=null})):400==t.code&&"Incorrect support number"==t.message?(this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongSupport),this.pinUtils.setRequestStatus("form")):400==t.code&&"Incorrect date"==t.message?(console.warn("entro aquiiii"),this.form.get("expired_date")?.setErrors({invalidDate:!0}),this.pinUtils.setRequestStatus("form")):(this.pinUtils.setRequestStatus("form"),this.showAlert(this.labels?.warnings?.error,t.message))):t&&t.status&&"success"==t.status?(this.pinUtils.setRequest(t.data),this.pinUtils.subscribeWS(),this.sendAcceptTerms()):this.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+t)})).catch((e=>{e&&e.errorMessage&&this.showAlert(this.labels.warnings.error,e.errorMessage)}))}setNoService(e){this.loading=this.labels.loadings.validatingData,e.user_id=this.customizationStoreService.USER_ID,e.package_id=this.customizationStoreService.PACK_ID,this.pinUtils.REQUEST.request_id&&(e.request_id=this.pinUtils.REQUEST.request_id),this.pinService.addSolicitud(e).then((e=>{this.pinService.setNoService({request_id:this.pinUtils.REQUEST.request_id}).then((e=>{this.pinUtils.setRequestStatus("no_service"),this.loading=null,this.cd.markForCheck()})).catch((e=>{this.pinUtils.setRequestStatus("no_service"),this.loading=null,this.cd.markForCheck()}))}))}showAlert(e,t){this.error=`<div class="flex flex-col w-full items-start gap-0 pl-2"><strong class="text-md" >${e}</strong><small>${t}</small></div>`}sendAcceptTerms(e=!0){let t={user_id:this.customizationStoreService.USER_ID,request_id:this.pinUtils.REQUEST.request_id,terms_and_conditions:!0,opening:this.termsOpened?1:0};Object.keys(this.deviceInfoDetails).length>0&&(t={...t,ip:this.deviceInfoDetails.ip,device:this.deviceInfoDetails.device,os:`${this.deviceInfoDetails.os} ${this.deviceInfoDetails.os_version}`,resolution:this.deviceInfoDetails.screen}),e&&(this.loading=this.labels.loadings.validatingData),this.pinService.acceptTerms(t).then((e=>{e.status&&"error"==e.status?e.message&&"You have a request in progress"==e.message?location.pathname.indexOf("widget-boxed")>-1?location.assign(e.response.widget_url_boxed):location.assign(e.response.widget_url):e.message&&"Invalid request status: stand_by"==e.message?this.pinUtils.setRequestStatus("stand_by"):this.showAlert(this.labels?.warnings?.error,e.message?e.message:e):e&&"success"==e.status&&(this.pinUtils.subscribeWS(),this.pinUtils.setRequest(e.data),this.loading=null,this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert(this.labels?.warnings?.error,e.error),this.loading=null}))}handleDisableInputs(e){!e||setTimeout((()=>{"venc"===e&&this.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1},{value:!1}),"sop"===e&&this.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1},{value:!1}),"nac"===e&&this.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1},{value:!1}),this.cd.markForCheck()}),1e3)}}return e.ɵfac=function(t){return new(t||e)(d.Y36(o.qu),d.Y36(u.F),d.Y36(d.sBO),d.Y36(j.t),d.Y36(z.uw),d.Y36(I.v),d.Y36(k._),d.Y36(B.T),d.Y36(M.r))},e.ɵcmp=d.Xpm({type:e,selectors:[["belender-form-step"]],viewQuery:function(e,t){if(1&e&&(d.Gf(K,5),d.Gf(X,5),d.Gf(ee,5)),2&e){let e;d.iGM(e=d.CRH())&&(t.checkComponent=e.first),d.iGM(e=d.CRH())&&(t.policyCheckComponent=e.first),d.iGM(e=d.CRH())&&(t.assignmentCheckComponent=e.first)}},inputs:{flowName:"flowName",data:"data",texts:"texts",acceptCirbe:"acceptCirbe",requestIDFromURL:"requestIDFromURL",labels:"labels",lang:"lang",editable_dates:"editable_dates",deviceInfoDetails:"deviceInfoDetails",skipCreationOfRequest:"skipCreationOfRequest"},outputs:{next:"nextStep",esDNI:"isDni",goTerms:"goToTerms",openTerms:"openTerms"},features:[d._Bn([{provide:q.sG,useValue:Te},{provide:d.soG,useValue:"es-ES"}])],decls:28,vars:46,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content","px-2","relative",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4","custom-html",3,"innerHTML"],[3,"ngClass"],[1,"mb-3","pt-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline"],["id","dniInput","formControlName","dni","maxlength","9","matInput","",3,"tabindex"],[4,"ngIf"],["appearance","outline",3,"class",4,"ngIf"],["class","w-full",4,"ngIf"],[1,"mb-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["class","px-2 flex items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500",4,"ngIf"],["class","flex justify-start items-center w-full flex-100",4,"ngIf"],["class","pl-3 w-full pr-4 flex items-center gap-2 py-2 rounded-md mt-3 bg-orange-500/10 text-orange-600",4,"ngIf"],[1,"flex","items-center","gap-2","p-4","flex-col","md:flex-row",3,"ngClass"],["id","sendBtn","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"],["class","loading-overlay flex flex-col gap-3 items-center justify-center ",3,"ngStyle",4,"ngIf"],["id","dniExpireInput","required","","formControlName","expired_date","type","text","mask","00/00/0000","matInput","",3,"tabindex"],["target","_blank",1,"text-sm","hover:text-blue-500","cursor-pointer",3,"click"],["id","dniExpireInput","required","","formControlName","expired_date","type","text","matInput","","mask","d0/M0/0000",3,"tabindex"],["id","supportNumberInput","maxlength","9","minlength","6","required","","formControlName","support_number","matInput","",3,"tabindex"],[1,"w-full"],["id","emailInput","formControlName","email","required","","type","email","matInput","",3,"tabindex","placeholder"],[1,"px-2","flex","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"],["svgIcon","mat:warning",1,"text-xs","w-4","h-4"],[1,"flex","justify-start","items-center","w-full","flex-100"],["id","termsCheckbox",3,"color","changeCheckbox"],["termsCheckbox",""],[3,"lang","flowName","data","linkType","firstSentence","secondSentence","thirdSentence","policyActionText","termsActionText","customTerms","goToTerms"],["id","policyCheckbox",3,"color","changeCheckbox"],["policyCheckbox",""],[3,"lang","flowName","data","linkType","policyActionText"],[3,"color","changeCheckbox"],["assignmentCheckbox",""],[1,"custom-html",3,"innerHTML"],[1,"pl-3","w-full","pr-4","flex","items-center","gap-2","py-2","rounded-md","mt-3","bg-orange-500/10","text-orange-600"],["svgIcon","mat:warning"],[1,"font-bold",3,"innerHTML"],[1,"loading-overlay","flex","flex-col","gap-3","items-center","justify-center",3,"ngStyle"],["diameter","30"]],template:function(e,t){if(1&e&&(d._UZ(0,"belender-widget-step-logo",0),d.TgZ(1,"form",1)(2,"div",2),d._UZ(3,"div",3)(4,"div",4),d.ALo(5,"safeHtml"),d.qZA(),d.TgZ(6,"div",5)(7,"div",6)(8,"mat-form-field",7)(9,"mat-label"),d._uU(10),d.qZA(),d._UZ(11,"input",8),d.YNc(12,te,2,1,"mat-error",9),d.YNc(13,ne,2,1,"mat-error",9),d.qZA(),d.YNc(14,ae,8,10,"mat-form-field",10),d.YNc(15,he,8,10,"mat-form-field",10),d.YNc(16,me,9,8,"mat-form-field",10),d.YNc(17,fe,5,7,"div",11),d.qZA()(),d.TgZ(18,"div",12),d.YNc(19,ge,3,1,"div",13),d.YNc(20,_e,4,11,"div",14),d.YNc(21,be,4,6,"div",14),d.YNc(22,ve,4,2,"div",14),d.YNc(23,ye,3,1,"div",15),d.qZA(),d.TgZ(24,"div",16)(25,"button",17),d.NdJ("click",(function(){return t.nextStep()})),d._uU(26),d.qZA()(),d.YNc(27,xe,4,4,"div",18),d.qZA()),2&e){let e,n;d.Q6J("data",t.data)("customImage",t.texts.form.customImage),d.xp6(1),d.Q6J("formGroup",t.form),d.xp6(2),d.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),d.Q6J("innerHTML",t.texts.form.title,d.oJD),d.xp6(1),d.Udp("color",t.data.styles.colors.text),d.Q6J("innerHTML",d.lcZ(5,38,t.texts.form.description||""),d.oJD),d.xp6(2),d.Q6J("ngClass",d.VKq(40,Se,t.data.config.dontShowDataInTerms&&t.pinUtils.REQUEST.request_id&&t.pinUtils.REQUEST.status_code&&"terms_and_conditions"===t.pinUtils.REQUEST.status_code)),d.xp6(2),d.Gre("",t.disabledInputs.dni?"disabled-input":""," w-full flex-1 belender-form-field"),d.xp6(2),d.Oqu(t.isDni?t.labels.dni:t.isNie?t.labels.nie:t.labels.nieOrDni),d.xp6(1),d.s9C("tabindex",t.disabledInputs.dni?-1:1),d.uIk("aria-label",t.isDni?t.labels.dni:t.isNie?t.labels.nie:t.labels.nieOrDni),d.xp6(1),d.Q6J("ngIf",null==(e=t.form.get("dni"))?null:e.hasError("required")),d.xp6(1),d.Q6J("ngIf",!(null!=(n=t.form.get("dni"))&&n.hasError("required"))&&(!t.isNie&&!t.isDni||(null==(n=t.form.get("dni"))?null:n.hasError("invalidDniOrNie")))),d.xp6(1),d.Q6J("ngIf",t.isDni),d.xp6(1),d.Q6J("ngIf",t.isNie),d.xp6(1),d.Q6J("ngIf",t.isNie),d.xp6(1),d.Q6J("ngIf",(null==t.data||null==t.data.config?null:t.data.config.followMail)&&(t.isDni||t.isNie)),d.xp6(2),d.Q6J("ngIf",t.submitAttempted&&!t.data.config.hideCheckLegal&&!t.acceptTerms),d.xp6(1),d.Q6J("ngIf",!t.data.config.hideCheckLegal),d.xp6(1),d.Q6J("ngIf",null==t.data||null==t.data.config?null:t.data.config.showPolicyLink),d.xp6(1),d.Q6J("ngIf",null==t.data?null:t.data.config.dataAssignmentCheck),d.xp6(1),d.Q6J("ngIf",t.error),d.xp6(1),d.Q6J("ngClass",d.kEZ(42,Ce,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),d.xp6(1),d.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),d.xp6(1),d.hij(" ",t.labels.actions.continue," "),d.xp6(1),d.Q6J("ngIf",t.loading)}},dependencies:[i.mk,i.O5,i.PC,o._Y,o.Fj,o.JJ,o.JL,o.Q7,o.wO,o.nD,o.sg,o.u,J.b,m.y,V.T,Q.Z6,W.Hw,g.lW,G.TO,G.KE,G.bx,G.hX,$.Nt,E.Ou,_.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.dont-show-data[_ngcontent-%COMP%]{opacity:0!important;padding:0!important;overflow:hidden!important;height:0px!important;margin:0!important}.hiden-input[_ngcontent-%COMP%]{height:0!important;max-height:0px!important;overflow:hidden!important;opacity:0!important}.loading-overlay[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;top:0;z-index:999}"]}),e})();var Me=n(8594),Ie=n(6e3);const Ee=[{path:":idUser",component:T.n},{path:":idUser/:packID",component:T.n}];let Ae=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=d.oAB({type:e}),e.ɵinj=d.cJS({imports:[Me.Bz.forChild(Ee),Me.Bz,Ie.d8]}),e})(),Oe=(()=>{class e{constructor(){}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=d.Xpm({type:e,selectors:[["belender-no-service-step"]],inputs:{data:"data",texts:"texts"},decls:6,vars:12,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&(d._UZ(0,"belender-widget-step-logo",0),d.TgZ(1,"form",1)(2,"div",2),d._UZ(3,"div",3)(4,"div",4),d.ALo(5,"safeHtml"),d.qZA()()),2&e&&(d.Q6J("data",t.data)("customImage",t.texts.noService.customImage),d.xp6(3),d.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),d.Q6J("innerHTML",t.texts.noService.title,d.oJD),d.xp6(1),d.Udp("color",t.data.styles.colors.text),d.Q6J("innerHTML",d.lcZ(5,10,t.texts.noService.description),d.oJD))},dependencies:[o._Y,o.JL,o.F,m.y,_.z]}),e})();const Le=function(e){return{background:e}};function De(e,t){if(1&e&&(d.TgZ(0,"div",9),d._UZ(1,"mat-spinner",10),d.TgZ(2,"p"),d._uU(3),d.qZA()()),2&e){const e=d.oxw();d.Q6J("ngStyle",d.VKq(2,Le,e.data.styles.colors.background)),d.xp6(3),d.Oqu(e.loading||"Cargando, espere por favor...")}}const Pe=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Ne=(()=>{class e{constructor(e,t,n,i,s){this.pinComponent=e,this.utils=t,this.pinUtils=n,this.customizationStoreService=i,this.pinService=s,this.loading=null}ngOnInit(){this.resolveLabels()}resolveLabels(){this.labels||(this.labels=this.pinUtils.labels)}save(){}retry(){this.pinComponent?.showAlert(null),this.retryRequest(this.pinUtils.REQUEST.request_id)}getTextStatus(){switch(this.pinUtils.REQUEST.status_code){case"abandoned_after_waiting_otp_seguridad_social":return this.labels.abandoned.afterWaitingOtpSS;case"abandoned_after_invalid_otp_seguridad_social":return this.labels.abandoned.afterInvalidOtpSS;case"abandoned_after_invalid_otp_aeat":return this.labels.abandoned.afterInvalidOtpAEAT;case"abandoned_after_waiting_otp_aeat":return this.labels.abandoned.afterWaitingOtpAEAT;default:return this.pinUtils.REQUEST.status_message||this.pinUtils.REQUEST.status_code}}retryRequest(e){let t={request_id:this.pinUtils?.REQUEST?.request_id||e,user_id:this.customizationStoreService.USER_ID};this.loading=this.labels.loadings.resendingRequest,this.pinUtils.subscribeWS(),this.pinService.retryRequest(t).then((e=>{e&&e.data&&(this.pinUtils.setRequest(e.data),this.pinUtils.setRequestStatus(this.pinUtils.REQUEST.status_code)),this.loading=null})).catch((e=>{console.error(e),this.loading=null}))}}return e.ɵfac=function(t){return new(t||e)(d.Y36(T.n,9),d.Y36(u.F),d.Y36(k._),d.Y36(M.r),d.Y36(I.v))},e.ɵcmp=d.Xpm({type:e,selectors:[["belender-abandoned-step"]],inputs:{data:"data",labels:"labels",texts:"texts"},decls:12,vars:26,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content","relative"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"p-1","px-4","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm","mb-2","mt-6"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"],["class","loading-overlay flex flex-col gap-3 items-center justify-center ",3,"ngStyle",4,"ngIf"],[1,"loading-overlay","flex","flex-col","gap-3","items-center","justify-center",3,"ngStyle"],["diameter","30"]],template:function(e,t){1&e&&(d._UZ(0,"belender-widget-step-logo",0),d.TgZ(1,"div",1)(2,"div",2),d._UZ(3,"div",3)(4,"div",4),d.ALo(5,"safeHtml"),d.TgZ(6,"div",5),d._uU(7),d.qZA()(),d.TgZ(8,"div",6)(9,"button",7),d.NdJ("click",(function(){return t.retry()})),d._uU(10),d.qZA()(),d.YNc(11,De,4,4,"div",8),d.qZA()),2&e&&(d.Q6J("data",t.data)("customImage",t.texts.abandoned.customImage),d.xp6(3),d.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),d.Q6J("innerHTML",t.texts.abandoned.title,d.oJD),d.xp6(1),d.Udp("color",t.data.styles.colors.text),d.Q6J("innerHTML",d.lcZ(5,20,t.texts.abandoned.description),d.oJD),d.xp6(3),d.hij(" ",t.getTextStatus()," "),d.xp6(1),d.Q6J("ngClass",d.kEZ(22,Pe,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),d.xp6(1),d.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),d.xp6(1),d.hij(" ",null==t.labels.actions?null:t.labels.actions.retry," "),d.xp6(1),d.Q6J("ngIf",t.loading))},dependencies:[i.mk,i.O5,i.PC,m.y,g.lW,E.Ou,_.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-overlay[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;top:0;z-index:999}"]}),e})();var qe=n(6981),Re=n(5145);const Ye=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Fe=(()=>{class e{constructor(e,t){this.utils=e,this.pinUtils=t}ngOnInit(){this.resolveLabels()}resolveLabels(){this.labels||(this.labels=this.pinUtils.labels)}newRequest(){this.pinUtils.setRequestStatus("created")}gotoRequest(){location.assign(this.pinUtils.REQUEST.widget_url_boxed)}getStatus(){let e=Re.Z.find((e=>e.text==this.pinUtils.REQUEST.status_code));return e?e.label:this.labels.unknownState}}return e.ɵfac=function(t){return new(t||e)(d.Y36(u.F),d.Y36(k._))},e.ɵcmp=d.Xpm({type:e,selectors:[["belender-duplicated-request-step"]],inputs:{data:"data",texts:"texts",labels:"labels"},decls:15,vars:25,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"flex","gap-2","justify-start","items-center","py-2"],[1,"w-fit","p-1","px-2","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8",3,"click"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(d.TgZ(0,"div",0)(1,"div",1)(2,"div",2),d._uU(3),d.qZA(),d.TgZ(4,"div",3),d._uU(5),d.qZA(),d.TgZ(6,"div",4),d._uU(7),d.TgZ(8,"div",5),d._uU(9),d.qZA()()(),d.TgZ(10,"div",6)(11,"button",7),d.NdJ("click",(function(){return t.newRequest()})),d._uU(12),d.qZA(),d.TgZ(13,"button",8),d.NdJ("click",(function(){return t.gotoRequest()})),d._uU(14),d.qZA()()()),2&e&&(d.xp6(2),d.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),d.xp6(1),d.hij(" ",t.labels.warnings.duplicatedRequest," "),d.xp6(1),d.Udp("color",t.data.styles.colors.text),d.xp6(1),d.hij(" ",t.labels.warnings.alreadyHaveRequest," "),d.xp6(2),d.hij(" ",t.labels.warnings.currentRequestStatus," "),d.xp6(2),d.hij(" ",t.getStatus()," "),d.xp6(1),d.Q6J("ngClass",d.kEZ(21,Ye,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),d.xp6(1),d.Udp("border-radius",t.data.styles.btnRound+"px"),d.xp6(1),d.hij(" ",t.labels.actions.newRequest," "),d.xp6(1),d.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),d.xp6(1),d.hij(" ",t.labels.actions.gotoCurrentRequest," "))},dependencies:[i.mk,g.lW],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Ue=n(1129),Ze=n(9476),He=n(3295);let je=(()=>{class e{constructor(){}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=d.Xpm({type:e,selectors:[["belender-standby-step"]],inputs:{data:"data",texts:"texts"},decls:5,vars:10,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&(d.TgZ(0,"form",0)(1,"div",1),d._UZ(2,"div",2)(3,"div",3),d.ALo(4,"safeHtml"),d.qZA()()),2&e&&(d.xp6(2),d.Udp("color",t.data.styles.colors.title)("font-size",t.texts.standby?t.texts.standby.titleSize+"px":"20px"),d.Q6J("innerHTML",t.texts.standby?t.texts.standby.title:"Solicitud en Stand By",d.oJD),d.xp6(1),d.Udp("color",t.data.styles.colors.text),d.Q6J("innerHTML",t.texts.standby?t.texts.standby.description:d.lcZ(4,8,"Descripcion del estado Stand By"),d.oJD))},dependencies:[o._Y,o.JL,o.F,_.z]}),e})();var ze=n(1145);const Be=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Je=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new d.vpe(null)}ngOnInit(){this.form=this.fb.group({document_expiration_date:[null,[o.kI.required]]})}next(){this.nextStep.emit(this.form.get("document_expiration_date").value)}}return e.ɵfac=function(t){return new(t||e)(d.Y36(o.QS),d.Y36(u.F))},e.ɵcmp=d.Xpm({type:e,selectors:[["belender-error-expiration-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:17,vars:24,consts:[[3,"data"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["type","date","placeholder","Ej: 22/03/1990","required","","formControlName","document_expiration_date","matInput",""],[1,"flex","items-center","justify-end","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(d._UZ(0,"belender-widget-step-logo",0),d.TgZ(1,"div",1)(2,"div",2)(3,"div",3),d._uU(4),d.qZA(),d.TgZ(5,"div",4),d._uU(6),d.qZA(),d.TgZ(7,"form",5)(8,"mat-form-field",6)(9,"mat-label"),d._uU(10),d.qZA(),d._UZ(11,"input",7),d.TgZ(12,"mat-hint"),d._uU(13,"DD/MM/YYYY"),d.qZA()()()(),d.TgZ(14,"div",8)(15,"button",9),d.NdJ("click",(function(){return t.next()})),d._uU(16),d.qZA()()()),2&e&&(d.Q6J("data",t.data),d.xp6(3),d.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),d.xp6(1),d.hij(" ",null==t.labels||null==t.labels.warnings?null:t.labels.warnings.wrongExpiration," "),d.xp6(1),d.Udp("color",t.data.styles.colors.text),d.xp6(1),d.hij(" ",null==t.labels||null==t.labels.warnings?null:t.labels.warnings.inputExpiration," "),d.xp6(1),d.Q6J("formGroup",t.form),d.xp6(3),d.Oqu(null==t.labels?null:t.labels.expiration),d.xp6(4),d.Q6J("ngClass",d.kEZ(20,Be,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),d.xp6(1),d.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),d.Q6J("disabled",t.form.invalid),d.xp6(1),d.hij(" ",null==t.labels||null==t.labels.actions?null:t.labels.actions.send," "))},dependencies:[i.mk,o._Y,o.Fj,o.JJ,o.JL,o.Q7,o.sg,o.u,m.y,g.lW,G.KE,G.bx,G.hX,$.Nt],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const Ve=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Qe=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new d.vpe(null)}ngOnInit(){this.form=this.fb.group({support_number:[null,[o.kI.required]]})}next(){this.nextStep.emit(this.form.get("support_number").value)}}return e.ɵfac=function(t){return new(t||e)(d.Y36(o.QS),d.Y36(u.F))},e.ɵcmp=d.Xpm({type:e,selectors:[["belender-error-support-number-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:15,vars:24,consts:[[3,"data"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["type","number","placeholder","Ej: 1233443","required","","formControlName","support_number","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(d._UZ(0,"belender-widget-step-logo",0),d.TgZ(1,"div",1)(2,"div",2)(3,"div",3),d._uU(4),d.qZA(),d.TgZ(5,"div",4),d._uU(6),d.qZA(),d.TgZ(7,"form",5)(8,"mat-form-field",6)(9,"mat-label"),d._uU(10),d.qZA(),d._UZ(11,"input",7),d.qZA()()(),d.TgZ(12,"div",8)(13,"button",9),d.NdJ("click",(function(){return t.next()})),d._uU(14),d.qZA()()()),2&e&&(d.Q6J("data",t.data),d.xp6(3),d.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),d.xp6(1),d.hij(" ",null==t.labels||null==t.labels.warnings?null:t.labels.warnings.wrongSupport," "),d.xp6(1),d.Udp("color",t.data.styles.colors.text),d.xp6(1),d.hij(" ",null==t.labels||null==t.labels.warnings?null:t.labels.warnings.inputSupport," "),d.xp6(1),d.Q6J("formGroup",t.form),d.xp6(3),d.Oqu(null==t.labels||null==t.labels.warnings?null:t.labels.warnings.support),d.xp6(2),d.Q6J("ngClass",d.kEZ(20,Ve,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),d.xp6(1),d.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),d.Q6J("disabled",t.form.invalid),d.xp6(1),d.hij(" ",null==t.labels||null==t.labels.actions?null:t.labels.actions.send," "))},dependencies:[i.mk,o._Y,o.Fj,o.wV,o.JJ,o.JL,o.Q7,o.sg,o.u,m.y,g.lW,G.KE,G.hX,$.Nt],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const We=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Ge=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new d.vpe(null)}ngOnInit(){this.form=this.fb.group({birth_date:[null,[o.kI.required]]})}next(){this.nextStep.emit(this.form.get("birth_date").value)}}return e.ɵfac=function(t){return new(t||e)(d.Y36(o.QS),d.Y36(u.F))},e.ɵcmp=d.Xpm({type:e,selectors:[["belender-error-birthday-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:17,vars:24,consts:[[3,"data"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","belender-form-field"],["type","text","required","","formControlName","birth_date","matInput","","mask","d0/M0/0000"],[1,"flex","items-center","justify-end","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(d._UZ(0,"belender-widget-step-logo",0),d.TgZ(1,"div",1)(2,"div",2)(3,"div",3),d._uU(4),d.qZA(),d.TgZ(5,"div",4),d._uU(6),d.qZA(),d.TgZ(7,"form",5)(8,"mat-form-field",6)(9,"mat-label"),d._uU(10),d.qZA(),d._UZ(11,"input",7),d.TgZ(12,"mat-hint"),d._uU(13,"DD/MM/YYYY"),d.qZA()()()(),d.TgZ(14,"div",8)(15,"button",9),d.NdJ("click",(function(){return t.next()})),d._uU(16),d.qZA()()()),2&e&&(d.Q6J("data",t.data),d.xp6(3),d.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),d.xp6(1),d.hij(" ",t.labels.warnings.wrongBirthday," "),d.xp6(1),d.Udp("color",t.data.styles.colors.text),d.xp6(1),d.hij(" ",t.labels.warnings.inputBirthDay," "),d.xp6(1),d.Q6J("formGroup",t.form),d.xp6(3),d.hij(" ",t.labels.warnings.birthday," "),d.xp6(4),d.Q6J("ngClass",d.kEZ(20,We,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),d.xp6(1),d.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),d.Q6J("disabled",t.form.invalid),d.xp6(1),d.hij(" ",t.labels.actions.send," "))},dependencies:[i.mk,o._Y,o.Fj,o.JJ,o.JL,o.Q7,o.sg,o.u,m.y,Q.Z6,g.lW,G.KE,G.bx,G.hX,$.Nt],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var $e=n(3300),Ke=n(865),Xe=n(3033),et=n(5028),tt=n(6830),nt=n(4302),it=n(9112),st=n(9382);let rt=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=d.oAB({type:e}),e.ɵinj=d.cJS({providers:[I.v,l.o,S.w,c.t,B.T,j.t,k._,{provide:q.Ad,useValue:"es-ES"}],imports:[Ae,i.ez,s.G,r.J,o.u5,o.UX,a.a,qe.x,Ue.n,Ze.F,He.g,ze.j,$e.C,Ke.q,Xe.d,et.q]}),e})();d.B6R(T.n,[i.O5,tt.L,nt.q,it.y,st.i,g.lW,E.Ou,x,N,ke,Oe,Ne,Fe,je,Je,Qe,Ge],[_.z])},2254:(e,t,n)=>{n.d(t,{p:()=>c});var i=n(1135),s=n(5762),r=n(2340),o=n(182),a=n(4650),l=n(8460);let c=(()=>{class e{constructor(e){this.customizationStoreService=e,this.currentHeight=0,this.socket=null,this.socketOpened=!0,this._request=new i.X({...new s.l,status_code:"created"}),this._request_status=new i.X(null),this.request$=this._request.asObservable(),this.request_status$=this._request_status.asObservable(),this.requestIDSubject=new i.X(""),this.requestID$=this.requestIDSubject.asObservable(),this.loadingSubject=new i.X(!1),this.loading$=this.loadingSubject.asObservable()}setLoading(e){this.loadingSubject.next(e)}updateRequestID(e){this.requestIDSubject.next(e),this.REQUEST_ID=e}setGlobalVariables(){this.REQUEST=this._request.value,this.REQUEST_STATUS=this.REQUEST.status_code,this._request_status.next(this.REQUEST_STATUS)}setRequest(e){this._request.next({...e}),this.setGlobalVariables()}patch(e){this._request.next({...this._request.value,...e}),this.setGlobalVariables()}setRequestStatus(e){this._request.next({...this._request.value,status_code:e}),this.setGlobalVariables()}setSubscriptionOfRequest(){const e=this;if(this.socket)return;let t="wss://notifications.dev.belender.net";"qa"==r.N.env&&(t="wss://notifications.qa.belender.net"),"pro"==r.N.env&&(t="wss://notifications.belender.net"),r.N.notificationsBaseUrl&&(t=r.N.notificationsBaseUrl),this.socket=new WebSocket(`${t}?requests_id=${this.REQUEST_ID}&user_id=${this.customizationStoreService.USER_ID}`),this.socket.onopen=function(e){console.log("Conexión establecida")},this.socket.onmessage=function(t){let n=JSON.parse(t.data);e.handlePusherNotification(n)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e),console.error(e)},this.socket.onclose=function(t){console.log("Conexión cerrada:",t),e.socketOpened=!1}}disconnectWebsocket(){console.error("disconnect ws"),this.socket&&this.socket.close(),this.socket=null}handlePusherNotification(e){if(!e||o.t.shouldIgnoreWebhookStatus(e.status_code)||(e&&e.widget_url&&(this.widgetUrl=e.widget_url),e&&e.widget_url_boxed&&(this.widgetUrlBoxed=e.widget_url_boxed),this.sendMessageToParent({type:"websocket",data:e}),console.warn("message from ws: ",e),!e.status_code))return;const t=e.status_code;if("consent_process_completed"===t&&this.disconnectWebsocket(),t.startsWith("abandoned")||t.startsWith("failed"))return this.disconnectWebsocket(),void this.setRequestStatus(t);this.patch({status_code:t})}sendMessageToParent(e){if(e&&e.type&&"widgetHeight"===e.type){if(e.data===this.currentHeight)return;this.currentHeight=e.data}console.log("Message to parent:",e),window.top.postMessage(e,"*")}}return e.ɵfac=function(t){return new(t||e)(a.LFG(l.r))},e.ɵprov=a.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},8135:(e,t,n)=>{n.d(t,{T:()=>re});var i=n(5861),s=n(7582),r=n(9549),o=n(9933),a=n(5762),l=n(8259),c=n(2340),d=n(667);const u="error-data",h={created:"form",form:"form",terms_and_conditions:"form",waiting_terms_and_conditions:"form",prerequest:"form",waiting_password:"form",waiting_otp_seguridad_social:"otp",waiting_login_seguridad_social:"otp",invalid_otp_seguridad_social:"otp",abandoned_after_bad_phone:"abandoned",abandoned_after_invalid_otp_seguridad_social:"abandoned",abandoned_after_terms_and_conditions:"abandoned",abandoned_after_waiting_otp_seguridad_social:"abandoned",all_documents_downloaded:"success",partial_documents_downloaded:"success",consent_process_completed:"success",partial_documents_downloaded_and_deleted:"success",all_documents_downloaded_and_deleted:"success",failed_documents_downloaded:"success",failed_with_retry:"failed",failed_without_retry:"failed",consent_process_canceled:"loading",no_service:"no-service",no_sms_service:"no-service",no_clave_pin_service:"no-service",stand_by:"loading","no-phone":"loading",no_phone:"loading","no-more-phone":"no-phone",no_more_phone:"no-phone",bad_phone:"bad-phone",error_expiration_date:"error-expiration-date",error_birth_date:"error-birth-date",error_support_number:"error-support-number",duplicated:"duplicated"};var p=n(6305),m=n(1931),f=n(182),g=n(4650),_=n(8594),b=n(8467),v=n(5601),y=n(7367),w=n(8460),x=n(5895),S=n(7489),C=n(9045),T=n(5412),k=n(7308),M=n(2254),I=n(3687);const E=["formStep"],A=["otpStep"];function O(e,t){1&e&&(g.TgZ(0,"div",8),g._UZ(1,"mat-progress-spinner",9),g.qZA()),2&e&&(g.xp6(1),g.Q6J("value",0))}function L(e,t){if(1&e){const e=g.EpF();g.TgZ(0,"belender-intro-step",25),g.NdJ("gotoFlow",(function(){g.CHM(e);const t=g.oxw(3);return g.KtG(t.goFlow())}))("gotoManual",(function(){g.CHM(e);const t=g.oxw(3);return g.KtG(t.gotoManual())})),g.qZA()}if(2&e){const e=g.oxw(3);g.Q6J("data",e.data)("flowName",e.flowName)}}function D(e,t){if(1&e&&g._UZ(0,"belender-manual-step",26),2&e){const e=g.oxw(3);g.Q6J("data",e.data)("flowName",e.flowName)("packId",e.packId)("userId",e.userId)("labels",e.labels)}}function P(e,t){if(1&e){const e=g.EpF();g.TgZ(0,"belender-form-step",27,28),g.NdJ("goToTerms",(function(){g.CHM(e);const t=g.oxw(3);return g.KtG(t.gotoTermsAndConditions())})),g.qZA()}if(2&e){const e=g.oxw(3);g.Q6J("requestIDFromURL",e.requestIDFromURL)("lang",e.currentLang)("requestID",e.requestID)("flowName",e.flowName)("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("pinMode",e.pinMode)("editable_dates",e.editable_dates)("skipCreationOfRequest",e.skipCreationOfRequest)}}function N(e,t){if(1&e&&g._UZ(0,"belender-error-form-step",29),2&e){const e=g.oxw(3);g.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("flowName",e.flowName)("requestID",e.requestID)}}function q(e,t){if(1&e&&g._UZ(0,"belender-error-birthday-step",30),2&e){const e=g.oxw(3);g.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function R(e,t){if(1&e&&g._UZ(0,"belender-error-expiration-step",30),2&e){const e=g.oxw(3);g.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function Y(e,t){if(1&e&&g._UZ(0,"belender-error-support-number-step",30),2&e){const e=g.oxw(3);g.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function F(e,t){if(1&e&&g._UZ(0,"belender-abandoned-step",31),2&e){const e=g.oxw(3);g.Q6J("requestID",e.requestID)("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("flowType",e.flowName)}}function U(e,t){if(1&e&&g._UZ(0,"belender-shared-otp-step",32,33),2&e){const e=g.oxw(3);g.Q6J("otpType","otpSS")("requestID",e.requestID)("testMode",e.testMode)("labels",e.labels)("logoCustom",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.otpSS?null:e.data[e.flowName].texts.otpSS.customImage)("flowType",e.flowName)("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("minLength",6)}}function Z(e,t){if(1&e&&g._UZ(0,"belender-success-step",34),2&e){const e=g.oxw(3);g.Q6J("data",e.data)("labels",e.labels)("packId",e.packId)("flowName",e.flowName)("userId",e.userId)("requestID",e.requestID)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function H(e,t){if(1&e){const e=g.EpF();g.TgZ(0,"belender-duplicated-request-step",35),g.NdJ("newRequest",(function(t){g.CHM(e);const n=g.oxw(3);return g.KtG(n.newRequest(t))})),g.qZA()}if(2&e){const e=g.oxw(3);g.Q6J("data",e.data)("labels",e.labels)("currentRequest",e.currentRequest)}}function j(e,t){if(1&e&&g._UZ(0,"belender-no-phone-step",36),2&e){const e=g.oxw(3);g.Q6J("data",e.data)("labels",e.labels)("flowName",e.flowName)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function z(e,t){if(1&e&&g._UZ(0,"belender-error-phone-step",37),2&e){const e=g.oxw(3);g.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("flowName",e.flowName)}}function B(e,t){if(1&e){const e=g.EpF();g.TgZ(0,"belender-fail-step",38),g.NdJ("newRequest",(function(t){g.CHM(e);const n=g.oxw(3);return g.KtG(n.newRequest(t))})),g.qZA()}if(2&e){const e=g.oxw(3);g.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("requestID",e.requestID)("flowType",e.flowName)}}function J(e,t){if(1&e&&g._UZ(0,"belender-no-service-step",39),2&e){const e=g.oxw(3);g.Q6J("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("data",e.data)("labels",e.labels)}}function V(e,t){if(1&e&&g._UZ(0,"belender-standby-step",39),2&e){const e=g.oxw(3);g.Q6J("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("data",e.data)("labels",e.labels)}}function Q(e,t){if(1&e&&g._UZ(0,"belender-cancel-request",40),2&e){const e=g.oxw(3);g.Q6J("flowType",e.flowName)("request_id",e.requestID)("user_id",e.userId)("data",e.data)("labels",e.labels)("textColor",e.data.styles.colors.text)("customText",e.data.config.cancelRequestText)}}function W(e,t){if(1&e&&(g._UZ(0,"div",41),g.ALo(1,"safeHtml")),2&e){const e=g.oxw(3);g.Udp("color",e.data.styles.colors.text),g.Q6J("innerHTML",g.lcZ(1,3,(null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.aditionalDescription)||""),g.oJD)}}function G(e,t){if(1&e&&(g.ynx(0),g.YNc(1,L,1,2,"belender-intro-step",10),g.YNc(2,D,1,5,"belender-manual-step",11),g.YNc(3,P,2,10,"belender-form-step",12),g.YNc(4,N,1,5,"belender-error-form-step",13),g.YNc(5,q,1,3,"belender-error-birthday-step",14),g.YNc(6,R,1,3,"belender-error-expiration-step",14),g.YNc(7,Y,1,3,"belender-error-support-number-step",14),g.YNc(8,F,1,5,"belender-abandoned-step",15),g.YNc(9,U,2,9,"belender-shared-otp-step",16),g.YNc(10,Z,1,7,"belender-success-step",17),g.YNc(11,H,1,3,"belender-duplicated-request-step",18),g.YNc(12,j,1,4,"belender-no-phone-step",19),g.YNc(13,z,1,4,"belender-error-phone-step",20),g.YNc(14,B,1,5,"belender-fail-step",21),g.YNc(15,J,1,3,"belender-no-service-step",22),g.YNc(16,V,1,3,"belender-standby-step",22),g.YNc(17,Q,1,7,"belender-cancel-request",23),g.YNc(18,W,2,5,"div",24),g.BQk()),2&e){const e=g.oxw(2);g.xp6(1),g.Q6J("ngIf","intro"===e.requestStatus),g.xp6(1),g.Q6J("ngIf","manual"===e.requestStatus),g.xp6(1),g.Q6J("ngIf","form"===e.requestStatus&&!e.settingRequestFromBack),g.xp6(1),g.Q6J("ngIf","error-data"===e.requestStatus),g.xp6(1),g.Q6J("ngIf","error-birth-date"==e.requestStatus),g.xp6(1),g.Q6J("ngIf","error-expiration-date"==e.requestStatus),g.xp6(1),g.Q6J("ngIf","error-support-number"==e.requestStatus),g.xp6(1),g.Q6J("ngIf","abandoned"==e.requestStatus),g.xp6(1),g.Q6J("ngIf","otp"==e.requestStatus),g.xp6(1),g.Q6J("ngIf","success"==e.requestStatus),g.xp6(1),g.Q6J("ngIf","duplicated"==e.requestStatus),g.xp6(1),g.Q6J("ngIf","no-phone"==e.requestStatus),g.xp6(1),g.Q6J("ngIf","bad-phone"==e.requestStatus),g.xp6(1),g.Q6J("ngIf","failed"==e.requestStatus),g.xp6(1),g.Q6J("ngIf","no-service"==e.requestStatus),g.xp6(1),g.Q6J("ngIf","standby"==e.requestStatus),g.xp6(1),g.Q6J("ngIf",e.showCancelRequest&&e.data.config.cancelRequest&&e.requestIDFromURL),g.xp6(1),g.Q6J("ngIf","form"===e.requestStatus&&!e.loading&&e.data[e.flowName]&&(null==e.data[e.flowName]?null:e.data[e.flowName].showAditionalDescription)&&(null==e.data[e.flowName]?null:e.data[e.flowName].texts)&&(null==e.data[e.flowName]?null:e.data[e.flowName].texts.form)&&(null==e.data[e.flowName]?null:e.data[e.flowName].texts.form.aditionalDescription))}}function $(e,t){1&e&&g._UZ(0,"belender-disabled-url")}function K(e,t){if(1&e&&(g.TgZ(0,"div",42),g._UZ(1,"div",43),g.qZA()),2&e){const e=g.oxw(2);g.xp6(1),g.Q6J("innerHTML",e.warning,g.oJD)}}function X(e,t){if(1&e){const e=g.EpF();g.TgZ(0,"div")(1,"div",44)(2,"div",45),g._uU(3,"Error!"),g.qZA(),g._UZ(4,"div",46),g.qZA(),g.TgZ(5,"div",47)(6,"button",48),g.NdJ("click",(function(){g.CHM(e);const t=g.oxw(2);return g.KtG(t.error=!1)})),g._uU(7,"Ingresar manualmente"),g.qZA()()()}if(2&e){const e=g.oxw(2);g.xp6(4),g.Udp("color",e.data.styles.colors.text),g.Q6J("innerHTML",e.error,g.oJD)}}function ee(e,t){if(1&e&&(g.TgZ(0,"div"),g.YNc(1,O,2,1,"div",6),g.YNc(2,G,19,18,"ng-container",4),g.YNc(3,$,1,0,"belender-disabled-url",4),g.YNc(4,K,2,1,"div",7),g.YNc(5,X,8,3,"div",4),g.qZA()),2&e){const e=g.oxw();g.Gre("h-full w-full flex-auto p-0 md:p-3 ",null==e.data||null==e.data.styles?null:e.data.styles.typography,""),g.Udp("background",null==e.data||null==e.data.styles||null==e.data.styles.colors?null:e.data.styles.colors.background),g.xp6(1),g.Q6J("ngIf",e.data.config.infiniteLoopInCompleted&&"loading"===e.requestStatus),g.xp6(1),g.Q6J("ngIf",!e.error&&!e.disableURL),g.xp6(1),g.Q6J("ngIf",!e.error&&e.disableURL),g.xp6(1),g.Q6J("ngIf",!e.loading&&e.warning&&"success"!=e.requestStatus&&"abandoned"!=e.requestStatus&&"failed"!=e.requestStatus),g.xp6(1),g.Q6J("ngIf",!e.loading&&e.error&&"loading"!=e.requestStatus)}}function te(e,t){if(1&e&&(g.TgZ(0,"div",49),g._UZ(1,"mat-progress-spinner",50),g.TgZ(2,"p",51),g._uU(3),g.qZA()()),2&e){const e=g.oxw();g.xp6(1),g.Q6J("value",e.spinnerValue)("mode",e.spinnerMode),g.xp6(2),g.Oqu(e.loading)}}function ne(e,t){if(1&e){const e=g.EpF();g.TgZ(0,"vex-terms",52),g.NdJ("accepted",(function(){g.CHM(e);const t=g.oxw();return g.KtG(t.handleTermsResponse(!0))}))("cancelled",(function(){g.CHM(e);const t=g.oxw();return g.KtG(t.handleTermsResponse(!1))})),g.qZA()}if(2&e){const e=g.oxw();g.Q6J("flow",e.flowName)("lang",e.currentLang)("allData",e.data)("requestStatus",e.smsFlowService.REQUEST?e.smsFlowService.REQUEST_STATUS:"")("requestID",e.requestID)}}function ie(e,t){if(1&e&&(g.ynx(0),g.TgZ(1,"div",53),g._uU(2),g.qZA(),g.BQk()),2&e){const e=g.oxw();g.xp6(2),g.hij("TestMode ",e.testMode?"ON":"OFF","")}}function se(e,t){if(1&e){const e=g.EpF();g.TgZ(0,"belender-tester-sms",54),g.NdJ("sendMessage",(function(t){g.CHM(e);const n=g.oxw();return g.KtG(n.setMessageFromTest(t))})),g.qZA()}}let re=class{constructor(e,t,n,i,s,r,o,a,l,d,u,h,p){if(this.cd=e,this.Activatedroute=t,this.utils=n,this.solicitudesService=i,this.customizationService=s,this.customizationStoreService=r,this.notis=o,this.pinService=a,this.deviceInfoService=l,this.dialog=d,this.translationService=u,this.smsFlowService=h,this.scrollService=p,this.data=null,this.disableActions=!1,this.step="created",this.waitingTime=15,this._loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1,this.introEnabled=!1,this.manual=!1,this.pinMode=!1,this.requestIDFromURL=!1,this.stopPropagationOfSuccess=!1,this.paramsSetted=!1,this.requestStatus="loading",this.disableURL=!1,this.settingRequestFromBack=!1,this.showCancelRequest=!1,this.requestedFromDetail=!1,this.env=c.N,this.intervalToAskBack=null,this.loadingRequestData=!1,this.intervalCount=0,this.requestedToPin=!1,this.isScaled=!1,this.termsOpened=!1,this.flowName="SMS",this.labels=m.S.es,this.currentLang="",this.showTermsDialog=!1,this.editable_dates=!1,"OTPCredential"in window){const e=new AbortController;navigator.credentials.get({otp:{transport:["sms"]},signal:e.signal}).then((e=>{this.showAlert("otp",e)})).catch((e=>{console.log(e)}))}this.deviceInfoDetails$=this.deviceInfoService.deviceInfo$.subscribe((e=>{Object.keys(e).length>0&&(this.deviceInfoDetails=e)}))}get loading(){return this._loading}set loading(e){this._loading=e,null!==e&&this.onLoadingChanged()}ngOnInit(){this.smsFlowService.request_status$.subscribe((e=>{this.setStatus()})),this.userId=this.customizationStoreService.USER_ID,this.smsFlowService.requestID$.subscribe((e=>{this.requestID=e})),this.smsFlowService.loading$.subscribe((e=>{this.loading=e})),this.getWindowsScreenOrientation();const e=this;this.packId=this.customizationStoreService.PACK_ID,"pro"!=c.N.env&&(l(document).keydown((function(t){16==t.which&&(this.shiftlIsPressed=!0),17==t.which&&(this.cntrlIsPressed=!0),84==t.which&&this.cntrlIsPressed&&this.shiftlIsPressed&&(e.testMode=!e.testMode,e.cd.markForCheck())})),l(document).keyup((function(e){16==e.which&&(this.shiftlIsPressed=!1),16==e.which&&(this.cntrlIsPressed=!1)})))}ngAfterViewInit(){this.initFunctions()}onLoadingChanged(){this.scrollUpContent()}initFunctions(){var e=this;return(0,i.Z)((function*(){var t;e.Activatedroute.queryParams.subscribe((t=(0,i.Z)((function*(t){t&&t.request_id&&e.smsFlowService.updateRequestID(t.request_id),t.lang?(e.currentLang=t.lang,e.smsFlowService.setLoading(e.translationService.getFirstLoading(e.currentLang)),e.setTranslation()):e.smsFlowService.setLoading(e.labels.loadings.gettingData),"true"===t.editable_dates&&(e.editable_dates=t.editable_dates),e.userId?e.setInitialData(e.userId):e.smsFlowService.setLoading(null)})),function(e){return t.apply(this,arguments)}))}))()}setTranslation(){let e=this.translationService.getLabelsTranslated(this.currentLang);e&&(this.labels=e)}ngOnDestroy(){window.screen&&window.screen.orientation&&this.orientationChangeHandler&&window.screen.orientation.removeEventListener("change",this.orientationChangeHandler)}ngAfterViewChecked(){this.getWidgetCardHeight()}getWindowsScreenOrientation(){window.screen&&window.screen.orientation&&(this.orientationChangeHandler=()=>{this.getWidgetCardHeight()},window.screen.orientation.addEventListener("change",this.orientationChangeHandler))}getWidgetCardHeight(){let e=l("#widget-wrapper").height()||0;this.isScaled$=this.deviceInfoService.isScaled$.subscribe((t=>{this.isScaled=t,this.isScaled&&(e*=1.5)})),this.smsFlowService.sendMessageToParent({type:"widgetHeight",data:e})}setInitialData(e){var t=this;return(0,i.Z)((function*(){yield t.validateRequestIdInUrl();const n=(0,p.cm)(yield t.getFlow(e));if(t.funderConfig=t.customizationStoreService.FUNDER_CONFIG,t.funderStyles=t.customizationStoreService.FUNDER_STYLES,t.data={config:t.funderConfig,styles:t.funderStyles,[t.flowName]:n},(0,p.bf)(t.data,t.flowName),!t.data.config||!t.data.config.funder_id)return t.showAlert(t.labels.warnings.error,t.labels.warnings.noCustomization,"error"),t.smsFlowService.setLoading(null),void t.cd.markForCheck();t.financiadorID=t.data.config.funder_id||"",t.disableURL=t.data.config.disableUrlWidget,t.introEnabled=t.data.config.introEnabled,t.smsFlowService.setLoading(!1),t.loading=null,yield t.utils.preloadImages(n,t.funderStyles),t.cd.markForCheck(),t.smsFlowService.sendMessageToParent({type:"widgetLoaded",data:{}})}))()}getFlow(e){var t=this;return(0,i.Z)((function*(){return new Promise((n=>{t.customizationService.getCustomizationByFlow(e,t.flowName,t.currentLang||t.customizationStoreService.LANG,t.requestID,t.smsFlowService.REQUEST?t.smsFlowService.REQUEST_STATUS:"").then((e=>{n(e?.data?e.data:null)}),(e=>{n(null)}))}))}))()}validateRequestIdInUrl(){var e=this;return(0,i.Z)((function*(){return new Promise((t=>{var n;e.Activatedroute.queryParams.subscribe((n=(0,i.Z)((function*(n){if(n&&(e.setParamsToRequest(n),e.smsFlowService.setLoading(!1)),n&&n.acceptTerms&&(e.paramsSetted=!0,e.autoAcceptTerms=!0),n.success&&(e.stopPropagationOfSuccess=!0,e.paramsSetted=!0),n&&n.request_id){e.smsFlowService.updateRequestID(n.request_id),e.disableURL=!1;let i=yield e.setFormFromVcCode(n.request_id,n);e.requestIDFromURL=!0,e.paramsSetted=!0,t(i)}else e.smsFlowService.setLoading(!1);t(null)})),function(e){return n.apply(this,arguments)}),(n=>{e.smsFlowService.setLoading(!1),t(null)}))}))}))()}setParamsToRequest(e){this.smsFlowService.REQUEST||this.setRequestStatus("form");let t={...this.smsFlowService.REQUEST};(e.document_number||e.document)&&!t.person_document_number&&(t.person_document_number=e.document_number||e.document,this.requestIDFromURL=!0,this.paramsSetted=!0),(e.birth_date||e.birthday)&&!t.person_birth_date&&(t.person_birth_date=e.birth_date||e.birthday,this.requestIDFromURL=!0,this.paramsSetted=!0),e.phone&&!t.person_phone&&(t.person_phone=e.phone,this.requestIDFromURL=!0,this.paramsSetted=!0),e.email&&!t.email&&(t.email=e.email,this.requestIDFromURL=!0,this.paramsSetted=!0),this.smsFlowService.setRequest(t)}setFormFromVcCode(e,t){var n=this;return(0,i.Z)((function*(){return n.showAlert(null),n.smsFlowService.setLoading(n.labels.loadings.gettingData),n.settingRequestFromBack=!0,new Promise((i=>{n.solicitudesService.getSolicitudByCode(e).then((e=>{if(e&&e.data){let i=e.data;i.status_code=i.consent_process_completed?"consent_process_completed":i.status_code,f.t.shouldIgnoreWebhookStatus(i.status_code)&&n.smsFlowService.REQUEST?.status_code&&(i={...i,status_code:n.smsFlowService.REQUEST.status_code}),n.smsFlowService.setRequest(i),n.setStatus(),n.smsFlowService.setSubscriptionOfRequest(),n.smsFlowService.setLoading(!1),n.skipCreationOfRequest=n.smsFlowService.REQUEST&&n.smsFlowService.REQUEST_STATUS&&"prerequest"!=n.smsFlowService.REQUEST_STATUS,n.autoAcceptTerms?n.acceptTerms():n.setParamsToRequest(t)}else n.smsFlowService.setLoading(null);n.settingRequestFromBack=!1,i(n.smsFlowService.REQUEST||null)})).catch((e=>{n.smsFlowService.setLoading(null),n.settingRequestFromBack=!1,i(null)}))}))}))()}setMessageFromTest(e){this.smsFlowService.handlePusherNotification(e)}addSolicitudPIN(e){this.data[this.flowName]&&this.data[this.flowName].packID&&(e.package_id=this.data[this.flowName].packID),this.formComponent.forceEnableDisableInputs({value:!0},{value:!0},{value:!0},{value:!0}),this.pinService.addSolicitud(e).then((t=>{t&&t.status&&"error"==t.status?t.message&&(this.smsFlowService.setRequest(e),400==t.code&&"Does not have Pin service"==t.message?(this.setRequestStatus("no_service"),this.smsFlowService.setLoading(!1)):400==t.code&&"Incorrect support number"==t.message?(this.notis.showAlert(this.labels.warnings.error,this.labels.warnings.wrongSupport),this.setRequestStatus("form")):400==t.code&&"Incorrect date"==t.message?(this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongDate),this.setRequestStatus("form")):(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,t.message)),this.setStatus()):t&&t.status&&"success"==t.status?(this.smsFlowService.updateRequestID(t.data.request_id),this.smsFlowService.setRequest(t.data),location.pathname.indexOf("widget-boxed")>-1?location.assign(t.data.widget_url_boxed+"&acceptTerms=true"):location.assign(t.data.widget_url+"&acceptTerms=true"),this.acceptTerms()):this.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+t)})).catch((e=>{e&&e.errorMessage&&this.showAlert("Error!",e.errorMessage)}))}addSolicitudSMS(e){this.formComponent.hasDateError=!1,this.showAlert(null),this.solicitudesService.addSolicitud(e).then((t=>{t&&t.status&&"error"==t.status?(this.smsFlowService.setRequest(e),t.message&&(400==t.code?"Birthdate incorrect"==t.message?(this.setRequestStatus("form"),this.formComponent.hasDateError=!0,this.formComponent.dateError=this.labels.warnings.wrongDateDesc):"Incorrect date"==t.message?(this.formComponent.hasDateError=!0,this.formComponent.dateError=this.labels.warnings.wrongDateDesc,this.setRequestStatus("form")):(this.setRequestStatus("no_service"),this.smsFlowService.setLoading(!1)):(t.message.phone||" Teléfono incorrecto"===t.message?this.formComponent.disableEnableInputs(!0,!0,!1,!0):this.formComponent.disableEnableInputs(!0,!1,!1,!1),this.setRequestStatus("form"),this.showAlert("Error!",t.message)),this.setStatus())):t&&t.status&&"success"==t.status?(this.smsFlowService.updateRequestID(t.data.request_id),this.smsFlowService.setRequest(t.data),this.setStatus(),this.smsFlowService.setSubscriptionOfRequest(),this.acceptTerms()):this.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+t)})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.smsFlowService.setLoading(!1)}))}validateHaveSmsMode(e){this.showAlert(null),this.solicitudesService.checkService(e).then((t=>{t&&t.message&&"does not have sms service"==t.message.toLowerCase()?(this.smsFlowService.setRequest(e),this.setRequestStatus("form"),this.pinMode=!0,this.smsFlowService.setLoading(null),this.showAlert(this.labels.warnings.noSms,this.labels.warnings.noSmsDesc)):this.addSolicitudSMS(e)})).catch((e=>{console.error(e)}))}showAlert(e,t,n){this.warning=e?`<div class="flex flex-col w-full items-start gap-0 pl-2 mr-1"><strong class="text-md" >${e}</strong><small>${t}</small></div>`:null}getFunderIconType(e){if(!e||!this.funderStyles)return"error";switch(e){case"error":return this.funderStyles.errorIcon||e;case"success":return this.funderStyles.successIcon||e;case"warning":return this.funderStyles.warningIcon||e;case"info":return this.funderStyles.infoIcon||e;default:return e}}acceptTerms(e=!0){this.showAlert(null);let t={request_id:this.requestID,user_id:this.userId,terms_and_conditions:!0,opening:this.termsOpened?1:0};Object.keys(this.deviceInfoDetails).length>0&&(t={...t,ip:this.deviceInfoDetails.ip,device:this.deviceInfoDetails.device,os:`${this.deviceInfoDetails.os} ${this.deviceInfoDetails.os_version}`,resolution:this.deviceInfoDetails.screen}),e&&this.smsFlowService.setLoading(this.labels.loadings.validatingAndLoginSS),this.solicitudesService.acceptTerms(t).then((e=>{if(e.status&&"error"==e.status){if("You have a request in progress"==e.message){const t=location.pathname;location.assign(t.includes("widget-boxed")?e.response.widget_url_boxed:e.response.widget_url)}else"Invalid request status: stand_by"==e.message?this.setRequestStatus("stand_by"):"Failed to retrieve login status"==e.message?(this.formComponent.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1}),this.showAlert("Error!",e.message)):this.showAlert("Error!",e.message||e);this.smsFlowService.setLoading(!1)}else e&&"success"==e.status?(this.smsFlowService.sendMessageToParent({type:"response",data:e.data||e}),this.smsFlowService.setRequest(e.data),this.setStatus(),this.smsFlowService.setSubscriptionOfRequest(),this.smsFlowService.setLoading(null),this.cd.markForCheck()):this.smsFlowService.setLoading(null)})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.smsFlowService.setLoading(!1)}))}askToBack(){this.solicitudesService.getSolicitudByCode(this.requestID).then((e=>{if(e&&e.data){if(f.t.shouldIgnoreWebhookStatus(e.data.status_code))return void this.smsFlowService.setLoading(!1);this.smsFlowService.setRequest(e.data),this.setStatus(),this.smsFlowService.setLoading(!1)}else this.smsFlowService.setLoading(!1)})).catch((e=>{this.smsFlowService.setLoading(!1)}))}setRequestStatus(e){let t={...this.smsFlowService.REQUEST};if(t)t.status_code=e;else{let n=new a.l;n.status_code=e,t=n,this.smsFlowService.setRequest(n)}this.smsFlowService.setRequestStatus(e),this.setStatus()}newRequest(e){this.setRequestStatus("created")}gotoManual(){this.manual=!0,this.cd.markForCheck()}goFlow(){this.introEnabled=!1}gotoPin(){this.showAlert(null),this.requestedToPin=!0;let e={request_id:this.smsFlowService.REQUEST.request_id};this.smsFlowService.setLoading(this.labels.loadings.smsToPin),this.solicitudesService.noPhone(e).then((e=>{this.smsFlowService.setLoading(null),this.setRequestStatus("no_more_phone")})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.smsFlowService.setLoading(null)}))}gotoClavePinUrl(e){location.href.indexOf("widget-boxed")>-1?location.assign(e.widget_url_boxed):location.assign(e.widget_url)}requestStatusFromDetail(){this.requestedFromDetail=!0,this.smsFlowService.setLoading(this.labels.loadings.validatingRequest),this.solicitudesService.getSolicitudByCode(this.smsFlowService.REQUEST.request_id).then((e=>{e&&e.consent_process_completed&&this.setRequestStatus("consent_process_completed"),this.smsFlowService.setLoading(null)})).catch((e=>{this.smsFlowService.setLoading(null),this.setRequestStatus("failed")}))}handleRequestStatus(e){let t=new a.l;e.consent_process_completed?(this.requestedFromDetail=!0,t.status_code="consent_process_completed",this.smsFlowService.setRequest(t),setTimeout((()=>{this.smsFlowService.disconnectWebsocket()}),3e3),this.setStatus(),this.data[this.flowName].showDocumentsOnSuccess&&!this.intervalToAskBack&&this.initIntervalToAskBack()):(this.otpComponent&&this.otpComponent.resetOtpNumber(),e.otp_status?"VALID"===e.otp_status?e.nex_step_detail&&"Seguridad Social"===e.nex_step_detail.portal&&(t.status_code="waiting_otp_seguridad_social",this.smsFlowService.setRequest(t),this.setStatus(),this.showAlert(null,null)):"INVALID"===e.otp_status&&(t.status_code=e.status_code,this.smsFlowService.setRequest(t),this.setStatus(),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongOtp)):(t.status_code=e.status_code||"failed_with_retry",this.smsFlowService.setRequest(t),this.setStatus(),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongOtp))),this.smsFlowService.setLoading(null)}initIntervalToAskBack(){!this.smsFlowService.REQUEST||!this.smsFlowService.REQUEST.request_id||(this.intervalToAskBack=setInterval((()=>{this.askDetailToBack(this.smsFlowService.REQUEST.request_id),this.intervalCount++,this.intervalCount>20&&this.stopInterval()}),5e3))}stopInterval(){this.intervalToAskBack&&clearInterval(this.intervalToAskBack)}askDetailToBack(e){let t=e||this.requestID,n=JSON.parse(JSON.stringify(this.smsFlowService.REQUEST_STATUS));t&&"consent_process_completed"!==n?this.pinService.getSolicitudByCode(e).then((e=>{if(e&&e.data){let t=e.data;if(t.status_code=t.consent_process_completed?"consent_process_completed":t.status_code,f.t.shouldIgnoreWebhookStatus(t.status_code))return;n!=t.status_code&&(this.smsFlowService.setRequest(t),this.setRequestStatus(this.smsFlowService.REQUEST_STATUS))}})).catch((e=>{this.smsFlowService.setLoading(null),this.loadingRequestData=!1})):this.stopInterval()}handleBadPhone(){this.smsFlowService.disconnectWebsocket(),this.smsFlowService.setLoading(this.labels.loadings.validatingData),setTimeout((()=>{this.smsFlowService.REQUEST||this.smsFlowService.setRequest(new a.l),this.setRequestStatus("failed_without_retry"),this.setStatus(),this.smsFlowService.setLoading(null)}),3e3)}setStatus(){if(this.showCancelRequest=!0,this.smsFlowService?.REQUEST){let e=this.smsFlowService?.REQUEST.status_code,t=h[e];if(t){if("success"===t&&this.funderConfig&&this.funderConfig.infiniteLoopInCompleted&&(this.loading=" "),"phone_not_exist_otp"===t)return void(this.data&&this.data.config&&this.data.config.tryPinWithoutSMS?(this.showCancelRequest=!1,this.gotoPin(),this.requestStatus="loading"):this.requestStatus=this.data.config.noRetryInBadPhone?"otp":u);if(("abandoned"===t||"failed"===t)&&(this.showCancelRequest=!1),"no-service"===t&&(this.requestStatus=t,this.data&&this.data.config&&this.data.config.tryPinWithoutSMS))return void(!this.requestedToPin&&this.gotoPin());if("bad-phone"===t&&this.data&&this.data.config&&this.data.config.tryPinWithoutSMS)return!this.requestedToPin&&this.gotoPin(),void(this.requestStatus="no-phone");if("no-phone"===t){if(this.data&&this.data.config&&!this.data.config.tryPinWithoutSMS)return void(this.requestStatus="no-service");if(this.data&&this.data.config&&this.data.tryPinWithoutSMS)return!this.requestedToPin&&this.gotoPin(),void(this.requestStatus="no-phone")}this.requestStatus=t,this.loading=null}else this.requestStatus="loading",this.smsFlowService.setLoading(this.labels.loadings.gettingData),this.initIntervalToAskBack()}this.cd.markForCheck()}setStatus2(){if(this.showCancelRequest=!0,this.manual)this.requestStatus="manual";else if(this.introEnabled)this.requestStatus="intro";else if(this.smsFlowService.REQUEST){if(this.smsFlowService.REQUEST){let e=h[this.smsFlowService.REQUEST_STATUS];if(e){if("success"===e&&this.data.config&&this.data.config.infiniteLoopInCompleted)return void(this.requestStatus="loading");if(("abandoned"===e||"failed"===e)&&(this.showCancelRequest=!1),"phone_not_exist_otp"===e)return void(this.data&&this.data.config&&this.data.config.tryPinWithoutSMS?(this.showCancelRequest=!1,this.gotoPin(),this.requestStatus="loading"):this.requestStatus=this.data.config.noRetryInBadPhone?"otp":u);if("no-service"===e&&(this.requestStatus=e,this.data&&this.data.config&&this.data.config.tryPinWithoutSMS))return void(!this.requestedToPin&&this.gotoPin());if("bad-phone"===e&&this.data&&this.data.config&&this.data.config.tryPinWithoutSMS)return!this.requestedToPin&&this.gotoPin(),void(this.requestStatus="no-phone");if("no-phone"===e){if(this.data&&this.data.config&&!this.data.config.tryPinWithoutSMS)return void(this.requestStatus="no-service");if(this.data&&this.data.config&&this.data.tryPinWithoutSMS)return!this.requestedToPin&&this.gotoPin(),void(this.requestStatus="no-phone")}this.requestStatus=e,this.scrollUpContent()}}}else this.requestStatus="form"}scrollUpContent(){setTimeout((()=>{this.scrollService.requestScrollMainTop()}),300)}sendRetry(){}gotoTermsAndConditions(){this.showTermsDialog=!0}handleTermsResponse(e){this.showTermsDialog=!1,this.termsOpened=!0,this.formComponent.setTermsCheck(e)}};re.ɵfac=function(e){return new(e||re)(g.Y36(g.sBO),g.Y36(_.gz),g.Y36(b.F),g.Y36(v.M),g.Y36(y.w),g.Y36(w.r),g.Y36(x.T),g.Y36(S.v),g.Y36(C.H),g.Y36(T.uw),g.Y36(k.D),g.Y36(M.p),g.Y36(I.a))},re.ɵcmp=g.Xpm({type:re,selectors:[["belender-widget-sms"]],viewQuery:function(e,t){if(1&e&&(g.Gf(E,5),g.Gf(A,5),g.Gf(E,5)),2&e){let e;g.iGM(e=g.CRH())&&(t.formComponent=e.first),g.iGM(e=g.CRH())&&(t.otpComponent=e.first),g.iGM(e=g.CRH())&&(t.theDiv=e.first)}},inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID"},features:[g._Bn([{provide:r.o2,useValue:{appearance:"standard"}}])],decls:6,vars:5,consts:[[1,"h-full","widget-belender"],[3,"class","background",4,"ngIf"],["class","loading-wrapper",4,"ngIf"],[3,"flow","lang","allData","requestStatus","requestID","accepted","cancelled",4,"ngIf"],[4,"ngIf"],[3,"sendMessage",4,"ngIf"],["class","flex justify-center h-full min-h-[300px] items-center",4,"ngIf"],["class","animated w-full fadeInRight",4,"ngIf"],[1,"flex","justify-center","h-full","min-h-[300px]","items-center"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],["class","h-full ",3,"data","flowName","gotoFlow","gotoManual",4,"ngIf"],["class","h-full ",3,"data","flowName","packId","userId","labels",4,"ngIf"],[3,"requestIDFromURL","lang","requestID","flowName","data","labels","texts","pinMode","editable_dates","skipCreationOfRequest","goToTerms",4,"ngIf"],[3,"data","labels","texts","flowName","requestID",4,"ngIf"],[3,"data","labels","texts",4,"ngIf"],[3,"requestID","data","labels","texts","flowType",4,"ngIf"],[3,"otpType","requestID","testMode","labels","logoCustom","flowType","data","texts","minLength",4,"ngIf"],[3,"data","labels","packId","flowName","userId","requestID","texts",4,"ngIf"],[3,"data","labels","currentRequest","newRequest",4,"ngIf"],[3,"data","labels","flowName","texts",4,"ngIf"],[3,"data","labels","texts","flowName",4,"ngIf"],[3,"data","labels","texts","requestID","flowType","newRequest",4,"ngIf"],[3,"texts","data","labels",4,"ngIf"],[3,"flowType","request_id","user_id","data","labels","textColor","customText",4,"ngIf"],["class","subheading-1 p-4 custom-html",3,"color","innerHTML",4,"ngIf"],[1,"h-full",3,"data","flowName","gotoFlow","gotoManual"],[1,"h-full",3,"data","flowName","packId","userId","labels"],[3,"requestIDFromURL","lang","requestID","flowName","data","labels","texts","pinMode","editable_dates","skipCreationOfRequest","goToTerms"],["formStep",""],[3,"data","labels","texts","flowName","requestID"],[3,"data","labels","texts"],[3,"requestID","data","labels","texts","flowType"],[3,"otpType","requestID","testMode","labels","logoCustom","flowType","data","texts","minLength"],["otpStep",""],[3,"data","labels","packId","flowName","userId","requestID","texts"],[3,"data","labels","currentRequest","newRequest"],[3,"data","labels","flowName","texts"],[3,"data","labels","texts","flowName"],[3,"data","labels","texts","requestID","flowType","newRequest"],[3,"texts","data","labels"],[3,"flowType","request_id","user_id","data","labels","textColor","customText"],[1,"subheading-1","p-4","custom-html",3,"innerHTML"],[1,"animated","w-full","fadeInRight"],[1,"px-6","py-4","w-full","bg-orange-500/10","rounded-md","flex","flex-col","text-orange-600",3,"innerHTML"],[1,"px-6","py-4","flex","flex-col"],[1,"text-red-500","title","m-0"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"text-blue-500","bg-blue-50","px-8",3,"click"],[1,"loading-wrapper"],["color","accent","diameter","40",1,"spinner",3,"value","mode"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[3,"flow","lang","allData","requestStatus","requestID","accepted","cancelled"],[1,"test-mode","px-10","py-2","bg-blue-500/10","text-blue-500","border-blue-500","border","rounded-md"],[3,"sendMessage"]],template:function(e,t){1&e&&(g.TgZ(0,"div",0),g.YNc(1,ee,6,10,"div",1),g.YNc(2,te,4,3,"div",2),g.qZA(),g.YNc(3,ne,1,5,"vex-terms",3),g.YNc(4,ie,3,1,"ng-container",4),g.YNc(5,se,1,0,"belender-tester-sms",5)),2&e&&(g.xp6(1),g.Q6J("ngIf",t.data&&t.data.styles&&t.data.styles.colors),g.xp6(1),g.Q6J("ngIf",t.loading&&!t.error),g.xp6(1),g.Q6J("ngIf",t.showTermsDialog),g.xp6(1),g.Q6J("ngIf",t.testMode),g.xp6(1),g.Q6J("ngIf",t.testMode))},styles:[".widget-belender[_ngcontent-%COMP%]{position:relative;min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"],data:{animation:[d.$]}}),re=(0,s.gn)([(0,o.c)()],re)},6547:(e,t,n)=>{n.r(t),n.d(t,{SmsModule:()=>Yt});var i=n(6895),s=n(6383),r=n(5592),o=n(8739),a=n(7155),l=n(6308),c=n(6709),d=n(7392),u=n(9101),h=n(1561),p=n(4006),m=n(266),f=n(4385),g=n(811),_=n(5601),b=n(3798),v=n(9391),y=n(1572),w=n(182),x=n(4650),S=n(8467),C=n(5895),T=n(8429),k=n(342),M=n(3731);function I(e,t){if(1&e&&(x.TgZ(0,"div",5),x._UZ(1,"div",6)(2,"div",7),x.ALo(3,"safeHtml"),x.qZA()),2&e){const e=x.oxw();x.xp6(1),x.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),x.Q6J("innerHTML",e.texts.success.title,x.oJD),x.xp6(1),x.Udp("color",e.data.styles.colors.text),x.Q6J("innerHTML",x.lcZ(3,8,e.texts.success.description||""),x.oJD)}}function E(e,t){if(1&e&&x._UZ(0,"widget-documents",8),2&e){const e=x.oxw();x.Q6J("userId",e.userId)("packId",e.packId)("requestID",e.requestID)}}function A(e,t){if(1&e&&(x.TgZ(0,"div",9),x._UZ(1,"mat-progress-spinner",10),x.TgZ(2,"p",11),x._uU(3),x.qZA()()),2&e){const e=x.oxw();x.xp6(1),x.Q6J("value",0),x.xp6(2),x.Oqu(e.loading)}}const O=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function L(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"div",12)(1,"button",13),x.NdJ("click",(function(){x.CHM(e);const t=x.oxw();return x.KtG(t.gotoRedirect())})),x._uU(2),x.qZA()()}if(2&e){const e=x.oxw();x.Q6J("ngClass",x.kEZ(8,O,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),x.xp6(1),x.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),x.xp6(1),x.hij(" ",e.data[e.flowName].btnTextCallBack||e.labels.actions.clickToFinish," ")}}let D=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.loading=null,this.showDocuments=!1}ngOnInit(){this.data&&this.data[this.flowName]&&this.data[this.flowName].enableUrlCallBack&&this.data[this.flowName].automaticRedirectCallBack&&this.data[this.flowName].callBackUrl?setTimeout((()=>{location.assign(this.data[this.flowName].callBackUrl)}),2e3):this.data&&this.data[this.flowName]&&this.data[this.flowName].showDocumentsOnSuccess&&(this.showDocuments=!0)}save(){}gotoRedirect(){this.data&&this.data[this.flowName]&&this.data[this.flowName].enableUrlCallBack&&this.data[this.flowName].callBackUrl&&location.assign(this.data[this.flowName].callBackUrl)}}return e.ɵfac=function(t){return new(t||e)(x.Y36(p.QS),x.Y36(S.F),x.Y36(_.M),x.Y36(v.o),x.Y36(C.T))},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-success-step"]],inputs:{data:"data",texts:"texts",loading:"loading",requestID:"requestID",packId:"packId",userId:"userId",flowName:"flowName",labels:"labels"},decls:5,vars:6,consts:[[3,"data","customImage"],["class"," pt-4 pb-8 flex flex-col animated fadeIn",4,"ngIf"],[3,"userId","packId","requestID",4,"ngIf"],["class","loading-wrapper flex flex-col items-center animated fadeIn",4,"ngIf"],["class","flex items-center gap-2 py-4 flex-col md:flex-row",3,"ngClass",4,"ngIf"],[1,"pt-4","pb-8","flex","flex-col","animated","fadeIn"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[3,"userId","packId","requestID"],[1,"loading-wrapper","flex","flex-col","items-center","animated","fadeIn"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[1,"flex","items-center","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(x._UZ(0,"belender-widget-step-logo",0),x.YNc(1,I,4,10,"div",1),x.YNc(2,E,1,3,"widget-documents",2),x.YNc(3,A,4,2,"div",3),x.YNc(4,L,3,12,"div",4)),2&e&&(x.Q6J("data",t.data)("customImage",t.texts.success.customImage),x.xp6(1),x.Q6J("ngIf",!t.data.config.infiniteLoopInCompleted&&!t.loading),x.xp6(1),x.Q6J("ngIf",t.showDocuments),x.xp6(1),x.Q6J("ngIf",t.loading),x.xp6(1),x.Q6J("ngIf",t.data&&t.data[t.flowName]&&t.data[t.flowName].enableUrlCallBack&&!t.data[t.flowName].automaticRedirectCallBack))},dependencies:[i.mk,i.O5,u.lW,y.Ou,T.y,k.A,M.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var P=n(4144),N=n(7367),q=n(2254),R=n(9549);function Y(e,t){if(1&e&&(x.TgZ(0,"form",7)(1,"mat-form-field",8)(2,"mat-label"),x._uU(3),x.qZA(),x._UZ(4,"input",9),x.qZA()()),2&e){const e=x.oxw();x.Q6J("formGroup",e.form),x.xp6(3),x.Oqu(e.labels.phone)}}const F=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function U(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"div",10)(1,"button",11),x.NdJ("click",(function(){x.CHM(e);const t=x.oxw();return x.KtG(t.no())})),x._uU(2),x.qZA(),x.TgZ(3,"button",12),x.NdJ("click",(function(){x.CHM(e);const t=x.oxw();return x.KtG(t.next())})),x._uU(4),x.qZA()()}if(2&e){const e=x.oxw();x.Q6J("ngClass",x.kEZ(12,F,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),x.xp6(1),x.Udp("border-radius",e.data.styles.btnRound+"px"),x.xp6(1),x.hij(" ",e.labels.warnings.dontHavePhone," "),x.xp6(1),x.Udp("color",e.form.invalid?"":e.data.styles.colors.btnText)("background",e.form.invalid?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),x.Q6J("disabled",e.form.invalid),x.xp6(1),x.hij(" ",e.labels.actions.next," ")}}let Z=(()=>{class e{constructor(e,t,n,i,s,r){this.fb=e,this.utils=t,this.cd=n,this.notifications=i,this.solicitudesService=s,this.smsFlowService=r,this.loading=null,this.noPhone=new x.vpe(null),this.nextStep=new x.vpe(null)}ngOnInit(){this.form=this.fb.group({phone:[null,[p.kI.required,p.kI.maxLength(9),p.kI.minLength(9)]]})}next(){"SMS"===this.flowName?this.setSmsPhone(this.form.get("phone").value):this.nextStep.emit(this.form.get("phone").value)}no(){"SMS"===this.flowName?this.setSmsNoPhone():this.noPhone.emit(!0)}setSmsPhone(e){this.smsFlowService.setLoading(this.labels.loadings.sendingNewPhone),this.solicitudesService.setPhone({phone:e},this.smsFlowService.REQUEST&&this.smsFlowService.REQUEST.request_id?this.smsFlowService.REQUEST.request_id:this.requestID).then((e=>{this.smsFlowService.setRequestStatus(e&&e.data?e.data.request_status:"bad_phone"),this.smsFlowService.setLoading(null)})).catch((e=>{console.error(e),this.smsFlowService.setLoading(null)}))}setSmsNoPhone(){this.smsFlowService.setLoading(this.labels.loadings.validatingData),this.solicitudesService.noPhone({request_id:this.smsFlowService.REQUEST.request_id}).then((e=>{this.smsFlowService.setRequestStatus("no_sms_service"),this.smsFlowService.setLoading(null)})).catch((e=>{this.smsFlowService.setLoading(null)}))}}return e.ɵfac=function(t){return new(t||e)(x.Y36(p.QS),x.Y36(S.F),x.Y36(x.sBO),x.Y36(C.T),x.Y36(_.M),x.Y36(q.p))},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-error-phone-step"]],inputs:{requestID:"requestID",flowName:"flowName",data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{noPhone:"noPhone",nextStep:"nextStep"},decls:9,vars:14,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","w-full",3,"formGroup",4,"ngIf"],["class","flex items-center gap-2 p-4",3,"ngClass",4,"ngIf"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"mb-4","w-full","md:max-w-[500px]"],["maxlength","9","formControlName","phone","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"bg-red-500","text-red-50","px-8","py-1","w-full","max-w-none","md:max-w-[220px]",3,"click"],["mat-flat-button","","type","button",1,"px-8","py-1","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(x._UZ(0,"belender-widget-step-logo",0),x.TgZ(1,"div",1)(2,"div",2),x._UZ(3,"div",3)(4,"div",4),x.ALo(5,"safeHtml"),x._UZ(6,"br"),x.YNc(7,Y,5,2,"form",5),x.qZA(),x.YNc(8,U,5,16,"div",6),x.qZA()),2&e&&(x.Q6J("data",t.data)("customImage",t.texts.errorPhone.customImage),x.xp6(3),x.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),x.Q6J("innerHTML",t.texts.errorPhone.title,x.oJD),x.xp6(1),x.Udp("color",t.data.styles.colors.text),x.Q6J("innerHTML",x.lcZ(5,12,t.texts.errorPhone.description),x.oJD),x.xp6(3),x.Q6J("ngIf",!t.data.config.noRetryInBadPhone),x.xp6(1),x.Q6J("ngIf",!t.data.config.noRetryInBadPhone))},dependencies:[i.mk,i.O5,u.lW,R.KE,R.hX,P.Nt,p._Y,p.Fj,p.JJ,p.JL,p.nD,p.sg,p.u,T.y,M.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var H=n(8135),j=n(8460);function z(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"div",9)(1,"button",10),x.NdJ("click",(function(){x.CHM(e);const t=x.oxw(2);return x.KtG(t.retry())})),x._uU(2),x.qZA()()}if(2&e){const e=x.oxw(2);x.xp6(1),x.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),x.xp6(1),x.hij(" ",e.labels.actions.retry," ")}}const B=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function J(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"div",11)(1,"button",10),x.NdJ("click",(function(){x.CHM(e);const t=x.oxw(2);return x.KtG(t.newRequest())})),x._uU(2),x.qZA()()}if(2&e){const e=x.oxw(2);x.Q6J("ngClass",x.kEZ(8,B,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),x.xp6(1),x.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),x.xp6(1),x.Oqu(e.labels.actions.newRequest)}}function V(e,t){if(1&e&&(x.TgZ(0,"div",3)(1,"div",4),x._UZ(2,"div",5)(3,"div",6),x.ALo(4,"safeHtml"),x.qZA(),x.YNc(5,z,3,7,"div",7),x.YNc(6,J,3,12,"div",8),x.qZA()),2&e){const e=x.oxw();x.xp6(2),x.Q6J("innerHTML",e.texts.fail.title,x.oJD),x.xp6(1),x.Udp("color",e.data.styles.colors.text),x.Q6J("innerHTML",x.lcZ(4,6,e.texts.fail.description),x.oJD),x.xp6(2),x.Q6J("ngIf",e.smsFlowService.REQUEST&&"failed_with_retry"==e.smsFlowService.REQUEST_STATUS),x.xp6(1),x.Q6J("ngIf",e.smsFlowService.REQUEST&&"failed_documents_downloaded"==e.smsFlowService.REQUEST_STATUS)}}function Q(e,t){if(1&e&&(x.TgZ(0,"div",12),x._UZ(1,"mat-progress-spinner",13),x.TgZ(2,"p",14),x._uU(3),x.qZA()()),2&e){const e=x.oxw();x.xp6(1),x.Q6J("value",0),x.xp6(2),x.Oqu(e.loading)}}let W=(()=>{class e{constructor(e,t,n,i,s,r,o,a){this.smsComponent=e,this.fb=t,this.utils=n,this.solicitudesService=i,this.attachmentsService=s,this.notifications=r,this.smsFlowService=o,this.customizationStoreService=a,this.loading=null,this.retryOp=new x.vpe(null),this.newReq=new x.vpe(null)}ngOnInit(){}save(){}retry(){"SMS"===this.flowType?this.retrySmsRequest(this.smsFlowService.REQUEST.request_id):this.retryOp.emit(this.smsFlowService.REQUEST.request_id)}newRequest(){this.newReq.emit(this.smsFlowService.REQUEST.request_id)}getIfRetryIsAllowed(){return"failed_with_retry"==this.smsFlowService.REQUEST_STATUS}getIfNewRequestIsAllowed(){return"failed_documents_downloaded"==this.smsFlowService.REQUEST_STATUS}retrySmsRequest(e){let t={request_id:(this.smsFlowService.REQUEST&&this.smsFlowService.REQUEST.request_id?this.smsFlowService.REQUEST.request_id:this.requestID)||e,user_id:this.customizationStoreService.USER_ID};this.smsComponent&&this.smsComponent.showAlert(null),this.smsFlowService.setLoading(this.labels.loadings.resendingRequest),this.smsFlowService.setSubscriptionOfRequest(),this.solicitudesService.retryRequest(t).then((e=>{e&&e.data&&(this.smsFlowService.setRequest(e.data),this.smsComponent.setStatus()),this.smsFlowService.setLoading(!1)})).catch((e=>{console.error(e),this.smsComponent.showAlert("Error!",e.message||e),this.smsFlowService.setLoading(!1)}))}}return e.ɵfac=function(t){return new(t||e)(x.Y36(H.T,9),x.Y36(p.QS),x.Y36(S.F),x.Y36(_.M),x.Y36(v.o),x.Y36(C.T),x.Y36(q.p),x.Y36(j.r))},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-fail-step"]],inputs:{flowType:"flowType",requestID:"requestID",data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{retryOp:"retry",newReq:"newRequest"},decls:3,vars:4,consts:[[3,"data","customImage"],["class","animated fadeIn fixed-content",4,"ngIf"],["class","loading-wrapper flex flex-col items-center animated fadeIn",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"px-2","py-4","flex","flex-col"],[1,"text-red-500","title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","flex items-center justify-end gap-2 p-4",4,"ngIf"],["class","flex items-center gap-2 p-4",3,"ngClass",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8",3,"click"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],[1,"loading-wrapper","flex","flex-col","items-center","animated","fadeIn"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&(x._UZ(0,"belender-widget-step-logo",0),x.YNc(1,V,7,8,"div",1),x.YNc(2,Q,4,2,"div",2)),2&e&&(x.Q6J("data",t.data)("customImage",t.texts.fail.customImage),x.xp6(1),x.Q6J("ngIf",!t.loading),x.xp6(1),x.Q6J("ngIf",t.loading))},dependencies:[i.mk,i.O5,u.lW,y.Ou,T.y,M.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var G=n(5439),$=n.n(G),K=(n(6866),n(3238)),X=n(3755),ee=n(3746),te=n(2932),ne=n(769),ie=n(4246),se=n(5412),re=n(1763),oe=n(5696),ae=n(1094);const le=["termsCheckbox"],ce=["policyCheckbox"],de=["assignmentCheckbox"];function ue(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw();x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.needDNI," ")}}function he(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw();x.xp6(1),x.hij(" ",e.errorDNI," ")}}function pe(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw();x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.needBirthDate," ")}}function me(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw();x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.invalidDateFormat," ")}}function fe(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw();x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.invalidDate," ")}}function ge(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw();x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.underAge," ")}}function _e(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw(2);x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.invalidDateFormat," ")}}function be(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw(2);x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.invalidDate," ")}}function ve(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw(2);x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.underAge," ")}}function ye(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"mat-form-field",22)(1,"mat-label"),x._uU(2),x.qZA(),x._UZ(3,"input",23),x.TgZ(4,"mat-hint")(5,"a",24),x.NdJ("click",(function(t){x.CHM(e);const n=x.oxw();return x.KtG(n.gotoExpirationDate(t))})),x.TgZ(6,"u"),x._uU(7),x.qZA()()(),x.YNc(8,_e,2,1,"mat-error",8),x.YNc(9,be,2,1,"mat-error",8),x.YNc(10,ve,2,1,"mat-error",8),x.qZA()}if(2&e){const e=x.oxw();let t,n,i;x.xp6(2),x.Oqu(e.labels.expiration),x.xp6(1),x.uIk("aria-label",e.labels.expiration),x.xp6(4),x.Oqu(e.labels.findExpiration),x.xp6(1),x.Q6J("ngIf",null==(t=e.form.get("document_expiration"))?null:t.hasError("invalidFormat")),x.xp6(1),x.Q6J("ngIf",null==(n=e.form.get("document_expiration"))?null:n.hasError("invalidDate")),x.xp6(1),x.Q6J("ngIf",null==(i=e.form.get("document_expiration"))?null:i.hasError("underAge"))}}function we(e,t){if(1&e&&(x.TgZ(0,"mat-form-field",22)(1,"mat-label"),x._uU(2),x.qZA(),x._UZ(3,"input",25),x.qZA()),2&e){const e=x.oxw();x.xp6(2),x.Oqu(e.labels.support),x.xp6(1),x.uIk("aria-label",e.labels.support)}}function xe(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw();x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.needPhone," ")}}function Se(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw();x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.phoneDigitsRequired," ")}}function Ce(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw(2);x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.requiredEmail," ")}}function Te(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw(2);x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.invalidEmail," ")}}function ke(e,t){if(1&e&&(x.TgZ(0,"div",26)(1,"mat-form-field",6)(2,"mat-label"),x._uU(3),x.qZA(),x._UZ(4,"input",27),x.YNc(5,Ce,2,1,"mat-error",8),x.YNc(6,Te,2,1,"mat-error",8),x.qZA()()),2&e){const e=x.oxw();let t,n;x.xp6(1),x.Gre("",e.disabledInputs.email?"disabled-input":""," w-full flex-1 belender-form-field"),x.xp6(2),x.Oqu(e.labels.email),x.xp6(1),x.s9C("tabindex",e.disabledInputs.email?-1:1),x.s9C("placeholder",e.labels.inputEmail),x.uIk("aria-label",e.labels.email),x.xp6(1),x.Q6J("ngIf",null==(t=e.form.get("email"))?null:t.hasError("required")),x.xp6(1),x.Q6J("ngIf",null==(n=e.form.get("email"))?null:n.hasError("email"))}}function Me(e,t){if(1&e&&(x.TgZ(0,"div",28),x._UZ(1,"mat-icon",29),x._uU(2),x.qZA()),2&e){const e=x.oxw();x.xp6(2),x.hij(" ",e.labels.warnings.haveToReadTerms," ")}}function Ie(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"div",30)(1,"belender-checkbox",31,32),x.NdJ("changeCheckbox",(function(t){x.CHM(e);const n=x.oxw();return x.KtG(n.setTerms(t))})),x.TgZ(3,"belender-terms-and-policy-links",33),x.NdJ("goToTerms",(function(t){x.CHM(e);const n=x.oxw();return x.KtG(n.gotoTermsAndConditions(t))})),x.qZA()()()}if(2&e){const e=x.oxw();x.xp6(1),x.Q6J("color",e.data.styles.colors.title),x.xp6(2),x.Q6J("userId",e.userId)("lang",e.lang)("flowName",e.flowName)("data",e.data)("linkType","terms")("firstSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.firstSentence)("secondSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.secondSentence)("thirdSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.thirdSentence)("policyActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.policyActionText)("termsActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.termsActionText)("customTerms",e.data[e.flowName].customTerms)}}function Ee(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"div",30)(1,"belender-checkbox",34,35),x.NdJ("changeCheckbox",(function(t){x.CHM(e);const n=x.oxw();return x.KtG(n.setPolicy(t))})),x._UZ(3,"belender-terms-and-policy-links",36),x.qZA()()}if(2&e){const e=x.oxw();x.xp6(1),x.Q6J("color",e.data.styles.colors.title),x.xp6(2),x.Q6J("userId",e.userId)("lang",e.lang)("flowName",e.flowName)("data",e.data)("linkType","policy")("policyActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.policyActionText)}}function Ae(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"div",30)(1,"belender-checkbox",37,38),x.NdJ("changeCheckbox",(function(t){x.CHM(e);const n=x.oxw();return x.KtG(n.setAssignment(t))})),x._UZ(3,"div",39),x.qZA()()}if(2&e){const e=x.oxw();x.xp6(1),x.Q6J("color",e.data.styles.colors.title),x.xp6(2),x.Q6J("innerHTML",(null==e.data[e.flowName]||null==e.data[e.flowName].texts?null:e.data[e.flowName].texts.dataAssignmentText)||(null==e.data[e.flowName]||null==e.data[e.flowName].config_translate?null:e.data[e.flowName].config_translate.dataAssignmentText)||(null==e.data||null==e.data.config?null:e.data.config.dataAssignmentText)||"",x.oJD)}}function Oe(e,t){if(1&e&&(x.TgZ(0,"div",40),x._UZ(1,"mat-icon",29),x._uU(2),x.qZA()),2&e){const e=x.oxw();x.xp6(2),x.hij(" ",e.errorDNI," ")}}function Le(e,t){if(1&e&&(x.TgZ(0,"div",41)(1,"strong",42),x._uU(2),x.qZA(),x.TgZ(3,"span",43),x._uU(4),x.qZA()()),2&e){const e=x.oxw();x.xp6(2),x.Oqu(e.labels.warnings.wrongDate||"Error"),x.xp6(2),x.Oqu(e.dateError)}}function De(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"button",44),x.NdJ("click",(function(){x.CHM(e);const t=x.oxw();return x.KtG(t.goBack())})),x._uU(1),x.qZA()}if(2&e){const e=x.oxw();x.Udp("border-radius",e.data.styles.btnRound+"px"),x.xp6(1),x.hij(" ",e.labels.actions.back," ")}}function Pe(e,t){if(1&e&&(x.TgZ(0,"div",45),x._UZ(1,"mat-progress-spinner",46),x.TgZ(2,"p",47),x._uU(3),x.qZA()()),2&e){const e=x.oxw();x.xp6(1),x.Q6J("value",0),x.xp6(2),x.hij(" ",e.loading," ")}}const Ne=function(e){return{"dont-show-data":e}},qe=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Re=(()=>{class e{constructor(e,t,n,i,s,r,o,a,l,c){this.smsComponent=e,this.fb=t,this.utils=n,this.cd=i,this.widgetUtils=s,this.dialog=r,this.customService=o,this.smsFlowService=a,this.solicitudesService=l,this.customizationStoreService=c,this.editable_dates=!1,this.next=new x.vpe(null),this.goTerms=new x.vpe(null),this.goIntro=new x.vpe(null),this.acceptTerms=!1,this.acceptPolicy=!1,this.assignment=!1,this.termsReaded=!1,this.isDni=!1,this.isNie=!1,this.errorDNI=null,this.disabledInputs={document_number:!1,birth_date:!1,email:!1,phone:!1},this.noValidate=!1,this.testMode=!0,this.submitAttempted=!1,this.lang="",this.hasDateError=!1,this.dateError=""}ngOnInit(){this.packId=this.customizationStoreService.PACK_ID,this.userId=this.customizationStoreService.USER_ID,this.smsFlowService.REQUEST?(this.noValidate="terms_and_conditions"==this.smsFlowService.REQUEST_STATUS,this.setForm(this.smsFlowService.REQUEST)):this.setForm(null)}setTermsCheck(e){this.checkComponent.checked=e,this.acceptTerms=e,this.termsReaded=e}setForm(e){let t=e?e.person_document_number||e.dni||e.document_number:null,n=e&&e.person_birth_date?$()(e.person_birth_date).format("DD/MM/YYYY"):null,i=e&&e.birth_date?$()(e.birth_date).format("DD/MM/YYYY"):n,s=e?e.person_phone||e.phone:null,r=e?e.person_email||e.email:null;t&&this.setRegex(t);const o=this;o.form=o.fb.group(o.data&&o.data.config&&o.data.config.followMail?{document_number:[t||null,o.noValidate?[]:[p.kI.required,p.kI.maxLength(9),o.regexDNI()]],birth_date:[i||null,o.noValidate?[]:[p.kI.required,(0,te.s)({checkFormat:!0,checkDate:!0,checkAge:!0})]],type:["DNI"],phone:[s||"",o.noValidate?[]:[p.kI.required,p.kI.maxLength(9),p.kI.minLength(9)]],email:[r||null,o.noValidate?[]:[p.kI.required,p.kI.email]],document_expiration:[null,[(0,te.s)({checkFormat:!0,checkDate:!0})]],support_number:[null]}:{document_number:[t||null,o.noValidate?[]:[p.kI.required,p.kI.maxLength(9),o.regexDNI()]],birth_date:[i||null,o.noValidate?[]:[p.kI.required,(0,te.s)({checkFormat:!0,checkDate:!0,checkAge:!0})]],type:["DNI"],phone:[s||"",o.noValidate?[]:[p.kI.required,p.kI.maxLength(9),p.kI.minLength(9)]],email:[r||null],document_expiration:[null,[(0,te.s)({checkFormat:!0,checkDate:!0,checkAge:!0})]],support_number:[null]}),this.form.markAsUntouched(),this.form.updateValueAndValidity(),o.requestIDFromURL&&o.disableEnableInputs(t,n,s,r)}forceEnableDisableInputs(e,t,n,i){this.disableEnableInputs(e?e.value:this.disabledInputs.document_number,t?t.value:this.disabledInputs.birth_date,n?n.value:this.disabledInputs.phone,i?i.value:this.disabledInputs.email)}disableEnableInputs(e,t,n,i){this.disabledInputs={document_number:e||!1,birth_date:!this.editable_dates&&(t||!1),email:i||!1,phone:n||!1}}regexDNI(){return e=>{const t=e.value;return t?(this.setRegex(t),this.isDni||this.isNie?null:{regexDNI:!0}):null}}gotoTermsAndConditions(e){e?.preventDefault(),e?.stopPropagation(),this.termsReaded=!0,this.goTerms.emit(!0)}setRegex(e){if(!e)return;let t=this.widgetUtils.ValidateIDType(e);t&&t.type?("dni"===t.type?(this.isDni=!0,this.errorDNI=t.valid?null:this.labels?.warnings?.invalidDni):this.isDni=!1,"nie"===t.type?(this.isNie=!0,this.errorDNI=t.valid?null:this.labels?.warnings?.invalidNie):this.isNie=!1):(this.isDni=!1,this.isNie=!1,this.errorDNI=this.labels?.warnings?.invalidNieOrDni),this.cd.markForCheck()}setTerms(e){this.acceptTerms=e,this.acceptTerms&&(this.data?.config??{}).forceChecks?this.gotoTermsAndConditions():this.acceptTerms||(this.termsReaded=!1)}setPolicy(e){this.acceptPolicy=e}setAssignment(e){this.assignment=e}getIfValid(){if(this.data.config.hideCheckLegal)return!this.data?.config?.showPolicyLink||this.acceptPolicy;{const e=!!this.data?.config?.showPolicyLink;return this.acceptTerms&&(!e||this.acceptPolicy)}}getFormsValid(){let e=!this.form.invalid,t=this.form.get("document_number").value;return t?this.setRegex(t):e=!1,!this.isDni&&!this.isNie&&(this.disabledInputs.document_number=!1,e=!1),this.errorDNI&&(e=!1),this.cd.markForCheck(),e}nextStep(){if(!this.getFormsValid()||!this.getAssignmentValidation()||!this.getIfValid())return void(0,ne.J)(this,this.cd);let e;e=this.data&&this.data.config&&this.data.config.followMail?{document_number:this.form.get("document_number").value.toUpperCase(),birth_date:this.utils.formatDate(this.form.get("birth_date").value),type:this.form.get("type").value,phone:this.form.get("phone").value,email_copy:this.form.get("email").value,check_legal:!0,document_expiration_date:this.form.get("document_expiration")?this.utils.formatDate(this.form.get("document_expiration").value):"2029-04-11"}:{document_number:this.form.get("document_number").value.toUpperCase(),birth_date:this.utils.formatDate(this.form.get("birth_date").value),type:this.form.get("type").value,phone:this.form.get("phone").value,check_legal:!0,email_copy:"roger.checa@belender.eu",document_expiration_date:this.form.get("document_expiration")?this.utils.formatDate(this.form.get("document_expiration").value):"2029-04-11"},"SMS"===this.flowName?this.gotoSmsTerms(e):this.next.emit(e)}getAssignmentValidation(){return!(this.data.config.forceChecks&&!this.data.config.hideCheckLegal&&!this.termsReaded)&&(!this.data.config.dataAssignmentCheck||this.assignment)}goBack(){"SMS"===this.flowName?this.goSmsIntro():this.goIntro.emit(!0)}gotoSupportAclaration(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(X.$,{panelClass:"fullscreen-dialog"})}gotoExpirationDate(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(ee.R,{panelClass:"fullscreen-dialog"})}gotoSmsTerms(e){this.smsFlowService.setLoading(this.labels.loadings.sendingData),e.package_id=this.packId,e.user_id=this.userId,this.requestID&&(e.request_id=this.requestID),this.skipCreationOfRequest?(this.smsComponent.acceptTerms(),this.smsFlowService.setSubscriptionOfRequest()):this.checkSmsService(e)}goSmsIntro(){this.smsComponent.manual=!1,this.smsComponent.introEnabled=!0}checkSmsService(e){this.hasDateError=!1,this.forceEnableDisableInputs({value:!0},{value:!0},{value:!0},{value:!0}),this.solicitudesService.checkService(e).then((t=>{console.warn(t),t&&t.message&&t.status&&"error"==t.status?t.message.birth_date?(this.smsFlowService.setLoading(null),this.smsComponent.setRequestStatus("form"),this.hasDateError=!0,this.dateError=this.labels.warnings.wrongDate,this.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1})):"string"==typeof t.message&&" fecha de nacimiento incorrecta"==t.message.toLowerCase()?(this.smsFlowService.setLoading(null),this.smsComponent.setRequestStatus("form"),this.hasDateError=!0,this.dateError=this.labels.warnings.wrongDateDesc,this.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1})):"string"==typeof t.message&&"does not have sms service"==t.message.toLowerCase()?(this.smsFlowService.setLoading(this.labels.loadings.creatingRequest),e.user_id=this.userId,e.package_id=this.packId,this.requestID&&(e.request_id=this.requestID),this.solicitudesService.addSolicitud(e).then((e=>{console.warn(e),e.data&&this.smsFlowService.updateRequestID(e.data.request_id),this.solicitudesService.setNoService({request_id:this.requestID}).then((()=>{this.smsFlowService.setLoading(null)})),this.smsComponent.setRequestStatus("no_service"),this.smsComponent.setStatus()}))):"string"==typeof t.message&&"birthdate incorrect"==t.message.toLowerCase()?(this.smsFlowService.setLoading(null),this.smsComponent.setRequestStatus("form"),this.hasDateError=!0,this.dateError=this.labels.warnings.wrongDateDesc,this.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1})):(this.smsComponent.setRequestStatus("form"),this.smsComponent.setStatus(),this.smsFlowService.setLoading(null)):t&&t.status&&"success"==t.status?this.smsComponent.addSolicitudSMS(e):(this.smsFlowService.setLoading(null),this.smsComponent.setRequestStatus("form"),this.smsComponent.setStatus(),this.dateError=t.message||t)})).catch((e=>{console.error(e),this.smsFlowService.setLoading(null),e.message&&"birthdate incorrect"==e.message.toLowerCase()&&(this.smsComponent.setRequestStatus("form"),this.hasDateError=!0,this.dateError=this.labels.warnings.wrongDateDesc)}))}}return e.ɵfac=function(t){return new(t||e)(x.Y36(H.T,9),x.Y36(p.QS),x.Y36(S.F),x.Y36(x.sBO),x.Y36(ie.t),x.Y36(se.uw),x.Y36(N.w),x.Y36(q.p),x.Y36(_.M),x.Y36(j.r))},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-form-step"]],viewQuery:function(e,t){if(1&e&&(x.Gf(le,5),x.Gf(ce,5),x.Gf(de,5)),2&e){let e;x.iGM(e=x.CRH())&&(t.checkComponent=e.first),x.iGM(e=x.CRH())&&(t.policyCheckComponent=e.first),x.iGM(e=x.CRH())&&(t.assignmentCheckComponent=e.first)}},inputs:{requestID:"requestID",data:"data",flowName:"flowName",texts:"texts",pinMode:"pinMode",requestIDFromURL:"requestIDFromURL",editable_dates:"editable_dates",skipCreationOfRequest:"skipCreationOfRequest",labels:"labels",lang:"lang"},outputs:{next:"nextStep",goTerms:"goToTerms",goIntro:"goIntro"},features:[x._Bn([{provide:K.sG,useValue:{parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}}}])],decls:42,vars:68,consts:[[3,"data","customImage"],[3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4","custom-html",3,"innerHTML"],[1,"mb-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between",3,"ngClass"],["appearance","outline"],["placeholder","Ej: 12312345R","formControlName","document_number","maxlength","9","matInput","",3,"tabindex"],[4,"ngIf"],["type","text","placeholder","Ej: 22/03/1990","formControlName","birth_date","matInput","","mask","d0/M0/0000",3,"tabindex"],["appearance","outline","class","w-full flex-1 belender-form-field",4,"ngIf"],["formControlName","phone","placeholder","Ej: 123123123","maxlength","9","type","text","matInput","",3,"tabindex"],["class","w-full",4,"ngIf"],[1,"mb-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["class","px-2 flex items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500",4,"ngIf"],["class","flex justify-start items-center w-full flex-100",4,"ngIf"],["class","pl-3 pr-4 flex w-fit items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500",4,"ngIf"],["class","bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative","role","alert",4,"ngIf"],[1,"flex","items-center","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["class","px-8 py-1 bg-slate-100 hover:bg-slate-200 text-slate-900 w-full max-w-none md:max-w-[220px]","mat-flat-button","","type","button",3,"border-radius","click",4,"ngIf"],["mat-flat-button","","type","button",1,"px-8","py-1","w-full","max-w-none","md:max-w-[220px]",3,"click"],["class","loading-wrapper flex flex-col items-center animated fadeIn",4,"ngIf"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["type","text","placeholder","Ej: 22/03/1990","required","","formControlName","document_expiration","matInput","","mask","d0/M0/0000"],["target","_blank",1,"text-sm","hover:text-blue-500","cursor-pointer",3,"click"],["type","text","placeholder","22211134","required","","formControlName","support_number","matInput",""],[1,"w-full"],["formControlName","email","type","email","matInput","",3,"tabindex","placeholder"],[1,"px-2","flex","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"],["svgIcon","mat:warning",1,"text-xs","w-4","h-4"],[1,"flex","justify-start","items-center","w-full","flex-100"],["id","termsCheckbox",3,"color","changeCheckbox"],["termsCheckbox",""],[3,"userId","lang","flowName","data","linkType","firstSentence","secondSentence","thirdSentence","policyActionText","termsActionText","customTerms","goToTerms"],["id","policyCheckbox",3,"color","changeCheckbox"],["policyCheckbox",""],[3,"userId","lang","flowName","data","linkType","policyActionText"],[3,"color","changeCheckbox"],["assignmentCheckbox",""],[1,"custom-html",3,"innerHTML"],[1,"pl-3","pr-4","flex","w-fit","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"],["role","alert",1,"bg-red-100","border","border-red-400","text-red-700","px-4","py-3","rounded","relative"],[1,"font-bold","mr-1"],[1,"block","sm:inline"],["mat-flat-button","","type","button",1,"px-8","py-1","bg-slate-100","hover:bg-slate-200","text-slate-900","w-full","max-w-none","md:max-w-[220px]",3,"click"],[1,"loading-wrapper","flex","flex-col","items-center","animated","fadeIn"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){if(1&e&&(x._UZ(0,"belender-widget-step-logo",0),x.TgZ(1,"form",1)(2,"div",2),x._UZ(3,"div",3)(4,"div",4),x.ALo(5,"safeHtml"),x.qZA(),x.TgZ(6,"div",5)(7,"mat-form-field",6)(8,"mat-label"),x._uU(9),x.qZA(),x._UZ(10,"input",7),x.YNc(11,ue,2,1,"mat-error",8),x.YNc(12,he,2,1,"mat-error",8),x.qZA(),x.TgZ(13,"mat-form-field",6)(14,"mat-label"),x._uU(15),x.qZA(),x._UZ(16,"input",9),x.YNc(17,pe,2,1,"mat-error",8),x.YNc(18,me,2,1,"mat-error",8),x.YNc(19,fe,2,1,"mat-error",8),x.YNc(20,ge,2,1,"mat-error",8),x.qZA(),x.YNc(21,ye,11,6,"mat-form-field",10),x.YNc(22,we,4,2,"mat-form-field",10),x.TgZ(23,"mat-form-field",6)(24,"mat-label"),x._uU(25),x.qZA(),x._UZ(26,"input",11),x.YNc(27,xe,2,1,"mat-error",8),x.YNc(28,Se,2,1,"mat-error",8),x.qZA(),x.YNc(29,ke,7,9,"div",12),x.qZA(),x.TgZ(30,"div",13),x.YNc(31,Me,3,1,"div",14),x.YNc(32,Ie,4,12,"div",15),x.YNc(33,Ee,4,7,"div",15),x.YNc(34,Ae,4,2,"div",15),x.YNc(35,Oe,3,1,"div",16),x.qZA(),x.YNc(36,Le,5,2,"div",17),x.TgZ(37,"div",18),x.YNc(38,De,2,3,"button",19),x.TgZ(39,"button",20),x.NdJ("click",(function(){return t.nextStep()})),x._uU(40),x.qZA()()(),x.YNc(41,Pe,4,2,"div",21)),2&e){let e,n,i,s,r,o,a,l;x.Q6J("data",t.data)("customImage",t.texts.form.customImage),x.xp6(1),x.Gre("animated ",t.loading?"hide-content":""," fadeIn fixed-content px-2"),x.Q6J("formGroup",t.form),x.xp6(2),x.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),x.Q6J("innerHTML",t.texts.form.title,x.oJD),x.xp6(1),x.Udp("color",t.data.styles.colors.text),x.Q6J("innerHTML",x.lcZ(5,60,t.texts.form.description||""),x.oJD),x.xp6(2),x.Q6J("ngClass",x.VKq(62,Ne,t.data.config.dontShowDataInTerms&&t.smsFlowService.REQUEST&&t.smsFlowService.REQUEST_STATUS&&"terms_and_conditions"===t.smsFlowService.REQUEST_STATUS)),x.xp6(1),x.Gre("",t.disabledInputs.document_number?"disabled-input":""," w-full flex-1 belender-form-field"),x.xp6(2),x.Oqu(t.isDni?t.labels.dni:t.isNie?t.labels.nie:t.labels.nieOrDni),x.xp6(1),x.s9C("tabindex",t.disabledInputs.document_number?-1:1),x.uIk("aria-label",t.isDni?t.labels.dni:t.isNie?t.labels.nie:t.labels.nieOrDni),x.xp6(1),x.Q6J("ngIf",null==(e=t.form.get("document_number"))?null:e.hasError("required")),x.xp6(1),x.Q6J("ngIf",!(null!=(n=t.form.get("document_number"))&&n.hasError("required"))&&t.errorDNI),x.xp6(1),x.Gre("",t.disabledInputs.birth_date?"disabled-input":""," w-full flex-1 belender-form-field"),x.xp6(2),x.Oqu(t.labels.birthday),x.xp6(1),x.s9C("tabindex",t.disabledInputs.birth_date?-1:1),x.uIk("aria-label",t.labels.birthday),x.xp6(1),x.Q6J("ngIf",null==(i=t.form.get("birth_date"))?null:i.hasError("required")),x.xp6(1),x.Q6J("ngIf",null==(s=t.form.get("birth_date"))?null:s.hasError("invalidFormat")),x.xp6(1),x.Q6J("ngIf",null==(r=t.form.get("birth_date"))?null:r.hasError("invalidDate")),x.xp6(1),x.Q6J("ngIf",null==(o=t.form.get("birth_date"))?null:o.hasError("underAge")),x.xp6(1),x.Q6J("ngIf",t.pinMode&&!t.isNie),x.xp6(1),x.Q6J("ngIf",t.pinMode&&t.isNie),x.xp6(1),x.Gre("",t.disabledInputs.phone?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),x.xp6(2),x.Oqu(t.labels.phone),x.xp6(1),x.s9C("tabindex",t.disabledInputs.phone?-1:1),x.uIk("aria-label",t.labels.phone),x.xp6(1),x.Q6J("ngIf",null==(a=t.form.get("phone"))?null:a.hasError("required")),x.xp6(1),x.Q6J("ngIf",(null==(l=t.form.get("phone"))?null:l.hasError("minlength"))||(null==(l=t.form.get("phone"))?null:l.hasError("maxlength"))),x.xp6(1),x.Q6J("ngIf",null==t.data||null==t.data.config?null:t.data.config.followMail),x.xp6(2),x.Q6J("ngIf",t.submitAttempted&&!t.data.config.hideCheckLegal&&!t.acceptTerms),x.xp6(1),x.Q6J("ngIf",!t.data.config.hideCheckLegal),x.xp6(1),x.Q6J("ngIf",null==t.data||null==t.data.config?null:t.data.config.showPolicyLink),x.xp6(1),x.Q6J("ngIf",null==t.data?null:t.data.config.dataAssignmentCheck),x.xp6(1),x.Q6J("ngIf",t.errorDNI),x.xp6(1),x.Q6J("ngIf",t.hasDateError),x.xp6(1),x.Q6J("ngClass",x.kEZ(64,qe,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),x.xp6(1),x.Q6J("ngIf",t.data.config.introEnabled),x.xp6(1),x.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),x.xp6(1),x.hij(" ",t.labels.actions.continue," "),x.xp6(1),x.Q6J("ngIf",t.loading)}},dependencies:[i.mk,i.O5,d.Hw,u.lW,R.TO,R.KE,R.bx,R.hX,P.Nt,p._Y,p.Fj,p.JJ,p.JL,p.Q7,p.nD,p.sg,p.u,y.Ou,re.b,T.y,oe.T,ae.Z6,M.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.dont-show-data[_ngcontent-%COMP%]{opacity:0!important;padding:0!important;overflow:hidden!important;height:0px!important;margin:0!important}.hide-content[_ngcontent-%COMP%]{opacity:0!important;max-height:0px!important;overflow:hidden!important;padding:0!important}"]}),e})();var Ye=n(9602),Fe=n(6257),Ue=n(1948),Ze=n(8594);const He=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let je=(()=>{class e{constructor(e,t,n,i,s,r,o){this.smsComponent=e,this.fb=t,this.utils=n,this.Activatedroute=i,this.smsFlowService=s,this.solicitudesService=r,this.cd=o,this.next=new x.vpe(null),this.loading=null,this.accept=!1}ngOnInit(){this.Activatedroute.queryParams.subscribe((e=>{this.setForm(e)}))}nextStep(){let e={phone:this.form.get("phone").value};"SMS"===this.flowName?this.sendSmsNewData(e):this.next.emit(e)}setForm(e){this.form=this.fb.group({phone:["",p.kI.required]}),this.smsFlowService.REQUEST&&"bad_phone"==this.smsFlowService.REQUEST_STATUS&&this.form.controls.phone.markAsTouched()}sendSmsNewData(e){this.smsFlowService.setLoading(this.labels.loadings.sendingData),this.solicitudesService.fixData(this.requestID,e).then((e=>{e.status&&"error"==e.status?e.message&&(this.smsComponent.showAlert("Error!",e.message,"error"),this.smsFlowService.setLoading(!1)):e&&"success"==e.status&&(this.smsFlowService.sendMessageToParent({type:"response",data:e.data||e}),this.smsFlowService.setLoading(this.labels.loadings.validatingData),this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.smsComponent.showAlert("Error!",e.error),this.smsFlowService.setLoading(!1)}))}}return e.ɵfac=function(t){return new(t||e)(x.Y36(H.T,9),x.Y36(p.QS),x.Y36(S.F),x.Y36(Ze.gz),x.Y36(q.p),x.Y36(_.M),x.Y36(x.sBO))},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-error-form-step"]],inputs:{requestID:"requestID",data:"data",flowName:"flowName",texts:"texts",mode:"mode",loading:"loading",labels:"labels"},outputs:{next:"nextStep"},decls:14,vars:23,consts:[[1,"animated","fadeIn","fixed-content",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"mb-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline",1,"mb-4","w-full","flex-1"],["formControlName","phone","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(x.TgZ(0,"form",0)(1,"div",1)(2,"div",2),x._uU(3),x.qZA(),x.TgZ(4,"div",3),x._uU(5),x.qZA()(),x.TgZ(6,"div",4)(7,"mat-form-field",5)(8,"mat-label"),x._uU(9),x.qZA(),x._UZ(10,"input",6),x.qZA()(),x.TgZ(11,"div",7)(12,"button",8),x.NdJ("click",(function(){return t.nextStep()})),x._uU(13),x.qZA()()()),2&e&&(x.Q6J("formGroup",t.form),x.xp6(2),x.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),x.xp6(1),x.Oqu(t.labels.warnings.phoneError),x.xp6(1),x.Udp("color",t.data.styles.colors.text),x.xp6(1),x.Oqu(t.labels.warnings.badPhoneSS),x.xp6(4),x.Oqu(t.labels.phone),x.xp6(2),x.Q6J("ngClass",x.kEZ(19,He,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),x.xp6(1),x.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),x.Q6J("disabled",t.form.invalid),x.xp6(1),x.Oqu(t.labels.actions.continue))},dependencies:[i.mk,u.lW,R.KE,R.hX,P.Nt,p._Y,p.Fj,p.JJ,p.JL,p.sg,p.u],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var ze=n(6e3);const Be=[{path:":idUser",component:H.T},{path:":idUser/:packID",component:H.T}];let Je=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=x.oAB({type:e}),e.ɵinj=x.cJS({imports:[Ze.Bz.forChild(Be),Ze.Bz,ze.d8]}),e})(),Ve=(()=>{class e{constructor(){this.loading=null}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-no-service-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},decls:6,vars:12,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&(x._UZ(0,"belender-widget-step-logo",0),x.TgZ(1,"form",1)(2,"div",2),x._UZ(3,"div",3)(4,"div",4),x.ALo(5,"safeHtml"),x.qZA()()),2&e&&(x.Q6J("data",t.data)("customImage",t.texts.noService.customImage),x.xp6(3),x.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),x.Q6J("innerHTML",t.texts.noService.title,x.oJD),x.xp6(1),x.Udp("color",t.data.styles.colors.text),x.Q6J("innerHTML",x.lcZ(5,10,t.texts.noService.description),x.oJD))},dependencies:[p._Y,p.JL,p.F,T.y,M.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const Qe=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let We=(()=>{class e{constructor(e,t,n,i,s,r,o,a){this.smsComponent=e,this.fb=t,this.utils=n,this.solicitudesService=i,this.attachmentsService=s,this.notifications=r,this.smsFlowService=o,this.customizationStoreService=a,this.retryOp=new x.vpe(null),this.loading=null}ngOnInit(){}save(){}retry(){this.smsComponent?.showAlert(null),"SMS"===this.flowType?this.retrySmsRequest(this.smsFlowService.REQUEST.request_id):this.retryOp.emit(this.smsFlowService.REQUEST.request_id)}getTextStatus(){switch(this.smsFlowService.REQUEST_STATUS){case"abandoned_after_waiting_otp_seguridad_social":return this.labels.abandoned.afterWaitingOtpSS;case"abandoned_after_invalid_otp_seguridad_social":return this.labels.abandoned.afterInvalidOtpSS;case"abandoned_after_invalid_otp_aeat":return this.labels.abandoned.afterInvalidOtpAEAT;case"abandoned_after_waiting_otp_aeat":return this.labels.abandoned.afterWaitingOtpAEAT;default:return this.smsFlowService.REQUEST.status_message||this.smsFlowService.REQUEST_STATUS}}retrySmsRequest(e){let t={request_id:(this.smsFlowService.REQUEST&&this.smsFlowService.REQUEST.request_id?this.smsFlowService.REQUEST.request_id:this.requestID)||e,user_id:this.customizationStoreService.USER_ID};this.smsFlowService.setLoading(this.labels.loadings.resendingRequest),this.smsFlowService.setSubscriptionOfRequest(),this.solicitudesService.retryRequest(t).then((e=>{e&&e.data&&(this.smsFlowService.setRequest(e.data),this.smsComponent.setStatus()),this.smsFlowService.setLoading(!1)})).catch((e=>{console.error(e),this.smsComponent.showAlert("Error!",e.message||e),this.smsFlowService.setLoading(!1)}))}}return e.ɵfac=function(t){return new(t||e)(x.Y36(H.T,9),x.Y36(p.QS),x.Y36(S.F),x.Y36(_.M),x.Y36(v.o),x.Y36(C.T),x.Y36(q.p),x.Y36(j.r))},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-abandoned-step"]],inputs:{flowType:"flowType",requestID:"requestID",loading:"loading",labels:"labels",data:"data",texts:"texts"},outputs:{retryOp:"retry"},decls:11,vars:25,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"p-1","px-4","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm","mb-2","mt-6"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(x._UZ(0,"belender-widget-step-logo",0),x.TgZ(1,"div",1)(2,"div",2),x._UZ(3,"div",3)(4,"div",4),x.ALo(5,"safeHtml"),x.TgZ(6,"div",5),x._uU(7),x.qZA()(),x.TgZ(8,"div",6)(9,"button",7),x.NdJ("click",(function(){return t.retry()})),x._uU(10),x.qZA()()()),2&e&&(x.Q6J("data",t.data)("customImage",t.texts.abandoned.customImage),x.xp6(3),x.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),x.Q6J("innerHTML",t.texts.abandoned.title,x.oJD),x.xp6(1),x.Udp("color",t.data.styles.colors.text),x.Q6J("innerHTML",x.lcZ(5,19,t.texts.abandoned.description),x.oJD),x.xp6(3),x.hij(" ",t.getTextStatus()," "),x.xp6(1),x.Q6J("ngClass",x.kEZ(21,Qe,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),x.xp6(1),x.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),x.xp6(1),x.Oqu(t.labels.actions.retry))},dependencies:[i.mk,u.lW,T.y,M.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Ge=n(6981),$e=n(5145);const Ke=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Xe=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.nr=new x.vpe(null),this.loading=null}ngOnInit(){}newRequest(){this.nr.emit(!0)}gotoRequest(){location.assign(this.currentRequest.widget_url_boxed)}getStatus(){let e=$e.Z.find((e=>e.text==this.currentRequest.status_code));return e?e.label:this.labels.unknownState}}return e.ɵfac=function(t){return new(t||e)(x.Y36(p.QS),x.Y36(S.F),x.Y36(_.M),x.Y36(v.o),x.Y36(C.T))},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-duplicated-request-step"]],inputs:{currentRequest:"currentRequest",loading:"loading",data:"data",texts:"texts",labels:"labels"},outputs:{nr:"newRequest"},decls:16,vars:26,consts:[[3,"data"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"flex","gap-2","justify-start","items-center","py-2"],[1,"w-fit","p-1","px-2","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8",3,"click"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(x._UZ(0,"belender-widget-step-logo",0),x.TgZ(1,"div",1)(2,"div",2)(3,"div",3),x._uU(4),x.qZA(),x.TgZ(5,"div",4),x._uU(6),x.qZA(),x.TgZ(7,"div",5),x._uU(8),x.TgZ(9,"div",6),x._uU(10),x.qZA()()(),x.TgZ(11,"div",7)(12,"button",8),x.NdJ("click",(function(){return t.newRequest()})),x._uU(13),x.qZA(),x.TgZ(14,"button",9),x.NdJ("click",(function(){return t.gotoRequest()})),x._uU(15),x.qZA()()()),2&e&&(x.Q6J("data",t.data),x.xp6(3),x.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),x.xp6(1),x.hij(" ",t.labels.warnings.duplicatedRequest," "),x.xp6(1),x.Udp("color",t.data.styles.colors.text),x.xp6(1),x.hij(" ",t.labels.warnings.alreadyHaveRequest," "),x.xp6(2),x.hij(" ",t.labels.warnings.currentRequestStatus," "),x.xp6(2),x.hij(" ",t.getStatus()," "),x.xp6(1),x.Q6J("ngClass",x.kEZ(22,Ke,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),x.xp6(1),x.Udp("border-radius",t.data.styles.btnRound+"px"),x.xp6(1),x.hij(" ",t.labels.actions.newRequest," "),x.xp6(1),x.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),x.xp6(1),x.hij(" ",t.labels.actions.gotoCurrentRequest," "))},dependencies:[i.mk,u.lW,T.y],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var et=n(1129),tt=n(9476),nt=n(8962),it=n(3468),st=n(3295);let rt=(()=>{class e{constructor(){this.loading=null}ngOnInit(){console.error(this.data,this.texts)}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-standby-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},decls:6,vars:12,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&(x._UZ(0,"belender-widget-step-logo",0),x.TgZ(1,"form",1)(2,"div",2),x._UZ(3,"div",3)(4,"div",4),x.ALo(5,"safeHtml"),x.qZA()()),2&e&&(x.Q6J("data",t.data)("customImage",t.texts.standby.customImage),x.xp6(3),x.Udp("color",t.data.styles.colors.title)("font-size",t.texts.standby?t.texts.standby.titleSize+"px":"20px"),x.Q6J("innerHTML",t.texts.standby?t.texts.standby.title:"Solicitud en Stand By",x.oJD),x.xp6(1),x.Udp("color",t.data.styles.colors.text),x.Q6J("innerHTML",t.texts.standby?t.texts.standby.description:x.lcZ(5,10,"Descripcion del estado Stand By"),x.oJD))},dependencies:[p._Y,p.JL,p.F,T.y,M.z]}),e})();const ot=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let at=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new x.vpe(null)}ngOnInit(){this.form=this.fb.group({birth_date:[null,[p.kI.required]]})}next(){this.nextStep.emit(this.form.get("birth_date").value)}}return e.ɵfac=function(t){return new(t||e)(x.Y36(p.QS),x.Y36(S.F))},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-error-birthday-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:16,vars:23,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","flex-1"],["type","text","placeholder","Ej: 22/03/1990","required","","formControlName","birth_date","matInput","","mask","d0/M0/0000"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(x.TgZ(0,"div",0)(1,"div",1)(2,"div",2),x._uU(3),x.qZA(),x.TgZ(4,"div",3),x._uU(5),x.qZA(),x.TgZ(6,"form",4)(7,"mat-form-field",5)(8,"mat-label"),x._uU(9),x.qZA(),x._UZ(10,"input",6),x.TgZ(11,"mat-hint"),x._uU(12,"DD/MM/YYYY"),x.qZA()()()(),x.TgZ(13,"div",7)(14,"button",8),x.NdJ("click",(function(){return t.next()})),x._uU(15),x.qZA()()()),2&e&&(x.xp6(2),x.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),x.xp6(1),x.hij(" ",t.labels.warnings.wrongBirthday," "),x.xp6(1),x.Udp("color",t.data.styles.colors.text),x.xp6(1),x.hij(" ",t.labels.warnings.inputBirthDay," "),x.xp6(1),x.Q6J("formGroup",t.form),x.xp6(3),x.Oqu(t.labels.birthday),x.xp6(4),x.Q6J("ngClass",x.kEZ(19,ot,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),x.xp6(1),x.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),x.Q6J("disabled",t.form.invalid),x.xp6(1),x.hij(" ",t.labels.send," "))},dependencies:[i.mk,u.lW,R.KE,R.bx,R.hX,P.Nt,p._Y,p.Fj,p.JJ,p.JL,p.Q7,p.sg,p.u,ae.Z6],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const lt=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let ct=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new x.vpe(null)}ngOnInit(){this.form=this.fb.group({support_number:[null,[p.kI.required]]})}next(){this.nextStep.emit(this.form.get("support_number").value)}}return e.ɵfac=function(t){return new(t||e)(x.Y36(p.QS),x.Y36(S.F))},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-error-support-number-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:14,vars:23,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","flex-1"],["type","number","placeholder","Ej: 1233443","required","","formControlName","support_number","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(x.TgZ(0,"div",0)(1,"div",1)(2,"div",2),x._uU(3),x.qZA(),x.TgZ(4,"div",3),x._uU(5),x.qZA(),x.TgZ(6,"form",4)(7,"mat-form-field",5)(8,"mat-label"),x._uU(9),x.qZA(),x._UZ(10,"input",6),x.qZA()()(),x.TgZ(11,"div",7)(12,"button",8),x.NdJ("click",(function(){return t.next()})),x._uU(13),x.qZA()()()),2&e&&(x.xp6(2),x.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),x.xp6(1),x.hij(" ",t.labels.warnings.wrongSupport," "),x.xp6(1),x.Udp("color",t.data.styles.colors.text),x.xp6(1),x.hij(" ",t.labels.warnings.inputSupport," "),x.xp6(1),x.Q6J("formGroup",t.form),x.xp6(3),x.Oqu(t.labels.support),x.xp6(2),x.Q6J("ngClass",x.kEZ(19,lt,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),x.xp6(1),x.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),x.Q6J("disabled",t.form.invalid),x.xp6(1),x.hij(" ",t.labels.send," "))},dependencies:[i.mk,u.lW,R.KE,R.hX,P.Nt,p._Y,p.Fj,p.wV,p.JJ,p.JL,p.Q7,p.sg,p.u],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const dt=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let ut=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new x.vpe(null)}ngOnInit(){this.form=this.fb.group({document_expiration_date:[null,[p.kI.required]]})}next(){this.nextStep.emit(this.form.get("document_expiration_date").value)}}return e.ɵfac=function(t){return new(t||e)(x.Y36(p.QS),x.Y36(S.F))},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-error-expiration-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:16,vars:23,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","flex-1"],["type","date","placeholder","Ej: 22/03/1990","required","","formControlName","document_expiration_date","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-button","","type","button",1,"px-8",3,"disabled","click"]],template:function(e,t){1&e&&(x.TgZ(0,"div",0)(1,"div",1)(2,"div",2),x._uU(3),x.qZA(),x.TgZ(4,"div",3),x._uU(5),x.qZA(),x.TgZ(6,"form",4)(7,"mat-form-field",5)(8,"mat-label"),x._uU(9),x.qZA(),x._UZ(10,"input",6),x.TgZ(11,"mat-hint"),x._uU(12,"DD/MM/YYYY"),x.qZA()()()(),x.TgZ(13,"div",7)(14,"button",8),x.NdJ("click",(function(){return t.next()})),x._uU(15),x.qZA()()()),2&e&&(x.xp6(2),x.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),x.xp6(1),x.hij(" ",t.labels.warnings.wrongExpiration," "),x.xp6(1),x.Udp("color",t.data.styles.colors.text),x.xp6(1),x.hij(" ",t.labels.warnings.inputExpiration," "),x.xp6(1),x.Q6J("formGroup",t.form),x.xp6(3),x.Oqu(t.labels.expiration),x.xp6(4),x.Q6J("ngClass",x.kEZ(19,dt,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),x.xp6(1),x.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),x.Q6J("disabled",t.form.invalid),x.xp6(1),x.Oqu(t.labels.send))},dependencies:[i.mk,u.lW,R.KE,R.bx,R.hX,P.Nt,p._Y,p.Fj,p.JJ,p.JL,p.Q7,p.sg,p.u],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function ht(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"mat-form-field",11)(1,"mat-label"),x._uU(2),x.qZA(),x._UZ(3,"input",12),x.TgZ(4,"mat-hint")(5,"a",13),x.NdJ("click",(function(t){x.CHM(e);const n=x.oxw(2);return x.KtG(n.gotoExpirationDate(t))})),x.TgZ(6,"u"),x._uU(7),x.qZA()()()()}if(2&e){const e=x.oxw(2);x.xp6(2),x.Oqu(e.labels.expiration),x.xp6(5),x.Oqu(e.labels.findExpiration)}}function pt(e,t){if(1&e&&(x.TgZ(0,"mat-form-field",14)(1,"mat-label"),x._uU(2),x.qZA(),x._UZ(3,"input",15),x.qZA()),2&e){const e=x.oxw(2);x.xp6(2),x.Oqu(e.labels.support)}}function mt(e,t){if(1&e&&(x.TgZ(0,"div",5),x._UZ(1,"div",6)(2,"div",7),x.ALo(3,"safeHtml"),x._UZ(4,"br"),x.TgZ(5,"form",8),x.YNc(6,ht,8,2,"mat-form-field",9),x.YNc(7,pt,4,1,"mat-form-field",10),x.qZA()()),2&e){const e=x.oxw();x.xp6(1),x.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),x.Q6J("innerHTML",null==e.texts.noPhone?null:e.texts.noPhone.title,x.oJD),x.xp6(1),x.Udp("color",e.data.styles.colors.text),x.Q6J("innerHTML",x.lcZ(3,11,e.texts.noPhone.description),x.oJD),x.xp6(3),x.Q6J("formGroup",e.form),x.xp6(1),x.Q6J("ngIf",e.isDni),x.xp6(1),x.Q6J("ngIf",e.isNie)}}const ft=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function gt(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"div",16)(1,"button",17),x.NdJ("click",(function(){x.CHM(e);const t=x.oxw();return x.KtG(t.next())})),x._uU(2),x.qZA()()}if(2&e){const e=x.oxw();x.Q6J("ngClass",x.kEZ(9,ft,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),x.xp6(1),x.Udp("color",e.data.styles.colors.btnText)("background",e.form.invalid?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),x.Q6J("disabled",e.form.invalid),x.xp6(1),x.hij(" ",e.labels.actions.next," ")}}function _t(e,t){if(1&e&&(x.TgZ(0,"div",18),x._uU(1),x.qZA()),2&e){const e=x.oxw();x.xp6(1),x.hij(" ",e.labels.loadings.gettingData," ")}}let bt=(()=>{class e{constructor(e,t,n,i,s,r,o){this.smsComponent=e,this.fb=t,this.utils=n,this.cd=i,this.dialog=s,this.smsFlowService=r,this.solicitudesService=o,this.loading=null,this.answered=!1,this.nextStep=new x.vpe(null),this.isNie=!1,this.isDni=!1}ngOnInit(){console.warn(this.smsFlowService.REQUEST),this.loading=!0,this.checkIfDniOrNie(),this.isDni&&(this.form=this.fb.group({document_expiration_date:[null,p.kI.required]})),this.isNie&&(this.form=this.fb.group({document_support:[null,p.kI.required]})),this.loading=!1}checkIfDniOrNie(){this.setRegex(this.smsFlowService.REQUEST.person_document_number)}setRegex(e){e&&(this.isDni=!!e.toUpperCase().match(/^(\d{8})([A-Z])$/),this.isNie=!!e.toUpperCase().match(/^[XYZ]\d{7,8}[A-Z]$/),this.cd.markForCheck())}next(){let e={};this.isDni?e.document_expiration_date=this.utils.formatDate(this.form.get("document_expiration_date").value):this.isNie&&(e.document_support=this.form.get("document_support").value),"SMS"===this.flowName?this.sendSmsDataToPin(e):this.nextStep.emit(e)}gotoSupportAclaration(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(X.$,{panelClass:"fullscreen-dialog"})}gotoExpirationDate(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(ee.R,{panelClass:"fullscreen-dialog"})}sendSmsDataToPin(e){e.request_id=this.smsFlowService.REQUEST.request_id,this.smsFlowService.setLoading(this.labels.loadings.sendingData),this.solicitudesService.smsToPin(e).then((e=>{e&&e.status&&"success"===e.status&&this.smsComponent.gotoClavePinUrl(e.data),e&&e.status&&"error"===e.status&&(e.message?"Does not have Pin service"==e.message?this.smsComponent.setRequestStatus("no-service"):this.smsComponent.showAlert("Error!",e.message):this.smsComponent.showAlert("Error!",e),this.smsFlowService.setLoading(null))})).catch((e=>{console.error(e),this.smsComponent.showAlert("Error!",e.message||e),this.smsFlowService.setLoading(null)}))}}return e.ɵfac=function(t){return new(t||e)(x.Y36(H.T,9),x.Y36(p.QS),x.Y36(S.F),x.Y36(x.sBO),x.Y36(se.uw),x.Y36(q.p),x.Y36(_.M))},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-no-phone-step"]],inputs:{flowName:"flowName",data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:5,vars:5,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content"],["class","py-4 flex flex-col",4,"ngIf"],["class","flex items-center gap-2 p-4",3,"ngClass",4,"ngIf"],["class","w-full flex justify-center p-4 items-center",4,"ngIf"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"w-full",3,"formGroup"],["appearance","outline","class","w-full flex-1 belender-form-field",4,"ngIf"],["appearance","outline","class","mb-4 w-full md:max-w-[500px]",4,"ngIf"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["type","text","placeholder","Ej: 22/03/2030","formControlName","document_expiration_date","matInput","","mask","d0/M0/0000"],["target","_blank",1,"text-sm","hover:text-blue-500","cursor-pointer",3,"click"],["appearance","outline",1,"mb-4","w-full","md:max-w-[500px]"],["formControlName","document_support","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"w-full","flex","justify-center","p-4","items-center"]],template:function(e,t){1&e&&(x._UZ(0,"belender-widget-step-logo",0),x.TgZ(1,"div",1),x.YNc(2,mt,8,13,"div",2),x.YNc(3,gt,3,13,"div",3),x.YNc(4,_t,2,1,"div",4),x.qZA()),2&e&&(x.Q6J("data",t.data)("customImage",t.texts.noPhone.customImage),x.xp6(2),x.Q6J("ngIf",(t.isDni||t.isNie)&&!t.loading),x.xp6(1),x.Q6J("ngIf",(t.isDni||t.isNie)&&!t.loading),x.xp6(1),x.Q6J("ngIf",!t.isDni&&!t.isNie||t.loading))},dependencies:[i.mk,i.O5,u.lW,R.KE,R.bx,R.hX,P.Nt,p._Y,p.Fj,p.JJ,p.JL,p.sg,p.u,T.y,ae.Z6,M.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var vt=n(3300),yt=n(865),wt=n(3033),xt=n(7582),St=n(9933),Ct=n(667);const Tt=["formStep"];function kt(e,t){if(1&e&&(x.TgZ(0,"mat-option",8),x._uU(1),x.qZA()),2&e){const e=t.$implicit;x.s9C("value",e),x.xp6(1),x.Oqu(e)}}function Mt(e,t){if(1&e){const e=x.EpF();x.ynx(0),x.TgZ(1,"mat-form-field",5)(2,"mat-label"),x._uU(3,"Estado"),x.qZA(),x.TgZ(4,"mat-select",6),x.NdJ("selectionChange",(function(t){const n=x.CHM(e).index,i=x.oxw();return x.KtG(i.setItemSelected(t,n))})),x.YNc(5,kt,2,2,"mat-option",7),x.qZA()(),x.BQk()}if(2&e){const e=t.$implicit,n=t.index,i=x.oxw();x.xp6(1),x.Gre(" w-full ",n===i.triggerObject.index-1?"!border-t-2 border-green-500 ":"",""),x.xp6(3),x.Q6J("value",e),x.xp6(1),x.Q6J("ngForOf",i.items)}}function It(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"button",9),x.NdJ("click",(function(){x.CHM(e);const t=x.oxw();return x.KtG(t.initTrigger())})),x._uU(1,"Empezar"),x.qZA()}}function Et(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"button",9),x.NdJ("click",(function(){x.CHM(e);const t=x.oxw();return x.KtG(t.initTrigger())})),x._uU(1,"Continuar"),x.qZA()}}function At(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"button",9),x.NdJ("click",(function(){x.CHM(e);const t=x.oxw();return x.KtG(t.initTriggerFromZero())})),x._uU(1,"Volver a empezar"),x.qZA()}}let Ot=class{constructor(e,t){this.cd=e,this.utils=t,this.sendMessage=new x.vpe,this.requestedToPin=!1,this.items=["created","form","terms_and_conditions","waiting_otp_seguridad_social","waiting_login_seguridad_social","invalid_otp_seguridad_social","abandoned_after_bad_phone","abandoned_after_invalid_otp_seguridad_social","abandoned_after_terms_and_conditions","abandoned_after_waiting_otp_seguridad_social","all_documents_downloaded","partial_documents_downloaded","consent_process_completed","partial_documents_downloaded_and_deleted","all_documents_downloaded_and_deleted","failed_with_retry","failed_without_retry","failed_documents_downloaded","no_service","no_sms_service","stand_by","no-phone","no-more-phone","bad_phone","error_expiration_date","error_birth_date","error_support_number","duplicated"],this.triggerObject={index:0,items:["form","waiting_otp_seguridad_social","all_documents_downloaded"]}}ngOnInit(){}setItemSelected(e,t){console.warn(e,t),this.triggerObject.items[t]=e.value,console.warn(this.triggerObject)}initTrigger(){this.emitMessage(this.triggerObject.items[this.triggerObject.index]),this.triggerObject.index++}initTriggerFromZero(){this.triggerObject.index=0,this.initTrigger()}emitMessage(e){let t={status_code:e};console.log(t),this.sendMessage.emit(t)}closeInterval(){this.int&&clearInterval(this.int),this.triggerObject.index=0}addState(){this.triggerObject.items.push("")}};Ot.ɵfac=function(e){return new(e||Ot)(x.Y36(x.sBO),x.Y36(S.F))},Ot.ɵcmp=x.Xpm({type:Ot,selectors:[["belender-tester-sms"]],viewQuery:function(e,t){if(1&e&&x.Gf(Tt,5),2&e){let e;x.iGM(e=x.CRH())&&(t.theDiv=e.first)}},outputs:{sendMessage:"sendMessage"},decls:9,vars:4,consts:[[1,"wrapper","flex","flex-col","justify-between","bg-slate-100","w-[200px]","h-full","p-2","gap-0"],[1,"flex","flex-col","h-full","dd-wrapper"],[4,"ngFor","ngForOf"],["mat-button","",1,"w-full","rounded-md",3,"click"],["mat-raised-button","","class","w-full rounded-md bg-blue-500 text-blue-50",3,"click",4,"ngIf"],["appearance","outline"],[1,"border",3,"value","selectionChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["mat-raised-button","",1,"w-full","rounded-md","bg-blue-500","text-blue-50",3,"click"]],template:function(e,t){1&e&&(x.TgZ(0,"div",0)(1,"div",1),x.YNc(2,Mt,6,5,"ng-container",2),x.TgZ(3,"button",3),x.NdJ("click",(function(){return t.addState()})),x._uU(4,"Agregar estado"),x.qZA()(),x.TgZ(5,"div"),x.YNc(6,It,2,0,"button",4),x.YNc(7,Et,2,0,"button",4),x.YNc(8,At,2,0,"button",4),x.qZA()()),2&e&&(x.xp6(2),x.Q6J("ngForOf",t.triggerObject.items),x.xp6(4),x.Q6J("ngIf",!t.triggerObject.index||0==t.triggerObject.index),x.xp6(1),x.Q6J("ngIf",t.triggerObject.index&&t.triggerObject.index<t.triggerObject.items.length),x.xp6(1),x.Q6J("ngIf",t.triggerObject.index&&t.triggerObject.index>=t.triggerObject.items.length))},dependencies:[i.sg,i.O5,u.lW,R.KE,R.hX,f.gD,K.ey],styles:[".wrapper[_ngcontent-%COMP%]{position:fixed;top:0;right:0;box-shadow:-10px 20px 30px #0000004d;z-index:99!important;max-height:100vh}.dd-wrapper[_ngcontent-%COMP%]{max-height:calc(100vh - 70px)!important;overflow:auto}"],data:{animation:[Ct.$]}}),Ot=(0,xt.gn)([(0,St.c)()],Ot);var Lt=n(3364),Dt=n(1760),Pt=n(6830),Nt=n(4302),qt=n(9112),Rt=n(9382);let Yt=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=x.oAB({type:e}),e.ɵinj=x.cJS({providers:[_.M,v.o,N.w,w.t,C.T,ie.t,{provide:K.Ad,useValue:"es-ES"}],imports:[Je,i.ez,s.G,r.J,o.TU,a.p0,l.JX,c.p9,d.Ps,u.ot,h.Tx,P.c,p.u5,m.AV,p.UX,f.LD,g.vV,b.a,y.Cq,Ye.FA,K.XK,Fe.T5,Ue.Fk,Ge.x,et.n,tt.F,nt.A,it.f,st.g,vt.C,yt.q,wt.d]}),e})();x.B6R(H.T,[i.O5,u.lW,y.Ou,Lt.R,Dt.u,Pt.L,Nt.q,qt.y,Rt.i,D,Z,W,Re,je,Ve,We,Xe,rt,at,ct,ut,bt,Ot],[M.z])},9938:(e,t,n)=>{n.r(t),n.d(t,{VideoIdModule:()=>Ut});var i=n(6895),s=n(6383),r=n(5592),o=n(8739),a=n(7155),l=n(6308),c=n(6709),d=n(7392),u=n(9101),h=n(1561),p=n(4006),m=n(266),f=n(4385),g=n(811),_=n(5601),b=n(3798),v=n(9391),y=n(1572),w=n(182),x=n(4144),S=n(7367),C=n(9602),T=n(3238),k=n(5895),M=n(6257),I=n(1948),E=n(4246),A=n(8594),O=n(6e3),L=n(5861),D=n(7582),P=n(9549),N=n(9933),q=n(5762),R=n(1363),Y=n(6305),F=n(1931);const U={created:"form",form:"form",terms_and_conditions:"form",widget_opened:"form",prerequest:"form",waiting_terms_and_conditions:"form",waiting_login_seguridad_social:"loading",saved_otp:"loading",loading:"loading",waiting_otp:"otp",invalid_otp:"otp",waiting_otp_seguridad_social:"otp",invalid_otp_seguridad_social:"otp",waiting_password:"password",abandoned_after_bad_phone:"abandoned",abandoned_after_invalid_otp_seguridad_social:"abandoned",abandoned_after_terms_and_conditions:"abandoned",abandoned_after_waiting_otp_seguridad_social:"abandoned",certificate_created:"success",waiting_certificate:"success",all_documents_downloaded:"success",partial_documents_downloaded:"success",waiting_video:"success",consent_process_completed:"success",waiting_documents:"success",partial_documents_downloaded_and_deleted:"success",all_documents_downloaded_and_deleted:"success",bad_phone:"error-data",phone_not_exist_otp:"error-data",failed_with_retry:"failed",failed_without_retry:"failed",rejected_identity:"failed",failed_documents_downloaded:"failed",failed_login_otp:"failed",consent_process_canceled:"failed",no_service:"no-service"};var Z=n(4650),H=n(8467),j=n(6554),z=n(9728);let B=(()=>{class e{constructor(e,t,n,i){this.utils=e,this.localFetch=t,this.solicitudesService=n,this.apiUrlService=i}getSolicitudes(){var e=this;return(0,L.Z)((function*(){const t=yield e.localFetch.getFetch(e.apiUrlService.baseUrl+"/requests");return e.solicitudesService.markRequestOpenedIfNeeded(t),t}))()}getSolicitudByCode(e){var t=this;return(0,L.Z)((function*(){const n=yield t.localFetch.freeGetFetch(t.apiUrlService.baseUrl+"/requests/"+e);return t.solicitudesService.markRequestOpenedIfNeeded(n),n}))()}setState(e,t){let n={request_id:e,status:t};return new Promise(((e,t)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/videoid/status",n).then((n=>{n?e(n):t(n)})).catch((e=>{console.error("addSolicitud",e),t(e)}))}))}addSolicitud(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/videoid",e).then((e=>{e?(this.solicitudesService.markRequestOpenedIfNeeded(e),t(e)):n(e)})).catch((e=>{console.error("addSolicitud",e),n(e)}))}))}acceptTerms(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/videoid/terms",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendPassword(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/videoid/password",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}getNewIdOfRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/"+e+"/get-new-id",{}).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}checkService(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/sms/check-service",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}retryRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/sms/retry",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}resendOTP(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/sms/resend-otp",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}fixData(e,t){return new Promise(((n,i)=>{this.localFetch.putFetchWhitoutToken(`${this.apiUrlService.baseUrl}/requests/${e}/person`,t).then((e=>{e?n(e):i(e)})).catch((e=>{i(e)}))}))}sendOTP(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/videoid/otp",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendLinkBySms(e,t){return new Promise(((n,i)=>{this.localFetch.postFetch(`${this.apiUrlService.baseUrl}/requests/${e}/send-link-sms`,t).then((e=>{e?n(e):i(e)})).catch((e=>{i(e)}))}))}}return e.ɵfac=function(t){return new(t||e)(Z.LFG(H.F),Z.LFG(j.r),Z.LFG(_.M),Z.LFG(z.i))},e.ɵprov=Z.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})();var J=n(8460),V=n(5412),Q=n(7308),W=n(1135),G=n(2340);let $=(()=>{class e{constructor(e){this.customizationStoreService=e,this.labels=F.S.es,this.socket=null,this.currentHeight=0,this._request=new W.X({...new q.l,status_code:"created"}),this._request_status=new W.X(null),this.request$=this._request.asObservable(),this.request_status$=this._request_status.asObservable()}setGlobalVariables(){this.REQUEST=this._request.value,this.REQUEST_STATUS=this.REQUEST?.status_code,this.REQUEST_ID=this.REQUEST?.request_id,this._request_status.next(this.REQUEST_STATUS)}setRequest(e){this._request.next({...e}),this.setGlobalVariables()}patch(e){this._request.next({...this._request.value,...e}),this.setGlobalVariables()}setRequestStatus(e){this._request.next({...this._request.value,status_code:e}),this.setGlobalVariables()}setRequestID(e){this._request.next({...this._request.value,request_id:e}),this.setGlobalVariables()}updateRequestID(e){this.REQUEST_ID=e,this.setRequestID(e)}subscribeWS(e){if(this.socket)return;const t=e||this.REQUEST_ID||this._request.value?.request_id;if(!t)return;let n="wss://notifications.dev.belender.net";"qa"==G.N.env&&(n="wss://notifications.qa.belender.net"),"pro"==G.N.env&&(n="wss://notifications.belender.net"),G.N.notificationsBaseUrl&&(n=G.N.notificationsBaseUrl),this.socket=new WebSocket(`${n}?requests_id=${t}&user_id=${this.customizationStoreService.USER_ID}`);const i=this;this.socket.onopen=function(){console.log("Conexión establecida")},this.socket.onmessage=function(e){const t=JSON.parse(e.data);i.handlePusherNotification(t)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e),console.error(e)},this.socket.onclose=function(){console.log("Conexión cerrada"),i.socket=null}}handlePusherNotification(e){if(!e||w.t.shouldIgnoreWebhookStatus(e.status_code))return;this.sendMessageToParent({type:"websocket",data:e}),console.warn("message from ws: ",e);const t=e.status_code;if(t){if(t.startsWith("failed"))return this.disconnectWebsocket(),void this.setRequestStatus(t);if(t.startsWith("abandoned"))return this.disconnectWebsocket(),void this.setRequestStatus(t);if("consent_process_completed"===t)return this.disconnectWebsocket(),void this.patch({status_code:t});this.patch({status_code:t})}}sendMessageToParent(e){if(e&&e.type&&"widgetHeight"===e.type){if(e.data===this.currentHeight)return;this.currentHeight=e.data}console.log("Message to parent:",e),window.top.postMessage(e,"*")}disconnectWebsocket(){this.socket&&this.socket.close(),this.socket=null}}return e.ɵfac=function(t){return new(t||e)(Z.LFG(J.r))},e.ɵprov=Z.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})();var K=n(6830),X=n(833),ee=n(4302),te=n(8259),ne=n(8429),ie=n(3731);function se(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.HOy("",e.labels.otp.noReceivedCode," ",e.labels.certificate.requestAgainIn," ",e.secsCount," ",e.labels.certificate.seconds,"")}}function re(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.xDo("",e.labels.otp.noReceivedCode2," ",e.lastNumberPhone,"? ",e.labels.certificate.requestAgainIn," ",e.secsCount," ",e.labels.certificate.seconds,"")}}const oe=function(e,t,n){return{color:e,border:t,background:n}};function ae(e,t){if(1&e&&(Z.ynx(0),Z.TgZ(1,"small",12),Z.YNc(2,se,2,4,"span",6),Z.YNc(3,re,2,5,"span",6),Z.qZA(),Z.BQk()),2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("ngStyle",Z.kEZ(3,oe,e.data.styles.colors.accentColor,"1px solid "+e.data.styles.colors.accentColor,e.data.styles.colors.accentBgColor)),Z.xp6(1),Z.Q6J("ngIf",!e.lastNumberPhone),Z.xp6(1),Z.Q6J("ngIf",e.lastNumberPhone)}}function le(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.hij(" ",e.labels.otp.noReceivedCode," ")}}function ce(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.AsE(" ",e.labels.otp.noReceivedCode2," ",e.lastNumberPhone,"? ")}}const de=function(e,t){return{color:e,background:t}};function ue(e,t){if(1&e){const e=Z.EpF();Z.ynx(0),Z.TgZ(1,"small",12),Z.YNc(2,le,2,1,"span",6),Z.YNc(3,ce,2,2,"span",6),Z.TgZ(4,"a",13),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.resendOTP())})),Z._uU(5),Z.qZA()(),Z.BQk()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("ngStyle",Z.kEZ(5,oe,e.data.styles.colors.dangerColor,"1px solid "+e.data.styles.colors.dangerColor,e.data.styles.colors.dangerBgColor)),Z.xp6(1),Z.Q6J("ngIf",!e.lastNumberPhone),Z.xp6(1),Z.Q6J("ngIf",e.lastNumberPhone),Z.xp6(1),Z.Q6J("ngStyle",Z.WLB(9,de,e.data.styles.colors.dangerTextButtonColor,e.data.styles.colors.dangerColor)),Z.xp6(1),Z.Oqu(e.labels.actions.resend)}}let he=(()=>{class e{constructor(e,t,n,i){this.fb=e,this.utils=t,this.solucitudesService=n,this.activeRoute=i,this.labels=F.S.es,this.next=new Z.vpe(null),this.errPhone=new Z.vpe(null),this.resendO=new Z.vpe(null),this.secsCount=60,this.lastNumberPhone="XXX"}ngOnInit(){this.form=this.fb.group({code1:[null,[p.kI.required,p.kI.maxLength(6),p.kI.minLength(6)]]}),this.initSecsInterval(),this.activeRoute.queryParams.subscribe((e=>{e&&e.request_id&&(this.requestID=e.request_id)}),(e=>{console.error(e)})),this.solicitud&&this.solicitud.person_phone&&this.setPhone(this.solicitud.person_phone)}setPhone(e){let t="XXX";e&&(t=(""+e).slice(-3)),this.lastNumberPhone=t}initSecsInterval(){this.interv=setInterval((()=>{this.secsCount--,this.secsCount<=0&&this.finishSecsInterval()}),1e3)}finishSecsInterval(){this.interv&&clearInterval(this.interv)}nextStep(){let e={code:this.getCode()};this.next.emit(e)}getCode(){return this.form.get("code1").value}capturePasteEvent(e){return(0,L.Z)((function*(){}))()}errorStep(){this.errPhone.emit(!0)}setInputEvent(e){""!=e.target.value?te(e.target).next().focus():"Backspace"==e.code&&te(e.target).prev().focus()}resendOTP(){this.resendO.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(H.F),Z.Y36(_.M),Z.Y36(A.gz))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-otp-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud",labels:"labels"},outputs:{next:"nextStep",errPhone:"errorPhone",resendO:"resendOTP"},decls:17,vars:24,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"title","py-2"],[4,"ngIf"],[1,"flex","gap-2","items-center","justify-start","w-full","max-w-[200px]"],["appearance","outline",1,"w-full","flex-1"],["tabindex","1","maxlength","6","minlength","1","formControlName","code1","type","text","matInput","",3,"change","keyup"],[1,"flex","items-center","justify-end","gap-2","p-4"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"info-time","w-fit",3,"ngStyle"],[1,"ml-4",3,"ngStyle","click"]],template:function(e,t){1&e&&(Z._UZ(0,"belender-widget-step-logo",0),Z.TgZ(1,"form",1)(2,"div",2),Z._UZ(3,"div",3)(4,"div",4),Z.ALo(5,"safeHtml"),Z.TgZ(6,"div",5),Z.YNc(7,ae,4,7,"ng-container",6),Z.YNc(8,ue,6,12,"ng-container",6),Z.qZA(),Z.TgZ(9,"div",7)(10,"mat-form-field",8)(11,"mat-label"),Z._uU(12),Z.qZA(),Z.TgZ(13,"input",9),Z.NdJ("change",(function(e){return t.capturePasteEvent(e)}))("keyup",(function(e){return t.setInputEvent(e)})),Z.qZA()()()(),Z.TgZ(14,"div",10)(15,"button",11),Z.NdJ("click",(function(){return t.nextStep()})),Z._uU(16),Z.qZA()()()),2&e&&(Z.Q6J("data",t.data)("customImage",t.texts.otp.customImage),Z.xp6(1),Z.Q6J("formGroup",t.form),Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.otp.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(5,22,t.texts.otp.description||""),Z.oJD),Z.xp6(3),Z.Q6J("ngIf",t.secsCount&&t.secsCount>0),Z.xp6(1),Z.Q6J("ngIf",!t.secsCount||t.secsCount<=0),Z.xp6(4),Z.Oqu(t.labels.otp.otpCode),Z.xp6(3),Z.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),Z.Q6J("disabled",t.form.invalid),Z.xp6(1),Z.Oqu(t.labels.actions.next))},dependencies:[i.O5,i.PC,u.lW,P.KE,P.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.nD,p.sg,p.u,ne.y,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function pe(e,t){if(1&e&&(Z.TgZ(0,"div",3),Z._UZ(1,"div",4)(2,"div",5),Z.ALo(3,"safeHtml"),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),Z.Q6J("innerHTML",e.texts.success.title,Z.oJD),Z.xp6(1),Z.Udp("color",e.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(3,8,e.texts.success.description||""),Z.oJD)}}function me(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",6)(1,"button",7),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.gotoRedirect())})),Z._uU(2),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),Z.xp6(1),Z.hij(" ",e.data[e.flowName].btnTextCallBack||e.labels.actions.clickToFinish," ")}}let fe=(()=>{class e{constructor(e,t,n,i){this.fb=e,this.utils=t,this.videoS=n,this.route=i,this.labels=F.S.es}ngOnInit(){this.route.queryParams.subscribe((e=>{e.request_id&&(this.requestID=e.request_id,this.videoS.setState(this.requestID,"success").then((e=>{console.log("Se ha seteado el status success correctamente")})).catch((e=>{console.error("No se ha seteado el status success. Error: ",e)})))}))}save(){}gotoRedirect(){this.data[this.flowName].enableUrlCallBack&&this.data[this.flowName].callBackUrl&&location.assign(this.data[this.flowName].callBackUrl)}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(H.F),Z.Y36(B),Z.Y36(A.gz))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-success-step"]],inputs:{data:"data",texts:"texts",packId:"packId",requestID:"requestID",userId:"userId",flowName:"flowName",labels:"labels"},decls:3,vars:4,consts:[[3,"data","customImage"],["class","pt-4 pb-8 flex flex-col animated fadeIn",4,"ngIf"],["class","flex items-center justify-end gap-2 p-4",4,"ngIf"],[1,"pt-4","pb-8","flex","flex-col","animated","fadeIn"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(Z._UZ(0,"belender-widget-step-logo",0),Z.YNc(1,pe,4,10,"div",1),Z.YNc(2,me,3,7,"div",2)),2&e&&(Z.Q6J("data",t.data)("customImage",t.texts.success.customImage),Z.xp6(1),Z.Q6J("ngIf",!t.data.config.infiniteLoopInCompleted),Z.xp6(1),Z.Q6J("ngIf",t.data[t.flowName].enableUrlCallBack))},dependencies:[i.O5,u.lW,ne.y,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function ge(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",6)(1,"button",7),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.retry())})),Z._uU(2),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),Z.xp6(1),Z.Oqu(e.labels.actions.retry)}}function _e(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",6)(1,"button",7),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.newRequest())})),Z._uU(2),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),Z.xp6(1),Z.Oqu(e.labels.certificate.createNewRequest)}}let be=(()=>{class e{constructor(e,t,n){this.utils=e,this.videoS=t,this.route=n,this.labels=F.S.es,this.retryOp=new Z.vpe(null),this.newReq=new Z.vpe(null)}ngOnInit(){this.route.queryParams.subscribe((e=>{e.request_id&&(this.requestID=e.request_id,this.videoS.setState(this.requestID,"failed").then((e=>{console.log("Se ha seteado el status failed correctamente")})).catch((e=>{console.error("No se ha seteado el status failed. Error: ",e)})))}))}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}newRequest(){this.newReq.emit(this.solicitud.request_id)}getIfRetryIsAllowed(){return"failed_with_retry"==this.solicitud}getIfNewRequestIsAllowed(){return"failed_documents_downloaded"==this.solicitud}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(H.F),Z.Y36(B),Z.Y36(A.gz))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-fail-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud",labels:"labels"},outputs:{retryOp:"retry",newReq:"newRequest"},decls:8,vars:10,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"text-red-500","title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","flex items-center justify-end gap-2 p-4",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(Z._UZ(0,"belender-widget-step-logo",0),Z.TgZ(1,"div",1)(2,"div",2),Z._UZ(3,"div",3)(4,"div",4),Z.ALo(5,"safeHtml"),Z.qZA(),Z.YNc(6,ge,3,7,"div",5),Z.YNc(7,_e,3,7,"div",5),Z.qZA()),2&e&&(Z.Q6J("data",t.data)("customImage",t.texts.fail.customImage),Z.xp6(3),Z.Q6J("innerHTML",t.texts.fail.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(5,8,t.texts.fail.description),Z.oJD),Z.xp6(2),Z.Q6J("ngIf",t.solicitud&&"failed_with_retry"==t.solicitud.status_code),Z.xp6(1),Z.Q6J("ngIf",t.solicitud&&"failed_documents_downloaded"==t.solicitud.status_code))},dependencies:[i.O5,u.lW,ne.y,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();n(6866);var ve=n(769),ye=n(1763),we=n(5696);const xe=["termsCheckbox"],Se=["policyCheckbox"],Ce=["termsCertCheckbox"],Te=["assignmentCheckbox"];function ke(e,t){if(1&e&&(Z.TgZ(0,"mat-error"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.selectPersonType," ")}}function Me(e,t){if(1&e&&(Z.TgZ(0,"mat-error"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.requiredName," ")}}function Ie(e,t){if(1&e&&(Z.TgZ(0,"mat-error"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.requiredFirstSurname," ")}}function Ee(e,t){if(1&e&&(Z.TgZ(0,"mat-error"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.requiredEmail," ")}}function Ae(e,t){if(1&e&&(Z.TgZ(0,"mat-error"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.invalidEmail," ")}}function Oe(e,t){if(1&e&&(Z.TgZ(0,"mat-error"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.needPhone," ")}}function Le(e,t){if(1&e&&(Z.TgZ(0,"mat-error"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.phoneDigitsRequired," ")}}function De(e,t){if(1&e&&(Z.TgZ(0,"mat-error"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.needDNI," ")}}function Pe(e,t){if(1&e&&(Z.TgZ(0,"mat-error"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.requiredCompanyName," ")}}function Ne(e,t){if(1&e&&(Z.TgZ(0,"mat-form-field",6)(1,"mat-label"),Z._uU(2),Z.qZA(),Z._UZ(3,"input",27),Z.YNc(4,Pe,2,1,"mat-error",10),Z.qZA()),2&e){const e=Z.oxw();let t;Z.Gre("",e.disabledInputs.razon?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(2),Z.Oqu(e.labels.certificate.companyName),Z.xp6(1),Z.s9C("tabindex",e.disabledInputs.razon?-1:1),Z.Q6J("placeholder",e.labels.certificate.companyPlaceholder),Z.uIk("aria-label",e.labels.certificate.companyName),Z.xp6(1),Z.Q6J("ngIf",null==(t=e.form.get("razon"))?null:t.hasError("required"))}}function qe(e,t){if(1&e&&(Z.TgZ(0,"mat-error"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.requiredCIF," ")}}function Re(e,t){if(1&e&&(Z.TgZ(0,"mat-form-field",6)(1,"mat-label"),Z._uU(2,"CIF"),Z.qZA(),Z._UZ(3,"input",28),Z.YNc(4,qe,2,1,"mat-error",10),Z.qZA()),2&e){const e=Z.oxw();let t;Z.Gre("",e.disabledInputs.cif?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(3),Z.s9C("tabindex",e.disabledInputs.cif?-1:1),Z.Q6J("placeholder",e.labels.flowCommon.cifPlaceholderShort),Z.xp6(1),Z.Q6J("ngIf",null==(t=e.form.get("cif"))?null:t.hasError("required"))}}function Ye(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",20)(1,"belender-checkbox",29,30),Z.NdJ("changeCheckbox",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.setTerms2(t))})),Z.TgZ(3,"belender-terms-and-policy-links",31),Z.NdJ("goToTerms",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.gotoTermsAndConditions())})),Z.qZA()()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("color",e.data.styles.colors.title),Z.xp6(2),Z.Q6J("lang",e.lang)("userId",e.userId)("linkType","terms")("firstSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.firstSentence)("secondSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.secondSentence)("thirdSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.thirdSentence)("policyActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.policyActionText)("termsActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.termsActionText)("customTerms",e.data[e.flowName].customTerms)}}function Fe(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",20)(1,"belender-checkbox",32,33),Z.NdJ("changeCheckbox",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.setPolicy(t))})),Z._UZ(3,"belender-terms-and-policy-links",34),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("color",e.data.styles.colors.title),Z.xp6(2),Z.Q6J("lang",e.lang)("userId",e.userId)("linkType","policy")("firstSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.firstSentence)("policyActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.policyActionText)}}function Ue(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",35)(1,"belender-checkbox",21),Z.NdJ("changeCheckbox",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.setPower(t))})),Z._uU(2),Z.TgZ(3,"a",23),Z.NdJ("click",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.gotoPowerConditions(t))})),Z.TgZ(4,"u"),Z._uU(5),Z.qZA()()()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("color",e.data.styles.colors.title),Z.xp6(1),Z.hij(" ",e.labels.certificate.powerConsentBefore,""),Z.xp6(3),Z.Oqu(e.labels.certificate.powerConsentHere)}}function Ze(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",20)(1,"belender-checkbox",21,36),Z.NdJ("changeCheckbox",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.setAssignment(t))})),Z._UZ(3,"div",37),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("color",e.data.styles.colors.title),Z.xp6(2),Z.Q6J("innerHTML",(null==e.data[e.flowName]||null==e.data[e.flowName].texts?null:e.data[e.flowName].texts.dataAssignmentText)||(null==e.data[e.flowName]||null==e.data[e.flowName].config_translate?null:e.data[e.flowName].config_translate.dataAssignmentText)||(null==e.data||null==e.data.config?null:e.data.config.dataAssignmentText)||"",Z.oJD)}}function He(e,t){if(1&e&&(Z.TgZ(0,"div",38),Z._UZ(1,"mat-icon",39),Z._uU(2),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(2),Z.hij(" ",e.labels.warnings.haveToReadTerms," ")}}const je=function(e){return{"dont-show-data":e}},ze={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let Be=(()=>{class e{constructor(e,t,n){this.fb=e,this.utils=t,this.cd=n,this.requestID=null,this.labels=F.S.es,this.lang="",this.next=new Z.vpe(null),this.goTerms=new Z.vpe(null),this.goTermsCert=new Z.vpe(null),this.goPower=new Z.vpe(null),this.acceptTerms=!1,this.acceptPolicy=!1,this.acceptTerms2=!1,this.termsReaded=!1,this.terms2Readed=!1,this.step=0,this.assignment=!1,this.disabledInputs={dni:!1,name:!1,lastname:!1,secondlastname:!1,phone:!1,email:!1,razon:!1,cif:!1,type:!1},this.requestAux={phone:null,email:null,razon:null,cif:null,name:null,lastname:null,secondLastname:null,dni:null,type:"NATURAL"},this.noValidate=!1,this.powerActivate=!1,this.submitAttempted=!1}ngOnInit(){this.solicitud?(this.noValidate="terms_and_conditions"==this.solicitud.status_code,this.setForm(this.solicitud)):this.setForm(null)}tabChanged(e){this.requestAux.type=e.value,this.setForm(this.requestAux)}setForm(e){this.requestAux.phone=e?e.person_phone||e.phone:null,this.requestAux.email=e?e.person_email||e.email||e.email_copy:null,this.requestAux.razon=e&&e.razon_social?e.razon_social:null,this.requestAux.cif=e&&e.cif?e.cif:null,this.requestAux.name=e?e.person_name||e.name:null,this.requestAux.lastname=e?e.person_first_surname||e.first_surname:null,this.requestAux.secondLastname=e?e.person_second_surname||e.second_surname:null,this.requestAux.dni=e&&e.document_number?e.document_number:e&&e.person_document_number?e.person_document_number:null,this.requestAux.type=e&&e.person_type?e.person_type:this.requestAux.type,this.form=this.fb.group("NATURAL"==this.requestAux.type?{type:[this.requestAux.type],name:[this.requestAux.name||null,this.noValidate?[]:[p.kI.required]],lastname:[this.requestAux.lastname||null,this.noValidate?[]:[p.kI.required]],secondLastname:[this.requestAux.secondLastname||null],email:[this.requestAux.email||null,this.noValidate?[]:[p.kI.required,p.kI.email]],phone:[this.requestAux.phone||"",this.noValidate?[]:[p.kI.required,p.kI.maxLength(9),p.kI.minLength(9)]],dni:[this.requestAux.dni||null,this.noValidate?[]:[p.kI.required]]}:{type:[this.requestAux.type],name:[this.requestAux.name||null,this.noValidate?[]:[p.kI.required]],lastname:[this.requestAux.lastname||null,this.noValidate?[]:[p.kI.required]],secondLastname:[this.requestAux.secondLastname||null],email:[this.requestAux.email||null,this.noValidate?[]:[p.kI.required,p.kI.email]],dni:[this.requestAux.dni||null,this.noValidate?[]:[p.kI.required]],phone:[this.requestAux.phone||"",this.noValidate?[]:[p.kI.required,p.kI.maxLength(9),p.kI.minLength(9)]],razon:[this.requestAux.razon||null,this.noValidate?[]:[p.kI.required]],cif:[this.requestAux.cif||null,this.noValidate?[]:[p.kI.required]]}),this.requestIDFromURL&&this.disableEnableInputs(this.requestAux.type,this.requestAux.name,this.requestAux.lastname,this.requestAux.secondLastname,this.requestAux.email,this.requestAux.phone,this.requestAux.dni,this.requestAux.razon,this.requestAux.cif),this.cd.markForCheck()}disableEnableInputs(e,t,n,i,s,r,o,a,l){this.disabledInputs={name:t||!1,lastname:n||!1,secondlastname:i||!1,email:s||!1,phone:r||!1,dni:o||!1,razon:a||!1,cif:l||!1,type:e||!1}}enableInput(e){this.disabledInputs[e]=!1,this.cd.markForCheck()}nextStep(){if(!this.getIfValid())return void(0,ve.J)(this,this.cd);let e;e="NATURAL"==this.requestAux.type?{email_copy:this.form.get("email").value,phone:this.form.get("phone").value,name:this.form.get("name").value,first_surname:this.form.get("lastname").value,second_surname:this.form.get("secondLastname").value,document_number:this.form.get("dni").value,type:"Natural"}:{email_copy:this.form.get("email").value,phone:this.form.get("phone").value,name:this.form.get("name").value,first_surname:this.form.get("lastname").value,second_surname:this.form.get("secondLastname").value,document_number:this.form.get("dni").value,company_name:this.form.get("razon").value,cif:this.form.get("cif").value,type:"Legal",rmc_validation:this.userId},(this.data.config.activatePower||this.solicitud?.power_activate)&&(e.power_activate=1,e.terms_and_conditions_power=1),this.next.emit(e)}gotoTermsAndConditions(){this.termsReaded=!0,this.goTerms.emit(!0)}gotoTermsAndConditionsCertificate(){this.terms2Readed=!0,this.goTermsCert.emit(!0)}setAssignment(e){this.assignment=e}getAssignmentValidation(){return!this.data.config.dataAssignmentCheck||this.assignment}setTerms2(e){this.acceptTerms2=e,this.acceptTerms2&&(this.data?.config??{}).forceChecks?this.gotoTermsAndConditions():this.acceptTerms2||(this.termsReaded=!1)}setTermsCheck(e){this.checkComponent.checked=e,this.acceptTerms=e}setTerms2Check(e){this.certCheckComponent.checked=e,this.acceptTerms2=e}setPolicyCheck(e){this.policyCheckComponent.checked=e,this.acceptPolicy=e}setAssignmentCheck(e){this.assignmentCheckComponent.checked=e,this.assignment=e}setTerms(e){this.acceptTerms=e,this.acceptTerms&&(this.data?.config??{}).forceChecks?this.gotoTermsAndConditionsCertificate():this.acceptTerms||(this.terms2Readed=!1)}setPolicy(e){this.acceptPolicy=e}getIfValid(){let e=this.form.invalid;return this.noValidate&&(e=!1),!((this.requestID?this.solicitud?.power_activate:this.data?.config.activatePower)&&!this.powerActivate||this.data.config.forceChecks&&(!this.data.config.hideCheckLegal&&!this.termsReaded||!this.terms2Readed))&&!e&&(this.data.config.hideCheckLegal||this.acceptTerms)&&(!this.data?.config?.showPolicyLink||this.acceptPolicy)&&this.acceptTerms2&&this.getAssignmentValidation()}setPower(e){this.powerActivate=e}gotoPowerConditions(e){this.goPower.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(H.F),Z.Y36(Z.sBO))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-form-step"]],viewQuery:function(e,t){if(1&e&&(Z.Gf(xe,5),Z.Gf(Se,5),Z.Gf(Ce,5),Z.Gf(Te,5)),2&e){let e;Z.iGM(e=Z.CRH())&&(t.checkComponent=e.first),Z.iGM(e=Z.CRH())&&(t.policyCheckComponent=e.first),Z.iGM(e=Z.CRH())&&(t.certCheckComponent=e.first),Z.iGM(e=Z.CRH())&&(t.assignmentCheckComponent=e.first)}},inputs:{requestID:"requestID",flowName:"flowName",data:"data",texts:"texts",solicitud:"solicitud",userId:"userId",labels:"labels",lang:"lang",requestIDFromURL:"requestIDFromURL"},outputs:{next:"nextStep",goTerms:"goToTerms",goTermsCert:"goToTermsCertificate",goPower:"goToPower"},features:[Z._Bn([{provide:T.sG,useValue:ze},{provide:Z.soG,useValue:"es-ES"}])],decls:65,vars:88,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4","custom-html",3,"innerHTML"],[1,"my-1","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between",3,"ngClass"],["appearance","outline"],["formControlName","type",3,"tabindex","selectionChange"],["value","NATURAL"],["value","LEGAL"],[4,"ngIf"],["id","form-name","formControlName","name","matInput","",3,"tabindex"],["id","form-lastname","formControlName","lastname","matInput","",3,"tabindex"],["id","form-lastname2","formControlName","secondLastname","matInput","",3,"tabindex"],["id","form-email","formControlName","email","type","email","matInput","",3,"tabindex","placeholder"],["id","form-phone","formControlName","phone","maxlength","9","type","text","matInput","",3,"tabindex","placeholder"],["id","form-dni","formControlName","dni","maxlength","9","minlength","9","type","text","matInput","",3,"tabindex","placeholder"],["appearance","outline",3,"class",4,"ngIf"],["class","flex justify-start items-center w-full flex-100",4,"ngIf"],["class","flex justify-between items-center w-full flex-100",4,"ngIf"],[1,"flex","justify-start","items-center","w-full","flex-100"],[3,"color","changeCheckbox"],["termsCertCheckbox",""],["target","_blank",1,"text-sm","hover:text-blue-500",3,"click"],["class","px-2 flex items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"],["id","form-razon","formControlName","razon","type","text","matInput","",3,"tabindex","placeholder"],["id","form-cif","aria-label","CIF","formControlName","cif","type","text","matInput","",3,"tabindex","placeholder"],["id","termsCheckbox",3,"color","changeCheckbox"],["termsCheckbox",""],[3,"lang","userId","linkType","firstSentence","secondSentence","thirdSentence","policyActionText","termsActionText","customTerms","goToTerms"],["id","policyCheckbox",3,"color","changeCheckbox"],["policyCheckbox",""],[3,"lang","userId","linkType","firstSentence","policyActionText"],[1,"flex","justify-between","items-center","w-full","flex-100"],["assignmentCheckbox",""],[1,"custom-html",3,"innerHTML"],[1,"px-2","flex","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"],["svgIcon","mat:warning",1,"text-xs","w-4","h-4"]],template:function(e,t){if(1&e&&(Z._UZ(0,"belender-widget-step-logo",0),Z.TgZ(1,"form",1)(2,"div",2),Z._UZ(3,"div",3)(4,"div",4),Z.ALo(5,"safeHtml"),Z.qZA(),Z.TgZ(6,"div",5)(7,"mat-form-field",6)(8,"mat-label"),Z._uU(9),Z.qZA(),Z.TgZ(10,"mat-select",7),Z.NdJ("selectionChange",(function(e){return t.tabChanged(e)})),Z.TgZ(11,"mat-option",8),Z._uU(12),Z.qZA(),Z.TgZ(13,"mat-option",9),Z._uU(14),Z.qZA()(),Z.YNc(15,ke,2,1,"mat-error",10),Z.qZA(),Z.TgZ(16,"mat-form-field",6)(17,"mat-label"),Z._uU(18),Z.qZA(),Z._UZ(19,"input",11),Z.YNc(20,Me,2,1,"mat-error",10),Z.qZA(),Z.TgZ(21,"mat-form-field",6)(22,"mat-label"),Z._uU(23),Z.qZA(),Z._UZ(24,"input",12),Z.YNc(25,Ie,2,1,"mat-error",10),Z.qZA(),Z.TgZ(26,"mat-form-field",6)(27,"mat-label"),Z._uU(28),Z.qZA(),Z._UZ(29,"input",13),Z.qZA(),Z.TgZ(30,"mat-form-field",6)(31,"mat-label"),Z._uU(32),Z.qZA(),Z._UZ(33,"input",14),Z.YNc(34,Ee,2,1,"mat-error",10),Z.YNc(35,Ae,2,1,"mat-error",10),Z.qZA(),Z.TgZ(36,"mat-form-field",6)(37,"mat-label"),Z._uU(38),Z.qZA(),Z._UZ(39,"input",15),Z.YNc(40,Oe,2,1,"mat-error",10),Z.YNc(41,Le,2,1,"mat-error",10),Z.qZA(),Z.TgZ(42,"mat-form-field",6)(43,"mat-label"),Z._uU(44),Z.qZA(),Z._UZ(45,"input",16),Z.YNc(46,De,2,1,"mat-error",10),Z.qZA(),Z.YNc(47,Ne,5,8,"mat-form-field",17),Z.YNc(48,Re,5,6,"mat-form-field",17),Z.qZA(),Z.YNc(49,Ye,4,10,"div",18),Z.YNc(50,Fe,4,6,"div",18),Z.YNc(51,Ue,6,3,"div",19),Z.TgZ(52,"div",20)(53,"belender-checkbox",21,22),Z.NdJ("changeCheckbox",(function(e){return t.setTerms(e)})),Z._uU(55),Z.TgZ(56,"a",23),Z.NdJ("click",(function(){return t.gotoTermsAndConditionsCertificate()})),Z.TgZ(57,"u"),Z._uU(58),Z.qZA()(),Z._uU(59),Z.qZA()(),Z.YNc(60,Ze,4,2,"div",18),Z.YNc(61,He,3,1,"div",24),Z.TgZ(62,"div",25)(63,"button",26),Z.NdJ("click",(function(){return t.nextStep()})),Z._uU(64),Z.qZA()()()),2&e){let e,n,i,s,r,o,a,l;Z.Q6J("data",t.data)("customImage",t.texts.form.customImage),Z.xp6(1),Z.Q6J("formGroup",t.form),Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.form.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(5,84,t.texts.form.description||""),Z.oJD),Z.xp6(2),Z.Q6J("ngClass",Z.VKq(86,je,t.data.config.dontShowDataInTerms&&t.solicitud&&t.solicitud.status_code&&"terms_and_conditions"===t.solicitud.status_code)),Z.xp6(1),Z.Gre("",t.disabledInputs.type?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(2),Z.Oqu(t.labels.flowCommon.personType),Z.xp6(1),Z.s9C("tabindex",t.disabledInputs.type?-1:1),Z.xp6(2),Z.Oqu(t.labels.flowCommon.natural),Z.xp6(2),Z.Oqu(t.labels.flowCommon.legal),Z.xp6(1),Z.Q6J("ngIf",null==(e=t.form.get("type"))?null:e.hasError("required")),Z.xp6(1),Z.Gre("",t.disabledInputs.name?"disabled-input":""," w-full flex-1 belender-form-field"),Z.xp6(2),Z.Oqu(t.labels.flowCommon.name),Z.xp6(1),Z.s9C("tabindex",t.disabledInputs.name?-1:1),Z.uIk("aria-label",t.labels.flowCommon.name),Z.xp6(1),Z.Q6J("ngIf",null==(n=t.form.get("name"))?null:n.hasError("required")),Z.xp6(1),Z.Gre("",t.disabledInputs.lastname?"disabled-input":""," w-full flex-1 belender-form-field"),Z.xp6(2),Z.Oqu(t.labels.flowCommon.firstSurname),Z.xp6(1),Z.s9C("tabindex",t.disabledInputs.lastname?-1:1),Z.uIk("aria-label",t.labels.flowCommon.firstSurname),Z.xp6(1),Z.Q6J("ngIf",null==(i=t.form.get("lastname"))?null:i.hasError("required")),Z.xp6(1),Z.Gre("",t.disabledInputs.secondlastname?"disabled-input":""," w-full flex-1 belender-form-field"),Z.xp6(2),Z.Oqu(t.labels.flowCommon.secondSurname),Z.xp6(1),Z.s9C("tabindex",t.disabledInputs.secondlastname?-1:1),Z.uIk("aria-label",t.labels.flowCommon.secondSurname),Z.xp6(1),Z.Gre("",t.disabledInputs.email?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(2),Z.Oqu(t.labels.email),Z.xp6(1),Z.s9C("tabindex",t.disabledInputs.email?-1:1),Z.Q6J("placeholder",t.labels.flowCommon.emailPlaceholder),Z.uIk("aria-label",t.labels.email),Z.xp6(1),Z.Q6J("ngIf",null==(s=t.form.get("email"))?null:s.hasError("required")),Z.xp6(1),Z.Q6J("ngIf",null==(r=t.form.get("email"))?null:r.hasError("email")),Z.xp6(1),Z.Gre("",t.disabledInputs.phone?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(2),Z.Oqu(t.labels.phone),Z.xp6(1),Z.s9C("tabindex",t.disabledInputs.phone?-1:1),Z.Q6J("placeholder",t.labels.flowCommon.phonePlaceholder),Z.uIk("aria-label",t.labels.phone),Z.xp6(1),Z.Q6J("ngIf",null==(o=t.form.get("phone"))?null:o.hasError("required")),Z.xp6(1),Z.Q6J("ngIf",(null==(a=t.form.get("phone"))?null:a.hasError("minlength"))||(null==(a=t.form.get("phone"))?null:a.hasError("maxlength"))),Z.xp6(1),Z.Gre("",t.disabledInputs.dni?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(2),Z.Oqu(t.labels.dni),Z.xp6(1),Z.s9C("tabindex",t.disabledInputs.dni?-1:1),Z.Q6J("placeholder",t.labels.flowCommon.dniPlaceholderShort),Z.uIk("aria-label",t.labels.dni),Z.xp6(1),Z.Q6J("ngIf",null==(l=t.form.get("dni"))?null:l.hasError("required")),Z.xp6(1),Z.Q6J("ngIf","LEGAL"==t.requestAux.type),Z.xp6(1),Z.Q6J("ngIf","LEGAL"==t.requestAux.type),Z.xp6(1),Z.Q6J("ngIf",!t.data.config.hideCheckLegal),Z.xp6(1),Z.Q6J("ngIf",null==t.data||null==t.data.config?null:t.data.config.showPolicyLink),Z.xp6(1),Z.Q6J("ngIf",t.requestID?null==t.solicitud?null:t.solicitud.power_activate:null==t.data?null:t.data.config.activatePower),Z.xp6(2),Z.Q6J("color",t.data.styles.colors.title),Z.xp6(2),Z.hij(" ",t.labels.flowCommon.certTermsBefore," "),Z.xp6(3),Z.Oqu(t.labels.flowCommon.certTermsLink),Z.xp6(1),Z.hij(" ",t.labels.flowCommon.certTermsAfter," "),Z.xp6(1),Z.Q6J("ngIf",null==t.data?null:t.data.config.dataAssignmentCheck),Z.xp6(1),Z.Q6J("ngIf",t.submitAttempted&&(!t.acceptTerms||!t.data.config.hideCheckLegal&&!t.acceptTerms2)),Z.xp6(2),Z.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),Z.xp6(1),Z.hij(" ",t.labels.actions.continue," ")}},dependencies:[i.mk,i.O5,d.Hw,u.lW,P.TO,P.KE,P.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.nD,p.sg,p.u,f.gD,T.ey,ye.b,ne.y,we.T,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.dont-show-data[_ngcontent-%COMP%]{opacity:0!important;padding:0!important;overflow:hidden!important;height:0px!important;margin:0!important}"]}),e})(),Je=(()=>{class e{constructor(e,t,n){this.fb=e,this.utils=t,this.Activatedroute=n,this.next=new Z.vpe(null),this.labels=F.S.es,this.accept=!1}ngOnInit(){this.Activatedroute.queryParams.subscribe((e=>{this.setForm(e)}))}nextStep(){let e={phone:this.form.get("phone").value};this.next.emit(e)}setForm(e){this.form=this.fb.group({phone:["",p.kI.required]}),this.solicitud&&"bad_phone"==this.solicitud.status_code&&this.form.controls.phone.markAsTouched()}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(H.F),Z.Y36(A.gz))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-error-form-step"]],inputs:{data:"data",flowName:"flowName",texts:"texts",mode:"mode",solicitud:"solicitud",labels:"labels"},outputs:{next:"nextStep"},decls:15,vars:19,consts:[[3,"data"],[1,"animated","fadeIn","fixed-content",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"mb-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline",1,"mb-4","w-full","flex-1","belender-form-field"],["formControlName","phone","matInput",""],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(Z._UZ(0,"belender-widget-step-logo",0),Z.TgZ(1,"form",1)(2,"div",2)(3,"div",3),Z._uU(4),Z.qZA(),Z.TgZ(5,"div",4),Z._uU(6),Z.qZA()(),Z.TgZ(7,"div",5)(8,"mat-form-field",6)(9,"mat-label"),Z._uU(10),Z.qZA(),Z._UZ(11,"input",7),Z.qZA()(),Z.TgZ(12,"div",8)(13,"button",9),Z.NdJ("click",(function(){return t.nextStep()})),Z._uU(14),Z.qZA()()()),2&e&&(Z.Q6J("data",t.data),Z.xp6(1),Z.Q6J("formGroup",t.form),Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.xp6(1),Z.hij(" ",t.labels.warnings.phoneError," "),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.xp6(1),Z.hij(" ",t.labels.warnings.badPhoneSS," "),Z.xp6(4),Z.Oqu(t.labels.phone),Z.xp6(3),Z.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),Z.Q6J("disabled",t.form.invalid),Z.xp6(1),Z.hij(" ",t.labels.actions.continue," "))},dependencies:[u.lW,P.KE,P.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.sg,p.u,ne.y],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Ve=n(5145);let Qe=(()=>{class e{constructor(e){this.utils=e,this.status="",this.labels=F.S.es,this.label=F.S.es.flowCommon.loadingData}ngOnInit(){this.data.config&&this.data.config.infiniteLoopInCompleted?this.label="":(this.label=this.labels.flowCommon.loadingData,Ve.Z.forEach((e=>{e.text==this.status&&(this.label=e.label)})))}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(H.F))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-loading-step"]],inputs:{status:"status",labels:"labels",data:"data"},decls:5,vars:1,consts:[[1,"fixed-content","h-full"],[1,"h-full","py-10","flex","flex-col","items-center"]],template:function(e,t){1&e&&(Z.TgZ(0,"div",0)(1,"div",1),Z._UZ(2,"mat-progress-spinner"),Z.TgZ(3,"p"),Z._uU(4),Z.qZA()()()),2&e&&(Z.xp6(4),Z.Oqu(t.label))},dependencies:[y.Ou],styles:[".content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),We=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.retryOp=new Z.vpe(null),this.labels=F.S.es}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}getTextStatus(){switch(this.solicitud.status_code){case"abandoned_after_waiting_otp_seguridad_social":return this.labels.abandoned.afterWaitingOtpSS;case"abandoned_after_invalid_otp_seguridad_social":return this.labels.abandoned.afterInvalidOtpSS;case"abandoned_after_invalid_otp_aeat":return this.labels.abandoned.afterInvalidOtpAEAT;case"abandoned_after_waiting_otp_aeat":return this.labels.abandoned.afterWaitingOtpAEAT;default:return this.solicitud.status_code}}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(H.F),Z.Y36(_.M),Z.Y36(v.o),Z.Y36(k.T))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-abandoned-step"]],inputs:{solicitud:"solicitud",data:"data",texts:"texts",labels:"labels"},outputs:{retryOp:"retry"},decls:11,vars:21,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"p-1","px-4","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm","mb-2","mt-6"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(Z._UZ(0,"belender-widget-step-logo",0),Z.TgZ(1,"div",1)(2,"div",2),Z._UZ(3,"div",3)(4,"div",4),Z.ALo(5,"safeHtml"),Z.TgZ(6,"div",5),Z._uU(7),Z.qZA()(),Z.TgZ(8,"div",6)(9,"button",7),Z.NdJ("click",(function(){return t.retry()})),Z._uU(10),Z.qZA()()()),2&e&&(Z.Q6J("data",t.data)("customImage",t.texts.abandoned.customImage),Z.xp6(3),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.abandoned.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(5,19,t.texts.abandoned.description),Z.oJD),Z.xp6(3),Z.AsE(" ",t.labels.certificate.status,": ",t.getTextStatus()," "),Z.xp6(2),Z.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),Z.xp6(1),Z.Oqu(t.labels.actions.retry))},dependencies:[u.lW,ne.y,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function Ge(e,t){return n=>{const i=n.controls[t];i.errors&&!i.errors.confirmedValidator||i.setErrors(n.controls[e].value!==i.value?{confirmedValidator:!0}:null)}}function $e(e,t){if(1&e&&(Z.TgZ(0,"mat-hint",13),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",e.labels.certificate.password.required," ")}}function Ke(e,t){if(1&e&&(Z.TgZ(0,"mat-hint",13),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",e.labels.certificate.password.minLength," ")}}function Xe(e,t){if(1&e&&(Z.TgZ(0,"mat-hint",13),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",e.labels.certificate.password.confirmRequired," ")}}function et(e,t){if(1&e&&(Z.TgZ(0,"mat-hint",13),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",e.labels.certificate.password.mismatch," ")}}function tt(e,t){if(1&e&&(Z.TgZ(0,"mat-hint",13),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",e.labels.certificate.password.minLength," ")}}const nt={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let it=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.labels=F.S.es,this.form=new p.cw({}),this.next=new Z.vpe(null)}ngOnInit(){this.setForm()}get f(){return this.form.controls}submit(){this.nextStep()}setForm(){this.form=this.fb.group({password:["",[p.kI.required]],confirm_password:["",[p.kI.required]]},{validator:Ge("password","confirm_password")})}nextStep(){let e={password:this.form.get("password").value};this.next.emit(e)}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.qu),Z.Y36(H.F))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-password-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud",labels:"labels"},outputs:{next:"nextStep"},features:[Z._Bn([{provide:T.sG,useValue:nt},{provide:Z.soG,useValue:"es-ES"}])],decls:23,vars:28,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"my-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["formControlName","password","minlength","8","type","password","matInput",""],["class","text-red-500",4,"ngIf"],["appearance","outline",1,"mb-4","w-full","flex-1","belender-form-field"],["formControlName","confirm_password","minlength","8","type","password","matInput",""],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"text-red-500"]],template:function(e,t){1&e&&(Z._UZ(0,"belender-widget-step-logo",0),Z.TgZ(1,"form",1)(2,"div",2),Z._UZ(3,"div",3)(4,"div",4),Z.ALo(5,"safeHtml"),Z.qZA(),Z.TgZ(6,"div",5)(7,"mat-form-field",6)(8,"mat-label"),Z._uU(9),Z.qZA(),Z._UZ(10,"input",7),Z.YNc(11,$e,2,1,"mat-hint",8),Z.YNc(12,Ke,2,1,"mat-hint",8),Z.qZA(),Z.TgZ(13,"mat-form-field",9)(14,"mat-label"),Z._uU(15),Z.qZA(),Z._UZ(16,"input",10),Z.YNc(17,Xe,2,1,"mat-hint",8),Z.YNc(18,et,2,1,"mat-hint",8),Z.YNc(19,tt,2,1,"mat-hint",8),Z.qZA()(),Z.TgZ(20,"div",11)(21,"button",12),Z.NdJ("click",(function(){return t.nextStep()})),Z._uU(22),Z.qZA()()()),2&e&&(Z.Q6J("data",t.data)("customImage",t.texts.password.customImage),Z.xp6(1),Z.Q6J("formGroup",t.form),Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.password.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(5,26,t.texts.password.description),Z.oJD),Z.xp6(5),Z.Oqu(t.labels.certificate.password.label),Z.xp6(2),Z.Q6J("ngIf",t.f.password.touched&&t.f.password.invalid&&t.f.password.errors.required),Z.xp6(1),Z.Q6J("ngIf",t.f.password.invalid&&t.f.password.errors.minlength),Z.xp6(3),Z.Oqu(t.labels.certificate.password.confirmLabel),Z.xp6(2),Z.Q6J("ngIf",t.f.confirm_password.touched&&t.f.confirm_password.touched&&t.f.confirm_password.invalid&&t.f.confirm_password.errors.required),Z.xp6(1),Z.Q6J("ngIf",t.f.confirm_password.touched&&t.f.confirm_password.touched&&t.f.confirm_password.invalid&&t.f.confirm_password.errors.confirmedValidator),Z.xp6(1),Z.Q6J("ngIf",t.f.confirm_password.invalid&&t.f.confirm_password.errors.minlength),Z.xp6(2),Z.Udp("color",t.form.invalid?"":t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),Z.Q6J("disabled",t.form.invalid),Z.xp6(1),Z.hij(" ",t.labels.certificate.password.save," "))},dependencies:[i.O5,u.lW,P.KE,P.bx,P.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.sg,p.u,ne.y,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const st=["formStep"];function rt(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"vex-power-cert",3),Z.NdJ("accept",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.acceptPowerCert())})),Z.qZA()}if(2&e){const e=Z.oxw();Z.Q6J("hideButtons",!1)("flow","VideoID")("userId",e.userId)}}function ot(e,t){1&e&&(Z.TgZ(0,"div",9),Z._UZ(1,"mat-progress-spinner",10),Z.qZA()),2&e&&(Z.xp6(1),Z.Q6J("value",0))}function at(e,t){if(1&e&&Z._UZ(0,"belender-loading-step",19),2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("labels",e.labels)("status",null==e.solicitud?null:e.solicitud.status_code)}}function lt(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-form-step",20,21),Z.NdJ("goToTerms",(function(){Z.CHM(e);const t=Z.oxw(4);return Z.KtG(t.gotoTermsAndConditions())}))("goToPower",(function(){Z.CHM(e);const t=Z.oxw(4);return Z.KtG(t.gotoPowerConditions())}))("goToTermsCertificate",(function(){Z.CHM(e);const t=Z.oxw(4);return Z.KtG(t.gotoTermsAndConditionsCertificate())}))("nextStep",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.gotoOTP(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("flowName",e.flowName)("requestID",e.requestID)("requestIDFromURL",e.requestIDFromURL)("userId",e.userId)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)("labels",e.labels)("lang",e.currentLang)("labels",e.labels)}}function ct(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-otp-step",22),Z.NdJ("resendOTP",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.resendOTP(t))}))("errorPhone",(function(){Z.CHM(e);const t=Z.oxw(4);return Z.KtG(t.setRequestStatus("failed_login_otp"))}))("nextStep",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.requestOTP(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function dt(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-password-step",23),Z.NdJ("nextStep",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.sendPassword(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function ut(e,t){if(1&e&&Z._UZ(0,"belender-success-step",24),2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("flowName",e.flowName)("packId",e.packId)("userId",e.userId)("requestID",e.requestID)("labels",e.labels)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function ht(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-fail-step",25),Z.NdJ("retry",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.retryRequest(t))}))("newRequest",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.newRequest(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function pt(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-error-form-step",26),Z.NdJ("nextStep",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.sendNewData(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("solicitud",e.solicitud)("data",e.data)("labels",e.labels)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function mt(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-abandoned-step",27),Z.NdJ("retry",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.retryRequest(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("solicitud",e.solicitud)("data",e.data)("labels",e.labels)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function ft(e,t){if(1&e&&(Z.ynx(0),Z.YNc(1,at,1,3,"belender-loading-step",11),Z.YNc(2,lt,2,10,"belender-form-step",12),Z.YNc(3,ct,1,4,"belender-otp-step",13),Z.YNc(4,dt,1,4,"belender-password-step",14),Z.YNc(5,ut,1,7,"belender-success-step",15),Z.YNc(6,ht,1,4,"belender-fail-step",16),Z.YNc(7,pt,1,4,"belender-error-form-step",17),Z.YNc(8,mt,1,4,"belender-abandoned-step",18),Z.BQk()),2&e){const e=Z.oxw(3);Z.xp6(1),Z.Q6J("ngIf","loading"==e.requestStatus),Z.xp6(1),Z.Q6J("ngIf","form"==e.requestStatus&&!e.loading),Z.xp6(1),Z.Q6J("ngIf","otp"==e.requestStatus),Z.xp6(1),Z.Q6J("ngIf","password"==e.requestStatus),Z.xp6(1),Z.Q6J("ngIf","success"==e.requestStatus),Z.xp6(1),Z.Q6J("ngIf","failed"==e.requestStatus),Z.xp6(1),Z.Q6J("ngIf","error-data"==e.requestStatus),Z.xp6(1),Z.Q6J("ngIf","abandoned"==e.requestStatus)}}function gt(e,t){1&e&&Z._UZ(0,"belender-disabled-url")}function _t(e,t){if(1&e&&(Z.TgZ(0,"div",28),Z._UZ(1,"mat-progress-spinner",29),Z.TgZ(2,"p",30),Z._uU(3),Z.qZA()()),2&e){const e=Z.oxw(3);Z.xp6(1),Z.Q6J("value",e.spinnerValue)("mode",e.spinnerMode),Z.xp6(2),Z.hij(" ",e.loading," ")}}function bt(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",31)(1,"div",32)(2,"div",33),Z._uU(3),Z.qZA(),Z._UZ(4,"div",34),Z.qZA(),Z.TgZ(5,"div",35)(6,"button",36),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw(3);return Z.KtG(t.error=!1)})),Z._uU(7),Z.qZA()()()}if(2&e){const e=Z.oxw(3);Z.xp6(3),Z.Oqu(e.labels.warnings.error),Z.xp6(1),Z.Udp("color",e.data.styles.colors.text),Z.Q6J("innerHTML",e.error,Z.oJD),Z.xp6(3),Z.hij(" ",e.labels.manual," ")}}function vt(e,t){if(1&e&&(Z.TgZ(0,"div",4)(1,"div"),Z.YNc(2,ot,2,1,"div",6),Z.YNc(3,ft,9,8,"ng-container",5),Z.YNc(4,gt,1,0,"belender-disabled-url",5),Z.YNc(5,_t,4,3,"div",7),Z.YNc(6,bt,8,5,"div",8),Z.qZA()()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.Gre("h-full w-full flex-auto p-0 md:p-3 ",e.data.styles.typography,""),Z.Udp("background",e.data.styles.colors.background),Z.xp6(1),Z.Q6J("ngIf",e.data.config.infiniteLoopInCompleted&&"loading"==e.requestStatus),Z.xp6(1),Z.Q6J("ngIf",!e.error&&!e.disableURL),Z.xp6(1),Z.Q6J("ngIf",!e.error&&e.disableURL),Z.xp6(1),Z.Q6J("ngIf",e.loading&&!e.error),Z.xp6(1),Z.Q6J("ngIf",!e.loading&&e.error)}}function yt(e,t){if(1&e&&(Z.ynx(0),Z.TgZ(1,"div",37),Z._uU(2),Z.qZA(),Z.BQk()),2&e){const e=Z.oxw(2);Z.xp6(2),Z.hij(" TestMode ",e.testMode?"ON":"OFF"," ")}}function wt(e,t){if(1&e&&(Z.TgZ(0,"div",4),Z.YNc(1,vt,7,10,"div",1),Z.YNc(2,yt,3,1,"ng-container",5),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("ngIf",e.data),Z.xp6(1),Z.Q6J("ngIf",e.testMode)}}function xt(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"vex-terms",38),Z.NdJ("accepted",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.handleTermsResponse(!0))}))("cancelled",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.handleTermsResponse(!1))})),Z.qZA()}if(2&e){const e=Z.oxw();Z.Q6J("flow","videoid")("lang",e.currentLang)("allData",e.data)("requestStatus",e.solicitud?e.solicitud.status_code:"")}}let St=class{constructor(e,t,n,i,s,r,o,a,l,c,d){this.cd=e,this.Activatedroute=t,this.utils=n,this.videoIDService=i,this.customizationService=s,this.customizationStoreService=r,this.notis=o,this.webhooksService=a,this.dialog=l,this.translationService=c,this.videoIdUtils=d,this.data=null,this.disableActions=!1,this.step="created",this.waitingTime=15,this.loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1,this.requestIDFromURL=!1,this.requestCreated=!1,this.viewPowerTerms=!1,this.disableURL=!1,this.flowName="VideoID",this.showTermsDialog=!1,this.currentLang="",this.labels=F.S.es,this.requestStatus="form",this.intervalToAskBack=null,this.intervalCount=0,this.lastInvalidOtpAlertStatus=null}set solicitud(e){this._solicitudInput=e,e&&this.videoIdUtils.setRequest(e)}get solicitud(){return this.videoIdUtils.REQUEST||this._solicitudInput}ngOnInit(){this.setTranslation(),this.loading=this.labels.certificate.loadings.gettingRequestInfo,this.userId=this.customizationStoreService.USER_ID,this.packId=this.customizationStoreService.PACK_ID,this.videoIdUtils.request_status$.subscribe((e=>{"invalid_otp_seguridad_social"===e&&this.lastInvalidOtpAlertStatus!==e&&(this.lastInvalidOtpAlertStatus=e,this.showAlert("Error!","Código inválido. Por favor, introduzca el código recibido por SMS")),this.setStatus()})),this.userId?this.setInitialData(this.userId):this.loading=null,this.utils.setLoading(!1)}ngOnDestroy(){this.stopInterval(),this.videoIdUtils.disconnectWebsocket()}sendMessageToParent(e){this.videoIdUtils.sendMessageToParent(e)}setInitialData(e){var t=this;return(0,L.Z)((function*(){const n=(0,Y.cm)(yield t.getFlow(e));if(t.funderConfig=t.customizationStoreService.FUNDER_CONFIG,t.data={config:t.funderConfig,styles:t.customizationStoreService.FUNDER_STYLES,[t.flowName]:n},(0,Y.bf)(t.data,t.flowName),!t.data.config||!t.data.config.funder_id)return t.notis.showAlert(t.labels.warnings.error,t.labels.warnings.noCustomization,"error"),t.loading=null,void t.cd.markForCheck();t.financiadorID=t.data.config.funder_id||"",t.disableURL=t.data.config.disableUrlWidget,t.validateRequestIdInUrl(),t.cd.markForCheck()}))()}getFlow(e){var t=this;return(0,L.Z)((function*(){return console.error(e,t.flowName),new Promise((n=>{t.customizationService.getCustomizationByFlow(e,t.flowName,t.customizationStoreService.LANG).then((e=>{n(e?.data?e.data:null)}),(e=>{n(null)}))}))}))()}setTranslation(){const e=this.currentLang||this.customizationStoreService?.LANG||localStorage.getItem("belender-language")||"es",t=this.translationService.getLabelsTranslated(e);t&&(this.labels=t,this.videoIdUtils.labels=t)}validateRequestIdInUrl(){this.Activatedroute.queryParams.subscribe((e=>{e?.lang&&(this.currentLang=e.lang,this.setTranslation(),this.loading=this.translationService.getFirstLoading(this.currentLang)),e&&this.setParamsToRequest(e),e&&e.acceptTerms&&(this.autoAcceptTerms=!0),e&&e.request_id?(this.disableURL=!1,this.requestID=e.request_id,this.setFormFromVcCode(e.request_id)):(this.loading=null,this.sendMessageToParent({type:"widgetLoaded",data:{}}))}),(e=>{this.loading=null,this.sendMessageToParent({type:"widgetLoaded",data:{}})}))}setFormFromVcCode(e){var t=this;return(0,L.Z)((function*(){t.loading=t.labels.loadings.gettingData,t.videoIDService.getSolicitudByCode(e).then((n=>{if(n&&n.data){if(w.t.shouldIgnoreWebhookStatus(n.data.status_code))return t.videoIdUtils.setRequest(t.videoIdUtils.REQUEST?.status_code?{...n.data,status_code:t.videoIdUtils.REQUEST.status_code}:n.data),t.videoIdUtils.subscribeWS(e),t.loading="Estamos procesando su solicitud. Espere un momento por favor",t.requestCreated=!0,t.requestIDFromURL=!0,t.skipCreationOfRequest=!0,t.autoAcceptTerms&&t.gotoOTP(),void t.sendMessageToParent({type:"widgetLoaded",data:{}});t.videoIdUtils.setRequest(n.data),t.requestCreated=!0,t.requestIDFromURL=!0,t.videoIdUtils.subscribeWS(e),t.setRequestStatus(t.videoIdUtils.REQUEST.status_code),t.loading=null,t.solicitud.status_code&&"waiting_video"===t.solicitud.status_code&&t.solicitud.url_video_id&&location.assign(t.solicitud.url_video_id),t.skipCreationOfRequest=t.solicitud&&t.solicitud.status_code&&"prerequest"!=t.solicitud.status_code,t.autoAcceptTerms&&t.gotoOTP()}else t.loading=null;t.sendMessageToParent({type:"widgetLoaded",data:{}})})).catch((e=>{t.loading=null,t.sendMessageToParent({type:"widgetLoaded",data:{}})}))}))()}setParamsToRequest(e){this.requestIDFromURL=!0,this.solicitud||(this.solicitud={status_code:"form"}),e.document&&!this.solicitud.person_document_number&&(this.solicitud.document_number=e.document),e.birthday&&!this.solicitud.birth_date&&(this.solicitud.birth_date=e.birthday),e.expiration&&!this.solicitud.document_expiration_date&&(this.solicitud.document_expiration_date=e.expiration),e.type&&!this.solicitud.person_type&&(this.solicitud.person_type=e.type),e.phone&&!this.solicitud.person_phone&&(this.solicitud.person_phone=e.phone),e.email&&!this.solicitud.person_email&&(this.solicitud.person_email=e.email),e.cif&&!this.solicitud.cif&&(this.solicitud.cif=e.cif),e.razon&&!this.solicitud.razon_social&&(this.solicitud.razon_social=e.razon),e.name&&!this.solicitud.person_name&&(this.solicitud.person_name=e.name),e.lastname&&!this.solicitud.person_first_surname&&(this.solicitud.person_first_surname=e.lastname),e.second_lastname&&!this.solicitud.person_second_surname&&(this.solicitud.person_second_surname=e.second_lastname)}handlePusherNotification(e){this.videoIdUtils.handlePusherNotification(e),setTimeout((()=>{this.loading=null,this.cd.markForCheck()}),500)}resendOTP(e){let t={request_id:this.requestID,user_id:this.userId};this.loading=this.labels.loadings.resendingOtp,this.setSubscriptionOfRequest(),this.videoIDService.resendOTP(t).then((e=>{e&&e.data&&(this.videoIdUtils.setRequest(e.data),this.setRequestStatus(this.videoIdUtils.REQUEST.status_code)),this.loading=null})).catch((e=>{console.error(e),this.showAlert(this.labels.warnings.error,e.message||e),this.loading=null}))}gotoTerms(e){this.loading=this.labels.loadings.sendingData,e.package_id=this.packId,e.user_id=this.userId,this.requestID&&(e.request_id=this.requestID),this.testMode?setTimeout((()=>{this.videoIdUtils.setRequest(new q.l),this.setRequestStatus("waiting_otp_seguridad_social"),this.loading=null}),4e3):this.skipCreationOfRequest?(this.gotoOTP(),this.setSubscriptionOfRequest()):this.videoIDService.addSolicitud(e).then((t=>{t&&t.status&&"error"==t.status?(this.videoIdUtils.setRequest({...e,status_code:"form"}),t.message&&(400==t.code?"Birthdate incorrect"==t.message?(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongBirthday)):"Incorrect date"==t.message?(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongDate)):(this.setRequestStatus("no_service"),this.loading=null):(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,t.message)))):t&&t.status&&"success"==t.status?(this.requestID=t.data.request_id,this.videoIdUtils.setRequest(t.data),this.sendMessageToParent({type:"response",data:t.data||t}),this.gotoOTP()):this.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+t)})).catch((e=>{e&&e.error&&this.showAlert(this.labels.warnings.error,e.error),this.loading=null}))}setSubscriptionOfRequest(){this.videoIdUtils.subscribeWS(this.requestID)}setSubscriptionOfRequestOld(){!this.financiadorID||!this.userId||!this.requestID||this.subscribed||(this.subscribed=!0,this.webhooksService.bindRequestChanges(this.financiadorID,this.userId,this.requestID),this.webhooksService.subscribeRequestChanges().subscribe((e=>{e&&this.handlePusherNotification(e)}),(e=>{this.loading=null})))}sendNewData(e){this.loading=this.labels.certificate.loadings.sendingInfo,this.videoIDService.fixData(this.requestID,e).then((e=>{e.status&&"error"==e.status?e.message&&(this.showAlert(this.labels.warnings.error,e),this.loading=null):e&&"success"==e.status&&(this.sendMessageToParent({type:"response",data:e.data||e}),this.initWaitingForResponse(this.labels.loadings.validatingData),this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert(this.labels.warnings.error,e.error),this.loading=null}))}showAlert(e,t){this.loading=null,this.notis.showAlert(e,t)}gotoOTP(e){let t=e;t.user_id=this.userId,t.package_id=this.packId,this.requestCreated?this.setTerms(e):(this.initWaitingForResponse(this.labels.certificate.loadings.startingEmission),this.videoIDService.addSolicitud(t).then((n=>{n.status&&"error"==n.status?(console.error("error en el then",n),this.videoIdUtils.setRequest({...t,status_code:"form"}),n.message?(this.showAlert(this.labels.warnings.error,n.message),n.message&&" Teléfono incorrecto"===n.message&&setTimeout((()=>{this.formComponent.enableInput("phone")}),1e3)):this.showAlert(this.labels.warnings.error,n)):n&&"success"==n.status&&(this.sendMessageToParent({type:"response",data:n.data||n}),this.videoIdUtils.setRequest(n.data),this.requestID=n.data.request_id,this.setSubscriptionOfRequest(),this.cd.markForCheck(),this.setTerms(e))})).catch((e=>{console.error("errooooooorrrrr",e),e&&e.error&&this.showAlert(this.labels.warnings.error,e.error),this.loading=null})))}setTerms(e){this.loading=this.labels.loadings.sendingData;let t={request_id:this.solicitud.request_id,terms_and_conditions_service:!0,terms_and_conditions_certificate_emition:!0};(this.data.config.activatePower||this.solicitud?.power_activate)&&(t.power_activate=!0,t.terms_and_conditions_power=e.terms_and_conditions_power),this.testMode?setTimeout((()=>{this.videoIdUtils.setRequest(new q.l),this.setRequestStatus("waiting_otp_seguridad_social"),this.loading=null}),4e3):this.videoIDService.acceptTerms(t).then((e=>{e&&e.status&&"error"==e.status?(this.videoIdUtils.setRequest({...t,status_code:"form"}),e.message&&(400==e.code?"Birthdate incorrect"==e.message?(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongBirthday)):"Incorrect date"==e.message?(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongDate)):(this.setRequestStatus("no_service"),this.loading=null):(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,e.message)))):e&&e.status&&"success"==e.status?(this.setRequestStatus("waiting_password"),this.sendMessageToParent({type:"response",data:e.data||e}),this.loading=null):this.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+e)})).catch((e=>{e&&e.error&&this.showAlert(this.labels.warnings.error,e.error),this.loading=null}))}sendPassword(e){this.loading=this.labels.videoid.sendingPassword,console.error("password: ",e),e.request_id=this.requestID,this.videoIDService.sendPassword(e).then((e=>{e&&e.status&&"error"==e.status?e.message&&(400==e.code?(this.setRequestStatus("no_service"),this.loading=null):(this.setRequestStatus("waiting_password"),this.showAlert(this.labels.warnings.error,e.message))):e&&e.status&&"success"==e.status?(this.setRequestStatus("waiting_otp"),this.sendMessageToParent({type:"response",data:e.data||e})):this.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+e)})).catch((e=>{e&&e.error&&this.showAlert(this.labels.warnings.error,e.error),this.loading=null}))}requestOTP(e){this.loading=this.labels.videoid.sendingOtpShort,this.testMode?setTimeout((()=>{this.videoIdUtils.setRequest(new q.l),this.setRequestStatus("all_documents_downloaded"),this.loading=null}),2e3):this.videoIDService.sendOTP({request_id:this.requestID,otp:e.code}).then((e=>{e.status&&"error"==e.status?(this.showAlert(this.labels.warnings.error,e.message?"invalid_otp"==e.message?this.labels.videoid.invalidOtpRetry:e.message:e),this.loading=!1):e&&"success"==e.status&&(this.loading=this.labels.videoid.redirectingVintegris,this.setRequestStatus("loading"),this.sendMessageToParent({type:"response",data:e.data||e}),this.cd.markForCheck(),location.assign(e.message))})).catch((e=>{e&&e.error&&this.showAlert(this.labels.warnings.error,e.error),this.loading=null}))}initWaitingForResponse(e){this.loading=e||this.labels.certificate.loadings.validatingInfo,setTimeout((()=>{this.loading&&this.askToBack()}),1e4)}askToBack(){this.askDetailToBack(this.requestID)}askDetailToBack(e){const t=this.videoIdUtils.REQUEST?.status_code,n=e||this.requestID||this.videoIdUtils.REQUEST?.request_id;n&&"consent_process_completed"!==t?this.videoIDService.getSolicitudByCode(n).then((e=>{if(e&&e.data){if(w.t.shouldIgnoreWebhookStatus(e.data.status_code))return;t!=e.data.status_code&&(this.videoIdUtils.setRequest(e.data),this.setRequestStatus(this.videoIdUtils.REQUEST.status_code)),this.loading=null}else this.loading=null})).catch((e=>{this.loading=null})):this.stopInterval()}initIntervalToAskBack(){!this.videoIdUtils.REQUEST?.request_id&&!this.requestID||this.intervalToAskBack||(this.intervalToAskBack=setInterval((()=>{this.askDetailToBack(),this.intervalCount++,this.intervalCount>20&&this.stopInterval()}),5e3))}stopInterval(){this.intervalToAskBack&&clearInterval(this.intervalToAskBack),this.intervalToAskBack=null,this.intervalCount=0}gotoErrorPhone(){}setRequestStatus(e){this.videoIdUtils.REQUEST||this.videoIdUtils.setRequest(new q.l),this.videoIdUtils.setRequestStatus(e),this.setStatus()}setStatus(){if(!this.videoIdUtils.REQUEST)return;const e=this.videoIdUtils.REQUEST.status_code,t=U[e];if(t){if("success"===t&&(this.funderConfig?.infiniteLoopInCompleted||"waiting_video"===e))return this.requestStatus="loading",this.loading="Aguardando validación por Video ID",void this.cd.markForCheck();if("error-data"===t)return this.requestStatus=this.data?.config?.noRetryInBadPhone?"otp":"error-data",this.loading=null,this.stopInterval(),void this.cd.markForCheck();if("loading"===t)return this.requestStatus="loading",this.loading=this.labels.loadings?.validatingData||"Estamos procesando su solicitud. Espere un momento por favor",void this.cd.markForCheck();this.requestStatus=t,this.loading=null,this.stopInterval()}else this.requestStatus="loading",this.loading=this.labels.loadings?.validatingData||"Estamos procesando su solicitud. Espere un momento por favor",this.initIntervalToAskBack();this.cd.markForCheck()}getStatus(){return this.requestStatus}retryRequest(e){let t={request_id:e,user_id:this.userId};this.loading=this.labels.loadings.resendingRequest,this.setSubscriptionOfRequest(),this.videoIDService.retryRequest(t).then((e=>{e&&e.data&&(this.videoIdUtils.setRequest(e.data),this.setRequestStatus(this.videoIdUtils.REQUEST.status_code)),this.loading=null})).catch((e=>{console.error(e),this.showAlert(this.labels.warnings.error,e.message||e),this.loading=null}))}newRequest(e){this.setRequestStatus("created")}sendRetry(){}gotoTermsAndConditions(){this.showTermsDialog=!0}handleTermsResponse(e){this.showTermsDialog=!1,this.formComponent.setTermsCheck(e)}gotoTermsAndConditionsCertificate(){this.dialog.open(R.v,{panelClass:"fullscreen-dialog",data:{flow:"videoid",lang:this.currentLang||localStorage.getItem("belender-language")||"es"}}).afterClosed().subscribe((e=>{e&&this.formComponent.setTerms2Check(!0)}))}gotoPowerConditions(){this.viewPowerTerms=!0}acceptPowerCert(){this.viewPowerTerms=!1}get customImageForCurrentStep(){const e=this.data?.[this.flowName]?.texts;return e&&e[{failed:"fail","no-service":"noService",otp:"otp"}[this.requestStatus]??this.requestStatus]?.customImage||""}};function Ct(e,t){if(1&e&&(Z.TgZ(0,"div",6),Z._UZ(1,"mat-progress-spinner",7),Z.TgZ(2,"p",8),Z._uU(3),Z.qZA()()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.Q6J("value",e.spinnerValue)("mode",e.spinnerMode),Z.xp6(2),Z.Oqu(e.loading)}}function Tt(e,t){if(1&e&&(Z.TgZ(0,"div",1)(1,"div",2),Z._UZ(2,"belender-widget-step-logo",3)(3,"belender-success-step",4),Z.YNc(4,Ct,4,3,"div",5),Z.qZA()()),2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("background",e.data.styles.colors.background),Z.xp6(1),Z.Q6J("data",e.data)("customImage",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.success?null:e.data[e.flowName].texts.success.customImage),Z.xp6(1),Z.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("flowName",e.flowName),Z.xp6(1),Z.Q6J("ngIf",e.loading&&!e.error)}}St.ɵfac=function(e){return new(e||St)(Z.Y36(Z.sBO),Z.Y36(A.gz),Z.Y36(H.F),Z.Y36(B),Z.Y36(S.w),Z.Y36(J.r),Z.Y36(k.T),Z.Y36(w.t),Z.Y36(V.uw),Z.Y36(Q.D),Z.Y36($))},St.ɵcmp=Z.Xpm({type:St,selectors:[["belender-widget-videoid"]],viewQuery:function(e,t){if(1&e&&Z.Gf(st,5),2&e){let e;Z.iGM(e=Z.CRH())&&(t.formComponent=e.first)}},inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud"},features:[Z._Bn([{provide:P.o2,useValue:{appearance:"standard"}}])],decls:3,vars:3,consts:[[3,"hideButtons","flow","userId","accept",4,"ngIf"],["class","h-full widget-belender",4,"ngIf"],[3,"flow","lang","allData","requestStatus","accepted","cancelled",4,"ngIf"],[3,"hideButtons","flow","userId","accept"],[1,"h-full","widget-belender"],[4,"ngIf"],["class","flex justify-center h-full min-h-[300px] items-center",4,"ngIf"],["class","loading-wrapper animated fadeIn",4,"ngIf"],["class","animated fadeInRight",4,"ngIf"],[1,"flex","justify-center","h-full","min-h-[300px]","items-center"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],[3,"data","labels","status",4,"ngIf"],[3,"data","flowName","requestID","requestIDFromURL","userId","texts","solicitud","labels","lang","goToTerms","goToPower","goToTermsCertificate","nextStep",4,"ngIf"],[3,"data","labels","texts","solicitud","resendOTP","errorPhone","nextStep",4,"ngIf"],[3,"data","labels","texts","solicitud","nextStep",4,"ngIf"],[3,"data","flowName","packId","userId","requestID","labels","texts",4,"ngIf"],[3,"data","labels","texts","solicitud","retry","newRequest",4,"ngIf"],[3,"solicitud","data","labels","texts","nextStep",4,"ngIf"],[3,"solicitud","data","labels","texts","retry",4,"ngIf"],[3,"data","labels","status"],[3,"data","flowName","requestID","requestIDFromURL","userId","texts","solicitud","labels","lang","goToTerms","goToPower","goToTermsCertificate","nextStep"],["formStep",""],[3,"data","labels","texts","solicitud","resendOTP","errorPhone","nextStep"],[3,"data","labels","texts","solicitud","nextStep"],[3,"data","flowName","packId","userId","requestID","labels","texts"],[3,"data","labels","texts","solicitud","retry","newRequest"],[3,"solicitud","data","labels","texts","nextStep"],[3,"solicitud","data","labels","texts","retry"],[1,"loading-wrapper","animated","fadeIn"],["color","accent","diameter","40",1,"spinner",3,"value","mode"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[1,"animated","fadeInRight"],[1,"px-6","py-4","flex","flex-col"],[1,"text-red-500","title","m-0"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"text-blue-500","bg-blue-50","px-8",3,"click"],[1,"test-mode","px-10","py-2","bg-blue-500/10","text-blue-500","border-blue-500","border","rounded-md"],[3,"flow","lang","allData","requestStatus","accepted","cancelled"]],template:function(e,t){1&e&&(Z.YNc(0,rt,1,3,"vex-power-cert",0),Z.YNc(1,wt,3,2,"div",1),Z.YNc(2,xt,1,4,"vex-terms",2)),2&e&&(Z.Q6J("ngIf",t.viewPowerTerms),Z.xp6(1),Z.Q6J("ngIf",t.data),Z.xp6(1),Z.Q6J("ngIf",t.showTermsDialog))},dependencies:[i.O5,u.lW,y.Ou,K.L,X.L,ee.q,he,fe,be,Be,Je,Qe,We,it],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative}.widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"]}),St=(0,D.gn)([(0,N.c)()],St);let kt=class{constructor(e,t,n,i,s,r,o,a){this.cd=e,this.Activatedroute=t,this.utils=n,this.videoIDService=i,this.customizationStoreService=s,this.customizationService=r,this.notis=o,this.translationService=a,this.data=null,this.disableActions=!1,this.step="created",this.flowName="VideoID",this.labels=F.S.es,this.waitingTime=15,this.loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1}ngOnInit(){this.labels=this.translationService.getLabelsTranslated(localStorage.getItem("belender-language")||"es"),this.loading=this.labels.certificate.loadings.gettingRequestInfo,this.Activatedroute.params.subscribe((e=>{e&&e.idUser?(this.userId=e.idUser,this.setInitialData(this.userId)):this.loading=null,e&&e.packID&&(this.packId=e.packID)}),(e=>{this.loading=null})),this.utils.setLoading(!1)}ngOnDestroy(){}setInitialData(e){var t=this;return(0,L.Z)((function*(){const n=(0,Y.cm)(yield t.getFlow(e));if(t.data={config:t.customizationStoreService.FUNDER_CONFIG,styles:t.customizationStoreService.FUNDER_STYLES,[t.flowName]:n},(0,Y.bf)(t.data,t.flowName),!t.data.config||!t.data.config.funder_id)return t.notis.showAlert(t.labels.warnings.error,t.labels.warnings.noCustomization,"error"),t.loading=null,void t.cd.markForCheck();t.financiadorID=t.data.config.funder_id||"",t.loading=null,t.cd.markForCheck()}))()}getFlow(e){var t=this;return(0,L.Z)((function*(){return new Promise((n=>{t.customizationService.getCustomizationByFlow(e,t.flowName,t.customizationStoreService.LANG).then((e=>{n(e?.data?e.data:null)}),(e=>{n(null)}))}))}))()}showAlert(e,t){this.loading=null,this.notis.showAlert(e,t)}initWaitingForResponse(e){this.loading=e||"Validando información, espere por favor..",setTimeout((()=>{this.loading&&this.askToBack()}),1e4)}askToBack(){this.videoIDService.getSolicitudByCode(this.requestID).then((e=>{e&&e.data?(this.solicitud=e.data,this.loading=null):this.loading=null})).catch((e=>{this.loading=null}))}setRequestStatus(e){this.solicitud.status_code=e}};function Mt(e,t){if(1&e&&(Z.TgZ(0,"div",6),Z._UZ(1,"mat-progress-spinner",7),Z.TgZ(2,"p",8),Z._uU(3),Z.qZA()()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.Q6J("value",e.spinnerValue)("mode",e.spinnerMode),Z.xp6(2),Z.Oqu(e.loading)}}function It(e,t){if(1&e&&(Z.TgZ(0,"div",1)(1,"div",2),Z._UZ(2,"belender-widget-step-logo",3)(3,"belender-fail-step",4),Z.YNc(4,Mt,4,3,"div",5),Z.qZA()()),2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("background",e.data.styles.colors.background),Z.xp6(1),Z.Q6J("data",e.data)("customImage",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.fail?null:e.data[e.flowName].texts.fail.customImage),Z.xp6(1),Z.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud),Z.xp6(1),Z.Q6J("ngIf",e.loading&&!e.error)}}kt.ɵfac=function(e){return new(e||kt)(Z.Y36(Z.sBO),Z.Y36(A.gz),Z.Y36(H.F),Z.Y36(B),Z.Y36(J.r),Z.Y36(S.w),Z.Y36(k.T),Z.Y36(Q.D))},kt.ɵcmp=Z.Xpm({type:kt,selectors:[["belender-widget-videoid-success"]],inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud",flowName:"flowName"},features:[Z._Bn([{provide:P.o2,useValue:{appearance:"standard"}}])],decls:1,vars:1,consts:[["class","h-full widget-belender",4,"ngIf"],[1,"h-full","widget-belender"],[1,"h-full","w-full","flex-auto","p-0","md:p-3"],[3,"data","customImage"],[3,"data","texts","flowName"],["class","loading-wrapper animated fadeIn",4,"ngIf"],[1,"loading-wrapper","animated","fadeIn"],["color","accent","diameter","40",1,"spinner",3,"value","mode"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&Z.YNc(0,Tt,5,8,"div",0),2&e&&Z.Q6J("ngIf",t.data)},dependencies:[i.O5,y.Ou,ne.y,fe],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative}.widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"]}),kt=(0,D.gn)([(0,N.c)()],kt);let Et=class{constructor(e,t,n,i,s,r,o,a){this.cd=e,this.Activatedroute=t,this.utils=n,this.videoIDService=i,this.customizationService=s,this.customizationStoreService=r,this.notis=o,this.translationService=a,this.data=null,this.disableActions=!1,this.step="created",this.flowName="VideoID",this.labels=F.S.es,this.waitingTime=15,this.loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1}ngOnInit(){this.labels=this.translationService.getLabelsTranslated(localStorage.getItem("belender-language")||"es"),this.loading=this.labels.certificate.loadings.gettingRequestInfo,this.Activatedroute.params.subscribe((e=>{e&&e.idUser?(this.userId=e.idUser,this.setInitialData(this.userId)):this.loading=null,e&&e.packID&&(this.packId=e.packID)}),(e=>{this.loading=null})),this.utils.setLoading(!1)}ngOnDestroy(){}setInitialData(e){var t=this;return(0,L.Z)((function*(){const n=(0,Y.cm)(yield t.getFlow(e));if(t.data={config:t.customizationStoreService.FUNDER_CONFIG,styles:t.customizationStoreService.FUNDER_STYLES,[t.flowName]:n},(0,Y.bf)(t.data,t.flowName),!t.data.config||!t.data.config.funder_id)return t.notis.showAlert(t.labels.warnings.error,t.labels.warnings.noCustomization,"error"),t.loading=null,void t.cd.markForCheck();t.financiadorID=t.data.config.funder_id||"",t.loading=null,t.cd.markForCheck()}))()}getFlow(e){var t=this;return(0,L.Z)((function*(){return new Promise((n=>{t.customizationService.getCustomizationByFlow(e,t.flowName,t.customizationStoreService.LANG).then((e=>{n(e?.data?e.data:null)}),(e=>{n(null)}))}))}))()}showAlert(e,t){this.loading=null,this.notis.showAlert(e,t)}initWaitingForResponse(e){this.loading=e||"Validando información, espere por favor..",setTimeout((()=>{this.loading&&this.askToBack()}),1e4)}askToBack(){this.videoIDService.getSolicitudByCode(this.requestID).then((e=>{e&&e.data?(this.solicitud=e.data,this.loading=null):this.loading=null})).catch((e=>{this.loading=null}))}setRequestStatus(e){this.solicitud.status_code=e}};Et.ɵfac=function(e){return new(e||Et)(Z.Y36(Z.sBO),Z.Y36(A.gz),Z.Y36(H.F),Z.Y36(B),Z.Y36(S.w),Z.Y36(J.r),Z.Y36(k.T),Z.Y36(Q.D))},Et.ɵcmp=Z.Xpm({type:Et,selectors:[["belender-widget-videoid-fail"]],inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud",flowName:"flowName"},features:[Z._Bn([{provide:P.o2,useValue:{appearance:"standard"}}])],decls:1,vars:1,consts:[["class","h-full widget-belender",4,"ngIf"],[1,"h-full","widget-belender"],[1,"h-full","w-full","flex-auto","p-0","md:p-3"],[3,"data","customImage"],[3,"data","texts","solicitud"],["class","loading-wrapper animated fadeIn",4,"ngIf"],[1,"loading-wrapper","animated","fadeIn"],["color","accent","diameter","40",1,"spinner",3,"value","mode"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&Z.YNc(0,It,5,8,"div",0),2&e&&Z.Q6J("ngIf",t.data)},dependencies:[i.O5,y.Ou,ne.y,be],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative}.widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"]}),Et=(0,D.gn)([(0,N.c)()],Et);const At=[{path:":idUser",component:St},{path:":idUser/:packID",component:St},{path:":idUser/:packID/success",component:kt},{path:":idUser/:packID/fail",component:Et}];let Ot=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=Z.oAB({type:e}),e.ɵinj=Z.cJS({imports:[A.Bz.forChild(At),A.Bz,O.d8]}),e})();var Lt=n(6981),Dt=n(3848),Pt=n(1129),Nt=n(1258),qt=n(3295),Rt=n(2266),Yt=n(3300),Ft=n(865);let Ut=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=Z.oAB({type:e}),e.ɵinj=Z.cJS({providers:[_.M,v.o,S.w,w.t,k.T,E.t,$,{provide:T.Ad,useValue:"es-ES"}],imports:[Ot,i.ez,s.G,r.J,o.TU,a.p0,l.JX,c.p9,d.Ps,u.ot,h.Tx,x.c,p.u5,m.AV,p.UX,f.LD,g.vV,b.a,y.Cq,C.FA,T.XK,M.T5,I.Fk,Lt.x,Dt.Nh,Pt.n,Nt.H,qt.g,Rt.L,Yt.C,Ft.q]}),e})()},5469:(e,t,n)=>{n.d(t,{B:()=>w});var i=n(5861),s=n(7582),r=n(9933),o=n(8259),a=n(6305),l=n(4650),c=n(8467),d=n(7367),u=n(8460),h=n(8594),p=n(9045),m=n(5601),f=n(6895),g=n(2237),_=n(9199);const b=["widgetCard"];function v(e,t){1&e&&(l.ynx(0),l._UZ(1,"router-outlet"),l.BQk())}const y=function(e){return{"margin-top":e}};let w=class{constructor(e,t,n,i,s,r){this.utils=e,this.customizationService=t,this.customizationStoreService=n,this.router=i,this.deviceInfoService=s,this.solicitudesService=r,this.type="",this.widgetHeight=0,this.warningsSpace=0,this.isScaled=!1,this.funderConfigLoaded=!1,this.funderStylesLoaded=!1,this.lang="es",this.widgetFlowApiName="SMS",this.flowCustomizationFallback=null}ngOnInit(){this.getWindowsScreenOrientation(),this.utils.getWarningsSpaces().subscribe((e=>{this.warningsSpace=e}));const e=this.router.parseUrl(this.router.url),t=e.root.children.primary?.segments.map((e=>e.path))??[];this.userId=t[2]??"",this.packId=t[3]??"",this.widgetFlowApiName=(0,a.G4)(t[1]),this.userId&&(this.customizationStoreService.setUserID(this.userId),this.setCustomization()),this.packId&&this.customizationStoreService.setPackID(this.packId);const n=e.queryParams.lang;n&&(this.lang=n,this.customizationStoreService.setLang(n))}ngDoCheck(){this.getWidgetCardHeight()}ngOnDestroy(){window.screen&&window.screen.orientation&&this.orientationChangeHandler&&window.screen.orientation.removeEventListener("change",this.orientationChangeHandler)}ngAfterViewInit(){o("body").css("background","transparent"),o("body").css("background-color","transparent")}getWindowsScreenOrientation(){window.addEventListener("resize",(()=>{this.widgetHeight=this.widgetCard.nativeElement.offsetHeight,this.isScaled&&(this.widgetHeight=1.5*this.widgetHeight),this.sendMessageToParent({type:"widgetHeight",data:this.widgetHeight})})),window.screen&&window.screen.orientation?(this.orientationChangeHandler=()=>{this.getWidgetCardHeight()},window.screen.orientation.addEventListener("change",this.orientationChangeHandler)):console.warn("Screen Orientation API not supported.")}getWidgetCardHeight(){this.widgetCard&&this.widgetHeight!=this.widgetCard.nativeElement.offsetHeight&&(this.widgetHeight=this.widgetCard.nativeElement.offsetHeight,this.isScaled$=this.deviceInfoService.isScaled$.subscribe((e=>{this.isScaled=e,this.isScaled&&(this.widgetHeight=1.5*this.widgetHeight)})),this.sendMessageToParent({type:"widgetHeight",data:this.widgetHeight}))}sendMessageToParent(e){console.log("Message to parent:",e),window.top.postMessage(e,"*")}loadFlowCustomizationOnce(){return this.flowCustomizationFallback||(this.flowCustomizationFallback=this.customizationService.getCustomizationByFlow(this.userId,this.widgetFlowApiName,this.customizationStoreService.LANG,void 0,"").catch((e=>(console.log("🚀 ~ WidgetComponent ~ fallback flow",this.widgetFlowApiName,e),null)))),this.flowCustomizationFallback}setCustomization(){var e,t=this;this.flowCustomizationFallback=null,this.customizationService.getFunderConfig(this.userId).then((e=>{this.customizationStoreService.setFunderConfig((0,a.PX)(e?.data??e,this.userId)),this.funderConfigLoaded=!0})).catch((e=(0,i.Z)((function*(e){console.log("🚀 ~ WidgetComponent ~ getFunderConfig ~ intentando datos del flujo:",e);const n=yield t.loadFlowCustomizationOnce(),{config:i}=(0,a.Y1)(n);t.customizationStoreService.setFunderConfig((0,a.PX)(i,t.userId)),t.funderConfigLoaded=!0})),function(t){return e.apply(this,arguments)})),this.customizationService.getFunderStyles(this.userId).then((e=>{this.customizationStoreService.setFunderStyles((0,a.mO)(e?.data??e)),this.funderStylesLoaded=!0})).catch(function(){var e=(0,i.Z)((function*(e){console.log("🚀 ~ WidgetComponent ~ getFunderStyles ~ intentando datos del flujo:",e);const n=yield t.loadFlowCustomizationOnce(),{styles:i}=(0,a.Y1)(n);t.customizationStoreService.setFunderStyles((0,a.mO)(i)),t.funderStylesLoaded=!0}));return function(t){return e.apply(this,arguments)}}())}};w.ɵfac=function(e){return new(e||w)(l.Y36(c.F),l.Y36(d.w),l.Y36(u.r),l.Y36(h.F0),l.Y36(p.H),l.Y36(m.M))},w.ɵcmp=l.Xpm({type:w,selectors:[["belender-widget"]],viewQuery:function(e,t){if(1&e&&l.Gf(b,5),2&e){let e;l.iGM(e=l.CRH())&&(t.widgetCard=e.first)}},inputs:{type:"type"},decls:4,vars:4,consts:[[1,"belender-page-layout","h-auto","p-0","md:p-4","overflow-y-visible",3,"ngStyle"],[1,"h-auto","overflow-y-visible","content-layout","overflow-x-hidden","content-widget","p-0","md:p-3"],["widgetCard",""],[4,"ngIf"]],template:function(e,t){1&e&&(l.TgZ(0,"vex-page-layout",0)(1,"vex-page-layout-content",1,2),l.YNc(3,v,2,0,"ng-container",3),l.qZA()()),2&e&&(l.Q6J("ngStyle",l.VKq(2,y,t.warningsSpace+"px")),l.xp6(3),l.Q6J("ngIf",t.funderConfigLoaded&&t.funderStylesLoaded))},dependencies:[f.O5,f.PC,h.lC,g.w,_.d],styles:[".badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.card[_ngcontent-%COMP%]{margin:0 auto;max-width:440px}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.content-layout[_ngcontent-%COMP%]{max-height:none;max-height:initial;overflow-y:auto;padding:0!important}.belender-page-layout[_ngcontent-%COMP%]{padding:0!important}"]}),w=(0,s.gn)([(0,r.c)()],w)},2932:(e,t,n)=>{function i(e={}){return t=>{const n=t.value;if(!n)return null;const i=n.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(e.checkFormat&&!i)return{invalidFormat:!0};if(!i)return null;const s=parseInt(i[1],10),r=parseInt(i[2],10)-1,o=parseInt(i[3],10),a=new Date(o,r,s);if(e.checkDate&&(a.getFullYear()!==o||a.getMonth()!==r||a.getDate()!==s))return{invalidDate:!0};if(e.checkAge){const e=new Date;let t=e.getFullYear()-o;const n=e.getMonth()-r;if((n<0||0===n&&e.getDate()<s)&&t--,t<18)return{underAge:!0}}return null}}n.d(t,{s:()=>i})},769:(e,t,n)=>{function i(e,t){e.submitAttempted=!0,e.form?.markAllAsTouched(),t?.markForCheck()}n.d(t,{J:()=>i})},9382:(e,t,n)=>{n.d(t,{i:()=>p});var i=n(4650),s=n(8135),r=n(5601),o=n(5895),a=n(6895),l=n(3731);function c(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"div",4),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw(2);return i.KtG(t.goToCancelRequest())})),i.ALo(1,"safeHtml"),i.qZA()}if(2&e){const e=i.oxw(2);i.Udp("color",e.textColor),i.Q6J("innerHTML",i.lcZ(1,3,e.customText),i.oJD)}}function d(e,t){if(1&e&&(i.TgZ(0,"div",5),i._uU(1),i.qZA()),2&e){const e=i.oxw(2);i.xp6(1),i.hij(" ",e.labels.loadings.cancelingRequest,"\n")}}const u=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function h(e,t){if(1&e&&(i.TgZ(0,"div",1),i.YNc(1,c,2,5,"div",2),i.YNc(2,d,2,1,"div",3),i.qZA()),2&e){const e=i.oxw();i.Q6J("ngClass",i.kEZ(3,u,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),i.xp6(1),i.Q6J("ngIf",!e.loading),i.xp6(1),i.Q6J("ngIf",e.loading)}}let p=(()=>{class e{constructor(e,t,n){this.smsComponent=e,this.solicitudesService=t,this.notis=n,this.customText="",this.textColor="",this.flowType="SMS",this.updateStatusCode=new i.vpe,this.requestType="sms",this.loading=!1}goToCancelRequest(){this.loading=!0;const e={request_id:this.request_id,user_id:this.user_id};this.requestType="ClavePin"===this.flowType?"clave-pin":"sms",this.solicitudesService.cancelRequest(e,this.requestType).then((e=>{e&&e.data&&("SMS"===this.flowType?this.setSmsCancel("consent_process_canceled"):this.updateStatusCode.emit("consent_process_canceled")),e.message&&this.showAlert(e.status?this.capitalizeFirstLetter(e.status)+"!":"Aviso!",e.message),setTimeout((()=>{this.loading=!1}),1e3)})).catch((e=>{this.loading=!1,this.showAlert("Error!",e.message||e)}))}capitalizeFirstLetter(e){return"string"!=typeof e||0===e.length?e:e.charAt(0).toUpperCase()+e.slice(1)}showAlert(e,t){this.notis.showAlert(e,t)}setSmsCancel(e){this.smsComponent.setRequestStatus(e),this.smsComponent.setStatus()}}return e.ɵfac=function(t){return new(t||e)(i.Y36(s.T,9),i.Y36(r.M),i.Y36(o.T))},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-cancel-request"]],inputs:{data:"data",customText:"customText",textColor:"textColor",flowType:"flowType",request_id:"request_id",user_id:"user_id",labels:"labels"},outputs:{updateStatusCode:"updateStatusCode"},decls:1,vars:1,consts:[["class","flex",3,"ngClass",4,"ngIf"],[1,"flex",3,"ngClass"],["class","subheading-1 px-2 text-right underline cursor-pointer custom-html",3,"color","innerHTML","click",4,"ngIf"],["class","subheading-1 px-2 text-right text-orange-500 custom-html",4,"ngIf"],[1,"subheading-1","px-2","text-right","underline","cursor-pointer","custom-html",3,"innerHTML","click"],[1,"subheading-1","px-2","text-right","text-orange-500","custom-html"]],template:function(e,t){1&e&&i.YNc(0,h,3,7,"div",0),2&e&&i.Q6J("ngIf",t.data&&t.data.styles)},dependencies:[a.mk,a.O5,l.z]}),e})()},9112:(e,t,n)=>{n.d(t,{y:()=>N});var i=n(5861),s=n(4650),r=n(4006),o=n(8259),a=n(2440),l=n(5762),c=n(2340),d=n(8135),u=n(8467),h=n(2254),p=n(5601),m=n(8460),f=n(1742),g=n(6895),_=n(9101),b=n(8429),v=n(3731);function y(e,t){if(1&e&&s._UZ(0,"div",13),2&e){const e=s.oxw();s.Udp("color",null==e.data.styles?null:e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),s.Q6J("innerHTML",e.texts[e.otpType].title,s.oJD)}}function w(e,t){if(1&e&&(s._UZ(0,"div",14),s.ALo(1,"safeHtml")),2&e){const e=s.oxw();s.Udp("color",null==e.data.styles?null:e.data.styles.colors.text),s.Q6J("innerHTML",s.lcZ(1,3,null==e.texts[e.otpType]?null:e.texts[e.otpType].description),s.oJD)}}function x(e,t){if(1&e&&(s.ynx(0),s._uU(1),s.BQk()),2&e){const e=s.oxw(2);s.xp6(1),s.hij(" ",e.labels?e.labels.otp.requestingOtp:"Estamos solicitando el código. Por favor, espere un momento."," ")}}function S(e,t){if(1&e&&(s.ynx(0),s._uU(1),s.BQk()),2&e){const e=s.oxw(2);s.xp6(1),s.AsE(" ",e.labels?e.labels.otp.otpSentToNumber:"El código ha sido enviado al teléfono acabado en"," ",e.lastThreeNumbersPhone,". ")}}function C(e,t){if(1&e&&(s.ynx(0),s._uU(1),s.BQk()),2&e){const e=s.oxw(2);s.xp6(1),s.hij(" ",e.labels?e.labels.otp.requestingCode:"Estamos solicitando el código. Por favor, espere un momento."," ")}}const T=function(e,t,n){return{color:e,border:t,background:n}};function k(e,t){if(1&e&&(s.ynx(0),s.TgZ(1,"small",15),s.YNc(2,x,2,1,"ng-container",6),s.YNc(3,S,2,2,"ng-container",6),s.YNc(4,C,2,1,"ng-container",6),s.qZA(),s.BQk()),2&e){const e=s.oxw();s.xp6(1),s.Q6J("ngStyle",s.kEZ(4,T,null==e.data.styles?null:e.data.styles.colors.accentColor,"1px solid "+(null==e.data.styles?null:e.data.styles.colors.accentColor),null==e.data.styles?null:e.data.styles.colors.accentBgColor)),s.xp6(1),s.Q6J("ngIf",!e.lastThreeNumbersPhone),s.xp6(1),s.Q6J("ngIf",e.lastThreeNumbersPhone&&!(null!=e.data.config&&e.data.config.noRetryInBadPhone)),s.xp6(1),s.Q6J("ngIf",e.lastThreeNumbersPhone&&(null==e.data.config?null:e.data.config.noRetryInBadPhone))}}function M(e,t){if(1&e&&(s.TgZ(0,"span"),s._uU(1),s.qZA()),2&e){const e=s.oxw(2);s.xp6(1),s.hij(" ",e.labels?e.labels.otp.noReceivedCode:"¿No has recibido el código en tu teléfono?"," ")}}function I(e,t){if(1&e&&(s.TgZ(0,"span"),s._uU(1),s.qZA()),2&e){const e=s.oxw(2);s.xp6(1),s.AsE("",e.labels?e.labels.otp.noReceivedCode2:"¿No has recibido el código en el teléfono acabado en"," ",e.lastThreeNumbersPhone,"? ")}}function E(e,t){if(1&e&&(s.TgZ(0,"span"),s._uU(1),s.qZA()),2&e){const e=s.oxw(2);s.xp6(1),s.hij(" ",e.labels?e.labels.otp.noReceivedCode:"¿No has recibido el código en tu teléfono?"," ")}}const A=function(e,t){return{color:e,background:t}};function O(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"a",18),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.resendOTP())})),s._uU(1),s.qZA()}if(2&e){const e=s.oxw(2);s.Q6J("ngStyle",s.WLB(2,A,null==e.data.styles?null:e.data.styles.colors.dangerTextButtonColor,null==e.data.styles?null:e.data.styles.colors.dangerColor)),s.xp6(1),s.hij(" ",e.labels?e.labels.actions.resend:"Reenviar"," ")}}function L(e,t){if(1&e&&(s.ynx(0),s.TgZ(1,"small",16),s.YNc(2,M,2,1,"span",6),s.YNc(3,I,2,2,"span",6),s.YNc(4,E,2,1,"span",6),s.YNc(5,O,2,5,"a",17),s.qZA(),s.BQk()),2&e){const e=s.oxw();s.xp6(1),s.Q6J("ngStyle",s.kEZ(5,T,null==e.data.styles?null:e.data.styles.colors.dangerColor,"1px solid "+(null==e.data.styles?null:e.data.styles.colors.dangerColor),null==e.data.styles?null:e.data.styles.colors.dangerBgColor)),s.xp6(1),s.Q6J("ngIf",!e.lastThreeNumbersPhone),s.xp6(1),s.Q6J("ngIf",e.lastThreeNumbersPhone&&!(null!=e.data.config&&e.data.config.noRetryInBadPhone)),s.xp6(1),s.Q6J("ngIf",null==e.data.config?null:e.data.config.noRetryInBadPhone),s.xp6(1),s.Q6J("ngIf",!e.secondTry)}}const D=function(e,t){return{length:e,allowNumbersOnly:t}},P=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let N=(()=>{class e{constructor(e,t,n,i,r,o,a,l){this.smsComponent=e,this.fb=t,this.utils=n,this.smsFlowService=i,this.solicitudesService=r,this.cd=o,this.customizationStoreService=a,this.pinUtils=l,this.minLength=3,this.logoCustom="",this.next=new s.vpe(null),this.errPhone=new s.vpe(null),this.resendO=new s.vpe(null),this.secsCount=60,this.secondTry=!1,this.timerIsRunning=!1,this.env=c.N.env,this.limitSecsCount=60}ngOnInit(){this.packId=this.customizationStoreService.PACK_ID,this.userId=this.customizationStoreService.USER_ID,this.resolveLabels(),this.form=this.fb.group({code1:[null,[r.kI.required,r.kI.maxLength(6),r.kI.minLength(this.minLength)]]}),this.subsPhone=this.pinUtils.lastThreeNumbersPhone$.subscribe((e=>{this.lastThreeNumbersPhone=e})),this.subsPhone=this.pinUtils.lastThreeNumbersPhone$.subscribe((e=>{this.lastThreeNumbersPhone=e})),"SMS"==this.flowType&&this.solicitud&&this.solicitud.person_phone&&this.setPhone(this.solicitud.person_phone)}ngOnDestroy(){this.subsPhone&&this.subsPhone.unsubscribe()}resetOtpNumber(){this.form.get("code1").setValue(""),this.ngOtpInput.setValue("")}ngOnChanges(e){e.otpType&&!e.otpType.previousValue&&(this.limitSecsCount="otpAEAT"==e.otpType?.currentValue||"otpIRS"==e.otpType?.currentValue?300:60,this.initSecsInterval())}setPhone(e){let t="XXX";e&&(t=(""+e).slice(-3)),this.lastThreeNumbersPhone=t}resolveLabels(){this.labels||(this.labels=this.pinUtils.labels)}initSecsInterval(){this.timerIsRunning||(this.secsCount=+this.limitSecsCount,this.interv=setInterval((()=>{this.timerIsRunning=!0,this.secsCount=this.secsCount-1,this.secsRemaining=this.getRemaining(),this.secsCount<=0&&this.finishSecsInterval()}),1e3))}getRemaining(){let e=Math.floor(this.secsCount/60),t=this.secsCount%60;return this.addZero(e)+":"+this.addZero(t)}addZero(e){return e>=10?e:"0"+e}finishSecsInterval(){this.timerIsRunning=!1,this.interv&&clearInterval(this.interv)}getCode(){return this.form.get("code1").value}capturePasteEvent(e){var t=this;return(0,i.Z)((function*(){t.form.get("code1").setValue(e)}))()}setInputEvent(e){""!=e.target.value?o(e.target).next().focus():"Backspace"==e.code&&o(e.target).prev().focus()}nextStep(){let e={code:this.getCode()};"SMS"===this.flowType?this.requestSmsOTP(e):this.next.emit(e)}resendOTP(){this.secondTry=!0,this.initSecsInterval(),"SMS"===this.flowType?this.resendSmsOTP(!0):this.resendO.emit(!0)}requestSmsOTP(e){this.smsFlowService.setLoading(this.labels.loadings.sendingData),this.smsComponent.showAlert(null),this.testMode?setTimeout((()=>{this.smsFlowService.setRequest(new l.l),this.smsComponent.setRequestStatus("all_documents_downloaded"),this.smsComponent.setStatus(),this.smsFlowService.setLoading(!1)}),2e3):this.solicitudesService.sendOTP({request_id:this.requestID,user_id:this.userId,code:e.code}).then((e=>{e.status&&"error"==e.status?(this.smsComponent.showAlert(this.labels.warnings.error,e.message&&"Invalid request status: waiting_login_seguridad_social"==e.message?this.labels.warnings.unknownError:e.message?e.message.code?this.labels.warnings.wrongOtp:e.message.request_id?this.labels.warnings.noRequests:this.labels.warnings.unknownError:this.labels.warnings.unknownError),this.smsFlowService.setLoading(!1)):e&&"success"==e.status&&(this.smsComponent.handleRequestStatus(e.data||e),this.cd.markForCheck())})).catch((e=>{this.smsComponent.showAlert(this.labels.warnings.error,e?.error||e?.message||e||this.labels.warnings.unknownError),this.smsFlowService.setLoading(!1)})),this.resetOtpNumber()}resendSmsOTP(e){let t={request_id:(this.smsFlowService.REQUEST&&this.smsFlowService.REQUEST.request_id?this.smsFlowService.REQUEST.request_id:this.requestID)||e,user_id:this.userId};this.smsComponent.showAlert(null),this.smsFlowService.setLoading(this.labels.loadings.resendingOtp),this.smsFlowService.setSubscriptionOfRequest(),this.solicitudesService.resendOTP(t).then((e=>{e&&e.data&&(this.smsFlowService.setRequest(e.data),this.smsComponent.setStatus()),this.smsFlowService.setLoading(!1)})).catch((e=>{console.error(e),this.smsComponent.showAlert(this.labels.warnings.error,e?.error||e?.message||e||this.labels.warnings.unknownError),this.smsFlowService.setLoading(!1)})),this.resetOtpNumber()}}return e.ɵfac=function(t){return new(t||e)(s.Y36(d.T,9),s.Y36(r.QS),s.Y36(u.F),s.Y36(h.p),s.Y36(p.M),s.Y36(s.sBO),s.Y36(m.r),s.Y36(f._))},e.ɵcmp=s.Xpm({type:e,selectors:[["belender-shared-otp-step"]],viewQuery:function(e,t){if(1&e&&s.Gf(a.df,5),2&e){let e;s.iGM(e=s.CRH())&&(t.ngOtpInput=e.first)}},inputs:{data:"data",texts:"texts",lastThreeNumbersPhone:"lastThreeNumbersPhone",otpType:"otpType",minLength:"minLength",flowType:"flowType",logoCustom:"logoCustom",labels:"labels",requestID:"requestID",testMode:"testMode",solicitud:"solicitud"},outputs:{next:"nextStep",errPhone:"errorPhone",resendO:"resendOTP"},features:[s.TTD],decls:16,vars:27,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-1","flex","flex-col"],["id","otpTitle","class","title m-0",3,"color","font-size","innerHTML",4,"ngIf"],["id","otpDescription","class","subheading-1 pt-4",3,"color","innerHTML",4,"ngIf"],[1,"title","py-2"],[4,"ngIf"],[1,"flex","w-full","flex-col","gap-2","py-2"],[1,"subheading-1","py-1","custom-html"],[3,"config","onInputChange"],["ngOtpInput",""],[1,"flex","items-center","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],["id","otpTitle",1,"title","m-0",3,"innerHTML"],["id","otpDescription",1,"subheading-1","pt-4",3,"innerHTML"],["id","secsCountContainer",1,"info-time","w-full",3,"ngStyle"],[1,"info-time","w-full",3,"ngStyle"],["id","resendOTPButton","class","ml-4",3,"ngStyle","click",4,"ngIf"],["id","resendOTPButton",1,"ml-4",3,"ngStyle","click"]],template:function(e,t){1&e&&(s._UZ(0,"belender-widget-step-logo",0),s.TgZ(1,"form",1)(2,"div",2),s.YNc(3,y,1,5,"div",3),s.YNc(4,w,2,5,"div",4),s.TgZ(5,"div",5),s.YNc(6,k,5,8,"ng-container",6),s.YNc(7,L,6,9,"ng-container",6),s.qZA(),s.TgZ(8,"div",7)(9,"p",8),s._uU(10),s.qZA(),s.TgZ(11,"ng-otp-input",9,10),s.NdJ("onInputChange",(function(e){return t.capturePasteEvent(e)})),s.qZA()()(),s.TgZ(13,"div",11)(14,"button",12),s.NdJ("click",(function(){return t.nextStep()})),s._uU(15),s.qZA()()()),2&e&&(s.Q6J("data",t.data)("customImage",t.logoCustom),s.xp6(1),s.Q6J("formGroup",t.form),s.xp6(2),s.Q6J("ngIf",t.texts&&(null==t.texts[t.otpType]?null:t.texts[t.otpType].title)&&""!=(null==t.texts[t.otpType]?null:t.texts[t.otpType].title)),s.xp6(1),s.Q6J("ngIf",t.texts&&(null==t.texts[t.otpType]?null:t.texts[t.otpType].description)&&""!=(null==t.texts[t.otpType]?null:t.texts[t.otpType].description)),s.xp6(2),s.Q6J("ngIf",t.secsCount&&t.secsCount>0),s.xp6(1),s.Q6J("ngIf",!t.secsCount||t.secsCount<=0),s.xp6(2),s.Udp("color",t.data.styles.colors.text),s.xp6(1),s.hij(" ",t.labels?t.labels.otp.otpCode:"Código OTP (recibido por SMS)"," "),s.xp6(1),s.Q6J("config",s.WLB(20,D,t.minLength,"qa"!=t.env&&"dev"!=t.env)),s.xp6(2),s.Q6J("ngClass",s.kEZ(23,P,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),s.xp6(1),s.Udp("color",null==t.data.styles?null:t.data.styles.colors.btnText)("background",t.form.invalid?"":null==t.data.styles?null:t.data.styles.colors.btnBg)("border-radius",(null==t.data.styles?null:t.data.styles.btnRound)+"px"),s.Q6J("disabled",t.form.invalid),s.xp6(1),s.hij(" ",t.labels?t.labels.actions.next:"Siguiente"," "))},dependencies:[g.mk,g.O5,g.PC,_.lW,r._Y,r.JL,r.sg,a.df,b.y,v.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.code-wrapper[_ngcontent-%COMP%]{padding:5px;height:50px}.code-wrapper[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:40px;min-width:136px;border-radius:6px;border:1px solid rgba(0,0,0,.1);text-transform:uppercase;text-align:left;font-weight:700;transition:all .3s ease;outline:1px solid transparent;letter-spacing:12px;padding:0 18px}.code-wrapper[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:hover{background:#fcfcfc;border:1px solid rgba(0,0,0,.2);transition:all .3s ease}.code-wrapper[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus{outline:1px solid #4e98d0;border:1px solid #4e98d0}.info-time[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:7px 10px;min-height:40px;font-size:14px;line-height:14px;border-radius:5px;border-width:1px;border-style:solid;margin:10px 0}.info-time[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{font-size:14px;line-height:24px;padding:0 10px;border-radius:5px;cursor:pointer;transition:all .2s ease}@media (max-width: 576px){.info-time[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{padding:0 20px}}"]}),e})()},5696:(e,t,n)=>{n.d(t,{T:()=>p});var i=n(4650),s=n(7403),r=n(6390),o=n(5412),a=n(7308),l=n(6895);function c(e,t){if(1&e){const e=i.EpF();i.ynx(0),i._uU(1),i.TgZ(2,"a",1),i.NdJ("click",(function(t){i.CHM(e);const n=i.oxw();return i.KtG(n.gotoTermsAndConditions(t))})),i.TgZ(3,"u"),i._uU(4),i.qZA()(),i._uU(5),i.BQk()}if(2&e){const e=i.oxw();i.xp6(1),i.hij(" ",e.parts.p1," "),i.xp6(3),i.Oqu(e.parts.a1),i.xp6(1),i.hij(" ",e.parts.p2,"\n")}}function d(e,t){if(1&e&&(i.ynx(0),i._uU(1),i.BQk()),2&e){const e=i.oxw();i.xp6(1),i.hij(" ",e.policyLeadText,"\n")}}function u(e,t){if(1&e&&(i.TgZ(0,"span"),i._uU(1),i.qZA()),2&e){const e=i.oxw(2);i.xp6(1),i.hij(" ",e.parts.p3," ")}}function h(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"span"),i.YNc(1,u,2,1,"span",0),i.TgZ(2,"a",1),i.NdJ("click",(function(t){i.CHM(e);const n=i.oxw();return i.KtG(n.gotoLegalDocument(t))})),i.TgZ(3,"u"),i._uU(4),i.qZA()()()}if(2&e){const e=i.oxw();i.xp6(1),i.Q6J("ngIf",!e.isPolicyOnly),i.xp6(3),i.Oqu(e.parts.a2)}}let p=(()=>{class e{constructor(e,t){this.dialog=e,this.translationService=t,this.linkType="both",this.goToTerms=new i.vpe(null),this.customTerms=!1,this.lang="",this.parts={p1:"He leído y acepto los",p2:"del servicio",p3:"y la",a1:"términos y condiciones",a2:"política de privacidad"},this.translatedParts={es:{p1:"He leído y acepto los",p2:"del servicio",p3:"y la",a1:"términos y condiciones",a2:"política de privacidad"},ca:{p1:"He llegit i accepto els",p2:"del servei",p3:"i la",a1:"termes i condicions",a2:"política de privacitat"},en:{p1:"I have read and accept the",p2:"of the service",p3:"and the",a1:"terms and conditions",a2:"privacy policy"},fr:{p1:"J'ai lu et j'accepte les",p2:"du service",p3:"et la",a1:"conditions générales",a2:"polítique de confidentialité"},it:{p1:"Ho letto e accetto i",p2:"del servizio",p3:"e la",a1:"termini e condizioni",a2:"informativa sulla privacy"},pt:{p1:"Li e aceito os",p2:"do serviço",p3:"e a",a1:"termos e condições",a2:"política de privacidade"},de:{p1:"Ich habe die",p2:"des Dienstes gelesen und akzeptiere sie",p3:"sowie die",a1:"Nutzungsbedingungen",a2:"Datenschutzrichtlinie"}},this.policyLeadByLang={es:"He leído y acepto la",ca:"He llegit i accepto la",en:"I have read and accept the",fr:"J'ai lu et j'accepte la",it:"Ho letto e accetto la",pt:"Li e aceito a",de:"Ich habe die"}}translatedBlock(e){return this.translatedParts[e]??null}resolveLang(){return(0,r.ie)(this.lang?this.lang:localStorage.getItem("belender-language"))}isSpanishDefaultText(t,n){if(!t)return!0;const i=[e.defaultPartsEs[n],"a1"===n||"a2"===n?e.defaultLinkLabelsEs[n]:null,this.translatedParts.es[n]].filter(Boolean),s=t.toLowerCase();return i.some((e=>t===e||s===e.toLowerCase()))}ngOnInit(){this.rebuildParts()}ngOnChanges(e){(e.firstSentence||e.secondSentence||e.thirdSentence||e.termsActionText||e.policyActionText||e.lang)&&this.rebuildParts()}rebuildParts(){const e=this.resolveLang();this.parts={p1:this.getPart(this.firstSentence,"p1",e),p2:this.getPart(this.secondSentence,"p2",e),p3:this.getPart(this.thirdSentence,"p3",e),a1:this.getPart(this.termsActionText,"a1",e),a2:this.getPart(this.policyActionText,"a2",e)}}getPart(t,n,i){const s=i||this.resolveLang(),r=this.translatedBlock(s),o=t?.trim()??"";return"es"!==s&&r?.[n]&&this.isSpanishDefaultText(o,n)?r[n]:o||(r?.[n]?r[n]:e.defaultPartsEs[n]||"")}gotoTermsAndConditions(e){e.preventDefault(),e.stopPropagation(),this.goToTerms.emit(e)}gotoLegalDocument(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(s.N,{panelClass:"fullscreen-dialog",data:{lang:this.resolveLang(),allData:this.data,flow:this.flowName}})}get isTermsOnly(){return"terms"===this.linkType}get isPolicyOnly(){return"policy"===this.linkType}get policyLeadText(){const e=this.firstSentence?.trim()??"",t=this.resolveLang();if(e){const n=this.policyLeadByLang.es;return"es"===t||e!==n&&e.toLowerCase()!==n.toLowerCase()?this.firstSentence:this.policyLeadByLang[t]||n}return this.policyLeadByLang[t]||this.policyLeadByLang.es}}return e.defaultLinkLabelsEs={a1:"Términos y condiciones",a2:"Política de privacidad"},e.defaultPartsEs={p1:"He leído y acepto los",p2:"del servicio",p3:"y la",a1:"términos y condiciones",a2:"política de privacidad"},e.ɵfac=function(t){return new(t||e)(i.Y36(o.uw),i.Y36(a.D))},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-terms-and-policy-links"]],inputs:{userId:"userId",linkType:"linkType",firstSentence:"firstSentence",secondSentence:"secondSentence",thirdSentence:"thirdSentence",policyActionText:"policyActionText",termsActionText:"termsActionText",customTerms:"customTerms",lang:"lang",data:"data",flowName:"flowName"},outputs:{goToTerms:"goToTerms"},features:[i.TTD],decls:3,vars:3,consts:[[4,"ngIf"],["target","_blank",1,"text-sm","hover:text-blue-500",3,"click"]],template:function(e,t){1&e&&(i.YNc(0,c,6,3,"ng-container",0),i.YNc(1,d,2,1,"ng-container",0),i.YNc(2,h,5,2,"span",0)),2&e&&(i.Q6J("ngIf",!t.isPolicyOnly),i.xp6(1),i.Q6J("ngIf",t.isPolicyOnly),i.xp6(1),i.Q6J("ngIf",!t.isTermsOnly))},dependencies:[l.O5]}),e})()},8429:(e,t,n)=>{n.d(t,{y:()=>c});var i=n(4650),s=n(6895);function r(e,t){1&e&&i._UZ(0,"div",5)}const o=function(e){return{display:e}};function a(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"div",1),i.YNc(1,r,1,0,"div",2),i.TgZ(2,"img",3,4),i.NdJ("load",(function(){i.CHM(e);const t=i.oxw();return i.KtG(t.logoUrlIsLoaded=!0)})),i.qZA()()}if(2&e){const e=i.oxw();i.xp6(1),i.Q6J("ngIf",!e.logoUrlIsLoaded),i.xp6(1),i.Q6J("src",e.firstOption||e.logoUrl,i.LSH)("ngStyle",i.VKq(3,o,e.logoUrlIsLoaded?"block":"none"))}}let l=(()=>{class e{constructor(){this.logoUrl="",this.firstOption=this.logoUrl,this.withLogo=!1,this.logoUrlIsLoaded=!1}ngOnInit(){}get shouldShow(){return!!this.withLogo||!!this.firstOption}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-widget-logo"]],inputs:{logoUrl:"logoUrl",firstOption:"firstOption",withLogo:"withLogo"},decls:1,vars:1,consts:[["class","img-wrapper p-4 flex justify-center items-center",4,"ngIf"],[1,"img-wrapper","p-4","flex","justify-center","items-center"],["class","animated-bg h-full w-full",4,"ngIf"],[1,"img-card",3,"src","ngStyle","load"],["img",""],[1,"animated-bg","h-full","w-full"]],template:function(e,t){1&e&&i.YNc(0,a,4,5,"div",0),2&e&&i.Q6J("ngIf",t.shouldShow)},dependencies:[s.O5,s.PC],styles:[".img-wrapper[_ngcontent-%COMP%]{max-height:240px}.img-wrapper[_ngcontent-%COMP%] .img-card[_ngcontent-%COMP%], .img-wrapper[_ngcontent-%COMP%] .animated-bg[_ngcontent-%COMP%]{max-width:240px;max-height:240px}"]}),e})(),c=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-widget-step-logo"]],inputs:{data:"data",customImage:"customImage",withLogo:"withLogo"},decls:1,vars:3,consts:[[3,"firstOption","withLogo","logoUrl"]],template:function(e,t){if(1&e&&i._UZ(0,"belender-widget-logo",0),2&e){let e;i.Q6J("firstOption",t.customImage)("withLogo",null!==(e=t.withLogo)&&void 0!==e?e:null==t.data||null==t.data.styles?null:t.data.styles.withLogo)("logoUrl",null==t.data||null==t.data.styles?null:t.data.styles.logoUrl)}},dependencies:[l],encapsulation:2}),e})()},5762:(e,t,n)=>{n.d(t,{l:()=>i});class i{constructor(){this.status_code="created"}}},3731:(e,t,n)=>{n.d(t,{z:()=>r});var i=n(4650),s=n(1481);let r=(()=>{class e{constructor(e){this.sanitized=e}transform(e){return this.sanitized.bypassSecurityTrustHtml(e)}}return e.ɵfac=function(t){return new(t||e)(i.Y36(s.H7,16))},e.ɵpipe=i.Yjl({name:"safeHtml",type:e,pure:!0}),e})()},9391:(e,t,n)=>{n.d(t,{o:()=>l});var i=n(7396),s=n(8829),r=n(4650),o=n(6554),a=n(9728);let l=(()=>{class e{constructor(e,t){this.localFetch=e,this.apiUrlService=t}getAttachmentsOld(e){return new Promise(((t,n)=>{const r=(0,i.IO)((0,i.hJ)(s.db,"solicitudes"),(0,i.ar)("id","==",e),(0,i.b9)(1));(0,i.cf)(r,(e=>{let n;e.forEach((e=>{n=e.data().attachments})),t(n)}),(e=>{n(e)}))}))}getAttachments(e){return new Promise(((t,n)=>{this.localFetch.getFetch(`${this.apiUrlService.baseUrl}/requests/${e}/documents`).then((e=>{e?t(e):n("No hay archivos asignados a esta solicitud..")})).catch((e=>{n(e)}))}))}uploadFile(e){return new Promise(((t,n)=>{this.localFetch.postFileFetchWhitoutToken(`${this.apiUrlService.baseUrl}/documents/upload-files`,e).then((e=>{e?t(e):n("No se pudieron subir los documentos..")})).catch((e=>{n(e)}))}))}}return e.ɵfac=function(t){return new(t||e)(r.LFG(o.r),r.LFG(a.i))},e.ɵprov=r.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},5710:(e,t,n)=>{n.d(t,{S:()=>c});var i=n(2340),s=n(4650),r=n(8467),o=n(6554),a=n(5601),l=n(9728);let c=(()=>{class e{constructor(e,t,n,i){this.utils=e,this.localFetch=t,this.solicitudesService=n,this.apiUrlService=i}addSolicitud(e){return new Promise(((t,n)=>{this.localFetch.postFileFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/client-certificate",e).then((e=>{e?(this.solicitudesService.markRequestOpenedIfNeeded(e),t(e)):n(e)})).catch((e=>{n(e)}))}))}addSignedFile(e){return new Promise(((t,n)=>{this.localFetch.postFile(this.apiUrlService.baseUrl+"/requests/client-certificate/upload-file-signed",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}addFiles(e){return new Promise(((t,n)=>{this.localFetch.postFile(this.apiUrlService.baseUrl+"/requests/client-certificate/upload-files",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}acceptTerms(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/client-certificate/terms",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendOtp(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/client-certificate/otp",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendPassword(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/client-certificate/password",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}preRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/pre-request/client-certificate",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendOTP(e){return new Promise(((t,n)=>{let s="/requests/client-certificate/otp";i.N.scraperMock&&(s="/mockscrapper/requests/client-certificate/otp"),this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+s,e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}}return e.ɵfac=function(t){return new(t||e)(s.LFG(r.F),s.LFG(o.r),s.LFG(a.M),s.LFG(l.i))},e.ɵprov=s.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},7489:(e,t,n)=>{n.d(t,{v:()=>u});var i=n(5861),s=n(2340),r=n(4650),o=n(8467),a=n(1742),l=n(6554),c=n(5601),d=n(9728);let u=(()=>{class e{constructor(e,t,n,i,s){this.utils=e,this.pinUtils=t,this.localFetch=n,this.solicitudesService=i,this.apiUrlService=s}getSolicitudes(){var e=this;return(0,i.Z)((function*(){const t=yield e.localFetch.getFetch(e.apiUrlService.baseUrl+"/requests");return e.solicitudesService.markRequestOpenedIfNeeded(t),t}))()}getSolicitudByCode(e){var t=this;return(0,i.Z)((function*(){const n=yield t.localFetch.freeGetFetch(t.apiUrlService.baseUrl+"/requests/"+e);return t.solicitudesService.markRequestOpenedIfNeeded(n),n}))()}noMatchPhone(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/clave-pin/cancel",e).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?t(e):n(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),n(e)}))}))}addSolicitud(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/clave-pin",e).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?(this.solicitudesService.markRequestOpenedIfNeeded(e),t(e)):n(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),n(e)}))}))}checkService(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/clave-pin/check-service",e).then((e=>{this.pinUtils.sendMessageToParent(400===e.code?{type:"response",data:{...e.response,status_code:"no_clave_pin_service"}}:{type:"response",data:e.data||e}),t(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),n(e)}))}))}setNoService(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/clave-pin/no-service",e).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?t(e):n(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),n(e)}))}))}acceptTerms(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/clave-pin/terms",e).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?t(e):n(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),n(e)}))}))}getNewIdOfRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/"+e+"/get-new-id",{}).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?t(e):n(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),n(e)}))}))}retryRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/clave-pin/retry",e).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?t(e):n(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),n(e)}))}))}resendOTP(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/clave-pin/resend-otp",e).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?t(e):n(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),n(e)}))}))}fixData(e,t){return new Promise(((n,i)=>{this.localFetch.putFetchWhitoutToken(`${this.apiUrlService.baseUrl}/requests/${e}/person`,t).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?n(e):i(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),i(e)}))}))}sendOTP(e,t){let n="/requests/clave-pin/otp";return(s.N.scraperMock||t)&&(n="/mockscrapper/requests/clave-pin/otp"),new Promise(((t,i)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+n,e).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?t(e):i(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),i(e)}))}))}sendOTPToBde(e,t){let n="/requests/cirbe-cp/otp";return(s.N.scraperMock||t)&&(n="/mockscrapper/requests/cirbe-cp/otp"),new Promise(((t,i)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+n,e).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?t(e):i(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),i(e)}))}))}sendSecondTask(e){let t="/requests/clave-pin/secondTask";return s.N.scraperMock&&(t="/mockscrapper/requests/clave-pin/secondTask"),new Promise(((n,i)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+t,e).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?n(e):i(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),i(e)}))}))}sendLinkBySms(e,t){return new Promise(((n,i)=>{this.localFetch.postFetch(`${this.apiUrlService.baseUrl}/requests/${e}/send-link-sms`,t).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?n(e):i(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),i(e)}))}))}}return e.ɵfac=function(t){return new(t||e)(r.LFG(o.F),r.LFG(a._),r.LFG(l.r),r.LFG(c.M),r.LFG(d.i))},e.ɵprov=r.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},9617:(e,t,n)=>{n.d(t,{U:()=>a});var i=n(4650),s=n(8467),r=n(6554),o=n(9728);let a=(()=>{class e{constructor(e,t,n){this.utils=e,this.localFetch=t,this.apiUrlService=n}getPackagesByUserID(e){return new Promise(((t,n)=>{this.localFetch.getFetchWhitoutToken(this.apiUrlService.baseUrl+"/users/"+e+"/pack-documents").then((e=>{e?t(e):n(e)})).catch((e=>{console.error("addSolicitud",e),n(e)}))}))}getPacksByPackId(e){return new Promise(((t,n)=>{this.localFetch.getFetchWhitoutToken(this.apiUrlService.baseUrl+"/pack-documents/"+e).then((e=>{e?t(e):n(e)})).catch((e=>{console.error("addSolicitud",e),n(e)}))}))}getFlowPackagesByUserID(e,t){}}return e.ɵfac=function(t){return new(t||e)(i.LFG(s.F),i.LFG(r.r),i.LFG(o.i))},e.ɵprov=i.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},5601:(e,t,n)=>{n.d(t,{M:()=>c});var i=n(5861),s=n(2340),r=n(4650),o=n(8467),a=n(6554),l=n(9728);let c=(()=>{class e{constructor(e,t,n){this.utils=e,this.localFetch=t,this.apiUrlService=n}getSolicitudes(){var e=this;return(0,i.Z)((function*(){const t=yield e.localFetch.getFetch(e.apiUrlService.baseUrl+"/requests");return e.markRequestOpenedIfNeeded(t),t}))()}getSolicitudByCode(e){var t=this;return(0,i.Z)((function*(){const n=yield t.localFetch.freeGetFetch(t.apiUrlService.baseUrl+"/requests/"+e);return t.markRequestOpenedIfNeeded(n),n}))()}setPhone(e,t){return new Promise(((n,i)=>{this.localFetch.putFetchWhitoutToken(`${this.apiUrlService.baseUrl}/requests/${t}/person`,e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),n(e)):i(e)})).catch((e=>{i(e)}))}))}noPhone(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/sms/no-phone",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}smsToPin(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/sms-clave",e).then((e=>{e?(this.markRequestOpenedIfNeeded((e.data||e).request_id),this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}transitionToVideoId(e){return this.localFetch.postFetchWhitoutToken(s.N.baseUrl+"/requests/client-certificate/to-videoid",e).then((e=>e?(this.sendMessageToParent({type:"response",data:e.data||e}),e):Promise.reject(e)))}addSolicitud(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/sms",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),this.markRequestOpenedIfNeeded(e),t(e)):n(e)})).catch((e=>{console.error("addSolicitud",e),n(e)}))}))}setNoService(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/sms/no-service",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}acceptTerms(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/sms/terms",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}getNewIdOfRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/"+e+"/get-new-id",{}).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}checkService(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/sms/check-service",e).then((e=>{this.sendMessageToParent(400===e.code?{type:"response",data:{...e.response,status_code:"no_sms_service"}}:{type:"response",data:e.data||e}),t(e)})).catch((e=>{n(e)}))}))}retryRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/sms/retry",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}resendOTP(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/sms/resend-otp",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}fixData(e,t){return new Promise(((n,i)=>{this.localFetch.putFetchWhitoutToken(`${this.apiUrlService.baseUrl}/requests/${e}/person`,t).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),n(e)):i(e)})).catch((e=>{i(e)}))}))}sendOTP(e){return new Promise(((t,n)=>{let i="/requests/sms/otp";s.N.scraperMock&&(i="/mockscrapper/requests/sms/otp"),this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+i,e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}uploadFileFromWidget(e){return new Promise(((t,n)=>{this.localFetch.postFileFetchWhitoutToken(this.apiUrlService.baseUrl+"/documents/upload-files-from-widget",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}sendLinkBySms(e,t){return new Promise(((n,i)=>{this.localFetch.postFetch(`${this.apiUrlService.baseUrl}/requests/${e}/send-link-sms`,t).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),n(e)):i(e)})).catch((e=>{i(e)}))}))}getDocuments(e){return new Promise(((t,n)=>{this.localFetch.getFetch(`${this.apiUrlService.baseUrl}/requests/${e}/documents`).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n("No hay archivos asignados a esta solicitud..")})).catch((e=>{n(e)}))}))}getDocumentsIds(e){return new Promise(((t,n)=>{this.localFetch.getFetch(`${this.apiUrlService.baseUrl}/requests/${e}/documents-ids-widget`).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n("No hay archivos asignados a esta solicitud..")})).catch((e=>{n(e)}))}))}cancelRequest(e,t){return new Promise(((n,i)=>{this.localFetch.postFetch(this.apiUrlService.baseUrl+`/requests/${t}/cancel`,e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),n(e)):i(e)})).catch((e=>{i(e)}))}))}markRequestOpened(e){return this.localFetch.postFetchWhitoutToken(`${this.apiUrlService.baseUrl}/requests/${e}/opened`,{})}markRequestOpenedIfNeeded(e){const t=e?.data||e;!1===t?.widget_opened&&this.markRequestOpened(t.request_id)}sendMessageToParent(e){window.top.postMessage(e,"*")}}return e.ɵfac=function(t){return new(t||e)(r.LFG(o.F),r.LFG(a.r),r.LFG(l.i))},e.ɵprov=r.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},5145:(e,t,n)=>{n.d(t,{Z:()=>i});const i=[{id:0,text:"error_clave_pin",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"Error con la clave PIN"},{id:1,text:"failed_without_retry",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"Fallo sin reintento"},{id:111,text:"failed_with_retry",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"Fallo con reintento"},{id:2,text:"bad_phone",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"Teléfono erróneo"},{id:3,text:"failed_documents_downloaded",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"Fallo al descargar Documentos"},{id:4,text:"invalid_otp_aeat",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"OTP de AEAT inválido"},{id:5,text:"invalid_otp_seguridad_social",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"OTP de Seg. Social inválido"},{id:6,text:"max_entries_otp",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"not_interested",label:"Max intentos OTP"},{id:7,text:"abandoned_after_bad_phone",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"phonelink_erase",label:"Abandonado (bad phone)"},{id:8,text:"abandoned_after_terms",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"warning",label:"Abandonado (términos y condiciones)"},{id:9,text:"abandoned_after_invalid_otp_seguridad_social",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"warning",label:"Abandonado (invalid OTP SS)"},{id:10,text:"abandoned_after_invalid_otp_aeat",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"warning",label:"Abandonado (invalid OTP AEAT)"},{id:11,text:"abandoned_after_waiting_otp_aeat",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"warning",label:"Abandonado (waiting OTP AEAT)"},{id:12,text:"abandoned_after_waiting_otp_seguridad_social",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"warning",label:"Abandonado (waiting OTP SS)"},{id:13,text:"waiting_login_seguridad_social",textClass:"text-yellow-500",bgClass:"bg-yellow-500/10",previewClass:"bg-yellow-500",icon:"timelapse",label:"Esperando login SS"},{id:14,text:"waiting_login_aeat",textClass:"text-yellow-500",bgClass:"bg-yellow-500/10",previewClass:"bg-yellow-500",icon:"timelapse",label:"Esperando login AEAT"},{id:15,text:"waiting_otp_aeat",textClass:"text-yellow-500",bgClass:"bg-yellow-500/10",previewClass:"bg-yellow-500",icon:"timelapse",label:"Esperando OTP AEAT"},{id:16,text:"waiting_otp_seguridad_social",textClass:"text-yellow-500",bgClass:"bg-yellow-500/10",previewClass:"bg-yellow-500",icon:"timelapse",label:"Esperando OTP SS"},{id:17,text:"saved_otp",textClass:"text-purple",bgClass:"bg-purple-light",previewClass:"bg-purple",icon:"timelapse",label:"OTP guardado"},{id:171,text:"picked_up_otp",textClass:"text-purple",bgClass:"bg-purple-light",previewClass:"bg-purple",icon:"timelapse",label:"OTP recogido"},{id:18,text:"terms_and_conditions",textClass:"text-purple",bgClass:"bg-purple-light",previewClass:"bg-purple",icon:"timelapse",label:"Términos y condiciones"},{id:19,text:"waiting_documents",textClass:"text-cyan",bgClass:"bg-cyan-light",previewClass:"bg-cyan",icon:"hourglass_empty",label:"Esperando documentos"},{id:20,text:"created",textClass:"text-cyan",bgClass:"bg-cyan-light",previewClass:"bg-cyan",icon:"fiber_new",label:"Solicitud creada"},{id:21,text:"all_documents_downloaded",textClass:"text-green",bgClass:"bg-green-light",previewClass:"bg-green",icon:"check_circle",label:"Todo los documentos descargados"},{id:22,text:"partial_documents_downloaded",textClass:"text-green",bgClass:"bg-green-light",previewClass:"bg-green",icon:"check_circle",label:"Algunos Documentos descargados"},{id:23,text:"parcial_documents_downloaded",textClass:"text-green",bgClass:"bg-green-light",previewClass:"bg-green",icon:"check_circle",label:"Algunos Documentos descargados"},{id:24,text:"all_documents_downloaded_and_deleted",textClass:"text-green",bgClass:"bg-green-light",previewClass:"bg-green",icon:"delete",label:"Todos descargados y eliminados"},{id:25,text:"partial_documents_downloaded_and_deleted",textClass:"text-green",bgClass:"bg-green-light",previewClass:"bg-green",icon:"delete",label:"Algunos descargados y eliminados"},{id:26,text:"updated_data",textClass:"text-blue-500",bgClass:"bg-blue-500/10",previewClass:"bg-blue-500",icon:"check",label:"Datos del cliente actualizados"},{id:27,text:"resend_otp",textClass:"text-blue-500",bgClass:"bg-blue-500/10",previewClass:"bg-blue-500",icon:"refresh",label:"OTP reenviado"}]},8259:function(e,t){var n;
|
|
66
|
+
"use strict";if((self.webpackChunkvex=self.webpackChunkvex||[]).push([[281,970],{9943:(e,t,n)=>{n.d(t,{J:()=>d});var i=n(1135),s=n(1931),r=n(5762),o=n(2340),a=n(182),l=n(4650),c=n(8460);let d=(()=>{class e{constructor(e){this.customizationStoreService=e,this.labels=s.S.es,this.socket=null,this.currentHeight=0,this._request=new i.X({...new r.l,status_code:"created"}),this._request_status=new i.X(null),this.request$=this._request.asObservable(),this.request_status$=this._request_status.asObservable()}setGlobalVariables(){this.REQUEST=this._request.value,this.REQUEST_STATUS=this.REQUEST?.status_code,this.REQUEST_ID=this.REQUEST?.request_id,this._request_status.next(this.REQUEST_STATUS)}setRequest(e){this._request.next({...e}),this.setGlobalVariables()}patch(e){this._request.next({...this._request.value,...e}),this.setGlobalVariables()}setRequestStatus(e){this._request.next({...this._request.value,status_code:e}),this.setGlobalVariables()}setRequestID(e){this._request.next({...this._request.value,request_id:e}),this.setGlobalVariables()}updateRequestID(e){this.REQUEST_ID=e,this.setRequestID(e)}subscribeWS(e){if(this.socket)return;const t=e||this.REQUEST_ID||this._request.value?.request_id;if(!t)return;let n="wss://notifications.dev.belender.net";"qa"==o.N.env&&(n="wss://notifications.qa.belender.net"),"pro"==o.N.env&&(n="wss://notifications.belender.net"),o.N.notificationsBaseUrl&&(n=o.N.notificationsBaseUrl),this.socket=new WebSocket(`${n}?requests_id=${t}&user_id=${this.customizationStoreService.USER_ID}`);const i=this;this.socket.onopen=function(){console.log("Conexión establecida")},this.socket.onmessage=function(e){const t=JSON.parse(e.data);i.handlePusherNotification(t)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e),console.error(e)},this.socket.onclose=function(){console.log("Conexión cerrada"),i.socket=null}}handlePusherNotification(e){if(!e||a.t.shouldIgnoreWebhookStatus(e.status_code))return;this.sendMessageToParent({type:"websocket",data:e}),console.warn("message from ws: ",e);const t=e.status_code;if(t){if(t.startsWith("failed"))return this.disconnectWebsocket(),void this.setRequestStatus(t);if(t.startsWith("abandoned"))return this.disconnectWebsocket(),void this.setRequestStatus(t);if("consent_process_completed"===t)return this.disconnectWebsocket(),void this.patch({status_code:t});this.patch({status_code:t})}}sendMessageToParent(e){if(e&&e.type&&"widgetHeight"===e.type){if(e.data===this.currentHeight)return;this.currentHeight=e.data}console.log("Message to parent:",e),window.top.postMessage(e,"*")}disconnectWebsocket(){this.socket&&this.socket.close(),this.socket=null}}return e.ɵfac=function(t){return new(t||e)(l.LFG(c.r))},e.ɵprov=l.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},871:(e,t,n)=>{n.d(t,{S:()=>s,q:()=>i});const i={FORM:"form",LOADING:"loading",PASSWORD:"password",OTP:"otp",AUTOFIRMA:"autofirma",SUCCESS:"success",FAILED:"failed",ABANDONED:"abandoned",NO_SERVICE:"no-service",ERROR_DATA:"error-data"},s={created:i.FORM,form:i.FORM,prerequest:i.FORM,terms_and_conditions:i.FORM,widget_opened:i.FORM,waiting_terms_and_conditions:i.FORM,waiting_login_seguridad_social:i.LOADING,saved_otp:i.LOADING,waiting_otp_seguridad_social:i.OTP,waiting_otp:i.OTP,invalid_otp_seguridad_social:i.OTP,waiting_password:i.PASSWORD,waiting_acceptance_file_signed:i.AUTOFIRMA,abandoned_after_bad_phone:i.ABANDONED,abandoned_after_invalid_otp_seguridad_social:i.ABANDONED,abandoned_after_terms_and_conditions:i.ABANDONED,abandoned_after_waiting_otp_seguridad_social:i.ABANDONED,all_documents_downloaded:i.SUCCESS,partial_documents_downloaded:i.SUCCESS,consent_process_completed:i.SUCCESS,waiting_certificate:i.SUCCESS,waiting_documents:i.SUCCESS,partial_documents_downloaded_and_deleted:i.SUCCESS,all_documents_downloaded_and_deleted:i.SUCCESS,bad_phone:i.ERROR_DATA,phone_not_exist_otp:i.ERROR_DATA,failed_with_retry:i.FAILED,failed_without_retry:i.FAILED,failed_documents_downloaded:i.FAILED,failed_login_otp:i.FAILED,consent_process_canceled:i.FAILED,no_service:i.NO_SERVICE}},6281:(e,t,n)=>{n.r(t),n.d(t,{ClientCertModule:()=>gt});var i=n(6895),s=n(6383),r=n(5592),o=n(8739),a=n(7155),l=n(6308),c=n(6709),d=n(7392),u=n(9101),h=n(1561),p=n(4006),m=n(266),f=n(4385),g=n(811),_=n(5601),b=n(3798),v=n(9391),y=n(1572),w=n(182),x=n(4144),S=n(7367),C=n(9602),T=n(3238),k=n(5895),M=n(6257),I=n(1948),E=n(4246),A=n(8594),O=n(6e3),L=n(5861),D=n(7582),P=n(9549),N=n(9933),q=n(5762),R=n(8259),Y=n(2340),F=n(1363),U=n(1931),Z=n(871),H=n(4650),j=n(8467),z=n(5412),B=n(7308),J=n(9943),V=n(4302),Q=n(6830),W=n(3731);function G(e,t){if(1&e&&(H.TgZ(0,"span"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij("¿No has recibido el código? Solicítalo de nuevo en ",e.secsCount," segundos")}}function $(e,t){if(1&e&&(H.TgZ(0,"span"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.AsE("¿No has recibido el código en el teléfono acabado en ",e.lastNumberPhone,"? Solicítalo de nuevo en ",e.secsCount," segundos")}}const K=function(e,t,n){return{color:e,border:t,background:n}};function X(e,t){if(1&e&&(H.ynx(0),H.TgZ(1,"small",11),H.YNc(2,G,2,1,"span",5),H.YNc(3,$,2,2,"span",5),H.qZA(),H.BQk()),2&e){const e=H.oxw();H.xp6(1),H.Q6J("ngStyle",H.kEZ(3,K,e.data.styles.colors.accentColor,"1px solid "+e.data.styles.colors.accentColor,e.data.styles.colors.accentBgColor)),H.xp6(1),H.Q6J("ngIf",!e.lastNumberPhone),H.xp6(1),H.Q6J("ngIf",e.lastNumberPhone)}}function ee(e,t){1&e&&(H.TgZ(0,"span"),H._uU(1," ¿No has recibido el código en tu teléfono? "),H.qZA())}function te(e,t){if(1&e&&(H.TgZ(0,"span"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij(" ¿No has recibido el código en el teléfono acabado en ",e.lastNumberPhone,"? ")}}const ne=function(e,t){return{color:e,background:t}};function ie(e,t){if(1&e){const e=H.EpF();H.ynx(0),H.TgZ(1,"small",11),H.YNc(2,ee,2,0,"span",5),H.YNc(3,te,2,1,"span",5),H.TgZ(4,"a",12),H.NdJ("click",(function(){H.CHM(e);const t=H.oxw();return H.KtG(t.resendOTP())})),H._uU(5,"Reenviar"),H.qZA()(),H.BQk()}if(2&e){const e=H.oxw();H.xp6(1),H.Q6J("ngStyle",H.kEZ(4,K,e.data.styles.colors.dangerColor,"1px solid "+e.data.styles.colors.dangerColor,e.data.styles.colors.dangerBgColor)),H.xp6(1),H.Q6J("ngIf",!e.lastNumberPhone),H.xp6(1),H.Q6J("ngIf",e.lastNumberPhone),H.xp6(1),H.Q6J("ngStyle",H.WLB(8,ne,e.data.styles.colors.dangerTextButtonColor,e.data.styles.colors.dangerColor))}}let se=(()=>{class e{constructor(e,t,n,i){this.fb=e,this.utils=t,this.solucitudesService=n,this.activeRoute=i,this.next=new H.vpe(null),this.errPhone=new H.vpe(null),this.resendO=new H.vpe(null),this.secsCount=60,this.lastNumberPhone="XXX"}ngOnInit(){this.form=this.fb.group({code1:[null,[p.kI.required,p.kI.maxLength(6),p.kI.minLength(6)]]}),this.initSecsInterval(),this.activeRoute.queryParams.subscribe((e=>{e&&e.request_id&&(this.requestID=e.request_id)}),(e=>{console.error(e)})),this.solicitud&&this.solicitud.person_phone&&this.setPhone(this.solicitud.person_phone)}setPhone(e){let t="XXX";e&&(t=(""+e).slice(-3)),this.lastNumberPhone=t}initSecsInterval(){this.interv=setInterval((()=>{this.secsCount--,this.secsCount<=0&&this.finishSecsInterval()}),1e3)}finishSecsInterval(){this.interv&&clearInterval(this.interv)}nextStep(){let e={code:this.getCode()};this.next.emit(e)}getCode(){return this.form.get("code1").value}capturePasteEvent(e){return(0,L.Z)((function*(){}))()}errorStep(){this.errPhone.emit(!0)}setInputEvent(e){""!=e.target.value?R(e.target).next().focus():"Backspace"==e.code&&R(e.target).prev().focus()}resendOTP(){this.resendO.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(H.Y36(p.QS),H.Y36(j.F),H.Y36(_.M),H.Y36(A.gz))},e.ɵcmp=H.Xpm({type:e,selectors:[["belender-otp-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud"},outputs:{next:"nextStep",errPhone:"errorPhone",resendO:"resendOTP"},decls:16,vars:20,consts:[[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"title","py-2"],[4,"ngIf"],[1,"flex","gap-2","items-center","justify-start","w-full","max-w-[200px]"],["appearance","outline",1,"w-full","flex-1"],["tabindex","1","maxlength","6","minlength","1","formControlName","code1","type","text","matInput","",3,"change","keyup"],[1,"flex","items-center","justify-end","gap-2","p-4"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"info-time","w-fit",3,"ngStyle"],[1,"ml-4",3,"ngStyle","click"]],template:function(e,t){1&e&&(H.TgZ(0,"form",0)(1,"div",1),H._UZ(2,"div",2)(3,"div",3),H.ALo(4,"safeHtml"),H.TgZ(5,"div",4),H.YNc(6,X,4,7,"ng-container",5),H.YNc(7,ie,6,11,"ng-container",5),H.qZA(),H.TgZ(8,"div",6)(9,"mat-form-field",7)(10,"mat-label"),H._uU(11," Código OTP "),H.qZA(),H.TgZ(12,"input",8),H.NdJ("change",(function(e){return t.capturePasteEvent(e)}))("keyup",(function(e){return t.setInputEvent(e)})),H.qZA()()()(),H.TgZ(13,"div",9)(14,"button",10),H.NdJ("click",(function(){return t.nextStep()})),H._uU(15,"Siguiente"),H.qZA()()()),2&e&&(H.Q6J("formGroup",t.form),H.xp6(2),H.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),H.Q6J("innerHTML",t.texts.otp.title,H.oJD),H.xp6(1),H.Udp("color",t.data.styles.colors.text),H.Q6J("innerHTML",H.lcZ(4,18,t.texts.otp.description||""),H.oJD),H.xp6(3),H.Q6J("ngIf",t.secsCount&&t.secsCount>0),H.xp6(1),H.Q6J("ngIf",!t.secsCount||t.secsCount<=0),H.xp6(7),H.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),H.Q6J("disabled",t.form.invalid))},dependencies:[i.O5,i.PC,u.lW,P.KE,P.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.nD,p.sg,p.u,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function re(e,t){if(1&e&&(H.TgZ(0,"div",1),H._UZ(1,"div",2)(2,"div",3),H.ALo(3,"safeHtml"),H.qZA()),2&e){const e=H.oxw();H.xp6(1),H.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),H.Q6J("innerHTML",e.texts.success.title,H.oJD),H.xp6(1),H.Udp("color",e.data.styles.colors.text),H.Q6J("innerHTML",H.lcZ(3,8,e.texts.success.description||""),H.oJD)}}let oe=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s}ngOnInit(){}save(){}}return e.ɵfac=function(t){return new(t||e)(H.Y36(p.QS),H.Y36(j.F),H.Y36(_.M),H.Y36(v.o),H.Y36(k.T))},e.ɵcmp=H.Xpm({type:e,selectors:[["belender-success-step"]],inputs:{data:"data",texts:"texts"},decls:1,vars:1,consts:[["class"," pt-4 pb-8 flex flex-col animated fadeIn",4,"ngIf"],[1,"pt-4","pb-8","flex","flex-col","animated","fadeIn"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&H.YNc(0,re,4,10,"div",0),2&e&&H.Q6J("ngIf",!t.data.config.infiniteLoopInCompleted)},dependencies:[i.O5,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function ae(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"div",5)(1,"button",6),H.NdJ("click",(function(){H.CHM(e);const t=H.oxw();return H.KtG(t.retry())})),H._uU(2,"Intentarlo nuevamente"),H.qZA()()}if(2&e){const e=H.oxw();H.xp6(1),H.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px")}}function le(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"div",5)(1,"button",7),H.NdJ("click",(function(){H.CHM(e);const t=H.oxw();return H.KtG(t.newRequest())})),H._uU(2,"Crear nueva solicitud"),H.qZA()()}if(2&e){const e=H.oxw();H.xp6(1),H.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px")}}let ce=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.retryOp=new H.vpe(null),this.newReq=new H.vpe(null)}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}newRequest(){this.newReq.emit(this.solicitud.request_id)}getIfRetryIsAllowed(){return"failed_with_retry"==this.solicitud}getIfNewRequestIsAllowed(){return"failed_documents_downloaded"==this.solicitud}}return e.ɵfac=function(t){return new(t||e)(H.Y36(p.QS),H.Y36(j.F),H.Y36(_.M),H.Y36(v.o),H.Y36(k.T))},e.ɵcmp=H.Xpm({type:e,selectors:[["belender-fail-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud"},outputs:{retryOp:"retry",newReq:"newRequest"},decls:7,vars:8,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"text-red-500","title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","flex items-center justify-end gap-2 p-4",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8",3,"click"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(H.TgZ(0,"div",0)(1,"div",1),H._UZ(2,"div",2)(3,"div",3),H.ALo(4,"safeHtml"),H.qZA(),H.YNc(5,ae,3,6,"div",4),H.YNc(6,le,3,6,"div",4),H.qZA()),2&e&&(H.xp6(2),H.Q6J("innerHTML",t.texts.fail.title,H.oJD),H.xp6(1),H.Udp("color",t.data.styles.colors.text),H.Q6J("innerHTML",H.lcZ(4,6,t.texts.fail.description),H.oJD),H.xp6(2),H.Q6J("ngIf",t.solicitud&&"failed_with_retry"==t.solicitud.status_code),H.xp6(1),H.Q6J("ngIf",t.solicitud&&"failed_documents_downloaded"==t.solicitud.status_code))},dependencies:[i.O5,u.lW,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();n(6866);var de=n(769),ue=n(3848),he=n(1763),pe=n(5696);function me(e,t){if(1&e&&(H.TgZ(0,"mat-error"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij(" ",e.labels.warnings.requiredName," ")}}function fe(e,t){if(1&e&&(H.TgZ(0,"mat-error"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij(" ",e.labels.warnings.requiredFirstSurname," ")}}function ge(e,t){if(1&e&&(H.TgZ(0,"mat-error"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij(" ",e.labels.warnings.requiredSecondSurname," ")}}function _e(e,t){if(1&e&&(H.TgZ(0,"mat-error"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij(" ",e.labels.warnings.needDNI," ")}}function be(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"div",22)(1,"belender-checkbox",20),H.NdJ("changeCheckbox",(function(t){H.CHM(e);const n=H.oxw(2);return H.KtG(n.setTerms2(t))})),H.TgZ(2,"belender-terms-and-policy-links",23),H.NdJ("goToTerms",(function(t){H.CHM(e);const n=H.oxw(2);return H.KtG(n.gotoTermsAndConditions(t))})),H.qZA()()()}if(2&e){const e=H.oxw(2);H.xp6(1),H.Q6J("color",e.data.styles.colors.title),H.xp6(1),H.Q6J("userId",e.userId)("linkType","terms")}}function ve(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"div",22)(1,"belender-checkbox",20),H.NdJ("changeCheckbox",(function(t){H.CHM(e);const n=H.oxw(2);return H.KtG(n.setAssignment(t))})),H._UZ(2,"div",24),H.qZA()()}if(2&e){const e=H.oxw(2);H.xp6(1),H.Q6J("color",e.data.styles.colors.title),H.xp6(1),H.Q6J("innerHTML",(null==e.data[e.flowName]||null==e.data[e.flowName].texts?null:e.data[e.flowName].texts.dataAssignmentText)||(null==e.data[e.flowName]||null==e.data[e.flowName].config_translate?null:e.data[e.flowName].config_translate.dataAssignmentText)||(null==e.data||null==e.data.config?null:e.data.config.dataAssignmentText)||"",H.oJD)}}function ye(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"div",11)(1,"mat-form-field",12)(2,"mat-label"),H._uU(3),H.qZA(),H._UZ(4,"input",13),H.YNc(5,me,2,1,"mat-error",8),H.qZA(),H.TgZ(6,"mat-form-field",12)(7,"mat-label"),H._uU(8),H.qZA(),H._UZ(9,"input",14),H.YNc(10,fe,2,1,"mat-error",8),H.qZA(),H.TgZ(11,"mat-form-field",12)(12,"mat-label"),H._uU(13),H.qZA(),H._UZ(14,"input",15),H.YNc(15,ge,2,1,"mat-error",8),H.qZA(),H.TgZ(16,"mat-form-field",16)(17,"mat-label"),H._uU(18),H.qZA(),H._UZ(19,"input",17),H.YNc(20,_e,2,1,"mat-error",8),H.qZA(),H.YNc(21,be,3,3,"div",18),H.TgZ(22,"div",19)(23,"belender-checkbox",20),H.NdJ("changeCheckbox",(function(t){H.CHM(e);const n=H.oxw();return H.KtG(n.setTerms(t))})),H._uU(24),H.TgZ(25,"a",21),H.NdJ("click",(function(t){H.CHM(e);const n=H.oxw();return H.KtG(n.gotoTermsAndConditionsCertificate(t))})),H.TgZ(26,"u"),H._uU(27),H.qZA()(),H._uU(28),H.qZA()(),H.YNc(29,ve,3,2,"div",18),H.qZA()}if(2&e){const e=H.oxw();let t,n,i,s;H.xp6(3),H.Oqu(e.labels.flowCommon.name),H.xp6(2),H.Q6J("ngIf",null==(t=e.form.get("name"))?null:t.hasError("required")),H.xp6(3),H.Oqu(e.labels.flowCommon.firstSurname),H.xp6(2),H.Q6J("ngIf",null==(n=e.form.get("lastname"))?null:n.hasError("required")),H.xp6(3),H.Oqu(e.labels.flowCommon.secondSurname),H.xp6(2),H.Q6J("ngIf",null==(i=e.form.get("lastname2"))?null:i.hasError("required")),H.xp6(3),H.Oqu(e.labels.nieOrDni),H.xp6(1),H.s9C("placeholder",e.labels.certificate.dniPlaceholder),H.xp6(1),H.Q6J("ngIf",null==(s=e.form.get("dni"))?null:s.hasError("required")),H.xp6(1),H.Q6J("ngIf",!e.data.config.hideCheckLegal),H.xp6(2),H.Q6J("color",e.data.styles.colors.title),H.xp6(1),H.hij(" ",e.labels.flowCommon.certTermsBefore," "),H.xp6(3),H.Oqu(e.labels.flowCommon.certTermsLink),H.xp6(1),H.hij(" ",e.labels.flowCommon.certTermsAfter," "),H.xp6(1),H.Q6J("ngIf",null==e.data?null:e.data.config.dataAssignmentCheck)}}function we(e,t){if(1&e&&(H.TgZ(0,"mat-error"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij(" ",e.labels.warnings.requiredName," ")}}function xe(e,t){if(1&e&&(H.TgZ(0,"mat-error"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij(" ",e.labels.warnings.requiredFirstSurname," ")}}function Se(e,t){if(1&e&&(H.TgZ(0,"mat-error"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij(" ",e.labels.warnings.requiredSecondSurname," ")}}function Ce(e,t){if(1&e&&(H.TgZ(0,"mat-error"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij(" ",e.labels.warnings.needDNI," ")}}function Te(e,t){if(1&e&&(H.TgZ(0,"mat-error"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij(" ",e.labels.warnings.requiredCompanyName," ")}}function ke(e,t){if(1&e&&(H.TgZ(0,"mat-error"),H._uU(1),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.hij(" ",e.labels.warnings.requiredCIF," ")}}function Me(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"div",22)(1,"belender-checkbox",20),H.NdJ("changeCheckbox",(function(t){H.CHM(e);const n=H.oxw(2);return H.KtG(n.setTerms2(t))})),H.TgZ(2,"belender-terms-and-policy-links",23),H.NdJ("goToTerms",(function(t){H.CHM(e);const n=H.oxw(2);return H.KtG(n.gotoTermsAndConditions(t))})),H.qZA()()()}if(2&e){const e=H.oxw(2);H.xp6(1),H.Q6J("color",e.data.styles.colors.title),H.xp6(1),H.Q6J("userId",e.userId)("linkType","terms")}}function Ie(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"div",22)(1,"belender-checkbox",20),H.NdJ("changeCheckbox",(function(t){H.CHM(e);const n=H.oxw(2);return H.KtG(n.setAssignment(t))})),H._UZ(2,"div",24),H.qZA()()}if(2&e){const e=H.oxw(2);H.xp6(1),H.Q6J("color",e.data.styles.colors.title),H.xp6(1),H.Q6J("innerHTML",(null==e.data[e.flowName]||null==e.data[e.flowName].texts?null:e.data[e.flowName].texts.dataAssignmentText)||(null==e.data[e.flowName]||null==e.data[e.flowName].config_translate?null:e.data[e.flowName].config_translate.dataAssignmentText)||(null==e.data||null==e.data.config?null:e.data.config.dataAssignmentText)||"",H.oJD)}}function Ee(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"div",11)(1,"mat-form-field",12)(2,"mat-label"),H._uU(3),H.qZA(),H._UZ(4,"input",25),H.YNc(5,we,2,1,"mat-error",8),H.qZA(),H.TgZ(6,"mat-form-field",12)(7,"mat-label"),H._uU(8),H.qZA(),H._UZ(9,"input",26),H.YNc(10,xe,2,1,"mat-error",8),H.qZA(),H.TgZ(11,"mat-form-field",12)(12,"mat-label"),H._uU(13),H.qZA(),H._UZ(14,"input",27),H.YNc(15,Se,2,1,"mat-error",8),H.qZA(),H.TgZ(16,"mat-form-field",16)(17,"mat-label"),H._uU(18),H.qZA(),H._UZ(19,"input",28),H.YNc(20,Ce,2,1,"mat-error",8),H.qZA(),H.TgZ(21,"mat-form-field",16)(22,"mat-label"),H._uU(23),H.qZA(),H._UZ(24,"input",29),H.YNc(25,Te,2,1,"mat-error",8),H.qZA(),H.TgZ(26,"mat-form-field",16)(27,"mat-label"),H._uU(28),H.qZA(),H._UZ(29,"input",30),H.YNc(30,ke,2,1,"mat-error",8),H.qZA(),H.YNc(31,Me,3,3,"div",18),H.TgZ(32,"div",19)(33,"belender-checkbox",20),H.NdJ("changeCheckbox",(function(t){H.CHM(e);const n=H.oxw();return H.KtG(n.setTerms(t))})),H._uU(34),H.TgZ(35,"a",21),H.NdJ("click",(function(t){H.CHM(e);const n=H.oxw();return H.KtG(n.gotoTermsAndConditionsCertificate(t))})),H.TgZ(36,"u"),H._uU(37),H.qZA()(),H._uU(38),H.qZA()(),H.YNc(39,Ie,3,2,"div",18),H.TgZ(40,"h1"),H._uU(41,"safdsfds"),H.qZA()()}if(2&e){const e=H.oxw();let t,n,i,s,r,o;H.xp6(3),H.Oqu(e.labels.flowCommon.name),H.xp6(2),H.Q6J("ngIf",null==(t=e.form.get("name"))?null:t.hasError("required")),H.xp6(3),H.Oqu(e.labels.flowCommon.firstSurname),H.xp6(2),H.Q6J("ngIf",null==(n=e.form.get("lastname"))?null:n.hasError("required")),H.xp6(3),H.Oqu(e.labels.flowCommon.secondSurname),H.xp6(2),H.Q6J("ngIf",null==(i=e.form.get("lastname2"))?null:i.hasError("required")),H.xp6(3),H.Oqu(e.labels.nieOrDni),H.xp6(1),H.s9C("placeholder",e.labels.certificate.dniPlaceholder),H.xp6(1),H.Q6J("ngIf",null==(s=e.form.get("dni"))?null:s.hasError("required")),H.xp6(3),H.Oqu(e.labels.certificate.companyName),H.xp6(1),H.s9C("placeholder",e.labels.certificate.companyPlaceholder),H.xp6(1),H.Q6J("ngIf",null==(r=e.form.get("razon"))?null:r.hasError("required")),H.xp6(3),H.Oqu(e.labels.cif),H.xp6(1),H.s9C("placeholder",e.labels.certificate.cifPlaceholder),H.xp6(1),H.Q6J("ngIf",null==(o=e.form.get("cif"))?null:o.hasError("required")),H.xp6(1),H.Q6J("ngIf",!e.data.config.hideCheckLegal),H.xp6(2),H.Q6J("color",e.data.styles.colors.title),H.xp6(1),H.hij(" ",e.labels.flowCommon.certTermsBefore," "),H.xp6(3),H.Oqu(e.labels.flowCommon.certTermsLink),H.xp6(1),H.hij(" ",e.labels.flowCommon.certTermsAfter," "),H.xp6(1),H.Q6J("ngIf",null==e.data?null:e.data.config.dataAssignmentCheck)}}function Ae(e,t){if(1&e&&(H.TgZ(0,"div",31),H._UZ(1,"mat-icon",32),H._uU(2),H.qZA()),2&e){const e=H.oxw();H.xp6(2),H.hij(" ",e.labels.warnings.readAndAcceptBothTerms," ")}}function Oe(e,t){if(1&e&&(H.ynx(0),H.TgZ(1,"div",31),H._UZ(2,"mat-icon",32),H._uU(3),H.qZA(),H.BQk()),2&e){const e=H.oxw();H.xp6(3),H.hij(" ",e.labels.warnings.acceptPowerTerms," ")}}const Le={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let De=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.next=new H.vpe(null),this.goTerms=new H.vpe(null),this.goTermsCert=new H.vpe(null),this.acceptTerms=!1,this.acceptTerms2=!1,this.termsReaded=!1,this.terms2Readed=!1,this.step=0,this.assignment=!1,this.submitAttempted=!1}ngOnInit(){console.error(this.solicitud),this.setForm(this.solicitud?this.solicitud:null)}tabChanged(e){this.step=e,this.setForm(null)}setForm(e){let t=e?e.person_document_number||e.phone:null,n=e&&e.razon_social?e.razon_social:null,i=e&&e.cif?e.cif:null,s=e&&e.person_name?e.person_name:null,r=e&&e.person_last_name?e.person_last_name:null;this.form=this.fb.group(this.step&&0!=this.step?{name:[s||null,[p.kI.required]],lastname:[r||null,[p.kI.required]],lastname2:[r||null,[p.kI.required]],dni:[t||null,[p.kI.required,p.kI.maxLength(9),p.kI.minLength(9)]],razon:[n||null,[p.kI.required]],cif:[i||null,[p.kI.required]]}:{name:[s||null,[p.kI.required]],lastname:[r||null,[p.kI.required]],lastname2:[r||null,[p.kI.required]],dni:[t||null,[p.kI.required,p.kI.maxLength(9),p.kI.minLength(9)]]})}nextStep(){if(this.form.invalid||!this.getIsValid()||!this.getAssignmentValidation())return void(0,de.J)(this);let e;e=this.step&&0!=this.step?{name:this.form.get("name").value,lastname:this.form.get("lastname").value,lastname2:this.form.get("lastname2").value,dni:this.form.get("dni").value,razon:this.form.get("razon").value,cif:this.form.get("cif").value}:{name:this.form.get("name").value,lastname:this.form.get("lastname").value,lastname2:this.form.get("lastname2").value,dni:this.form.get("dni").value},this.next.emit(e)}gotoTermsAndConditions(e){e.preventDefault(),e.stopPropagation(),this.termsReaded=!0,this.goTerms.emit(!0)}gotoTermsAndConditionsCertificate(e){e.preventDefault(),e.stopPropagation(),this.terms2Readed=!0,this.goTermsCert.emit(!0)}setAssignment(e){this.assignment=e}getAssignmentValidation(){return!(this.data.config.forceChecks&&(!this.data.config.hideCheckLegal&&!this.termsReaded||!this.terms2Readed))&&(!this.data.config.dataAssignmentCheck||this.assignment)}setTerms(e){this.acceptTerms=e}setTerms2(e){this.acceptTerms2=e}getIsValid(){return(this.data.config.hideCheckLegal||this.acceptTerms)&&this.acceptTerms2}}return e.ɵfac=function(t){return new(t||e)(H.Y36(p.QS),H.Y36(j.F))},e.ɵcmp=H.Xpm({type:e,selectors:[["belender-form-step"]],inputs:{userId:"userId",flowName:"flowName",data:"data",texts:"texts",labels:"labels",solicitud:"solicitud"},outputs:{next:"nextStep",goTerms:"goToTerms",goTermsCert:"goToTermsCertificate"},features:[H._Bn([{provide:T.sG,useValue:Le},{provide:H.soG,useValue:"es-ES"}])],decls:15,vars:25,consts:[[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4","custom-html",3,"innerHTML"],[3,"selectedIndex","selectedIndexChange"],[3,"label"],["class","my-3 flex flex-col md:flex-row flex-wrap gap-2 md:justify-between",4,"ngIf"],["class","px-2 flex items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500",4,"ngIf"],[4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"],[1,"my-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["id","form-name","aria-label","Nombre","formControlName","name","matInput",""],["id","form-lastname","aria-label","Primer apellido","formControlName","lastname","matInput",""],["id","form-lastname2","aria-label","Segundo apellido","formControlName","lastname2","matInput",""],["appearance","outline",1,"mb-4","w-full","flex-1","belender-form-field"],["id","form-dni","aria-label","DNI","formControlName","dni","maxlength","9","matInput","",3,"placeholder"],["class","flex justify-start items-center w-full flex-100",4,"ngIf"],[1,"mt-3","flex","justify-start","items-center","w-full","flex-100"],[3,"color","changeCheckbox"],["target","_blank",1,"text-sm","hover:text-blue-500",3,"click"],[1,"flex","justify-start","items-center","w-full","flex-100"],[3,"userId","linkType","goToTerms"],[1,"custom-html",3,"innerHTML"],["id","form-name-legal","aria-label","Nombre","formControlName","name","matInput",""],["id","form-lastname-legal","aria-label","Primer apellido","formControlName","lastname","matInput",""],["id","form-lastname2-legal","aria-label","Segundo apellido","formControlName","lastname2","matInput",""],["id","form-dni-legal","aria-label","DNI","formControlName","dni","maxlength","9","matInput","",3,"placeholder"],["id","form-razon","aria-label","Razón social","formControlName","razon","type","text","matInput","",3,"placeholder"],["id","form-cif","aria-label","CIF","formControlName","cif","type","text","matInput","",3,"placeholder"],[1,"px-2","flex","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"],["svgIcon","mat:warning",1,"text-xs","w-4","h-4"]],template:function(e,t){1&e&&(H.TgZ(0,"form",0)(1,"div",1),H._UZ(2,"div",2)(3,"div",3),H.ALo(4,"safeHtml"),H.qZA(),H.TgZ(5,"mat-tab-group",4),H.NdJ("selectedIndexChange",(function(e){return t.tabChanged(e)})),H.TgZ(6,"mat-tab",5),H.YNc(7,ye,30,15,"div",6),H.qZA(),H.TgZ(8,"mat-tab",5),H.YNc(9,Ee,42,21,"div",6),H.qZA()(),H.YNc(10,Ae,3,1,"div",7),H.YNc(11,Oe,4,1,"ng-container",8),H.TgZ(12,"div",9)(13,"button",10),H.NdJ("click",(function(){return t.nextStep()})),H._uU(14),H.qZA()()()),2&e&&(H.Q6J("formGroup",t.form),H.xp6(2),H.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),H.Q6J("innerHTML",t.texts.form.title,H.oJD),H.xp6(1),H.Udp("color",t.data.styles.colors.text),H.Q6J("innerHTML",H.lcZ(4,23,t.texts.form.description||""),H.oJD),H.xp6(2),H.Q6J("selectedIndex",t.step),H.xp6(1),H.Q6J("label",t.labels.naturalPerson),H.xp6(1),H.Q6J("ngIf",0==t.step),H.xp6(1),H.Q6J("label",t.labels.legalPerson),H.xp6(1),H.Q6J("ngIf",1==t.step),H.xp6(1),H.Q6J("ngIf",t.submitAttempted&&(!t.acceptTerms2||!t.data.config.hideCheckLegal&&!t.acceptTerms)),H.xp6(1),H.Q6J("ngIf",(null==t.data?null:t.data.config.activatePower)&&!(null!=t.solicitud&&t.solicitud.power_activate)),H.xp6(2),H.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),H.xp6(1),H.hij(" ",t.labels.actions.next," "))},dependencies:[i.O5,d.Hw,u.lW,P.TO,P.KE,P.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.nD,p.sg,p.u,ue.SP,ue.uX,he.b,pe.T,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Pe=n(5145);let Ne=(()=>{class e{constructor(e){this.utils=e,this.status="",this.label="Cargando datos.."}ngOnInit(){this.data.config&&this.data.config.infiniteLoopInCompleted?this.label="":Pe.Z.forEach((e=>{e.text==this.status&&(this.label=e.label)}))}}return e.ɵfac=function(t){return new(t||e)(H.Y36(j.F))},e.ɵcmp=H.Xpm({type:e,selectors:[["belender-loading-step"]],inputs:{status:"status",data:"data"},decls:5,vars:1,consts:[[1,"fixed-content","h-full"],[1,"h-full","py-10","flex","flex-col","items-center"]],template:function(e,t){1&e&&(H.TgZ(0,"div",0)(1,"div",1),H._UZ(2,"mat-progress-spinner"),H.TgZ(3,"p"),H._uU(4),H.qZA()()()),2&e&&(H.xp6(4),H.Oqu(t.label))},dependencies:[y.Ou],styles:[".content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),qe=(()=>{class e{constructor(){}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=H.Xpm({type:e,selectors:[["belender-no-service-step"]],inputs:{data:"data",texts:"texts"},decls:5,vars:10,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&(H.TgZ(0,"form",0)(1,"div",1),H._UZ(2,"div",2)(3,"div",3),H.ALo(4,"safeHtml"),H.qZA()()),2&e&&(H.xp6(2),H.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),H.Q6J("innerHTML",t.texts.noService.title,H.oJD),H.xp6(1),H.Udp("color",t.data.styles.colors.text),H.Q6J("innerHTML",H.lcZ(4,8,t.texts.noService.description),H.oJD))},dependencies:[p._Y,p.JL,p.F,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),Re=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.retryOp=new H.vpe(null)}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}getTextStatus(){switch(this.solicitud.status_code){case"abandoned_after_waiting_otp_seguridad_social":return"Abandonado después de esperar OTP de Seguridad Social";case"abandoned_after_invalid_otp_seguridad_social":return"Abandonado despues de OTP inválido en Seguridad Social";case"abandoned_after_invalid_otp_aeat":return"Abandonado despues de OTP inválido en AEAT";case"abandoned_after_waiting_otp_aeat":return"Abandonado después de esperar OTP de AEAT";default:return this.solicitud.status_code}}}return e.ɵfac=function(t){return new(t||e)(H.Y36(p.QS),H.Y36(j.F),H.Y36(_.M),H.Y36(v.o),H.Y36(k.T))},e.ɵcmp=H.Xpm({type:e,selectors:[["belender-abandoned-step"]],inputs:{solicitud:"solicitud",data:"data",texts:"texts"},outputs:{retryOp:"retry"},decls:10,vars:17,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"p-1","px-2","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-md","mb-2","mt-2"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(H.TgZ(0,"div",0)(1,"div",1),H._UZ(2,"div",2)(3,"div",3),H.ALo(4,"safeHtml"),H.TgZ(5,"div",4),H._uU(6),H.qZA()(),H.TgZ(7,"div",5)(8,"button",6),H.NdJ("click",(function(){return t.retry()})),H._uU(9,"Intentarlo nuevamente"),H.qZA()()()),2&e&&(H.xp6(2),H.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),H.Q6J("innerHTML",t.texts.abandoned.title,H.oJD),H.xp6(1),H.Udp("color",t.data.styles.colors.text),H.Q6J("innerHTML",H.lcZ(4,15,t.texts.abandoned.description),H.oJD),H.xp6(3),H.hij(" Estado: ",t.getTextStatus()," "),H.xp6(2),H.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"))},dependencies:[u.lW,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Ye=n(1406);function Fe(e,t){1&e&&(H.TgZ(0,"mat-hint",12),H._uU(1," La contraseña es requerida "),H.qZA())}function Ue(e,t){1&e&&(H.TgZ(0,"mat-hint",12),H._uU(1," La contraseña debe tener al menos 8 carácteres "),H.qZA())}const Ze={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let He=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.form=new p.cw({}),this.next=new H.vpe(null)}ngOnInit(){this.setForm()}get f(){return this.form.controls}submit(){this.nextStep()}setForm(){this.form=this.fb.group({password:["",[p.kI.required]]})}nextStep(){let e={password:this.form.get("password").value};this.next.emit(e)}}return e.ɵfac=function(t){return new(t||e)(H.Y36(p.qu),H.Y36(j.F))},e.ɵcmp=H.Xpm({type:e,selectors:[["belender-password-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud"},outputs:{next:"nextStep"},features:[H._Bn([{provide:T.sG,useValue:Ze},{provide:H.soG,useValue:"es-ES"}])],decls:17,vars:20,consts:[[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"my-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],[1,"w-full","mb-3"],["label","Seleccione archivo de certificado (.p12)",1,"w-full"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["formControlName","password","minlength","8","type","password","matInput",""],["class","text-red-500",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"text-red-500"]],template:function(e,t){1&e&&(H.TgZ(0,"form",0)(1,"div",1),H._UZ(2,"div",2)(3,"div",3),H.ALo(4,"safeHtml"),H.qZA(),H.TgZ(5,"div",4)(6,"div",5),H._UZ(7,"app-file-upload",6),H.qZA(),H.TgZ(8,"mat-form-field",7)(9,"mat-label"),H._uU(10,"Contraseña"),H.qZA(),H._UZ(11,"input",8),H.YNc(12,Fe,2,0,"mat-hint",9),H.YNc(13,Ue,2,0,"mat-hint",9),H.qZA()(),H.TgZ(14,"div",10)(15,"button",11),H.NdJ("click",(function(){return t.nextStep()})),H._uU(16," Guardar "),H.qZA()()()),2&e&&(H.Q6J("formGroup",t.form),H.xp6(2),H.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),H.Q6J("innerHTML",t.texts.password.title,H.oJD),H.xp6(1),H.Udp("color",t.data.styles.colors.text),H.Q6J("innerHTML",H.lcZ(4,18,t.texts.password.description),H.oJD),H.xp6(9),H.Q6J("ngIf",t.f.password.touched&&t.f.password.invalid&&t.f.password.errors.required),H.xp6(1),H.Q6J("ngIf",t.f.password.invalid&&t.f.password.errors.minlength),H.xp6(2),H.Udp("color",t.form.invalid?"":t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),H.Q6J("disabled",t.form.invalid))},dependencies:[i.O5,u.lW,P.KE,P.bx,P.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.sg,p.u,Ye.Y,W.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function je(e,t){if(1&e&&(H.TgZ(0,"div",12),H._UZ(1,"img",13),H.qZA()),2&e){const e=H.oxw(3);H.xp6(1),H.Q6J("src",e.data.styles.logoUrl,H.LSH)}}function ze(e,t){if(1&e&&(H.TgZ(0,"div",9),H.YNc(1,je,2,1,"div",6),H.TgZ(2,"div",10)(3,"p",11)(4,"strong"),H._uU(5,"Uso exclusivo en ordenadores o portátiles"),H.qZA()(),H.TgZ(6,"p",11),H._uU(7," Para garantizar la correcta finalización de este proceso, el acceso está habilitado únicamente desde "),H.TgZ(8,"strong"),H._uU(9,"ordenadores de sobremesa o portátiles."),H.qZA()(),H.TgZ(10,"p",11),H._uU(11," Actualmente, el servicio no es compatible con dispositivos móviles o tablets. Te recomendamos que vuelvas a iniciar el proceso desde un ordenador o portátil. "),H.qZA()()()),2&e){const e=H.oxw(2);H.Udp("color",e.data.styles.colors.text),H.xp6(1),H.Q6J("ngIf",e.data.styles.withLogo)}}function Be(e,t){if(1&e&&(H.TgZ(0,"div",12),H._UZ(1,"img",13),H.qZA()),2&e){const e=H.oxw(2);H.xp6(1),H.Q6J("src",e.data.styles.logoUrl,H.LSH)}}function Je(e,t){if(1&e&&H._UZ(0,"belender-loading-step",22),2&e){const e=H.oxw(3);H.Q6J("status",null==e.solicitud?null:e.solicitud.status_code)("data",e.data)}}function Ve(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"belender-form-step",23),H.NdJ("goToTerms",(function(){H.CHM(e);const t=H.oxw(3);return H.KtG(t.gotoTermsAndConditions())}))("goToTermsCertificate",(function(){H.CHM(e);const t=H.oxw(3);return H.KtG(t.gotoTermsAndConditionsCertificate())}))("nextStep",(function(t){H.CHM(e);const n=H.oxw(3);return H.KtG(n.gotoPassword(t))})),H.qZA()}if(2&e){const e=H.oxw(3);H.Q6J("userId",e.userId)("data",e.data)("flowName",e.flowName)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("labels",e.labels)("solicitud",e.solicitud)}}function Qe(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"belender-password-step",24),H.NdJ("nextStep",(function(t){H.CHM(e);const n=H.oxw(3);return H.KtG(n.sendPassword(t))})),H.qZA()}if(2&e){const e=H.oxw(3);H.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function We(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"belender-otp-step",25),H.NdJ("resendOTP",(function(t){H.CHM(e);const n=H.oxw(3);return H.KtG(n.resendOTP(t))}))("errorPhone",(function(){H.CHM(e);const t=H.oxw(3);return H.KtG(t.setRequestStatus("failed_login_otp"))}))("nextStep",(function(t){H.CHM(e);const n=H.oxw(3);return H.KtG(n.requestOTP(t))})),H.qZA()}if(2&e){const e=H.oxw(3);H.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function Ge(e,t){if(1&e&&H._UZ(0,"belender-success-step",26),2&e){const e=H.oxw(3);H.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function $e(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"belender-fail-step",27),H.NdJ("retry",(function(t){H.CHM(e);const n=H.oxw(3);return H.KtG(n.retryRequest(t))}))("newRequest",(function(t){H.CHM(e);const n=H.oxw(3);return H.KtG(n.newRequest(t))})),H.qZA()}if(2&e){const e=H.oxw(3);H.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function Ke(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"belender-abandoned-step",28),H.NdJ("retry",(function(t){H.CHM(e);const n=H.oxw(3);return H.KtG(n.retryRequest(t))})),H.qZA()}if(2&e){const e=H.oxw(3);H.Q6J("solicitud",e.solicitud)("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function Xe(e,t){if(1&e&&H._UZ(0,"belender-no-service-step",29),2&e){const e=H.oxw(3);H.Q6J("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("data",e.data)}}function et(e,t){if(1&e&&(H.ynx(0),H.YNc(1,Je,1,2,"belender-loading-step",14),H.YNc(2,Ve,1,6,"belender-form-step",15),H.YNc(3,Qe,1,3,"belender-password-step",16),H.YNc(4,We,1,3,"belender-otp-step",17),H.YNc(5,Ge,1,2,"belender-success-step",18),H.YNc(6,$e,1,3,"belender-fail-step",19),H.YNc(7,Ke,1,3,"belender-abandoned-step",20),H.YNc(8,Xe,1,2,"belender-no-service-step",21),H.BQk()),2&e){const e=H.oxw(2);H.xp6(1),H.Q6J("ngIf","loading"==e.requestStatus),H.xp6(1),H.Q6J("ngIf","form"==e.requestStatus&&!e.loading),H.xp6(1),H.Q6J("ngIf","password"==e.requestStatus),H.xp6(1),H.Q6J("ngIf","otp"==e.requestStatus),H.xp6(1),H.Q6J("ngIf","success"==e.requestStatus),H.xp6(1),H.Q6J("ngIf","failed"==e.requestStatus),H.xp6(1),H.Q6J("ngIf","abandoned"==e.requestStatus),H.xp6(1),H.Q6J("ngIf","no-service"==e.requestStatus)}}function tt(e,t){1&e&&H._UZ(0,"belender-disabled-url")}function nt(e,t){if(1&e&&(H.TgZ(0,"div",30),H._UZ(1,"mat-progress-spinner",31),H.TgZ(2,"p",32),H._uU(3),H.qZA()()),2&e){const e=H.oxw(2);H.xp6(1),H.Q6J("value",e.spinnerValue)("mode",e.spinnerMode),H.xp6(2),H.Oqu(e.loading)}}function it(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"div",33)(1,"div",34)(2,"div",35),H._uU(3,"Error!"),H.qZA(),H._UZ(4,"div",36),H.qZA(),H.TgZ(5,"div",37)(6,"button",38),H.NdJ("click",(function(){H.CHM(e);const t=H.oxw(2);return H.KtG(t.error=!1)})),H._uU(7,"Ingresar manualmente"),H.qZA()()()}if(2&e){const e=H.oxw(2);H.xp6(4),H.Udp("color",e.data.styles.colors.text),H.Q6J("innerHTML",e.error,H.oJD)}}function st(e,t){if(1&e&&(H.TgZ(0,"div",3)(1,"div",4),H.YNc(2,ze,12,3,"div",5),H.YNc(3,Be,2,1,"div",6),H.YNc(4,et,9,8,"ng-container",2),H.YNc(5,tt,1,0,"belender-disabled-url",2),H.YNc(6,nt,4,3,"div",7),H.YNc(7,it,8,3,"div",8),H.qZA()()),2&e){const e=H.oxw();H.xp6(1),H.Udp("background",e.data.styles.colors.background),H.xp6(1),H.Q6J("ngIf",e.showMobileAutofirmaError),H.xp6(1),H.Q6J("ngIf",!e.showMobileAutofirmaError&&e.data.styles.withLogo&&"loading"!=e.requestStatus),H.xp6(1),H.Q6J("ngIf",!e.error&&!e.disableURL&&!e.showMobileAutofirmaError),H.xp6(1),H.Q6J("ngIf",!e.error&&e.disableURL&&!e.showMobileAutofirmaError),H.xp6(1),H.Q6J("ngIf",e.loading&&!e.error&&!e.showMobileAutofirmaError),H.xp6(1),H.Q6J("ngIf",!e.loading&&e.error&&!e.showMobileAutofirmaError)}}function rt(e,t){if(1&e){const e=H.EpF();H.TgZ(0,"vex-terms",39),H.NdJ("accepted",(function(){H.CHM(e);const t=H.oxw();return H.KtG(t.handleTermsResponse(!0))}))("cancelled",(function(){H.CHM(e);const t=H.oxw();return H.KtG(t.handleTermsResponse(!1))})),H.qZA()}if(2&e){const e=H.oxw();H.Q6J("flow","presencial")("requestStatus",e.solicitud?e.solicitud.status_code:"")}}function ot(e,t){if(1&e&&(H.ynx(0),H.TgZ(1,"div",40),H._uU(2),H.qZA(),H.BQk()),2&e){const e=H.oxw();H.xp6(2),H.hij("TestMode ",e.testMode?"ON":"OFF","")}}let at=class{constructor(e,t,n,i,s,r,o,a,l,c){this.cd=e,this.Activatedroute=t,this.utils=n,this.solicitudesService=i,this.customizationService=s,this.notis=r,this.webhooksService=o,this.dialog=a,this.translationService=l,this.certificateUtils=c,this.data=null,this.disableActions=!1,this.step="created",this.waitingTime=15,this.loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1,this.disableURL=!1,this.flowName="ClientCertificate",this.showTermsDialog=!1,this.showMobileAutofirmaError=!1,this.currentLang="",this.labels=U.S.es,this.requestStatus=Z.q.FORM,this.intervalToAskBack=null,this.intervalCount=0,this.lastInvalidOtpAlertStatus=null}set solicitud(e){this._solicitudInput=e,e&&this.certificateUtils.setRequest(e)}get solicitud(){return this.certificateUtils.REQUEST||this._solicitudInput}ngOnInit(){const e=this;this.setTranslation(),this.loading="Obteniendo información de la solicitud",this.showMobileAutofirmaError=this.isMobileDevice(),this.certificateUtils.request_status$.subscribe((e=>{"invalid_otp_seguridad_social"===e&&this.lastInvalidOtpAlertStatus!==e&&(this.lastInvalidOtpAlertStatus=e,this.showAlert("Error!","Código inválido. Por favor, introduzca el código recibido por SMS")),this.setStatus()})),this.Activatedroute.params.subscribe((e=>{this.utils.setLoading(!1),e&&e.idUser?(this.userId=e.idUser,this.setInitialData(this.userId)):this.loading=!1,e&&e.packID&&(this.packId=e.packID)}),(e=>{this.loading=!1})),"pro"!=Y.N.env&&(R(document).keydown((function(t){16==t.which&&(this.shiftlIsPressed=!0),17==t.which&&(this.cntrlIsPressed=!0),84==t.which&&this.cntrlIsPressed&&this.shiftlIsPressed&&(e.testMode=!e.testMode,e.cd.markForCheck())})),R(document).keyup((function(e){16==e.which&&(this.shiftlIsPressed=!1),16==e.which&&(this.cntrlIsPressed=!1)})))}ngOnDestroy(){this.stopInterval(),this.certificateUtils.disconnectWebsocket()}isMobileDevice(){const e=navigator.userAgent||"";return/Android|iPhone|iPad|iPod|IEMobile|Opera Mini|Mobile/i.test(e)}sendMessageToParent(e){this.certificateUtils.sendMessageToParent(e)}setInitialData(e){this.customizationService.getCustomization(e).then((e=>{e&&(this.data=e,this.funderConfig=e.config,this.disableURL=e.config.disableUrlWidget,this.financiadorID=e.funder_id||"",this.validateRequestIdInUrl(),this.cd.markForCheck()),this.loading=!1}),(e=>{console.error(e),this.loading=!1}))}setTranslation(){const e=this.currentLang||localStorage.getItem("belender-language")||"es",t=this.translationService.getLabelsTranslated(e);t&&(this.labels=t,this.certificateUtils.labels=t)}validateRequestIdInUrl(){this.Activatedroute.queryParams.subscribe((e=>{e?.lang&&(this.currentLang=e.lang,this.setTranslation()),e&&e.acceptTerms&&(this.autoAcceptTerms=!0),e&&e.request_id?(this.disableURL=!1,this.requestID=e.request_id,this.setFormFromVcCode(e.request_id)):this.loading=!1}),(e=>{this.loading=!1}))}setFormFromVcCode(e){var t=this;return(0,L.Z)((function*(){t.loading="Obteniendo datos de la solicitud...",t.solicitudesService.getSolicitudByCode(e).then((n=>{if(n&&n.data){if(w.t.shouldIgnoreWebhookStatus(n.data.status_code))return t.certificateUtils.setRequest(t.certificateUtils.REQUEST?.status_code?{...n.data,status_code:t.certificateUtils.REQUEST.status_code}:n.data),t.certificateUtils.subscribeWS(e),t.loading="Estamos procesando su solicitud. Espere un momento por favor",t.skipCreationOfRequest=!0,void(t.autoAcceptTerms&&t.gotoPassword());t.certificateUtils.setRequest(n.data),t.certificateUtils.subscribeWS(e),t.setRequestStatus(t.certificateUtils.REQUEST.status_code),t.loading=!1,t.skipCreationOfRequest=!0,t.autoAcceptTerms&&t.gotoPassword()}else t.loading=!1})).catch((e=>{t.loading=!1}))}))()}setSubscriptionOfRequest(){this.certificateUtils.subscribeWS(this.requestID)}handlePusherNotification(e){this.certificateUtils.handlePusherNotification(e),e?.status_code&&"terms_and_conditions"!=e.status_code&&setTimeout((()=>{this.loading=!1,this.cd.markForCheck()}),500)}setSubscriptionOfRequestOld(){!this.financiadorID||!this.userId||!this.requestID||this.subscribed||(this.subscribed=!0,this.webhooksService.bindRequestChanges(this.financiadorID,this.userId,this.requestID),this.webhooksService.subscribeRequestChanges().subscribe((e=>{e&&this.handlePusherNotification(e)}),(e=>{this.loading=!1})))}resendOTP(e){let t={request_id:this.requestID,user_id:this.userId};this.loading="Reenviando OTP...",this.setSubscriptionOfRequest(),this.solicitudesService.resendOTP(t).then((e=>{e&&e.data&&(this.certificateUtils.setRequest(e.data),this.setRequestStatus(this.certificateUtils.REQUEST.status_code)),this.loading=!1})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=!1}))}gotoTerms(e){this.loading=this.labels.loadings.sendingData,e.package_id=this.packId,e.user_id=this.userId,this.testMode?setTimeout((()=>{this.certificateUtils.setRequest(new q.l),this.setRequestStatus("waiting_otp_seguridad_social"),this.loading=!1}),4e3):this.skipCreationOfRequest?(this.gotoPassword(),this.setSubscriptionOfRequest()):this.solicitudesService.addSolicitud(e).then((t=>{t&&t.status&&"error"==t.status?(this.certificateUtils.setRequest({...e,status_code:"form"}),t.message&&(400==t.code?"Birthdate incorrect"==t.message?(this.setRequestStatus("form"),this.showAlert("Error!","Fecha de nacimiento incorrecta")):(this.setRequestStatus("no_service"),this.loading=!1):(this.setRequestStatus("form"),this.showAlert("Error!",t.message)))):t&&t.status&&"success"==t.status?(this.requestID=t.data.request_id,this.certificateUtils.setRequest(t.data),this.sendMessageToParent(t.data),this.gotoPassword()):this.showAlert("Error!","Error desconocido: "+t)})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=!1}))}sendNewData(e){this.loading="Enviando información..",this.solicitudesService.fixData(this.requestID,e).then((e=>{e.status&&"error"==e.status?e.message&&(this.showAlert("Error!",e),this.loading=!1):e&&"success"==e.status&&(this.sendMessageToParent(e.data||e),this.initWaitingForResponse("Validando nuevos datos, espere por favor.."),this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.loading=!1}))}showAlert(e,t){this.loading=!1,this.notis.showAlert(e,t)}gotoPassword(e){this.initWaitingForResponse("Iniciando el proceso de emisión de certificado.."),setTimeout((()=>{this.certificateUtils.setRequest(new q.l),this.setRequestStatus("waiting_password"),this.loading=!1}),2e3)}requestOTP(e){this.loading="Enviando información..",setTimeout((()=>{this.certificateUtils.setRequest(new q.l),this.setRequestStatus("waiting_password"),this.loading=!1}),2e3)}sendPassword(e){this.loading="Enviando información..",setTimeout((()=>{this.setRequestStatus("all_documents_downloaded"),this.loading=!1}),2e3)}initWaitingForResponse(e){this.loading=e||"Validando información, espere por favor..",setTimeout((()=>{this.loading&&this.askToBack()}),1e4)}askToBack(){this.askDetailToBack(this.requestID)}askDetailToBack(e){const t=this.certificateUtils.REQUEST?.status_code,n=e||this.requestID||this.certificateUtils.REQUEST?.request_id;n&&"consent_process_completed"!==t?this.solicitudesService.getSolicitudByCode(n).then((e=>{if(e&&e.data){if(w.t.shouldIgnoreWebhookStatus(e.data.status_code))return;t!=e.data.status_code&&(this.certificateUtils.setRequest(e.data),this.setRequestStatus(this.certificateUtils.REQUEST.status_code)),this.loading=!1}else this.loading=!1})).catch((e=>{this.loading=!1})):this.stopInterval()}initIntervalToAskBack(){!this.certificateUtils.REQUEST?.request_id&&!this.requestID||this.intervalToAskBack||(this.intervalToAskBack=setInterval((()=>{this.askDetailToBack(),this.intervalCount++,this.intervalCount>20&&this.stopInterval()}),5e3))}stopInterval(){this.intervalToAskBack&&clearInterval(this.intervalToAskBack),this.intervalToAskBack=null,this.intervalCount=0}gotoErrorPhone(){}setRequestStatus(e){this.certificateUtils.REQUEST||this.certificateUtils.setRequest(new q.l),this.certificateUtils.setRequestStatus(e),this.setStatus()}setStatus(){if(!this.certificateUtils.REQUEST)return;const e=Z.S[this.certificateUtils.REQUEST.status_code];if(e){if(e===Z.q.SUCCESS&&this.funderConfig?.infiniteLoopInCompleted)return this.requestStatus=Z.q.LOADING,this.loading=" ",void this.cd.markForCheck();if(e===Z.q.LOADING)return this.requestStatus=Z.q.LOADING,this.loading=this.labels.loadings?.validatingData||"Estamos procesando su solicitud. Espere un momento por favor",void this.cd.markForCheck();if(e===Z.q.ERROR_DATA)return this.requestStatus=Z.q.ERROR_DATA,this.loading=null,this.stopInterval(),void this.cd.markForCheck();this.requestStatus=e,this.loading=null,this.stopInterval()}else this.requestStatus=Z.q.LOADING,this.loading=this.labels.loadings?.validatingData||"Estamos procesando su solicitud. Espere un momento por favor",this.initIntervalToAskBack();this.cd.markForCheck()}retryRequest(e){let t={request_id:e,user_id:this.userId};this.loading="Reintentando enviar la solicitud...",this.setSubscriptionOfRequest(),this.solicitudesService.retryRequest(t).then((e=>{e&&e.data&&(this.certificateUtils.setRequest(e.data),this.setRequestStatus(this.certificateUtils.REQUEST.status_code)),this.loading=!1})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=!1}))}newRequest(e){this.setRequestStatus("created")}getStatus(){return this.requestStatus}sendRetry(){}gotoTermsAndConditions(){this.showTermsDialog=!0}handleTermsResponse(e){this.showTermsDialog=!1}gotoTermsAndConditionsCertificate(){this.dialog.open(F.v,{panelClass:"fullscreen-dialog",data:{flow:"presencial"}})}};at.ɵfac=function(e){return new(e||at)(H.Y36(H.sBO),H.Y36(A.gz),H.Y36(j.F),H.Y36(_.M),H.Y36(S.w),H.Y36(k.T),H.Y36(w.t),H.Y36(z.uw),H.Y36(B.D),H.Y36(J.J))},at.ɵcmp=H.Xpm({type:at,selectors:[["belender-widget-client-cert"]],inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud"},features:[H._Bn([{provide:P.o2,useValue:{appearance:"standard"}}])],decls:3,vars:3,consts:[["class","h-full widget-belender",4,"ngIf"],[3,"flow","requestStatus","accepted","cancelled",4,"ngIf"],[4,"ngIf"],[1,"h-full","widget-belender"],[1,"h-full","w-full","flex-auto","p-0","md:p-3"],["class","px-6 py-8 flex flex-col gap-4",3,"color",4,"ngIf"],["class","img-wrapper p-6 flex justify-center items-center",4,"ngIf"],["class","loading-wrapper animated fadeIn",4,"ngIf"],["class","animated fadeInRight",4,"ngIf"],[1,"px-6","py-8","flex","flex-col","gap-4"],[1,"subheading-1","flex","flex-col","gap-3"],[1,"m-0"],[1,"img-wrapper","p-6","flex","justify-center","items-center"],["alt","",1,"img-card",3,"src"],[3,"status","data",4,"ngIf"],[3,"userId","data","flowName","texts","labels","solicitud","goToTerms","goToTermsCertificate","nextStep",4,"ngIf"],[3,"data","texts","solicitud","nextStep",4,"ngIf"],[3,"data","texts","solicitud","resendOTP","errorPhone","nextStep",4,"ngIf"],[3,"data","texts",4,"ngIf"],[3,"data","texts","solicitud","retry","newRequest",4,"ngIf"],[3,"solicitud","data","texts","retry",4,"ngIf"],[3,"texts","data",4,"ngIf"],[3,"status","data"],[3,"userId","data","flowName","texts","labels","solicitud","goToTerms","goToTermsCertificate","nextStep"],[3,"data","texts","solicitud","nextStep"],[3,"data","texts","solicitud","resendOTP","errorPhone","nextStep"],[3,"data","texts"],[3,"data","texts","solicitud","retry","newRequest"],[3,"solicitud","data","texts","retry"],[3,"texts","data"],[1,"loading-wrapper","animated","fadeIn"],["color","accent","diameter","40",1,"spinner",3,"value","mode"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[1,"animated","fadeInRight"],[1,"px-6","py-4","flex","flex-col"],[1,"text-red-500","title","m-0"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"text-blue-500","bg-blue-50","px-8",3,"click"],[3,"flow","requestStatus","accepted","cancelled"],[1,"test-mode","px-10","py-2","bg-blue-500/10","text-blue-500","border-blue-500","border","rounded-md"]],template:function(e,t){1&e&&(H.YNc(0,st,8,8,"div",0),H.YNc(1,rt,1,2,"vex-terms",1),H.YNc(2,ot,3,1,"ng-container",2)),2&e&&(H.Q6J("ngIf",t.data),H.xp6(1),H.Q6J("ngIf",t.showTermsDialog),H.xp6(1),H.Q6J("ngIf",t.testMode))},dependencies:[i.O5,u.lW,y.Ou,V.q,Q.L,se,oe,ce,De,Ne,qe,Re,He],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative}.widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"]}),at=(0,D.gn)([(0,N.c)()],at);const lt=[{path:":idUser",component:at},{path:":idUser/:packID",component:at}];let ct=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=H.oAB({type:e}),e.ɵinj=H.cJS({imports:[A.Bz.forChild(lt),A.Bz,O.d8]}),e})();var dt=n(6981),ut=n(1129),ht=n(969),pt=n(3300),mt=n(865),ft=n(3295);let gt=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=H.oAB({type:e}),e.ɵinj=H.cJS({providers:[_.M,v.o,S.w,w.t,k.T,E.t,J.J,{provide:T.Ad,useValue:"es-ES"}],imports:[ct,i.ez,s.G,r.J,o.TU,a.p0,l.JX,c.p9,d.Ps,u.ot,h.Tx,x.c,p.u5,m.AV,p.UX,f.LD,g.vV,b.a,y.Cq,C.FA,T.XK,M.T5,I.Fk,dt.x,ue.Nh,c.p9,ut.n,ht.O,pt.C,mt.q,ft.g]}),e})()}}]),(self.webpackChunkvex=self.webpackChunkvex||[]).push([[298],{667:(e,t,n)=>{n.d(t,{$:()=>s});var i=n(7340);const s=(r=400,(0,i.X$)("fadeInUp",[(0,i.eR)(":enter",[(0,i.oB)({transform:"translateY(20px)",opacity:0}),(0,i.jt)(`${r}ms cubic-bezier(0.35, 0, 0.25, 1)`,(0,i.oB)({transform:"translateY(0)",opacity:1}))])]));var r},5592:(e,t,n)=>{n.d(t,{J:()=>a});var i=n(6895),s=n(8594),r=n(7392),o=n(4650);let a=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=o.oAB({type:e}),e.ɵinj=o.cJS({imports:[i.ez,s.Bz,r.Ps]}),e})()},1763:(e,t,n)=>{n.d(t,{b:()=>c});var i=n(4650),s=n(6895),r=n(7392);function o(e,t){1&e&&i._UZ(0,"mat-icon",3)}const a=function(e,t){return{background:e,"border-color":t}},l=["*"];let c=(()=>{class e{constructor(){this.text="",this.color="rgb(14, 197, 151)",this.changeCheckbox=new i.vpe,this.checked=!1}emitChange(){this.checked=!this.checked,this.changeCheckbox.emit(this.checked)}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-checkbox"]],inputs:{text:"text",color:"color",checked:"checked"},outputs:{changeCheckbox:"changeCheckbox"},ngContentSelectors:l,decls:5,vars:5,consts:[[1,"flex","items-start","gap-2","justify-start","w-fit","hover:bg-slate-700/10","py-2","rounded-sm","cursor-pointer",3,"click"],[1,"check-wrapper","w-5","h-5","border","mr-1","rounded-sm","flex","justify-center","items-center","p-0",3,"ngStyle"],["style","font-size: 5px","class","m-0 p-0 text-white","svgIcon","mat:check",4,"ngIf"],["svgIcon","mat:check",1,"m-0","p-0","text-white",2,"font-size","5px"]],template:function(e,t){1&e&&(i.F$t(),i.TgZ(0,"div",0),i.NdJ("click",(function(){return t.emitChange()})),i.TgZ(1,"div",1),i.YNc(2,o,1,0,"mat-icon",2),i.qZA(),i.TgZ(3,"div"),i.Hsn(4),i.qZA()()),2&e&&(i.xp6(1),i.Q6J("ngStyle",i.WLB(2,a,t.checked?t.color:"transparent",t.checked?t.color:"rgba(0,0,0,.7)")),i.xp6(1),i.Q6J("ngIf",t.checked))},dependencies:[s.O5,s.PC,r.Hw],styles:[".check-wrapper[_ngcontent-%COMP%]{transition:all .3s ease;min-width:1.25rem}"]}),e})()},1129:(e,t,n)=>{n.d(t,{n:()=>c});var i=n(6895),s=n(4006),r=n(9549),o=n(9101),a=n(7392),l=n(4650);let c=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=l.oAB({type:e}),e.ɵinj=l.cJS({imports:[i.ez,s.u5,s.UX,r.lN,o.ot,a.Ps]}),e})()},8008:(e,t,n)=>{n.d(t,{O:()=>o});var i=n(4650),s=n(6895);function r(e,t){if(1&e&&(i.O4$(),i.kcU(),i.TgZ(0,"p",4),i._uU(1),i.qZA()),2&e){const e=i.oxw();i.xp6(1),i.Oqu(e.text)}}let o=(()=>{class e{constructor(){this.text="",this.color="rgb(14, 197, 151)",this.zoom=1}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-spinner"]],inputs:{text:"text",color:"color",zoom:"zoom"},decls:4,vars:7,consts:[[1,"flex","w-full","justify-center","items-center","flex-col","gap-4"],["width","65px","height","65px","viewBox","0 0 66 66","xmlns","http://www.w3.org/2000/svg",1,"spinner"],["fill","none","stroke-width","6","stroke-linecap","round","cx","33","cy","33","r","30",1,"path"],["class","text-center",4,"ngIf"],[1,"text-center"]],template:function(e,t){1&e&&(i.TgZ(0,"div",0),i.O4$(),i.TgZ(1,"svg",1),i._UZ(2,"circle",2),i.qZA(),i.YNc(3,r,2,1,"p",3),i.qZA()),2&e&&(i.xp6(1),i.Jzz("zoom: ",t.zoom,"; "),i.xp6(1),i.Jzz("stroke: ",t.color,""),i.xp6(1),i.Q6J("ngIf",t.text))},dependencies:[s.O5],styles:[".spinner[_ngcontent-%COMP%]{animation:rotator 1.4s linear infinite}@keyframes rotator{0%{transform:rotate(0)}to{transform:rotate(270deg)}}.path[_ngcontent-%COMP%]{stroke-dasharray:187;stroke-dashoffset:0;transform-origin:center;animation:dash 1.4s ease-in-out infinite}@keyframes dash{0%{stroke-dashoffset:187}50%{stroke-dashoffset:46.75;transform:rotate(135deg)}to{stroke-dashoffset:187;transform:rotate(450deg)}}"]}),e})()},9476:(e,t,n)=>{n.d(t,{F:()=>c});var i=n(6895),s=n(4006),r=n(9549),o=n(9101),a=n(7392),l=n(4650);let c=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=l.oAB({type:e}),e.ɵinj=l.cJS({imports:[i.ez,s.u5,s.UX,r.lN,o.ot,a.Ps]}),e})()},833:(e,t,n)=>{n.d(t,{L:()=>d});var i=n(4650),s=n(8594),r=n(7367),o=n(8460),a=n(6895),l=n(9101);function c(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"div",5)(1,"button",6),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw();return i.KtG(t.accept())})),i._uU(2,"Cerrar"),i.qZA()()}if(2&e){const e=i.oxw();i.xp6(1),i.Udp("color",e.funderStyles.colors.btnText)("background",e.funderStyles.colors.btnBg)("border-radius",e.funderStyles.btnRound+"px")}}let d=(()=>{class e{constructor(e,t,n){this.Activatedroute=e,this.customizationService=t,this.customizationStoreService=n,this.loading=!0,this.hideButtons=!0,this.acceptTerms=new i.vpe(null),this.cancelTerms=new i.vpe(null)}ngOnInit(){this.loading=!0,this.userId&&this.flow?(this.userID=this.userId,this.flowName=this.flow,this.customizationStoreService.getFunderStyles().subscribe((e=>{this.funderStyles=e})),this.customizationService.getCustomizationByFlow(this.userID,this.flowName,this.customizationStoreService.LANG).then((e=>{this.flowConfig=e,this.terms_and_conditions=this.flowConfig&&this.flowConfig.terms_and_conditions?this.flowConfig.terms_and_conditions:`\n <div class="px-10 py-6 rounded-md text-center bg-orange-500/20 text-orange-600">\n <p>No hay términos y condiciones para el flujo <b>${this.flowName}</b></p> \n </div>`,this.loading=!1})).catch((e=>{this.loading=!1}))):this.Activatedroute.params.subscribe((e=>{e&&e.idUser?(this.userID=e.idUser,this.flowName=this.getParsedFlowName(e.flow),this.userID?this.customizationService.getCustomizationByFlow(this.userID,this.flowName,this.customizationStoreService.LANG).then((e=>{this.flowConfig=e,this.terms_and_conditions=this.flowConfig&&this.flowConfig.terms_and_conditions?this.flowConfig.terms_and_conditions:'\n <div class="px-10 py-6 rounded-md text-center bg-orange-500/20 text-orange-600">\n <p>No hay términos y condiciones para este flujo</p> \n </div>',this.loading=!1})).catch((e=>{this.loading=!1})):this.loading=!1):this.loading=!1}),(e=>{this.loading=!1}))}getParsedFlowName(e){switch(e){case"sms":case"Sms":return"SMS";case"clavepin":case"ClavePin":case"CLAVEPIN":return"ClavePin";case"videoid":return"VideoID";case"personal":case"presencial":case"client-cert":return"KnownClient";default:return e}}accept(){this.acceptTerms.emit(!0)}cancel(){this.cancelTerms.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(i.Y36(s.gz),i.Y36(r.w),i.Y36(o.r))},e.ɵcmp=i.Xpm({type:e,selectors:[["vex-power-cert"]],inputs:{flow:"flow",userId:"userId",hideButtons:"hideButtons"},outputs:{acceptTerms:"accept",cancelTerms:"cancel"},decls:33,vars:1,consts:[[1,"py-12","flex","flex-col","items-center","overflow-auto","max-h-[96vh]","terms-page"],[1,"max-w-xl","overflow-y-auto"],[1,"font-bold"],[1,"pt-6","font-bold"],["class","w-full max-w-xl flex items-center justify-end gap-2 p-4",4,"ngIf"],[1,"w-full","max-w-xl","flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8",3,"click"]],template:function(e,t){1&e&&(i.TgZ(0,"div",0)(1,"div",1)(2,"h1",2),i._uU(3,"HOJA DE ACEPTACIÓN DE CERTIFICADO ELECTRONICO CUALIFICADO RÉGIMEN OBLIGATORIO DE USO DEL CERTIFICADO ELECTRONICO: “CERTIFICADO DE PERSONA FÍSICA REPRESENTANTE DE EMPRESA EMITIDO EN SOFTWARE”"),i.qZA(),i.TgZ(4,"p"),i._uU(5," a) Que existen unas condiciones generales del servicio incorporadas en el texto de divulgación del certificado o PDS, y una declaración de prácticas de certificación, que regulan la emisión y utilización del certificado electrónico emitido porvinCAsign, cuyo texto íntegro se puede consultar en la dirección de Internet, https://policy.vincasign.net. "),i.qZA(),i.TgZ(6,"p"),i._uU(7," b) Que el certificado electrónico emitido y el resto de los elementos que forman parte de la identificación electrónica son únicos para cada usuario. El certificado debe ser protegido por un código secreto (PIN), que sólo conoce el titular y que le será entregado en el momento de la emisión del certificado. Para utilizar el certificado es imprescindible conocer este código. "),i.qZA(),i.TgZ(8,"p"),i._uU(9," c) Que este certificado permite al titular del certificado generar firmas electrónicas e identificarse de forma electrónica en aquellos sistemas de información que soporten este tipo de autenticación. "),i.qZA(),i.TgZ(10,"p"),i._uU(11," d) Que el FIRMANTE debe custodiar, de forma diligente, el PIN que permite utilizarlo, para evitar que otras personas puedan suplantar su identidad y firmar documentos en su nombre, o acceder a mensajes confidenciales o sistemas de información de acceso restringido. "),i.qZA(),i.TgZ(12,"p"),i._uU(13," e) Que, si el FIRMANTE detecta cualquier indicio de que su identificación electrónica ha podido ser utilizada por otras personas, tendrá que suspender el uso del certificado y notificarlo inmediatamente al responsable del servicio de certificación del SUSCRIPTOR, o a vinCAsign, para pedir la revocación del certificado y, en su caso, la emisión de uno nuevo. "),i.qZA(),i.TgZ(14,"p"),i._uU(15," f) Que ante cualquier necesidad de información adicional, respecto de la utilización de los certificados emitidos en nombre de vinCAsign, el FIRMANTE se podrá dirigir al SUSCRIPTOR, al responsable del servicio de certificación del SUSCRIPTOR, y/o a VINTEGRIS. "),i.qZA(),i.TgZ(16,"p"),i._uU(17," g) Que con el fin de obtener los correspondientes certificados, y dentro del marco del Reglamento (UE) 2016/679 del Parlamento Europeo y del Consejo de 27 de abril de 2016 relativo a la protección de las personas físicas en lo que respecta al tratamiento de datos personales y a la libre circulación de estos datos y por el que se deroga la Directiva 95/46/CE (Reglamento general de protección de datos), el SUSCRIPTOR ha comunicado a vinCAsign los datos identificativos del FIRMANTE con el fin de emitir y gestionar el certificado corporativo de persona física emitido en software, en el ámbito de la relación de trabajo entre dicho FIRMANTE y el SUSCRIPTOR, todo ello a los efectos de lo previsto en el artículo 28 del Reglamento general de protección de datos. "),i.qZA(),i.TgZ(18,"p"),i._uU(19," h) Que sabe que, en cumplimiento de lo establecido en los artículos 24.2 y 28 del Reglamento (UE) 910/2014 del Parlamento Europeo y del Consejo de 23 de julio de 2014, los datos contenidos en el certificado corporativo de persona física emitido en software están publicados en la página web de vinCAsign a efectos del Registro de Certificados y de las listas de revocación, toda vez que ha prestado su consentimiento durante el proceso de solicitud. "),i.qZA(),i.TgZ(20,"h1",3),i._uU(21," ACTO DE ACEPTACIÓN DEL CERTIFICADO ELECTRÓNICO "),i.qZA(),i.TgZ(22,"p"),i._uU(23," Firmo el presente documento para dejar constancia: "),i.qZA(),i.TgZ(24,"p"),i._uU(25," Que ha sido informado del contenido del texto de divulgación del certificado o PDS, en el que se incluyen las condiciones generales del servicio aplicable al certificado corporativo de persona física emitido en software. "),i.qZA(),i.TgZ(26,"p"),i._uU(27," Que ha sido informado del régimen obligatorio de uso del certificado emitido, sus condiciones de uso y sus responsabilidades. "),i.qZA(),i.TgZ(28,"p"),i._uU(29," Que ha sido informado de las circunstancias relativas al tratamiento de sus datos personales para la correcta emisión y gestión del certificado que se emite. "),i.qZA(),i.TgZ(30,"p"),i._uU(31," Firma de conformidad, en virtud de la cual ha leído y entiende las obligaciones y responsabilidades que asume. "),i.qZA()(),i.YNc(32,c,3,6,"div",4),i.qZA()),2&e&&(i.xp6(32),i.Q6J("ngIf",t.funderStyles&&!t.hideButtons))},dependencies:[a.O5,l.lW],styles:["h1[_ngcontent-%COMP%]{font-size:20px!important;font-weight:700}h2[_ngcontent-%COMP%]{font-size:20px!important;font-weight:700;line-height:25px;margin:15px 0}p[_ngcontent-%COMP%]{margin:10px 0}.terms-page[_ngcontent-%COMP%]{position:fixed;top:0;left:0;width:100vw;background:white;z-index:9999999!important;height:100vh;max-height:100vh}"]}),e})()},2266:(e,t,n)=>{n.d(t,{L:()=>g});var i=n(8594),s=n(833),r=n(6e3),o=n(4650);const a=[{path:":flow",component:s.L},{path:":flow/:idUser",component:s.L}];let l=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=o.oAB({type:e}),e.ɵinj=o.cJS({imports:[i.Bz.forChild(a),i.Bz,r.d8]}),e})();var c=n(7533),d=n(1572),u=n(7367),h=n(6383),p=n(6895),m=n(4006),f=n(9101);let g=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=o.oAB({type:e}),e.ɵinj=o.cJS({providers:[u.w],imports:[l,c.q,d.Cq,h.G,p.ez,m.u5,f.ot]}),e})()},1145:(e,t,n)=>{n.d(t,{j:()=>l});var i=n(4650),s=n(6895);let r=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=i.oAB({type:e}),e.ɵinj=i.cJS({imports:[[s.ez]]}),e})();var o=n(7392),a=n(4006);let l=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=i.oAB({type:e}),e.ɵinj=i.cJS({imports:[s.ez,a.u5,r,o.Ps]}),e})()},4302:(e,t,n)=>{n.d(t,{q:()=>a});var i=n(7582),s=n(9933),r=n(667),o=n(4650);let a=class{constructor(){}};a.ɵfac=function(e){return new(e||a)},a.ɵcmp=o.Xpm({type:a,selectors:[["belender-disabled-url"]],decls:6,vars:1,consts:[[1,"p-2","w-full","flex","justify-start","flex-wrap"],[1,"py-4","px-6","w-full","rounded-md","bg-red-500/10","text-red-600","flex","flex-col","gap-3"]],template:function(e,t){1&e&&(o.TgZ(0,"div",0)(1,"div",1)(2,"h2"),o._uU(3,"Servicio desactivado"),o.qZA(),o.TgZ(4,"p"),o._uU(5,"El servicio que intenta acceder está desactivado. "),o.qZA()()()),2&e&&o.Q6J("@fadeInUp",void 0)},data:{animation:[r.$]}}),a=(0,i.gn)([(0,s.c)()],a)},3300:(e,t,n)=>{n.d(t,{C:()=>o});var i=n(6895),s=n(4006),r=n(4650);let o=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=r.oAB({type:e}),e.ɵinj=r.cJS({imports:[i.ez,s.u5]}),e})()},342:(e,t,n)=>{n.d(t,{A:()=>y});var i=n(7582),s=n(9933),r=n(2340),o=n(8730),a=n(4650),l=n(4006),c=n(8467),d=n(5601),u=n(9617),h=n(8460),p=n(6895),m=n(7392),f=n(1572);function g(e,t){if(1&e&&(a.TgZ(0,"span",11),a._uU(1),a._UZ(2,"mat-progress-spinner",12),a.qZA()),2&e){const e=a.oxw().$implicit;a.xp6(1),a.hij(" ",e.document_name," ")}}function _(e,t){if(1&e&&(a.TgZ(0,"span",13),a._uU(1),a._UZ(2,"mat-icon",14),a.qZA()),2&e){const e=a.oxw().$implicit;a.xp6(1),a.hij(" ",e.document_name," ")}}function b(e,t){if(1&e){const e=a.EpF();a.TgZ(0,"span",15),a.NdJ("click",(function(){a.CHM(e);const t=a.oxw().$implicit,n=a.MAs(5);return a.oxw().setDocumentName(t.document_name),a.KtG(n.click())})),a._uU(1),a._UZ(2,"mat-icon",16),a.qZA()}if(2&e){const e=a.oxw().$implicit;a.xp6(1),a.hij(" ",e.document_name," ")}}function v(e,t){if(1&e){const e=a.EpF();a.ynx(0),a.YNc(1,g,3,1,"span",6),a.YNc(2,_,3,1,"span",7),a.YNc(3,b,3,1,"span",8),a.TgZ(4,"input",9,10),a.NdJ("change",(function(t){a.CHM(e);const n=a.oxw();return a.KtG(n.fileChange(t))})),a.qZA(),a.BQk()}if(2&e){const e=t.$implicit,n=a.oxw();a.xp6(1),a.Q6J("ngIf",!e.document_status_code),a.xp6(1),a.Q6J("ngIf",e.document_status_code&&"downloaded"===e.document_status_code&&!n.loadingDocs),a.xp6(1),a.Q6J("ngIf",e.document_status_code&&"failed_download"===e.document_status_code&&!n.loadingDocs),a.xp6(1),a.Q6J("accept",n.acceptFiles)}}let y=class{constructor(e,t,n,i,s,r){this.formBuilder=e,this.utils=t,this.solicitudesService=n,this.packsS=i,this.cd=s,this.customizationStoreService=r,this.totalDocuments=[],this.totalDownloaded=0,this.totalNotDownloaded=0,this.file=null,this.fileSize=0,this.acceptFiles="image/jpeg, image/jpg, application/pdf",this.loadingDocs=!0,this.toBase64=e=>new Promise(((t,n)=>{const i=new FileReader;i.readAsDataURL(e),i.onload=()=>t(i.result),i.onerror=n}))}ngOnInit(){this.setLabels(),this.customizationStoreService.lang$.pipe((0,s.t)(this)).subscribe((()=>this.setLabels())),this.loadingDocs=!0,this.uploadForm=this.formBuilder.group({file:[""]}),this.setPacksAndDocuments(),this.initIntervalDocs()}ngOnChanges(e){e.lang&&this.setLabels()}setLabels(){const e=(0,o.S)(this.lang,this.customizationStoreService.LANG);this.file||(this.fileName=e.noFileSelected)}initIntervalDocs(){this.intDocs=setInterval((()=>{this.setDocumentsFromPack()}),4e3)}setPacksAndDocuments(){this.packsS.getPacksByPackId(this.packId).then((e=>{this.totalDocuments=this.parseDocumentsFromPack(e.data.documents),this.setDocumentsFromPack()}))}setDocumentsFromPack(){this.solicitudesService.getDocumentsIds(this.requestID).then((e=>{e.data&&this.setDocumentsReports(e.data),this.loadingDocs=!1})).catch((()=>{this.loadingDocs=!1}))}setSubscriptionOfRequest(){if(this.socket)return;let e="wss://notifications.dev.belender.net";"qa"==r.N.env&&(e="wss://notifications.qa.belender.net"),"pro"==r.N.env&&(e="wss://notifications.belender.net"),r.N.notificationsBaseUrl&&(e=r.N.notificationsBaseUrl),this.socket=new WebSocket(`${e}?requests_id=${this.requestID}&user_id=${this.userId}`);var t=this;this.socket.onopen=function(e){console.log("Conexión establecida")},this.socket.onmessage=function(e){let n=JSON.parse(e.data);console.warn(n),n&&t.handlePusherNotification(n)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e),console.error(e)},this.socket.onclose=function(e){console.log("Conexión cerrada")}}handlePusherNotification(e){this.totalDocuments&&this.totalDocuments.forEach((t=>{t.document_name===e.document_name&&(t.document_status_code=e.document_status_code)})),this.cd.markForCheck()}parseDocumentsFromPack(e){let t=[];return e&&e.length&&e.forEach((e=>{t.push({document_name:e,document_status_code:null})})),t}setDocumentsReports(e){e&&e.length&&e.forEach((e=>{this.totalDocuments.forEach((t=>{t.document_name===e.document_name&&(t.document_status_code=e.document_status_code)}))})),this.checkIfAllReported(),this.cd.markForCheck()}checkIfAllReported(){this.totalDocuments.find((e=>!e.document_status_code||"downloaded"!=e.document_status_code))||this.intDocs&&clearInterval(this.intDocs)}fileChange(e){e.preventDefault(),e.stopPropagation();let t=e.target.files[0];this.file=t,this.fileName=t.name;const n=new FormData;n.append("file",t),n.append("request_id",this.requestID),n.append("document_name",this.docName),this.loadingDocs=!0,this.solicitudesService.uploadFileFromWidget(n).then((e=>{console.log("success"),this.setPacksAndDocuments()})).catch((e=>{console.error(e),this.setPacksAndDocuments()}))}setDocumentName(e){this.docName=e}};y.ɵfac=function(e){return new(e||y)(a.Y36(l.qu),a.Y36(c.F),a.Y36(d.M),a.Y36(u.U),a.Y36(a.sBO),a.Y36(h.r))},y.ɵcmp=a.Xpm({type:y,selectors:[["widget-documents"]],inputs:{packId:"packId",requestID:"requestID",userId:"userId",lang:"lang",acceptFiles:"acceptFiles"},features:[a.TTD],decls:7,vars:1,consts:[[1,"px-4","py-3","bg-slate-300/10","rounded-md"],[1,"w-full","flex","mb-4","justify-between","items-center"],[1,"text-xl","font-bold"],[1,"flex","justify-end","items-center"],[1,"flex","gap-1","flex-wrap","items-start","justify-start","w-full","flex-col"],[4,"ngFor","ngForOf"],["class","bg-black/10 items-center w-full h-8 gap-2 pr-4 pl-3 py-1 rounded-sm flex text-xs justify-between",4,"ngIf"],["class","bg-green-500/10 items-center text-green-500 w-full justify-between border border-green-500 gap-2 h-8 font-bold pr-4 pl-3 py-1 rounded-sm flex text-xs ",4,"ngIf"],["class","bg-red-500/10 items-center text-red-500 border border-red-500 gap-2 h-8 font-bold pr-4 pl-3 py-1 rounded-sm flex text-xs justify-between w-full cursor-pointer hover:bg-red-500 hover:text-red-50",3,"click",4,"ngIf"],["hidden","true","onclick","this.value=null","type","file","name","file",3,"accept","change"],["fileInput",""],[1,"bg-black/10","items-center","w-full","h-8","gap-2","pr-4","pl-3","py-1","rounded-sm","flex","text-xs","justify-between"],["color","accent","diameter","12","value","0","mode","indeterminate",1,"spinner"],[1,"bg-green-500/10","items-center","text-green-500","w-full","justify-between","border","border-green-500","gap-2","h-8","font-bold","pr-4","pl-3","py-1","rounded-sm","flex","text-xs"],["svgIcon","mat:check",1,"w-4"],[1,"bg-red-500/10","items-center","text-red-500","border","border-red-500","gap-2","h-8","font-bold","pr-4","pl-3","py-1","rounded-sm","flex","text-xs","justify-between","w-full","cursor-pointer","hover:bg-red-500","hover:text-red-50",3,"click"],["svgIcon","mat:upload",1,"w-4"]],template:function(e,t){1&e&&(a.TgZ(0,"div",0)(1,"div",1)(2,"p",2),a._uU(3,"Documentos: "),a.qZA(),a._UZ(4,"div",3),a.qZA(),a.TgZ(5,"div",4),a.YNc(6,v,6,4,"ng-container",5),a.qZA()()),2&e&&(a.xp6(6),a.Q6J("ngForOf",t.totalDocuments))},dependencies:[p.sg,p.O5,m.Hw,f.Ou]}),y=(0,i.gn)([(0,s.c)()],y)},3033:(e,t,n)=>{n.d(t,{d:()=>l});var i=n(6895),s=n(4006),r=n(7392),o=n(1572),a=n(4650);let l=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=a.oAB({type:e}),e.ɵinj=a.cJS({imports:[i.ez,r.Ps,s.UX,o.Cq]}),e})()},1406:(e,t,n)=>{n.d(t,{Y:()=>u});var i=n(7582),s=n(4650),r=n(9933),o=n(8730),a=n(4006),l=n(8460),c=n(9549),d=n(9101);let u=class{constructor(e,t){this.formBuilder=e,this.customizationStoreService=t,this.file=null,this.acceptFiles="image/png, image/jpeg, image/jpg, .pdf",this.newItemEvent=new s.vpe(null),this.uploadFile=new s.vpe(null),this.toBase64=e=>new Promise(((t,n)=>{const i=new FileReader;i.readAsDataURL(e),i.onload=()=>t(i.result),i.onerror=n}))}ngOnInit(){this.setLabels(),this.customizationStoreService.lang$.pipe((0,r.t)(this)).subscribe((()=>this.setLabels())),this.uploadForm=this.formBuilder.group({file:[""]})}ngOnChanges(e){e.lang&&this.setLabels()}setLabels(){const e=(0,o.S)(this.lang,this.customizationStoreService.LANG);this.selectFileLabel=e.selectFile,this.file||(this.fileName=e.noFileSelected)}fileChange(e){const t=e.target.files[0];this.file=t,this.uploadForm.patchValue({file:t}),this.uploadForm.get("file").updateValueAndValidity();const n=new FormData;let i=this.uploadForm.get("file").value;this.fileName=i.name,this.fileSize=+(+i.size/1e3).toFixed(1),n.append("file",i),this.newItemEvent.emit({file:n}),this.uploadFile.emit(i)}};u.ɵfac=function(e){return new(e||u)(s.Y36(a.qu),s.Y36(l.r))},u.ɵcmp=s.Xpm({type:u,selectors:[["app-file-upload"]],inputs:{label:"label",lang:"lang",acceptFiles:"acceptFiles"},outputs:{newItemEvent:"change",uploadFile:"fileUpload"},features:[s.TTD],decls:11,vars:6,consts:[[1,"flex","flex-col","w-full","items-start","input-file-wrapper","my-1",3,"formGroup"],["hidden","true","onclick","this.value=null","type","file","name","file",3,"accept","change"],["fileInput",""],[1,"flex","items-center","justify-start","mt-3"],["mat-flat-button","","color","accent",1,"btn-file",3,"click"]],template:function(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"form",0)(1,"mat-label"),s._uU(2),s.qZA(),s.TgZ(3,"input",1,2),s.NdJ("change",(function(e){return t.fileChange(e)})),s.qZA(),s.TgZ(5,"div",3)(6,"button",4),s.NdJ("click",(function(){s.CHM(e);const t=s.MAs(4);return s.KtG(t.click())})),s._uU(7),s.qZA(),s._uU(8," "),s.TgZ(9,"span"),s._uU(10),s.qZA()()()}2&e&&(s.Q6J("formGroup",t.uploadForm),s.xp6(2),s.Oqu(t.label),s.xp6(1),s.Q6J("accept",t.acceptFiles),s.xp6(4),s.Oqu(t.selectFileLabel),s.xp6(3),s.AsE("",t.fileName," ",t.fileSize?"("+t.fileSize+"Kb)":"",""))},dependencies:[a._Y,a.JL,a.sg,c.hX,d.lW],styles:["button[aria-pressed=true][_ngcontent-%COMP%]{color:red!important}.btn-file[_ngcontent-%COMP%]{max-width:200px}.input-file-wrapper[_ngcontent-%COMP%]{background:rgba(0,0,0,.0117647059);padding:.7rem .5rem .7rem 1rem;border-radius:5px;border:2px dashed rgba(0,0,0,.1)}"]}),u=(0,i.gn)([(0,r.c)()],u)},8730:(e,t,n)=>{n.d(t,{S:()=>r});var i=n(6390);const s={es:{selectFile:"Seleccionar archivo",noFileSelected:"No se ha seleccionado ningun archivo"},en:{selectFile:"Select file",noFileSelected:"No file selected"},pt:{selectFile:"Selecionar ficheiro",noFileSelected:"Nenhum ficheiro selecionado"},ca:{selectFile:"Seleccionar fitxer",noFileSelected:"No s'ha seleccionat cap fitxer"},it:{selectFile:"Seleziona file",noFileSelected:"Nessun file selezionato"},fr:{selectFile:"Sélectionner un fichier",noFileSelected:"Aucun fichier sélectionné"},de:{selectFile:"Datei auswählen",noFileSelected:"Keine Datei ausgewählt"}};function r(e,t){const n=(0,i.Ry)(e,t);return s[n]||s.es}},969:(e,t,n)=>{n.d(t,{O:()=>d});var i=n(6895),s=n(4006),r=n(9101),o=n(7392),a=n(4144),l=n(7009),c=n(4650);let d=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=c.oAB({type:e}),e.ɵinj=c.cJS({imports:[i.ez,l.ZX,o.Ps,s.UX,a.c,r.ot]}),e})()},4246:(e,t,n)=>{n.d(t,{t:()=>s});var i=n(4650);let s=(()=>{class e{constructor(){this.DNI_REGEX=/^(\d{8})([A-Z])$/,this.CIF_REGEX=/^([ABCDEFGHJKLMNPQRSUVW])(\d{7})([0-9A-J])$/,this.NIE_REGEX=/^[XYZ]\d{7,8}[A-Z]$/}convertObjectArrayToArray(e){return Object.keys(e).map((t=>{const n=e[t];return n.key=t,n}))}ValidateIDType(e){e=e.toUpperCase().replace(/\s/,"");var t=!1,n=this.spainIdType(e);switch(n){case"dni":t=this.validDNI(e);break;case"nie":t=this.validNIE(e)}return{type:n,valid:t}}spainIdType(e){return e.match(this.DNI_REGEX)?"dni":e.match(this.NIE_REGEX)?"nie":void 0}validDNI(e){return"TRWAGMYFPDXBNJZSQVHLCKE".charAt(parseInt(e,10)%23)==e.charAt(8)}validNIE(e){var t=e.charAt(0);switch(t){case"X":t=0;break;case"Y":t=1;break;case"Z":t=2}return this.validDNI(t+e.substr(1))}}return e.ɵfac=function(t){return new(t||e)},e.ɵprov=i.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},6292:(e,t,n)=>{n.r(t),n.d(t,{CertFlowChooserModule:()=>D});var i=n(6895),s=n(5601),r=n(9391),o=n(182),a=n(7367),l=n(3238),c=n(5895),d=n(4246),u=n(5710),h=n(8594),p=n(6e3),m=n(5861),f=n(7582),g=n(9549),_=n(9933),b=n(1135),v=n(4650),y=n(6554),w=n(9728);let x=(()=>{class e{constructor(e,t){this.localFetch=e,this.apiUrlService=t}getPreRequestData(e){return this.localFetch.getFetchWhitoutToken(this.apiUrlService.baseUrl+`/pre-request/cert-flow-chooser/${e}`)}}return e.ɵfac=function(t){return new(t||e)(v.LFG(y.r),v.LFG(w.i))},e.ɵprov=v.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})();var S=n(6209),C=n(8460),T=n(1572);function k(e,t){if(1&e&&(v.TgZ(0,"div",4),v._UZ(1,"mat-progress-spinner",5),v.TgZ(2,"p",6),v._uU(3),v.qZA()()),2&e){const e=v.oxw().ngIf,t=v.oxw();v.xp6(1),v.Q6J("mode",t.spinnerMode)("value",t.spinnerValue),v.xp6(2),v.Oqu(e.loading)}}function M(e,t){if(1&e&&(v.TgZ(0,"div",7)(1,"div",8)(2,"p"),v._uU(3),v.qZA()()()),2&e){const e=v.oxw().ngIf;v.xp6(3),v.Oqu(e.error)}}function I(e,t){if(1&e&&(v.ynx(0),v.YNc(1,k,4,3,"div",2),v.YNc(2,M,4,1,"div",3),v.BQk()),2&e){const e=t.ngIf;v.xp6(1),v.Q6J("ngIf",e.loading&&!e.error),v.xp6(1),v.Q6J("ngIf",e.error)}}let E=class{constructor(e,t,n,i,s){this.certService=e,this.autofirmaDetector=t,this.route=n,this.router=i,this.customizationStore=s,this.state=new b.X({loading:"Verificando datos, espera un momento...",error:null}),this.state$=this.state.asObservable(),this.requestId=null,this.userId=null,this.spinnerMode="indeterminate",this.spinnerValue=0}ngOnInit(){this.requestId=this.route.snapshot.queryParamMap.get("request_id"),this.userId=this.route.snapshot.paramMap.get("user_id"),this.requestId?this.initFlow():this.updateState({error:"Falta el ID de solicitud.",loading:null})}initFlow(){var e=this;return(0,m.Z)((function*(){try{const t=yield e.certService.getPreRequestData(e.requestId),n=t?.data;if("success"!==t?.status||!n)throw new Error("Invalid flow data");e.updateState({loading:"Verificando métodos disponibles..."}),e.userId=e.userId||n.user_id,yield e.resolveBestFlow(n)}catch{e.updateState({error:"No se han podido obtener los datos de certificación.",loading:null})}}))()}resolveBestFlow(e){var t=this;return(0,m.Z)((function*(){const{package_id_video_id:n,package_id_client_certificate:i}=e;return i&&(yield t.autofirmaDetector.getAutofirmaIsInstalled("9881,9882,9883",1e4))?t.redirect("client-certificate",i):n?t.redirect("videoid",n):void t.updateState({error:"No hay métodos de firma compatibles con tu equipo actual.",loading:null})}))()}redirect(e,t){const n=this.router.url.includes("widget-boxed")?"widget-boxed":"widget";this.customizationStore.setPackID(t),this.userId&&this.customizationStore.setUserID(this.userId),this.router.navigate([n,e,this.userId,t],{queryParams:{request_id:this.requestId,acceptTerms:!0}})}updateState(e){this.state.next({...this.state.value,...e})}};E.ɵfac=function(e){return new(e||E)(v.Y36(x),v.Y36(S.L),v.Y36(h.gz),v.Y36(h.F0),v.Y36(C.r))},E.ɵcmp=v.Xpm({type:E,selectors:[["belender-widget-cert-flow-chooser"]],features:[v._Bn([{provide:g.o2,useValue:{appearance:"outline"}}])],decls:3,vars:3,consts:[[1,"h-full","widget-belender"],[4,"ngIf"],["class","loading-wrapper",4,"ngIf"],["class","error-container",4,"ngIf"],[1,"loading-wrapper"],["color","accent","diameter","40",1,"spinner","mx-auto",3,"mode","value"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[1,"error-container"],[1,"px-10","py-6","rounded-md","text-center","bg-orange-500/20","text-orange-600"]],template:function(e,t){1&e&&(v.TgZ(0,"div",0),v.YNc(1,I,3,2,"ng-container",1),v.ALo(2,"async"),v.qZA()),2&e&&(v.xp6(1),v.Q6J("ngIf",v.lcZ(2,1,t.state$)))},dependencies:[i.O5,T.Ou,i.Ov],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative;min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.loading-wrapper[_ngcontent-%COMP%], .error-container[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}"]}),E=(0,f.gn)([(0,_.c)()],E);const A=[{path:":user_id",component:E}];let O=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=v.oAB({type:e}),e.ɵinj=v.cJS({imports:[h.Bz.forChild(A),h.Bz,p.d8]}),e})();var L=n(5028);let D=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=v.oAB({type:e}),e.ɵinj=v.cJS({providers:[s.M,r.o,a.w,o.t,c.T,d.t,u.S,x,{provide:l.Ad,useValue:"es-ES"}],imports:[i.ez,O,L.q]}),e})()},3364:(e,t,n)=>{n.d(t,{R:()=>l});var i=n(4650),s=(n(6866),n(8467)),r=n(8594),o=n(9101),a=n(3731);let l=(()=>{class e{constructor(e,t){this.utils=e,this.Activatedroute=t,this.goFlow=new i.vpe(null),this.goManual=new i.vpe(null)}ngOnInit(){console.error("data: ",this.data)}gotoFlow(){this.goFlow.emit(!0)}gotoManual(){this.goManual.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(i.Y36(s.F),i.Y36(r.gz))},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-intro-step"]],inputs:{data:"data",solicitud:"solicitud",flowName:"flowName"},outputs:{goFlow:"gotoFlow",goManual:"gotoManual"},decls:10,vars:18,consts:[[1,"flex","flex-col","justify-between","h-full","fixed-content"],[1,"flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-2"],["mat-flat-button","","type","button",1,"px-8","bg-slate-100","hover:bg-slate-200","text-slate-900",3,"click"],["mat-flat-button","","type","button",1,"px-8","hover:opacity-90",3,"click"]],template:function(e,t){1&e&&(i.TgZ(0,"div",0)(1,"div",1),i._UZ(2,"div",2)(3,"div",3),i.ALo(4,"safeHtml"),i.qZA(),i.TgZ(5,"div",4)(6,"button",5),i.NdJ("click",(function(){return t.gotoManual()})),i._uU(7,"Subida manual"),i.qZA(),i.TgZ(8,"button",6),i.NdJ("click",(function(){return t.gotoFlow()})),i._uU(9,"Subida automatica"),i.qZA()()()),2&e&&(i.xp6(2),i.Udp("color",t.data.styles.colors.title)("font-size",t.data.intro?t.data.intro.titleSize+"px":"30px"),i.Q6J("innerHTML",t.data.intro?t.data.intro.title:"Intro de descripción",i.oJD),i.xp6(1),i.Udp("color",t.data.styles.colors.text),i.Q6J("innerHTML",t.data.intro?t.data.intro.description:i.lcZ(4,16,"Descripcion de la intro"),i.oJD),i.xp6(3),i.Udp("border-radius",t.data.styles.btnRound+"px"),i.xp6(2),i.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"))},dependencies:[o.lW,a.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.dont-show-data[_ngcontent-%COMP%]{opacity:0!important;padding:0!important;overflow:hidden!important;height:0px!important;margin:0!important}"]}),e})()},8962:(e,t,n)=>{n.d(t,{A:()=>C});var i=n(6895),s=n(9101),r=n(1561),o=n(4006),a=n(5601),l=n(3798),c=n(9391),d=n(1572),u=n(182),h=n(4144),p=n(7367),m=n(9602),f=n(3238),g=n(5895),_=n(6257),b=n(1948),v=n(4246),y=n(6981),w=n(1129),x=n(9476),S=n(4650);let C=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=S.oAB({type:e}),e.ɵinj=S.cJS({providers:[a.M,c.o,p.w,u.t,g.T,v.t],imports:[i.ez,s.ot,r.Tx,h.c,o.u5,o.UX,l.a,d.Cq,m.FA,f.XK,_.T5,b.Fk,y.x,w.n,x.F]}),e})()},1760:(e,t,n)=>{n.d(t,{u:()=>T});var i=n(4650),s=(n(6866),n(4006)),r=n(8135),o=n(8467),a=n(9391),l=n(8594),c=n(9617),d=n(5895),u=n(2254),h=n(5601),p=n(6895),m=n(9101),f=n(9549),g=n(4144),_=n(8008),b=n(1406),v=n(3731);function y(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"form",1)(1,"div",2),i._UZ(2,"div",3)(3,"div",4),i.ALo(4,"safeHtml"),i.qZA(),i.TgZ(5,"div",5)(6,"div",6)(7,"mat-form-field",7)(8,"mat-label"),i._uU(9,"DNI / NIE"),i.qZA(),i._UZ(10,"input",8),i.qZA()()(),i.TgZ(11,"div",9)(12,"button",10),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw();return i.KtG(t.goBack())})),i._uU(13," Volver "),i.qZA(),i.TgZ(14,"button",11),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw();return i.KtG(t.gotoStep2())})),i._uU(15," Siguiente "),i.qZA()()()}if(2&e){const e=i.oxw();i.Q6J("formGroup",e.formDni),i.xp6(2),i.Udp("color",e.data.styles.colors.title)("font-size",e.data.Manual?e.data.Manual.titleSize+"px":"30px"),i.Q6J("innerHTML",e.data.Manual?e.data.Manual.title:"Manual de descripción",i.oJD),i.xp6(1),i.Udp("color",e.data.styles.colors.text),i.Q6J("innerHTML",e.data.Manual?e.data.Manual.description:i.lcZ(4,18,"Descripcion de la subida manual"),i.oJD),i.xp6(9),i.Udp("border-radius",e.data.styles.btnRound+"px"),i.xp6(2),i.Udp("color",e.formDni.invalid?"":e.data.styles.colors.btnText)("background",e.formDni.invalid?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),i.Q6J("disabled",e.formDni.invalid)}}function w(e,t){if(1&e){const e=i.EpF();i.ynx(0),i.TgZ(1,"app-file-upload",15),i.NdJ("fileUpload",(function(t){const n=i.CHM(e).$implicit,s=i.oxw(3);return i.KtG(s.setFile(n,t))})),i.qZA(),i.BQk()}if(2&e){const e=t.$implicit;i.xp6(1),i.s9C("label",e)}}function x(e,t){if(1&e&&(i.TgZ(0,"div",5),i.YNc(1,w,2,1,"ng-container",14),i.qZA()),2&e){const e=i.oxw(2);i.xp6(1),i.Q6J("ngForOf",e.pack.documents)}}function S(e,t){1&e&&(i.TgZ(0,"div",16),i._UZ(1,"belender-spinner",17),i.qZA()),2&e&&(i.xp6(1),i.Q6J("zoom",.6))}function C(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"form",1)(1,"div",2),i._UZ(2,"div",3)(3,"div",4),i.ALo(4,"safeHtml"),i.qZA(),i.YNc(5,x,2,1,"div",12),i.YNc(6,S,2,1,"div",13),i.TgZ(7,"div",9)(8,"button",10),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw();return i.KtG(t.goBack())})),i._uU(9," Volver "),i.qZA(),i.TgZ(10,"button",11),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw();return i.KtG(t.uploadFiles())})),i._uU(11," Subir archivos "),i.qZA()()()}if(2&e){const e=i.oxw();i.Q6J("formGroup",e.form),i.xp6(2),i.Udp("color",e.data.styles.colors.title)("font-size",e.data.Manual?e.data.Manual.titleSize+"px":"30px"),i.Q6J("innerHTML",e.data.Manual?e.data.Manual.title:"Manual de descripción",i.oJD),i.xp6(1),i.Udp("color",e.data.styles.colors.text),i.Q6J("innerHTML",e.data.Manual?e.data.Manual.description:i.lcZ(4,20,"Descripcion de la subida manual"),i.oJD),i.xp6(2),i.Q6J("ngIf",e.pack&&!e.loadingPack),i.xp6(1),i.Q6J("ngIf",e.loadingPack),i.xp6(2),i.Udp("border-radius",e.data.styles.btnRound+"px"),i.xp6(2),i.Udp("color",e.form.invalid?"":e.data.styles.colors.btnText)("background",e.form.invalid?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),i.Q6J("disabled",e.form.invalid)}}let T=(()=>{class e{constructor(e,t,n,s,r,o,a,l,c){this.smsComponent=e,this.fb=t,this.utils=n,this.attachmentsS=s,this.ar=r,this.packsS=o,this.notis=a,this.smsFlowService=l,this.solicitudesService=c,this.upload=new i.vpe(null),this.back=new i.vpe(null),this.sendDNI=new i.vpe(null),this.loadingPack=!1,this.step=1}ngOnInit(){this.form=this.fb.group({}),console.warn("data: ",this.data),this.loadingPack=!0,this.packsS.getPackagesByUserID(this.userId).then((e=>{console.warn(e),e&&e.data?this.setPack(e.data):this.loadingPack=!1})).catch((e=>{console.error(e),this.loadingPack=!1})),this.formDni=this.fb.group({dni:[null,[s.kI.required,s.kI.maxLength(9)]]}),console.error(this.smsFlowService.REQUEST),this.smsFlowService.REQUEST&&this.smsFlowService.REQUEST.request_id&&(this.step=2)}setRequestStep(){}gotoStep2(){"SMS"===this.flowName?this.createSmsRequestFromDNI(this.formDni.get("dni").value):this.sendDNI.emit(this.formDni.get("dni").value)}setPack(e){this.pack=e.find((e=>e.id==this.packId)),this.loadingPack=!1,this.setForm()}setForm(){this.pack&&this.pack.documents&&this.pack.documents.forEach((e=>{this.form.addControl(e,new s.NI("",s.kI.required))}))}uploadFiles(){this.upload.emit(!0)}goBack(){"SMS"===this.flowName?this.smsComponent.manual=!1:this.back.emit(!0)}fileChange(e){e.preventDefault(),e.stopPropagation()}setFile(e,t){const n=new FormData;n.append("file",t),n.append("request_id",this.smsFlowService.REQUEST.request_id),n.append("document_name",e),this.notis.showToast("Subiendo documento: "+e,6e3,"info"),this.attachmentsS.uploadFile(n).then((n=>{n&&n.status&&"error"!=n.status?(this.form.get(e).setValue(t),this.notis.showToast("Documento "+e+" subido correctamente",4e3,"success")):n&&n.status&&"error"==n.status&&this.notis.showToast("El documento "+e+" no se ha podido subir: "+n.message,4e3,"error")})).catch((t=>{console.error(t),this.notis.showToast("El documento "+e+" no se ha podido subir: "+t,4e3,"error")}))}createSmsRequestFromDNI(e){let t={document_number:e,user_id:this.userId,package_id:this.packId,check_legal:!0};this.solicitudesService.addSolicitud(t).then((e=>{e&&e.status&&"error"==e.status?(this.smsFlowService.setRequest(t),e.message&&(400==e.code?"Birthdate incorrect"==e.message?(this.smsComponent.setRequestStatus("form"),this.smsComponent.showAlert(this.labels.warnings.wrongDate,this.labels.warnings.wrongDateDesc)):"Incorrect date"==e.message?(this.smsComponent.setRequestStatus("form"),this.smsComponent.showAlert(this.labels.warnings.error,this.labels.warnings.wrongDate)):(this.smsComponent.setRequestStatus("no_service"),this.smsFlowService.setLoading(!1)):(this.smsComponent.setRequestStatus("form"),this.smsComponent.showAlert("Error!",e.message))),this.smsComponent.setStatus()):e&&e.status&&"success"==e.status?(this.smsFlowService.updateRequestID(e.data.request_id),this.smsFlowService.setRequest(e.data),this.smsComponent.setStatus(),this.smsFlowService.setSubscriptionOfRequest(),this.smsFlowService.sendMessageToParent({type:"response",data:e.data}),this.smsComponent.acceptTerms()):this.smsComponent.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+e)})).catch((e=>{e&&e.error&&this.smsComponent.showAlert("Error!",e.error),this.smsFlowService.setLoading(!1)}))}}return e.ɵfac=function(t){return new(t||e)(i.Y36(r.T,9),i.Y36(s.QS),i.Y36(o.F),i.Y36(a.o),i.Y36(l.gz),i.Y36(c.U),i.Y36(d.T),i.Y36(u.p),i.Y36(h.M))},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-manual-step"]],inputs:{data:"data",flowName:"flowName",packId:"packId",userId:"userId",labels:"labels"},outputs:{upload:"uploadFiles",back:"goBack",sendDNI:"dniChange"},decls:2,vars:2,consts:[["class","flex flex-col justify-between h-full fixed-content",3,"formGroup",4,"ngIf"],[1,"flex","flex-col","justify-between","h-full","fixed-content",3,"formGroup"],[1,"flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"py-4"],[1,"w-full"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["maxlength","9","formControlName","dni","type","text","placeholder","Ingresa tu DNI o NIE","matInput",""],[1,"flex","items-center","justify-end","gap-2","p-2"],["mat-flat-button","","type","button",1,"px-8","bg-slate-100","hover:bg-slate-200","text-slate-900",3,"click"],["mat-flat-button","","type","button",1,"px-8","hover:opacity-90",3,"disabled","click"],["class","py-4",4,"ngIf"],["class","py-10 px-4",4,"ngIf"],[4,"ngFor","ngForOf"],[3,"label","fileUpload"],[1,"py-10","px-4"],["text","Cargando documentos",3,"zoom"]],template:function(e,t){1&e&&(i.YNc(0,y,16,20,"form",0),i.YNc(1,C,12,22,"form",0)),2&e&&(i.Q6J("ngIf",1==t.step),i.xp6(1),i.Q6J("ngIf",2==t.step))},dependencies:[p.sg,p.O5,m.lW,f.KE,f.hX,g.Nt,s._Y,s.Fj,s.JJ,s.JL,s.nD,s.sg,s.u,_.O,b.Y,v.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.dont-show-data[_ngcontent-%COMP%]{opacity:0!important;padding:0!important;overflow:hidden!important;height:0px!important;margin:0!important}"]}),e})()},3468:(e,t,n)=>{n.d(t,{f:()=>T});var i=n(6895),s=n(9101),r=n(1561),o=n(4006),a=n(5601),l=n(3798),c=n(9391),d=n(1572),u=n(182),h=n(4144),p=n(7367),m=n(9602),f=n(3238),g=n(5895),_=n(6257),b=n(1948),v=n(4246),y=n(6981),w=n(1129),x=n(9476),S=n(969),C=n(4650);let T=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=C.oAB({type:e}),e.ɵinj=C.cJS({providers:[a.M,c.o,p.w,u.t,g.T,v.t],imports:[i.ez,s.ot,r.Tx,h.c,o.u5,o.UX,l.a,d.Cq,m.FA,f.XK,_.T5,b.Fk,y.x,w.n,x.F,S.O]}),e})()},5967:(e,t,n)=>{n.r(t),n.d(t,{PersonalModule:()=>St});var i=n(6895),s=n(6383),r=n(5592),o=n(8739),a=n(7155),l=n(6308),c=n(6709),d=n(7392),u=n(9101),h=n(1561),p=n(4006),m=n(266),f=n(4385),g=n(811),_=n(5601),b=n(3798),v=n(9391),y=n(1572),w=n(182),x=n(4144),S=n(7367),C=n(9602),T=n(3238),k=n(5895),M=n(6257),I=n(1948),E=n(4246),A=n(8594),O=n(6e3),L=n(5861),D=n(7582),P=n(9549),N=n(9933),q=n(5762),R=n(8259),Y=n(2340),F=n(1363),U=n(6305),Z=n(1931);const H={created:"form",form:"form",terms_and_conditions:"form",widget_opened:"form",prerequest:"form",waiting_terms_and_conditions:"form",waiting_login:"loading",saved_otp:"loading",waiting_otp:"otp",invalid_otp:"otp",waiting_otp_seguridad_social:"otp",invalid_otp_seguridad_social:"otp",waiting_login_seguridad_social:"loading",waiting_password:"password",abandoned_after_bad_phone:"abandoned",abandoned_after_invalid_otp:"abandoned",abandoned_after_terms_and_conditions:"abandoned",abandoned_after_waiting_otp:"abandoned",all_documents_downloaded:"success",certificate_created:"success",partial_documents_downloaded:"success",waiting_certificate:"success",consent_process_completed:"success",success_otp:"success",otp_success:"success",waiting_documents:"success",partial_documents_downloaded_and_deleted:"success",all_documents_downloaded_and_deleted:"success",bad_phone:"error-data",phone_not_exist_otp:"error-data",failed_with_retry:"failed",failed_without_retry:"failed",failed_documents_downloaded:"failed",failed_login_otp:"failed",consent_process_canceled:"failed",no_service:"no-service",no_known_client_service:"no-service"};var j=n(4650),z=n(8467),B=n(8460),J=n(6554),V=n(9728);let Q=(()=>{class e{constructor(e,t,n,i){this.utils=e,this.localFetch=t,this.solicitudesService=n,this.apiUrlService=i}addSolicitud(e){return new Promise(((t,n)=>{this.localFetch.postFileFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/known-client",e).then((e=>{e?(this.solicitudesService.markRequestOpenedIfNeeded(e),t(e)):n(e)})).catch((e=>{n(e)}))}))}addFiles(e){return new Promise(((t,n)=>{this.localFetch.postFile(this.apiUrlService.baseUrl+"/requests/known-client/upload-files",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}acceptTerms(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/known-client/terms",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendOtp(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/known-client/otp",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendPassword(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/known-client/password",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}preRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/pre-request/known-client",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendOTP(e){return new Promise(((t,n)=>{let i="/requests/known-client/otp";Y.N.scraperMock&&(i="/mockscrapper/requests/known-client/otp"),this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+i,e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}}return e.ɵfac=function(t){return new(t||e)(j.LFG(z.F),j.LFG(J.r),j.LFG(_.M),j.LFG(V.i))},e.ɵprov=j.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})();var W=n(5412),G=n(7308),$=n(1135);let K=(()=>{class e{constructor(e){this.customizationStoreService=e,this.labels=Z.S.es,this.socket=null,this.currentHeight=0,this._request=new $.X({...new q.l,status_code:"created"}),this._request_status=new $.X(null),this.request$=this._request.asObservable(),this.request_status$=this._request_status.asObservable()}setGlobalVariables(){this.REQUEST=this._request.value,this.REQUEST_STATUS=this.REQUEST?.status_code,this.REQUEST_ID=this.REQUEST?.request_id,this._request_status.next(this.REQUEST_STATUS)}setRequest(e){this._request.next({...e}),this.setGlobalVariables()}patch(e){this._request.next({...this._request.value,...e}),this.setGlobalVariables()}setRequestStatus(e){this._request.next({...this._request.value,status_code:e}),this.setGlobalVariables()}setRequestID(e){this._request.next({...this._request.value,request_id:e}),this.setGlobalVariables()}updateRequestID(e){this.REQUEST_ID=e,this.setRequestID(e)}subscribeWS(e){if(this.socket)return;const t=e||this.REQUEST_ID||this._request.value?.request_id;if(!t)return;let n="wss://notifications.dev.belender.net";"qa"==Y.N.env&&(n="wss://notifications.qa.belender.net"),"pro"==Y.N.env&&(n="wss://notifications.belender.net"),Y.N.notificationsBaseUrl&&(n=Y.N.notificationsBaseUrl),this.socket=new WebSocket(`${n}?requests_id=${t}&user_id=${this.customizationStoreService.USER_ID}`);const i=this;this.socket.onopen=function(){console.log("Conexión establecida")},this.socket.onmessage=function(e){const t=JSON.parse(e.data);i.handlePusherNotification(t)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e),console.error(e)},this.socket.onclose=function(){console.log("Conexión cerrada"),i.socket=null}}handlePusherNotification(e){if(!e||w.t.shouldIgnoreWebhookStatus(e.status_code))return;this.sendMessageToParent({type:"websocket",data:e}),console.warn("message from ws: ",e);const t=e.status_code;if(t){if(t.startsWith("failed"))return this.disconnectWebsocket(),void this.setRequestStatus(t);if(t.startsWith("abandoned"))return this.disconnectWebsocket(),void this.setRequestStatus(t);if("consent_process_completed"===t)return this.disconnectWebsocket(),void this.patch({status_code:t});this.patch({status_code:t})}}sendMessageToParent(e){if(e&&e.type&&"widgetHeight"===e.type){if(e.data===this.currentHeight)return;this.currentHeight=e.data}console.log("Message to parent:",e),window.top.postMessage(e,"*")}disconnectWebsocket(){this.socket&&this.socket.close(),this.socket=null}}return e.ɵfac=function(t){return new(t||e)(j.LFG(B.r))},e.ɵprov=j.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})();var X=n(6830),ee=n(833),te=n(4302),ne=n(8429),ie=n(3731);function se(e,t){if(1&e&&(j.TgZ(0,"span"),j._uU(1),j.qZA()),2&e){const e=j.oxw(2);j.xp6(1),j.HOy("",e.labels.otp.noReceivedCode," ",e.labels.certificate.requestAgainIn," ",e.secsCount," ",e.labels.certificate.seconds,"")}}function re(e,t){if(1&e&&(j.TgZ(0,"span"),j._uU(1),j.qZA()),2&e){const e=j.oxw(2);j.xp6(1),j.xDo("",e.labels.otp.noReceivedCode2," ",e.lastNumberPhone,"? ",e.labels.certificate.requestAgainIn," ",e.secsCount," ",e.labels.certificate.seconds,"")}}function oe(e,t){if(1&e&&(j.TgZ(0,"span"),j._uU(1),j.qZA()),2&e){const e=j.oxw(2);j.xp6(1),j.HOy("",e.labels.otp.noReceivedCode," ",e.labels.certificate.requestAgainIn," ",e.secsCount," ",e.labels.certificate.seconds,"")}}const ae=function(e,t,n){return{color:e,border:t,background:n}};function le(e,t){if(1&e&&(j.ynx(0),j.TgZ(1,"small",12),j.YNc(2,se,2,4,"span",6),j.YNc(3,re,2,5,"span",6),j.YNc(4,oe,2,4,"span",6),j.qZA(),j.BQk()),2&e){const e=j.oxw();j.xp6(1),j.Q6J("ngStyle",j.kEZ(4,ae,e.data.styles.colors.accentColor,"1px solid "+e.data.styles.colors.accentColor,e.data.styles.colors.accentBgColor)),j.xp6(1),j.Q6J("ngIf",!e.lastNumberPhone),j.xp6(1),j.Q6J("ngIf",e.lastNumberPhone&&!e.data.config.noRetryInBadPhone),j.xp6(1),j.Q6J("ngIf",e.lastNumberPhone&&e.data.config.noRetryInBadPhone)}}function ce(e,t){if(1&e&&(j.TgZ(0,"span"),j._uU(1),j.qZA()),2&e){const e=j.oxw(2);j.xp6(1),j.hij(" ",e.labels.otp.noReceivedCode," ")}}function de(e,t){if(1&e&&(j.TgZ(0,"span"),j._uU(1),j.qZA()),2&e){const e=j.oxw(2);j.xp6(1),j.AsE(" ",e.labels.otp.noReceivedCode2," ",e.lastNumberPhone,"? ")}}function ue(e,t){if(1&e&&(j.TgZ(0,"span"),j._uU(1),j.qZA()),2&e){const e=j.oxw(2);j.xp6(1),j.hij(" ",e.labels.otp.noReceivedCode," ")}}const he=function(e,t){return{color:e,background:t}};function pe(e,t){if(1&e){const e=j.EpF();j.ynx(0),j.TgZ(1,"small",12),j.YNc(2,ce,2,1,"span",6),j.YNc(3,de,2,2,"span",6),j.YNc(4,ue,2,1,"span",6),j.TgZ(5,"a",13),j.NdJ("click",(function(){j.CHM(e);const t=j.oxw();return j.KtG(t.resendOTP())})),j._uU(6),j.qZA()(),j.BQk()}if(2&e){const e=j.oxw();j.xp6(1),j.Q6J("ngStyle",j.kEZ(6,ae,e.data.styles.colors.dangerColor,"1px solid "+e.data.styles.colors.dangerColor,e.data.styles.colors.dangerBgColor)),j.xp6(1),j.Q6J("ngIf",!e.lastNumberPhone),j.xp6(1),j.Q6J("ngIf",e.lastNumberPhone&&!e.data.config.noRetryInBadPhone),j.xp6(1),j.Q6J("ngIf",e.data.config.noRetryInBadPhone),j.xp6(1),j.Q6J("ngStyle",j.WLB(10,he,e.data.styles.colors.dangerTextButtonColor,e.data.styles.colors.dangerColor)),j.xp6(1),j.Oqu(e.labels.actions.resend)}}let me=(()=>{class e{constructor(e,t,n,i){this.fb=e,this.utils=t,this.solucitudesService=n,this.activeRoute=i,this.next=new j.vpe(null),this.errPhone=new j.vpe(null),this.resendO=new j.vpe(null),this.labels=Z.S.es,this.secsCount=60,this.lastNumberPhone="XXX"}ngOnInit(){this.form=this.fb.group({code1:[null,[p.kI.required,p.kI.maxLength(6),p.kI.minLength(6)]]}),this.initSecsInterval(),this.activeRoute.queryParams.subscribe((e=>{e&&e.request_id&&(this.requestID=e.request_id)}),(e=>{console.error(e)})),this.solicitud&&this.solicitud.person_phone&&this.setPhone(this.solicitud.person_phone)}setPhone(e){let t="XXX";e&&(t=(""+e).slice(-3)),this.lastNumberPhone=t}initSecsInterval(){this.interv=setInterval((()=>{this.secsCount--,this.secsCount<=0&&this.finishSecsInterval()}),1e3)}finishSecsInterval(){this.interv&&clearInterval(this.interv)}nextStep(){let e={code:this.getCode()};this.next.emit(e)}getCode(){return this.form.get("code1").value}capturePasteEvent(e){return(0,L.Z)((function*(){}))()}errorStep(){this.errPhone.emit(!0)}setInputEvent(e){""!=e.target.value?R(e.target).next().focus():"Backspace"==e.code&&R(e.target).prev().focus()}resendOTP(){this.resendO.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(j.Y36(p.QS),j.Y36(z.F),j.Y36(_.M),j.Y36(A.gz))},e.ɵcmp=j.Xpm({type:e,selectors:[["belender-otp-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud",labels:"labels"},outputs:{next:"nextStep",errPhone:"errorPhone",resendO:"resendOTP"},decls:17,vars:24,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"title","py-2"],[4,"ngIf"],[1,"flex","gap-2","items-center","justify-start","w-full","max-w-[200px]"],["appearance","outline",1,"w-full","flex-1"],["tabindex","1","maxlength","6","minlength","1","formControlName","code1","type","text","matInput","",3,"change","keyup"],[1,"flex","items-center","justify-end","gap-2","p-4"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"info-time","w-fit",3,"ngStyle"],[1,"ml-4",3,"ngStyle","click"]],template:function(e,t){1&e&&(j._UZ(0,"belender-widget-step-logo",0),j.TgZ(1,"form",1)(2,"div",2),j._UZ(3,"div",3)(4,"div",4),j.ALo(5,"safeHtml"),j.TgZ(6,"div",5),j.YNc(7,le,5,8,"ng-container",6),j.YNc(8,pe,7,13,"ng-container",6),j.qZA(),j.TgZ(9,"div",7)(10,"mat-form-field",8)(11,"mat-label"),j._uU(12),j.qZA(),j.TgZ(13,"input",9),j.NdJ("change",(function(e){return t.capturePasteEvent(e)}))("keyup",(function(e){return t.setInputEvent(e)})),j.qZA()()()(),j.TgZ(14,"div",10)(15,"button",11),j.NdJ("click",(function(){return t.nextStep()})),j._uU(16),j.qZA()()()),2&e&&(j.Q6J("data",t.data)("customImage",t.texts.otp.customImage),j.xp6(1),j.Q6J("formGroup",t.form),j.xp6(2),j.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),j.Q6J("innerHTML",t.texts.otp.title,j.oJD),j.xp6(1),j.Udp("color",t.data.styles.colors.text),j.Q6J("innerHTML",j.lcZ(5,22,t.texts.otp.description||""),j.oJD),j.xp6(3),j.Q6J("ngIf",t.secsCount&&t.secsCount>0),j.xp6(1),j.Q6J("ngIf",!t.secsCount||t.secsCount<=0),j.xp6(4),j.Oqu(t.labels.otp.otpCode),j.xp6(3),j.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),j.Q6J("disabled",t.form.invalid),j.xp6(1),j.Oqu(t.labels.actions.next))},dependencies:[i.O5,i.PC,u.lW,P.KE,P.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.nD,p.sg,p.u,ne.y,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function fe(e,t){if(1&e&&(j.TgZ(0,"div",2),j._UZ(1,"div",3)(2,"div",4),j.ALo(3,"safeHtml"),j.qZA()),2&e){const e=j.oxw();j.xp6(1),j.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),j.Q6J("innerHTML",e.texts.success.title,j.oJD),j.xp6(1),j.Udp("color",e.data.styles.colors.text),j.Q6J("innerHTML",j.lcZ(3,8,e.texts.success.description||""),j.oJD)}}let ge=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.labels=Z.S.es}ngOnInit(){}save(){}}return e.ɵfac=function(t){return new(t||e)(j.Y36(p.QS),j.Y36(z.F),j.Y36(_.M),j.Y36(v.o),j.Y36(k.T))},e.ɵcmp=j.Xpm({type:e,selectors:[["belender-success-step"]],inputs:{data:"data",texts:"texts",labels:"labels"},decls:2,vars:3,consts:[[3,"data","customImage"],["class"," pt-4 pb-8 flex flex-col animated fadeIn",4,"ngIf"],[1,"pt-4","pb-8","flex","flex-col","animated","fadeIn"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&(j._UZ(0,"belender-widget-step-logo",0),j.YNc(1,fe,4,10,"div",1)),2&e&&(j.Q6J("data",t.data)("customImage",t.texts.success.customImage),j.xp6(1),j.Q6J("ngIf",!t.data.config.infiniteLoopInCompleted))},dependencies:[i.O5,ne.y,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function _e(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"div",6)(1,"button",7),j.NdJ("click",(function(){j.CHM(e);const t=j.oxw();return j.KtG(t.retry())})),j._uU(2),j.qZA()()}if(2&e){const e=j.oxw();j.xp6(1),j.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),j.xp6(1),j.Oqu(e.labels.actions.retry)}}function be(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"div",6)(1,"button",8),j.NdJ("click",(function(){j.CHM(e);const t=j.oxw();return j.KtG(t.newRequest())})),j._uU(2),j.qZA()()}if(2&e){const e=j.oxw();j.xp6(1),j.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),j.xp6(1),j.Oqu(e.labels.certificate.createNewRequest)}}let ve=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.labels=Z.S.es,this.retryOp=new j.vpe(null),this.newReq=new j.vpe(null)}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}newRequest(){this.newReq.emit(this.solicitud.request_id)}getIfRetryIsAllowed(){return"failed_with_retry"==this.solicitud}getIfNewRequestIsAllowed(){return"failed_documents_downloaded"==this.solicitud}}return e.ɵfac=function(t){return new(t||e)(j.Y36(p.QS),j.Y36(z.F),j.Y36(_.M),j.Y36(v.o),j.Y36(k.T))},e.ɵcmp=j.Xpm({type:e,selectors:[["belender-fail-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud",labels:"labels"},outputs:{retryOp:"retry",newReq:"newRequest"},decls:8,vars:10,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"text-red-500","title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","flex items-center justify-end gap-2 p-4",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8",3,"click"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(j._UZ(0,"belender-widget-step-logo",0),j.TgZ(1,"div",1)(2,"div",2),j._UZ(3,"div",3)(4,"div",4),j.ALo(5,"safeHtml"),j.qZA(),j.YNc(6,_e,3,7,"div",5),j.YNc(7,be,3,7,"div",5),j.qZA()),2&e&&(j.Q6J("data",t.data)("customImage",t.texts.fail.customImage),j.xp6(3),j.Q6J("innerHTML",t.texts.fail.title,j.oJD),j.xp6(1),j.Udp("color",t.data.styles.colors.text),j.Q6J("innerHTML",j.lcZ(5,8,t.texts.fail.description),j.oJD),j.xp6(2),j.Q6J("ngIf",t.solicitud&&"failed_with_retry"==t.solicitud.status_code),j.xp6(1),j.Q6J("ngIf",t.solicitud&&"failed_documents_downloaded"==t.solicitud.status_code))},dependencies:[i.O5,u.lW,ne.y,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();n(6866);var ye=n(769),we=n(1763),xe=n(5696);const Se=["termsCheckbox"],Ce=["policyCheckbox"],Te=["termsCertCheckbox"],ke=["assignmentCheckbox"];function Me(e,t){if(1&e&&(j.TgZ(0,"mat-error"),j._uU(1),j.qZA()),2&e){const e=j.oxw(2);j.xp6(1),j.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.requiredEmail," ")}}function Ie(e,t){if(1&e&&(j.TgZ(0,"mat-error"),j._uU(1),j.qZA()),2&e){const e=j.oxw(2);j.xp6(1),j.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.invalidEmail," ")}}function Ee(e,t){if(1&e&&(j.TgZ(0,"div",16)(1,"mat-form-field",17)(2,"mat-label"),j._uU(3),j.qZA(),j._UZ(4,"input",18),j.YNc(5,Me,2,1,"mat-error",19),j.YNc(6,Ie,2,1,"mat-error",19),j.qZA()()),2&e){const e=j.oxw();let t,n;j.xp6(3),j.Oqu(e.labels.email),j.xp6(1),j.Q6J("placeholder",e.labels.inputEmail),j.uIk("aria-label",e.labels.email),j.xp6(1),j.Q6J("ngIf",null==(t=e.form.get("email"))?null:t.hasError("required")),j.xp6(1),j.Q6J("ngIf",null==(n=e.form.get("email"))?null:n.hasError("email"))}}function Ae(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"div",9)(1,"belender-checkbox",20,21),j.NdJ("changeCheckbox",(function(t){j.CHM(e);const n=j.oxw();return j.KtG(n.setTerms(t))})),j.TgZ(3,"belender-terms-and-policy-links",22),j.NdJ("goToTerms",(function(){j.CHM(e);const t=j.oxw();return j.KtG(t.gotoTermsAndConditions())})),j.qZA()()()}if(2&e){const e=j.oxw();j.xp6(1),j.Q6J("color",e.data.styles.colors.title),j.xp6(2),j.Q6J("lang",e.lang)("userId",e.userId)("linkType","terms")("firstSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.firstSentence)("secondSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.secondSentence)("thirdSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.thirdSentence)("policyActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.policyActionText)("termsActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.termsActionText)("customTerms",e.data[e.flowName].customTerms)}}function Oe(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"div",9)(1,"belender-checkbox",23,24),j.NdJ("changeCheckbox",(function(t){j.CHM(e);const n=j.oxw();return j.KtG(n.setPolicy(t))})),j._UZ(3,"belender-terms-and-policy-links",25),j.qZA()()}if(2&e){const e=j.oxw();j.xp6(1),j.Q6J("color",e.data.styles.colors.title),j.xp6(2),j.Q6J("lang",e.lang)("userId",e.userId)("linkType","policy")("flowName",e.flowName)("data",e.data)("policyActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.policyActionText)}}function Le(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"div",26)(1,"belender-checkbox",10),j.NdJ("changeCheckbox",(function(t){j.CHM(e);const n=j.oxw();return j.KtG(n.setPower(t))})),j._uU(2),j.TgZ(3,"a",12),j.NdJ("click",(function(t){j.CHM(e);const n=j.oxw();return j.KtG(n.gotoPowerConditions(t))})),j.TgZ(4,"u"),j._uU(5),j.qZA()()()()}if(2&e){const e=j.oxw();j.xp6(1),j.Q6J("color",e.data.styles.colors.title),j.xp6(1),j.hij(" ",e.labels.certificate.powerConsentBefore,""),j.xp6(3),j.Oqu(e.labels.certificate.powerConsentHere)}}function De(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"div",9)(1,"belender-checkbox",10,27),j.NdJ("changeCheckbox",(function(t){j.CHM(e);const n=j.oxw();return j.KtG(n.setAssignment(t))})),j._UZ(3,"div",28),j.qZA()()}if(2&e){const e=j.oxw();j.xp6(1),j.Q6J("color",e.data.styles.colors.title),j.xp6(2),j.Q6J("innerHTML",(null==e.data[e.flowName]||null==e.data[e.flowName].texts?null:e.data[e.flowName].texts.dataAssignmentText)||(null==e.data[e.flowName]||null==e.data[e.flowName].config_translate?null:e.data[e.flowName].config_translate.dataAssignmentText)||(null==e.data||null==e.data.config?null:e.data.config.dataAssignmentText)||"",j.oJD)}}function Pe(e,t){if(1&e&&(j.TgZ(0,"div",29),j._UZ(1,"mat-icon",30),j._uU(2),j.qZA()),2&e){const e=j.oxw();j.xp6(2),j.hij(" ",e.labels.warnings.haveToReadTerms," ")}}const Ne={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let qe=(()=>{class e{constructor(e,t){this.utils=e,this.fb=t,this.requestID=null,this.labels=Z.S.es,this.lang="",this.next=new j.vpe(null),this.goTerms=new j.vpe(null),this.goTermsCert=new j.vpe(null),this.goPower=new j.vpe(null),this.acceptTerms=!1,this.acceptPolicy=!1,this.acceptTerms2=!1,this.termsReaded=!1,this.terms2Readed=!1,this.step=0,this.assignment=!1,this.powerActivate=!1,this.submitAttempted=!1}ngOnInit(){this.setForm(this.solicitud?this.solicitud:null)}tabChanged(e){this.step=e,this.setForm(null)}setForm(e){let t=e?e.person_email||e.email:null;this.form=this.fb.group(this.data.config.followMail?{email:[t,[p.kI.required,p.kI.email]]}:{email:[t]})}setTermsCheck(e){this.checkComponent.checked=e,this.acceptTerms=e}setTerms2Check(e){this.certCheckComponent.checked=e,this.acceptTerms2=e}setAssignmentCheck(e){this.assignmentCheckComponent.checked=e,this.assignment=e}setTerms(e){this.acceptTerms=e,this.acceptTerms&&(this.data?.config??{}).forceChecks?this.gotoTermsAndConditions():this.acceptTerms||(this.termsReaded=!1)}setPolicy(e){this.acceptPolicy=e}setTerms2(e){this.acceptTerms2=e,this.acceptTerms2&&(this.data?.config??{}).forceChecks?this.gotoTermsAndConditionsCertificate():this.acceptTerms2||(this.terms2Readed=!1)}setAssignment(e){this.assignment=e}nextStep(){if(this.form.invalid||!this.getIfValid())return void(0,ye.J)(this);let e={terms_and_conditions_service:this.acceptTerms,terms_and_conditions_certificate_emition:this.acceptTerms2,request_id:this.solicitud.request_id};this.data&&this.data.config&&this.data.config.followMail&&(e.email_copy=this.form.get("email").value),(this.data.config.activatePower||this.solicitud?.power_activate)&&(e.power_activate=!0,e.terms_and_conditions_power=this.powerActivate?1:0),this.next.emit(e)}gotoTermsAndConditions(){this.termsReaded=!0,this.goTerms.emit(!0)}gotoTermsAndConditionsCertificate(){this.terms2Readed=!0,this.goTermsCert.emit(!0)}getIfValid(){return!((this.requestID?this.solicitud?.power_activate:this.data?.config.activatePower)&&!this.powerActivate)&&this.getAssignmentValidation()}getAssignmentValidation(){if(this.data.config.forceChecks&&(!this.data.config.hideCheckLegal&&!this.termsReaded||!this.terms2Readed))return!1;this.data.config.hideCheckLegal&&(this.acceptTerms=!0),this.data?.config?.showPolicyLink||(this.acceptPolicy=!0);const e=!!this.data?.config?.showPolicyLink;return this.data.config.dataAssignmentCheck?this.acceptTerms&&(!e||this.acceptPolicy)&&this.acceptTerms2&&this.assignment:this.acceptTerms&&(!e||this.acceptPolicy)&&this.acceptTerms2}gotoPowerConditions(e){this.goPower.emit(!0)}setPower(e){this.powerActivate=e}}return e.ɵfac=function(t){return new(t||e)(j.Y36(z.F),j.Y36(p.QS))},e.ɵcmp=j.Xpm({type:e,selectors:[["belender-form-step"]],viewQuery:function(e,t){if(1&e&&(j.Gf(Se,5),j.Gf(Ce,5),j.Gf(Te,5),j.Gf(ke,5)),2&e){let e;j.iGM(e=j.CRH())&&(t.checkComponent=e.first),j.iGM(e=j.CRH())&&(t.policyCheckComponent=e.first),j.iGM(e=j.CRH())&&(t.certCheckComponent=e.first),j.iGM(e=j.CRH())&&(t.assignmentCheckComponent=e.first)}},inputs:{userId:"userId",flowName:"flowName",requestID:"requestID",data:"data",texts:"texts",solicitud:"solicitud",labels:"labels",lang:"lang",acceptTerms:"acceptTerms",acceptPolicy:"acceptPolicy",acceptTerms2:"acceptTerms2",termsReaded:"termsReaded",terms2Readed:"terms2Readed"},outputs:{next:"nextStep",goTerms:"goToTerms",goTermsCert:"goToTermsCertificate",goPower:"goToPower"},features:[j._Bn([{provide:T.sG,useValue:Ne},{provide:j.soG,useValue:"es-ES"}])],decls:24,vars:30,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4","custom-html",3,"innerHTML"],[1,"my-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["class","w-full",4,"ngIf"],["class","flex justify-start items-center w-full flex-100",4,"ngIf"],["class","flex justify-between items-center w-full flex-100",4,"ngIf"],[1,"flex","justify-start","items-center","w-full","flex-100"],[3,"color","changeCheckbox"],["termsCertCheckbox",""],["target","_blank",1,"text-sm","hover:text-blue-500",3,"click"],["class","px-2 flex items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"],[1,"w-full"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["id","form-email","formControlName","email","type","email","matInput","",3,"placeholder"],[4,"ngIf"],["id","termsCheckbox",3,"color","changeCheckbox"],["termsCheckbox",""],[3,"lang","userId","linkType","firstSentence","secondSentence","thirdSentence","policyActionText","termsActionText","customTerms","goToTerms"],["id","policyCheckbox",3,"color","changeCheckbox"],["policyCheckbox",""],[3,"lang","userId","linkType","flowName","data","policyActionText"],[1,"flex","justify-between","items-center","w-full","flex-100"],["assignmentCheckbox",""],[1,"custom-html",3,"innerHTML"],[1,"px-2","flex","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"],["svgIcon","mat:warning",1,"text-xs","w-4","h-4"]],template:function(e,t){1&e&&(j._UZ(0,"belender-widget-step-logo",0),j.TgZ(1,"form",1)(2,"div",2),j._UZ(3,"div",3)(4,"div",4),j.ALo(5,"safeHtml"),j.qZA(),j.TgZ(6,"div",5),j.YNc(7,Ee,7,5,"div",6),j.YNc(8,Ae,4,10,"div",7),j.YNc(9,Oe,4,7,"div",7),j.YNc(10,Le,6,3,"div",8),j.TgZ(11,"div",9)(12,"belender-checkbox",10,11),j.NdJ("changeCheckbox",(function(e){return t.setTerms2(e)})),j._uU(14),j.TgZ(15,"a",12),j.NdJ("click",(function(){return t.gotoTermsAndConditionsCertificate()})),j.TgZ(16,"u"),j._uU(17),j.qZA()(),j._uU(18),j.qZA()(),j.YNc(19,De,4,2,"div",7),j.YNc(20,Pe,3,1,"div",13),j.qZA(),j.TgZ(21,"div",14)(22,"button",15),j.NdJ("click",(function(){return t.nextStep()})),j._uU(23),j.qZA()()()),2&e&&(j.Q6J("data",t.data)("customImage",t.texts.form.customImage),j.xp6(1),j.Q6J("formGroup",t.form),j.xp6(2),j.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),j.Q6J("innerHTML",t.texts.form.title,j.oJD),j.xp6(1),j.Udp("color",t.data.styles.colors.text),j.Q6J("innerHTML",j.lcZ(5,28,t.texts.form.description||""),j.oJD),j.xp6(3),j.Q6J("ngIf",null==t.data||null==t.data.config?null:t.data.config.followMail),j.xp6(1),j.Q6J("ngIf",!t.data.config.hideCheckLegal),j.xp6(1),j.Q6J("ngIf",null==t.data||null==t.data.config?null:t.data.config.showPolicyLink),j.xp6(1),j.Q6J("ngIf",t.requestID?null==t.solicitud?null:t.solicitud.power_activate:null==t.data?null:t.data.config.activatePower),j.xp6(2),j.Q6J("color",t.data.styles.colors.title),j.xp6(2),j.hij(" ",t.labels.flowCommon.certTermsBefore," "),j.xp6(3),j.Oqu(t.labels.flowCommon.certTermsLink),j.xp6(1),j.hij(" ",t.labels.flowCommon.certTermsAfter," "),j.xp6(1),j.Q6J("ngIf",null==t.data?null:t.data.config.dataAssignmentCheck),j.xp6(1),j.Q6J("ngIf",t.submitAttempted&&(!t.acceptTerms2||!t.data.config.hideCheckLegal&&!t.acceptTerms)),j.xp6(2),j.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),j.xp6(1),j.hij(" ",t.labels.actions.next," "))},dependencies:[i.O5,d.Hw,u.lW,P.TO,P.KE,P.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.sg,p.u,we.b,ne.y,xe.T,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Re=n(5145);let Ye=(()=>{class e{constructor(e){this.utils=e,this.status="",this.labels=Z.S.es,this.label=""}ngOnInit(){this.data.config&&this.data.config.infiniteLoopInCompleted?this.label="":(this.label=this.labels.flowCommon.loadingData,Re.Z.forEach((e=>{e.text==this.status&&(this.label=e.label)})))}}return e.ɵfac=function(t){return new(t||e)(j.Y36(z.F))},e.ɵcmp=j.Xpm({type:e,selectors:[["belender-loading-step"]],inputs:{status:"status",labels:"labels",data:"data"},decls:5,vars:1,consts:[[1,"fixed-content","h-full"],[1,"h-full","py-10","flex","flex-col","items-center"]],template:function(e,t){1&e&&(j.TgZ(0,"div",0)(1,"div",1),j._UZ(2,"mat-progress-spinner"),j.TgZ(3,"p"),j._uU(4),j.qZA()()()),2&e&&(j.xp6(4),j.Oqu(t.label))},dependencies:[y.Ou],styles:[".content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),Fe=(()=>{class e{constructor(){this.labels=Z.S.es}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=j.Xpm({type:e,selectors:[["belender-no-service-step"]],inputs:{data:"data",texts:"texts",labels:"labels"},decls:6,vars:12,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&(j._UZ(0,"belender-widget-step-logo",0),j.TgZ(1,"form",1)(2,"div",2),j._UZ(3,"div",3)(4,"div",4),j.ALo(5,"safeHtml"),j.qZA()()),2&e&&(j.Q6J("data",t.data)("customImage",t.texts.noService.customImage),j.xp6(3),j.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),j.Q6J("innerHTML",t.texts.noService.title,j.oJD),j.xp6(1),j.Udp("color",t.data.styles.colors.text),j.Q6J("innerHTML",j.lcZ(5,10,t.texts.noService.description),j.oJD))},dependencies:[p._Y,p.JL,p.F,ne.y,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),Ue=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.retryOp=new j.vpe(null),this.labels=Z.S.es}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}getTextStatus(){switch(this.solicitud.status_code){case"abandoned_after_waiting_otp_seguridad_social":return this.labels.abandoned.afterWaitingOtpSS;case"abandoned_after_invalid_otp_seguridad_social":return this.labels.abandoned.afterInvalidOtpSS;case"abandoned_after_invalid_otp_aeat":return this.labels.abandoned.afterInvalidOtpAEAT;case"abandoned_after_waiting_otp_aeat":return this.labels.abandoned.afterWaitingOtpAEAT;default:return this.solicitud.status_message||this.solicitud.status_code}}}return e.ɵfac=function(t){return new(t||e)(j.Y36(p.QS),j.Y36(z.F),j.Y36(_.M),j.Y36(v.o),j.Y36(k.T))},e.ɵcmp=j.Xpm({type:e,selectors:[["belender-abandoned-step"]],inputs:{solicitud:"solicitud",data:"data",texts:"texts",labels:"labels"},outputs:{retryOp:"retry"},decls:11,vars:21,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"p-1","px-4","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm","mb-2","mt-6"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(j._UZ(0,"belender-widget-step-logo",0),j.TgZ(1,"div",1)(2,"div",2),j._UZ(3,"div",3)(4,"div",4),j.ALo(5,"safeHtml"),j.TgZ(6,"div",5),j._uU(7),j.qZA()(),j.TgZ(8,"div",6)(9,"button",7),j.NdJ("click",(function(){return t.retry()})),j._uU(10),j.qZA()()()),2&e&&(j.Q6J("data",t.data)("customImage",t.texts.abandoned.customImage),j.xp6(3),j.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),j.Q6J("innerHTML",t.texts.abandoned.title,j.oJD),j.xp6(1),j.Udp("color",t.data.styles.colors.text),j.Q6J("innerHTML",j.lcZ(5,19,t.texts.abandoned.description),j.oJD),j.xp6(3),j.AsE(" ",t.labels.certificate.status,": ",t.getTextStatus()," "),j.xp6(2),j.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),j.xp6(1),j.Oqu(t.labels.actions.retry))},dependencies:[u.lW,ne.y,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function Ze(e,t){return n=>{const i=n.controls[t];i.errors&&!i.errors.confirmedValidator||i.setErrors(n.controls[e].value!==i.value?{confirmedValidator:!0}:null)}}function He(e,t){if(1&e&&(j.TgZ(0,"mat-hint",13),j._uU(1),j.qZA()),2&e){const e=j.oxw();j.xp6(1),j.hij(" ",e.labels.certificate.password.required," ")}}function je(e,t){if(1&e&&(j.TgZ(0,"mat-hint",13),j._uU(1),j.qZA()),2&e){const e=j.oxw();j.xp6(1),j.hij(" ",e.labels.certificate.password.minLength," ")}}function ze(e,t){if(1&e&&(j.TgZ(0,"mat-hint",13),j._uU(1),j.qZA()),2&e){const e=j.oxw();j.xp6(1),j.hij(" ",e.labels.certificate.password.confirmRequired," ")}}function Be(e,t){if(1&e&&(j.TgZ(0,"mat-hint",13),j._uU(1),j.qZA()),2&e){const e=j.oxw();j.xp6(1),j.hij(" ",e.labels.certificate.password.mismatch," ")}}function Je(e,t){if(1&e&&(j.TgZ(0,"mat-hint",13),j._uU(1),j.qZA()),2&e){const e=j.oxw();j.xp6(1),j.hij(" ",e.labels.certificate.password.minLength," ")}}const Ve={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let Qe=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.labels=Z.S.es,this.form=new p.cw({}),this.next=new j.vpe(null)}ngOnInit(){this.setForm()}get f(){return this.form.controls}submit(){this.nextStep()}setForm(){this.form=this.fb.group({password:["",[p.kI.required]],confirm_password:["",[p.kI.required]]},{validator:Ze("password","confirm_password")})}nextStep(){let e={set_password_certificate:this.form.get("password").value};this.next.emit(e)}}return e.ɵfac=function(t){return new(t||e)(j.Y36(p.qu),j.Y36(z.F))},e.ɵcmp=j.Xpm({type:e,selectors:[["belender-password-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud",labels:"labels"},outputs:{next:"nextStep"},features:[j._Bn([{provide:T.sG,useValue:Ve},{provide:j.soG,useValue:"es-ES"}])],decls:23,vars:28,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"my-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["formControlName","password","minlength","8","type","password","matInput",""],["class","text-red-500",4,"ngIf"],["appearance","outline",1,"mb-4","w-full","flex-1","belender-form-field"],["formControlName","confirm_password","minlength","8","type","password","matInput",""],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"text-red-500"]],template:function(e,t){1&e&&(j._UZ(0,"belender-widget-step-logo",0),j.TgZ(1,"form",1)(2,"div",2),j._UZ(3,"div",3)(4,"div",4),j.ALo(5,"safeHtml"),j.qZA(),j.TgZ(6,"div",5)(7,"mat-form-field",6)(8,"mat-label"),j._uU(9),j.qZA(),j._UZ(10,"input",7),j.YNc(11,He,2,1,"mat-hint",8),j.YNc(12,je,2,1,"mat-hint",8),j.qZA(),j.TgZ(13,"mat-form-field",9)(14,"mat-label"),j._uU(15),j.qZA(),j._UZ(16,"input",10),j.YNc(17,ze,2,1,"mat-hint",8),j.YNc(18,Be,2,1,"mat-hint",8),j.YNc(19,Je,2,1,"mat-hint",8),j.qZA()(),j.TgZ(20,"div",11)(21,"button",12),j.NdJ("click",(function(){return t.nextStep()})),j._uU(22),j.qZA()()()),2&e&&(j.Q6J("data",t.data)("customImage",t.texts.password.customImage),j.xp6(1),j.Q6J("formGroup",t.form),j.xp6(2),j.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),j.Q6J("innerHTML",t.texts.password.title,j.oJD),j.xp6(1),j.Udp("color",t.data.styles.colors.text),j.Q6J("innerHTML",j.lcZ(5,26,t.texts.password.description),j.oJD),j.xp6(5),j.Oqu(t.labels.certificate.password.label),j.xp6(2),j.Q6J("ngIf",t.f.password.touched&&t.f.password.invalid&&t.f.password.errors.required),j.xp6(1),j.Q6J("ngIf",t.f.password.invalid&&t.f.password.errors.minlength),j.xp6(3),j.Oqu(t.labels.certificate.password.confirmLabel),j.xp6(2),j.Q6J("ngIf",t.f.confirm_password.touched&&t.f.confirm_password.touched&&t.f.confirm_password.invalid&&t.f.confirm_password.errors.required),j.xp6(1),j.Q6J("ngIf",t.f.confirm_password.touched&&t.f.confirm_password.touched&&t.f.confirm_password.invalid&&t.f.confirm_password.errors.confirmedValidator),j.xp6(1),j.Q6J("ngIf",t.f.confirm_password.invalid&&t.f.confirm_password.errors.minlength),j.xp6(2),j.Udp("color",t.form.invalid?"":t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),j.Q6J("disabled",t.form.invalid),j.xp6(1),j.hij(" ",t.labels.certificate.password.save," "))},dependencies:[i.O5,u.lW,P.KE,P.bx,P.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.sg,p.u,ne.y,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const We=["formStep"];function Ge(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"vex-power-cert",4),j.NdJ("accept",(function(){j.CHM(e);const t=j.oxw();return j.KtG(t.acceptPowerCert())})),j.qZA()}if(2&e){const e=j.oxw();j.Q6J("hideButtons",!1)("flow","KnownClient")("userId",e.userId)}}function $e(e,t){if(1&e&&j._UZ(0,"belender-loading-step",16),2&e){const e=j.oxw(3);j.Q6J("labels",e.labels)("status",null==e.solicitud?null:e.solicitud.status_code)("data",e.data)}}function Ke(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"belender-form-step",17,18),j.NdJ("goToTerms",(function(){j.CHM(e);const t=j.oxw(3);return j.KtG(t.gotoTermsAndConditions())}))("goToPower",(function(){j.CHM(e);const t=j.oxw(3);return j.KtG(t.gotoPowerConditions())}))("goToTermsCertificate",(function(){j.CHM(e);const t=j.oxw(3);return j.KtG(t.gotoTermsAndConditionsCertificate())}))("nextStep",(function(t){j.CHM(e);const n=j.oxw(3);return j.KtG(n.gotoPassword(t))})),j.qZA()}if(2&e){const e=j.oxw(3);j.Q6J("userId",e.userId)("requestID",e.requestID)("data",e.data)("flowName",e.flowName)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)("labels",e.labels)("lang",e.currentLang)}}function Xe(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"belender-password-step",19),j.NdJ("nextStep",(function(t){j.CHM(e);const n=j.oxw(3);return j.KtG(n.sendPassword(t))})),j.qZA()}if(2&e){const e=j.oxw(3);j.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function et(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"belender-otp-step",20),j.NdJ("resendOTP",(function(t){j.CHM(e);const n=j.oxw(3);return j.KtG(n.resendOTP(t))}))("errorPhone",(function(){j.CHM(e);const t=j.oxw(3);return j.KtG(t.setRequestStatus("failed_login_otp"))}))("nextStep",(function(t){j.CHM(e);const n=j.oxw(3);return j.KtG(n.requestOTP(t))})),j.qZA()}if(2&e){const e=j.oxw(3);j.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function tt(e,t){if(1&e&&j._UZ(0,"belender-success-step",21),2&e){const e=j.oxw(3);j.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function nt(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"belender-fail-step",22),j.NdJ("retry",(function(t){j.CHM(e);const n=j.oxw(3);return j.KtG(n.retryRequest(t))}))("newRequest",(function(t){j.CHM(e);const n=j.oxw(3);return j.KtG(n.newRequest(t))})),j.qZA()}if(2&e){const e=j.oxw(3);j.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function it(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"belender-abandoned-step",23),j.NdJ("retry",(function(t){j.CHM(e);const n=j.oxw(3);return j.KtG(n.retryRequest(t))})),j.qZA()}if(2&e){const e=j.oxw(3);j.Q6J("solicitud",e.solicitud)("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function st(e,t){if(1&e&&j._UZ(0,"belender-no-service-step",24),2&e){const e=j.oxw(3);j.Q6J("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("labels",e.labels)("data",e.data)}}function rt(e,t){if(1&e&&(j.ynx(0),j.YNc(1,$e,1,3,"belender-loading-step",8),j.YNc(2,Ke,2,8,"belender-form-step",9),j.YNc(3,Xe,1,4,"belender-password-step",10),j.YNc(4,et,1,4,"belender-otp-step",11),j.YNc(5,tt,1,3,"belender-success-step",12),j.YNc(6,nt,1,4,"belender-fail-step",13),j.YNc(7,it,1,4,"belender-abandoned-step",14),j.YNc(8,st,1,3,"belender-no-service-step",15),j.BQk()),2&e){const e=j.oxw(2);j.xp6(1),j.Q6J("ngIf","loading"==e.requestStatus&&!e.loading),j.xp6(1),j.Q6J("ngIf","form"==e.requestStatus&&!e.loading),j.xp6(1),j.Q6J("ngIf","password"==e.requestStatus),j.xp6(1),j.Q6J("ngIf","otp"==e.requestStatus),j.xp6(1),j.Q6J("ngIf","success"==e.requestStatus),j.xp6(1),j.Q6J("ngIf","failed"==e.requestStatus),j.xp6(1),j.Q6J("ngIf","abandoned"==e.requestStatus),j.xp6(1),j.Q6J("ngIf","no-service"==e.requestStatus)}}function ot(e,t){1&e&&j._UZ(0,"belender-disabled-url")}function at(e,t){if(1&e&&(j.TgZ(0,"div",25),j._UZ(1,"mat-progress-spinner",26),j.TgZ(2,"p",27),j._uU(3),j.qZA()()),2&e){const e=j.oxw(2);j.xp6(1),j.Q6J("value",e.spinnerValue)("mode",e.spinnerMode),j.xp6(2),j.Oqu(e.loading)}}function lt(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"div",28)(1,"div",29)(2,"div",30),j._uU(3),j.qZA(),j._UZ(4,"div",31),j.qZA(),j.TgZ(5,"div",32)(6,"button",33),j.NdJ("click",(function(){j.CHM(e);const t=j.oxw(2);return j.KtG(t.error=!1)})),j._uU(7),j.qZA()()()}if(2&e){const e=j.oxw(2);j.xp6(3),j.Oqu(e.labels.warnings.error),j.xp6(1),j.Udp("color",e.data.styles.colors.text),j.Q6J("innerHTML",e.error,j.oJD),j.xp6(3),j.Oqu(e.labels.manual)}}function ct(e,t){if(1&e&&(j.TgZ(0,"div",5)(1,"div"),j.YNc(2,rt,9,8,"ng-container",3),j.YNc(3,ot,1,0,"belender-disabled-url",3),j.YNc(4,at,4,3,"div",6),j.YNc(5,lt,8,5,"div",7),j.qZA()()),2&e){const e=j.oxw();j.xp6(1),j.Gre("h-full w-full flex-auto p-0 md:p-3 ",e.data.styles.typography,""),j.Udp("background",e.data.styles.colors.background),j.xp6(1),j.Q6J("ngIf",!e.error&&!e.disableURL),j.xp6(1),j.Q6J("ngIf",!e.error&&e.disableURL),j.xp6(1),j.Q6J("ngIf",e.loading&&!e.error),j.xp6(1),j.Q6J("ngIf",!e.loading&&e.error)}}function dt(e,t){if(1&e){const e=j.EpF();j.TgZ(0,"vex-terms",34),j.NdJ("accepted",(function(){j.CHM(e);const t=j.oxw();return j.KtG(t.handleTermsResponse(!0))}))("cancelled",(function(){j.CHM(e);const t=j.oxw();return j.KtG(t.handleTermsResponse(!1))})),j.qZA()}if(2&e){const e=j.oxw();j.Q6J("flow","presencial")("lang",e.currentLang)("allData",e.data)("requestStatus",e.solicitud?e.solicitud.status_code:"")}}function ut(e,t){if(1&e&&(j.ynx(0),j.TgZ(1,"div",35),j._uU(2),j.qZA(),j.BQk()),2&e){const e=j.oxw();j.xp6(2),j.hij("TestMode ",e.testMode?"ON":"OFF","")}}let ht=class{constructor(e,t,n,i,s,r,o,a,l,c,d,u){this.cd=e,this.Activatedroute=t,this.utils=n,this.solicitudesService=i,this.customizationService=s,this.customizationStoreService=r,this.notis=o,this.webhooksService=a,this.knownService=l,this.dialog=c,this.translationService=d,this.personalUtils=u,this.data=null,this.disableActions=!1,this.step="created",this.waitingTime=15,this.loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1,this.viewPowerTerms=!1,this.disableURL=!1,this.flowName="KnownClient",this.showTermsDialog=!1,this.currentLang="",this.labels=Z.S.es,this.requestStatus="",this.intervalToAskBack=null,this.intervalCount=0,this.lastInvalidOtpAlertStatus=null}set solicitud(e){this._solicitudInput=e,e&&this.personalUtils.setRequest(e)}get solicitud(){return this.personalUtils.REQUEST||this._solicitudInput}ngOnInit(){const e=this;this.setTranslation(),this.loading=this.labels.certificate.loadings.gettingRequestInfo,this.userId=this.customizationStoreService.USER_ID,this.packId=this.customizationStoreService.PACK_ID,this.personalUtils.request_status$.subscribe((e=>{"invalid_otp"===e&&this.lastInvalidOtpAlertStatus!==e&&(this.lastInvalidOtpAlertStatus=e,this.showAlert("Error!","Código inválido. Por favor, introduzca el código recibido por SMS")),this.setStatus()})),this.userId?this.setInitialData(this.userId):this.loading=null,"pro"!=Y.N.env&&(R(document).keydown((function(t){16==t.which&&(this.shiftlIsPressed=!0),17==t.which&&(this.cntrlIsPressed=!0),84==t.which&&this.cntrlIsPressed&&this.shiftlIsPressed&&(e.testMode=!e.testMode,e.cd.markForCheck())})),R(document).keyup((function(e){16==e.which&&(this.shiftlIsPressed=!1),16==e.which&&(this.cntrlIsPressed=!1)})))}ngOnDestroy(){this.stopInterval(),this.personalUtils.disconnectWebsocket()}setInitialData(e){var t=this;return(0,L.Z)((function*(){const n=(0,U.cm)(yield t.getFlow(e));if(t.funderConfig=t.customizationStoreService.FUNDER_CONFIG,t.data={config:t.funderConfig,styles:t.customizationStoreService.FUNDER_STYLES,[t.flowName]:n},(0,U.bf)(t.data,t.flowName),!t.data.config||!t.data.config.funder_id)return t.notis.showAlert(t.labels.warnings.error,t.labels.warnings.noCustomization,"error"),t.loading=null,void t.cd.markForCheck();t.financiadorID=t.data.config.funder_id||"",t.disableURL=t.data.config.disableUrlWidget,t.validateRequestIdInUrl(),t.cd.markForCheck()}))()}getFlow(e){var t=this;return(0,L.Z)((function*(){return new Promise((n=>{t.customizationService.getCustomizationByFlow(e,t.flowName,t.customizationStoreService.LANG).then((e=>{n(e?.data?e.data:null)}),(e=>{n(null)}))}))}))()}sendMessageToParent(e){this.personalUtils.sendMessageToParent(e)}setTranslation(){const e=this.currentLang||this.customizationStoreService?.LANG||localStorage.getItem("belender-language")||"es",t=this.translationService.getLabelsTranslated(e);t&&(this.labels=t,this.personalUtils.labels=t)}validateRequestIdInUrl(){this.Activatedroute.queryParams.subscribe((e=>{e?.lang&&(this.currentLang=e.lang,this.setTranslation(),this.loading=this.translationService.getFirstLoading(this.currentLang)),e&&e.acceptTerms&&(this.autoAcceptTerms=!0),e&&e.request_id?(this.disableURL=!1,this.requestID=e.request_id,this.setFormFromVcCode(e.request_id)):this.loading=!1}),(e=>{this.loading=!1}))}setFormFromVcCode(e){var t=this;return(0,L.Z)((function*(){t.loading=t.labels.loadings.gettingData,t.solicitudesService.getSolicitudByCode(e).then((n=>{if(console.warn("solicitud: ",n.data),n&&n.data){if(w.t.shouldIgnoreWebhookStatus(n.data.status_code))return t.personalUtils.setRequest(t.personalUtils.REQUEST?.status_code?{...n.data,status_code:t.personalUtils.REQUEST.status_code}:n.data),t.personalUtils.subscribeWS(e),t.loading="Estamos procesando su solicitud. Espere un momento por favor",t.skipCreationOfRequest=!0,void(t.autoAcceptTerms&&t.gotoOTP());t.personalUtils.setRequest(n.data),t.personalUtils.subscribeWS(e),t.setRequestStatus(t.personalUtils.REQUEST.status_code),t.loading=!1,t.skipCreationOfRequest=t.personalUtils.REQUEST?.status_code&&"prerequest"!=t.personalUtils.REQUEST.status_code,t.autoAcceptTerms&&t.gotoOTP()}else t.loading=!1})).catch((e=>{t.loading=!1}))}))()}setSubscriptionOfRequest(){this.personalUtils.subscribeWS(this.requestID)}handlePusherNotification(e){this.personalUtils.handlePusherNotification(e),e?.status_code&&"terms_and_conditions"!=e.status_code&&setTimeout((()=>{this.loading=!1,this.cd.markForCheck()}),500)}resendOTP(e){let t={request_id:this.requestID,user_id:this.userId};this.loading=this.labels.loadings.resendingOtp,this.setSubscriptionOfRequest(),this.solicitudesService.resendOTP(t).then((e=>{e&&e.data&&(this.personalUtils.setRequest(e.data),this.setRequestStatus(this.personalUtils.REQUEST.status_code)),this.loading=!1})).catch((e=>{console.error(e),this.showAlert(this.labels.warnings.error,e.message||e),this.loading=!1}))}gotoTerms(e){this.loading=this.labels.loadings.sendingData,e.package_id=this.packId,e.user_id=this.userId,this.testMode?setTimeout((()=>{this.personalUtils.setRequest(new q.l),this.personalUtils.setRequestStatus("waiting_otp"),this.loading=!1}),4e3):this.skipCreationOfRequest?(this.gotoOTP(),this.setSubscriptionOfRequest()):this.solicitudesService.addSolicitud(e).then((t=>{t&&t.status&&"error"==t.status?(this.personalUtils.setRequest({...e,status_code:"form"}),t.message&&(400==t.code?"Birthdate incorrect"==t.message?(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongBirthday)):(this.setRequestStatus("no_service"),this.loading=!1):(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,t.message)))):t&&t.status&&"success"==t.status?(this.requestID=t.data.request_id,this.personalUtils.setRequest(t.data),this.personalUtils.sendMessageToParent({type:"response",data:t.data||t}),this.gotoOTP()):this.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+t)})).catch((e=>{e&&e.error&&this.showAlert(this.labels.warnings.error,e.error),this.loading=!1}))}setSubscriptionOfRequestOld(){!this.financiadorID||!this.userId||!this.requestID||this.subscribed||(this.subscribed=!0,this.webhooksService.bindRequestChanges(this.financiadorID,this.userId,this.requestID),this.webhooksService.subscribeRequestChanges().subscribe((e=>{e&&this.handlePusherNotification(e)}),(e=>{this.loading=!1})))}sendNewData(e){this.loading=this.labels.certificate.loadings.sendingInfo,this.solicitudesService.fixData(this.requestID,e).then((e=>{e.status&&"error"==e.status?e.message&&(this.showAlert(this.labels.warnings.error,e),this.loading=!1):e&&"success"==e.status&&(this.sendMessageToParent({type:"response",data:e.data||e}),this.initWaitingForResponse(this.labels.loadings.validatingData),this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert(this.labels.warnings.error,e.error),this.loading=!1}))}showAlert(e,t){this.loading=!1,this.notis.showAlert(e,t)}gotoPassword(e){this.loading=this.labels.certificate.loadings.startingEmission;let t=e;(this.data.config.activatePower||this.solicitud?.power_activate)&&(t.power_activate=!0,t.terms_and_conditions_power=e.terms_and_conditions_power),this.knownService.acceptTerms(t).then((e=>{e.status&&"error"==e.status?(this.showAlert(this.labels.warnings.error,e.message?e.message:e),this.loading=!1):e&&"success"==e.status?this.sendMessageToParent({type:"response",data:e.data||e}):this.loading=!1})).catch((e=>{t&&t.error&&this.showAlert(this.labels.warnings.error,t.error),this.loading=!1}))}gotoOTP(e){let t=e;t.request_id=this.requestID,t.user_id=this.userId,this.initWaitingForResponse(this.labels.certificate.loadings.startingEmission),setTimeout((()=>{this.personalUtils.setRequest(new q.l),this.personalUtils.setRequestStatus("waiting_otp"),this.loading=!1}),2e3)}requestOTP(e){let t={otp:e.code,request_id:this.solicitud.request_id};this.loading=this.labels.certificate.loadings.sendingOtp,this.knownService.sendOtp(t).then((e=>{e.status&&"error"==e.status?(this.showAlert(this.labels.warnings.error,e.message?e.message:e),this.loading=!1):e&&"success"==e.status?this.sendMessageToParent({type:"response",data:e.data||e}):this.loading=!1})).catch((e=>{e&&e.error&&this.showAlert(this.labels.warnings.error,e.error),this.loading=!1}))}sendPassword(e){let t={password:e.set_password_certificate,request_id:this.solicitud.request_id};this.loading=this.labels.flowCommon.sendingPassword,this.knownService.sendPassword(t).then((e=>{e.status&&"error"==e.status?(this.showAlert(this.labels.warnings.error,e.message?e.message:e),this.loading=!1):e&&"success"==e.status?this.sendMessageToParent({type:"response",data:e.data||e}):this.loading=!1})).catch((t=>{e&&e.error&&this.showAlert(this.labels.warnings.error,e.error),this.loading=!1}))}initWaitingForResponse(e){this.loading=e||this.labels.certificate.loadings.validatingInfo,setTimeout((()=>{this.loading&&this.askToBack()}),1e4)}askToBack(){this.askDetailToBack(this.requestID)}askDetailToBack(e){const t=this.personalUtils.REQUEST?.status_code,n=e||this.requestID||this.personalUtils.REQUEST?.request_id;n&&"consent_process_completed"!==t?this.solicitudesService.getSolicitudByCode(n).then((e=>{if(e&&e.data){if(w.t.shouldIgnoreWebhookStatus(e.data.status_code))return;const n=e.data;n.status_code=n.consent_process_completed?"consent_process_completed":n.status_code,t!=n.status_code&&(this.personalUtils.setRequest(n),this.setRequestStatus(this.personalUtils.REQUEST.status_code))}})).catch((()=>{this.loading=null})):this.stopInterval()}initIntervalToAskBack(){!this.personalUtils.REQUEST?.request_id&&!this.requestID||this.intervalToAskBack||(this.intervalToAskBack=setInterval((()=>{this.askDetailToBack(),this.intervalCount++,this.intervalCount>20&&this.stopInterval()}),5e3))}stopInterval(){this.intervalToAskBack&&clearInterval(this.intervalToAskBack),this.intervalToAskBack=null,this.intervalCount=0}gotoErrorPhone(){}setRequestStatus(e){this.personalUtils.REQUEST||this.personalUtils.setRequest(new q.l),this.personalUtils.setRequestStatus(e),this.setStatus()}setStatus(){if(!this.personalUtils.REQUEST)return;const e=H[this.personalUtils.REQUEST.status_code];if(e){if("success"===e&&this.funderConfig?.infiniteLoopInCompleted)return this.requestStatus="loading",this.loading=" ",void this.cd.markForCheck();if("error-data"===e)return this.requestStatus=this.data?.config?.noRetryInBadPhone?"otp":"error-data",this.loading=null,this.stopInterval(),void this.cd.markForCheck();if("loading"===e)return this.requestStatus="loading",this.loading=this.labels.loadings?.validatingData||"Estamos procesando su solicitud. Espere un momento por favor",void this.cd.markForCheck();this.requestStatus=e,this.loading=null,this.stopInterval()}else this.requestStatus="loading",this.loading=this.labels.loadings?.validatingData||"Estamos procesando su solicitud. Espere un momento por favor",this.initIntervalToAskBack();this.cd.markForCheck()}retryRequest(e){let t={request_id:e,user_id:this.userId};this.loading=this.labels.loadings.resendingRequest,this.setSubscriptionOfRequest(),this.solicitudesService.retryRequest(t).then((e=>{e&&e.data&&(this.personalUtils.setRequest(e.data),this.setRequestStatus(this.personalUtils.REQUEST.status_code)),this.loading=!1})).catch((e=>{console.error(e),this.showAlert(this.labels.warnings.error,e.message||e),this.loading=!1}))}newRequest(e){this.setRequestStatus("created")}getStatus(){return this.requestStatus}sendRetry(){}gotoTermsAndConditions(){this.showTermsDialog=!0}handleTermsResponse(e){this.showTermsDialog=!1,this.formComponent.setTermsCheck(e)}gotoTermsAndConditionsCertificate(){this.dialog.open(F.v,{panelClass:"fullscreen-dialog",data:{flow:"presencial",lang:this.currentLang||localStorage.getItem("belender-language")||"es"}}).afterClosed().subscribe((e=>{e&&this.formComponent.setTerms2Check(!0)}))}gotoPowerConditions(){this.viewPowerTerms=!0}acceptPowerCert(){this.viewPowerTerms=!1}get customImageForCurrentStep(){const e=this.data?.[this.flowName]?.texts;return e&&e[{failed:"fail","no-service":"noService",otp:"otpCC"}[this.requestStatus]??this.requestStatus]?.customImage||""}};ht.ɵfac=function(e){return new(e||ht)(j.Y36(j.sBO),j.Y36(A.gz),j.Y36(z.F),j.Y36(_.M),j.Y36(S.w),j.Y36(B.r),j.Y36(k.T),j.Y36(w.t),j.Y36(Q),j.Y36(W.uw),j.Y36(G.D),j.Y36(K))},ht.ɵcmp=j.Xpm({type:ht,selectors:[["belender-widget-personal"]],viewQuery:function(e,t){if(1&e&&j.Gf(We,5),2&e){let e;j.iGM(e=j.CRH())&&(t.formComponent=e.first)}},inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud"},features:[j._Bn([{provide:P.o2,useValue:{appearance:"standard"}}])],decls:4,vars:4,consts:[[3,"hideButtons","flow","userId","accept",4,"ngIf"],["class","h-full widget-belender",4,"ngIf"],[3,"flow","lang","allData","requestStatus","accepted","cancelled",4,"ngIf"],[4,"ngIf"],[3,"hideButtons","flow","userId","accept"],[1,"h-full","widget-belender"],["class","loading-wrapper animated fadeIn",4,"ngIf"],["class","animated fadeInRight",4,"ngIf"],[3,"labels","status","data",4,"ngIf"],[3,"userId","requestID","data","flowName","texts","solicitud","labels","lang","goToTerms","goToPower","goToTermsCertificate","nextStep",4,"ngIf"],[3,"data","labels","texts","solicitud","nextStep",4,"ngIf"],[3,"data","labels","texts","solicitud","resendOTP","errorPhone","nextStep",4,"ngIf"],[3,"data","labels","texts",4,"ngIf"],[3,"data","labels","texts","solicitud","retry","newRequest",4,"ngIf"],[3,"solicitud","data","labels","texts","retry",4,"ngIf"],[3,"texts","labels","data",4,"ngIf"],[3,"labels","status","data"],[3,"userId","requestID","data","flowName","texts","solicitud","labels","lang","goToTerms","goToPower","goToTermsCertificate","nextStep"],["formStep",""],[3,"data","labels","texts","solicitud","nextStep"],[3,"data","labels","texts","solicitud","resendOTP","errorPhone","nextStep"],[3,"data","labels","texts"],[3,"data","labels","texts","solicitud","retry","newRequest"],[3,"solicitud","data","labels","texts","retry"],[3,"texts","labels","data"],[1,"loading-wrapper","animated","fadeIn"],["color","accent","diameter","40",1,"spinner",3,"value","mode"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[1,"animated","fadeInRight"],[1,"px-6","py-4","flex","flex-col"],[1,"text-red-500","title","m-0"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"text-blue-500","bg-blue-50","px-8",3,"click"],[3,"flow","lang","allData","requestStatus","accepted","cancelled"],[1,"test-mode","px-10","py-2","bg-blue-500/10","text-blue-500","border-blue-500","border","rounded-md"]],template:function(e,t){1&e&&(j.YNc(0,Ge,1,3,"vex-power-cert",0),j.YNc(1,ct,6,9,"div",1),j.YNc(2,dt,1,4,"vex-terms",2),j.YNc(3,ut,3,1,"ng-container",3)),2&e&&(j.Q6J("ngIf",t.viewPowerTerms),j.xp6(1),j.Q6J("ngIf",t.data),j.xp6(1),j.Q6J("ngIf",t.showTermsDialog),j.xp6(1),j.Q6J("ngIf",t.testMode))},dependencies:[i.O5,u.lW,y.Ou,X.L,ee.L,te.q,me,ge,ve,qe,Ye,Fe,Ue,Qe],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative}.widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"]}),ht=(0,D.gn)([(0,N.c)()],ht);const pt=[{path:":idUser",component:ht},{path:":idUser/:packID",component:ht}];let mt=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=j.oAB({type:e}),e.ɵinj=j.cJS({imports:[A.Bz.forChild(pt),A.Bz,O.d8]}),e})();var ft=n(6981),gt=n(3848),_t=n(1129),bt=n(3295),vt=n(1258),yt=n(2266),wt=n(3300),xt=n(865);let St=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=j.oAB({type:e}),e.ɵinj=j.cJS({providers:[_.M,v.o,S.w,w.t,k.T,E.t,Q,K,{provide:T.Ad,useValue:"es-ES"}],imports:[mt,i.ez,s.G,r.J,o.TU,a.p0,l.JX,c.p9,d.Ps,u.ot,h.Tx,x.c,p.u5,m.AV,p.UX,f.LD,g.vV,b.a,y.Cq,C.FA,T.XK,M.T5,I.Fk,ft.x,gt.Nh,_t.n,bt.g,vt.H,yt.L,wt.C,xt.q]}),e})()},1742:(e,t,n)=>{n.d(t,{_:()=>u});var i=n(1931),s=n(1135),r=n(4707),o=n(5762),a=n(2340),l=n(182),c=n(4650),d=n(8460);let u=(()=>{class e{constructor(e){this.customizationStoreService=e,this.labels=i.S.es,this.socket=null,this._request=new s.X({...new o.l,status_code:"created"}),this._lastThreeNumbersPhone=new s.X(null),this._request_status=new s.X(null),this.currentHeight=0,this.autoAcceptSource=new r.t,this.autoAccept$=this.autoAcceptSource.asObservable(),this.request$=this._request.asObservable(),this.request_status$=this._request_status.asObservable(),this.lastThreeNumbersPhone$=this._lastThreeNumbersPhone.asObservable()}parseErrorResponse(e){if(Array.isArray(e)){let t="";return e.forEach((e=>{t+=e+" "})),{title:this.labels.warnings.errorSomeData,description:t}}return"does not have pin service"==e.toLowerCase()||"does not have clave pin service"==e.toLowerCase()?{title:"no-service",code:"no-service",description:this.labels.warnings.noPinService}:"document number invalid."==e.toLowerCase()?{title:this.labels.warnings.wrongDni,code:"dni",description:this.labels.warnings.wrongDniDesc}:"incorrect support number"==e.toLowerCase()?{title:this.labels.warnings.error,code:"sop",description:this.labels.warnings.wrongSupport}:"incorrect date"==e.toLowerCase()?{title:this.labels.warnings.wrongDate,code:"nac",description:this.labels.warnings.wrongDateDesc}:{title:"Error!",code:"unknown",description:e}}setGlobalVariables(){this.REQUEST=this._request.value,this.REQUEST_STATUS=this.REQUEST.status_code,this._request_status.next(this.REQUEST_STATUS)}setRequest(e){this._request.next({...e}),this.setGlobalVariables()}patch(e){this._request.next({...this._request.value,...e}),this.setGlobalVariables()}setParameter(e,t){this._request.next({...this._request.value,[e]:t}),this.setGlobalVariables()}setRequestStatus(e){this._request.next({...this._request.value,status_code:e}),this.setGlobalVariables()}setRequestID(e){this._request.next({...this._request.value,request_id:e}),this.setGlobalVariables()}subscribeWS(){if(this.socket)return;let e="wss://notifications.dev.belender.net";"qa"==a.N.env&&(e="wss://notifications.qa.belender.net"),"pro"==a.N.env&&(e="wss://notifications.belender.net"),a.N.notificationsBaseUrl&&(e=a.N.notificationsBaseUrl),this.socket=new WebSocket(`${e}?requests_id=${this._request.value.request_id}&user_id=${this.customizationStoreService.USER_ID}`);var t=this;this.socket.onopen=function(e){console.log("Conexión establecida")},this.socket.onmessage=function(e){let n=JSON.parse(e.data);t.handlePusherNotification(n)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e),console.error(e)},this.socket.onclose=function(e){console.log("Conexión cerrada")}}handlePusherNotification(e){if(!e||l.t.shouldIgnoreWebhookStatus(e.status_code))return;this.sendMessageToParent({type:"websocket",data:e}),console.warn("message from ws: ",e),e.person_last_three_phone_number&&this._lastThreeNumbersPhone.next(e.person_last_three_phone_number);const t=e.status_code;if(t){if(t.startsWith("failed"))return this.disconnectWebsocket(),void this.setRequestStatus(t);if(t.startsWith("abandoned"))return this.disconnectWebsocket(),void this.setRequestStatus(t);if("consent_process_completed"===t)return this.disconnectWebsocket(),void this.patch({status_code:t});this.patch({status_code:t})}}sendMessageToParent(e){if(e&&e.type&&"widgetHeight"===e.type){if(e.data===this.currentHeight)return;this.currentHeight=e.data}console.log("Message to parent:",e),window.top.postMessage(e,"*")}disconnectWebsocket(){this.socket&&this.socket.close(),this.socket=null}triggerAutoAccept(){this.autoAcceptSource.next()}clearAutoAccept(){this.autoAcceptSource=new r.t(1),this.autoAccept$=this.autoAcceptSource.asObservable()}}return e.ɵfac=function(t){return new(t||e)(c.LFG(d.r))},e.ɵprov=c.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},8593:(e,t,n)=>{n.d(t,{n:()=>W});var i=n(5861),s=n(7582),r=n(9549),o=n(9933),a=n(5762),l=n(2340),c=n(667);const d={created:"form",form:"form",prerequest:"form",terms_and_conditions:"form",waiting_terms_and_conditions:"form",waiting_password:"form",waiting_otp_seguridad_social:"otp_ss",waiting_login_seguridad_social:"otp_ss",invalid_otp_seguridad_social:"otp_ss",waiting_otp_carpeta_ciudadana:"otp_cc",waiting_login_carpeta_ciudadana:"otp_cc",invalid_otp_carpeta_ciudadana:"otp_cc",waiting_otp_aeat:"otp_aeat",waiting_login_aeat:"otp_aeat",invalid_otp_aeat:"otp_aeat",waiting_login_bde:"otp_bde",waiting_otp_bde:"otp_bde",invalid_otp_bde:"otp_bde",abandoned_after_bad_phone:"abandoned",abandoned_after_terms_and_conditions:"abandoned",abandoned_after_invalid_otp_seguridad_social:"abandoned",abandoned_after_waiting_otp_seguridad_social:"abandoned",abandoned_after_invalid_otp_aeat:"abandoned",abandoned_after_waiting_otp_aeat:"abandoned",abandoned_after_waiting_otp_bde:"abandoned",abandoned_after_invalid_otp_bde:"abandoned",abandoned_after_waiting_otp_carpeta_ciudadana:"abandoned",abandoned_after_invalid_otp_carpeta_ciudadana:"abandoned",all_documents_downloaded:"success",partial_documents_downloaded:"success",consent_process_completed:"success",partial_documents_downloaded_and_deleted:"success",all_documents_downloaded_and_deleted:"success",failed_with_retry:"failed",failed_without_retry:"failed",failed_documents_downloaded:"failed",consent_process_canceled:"failed",failed_job_task_cirbe:"failed",no_service:"no-service",no_clave_pin_service:"no-service",no_cirbe_cp_service:"no-service",no_sms_service:"no-service",stand_by:"standby","no-phone":"no-phone","no-more-phone":"no-phone",bad_phone:"bad-phone",error_expiration_date:"error-expiration-date",error_birth_date:"error-birth-date",error_support_number:"error-support-number",duplicated:"duplicated"};var u=n(182),h=n(6305),p=n(4650),m=n(8594),f=n(8467),g=n(7489),_=n(8460),b=n(9045),v=n(7367),y=n(7308),w=n(1742),x=n(3687);const S=["formStep"],C=["otpStep"];function T(e,t){1&e&&(p.TgZ(0,"div",8),p._UZ(1,"mat-progress-spinner",9),p.qZA()),2&e&&(p.xp6(1),p.Q6J("value",0))}function k(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-form-step",20,21),p.NdJ("openTerms",(function(){p.CHM(e);const t=p.oxw(3);return p.KtG(t.showTermsDialog=!0)})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("skipCreationOfRequest",e.skipCreationOfRequest)("deviceInfoDetails",e.deviceInfoDetails)("flowName",e.flowName)("acceptCirbe",e.acceptCirbe)("requestIDFromURL",e.requestIDFromURL)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("data",e.data)("labels",e.labels)("lang",e.currentLang)("editable_dates",e.editable_dates)}}function M(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-shared-otp-step",22,23),p.NdJ("resendOTP",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.resendOTP(t))}))("errorPhone",(function(){p.CHM(e);const t=p.oxw(3);return p.KtG(t.setRequestStatus("failed_login_otp"))}))("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.requestOTP(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("otpType",e.getOtpType(e.requestStatus))("flowType",e.flowName)("data",e.data)("labels",e.labels)("minLength",e.getOTPMinLength())("logoCustom",e.getLogoCustom())("lastThreeNumbersPhone",e.lastThreeNumbersPhone)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function I(e,t){if(1&e&&p._UZ(0,"belender-success-step",24),2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("flowName",e.flowName)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function E(e,t){if(1&e&&p._UZ(0,"belender-duplicated-request-step",25),2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)}}function A(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-error-birthday-step",26),p.NdJ("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.setBirthDate(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function O(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-error-expiration-step",26),p.NdJ("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.setExpiration(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function L(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-error-support-number-step",26),p.NdJ("nextStep",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.setSupportNumber(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function D(e,t){if(1&e&&p._UZ(0,"belender-fail-step",27),2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function P(e,t){if(1&e&&p._UZ(0,"belender-abandoned-step",27),2&e){const e=p.oxw(3);p.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function N(e,t){if(1&e&&p._UZ(0,"belender-no-service-step",28),2&e){const e=p.oxw(3);p.Q6J("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("data",e.data)}}function q(e,t){if(1&e&&p._UZ(0,"belender-standby-step",28),2&e){const e=p.oxw(3);p.Q6J("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("data",e.data)}}function R(e,t){if(1&e&&(p.TgZ(0,"div",29)(1,"div",30)(2,"h1",31),p._uU(3),p.qZA()(),p.TgZ(4,"div",32),p._uU(5),p.qZA()()),2&e){const e=p.oxw(3);p.xp6(3),p.Oqu(null==e.labels||null==e.labels.warnings?null:e.labels.warnings.requestNoExist),p.xp6(1),p.Udp("color",e.data.styles.colors.text),p.xp6(1),p.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.noRequests," ")}}function Y(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"belender-cancel-request",33),p.NdJ("updateStatusCode",(function(t){p.CHM(e);const n=p.oxw(3);return p.KtG(n.setCancel(t))})),p.qZA()}if(2&e){const e=p.oxw(3);p.Q6J("flowType",e.flowName)("data",e.data)("labels",e.labels)("textColor",e.data.styles.colors.text)("customText",e.data.config.cancelRequestText)}}function F(e,t){if(1&e&&(p._UZ(0,"div",34),p.ALo(1,"safeHtml")),2&e){const e=p.oxw(3);p.Udp("color",e.data.styles.colors.text),p.Q6J("innerHTML",e.data[e.flowName]&&null!=e.data[e.flowName]&&null!=e.data[e.flowName].texts&&null!=e.data[e.flowName].texts.form&&e.data[e.flowName].texts.form.aditionalDescription?p.lcZ(1,3,(null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.aditionalDescription)||""):"",p.oJD)}}function U(e,t){if(1&e&&(p.ynx(0),p.YNc(1,k,2,10,"belender-form-step",10),p.YNc(2,M,2,8,"belender-shared-otp-step",11),p.YNc(3,I,1,4,"belender-success-step",12),p.YNc(4,E,1,2,"belender-duplicated-request-step",13),p.YNc(5,A,1,3,"belender-error-birthday-step",14),p.YNc(6,O,1,3,"belender-error-expiration-step",14),p.YNc(7,L,1,3,"belender-error-support-number-step",14),p.YNc(8,D,1,3,"belender-fail-step",15),p.YNc(9,P,1,3,"belender-abandoned-step",15),p.YNc(10,N,1,2,"belender-no-service-step",16),p.YNc(11,q,1,2,"belender-standby-step",16),p.YNc(12,R,6,4,"div",17),p.YNc(13,Y,1,5,"belender-cancel-request",18),p.YNc(14,F,2,5,"div",19),p.BQk()),2&e){const e=p.oxw(2);p.xp6(1),p.Q6J("ngIf","form"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","otp_ss"==e.requestStatus||"otp_aeat"==e.requestStatus||"otp_bde"==e.requestStatus||"otp_cc"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","success"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","duplicated"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","error-birth-date"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","error-expiration-date"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","error-support-number"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","failed"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","abandoned"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","no-service"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","standby"==e.requestStatus),p.xp6(1),p.Q6J("ngIf","created"!=e.step),p.xp6(1),p.Q6J("ngIf",e.showCancelRequest&&e.data.config.cancelRequest),p.xp6(1),p.Q6J("ngIf","form"===e.requestStatus&&!e.loadingRequestData&&e.data[e.flowName]&&(null==e.data[e.flowName]?null:e.data[e.flowName].showAditionalDescription))}}function Z(e,t){1&e&&p._UZ(0,"belender-disabled-url")}function H(e,t){if(1&e&&(p.TgZ(0,"div",35),p._UZ(1,"div",36),p.qZA()),2&e){const e=p.oxw(2);p.xp6(1),p.Q6J("innerHTML",e.warning,p.oJD)}}function j(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"div",37)(1,"div",29)(2,"div",38),p._uU(3),p.qZA(),p._UZ(4,"div",39),p.qZA(),p.TgZ(5,"div",40)(6,"button",41),p.NdJ("click",(function(){p.CHM(e);const t=p.oxw(2);return p.KtG(t.error=!1)})),p._uU(7),p.qZA()()()}if(2&e){const e=p.oxw(2);p.xp6(3),p.Oqu(null==e.labels||null==e.labels.warnings?null:e.labels.warnings.error),p.xp6(1),p.Udp("color",e.data.styles.colors.text),p.Q6J("innerHTML",e.error,p.oJD),p.xp6(3),p.hij(" ",null==e.labels?null:e.labels.manual," ")}}function z(e,t){if(1&e&&(p.TgZ(0,"div",3)(1,"div"),p.YNc(2,T,2,1,"div",4),p.YNc(3,U,15,14,"ng-container",5),p.YNc(4,Z,1,0,"belender-disabled-url",5),p.YNc(5,H,2,1,"div",6),p.YNc(6,j,8,5,"div",7),p.qZA()()),2&e){const e=p.oxw();p.xp6(1),p.Gre("h-full w-full relative flex-auto p-0 md:p-3 ",null==e.data||null==e.data.styles?null:e.data.styles.typography,""),p.Udp("background",null==e.data||null==e.data.styles||null==e.data.styles.colors?null:e.data.styles.colors.background),p.xp6(1),p.Q6J("ngIf",e.data.config.infiniteLoopInCompleted&&"success"===e.requestStatus),p.xp6(1),p.Q6J("ngIf",!e.error&&!e.disableURL),p.xp6(1),p.Q6J("ngIf",!e.error&&e.disableURL),p.xp6(1),p.Q6J("ngIf",!e.loading&&e.warning&&"success"!=e.requestStatus&&"abandoned"!=e.requestStatus&&"failed"!=e.requestStatus),p.xp6(1),p.Q6J("ngIf",!e.loading&&e.error)}}function B(e,t){if(1&e){const e=p.EpF();p.TgZ(0,"vex-terms",42),p.NdJ("accepted",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.handleTermsResponse(!0))}))("cancelled",(function(){p.CHM(e);const t=p.oxw();return p.KtG(t.handleTermsResponse(!1))})),p.qZA()}if(2&e){const e=p.oxw();p.Q6J("flow",e.flowName)("lang",e.currentLang)("requestID",e.requestID)("requestStatus",e.solicitud?e.solicitud.status_code:"")("allData",e.data)}}function J(e,t){if(1&e&&(p.TgZ(0,"div",43),p._UZ(1,"mat-progress-spinner",44),p.TgZ(2,"p",45),p._uU(3),p.qZA()()),2&e){const e=p.oxw();p.xp6(3),p.hij(" ",e.loading||""," ")}}const V={"Seguridad Social":"waiting_otp_seguridad_social",AEAT:"waiting_otp_aeat","Banco de España":"waiting_otp_bde"},Q=["saved_otp","waiting_documents","fast_json_seguridad_social","widget_opened"];let W=class{constructor(e,t,n,i,s,r,o,a,c,d){this.cd=e,this.Activatedroute=t,this.utils=n,this.pinService=i,this.customizationStoreService=s,this.deviceInfoService=r,this.customizationService=o,this.translationService=a,this.pinUtils=c,this.scrollService=d,this.data=null,this.disableActions=!1,this.step="created",this.clientEnviroment="belender",this.showCancelRequest=!1,this._loading=null,this.error=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1,this.lastThreeNumbersPhone=null,this.requestIDFromURL=!1,this.paramsSetted=!1,this.stopPropagationOfSuccess=!1,this.picturesTaken=[],this.disableURL=!1,this.selectedLanguage="es",this.loadingRequestData=!1,this.env=l.N,this.intervalToAskBack=null,this.requestedFromDetail=!1,this.intervalCount=0,this.requestStatus="",this.isScaled=!1,this.flowName="ClavePin",this.currentLang="",this.acceptCirbe=!1,this.showTermsDialog=!1,this.editable_dates=!1,this.termsOpened=!1,localStorage.getItem("belender-language")&&(this.selectedLanguage=localStorage.getItem("belender-language")),this.deviceInfoDetails$=this.deviceInfoService.deviceInfo$.subscribe((e=>{Object.keys(e).length>0&&(this.deviceInfoDetails=e)}))}ngOnInit(){this.labels=this.pinUtils.labels,this.loading=this.labels.loadings.gettingData,this.pinUtils.request_status$.subscribe((e=>{this.setStatus()})),this.checkClientUrl()}ngAfterViewInit(){this.initFunctions()}ngOnDestroy(){window.screen&&window.screen.orientation&&this.orientationChangeHandler&&window.screen.orientation.removeEventListener("change",this.orientationChangeHandler)}ngAfterViewChecked(){}isQA(){return"qa"===l.N.env}get loading(){return this._loading}set loading(e){this._loading=e,null!==e&&this.onLoadingChanged(e)}getLogoCustom(){switch(this.requestStatus){case"otp_ss":return this.data[this.flowName]?.texts?.otpSS?.customImage;case"otp_cc":return this.data[this.flowName]?.texts?.otpCC?.customImage;case"otp_aeat":return this.data[this.flowName]?.texts?.otpAEAT?.customImage;case"otp_bde":return this.data[this.flowName]?.texts?.otpBDE?.customImage}return this.data[this.flowName]?.texts?.otpSS?.customImage}onLoadingChanged(e){this.scrollUpContent()}initFunctions(){var e=this;return(0,i.Z)((function*(){var t;e.Activatedroute.queryParams.subscribe((t=(0,i.Z)((function*(t){t&&t.request_id&&(e.requestID=t.request_id,console.warn(e.requestID)),t.lang?(e.currentLang=t.lang,e.loading=e.translationService.getFirstLoading(e.currentLang),e.setTranslation()):e.loading=e.pinUtils.labels.loadings.gettingData,"true"===t.editable_dates&&(e.editable_dates=t.editable_dates),e.customizationStoreService.USER_ID?e.setInitialData(e.customizationStoreService.USER_ID):e.loading=null})),function(e){return t.apply(this,arguments)}))}))()}setTranslation(){let e=this.translationService.getLabelsTranslated(this.currentLang);e&&(this.pinUtils.labels=e,this.labels=e)}getWindowsScreenOrientation(){window.screen&&window.screen.orientation?window.screen.orientation.addEventListener("change",this.orientationChangeHandler):console.warn("Screen Orientation API not supported.")}getOtpType(e){switch(e){case"otp_ss":default:return"otpSS";case"otp_cc":return"otpCC";case"otp_aeat":return"otpAEAT";case"otp_bde":return"otpBDE"}}setRequestStatus(e){this.pinUtils?.REQUEST?this.pinUtils.setRequestStatus(e):this.pinUtils.setRequest(new a.l),this.setStatus()}checkClientUrl(){const e=window.location.href;this.clientEnviroment=this.getClientFromUrl(e)}getOTPMinLength(){return this.env?"dev"===this.env.env&&"belender"===this.clientEnviroment?6:"qa"===this.env.env||"dev"===this.env.env&&"opendata"===this.clientEnviroment?3:6:6}getClientFromUrl(e){return e.includes("opendata")?"opendata":"belender"}setInitialData(e){var t=this;return(0,i.Z)((function*(){if(yield t.validateRequestIdInUrl(),t.flowConfig=(0,h.cm)(yield t.getFlow(e)),t.funderConfig=t.customizationStoreService.FUNDER_CONFIG,t.funderStyles=t.customizationStoreService.FUNDER_STYLES,t.data={config:t.funderConfig,styles:t.funderStyles,[t.flowName]:t.flowConfig},(0,h.bf)(t.data,t.flowName),!t.data.config||!t.data.config.funder_id)return t.showAlert(t.pinUtils.labels.warnings.error,t.pinUtils.labels.warnings.noCustomization,"error"),t.loading=null,void t.cd.markForCheck();t.financiadorID=t.data.config.funder_id||"",t.customizationStoreService.setFunderID(t.financiadorID),t.disableURL=t.data.config.disableUrlWidget,t.loading=null,yield t.utils.preloadImages(t.flowConfig,t.funderStyles),t.cd.markForCheck(),t.pinUtils.sendMessageToParent({type:"widgetLoaded",data:{}})}))()}getFlow(e){var t=this;return(0,i.Z)((function*(){return new Promise((n=>{t.customizationService.getCustomizationByFlow(e,t.flowName,t.currentLang||t.customizationStoreService.LANG,t.requestID,t.solicitud?t.solicitud.status_code:"").then((e=>{n(e?.data?e.data:null)}),(e=>{n(null)}))}))}))()}validateRequestIdInUrl(){var e=this;return(0,i.Z)((function*(){return new Promise((t=>{var n;e.Activatedroute.queryParams.subscribe({next:(n=(0,i.Z)((function*(n){if(n&&n.acceptTerms&&(e.autoAcceptTerms=!0),n&&n.request_id){e.disableURL=!1,e.requestID=n.request_id;let i=yield e.setFormFromVcCode(n.request_id,n);e.requestIDFromURL=!0,t(i)}else n?(e.setParamsToRequest(n),t(null)):(e.loading=null,t(null))})),function(e){return n.apply(this,arguments)}),error:()=>{e.loading=null,t(null)}})}))}))()}syncAcceptCirbeFromRequestPayload(e){e&&!0===e.add_cirbe&&(this.acceptCirbe=!0)}setParamsToRequest(e){this.pinUtils?.REQUEST||this.pinUtils.setRequest(new a.l),e.success&&(this.stopPropagationOfSuccess=!0);const t=e.accept_cirbe??e.add_cirbe;(!0===t||"true"===t||"1"===t)&&(this.acceptCirbe=!0),(e.document_number||e.document)&&!this.pinUtils?.REQUEST.person_document_number&&(this.pinUtils.REQUEST.person_document_number=e.document_number||e.document,this.requestIDFromURL=!0),(e.birth_date||e.birthday)&&!this.pinUtils?.REQUEST.birth_date&&(this.pinUtils.REQUEST.birth_date=e.birth_date||e.birthday,this.requestIDFromURL=!0),(e.document_expiration_date||e.expiration)&&!this.pinUtils.REQUEST.person_document_expiration_date&&(this.pinUtils.REQUEST.person_document_expiration_date=e.document_expiration_date||e.expiration,this.requestIDFromURL=!0),(e.document_support||e.supportNumber)&&!this.pinUtils.REQUEST.document_support&&(this.pinUtils.REQUEST.document_support=e.document_support||e.supportNumber,this.requestIDFromURL=!0),e.email&&!this.pinUtils.REQUEST.email&&(this.pinUtils.REQUEST.email=e.email,this.requestIDFromURL=!0,this.paramsSetted=!0),this.paramsSetted=!0}setFormFromVcCode(e,t){var n=this;return(0,i.Z)((function*(){return n.loading=n.pinUtils.labels.loadings.gettingData,n.loadingRequestData=!0,new Promise((i=>{n.pinService.getSolicitudByCode(e).then((e=>{if(e&&e.data){let i=e.data;i.status_code=i.consent_process_completed?"consent_process_completed":i.status_code,u.t.shouldIgnoreWebhookStatus(i.status_code)&&n.pinUtils.REQUEST?.status_code&&(i={...i,status_code:n.pinUtils.REQUEST.status_code}),n.syncAcceptCirbeFromRequestPayload(i),n.pinUtils.setRequest(i),n.setRequestStatus(n.pinUtils.REQUEST.status_code),n.pinUtils.subscribeWS(),n.loading=null,n.skipCreationOfRequest=n.solicitud&&n.solicitud.status_code&&"prerequest"!=n.solicitud.status_code,n.autoAcceptTerms?n.pinUtils.triggerAutoAccept():n.setParamsToRequest(t)}else n.loading=null;n.loadingRequestData=!1,i(n.solicitud||null)})).catch((e=>{n.loading=null,n.loadingRequestData=!1,i(null)}))}))}))()}handleBadPhone(){this.pinUtils.disconnectWebsocket(),this.loading=this.pinUtils.labels.loadings.validatingData,this.pinService.noMatchPhone({request_id:this.pinUtils.REQUEST.request_id,user_id:this.customizationStoreService.USER_ID}).then((e=>{this.pinUtils.REQUEST||(this.pinUtils.setRequest(new a.l),this.setRequestStatus(this.pinUtils.REQUEST.status_code)),e&&e.data&&(this.pinUtils.setRequest(e.data),this.setRequestStatus(this.pinUtils.REQUEST.status_code)),this.loading=null})).catch((e=>{this.showAlert("Error!",e),setTimeout((()=>{this.pinUtils.REQUEST||(this.pinUtils.setRequest(new a.l),this.setRequestStatus(this.pinUtils.REQUEST.status_code)),this.setRequestStatus("failed_without_retry"),this.loading=null}),1e3)}))}sendNewData(e){this.loading=this.pinUtils.labels.loadings.sendingData,this.pinService.fixData(this.pinUtils.REQUEST.requestID,e).then((e=>{e.status&&"error"==e.status?e.message&&(this.showAlert("Error!",e,"error"),this.loading=null):e&&"success"==e.status&&(this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),this.loading=this.pinUtils.labels.loadings.validatingData,this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error,"error")}))}showAlert(e,t,n){this.loading=null,this.getFunderIconType(n),this.warning=e?`<div class="flex flex-col w-full items-start gap-0 pl-2 mr-1"><strong class="text-md" >${e}</strong><small>${t}</small></div>`:null}getFunderIconType(e){if(!e||!this.funderStyles)return"error";switch(e){case"error":return this.funderStyles.errorIcon||e;case"success":return this.funderStyles.successIcon||e;case"warning":return this.funderStyles.warningIcon||e;case"info":return this.funderStyles.infoIcon||e;default:return e}}isBdeStatus(){let e=this.pinUtils.REQUEST?this.pinUtils.REQUEST.status_code:null;return!!e&&("waiting_otp_bde"===e||"waiting_login_bde"===e||"invalid_otp_bde"===e)}sendOtpToBde(e){this.pinUtils.disconnectWebsocket(),this.pinService.sendOTPToBde(e,"qa"===l.N.env).then((e=>{e.status&&"error"==e.status?(e.message&&"Invalid request status: waiting_login_seguridad_social"==e.message?this.showAlert(this.pinUtils.labels.warnings.error,this.pinUtils.labels.warnings.noOtp):this.showAlert("Error!",e.message?e.message:e),this.loading=null):e?(console.warn("handle success!"),e.data?e.data.consent_process_completed=!0:e.consent_process_completed=!0,this.handleRequestStatus(e.data?e.data:e),this.cd.markForCheck()):this.loading=null})).catch((e=>{this.showAlert("Error!",e&&e.error?e.error:e),this.loading=null}))}requestOTP(e){var t=this;return(0,i.Z)((function*(){if(!e?.code)return void t.showAlert("Error",t.pinUtils.labels.warnings.wrongOtp);t.showAlert(null,null),t.loading=t.labels.loadings.sendingData;const n={user_id:t.customizationStoreService.USER_ID,request_id:t.pinUtils.REQUEST.request_id,code:e.code};try{if(t.isBdeStatus()){const e=yield t.sendOtpToBde(n);return void t.handleSendOtpResponse(e)}const e=yield t.pinService.sendOTP(n,t.isQA());t.handleSendOtpResponse(e)}catch(e){const n=e?.error??e?.message??String(e);t.showAlert("Error!",n)}finally{t.loading=null}}))()}handleSendOtpResponse(e){if(e)return"error"===e.status?"Invalid request status: waiting_login_seguridad_social"===e.message?void this.showAlert(this.pinUtils.labels.warnings.error,this.pinUtils.labels.warnings.noOtp):void this.showAlert("Error!",e.message??e):"success"===e.status?(this.handleRequestStatus(e.data??e),void this.cd.markForCheck()):void this.showAlert("Error!",this.pinUtils.labels.warnings.noOtp);this.showAlert("Error!",this.pinUtils.labels.warnings.noOtp)}handleRequestStatus(e){if(e.consent_process_completed)return this.requestedFromDetail=!0,this.pinUtils.sendMessageToParent({type:"response",data:{status_message:"El proceso de consentimiento ha finalizado",widget_url:this.pinUtils?.REQUEST?.widget_url||"",status_code:"consent_process_completed",user_id:this.customizationStoreService?.USER_ID||"",funder_id:this.customizationStoreService?.FUNDER_ID||"",request_id:this.pinUtils?.REQUEST?.request_id||"",widget_url_boxed:this.pinUtils?.REQUEST?.widget_url_boxed||""}}),this.pinUtils.setRequestStatus("consent_process_completed"),setTimeout((()=>this.pinUtils.disconnectWebsocket()),1e3),void(this.data[this.flowName].showDocumentsOnSuccess&&!this.intervalToAskBack&&this.initIntervalToAskBack());if(this.otpComponent?.resetOtpNumber(),!e.otp_status&&!e.next_step_detail)return this.pinUtils.setRequestStatus("failed"),void this.pinUtils.sendMessageToParent({type:"response",data:e});if("INVALID"===e.otp_status)return this.pinUtils.setRequestStatus(e.status_code??"failed"),this.showAlert(this.pinUtils.labels.warnings.error,this.pinUtils.labels.warnings.wrongOtp),void this.pinUtils.sendMessageToParent({type:"response",data:e});if("VALID"===e.otp_status){this.showAlert(null,null);const t=this.firstPortal(e.next_step_detail);return this.pinUtils.setRequestStatus(t&&V[t]||e.status_code||"failed"),void this.pinUtils.sendMessageToParent({type:"response",data:e})}this.pinUtils.setRequestStatus(e.status_code||"failed"),this.pinUtils.sendMessageToParent({type:"response",data:e})}firstPortal(e){return e?(Array.isArray(e)?e[0]:e)?.portal:void 0}askToBack(){this.pinService.getSolicitudByCode(this.pinUtils?.REQUEST?.request_id).then((e=>{if(e&&e.data){if(this.syncAcceptCirbeFromRequestPayload(e.data),u.t.shouldIgnoreWebhookStatus(e.data.status_code))return void(this.loading=null);this.pinUtils.setRequest(e.data),this.setRequestStatus(this.pinUtils.REQUEST.status_code),this.loading=null}else this.loading=null})).catch((e=>{this.loading=null}))}gotoErrorPhone(){}setBirthDate(e){}setExpiration(e){}setSupportNumber(e){}resendOTP(e){let t={request_id:this.pinUtils?.REQUEST?.request_id,user_id:this.customizationStoreService.USER_ID};this.loading="Reenviando OTP...",this.pinUtils.subscribeWS(),this.showAlert(null,null),this.pinService.resendOTP(t).then((e=>{e&&e.data&&(this.pinUtils.setRequest(e.data),this.setRequestStatus(this.pinUtils.REQUEST.status_code)),this.loading=null})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.loading=null}))}initIntervalToAskBack(){!this.pinUtils?.REQUEST||!this.pinUtils?.REQUEST?.request_id||this.intervalToAskBack||(this.intervalToAskBack=setInterval((()=>{this.askDetailToBack(this.pinUtils.REQUEST.request_id),this.intervalCount++,this.intervalCount>20&&this.stopInterval()}),5e3))}stopInterval(){this.intervalToAskBack&&clearInterval(this.intervalToAskBack),this.intervalToAskBack=null,this.intervalCount=0}askDetailToBack(e){let t=JSON.parse(JSON.stringify(this.pinUtils.REQUEST.status_code));(e||this.pinUtils?.REQUEST?.request_id)&&"consent_process_completed"!==t?this.pinService.getSolicitudByCode(e).then((e=>{if(e&&e.data){let n=e.data;if(n.status_code=n.consent_process_completed?"consent_process_completed":n.status_code,u.t.shouldIgnoreWebhookStatus(n.status_code))return;this.syncAcceptCirbeFromRequestPayload(n),t!=n.status_code&&(this.pinUtils.setRequest(n),this.setRequestStatus(this.pinUtils.REQUEST.status_code))}})).catch((e=>{this.loading=null,this.loadingRequestData=!1})):this.stopInterval()}setStatus(){if(console.error("set status"),this.pinUtils?.REQUEST){let e=this.pinUtils?.REQUEST.status_code;if(Q.includes(e))return;this.showCancelRequest=!0;let t=d[e];t?("success"===t&&this.funderConfig&&this.funderConfig.infiniteLoopInCompleted&&(this.loading=" "),("abandoned"===t||"failed"===t)&&(this.showCancelRequest=!1),this.requestStatus=t,this.loading=null):(this.requestStatus="loading",this.loading=this.pinUtils.labels.loadings.validatingData,this.initIntervalToAskBack())}this.cd.markForCheck()}scrollUpContent(){setTimeout((()=>{this.scrollService.requestScrollMainTop()}),300)}sendRetry(){}setCancel(e){this.setRequestStatus(e)}pictureTaken(e){this.picturesTaken.push(e._imageAsDataUrl)}getIfShowLogo(){return("loading"!=this.requestStatus&&"success"!=this.requestStatus&&!this.loading||!this.funderConfig?.infiniteLoopInCompleted)&&this.funderStyles?.withLogo}handleTermsResponse(e){this.showTermsDialog=!1,this.termsOpened=e,this.formComponent.setTermsCheck(e)}};W.ɵfac=function(e){return new(e||W)(p.Y36(p.sBO),p.Y36(m.gz),p.Y36(f.F),p.Y36(g.v),p.Y36(_.r),p.Y36(b.H),p.Y36(v.w),p.Y36(y.D),p.Y36(w._),p.Y36(x.a))},W.ɵcmp=p.Xpm({type:W,selectors:[["belender-widget-pin"]],viewQuery:function(e,t){if(1&e&&(p.Gf(S,5),p.Gf(C,5),p.Gf(S,5)),2&e){let e;p.iGM(e=p.CRH())&&(t.formComponent=e.first),p.iGM(e=p.CRH())&&(t.otpComponent=e.first),p.iGM(e=p.CRH())&&(t.theDiv=e.first)}},inputs:{solicitud:"solicitud",data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID"},features:[p._Bn([{provide:r.o2,useValue:{appearance:"standard"}}])],decls:3,vars:3,consts:[["id","widget-wrapper","class","h-full widget-belender",4,"ngIf"],[3,"flow","lang","requestID","requestStatus","allData","accepted","cancelled",4,"ngIf"],["class","loading-wrapper animated fadeIn",4,"ngIf"],["id","widget-wrapper",1,"h-full","widget-belender"],["class","flex justify-center h-full min-h-[300px] items-center",4,"ngIf"],[4,"ngIf"],["class","animated w-full fadeInRight",4,"ngIf"],["class","animated fadeInRight",4,"ngIf"],[1,"flex","justify-center","h-full","min-h-[300px]","items-center"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],[3,"skipCreationOfRequest","deviceInfoDetails","flowName","acceptCirbe","requestIDFromURL","texts","data","labels","lang","editable_dates","openTerms",4,"ngIf"],[3,"otpType","flowType","data","labels","minLength","logoCustom","lastThreeNumbersPhone","texts","resendOTP","errorPhone","nextStep",4,"ngIf"],[3,"data","labels","flowName","texts",4,"ngIf"],[3,"data","labels",4,"ngIf"],[3,"data","labels","texts","nextStep",4,"ngIf"],[3,"data","labels","texts",4,"ngIf"],[3,"texts","data",4,"ngIf"],["class","px-6 py-4 flex flex-col",4,"ngIf"],[3,"flowType","data","labels","textColor","customText","updateStatusCode",4,"ngIf"],["class","subheading-1 p-4 custom-html",3,"color","innerHTML",4,"ngIf"],[3,"skipCreationOfRequest","deviceInfoDetails","flowName","acceptCirbe","requestIDFromURL","texts","data","labels","lang","editable_dates","openTerms"],["formStep",""],[3,"otpType","flowType","data","labels","minLength","logoCustom","lastThreeNumbersPhone","texts","resendOTP","errorPhone","nextStep"],["otpStep",""],[3,"data","labels","flowName","texts"],[3,"data","labels"],[3,"data","labels","texts","nextStep"],[3,"data","labels","texts"],[3,"texts","data"],[1,"px-6","py-4","flex","flex-col"],[1,"title","m-0"],[1,"text-red-500"],[1,"subheading-1","pt-4"],[3,"flowType","data","labels","textColor","customText","updateStatusCode"],[1,"subheading-1","p-4","custom-html",3,"innerHTML"],[1,"animated","w-full","fadeInRight"],[1,"px-6","py-4","w-full","bg-orange-500/10","rounded-md","flex","flex-col","text-orange-600",3,"innerHTML"],[1,"animated","fadeInRight"],[1,"text-red-500","title","m-0"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"text-blue-500","bg-blue-50","px-8",3,"click"],[3,"flow","lang","requestID","requestStatus","allData","accepted","cancelled"],[1,"loading-wrapper","animated","fadeIn"],["color","accent","diameter","40","value","0","mode","indeterminate",1,"spinner"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&(p.YNc(0,z,7,10,"div",0),p.YNc(1,B,1,5,"vex-terms",1),p.YNc(2,J,4,1,"div",2)),2&e&&(p.Q6J("ngIf",t.data&&t.data.styles&&t.data.styles.colors&&!t.loading&&"loading"!=t.requestStatus),p.xp6(1),p.Q6J("ngIf",t.showTermsDialog),p.xp6(1),p.Q6J("ngIf",("loading"===t.requestStatus||t.loading)&&!t.error))},styles:[".widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.card[_ngcontent-%COMP%]{transition:all .2s ease;overflow:hidden;width:500px;max-width:100%;margin:0 auto}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}.webcam-wrapper[_ngcontent-%COMP%]{position:relative}.webcam-overlay[_ngcontent-%COMP%]{position:absolute;z-index:99;width:500px;top:0;left:0;width:100%;height:100%;justify-content:center}.webcam-overlay[_ngcontent-%COMP%] .overlay[_ngcontent-%COMP%]{background:url(/assets/img/exclude.png);width:100%;height:100%;background-repeat:no-repeat;background-size:cover;opacity:.7;max-width:500px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;top:0;left:0;background:#fff}"],data:{animation:[c.$]}}),W=(0,s.gn)([(0,o.c)()],W)},8489:(e,t,n)=>{n.r(t),n.d(t,{PinModule:()=>rt});var i=n(6895),s=n(6383),r=n(5592),o=n(4006),a=n(3798),l=n(9391),c=n(182),d=n(4650),u=n(8467),h=n(5601),p=n(9617),m=n(8429),f=n(342),g=n(9101),_=n(3731);function b(e,t){if(1&e&&d._UZ(0,"widget-documents",7),2&e){const e=d.oxw(2);d.Q6J("userId",e.userId)("packId",e.packId)("requestID",e.requestID)}}function v(e,t){if(1&e&&(d.TgZ(0,"div",3),d._UZ(1,"div",4)(2,"div",5),d.ALo(3,"safeHtml"),d.YNc(4,b,1,3,"widget-documents",6),d.qZA()),2&e){const e=d.oxw();d.xp6(1),d.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),d.Q6J("innerHTML",e.texts.success.title,d.oJD),d.xp6(1),d.Udp("color",e.data.styles.colors.text),d.Q6J("innerHTML",d.lcZ(3,9,e.texts.success.description||""),d.oJD),d.xp6(2),d.Q6J("ngIf",e.showDocuments)}}const y=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function w(e,t){if(1&e){const e=d.EpF();d.TgZ(0,"div",8)(1,"button",9),d.NdJ("click",(function(){d.CHM(e);const t=d.oxw();return d.KtG(t.gotoRedirect())})),d._uU(2),d.qZA()()}if(2&e){const e=d.oxw();d.Q6J("ngClass",d.kEZ(8,y,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),d.xp6(1),d.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),d.xp6(1),d.hij(" ",e.data[e.flowName].btnTextCallBack||e.labels.actions.clickToFinish," ")}}let x=(()=>{class e{constructor(e,t,n,i,s){this.formBuilder=e,this.utils=t,this.solicitudesService=n,this.packsS=i,this.cd=s,this.showDocuments=!1}ngOnInit(){this.uploadForm=this.formBuilder.group({file:[""]}),this.data&&this.data[this.flowName]&&this.data[this.flowName].enableUrlCallBack&&this.data[this.flowName].automaticRedirectCallBack&&this.data[this.flowName].callBackUrl?setTimeout((()=>{location.assign(this.data[this.flowName].callBackUrl)}),2e3):this.data&&this.data[this.flowName]&&this.data[this.flowName].showDocumentsOnSuccess&&(this.showDocuments=!0)}save(){}gotoRedirect(){this.data&&this.data[this.flowName]&&this.data[this.flowName].enableUrlCallBack&&this.data[this.flowName].callBackUrl&&location.assign(this.data[this.flowName].callBackUrl)}getIfShowLogo(){return!this.data?.config?.infiniteLoopInCompleted&&this.data?.styles?.withLogo}}return e.ɵfac=function(t){return new(t||e)(d.Y36(o.qu),d.Y36(u.F),d.Y36(h.M),d.Y36(p.U),d.Y36(d.sBO))},e.ɵcmp=d.Xpm({type:e,selectors:[["belender-success-step"]],inputs:{data:"data",texts:"texts",packId:"packId",requestID:"requestID",userId:"userId",flowName:"flowName",labels:"labels"},decls:3,vars:5,consts:[[3,"data","customImage","withLogo"],["class"," pt-4 pb-8 flex flex-col animated fadeIn",4,"ngIf"],["class","flex items-center gap-2 py-4 flex-col md:flex-row",3,"ngClass",4,"ngIf"],[1,"pt-4","pb-8","flex","flex-col","animated","fadeIn"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[3,"userId","packId","requestID",4,"ngIf"],[3,"userId","packId","requestID"],[1,"flex","items-center","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(d._UZ(0,"belender-widget-step-logo",0),d.YNc(1,v,5,11,"div",1),d.YNc(2,w,3,12,"div",2)),2&e&&(d.Q6J("data",t.data)("customImage",t.texts.success.customImage)("withLogo",t.getIfShowLogo()),d.xp6(1),d.Q6J("ngIf",!t.data.config.infiniteLoopInCompleted),d.xp6(1),d.Q6J("ngIf",t.data&&t.data[t.flowName]&&t.data[t.flowName].enableUrlCallBack&&!t.data[t.flowName].automaticRedirectCallBack))},dependencies:[i.mk,i.O5,m.y,f.A,g.lW,_.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var S=n(7367),C=n(5762),T=n(8593),k=n(1742),M=n(8460),I=n(7489),E=n(1572);const A=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function O(e,t){if(1&e){const e=d.EpF();d.TgZ(0,"div",9)(1,"button",10),d.NdJ("click",(function(){d.CHM(e);const t=d.oxw(2);return d.KtG(t.retry())})),d._uU(2),d.qZA()()}if(2&e){const e=d.oxw(2);d.Q6J("ngClass",d.kEZ(8,A,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),d.xp6(1),d.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),d.xp6(1),d.hij(" ",null==e.labels||null==e.labels.actions?null:e.labels.actions.retry," ")}}function L(e,t){if(1&e){const e=d.EpF();d.TgZ(0,"div",9)(1,"button",11),d.NdJ("click",(function(){d.CHM(e);const t=d.oxw(2);return d.KtG(t.newRequest())})),d._uU(2),d.qZA()()}if(2&e){const e=d.oxw(2);d.Q6J("ngClass",d.kEZ(8,A,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),d.xp6(1),d.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),d.xp6(1),d.hij(" ",null==e.labels||null==e.labels.actions?null:e.labels.actions.newRequest," ")}}function D(e,t){if(1&e&&(d.TgZ(0,"div",3)(1,"div",4),d._UZ(2,"div",5)(3,"div",6),d.ALo(4,"safeHtml"),d.qZA(),d.YNc(5,O,3,12,"div",7),d.YNc(6,L,3,12,"div",8),d.qZA()),2&e){const e=d.oxw();d.xp6(2),d.Q6J("innerHTML",e.texts.fail.title,d.oJD),d.xp6(1),d.Udp("color",e.data.styles.colors.text),d.Q6J("innerHTML",d.lcZ(4,6,e.texts.fail.description),d.oJD),d.xp6(2),d.Q6J("ngIf",e.pinUtils.REQUEST&&"failed_with_retry"==e.pinUtils.REQUEST.status_code),d.xp6(1),d.Q6J("ngIf",e.pinUtils.REQUEST&&"failed_documents_downloaded"==e.pinUtils.REQUEST.status_code)}}function P(e,t){if(1&e&&(d.TgZ(0,"div",12),d._UZ(1,"mat-progress-spinner",13),d.TgZ(2,"p",14),d._uU(3),d.qZA()()),2&e){const e=d.oxw();d.xp6(1),d.Q6J("value",0),d.xp6(1),d.Udp("color",e.data.styles.colors.text),d.xp6(1),d.Oqu(e.loading)}}let N=(()=>{class e{constructor(e,t,n,i){this.pinComponent=e,this.pinUtils=t,this.customizationStoreService=n,this.pinService=i,this.loading=null}ngOnInit(){this.resolveLabels()}resolveLabels(){this.labels||(this.labels=this.pinUtils.labels)}save(){}retry(){this.pinComponent?.showAlert(null),this.retryRequest(this.pinUtils?.REQUEST?.request_id)}newRequest(){this.pinComponent&&this.pinComponent.showAlert(null),this.pinUtils.setRequest(new C.l)}retryRequest(e){const t={request_id:this.pinUtils?.REQUEST?.request_id||e,user_id:this.customizationStoreService.USER_ID};this.loading=this.labels.loadings.resendingRequest,this.pinUtils.subscribeWS(),this.pinService.retryRequest(t).then((e=>{e&&e.data&&(this.pinUtils.setRequest(e.data),this.pinUtils.setRequestStatus(this.pinUtils.REQUEST.status_code)),this.loading=null})).catch((e=>{console.error(e),this.loading=null,this.pinComponent?.showAlert(this.labels?.alerts?.retryRequestError||this.labels?.errors?.retryRequest||"No fue posible reenviar la solicitud. Intenta nuevamente.")}))}}return e.ɵfac=function(t){return new(t||e)(d.Y36(T.n,9),d.Y36(k._),d.Y36(M.r),d.Y36(I.v))},e.ɵcmp=d.Xpm({type:e,selectors:[["belender-fail-step"]],inputs:{data:"data",texts:"texts",labels:"labels"},decls:3,vars:4,consts:[[3,"data","customImage"],["class","animated fadeIn fixed-content",4,"ngIf"],["class","loading-wrapper flex flex-col items-center animated fadeIn",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"px-2","py-4","flex","flex-col"],[1,"text-red-500","title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","flex items-center gap-2 p-4",3,"ngClass",4,"ngIf"],["class","flex items-center gap-2 p-4",3,"ngClass",4,"ngIf"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8",3,"click"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"],[1,"loading-wrapper","flex","flex-col","items-center","animated","fadeIn"],["color","accent","diameter","40","mode","indeterminate","aria-labelledby","fail-step-loading-text",1,"spinner",3,"value"],["id","fail-step-loading-text",1,"mt-6","text-center"]],template:function(e,t){1&e&&(d._UZ(0,"belender-widget-step-logo",0),d.YNc(1,D,7,8,"div",1),d.YNc(2,P,4,4,"div",2)),2&e&&(d.Q6J("data",t.data)("customImage",t.texts.fail.customImage),d.xp6(1),d.Q6J("ngIf",!t.loading),d.xp6(1),d.Q6J("ngIf",t.loading))},dependencies:[i.mk,i.O5,m.y,g.lW,E.Ou,_.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var q=n(3238),R=n(5439),Y=n.n(R),F=n(3755),U=n(3746),Z=n(2932),H=n(769),j=n(4246),z=n(5412),B=n(5895),J=n(1763),V=n(5696),Q=n(1094),W=n(7392),G=n(9549),$=n(4144);const K=["termsCheckbox"],X=["policyCheckbox"],ee=["assignmentCheckbox"];function te(e,t){if(1&e&&(d.TgZ(0,"mat-error"),d._uU(1),d.qZA()),2&e){const e=d.oxw();d.xp6(1),d.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.needDNI," ")}}function ne(e,t){if(1&e&&(d.TgZ(0,"mat-error"),d._uU(1),d.qZA()),2&e){const e=d.oxw();d.xp6(1),d.hij(" ",e.labels.warnings.invalidNieOrDni," ")}}function ie(e,t){if(1&e){const e=d.EpF();d.TgZ(0,"mat-hint")(1,"a",20),d.NdJ("click",(function(t){d.CHM(e);const n=d.oxw(2);return d.KtG(n.gotoExpirationDate(t))})),d.TgZ(2,"u"),d._uU(3),d.qZA()()()}if(2&e){const e=d.oxw(2);d.xp6(3),d.Oqu(e.labels.findExpiration)}}function se(e,t){if(1&e&&(d.TgZ(0,"mat-error"),d._uU(1),d.qZA()),2&e){const e=d.oxw(2);d.xp6(1),d.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.needExpirationDate," ")}}function re(e,t){if(1&e&&(d.TgZ(0,"mat-error"),d._uU(1),d.qZA()),2&e){const e=d.oxw(2);d.xp6(1),d.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.invalidDateFormat," ")}}function oe(e,t){if(1&e&&(d.TgZ(0,"mat-error"),d._uU(1),d.qZA()),2&e){const e=d.oxw(2);d.xp6(1),d.hij(" ",e.labels.warnings.wrongDate," ")}}function ae(e,t){if(1&e&&(d.TgZ(0,"mat-form-field",7)(1,"mat-label"),d._uU(2),d.qZA(),d._UZ(3,"input",19),d.YNc(4,ie,4,1,"mat-hint",9),d.YNc(5,se,2,1,"mat-error",9),d.YNc(6,re,2,1,"mat-error",9),d.YNc(7,oe,2,1,"mat-error",9),d.qZA()),2&e){const e=d.oxw();let t,n,i;d.Gre("",e.disabledInputs.expiration?"disabled-input":""," w-full flex-1 belender-form-field"),d.xp6(2),d.Oqu(e.labels.expiration),d.xp6(1),d.s9C("tabindex",e.disabledInputs.expiration?-1:1),d.uIk("aria-label",e.labels.expiration),d.xp6(1),d.Q6J("ngIf",e.isDni),d.xp6(1),d.Q6J("ngIf",null==(t=e.form.get("expired_date"))?null:t.hasError("required")),d.xp6(1),d.Q6J("ngIf",null==(n=e.form.get("expired_date"))?null:n.hasError("invalidFormat")),d.xp6(1),d.Q6J("ngIf",null==(i=e.form.get("expired_date"))?null:i.hasError("invalidDate"))}}function le(e,t){if(1&e&&(d.TgZ(0,"mat-error"),d._uU(1),d.qZA()),2&e){const e=d.oxw(2);d.xp6(1),d.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.needDate," ")}}function ce(e,t){if(1&e&&(d.TgZ(0,"mat-error"),d._uU(1),d.qZA()),2&e){const e=d.oxw(2);d.xp6(1),d.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.invalidDateFormat," ")}}function de(e,t){if(1&e&&(d.TgZ(0,"mat-error"),d._uU(1),d.qZA()),2&e){const e=d.oxw(2);d.xp6(1),d.hij(" ",e.labels.warnings.wrongDate," ")}}function ue(e,t){if(1&e&&(d.TgZ(0,"mat-error"),d._uU(1),d.qZA()),2&e){const e=d.oxw(2);d.xp6(1),d.hij(" ",e.labels.warnings.wrongDate," ")}}function he(e,t){if(1&e&&(d.TgZ(0,"mat-form-field",7)(1,"mat-label"),d._uU(2),d.qZA(),d._UZ(3,"input",21),d.YNc(4,le,2,1,"mat-error",9),d.YNc(5,ce,2,1,"mat-error",9),d.YNc(6,de,2,1,"mat-error",9),d.YNc(7,ue,2,1,"mat-error",9),d.qZA()),2&e){const e=d.oxw();let t,n,i,s;d.Gre("",e.disabledInputs.birthday?"disabled-input":""," w-full flex-1 belender-form-field"),d.xp6(2),d.Oqu(e.labels.birthday),d.xp6(1),d.s9C("tabindex",e.disabledInputs.birthday?-1:1),d.uIk("aria-label",e.labels.birthday),d.xp6(1),d.Q6J("ngIf",null==(t=e.form.get("expired_date"))?null:t.hasError("required")),d.xp6(1),d.Q6J("ngIf",null==(n=e.form.get("expired_date"))?null:n.hasError("invalidFormat")),d.xp6(1),d.Q6J("ngIf",null==(i=e.form.get("expired_date"))?null:i.hasError("invalidDate")),d.xp6(1),d.Q6J("ngIf",null==(s=e.form.get("expired_date"))?null:s.hasError("underAge"))}}function pe(e,t){if(1&e&&(d.TgZ(0,"mat-error"),d._uU(1),d.qZA()),2&e){const e=d.oxw(2);d.xp6(1),d.hij(" ",e.labels.warnings.wrongSupport," ")}}function me(e,t){if(1&e){const e=d.EpF();d.TgZ(0,"mat-form-field",7)(1,"mat-label"),d._uU(2),d.qZA(),d._UZ(3,"input",22),d.YNc(4,pe,2,1,"mat-error",9),d.TgZ(5,"mat-hint")(6,"a",20),d.NdJ("click",(function(t){d.CHM(e);const n=d.oxw();return d.KtG(n.gotoSupportAclaration(t))})),d.TgZ(7,"u"),d._uU(8),d.qZA()()()()}if(2&e){const e=d.oxw();let t;d.Gre("",e.disabledInputs.supportNumber?"disabled-input":""," w-full flex-1 belender-form-field"),d.xp6(2),d.Oqu(e.labels.support),d.xp6(1),d.s9C("tabindex",e.disabledInputs.supportNumber?-1:1),d.uIk("aria-label",e.labels.support),d.xp6(1),d.Q6J("ngIf",null==(t=e.form.get("support_number"))?null:t.hasError("invalidSupportNumber")),d.xp6(4),d.Oqu(e.labels.findExpiration)}}function fe(e,t){if(1&e&&(d.TgZ(0,"div",23)(1,"mat-form-field",7)(2,"mat-label"),d._uU(3),d.qZA(),d._UZ(4,"input",24),d.qZA()()),2&e){const e=d.oxw();d.xp6(1),d.Gre("",e.disabledInputs.email?"disabled-input":""," w-full flex-1 belender-form-field"),d.xp6(2),d.Oqu(e.labels.email),d.xp6(1),d.s9C("tabindex",e.disabledInputs.email?-1:1),d.s9C("placeholder",null==e.labels?null:e.labels.inputEmail),d.uIk("aria-label",e.labels.email)}}function ge(e,t){if(1&e&&(d.TgZ(0,"div",25),d._UZ(1,"mat-icon",26),d._uU(2),d.qZA()),2&e){const e=d.oxw();d.xp6(2),d.hij(" ",e.labels.warnings.haveToReadTerms," ")}}function _e(e,t){if(1&e){const e=d.EpF();d.TgZ(0,"div",27)(1,"belender-checkbox",28,29),d.NdJ("changeCheckbox",(function(t){d.CHM(e);const n=d.oxw();return d.KtG(n.setTerms(t))})),d.TgZ(3,"belender-terms-and-policy-links",30),d.NdJ("goToTerms",(function(){d.CHM(e);const t=d.oxw();return d.KtG(t.gotoTermsAndConditions())})),d.qZA()()()}if(2&e){const e=d.oxw();d.xp6(1),d.Q6J("color",e.data.styles.colors.title),d.xp6(2),d.Q6J("lang",e.lang)("flowName",e.flowName)("data",e.data)("linkType","terms")("firstSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.firstSentence)("secondSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.secondSentence)("thirdSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.thirdSentence)("policyActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.policyActionText)("termsActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.termsActionText)("customTerms",e.data[e.flowName].customTerms)}}function be(e,t){if(1&e){const e=d.EpF();d.TgZ(0,"div",27)(1,"belender-checkbox",31,32),d.NdJ("changeCheckbox",(function(t){d.CHM(e);const n=d.oxw();return d.KtG(n.setPolicy(t))})),d._UZ(3,"belender-terms-and-policy-links",33),d.qZA()()}if(2&e){const e=d.oxw();d.xp6(1),d.Q6J("color",e.data.styles.colors.title),d.xp6(2),d.Q6J("lang",e.lang)("flowName",e.flowName)("data",e.data)("linkType","policy")("policyActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.policyActionText)}}function ve(e,t){if(1&e){const e=d.EpF();d.TgZ(0,"div",27)(1,"belender-checkbox",34,35),d.NdJ("changeCheckbox",(function(t){d.CHM(e);const n=d.oxw();return d.KtG(n.setAssignment(t))})),d._UZ(3,"div",36),d.qZA()()}if(2&e){const e=d.oxw();d.xp6(1),d.Q6J("color",e.data.styles.colors.title),d.xp6(2),d.Q6J("innerHTML",(null==e.data[e.flowName]||null==e.data[e.flowName].texts?null:e.data[e.flowName].texts.dataAssignmentText)||(null==e.data[e.flowName]||null==e.data[e.flowName].config_translate?null:e.data[e.flowName].config_translate.dataAssignmentText)||(null==e.data||null==e.data.config?null:e.data.config.dataAssignmentText)||"",d.oJD)}}function ye(e,t){if(1&e&&(d.TgZ(0,"div",37),d._UZ(1,"mat-icon",38)(2,"div",39),d.qZA()),2&e){const e=d.oxw();d.xp6(2),d.Q6J("innerHTML",e.error,d.oJD)}}const we=function(e){return{background:e}};function xe(e,t){if(1&e&&(d.TgZ(0,"div",40),d._UZ(1,"mat-spinner",41),d.TgZ(2,"p"),d._uU(3),d.qZA()()),2&e){const e=d.oxw();d.Q6J("ngStyle",d.VKq(2,we,e.data.styles.colors.background)),d.xp6(3),d.Oqu(e.loading||"Cargando, espere por favor...")}}const Se=function(e){return{"dont-show-data":e}},Ce=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}},Te={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let ke=(()=>{class e{constructor(e,t,n,i,s,r,o,a,l){this.fb=e,this.utils=t,this.cd=n,this.widgetUtils=i,this.dialog=s,this.pinService=r,this.pinUtils=o,this.notis=a,this.customizationStoreService=l,this.lang="",this.editable_dates=!1,this.next=new d.vpe(null),this.esDNI=new d.vpe(null),this.goTerms=new d.vpe(null),this.deviceInfoDetails={},this.skipCreationOfRequest=!1,this.openTerms=new d.vpe,this.acceptTerms=!1,this.acceptPolicy=!1,this.step=0,this.assignment=!1,this.termsReaded=!1,this.isDni=!1,this.isNie=!1,this.disabledInputs={dni:!1,birthday:!1,supportNumber:!1,email:!1,expiration:!1},this.noValidate=!1,this.termsOpened=!1,this.loading=!1,this.error="",this.submitAttempted=!1}ngOnInit(){this.resolveLabels(),this.pinUtils.REQUEST?(this.setBaseForm(this.pinUtils.REQUEST),this.noValidate="terms_and_conditions"==this.pinUtils.REQUEST.status_code):this.setBaseForm(null),this.autoAcceptSub=this.pinUtils.autoAccept$.subscribe((()=>{setTimeout((()=>{this.sendAcceptTerms(),this.pinUtils.clearAutoAccept()}),50)}))}ngOnDestroy(){this.subscribeRequest&&this.subscribeRequest.unsubscribe(),this.autoAcceptSub&&this.autoAcceptSub.unsubscribe()}resolveLabels(){this.labels||(this.labels=this.pinUtils.labels)}sendPestana(){window.parent.open("www.google.com","_blank")}setRegex(e){if(!e)return;let t=this.widgetUtils.ValidateIDType(e);t&&t.type?(this.isDni="dni"===t.type,this.isNie="nie"===t.type):(this.isDni=!1,this.isNie=!1),this.form?.get("expired_date").setValidators([(0,Z.s)({checkFormat:!0,checkDate:!0,checkAge:!this.isDni})]),this.cd.markForCheck()}normalizeRequest(e){return{dni:e?.person_document_number??e?.dni??e?.document_number??null,birth:e?.person_birth_date??e?.birth_date??null,expiration:e?.person_document_expiration_date??null,email:e?.person_email??e?.email??e?.email_copy??null,supportNumber:e?.person_document_support??e?.document_support??null}}setBaseForm(e){let t=this.normalizeRequest(e),n=t?.dni||null,i=t.birth?Y()(t.birth).format("DD/MM/YYYY"):null,s=t.expiration?Y()(t.expiration).format("DD/MM/YYYY"):null,r=t.supportNumber||null,a=t.email||null;const l=this.data?.config??{};n&&this.setRegex(n),this.form=this.fb.group(this.isDni?l.followMail?{dni:[n,this.noValidate?[]:[o.kI.required,o.kI.maxLength(9),this.regexDNI()]],email:[a],document_type:["dni"],expired_date:[s,[(0,Z.s)({checkFormat:!0,checkDate:!0})]],support_number:[null],person_phone:[]}:{dni:[n,this.noValidate?[]:[o.kI.required,o.kI.maxLength(9),this.regexDNI()]],document_type:["dni"],expired_date:[s,[(0,Z.s)({checkFormat:!0,checkDate:!0})]],support_number:[null]}:l.followMail?{dni:[n,[o.kI.required,o.kI.maxLength(9),this.regexDNI()]],expired_date:[i],document_type:["nie"],support_number:[r],email:[a]}:{dni:[n,[o.kI.required,o.kI.maxLength(9),this.regexDNI()]],expired_date:[i],document_type:["nie"],support_number:[r]}),this.form.get("expired_date").setValidators([o.kI.required,(0,Z.s)({checkFormat:!0,checkDate:!0,checkAge:!this.isDni})]),this.form.markAsUntouched(),this.form.updateValueAndValidity(),this.requestIDFromURL&&this.disableEnableInputs(n,i,s,r,a)}forceEnableDisableInputs(e,t,n,i,s){let r=t?t.value:this.disabledInputs.birthday,o=i?i.value:this.disabledInputs.supportNumber;this.isNie&&r&&!r.value&&(o={value:!1}),this.disableEnableInputs(e?e.value:this.disabledInputs.dni,r,n?n.value:this.disabledInputs.expiration,o,s?s.value:this.disabledInputs.email)}disableEnableInputs(e,t,n,i,s){this.disabledInputs={dni:e||!1,birthday:!this.editable_dates&&(t||!1),supportNumber:i||!1,email:!!s,expiration:!this.editable_dates&&(n||!1)},this.cd.markForCheck()}regexDNI(){return e=>{const t=e.value;return t?(this.setRegex(t),this.isDni||this.isNie?null:{regexDNI:!0}):null}}setTermsCheck(e){this.checkComponent.checked=e,this.acceptTerms=e,this.termsReaded=e}nextStep(){if(!this.getFormsValid()||!this.getIfValid()||!this.getAssignmentValidation())return void(0,H.J)(this,this.cd);let e;const t=this.data?.config??{};e=this.isDni?{document_number:this.form.get("dni").value.toUpperCase(),check_legal:!0,document_expiration_date:this.utils.formatDate(this.form.get("expired_date").value)}:{document_number:this.form.get("dni").value.toUpperCase(),birth_date:this.utils.formatDate(this.form.get("expired_date").value),check_legal:!0,document_support:this.form.get("support_number").value},t.followMail&&(e.email_copy=this.form?.get("email")?.value||""),e.document_type=this.isDni?"dni":"nie",this.validateRequest(e)}gotoSupportAclaration(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(F.$,{panelClass:"fullscreen-dialog"})}gotoExpirationDate(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(U.R,{panelClass:"fullscreen-dialog"})}setTerms(e){this.acceptTerms=e,this.acceptTerms&&(this.data?.config??{}).forceChecks?this.gotoTermsAndConditions():this.acceptTerms||(this.termsReaded=!1)}setPolicy(e){this.acceptPolicy=e}setAssignment(e){this.assignment=e}getFormsValid(){if(!this.form||this.form.invalid)return!1;if((this.data?.config??{}).dontShowDataInTerms&&"terms_and_conditions"===this.pinUtils?.REQUEST?.status_code)return!0;const e=this.form.get("dni")?.value?.toString().trim();if(!e)return!1;const{type:t,valid:n}=this.widgetUtils.ValidateIDType(e)||{},i="nie"===t;if("dni"!==t&&!i||!n)return!1;const s=this.form.get("support_number")?.value?.toString().trim();return!(i&&!s)}getIfValid(){const e=this.data?.config??{};if(e.dontShowDataInTerms&&this.pinUtils.REQUEST&&this.pinUtils.REQUEST.status_code&&"terms_and_conditions"===this.pinUtils.REQUEST.status_code&&(this.acceptTerms=!0,this.acceptPolicy=!0),this.isDni||this.isNie){if(e.hideCheckLegal)return!e.showPolicyLink||this.acceptPolicy;{const t=!!e.showPolicyLink;return this.acceptTerms&&(!t||this.acceptPolicy)}}this.form.get("dni")?.setErrors({dni:!0})}getAssignmentValidation(){const e=this.data?.config??{};return!(e.forceChecks&&!e.hideCheckLegal&&!this.termsReaded)&&(!e.dataAssignmentCheck||this.assignment)}gotoTermsAndConditions(){this.openTerms.emit(!0)}setFormError(e){switch(e){case"nac":case"expiration":this.form.get("expired_date")?.setErrors({invalidDate:!0});break;case"dni":this.form.get("dni")?.setErrors({invalidDniOrNie:!0});break;case"sop":this.form.get("support_number")?.setErrors({invalidSupportNumber:!0})}}validateRequest(e){e.user_id=this.customizationStoreService.USER_ID,e.package_id=this.customizationStoreService.PACK_ID,this.loading=this.labels.loadings.validatingData,this.forceEnableDisableInputs({value:!0},{value:!0},{value:!0},{value:!0},{value:!0}),this.pinService.checkService(e).then((t=>{if(t&&t.status&&"success"==t.status)this.gotoTerms(e);else if(t.message){let n=this.pinUtils.parseErrorResponse(t.message);"no-service"==n.code?this.setNoService(e):(this.setFormError(n.code),this.loading=null),this.handleDisableInputs(n.code)}else this.setNoService(e)})).catch((t=>{if(t.message){let n=this.pinUtils.parseErrorResponse(t.message);"no-service"!=n.title?(this.showAlert(n.title,n.description),this.loading=null):(this.pinService.addSolicitud(e).then((e=>{this.pinService.setNoService({request_id:this.pinUtils.REQUEST}).then((e=>{this.pinUtils.setRequestStatus("no_service"),this.loading=null})).catch((e=>{this.pinUtils.setRequestStatus("no_service"),this.loading=null}))})),this.loading=null,this.cd.markForCheck()),console.log("handle code: ",n.code),this.handleDisableInputs(n.code)}else this.showAlert(this.labels?.warnings?.undefinedError,t),this.loading=null,this.cd.markForCheck()}))}gotoTerms(e){e.user_id=this.customizationStoreService.USER_ID,e.package_id=this.customizationStoreService.PACK_ID,this.acceptCirbe&&(e.add_cirbe=!0),this.pinUtils.REQUEST.request_id&&(e.request_id=this.pinUtils.REQUEST.request_id),this.loading=this.labels.loadings.sendingData,this.skipCreationOfRequest=this.pinUtils.REQUEST&&this.pinUtils.REQUEST.request_id&&this.pinUtils.REQUEST.status_code&&"prerequest"!=this.pinUtils.REQUEST.status_code,this.skipCreationOfRequest?(this.sendAcceptTerms(),this.pinUtils.subscribeWS()):this.pinService.addSolicitud(e).then((t=>{t&&t.status&&"error"==t.status?t.message&&(this.pinUtils.setRequest(e),400==t.code&&"Does not have Pin service"==t.message?this.pinService.setNoService({request_id:this.pinUtils.REQUEST.request_id}).then((e=>{this.pinUtils.setRequestStatus("no_service"),this.loading=null})).catch((e=>{this.pinUtils.setRequestStatus("no_service"),this.loading=null})):400==t.code&&"Incorrect support number"==t.message?(this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongSupport),this.pinUtils.setRequestStatus("form")):400==t.code&&"Incorrect date"==t.message?(console.warn("entro aquiiii"),this.form.get("expired_date")?.setErrors({invalidDate:!0}),this.pinUtils.setRequestStatus("form")):(this.pinUtils.setRequestStatus("form"),this.showAlert(this.labels?.warnings?.error,t.message))):t&&t.status&&"success"==t.status?(this.pinUtils.setRequest(t.data),this.pinUtils.subscribeWS(),this.sendAcceptTerms()):this.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+t)})).catch((e=>{e&&e.errorMessage&&this.showAlert(this.labels.warnings.error,e.errorMessage)}))}setNoService(e){this.loading=this.labels.loadings.validatingData,e.user_id=this.customizationStoreService.USER_ID,e.package_id=this.customizationStoreService.PACK_ID,this.pinUtils.REQUEST.request_id&&(e.request_id=this.pinUtils.REQUEST.request_id),this.pinService.addSolicitud(e).then((e=>{this.pinService.setNoService({request_id:this.pinUtils.REQUEST.request_id}).then((e=>{this.pinUtils.setRequestStatus("no_service"),this.loading=null,this.cd.markForCheck()})).catch((e=>{this.pinUtils.setRequestStatus("no_service"),this.loading=null,this.cd.markForCheck()}))}))}showAlert(e,t){this.error=`<div class="flex flex-col w-full items-start gap-0 pl-2"><strong class="text-md" >${e}</strong><small>${t}</small></div>`}sendAcceptTerms(e=!0){let t={user_id:this.customizationStoreService.USER_ID,request_id:this.pinUtils.REQUEST.request_id,terms_and_conditions:!0,opening:this.termsOpened?1:0};Object.keys(this.deviceInfoDetails).length>0&&(t={...t,ip:this.deviceInfoDetails.ip,device:this.deviceInfoDetails.device,os:`${this.deviceInfoDetails.os} ${this.deviceInfoDetails.os_version}`,resolution:this.deviceInfoDetails.screen}),e&&(this.loading=this.labels.loadings.validatingData),this.pinService.acceptTerms(t).then((e=>{e.status&&"error"==e.status?e.message&&"You have a request in progress"==e.message?location.pathname.indexOf("widget-boxed")>-1?location.assign(e.response.widget_url_boxed):location.assign(e.response.widget_url):e.message&&"Invalid request status: stand_by"==e.message?this.pinUtils.setRequestStatus("stand_by"):this.showAlert(this.labels?.warnings?.error,e.message?e.message:e):e&&"success"==e.status&&(this.pinUtils.subscribeWS(),this.pinUtils.setRequest(e.data),this.loading=null,this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert(this.labels?.warnings?.error,e.error),this.loading=null}))}handleDisableInputs(e){!e||setTimeout((()=>{"venc"===e&&this.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1},{value:!1}),"sop"===e&&this.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1},{value:!1}),"nac"===e&&this.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1},{value:!1}),this.cd.markForCheck()}),1e3)}}return e.ɵfac=function(t){return new(t||e)(d.Y36(o.qu),d.Y36(u.F),d.Y36(d.sBO),d.Y36(j.t),d.Y36(z.uw),d.Y36(I.v),d.Y36(k._),d.Y36(B.T),d.Y36(M.r))},e.ɵcmp=d.Xpm({type:e,selectors:[["belender-form-step"]],viewQuery:function(e,t){if(1&e&&(d.Gf(K,5),d.Gf(X,5),d.Gf(ee,5)),2&e){let e;d.iGM(e=d.CRH())&&(t.checkComponent=e.first),d.iGM(e=d.CRH())&&(t.policyCheckComponent=e.first),d.iGM(e=d.CRH())&&(t.assignmentCheckComponent=e.first)}},inputs:{flowName:"flowName",data:"data",texts:"texts",acceptCirbe:"acceptCirbe",requestIDFromURL:"requestIDFromURL",labels:"labels",lang:"lang",editable_dates:"editable_dates",deviceInfoDetails:"deviceInfoDetails",skipCreationOfRequest:"skipCreationOfRequest"},outputs:{next:"nextStep",esDNI:"isDni",goTerms:"goToTerms",openTerms:"openTerms"},features:[d._Bn([{provide:q.sG,useValue:Te},{provide:d.soG,useValue:"es-ES"}])],decls:28,vars:46,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content","px-2","relative",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4","custom-html",3,"innerHTML"],[3,"ngClass"],[1,"mb-3","pt-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline"],["id","dniInput","formControlName","dni","maxlength","9","matInput","",3,"tabindex"],[4,"ngIf"],["appearance","outline",3,"class",4,"ngIf"],["class","w-full",4,"ngIf"],[1,"mb-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["class","px-2 flex items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500",4,"ngIf"],["class","flex justify-start items-center w-full flex-100",4,"ngIf"],["class","pl-3 w-full pr-4 flex items-center gap-2 py-2 rounded-md mt-3 bg-orange-500/10 text-orange-600",4,"ngIf"],[1,"flex","items-center","gap-2","p-4","flex-col","md:flex-row",3,"ngClass"],["id","sendBtn","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"],["class","loading-overlay flex flex-col gap-3 items-center justify-center ",3,"ngStyle",4,"ngIf"],["id","dniExpireInput","required","","formControlName","expired_date","type","text","mask","00/00/0000","matInput","",3,"tabindex"],["target","_blank",1,"text-sm","hover:text-blue-500","cursor-pointer",3,"click"],["id","dniExpireInput","required","","formControlName","expired_date","type","text","matInput","","mask","d0/M0/0000",3,"tabindex"],["id","supportNumberInput","maxlength","9","minlength","6","required","","formControlName","support_number","matInput","",3,"tabindex"],[1,"w-full"],["id","emailInput","formControlName","email","required","","type","email","matInput","",3,"tabindex","placeholder"],[1,"px-2","flex","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"],["svgIcon","mat:warning",1,"text-xs","w-4","h-4"],[1,"flex","justify-start","items-center","w-full","flex-100"],["id","termsCheckbox",3,"color","changeCheckbox"],["termsCheckbox",""],[3,"lang","flowName","data","linkType","firstSentence","secondSentence","thirdSentence","policyActionText","termsActionText","customTerms","goToTerms"],["id","policyCheckbox",3,"color","changeCheckbox"],["policyCheckbox",""],[3,"lang","flowName","data","linkType","policyActionText"],[3,"color","changeCheckbox"],["assignmentCheckbox",""],[1,"custom-html",3,"innerHTML"],[1,"pl-3","w-full","pr-4","flex","items-center","gap-2","py-2","rounded-md","mt-3","bg-orange-500/10","text-orange-600"],["svgIcon","mat:warning"],[1,"font-bold",3,"innerHTML"],[1,"loading-overlay","flex","flex-col","gap-3","items-center","justify-center",3,"ngStyle"],["diameter","30"]],template:function(e,t){if(1&e&&(d._UZ(0,"belender-widget-step-logo",0),d.TgZ(1,"form",1)(2,"div",2),d._UZ(3,"div",3)(4,"div",4),d.ALo(5,"safeHtml"),d.qZA(),d.TgZ(6,"div",5)(7,"div",6)(8,"mat-form-field",7)(9,"mat-label"),d._uU(10),d.qZA(),d._UZ(11,"input",8),d.YNc(12,te,2,1,"mat-error",9),d.YNc(13,ne,2,1,"mat-error",9),d.qZA(),d.YNc(14,ae,8,10,"mat-form-field",10),d.YNc(15,he,8,10,"mat-form-field",10),d.YNc(16,me,9,8,"mat-form-field",10),d.YNc(17,fe,5,7,"div",11),d.qZA()(),d.TgZ(18,"div",12),d.YNc(19,ge,3,1,"div",13),d.YNc(20,_e,4,11,"div",14),d.YNc(21,be,4,6,"div",14),d.YNc(22,ve,4,2,"div",14),d.YNc(23,ye,3,1,"div",15),d.qZA(),d.TgZ(24,"div",16)(25,"button",17),d.NdJ("click",(function(){return t.nextStep()})),d._uU(26),d.qZA()(),d.YNc(27,xe,4,4,"div",18),d.qZA()),2&e){let e,n;d.Q6J("data",t.data)("customImage",t.texts.form.customImage),d.xp6(1),d.Q6J("formGroup",t.form),d.xp6(2),d.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),d.Q6J("innerHTML",t.texts.form.title,d.oJD),d.xp6(1),d.Udp("color",t.data.styles.colors.text),d.Q6J("innerHTML",d.lcZ(5,38,t.texts.form.description||""),d.oJD),d.xp6(2),d.Q6J("ngClass",d.VKq(40,Se,t.data.config.dontShowDataInTerms&&t.pinUtils.REQUEST.request_id&&t.pinUtils.REQUEST.status_code&&"terms_and_conditions"===t.pinUtils.REQUEST.status_code)),d.xp6(2),d.Gre("",t.disabledInputs.dni?"disabled-input":""," w-full flex-1 belender-form-field"),d.xp6(2),d.Oqu(t.isDni?t.labels.dni:t.isNie?t.labels.nie:t.labels.nieOrDni),d.xp6(1),d.s9C("tabindex",t.disabledInputs.dni?-1:1),d.uIk("aria-label",t.isDni?t.labels.dni:t.isNie?t.labels.nie:t.labels.nieOrDni),d.xp6(1),d.Q6J("ngIf",null==(e=t.form.get("dni"))?null:e.hasError("required")),d.xp6(1),d.Q6J("ngIf",!(null!=(n=t.form.get("dni"))&&n.hasError("required"))&&(!t.isNie&&!t.isDni||(null==(n=t.form.get("dni"))?null:n.hasError("invalidDniOrNie")))),d.xp6(1),d.Q6J("ngIf",t.isDni),d.xp6(1),d.Q6J("ngIf",t.isNie),d.xp6(1),d.Q6J("ngIf",t.isNie),d.xp6(1),d.Q6J("ngIf",(null==t.data||null==t.data.config?null:t.data.config.followMail)&&(t.isDni||t.isNie)),d.xp6(2),d.Q6J("ngIf",t.submitAttempted&&!t.data.config.hideCheckLegal&&!t.acceptTerms),d.xp6(1),d.Q6J("ngIf",!t.data.config.hideCheckLegal),d.xp6(1),d.Q6J("ngIf",null==t.data||null==t.data.config?null:t.data.config.showPolicyLink),d.xp6(1),d.Q6J("ngIf",null==t.data?null:t.data.config.dataAssignmentCheck),d.xp6(1),d.Q6J("ngIf",t.error),d.xp6(1),d.Q6J("ngClass",d.kEZ(42,Ce,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),d.xp6(1),d.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),d.xp6(1),d.hij(" ",t.labels.actions.continue," "),d.xp6(1),d.Q6J("ngIf",t.loading)}},dependencies:[i.mk,i.O5,i.PC,o._Y,o.Fj,o.JJ,o.JL,o.Q7,o.wO,o.nD,o.sg,o.u,J.b,m.y,V.T,Q.Z6,W.Hw,g.lW,G.TO,G.KE,G.bx,G.hX,$.Nt,E.Ou,_.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.dont-show-data[_ngcontent-%COMP%]{opacity:0!important;padding:0!important;overflow:hidden!important;height:0px!important;margin:0!important}.hiden-input[_ngcontent-%COMP%]{height:0!important;max-height:0px!important;overflow:hidden!important;opacity:0!important}.loading-overlay[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;top:0;z-index:999}"]}),e})();var Me=n(8594),Ie=n(6e3);const Ee=[{path:":idUser",component:T.n},{path:":idUser/:packID",component:T.n}];let Ae=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=d.oAB({type:e}),e.ɵinj=d.cJS({imports:[Me.Bz.forChild(Ee),Me.Bz,Ie.d8]}),e})(),Oe=(()=>{class e{constructor(){}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=d.Xpm({type:e,selectors:[["belender-no-service-step"]],inputs:{data:"data",texts:"texts"},decls:6,vars:12,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&(d._UZ(0,"belender-widget-step-logo",0),d.TgZ(1,"form",1)(2,"div",2),d._UZ(3,"div",3)(4,"div",4),d.ALo(5,"safeHtml"),d.qZA()()),2&e&&(d.Q6J("data",t.data)("customImage",t.texts.noService.customImage),d.xp6(3),d.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),d.Q6J("innerHTML",t.texts.noService.title,d.oJD),d.xp6(1),d.Udp("color",t.data.styles.colors.text),d.Q6J("innerHTML",d.lcZ(5,10,t.texts.noService.description),d.oJD))},dependencies:[o._Y,o.JL,o.F,m.y,_.z]}),e})();const Le=function(e){return{background:e}};function De(e,t){if(1&e&&(d.TgZ(0,"div",9),d._UZ(1,"mat-spinner",10),d.TgZ(2,"p"),d._uU(3),d.qZA()()),2&e){const e=d.oxw();d.Q6J("ngStyle",d.VKq(2,Le,e.data.styles.colors.background)),d.xp6(3),d.Oqu(e.loading||"Cargando, espere por favor...")}}const Pe=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Ne=(()=>{class e{constructor(e,t,n,i,s){this.pinComponent=e,this.utils=t,this.pinUtils=n,this.customizationStoreService=i,this.pinService=s,this.loading=null}ngOnInit(){this.resolveLabels()}resolveLabels(){this.labels||(this.labels=this.pinUtils.labels)}save(){}retry(){this.pinComponent?.showAlert(null),this.retryRequest(this.pinUtils.REQUEST.request_id)}getTextStatus(){switch(this.pinUtils.REQUEST.status_code){case"abandoned_after_waiting_otp_seguridad_social":return this.labels.abandoned.afterWaitingOtpSS;case"abandoned_after_invalid_otp_seguridad_social":return this.labels.abandoned.afterInvalidOtpSS;case"abandoned_after_invalid_otp_aeat":return this.labels.abandoned.afterInvalidOtpAEAT;case"abandoned_after_waiting_otp_aeat":return this.labels.abandoned.afterWaitingOtpAEAT;default:return this.pinUtils.REQUEST.status_message||this.pinUtils.REQUEST.status_code}}retryRequest(e){let t={request_id:this.pinUtils?.REQUEST?.request_id||e,user_id:this.customizationStoreService.USER_ID};this.loading=this.labels.loadings.resendingRequest,this.pinUtils.subscribeWS(),this.pinService.retryRequest(t).then((e=>{e&&e.data&&(this.pinUtils.setRequest(e.data),this.pinUtils.setRequestStatus(this.pinUtils.REQUEST.status_code)),this.loading=null})).catch((e=>{console.error(e),this.loading=null}))}}return e.ɵfac=function(t){return new(t||e)(d.Y36(T.n,9),d.Y36(u.F),d.Y36(k._),d.Y36(M.r),d.Y36(I.v))},e.ɵcmp=d.Xpm({type:e,selectors:[["belender-abandoned-step"]],inputs:{data:"data",labels:"labels",texts:"texts"},decls:12,vars:26,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content","relative"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"p-1","px-4","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm","mb-2","mt-6"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"],["class","loading-overlay flex flex-col gap-3 items-center justify-center ",3,"ngStyle",4,"ngIf"],[1,"loading-overlay","flex","flex-col","gap-3","items-center","justify-center",3,"ngStyle"],["diameter","30"]],template:function(e,t){1&e&&(d._UZ(0,"belender-widget-step-logo",0),d.TgZ(1,"div",1)(2,"div",2),d._UZ(3,"div",3)(4,"div",4),d.ALo(5,"safeHtml"),d.TgZ(6,"div",5),d._uU(7),d.qZA()(),d.TgZ(8,"div",6)(9,"button",7),d.NdJ("click",(function(){return t.retry()})),d._uU(10),d.qZA()(),d.YNc(11,De,4,4,"div",8),d.qZA()),2&e&&(d.Q6J("data",t.data)("customImage",t.texts.abandoned.customImage),d.xp6(3),d.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),d.Q6J("innerHTML",t.texts.abandoned.title,d.oJD),d.xp6(1),d.Udp("color",t.data.styles.colors.text),d.Q6J("innerHTML",d.lcZ(5,20,t.texts.abandoned.description),d.oJD),d.xp6(3),d.hij(" ",t.getTextStatus()," "),d.xp6(1),d.Q6J("ngClass",d.kEZ(22,Pe,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),d.xp6(1),d.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),d.xp6(1),d.hij(" ",null==t.labels.actions?null:t.labels.actions.retry," "),d.xp6(1),d.Q6J("ngIf",t.loading))},dependencies:[i.mk,i.O5,i.PC,m.y,g.lW,E.Ou,_.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-overlay[_ngcontent-%COMP%]{position:absolute;width:100%;height:100%;top:0;z-index:999}"]}),e})();var qe=n(6981),Re=n(5145);const Ye=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Fe=(()=>{class e{constructor(e,t){this.utils=e,this.pinUtils=t}ngOnInit(){this.resolveLabels()}resolveLabels(){this.labels||(this.labels=this.pinUtils.labels)}newRequest(){this.pinUtils.setRequestStatus("created")}gotoRequest(){location.assign(this.pinUtils.REQUEST.widget_url_boxed)}getStatus(){let e=Re.Z.find((e=>e.text==this.pinUtils.REQUEST.status_code));return e?e.label:this.labels.unknownState}}return e.ɵfac=function(t){return new(t||e)(d.Y36(u.F),d.Y36(k._))},e.ɵcmp=d.Xpm({type:e,selectors:[["belender-duplicated-request-step"]],inputs:{data:"data",texts:"texts",labels:"labels"},decls:15,vars:25,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"flex","gap-2","justify-start","items-center","py-2"],[1,"w-fit","p-1","px-2","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8",3,"click"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(d.TgZ(0,"div",0)(1,"div",1)(2,"div",2),d._uU(3),d.qZA(),d.TgZ(4,"div",3),d._uU(5),d.qZA(),d.TgZ(6,"div",4),d._uU(7),d.TgZ(8,"div",5),d._uU(9),d.qZA()()(),d.TgZ(10,"div",6)(11,"button",7),d.NdJ("click",(function(){return t.newRequest()})),d._uU(12),d.qZA(),d.TgZ(13,"button",8),d.NdJ("click",(function(){return t.gotoRequest()})),d._uU(14),d.qZA()()()),2&e&&(d.xp6(2),d.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),d.xp6(1),d.hij(" ",t.labels.warnings.duplicatedRequest," "),d.xp6(1),d.Udp("color",t.data.styles.colors.text),d.xp6(1),d.hij(" ",t.labels.warnings.alreadyHaveRequest," "),d.xp6(2),d.hij(" ",t.labels.warnings.currentRequestStatus," "),d.xp6(2),d.hij(" ",t.getStatus()," "),d.xp6(1),d.Q6J("ngClass",d.kEZ(21,Ye,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),d.xp6(1),d.Udp("border-radius",t.data.styles.btnRound+"px"),d.xp6(1),d.hij(" ",t.labels.actions.newRequest," "),d.xp6(1),d.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),d.xp6(1),d.hij(" ",t.labels.actions.gotoCurrentRequest," "))},dependencies:[i.mk,g.lW],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Ue=n(1129),Ze=n(9476),He=n(3295);let je=(()=>{class e{constructor(){}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=d.Xpm({type:e,selectors:[["belender-standby-step"]],inputs:{data:"data",texts:"texts"},decls:5,vars:10,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&(d.TgZ(0,"form",0)(1,"div",1),d._UZ(2,"div",2)(3,"div",3),d.ALo(4,"safeHtml"),d.qZA()()),2&e&&(d.xp6(2),d.Udp("color",t.data.styles.colors.title)("font-size",t.texts.standby?t.texts.standby.titleSize+"px":"20px"),d.Q6J("innerHTML",t.texts.standby?t.texts.standby.title:"Solicitud en Stand By",d.oJD),d.xp6(1),d.Udp("color",t.data.styles.colors.text),d.Q6J("innerHTML",t.texts.standby?t.texts.standby.description:d.lcZ(4,8,"Descripcion del estado Stand By"),d.oJD))},dependencies:[o._Y,o.JL,o.F,_.z]}),e})();var ze=n(1145);const Be=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Je=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new d.vpe(null)}ngOnInit(){this.form=this.fb.group({document_expiration_date:[null,[o.kI.required]]})}next(){this.nextStep.emit(this.form.get("document_expiration_date").value)}}return e.ɵfac=function(t){return new(t||e)(d.Y36(o.QS),d.Y36(u.F))},e.ɵcmp=d.Xpm({type:e,selectors:[["belender-error-expiration-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:17,vars:24,consts:[[3,"data"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["type","date","placeholder","Ej: 22/03/1990","required","","formControlName","document_expiration_date","matInput",""],[1,"flex","items-center","justify-end","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(d._UZ(0,"belender-widget-step-logo",0),d.TgZ(1,"div",1)(2,"div",2)(3,"div",3),d._uU(4),d.qZA(),d.TgZ(5,"div",4),d._uU(6),d.qZA(),d.TgZ(7,"form",5)(8,"mat-form-field",6)(9,"mat-label"),d._uU(10),d.qZA(),d._UZ(11,"input",7),d.TgZ(12,"mat-hint"),d._uU(13,"DD/MM/YYYY"),d.qZA()()()(),d.TgZ(14,"div",8)(15,"button",9),d.NdJ("click",(function(){return t.next()})),d._uU(16),d.qZA()()()),2&e&&(d.Q6J("data",t.data),d.xp6(3),d.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),d.xp6(1),d.hij(" ",null==t.labels||null==t.labels.warnings?null:t.labels.warnings.wrongExpiration," "),d.xp6(1),d.Udp("color",t.data.styles.colors.text),d.xp6(1),d.hij(" ",null==t.labels||null==t.labels.warnings?null:t.labels.warnings.inputExpiration," "),d.xp6(1),d.Q6J("formGroup",t.form),d.xp6(3),d.Oqu(null==t.labels?null:t.labels.expiration),d.xp6(4),d.Q6J("ngClass",d.kEZ(20,Be,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),d.xp6(1),d.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),d.Q6J("disabled",t.form.invalid),d.xp6(1),d.hij(" ",null==t.labels||null==t.labels.actions?null:t.labels.actions.send," "))},dependencies:[i.mk,o._Y,o.Fj,o.JJ,o.JL,o.Q7,o.sg,o.u,m.y,g.lW,G.KE,G.bx,G.hX,$.Nt],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const Ve=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Qe=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new d.vpe(null)}ngOnInit(){this.form=this.fb.group({support_number:[null,[o.kI.required]]})}next(){this.nextStep.emit(this.form.get("support_number").value)}}return e.ɵfac=function(t){return new(t||e)(d.Y36(o.QS),d.Y36(u.F))},e.ɵcmp=d.Xpm({type:e,selectors:[["belender-error-support-number-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:15,vars:24,consts:[[3,"data"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["type","number","placeholder","Ej: 1233443","required","","formControlName","support_number","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(d._UZ(0,"belender-widget-step-logo",0),d.TgZ(1,"div",1)(2,"div",2)(3,"div",3),d._uU(4),d.qZA(),d.TgZ(5,"div",4),d._uU(6),d.qZA(),d.TgZ(7,"form",5)(8,"mat-form-field",6)(9,"mat-label"),d._uU(10),d.qZA(),d._UZ(11,"input",7),d.qZA()()(),d.TgZ(12,"div",8)(13,"button",9),d.NdJ("click",(function(){return t.next()})),d._uU(14),d.qZA()()()),2&e&&(d.Q6J("data",t.data),d.xp6(3),d.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),d.xp6(1),d.hij(" ",null==t.labels||null==t.labels.warnings?null:t.labels.warnings.wrongSupport," "),d.xp6(1),d.Udp("color",t.data.styles.colors.text),d.xp6(1),d.hij(" ",null==t.labels||null==t.labels.warnings?null:t.labels.warnings.inputSupport," "),d.xp6(1),d.Q6J("formGroup",t.form),d.xp6(3),d.Oqu(null==t.labels||null==t.labels.warnings?null:t.labels.warnings.support),d.xp6(2),d.Q6J("ngClass",d.kEZ(20,Ve,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),d.xp6(1),d.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),d.Q6J("disabled",t.form.invalid),d.xp6(1),d.hij(" ",null==t.labels||null==t.labels.actions?null:t.labels.actions.send," "))},dependencies:[i.mk,o._Y,o.Fj,o.wV,o.JJ,o.JL,o.Q7,o.sg,o.u,m.y,g.lW,G.KE,G.hX,$.Nt],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const We=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Ge=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new d.vpe(null)}ngOnInit(){this.form=this.fb.group({birth_date:[null,[o.kI.required]]})}next(){this.nextStep.emit(this.form.get("birth_date").value)}}return e.ɵfac=function(t){return new(t||e)(d.Y36(o.QS),d.Y36(u.F))},e.ɵcmp=d.Xpm({type:e,selectors:[["belender-error-birthday-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:17,vars:24,consts:[[3,"data"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","belender-form-field"],["type","text","required","","formControlName","birth_date","matInput","","mask","d0/M0/0000"],[1,"flex","items-center","justify-end","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(d._UZ(0,"belender-widget-step-logo",0),d.TgZ(1,"div",1)(2,"div",2)(3,"div",3),d._uU(4),d.qZA(),d.TgZ(5,"div",4),d._uU(6),d.qZA(),d.TgZ(7,"form",5)(8,"mat-form-field",6)(9,"mat-label"),d._uU(10),d.qZA(),d._UZ(11,"input",7),d.TgZ(12,"mat-hint"),d._uU(13,"DD/MM/YYYY"),d.qZA()()()(),d.TgZ(14,"div",8)(15,"button",9),d.NdJ("click",(function(){return t.next()})),d._uU(16),d.qZA()()()),2&e&&(d.Q6J("data",t.data),d.xp6(3),d.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),d.xp6(1),d.hij(" ",t.labels.warnings.wrongBirthday," "),d.xp6(1),d.Udp("color",t.data.styles.colors.text),d.xp6(1),d.hij(" ",t.labels.warnings.inputBirthDay," "),d.xp6(1),d.Q6J("formGroup",t.form),d.xp6(3),d.hij(" ",t.labels.warnings.birthday," "),d.xp6(4),d.Q6J("ngClass",d.kEZ(20,We,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),d.xp6(1),d.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),d.Q6J("disabled",t.form.invalid),d.xp6(1),d.hij(" ",t.labels.actions.send," "))},dependencies:[i.mk,o._Y,o.Fj,o.JJ,o.JL,o.Q7,o.sg,o.u,m.y,Q.Z6,g.lW,G.KE,G.bx,G.hX,$.Nt],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var $e=n(3300),Ke=n(865),Xe=n(3033),et=n(5028),tt=n(6830),nt=n(4302),it=n(9112),st=n(9382);let rt=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=d.oAB({type:e}),e.ɵinj=d.cJS({providers:[I.v,l.o,S.w,c.t,B.T,j.t,k._,{provide:q.Ad,useValue:"es-ES"}],imports:[Ae,i.ez,s.G,r.J,o.u5,o.UX,a.a,qe.x,Ue.n,Ze.F,He.g,ze.j,$e.C,Ke.q,Xe.d,et.q]}),e})();d.B6R(T.n,[i.O5,tt.L,nt.q,it.y,st.i,g.lW,E.Ou,x,N,ke,Oe,Ne,Fe,je,Je,Qe,Ge],[_.z])},2254:(e,t,n)=>{n.d(t,{p:()=>c});var i=n(1135),s=n(5762),r=n(2340),o=n(182),a=n(4650),l=n(8460);let c=(()=>{class e{constructor(e){this.customizationStoreService=e,this.currentHeight=0,this.socket=null,this.socketOpened=!0,this._request=new i.X({...new s.l,status_code:"created"}),this._request_status=new i.X(null),this.request$=this._request.asObservable(),this.request_status$=this._request_status.asObservable(),this.requestIDSubject=new i.X(""),this.requestID$=this.requestIDSubject.asObservable(),this.loadingSubject=new i.X(!1),this.loading$=this.loadingSubject.asObservable()}setLoading(e){this.loadingSubject.next(e)}updateRequestID(e){this.requestIDSubject.next(e),this.REQUEST_ID=e}setGlobalVariables(){this.REQUEST=this._request.value,this.REQUEST_STATUS=this.REQUEST.status_code,this._request_status.next(this.REQUEST_STATUS)}setRequest(e){this._request.next({...e}),this.setGlobalVariables()}patch(e){this._request.next({...this._request.value,...e}),this.setGlobalVariables()}setRequestStatus(e){this._request.next({...this._request.value,status_code:e}),this.setGlobalVariables()}setSubscriptionOfRequest(){const e=this;if(this.socket)return;let t="wss://notifications.dev.belender.net";"qa"==r.N.env&&(t="wss://notifications.qa.belender.net"),"pro"==r.N.env&&(t="wss://notifications.belender.net"),r.N.notificationsBaseUrl&&(t=r.N.notificationsBaseUrl),this.socket=new WebSocket(`${t}?requests_id=${this.REQUEST_ID}&user_id=${this.customizationStoreService.USER_ID}`),this.socket.onopen=function(e){console.log("Conexión establecida")},this.socket.onmessage=function(t){let n=JSON.parse(t.data);e.handlePusherNotification(n)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e),console.error(e)},this.socket.onclose=function(t){console.log("Conexión cerrada:",t),e.socketOpened=!1}}disconnectWebsocket(){console.error("disconnect ws"),this.socket&&this.socket.close(),this.socket=null}handlePusherNotification(e){if(!e||o.t.shouldIgnoreWebhookStatus(e.status_code)||(e&&e.widget_url&&(this.widgetUrl=e.widget_url),e&&e.widget_url_boxed&&(this.widgetUrlBoxed=e.widget_url_boxed),this.sendMessageToParent({type:"websocket",data:e}),console.warn("message from ws: ",e),!e.status_code))return;const t=e.status_code;if("consent_process_completed"===t&&this.disconnectWebsocket(),t.startsWith("abandoned")||t.startsWith("failed"))return this.disconnectWebsocket(),void this.setRequestStatus(t);this.patch({status_code:t})}sendMessageToParent(e){if(e&&e.type&&"widgetHeight"===e.type){if(e.data===this.currentHeight)return;this.currentHeight=e.data}console.log("Message to parent:",e),window.top.postMessage(e,"*")}}return e.ɵfac=function(t){return new(t||e)(a.LFG(l.r))},e.ɵprov=a.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},8135:(e,t,n)=>{n.d(t,{T:()=>re});var i=n(5861),s=n(7582),r=n(9549),o=n(9933),a=n(5762),l=n(8259),c=n(2340),d=n(667);const u="error-data",h={created:"form",form:"form",terms_and_conditions:"form",waiting_terms_and_conditions:"form",prerequest:"form",waiting_password:"form",waiting_otp_seguridad_social:"otp",waiting_login_seguridad_social:"otp",invalid_otp_seguridad_social:"otp",abandoned_after_bad_phone:"abandoned",abandoned_after_invalid_otp_seguridad_social:"abandoned",abandoned_after_terms_and_conditions:"abandoned",abandoned_after_waiting_otp_seguridad_social:"abandoned",all_documents_downloaded:"success",partial_documents_downloaded:"success",consent_process_completed:"success",partial_documents_downloaded_and_deleted:"success",all_documents_downloaded_and_deleted:"success",failed_documents_downloaded:"success",failed_with_retry:"failed",failed_without_retry:"failed",consent_process_canceled:"loading",no_service:"no-service",no_sms_service:"no-service",no_clave_pin_service:"no-service",stand_by:"loading","no-phone":"loading",no_phone:"loading","no-more-phone":"no-phone",no_more_phone:"no-phone",bad_phone:"bad-phone",error_expiration_date:"error-expiration-date",error_birth_date:"error-birth-date",error_support_number:"error-support-number",duplicated:"duplicated"};var p=n(6305),m=n(1931),f=n(182),g=n(4650),_=n(8594),b=n(8467),v=n(5601),y=n(7367),w=n(8460),x=n(5895),S=n(7489),C=n(9045),T=n(5412),k=n(7308),M=n(2254),I=n(3687);const E=["formStep"],A=["otpStep"];function O(e,t){1&e&&(g.TgZ(0,"div",8),g._UZ(1,"mat-progress-spinner",9),g.qZA()),2&e&&(g.xp6(1),g.Q6J("value",0))}function L(e,t){if(1&e){const e=g.EpF();g.TgZ(0,"belender-intro-step",25),g.NdJ("gotoFlow",(function(){g.CHM(e);const t=g.oxw(3);return g.KtG(t.goFlow())}))("gotoManual",(function(){g.CHM(e);const t=g.oxw(3);return g.KtG(t.gotoManual())})),g.qZA()}if(2&e){const e=g.oxw(3);g.Q6J("data",e.data)("flowName",e.flowName)}}function D(e,t){if(1&e&&g._UZ(0,"belender-manual-step",26),2&e){const e=g.oxw(3);g.Q6J("data",e.data)("flowName",e.flowName)("packId",e.packId)("userId",e.userId)("labels",e.labels)}}function P(e,t){if(1&e){const e=g.EpF();g.TgZ(0,"belender-form-step",27,28),g.NdJ("goToTerms",(function(){g.CHM(e);const t=g.oxw(3);return g.KtG(t.gotoTermsAndConditions())})),g.qZA()}if(2&e){const e=g.oxw(3);g.Q6J("requestIDFromURL",e.requestIDFromURL)("lang",e.currentLang)("requestID",e.requestID)("flowName",e.flowName)("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("pinMode",e.pinMode)("editable_dates",e.editable_dates)("skipCreationOfRequest",e.skipCreationOfRequest)}}function N(e,t){if(1&e&&g._UZ(0,"belender-error-form-step",29),2&e){const e=g.oxw(3);g.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("flowName",e.flowName)("requestID",e.requestID)}}function q(e,t){if(1&e&&g._UZ(0,"belender-error-birthday-step",30),2&e){const e=g.oxw(3);g.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function R(e,t){if(1&e&&g._UZ(0,"belender-error-expiration-step",30),2&e){const e=g.oxw(3);g.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function Y(e,t){if(1&e&&g._UZ(0,"belender-error-support-number-step",30),2&e){const e=g.oxw(3);g.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function F(e,t){if(1&e&&g._UZ(0,"belender-abandoned-step",31),2&e){const e=g.oxw(3);g.Q6J("requestID",e.requestID)("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("flowType",e.flowName)}}function U(e,t){if(1&e&&g._UZ(0,"belender-shared-otp-step",32,33),2&e){const e=g.oxw(3);g.Q6J("otpType","otpSS")("requestID",e.requestID)("testMode",e.testMode)("labels",e.labels)("logoCustom",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.otpSS?null:e.data[e.flowName].texts.otpSS.customImage)("flowType",e.flowName)("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("minLength",6)}}function Z(e,t){if(1&e&&g._UZ(0,"belender-success-step",34),2&e){const e=g.oxw(3);g.Q6J("data",e.data)("labels",e.labels)("packId",e.packId)("flowName",e.flowName)("userId",e.userId)("requestID",e.requestID)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function H(e,t){if(1&e){const e=g.EpF();g.TgZ(0,"belender-duplicated-request-step",35),g.NdJ("newRequest",(function(t){g.CHM(e);const n=g.oxw(3);return g.KtG(n.newRequest(t))})),g.qZA()}if(2&e){const e=g.oxw(3);g.Q6J("data",e.data)("labels",e.labels)("currentRequest",e.currentRequest)}}function j(e,t){if(1&e&&g._UZ(0,"belender-no-phone-step",36),2&e){const e=g.oxw(3);g.Q6J("data",e.data)("labels",e.labels)("flowName",e.flowName)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function z(e,t){if(1&e&&g._UZ(0,"belender-error-phone-step",37),2&e){const e=g.oxw(3);g.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("flowName",e.flowName)}}function B(e,t){if(1&e){const e=g.EpF();g.TgZ(0,"belender-fail-step",38),g.NdJ("newRequest",(function(t){g.CHM(e);const n=g.oxw(3);return g.KtG(n.newRequest(t))})),g.qZA()}if(2&e){const e=g.oxw(3);g.Q6J("data",e.data)("labels",e.labels)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("requestID",e.requestID)("flowType",e.flowName)}}function J(e,t){if(1&e&&g._UZ(0,"belender-no-service-step",39),2&e){const e=g.oxw(3);g.Q6J("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("data",e.data)("labels",e.labels)}}function V(e,t){if(1&e&&g._UZ(0,"belender-standby-step",39),2&e){const e=g.oxw(3);g.Q6J("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("data",e.data)("labels",e.labels)}}function Q(e,t){if(1&e&&g._UZ(0,"belender-cancel-request",40),2&e){const e=g.oxw(3);g.Q6J("flowType",e.flowName)("request_id",e.requestID)("user_id",e.userId)("data",e.data)("labels",e.labels)("textColor",e.data.styles.colors.text)("customText",e.data.config.cancelRequestText)}}function W(e,t){if(1&e&&(g._UZ(0,"div",41),g.ALo(1,"safeHtml")),2&e){const e=g.oxw(3);g.Udp("color",e.data.styles.colors.text),g.Q6J("innerHTML",g.lcZ(1,3,(null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.aditionalDescription)||""),g.oJD)}}function G(e,t){if(1&e&&(g.ynx(0),g.YNc(1,L,1,2,"belender-intro-step",10),g.YNc(2,D,1,5,"belender-manual-step",11),g.YNc(3,P,2,10,"belender-form-step",12),g.YNc(4,N,1,5,"belender-error-form-step",13),g.YNc(5,q,1,3,"belender-error-birthday-step",14),g.YNc(6,R,1,3,"belender-error-expiration-step",14),g.YNc(7,Y,1,3,"belender-error-support-number-step",14),g.YNc(8,F,1,5,"belender-abandoned-step",15),g.YNc(9,U,2,9,"belender-shared-otp-step",16),g.YNc(10,Z,1,7,"belender-success-step",17),g.YNc(11,H,1,3,"belender-duplicated-request-step",18),g.YNc(12,j,1,4,"belender-no-phone-step",19),g.YNc(13,z,1,4,"belender-error-phone-step",20),g.YNc(14,B,1,5,"belender-fail-step",21),g.YNc(15,J,1,3,"belender-no-service-step",22),g.YNc(16,V,1,3,"belender-standby-step",22),g.YNc(17,Q,1,7,"belender-cancel-request",23),g.YNc(18,W,2,5,"div",24),g.BQk()),2&e){const e=g.oxw(2);g.xp6(1),g.Q6J("ngIf","intro"===e.requestStatus),g.xp6(1),g.Q6J("ngIf","manual"===e.requestStatus),g.xp6(1),g.Q6J("ngIf","form"===e.requestStatus&&!e.settingRequestFromBack),g.xp6(1),g.Q6J("ngIf","error-data"===e.requestStatus),g.xp6(1),g.Q6J("ngIf","error-birth-date"==e.requestStatus),g.xp6(1),g.Q6J("ngIf","error-expiration-date"==e.requestStatus),g.xp6(1),g.Q6J("ngIf","error-support-number"==e.requestStatus),g.xp6(1),g.Q6J("ngIf","abandoned"==e.requestStatus),g.xp6(1),g.Q6J("ngIf","otp"==e.requestStatus),g.xp6(1),g.Q6J("ngIf","success"==e.requestStatus),g.xp6(1),g.Q6J("ngIf","duplicated"==e.requestStatus),g.xp6(1),g.Q6J("ngIf","no-phone"==e.requestStatus),g.xp6(1),g.Q6J("ngIf","bad-phone"==e.requestStatus),g.xp6(1),g.Q6J("ngIf","failed"==e.requestStatus),g.xp6(1),g.Q6J("ngIf","no-service"==e.requestStatus),g.xp6(1),g.Q6J("ngIf","standby"==e.requestStatus),g.xp6(1),g.Q6J("ngIf",e.showCancelRequest&&e.data.config.cancelRequest&&e.requestIDFromURL),g.xp6(1),g.Q6J("ngIf","form"===e.requestStatus&&!e.loading&&e.data[e.flowName]&&(null==e.data[e.flowName]?null:e.data[e.flowName].showAditionalDescription)&&(null==e.data[e.flowName]?null:e.data[e.flowName].texts)&&(null==e.data[e.flowName]?null:e.data[e.flowName].texts.form)&&(null==e.data[e.flowName]?null:e.data[e.flowName].texts.form.aditionalDescription))}}function $(e,t){1&e&&g._UZ(0,"belender-disabled-url")}function K(e,t){if(1&e&&(g.TgZ(0,"div",42),g._UZ(1,"div",43),g.qZA()),2&e){const e=g.oxw(2);g.xp6(1),g.Q6J("innerHTML",e.warning,g.oJD)}}function X(e,t){if(1&e){const e=g.EpF();g.TgZ(0,"div")(1,"div",44)(2,"div",45),g._uU(3,"Error!"),g.qZA(),g._UZ(4,"div",46),g.qZA(),g.TgZ(5,"div",47)(6,"button",48),g.NdJ("click",(function(){g.CHM(e);const t=g.oxw(2);return g.KtG(t.error=!1)})),g._uU(7,"Ingresar manualmente"),g.qZA()()()}if(2&e){const e=g.oxw(2);g.xp6(4),g.Udp("color",e.data.styles.colors.text),g.Q6J("innerHTML",e.error,g.oJD)}}function ee(e,t){if(1&e&&(g.TgZ(0,"div"),g.YNc(1,O,2,1,"div",6),g.YNc(2,G,19,18,"ng-container",4),g.YNc(3,$,1,0,"belender-disabled-url",4),g.YNc(4,K,2,1,"div",7),g.YNc(5,X,8,3,"div",4),g.qZA()),2&e){const e=g.oxw();g.Gre("h-full w-full flex-auto p-0 md:p-3 ",null==e.data||null==e.data.styles?null:e.data.styles.typography,""),g.Udp("background",null==e.data||null==e.data.styles||null==e.data.styles.colors?null:e.data.styles.colors.background),g.xp6(1),g.Q6J("ngIf",e.data.config.infiniteLoopInCompleted&&"loading"===e.requestStatus),g.xp6(1),g.Q6J("ngIf",!e.error&&!e.disableURL),g.xp6(1),g.Q6J("ngIf",!e.error&&e.disableURL),g.xp6(1),g.Q6J("ngIf",!e.loading&&e.warning&&"success"!=e.requestStatus&&"abandoned"!=e.requestStatus&&"failed"!=e.requestStatus),g.xp6(1),g.Q6J("ngIf",!e.loading&&e.error&&"loading"!=e.requestStatus)}}function te(e,t){if(1&e&&(g.TgZ(0,"div",49),g._UZ(1,"mat-progress-spinner",50),g.TgZ(2,"p",51),g._uU(3),g.qZA()()),2&e){const e=g.oxw();g.xp6(1),g.Q6J("value",e.spinnerValue)("mode",e.spinnerMode),g.xp6(2),g.Oqu(e.loading)}}function ne(e,t){if(1&e){const e=g.EpF();g.TgZ(0,"vex-terms",52),g.NdJ("accepted",(function(){g.CHM(e);const t=g.oxw();return g.KtG(t.handleTermsResponse(!0))}))("cancelled",(function(){g.CHM(e);const t=g.oxw();return g.KtG(t.handleTermsResponse(!1))})),g.qZA()}if(2&e){const e=g.oxw();g.Q6J("flow",e.flowName)("lang",e.currentLang)("allData",e.data)("requestStatus",e.smsFlowService.REQUEST?e.smsFlowService.REQUEST_STATUS:"")("requestID",e.requestID)}}function ie(e,t){if(1&e&&(g.ynx(0),g.TgZ(1,"div",53),g._uU(2),g.qZA(),g.BQk()),2&e){const e=g.oxw();g.xp6(2),g.hij("TestMode ",e.testMode?"ON":"OFF","")}}function se(e,t){if(1&e){const e=g.EpF();g.TgZ(0,"belender-tester-sms",54),g.NdJ("sendMessage",(function(t){g.CHM(e);const n=g.oxw();return g.KtG(n.setMessageFromTest(t))})),g.qZA()}}let re=class{constructor(e,t,n,i,s,r,o,a,l,d,u,h,p){if(this.cd=e,this.Activatedroute=t,this.utils=n,this.solicitudesService=i,this.customizationService=s,this.customizationStoreService=r,this.notis=o,this.pinService=a,this.deviceInfoService=l,this.dialog=d,this.translationService=u,this.smsFlowService=h,this.scrollService=p,this.data=null,this.disableActions=!1,this.step="created",this.waitingTime=15,this._loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1,this.introEnabled=!1,this.manual=!1,this.pinMode=!1,this.requestIDFromURL=!1,this.stopPropagationOfSuccess=!1,this.paramsSetted=!1,this.requestStatus="loading",this.disableURL=!1,this.settingRequestFromBack=!1,this.showCancelRequest=!1,this.requestedFromDetail=!1,this.env=c.N,this.intervalToAskBack=null,this.loadingRequestData=!1,this.intervalCount=0,this.requestedToPin=!1,this.isScaled=!1,this.termsOpened=!1,this.flowName="SMS",this.labels=m.S.es,this.currentLang="",this.showTermsDialog=!1,this.editable_dates=!1,"OTPCredential"in window){const e=new AbortController;navigator.credentials.get({otp:{transport:["sms"]},signal:e.signal}).then((e=>{this.showAlert("otp",e)})).catch((e=>{console.log(e)}))}this.deviceInfoDetails$=this.deviceInfoService.deviceInfo$.subscribe((e=>{Object.keys(e).length>0&&(this.deviceInfoDetails=e)}))}get loading(){return this._loading}set loading(e){this._loading=e,null!==e&&this.onLoadingChanged()}ngOnInit(){this.smsFlowService.request_status$.subscribe((e=>{this.setStatus()})),this.userId=this.customizationStoreService.USER_ID,this.smsFlowService.requestID$.subscribe((e=>{this.requestID=e})),this.smsFlowService.loading$.subscribe((e=>{this.loading=e})),this.getWindowsScreenOrientation();const e=this;this.packId=this.customizationStoreService.PACK_ID,"pro"!=c.N.env&&(l(document).keydown((function(t){16==t.which&&(this.shiftlIsPressed=!0),17==t.which&&(this.cntrlIsPressed=!0),84==t.which&&this.cntrlIsPressed&&this.shiftlIsPressed&&(e.testMode=!e.testMode,e.cd.markForCheck())})),l(document).keyup((function(e){16==e.which&&(this.shiftlIsPressed=!1),16==e.which&&(this.cntrlIsPressed=!1)})))}ngAfterViewInit(){this.initFunctions()}onLoadingChanged(){this.scrollUpContent()}initFunctions(){var e=this;return(0,i.Z)((function*(){var t;e.Activatedroute.queryParams.subscribe((t=(0,i.Z)((function*(t){t&&t.request_id&&e.smsFlowService.updateRequestID(t.request_id),t.lang?(e.currentLang=t.lang,e.smsFlowService.setLoading(e.translationService.getFirstLoading(e.currentLang)),e.setTranslation()):e.smsFlowService.setLoading(e.labels.loadings.gettingData),"true"===t.editable_dates&&(e.editable_dates=t.editable_dates),e.userId?e.setInitialData(e.userId):e.smsFlowService.setLoading(null)})),function(e){return t.apply(this,arguments)}))}))()}setTranslation(){let e=this.translationService.getLabelsTranslated(this.currentLang);e&&(this.labels=e)}ngOnDestroy(){window.screen&&window.screen.orientation&&this.orientationChangeHandler&&window.screen.orientation.removeEventListener("change",this.orientationChangeHandler)}ngAfterViewChecked(){this.getWidgetCardHeight()}getWindowsScreenOrientation(){window.screen&&window.screen.orientation&&(this.orientationChangeHandler=()=>{this.getWidgetCardHeight()},window.screen.orientation.addEventListener("change",this.orientationChangeHandler))}getWidgetCardHeight(){let e=l("#widget-wrapper").height()||0;this.isScaled$=this.deviceInfoService.isScaled$.subscribe((t=>{this.isScaled=t,this.isScaled&&(e*=1.5)})),this.smsFlowService.sendMessageToParent({type:"widgetHeight",data:e})}setInitialData(e){var t=this;return(0,i.Z)((function*(){yield t.validateRequestIdInUrl();const n=(0,p.cm)(yield t.getFlow(e));if(t.funderConfig=t.customizationStoreService.FUNDER_CONFIG,t.funderStyles=t.customizationStoreService.FUNDER_STYLES,t.data={config:t.funderConfig,styles:t.funderStyles,[t.flowName]:n},(0,p.bf)(t.data,t.flowName),!t.data.config||!t.data.config.funder_id)return t.showAlert(t.labels.warnings.error,t.labels.warnings.noCustomization,"error"),t.smsFlowService.setLoading(null),void t.cd.markForCheck();t.financiadorID=t.data.config.funder_id||"",t.disableURL=t.data.config.disableUrlWidget,t.introEnabled=t.data.config.introEnabled,t.smsFlowService.setLoading(!1),t.loading=null,yield t.utils.preloadImages(n,t.funderStyles),t.cd.markForCheck(),t.smsFlowService.sendMessageToParent({type:"widgetLoaded",data:{}})}))()}getFlow(e){var t=this;return(0,i.Z)((function*(){return new Promise((n=>{t.customizationService.getCustomizationByFlow(e,t.flowName,t.currentLang||t.customizationStoreService.LANG,t.requestID,t.smsFlowService.REQUEST?t.smsFlowService.REQUEST_STATUS:"").then((e=>{n(e?.data?e.data:null)}),(e=>{n(null)}))}))}))()}validateRequestIdInUrl(){var e=this;return(0,i.Z)((function*(){return new Promise((t=>{var n;e.Activatedroute.queryParams.subscribe((n=(0,i.Z)((function*(n){if(n&&(e.setParamsToRequest(n),e.smsFlowService.setLoading(!1)),n&&n.acceptTerms&&(e.paramsSetted=!0,e.autoAcceptTerms=!0),n.success&&(e.stopPropagationOfSuccess=!0,e.paramsSetted=!0),n&&n.request_id){e.smsFlowService.updateRequestID(n.request_id),e.disableURL=!1;let i=yield e.setFormFromVcCode(n.request_id,n);e.requestIDFromURL=!0,e.paramsSetted=!0,t(i)}else e.smsFlowService.setLoading(!1);t(null)})),function(e){return n.apply(this,arguments)}),(n=>{e.smsFlowService.setLoading(!1),t(null)}))}))}))()}setParamsToRequest(e){this.smsFlowService.REQUEST||this.setRequestStatus("form");let t={...this.smsFlowService.REQUEST};(e.document_number||e.document)&&!t.person_document_number&&(t.person_document_number=e.document_number||e.document,this.requestIDFromURL=!0,this.paramsSetted=!0),(e.birth_date||e.birthday)&&!t.person_birth_date&&(t.person_birth_date=e.birth_date||e.birthday,this.requestIDFromURL=!0,this.paramsSetted=!0),e.phone&&!t.person_phone&&(t.person_phone=e.phone,this.requestIDFromURL=!0,this.paramsSetted=!0),e.email&&!t.email&&(t.email=e.email,this.requestIDFromURL=!0,this.paramsSetted=!0),this.smsFlowService.setRequest(t)}setFormFromVcCode(e,t){var n=this;return(0,i.Z)((function*(){return n.showAlert(null),n.smsFlowService.setLoading(n.labels.loadings.gettingData),n.settingRequestFromBack=!0,new Promise((i=>{n.solicitudesService.getSolicitudByCode(e).then((e=>{if(e&&e.data){let i=e.data;i.status_code=i.consent_process_completed?"consent_process_completed":i.status_code,f.t.shouldIgnoreWebhookStatus(i.status_code)&&n.smsFlowService.REQUEST?.status_code&&(i={...i,status_code:n.smsFlowService.REQUEST.status_code}),n.smsFlowService.setRequest(i),n.setStatus(),n.smsFlowService.setSubscriptionOfRequest(),n.smsFlowService.setLoading(!1),n.skipCreationOfRequest=n.smsFlowService.REQUEST&&n.smsFlowService.REQUEST_STATUS&&"prerequest"!=n.smsFlowService.REQUEST_STATUS,n.autoAcceptTerms?n.acceptTerms():n.setParamsToRequest(t)}else n.smsFlowService.setLoading(null);n.settingRequestFromBack=!1,i(n.smsFlowService.REQUEST||null)})).catch((e=>{n.smsFlowService.setLoading(null),n.settingRequestFromBack=!1,i(null)}))}))}))()}setMessageFromTest(e){this.smsFlowService.handlePusherNotification(e)}addSolicitudPIN(e){this.data[this.flowName]&&this.data[this.flowName].packID&&(e.package_id=this.data[this.flowName].packID),this.formComponent.forceEnableDisableInputs({value:!0},{value:!0},{value:!0},{value:!0}),this.pinService.addSolicitud(e).then((t=>{t&&t.status&&"error"==t.status?t.message&&(this.smsFlowService.setRequest(e),400==t.code&&"Does not have Pin service"==t.message?(this.setRequestStatus("no_service"),this.smsFlowService.setLoading(!1)):400==t.code&&"Incorrect support number"==t.message?(this.notis.showAlert(this.labels.warnings.error,this.labels.warnings.wrongSupport),this.setRequestStatus("form")):400==t.code&&"Incorrect date"==t.message?(this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongDate),this.setRequestStatus("form")):(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,t.message)),this.setStatus()):t&&t.status&&"success"==t.status?(this.smsFlowService.updateRequestID(t.data.request_id),this.smsFlowService.setRequest(t.data),location.pathname.indexOf("widget-boxed")>-1?location.assign(t.data.widget_url_boxed+"&acceptTerms=true"):location.assign(t.data.widget_url+"&acceptTerms=true"),this.acceptTerms()):this.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+t)})).catch((e=>{e&&e.errorMessage&&this.showAlert("Error!",e.errorMessage)}))}addSolicitudSMS(e){this.formComponent.hasDateError=!1,this.showAlert(null),this.solicitudesService.addSolicitud(e).then((t=>{t&&t.status&&"error"==t.status?(this.smsFlowService.setRequest(e),t.message&&(400==t.code?"Birthdate incorrect"==t.message?(this.setRequestStatus("form"),this.formComponent.hasDateError=!0,this.formComponent.dateError=this.labels.warnings.wrongDateDesc):"Incorrect date"==t.message?(this.formComponent.hasDateError=!0,this.formComponent.dateError=this.labels.warnings.wrongDateDesc,this.setRequestStatus("form")):(this.setRequestStatus("no_service"),this.smsFlowService.setLoading(!1)):(t.message.phone||" Teléfono incorrecto"===t.message?this.formComponent.disableEnableInputs(!0,!0,!1,!0):this.formComponent.disableEnableInputs(!0,!1,!1,!1),this.setRequestStatus("form"),this.showAlert("Error!",t.message)),this.setStatus())):t&&t.status&&"success"==t.status?(this.smsFlowService.updateRequestID(t.data.request_id),this.smsFlowService.setRequest(t.data),this.setStatus(),this.smsFlowService.setSubscriptionOfRequest(),this.acceptTerms()):this.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+t)})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.smsFlowService.setLoading(!1)}))}validateHaveSmsMode(e){this.showAlert(null),this.solicitudesService.checkService(e).then((t=>{t&&t.message&&"does not have sms service"==t.message.toLowerCase()?(this.smsFlowService.setRequest(e),this.setRequestStatus("form"),this.pinMode=!0,this.smsFlowService.setLoading(null),this.showAlert(this.labels.warnings.noSms,this.labels.warnings.noSmsDesc)):this.addSolicitudSMS(e)})).catch((e=>{console.error(e)}))}showAlert(e,t,n){this.warning=e?`<div class="flex flex-col w-full items-start gap-0 pl-2 mr-1"><strong class="text-md" >${e}</strong><small>${t}</small></div>`:null}getFunderIconType(e){if(!e||!this.funderStyles)return"error";switch(e){case"error":return this.funderStyles.errorIcon||e;case"success":return this.funderStyles.successIcon||e;case"warning":return this.funderStyles.warningIcon||e;case"info":return this.funderStyles.infoIcon||e;default:return e}}acceptTerms(e=!0){this.showAlert(null);let t={request_id:this.requestID,user_id:this.userId,terms_and_conditions:!0,opening:this.termsOpened?1:0};Object.keys(this.deviceInfoDetails).length>0&&(t={...t,ip:this.deviceInfoDetails.ip,device:this.deviceInfoDetails.device,os:`${this.deviceInfoDetails.os} ${this.deviceInfoDetails.os_version}`,resolution:this.deviceInfoDetails.screen}),e&&this.smsFlowService.setLoading(this.labels.loadings.validatingAndLoginSS),this.solicitudesService.acceptTerms(t).then((e=>{if(e.status&&"error"==e.status){if("You have a request in progress"==e.message){const t=location.pathname;location.assign(t.includes("widget-boxed")?e.response.widget_url_boxed:e.response.widget_url)}else"Invalid request status: stand_by"==e.message?this.setRequestStatus("stand_by"):"Failed to retrieve login status"==e.message?(this.formComponent.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1}),this.showAlert("Error!",e.message)):this.showAlert("Error!",e.message||e);this.smsFlowService.setLoading(!1)}else e&&"success"==e.status?(this.smsFlowService.sendMessageToParent({type:"response",data:e.data||e}),this.smsFlowService.setRequest(e.data),this.setStatus(),this.smsFlowService.setSubscriptionOfRequest(),this.smsFlowService.setLoading(null),this.cd.markForCheck()):this.smsFlowService.setLoading(null)})).catch((e=>{e&&e.error&&this.showAlert("Error!",e.error),this.smsFlowService.setLoading(!1)}))}askToBack(){this.solicitudesService.getSolicitudByCode(this.requestID).then((e=>{if(e&&e.data){if(f.t.shouldIgnoreWebhookStatus(e.data.status_code))return void this.smsFlowService.setLoading(!1);this.smsFlowService.setRequest(e.data),this.setStatus(),this.smsFlowService.setLoading(!1)}else this.smsFlowService.setLoading(!1)})).catch((e=>{this.smsFlowService.setLoading(!1)}))}setRequestStatus(e){let t={...this.smsFlowService.REQUEST};if(t)t.status_code=e;else{let n=new a.l;n.status_code=e,t=n,this.smsFlowService.setRequest(n)}this.smsFlowService.setRequestStatus(e),this.setStatus()}newRequest(e){this.setRequestStatus("created")}gotoManual(){this.manual=!0,this.cd.markForCheck()}goFlow(){this.introEnabled=!1}gotoPin(){this.showAlert(null),this.requestedToPin=!0;let e={request_id:this.smsFlowService.REQUEST.request_id};this.smsFlowService.setLoading(this.labels.loadings.smsToPin),this.solicitudesService.noPhone(e).then((e=>{this.smsFlowService.setLoading(null),this.setRequestStatus("no_more_phone")})).catch((e=>{console.error(e),this.showAlert("Error!",e.message||e),this.smsFlowService.setLoading(null)}))}gotoClavePinUrl(e){location.href.indexOf("widget-boxed")>-1?location.assign(e.widget_url_boxed):location.assign(e.widget_url)}requestStatusFromDetail(){this.requestedFromDetail=!0,this.smsFlowService.setLoading(this.labels.loadings.validatingRequest),this.solicitudesService.getSolicitudByCode(this.smsFlowService.REQUEST.request_id).then((e=>{e&&e.consent_process_completed&&this.setRequestStatus("consent_process_completed"),this.smsFlowService.setLoading(null)})).catch((e=>{this.smsFlowService.setLoading(null),this.setRequestStatus("failed")}))}handleRequestStatus(e){let t=new a.l;e.consent_process_completed?(this.requestedFromDetail=!0,t.status_code="consent_process_completed",this.smsFlowService.setRequest(t),setTimeout((()=>{this.smsFlowService.disconnectWebsocket()}),3e3),this.setStatus(),this.data[this.flowName].showDocumentsOnSuccess&&!this.intervalToAskBack&&this.initIntervalToAskBack()):(this.otpComponent&&this.otpComponent.resetOtpNumber(),e.otp_status?"VALID"===e.otp_status?e.nex_step_detail&&"Seguridad Social"===e.nex_step_detail.portal&&(t.status_code="waiting_otp_seguridad_social",this.smsFlowService.setRequest(t),this.setStatus(),this.showAlert(null,null)):"INVALID"===e.otp_status&&(t.status_code=e.status_code,this.smsFlowService.setRequest(t),this.setStatus(),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongOtp)):(t.status_code=e.status_code||"failed_with_retry",this.smsFlowService.setRequest(t),this.setStatus(),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongOtp))),this.smsFlowService.setLoading(null)}initIntervalToAskBack(){!this.smsFlowService.REQUEST||!this.smsFlowService.REQUEST.request_id||(this.intervalToAskBack=setInterval((()=>{this.askDetailToBack(this.smsFlowService.REQUEST.request_id),this.intervalCount++,this.intervalCount>20&&this.stopInterval()}),5e3))}stopInterval(){this.intervalToAskBack&&clearInterval(this.intervalToAskBack)}askDetailToBack(e){let t=e||this.requestID,n=JSON.parse(JSON.stringify(this.smsFlowService.REQUEST_STATUS));t&&"consent_process_completed"!==n?this.pinService.getSolicitudByCode(e).then((e=>{if(e&&e.data){let t=e.data;if(t.status_code=t.consent_process_completed?"consent_process_completed":t.status_code,f.t.shouldIgnoreWebhookStatus(t.status_code))return;n!=t.status_code&&(this.smsFlowService.setRequest(t),this.setRequestStatus(this.smsFlowService.REQUEST_STATUS))}})).catch((e=>{this.smsFlowService.setLoading(null),this.loadingRequestData=!1})):this.stopInterval()}handleBadPhone(){this.smsFlowService.disconnectWebsocket(),this.smsFlowService.setLoading(this.labels.loadings.validatingData),setTimeout((()=>{this.smsFlowService.REQUEST||this.smsFlowService.setRequest(new a.l),this.setRequestStatus("failed_without_retry"),this.setStatus(),this.smsFlowService.setLoading(null)}),3e3)}setStatus(){if(this.showCancelRequest=!0,this.smsFlowService?.REQUEST){let e=this.smsFlowService?.REQUEST.status_code,t=h[e];if(t){if("success"===t&&this.funderConfig&&this.funderConfig.infiniteLoopInCompleted&&(this.loading=" "),"phone_not_exist_otp"===t)return void(this.data&&this.data.config&&this.data.config.tryPinWithoutSMS?(this.showCancelRequest=!1,this.gotoPin(),this.requestStatus="loading"):this.requestStatus=this.data.config.noRetryInBadPhone?"otp":u);if(("abandoned"===t||"failed"===t)&&(this.showCancelRequest=!1),"no-service"===t&&(this.requestStatus=t,this.data&&this.data.config&&this.data.config.tryPinWithoutSMS))return void(!this.requestedToPin&&this.gotoPin());if("bad-phone"===t&&this.data&&this.data.config&&this.data.config.tryPinWithoutSMS)return!this.requestedToPin&&this.gotoPin(),void(this.requestStatus="no-phone");if("no-phone"===t){if(this.data&&this.data.config&&!this.data.config.tryPinWithoutSMS)return void(this.requestStatus="no-service");if(this.data&&this.data.config&&this.data.tryPinWithoutSMS)return!this.requestedToPin&&this.gotoPin(),void(this.requestStatus="no-phone")}this.requestStatus=t,this.loading=null}else this.requestStatus="loading",this.smsFlowService.setLoading(this.labels.loadings.gettingData),this.initIntervalToAskBack()}this.cd.markForCheck()}setStatus2(){if(this.showCancelRequest=!0,this.manual)this.requestStatus="manual";else if(this.introEnabled)this.requestStatus="intro";else if(this.smsFlowService.REQUEST){if(this.smsFlowService.REQUEST){let e=h[this.smsFlowService.REQUEST_STATUS];if(e){if("success"===e&&this.data.config&&this.data.config.infiniteLoopInCompleted)return void(this.requestStatus="loading");if(("abandoned"===e||"failed"===e)&&(this.showCancelRequest=!1),"phone_not_exist_otp"===e)return void(this.data&&this.data.config&&this.data.config.tryPinWithoutSMS?(this.showCancelRequest=!1,this.gotoPin(),this.requestStatus="loading"):this.requestStatus=this.data.config.noRetryInBadPhone?"otp":u);if("no-service"===e&&(this.requestStatus=e,this.data&&this.data.config&&this.data.config.tryPinWithoutSMS))return void(!this.requestedToPin&&this.gotoPin());if("bad-phone"===e&&this.data&&this.data.config&&this.data.config.tryPinWithoutSMS)return!this.requestedToPin&&this.gotoPin(),void(this.requestStatus="no-phone");if("no-phone"===e){if(this.data&&this.data.config&&!this.data.config.tryPinWithoutSMS)return void(this.requestStatus="no-service");if(this.data&&this.data.config&&this.data.tryPinWithoutSMS)return!this.requestedToPin&&this.gotoPin(),void(this.requestStatus="no-phone")}this.requestStatus=e,this.scrollUpContent()}}}else this.requestStatus="form"}scrollUpContent(){setTimeout((()=>{this.scrollService.requestScrollMainTop()}),300)}sendRetry(){}gotoTermsAndConditions(){this.showTermsDialog=!0}handleTermsResponse(e){this.showTermsDialog=!1,this.termsOpened=!0,this.formComponent.setTermsCheck(e)}};re.ɵfac=function(e){return new(e||re)(g.Y36(g.sBO),g.Y36(_.gz),g.Y36(b.F),g.Y36(v.M),g.Y36(y.w),g.Y36(w.r),g.Y36(x.T),g.Y36(S.v),g.Y36(C.H),g.Y36(T.uw),g.Y36(k.D),g.Y36(M.p),g.Y36(I.a))},re.ɵcmp=g.Xpm({type:re,selectors:[["belender-widget-sms"]],viewQuery:function(e,t){if(1&e&&(g.Gf(E,5),g.Gf(A,5),g.Gf(E,5)),2&e){let e;g.iGM(e=g.CRH())&&(t.formComponent=e.first),g.iGM(e=g.CRH())&&(t.otpComponent=e.first),g.iGM(e=g.CRH())&&(t.theDiv=e.first)}},inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID"},features:[g._Bn([{provide:r.o2,useValue:{appearance:"standard"}}])],decls:6,vars:5,consts:[[1,"h-full","widget-belender"],[3,"class","background",4,"ngIf"],["class","loading-wrapper",4,"ngIf"],[3,"flow","lang","allData","requestStatus","requestID","accepted","cancelled",4,"ngIf"],[4,"ngIf"],[3,"sendMessage",4,"ngIf"],["class","flex justify-center h-full min-h-[300px] items-center",4,"ngIf"],["class","animated w-full fadeInRight",4,"ngIf"],[1,"flex","justify-center","h-full","min-h-[300px]","items-center"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],["class","h-full ",3,"data","flowName","gotoFlow","gotoManual",4,"ngIf"],["class","h-full ",3,"data","flowName","packId","userId","labels",4,"ngIf"],[3,"requestIDFromURL","lang","requestID","flowName","data","labels","texts","pinMode","editable_dates","skipCreationOfRequest","goToTerms",4,"ngIf"],[3,"data","labels","texts","flowName","requestID",4,"ngIf"],[3,"data","labels","texts",4,"ngIf"],[3,"requestID","data","labels","texts","flowType",4,"ngIf"],[3,"otpType","requestID","testMode","labels","logoCustom","flowType","data","texts","minLength",4,"ngIf"],[3,"data","labels","packId","flowName","userId","requestID","texts",4,"ngIf"],[3,"data","labels","currentRequest","newRequest",4,"ngIf"],[3,"data","labels","flowName","texts",4,"ngIf"],[3,"data","labels","texts","flowName",4,"ngIf"],[3,"data","labels","texts","requestID","flowType","newRequest",4,"ngIf"],[3,"texts","data","labels",4,"ngIf"],[3,"flowType","request_id","user_id","data","labels","textColor","customText",4,"ngIf"],["class","subheading-1 p-4 custom-html",3,"color","innerHTML",4,"ngIf"],[1,"h-full",3,"data","flowName","gotoFlow","gotoManual"],[1,"h-full",3,"data","flowName","packId","userId","labels"],[3,"requestIDFromURL","lang","requestID","flowName","data","labels","texts","pinMode","editable_dates","skipCreationOfRequest","goToTerms"],["formStep",""],[3,"data","labels","texts","flowName","requestID"],[3,"data","labels","texts"],[3,"requestID","data","labels","texts","flowType"],[3,"otpType","requestID","testMode","labels","logoCustom","flowType","data","texts","minLength"],["otpStep",""],[3,"data","labels","packId","flowName","userId","requestID","texts"],[3,"data","labels","currentRequest","newRequest"],[3,"data","labels","flowName","texts"],[3,"data","labels","texts","flowName"],[3,"data","labels","texts","requestID","flowType","newRequest"],[3,"texts","data","labels"],[3,"flowType","request_id","user_id","data","labels","textColor","customText"],[1,"subheading-1","p-4","custom-html",3,"innerHTML"],[1,"animated","w-full","fadeInRight"],[1,"px-6","py-4","w-full","bg-orange-500/10","rounded-md","flex","flex-col","text-orange-600",3,"innerHTML"],[1,"px-6","py-4","flex","flex-col"],[1,"text-red-500","title","m-0"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"text-blue-500","bg-blue-50","px-8",3,"click"],[1,"loading-wrapper"],["color","accent","diameter","40",1,"spinner",3,"value","mode"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[3,"flow","lang","allData","requestStatus","requestID","accepted","cancelled"],[1,"test-mode","px-10","py-2","bg-blue-500/10","text-blue-500","border-blue-500","border","rounded-md"],[3,"sendMessage"]],template:function(e,t){1&e&&(g.TgZ(0,"div",0),g.YNc(1,ee,6,10,"div",1),g.YNc(2,te,4,3,"div",2),g.qZA(),g.YNc(3,ne,1,5,"vex-terms",3),g.YNc(4,ie,3,1,"ng-container",4),g.YNc(5,se,1,0,"belender-tester-sms",5)),2&e&&(g.xp6(1),g.Q6J("ngIf",t.data&&t.data.styles&&t.data.styles.colors),g.xp6(1),g.Q6J("ngIf",t.loading&&!t.error),g.xp6(1),g.Q6J("ngIf",t.showTermsDialog),g.xp6(1),g.Q6J("ngIf",t.testMode),g.xp6(1),g.Q6J("ngIf",t.testMode))},styles:[".widget-belender[_ngcontent-%COMP%]{position:relative;min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"],data:{animation:[d.$]}}),re=(0,s.gn)([(0,o.c)()],re)},6547:(e,t,n)=>{n.r(t),n.d(t,{SmsModule:()=>Yt});var i=n(6895),s=n(6383),r=n(5592),o=n(8739),a=n(7155),l=n(6308),c=n(6709),d=n(7392),u=n(9101),h=n(1561),p=n(4006),m=n(266),f=n(4385),g=n(811),_=n(5601),b=n(3798),v=n(9391),y=n(1572),w=n(182),x=n(4650),S=n(8467),C=n(5895),T=n(8429),k=n(342),M=n(3731);function I(e,t){if(1&e&&(x.TgZ(0,"div",5),x._UZ(1,"div",6)(2,"div",7),x.ALo(3,"safeHtml"),x.qZA()),2&e){const e=x.oxw();x.xp6(1),x.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),x.Q6J("innerHTML",e.texts.success.title,x.oJD),x.xp6(1),x.Udp("color",e.data.styles.colors.text),x.Q6J("innerHTML",x.lcZ(3,8,e.texts.success.description||""),x.oJD)}}function E(e,t){if(1&e&&x._UZ(0,"widget-documents",8),2&e){const e=x.oxw();x.Q6J("userId",e.userId)("packId",e.packId)("requestID",e.requestID)}}function A(e,t){if(1&e&&(x.TgZ(0,"div",9),x._UZ(1,"mat-progress-spinner",10),x.TgZ(2,"p",11),x._uU(3),x.qZA()()),2&e){const e=x.oxw();x.xp6(1),x.Q6J("value",0),x.xp6(2),x.Oqu(e.loading)}}const O=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function L(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"div",12)(1,"button",13),x.NdJ("click",(function(){x.CHM(e);const t=x.oxw();return x.KtG(t.gotoRedirect())})),x._uU(2),x.qZA()()}if(2&e){const e=x.oxw();x.Q6J("ngClass",x.kEZ(8,O,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),x.xp6(1),x.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),x.xp6(1),x.hij(" ",e.data[e.flowName].btnTextCallBack||e.labels.actions.clickToFinish," ")}}let D=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.loading=null,this.showDocuments=!1}ngOnInit(){this.data&&this.data[this.flowName]&&this.data[this.flowName].enableUrlCallBack&&this.data[this.flowName].automaticRedirectCallBack&&this.data[this.flowName].callBackUrl?setTimeout((()=>{location.assign(this.data[this.flowName].callBackUrl)}),2e3):this.data&&this.data[this.flowName]&&this.data[this.flowName].showDocumentsOnSuccess&&(this.showDocuments=!0)}save(){}gotoRedirect(){this.data&&this.data[this.flowName]&&this.data[this.flowName].enableUrlCallBack&&this.data[this.flowName].callBackUrl&&location.assign(this.data[this.flowName].callBackUrl)}}return e.ɵfac=function(t){return new(t||e)(x.Y36(p.QS),x.Y36(S.F),x.Y36(_.M),x.Y36(v.o),x.Y36(C.T))},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-success-step"]],inputs:{data:"data",texts:"texts",loading:"loading",requestID:"requestID",packId:"packId",userId:"userId",flowName:"flowName",labels:"labels"},decls:5,vars:6,consts:[[3,"data","customImage"],["class"," pt-4 pb-8 flex flex-col animated fadeIn",4,"ngIf"],[3,"userId","packId","requestID",4,"ngIf"],["class","loading-wrapper flex flex-col items-center animated fadeIn",4,"ngIf"],["class","flex items-center gap-2 py-4 flex-col md:flex-row",3,"ngClass",4,"ngIf"],[1,"pt-4","pb-8","flex","flex-col","animated","fadeIn"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[3,"userId","packId","requestID"],[1,"loading-wrapper","flex","flex-col","items-center","animated","fadeIn"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[1,"flex","items-center","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(x._UZ(0,"belender-widget-step-logo",0),x.YNc(1,I,4,10,"div",1),x.YNc(2,E,1,3,"widget-documents",2),x.YNc(3,A,4,2,"div",3),x.YNc(4,L,3,12,"div",4)),2&e&&(x.Q6J("data",t.data)("customImage",t.texts.success.customImage),x.xp6(1),x.Q6J("ngIf",!t.data.config.infiniteLoopInCompleted&&!t.loading),x.xp6(1),x.Q6J("ngIf",t.showDocuments),x.xp6(1),x.Q6J("ngIf",t.loading),x.xp6(1),x.Q6J("ngIf",t.data&&t.data[t.flowName]&&t.data[t.flowName].enableUrlCallBack&&!t.data[t.flowName].automaticRedirectCallBack))},dependencies:[i.mk,i.O5,u.lW,y.Ou,T.y,k.A,M.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var P=n(4144),N=n(7367),q=n(2254),R=n(9549);function Y(e,t){if(1&e&&(x.TgZ(0,"form",7)(1,"mat-form-field",8)(2,"mat-label"),x._uU(3),x.qZA(),x._UZ(4,"input",9),x.qZA()()),2&e){const e=x.oxw();x.Q6J("formGroup",e.form),x.xp6(3),x.Oqu(e.labels.phone)}}const F=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function U(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"div",10)(1,"button",11),x.NdJ("click",(function(){x.CHM(e);const t=x.oxw();return x.KtG(t.no())})),x._uU(2),x.qZA(),x.TgZ(3,"button",12),x.NdJ("click",(function(){x.CHM(e);const t=x.oxw();return x.KtG(t.next())})),x._uU(4),x.qZA()()}if(2&e){const e=x.oxw();x.Q6J("ngClass",x.kEZ(12,F,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),x.xp6(1),x.Udp("border-radius",e.data.styles.btnRound+"px"),x.xp6(1),x.hij(" ",e.labels.warnings.dontHavePhone," "),x.xp6(1),x.Udp("color",e.form.invalid?"":e.data.styles.colors.btnText)("background",e.form.invalid?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),x.Q6J("disabled",e.form.invalid),x.xp6(1),x.hij(" ",e.labels.actions.next," ")}}let Z=(()=>{class e{constructor(e,t,n,i,s,r){this.fb=e,this.utils=t,this.cd=n,this.notifications=i,this.solicitudesService=s,this.smsFlowService=r,this.loading=null,this.noPhone=new x.vpe(null),this.nextStep=new x.vpe(null)}ngOnInit(){this.form=this.fb.group({phone:[null,[p.kI.required,p.kI.maxLength(9),p.kI.minLength(9)]]})}next(){"SMS"===this.flowName?this.setSmsPhone(this.form.get("phone").value):this.nextStep.emit(this.form.get("phone").value)}no(){"SMS"===this.flowName?this.setSmsNoPhone():this.noPhone.emit(!0)}setSmsPhone(e){this.smsFlowService.setLoading(this.labels.loadings.sendingNewPhone),this.solicitudesService.setPhone({phone:e},this.smsFlowService.REQUEST&&this.smsFlowService.REQUEST.request_id?this.smsFlowService.REQUEST.request_id:this.requestID).then((e=>{this.smsFlowService.setRequestStatus(e&&e.data?e.data.request_status:"bad_phone"),this.smsFlowService.setLoading(null)})).catch((e=>{console.error(e),this.smsFlowService.setLoading(null)}))}setSmsNoPhone(){this.smsFlowService.setLoading(this.labels.loadings.validatingData),this.solicitudesService.noPhone({request_id:this.smsFlowService.REQUEST.request_id}).then((e=>{this.smsFlowService.setRequestStatus("no_sms_service"),this.smsFlowService.setLoading(null)})).catch((e=>{this.smsFlowService.setLoading(null)}))}}return e.ɵfac=function(t){return new(t||e)(x.Y36(p.QS),x.Y36(S.F),x.Y36(x.sBO),x.Y36(C.T),x.Y36(_.M),x.Y36(q.p))},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-error-phone-step"]],inputs:{requestID:"requestID",flowName:"flowName",data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{noPhone:"noPhone",nextStep:"nextStep"},decls:9,vars:14,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","w-full",3,"formGroup",4,"ngIf"],["class","flex items-center gap-2 p-4",3,"ngClass",4,"ngIf"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"mb-4","w-full","md:max-w-[500px]"],["maxlength","9","formControlName","phone","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"bg-red-500","text-red-50","px-8","py-1","w-full","max-w-none","md:max-w-[220px]",3,"click"],["mat-flat-button","","type","button",1,"px-8","py-1","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(x._UZ(0,"belender-widget-step-logo",0),x.TgZ(1,"div",1)(2,"div",2),x._UZ(3,"div",3)(4,"div",4),x.ALo(5,"safeHtml"),x._UZ(6,"br"),x.YNc(7,Y,5,2,"form",5),x.qZA(),x.YNc(8,U,5,16,"div",6),x.qZA()),2&e&&(x.Q6J("data",t.data)("customImage",t.texts.errorPhone.customImage),x.xp6(3),x.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),x.Q6J("innerHTML",t.texts.errorPhone.title,x.oJD),x.xp6(1),x.Udp("color",t.data.styles.colors.text),x.Q6J("innerHTML",x.lcZ(5,12,t.texts.errorPhone.description),x.oJD),x.xp6(3),x.Q6J("ngIf",!t.data.config.noRetryInBadPhone),x.xp6(1),x.Q6J("ngIf",!t.data.config.noRetryInBadPhone))},dependencies:[i.mk,i.O5,u.lW,R.KE,R.hX,P.Nt,p._Y,p.Fj,p.JJ,p.JL,p.nD,p.sg,p.u,T.y,M.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var H=n(8135),j=n(8460);function z(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"div",9)(1,"button",10),x.NdJ("click",(function(){x.CHM(e);const t=x.oxw(2);return x.KtG(t.retry())})),x._uU(2),x.qZA()()}if(2&e){const e=x.oxw(2);x.xp6(1),x.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),x.xp6(1),x.hij(" ",e.labels.actions.retry," ")}}const B=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function J(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"div",11)(1,"button",10),x.NdJ("click",(function(){x.CHM(e);const t=x.oxw(2);return x.KtG(t.newRequest())})),x._uU(2),x.qZA()()}if(2&e){const e=x.oxw(2);x.Q6J("ngClass",x.kEZ(8,B,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),x.xp6(1),x.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),x.xp6(1),x.Oqu(e.labels.actions.newRequest)}}function V(e,t){if(1&e&&(x.TgZ(0,"div",3)(1,"div",4),x._UZ(2,"div",5)(3,"div",6),x.ALo(4,"safeHtml"),x.qZA(),x.YNc(5,z,3,7,"div",7),x.YNc(6,J,3,12,"div",8),x.qZA()),2&e){const e=x.oxw();x.xp6(2),x.Q6J("innerHTML",e.texts.fail.title,x.oJD),x.xp6(1),x.Udp("color",e.data.styles.colors.text),x.Q6J("innerHTML",x.lcZ(4,6,e.texts.fail.description),x.oJD),x.xp6(2),x.Q6J("ngIf",e.smsFlowService.REQUEST&&"failed_with_retry"==e.smsFlowService.REQUEST_STATUS),x.xp6(1),x.Q6J("ngIf",e.smsFlowService.REQUEST&&"failed_documents_downloaded"==e.smsFlowService.REQUEST_STATUS)}}function Q(e,t){if(1&e&&(x.TgZ(0,"div",12),x._UZ(1,"mat-progress-spinner",13),x.TgZ(2,"p",14),x._uU(3),x.qZA()()),2&e){const e=x.oxw();x.xp6(1),x.Q6J("value",0),x.xp6(2),x.Oqu(e.loading)}}let W=(()=>{class e{constructor(e,t,n,i,s,r,o,a){this.smsComponent=e,this.fb=t,this.utils=n,this.solicitudesService=i,this.attachmentsService=s,this.notifications=r,this.smsFlowService=o,this.customizationStoreService=a,this.loading=null,this.retryOp=new x.vpe(null),this.newReq=new x.vpe(null)}ngOnInit(){}save(){}retry(){"SMS"===this.flowType?this.retrySmsRequest(this.smsFlowService.REQUEST.request_id):this.retryOp.emit(this.smsFlowService.REQUEST.request_id)}newRequest(){this.newReq.emit(this.smsFlowService.REQUEST.request_id)}getIfRetryIsAllowed(){return"failed_with_retry"==this.smsFlowService.REQUEST_STATUS}getIfNewRequestIsAllowed(){return"failed_documents_downloaded"==this.smsFlowService.REQUEST_STATUS}retrySmsRequest(e){let t={request_id:(this.smsFlowService.REQUEST&&this.smsFlowService.REQUEST.request_id?this.smsFlowService.REQUEST.request_id:this.requestID)||e,user_id:this.customizationStoreService.USER_ID};this.smsComponent&&this.smsComponent.showAlert(null),this.smsFlowService.setLoading(this.labels.loadings.resendingRequest),this.smsFlowService.setSubscriptionOfRequest(),this.solicitudesService.retryRequest(t).then((e=>{e&&e.data&&(this.smsFlowService.setRequest(e.data),this.smsComponent.setStatus()),this.smsFlowService.setLoading(!1)})).catch((e=>{console.error(e),this.smsComponent.showAlert("Error!",e.message||e),this.smsFlowService.setLoading(!1)}))}}return e.ɵfac=function(t){return new(t||e)(x.Y36(H.T,9),x.Y36(p.QS),x.Y36(S.F),x.Y36(_.M),x.Y36(v.o),x.Y36(C.T),x.Y36(q.p),x.Y36(j.r))},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-fail-step"]],inputs:{flowType:"flowType",requestID:"requestID",data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{retryOp:"retry",newReq:"newRequest"},decls:3,vars:4,consts:[[3,"data","customImage"],["class","animated fadeIn fixed-content",4,"ngIf"],["class","loading-wrapper flex flex-col items-center animated fadeIn",4,"ngIf"],[1,"animated","fadeIn","fixed-content"],[1,"px-2","py-4","flex","flex-col"],[1,"text-red-500","title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","flex items-center justify-end gap-2 p-4",4,"ngIf"],["class","flex items-center gap-2 p-4",3,"ngClass",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8",3,"click"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],[1,"loading-wrapper","flex","flex-col","items-center","animated","fadeIn"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&(x._UZ(0,"belender-widget-step-logo",0),x.YNc(1,V,7,8,"div",1),x.YNc(2,Q,4,2,"div",2)),2&e&&(x.Q6J("data",t.data)("customImage",t.texts.fail.customImage),x.xp6(1),x.Q6J("ngIf",!t.loading),x.xp6(1),x.Q6J("ngIf",t.loading))},dependencies:[i.mk,i.O5,u.lW,y.Ou,T.y,M.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var G=n(5439),$=n.n(G),K=(n(6866),n(3238)),X=n(3755),ee=n(3746),te=n(2932),ne=n(769),ie=n(4246),se=n(5412),re=n(1763),oe=n(5696),ae=n(1094);const le=["termsCheckbox"],ce=["policyCheckbox"],de=["assignmentCheckbox"];function ue(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw();x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.needDNI," ")}}function he(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw();x.xp6(1),x.hij(" ",e.errorDNI," ")}}function pe(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw();x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.needBirthDate," ")}}function me(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw();x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.invalidDateFormat," ")}}function fe(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw();x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.invalidDate," ")}}function ge(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw();x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.underAge," ")}}function _e(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw(2);x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.invalidDateFormat," ")}}function be(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw(2);x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.invalidDate," ")}}function ve(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw(2);x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.underAge," ")}}function ye(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"mat-form-field",22)(1,"mat-label"),x._uU(2),x.qZA(),x._UZ(3,"input",23),x.TgZ(4,"mat-hint")(5,"a",24),x.NdJ("click",(function(t){x.CHM(e);const n=x.oxw();return x.KtG(n.gotoExpirationDate(t))})),x.TgZ(6,"u"),x._uU(7),x.qZA()()(),x.YNc(8,_e,2,1,"mat-error",8),x.YNc(9,be,2,1,"mat-error",8),x.YNc(10,ve,2,1,"mat-error",8),x.qZA()}if(2&e){const e=x.oxw();let t,n,i;x.xp6(2),x.Oqu(e.labels.expiration),x.xp6(1),x.uIk("aria-label",e.labels.expiration),x.xp6(4),x.Oqu(e.labels.findExpiration),x.xp6(1),x.Q6J("ngIf",null==(t=e.form.get("document_expiration"))?null:t.hasError("invalidFormat")),x.xp6(1),x.Q6J("ngIf",null==(n=e.form.get("document_expiration"))?null:n.hasError("invalidDate")),x.xp6(1),x.Q6J("ngIf",null==(i=e.form.get("document_expiration"))?null:i.hasError("underAge"))}}function we(e,t){if(1&e&&(x.TgZ(0,"mat-form-field",22)(1,"mat-label"),x._uU(2),x.qZA(),x._UZ(3,"input",25),x.qZA()),2&e){const e=x.oxw();x.xp6(2),x.Oqu(e.labels.support),x.xp6(1),x.uIk("aria-label",e.labels.support)}}function xe(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw();x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.needPhone," ")}}function Se(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw();x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.phoneDigitsRequired," ")}}function Ce(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw(2);x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.requiredEmail," ")}}function Te(e,t){if(1&e&&(x.TgZ(0,"mat-error"),x._uU(1),x.qZA()),2&e){const e=x.oxw(2);x.xp6(1),x.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.invalidEmail," ")}}function ke(e,t){if(1&e&&(x.TgZ(0,"div",26)(1,"mat-form-field",6)(2,"mat-label"),x._uU(3),x.qZA(),x._UZ(4,"input",27),x.YNc(5,Ce,2,1,"mat-error",8),x.YNc(6,Te,2,1,"mat-error",8),x.qZA()()),2&e){const e=x.oxw();let t,n;x.xp6(1),x.Gre("",e.disabledInputs.email?"disabled-input":""," w-full flex-1 belender-form-field"),x.xp6(2),x.Oqu(e.labels.email),x.xp6(1),x.s9C("tabindex",e.disabledInputs.email?-1:1),x.s9C("placeholder",e.labels.inputEmail),x.uIk("aria-label",e.labels.email),x.xp6(1),x.Q6J("ngIf",null==(t=e.form.get("email"))?null:t.hasError("required")),x.xp6(1),x.Q6J("ngIf",null==(n=e.form.get("email"))?null:n.hasError("email"))}}function Me(e,t){if(1&e&&(x.TgZ(0,"div",28),x._UZ(1,"mat-icon",29),x._uU(2),x.qZA()),2&e){const e=x.oxw();x.xp6(2),x.hij(" ",e.labels.warnings.haveToReadTerms," ")}}function Ie(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"div",30)(1,"belender-checkbox",31,32),x.NdJ("changeCheckbox",(function(t){x.CHM(e);const n=x.oxw();return x.KtG(n.setTerms(t))})),x.TgZ(3,"belender-terms-and-policy-links",33),x.NdJ("goToTerms",(function(t){x.CHM(e);const n=x.oxw();return x.KtG(n.gotoTermsAndConditions(t))})),x.qZA()()()}if(2&e){const e=x.oxw();x.xp6(1),x.Q6J("color",e.data.styles.colors.title),x.xp6(2),x.Q6J("userId",e.userId)("lang",e.lang)("flowName",e.flowName)("data",e.data)("linkType","terms")("firstSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.firstSentence)("secondSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.secondSentence)("thirdSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.thirdSentence)("policyActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.policyActionText)("termsActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.termsActionText)("customTerms",e.data[e.flowName].customTerms)}}function Ee(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"div",30)(1,"belender-checkbox",34,35),x.NdJ("changeCheckbox",(function(t){x.CHM(e);const n=x.oxw();return x.KtG(n.setPolicy(t))})),x._UZ(3,"belender-terms-and-policy-links",36),x.qZA()()}if(2&e){const e=x.oxw();x.xp6(1),x.Q6J("color",e.data.styles.colors.title),x.xp6(2),x.Q6J("userId",e.userId)("lang",e.lang)("flowName",e.flowName)("data",e.data)("linkType","policy")("policyActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.policyActionText)}}function Ae(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"div",30)(1,"belender-checkbox",37,38),x.NdJ("changeCheckbox",(function(t){x.CHM(e);const n=x.oxw();return x.KtG(n.setAssignment(t))})),x._UZ(3,"div",39),x.qZA()()}if(2&e){const e=x.oxw();x.xp6(1),x.Q6J("color",e.data.styles.colors.title),x.xp6(2),x.Q6J("innerHTML",(null==e.data[e.flowName]||null==e.data[e.flowName].texts?null:e.data[e.flowName].texts.dataAssignmentText)||(null==e.data[e.flowName]||null==e.data[e.flowName].config_translate?null:e.data[e.flowName].config_translate.dataAssignmentText)||(null==e.data||null==e.data.config?null:e.data.config.dataAssignmentText)||"",x.oJD)}}function Oe(e,t){if(1&e&&(x.TgZ(0,"div",40),x._UZ(1,"mat-icon",29),x._uU(2),x.qZA()),2&e){const e=x.oxw();x.xp6(2),x.hij(" ",e.errorDNI," ")}}function Le(e,t){if(1&e&&(x.TgZ(0,"div",41)(1,"strong",42),x._uU(2),x.qZA(),x.TgZ(3,"span",43),x._uU(4),x.qZA()()),2&e){const e=x.oxw();x.xp6(2),x.Oqu(e.labels.warnings.wrongDate||"Error"),x.xp6(2),x.Oqu(e.dateError)}}function De(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"button",44),x.NdJ("click",(function(){x.CHM(e);const t=x.oxw();return x.KtG(t.goBack())})),x._uU(1),x.qZA()}if(2&e){const e=x.oxw();x.Udp("border-radius",e.data.styles.btnRound+"px"),x.xp6(1),x.hij(" ",e.labels.actions.back," ")}}function Pe(e,t){if(1&e&&(x.TgZ(0,"div",45),x._UZ(1,"mat-progress-spinner",46),x.TgZ(2,"p",47),x._uU(3),x.qZA()()),2&e){const e=x.oxw();x.xp6(1),x.Q6J("value",0),x.xp6(2),x.hij(" ",e.loading," ")}}const Ne=function(e){return{"dont-show-data":e}},qe=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Re=(()=>{class e{constructor(e,t,n,i,s,r,o,a,l,c){this.smsComponent=e,this.fb=t,this.utils=n,this.cd=i,this.widgetUtils=s,this.dialog=r,this.customService=o,this.smsFlowService=a,this.solicitudesService=l,this.customizationStoreService=c,this.editable_dates=!1,this.next=new x.vpe(null),this.goTerms=new x.vpe(null),this.goIntro=new x.vpe(null),this.acceptTerms=!1,this.acceptPolicy=!1,this.assignment=!1,this.termsReaded=!1,this.isDni=!1,this.isNie=!1,this.errorDNI=null,this.disabledInputs={document_number:!1,birth_date:!1,email:!1,phone:!1},this.noValidate=!1,this.testMode=!0,this.submitAttempted=!1,this.lang="",this.hasDateError=!1,this.dateError=""}ngOnInit(){this.packId=this.customizationStoreService.PACK_ID,this.userId=this.customizationStoreService.USER_ID,this.smsFlowService.REQUEST?(this.noValidate="terms_and_conditions"==this.smsFlowService.REQUEST_STATUS,this.setForm(this.smsFlowService.REQUEST)):this.setForm(null)}setTermsCheck(e){this.checkComponent.checked=e,this.acceptTerms=e,this.termsReaded=e}setForm(e){let t=e?e.person_document_number||e.dni||e.document_number:null,n=e&&e.person_birth_date?$()(e.person_birth_date).format("DD/MM/YYYY"):null,i=e&&e.birth_date?$()(e.birth_date).format("DD/MM/YYYY"):n,s=e?e.person_phone||e.phone:null,r=e?e.person_email||e.email:null;t&&this.setRegex(t);const o=this;o.form=o.fb.group(o.data&&o.data.config&&o.data.config.followMail?{document_number:[t||null,o.noValidate?[]:[p.kI.required,p.kI.maxLength(9),o.regexDNI()]],birth_date:[i||null,o.noValidate?[]:[p.kI.required,(0,te.s)({checkFormat:!0,checkDate:!0,checkAge:!0})]],type:["DNI"],phone:[s||"",o.noValidate?[]:[p.kI.required,p.kI.maxLength(9),p.kI.minLength(9)]],email:[r||null,o.noValidate?[]:[p.kI.required,p.kI.email]],document_expiration:[null,[(0,te.s)({checkFormat:!0,checkDate:!0})]],support_number:[null]}:{document_number:[t||null,o.noValidate?[]:[p.kI.required,p.kI.maxLength(9),o.regexDNI()]],birth_date:[i||null,o.noValidate?[]:[p.kI.required,(0,te.s)({checkFormat:!0,checkDate:!0,checkAge:!0})]],type:["DNI"],phone:[s||"",o.noValidate?[]:[p.kI.required,p.kI.maxLength(9),p.kI.minLength(9)]],email:[r||null],document_expiration:[null,[(0,te.s)({checkFormat:!0,checkDate:!0,checkAge:!0})]],support_number:[null]}),this.form.markAsUntouched(),this.form.updateValueAndValidity(),o.requestIDFromURL&&o.disableEnableInputs(t,n,s,r)}forceEnableDisableInputs(e,t,n,i){this.disableEnableInputs(e?e.value:this.disabledInputs.document_number,t?t.value:this.disabledInputs.birth_date,n?n.value:this.disabledInputs.phone,i?i.value:this.disabledInputs.email)}disableEnableInputs(e,t,n,i){this.disabledInputs={document_number:e||!1,birth_date:!this.editable_dates&&(t||!1),email:i||!1,phone:n||!1}}regexDNI(){return e=>{const t=e.value;return t?(this.setRegex(t),this.isDni||this.isNie?null:{regexDNI:!0}):null}}gotoTermsAndConditions(e){e?.preventDefault(),e?.stopPropagation(),this.termsReaded=!0,this.goTerms.emit(!0)}setRegex(e){if(!e)return;let t=this.widgetUtils.ValidateIDType(e);t&&t.type?("dni"===t.type?(this.isDni=!0,this.errorDNI=t.valid?null:this.labels?.warnings?.invalidDni):this.isDni=!1,"nie"===t.type?(this.isNie=!0,this.errorDNI=t.valid?null:this.labels?.warnings?.invalidNie):this.isNie=!1):(this.isDni=!1,this.isNie=!1,this.errorDNI=this.labels?.warnings?.invalidNieOrDni),this.cd.markForCheck()}setTerms(e){this.acceptTerms=e,this.acceptTerms&&(this.data?.config??{}).forceChecks?this.gotoTermsAndConditions():this.acceptTerms||(this.termsReaded=!1)}setPolicy(e){this.acceptPolicy=e}setAssignment(e){this.assignment=e}getIfValid(){if(this.data.config.hideCheckLegal)return!this.data?.config?.showPolicyLink||this.acceptPolicy;{const e=!!this.data?.config?.showPolicyLink;return this.acceptTerms&&(!e||this.acceptPolicy)}}getFormsValid(){let e=!this.form.invalid,t=this.form.get("document_number").value;return t?this.setRegex(t):e=!1,!this.isDni&&!this.isNie&&(this.disabledInputs.document_number=!1,e=!1),this.errorDNI&&(e=!1),this.cd.markForCheck(),e}nextStep(){if(!this.getFormsValid()||!this.getAssignmentValidation()||!this.getIfValid())return void(0,ne.J)(this,this.cd);let e;e=this.data&&this.data.config&&this.data.config.followMail?{document_number:this.form.get("document_number").value.toUpperCase(),birth_date:this.utils.formatDate(this.form.get("birth_date").value),type:this.form.get("type").value,phone:this.form.get("phone").value,email_copy:this.form.get("email").value,check_legal:!0,document_expiration_date:this.form.get("document_expiration")?this.utils.formatDate(this.form.get("document_expiration").value):"2029-04-11"}:{document_number:this.form.get("document_number").value.toUpperCase(),birth_date:this.utils.formatDate(this.form.get("birth_date").value),type:this.form.get("type").value,phone:this.form.get("phone").value,check_legal:!0,email_copy:"roger.checa@belender.eu",document_expiration_date:this.form.get("document_expiration")?this.utils.formatDate(this.form.get("document_expiration").value):"2029-04-11"},"SMS"===this.flowName?this.gotoSmsTerms(e):this.next.emit(e)}getAssignmentValidation(){return!(this.data.config.forceChecks&&!this.data.config.hideCheckLegal&&!this.termsReaded)&&(!this.data.config.dataAssignmentCheck||this.assignment)}goBack(){"SMS"===this.flowName?this.goSmsIntro():this.goIntro.emit(!0)}gotoSupportAclaration(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(X.$,{panelClass:"fullscreen-dialog"})}gotoExpirationDate(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(ee.R,{panelClass:"fullscreen-dialog"})}gotoSmsTerms(e){this.smsFlowService.setLoading(this.labels.loadings.sendingData),e.package_id=this.packId,e.user_id=this.userId,this.requestID&&(e.request_id=this.requestID),this.skipCreationOfRequest?(this.smsComponent.acceptTerms(),this.smsFlowService.setSubscriptionOfRequest()):this.checkSmsService(e)}goSmsIntro(){this.smsComponent.manual=!1,this.smsComponent.introEnabled=!0}checkSmsService(e){this.hasDateError=!1,this.forceEnableDisableInputs({value:!0},{value:!0},{value:!0},{value:!0}),this.solicitudesService.checkService(e).then((t=>{console.warn(t),t&&t.message&&t.status&&"error"==t.status?t.message.birth_date?(this.smsFlowService.setLoading(null),this.smsComponent.setRequestStatus("form"),this.hasDateError=!0,this.dateError=this.labels.warnings.wrongDate,this.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1})):"string"==typeof t.message&&" fecha de nacimiento incorrecta"==t.message.toLowerCase()?(this.smsFlowService.setLoading(null),this.smsComponent.setRequestStatus("form"),this.hasDateError=!0,this.dateError=this.labels.warnings.wrongDateDesc,this.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1})):"string"==typeof t.message&&"does not have sms service"==t.message.toLowerCase()?(this.smsFlowService.setLoading(this.labels.loadings.creatingRequest),e.user_id=this.userId,e.package_id=this.packId,this.requestID&&(e.request_id=this.requestID),this.solicitudesService.addSolicitud(e).then((e=>{console.warn(e),e.data&&this.smsFlowService.updateRequestID(e.data.request_id),this.solicitudesService.setNoService({request_id:this.requestID}).then((()=>{this.smsFlowService.setLoading(null)})),this.smsComponent.setRequestStatus("no_service"),this.smsComponent.setStatus()}))):"string"==typeof t.message&&"birthdate incorrect"==t.message.toLowerCase()?(this.smsFlowService.setLoading(null),this.smsComponent.setRequestStatus("form"),this.hasDateError=!0,this.dateError=this.labels.warnings.wrongDateDesc,this.forceEnableDisableInputs({value:!0},{value:!1},{value:!1},{value:!1})):(this.smsComponent.setRequestStatus("form"),this.smsComponent.setStatus(),this.smsFlowService.setLoading(null)):t&&t.status&&"success"==t.status?this.smsComponent.addSolicitudSMS(e):(this.smsFlowService.setLoading(null),this.smsComponent.setRequestStatus("form"),this.smsComponent.setStatus(),this.dateError=t.message||t)})).catch((e=>{console.error(e),this.smsFlowService.setLoading(null),e.message&&"birthdate incorrect"==e.message.toLowerCase()&&(this.smsComponent.setRequestStatus("form"),this.hasDateError=!0,this.dateError=this.labels.warnings.wrongDateDesc)}))}}return e.ɵfac=function(t){return new(t||e)(x.Y36(H.T,9),x.Y36(p.QS),x.Y36(S.F),x.Y36(x.sBO),x.Y36(ie.t),x.Y36(se.uw),x.Y36(N.w),x.Y36(q.p),x.Y36(_.M),x.Y36(j.r))},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-form-step"]],viewQuery:function(e,t){if(1&e&&(x.Gf(le,5),x.Gf(ce,5),x.Gf(de,5)),2&e){let e;x.iGM(e=x.CRH())&&(t.checkComponent=e.first),x.iGM(e=x.CRH())&&(t.policyCheckComponent=e.first),x.iGM(e=x.CRH())&&(t.assignmentCheckComponent=e.first)}},inputs:{requestID:"requestID",data:"data",flowName:"flowName",texts:"texts",pinMode:"pinMode",requestIDFromURL:"requestIDFromURL",editable_dates:"editable_dates",skipCreationOfRequest:"skipCreationOfRequest",labels:"labels",lang:"lang"},outputs:{next:"nextStep",goTerms:"goToTerms",goIntro:"goIntro"},features:[x._Bn([{provide:K.sG,useValue:{parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}}}])],decls:42,vars:68,consts:[[3,"data","customImage"],[3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4","custom-html",3,"innerHTML"],[1,"mb-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between",3,"ngClass"],["appearance","outline"],["placeholder","Ej: 12312345R","formControlName","document_number","maxlength","9","matInput","",3,"tabindex"],[4,"ngIf"],["type","text","placeholder","Ej: 22/03/1990","formControlName","birth_date","matInput","","mask","d0/M0/0000",3,"tabindex"],["appearance","outline","class","w-full flex-1 belender-form-field",4,"ngIf"],["formControlName","phone","placeholder","Ej: 123123123","maxlength","9","type","text","matInput","",3,"tabindex"],["class","w-full",4,"ngIf"],[1,"mb-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["class","px-2 flex items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500",4,"ngIf"],["class","flex justify-start items-center w-full flex-100",4,"ngIf"],["class","pl-3 pr-4 flex w-fit items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500",4,"ngIf"],["class","bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative","role","alert",4,"ngIf"],[1,"flex","items-center","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["class","px-8 py-1 bg-slate-100 hover:bg-slate-200 text-slate-900 w-full max-w-none md:max-w-[220px]","mat-flat-button","","type","button",3,"border-radius","click",4,"ngIf"],["mat-flat-button","","type","button",1,"px-8","py-1","w-full","max-w-none","md:max-w-[220px]",3,"click"],["class","loading-wrapper flex flex-col items-center animated fadeIn",4,"ngIf"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["type","text","placeholder","Ej: 22/03/1990","required","","formControlName","document_expiration","matInput","","mask","d0/M0/0000"],["target","_blank",1,"text-sm","hover:text-blue-500","cursor-pointer",3,"click"],["type","text","placeholder","22211134","required","","formControlName","support_number","matInput",""],[1,"w-full"],["formControlName","email","type","email","matInput","",3,"tabindex","placeholder"],[1,"px-2","flex","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"],["svgIcon","mat:warning",1,"text-xs","w-4","h-4"],[1,"flex","justify-start","items-center","w-full","flex-100"],["id","termsCheckbox",3,"color","changeCheckbox"],["termsCheckbox",""],[3,"userId","lang","flowName","data","linkType","firstSentence","secondSentence","thirdSentence","policyActionText","termsActionText","customTerms","goToTerms"],["id","policyCheckbox",3,"color","changeCheckbox"],["policyCheckbox",""],[3,"userId","lang","flowName","data","linkType","policyActionText"],[3,"color","changeCheckbox"],["assignmentCheckbox",""],[1,"custom-html",3,"innerHTML"],[1,"pl-3","pr-4","flex","w-fit","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"],["role","alert",1,"bg-red-100","border","border-red-400","text-red-700","px-4","py-3","rounded","relative"],[1,"font-bold","mr-1"],[1,"block","sm:inline"],["mat-flat-button","","type","button",1,"px-8","py-1","bg-slate-100","hover:bg-slate-200","text-slate-900","w-full","max-w-none","md:max-w-[220px]",3,"click"],[1,"loading-wrapper","flex","flex-col","items-center","animated","fadeIn"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){if(1&e&&(x._UZ(0,"belender-widget-step-logo",0),x.TgZ(1,"form",1)(2,"div",2),x._UZ(3,"div",3)(4,"div",4),x.ALo(5,"safeHtml"),x.qZA(),x.TgZ(6,"div",5)(7,"mat-form-field",6)(8,"mat-label"),x._uU(9),x.qZA(),x._UZ(10,"input",7),x.YNc(11,ue,2,1,"mat-error",8),x.YNc(12,he,2,1,"mat-error",8),x.qZA(),x.TgZ(13,"mat-form-field",6)(14,"mat-label"),x._uU(15),x.qZA(),x._UZ(16,"input",9),x.YNc(17,pe,2,1,"mat-error",8),x.YNc(18,me,2,1,"mat-error",8),x.YNc(19,fe,2,1,"mat-error",8),x.YNc(20,ge,2,1,"mat-error",8),x.qZA(),x.YNc(21,ye,11,6,"mat-form-field",10),x.YNc(22,we,4,2,"mat-form-field",10),x.TgZ(23,"mat-form-field",6)(24,"mat-label"),x._uU(25),x.qZA(),x._UZ(26,"input",11),x.YNc(27,xe,2,1,"mat-error",8),x.YNc(28,Se,2,1,"mat-error",8),x.qZA(),x.YNc(29,ke,7,9,"div",12),x.qZA(),x.TgZ(30,"div",13),x.YNc(31,Me,3,1,"div",14),x.YNc(32,Ie,4,12,"div",15),x.YNc(33,Ee,4,7,"div",15),x.YNc(34,Ae,4,2,"div",15),x.YNc(35,Oe,3,1,"div",16),x.qZA(),x.YNc(36,Le,5,2,"div",17),x.TgZ(37,"div",18),x.YNc(38,De,2,3,"button",19),x.TgZ(39,"button",20),x.NdJ("click",(function(){return t.nextStep()})),x._uU(40),x.qZA()()(),x.YNc(41,Pe,4,2,"div",21)),2&e){let e,n,i,s,r,o,a,l;x.Q6J("data",t.data)("customImage",t.texts.form.customImage),x.xp6(1),x.Gre("animated ",t.loading?"hide-content":""," fadeIn fixed-content px-2"),x.Q6J("formGroup",t.form),x.xp6(2),x.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),x.Q6J("innerHTML",t.texts.form.title,x.oJD),x.xp6(1),x.Udp("color",t.data.styles.colors.text),x.Q6J("innerHTML",x.lcZ(5,60,t.texts.form.description||""),x.oJD),x.xp6(2),x.Q6J("ngClass",x.VKq(62,Ne,t.data.config.dontShowDataInTerms&&t.smsFlowService.REQUEST&&t.smsFlowService.REQUEST_STATUS&&"terms_and_conditions"===t.smsFlowService.REQUEST_STATUS)),x.xp6(1),x.Gre("",t.disabledInputs.document_number?"disabled-input":""," w-full flex-1 belender-form-field"),x.xp6(2),x.Oqu(t.isDni?t.labels.dni:t.isNie?t.labels.nie:t.labels.nieOrDni),x.xp6(1),x.s9C("tabindex",t.disabledInputs.document_number?-1:1),x.uIk("aria-label",t.isDni?t.labels.dni:t.isNie?t.labels.nie:t.labels.nieOrDni),x.xp6(1),x.Q6J("ngIf",null==(e=t.form.get("document_number"))?null:e.hasError("required")),x.xp6(1),x.Q6J("ngIf",!(null!=(n=t.form.get("document_number"))&&n.hasError("required"))&&t.errorDNI),x.xp6(1),x.Gre("",t.disabledInputs.birth_date?"disabled-input":""," w-full flex-1 belender-form-field"),x.xp6(2),x.Oqu(t.labels.birthday),x.xp6(1),x.s9C("tabindex",t.disabledInputs.birth_date?-1:1),x.uIk("aria-label",t.labels.birthday),x.xp6(1),x.Q6J("ngIf",null==(i=t.form.get("birth_date"))?null:i.hasError("required")),x.xp6(1),x.Q6J("ngIf",null==(s=t.form.get("birth_date"))?null:s.hasError("invalidFormat")),x.xp6(1),x.Q6J("ngIf",null==(r=t.form.get("birth_date"))?null:r.hasError("invalidDate")),x.xp6(1),x.Q6J("ngIf",null==(o=t.form.get("birth_date"))?null:o.hasError("underAge")),x.xp6(1),x.Q6J("ngIf",t.pinMode&&!t.isNie),x.xp6(1),x.Q6J("ngIf",t.pinMode&&t.isNie),x.xp6(1),x.Gre("",t.disabledInputs.phone?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),x.xp6(2),x.Oqu(t.labels.phone),x.xp6(1),x.s9C("tabindex",t.disabledInputs.phone?-1:1),x.uIk("aria-label",t.labels.phone),x.xp6(1),x.Q6J("ngIf",null==(a=t.form.get("phone"))?null:a.hasError("required")),x.xp6(1),x.Q6J("ngIf",(null==(l=t.form.get("phone"))?null:l.hasError("minlength"))||(null==(l=t.form.get("phone"))?null:l.hasError("maxlength"))),x.xp6(1),x.Q6J("ngIf",null==t.data||null==t.data.config?null:t.data.config.followMail),x.xp6(2),x.Q6J("ngIf",t.submitAttempted&&!t.data.config.hideCheckLegal&&!t.acceptTerms),x.xp6(1),x.Q6J("ngIf",!t.data.config.hideCheckLegal),x.xp6(1),x.Q6J("ngIf",null==t.data||null==t.data.config?null:t.data.config.showPolicyLink),x.xp6(1),x.Q6J("ngIf",null==t.data?null:t.data.config.dataAssignmentCheck),x.xp6(1),x.Q6J("ngIf",t.errorDNI),x.xp6(1),x.Q6J("ngIf",t.hasDateError),x.xp6(1),x.Q6J("ngClass",x.kEZ(64,qe,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),x.xp6(1),x.Q6J("ngIf",t.data.config.introEnabled),x.xp6(1),x.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),x.xp6(1),x.hij(" ",t.labels.actions.continue," "),x.xp6(1),x.Q6J("ngIf",t.loading)}},dependencies:[i.mk,i.O5,d.Hw,u.lW,R.TO,R.KE,R.bx,R.hX,P.Nt,p._Y,p.Fj,p.JJ,p.JL,p.Q7,p.nD,p.sg,p.u,y.Ou,re.b,T.y,oe.T,ae.Z6,M.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.dont-show-data[_ngcontent-%COMP%]{opacity:0!important;padding:0!important;overflow:hidden!important;height:0px!important;margin:0!important}.hide-content[_ngcontent-%COMP%]{opacity:0!important;max-height:0px!important;overflow:hidden!important;padding:0!important}"]}),e})();var Ye=n(9602),Fe=n(6257),Ue=n(1948),Ze=n(8594);const He=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let je=(()=>{class e{constructor(e,t,n,i,s,r,o){this.smsComponent=e,this.fb=t,this.utils=n,this.Activatedroute=i,this.smsFlowService=s,this.solicitudesService=r,this.cd=o,this.next=new x.vpe(null),this.loading=null,this.accept=!1}ngOnInit(){this.Activatedroute.queryParams.subscribe((e=>{this.setForm(e)}))}nextStep(){let e={phone:this.form.get("phone").value};"SMS"===this.flowName?this.sendSmsNewData(e):this.next.emit(e)}setForm(e){this.form=this.fb.group({phone:["",p.kI.required]}),this.smsFlowService.REQUEST&&"bad_phone"==this.smsFlowService.REQUEST_STATUS&&this.form.controls.phone.markAsTouched()}sendSmsNewData(e){this.smsFlowService.setLoading(this.labels.loadings.sendingData),this.solicitudesService.fixData(this.requestID,e).then((e=>{e.status&&"error"==e.status?e.message&&(this.smsComponent.showAlert("Error!",e.message,"error"),this.smsFlowService.setLoading(!1)):e&&"success"==e.status&&(this.smsFlowService.sendMessageToParent({type:"response",data:e.data||e}),this.smsFlowService.setLoading(this.labels.loadings.validatingData),this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.smsComponent.showAlert("Error!",e.error),this.smsFlowService.setLoading(!1)}))}}return e.ɵfac=function(t){return new(t||e)(x.Y36(H.T,9),x.Y36(p.QS),x.Y36(S.F),x.Y36(Ze.gz),x.Y36(q.p),x.Y36(_.M),x.Y36(x.sBO))},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-error-form-step"]],inputs:{requestID:"requestID",data:"data",flowName:"flowName",texts:"texts",mode:"mode",loading:"loading",labels:"labels"},outputs:{next:"nextStep"},decls:14,vars:23,consts:[[1,"animated","fadeIn","fixed-content",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"mb-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline",1,"mb-4","w-full","flex-1"],["formControlName","phone","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(x.TgZ(0,"form",0)(1,"div",1)(2,"div",2),x._uU(3),x.qZA(),x.TgZ(4,"div",3),x._uU(5),x.qZA()(),x.TgZ(6,"div",4)(7,"mat-form-field",5)(8,"mat-label"),x._uU(9),x.qZA(),x._UZ(10,"input",6),x.qZA()(),x.TgZ(11,"div",7)(12,"button",8),x.NdJ("click",(function(){return t.nextStep()})),x._uU(13),x.qZA()()()),2&e&&(x.Q6J("formGroup",t.form),x.xp6(2),x.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),x.xp6(1),x.Oqu(t.labels.warnings.phoneError),x.xp6(1),x.Udp("color",t.data.styles.colors.text),x.xp6(1),x.Oqu(t.labels.warnings.badPhoneSS),x.xp6(4),x.Oqu(t.labels.phone),x.xp6(2),x.Q6J("ngClass",x.kEZ(19,He,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),x.xp6(1),x.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),x.Q6J("disabled",t.form.invalid),x.xp6(1),x.Oqu(t.labels.actions.continue))},dependencies:[i.mk,u.lW,R.KE,R.hX,P.Nt,p._Y,p.Fj,p.JJ,p.JL,p.sg,p.u],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var ze=n(6e3);const Be=[{path:":idUser",component:H.T},{path:":idUser/:packID",component:H.T}];let Je=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=x.oAB({type:e}),e.ɵinj=x.cJS({imports:[Ze.Bz.forChild(Be),Ze.Bz,ze.d8]}),e})(),Ve=(()=>{class e{constructor(){this.loading=null}ngOnInit(){}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-no-service-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},decls:6,vars:12,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&(x._UZ(0,"belender-widget-step-logo",0),x.TgZ(1,"form",1)(2,"div",2),x._UZ(3,"div",3)(4,"div",4),x.ALo(5,"safeHtml"),x.qZA()()),2&e&&(x.Q6J("data",t.data)("customImage",t.texts.noService.customImage),x.xp6(3),x.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),x.Q6J("innerHTML",t.texts.noService.title,x.oJD),x.xp6(1),x.Udp("color",t.data.styles.colors.text),x.Q6J("innerHTML",x.lcZ(5,10,t.texts.noService.description),x.oJD))},dependencies:[p._Y,p.JL,p.F,T.y,M.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const Qe=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let We=(()=>{class e{constructor(e,t,n,i,s,r,o,a){this.smsComponent=e,this.fb=t,this.utils=n,this.solicitudesService=i,this.attachmentsService=s,this.notifications=r,this.smsFlowService=o,this.customizationStoreService=a,this.retryOp=new x.vpe(null),this.loading=null}ngOnInit(){}save(){}retry(){this.smsComponent?.showAlert(null),"SMS"===this.flowType?this.retrySmsRequest(this.smsFlowService.REQUEST.request_id):this.retryOp.emit(this.smsFlowService.REQUEST.request_id)}getTextStatus(){switch(this.smsFlowService.REQUEST_STATUS){case"abandoned_after_waiting_otp_seguridad_social":return this.labels.abandoned.afterWaitingOtpSS;case"abandoned_after_invalid_otp_seguridad_social":return this.labels.abandoned.afterInvalidOtpSS;case"abandoned_after_invalid_otp_aeat":return this.labels.abandoned.afterInvalidOtpAEAT;case"abandoned_after_waiting_otp_aeat":return this.labels.abandoned.afterWaitingOtpAEAT;default:return this.smsFlowService.REQUEST.status_message||this.smsFlowService.REQUEST_STATUS}}retrySmsRequest(e){let t={request_id:(this.smsFlowService.REQUEST&&this.smsFlowService.REQUEST.request_id?this.smsFlowService.REQUEST.request_id:this.requestID)||e,user_id:this.customizationStoreService.USER_ID};this.smsFlowService.setLoading(this.labels.loadings.resendingRequest),this.smsFlowService.setSubscriptionOfRequest(),this.solicitudesService.retryRequest(t).then((e=>{e&&e.data&&(this.smsFlowService.setRequest(e.data),this.smsComponent.setStatus()),this.smsFlowService.setLoading(!1)})).catch((e=>{console.error(e),this.smsComponent.showAlert("Error!",e.message||e),this.smsFlowService.setLoading(!1)}))}}return e.ɵfac=function(t){return new(t||e)(x.Y36(H.T,9),x.Y36(p.QS),x.Y36(S.F),x.Y36(_.M),x.Y36(v.o),x.Y36(C.T),x.Y36(q.p),x.Y36(j.r))},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-abandoned-step"]],inputs:{flowType:"flowType",requestID:"requestID",loading:"loading",labels:"labels",data:"data",texts:"texts"},outputs:{retryOp:"retry"},decls:11,vars:25,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"p-1","px-4","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm","mb-2","mt-6"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(x._UZ(0,"belender-widget-step-logo",0),x.TgZ(1,"div",1)(2,"div",2),x._UZ(3,"div",3)(4,"div",4),x.ALo(5,"safeHtml"),x.TgZ(6,"div",5),x._uU(7),x.qZA()(),x.TgZ(8,"div",6)(9,"button",7),x.NdJ("click",(function(){return t.retry()})),x._uU(10),x.qZA()()()),2&e&&(x.Q6J("data",t.data)("customImage",t.texts.abandoned.customImage),x.xp6(3),x.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),x.Q6J("innerHTML",t.texts.abandoned.title,x.oJD),x.xp6(1),x.Udp("color",t.data.styles.colors.text),x.Q6J("innerHTML",x.lcZ(5,19,t.texts.abandoned.description),x.oJD),x.xp6(3),x.hij(" ",t.getTextStatus()," "),x.xp6(1),x.Q6J("ngClass",x.kEZ(21,Qe,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),x.xp6(1),x.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),x.xp6(1),x.Oqu(t.labels.actions.retry))},dependencies:[i.mk,u.lW,T.y,M.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Ge=n(6981),$e=n(5145);const Ke=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let Xe=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.nr=new x.vpe(null),this.loading=null}ngOnInit(){}newRequest(){this.nr.emit(!0)}gotoRequest(){location.assign(this.currentRequest.widget_url_boxed)}getStatus(){let e=$e.Z.find((e=>e.text==this.currentRequest.status_code));return e?e.label:this.labels.unknownState}}return e.ɵfac=function(t){return new(t||e)(x.Y36(p.QS),x.Y36(S.F),x.Y36(_.M),x.Y36(v.o),x.Y36(C.T))},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-duplicated-request-step"]],inputs:{currentRequest:"currentRequest",loading:"loading",data:"data",texts:"texts",labels:"labels"},outputs:{nr:"newRequest"},decls:16,vars:26,consts:[[3,"data"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"flex","gap-2","justify-start","items-center","py-2"],[1,"w-fit","p-1","px-2","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-flat-button","","type","button",1,"px-8",3,"click"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(x._UZ(0,"belender-widget-step-logo",0),x.TgZ(1,"div",1)(2,"div",2)(3,"div",3),x._uU(4),x.qZA(),x.TgZ(5,"div",4),x._uU(6),x.qZA(),x.TgZ(7,"div",5),x._uU(8),x.TgZ(9,"div",6),x._uU(10),x.qZA()()(),x.TgZ(11,"div",7)(12,"button",8),x.NdJ("click",(function(){return t.newRequest()})),x._uU(13),x.qZA(),x.TgZ(14,"button",9),x.NdJ("click",(function(){return t.gotoRequest()})),x._uU(15),x.qZA()()()),2&e&&(x.Q6J("data",t.data),x.xp6(3),x.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),x.xp6(1),x.hij(" ",t.labels.warnings.duplicatedRequest," "),x.xp6(1),x.Udp("color",t.data.styles.colors.text),x.xp6(1),x.hij(" ",t.labels.warnings.alreadyHaveRequest," "),x.xp6(2),x.hij(" ",t.labels.warnings.currentRequestStatus," "),x.xp6(2),x.hij(" ",t.getStatus()," "),x.xp6(1),x.Q6J("ngClass",x.kEZ(22,Ke,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),x.xp6(1),x.Udp("border-radius",t.data.styles.btnRound+"px"),x.xp6(1),x.hij(" ",t.labels.actions.newRequest," "),x.xp6(1),x.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),x.xp6(1),x.hij(" ",t.labels.actions.gotoCurrentRequest," "))},dependencies:[i.mk,u.lW,T.y],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var et=n(1129),tt=n(9476),nt=n(8962),it=n(3468),st=n(3295);let rt=(()=>{class e{constructor(){this.loading=null}ngOnInit(){console.error(this.data,this.texts)}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-standby-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},decls:6,vars:12,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"]],template:function(e,t){1&e&&(x._UZ(0,"belender-widget-step-logo",0),x.TgZ(1,"form",1)(2,"div",2),x._UZ(3,"div",3)(4,"div",4),x.ALo(5,"safeHtml"),x.qZA()()),2&e&&(x.Q6J("data",t.data)("customImage",t.texts.standby.customImage),x.xp6(3),x.Udp("color",t.data.styles.colors.title)("font-size",t.texts.standby?t.texts.standby.titleSize+"px":"20px"),x.Q6J("innerHTML",t.texts.standby?t.texts.standby.title:"Solicitud en Stand By",x.oJD),x.xp6(1),x.Udp("color",t.data.styles.colors.text),x.Q6J("innerHTML",t.texts.standby?t.texts.standby.description:x.lcZ(5,10,"Descripcion del estado Stand By"),x.oJD))},dependencies:[p._Y,p.JL,p.F,T.y,M.z]}),e})();const ot=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let at=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new x.vpe(null)}ngOnInit(){this.form=this.fb.group({birth_date:[null,[p.kI.required]]})}next(){this.nextStep.emit(this.form.get("birth_date").value)}}return e.ɵfac=function(t){return new(t||e)(x.Y36(p.QS),x.Y36(S.F))},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-error-birthday-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:16,vars:23,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","flex-1"],["type","text","placeholder","Ej: 22/03/1990","required","","formControlName","birth_date","matInput","","mask","d0/M0/0000"],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(x.TgZ(0,"div",0)(1,"div",1)(2,"div",2),x._uU(3),x.qZA(),x.TgZ(4,"div",3),x._uU(5),x.qZA(),x.TgZ(6,"form",4)(7,"mat-form-field",5)(8,"mat-label"),x._uU(9),x.qZA(),x._UZ(10,"input",6),x.TgZ(11,"mat-hint"),x._uU(12,"DD/MM/YYYY"),x.qZA()()()(),x.TgZ(13,"div",7)(14,"button",8),x.NdJ("click",(function(){return t.next()})),x._uU(15),x.qZA()()()),2&e&&(x.xp6(2),x.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),x.xp6(1),x.hij(" ",t.labels.warnings.wrongBirthday," "),x.xp6(1),x.Udp("color",t.data.styles.colors.text),x.xp6(1),x.hij(" ",t.labels.warnings.inputBirthDay," "),x.xp6(1),x.Q6J("formGroup",t.form),x.xp6(3),x.Oqu(t.labels.birthday),x.xp6(4),x.Q6J("ngClass",x.kEZ(19,ot,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),x.xp6(1),x.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),x.Q6J("disabled",t.form.invalid),x.xp6(1),x.hij(" ",t.labels.send," "))},dependencies:[i.mk,u.lW,R.KE,R.bx,R.hX,P.Nt,p._Y,p.Fj,p.JJ,p.JL,p.Q7,p.sg,p.u,ae.Z6],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const lt=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let ct=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new x.vpe(null)}ngOnInit(){this.form=this.fb.group({support_number:[null,[p.kI.required]]})}next(){this.nextStep.emit(this.form.get("support_number").value)}}return e.ɵfac=function(t){return new(t||e)(x.Y36(p.QS),x.Y36(S.F))},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-error-support-number-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:14,vars:23,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","flex-1"],["type","number","placeholder","Ej: 1233443","required","","formControlName","support_number","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(x.TgZ(0,"div",0)(1,"div",1)(2,"div",2),x._uU(3),x.qZA(),x.TgZ(4,"div",3),x._uU(5),x.qZA(),x.TgZ(6,"form",4)(7,"mat-form-field",5)(8,"mat-label"),x._uU(9),x.qZA(),x._UZ(10,"input",6),x.qZA()()(),x.TgZ(11,"div",7)(12,"button",8),x.NdJ("click",(function(){return t.next()})),x._uU(13),x.qZA()()()),2&e&&(x.xp6(2),x.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),x.xp6(1),x.hij(" ",t.labels.warnings.wrongSupport," "),x.xp6(1),x.Udp("color",t.data.styles.colors.text),x.xp6(1),x.hij(" ",t.labels.warnings.inputSupport," "),x.xp6(1),x.Q6J("formGroup",t.form),x.xp6(3),x.Oqu(t.labels.support),x.xp6(2),x.Q6J("ngClass",x.kEZ(19,lt,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),x.xp6(1),x.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),x.Q6J("disabled",t.form.invalid),x.xp6(1),x.hij(" ",t.labels.send," "))},dependencies:[i.mk,u.lW,R.KE,R.hX,P.Nt,p._Y,p.Fj,p.wV,p.JJ,p.JL,p.Q7,p.sg,p.u],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const dt=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let ut=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.loading=null,this.nextStep=new x.vpe(null)}ngOnInit(){this.form=this.fb.group({document_expiration_date:[null,[p.kI.required]]})}next(){this.nextStep.emit(this.form.get("document_expiration_date").value)}}return e.ɵfac=function(t){return new(t||e)(x.Y36(p.QS),x.Y36(S.F))},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-error-expiration-step"]],inputs:{data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:16,vars:23,consts:[[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"w-full",3,"formGroup"],["appearance","outline",1,"w-full","flex-1"],["type","date","placeholder","Ej: 22/03/1990","required","","formControlName","document_expiration_date","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-button","","type","button",1,"px-8",3,"disabled","click"]],template:function(e,t){1&e&&(x.TgZ(0,"div",0)(1,"div",1)(2,"div",2),x._uU(3),x.qZA(),x.TgZ(4,"div",3),x._uU(5),x.qZA(),x.TgZ(6,"form",4)(7,"mat-form-field",5)(8,"mat-label"),x._uU(9),x.qZA(),x._UZ(10,"input",6),x.TgZ(11,"mat-hint"),x._uU(12,"DD/MM/YYYY"),x.qZA()()()(),x.TgZ(13,"div",7)(14,"button",8),x.NdJ("click",(function(){return t.next()})),x._uU(15),x.qZA()()()),2&e&&(x.xp6(2),x.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),x.xp6(1),x.hij(" ",t.labels.warnings.wrongExpiration," "),x.xp6(1),x.Udp("color",t.data.styles.colors.text),x.xp6(1),x.hij(" ",t.labels.warnings.inputExpiration," "),x.xp6(1),x.Q6J("formGroup",t.form),x.xp6(3),x.Oqu(t.labels.expiration),x.xp6(4),x.Q6J("ngClass",x.kEZ(19,dt,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),x.xp6(1),x.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),x.Q6J("disabled",t.form.invalid),x.xp6(1),x.Oqu(t.labels.send))},dependencies:[i.mk,u.lW,R.KE,R.bx,R.hX,P.Nt,p._Y,p.Fj,p.JJ,p.JL,p.Q7,p.sg,p.u],styles:[".label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function ht(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"mat-form-field",11)(1,"mat-label"),x._uU(2),x.qZA(),x._UZ(3,"input",12),x.TgZ(4,"mat-hint")(5,"a",13),x.NdJ("click",(function(t){x.CHM(e);const n=x.oxw(2);return x.KtG(n.gotoExpirationDate(t))})),x.TgZ(6,"u"),x._uU(7),x.qZA()()()()}if(2&e){const e=x.oxw(2);x.xp6(2),x.Oqu(e.labels.expiration),x.xp6(5),x.Oqu(e.labels.findExpiration)}}function pt(e,t){if(1&e&&(x.TgZ(0,"mat-form-field",14)(1,"mat-label"),x._uU(2),x.qZA(),x._UZ(3,"input",15),x.qZA()),2&e){const e=x.oxw(2);x.xp6(2),x.Oqu(e.labels.support)}}function mt(e,t){if(1&e&&(x.TgZ(0,"div",5),x._UZ(1,"div",6)(2,"div",7),x.ALo(3,"safeHtml"),x._UZ(4,"br"),x.TgZ(5,"form",8),x.YNc(6,ht,8,2,"mat-form-field",9),x.YNc(7,pt,4,1,"mat-form-field",10),x.qZA()()),2&e){const e=x.oxw();x.xp6(1),x.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),x.Q6J("innerHTML",null==e.texts.noPhone?null:e.texts.noPhone.title,x.oJD),x.xp6(1),x.Udp("color",e.data.styles.colors.text),x.Q6J("innerHTML",x.lcZ(3,11,e.texts.noPhone.description),x.oJD),x.xp6(3),x.Q6J("formGroup",e.form),x.xp6(1),x.Q6J("ngIf",e.isDni),x.xp6(1),x.Q6J("ngIf",e.isNie)}}const ft=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function gt(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"div",16)(1,"button",17),x.NdJ("click",(function(){x.CHM(e);const t=x.oxw();return x.KtG(t.next())})),x._uU(2),x.qZA()()}if(2&e){const e=x.oxw();x.Q6J("ngClass",x.kEZ(9,ft,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),x.xp6(1),x.Udp("color",e.data.styles.colors.btnText)("background",e.form.invalid?"":e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),x.Q6J("disabled",e.form.invalid),x.xp6(1),x.hij(" ",e.labels.actions.next," ")}}function _t(e,t){if(1&e&&(x.TgZ(0,"div",18),x._uU(1),x.qZA()),2&e){const e=x.oxw();x.xp6(1),x.hij(" ",e.labels.loadings.gettingData," ")}}let bt=(()=>{class e{constructor(e,t,n,i,s,r,o){this.smsComponent=e,this.fb=t,this.utils=n,this.cd=i,this.dialog=s,this.smsFlowService=r,this.solicitudesService=o,this.loading=null,this.answered=!1,this.nextStep=new x.vpe(null),this.isNie=!1,this.isDni=!1}ngOnInit(){console.warn(this.smsFlowService.REQUEST),this.loading=!0,this.checkIfDniOrNie(),this.isDni&&(this.form=this.fb.group({document_expiration_date:[null,p.kI.required]})),this.isNie&&(this.form=this.fb.group({document_support:[null,p.kI.required]})),this.loading=!1}checkIfDniOrNie(){this.setRegex(this.smsFlowService.REQUEST.person_document_number)}setRegex(e){e&&(this.isDni=!!e.toUpperCase().match(/^(\d{8})([A-Z])$/),this.isNie=!!e.toUpperCase().match(/^[XYZ]\d{7,8}[A-Z]$/),this.cd.markForCheck())}next(){let e={};this.isDni?e.document_expiration_date=this.utils.formatDate(this.form.get("document_expiration_date").value):this.isNie&&(e.document_support=this.form.get("document_support").value),"SMS"===this.flowName?this.sendSmsDataToPin(e):this.nextStep.emit(e)}gotoSupportAclaration(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(X.$,{panelClass:"fullscreen-dialog"})}gotoExpirationDate(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(ee.R,{panelClass:"fullscreen-dialog"})}sendSmsDataToPin(e){e.request_id=this.smsFlowService.REQUEST.request_id,this.smsFlowService.setLoading(this.labels.loadings.sendingData),this.solicitudesService.smsToPin(e).then((e=>{e&&e.status&&"success"===e.status&&this.smsComponent.gotoClavePinUrl(e.data),e&&e.status&&"error"===e.status&&(e.message?"Does not have Pin service"==e.message?this.smsComponent.setRequestStatus("no-service"):this.smsComponent.showAlert("Error!",e.message):this.smsComponent.showAlert("Error!",e),this.smsFlowService.setLoading(null))})).catch((e=>{console.error(e),this.smsComponent.showAlert("Error!",e.message||e),this.smsFlowService.setLoading(null)}))}}return e.ɵfac=function(t){return new(t||e)(x.Y36(H.T,9),x.Y36(p.QS),x.Y36(S.F),x.Y36(x.sBO),x.Y36(se.uw),x.Y36(q.p),x.Y36(_.M))},e.ɵcmp=x.Xpm({type:e,selectors:[["belender-no-phone-step"]],inputs:{flowName:"flowName",data:"data",texts:"texts",loading:"loading",labels:"labels"},outputs:{nextStep:"nextStep"},decls:5,vars:5,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content"],["class","py-4 flex flex-col",4,"ngIf"],["class","flex items-center gap-2 p-4",3,"ngClass",4,"ngIf"],["class","w-full flex justify-center p-4 items-center",4,"ngIf"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"w-full",3,"formGroup"],["appearance","outline","class","w-full flex-1 belender-form-field",4,"ngIf"],["appearance","outline","class","mb-4 w-full md:max-w-[500px]",4,"ngIf"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["type","text","placeholder","Ej: 22/03/2030","formControlName","document_expiration_date","matInput","","mask","d0/M0/0000"],["target","_blank",1,"text-sm","hover:text-blue-500","cursor-pointer",3,"click"],["appearance","outline",1,"mb-4","w-full","md:max-w-[500px]"],["formControlName","document_support","matInput",""],[1,"flex","items-center","gap-2","p-4",3,"ngClass"],["mat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"w-full","flex","justify-center","p-4","items-center"]],template:function(e,t){1&e&&(x._UZ(0,"belender-widget-step-logo",0),x.TgZ(1,"div",1),x.YNc(2,mt,8,13,"div",2),x.YNc(3,gt,3,13,"div",3),x.YNc(4,_t,2,1,"div",4),x.qZA()),2&e&&(x.Q6J("data",t.data)("customImage",t.texts.noPhone.customImage),x.xp6(2),x.Q6J("ngIf",(t.isDni||t.isNie)&&!t.loading),x.xp6(1),x.Q6J("ngIf",(t.isDni||t.isNie)&&!t.loading),x.xp6(1),x.Q6J("ngIf",!t.isDni&&!t.isNie||t.loading))},dependencies:[i.mk,i.O5,u.lW,R.KE,R.bx,R.hX,P.Nt,p._Y,p.Fj,p.JJ,p.JL,p.sg,p.u,T.y,ae.Z6,M.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var vt=n(3300),yt=n(865),wt=n(3033),xt=n(7582),St=n(9933),Ct=n(667);const Tt=["formStep"];function kt(e,t){if(1&e&&(x.TgZ(0,"mat-option",8),x._uU(1),x.qZA()),2&e){const e=t.$implicit;x.s9C("value",e),x.xp6(1),x.Oqu(e)}}function Mt(e,t){if(1&e){const e=x.EpF();x.ynx(0),x.TgZ(1,"mat-form-field",5)(2,"mat-label"),x._uU(3,"Estado"),x.qZA(),x.TgZ(4,"mat-select",6),x.NdJ("selectionChange",(function(t){const n=x.CHM(e).index,i=x.oxw();return x.KtG(i.setItemSelected(t,n))})),x.YNc(5,kt,2,2,"mat-option",7),x.qZA()(),x.BQk()}if(2&e){const e=t.$implicit,n=t.index,i=x.oxw();x.xp6(1),x.Gre(" w-full ",n===i.triggerObject.index-1?"!border-t-2 border-green-500 ":"",""),x.xp6(3),x.Q6J("value",e),x.xp6(1),x.Q6J("ngForOf",i.items)}}function It(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"button",9),x.NdJ("click",(function(){x.CHM(e);const t=x.oxw();return x.KtG(t.initTrigger())})),x._uU(1,"Empezar"),x.qZA()}}function Et(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"button",9),x.NdJ("click",(function(){x.CHM(e);const t=x.oxw();return x.KtG(t.initTrigger())})),x._uU(1,"Continuar"),x.qZA()}}function At(e,t){if(1&e){const e=x.EpF();x.TgZ(0,"button",9),x.NdJ("click",(function(){x.CHM(e);const t=x.oxw();return x.KtG(t.initTriggerFromZero())})),x._uU(1,"Volver a empezar"),x.qZA()}}let Ot=class{constructor(e,t){this.cd=e,this.utils=t,this.sendMessage=new x.vpe,this.requestedToPin=!1,this.items=["created","form","terms_and_conditions","waiting_otp_seguridad_social","waiting_login_seguridad_social","invalid_otp_seguridad_social","abandoned_after_bad_phone","abandoned_after_invalid_otp_seguridad_social","abandoned_after_terms_and_conditions","abandoned_after_waiting_otp_seguridad_social","all_documents_downloaded","partial_documents_downloaded","consent_process_completed","partial_documents_downloaded_and_deleted","all_documents_downloaded_and_deleted","failed_with_retry","failed_without_retry","failed_documents_downloaded","no_service","no_sms_service","stand_by","no-phone","no-more-phone","bad_phone","error_expiration_date","error_birth_date","error_support_number","duplicated"],this.triggerObject={index:0,items:["form","waiting_otp_seguridad_social","all_documents_downloaded"]}}ngOnInit(){}setItemSelected(e,t){console.warn(e,t),this.triggerObject.items[t]=e.value,console.warn(this.triggerObject)}initTrigger(){this.emitMessage(this.triggerObject.items[this.triggerObject.index]),this.triggerObject.index++}initTriggerFromZero(){this.triggerObject.index=0,this.initTrigger()}emitMessage(e){let t={status_code:e};console.log(t),this.sendMessage.emit(t)}closeInterval(){this.int&&clearInterval(this.int),this.triggerObject.index=0}addState(){this.triggerObject.items.push("")}};Ot.ɵfac=function(e){return new(e||Ot)(x.Y36(x.sBO),x.Y36(S.F))},Ot.ɵcmp=x.Xpm({type:Ot,selectors:[["belender-tester-sms"]],viewQuery:function(e,t){if(1&e&&x.Gf(Tt,5),2&e){let e;x.iGM(e=x.CRH())&&(t.theDiv=e.first)}},outputs:{sendMessage:"sendMessage"},decls:9,vars:4,consts:[[1,"wrapper","flex","flex-col","justify-between","bg-slate-100","w-[200px]","h-full","p-2","gap-0"],[1,"flex","flex-col","h-full","dd-wrapper"],[4,"ngFor","ngForOf"],["mat-button","",1,"w-full","rounded-md",3,"click"],["mat-raised-button","","class","w-full rounded-md bg-blue-500 text-blue-50",3,"click",4,"ngIf"],["appearance","outline"],[1,"border",3,"value","selectionChange"],[3,"value",4,"ngFor","ngForOf"],[3,"value"],["mat-raised-button","",1,"w-full","rounded-md","bg-blue-500","text-blue-50",3,"click"]],template:function(e,t){1&e&&(x.TgZ(0,"div",0)(1,"div",1),x.YNc(2,Mt,6,5,"ng-container",2),x.TgZ(3,"button",3),x.NdJ("click",(function(){return t.addState()})),x._uU(4,"Agregar estado"),x.qZA()(),x.TgZ(5,"div"),x.YNc(6,It,2,0,"button",4),x.YNc(7,Et,2,0,"button",4),x.YNc(8,At,2,0,"button",4),x.qZA()()),2&e&&(x.xp6(2),x.Q6J("ngForOf",t.triggerObject.items),x.xp6(4),x.Q6J("ngIf",!t.triggerObject.index||0==t.triggerObject.index),x.xp6(1),x.Q6J("ngIf",t.triggerObject.index&&t.triggerObject.index<t.triggerObject.items.length),x.xp6(1),x.Q6J("ngIf",t.triggerObject.index&&t.triggerObject.index>=t.triggerObject.items.length))},dependencies:[i.sg,i.O5,u.lW,R.KE,R.hX,f.gD,K.ey],styles:[".wrapper[_ngcontent-%COMP%]{position:fixed;top:0;right:0;box-shadow:-10px 20px 30px #0000004d;z-index:99!important;max-height:100vh}.dd-wrapper[_ngcontent-%COMP%]{max-height:calc(100vh - 70px)!important;overflow:auto}"],data:{animation:[Ct.$]}}),Ot=(0,xt.gn)([(0,St.c)()],Ot);var Lt=n(3364),Dt=n(1760),Pt=n(6830),Nt=n(4302),qt=n(9112),Rt=n(9382);let Yt=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=x.oAB({type:e}),e.ɵinj=x.cJS({providers:[_.M,v.o,N.w,w.t,C.T,ie.t,{provide:K.Ad,useValue:"es-ES"}],imports:[Je,i.ez,s.G,r.J,o.TU,a.p0,l.JX,c.p9,d.Ps,u.ot,h.Tx,P.c,p.u5,m.AV,p.UX,f.LD,g.vV,b.a,y.Cq,Ye.FA,K.XK,Fe.T5,Ue.Fk,Ge.x,et.n,tt.F,nt.A,it.f,st.g,vt.C,yt.q,wt.d]}),e})();x.B6R(H.T,[i.O5,u.lW,y.Ou,Lt.R,Dt.u,Pt.L,Nt.q,qt.y,Rt.i,D,Z,W,Re,je,Ve,We,Xe,rt,at,ct,ut,bt,Ot],[M.z])},9938:(e,t,n)=>{n.r(t),n.d(t,{VideoIdModule:()=>Ut});var i=n(6895),s=n(6383),r=n(5592),o=n(8739),a=n(7155),l=n(6308),c=n(6709),d=n(7392),u=n(9101),h=n(1561),p=n(4006),m=n(266),f=n(4385),g=n(811),_=n(5601),b=n(3798),v=n(9391),y=n(1572),w=n(182),x=n(4144),S=n(7367),C=n(9602),T=n(3238),k=n(5895),M=n(6257),I=n(1948),E=n(4246),A=n(8594),O=n(6e3),L=n(5861),D=n(7582),P=n(9549),N=n(9933),q=n(5762),R=n(1363),Y=n(6305),F=n(1931);const U={created:"form",form:"form",terms_and_conditions:"form",widget_opened:"form",prerequest:"form",waiting_terms_and_conditions:"form",waiting_login_seguridad_social:"loading",saved_otp:"loading",loading:"loading",waiting_otp:"otp",invalid_otp:"otp",waiting_otp_seguridad_social:"otp",invalid_otp_seguridad_social:"otp",waiting_password:"password",abandoned_after_bad_phone:"abandoned",abandoned_after_invalid_otp_seguridad_social:"abandoned",abandoned_after_terms_and_conditions:"abandoned",abandoned_after_waiting_otp_seguridad_social:"abandoned",certificate_created:"success",waiting_certificate:"success",all_documents_downloaded:"success",partial_documents_downloaded:"success",waiting_video:"success",consent_process_completed:"success",waiting_documents:"success",partial_documents_downloaded_and_deleted:"success",all_documents_downloaded_and_deleted:"success",bad_phone:"error-data",phone_not_exist_otp:"error-data",failed_with_retry:"failed",failed_without_retry:"failed",rejected_identity:"failed",failed_documents_downloaded:"failed",failed_login_otp:"failed",consent_process_canceled:"failed",no_service:"no-service"};var Z=n(4650),H=n(8467),j=n(6554),z=n(9728);let B=(()=>{class e{constructor(e,t,n,i){this.utils=e,this.localFetch=t,this.solicitudesService=n,this.apiUrlService=i}getSolicitudes(){var e=this;return(0,L.Z)((function*(){const t=yield e.localFetch.getFetch(e.apiUrlService.baseUrl+"/requests");return e.solicitudesService.markRequestOpenedIfNeeded(t),t}))()}getSolicitudByCode(e){var t=this;return(0,L.Z)((function*(){const n=yield t.localFetch.freeGetFetch(t.apiUrlService.baseUrl+"/requests/"+e);return t.solicitudesService.markRequestOpenedIfNeeded(n),n}))()}setState(e,t){let n={request_id:e,status:t};return new Promise(((e,t)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/videoid/status",n).then((n=>{n?e(n):t(n)})).catch((e=>{console.error("addSolicitud",e),t(e)}))}))}addSolicitud(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/videoid",e).then((e=>{e?(this.solicitudesService.markRequestOpenedIfNeeded(e),t(e)):n(e)})).catch((e=>{console.error("addSolicitud",e),n(e)}))}))}acceptTerms(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/videoid/terms",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendPassword(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/videoid/password",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}getNewIdOfRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/"+e+"/get-new-id",{}).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}checkService(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/sms/check-service",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}retryRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/sms/retry",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}resendOTP(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/sms/resend-otp",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}fixData(e,t){return new Promise(((n,i)=>{this.localFetch.putFetchWhitoutToken(`${this.apiUrlService.baseUrl}/requests/${e}/person`,t).then((e=>{e?n(e):i(e)})).catch((e=>{i(e)}))}))}sendOTP(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/videoid/otp",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendLinkBySms(e,t){return new Promise(((n,i)=>{this.localFetch.postFetch(`${this.apiUrlService.baseUrl}/requests/${e}/send-link-sms`,t).then((e=>{e?n(e):i(e)})).catch((e=>{i(e)}))}))}}return e.ɵfac=function(t){return new(t||e)(Z.LFG(H.F),Z.LFG(j.r),Z.LFG(_.M),Z.LFG(z.i))},e.ɵprov=Z.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})();var J=n(8460),V=n(5412),Q=n(7308),W=n(1135),G=n(2340);let $=(()=>{class e{constructor(e){this.customizationStoreService=e,this.labels=F.S.es,this.socket=null,this.currentHeight=0,this._request=new W.X({...new q.l,status_code:"created"}),this._request_status=new W.X(null),this.request$=this._request.asObservable(),this.request_status$=this._request_status.asObservable()}setGlobalVariables(){this.REQUEST=this._request.value,this.REQUEST_STATUS=this.REQUEST?.status_code,this.REQUEST_ID=this.REQUEST?.request_id,this._request_status.next(this.REQUEST_STATUS)}setRequest(e){this._request.next({...e}),this.setGlobalVariables()}patch(e){this._request.next({...this._request.value,...e}),this.setGlobalVariables()}setRequestStatus(e){this._request.next({...this._request.value,status_code:e}),this.setGlobalVariables()}setRequestID(e){this._request.next({...this._request.value,request_id:e}),this.setGlobalVariables()}updateRequestID(e){this.REQUEST_ID=e,this.setRequestID(e)}subscribeWS(e){if(this.socket)return;const t=e||this.REQUEST_ID||this._request.value?.request_id;if(!t)return;let n="wss://notifications.dev.belender.net";"qa"==G.N.env&&(n="wss://notifications.qa.belender.net"),"pro"==G.N.env&&(n="wss://notifications.belender.net"),G.N.notificationsBaseUrl&&(n=G.N.notificationsBaseUrl),this.socket=new WebSocket(`${n}?requests_id=${t}&user_id=${this.customizationStoreService.USER_ID}`);const i=this;this.socket.onopen=function(){console.log("Conexión establecida")},this.socket.onmessage=function(e){const t=JSON.parse(e.data);i.handlePusherNotification(t)},this.socket.onerror=function(e){console.log("WebSocket Error: "+e),console.error(e)},this.socket.onclose=function(){console.log("Conexión cerrada"),i.socket=null}}handlePusherNotification(e){if(!e||w.t.shouldIgnoreWebhookStatus(e.status_code))return;this.sendMessageToParent({type:"websocket",data:e}),console.warn("message from ws: ",e);const t=e.status_code;if(t){if(t.startsWith("failed"))return this.disconnectWebsocket(),void this.setRequestStatus(t);if(t.startsWith("abandoned"))return this.disconnectWebsocket(),void this.setRequestStatus(t);if("consent_process_completed"===t)return this.disconnectWebsocket(),void this.patch({status_code:t});this.patch({status_code:t})}}sendMessageToParent(e){if(e&&e.type&&"widgetHeight"===e.type){if(e.data===this.currentHeight)return;this.currentHeight=e.data}console.log("Message to parent:",e),window.top.postMessage(e,"*")}disconnectWebsocket(){this.socket&&this.socket.close(),this.socket=null}}return e.ɵfac=function(t){return new(t||e)(Z.LFG(J.r))},e.ɵprov=Z.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})();var K=n(6830),X=n(833),ee=n(4302),te=n(8259),ne=n(8429),ie=n(3731);function se(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.HOy("",e.labels.otp.noReceivedCode," ",e.labels.certificate.requestAgainIn," ",e.secsCount," ",e.labels.certificate.seconds,"")}}function re(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.xDo("",e.labels.otp.noReceivedCode2," ",e.lastNumberPhone,"? ",e.labels.certificate.requestAgainIn," ",e.secsCount," ",e.labels.certificate.seconds,"")}}const oe=function(e,t,n){return{color:e,border:t,background:n}};function ae(e,t){if(1&e&&(Z.ynx(0),Z.TgZ(1,"small",12),Z.YNc(2,se,2,4,"span",6),Z.YNc(3,re,2,5,"span",6),Z.qZA(),Z.BQk()),2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("ngStyle",Z.kEZ(3,oe,e.data.styles.colors.accentColor,"1px solid "+e.data.styles.colors.accentColor,e.data.styles.colors.accentBgColor)),Z.xp6(1),Z.Q6J("ngIf",!e.lastNumberPhone),Z.xp6(1),Z.Q6J("ngIf",e.lastNumberPhone)}}function le(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.hij(" ",e.labels.otp.noReceivedCode," ")}}function ce(e,t){if(1&e&&(Z.TgZ(0,"span"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.AsE(" ",e.labels.otp.noReceivedCode2," ",e.lastNumberPhone,"? ")}}const de=function(e,t){return{color:e,background:t}};function ue(e,t){if(1&e){const e=Z.EpF();Z.ynx(0),Z.TgZ(1,"small",12),Z.YNc(2,le,2,1,"span",6),Z.YNc(3,ce,2,2,"span",6),Z.TgZ(4,"a",13),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.resendOTP())})),Z._uU(5),Z.qZA()(),Z.BQk()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("ngStyle",Z.kEZ(5,oe,e.data.styles.colors.dangerColor,"1px solid "+e.data.styles.colors.dangerColor,e.data.styles.colors.dangerBgColor)),Z.xp6(1),Z.Q6J("ngIf",!e.lastNumberPhone),Z.xp6(1),Z.Q6J("ngIf",e.lastNumberPhone),Z.xp6(1),Z.Q6J("ngStyle",Z.WLB(9,de,e.data.styles.colors.dangerTextButtonColor,e.data.styles.colors.dangerColor)),Z.xp6(1),Z.Oqu(e.labels.actions.resend)}}let he=(()=>{class e{constructor(e,t,n,i){this.fb=e,this.utils=t,this.solucitudesService=n,this.activeRoute=i,this.labels=F.S.es,this.next=new Z.vpe(null),this.errPhone=new Z.vpe(null),this.resendO=new Z.vpe(null),this.secsCount=60,this.lastNumberPhone="XXX"}ngOnInit(){this.form=this.fb.group({code1:[null,[p.kI.required,p.kI.maxLength(6),p.kI.minLength(6)]]}),this.initSecsInterval(),this.activeRoute.queryParams.subscribe((e=>{e&&e.request_id&&(this.requestID=e.request_id)}),(e=>{console.error(e)})),this.solicitud&&this.solicitud.person_phone&&this.setPhone(this.solicitud.person_phone)}setPhone(e){let t="XXX";e&&(t=(""+e).slice(-3)),this.lastNumberPhone=t}initSecsInterval(){this.interv=setInterval((()=>{this.secsCount--,this.secsCount<=0&&this.finishSecsInterval()}),1e3)}finishSecsInterval(){this.interv&&clearInterval(this.interv)}nextStep(){let e={code:this.getCode()};this.next.emit(e)}getCode(){return this.form.get("code1").value}capturePasteEvent(e){return(0,L.Z)((function*(){}))()}errorStep(){this.errPhone.emit(!0)}setInputEvent(e){""!=e.target.value?te(e.target).next().focus():"Backspace"==e.code&&te(e.target).prev().focus()}resendOTP(){this.resendO.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(H.F),Z.Y36(_.M),Z.Y36(A.gz))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-otp-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud",labels:"labels"},outputs:{next:"nextStep",errPhone:"errorPhone",resendO:"resendOTP"},decls:17,vars:24,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"title","py-2"],[4,"ngIf"],[1,"flex","gap-2","items-center","justify-start","w-full","max-w-[200px]"],["appearance","outline",1,"w-full","flex-1"],["tabindex","1","maxlength","6","minlength","1","formControlName","code1","type","text","matInput","",3,"change","keyup"],[1,"flex","items-center","justify-end","gap-2","p-4"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"info-time","w-fit",3,"ngStyle"],[1,"ml-4",3,"ngStyle","click"]],template:function(e,t){1&e&&(Z._UZ(0,"belender-widget-step-logo",0),Z.TgZ(1,"form",1)(2,"div",2),Z._UZ(3,"div",3)(4,"div",4),Z.ALo(5,"safeHtml"),Z.TgZ(6,"div",5),Z.YNc(7,ae,4,7,"ng-container",6),Z.YNc(8,ue,6,12,"ng-container",6),Z.qZA(),Z.TgZ(9,"div",7)(10,"mat-form-field",8)(11,"mat-label"),Z._uU(12),Z.qZA(),Z.TgZ(13,"input",9),Z.NdJ("change",(function(e){return t.capturePasteEvent(e)}))("keyup",(function(e){return t.setInputEvent(e)})),Z.qZA()()()(),Z.TgZ(14,"div",10)(15,"button",11),Z.NdJ("click",(function(){return t.nextStep()})),Z._uU(16),Z.qZA()()()),2&e&&(Z.Q6J("data",t.data)("customImage",t.texts.otp.customImage),Z.xp6(1),Z.Q6J("formGroup",t.form),Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.otp.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(5,22,t.texts.otp.description||""),Z.oJD),Z.xp6(3),Z.Q6J("ngIf",t.secsCount&&t.secsCount>0),Z.xp6(1),Z.Q6J("ngIf",!t.secsCount||t.secsCount<=0),Z.xp6(4),Z.Oqu(t.labels.otp.otpCode),Z.xp6(3),Z.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),Z.Q6J("disabled",t.form.invalid),Z.xp6(1),Z.Oqu(t.labels.actions.next))},dependencies:[i.O5,i.PC,u.lW,P.KE,P.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.nD,p.sg,p.u,ne.y,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function pe(e,t){if(1&e&&(Z.TgZ(0,"div",3),Z._UZ(1,"div",4)(2,"div",5),Z.ALo(3,"safeHtml"),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("color",e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),Z.Q6J("innerHTML",e.texts.success.title,Z.oJD),Z.xp6(1),Z.Udp("color",e.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(3,8,e.texts.success.description||""),Z.oJD)}}function me(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",6)(1,"button",7),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.gotoRedirect())})),Z._uU(2),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),Z.xp6(1),Z.hij(" ",e.data[e.flowName].btnTextCallBack||e.labels.actions.clickToFinish," ")}}let fe=(()=>{class e{constructor(e,t,n,i){this.fb=e,this.utils=t,this.videoS=n,this.route=i,this.labels=F.S.es}ngOnInit(){this.route.queryParams.subscribe((e=>{e.request_id&&(this.requestID=e.request_id,this.videoS.setState(this.requestID,"success").then((e=>{console.log("Se ha seteado el status success correctamente")})).catch((e=>{console.error("No se ha seteado el status success. Error: ",e)})))}))}save(){}gotoRedirect(){this.data[this.flowName].enableUrlCallBack&&this.data[this.flowName].callBackUrl&&location.assign(this.data[this.flowName].callBackUrl)}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(H.F),Z.Y36(B),Z.Y36(A.gz))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-success-step"]],inputs:{data:"data",texts:"texts",packId:"packId",requestID:"requestID",userId:"userId",flowName:"flowName",labels:"labels"},decls:3,vars:4,consts:[[3,"data","customImage"],["class","pt-4 pb-8 flex flex-col animated fadeIn",4,"ngIf"],["class","flex items-center justify-end gap-2 p-4",4,"ngIf"],[1,"pt-4","pb-8","flex","flex-col","animated","fadeIn"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(Z._UZ(0,"belender-widget-step-logo",0),Z.YNc(1,pe,4,10,"div",1),Z.YNc(2,me,3,7,"div",2)),2&e&&(Z.Q6J("data",t.data)("customImage",t.texts.success.customImage),Z.xp6(1),Z.Q6J("ngIf",!t.data.config.infiniteLoopInCompleted),Z.xp6(1),Z.Q6J("ngIf",t.data[t.flowName].enableUrlCallBack))},dependencies:[i.O5,u.lW,ne.y,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function ge(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",6)(1,"button",7),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.retry())})),Z._uU(2),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),Z.xp6(1),Z.Oqu(e.labels.actions.retry)}}function _e(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",6)(1,"button",7),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.newRequest())})),Z._uU(2),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("color",e.data.styles.colors.btnText)("background",e.data.styles.colors.btnBg)("border-radius",e.data.styles.btnRound+"px"),Z.xp6(1),Z.Oqu(e.labels.certificate.createNewRequest)}}let be=(()=>{class e{constructor(e,t,n){this.utils=e,this.videoS=t,this.route=n,this.labels=F.S.es,this.retryOp=new Z.vpe(null),this.newReq=new Z.vpe(null)}ngOnInit(){this.route.queryParams.subscribe((e=>{e.request_id&&(this.requestID=e.request_id,this.videoS.setState(this.requestID,"failed").then((e=>{console.log("Se ha seteado el status failed correctamente")})).catch((e=>{console.error("No se ha seteado el status failed. Error: ",e)})))}))}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}newRequest(){this.newReq.emit(this.solicitud.request_id)}getIfRetryIsAllowed(){return"failed_with_retry"==this.solicitud}getIfNewRequestIsAllowed(){return"failed_documents_downloaded"==this.solicitud}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(H.F),Z.Y36(B),Z.Y36(A.gz))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-fail-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud",labels:"labels"},outputs:{retryOp:"retry",newReq:"newRequest"},decls:8,vars:10,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"text-red-500","title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],["class","flex items-center justify-end gap-2 p-4",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(Z._UZ(0,"belender-widget-step-logo",0),Z.TgZ(1,"div",1)(2,"div",2),Z._UZ(3,"div",3)(4,"div",4),Z.ALo(5,"safeHtml"),Z.qZA(),Z.YNc(6,ge,3,7,"div",5),Z.YNc(7,_e,3,7,"div",5),Z.qZA()),2&e&&(Z.Q6J("data",t.data)("customImage",t.texts.fail.customImage),Z.xp6(3),Z.Q6J("innerHTML",t.texts.fail.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(5,8,t.texts.fail.description),Z.oJD),Z.xp6(2),Z.Q6J("ngIf",t.solicitud&&"failed_with_retry"==t.solicitud.status_code),Z.xp6(1),Z.Q6J("ngIf",t.solicitud&&"failed_documents_downloaded"==t.solicitud.status_code))},dependencies:[i.O5,u.lW,ne.y,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();n(6866);var ve=n(769),ye=n(1763),we=n(5696);const xe=["termsCheckbox"],Se=["policyCheckbox"],Ce=["termsCertCheckbox"],Te=["assignmentCheckbox"];function ke(e,t){if(1&e&&(Z.TgZ(0,"mat-error"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.selectPersonType," ")}}function Me(e,t){if(1&e&&(Z.TgZ(0,"mat-error"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.requiredName," ")}}function Ie(e,t){if(1&e&&(Z.TgZ(0,"mat-error"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.requiredFirstSurname," ")}}function Ee(e,t){if(1&e&&(Z.TgZ(0,"mat-error"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.requiredEmail," ")}}function Ae(e,t){if(1&e&&(Z.TgZ(0,"mat-error"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.invalidEmail," ")}}function Oe(e,t){if(1&e&&(Z.TgZ(0,"mat-error"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.needPhone," ")}}function Le(e,t){if(1&e&&(Z.TgZ(0,"mat-error"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.phoneDigitsRequired," ")}}function De(e,t){if(1&e&&(Z.TgZ(0,"mat-error"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.needDNI," ")}}function Pe(e,t){if(1&e&&(Z.TgZ(0,"mat-error"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.requiredCompanyName," ")}}function Ne(e,t){if(1&e&&(Z.TgZ(0,"mat-form-field",6)(1,"mat-label"),Z._uU(2),Z.qZA(),Z._UZ(3,"input",27),Z.YNc(4,Pe,2,1,"mat-error",10),Z.qZA()),2&e){const e=Z.oxw();let t;Z.Gre("",e.disabledInputs.razon?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(2),Z.Oqu(e.labels.certificate.companyName),Z.xp6(1),Z.s9C("tabindex",e.disabledInputs.razon?-1:1),Z.Q6J("placeholder",e.labels.certificate.companyPlaceholder),Z.uIk("aria-label",e.labels.certificate.companyName),Z.xp6(1),Z.Q6J("ngIf",null==(t=e.form.get("razon"))?null:t.hasError("required"))}}function qe(e,t){if(1&e&&(Z.TgZ(0,"mat-error"),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.hij(" ",null==e.labels||null==e.labels.warnings?null:e.labels.warnings.requiredCIF," ")}}function Re(e,t){if(1&e&&(Z.TgZ(0,"mat-form-field",6)(1,"mat-label"),Z._uU(2,"CIF"),Z.qZA(),Z._UZ(3,"input",28),Z.YNc(4,qe,2,1,"mat-error",10),Z.qZA()),2&e){const e=Z.oxw();let t;Z.Gre("",e.disabledInputs.cif?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(3),Z.s9C("tabindex",e.disabledInputs.cif?-1:1),Z.Q6J("placeholder",e.labels.flowCommon.cifPlaceholderShort),Z.xp6(1),Z.Q6J("ngIf",null==(t=e.form.get("cif"))?null:t.hasError("required"))}}function Ye(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",20)(1,"belender-checkbox",29,30),Z.NdJ("changeCheckbox",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.setTerms2(t))})),Z.TgZ(3,"belender-terms-and-policy-links",31),Z.NdJ("goToTerms",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.gotoTermsAndConditions())})),Z.qZA()()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("color",e.data.styles.colors.title),Z.xp6(2),Z.Q6J("lang",e.lang)("userId",e.userId)("linkType","terms")("firstSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.firstSentence)("secondSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.secondSentence)("thirdSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.thirdSentence)("policyActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.policyActionText)("termsActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.termsActionText)("customTerms",e.data[e.flowName].customTerms)}}function Fe(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",20)(1,"belender-checkbox",32,33),Z.NdJ("changeCheckbox",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.setPolicy(t))})),Z._UZ(3,"belender-terms-and-policy-links",34),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("color",e.data.styles.colors.title),Z.xp6(2),Z.Q6J("lang",e.lang)("userId",e.userId)("linkType","policy")("firstSentence",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.firstSentence)("policyActionText",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.form?null:e.data[e.flowName].texts.form.policyActionText)}}function Ue(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",35)(1,"belender-checkbox",21),Z.NdJ("changeCheckbox",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.setPower(t))})),Z._uU(2),Z.TgZ(3,"a",23),Z.NdJ("click",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.gotoPowerConditions(t))})),Z.TgZ(4,"u"),Z._uU(5),Z.qZA()()()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("color",e.data.styles.colors.title),Z.xp6(1),Z.hij(" ",e.labels.certificate.powerConsentBefore,""),Z.xp6(3),Z.Oqu(e.labels.certificate.powerConsentHere)}}function Ze(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",20)(1,"belender-checkbox",21,36),Z.NdJ("changeCheckbox",(function(t){Z.CHM(e);const n=Z.oxw();return Z.KtG(n.setAssignment(t))})),Z._UZ(3,"div",37),Z.qZA()()}if(2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("color",e.data.styles.colors.title),Z.xp6(2),Z.Q6J("innerHTML",(null==e.data[e.flowName]||null==e.data[e.flowName].texts?null:e.data[e.flowName].texts.dataAssignmentText)||(null==e.data[e.flowName]||null==e.data[e.flowName].config_translate?null:e.data[e.flowName].config_translate.dataAssignmentText)||(null==e.data||null==e.data.config?null:e.data.config.dataAssignmentText)||"",Z.oJD)}}function He(e,t){if(1&e&&(Z.TgZ(0,"div",38),Z._UZ(1,"mat-icon",39),Z._uU(2),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(2),Z.hij(" ",e.labels.warnings.haveToReadTerms," ")}}const je=function(e){return{"dont-show-data":e}},ze={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let Be=(()=>{class e{constructor(e,t,n){this.fb=e,this.utils=t,this.cd=n,this.requestID=null,this.labels=F.S.es,this.lang="",this.next=new Z.vpe(null),this.goTerms=new Z.vpe(null),this.goTermsCert=new Z.vpe(null),this.goPower=new Z.vpe(null),this.acceptTerms=!1,this.acceptPolicy=!1,this.acceptTerms2=!1,this.termsReaded=!1,this.terms2Readed=!1,this.step=0,this.assignment=!1,this.disabledInputs={dni:!1,name:!1,lastname:!1,secondlastname:!1,phone:!1,email:!1,razon:!1,cif:!1,type:!1},this.requestAux={phone:null,email:null,razon:null,cif:null,name:null,lastname:null,secondLastname:null,dni:null,type:"NATURAL"},this.noValidate=!1,this.powerActivate=!1,this.submitAttempted=!1}ngOnInit(){this.solicitud?(this.noValidate="terms_and_conditions"==this.solicitud.status_code,this.setForm(this.solicitud)):this.setForm(null)}tabChanged(e){this.requestAux.type=e.value,this.setForm(this.requestAux)}setForm(e){this.requestAux.phone=e?e.person_phone||e.phone:null,this.requestAux.email=e?e.person_email||e.email||e.email_copy:null,this.requestAux.razon=e&&e.razon_social?e.razon_social:null,this.requestAux.cif=e&&e.cif?e.cif:null,this.requestAux.name=e?e.person_name||e.name:null,this.requestAux.lastname=e?e.person_first_surname||e.first_surname:null,this.requestAux.secondLastname=e?e.person_second_surname||e.second_surname:null,this.requestAux.dni=e&&e.document_number?e.document_number:e&&e.person_document_number?e.person_document_number:null,this.requestAux.type=e&&e.person_type?e.person_type:this.requestAux.type,this.form=this.fb.group("NATURAL"==this.requestAux.type?{type:[this.requestAux.type],name:[this.requestAux.name||null,this.noValidate?[]:[p.kI.required]],lastname:[this.requestAux.lastname||null,this.noValidate?[]:[p.kI.required]],secondLastname:[this.requestAux.secondLastname||null],email:[this.requestAux.email||null,this.noValidate?[]:[p.kI.required,p.kI.email]],phone:[this.requestAux.phone||"",this.noValidate?[]:[p.kI.required,p.kI.maxLength(9),p.kI.minLength(9)]],dni:[this.requestAux.dni||null,this.noValidate?[]:[p.kI.required]]}:{type:[this.requestAux.type],name:[this.requestAux.name||null,this.noValidate?[]:[p.kI.required]],lastname:[this.requestAux.lastname||null,this.noValidate?[]:[p.kI.required]],secondLastname:[this.requestAux.secondLastname||null],email:[this.requestAux.email||null,this.noValidate?[]:[p.kI.required,p.kI.email]],dni:[this.requestAux.dni||null,this.noValidate?[]:[p.kI.required]],phone:[this.requestAux.phone||"",this.noValidate?[]:[p.kI.required,p.kI.maxLength(9),p.kI.minLength(9)]],razon:[this.requestAux.razon||null,this.noValidate?[]:[p.kI.required]],cif:[this.requestAux.cif||null,this.noValidate?[]:[p.kI.required]]}),this.requestIDFromURL&&this.disableEnableInputs(this.requestAux.type,this.requestAux.name,this.requestAux.lastname,this.requestAux.secondLastname,this.requestAux.email,this.requestAux.phone,this.requestAux.dni,this.requestAux.razon,this.requestAux.cif),this.cd.markForCheck()}disableEnableInputs(e,t,n,i,s,r,o,a,l){this.disabledInputs={name:t||!1,lastname:n||!1,secondlastname:i||!1,email:s||!1,phone:r||!1,dni:o||!1,razon:a||!1,cif:l||!1,type:e||!1}}enableInput(e){this.disabledInputs[e]=!1,this.cd.markForCheck()}nextStep(){if(!this.getIfValid())return void(0,ve.J)(this,this.cd);let e;e="NATURAL"==this.requestAux.type?{email_copy:this.form.get("email").value,phone:this.form.get("phone").value,name:this.form.get("name").value,first_surname:this.form.get("lastname").value,second_surname:this.form.get("secondLastname").value,document_number:this.form.get("dni").value,type:"Natural"}:{email_copy:this.form.get("email").value,phone:this.form.get("phone").value,name:this.form.get("name").value,first_surname:this.form.get("lastname").value,second_surname:this.form.get("secondLastname").value,document_number:this.form.get("dni").value,company_name:this.form.get("razon").value,cif:this.form.get("cif").value,type:"Legal",rmc_validation:this.userId},(this.data.config.activatePower||this.solicitud?.power_activate)&&(e.power_activate=1,e.terms_and_conditions_power=1),this.next.emit(e)}gotoTermsAndConditions(){this.termsReaded=!0,this.goTerms.emit(!0)}gotoTermsAndConditionsCertificate(){this.terms2Readed=!0,this.goTermsCert.emit(!0)}setAssignment(e){this.assignment=e}getAssignmentValidation(){return!this.data.config.dataAssignmentCheck||this.assignment}setTerms2(e){this.acceptTerms2=e,this.acceptTerms2&&(this.data?.config??{}).forceChecks?this.gotoTermsAndConditions():this.acceptTerms2||(this.termsReaded=!1)}setTermsCheck(e){this.checkComponent.checked=e,this.acceptTerms=e}setTerms2Check(e){this.certCheckComponent.checked=e,this.acceptTerms2=e}setPolicyCheck(e){this.policyCheckComponent.checked=e,this.acceptPolicy=e}setAssignmentCheck(e){this.assignmentCheckComponent.checked=e,this.assignment=e}setTerms(e){this.acceptTerms=e,this.acceptTerms&&(this.data?.config??{}).forceChecks?this.gotoTermsAndConditionsCertificate():this.acceptTerms||(this.terms2Readed=!1)}setPolicy(e){this.acceptPolicy=e}getIfValid(){let e=this.form.invalid;return this.noValidate&&(e=!1),!((this.requestID?this.solicitud?.power_activate:this.data?.config.activatePower)&&!this.powerActivate||this.data.config.forceChecks&&(!this.data.config.hideCheckLegal&&!this.termsReaded||!this.terms2Readed))&&!e&&(this.data.config.hideCheckLegal||this.acceptTerms)&&(!this.data?.config?.showPolicyLink||this.acceptPolicy)&&this.acceptTerms2&&this.getAssignmentValidation()}setPower(e){this.powerActivate=e}gotoPowerConditions(e){this.goPower.emit(!0)}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(H.F),Z.Y36(Z.sBO))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-form-step"]],viewQuery:function(e,t){if(1&e&&(Z.Gf(xe,5),Z.Gf(Se,5),Z.Gf(Ce,5),Z.Gf(Te,5)),2&e){let e;Z.iGM(e=Z.CRH())&&(t.checkComponent=e.first),Z.iGM(e=Z.CRH())&&(t.policyCheckComponent=e.first),Z.iGM(e=Z.CRH())&&(t.certCheckComponent=e.first),Z.iGM(e=Z.CRH())&&(t.assignmentCheckComponent=e.first)}},inputs:{requestID:"requestID",flowName:"flowName",data:"data",texts:"texts",solicitud:"solicitud",userId:"userId",labels:"labels",lang:"lang",requestIDFromURL:"requestIDFromURL"},outputs:{next:"nextStep",goTerms:"goToTerms",goTermsCert:"goToTermsCertificate",goPower:"goToPower"},features:[Z._Bn([{provide:T.sG,useValue:ze},{provide:Z.soG,useValue:"es-ES"}])],decls:65,vars:88,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4","custom-html",3,"innerHTML"],[1,"my-1","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between",3,"ngClass"],["appearance","outline"],["formControlName","type",3,"tabindex","selectionChange"],["value","NATURAL"],["value","LEGAL"],[4,"ngIf"],["id","form-name","formControlName","name","matInput","",3,"tabindex"],["id","form-lastname","formControlName","lastname","matInput","",3,"tabindex"],["id","form-lastname2","formControlName","secondLastname","matInput","",3,"tabindex"],["id","form-email","formControlName","email","type","email","matInput","",3,"tabindex","placeholder"],["id","form-phone","formControlName","phone","maxlength","9","type","text","matInput","",3,"tabindex","placeholder"],["id","form-dni","formControlName","dni","maxlength","9","minlength","9","type","text","matInput","",3,"tabindex","placeholder"],["appearance","outline",3,"class",4,"ngIf"],["class","flex justify-start items-center w-full flex-100",4,"ngIf"],["class","flex justify-between items-center w-full flex-100",4,"ngIf"],[1,"flex","justify-start","items-center","w-full","flex-100"],[3,"color","changeCheckbox"],["termsCertCheckbox",""],["target","_blank",1,"text-sm","hover:text-blue-500",3,"click"],["class","px-2 flex items-center gap-2 py-2 rounded-sm mt-3 bg-orange-500/10 text-orange-500",4,"ngIf"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"],["id","form-razon","formControlName","razon","type","text","matInput","",3,"tabindex","placeholder"],["id","form-cif","aria-label","CIF","formControlName","cif","type","text","matInput","",3,"tabindex","placeholder"],["id","termsCheckbox",3,"color","changeCheckbox"],["termsCheckbox",""],[3,"lang","userId","linkType","firstSentence","secondSentence","thirdSentence","policyActionText","termsActionText","customTerms","goToTerms"],["id","policyCheckbox",3,"color","changeCheckbox"],["policyCheckbox",""],[3,"lang","userId","linkType","firstSentence","policyActionText"],[1,"flex","justify-between","items-center","w-full","flex-100"],["assignmentCheckbox",""],[1,"custom-html",3,"innerHTML"],[1,"px-2","flex","items-center","gap-2","py-2","rounded-sm","mt-3","bg-orange-500/10","text-orange-500"],["svgIcon","mat:warning",1,"text-xs","w-4","h-4"]],template:function(e,t){if(1&e&&(Z._UZ(0,"belender-widget-step-logo",0),Z.TgZ(1,"form",1)(2,"div",2),Z._UZ(3,"div",3)(4,"div",4),Z.ALo(5,"safeHtml"),Z.qZA(),Z.TgZ(6,"div",5)(7,"mat-form-field",6)(8,"mat-label"),Z._uU(9),Z.qZA(),Z.TgZ(10,"mat-select",7),Z.NdJ("selectionChange",(function(e){return t.tabChanged(e)})),Z.TgZ(11,"mat-option",8),Z._uU(12),Z.qZA(),Z.TgZ(13,"mat-option",9),Z._uU(14),Z.qZA()(),Z.YNc(15,ke,2,1,"mat-error",10),Z.qZA(),Z.TgZ(16,"mat-form-field",6)(17,"mat-label"),Z._uU(18),Z.qZA(),Z._UZ(19,"input",11),Z.YNc(20,Me,2,1,"mat-error",10),Z.qZA(),Z.TgZ(21,"mat-form-field",6)(22,"mat-label"),Z._uU(23),Z.qZA(),Z._UZ(24,"input",12),Z.YNc(25,Ie,2,1,"mat-error",10),Z.qZA(),Z.TgZ(26,"mat-form-field",6)(27,"mat-label"),Z._uU(28),Z.qZA(),Z._UZ(29,"input",13),Z.qZA(),Z.TgZ(30,"mat-form-field",6)(31,"mat-label"),Z._uU(32),Z.qZA(),Z._UZ(33,"input",14),Z.YNc(34,Ee,2,1,"mat-error",10),Z.YNc(35,Ae,2,1,"mat-error",10),Z.qZA(),Z.TgZ(36,"mat-form-field",6)(37,"mat-label"),Z._uU(38),Z.qZA(),Z._UZ(39,"input",15),Z.YNc(40,Oe,2,1,"mat-error",10),Z.YNc(41,Le,2,1,"mat-error",10),Z.qZA(),Z.TgZ(42,"mat-form-field",6)(43,"mat-label"),Z._uU(44),Z.qZA(),Z._UZ(45,"input",16),Z.YNc(46,De,2,1,"mat-error",10),Z.qZA(),Z.YNc(47,Ne,5,8,"mat-form-field",17),Z.YNc(48,Re,5,6,"mat-form-field",17),Z.qZA(),Z.YNc(49,Ye,4,10,"div",18),Z.YNc(50,Fe,4,6,"div",18),Z.YNc(51,Ue,6,3,"div",19),Z.TgZ(52,"div",20)(53,"belender-checkbox",21,22),Z.NdJ("changeCheckbox",(function(e){return t.setTerms(e)})),Z._uU(55),Z.TgZ(56,"a",23),Z.NdJ("click",(function(){return t.gotoTermsAndConditionsCertificate()})),Z.TgZ(57,"u"),Z._uU(58),Z.qZA()(),Z._uU(59),Z.qZA()(),Z.YNc(60,Ze,4,2,"div",18),Z.YNc(61,He,3,1,"div",24),Z.TgZ(62,"div",25)(63,"button",26),Z.NdJ("click",(function(){return t.nextStep()})),Z._uU(64),Z.qZA()()()),2&e){let e,n,i,s,r,o,a,l;Z.Q6J("data",t.data)("customImage",t.texts.form.customImage),Z.xp6(1),Z.Q6J("formGroup",t.form),Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.form.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(5,84,t.texts.form.description||""),Z.oJD),Z.xp6(2),Z.Q6J("ngClass",Z.VKq(86,je,t.data.config.dontShowDataInTerms&&t.solicitud&&t.solicitud.status_code&&"terms_and_conditions"===t.solicitud.status_code)),Z.xp6(1),Z.Gre("",t.disabledInputs.type?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(2),Z.Oqu(t.labels.flowCommon.personType),Z.xp6(1),Z.s9C("tabindex",t.disabledInputs.type?-1:1),Z.xp6(2),Z.Oqu(t.labels.flowCommon.natural),Z.xp6(2),Z.Oqu(t.labels.flowCommon.legal),Z.xp6(1),Z.Q6J("ngIf",null==(e=t.form.get("type"))?null:e.hasError("required")),Z.xp6(1),Z.Gre("",t.disabledInputs.name?"disabled-input":""," w-full flex-1 belender-form-field"),Z.xp6(2),Z.Oqu(t.labels.flowCommon.name),Z.xp6(1),Z.s9C("tabindex",t.disabledInputs.name?-1:1),Z.uIk("aria-label",t.labels.flowCommon.name),Z.xp6(1),Z.Q6J("ngIf",null==(n=t.form.get("name"))?null:n.hasError("required")),Z.xp6(1),Z.Gre("",t.disabledInputs.lastname?"disabled-input":""," w-full flex-1 belender-form-field"),Z.xp6(2),Z.Oqu(t.labels.flowCommon.firstSurname),Z.xp6(1),Z.s9C("tabindex",t.disabledInputs.lastname?-1:1),Z.uIk("aria-label",t.labels.flowCommon.firstSurname),Z.xp6(1),Z.Q6J("ngIf",null==(i=t.form.get("lastname"))?null:i.hasError("required")),Z.xp6(1),Z.Gre("",t.disabledInputs.secondlastname?"disabled-input":""," w-full flex-1 belender-form-field"),Z.xp6(2),Z.Oqu(t.labels.flowCommon.secondSurname),Z.xp6(1),Z.s9C("tabindex",t.disabledInputs.secondlastname?-1:1),Z.uIk("aria-label",t.labels.flowCommon.secondSurname),Z.xp6(1),Z.Gre("",t.disabledInputs.email?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(2),Z.Oqu(t.labels.email),Z.xp6(1),Z.s9C("tabindex",t.disabledInputs.email?-1:1),Z.Q6J("placeholder",t.labels.flowCommon.emailPlaceholder),Z.uIk("aria-label",t.labels.email),Z.xp6(1),Z.Q6J("ngIf",null==(s=t.form.get("email"))?null:s.hasError("required")),Z.xp6(1),Z.Q6J("ngIf",null==(r=t.form.get("email"))?null:r.hasError("email")),Z.xp6(1),Z.Gre("",t.disabledInputs.phone?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(2),Z.Oqu(t.labels.phone),Z.xp6(1),Z.s9C("tabindex",t.disabledInputs.phone?-1:1),Z.Q6J("placeholder",t.labels.flowCommon.phonePlaceholder),Z.uIk("aria-label",t.labels.phone),Z.xp6(1),Z.Q6J("ngIf",null==(o=t.form.get("phone"))?null:o.hasError("required")),Z.xp6(1),Z.Q6J("ngIf",(null==(a=t.form.get("phone"))?null:a.hasError("minlength"))||(null==(a=t.form.get("phone"))?null:a.hasError("maxlength"))),Z.xp6(1),Z.Gre("",t.disabledInputs.dni?"disabled-input":""," mb-4 w-full flex-1 belender-form-field"),Z.xp6(2),Z.Oqu(t.labels.dni),Z.xp6(1),Z.s9C("tabindex",t.disabledInputs.dni?-1:1),Z.Q6J("placeholder",t.labels.flowCommon.dniPlaceholderShort),Z.uIk("aria-label",t.labels.dni),Z.xp6(1),Z.Q6J("ngIf",null==(l=t.form.get("dni"))?null:l.hasError("required")),Z.xp6(1),Z.Q6J("ngIf","LEGAL"==t.requestAux.type),Z.xp6(1),Z.Q6J("ngIf","LEGAL"==t.requestAux.type),Z.xp6(1),Z.Q6J("ngIf",!t.data.config.hideCheckLegal),Z.xp6(1),Z.Q6J("ngIf",null==t.data||null==t.data.config?null:t.data.config.showPolicyLink),Z.xp6(1),Z.Q6J("ngIf",t.requestID?null==t.solicitud?null:t.solicitud.power_activate:null==t.data?null:t.data.config.activatePower),Z.xp6(2),Z.Q6J("color",t.data.styles.colors.title),Z.xp6(2),Z.hij(" ",t.labels.flowCommon.certTermsBefore," "),Z.xp6(3),Z.Oqu(t.labels.flowCommon.certTermsLink),Z.xp6(1),Z.hij(" ",t.labels.flowCommon.certTermsAfter," "),Z.xp6(1),Z.Q6J("ngIf",null==t.data?null:t.data.config.dataAssignmentCheck),Z.xp6(1),Z.Q6J("ngIf",t.submitAttempted&&(!t.acceptTerms||!t.data.config.hideCheckLegal&&!t.acceptTerms2)),Z.xp6(2),Z.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),Z.xp6(1),Z.hij(" ",t.labels.actions.continue," ")}},dependencies:[i.mk,i.O5,d.Hw,u.lW,P.TO,P.KE,P.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.nD,p.sg,p.u,f.gD,T.ey,ye.b,ne.y,we.T,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.dont-show-data[_ngcontent-%COMP%]{opacity:0!important;padding:0!important;overflow:hidden!important;height:0px!important;margin:0!important}"]}),e})(),Je=(()=>{class e{constructor(e,t,n){this.fb=e,this.utils=t,this.Activatedroute=n,this.next=new Z.vpe(null),this.labels=F.S.es,this.accept=!1}ngOnInit(){this.Activatedroute.queryParams.subscribe((e=>{this.setForm(e)}))}nextStep(){let e={phone:this.form.get("phone").value};this.next.emit(e)}setForm(e){this.form=this.fb.group({phone:["",p.kI.required]}),this.solicitud&&"bad_phone"==this.solicitud.status_code&&this.form.controls.phone.markAsTouched()}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(H.F),Z.Y36(A.gz))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-error-form-step"]],inputs:{data:"data",flowName:"flowName",texts:"texts",mode:"mode",solicitud:"solicitud",labels:"labels"},outputs:{next:"nextStep"},decls:15,vars:19,consts:[[3,"data"],[1,"animated","fadeIn","fixed-content",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0"],[1,"subheading-1","pt-4"],[1,"mb-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline",1,"mb-4","w-full","flex-1","belender-form-field"],["formControlName","phone","matInput",""],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"]],template:function(e,t){1&e&&(Z._UZ(0,"belender-widget-step-logo",0),Z.TgZ(1,"form",1)(2,"div",2)(3,"div",3),Z._uU(4),Z.qZA(),Z.TgZ(5,"div",4),Z._uU(6),Z.qZA()(),Z.TgZ(7,"div",5)(8,"mat-form-field",6)(9,"mat-label"),Z._uU(10),Z.qZA(),Z._UZ(11,"input",7),Z.qZA()(),Z.TgZ(12,"div",8)(13,"button",9),Z.NdJ("click",(function(){return t.nextStep()})),Z._uU(14),Z.qZA()()()),2&e&&(Z.Q6J("data",t.data),Z.xp6(1),Z.Q6J("formGroup",t.form),Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.xp6(1),Z.hij(" ",t.labels.warnings.phoneError," "),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.xp6(1),Z.hij(" ",t.labels.warnings.badPhoneSS," "),Z.xp6(4),Z.Oqu(t.labels.phone),Z.xp6(3),Z.Udp("color",t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),Z.Q6J("disabled",t.form.invalid),Z.xp6(1),Z.hij(" ",t.labels.actions.continue," "))},dependencies:[u.lW,P.KE,P.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.sg,p.u,ne.y],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();var Ve=n(5145);let Qe=(()=>{class e{constructor(e){this.utils=e,this.status="",this.labels=F.S.es,this.label=F.S.es.flowCommon.loadingData}ngOnInit(){this.data.config&&this.data.config.infiniteLoopInCompleted?this.label="":(this.label=this.labels.flowCommon.loadingData,Ve.Z.forEach((e=>{e.text==this.status&&(this.label=e.label)})))}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(H.F))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-loading-step"]],inputs:{status:"status",labels:"labels",data:"data"},decls:5,vars:1,consts:[[1,"fixed-content","h-full"],[1,"h-full","py-10","flex","flex-col","items-center"]],template:function(e,t){1&e&&(Z.TgZ(0,"div",0)(1,"div",1),Z._UZ(2,"mat-progress-spinner"),Z.TgZ(3,"p"),Z._uU(4),Z.qZA()()()),2&e&&(Z.xp6(4),Z.Oqu(t.label))},dependencies:[y.Ou],styles:[".content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})(),We=(()=>{class e{constructor(e,t,n,i,s){this.fb=e,this.utils=t,this.solicitudesService=n,this.attachmentsService=i,this.notifications=s,this.retryOp=new Z.vpe(null),this.labels=F.S.es}ngOnInit(){}save(){}retry(){this.retryOp.emit(this.solicitud.request_id)}getTextStatus(){switch(this.solicitud.status_code){case"abandoned_after_waiting_otp_seguridad_social":return this.labels.abandoned.afterWaitingOtpSS;case"abandoned_after_invalid_otp_seguridad_social":return this.labels.abandoned.afterInvalidOtpSS;case"abandoned_after_invalid_otp_aeat":return this.labels.abandoned.afterInvalidOtpAEAT;case"abandoned_after_waiting_otp_aeat":return this.labels.abandoned.afterWaitingOtpAEAT;default:return this.solicitud.status_code}}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.QS),Z.Y36(H.F),Z.Y36(_.M),Z.Y36(v.o),Z.Y36(k.T))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-abandoned-step"]],inputs:{solicitud:"solicitud",data:"data",texts:"texts",labels:"labels"},outputs:{retryOp:"retry"},decls:11,vars:21,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"p-1","px-4","py-2","bg-orange-500/10","text-orange-500","border","border-orange-500","rounded-sm","mb-2","mt-6"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"click"]],template:function(e,t){1&e&&(Z._UZ(0,"belender-widget-step-logo",0),Z.TgZ(1,"div",1)(2,"div",2),Z._UZ(3,"div",3)(4,"div",4),Z.ALo(5,"safeHtml"),Z.TgZ(6,"div",5),Z._uU(7),Z.qZA()(),Z.TgZ(8,"div",6)(9,"button",7),Z.NdJ("click",(function(){return t.retry()})),Z._uU(10),Z.qZA()()()),2&e&&(Z.Q6J("data",t.data)("customImage",t.texts.abandoned.customImage),Z.xp6(3),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.abandoned.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(5,19,t.texts.abandoned.description),Z.oJD),Z.xp6(3),Z.AsE(" ",t.labels.certificate.status,": ",t.getTextStatus()," "),Z.xp6(2),Z.Udp("color",t.data.styles.colors.btnText)("background",t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),Z.xp6(1),Z.Oqu(t.labels.actions.retry))},dependencies:[u.lW,ne.y,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();function Ge(e,t){return n=>{const i=n.controls[t];i.errors&&!i.errors.confirmedValidator||i.setErrors(n.controls[e].value!==i.value?{confirmedValidator:!0}:null)}}function $e(e,t){if(1&e&&(Z.TgZ(0,"mat-hint",13),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",e.labels.certificate.password.required," ")}}function Ke(e,t){if(1&e&&(Z.TgZ(0,"mat-hint",13),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",e.labels.certificate.password.minLength," ")}}function Xe(e,t){if(1&e&&(Z.TgZ(0,"mat-hint",13),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",e.labels.certificate.password.confirmRequired," ")}}function et(e,t){if(1&e&&(Z.TgZ(0,"mat-hint",13),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",e.labels.certificate.password.mismatch," ")}}function tt(e,t){if(1&e&&(Z.TgZ(0,"mat-hint",13),Z._uU(1),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.hij(" ",e.labels.certificate.password.minLength," ")}}const nt={parse:{dateInput:"DD/MM/YYYY"},display:{dateInput:"DD/MM/YYYY",monthYearLabel:"MMM YYYY",dateA11yLabel:"LL",monthYearA11yLabel:"MMMM YYYY"}};let it=(()=>{class e{constructor(e,t){this.fb=e,this.utils=t,this.labels=F.S.es,this.form=new p.cw({}),this.next=new Z.vpe(null)}ngOnInit(){this.setForm()}get f(){return this.form.controls}submit(){this.nextStep()}setForm(){this.form=this.fb.group({password:["",[p.kI.required]],confirm_password:["",[p.kI.required]]},{validator:Ge("password","confirm_password")})}nextStep(){let e={password:this.form.get("password").value};this.next.emit(e)}}return e.ɵfac=function(t){return new(t||e)(Z.Y36(p.qu),Z.Y36(H.F))},e.ɵcmp=Z.Xpm({type:e,selectors:[["belender-password-step"]],inputs:{data:"data",texts:"texts",solicitud:"solicitud",labels:"labels"},outputs:{next:"nextStep"},features:[Z._Bn([{provide:T.sG,useValue:nt},{provide:Z.soG,useValue:"es-ES"}])],decls:23,vars:28,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-4","flex","flex-col"],[1,"title","m-0",3,"innerHTML"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"my-3","flex","flex-col","md:flex-row","flex-wrap","gap-2","md:justify-between"],["appearance","outline",1,"w-full","flex-1","belender-form-field"],["formControlName","password","minlength","8","type","password","matInput",""],["class","text-red-500",4,"ngIf"],["appearance","outline",1,"mb-4","w-full","flex-1","belender-form-field"],["formControlName","confirm_password","minlength","8","type","password","matInput",""],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],[1,"text-red-500"]],template:function(e,t){1&e&&(Z._UZ(0,"belender-widget-step-logo",0),Z.TgZ(1,"form",1)(2,"div",2),Z._UZ(3,"div",3)(4,"div",4),Z.ALo(5,"safeHtml"),Z.qZA(),Z.TgZ(6,"div",5)(7,"mat-form-field",6)(8,"mat-label"),Z._uU(9),Z.qZA(),Z._UZ(10,"input",7),Z.YNc(11,$e,2,1,"mat-hint",8),Z.YNc(12,Ke,2,1,"mat-hint",8),Z.qZA(),Z.TgZ(13,"mat-form-field",9)(14,"mat-label"),Z._uU(15),Z.qZA(),Z._UZ(16,"input",10),Z.YNc(17,Xe,2,1,"mat-hint",8),Z.YNc(18,et,2,1,"mat-hint",8),Z.YNc(19,tt,2,1,"mat-hint",8),Z.qZA()(),Z.TgZ(20,"div",11)(21,"button",12),Z.NdJ("click",(function(){return t.nextStep()})),Z._uU(22),Z.qZA()()()),2&e&&(Z.Q6J("data",t.data)("customImage",t.texts.password.customImage),Z.xp6(1),Z.Q6J("formGroup",t.form),Z.xp6(2),Z.Udp("color",t.data.styles.colors.title)("font-size",t.texts.form.titleSize+"px"),Z.Q6J("innerHTML",t.texts.password.title,Z.oJD),Z.xp6(1),Z.Udp("color",t.data.styles.colors.text),Z.Q6J("innerHTML",Z.lcZ(5,26,t.texts.password.description),Z.oJD),Z.xp6(5),Z.Oqu(t.labels.certificate.password.label),Z.xp6(2),Z.Q6J("ngIf",t.f.password.touched&&t.f.password.invalid&&t.f.password.errors.required),Z.xp6(1),Z.Q6J("ngIf",t.f.password.invalid&&t.f.password.errors.minlength),Z.xp6(3),Z.Oqu(t.labels.certificate.password.confirmLabel),Z.xp6(2),Z.Q6J("ngIf",t.f.confirm_password.touched&&t.f.confirm_password.touched&&t.f.confirm_password.invalid&&t.f.confirm_password.errors.required),Z.xp6(1),Z.Q6J("ngIf",t.f.confirm_password.touched&&t.f.confirm_password.touched&&t.f.confirm_password.invalid&&t.f.confirm_password.errors.confirmedValidator),Z.xp6(1),Z.Q6J("ngIf",t.f.confirm_password.invalid&&t.f.confirm_password.errors.minlength),Z.xp6(2),Z.Udp("color",t.form.invalid?"":t.data.styles.colors.btnText)("background",t.form.invalid?"":t.data.styles.colors.btnBg)("border-radius",t.data.styles.btnRound+"px"),Z.Q6J("disabled",t.form.invalid),Z.xp6(1),Z.hij(" ",t.labels.certificate.password.save," "))},dependencies:[i.O5,u.lW,P.KE,P.bx,P.hX,x.Nt,p._Y,p.Fj,p.JJ,p.JL,p.wO,p.sg,p.u,ne.y,ie.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}"]}),e})();const st=["formStep"];function rt(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"vex-power-cert",3),Z.NdJ("accept",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.acceptPowerCert())})),Z.qZA()}if(2&e){const e=Z.oxw();Z.Q6J("hideButtons",!1)("flow","VideoID")("userId",e.userId)}}function ot(e,t){1&e&&(Z.TgZ(0,"div",9),Z._UZ(1,"mat-progress-spinner",10),Z.qZA()),2&e&&(Z.xp6(1),Z.Q6J("value",0))}function at(e,t){if(1&e&&Z._UZ(0,"belender-loading-step",19),2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("labels",e.labels)("status",null==e.solicitud?null:e.solicitud.status_code)}}function lt(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-form-step",20,21),Z.NdJ("goToTerms",(function(){Z.CHM(e);const t=Z.oxw(4);return Z.KtG(t.gotoTermsAndConditions())}))("goToPower",(function(){Z.CHM(e);const t=Z.oxw(4);return Z.KtG(t.gotoPowerConditions())}))("goToTermsCertificate",(function(){Z.CHM(e);const t=Z.oxw(4);return Z.KtG(t.gotoTermsAndConditionsCertificate())}))("nextStep",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.gotoOTP(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("flowName",e.flowName)("requestID",e.requestID)("requestIDFromURL",e.requestIDFromURL)("userId",e.userId)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)("labels",e.labels)("lang",e.currentLang)("labels",e.labels)}}function ct(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-otp-step",22),Z.NdJ("resendOTP",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.resendOTP(t))}))("errorPhone",(function(){Z.CHM(e);const t=Z.oxw(4);return Z.KtG(t.setRequestStatus("failed_login_otp"))}))("nextStep",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.requestOTP(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function dt(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-password-step",23),Z.NdJ("nextStep",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.sendPassword(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function ut(e,t){if(1&e&&Z._UZ(0,"belender-success-step",24),2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("flowName",e.flowName)("packId",e.packId)("userId",e.userId)("requestID",e.requestID)("labels",e.labels)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function ht(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-fail-step",25),Z.NdJ("retry",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.retryRequest(t))}))("newRequest",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.newRequest(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("data",e.data)("labels",e.labels)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud)}}function pt(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-error-form-step",26),Z.NdJ("nextStep",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.sendNewData(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("solicitud",e.solicitud)("data",e.data)("labels",e.labels)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function mt(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"belender-abandoned-step",27),Z.NdJ("retry",(function(t){Z.CHM(e);const n=Z.oxw(4);return Z.KtG(n.retryRequest(t))})),Z.qZA()}if(2&e){const e=Z.oxw(4);Z.Q6J("solicitud",e.solicitud)("data",e.data)("labels",e.labels)("texts",e.data[e.flowName]?e.data[e.flowName].texts:null==e.data[e.flowName]?null:e.data[e.flowName].texts)}}function ft(e,t){if(1&e&&(Z.ynx(0),Z.YNc(1,at,1,3,"belender-loading-step",11),Z.YNc(2,lt,2,10,"belender-form-step",12),Z.YNc(3,ct,1,4,"belender-otp-step",13),Z.YNc(4,dt,1,4,"belender-password-step",14),Z.YNc(5,ut,1,7,"belender-success-step",15),Z.YNc(6,ht,1,4,"belender-fail-step",16),Z.YNc(7,pt,1,4,"belender-error-form-step",17),Z.YNc(8,mt,1,4,"belender-abandoned-step",18),Z.BQk()),2&e){const e=Z.oxw(3);Z.xp6(1),Z.Q6J("ngIf","loading"==e.requestStatus),Z.xp6(1),Z.Q6J("ngIf","form"==e.requestStatus&&!e.loading),Z.xp6(1),Z.Q6J("ngIf","otp"==e.requestStatus),Z.xp6(1),Z.Q6J("ngIf","password"==e.requestStatus),Z.xp6(1),Z.Q6J("ngIf","success"==e.requestStatus),Z.xp6(1),Z.Q6J("ngIf","failed"==e.requestStatus),Z.xp6(1),Z.Q6J("ngIf","error-data"==e.requestStatus),Z.xp6(1),Z.Q6J("ngIf","abandoned"==e.requestStatus)}}function gt(e,t){1&e&&Z._UZ(0,"belender-disabled-url")}function _t(e,t){if(1&e&&(Z.TgZ(0,"div",28),Z._UZ(1,"mat-progress-spinner",29),Z.TgZ(2,"p",30),Z._uU(3),Z.qZA()()),2&e){const e=Z.oxw(3);Z.xp6(1),Z.Q6J("value",e.spinnerValue)("mode",e.spinnerMode),Z.xp6(2),Z.hij(" ",e.loading," ")}}function bt(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"div",31)(1,"div",32)(2,"div",33),Z._uU(3),Z.qZA(),Z._UZ(4,"div",34),Z.qZA(),Z.TgZ(5,"div",35)(6,"button",36),Z.NdJ("click",(function(){Z.CHM(e);const t=Z.oxw(3);return Z.KtG(t.error=!1)})),Z._uU(7),Z.qZA()()()}if(2&e){const e=Z.oxw(3);Z.xp6(3),Z.Oqu(e.labels.warnings.error),Z.xp6(1),Z.Udp("color",e.data.styles.colors.text),Z.Q6J("innerHTML",e.error,Z.oJD),Z.xp6(3),Z.hij(" ",e.labels.manual," ")}}function vt(e,t){if(1&e&&(Z.TgZ(0,"div",4)(1,"div"),Z.YNc(2,ot,2,1,"div",6),Z.YNc(3,ft,9,8,"ng-container",5),Z.YNc(4,gt,1,0,"belender-disabled-url",5),Z.YNc(5,_t,4,3,"div",7),Z.YNc(6,bt,8,5,"div",8),Z.qZA()()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.Gre("h-full w-full flex-auto p-0 md:p-3 ",e.data.styles.typography,""),Z.Udp("background",e.data.styles.colors.background),Z.xp6(1),Z.Q6J("ngIf",e.data.config.infiniteLoopInCompleted&&"loading"==e.requestStatus),Z.xp6(1),Z.Q6J("ngIf",!e.error&&!e.disableURL),Z.xp6(1),Z.Q6J("ngIf",!e.error&&e.disableURL),Z.xp6(1),Z.Q6J("ngIf",e.loading&&!e.error),Z.xp6(1),Z.Q6J("ngIf",!e.loading&&e.error)}}function yt(e,t){if(1&e&&(Z.ynx(0),Z.TgZ(1,"div",37),Z._uU(2),Z.qZA(),Z.BQk()),2&e){const e=Z.oxw(2);Z.xp6(2),Z.hij(" TestMode ",e.testMode?"ON":"OFF"," ")}}function wt(e,t){if(1&e&&(Z.TgZ(0,"div",4),Z.YNc(1,vt,7,10,"div",1),Z.YNc(2,yt,3,1,"ng-container",5),Z.qZA()),2&e){const e=Z.oxw();Z.xp6(1),Z.Q6J("ngIf",e.data),Z.xp6(1),Z.Q6J("ngIf",e.testMode)}}function xt(e,t){if(1&e){const e=Z.EpF();Z.TgZ(0,"vex-terms",38),Z.NdJ("accepted",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.handleTermsResponse(!0))}))("cancelled",(function(){Z.CHM(e);const t=Z.oxw();return Z.KtG(t.handleTermsResponse(!1))})),Z.qZA()}if(2&e){const e=Z.oxw();Z.Q6J("flow","videoid")("lang",e.currentLang)("allData",e.data)("requestStatus",e.solicitud?e.solicitud.status_code:"")}}let St=class{constructor(e,t,n,i,s,r,o,a,l,c,d){this.cd=e,this.Activatedroute=t,this.utils=n,this.videoIDService=i,this.customizationService=s,this.customizationStoreService=r,this.notis=o,this.webhooksService=a,this.dialog=l,this.translationService=c,this.videoIdUtils=d,this.data=null,this.disableActions=!1,this.step="created",this.waitingTime=15,this.loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1,this.requestIDFromURL=!1,this.requestCreated=!1,this.viewPowerTerms=!1,this.disableURL=!1,this.flowName="VideoID",this.showTermsDialog=!1,this.currentLang="",this.labels=F.S.es,this.requestStatus="form",this.intervalToAskBack=null,this.intervalCount=0,this.lastInvalidOtpAlertStatus=null}set solicitud(e){this._solicitudInput=e,e&&this.videoIdUtils.setRequest(e)}get solicitud(){return this.videoIdUtils.REQUEST||this._solicitudInput}ngOnInit(){this.setTranslation(),this.loading=this.labels.certificate.loadings.gettingRequestInfo,this.userId=this.customizationStoreService.USER_ID,this.packId=this.customizationStoreService.PACK_ID,this.videoIdUtils.request_status$.subscribe((e=>{"invalid_otp_seguridad_social"===e&&this.lastInvalidOtpAlertStatus!==e&&(this.lastInvalidOtpAlertStatus=e,this.showAlert("Error!","Código inválido. Por favor, introduzca el código recibido por SMS")),this.setStatus()})),this.userId?this.setInitialData(this.userId):this.loading=null,this.utils.setLoading(!1)}ngOnDestroy(){this.stopInterval(),this.videoIdUtils.disconnectWebsocket()}sendMessageToParent(e){this.videoIdUtils.sendMessageToParent(e)}setInitialData(e){var t=this;return(0,L.Z)((function*(){const n=(0,Y.cm)(yield t.getFlow(e));if(t.funderConfig=t.customizationStoreService.FUNDER_CONFIG,t.data={config:t.funderConfig,styles:t.customizationStoreService.FUNDER_STYLES,[t.flowName]:n},(0,Y.bf)(t.data,t.flowName),!t.data.config||!t.data.config.funder_id)return t.notis.showAlert(t.labels.warnings.error,t.labels.warnings.noCustomization,"error"),t.loading=null,void t.cd.markForCheck();t.financiadorID=t.data.config.funder_id||"",t.disableURL=t.data.config.disableUrlWidget,t.validateRequestIdInUrl(),t.cd.markForCheck()}))()}getFlow(e){var t=this;return(0,L.Z)((function*(){return console.error(e,t.flowName),new Promise((n=>{t.customizationService.getCustomizationByFlow(e,t.flowName,t.customizationStoreService.LANG).then((e=>{n(e?.data?e.data:null)}),(e=>{n(null)}))}))}))()}setTranslation(){const e=this.currentLang||this.customizationStoreService?.LANG||localStorage.getItem("belender-language")||"es",t=this.translationService.getLabelsTranslated(e);t&&(this.labels=t,this.videoIdUtils.labels=t)}validateRequestIdInUrl(){this.Activatedroute.queryParams.subscribe((e=>{e?.lang&&(this.currentLang=e.lang,this.setTranslation(),this.loading=this.translationService.getFirstLoading(this.currentLang)),e&&this.setParamsToRequest(e),e&&e.acceptTerms&&(this.autoAcceptTerms=!0),e&&e.request_id?(this.disableURL=!1,this.requestID=e.request_id,this.setFormFromVcCode(e.request_id)):(this.loading=null,this.sendMessageToParent({type:"widgetLoaded",data:{}}))}),(e=>{this.loading=null,this.sendMessageToParent({type:"widgetLoaded",data:{}})}))}setFormFromVcCode(e){var t=this;return(0,L.Z)((function*(){t.loading=t.labels.loadings.gettingData,t.videoIDService.getSolicitudByCode(e).then((n=>{if(n&&n.data){if(w.t.shouldIgnoreWebhookStatus(n.data.status_code))return t.videoIdUtils.setRequest(t.videoIdUtils.REQUEST?.status_code?{...n.data,status_code:t.videoIdUtils.REQUEST.status_code}:n.data),t.videoIdUtils.subscribeWS(e),t.loading="Estamos procesando su solicitud. Espere un momento por favor",t.requestCreated=!0,t.requestIDFromURL=!0,t.skipCreationOfRequest=!0,t.autoAcceptTerms&&t.gotoOTP(),void t.sendMessageToParent({type:"widgetLoaded",data:{}});t.videoIdUtils.setRequest(n.data),t.requestCreated=!0,t.requestIDFromURL=!0,t.videoIdUtils.subscribeWS(e),t.setRequestStatus(t.videoIdUtils.REQUEST.status_code),t.loading=null,t.solicitud.status_code&&"waiting_video"===t.solicitud.status_code&&t.solicitud.url_video_id&&location.assign(t.solicitud.url_video_id),t.skipCreationOfRequest=t.solicitud&&t.solicitud.status_code&&"prerequest"!=t.solicitud.status_code,t.autoAcceptTerms&&t.gotoOTP()}else t.loading=null;t.sendMessageToParent({type:"widgetLoaded",data:{}})})).catch((e=>{t.loading=null,t.sendMessageToParent({type:"widgetLoaded",data:{}})}))}))()}setParamsToRequest(e){this.requestIDFromURL=!0,this.solicitud||(this.solicitud={status_code:"form"}),e.document&&!this.solicitud.person_document_number&&(this.solicitud.document_number=e.document),e.birthday&&!this.solicitud.birth_date&&(this.solicitud.birth_date=e.birthday),e.expiration&&!this.solicitud.document_expiration_date&&(this.solicitud.document_expiration_date=e.expiration),e.type&&!this.solicitud.person_type&&(this.solicitud.person_type=e.type),e.phone&&!this.solicitud.person_phone&&(this.solicitud.person_phone=e.phone),e.email&&!this.solicitud.person_email&&(this.solicitud.person_email=e.email),e.cif&&!this.solicitud.cif&&(this.solicitud.cif=e.cif),e.razon&&!this.solicitud.razon_social&&(this.solicitud.razon_social=e.razon),e.name&&!this.solicitud.person_name&&(this.solicitud.person_name=e.name),e.lastname&&!this.solicitud.person_first_surname&&(this.solicitud.person_first_surname=e.lastname),e.second_lastname&&!this.solicitud.person_second_surname&&(this.solicitud.person_second_surname=e.second_lastname)}handlePusherNotification(e){this.videoIdUtils.handlePusherNotification(e),setTimeout((()=>{this.loading=null,this.cd.markForCheck()}),500)}resendOTP(e){let t={request_id:this.requestID,user_id:this.userId};this.loading=this.labels.loadings.resendingOtp,this.setSubscriptionOfRequest(),this.videoIDService.resendOTP(t).then((e=>{e&&e.data&&(this.videoIdUtils.setRequest(e.data),this.setRequestStatus(this.videoIdUtils.REQUEST.status_code)),this.loading=null})).catch((e=>{console.error(e),this.showAlert(this.labels.warnings.error,e.message||e),this.loading=null}))}gotoTerms(e){this.loading=this.labels.loadings.sendingData,e.package_id=this.packId,e.user_id=this.userId,this.requestID&&(e.request_id=this.requestID),this.testMode?setTimeout((()=>{this.videoIdUtils.setRequest(new q.l),this.setRequestStatus("waiting_otp_seguridad_social"),this.loading=null}),4e3):this.skipCreationOfRequest?(this.gotoOTP(),this.setSubscriptionOfRequest()):this.videoIDService.addSolicitud(e).then((t=>{t&&t.status&&"error"==t.status?(this.videoIdUtils.setRequest({...e,status_code:"form"}),t.message&&(400==t.code?"Birthdate incorrect"==t.message?(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongBirthday)):"Incorrect date"==t.message?(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongDate)):(this.setRequestStatus("no_service"),this.loading=null):(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,t.message)))):t&&t.status&&"success"==t.status?(this.requestID=t.data.request_id,this.videoIdUtils.setRequest(t.data),this.sendMessageToParent({type:"response",data:t.data||t}),this.gotoOTP()):this.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+t)})).catch((e=>{e&&e.error&&this.showAlert(this.labels.warnings.error,e.error),this.loading=null}))}setSubscriptionOfRequest(){this.videoIdUtils.subscribeWS(this.requestID)}setSubscriptionOfRequestOld(){!this.financiadorID||!this.userId||!this.requestID||this.subscribed||(this.subscribed=!0,this.webhooksService.bindRequestChanges(this.financiadorID,this.userId,this.requestID),this.webhooksService.subscribeRequestChanges().subscribe((e=>{e&&this.handlePusherNotification(e)}),(e=>{this.loading=null})))}sendNewData(e){this.loading=this.labels.certificate.loadings.sendingInfo,this.videoIDService.fixData(this.requestID,e).then((e=>{e.status&&"error"==e.status?e.message&&(this.showAlert(this.labels.warnings.error,e),this.loading=null):e&&"success"==e.status&&(this.sendMessageToParent({type:"response",data:e.data||e}),this.initWaitingForResponse(this.labels.loadings.validatingData),this.cd.markForCheck())})).catch((e=>{e&&e.error&&this.showAlert(this.labels.warnings.error,e.error),this.loading=null}))}showAlert(e,t){this.loading=null,this.notis.showAlert(e,t)}gotoOTP(e){let t=e;t.user_id=this.userId,t.package_id=this.packId,this.requestCreated?this.setTerms(e):(this.initWaitingForResponse(this.labels.certificate.loadings.startingEmission),this.videoIDService.addSolicitud(t).then((n=>{n.status&&"error"==n.status?(console.error("error en el then",n),this.videoIdUtils.setRequest({...t,status_code:"form"}),n.message?(this.showAlert(this.labels.warnings.error,n.message),n.message&&" Teléfono incorrecto"===n.message&&setTimeout((()=>{this.formComponent.enableInput("phone")}),1e3)):this.showAlert(this.labels.warnings.error,n)):n&&"success"==n.status&&(this.sendMessageToParent({type:"response",data:n.data||n}),this.videoIdUtils.setRequest(n.data),this.requestID=n.data.request_id,this.setSubscriptionOfRequest(),this.cd.markForCheck(),this.setTerms(e))})).catch((e=>{console.error("errooooooorrrrr",e),e&&e.error&&this.showAlert(this.labels.warnings.error,e.error),this.loading=null})))}setTerms(e){this.loading=this.labels.loadings.sendingData;let t={request_id:this.solicitud.request_id,terms_and_conditions_service:!0,terms_and_conditions_certificate_emition:!0};(this.data.config.activatePower||this.solicitud?.power_activate)&&(t.power_activate=!0,t.terms_and_conditions_power=e.terms_and_conditions_power),this.testMode?setTimeout((()=>{this.videoIdUtils.setRequest(new q.l),this.setRequestStatus("waiting_otp_seguridad_social"),this.loading=null}),4e3):this.videoIDService.acceptTerms(t).then((e=>{e&&e.status&&"error"==e.status?(this.videoIdUtils.setRequest({...t,status_code:"form"}),e.message&&(400==e.code?"Birthdate incorrect"==e.message?(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongBirthday)):"Incorrect date"==e.message?(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,this.labels.warnings.wrongDate)):(this.setRequestStatus("no_service"),this.loading=null):(this.setRequestStatus("form"),this.showAlert(this.labels.warnings.error,e.message)))):e&&e.status&&"success"==e.status?(this.setRequestStatus("waiting_password"),this.sendMessageToParent({type:"response",data:e.data||e}),this.loading=null):this.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+e)})).catch((e=>{e&&e.error&&this.showAlert(this.labels.warnings.error,e.error),this.loading=null}))}sendPassword(e){this.loading=this.labels.videoid.sendingPassword,console.error("password: ",e),e.request_id=this.requestID,this.videoIDService.sendPassword(e).then((e=>{e&&e.status&&"error"==e.status?e.message&&(400==e.code?(this.setRequestStatus("no_service"),this.loading=null):(this.setRequestStatus("waiting_password"),this.showAlert(this.labels.warnings.error,e.message))):e&&e.status&&"success"==e.status?(this.setRequestStatus("waiting_otp"),this.sendMessageToParent({type:"response",data:e.data||e})):this.showAlert(this.labels.warnings.error,this.labels.warnings.unknownError+e)})).catch((e=>{e&&e.error&&this.showAlert(this.labels.warnings.error,e.error),this.loading=null}))}requestOTP(e){this.loading=this.labels.videoid.sendingOtpShort,this.testMode?setTimeout((()=>{this.videoIdUtils.setRequest(new q.l),this.setRequestStatus("all_documents_downloaded"),this.loading=null}),2e3):this.videoIDService.sendOTP({request_id:this.requestID,otp:e.code}).then((e=>{e.status&&"error"==e.status?(this.showAlert(this.labels.warnings.error,e.message?"invalid_otp"==e.message?this.labels.videoid.invalidOtpRetry:e.message:e),this.loading=!1):e&&"success"==e.status&&(this.loading=this.labels.videoid.redirectingVintegris,this.setRequestStatus("loading"),this.sendMessageToParent({type:"response",data:e.data||e}),this.cd.markForCheck(),location.assign(e.message))})).catch((e=>{e&&e.error&&this.showAlert(this.labels.warnings.error,e.error),this.loading=null}))}initWaitingForResponse(e){this.loading=e||this.labels.certificate.loadings.validatingInfo,setTimeout((()=>{this.loading&&this.askToBack()}),1e4)}askToBack(){this.askDetailToBack(this.requestID)}askDetailToBack(e){const t=this.videoIdUtils.REQUEST?.status_code,n=e||this.requestID||this.videoIdUtils.REQUEST?.request_id;n&&"consent_process_completed"!==t?this.videoIDService.getSolicitudByCode(n).then((e=>{if(e&&e.data){if(w.t.shouldIgnoreWebhookStatus(e.data.status_code))return;t!=e.data.status_code&&(this.videoIdUtils.setRequest(e.data),this.setRequestStatus(this.videoIdUtils.REQUEST.status_code)),this.loading=null}else this.loading=null})).catch((e=>{this.loading=null})):this.stopInterval()}initIntervalToAskBack(){!this.videoIdUtils.REQUEST?.request_id&&!this.requestID||this.intervalToAskBack||(this.intervalToAskBack=setInterval((()=>{this.askDetailToBack(),this.intervalCount++,this.intervalCount>20&&this.stopInterval()}),5e3))}stopInterval(){this.intervalToAskBack&&clearInterval(this.intervalToAskBack),this.intervalToAskBack=null,this.intervalCount=0}gotoErrorPhone(){}setRequestStatus(e){this.videoIdUtils.REQUEST||this.videoIdUtils.setRequest(new q.l),this.videoIdUtils.setRequestStatus(e),this.setStatus()}setStatus(){if(!this.videoIdUtils.REQUEST)return;const e=this.videoIdUtils.REQUEST.status_code,t=U[e];if(t){if("success"===t&&(this.funderConfig?.infiniteLoopInCompleted||"waiting_video"===e))return this.requestStatus="loading",this.loading="Aguardando validación por Video ID",void this.cd.markForCheck();if("error-data"===t)return this.requestStatus=this.data?.config?.noRetryInBadPhone?"otp":"error-data",this.loading=null,this.stopInterval(),void this.cd.markForCheck();if("loading"===t)return this.requestStatus="loading",this.loading=this.labels.loadings?.validatingData||"Estamos procesando su solicitud. Espere un momento por favor",void this.cd.markForCheck();this.requestStatus=t,this.loading=null,this.stopInterval()}else this.requestStatus="loading",this.loading=this.labels.loadings?.validatingData||"Estamos procesando su solicitud. Espere un momento por favor",this.initIntervalToAskBack();this.cd.markForCheck()}getStatus(){return this.requestStatus}retryRequest(e){let t={request_id:e,user_id:this.userId};this.loading=this.labels.loadings.resendingRequest,this.setSubscriptionOfRequest(),this.videoIDService.retryRequest(t).then((e=>{e&&e.data&&(this.videoIdUtils.setRequest(e.data),this.setRequestStatus(this.videoIdUtils.REQUEST.status_code)),this.loading=null})).catch((e=>{console.error(e),this.showAlert(this.labels.warnings.error,e.message||e),this.loading=null}))}newRequest(e){this.setRequestStatus("created")}sendRetry(){}gotoTermsAndConditions(){this.showTermsDialog=!0}handleTermsResponse(e){this.showTermsDialog=!1,this.formComponent.setTermsCheck(e)}gotoTermsAndConditionsCertificate(){this.dialog.open(R.v,{panelClass:"fullscreen-dialog",data:{flow:"videoid",lang:this.currentLang||localStorage.getItem("belender-language")||"es"}}).afterClosed().subscribe((e=>{e&&this.formComponent.setTerms2Check(!0)}))}gotoPowerConditions(){this.viewPowerTerms=!0}acceptPowerCert(){this.viewPowerTerms=!1}get customImageForCurrentStep(){const e=this.data?.[this.flowName]?.texts;return e&&e[{failed:"fail","no-service":"noService",otp:"otp"}[this.requestStatus]??this.requestStatus]?.customImage||""}};function Ct(e,t){if(1&e&&(Z.TgZ(0,"div",6),Z._UZ(1,"mat-progress-spinner",7),Z.TgZ(2,"p",8),Z._uU(3),Z.qZA()()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.Q6J("value",e.spinnerValue)("mode",e.spinnerMode),Z.xp6(2),Z.Oqu(e.loading)}}function Tt(e,t){if(1&e&&(Z.TgZ(0,"div",1)(1,"div",2),Z._UZ(2,"belender-widget-step-logo",3)(3,"belender-success-step",4),Z.YNc(4,Ct,4,3,"div",5),Z.qZA()()),2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("background",e.data.styles.colors.background),Z.xp6(1),Z.Q6J("data",e.data)("customImage",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.success?null:e.data[e.flowName].texts.success.customImage),Z.xp6(1),Z.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("flowName",e.flowName),Z.xp6(1),Z.Q6J("ngIf",e.loading&&!e.error)}}St.ɵfac=function(e){return new(e||St)(Z.Y36(Z.sBO),Z.Y36(A.gz),Z.Y36(H.F),Z.Y36(B),Z.Y36(S.w),Z.Y36(J.r),Z.Y36(k.T),Z.Y36(w.t),Z.Y36(V.uw),Z.Y36(Q.D),Z.Y36($))},St.ɵcmp=Z.Xpm({type:St,selectors:[["belender-widget-videoid"]],viewQuery:function(e,t){if(1&e&&Z.Gf(st,5),2&e){let e;Z.iGM(e=Z.CRH())&&(t.formComponent=e.first)}},inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud"},features:[Z._Bn([{provide:P.o2,useValue:{appearance:"standard"}}])],decls:3,vars:3,consts:[[3,"hideButtons","flow","userId","accept",4,"ngIf"],["class","h-full widget-belender",4,"ngIf"],[3,"flow","lang","allData","requestStatus","accepted","cancelled",4,"ngIf"],[3,"hideButtons","flow","userId","accept"],[1,"h-full","widget-belender"],[4,"ngIf"],["class","flex justify-center h-full min-h-[300px] items-center",4,"ngIf"],["class","loading-wrapper animated fadeIn",4,"ngIf"],["class","animated fadeInRight",4,"ngIf"],[1,"flex","justify-center","h-full","min-h-[300px]","items-center"],["color","accent","diameter","40","mode","indeterminate",1,"spinner",3,"value"],[3,"data","labels","status",4,"ngIf"],[3,"data","flowName","requestID","requestIDFromURL","userId","texts","solicitud","labels","lang","goToTerms","goToPower","goToTermsCertificate","nextStep",4,"ngIf"],[3,"data","labels","texts","solicitud","resendOTP","errorPhone","nextStep",4,"ngIf"],[3,"data","labels","texts","solicitud","nextStep",4,"ngIf"],[3,"data","flowName","packId","userId","requestID","labels","texts",4,"ngIf"],[3,"data","labels","texts","solicitud","retry","newRequest",4,"ngIf"],[3,"solicitud","data","labels","texts","nextStep",4,"ngIf"],[3,"solicitud","data","labels","texts","retry",4,"ngIf"],[3,"data","labels","status"],[3,"data","flowName","requestID","requestIDFromURL","userId","texts","solicitud","labels","lang","goToTerms","goToPower","goToTermsCertificate","nextStep"],["formStep",""],[3,"data","labels","texts","solicitud","resendOTP","errorPhone","nextStep"],[3,"data","labels","texts","solicitud","nextStep"],[3,"data","flowName","packId","userId","requestID","labels","texts"],[3,"data","labels","texts","solicitud","retry","newRequest"],[3,"solicitud","data","labels","texts","nextStep"],[3,"solicitud","data","labels","texts","retry"],[1,"loading-wrapper","animated","fadeIn"],["color","accent","diameter","40",1,"spinner",3,"value","mode"],[1,"mt-6","text-center","text-black",2,"color","black !important"],[1,"animated","fadeInRight"],[1,"px-6","py-4","flex","flex-col"],[1,"text-red-500","title","m-0"],[1,"subheading-1","pt-4",3,"innerHTML"],[1,"flex","items-center","justify-end","gap-2","p-4"],["mat-flat-button","","type","button",1,"text-blue-500","bg-blue-50","px-8",3,"click"],[1,"test-mode","px-10","py-2","bg-blue-500/10","text-blue-500","border-blue-500","border","rounded-md"],[3,"flow","lang","allData","requestStatus","accepted","cancelled"]],template:function(e,t){1&e&&(Z.YNc(0,rt,1,3,"vex-power-cert",0),Z.YNc(1,wt,3,2,"div",1),Z.YNc(2,xt,1,4,"vex-terms",2)),2&e&&(Z.Q6J("ngIf",t.viewPowerTerms),Z.xp6(1),Z.Q6J("ngIf",t.data),Z.xp6(1),Z.Q6J("ngIf",t.showTermsDialog))},dependencies:[i.O5,u.lW,y.Ou,K.L,X.L,ee.q,he,fe,be,Be,Je,Qe,We,it],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative}.widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"]}),St=(0,D.gn)([(0,N.c)()],St);let kt=class{constructor(e,t,n,i,s,r,o,a){this.cd=e,this.Activatedroute=t,this.utils=n,this.videoIDService=i,this.customizationStoreService=s,this.customizationService=r,this.notis=o,this.translationService=a,this.data=null,this.disableActions=!1,this.step="created",this.flowName="VideoID",this.labels=F.S.es,this.waitingTime=15,this.loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1}ngOnInit(){this.labels=this.translationService.getLabelsTranslated(localStorage.getItem("belender-language")||"es"),this.loading=this.labels.certificate.loadings.gettingRequestInfo,this.Activatedroute.params.subscribe((e=>{e&&e.idUser?(this.userId=e.idUser,this.setInitialData(this.userId)):this.loading=null,e&&e.packID&&(this.packId=e.packID)}),(e=>{this.loading=null})),this.utils.setLoading(!1)}ngOnDestroy(){}setInitialData(e){var t=this;return(0,L.Z)((function*(){const n=(0,Y.cm)(yield t.getFlow(e));if(t.data={config:t.customizationStoreService.FUNDER_CONFIG,styles:t.customizationStoreService.FUNDER_STYLES,[t.flowName]:n},(0,Y.bf)(t.data,t.flowName),!t.data.config||!t.data.config.funder_id)return t.notis.showAlert(t.labels.warnings.error,t.labels.warnings.noCustomization,"error"),t.loading=null,void t.cd.markForCheck();t.financiadorID=t.data.config.funder_id||"",t.loading=null,t.cd.markForCheck()}))()}getFlow(e){var t=this;return(0,L.Z)((function*(){return new Promise((n=>{t.customizationService.getCustomizationByFlow(e,t.flowName,t.customizationStoreService.LANG).then((e=>{n(e?.data?e.data:null)}),(e=>{n(null)}))}))}))()}showAlert(e,t){this.loading=null,this.notis.showAlert(e,t)}initWaitingForResponse(e){this.loading=e||"Validando información, espere por favor..",setTimeout((()=>{this.loading&&this.askToBack()}),1e4)}askToBack(){this.videoIDService.getSolicitudByCode(this.requestID).then((e=>{e&&e.data?(this.solicitud=e.data,this.loading=null):this.loading=null})).catch((e=>{this.loading=null}))}setRequestStatus(e){this.solicitud.status_code=e}};function Mt(e,t){if(1&e&&(Z.TgZ(0,"div",6),Z._UZ(1,"mat-progress-spinner",7),Z.TgZ(2,"p",8),Z._uU(3),Z.qZA()()),2&e){const e=Z.oxw(2);Z.xp6(1),Z.Q6J("value",e.spinnerValue)("mode",e.spinnerMode),Z.xp6(2),Z.Oqu(e.loading)}}function It(e,t){if(1&e&&(Z.TgZ(0,"div",1)(1,"div",2),Z._UZ(2,"belender-widget-step-logo",3)(3,"belender-fail-step",4),Z.YNc(4,Mt,4,3,"div",5),Z.qZA()()),2&e){const e=Z.oxw();Z.xp6(1),Z.Udp("background",e.data.styles.colors.background),Z.xp6(1),Z.Q6J("data",e.data)("customImage",null==e.data[e.flowName]||null==e.data[e.flowName].texts||null==e.data[e.flowName].texts.fail?null:e.data[e.flowName].texts.fail.customImage),Z.xp6(1),Z.Q6J("data",e.data)("texts",null==e.data[e.flowName]?null:e.data[e.flowName].texts)("solicitud",e.solicitud),Z.xp6(1),Z.Q6J("ngIf",e.loading&&!e.error)}}kt.ɵfac=function(e){return new(e||kt)(Z.Y36(Z.sBO),Z.Y36(A.gz),Z.Y36(H.F),Z.Y36(B),Z.Y36(J.r),Z.Y36(S.w),Z.Y36(k.T),Z.Y36(Q.D))},kt.ɵcmp=Z.Xpm({type:kt,selectors:[["belender-widget-videoid-success"]],inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud",flowName:"flowName"},features:[Z._Bn([{provide:P.o2,useValue:{appearance:"standard"}}])],decls:1,vars:1,consts:[["class","h-full widget-belender",4,"ngIf"],[1,"h-full","widget-belender"],[1,"h-full","w-full","flex-auto","p-0","md:p-3"],[3,"data","customImage"],[3,"data","texts","flowName"],["class","loading-wrapper animated fadeIn",4,"ngIf"],[1,"loading-wrapper","animated","fadeIn"],["color","accent","diameter","40",1,"spinner",3,"value","mode"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&Z.YNc(0,Tt,5,8,"div",0),2&e&&Z.Q6J("ngIf",t.data)},dependencies:[i.O5,y.Ou,ne.y,fe],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative}.widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"]}),kt=(0,D.gn)([(0,N.c)()],kt);let Et=class{constructor(e,t,n,i,s,r,o,a){this.cd=e,this.Activatedroute=t,this.utils=n,this.videoIDService=i,this.customizationService=s,this.customizationStoreService=r,this.notis=o,this.translationService=a,this.data=null,this.disableActions=!1,this.step="created",this.flowName="VideoID",this.labels=F.S.es,this.waitingTime=15,this.loading=null,this.error=!1,this.spinnerMode="indeterminate",this.spinnerValue=0,this.subscribed=!1,this.testMode=!1,this.cntrlIsPressed=!1,this.shiftlIsPressed=!1,this.skipCreationOfRequest=!1,this.autoAcceptTerms=!1}ngOnInit(){this.labels=this.translationService.getLabelsTranslated(localStorage.getItem("belender-language")||"es"),this.loading=this.labels.certificate.loadings.gettingRequestInfo,this.Activatedroute.params.subscribe((e=>{e&&e.idUser?(this.userId=e.idUser,this.setInitialData(this.userId)):this.loading=null,e&&e.packID&&(this.packId=e.packID)}),(e=>{this.loading=null})),this.utils.setLoading(!1)}ngOnDestroy(){}setInitialData(e){var t=this;return(0,L.Z)((function*(){const n=(0,Y.cm)(yield t.getFlow(e));if(t.data={config:t.customizationStoreService.FUNDER_CONFIG,styles:t.customizationStoreService.FUNDER_STYLES,[t.flowName]:n},(0,Y.bf)(t.data,t.flowName),!t.data.config||!t.data.config.funder_id)return t.notis.showAlert(t.labels.warnings.error,t.labels.warnings.noCustomization,"error"),t.loading=null,void t.cd.markForCheck();t.financiadorID=t.data.config.funder_id||"",t.loading=null,t.cd.markForCheck()}))()}getFlow(e){var t=this;return(0,L.Z)((function*(){return new Promise((n=>{t.customizationService.getCustomizationByFlow(e,t.flowName,t.customizationStoreService.LANG).then((e=>{n(e?.data?e.data:null)}),(e=>{n(null)}))}))}))()}showAlert(e,t){this.loading=null,this.notis.showAlert(e,t)}initWaitingForResponse(e){this.loading=e||"Validando información, espere por favor..",setTimeout((()=>{this.loading&&this.askToBack()}),1e4)}askToBack(){this.videoIDService.getSolicitudByCode(this.requestID).then((e=>{e&&e.data?(this.solicitud=e.data,this.loading=null):this.loading=null})).catch((e=>{this.loading=null}))}setRequestStatus(e){this.solicitud.status_code=e}};Et.ɵfac=function(e){return new(e||Et)(Z.Y36(Z.sBO),Z.Y36(A.gz),Z.Y36(H.F),Z.Y36(B),Z.Y36(S.w),Z.Y36(J.r),Z.Y36(k.T),Z.Y36(Q.D))},Et.ɵcmp=Z.Xpm({type:Et,selectors:[["belender-widget-videoid-fail"]],inputs:{data:"data",disableActions:"disableActions",step:"step",financiadorID:"financiadorID",solicitud:"solicitud",flowName:"flowName"},features:[Z._Bn([{provide:P.o2,useValue:{appearance:"standard"}}])],decls:1,vars:1,consts:[["class","h-full widget-belender",4,"ngIf"],[1,"h-full","widget-belender"],[1,"h-full","w-full","flex-auto","p-0","md:p-3"],[3,"data","customImage"],[3,"data","texts","solicitud"],["class","loading-wrapper animated fadeIn",4,"ngIf"],[1,"loading-wrapper","animated","fadeIn"],["color","accent","diameter","40",1,"spinner",3,"value","mode"],[1,"mt-6","text-center","text-black",2,"color","black !important"]],template:function(e,t){1&e&&Z.YNc(0,It,5,8,"div",0),2&e&&Z.Q6J("ngIf",t.data)},dependencies:[i.O5,y.Ou,ne.y,be],styles:[".widget-belender[_ngcontent-%COMP%]{position:relative}.widget-belender[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{min-height:360px}.widget-belender[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] form[_ngcontent-%COMP%]{display:flex;flex-direction:column;justify-content:space-between}.badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center;position:absolute;top:0;left:0;background:#fff}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.test-mode[_ngcontent-%COMP%]{position:fixed;top:10px;left:10px}"]}),Et=(0,D.gn)([(0,N.c)()],Et);const At=[{path:":idUser",component:St},{path:":idUser/:packID",component:St},{path:":idUser/:packID/success",component:kt},{path:":idUser/:packID/fail",component:Et}];let Ot=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=Z.oAB({type:e}),e.ɵinj=Z.cJS({imports:[A.Bz.forChild(At),A.Bz,O.d8]}),e})();var Lt=n(6981),Dt=n(3848),Pt=n(1129),Nt=n(1258),qt=n(3295),Rt=n(2266),Yt=n(3300),Ft=n(865);let Ut=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵmod=Z.oAB({type:e}),e.ɵinj=Z.cJS({providers:[_.M,v.o,S.w,w.t,k.T,E.t,$,{provide:T.Ad,useValue:"es-ES"}],imports:[Ot,i.ez,s.G,r.J,o.TU,a.p0,l.JX,c.p9,d.Ps,u.ot,h.Tx,x.c,p.u5,m.AV,p.UX,f.LD,g.vV,b.a,y.Cq,C.FA,T.XK,M.T5,I.Fk,Lt.x,Dt.Nh,Pt.n,Nt.H,qt.g,Rt.L,Yt.C,Ft.q]}),e})()},5469:(e,t,n)=>{n.d(t,{B:()=>w});var i=n(5861),s=n(7582),r=n(9933),o=n(8259),a=n(6305),l=n(4650),c=n(8467),d=n(7367),u=n(8460),h=n(8594),p=n(9045),m=n(5601),f=n(6895),g=n(2237),_=n(9199);const b=["widgetCard"];function v(e,t){1&e&&(l.ynx(0),l._UZ(1,"router-outlet"),l.BQk())}const y=function(e){return{"margin-top":e}};let w=class{constructor(e,t,n,i,s,r){this.utils=e,this.customizationService=t,this.customizationStoreService=n,this.router=i,this.deviceInfoService=s,this.solicitudesService=r,this.type="",this.widgetHeight=0,this.warningsSpace=0,this.isScaled=!1,this.funderConfigLoaded=!1,this.funderStylesLoaded=!1,this.lang="es",this.widgetFlowApiName="SMS",this.flowCustomizationFallback=null}ngOnInit(){this.getWindowsScreenOrientation(),this.utils.getWarningsSpaces().subscribe((e=>{this.warningsSpace=e}));const e=this.router.parseUrl(this.router.url),t=e.root.children.primary?.segments.map((e=>e.path))??[];this.userId=t[2]??"",this.packId=t[3]??"",this.widgetFlowApiName=(0,a.G4)(t[1]),this.userId&&(this.customizationStoreService.setUserID(this.userId),this.setCustomization()),this.packId&&this.customizationStoreService.setPackID(this.packId);const n=e.queryParams.lang;n&&(this.lang=n,this.customizationStoreService.setLang(n))}ngDoCheck(){this.getWidgetCardHeight()}ngOnDestroy(){window.screen&&window.screen.orientation&&this.orientationChangeHandler&&window.screen.orientation.removeEventListener("change",this.orientationChangeHandler)}ngAfterViewInit(){o("body").css("background","transparent"),o("body").css("background-color","transparent")}getWindowsScreenOrientation(){window.addEventListener("resize",(()=>{this.widgetHeight=this.widgetCard.nativeElement.offsetHeight,this.isScaled&&(this.widgetHeight=1.5*this.widgetHeight),this.sendMessageToParent({type:"widgetHeight",data:this.widgetHeight})})),window.screen&&window.screen.orientation?(this.orientationChangeHandler=()=>{this.getWidgetCardHeight()},window.screen.orientation.addEventListener("change",this.orientationChangeHandler)):console.warn("Screen Orientation API not supported.")}getWidgetCardHeight(){this.widgetCard&&this.widgetHeight!=this.widgetCard.nativeElement.offsetHeight&&(this.widgetHeight=this.widgetCard.nativeElement.offsetHeight,this.isScaled$=this.deviceInfoService.isScaled$.subscribe((e=>{this.isScaled=e,this.isScaled&&(this.widgetHeight=1.5*this.widgetHeight)})),this.sendMessageToParent({type:"widgetHeight",data:this.widgetHeight}))}sendMessageToParent(e){console.log("Message to parent:",e),window.top.postMessage(e,"*")}loadFlowCustomizationOnce(){return this.flowCustomizationFallback||(this.flowCustomizationFallback=this.customizationService.getCustomizationByFlow(this.userId,this.widgetFlowApiName,this.customizationStoreService.LANG,void 0,"").catch((e=>(console.log("🚀 ~ WidgetComponent ~ fallback flow",this.widgetFlowApiName,e),null)))),this.flowCustomizationFallback}setCustomization(){var e,t=this;this.flowCustomizationFallback=null,this.customizationService.getFunderConfig(this.userId).then((e=>{this.customizationStoreService.setFunderConfig((0,a.PX)(e?.data??e,this.userId)),this.funderConfigLoaded=!0})).catch((e=(0,i.Z)((function*(e){console.log("🚀 ~ WidgetComponent ~ getFunderConfig ~ intentando datos del flujo:",e);const n=yield t.loadFlowCustomizationOnce(),{config:i}=(0,a.Y1)(n);t.customizationStoreService.setFunderConfig((0,a.PX)(i,t.userId)),t.funderConfigLoaded=!0})),function(t){return e.apply(this,arguments)})),this.customizationService.getFunderStyles(this.userId).then((e=>{this.customizationStoreService.setFunderStyles((0,a.mO)(e?.data??e)),this.funderStylesLoaded=!0})).catch(function(){var e=(0,i.Z)((function*(e){console.log("🚀 ~ WidgetComponent ~ getFunderStyles ~ intentando datos del flujo:",e);const n=yield t.loadFlowCustomizationOnce(),{styles:i}=(0,a.Y1)(n);t.customizationStoreService.setFunderStyles((0,a.mO)(i)),t.funderStylesLoaded=!0}));return function(t){return e.apply(this,arguments)}}())}};w.ɵfac=function(e){return new(e||w)(l.Y36(c.F),l.Y36(d.w),l.Y36(u.r),l.Y36(h.F0),l.Y36(p.H),l.Y36(m.M))},w.ɵcmp=l.Xpm({type:w,selectors:[["belender-widget"]],viewQuery:function(e,t){if(1&e&&l.Gf(b,5),2&e){let e;l.iGM(e=l.CRH())&&(t.widgetCard=e.first)}},inputs:{type:"type"},decls:4,vars:4,consts:[[1,"belender-page-layout","h-auto","p-0","md:p-4","overflow-y-visible",3,"ngStyle"],[1,"h-auto","overflow-y-visible","content-layout","overflow-x-hidden","content-widget","p-0","md:p-3"],["widgetCard",""],[4,"ngIf"]],template:function(e,t){1&e&&(l.TgZ(0,"vex-page-layout",0)(1,"vex-page-layout-content",1,2),l.YNc(3,v,2,0,"ng-container",3),l.qZA()()),2&e&&(l.Q6J("ngStyle",l.VKq(2,y,t.warningsSpace+"px")),l.xp6(3),l.Q6J("ngIf",t.funderConfigLoaded&&t.funderStylesLoaded))},dependencies:[f.O5,f.PC,h.lC,g.w,_.d],styles:[".badge-table[_ngcontent-%COMP%]{max-width:140px!important;border-radius:5px!important;-webkit-border-radius:5px!important;-moz-border-radius:5px!important;-ms-border-radius:5px!important;-o-border-radius:5px!important}.btn-refresh[_ngcontent-%COMP%]{transform:translateY(2px)}.request-data-info[_ngcontent-%COMP%]{transition:all .5s ease!important}.card[_ngcontent-%COMP%]{margin:0 auto;max-width:440px}.img-card[_ngcontent-%COMP%]{max-width:240px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.loading-wrapper[_ngcontent-%COMP%]{width:100%;height:100%;min-height:260px;display:flex;flex-direction:column;align-items:center;justify-content:center}.mat-flat-button.mat-primary.mat-button-disabled[_ngcontent-%COMP%]{background:red!important}button.mat-flat-button.text-green-500.bg-green-light.mat-button-disabled[_ngcontent-%COMP%]{background:orange!important}.content-layout[_ngcontent-%COMP%]{max-height:none;max-height:initial;overflow-y:auto;padding:0!important}.belender-page-layout[_ngcontent-%COMP%]{padding:0!important}"]}),w=(0,s.gn)([(0,r.c)()],w)},2932:(e,t,n)=>{function i(e={}){return t=>{const n=t.value;if(!n)return null;const i=n.match(/^(\d{2})\/(\d{2})\/(\d{4})$/);if(e.checkFormat&&!i)return{invalidFormat:!0};if(!i)return null;const s=parseInt(i[1],10),r=parseInt(i[2],10)-1,o=parseInt(i[3],10),a=new Date(o,r,s);if(e.checkDate&&(a.getFullYear()!==o||a.getMonth()!==r||a.getDate()!==s))return{invalidDate:!0};if(e.checkAge){const e=new Date;let t=e.getFullYear()-o;const n=e.getMonth()-r;if((n<0||0===n&&e.getDate()<s)&&t--,t<18)return{underAge:!0}}return null}}n.d(t,{s:()=>i})},769:(e,t,n)=>{function i(e,t){e.submitAttempted=!0,e.form?.markAllAsTouched(),t?.markForCheck()}n.d(t,{J:()=>i})},9382:(e,t,n)=>{n.d(t,{i:()=>p});var i=n(4650),s=n(8135),r=n(5601),o=n(5895),a=n(6895),l=n(3731);function c(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"div",4),i.NdJ("click",(function(){i.CHM(e);const t=i.oxw(2);return i.KtG(t.goToCancelRequest())})),i.ALo(1,"safeHtml"),i.qZA()}if(2&e){const e=i.oxw(2);i.Udp("color",e.textColor),i.Q6J("innerHTML",i.lcZ(1,3,e.customText),i.oJD)}}function d(e,t){if(1&e&&(i.TgZ(0,"div",5),i._uU(1),i.qZA()),2&e){const e=i.oxw(2);i.xp6(1),i.hij(" ",e.labels.loadings.cancelingRequest,"\n")}}const u=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};function h(e,t){if(1&e&&(i.TgZ(0,"div",1),i.YNc(1,c,2,5,"div",2),i.YNc(2,d,2,1,"div",3),i.qZA()),2&e){const e=i.oxw();i.Q6J("ngClass",i.kEZ(3,u,"left"===e.data.styles.alignButtons,"center"===e.data.styles.alignButtons,"right"===e.data.styles.alignButtons||!e.data.styles.alignButtons)),i.xp6(1),i.Q6J("ngIf",!e.loading),i.xp6(1),i.Q6J("ngIf",e.loading)}}let p=(()=>{class e{constructor(e,t,n){this.smsComponent=e,this.solicitudesService=t,this.notis=n,this.customText="",this.textColor="",this.flowType="SMS",this.updateStatusCode=new i.vpe,this.requestType="sms",this.loading=!1}goToCancelRequest(){this.loading=!0;const e={request_id:this.request_id,user_id:this.user_id};this.requestType="ClavePin"===this.flowType?"clave-pin":"sms",this.solicitudesService.cancelRequest(e,this.requestType).then((e=>{e&&e.data&&("SMS"===this.flowType?this.setSmsCancel("consent_process_canceled"):this.updateStatusCode.emit("consent_process_canceled")),e.message&&this.showAlert(e.status?this.capitalizeFirstLetter(e.status)+"!":"Aviso!",e.message),setTimeout((()=>{this.loading=!1}),1e3)})).catch((e=>{this.loading=!1,this.showAlert("Error!",e.message||e)}))}capitalizeFirstLetter(e){return"string"!=typeof e||0===e.length?e:e.charAt(0).toUpperCase()+e.slice(1)}showAlert(e,t){this.notis.showAlert(e,t)}setSmsCancel(e){this.smsComponent.setRequestStatus(e),this.smsComponent.setStatus()}}return e.ɵfac=function(t){return new(t||e)(i.Y36(s.T,9),i.Y36(r.M),i.Y36(o.T))},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-cancel-request"]],inputs:{data:"data",customText:"customText",textColor:"textColor",flowType:"flowType",request_id:"request_id",user_id:"user_id",labels:"labels"},outputs:{updateStatusCode:"updateStatusCode"},decls:1,vars:1,consts:[["class","flex",3,"ngClass",4,"ngIf"],[1,"flex",3,"ngClass"],["class","subheading-1 px-2 text-right underline cursor-pointer custom-html",3,"color","innerHTML","click",4,"ngIf"],["class","subheading-1 px-2 text-right text-orange-500 custom-html",4,"ngIf"],[1,"subheading-1","px-2","text-right","underline","cursor-pointer","custom-html",3,"innerHTML","click"],[1,"subheading-1","px-2","text-right","text-orange-500","custom-html"]],template:function(e,t){1&e&&i.YNc(0,h,3,7,"div",0),2&e&&i.Q6J("ngIf",t.data&&t.data.styles)},dependencies:[a.mk,a.O5,l.z]}),e})()},9112:(e,t,n)=>{n.d(t,{y:()=>N});var i=n(5861),s=n(4650),r=n(4006),o=n(8259),a=n(2440),l=n(5762),c=n(2340),d=n(8135),u=n(8467),h=n(2254),p=n(5601),m=n(8460),f=n(1742),g=n(6895),_=n(9101),b=n(8429),v=n(3731);function y(e,t){if(1&e&&s._UZ(0,"div",13),2&e){const e=s.oxw();s.Udp("color",null==e.data.styles?null:e.data.styles.colors.title)("font-size",e.texts.form.titleSize+"px"),s.Q6J("innerHTML",e.texts[e.otpType].title,s.oJD)}}function w(e,t){if(1&e&&(s._UZ(0,"div",14),s.ALo(1,"safeHtml")),2&e){const e=s.oxw();s.Udp("color",null==e.data.styles?null:e.data.styles.colors.text),s.Q6J("innerHTML",s.lcZ(1,3,null==e.texts[e.otpType]?null:e.texts[e.otpType].description),s.oJD)}}function x(e,t){if(1&e&&(s.ynx(0),s._uU(1),s.BQk()),2&e){const e=s.oxw(2);s.xp6(1),s.hij(" ",e.labels?e.labels.otp.requestingOtp:"Estamos solicitando el código. Por favor, espere un momento."," ")}}function S(e,t){if(1&e&&(s.ynx(0),s._uU(1),s.BQk()),2&e){const e=s.oxw(2);s.xp6(1),s.AsE(" ",e.labels?e.labels.otp.otpSentToNumber:"El código ha sido enviado al teléfono acabado en"," ",e.lastThreeNumbersPhone,". ")}}function C(e,t){if(1&e&&(s.ynx(0),s._uU(1),s.BQk()),2&e){const e=s.oxw(2);s.xp6(1),s.hij(" ",e.labels?e.labels.otp.requestingCode:"Estamos solicitando el código. Por favor, espere un momento."," ")}}const T=function(e,t,n){return{color:e,border:t,background:n}};function k(e,t){if(1&e&&(s.ynx(0),s.TgZ(1,"small",15),s.YNc(2,x,2,1,"ng-container",6),s.YNc(3,S,2,2,"ng-container",6),s.YNc(4,C,2,1,"ng-container",6),s.qZA(),s.BQk()),2&e){const e=s.oxw();s.xp6(1),s.Q6J("ngStyle",s.kEZ(4,T,null==e.data.styles?null:e.data.styles.colors.accentColor,"1px solid "+(null==e.data.styles?null:e.data.styles.colors.accentColor),null==e.data.styles?null:e.data.styles.colors.accentBgColor)),s.xp6(1),s.Q6J("ngIf",!e.lastThreeNumbersPhone),s.xp6(1),s.Q6J("ngIf",e.lastThreeNumbersPhone&&!(null!=e.data.config&&e.data.config.noRetryInBadPhone)),s.xp6(1),s.Q6J("ngIf",e.lastThreeNumbersPhone&&(null==e.data.config?null:e.data.config.noRetryInBadPhone))}}function M(e,t){if(1&e&&(s.TgZ(0,"span"),s._uU(1),s.qZA()),2&e){const e=s.oxw(2);s.xp6(1),s.hij(" ",e.labels?e.labels.otp.noReceivedCode:"¿No has recibido el código en tu teléfono?"," ")}}function I(e,t){if(1&e&&(s.TgZ(0,"span"),s._uU(1),s.qZA()),2&e){const e=s.oxw(2);s.xp6(1),s.AsE("",e.labels?e.labels.otp.noReceivedCode2:"¿No has recibido el código en el teléfono acabado en"," ",e.lastThreeNumbersPhone,"? ")}}function E(e,t){if(1&e&&(s.TgZ(0,"span"),s._uU(1),s.qZA()),2&e){const e=s.oxw(2);s.xp6(1),s.hij(" ",e.labels?e.labels.otp.noReceivedCode:"¿No has recibido el código en tu teléfono?"," ")}}const A=function(e,t){return{color:e,background:t}};function O(e,t){if(1&e){const e=s.EpF();s.TgZ(0,"a",18),s.NdJ("click",(function(){s.CHM(e);const t=s.oxw(2);return s.KtG(t.resendOTP())})),s._uU(1),s.qZA()}if(2&e){const e=s.oxw(2);s.Q6J("ngStyle",s.WLB(2,A,null==e.data.styles?null:e.data.styles.colors.dangerTextButtonColor,null==e.data.styles?null:e.data.styles.colors.dangerColor)),s.xp6(1),s.hij(" ",e.labels?e.labels.actions.resend:"Reenviar"," ")}}function L(e,t){if(1&e&&(s.ynx(0),s.TgZ(1,"small",16),s.YNc(2,M,2,1,"span",6),s.YNc(3,I,2,2,"span",6),s.YNc(4,E,2,1,"span",6),s.YNc(5,O,2,5,"a",17),s.qZA(),s.BQk()),2&e){const e=s.oxw();s.xp6(1),s.Q6J("ngStyle",s.kEZ(5,T,null==e.data.styles?null:e.data.styles.colors.dangerColor,"1px solid "+(null==e.data.styles?null:e.data.styles.colors.dangerColor),null==e.data.styles?null:e.data.styles.colors.dangerBgColor)),s.xp6(1),s.Q6J("ngIf",!e.lastThreeNumbersPhone),s.xp6(1),s.Q6J("ngIf",e.lastThreeNumbersPhone&&!(null!=e.data.config&&e.data.config.noRetryInBadPhone)),s.xp6(1),s.Q6J("ngIf",null==e.data.config?null:e.data.config.noRetryInBadPhone),s.xp6(1),s.Q6J("ngIf",!e.secondTry)}}const D=function(e,t){return{length:e,allowNumbersOnly:t}},P=function(e,t,n){return{"justify-start":e,"justify-center":t,"justify-end":n}};let N=(()=>{class e{constructor(e,t,n,i,r,o,a,l){this.smsComponent=e,this.fb=t,this.utils=n,this.smsFlowService=i,this.solicitudesService=r,this.cd=o,this.customizationStoreService=a,this.pinUtils=l,this.minLength=3,this.logoCustom="",this.next=new s.vpe(null),this.errPhone=new s.vpe(null),this.resendO=new s.vpe(null),this.secsCount=60,this.secondTry=!1,this.timerIsRunning=!1,this.env=c.N.env,this.limitSecsCount=60}ngOnInit(){this.packId=this.customizationStoreService.PACK_ID,this.userId=this.customizationStoreService.USER_ID,this.resolveLabels(),this.form=this.fb.group({code1:[null,[r.kI.required,r.kI.maxLength(6),r.kI.minLength(this.minLength)]]}),this.subsPhone=this.pinUtils.lastThreeNumbersPhone$.subscribe((e=>{this.lastThreeNumbersPhone=e})),this.subsPhone=this.pinUtils.lastThreeNumbersPhone$.subscribe((e=>{this.lastThreeNumbersPhone=e})),"SMS"==this.flowType&&this.solicitud&&this.solicitud.person_phone&&this.setPhone(this.solicitud.person_phone)}ngOnDestroy(){this.subsPhone&&this.subsPhone.unsubscribe()}resetOtpNumber(){this.form.get("code1").setValue(""),this.ngOtpInput.setValue("")}ngOnChanges(e){e.otpType&&!e.otpType.previousValue&&(this.limitSecsCount="otpAEAT"==e.otpType?.currentValue||"otpIRS"==e.otpType?.currentValue?300:60,this.initSecsInterval())}setPhone(e){let t="XXX";e&&(t=(""+e).slice(-3)),this.lastThreeNumbersPhone=t}resolveLabels(){this.labels||(this.labels=this.pinUtils.labels)}initSecsInterval(){this.timerIsRunning||(this.secsCount=+this.limitSecsCount,this.interv=setInterval((()=>{this.timerIsRunning=!0,this.secsCount=this.secsCount-1,this.secsRemaining=this.getRemaining(),this.secsCount<=0&&this.finishSecsInterval()}),1e3))}getRemaining(){let e=Math.floor(this.secsCount/60),t=this.secsCount%60;return this.addZero(e)+":"+this.addZero(t)}addZero(e){return e>=10?e:"0"+e}finishSecsInterval(){this.timerIsRunning=!1,this.interv&&clearInterval(this.interv)}getCode(){return this.form.get("code1").value}capturePasteEvent(e){var t=this;return(0,i.Z)((function*(){t.form.get("code1").setValue(e)}))()}setInputEvent(e){""!=e.target.value?o(e.target).next().focus():"Backspace"==e.code&&o(e.target).prev().focus()}nextStep(){let e={code:this.getCode()};"SMS"===this.flowType?this.requestSmsOTP(e):this.next.emit(e)}resendOTP(){this.secondTry=!0,this.initSecsInterval(),"SMS"===this.flowType?this.resendSmsOTP(!0):this.resendO.emit(!0)}requestSmsOTP(e){this.smsFlowService.setLoading(this.labels.loadings.sendingData),this.smsComponent.showAlert(null),this.testMode?setTimeout((()=>{this.smsFlowService.setRequest(new l.l),this.smsComponent.setRequestStatus("all_documents_downloaded"),this.smsComponent.setStatus(),this.smsFlowService.setLoading(!1)}),2e3):this.solicitudesService.sendOTP({request_id:this.requestID,user_id:this.userId,code:e.code}).then((e=>{e.status&&"error"==e.status?(this.smsComponent.showAlert(this.labels.warnings.error,e.message&&"Invalid request status: waiting_login_seguridad_social"==e.message?this.labels.warnings.unknownError:e.message?e.message.code?this.labels.warnings.wrongOtp:e.message.request_id?this.labels.warnings.noRequests:this.labels.warnings.unknownError:this.labels.warnings.unknownError),this.smsFlowService.setLoading(!1)):e&&"success"==e.status&&(this.smsComponent.handleRequestStatus(e.data||e),this.cd.markForCheck())})).catch((e=>{this.smsComponent.showAlert(this.labels.warnings.error,e?.error||e?.message||e||this.labels.warnings.unknownError),this.smsFlowService.setLoading(!1)})),this.resetOtpNumber()}resendSmsOTP(e){let t={request_id:(this.smsFlowService.REQUEST&&this.smsFlowService.REQUEST.request_id?this.smsFlowService.REQUEST.request_id:this.requestID)||e,user_id:this.userId};this.smsComponent.showAlert(null),this.smsFlowService.setLoading(this.labels.loadings.resendingOtp),this.smsFlowService.setSubscriptionOfRequest(),this.solicitudesService.resendOTP(t).then((e=>{e&&e.data&&(this.smsFlowService.setRequest(e.data),this.smsComponent.setStatus()),this.smsFlowService.setLoading(!1)})).catch((e=>{console.error(e),this.smsComponent.showAlert(this.labels.warnings.error,e?.error||e?.message||e||this.labels.warnings.unknownError),this.smsFlowService.setLoading(!1)})),this.resetOtpNumber()}}return e.ɵfac=function(t){return new(t||e)(s.Y36(d.T,9),s.Y36(r.QS),s.Y36(u.F),s.Y36(h.p),s.Y36(p.M),s.Y36(s.sBO),s.Y36(m.r),s.Y36(f._))},e.ɵcmp=s.Xpm({type:e,selectors:[["belender-shared-otp-step"]],viewQuery:function(e,t){if(1&e&&s.Gf(a.df,5),2&e){let e;s.iGM(e=s.CRH())&&(t.ngOtpInput=e.first)}},inputs:{data:"data",texts:"texts",lastThreeNumbersPhone:"lastThreeNumbersPhone",otpType:"otpType",minLength:"minLength",flowType:"flowType",logoCustom:"logoCustom",labels:"labels",requestID:"requestID",testMode:"testMode",solicitud:"solicitud"},outputs:{next:"nextStep",errPhone:"errorPhone",resendO:"resendOTP"},features:[s.TTD],decls:16,vars:27,consts:[[3,"data","customImage"],[1,"animated","fadeIn","fixed-content","px-2",3,"formGroup"],[1,"py-1","flex","flex-col"],["id","otpTitle","class","title m-0",3,"color","font-size","innerHTML",4,"ngIf"],["id","otpDescription","class","subheading-1 pt-4",3,"color","innerHTML",4,"ngIf"],[1,"title","py-2"],[4,"ngIf"],[1,"flex","w-full","flex-col","gap-2","py-2"],[1,"subheading-1","py-1","custom-html"],[3,"config","onInputChange"],["ngOtpInput",""],[1,"flex","items-center","gap-2","py-4","flex-col","md:flex-row",3,"ngClass"],["id","next-button","mat-flat-button","","type","button",1,"px-8","w-full","max-w-none","md:max-w-[220px]",3,"disabled","click"],["id","otpTitle",1,"title","m-0",3,"innerHTML"],["id","otpDescription",1,"subheading-1","pt-4",3,"innerHTML"],["id","secsCountContainer",1,"info-time","w-full",3,"ngStyle"],[1,"info-time","w-full",3,"ngStyle"],["id","resendOTPButton","class","ml-4",3,"ngStyle","click",4,"ngIf"],["id","resendOTPButton",1,"ml-4",3,"ngStyle","click"]],template:function(e,t){1&e&&(s._UZ(0,"belender-widget-step-logo",0),s.TgZ(1,"form",1)(2,"div",2),s.YNc(3,y,1,5,"div",3),s.YNc(4,w,2,5,"div",4),s.TgZ(5,"div",5),s.YNc(6,k,5,8,"ng-container",6),s.YNc(7,L,6,9,"ng-container",6),s.qZA(),s.TgZ(8,"div",7)(9,"p",8),s._uU(10),s.qZA(),s.TgZ(11,"ng-otp-input",9,10),s.NdJ("onInputChange",(function(e){return t.capturePasteEvent(e)})),s.qZA()()(),s.TgZ(13,"div",11)(14,"button",12),s.NdJ("click",(function(){return t.nextStep()})),s._uU(15),s.qZA()()()),2&e&&(s.Q6J("data",t.data)("customImage",t.logoCustom),s.xp6(1),s.Q6J("formGroup",t.form),s.xp6(2),s.Q6J("ngIf",t.texts&&(null==t.texts[t.otpType]?null:t.texts[t.otpType].title)&&""!=(null==t.texts[t.otpType]?null:t.texts[t.otpType].title)),s.xp6(1),s.Q6J("ngIf",t.texts&&(null==t.texts[t.otpType]?null:t.texts[t.otpType].description)&&""!=(null==t.texts[t.otpType]?null:t.texts[t.otpType].description)),s.xp6(2),s.Q6J("ngIf",t.secsCount&&t.secsCount>0),s.xp6(1),s.Q6J("ngIf",!t.secsCount||t.secsCount<=0),s.xp6(2),s.Udp("color",t.data.styles.colors.text),s.xp6(1),s.hij(" ",t.labels?t.labels.otp.otpCode:"Código OTP (recibido por SMS)"," "),s.xp6(1),s.Q6J("config",s.WLB(20,D,t.minLength,"qa"!=t.env&&"dev"!=t.env)),s.xp6(2),s.Q6J("ngClass",s.kEZ(23,P,"left"===t.data.styles.alignButtons,"center"===t.data.styles.alignButtons,"right"===t.data.styles.alignButtons||!t.data.styles.alignButtons)),s.xp6(1),s.Udp("color",null==t.data.styles?null:t.data.styles.colors.btnText)("background",t.form.invalid?"":null==t.data.styles?null:t.data.styles.colors.btnBg)("border-radius",(null==t.data.styles?null:t.data.styles.btnRound)+"px"),s.Q6J("disabled",t.form.invalid),s.xp6(1),s.hij(" ",t.labels?t.labels.actions.next:"Siguiente"," "))},dependencies:[g.mk,g.O5,g.PC,_.lW,r._Y,r.JL,r.sg,a.df,b.y,v.z],styles:[".members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{border:2px solid var(--background-foreground);box-sizing:border-box;height:36px;margin-right:-8px;margin-top:var(--padding-4);width:36px}.members[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]:last-child{margin-right:0}.type-badge[_ngcontent-%COMP%]{border-radius:5px;min-width:64px}.labels[_ngcontent-%COMP%] .label[_ngcontent-%COMP%]{border-radius:var(--border-radius);font:var(--font-caption);height:32px;line-height:32px;margin-top:var(--padding-4);min-width:100px;padding-left:var(--padding-8);padding-right:var(--padding-8);-webkit-user-select:none;-moz-user-select:none;user-select:none;text-align:center}.content[_ngcontent-%COMP%]{max-height:40vh}.status-section-wrapper[_ngcontent-%COMP%]{box-shadow:none;transition:all .3s ease;overflow:hidden;height:0;display:flex;align-items:center;padding:0}.status-section-wrapper.showing-status[_ngcontent-%COMP%]{padding:1.7rem .5rem 1.7rem 1.5rem;margin-top:0;height:40px;box-shadow:0 4px 6px #0000001a}@media (min-width: 600px){.content[_ngcontent-%COMP%]{max-height:50vh}}.rotate-180[_ngcontent-%COMP%]{transform:rotate(180deg)}.scrum-content[_ngcontent-%COMP%]{height:auto;max-height:1000px;transition:all .3s ease;overflow:hidden!important}.scrum-content.hide-content[_ngcontent-%COMP%]{max-height:0px;transition:all .3s ease}.label-status[_ngcontent-%COMP%]{border-radius:7px}.title[_ngcontent-%COMP%]{font-size:16px}.subheading-1[_ngcontent-%COMP%]{font-size:12px}.code-wrapper[_ngcontent-%COMP%]{padding:5px;height:50px}.code-wrapper[_ngcontent-%COMP%] input[_ngcontent-%COMP%]{height:40px;min-width:136px;border-radius:6px;border:1px solid rgba(0,0,0,.1);text-transform:uppercase;text-align:left;font-weight:700;transition:all .3s ease;outline:1px solid transparent;letter-spacing:12px;padding:0 18px}.code-wrapper[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:hover{background:#fcfcfc;border:1px solid rgba(0,0,0,.2);transition:all .3s ease}.code-wrapper[_ngcontent-%COMP%] input[_ngcontent-%COMP%]:focus{outline:1px solid #4e98d0;border:1px solid #4e98d0}.info-time[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:center;padding:7px 10px;min-height:40px;font-size:14px;line-height:14px;border-radius:5px;border-width:1px;border-style:solid;margin:10px 0}.info-time[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{font-size:14px;line-height:24px;padding:0 10px;border-radius:5px;cursor:pointer;transition:all .2s ease}@media (max-width: 576px){.info-time[_ngcontent-%COMP%] a[_ngcontent-%COMP%]{padding:0 20px}}"]}),e})()},5696:(e,t,n)=>{n.d(t,{T:()=>p});var i=n(4650),s=n(7403),r=n(6390),o=n(5412),a=n(7308),l=n(6895);function c(e,t){if(1&e){const e=i.EpF();i.ynx(0),i._uU(1),i.TgZ(2,"a",1),i.NdJ("click",(function(t){i.CHM(e);const n=i.oxw();return i.KtG(n.gotoTermsAndConditions(t))})),i.TgZ(3,"u"),i._uU(4),i.qZA()(),i._uU(5),i.BQk()}if(2&e){const e=i.oxw();i.xp6(1),i.hij(" ",e.parts.p1," "),i.xp6(3),i.Oqu(e.parts.a1),i.xp6(1),i.hij(" ",e.parts.p2,"\n")}}function d(e,t){if(1&e&&(i.ynx(0),i._uU(1),i.BQk()),2&e){const e=i.oxw();i.xp6(1),i.hij(" ",e.policyLeadText,"\n")}}function u(e,t){if(1&e&&(i.TgZ(0,"span"),i._uU(1),i.qZA()),2&e){const e=i.oxw(2);i.xp6(1),i.hij(" ",e.parts.p3," ")}}function h(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"span"),i.YNc(1,u,2,1,"span",0),i.TgZ(2,"a",1),i.NdJ("click",(function(t){i.CHM(e);const n=i.oxw();return i.KtG(n.gotoLegalDocument(t))})),i.TgZ(3,"u"),i._uU(4),i.qZA()()()}if(2&e){const e=i.oxw();i.xp6(1),i.Q6J("ngIf",!e.isPolicyOnly),i.xp6(3),i.Oqu(e.parts.a2)}}let p=(()=>{class e{constructor(e,t){this.dialog=e,this.translationService=t,this.linkType="both",this.goToTerms=new i.vpe(null),this.customTerms=!1,this.lang="",this.parts={p1:"He leído y acepto los",p2:"del servicio",p3:"y la",a1:"términos y condiciones",a2:"política de privacidad"},this.translatedParts={es:{p1:"He leído y acepto los",p2:"del servicio",p3:"y la",a1:"términos y condiciones",a2:"política de privacidad"},ca:{p1:"He llegit i accepto els",p2:"del servei",p3:"i la",a1:"termes i condicions",a2:"política de privacitat"},en:{p1:"I have read and accept the",p2:"of the service",p3:"and the",a1:"terms and conditions",a2:"privacy policy"},fr:{p1:"J'ai lu et j'accepte les",p2:"du service",p3:"et la",a1:"conditions générales",a2:"polítique de confidentialité"},it:{p1:"Ho letto e accetto i",p2:"del servizio",p3:"e la",a1:"termini e condizioni",a2:"informativa sulla privacy"},pt:{p1:"Li e aceito os",p2:"do serviço",p3:"e a",a1:"termos e condições",a2:"política de privacidade"},de:{p1:"Ich habe die",p2:"des Dienstes gelesen und akzeptiere sie",p3:"sowie die",a1:"Nutzungsbedingungen",a2:"Datenschutzrichtlinie"}},this.policyLeadByLang={es:"He leído y acepto la",ca:"He llegit i accepto la",en:"I have read and accept the",fr:"J'ai lu et j'accepte la",it:"Ho letto e accetto la",pt:"Li e aceito a",de:"Ich habe die"}}translatedBlock(e){return this.translatedParts[e]??null}resolveLang(){return(0,r.ie)(this.lang?this.lang:localStorage.getItem("belender-language"))}isSpanishDefaultText(t,n){if(!t)return!0;const i=[e.defaultPartsEs[n],"a1"===n||"a2"===n?e.defaultLinkLabelsEs[n]:null,this.translatedParts.es[n]].filter(Boolean),s=t.toLowerCase();return i.some((e=>t===e||s===e.toLowerCase()))}ngOnInit(){this.rebuildParts()}ngOnChanges(e){(e.firstSentence||e.secondSentence||e.thirdSentence||e.termsActionText||e.policyActionText||e.lang)&&this.rebuildParts()}rebuildParts(){const e=this.resolveLang();this.parts={p1:this.getPart(this.firstSentence,"p1",e),p2:this.getPart(this.secondSentence,"p2",e),p3:this.getPart(this.thirdSentence,"p3",e),a1:this.getPart(this.termsActionText,"a1",e),a2:this.getPart(this.policyActionText,"a2",e)}}getPart(t,n,i){const s=i||this.resolveLang(),r=this.translatedBlock(s),o=t?.trim()??"";return"es"!==s&&r?.[n]&&this.isSpanishDefaultText(o,n)?r[n]:o||(r?.[n]?r[n]:e.defaultPartsEs[n]||"")}gotoTermsAndConditions(e){e.preventDefault(),e.stopPropagation(),this.goToTerms.emit(e)}gotoLegalDocument(e){e.preventDefault(),e.stopPropagation(),this.dialog.open(s.N,{panelClass:"fullscreen-dialog",data:{lang:this.resolveLang(),allData:this.data,flow:this.flowName}})}get isTermsOnly(){return"terms"===this.linkType}get isPolicyOnly(){return"policy"===this.linkType}get policyLeadText(){const e=this.firstSentence?.trim()??"",t=this.resolveLang();if(e){const n=this.policyLeadByLang.es;return"es"===t||e!==n&&e.toLowerCase()!==n.toLowerCase()?this.firstSentence:this.policyLeadByLang[t]||n}return this.policyLeadByLang[t]||this.policyLeadByLang.es}}return e.defaultLinkLabelsEs={a1:"Términos y condiciones",a2:"Política de privacidad"},e.defaultPartsEs={p1:"He leído y acepto los",p2:"del servicio",p3:"y la",a1:"términos y condiciones",a2:"política de privacidad"},e.ɵfac=function(t){return new(t||e)(i.Y36(o.uw),i.Y36(a.D))},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-terms-and-policy-links"]],inputs:{userId:"userId",linkType:"linkType",firstSentence:"firstSentence",secondSentence:"secondSentence",thirdSentence:"thirdSentence",policyActionText:"policyActionText",termsActionText:"termsActionText",customTerms:"customTerms",lang:"lang",data:"data",flowName:"flowName"},outputs:{goToTerms:"goToTerms"},features:[i.TTD],decls:3,vars:3,consts:[[4,"ngIf"],["target","_blank",1,"text-sm","hover:text-blue-500",3,"click"]],template:function(e,t){1&e&&(i.YNc(0,c,6,3,"ng-container",0),i.YNc(1,d,2,1,"ng-container",0),i.YNc(2,h,5,2,"span",0)),2&e&&(i.Q6J("ngIf",!t.isPolicyOnly),i.xp6(1),i.Q6J("ngIf",t.isPolicyOnly),i.xp6(1),i.Q6J("ngIf",!t.isTermsOnly))},dependencies:[l.O5]}),e})()},8429:(e,t,n)=>{n.d(t,{y:()=>c});var i=n(4650),s=n(6895);function r(e,t){1&e&&i._UZ(0,"div",5)}const o=function(e){return{display:e}};function a(e,t){if(1&e){const e=i.EpF();i.TgZ(0,"div",1),i.YNc(1,r,1,0,"div",2),i.TgZ(2,"img",3,4),i.NdJ("load",(function(){i.CHM(e);const t=i.oxw();return i.KtG(t.logoUrlIsLoaded=!0)})),i.qZA()()}if(2&e){const e=i.oxw();i.xp6(1),i.Q6J("ngIf",!e.logoUrlIsLoaded),i.xp6(1),i.Q6J("src",e.firstOption||e.logoUrl,i.LSH)("ngStyle",i.VKq(3,o,e.logoUrlIsLoaded?"block":"none"))}}let l=(()=>{class e{constructor(){this.logoUrl="",this.firstOption=this.logoUrl,this.withLogo=!1,this.logoUrlIsLoaded=!1}ngOnInit(){}get shouldShow(){return!!this.withLogo||!!this.firstOption}}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-widget-logo"]],inputs:{logoUrl:"logoUrl",firstOption:"firstOption",withLogo:"withLogo"},decls:1,vars:1,consts:[["class","img-wrapper p-4 flex justify-center items-center",4,"ngIf"],[1,"img-wrapper","p-4","flex","justify-center","items-center"],["class","animated-bg h-full w-full",4,"ngIf"],[1,"img-card",3,"src","ngStyle","load"],["img",""],[1,"animated-bg","h-full","w-full"]],template:function(e,t){1&e&&i.YNc(0,a,4,5,"div",0),2&e&&i.Q6J("ngIf",t.shouldShow)},dependencies:[s.O5,s.PC],styles:[".img-wrapper[_ngcontent-%COMP%]{max-height:240px}.img-wrapper[_ngcontent-%COMP%] .img-card[_ngcontent-%COMP%], .img-wrapper[_ngcontent-%COMP%] .animated-bg[_ngcontent-%COMP%]{max-width:240px;max-height:240px}"]}),e})(),c=(()=>{class e{}return e.ɵfac=function(t){return new(t||e)},e.ɵcmp=i.Xpm({type:e,selectors:[["belender-widget-step-logo"]],inputs:{data:"data",customImage:"customImage",withLogo:"withLogo"},decls:1,vars:3,consts:[[3,"firstOption","withLogo","logoUrl"]],template:function(e,t){if(1&e&&i._UZ(0,"belender-widget-logo",0),2&e){let e;i.Q6J("firstOption",t.customImage)("withLogo",null!==(e=t.withLogo)&&void 0!==e?e:null==t.data||null==t.data.styles?null:t.data.styles.withLogo)("logoUrl",null==t.data||null==t.data.styles?null:t.data.styles.logoUrl)}},dependencies:[l],encapsulation:2}),e})()},5762:(e,t,n)=>{n.d(t,{l:()=>i});class i{constructor(){this.status_code="created"}}},3731:(e,t,n)=>{n.d(t,{z:()=>r});var i=n(4650),s=n(1481);let r=(()=>{class e{constructor(e){this.sanitized=e}transform(e){return this.sanitized.bypassSecurityTrustHtml(e)}}return e.ɵfac=function(t){return new(t||e)(i.Y36(s.H7,16))},e.ɵpipe=i.Yjl({name:"safeHtml",type:e,pure:!0}),e})()},9391:(e,t,n)=>{n.d(t,{o:()=>l});var i=n(7396),s=n(8829),r=n(4650),o=n(6554),a=n(9728);let l=(()=>{class e{constructor(e,t){this.localFetch=e,this.apiUrlService=t}getAttachmentsOld(e){return new Promise(((t,n)=>{const r=(0,i.IO)((0,i.hJ)(s.db,"solicitudes"),(0,i.ar)("id","==",e),(0,i.b9)(1));(0,i.cf)(r,(e=>{let n;e.forEach((e=>{n=e.data().attachments})),t(n)}),(e=>{n(e)}))}))}getAttachments(e){return new Promise(((t,n)=>{this.localFetch.getFetch(`${this.apiUrlService.baseUrl}/requests/${e}/documents`).then((e=>{e?t(e):n("No hay archivos asignados a esta solicitud..")})).catch((e=>{n(e)}))}))}uploadFile(e){return new Promise(((t,n)=>{this.localFetch.postFileFetchWhitoutToken(`${this.apiUrlService.baseUrl}/documents/upload-files`,e).then((e=>{e?t(e):n("No se pudieron subir los documentos..")})).catch((e=>{n(e)}))}))}}return e.ɵfac=function(t){return new(t||e)(r.LFG(o.r),r.LFG(a.i))},e.ɵprov=r.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},5710:(e,t,n)=>{n.d(t,{S:()=>c});var i=n(2340),s=n(4650),r=n(8467),o=n(6554),a=n(5601),l=n(9728);let c=(()=>{class e{constructor(e,t,n,i){this.utils=e,this.localFetch=t,this.solicitudesService=n,this.apiUrlService=i}addSolicitud(e){return new Promise(((t,n)=>{this.localFetch.postFileFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/client-certificate",e).then((e=>{e?(this.solicitudesService.markRequestOpenedIfNeeded(e),t(e)):n(e)})).catch((e=>{n(e)}))}))}addSignedFile(e){return new Promise(((t,n)=>{this.localFetch.postFile(this.apiUrlService.baseUrl+"/requests/client-certificate/upload-file-signed",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}addFiles(e){return new Promise(((t,n)=>{this.localFetch.postFile(this.apiUrlService.baseUrl+"/requests/client-certificate/upload-files",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}acceptTerms(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/client-certificate/terms",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendOtp(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/client-certificate/otp",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendPassword(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/client-certificate/password",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}preRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/pre-request/client-certificate",e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}sendOTP(e){return new Promise(((t,n)=>{let s="/requests/client-certificate/otp";i.N.scraperMock&&(s="/mockscrapper/requests/client-certificate/otp"),this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+s,e).then((e=>{e?t(e):n(e)})).catch((e=>{n(e)}))}))}}return e.ɵfac=function(t){return new(t||e)(s.LFG(r.F),s.LFG(o.r),s.LFG(a.M),s.LFG(l.i))},e.ɵprov=s.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},7489:(e,t,n)=>{n.d(t,{v:()=>u});var i=n(5861),s=n(2340),r=n(4650),o=n(8467),a=n(1742),l=n(6554),c=n(5601),d=n(9728);let u=(()=>{class e{constructor(e,t,n,i,s){this.utils=e,this.pinUtils=t,this.localFetch=n,this.solicitudesService=i,this.apiUrlService=s}getSolicitudes(){var e=this;return(0,i.Z)((function*(){const t=yield e.localFetch.getFetch(e.apiUrlService.baseUrl+"/requests");return e.solicitudesService.markRequestOpenedIfNeeded(t),t}))()}getSolicitudByCode(e){var t=this;return(0,i.Z)((function*(){const n=yield t.localFetch.freeGetFetch(t.apiUrlService.baseUrl+"/requests/"+e);return t.solicitudesService.markRequestOpenedIfNeeded(n),n}))()}noMatchPhone(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/clave-pin/cancel",e).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?t(e):n(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),n(e)}))}))}addSolicitud(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/clave-pin",e).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?(this.solicitudesService.markRequestOpenedIfNeeded(e),t(e)):n(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),n(e)}))}))}checkService(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/clave-pin/check-service",e).then((e=>{this.pinUtils.sendMessageToParent(400===e.code?{type:"response",data:{...e.response,status_code:"no_clave_pin_service"}}:{type:"response",data:e.data||e}),t(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),n(e)}))}))}setNoService(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/clave-pin/no-service",e).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?t(e):n(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),n(e)}))}))}acceptTerms(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/clave-pin/terms",e).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?t(e):n(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),n(e)}))}))}getNewIdOfRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/"+e+"/get-new-id",{}).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?t(e):n(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),n(e)}))}))}retryRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/clave-pin/retry",e).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?t(e):n(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),n(e)}))}))}resendOTP(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/clave-pin/resend-otp",e).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?t(e):n(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),n(e)}))}))}fixData(e,t){return new Promise(((n,i)=>{this.localFetch.putFetchWhitoutToken(`${this.apiUrlService.baseUrl}/requests/${e}/person`,t).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?n(e):i(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),i(e)}))}))}sendOTP(e,t){let n="/requests/clave-pin/otp";return(s.N.scraperMock||t)&&(n="/mockscrapper/requests/clave-pin/otp"),new Promise(((t,i)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+n,e).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?t(e):i(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),i(e)}))}))}sendOTPToBde(e,t){let n="/requests/cirbe-cp/otp";return(s.N.scraperMock||t)&&(n="/mockscrapper/requests/cirbe-cp/otp"),new Promise(((t,i)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+n,e).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?t(e):i(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),i(e)}))}))}sendSecondTask(e){let t="/requests/clave-pin/secondTask";return s.N.scraperMock&&(t="/mockscrapper/requests/clave-pin/secondTask"),new Promise(((n,i)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+t,e).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?n(e):i(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),i(e)}))}))}sendLinkBySms(e,t){return new Promise(((n,i)=>{this.localFetch.postFetch(`${this.apiUrlService.baseUrl}/requests/${e}/send-link-sms`,t).then((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),e?n(e):i(e)})).catch((e=>{this.pinUtils.sendMessageToParent({type:"response",data:e.data||e}),i(e)}))}))}}return e.ɵfac=function(t){return new(t||e)(r.LFG(o.F),r.LFG(a._),r.LFG(l.r),r.LFG(c.M),r.LFG(d.i))},e.ɵprov=r.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},9617:(e,t,n)=>{n.d(t,{U:()=>a});var i=n(4650),s=n(8467),r=n(6554),o=n(9728);let a=(()=>{class e{constructor(e,t,n){this.utils=e,this.localFetch=t,this.apiUrlService=n}getPackagesByUserID(e){return new Promise(((t,n)=>{this.localFetch.getFetchWhitoutToken(this.apiUrlService.baseUrl+"/users/"+e+"/pack-documents").then((e=>{e?t(e):n(e)})).catch((e=>{console.error("addSolicitud",e),n(e)}))}))}getPacksByPackId(e){return new Promise(((t,n)=>{this.localFetch.getFetchWhitoutToken(this.apiUrlService.baseUrl+"/pack-documents/"+e).then((e=>{e?t(e):n(e)})).catch((e=>{console.error("addSolicitud",e),n(e)}))}))}getFlowPackagesByUserID(e,t){}}return e.ɵfac=function(t){return new(t||e)(i.LFG(s.F),i.LFG(r.r),i.LFG(o.i))},e.ɵprov=i.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},5601:(e,t,n)=>{n.d(t,{M:()=>c});var i=n(5861),s=n(2340),r=n(4650),o=n(8467),a=n(6554),l=n(9728);let c=(()=>{class e{constructor(e,t,n){this.utils=e,this.localFetch=t,this.apiUrlService=n}getSolicitudes(){var e=this;return(0,i.Z)((function*(){const t=yield e.localFetch.getFetch(e.apiUrlService.baseUrl+"/requests");return e.markRequestOpenedIfNeeded(t),t}))()}getSolicitudByCode(e){var t=this;return(0,i.Z)((function*(){const n=yield t.localFetch.freeGetFetch(t.apiUrlService.baseUrl+"/requests/"+e);return t.markRequestOpenedIfNeeded(n),n}))()}setPhone(e,t){return new Promise(((n,i)=>{this.localFetch.putFetchWhitoutToken(`${this.apiUrlService.baseUrl}/requests/${t}/person`,e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),n(e)):i(e)})).catch((e=>{i(e)}))}))}noPhone(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/sms/no-phone",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}smsToPin(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/sms-clave",e).then((e=>{e?(this.markRequestOpenedIfNeeded((e.data||e).request_id),this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}transitionToVideoId(e){return this.localFetch.postFetchWhitoutToken(s.N.baseUrl+"/requests/client-certificate/to-videoid",e).then((e=>e?(this.sendMessageToParent({type:"response",data:e.data||e}),e):Promise.reject(e)))}addSolicitud(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/sms",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),this.markRequestOpenedIfNeeded(e),t(e)):n(e)})).catch((e=>{console.error("addSolicitud",e),n(e)}))}))}setNoService(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/sms/no-service",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}acceptTerms(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/sms/terms",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}getNewIdOfRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/"+e+"/get-new-id",{}).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}checkService(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/sms/check-service",e).then((e=>{this.sendMessageToParent(400===e.code?{type:"response",data:{...e.response,status_code:"no_sms_service"}}:{type:"response",data:e.data||e}),t(e)})).catch((e=>{n(e)}))}))}retryRequest(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/sms/retry",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}resendOTP(e){return new Promise(((t,n)=>{this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+"/requests/sms/resend-otp",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}fixData(e,t){return new Promise(((n,i)=>{this.localFetch.putFetchWhitoutToken(`${this.apiUrlService.baseUrl}/requests/${e}/person`,t).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),n(e)):i(e)})).catch((e=>{i(e)}))}))}sendOTP(e){return new Promise(((t,n)=>{let i="/requests/sms/otp";s.N.scraperMock&&(i="/mockscrapper/requests/sms/otp"),this.localFetch.postFetchWhitoutToken(this.apiUrlService.baseUrl+i,e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}uploadFileFromWidget(e){return new Promise(((t,n)=>{this.localFetch.postFileFetchWhitoutToken(this.apiUrlService.baseUrl+"/documents/upload-files-from-widget",e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n(e)})).catch((e=>{n(e)}))}))}sendLinkBySms(e,t){return new Promise(((n,i)=>{this.localFetch.postFetch(`${this.apiUrlService.baseUrl}/requests/${e}/send-link-sms`,t).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),n(e)):i(e)})).catch((e=>{i(e)}))}))}getDocuments(e){return new Promise(((t,n)=>{this.localFetch.getFetch(`${this.apiUrlService.baseUrl}/requests/${e}/documents`).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n("No hay archivos asignados a esta solicitud..")})).catch((e=>{n(e)}))}))}getDocumentsIds(e){return new Promise(((t,n)=>{this.localFetch.getFetch(`${this.apiUrlService.baseUrl}/requests/${e}/documents-ids-widget`).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),t(e)):n("No hay archivos asignados a esta solicitud..")})).catch((e=>{n(e)}))}))}cancelRequest(e,t){return new Promise(((n,i)=>{this.localFetch.postFetch(this.apiUrlService.baseUrl+`/requests/${t}/cancel`,e).then((e=>{e?(this.sendMessageToParent({type:"response",data:e.data||e}),n(e)):i(e)})).catch((e=>{i(e)}))}))}markRequestOpened(e){return this.localFetch.postFetchWhitoutToken(`${this.apiUrlService.baseUrl}/requests/${e}/opened`,{})}markRequestOpenedIfNeeded(e){const t=e?.data||e;!1===t?.widget_opened&&this.markRequestOpened(t.request_id)}sendMessageToParent(e){window.top.postMessage(e,"*")}}return e.ɵfac=function(t){return new(t||e)(r.LFG(o.F),r.LFG(a.r),r.LFG(l.i))},e.ɵprov=r.Yz7({token:e,factory:e.ɵfac,providedIn:"root"}),e})()},5145:(e,t,n)=>{n.d(t,{Z:()=>i});const i=[{id:0,text:"error_clave_pin",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"Error con la clave PIN"},{id:1,text:"failed_without_retry",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"Fallo sin reintento"},{id:111,text:"failed_with_retry",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"Fallo con reintento"},{id:2,text:"bad_phone",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"Teléfono erróneo"},{id:3,text:"failed_documents_downloaded",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"Fallo al descargar Documentos"},{id:4,text:"invalid_otp_aeat",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"OTP de AEAT inválido"},{id:5,text:"invalid_otp_seguridad_social",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"cancel",label:"OTP de Seg. Social inválido"},{id:6,text:"max_entries_otp",textClass:"text-red",bgClass:"bg-red-light",previewClass:"bg-red",icon:"not_interested",label:"Max intentos OTP"},{id:7,text:"abandoned_after_bad_phone",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"phonelink_erase",label:"Abandonado (bad phone)"},{id:8,text:"abandoned_after_terms",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"warning",label:"Abandonado (términos y condiciones)"},{id:9,text:"abandoned_after_invalid_otp_seguridad_social",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"warning",label:"Abandonado (invalid OTP SS)"},{id:10,text:"abandoned_after_invalid_otp_aeat",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"warning",label:"Abandonado (invalid OTP AEAT)"},{id:11,text:"abandoned_after_waiting_otp_aeat",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"warning",label:"Abandonado (waiting OTP AEAT)"},{id:12,text:"abandoned_after_waiting_otp_seguridad_social",textClass:"text-orange",bgClass:"bg-orange-light",previewClass:"bg-orange",icon:"warning",label:"Abandonado (waiting OTP SS)"},{id:13,text:"waiting_login_seguridad_social",textClass:"text-yellow-500",bgClass:"bg-yellow-500/10",previewClass:"bg-yellow-500",icon:"timelapse",label:"Esperando login SS"},{id:14,text:"waiting_login_aeat",textClass:"text-yellow-500",bgClass:"bg-yellow-500/10",previewClass:"bg-yellow-500",icon:"timelapse",label:"Esperando login AEAT"},{id:15,text:"waiting_otp_aeat",textClass:"text-yellow-500",bgClass:"bg-yellow-500/10",previewClass:"bg-yellow-500",icon:"timelapse",label:"Esperando OTP AEAT"},{id:16,text:"waiting_otp_seguridad_social",textClass:"text-yellow-500",bgClass:"bg-yellow-500/10",previewClass:"bg-yellow-500",icon:"timelapse",label:"Esperando OTP SS"},{id:17,text:"saved_otp",textClass:"text-purple",bgClass:"bg-purple-light",previewClass:"bg-purple",icon:"timelapse",label:"OTP guardado"},{id:171,text:"picked_up_otp",textClass:"text-purple",bgClass:"bg-purple-light",previewClass:"bg-purple",icon:"timelapse",label:"OTP recogido"},{id:18,text:"terms_and_conditions",textClass:"text-purple",bgClass:"bg-purple-light",previewClass:"bg-purple",icon:"timelapse",label:"Términos y condiciones"},{id:19,text:"waiting_documents",textClass:"text-cyan",bgClass:"bg-cyan-light",previewClass:"bg-cyan",icon:"hourglass_empty",label:"Esperando documentos"},{id:20,text:"created",textClass:"text-cyan",bgClass:"bg-cyan-light",previewClass:"bg-cyan",icon:"fiber_new",label:"Solicitud creada"},{id:21,text:"all_documents_downloaded",textClass:"text-green",bgClass:"bg-green-light",previewClass:"bg-green",icon:"check_circle",label:"Todo los documentos descargados"},{id:22,text:"partial_documents_downloaded",textClass:"text-green",bgClass:"bg-green-light",previewClass:"bg-green",icon:"check_circle",label:"Algunos Documentos descargados"},{id:23,text:"parcial_documents_downloaded",textClass:"text-green",bgClass:"bg-green-light",previewClass:"bg-green",icon:"check_circle",label:"Algunos Documentos descargados"},{id:24,text:"all_documents_downloaded_and_deleted",textClass:"text-green",bgClass:"bg-green-light",previewClass:"bg-green",icon:"delete",label:"Todos descargados y eliminados"},{id:25,text:"partial_documents_downloaded_and_deleted",textClass:"text-green",bgClass:"bg-green-light",previewClass:"bg-green",icon:"delete",label:"Algunos descargados y eliminados"},{id:26,text:"updated_data",textClass:"text-blue-500",bgClass:"bg-blue-500/10",previewClass:"bg-blue-500",icon:"check",label:"Datos del cliente actualizados"},{id:27,text:"resend_otp",textClass:"text-blue-500",bgClass:"bg-blue-500/10",previewClass:"bg-blue-500",icon:"refresh",label:"OTP reenviado"}]},8259:function(e,t){var n;
|
|
67
67
|
/*!
|
|
68
68
|
* jQuery JavaScript Library v3.7.1
|
|
69
69
|
* https://jquery.com/
|