1import{a as Ce}from"./chunk-CBBYYMF6.js";import{a as be}from"./chunk-RBBPXJPW.js";import{a as ye}from"./chunk-G3N4ISJZ.js";import{a as de}from"./chunk-OI7K3XU6.js";import{a as ge,b as xe,c as ve}from"./chunk-CSXLKKL7.js";import"./chunk-SUAVV44D.js";import"./chunk-C4HDU4HF.js";import{b as _e}from"./chunk-4AVMG4RO.js";import"./chunk-OUN453PY.js";import{a as ue}from"./chunk-W4MDNZTE.js";import"./chunk-KI4EY463.js";import{h as H}from"./chunk-IMMABWLR.js";import"./chunk-6WJDKN3F.js";import{a as me,b as ce,g as fe,h as he}from"./chunk-IJ3RVB7T.js";import"./chunk-5PRSKWTR.js";import{a as ne}from"./chunk-2HRDXC3D.js";import{Aa as te,Da as ie,Na as re,Oa as ae,_a as oe,bb as se,ca as z,eb as le,fa as G,fb as pe,ha as u,ja as W,ka as K,oa as $,pa as J,sa as X,ta as Q,wa as Y,ya as Z,za as ee}from"./chunk-FYXPWHFS.js";import{q}from"./chunk-W6KJKSZJ.js";import{$b as g,Ac as x,Eb as N,Kc as A,Nc as m,Oc as c,S as w,Sb as E,Ub as P,Vb as B,Wb as F,Xb as k,Yb as f,Zb as o,_b as a,a as D,cb as _,gb as r,gc as j,ic as R,ka as V,kc as v,kd as U,oa as M,sb as b,va as I,wa as T,yb as O,yc as l,zc as C}from"./chunk-CPUJRMSA.js";var Se=(()=>{let s=class s extends ne{constructor(e){super(e),this._http=e,this.siteKeyCaptcha=z.siteKeyCaptcha,this.dataBases=Object.keys(ie),this.typesOfId=[...Object.keys(te)],this.letterColumns=[{text:"entityInformer",property:"entityInformer",textType:"string"},{text:"contactInformation",property:"contactInformation",textType:"string"},{text:"operationDescription",property:"operationDescription",textType:"string"},{text:"natureDescription",property:"natureDescription",textType:"string"},{text:"originalCreatedDate",property:"originalCreatedDate",textType:"date"},{text:"lastOperationDate",property:"lastOperationDate",textType:"date"},{text:"displayDate",property:"displayDate",textType:"date"},{text:"firstUnpaidPayment",property:"firstUnpaidPayment",textType:"date"},{text:"lastUnpaidPayment",property:"lastUnpaidPayment",textType:"date"},{text:"totalUnpaidPayment",property:"totalUnpaidPayment",textType:"number"},{text:"clientName",property:"clientName",textType:"string"},{text:"cifnif",property:"idClient",textType:"string"}],this.dataBases.pop()}getResourceName(){return"erigths"}getLetter(e){return this.post(this.getResourceName()+"/getLetter",e)}getLetterPdf(e){return this.get(this.getResourceName()+"/getLetterPdf",e)}};s.\u0275fac=function(t){return new(t||s)(M(q))},s.\u0275prov=V({token:s,factory:s.\u0275fac,providedIn:"root"});let i=s;return i})();var Pe=i=>[i];function Re(i,s){if(i&1&&(o(0,"mat-radio-button",13),l(1),m(2,"translate"),a()),i&2){let n=s.$implicit;f("value",n),r(),C(c(2,2,"eRights."+n))}}function we(i,s){i&1&&(o(0,"p",15),l(1,"IN \xA0 / \xA0"),a())}function Be(i,s){if(i&1&&(o(0,"mat-error"),l(1),m(2,"translate"),a()),i&2){let n=v(2);r(),C(c(2,1,n.eRightsForm.controls.referencia.errors.isStartsWith.errorMessage))}}function Fe(i,s){if(i&1&&(o(0,"mat-option",13),l(1),m(2,"translate"),a()),i&2){let n=s.$implicit;f("value",n),r(),x(" ",c(2,2,n)," ")}}function ke(i,s){if(i&1&&(o(0,"div",24),g(1,"efx-img-previsualization",27),a()),i&2){let n=v(2);r(),f("data",A(1,Pe,n.fileToPrev))}}function Le(i,s){if(i&1){let n=j();o(0,"div",2)(1,"div",3)(2,"h1",4),l(3),m(4,"translate"),a(),g(5,"div",5),m(6,"translate"),o(7,"form",6),R("ngSubmit",function(){I(n);let t=v();return T(t.sendForm())}),o(8,"h1",7),l(9),m(10,"translate"),a(),o(11,"div",8),g(12,"div",5),m(13,"translate"),o(14,"div",9)(15,"mat-label",10)(16,"span",11),l(17,"*"),a(),l(18),m(19,"translate"),a(),o(20,"mat-radio-group",12,0),F(22,Re,3,4,"mat-radio-button",13,B),a()(),o(24,"div",9)(25,"mat-label",10)(26,"span",11),l(27,"*"),a(),l(28),m(29,"translate"),a(),o(30,"div",14)(31,"p",15),l(32,"740 \xA0 / \xA0"),a(),E(33,we,2,0,"p",15),o(34,"mat-form-field",16),g(35,"input",17),E(36,Be,3,3,"mat-error"),a()()(),o(37,"div",9)(38,"mat-label",10)(39,"span",11),l(40,"*"),a(),l(41),m(42,"translate"),a(),o(43,"mat-form-field",16)(44,"mat-select",18),R("selectionChange",function(t){I(n);let d=v();return T(d.validateNationalId(t.value))}),F(45,Fe,3,4,"mat-option",13,B),a()()(),o(47,"div",9)(48,"mat-label",10)(49,"span",11),l(50,"*"),a(),l(51),m(52,"translate"),a(),o(53,"mat-form-field",16),g(54,"input",19),a()(),o(55,"mat-checkbox",20),g(56,"span",5),m(57,"translate"),a(),o(58,"div",21)(59,"button",22),l(60),m(61,"translate"),a()()()(),o(62,"button",23),R("click",function(){I(n);let t=v();return T(t.downloadPdf())}),l(63),m(64,"translate"),a(),E(65,ke,2,3,"div",24),o(66,"div",25),g(67,"efx-table",26),a(),g(68,"div",5),m(69,"translate"),a()()}if(i&2){let n=v();r(3),C(c(4,20,"supportService")),r(2),f("innerHTML",c(6,22,"infoService"),_),r(2),f("formGroup",n.eRightsForm),r(2),C(c(10,24,"requestAsnefFile")),r(3),f("innerHTML",c(13,26,"infoForm"),_),r(6),x(" ",c(19,28,"file")),r(4),k(n.dataBases),r(6),x(" ",c(29,30,"reference")),r(5),P(n.eRightsForm.controls.database.value==="AsnefEnterprises"?33:-1),r(3),P(n.eRightsForm.controls.referencia.hasError("isStartsWith")?36:-1),r(5),x(" ",c(42,32,"typeOfId")),r(4),k(n.idTypeList),r(6),x(" ",c(52,34,"eRights.identifier")),r(5),f("innerHTML",c(57,36,"privacy"),_),r(3),f("disabled",!n.eRightsForm.valid),r(),x(" ",c(61,38,"submitoption")," "),r(2),f("hidden",!n.lettersStatus),r(),x(" ",c(64,40,"downloadsummaryreport")," "),r(2),P(n.fileToPrev?65:-1),r(2),f("data",n.letters)("columns",n._columns),r(),f("innerHTML",c(69,42,"conditions"),_)}}var Ie=(()=>{let s=class s{constructor(e,t,d,h){this._eRightsService=e,this._formBuilder=t,this._captchaService=d,this._matSnackBar=h,this.isLoading=!1,this.letters=[],this.fileToPrev=null,this.nationalIdRef=null,this.caseId=null,this.lettersStatus=!1,this.subscriptions=[],this.loadData()}loadData(){this.dataBases=this._eRightsService.dataBases,this._columns=[...this._eRightsService.letterColumns],this.idTypeList=[...this._eRightsService.typesOfId],this.eRightsForm=this._formBuilder.group({database:["",[u.required]],referencia:["",[u.required,be.patternCheck(/^JU/i,"isStartsWith","validationMessage.invali
1dReferenceNumber")]],nationalIdType:["",[u.required]],nationalId:["",[u.required]],privacy:[!1,[u.requiredTrue]]})}validateNationalId(e){let{nationalIdType:t,nationalId:d}=this.eRightsForm.controls,h=t.value==="PASSPORT"?10:9;d.clearValidators(),d.setValidators([u.required,u.pattern(ee[e]),ae(t.value),u.maxLength(h)]),d.updateValueAndValidity()}downloadPdf(){this.subscriptions.push(this._captchaService.generateCaptchaToken("ErightsPdfDownloadSubmit").subscribe({next:e=>{this.subscriptions.push(this._eRightsService.getLetterPdf({nationalId:this.nationalIdRef,caseId:this.caseId,kaptcha:"notokenkaptcha"}).pipe(w(()=>this.isLoading=!1)).subscribe({next:t=>{t&&t.Version&&t.Version.length>0&&t.Success?this.showPrev(t.Version[0]):t.Success?this._displayError({error:{errorCode:t.message}},"downloadIssue"):this._displayError(t,"downloadIssue")},error:t=>{this._displayError(t,"downloadIssue")}}))},error:e=>{this.isLoading=!1,this._displayError(null,"error.default")}}))}showPrev(e){let{VersionData:t,FileExtension:d}=re(e),h={FileExtension:d,VersionData:t,Title:e.hasOwnProperty("title")?e.title:e.Title};this.setPrevData(h)}setPrevData(e){this.fileToPrev=D({},e)}sendForm(){this.eRightsForm.valid?(this.isLoading=!0,this.subscriptions.push(this._captchaService.generateCaptchaToken("ErightsFormSubmit").subscribe({next:e=>{this.letters=[],this.lettersStatus=!1;let{database:t,referencia:d,nationalIdType:h,nationalId:y}=this.eRightsForm.value,S=t==="AsnefEnterprises"?"IN"+d:d;this.nationalIdRef=h==="PASSPORT"?"T"+y:y,this.subscriptions.push(this._eRightsService.getLetter({database:t,referencia:S,nationalIdType:h,nationalId:this.nationalIdRef,kaptcha:e}).pipe(w(()=>this.isLoading=!1)).subscribe({next:p=>{if(this.lettersStatus=p&&p.hasOwnProperty("Success")?p.Success:!1,this.caseId=p&&p.hasOwnProperty("CaseId")?p.CaseId:null,p.detalle&&p.detalle.length>0||p.debtList&&p.debtList.length>0){let L=p.detalle||p.debtList;this.letters=L?[...L]:[],setTimeout(()=>this.resetErightsForm(),100)}else this._displayError(p,"error_eRights_body",p.Success?"info":"warn"),this.resetTablePreview(p.Success)},error:p=>{this.lettersStatus=!1,this._displayError(p,"error_eRights_body"),this.resetTablePreview()}}))},error:e=>{this.isLoading=!1,this._displayError(null,"error.default")}}))):(this._displayError(null,"invalidFormValue"),this.resetTablePreview())}resetTablePreview(e=!1){this.fileToPrev=null,this.letters=[],this.lettersStatus=!!e}resetErightsForm(){this.fileToPrev=null;let{nationalId:e}=this.eRightsForm.controls;e.clearValidators(),e.setValidators([u.required]),e.updateValueAndValidity(),this.eRightsForm.reset()}_displayError(e,t,d="error",h=5e3){let y="",S=t;e&&(y=e.error&&e.error.ErrorCode?e.error.ErrorCode:e.error&&e.error.errorCode?e.error.errorCode:"",S=y?null:t),le(d,S,null,this._matSnackBar,h,y)}ngOnDestroy(){this.subscriptions.length>0&&this.subscriptions.forEach(e=>e.unsubscribe())}};s.\u0275fac=function(t){return new(t||s)(b(Se),b(Y),b(de),b(se))},s.\u0275cmp=O({type:s,selectors:[["efx-erights"]],decls:1,vars:1,consts:[["databaseRef",""],["class","margin-top",4,"efxLoader"],[1,"margin-top"],[1,"erights-wrap","d-flex","flex-column","gap-3","justify-content-center","align-items-center"],[1,"title"],[3,"innerHTML"],["id","eRightsForm",1,"d-flex","flex-column","gap-3","justify-content-center","align-items-center",3,"ngSubmit","formGroup"],[1,"title","box-title"],[1,"padding-1em","d-flex","flex-column","align-items-center","justify-content-md-around","align-items-md-stretch","gap-3"],[1,"form-fields","d-flex","flex-column","flex-lg-row","align-items-center"],[1,"title-14","font-bold","col-12","col-lg-4"],[1,"required-icon"],["formControlName","database","aria-label","Select an database","appearance","outline","color","accent",1,"d-flex","flex-column","flex-lg-row"],[3,"value"],[1,"d-flex","flex-row","align-items-center","w-100"],[1,"prefixtext"],["appearance","outline","color","accent"],["type","text","matInput","","formControlName","referencia","maxlength","13"],["formControlName","nationalIdType",3,"selectionChange"],["efxUpperCase","","type","text","matInput","","formControlName","nationalId",1,"uppercase"],["formControlName","privacy"],[1,"form-fields","d-flex","flex-column","flex-lg-row","justify-content-center","align-items-center","gap-1"],["mat-flat-button","","type","submit",1,"validate-email","red-button",3,"disabled"],["mat-flat-button","","type","button",3,"click","hidden"],[1,"previewpdfblock","d-flex","flex-column","justify-content-center","align-items-stretch"],[1,"d-flex","flex-column","w-100"],[3,"data","columns"],[1,"w-100",3,"data"]],template:function(t,d){t&1&&N(0,Le,70,44,"div",1),t&2&&f("efxLoader",d.isLoading)},dependencies:[pe,Z,$,G,W,K,Q,J,X,me,ge,xe,fe,he,ce,ue,H,ye,Ce,oe,_e,ve,U],styles:[".title[_ngcontent-%COMP%]{color:#903}.title.box-title[_ngcontent-%COMP%]{color:#fff;background-color:#903;text-align:center;width:100%}.margin-top[_ngcontent-%COMP%]{margin-top:3em}.disc-list[_ngcontent-%COMP%]{list-style:disc!important}form[_ngcontent-%COMP%]{max-width:50em;border:1px solid #990033}form[_ngcontent-%COMP%] .padding-1em[_ngcontent-%COMP%]{padding:1em} .erights-wrap .mat-mdc-form-field{width:100%} .erights-wrap .mat-mdc-radio-group .mat-mdc-radio-button:not(:last-child){margin-right:5px} .erights-wrap .mat-checkbox-layout .mat-checkbox-label{white-space:pre-wrap;word-break:break-word} .erights-wrap .prefixtext{white-space:nowrap;margin:0}.previewpdfblock[_ngcontent-%COMP%]{width:50em}"]});let i=s;return i})();var ut=[{path:"",component:Ie,canActivate:[]}];export{ut as ERIGHTS_ROUTES};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.