@sfinges/sf-solicitud 0.6.1 → 0.6.2

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.
@@ -547,6 +547,12 @@ const IDENTITY = {
547
547
  rejected: { label: 'Identidad rechazada', short: 'Rechazada', severity: 'danger', icon: 'pi pi-times-circle' },
548
548
  none: { label: 'Identidad sin validar', short: 'Sin validar', severity: 'secondary', icon: 'pi pi-question-circle' }
549
549
  };
550
+ /** Cómo se ve la verificación de un celular o correo: con texto e icono, no solo el color. */
551
+ const CONTACT = {
552
+ verified: { label: 'Validado', severity: 'success', icon: 'pi pi-check-circle' },
553
+ unverified: { label: 'Sin validar', severity: 'secondary', icon: 'pi pi-question-circle' },
554
+ notFound: { label: 'No existe en Experian', severity: 'warn', icon: 'pi pi-exclamation-triangle' }
555
+ };
550
556
  let nextId$3 = 0;
551
557
  /**
552
558
  * Titular de la solicitud: arriba lo básico (lo que trae la solicitud) y, al expandir, la persona completa, sus
@@ -587,13 +593,12 @@ class ApplicationPersonComponent {
587
593
  return ((words[0]?.[0] ?? '') + (words[1]?.[0] ?? '')).toUpperCase() || '?';
588
594
  });
589
595
  /** La validación de identidad del titular, para la etiqueta de la cabecera; null si el host no la sabe. */
590
- holderIdentity = computed(() => this.identityView(this.holder()?.identity));
591
596
  generalFields = computed(() => {
592
597
  const p = this.person();
593
598
  if (!p)
594
599
  return [];
595
600
  return [
596
- { label: 'Validación de identidad', value: this.identityView(this.holder()?.identity)?.short },
601
+ { label: 'Validación de identidad', value: this.identityView(p.identity)?.short },
597
602
  { label: 'Nombres', value: p.firstNames },
598
603
  { label: 'Apellidos', value: p.lastNames },
599
604
  // Tal cual lo manda el host, ya traducido con su catálogo: la librería no traduce códigos.
@@ -647,23 +652,50 @@ class ApplicationPersonComponent {
647
652
  this.personState.set('idle');
648
653
  this.accountsState.set('idle');
649
654
  this.loadedFor = null;
650
- if (this.expanded())
651
- this.load();
655
+ // La persona se pide al abrir la solicitud: la cabecera muestra su identidad y si el celular y el correo
656
+ // están validados. Las cuentas, solo al expandir.
657
+ this.load(this.expanded());
652
658
  });
653
659
  });
654
660
  }
661
+ /** La identidad de la cabecera: solo la de la persona. Mientras llega, o si no se sabe, no hay etiqueta. */
662
+ holderIdentity = computed(() => this.identityView(this.person()?.identity));
663
+ /** La verificación del celular de la cabecera: la del principal de la persona, si es el mismo número. */
664
+ phoneCheck = computed(() => {
665
+ const person = this.person();
666
+ const phone = this.holder()?.phone;
667
+ if (!person?.mobile || !phone || digits(person.mobile) !== digits(phone))
668
+ return null;
669
+ return this.contactView(person.phoneVerification);
670
+ });
671
+ /** La verificación del correo de la cabecera: la del principal de la persona, si es el mismo correo. */
672
+ emailCheck = computed(() => {
673
+ const person = this.person();
674
+ const email = this.holder()?.email;
675
+ if (!person?.email || !email || person.email.trim().toLowerCase() !== email.trim().toLowerCase())
676
+ return null;
677
+ return this.contactView(person.emailVerification);
678
+ });
679
+ /** Cómo se muestra la verificación de un celular o correo; null si no se sabe. */
680
+ contactView(verification) {
681
+ return verification ? (CONTACT[verification] ?? null) : null;
682
+ }
655
683
  /** Cómo se muestra una validación de identidad; null si no se sabe (valor ausente o desconocido). */
656
684
  identityView(identity) {
657
685
  return identity ? (IDENTITY[identity] ?? null) : null;
658
686
  }
659
687
  toggle() {
660
688
  this.expanded.update((open) => !open);
689
+ if (!this.expanded())
690
+ return;
661
691
  // Lo ya cargado (o en camino) no se vuelve a pedir: solo lo que nunca se pidió o falló.
662
- const state = this.personState();
663
- if (this.expanded() && (state === 'idle' || state === 'error'))
664
- this.load();
692
+ const person = this.personState();
693
+ if (person === 'idle' || person === 'error')
694
+ this.load(true);
695
+ else if (this.accountsState() === 'idle' || this.accountsState() === 'error')
696
+ this.loadAccounts();
665
697
  }
666
- load() {
698
+ load(withAccounts) {
667
699
  const holder = this.holder();
668
700
  // Sin tipo o sin número no se consulta: la librería no supone el tipo de documento.
669
701
  if (!holder?.documentNumber || !holder.documentType) {
@@ -673,7 +705,8 @@ class ApplicationPersonComponent {
673
705
  }
674
706
  this.loadedFor = this.holderKey();
675
707
  this.loadPerson();
676
- this.loadAccounts();
708
+ if (withAccounts)
709
+ this.loadAccounts();
677
710
  }
678
711
  /**
679
712
  * @param refresh Después de guardar: lo que se ve no se reemplaza por el esqueleto mientras llega (así no se pierden
@@ -792,12 +825,16 @@ class ApplicationPersonComponent {
792
825
  return holder ? `${holder.documentType ?? ''}|${holder.documentNumber}` : null;
793
826
  }
794
827
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ApplicationPersonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
795
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: ApplicationPersonComponent, isStandalone: true, selector: "lib-application-person", inputs: { parties: { classPropertyName: "parties", publicName: "parties", isSignal: true, isRequired: true, transformFunction: null }, permissions: { classPropertyName: "permissions", publicName: "permissions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { personUpdated: "personUpdated" }, ngImport: i0, template: "<p-card>\n @if (holder(); as titular) {\n <div class=\"sfs-person-head\">\n <div class=\"sfs-person-avatar\" aria-hidden=\"true\">{{ initials() }}</div>\n <div class=\"sfs-person-main\">\n <div class=\"sfs-person-name\">\n <h2 class=\"sfs-title\">{{ titular.name || '\u2014' }}</h2>\n @if (holderIdentity(); as identity) {\n <p-tag [value]=\"identity.label\" [icon]=\"identity.icon\" [severity]=\"identity.severity\"></p-tag>\n }\n </div>\n <div class=\"sfs-person-facts\">\n <span>Documento {{ titular.documentNumber || '\u2014' }}</span>\n <span>{{ titular.age != null ? (titular.age | number: '1.0-0' : locale) + ' a\u00F1os' : 'Edad: \u2014' }}</span>\n <span><i class=\"pi pi-mobile\" aria-hidden=\"true\"></i><span class=\"sfs-sr-only\">Celular: </span> {{ titular.phone || '\u2014' }}</span>\n <span class=\"sfs-break\"><i class=\"pi pi-envelope\" aria-hidden=\"true\"></i><span class=\"sfs-sr-only\">Correo: </span> {{ titular.email || '\u2014' }}</span>\n @if (others().length) {\n <span>{{ others().length }} {{ others().length === 1 ? 'persona m\u00E1s' : 'personas m\u00E1s' }} en la solicitud</span>\n }\n </div>\n </div>\n <!-- pButton y no p-button: el componente no deja poner aria-expanded en su <button>. -->\n <button pButton type=\"button\" class=\"sfs-person-toggle\" severity=\"secondary\" [text]=\"true\" label=\"Datos de la persona\" aria-label=\"Datos de la persona\"\n [icon]=\"expanded() ? 'pi pi-chevron-up' : 'pi pi-chevron-down'\" iconPos=\"right\"\n [attr.aria-expanded]=\"expanded()\" [attr.aria-controls]=\"ids.more\"\n (click)=\"toggle()\"></button>\n </div>\n\n @if (expanded()) {\n <div [id]=\"ids.more\" class=\"sfs-person-more\">\n <div aria-live=\"polite\">\n @if (editNotice(); as notice) {\n <p-message [severity]=\"notice.severity\" [text]=\"notice.text\"></p-message>\n }\n </div>\n\n <section [attr.aria-labelledby]=\"ids.prefix + '-general'\" [attr.aria-busy]=\"refreshingPerson() || null\">\n <div class=\"sfs-head\">\n <h3 [id]=\"ids.prefix + '-general'\" class=\"sfs-section-title\" tabindex=\"-1\"><i class=\"pi pi-id-card\" aria-hidden=\"true\"></i> Informaci\u00F3n general</h3>\n @if (canEdit().data && personState() === 'ready') {\n <p-button label=\"Editar\" icon=\"pi pi-pencil\" severity=\"secondary\" [text]=\"true\" ariaLabel=\"Editar datos b\u00E1sicos\"\n (onClick)=\"edit({ kind: 'data', item: person()?.edit ?? null }, $event)\"></p-button>\n }\n </div>\n @switch (personState()) {\n @case ('loading') {\n <div class=\"sfs-person-grid\" aria-busy=\"true\">\n @for (i of [1, 2, 3, 4, 5, 6, 7, 8]; track i) { <p-skeleton height=\"2.5rem\"></p-skeleton> }\n </div>\n }\n @case ('empty') {\n <p-message severity=\"info\" text=\"La persona no est\u00E1 registrada: se muestran solo los datos de la solicitud.\"></p-message>\n }\n @case ('missing') {\n <p-message severity=\"warn\" text=\"La solicitud no trae el tipo o el n\u00FAmero de documento del titular: no se pueden consultar sus datos.\"></p-message>\n }\n @case ('error') {\n <p-message severity=\"error\">\n <div class=\"sfs-inline\">\n <span>No se pudieron cargar los datos de la persona.</span>\n <p-button label=\"Reintentar\" icon=\"pi pi-refresh\" [text]=\"true\" (onClick)=\"loadPerson()\"></p-button>\n </div>\n </p-message>\n }\n @case ('ready') {\n <dl class=\"sfs-person-grid sfs-dl\">\n @for (field of generalFields(); track field.label) {\n <div class=\"sfs-field\">\n <dt>{{ field.label }}</dt>\n <dd>{{ field.value }}</dd>\n </div>\n }\n </dl>\n }\n }\n </section>\n\n @if (personState() === 'ready') {\n <section [attr.aria-labelledby]=\"ids.prefix + '-contact'\" [attr.aria-busy]=\"refreshingPerson() || null\">\n <div class=\"sfs-head\">\n <h3 [id]=\"ids.prefix + '-contact'\" class=\"sfs-section-title\" tabindex=\"-1\"><i class=\"pi pi-phone\" aria-hidden=\"true\"></i> Informaci\u00F3n de contacto</h3>\n @if (canEdit().contacts) {\n <p-button label=\"Agregar\" icon=\"pi pi-plus\" severity=\"secondary\" [text]=\"true\" ariaLabel=\"Agregar contacto\"\n (onClick)=\"edit({ kind: 'contact', item: null }, $event)\"></p-button>\n }\n </div>\n <p-table [value]=\"contacts()\" styleClass=\"p-datatable-sm\" [scrollable]=\"true\">\n <ng-template #header>\n <tr><th>Tipo</th><th>Descripci\u00F3n</th><th>Valor</th>@if (canEdit().contacts) { <th><span class=\"sfs-sr-only\">Acciones</span></th> }</tr>\n </ng-template>\n <ng-template #body let-c>\n <tr>\n <td>{{ c.type || '\u2014' }}</td>\n <td>{{ c.description || '\u2014' }}</td>\n <td class=\"sfs-break\">\n {{ c.value || '\u2014' }}\n @if (c.primary) { <span class=\"sfs-tag-gap\"><p-tag value=\"Principal\" severity=\"info\"></p-tag></span> }\n </td>\n @if (canEdit().contacts) {\n <td class=\"sfs-row-actions\">\n @if (c.id != null) {\n <p-button icon=\"pi pi-pencil\" severity=\"secondary\" [text]=\"true\" [rounded]=\"true\"\n [ariaLabel]=\"'Editar contacto ' + (c.value || '')\" [pTooltip]=\"'Editar contacto'\" tooltipPosition=\"left\"\n (onClick)=\"edit({ kind: 'contact', item: c }, $event)\"></p-button>\n }\n </td>\n }\n </tr>\n </ng-template>\n <ng-template #emptymessage>\n <tr><td [attr.colspan]=\"canEdit().contacts ? 4 : 3\">La persona no tiene medios de contacto registrados.</td></tr>\n </ng-template>\n </p-table>\n </section>\n\n <section [attr.aria-labelledby]=\"ids.prefix + '-address'\" [attr.aria-busy]=\"refreshingPerson() || null\">\n <div class=\"sfs-head\">\n <h3 [id]=\"ids.prefix + '-address'\" class=\"sfs-section-title\" tabindex=\"-1\"><i class=\"pi pi-home\" aria-hidden=\"true\"></i> Direcciones</h3>\n @if (canEdit().addresses) {\n <p-button label=\"Agregar\" icon=\"pi pi-plus\" severity=\"secondary\" [text]=\"true\" ariaLabel=\"Agregar direcci\u00F3n\"\n (onClick)=\"edit({ kind: 'address', item: null }, $event)\"></p-button>\n }\n </div>\n <p-table [value]=\"addresses()\" styleClass=\"p-datatable-sm\" [scrollable]=\"true\">\n <ng-template #header>\n <tr><th>Direcci\u00F3n</th><th>Pa\u00EDs</th><th>Ciudad</th><th>Barrio</th><th>Tel\u00E9fono</th>@if (canEdit().addresses) { <th><span class=\"sfs-sr-only\">Acciones</span></th> }</tr>\n </ng-template>\n <ng-template #body let-a>\n <tr>\n <td>{{ a.address || '\u2014' }}</td>\n <td>{{ a.country || '\u2014' }}</td>\n <td>{{ a.city || '\u2014' }}</td>\n <td>{{ a.neighborhood || '\u2014' }}</td>\n <td>{{ a.phone || '\u2014' }}</td>\n @if (canEdit().addresses) {\n <td class=\"sfs-row-actions\">\n @if (a.id != null) {\n <p-button icon=\"pi pi-pencil\" severity=\"secondary\" [text]=\"true\" [rounded]=\"true\"\n [ariaLabel]=\"'Editar direcci\u00F3n ' + (a.address || '')\" [pTooltip]=\"'Editar direcci\u00F3n'\" tooltipPosition=\"left\"\n (onClick)=\"edit({ kind: 'address', item: a }, $event)\"></p-button>\n }\n </td>\n }\n </tr>\n </ng-template>\n <ng-template #emptymessage>\n <tr><td [attr.colspan]=\"canEdit().addresses ? 6 : 5\">La persona no tiene direcciones registradas.</td></tr>\n </ng-template>\n </p-table>\n </section>\n }\n\n @if (hasAccounts && accountsState() !== 'missing') {\n <section [attr.aria-labelledby]=\"ids.prefix + '-accounts'\" [attr.aria-busy]=\"refreshingAccounts() || null\">\n <div class=\"sfs-head\">\n <h3 [id]=\"ids.prefix + '-accounts'\" class=\"sfs-section-title\" tabindex=\"-1\"><i class=\"pi pi-wallet\" aria-hidden=\"true\"></i> Cuentas</h3>\n @if (canEdit().accounts && accountsState() === 'ready') {\n <p-button label=\"Agregar\" icon=\"pi pi-plus\" severity=\"secondary\" [text]=\"true\" ariaLabel=\"Agregar cuenta\"\n (onClick)=\"edit({ kind: 'account', item: null }, $event)\"></p-button>\n }\n </div>\n @switch (accountsState()) {\n @case ('loading') { <p-skeleton height=\"5rem\" aria-busy=\"true\"></p-skeleton> }\n @case ('error') {\n <p-message severity=\"error\">\n <div class=\"sfs-inline\">\n <span>No se pudieron cargar las cuentas.</span>\n <p-button label=\"Reintentar\" icon=\"pi pi-refresh\" [text]=\"true\" (onClick)=\"loadAccounts()\"></p-button>\n </div>\n </p-message>\n }\n @case ('ready') {\n <p-table [value]=\"accounts()\" styleClass=\"p-datatable-sm\" [scrollable]=\"true\">\n <ng-template #header>\n <tr><th>Banco</th><th>Tipo de cuenta</th><th>N\u00FAmero</th>@if (canEdit().accounts) { <th><span class=\"sfs-sr-only\">Acciones</span></th> }</tr>\n </ng-template>\n <ng-template #body let-a>\n <tr>\n <td>{{ a.bank || '\u2014' }}</td>\n <td>{{ a.accountType || '\u2014' }}</td>\n <td>\n {{ a.number || '\u2014' }}\n @if (a.primary) { <span class=\"sfs-tag-gap\"><p-tag value=\"Principal\" severity=\"info\"></p-tag></span> }\n </td>\n @if (canEdit().accounts) {\n <td class=\"sfs-row-actions\">\n @if (a.id) {\n <p-button icon=\"pi pi-pencil\" severity=\"secondary\" [text]=\"true\" [rounded]=\"true\"\n [ariaLabel]=\"'Editar cuenta ' + (a.number || '')\" [pTooltip]=\"'Editar cuenta'\" tooltipPosition=\"left\"\n (onClick)=\"edit({ kind: 'account', item: a }, $event)\"></p-button>\n }\n </td>\n }\n </tr>\n </ng-template>\n <ng-template #emptymessage>\n <tr><td [attr.colspan]=\"canEdit().accounts ? 4 : 3\">La persona no tiene cuentas registradas.</td></tr>\n </ng-template>\n </p-table>\n }\n }\n </section>\n }\n\n @if (others().length) {\n <section [attr.aria-labelledby]=\"ids.prefix + '-others'\">\n <h3 [id]=\"ids.prefix + '-others'\" class=\"sfs-section-title\"><i class=\"pi pi-users\" aria-hidden=\"true\"></i> Otras personas de la solicitud</h3>\n <p-table [value]=\"others()\" styleClass=\"p-datatable-sm\" [scrollable]=\"true\" dataKey=\"documentNumber\">\n <ng-template #header>\n <tr><th>Rol</th><th>Documento</th><th>Nombre</th><th>Identidad</th><th>Edad</th><th>Celular</th><th>Correo</th></tr>\n </ng-template>\n <ng-template #body let-p>\n <tr>\n <td>{{ p.role || '\u2014' }}</td>\n <td>{{ p.documentNumber || '\u2014' }}</td>\n <td>{{ p.name || '\u2014' }}</td>\n <td class=\"sfs-nowrap\">\n @if (identityView(p.identity); as identity) {\n <p-tag [value]=\"identity.short\" [icon]=\"identity.icon\" [severity]=\"identity.severity\"></p-tag>\n } @else { \u2014 }\n </td>\n <td>{{ p.age != null ? (p.age | number: '1.0-0' : locale) : '\u2014' }}</td>\n <td>{{ p.phone || '\u2014' }}</td>\n <td class=\"sfs-break\">{{ p.email || '\u2014' }}</td>\n </tr>\n </ng-template>\n </p-table>\n </section>\n }\n </div>\n }\n\n @if (editing(); as target) {\n <lib-person-edit-dialog [target]=\"target\" [documentType]=\"titular.documentType ?? ''\" [documentNumber]=\"titular.documentNumber\"\n [personName]=\"titular.name\" [options]=\"editOptions()\" [optionsState]=\"editOptionsState()\" (saved)=\"onEditSaved($event)\" (closed)=\"onEditClosed()\"\n (retryOptions)=\"loadEditOptions(true)\"></lib-person-edit-dialog>\n }\n } @else {\n <p-message severity=\"info\" text=\"La solicitud no tiene titular registrado.\"></p-message>\n }\n</p-card>\n", styles: [".sfs-title{margin:0;font-size:1.125rem;font-weight:600}.sfs-subtitle{margin:0;font-size:1rem;font-weight:600}.sfs-muted{color:var(--p-text-muted-color)}.sfs-section-title{display:flex;align-items:center;gap:.5rem;margin:0 0 .75rem;font-size:1rem;font-weight:600}.sfs-section-title i{color:var(--primary-color, var(--p-primary-color))}.sfs-inline{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.sfs-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.5rem;margin-bottom:.75rem}.sfs-break{overflow-wrap:anywhere}.sfs-nowrap{white-space:nowrap}.sfs-right{text-align:right}.sfs-strong{font-weight:600}.sfs-tag-gap{margin-left:.5rem}.sfs-stack{display:flex;flex-direction:column;gap:1rem}.sfs-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sfs-summary{display:grid;grid-template-columns:minmax(8rem,max-content) 1fr;gap:.25rem 1rem;margin:0}.sfs-summary dt{color:var(--p-text-muted-color)}.sfs-summary dd{margin:0;text-align:right;font-variant-numeric:tabular-nums}@media (max-width: 575px){:host ::ng-deep .sfs-stack-table .p-datatable-table-container{overflow:visible!important}:host ::ng-deep .sfs-stack-table table,:host ::ng-deep .sfs-stack-table tbody{display:block;width:100%}:host ::ng-deep .sfs-stack-table thead{display:block!important;position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%);white-space:nowrap}:host ::ng-deep .sfs-stack-table tbody tr{display:flex;flex-direction:column;margin-bottom:.5rem;padding:.5rem .75rem;border:1px solid var(--p-content-border-color);border-radius:var(--p-content-border-radius, 6px)}:host ::ng-deep .sfs-stack-table tbody td{display:flex;align-items:center;justify-content:flex-end;gap:.375rem;padding:.3rem 0;border:0;text-align:right}:host ::ng-deep .sfs-stack-table tbody td[data-label]:before{content:attr(data-label);margin-right:auto;padding-right:1rem;color:var(--p-text-muted-color);text-align:left}:host ::ng-deep .sfs-stack-table tbody td.sfs-stack-title{order:-1;display:block;font-weight:600;text-align:left}:host ::ng-deep .sfs-stack-table tfoot,:host ::ng-deep .sfs-stack-table .sfs-stack-hide{display:none}}\n", ".sfs-person-head{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.sfs-person-avatar{display:flex;align-items:center;justify-content:center;width:3.5rem;height:3.5rem;flex-shrink:0;border-radius:50%;font-size:1.25rem;font-weight:700;color:var(--primary-color, var(--p-primary-color));background:var(--p-highlight-background)}.sfs-person-main{display:flex;flex-direction:column;gap:.25rem;flex:1 1 14rem;min-width:0}@media (max-width: 575px){:host ::ng-deep .sfs-person-toggle.p-button{width:100%;justify-content:space-between}}.sfs-person-name{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem .75rem}.sfs-person-facts{display:flex;flex-wrap:wrap;gap:.25rem 1rem;font-size:.875rem;color:var(--p-text-muted-color)}.sfs-person-facts i{font-size:.8rem}.sfs-person-more{display:flex;flex-direction:column;gap:1.25rem;margin-top:1rem;padding-top:1rem;border-top:1px solid var(--p-content-border-color)}.sfs-person-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem 1rem}@media (min-width: 768px){.sfs-person-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}.sfs-dl{margin:0}.sfs-field{display:flex;flex-direction:column;min-width:0}.sfs-field dt{font-size:.8rem;color:var(--p-text-muted-color)}.sfs-field dd{margin:0;overflow-wrap:anywhere}.sfs-head .sfs-section-title{margin:0}.sfs-row-actions{width:1%;white-space:nowrap;text-align:right}.sfs-section-title:focus:not(:focus-visible){outline:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1$1.DecimalPipe, name: "number" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "component", type: i3.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: CardModule }, { kind: "component", type: i3$1.Card, selector: "p-card", inputs: ["header", "subheader", "style", "styleClass"] }, { kind: "ngmodule", type: MessageModule }, { kind: "component", type: i7.Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant"], outputs: ["onClose"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i5$1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i6$1.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "virtualRowHeight", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "ngmodule", type: TagModule }, { kind: "component", type: i7$1.Tag, selector: "p-tag", inputs: ["style", "styleClass", "severity", "value", "icon", "rounded"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i8$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: PersonEditDialogComponent, selector: "lib-person-edit-dialog", inputs: ["target", "documentType", "documentNumber", "personName", "options", "optionsState"], outputs: ["saved", "closed", "retryOptions"] }] });
828
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.17", type: ApplicationPersonComponent, isStandalone: true, selector: "lib-application-person", inputs: { parties: { classPropertyName: "parties", publicName: "parties", isSignal: true, isRequired: true, transformFunction: null }, permissions: { classPropertyName: "permissions", publicName: "permissions", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { personUpdated: "personUpdated" }, ngImport: i0, template: "<p-card>\n @if (holder(); as titular) {\n <div class=\"sfs-person-head\">\n <div class=\"sfs-person-avatar\" aria-hidden=\"true\">{{ initials() }}</div>\n <div class=\"sfs-person-main\">\n <div class=\"sfs-person-name\">\n <h2 class=\"sfs-title\">{{ titular.name || '\u2014' }}</h2>\n @if (holderIdentity(); as identity) {\n <p-tag [value]=\"identity.label\" [icon]=\"identity.icon\" [severity]=\"identity.severity\"></p-tag>\n }\n </div>\n <div class=\"sfs-person-facts\">\n <span>Documento {{ titular.documentNumber || '\u2014' }}</span>\n <span>{{ titular.age != null ? (titular.age | number: '1.0-0' : locale) + ' a\u00F1os' : 'Edad: \u2014' }}</span>\n <span class=\"sfs-person-contact\">\n <i class=\"pi pi-mobile\" aria-hidden=\"true\"></i><span class=\"sfs-sr-only\">Celular: </span> {{ titular.phone || '\u2014' }}\n @if (phoneCheck(); as check) {\n <p-tag [value]=\"check.label\" [icon]=\"check.icon\" [severity]=\"check.severity\" styleClass=\"sfs-contact-tag\"></p-tag>\n }\n </span>\n <span class=\"sfs-break sfs-person-contact\">\n <i class=\"pi pi-envelope\" aria-hidden=\"true\"></i><span class=\"sfs-sr-only\">Correo: </span> {{ titular.email || '\u2014' }}\n @if (emailCheck(); as check) {\n <p-tag [value]=\"check.label\" [icon]=\"check.icon\" [severity]=\"check.severity\" styleClass=\"sfs-contact-tag\"></p-tag>\n }\n </span>\n @if (others().length) {\n <span>{{ others().length }} {{ others().length === 1 ? 'persona m\u00E1s' : 'personas m\u00E1s' }} en la solicitud</span>\n }\n </div>\n </div>\n <!-- pButton y no p-button: el componente no deja poner aria-expanded en su <button>. -->\n <button pButton type=\"button\" class=\"sfs-person-toggle\" severity=\"secondary\" [text]=\"true\" label=\"Datos de la persona\" aria-label=\"Datos de la persona\"\n [icon]=\"expanded() ? 'pi pi-chevron-up' : 'pi pi-chevron-down'\" iconPos=\"right\"\n [attr.aria-expanded]=\"expanded()\" [attr.aria-controls]=\"ids.more\"\n (click)=\"toggle()\"></button>\n </div>\n\n @if (expanded()) {\n <div [id]=\"ids.more\" class=\"sfs-person-more\">\n <div aria-live=\"polite\">\n @if (editNotice(); as notice) {\n <p-message [severity]=\"notice.severity\" [text]=\"notice.text\"></p-message>\n }\n </div>\n\n <section [attr.aria-labelledby]=\"ids.prefix + '-general'\" [attr.aria-busy]=\"refreshingPerson() || null\">\n <div class=\"sfs-head\">\n <h3 [id]=\"ids.prefix + '-general'\" class=\"sfs-section-title\" tabindex=\"-1\"><i class=\"pi pi-id-card\" aria-hidden=\"true\"></i> Informaci\u00F3n general</h3>\n @if (canEdit().data && personState() === 'ready') {\n <p-button label=\"Editar\" icon=\"pi pi-pencil\" severity=\"secondary\" [text]=\"true\" ariaLabel=\"Editar datos b\u00E1sicos\"\n (onClick)=\"edit({ kind: 'data', item: person()?.edit ?? null }, $event)\"></p-button>\n }\n </div>\n @switch (personState()) {\n @case ('loading') {\n <div class=\"sfs-person-grid\" aria-busy=\"true\">\n @for (i of [1, 2, 3, 4, 5, 6, 7, 8]; track i) { <p-skeleton height=\"2.5rem\"></p-skeleton> }\n </div>\n }\n @case ('empty') {\n <p-message severity=\"info\" text=\"La persona no est\u00E1 registrada: se muestran solo los datos de la solicitud.\"></p-message>\n }\n @case ('missing') {\n <p-message severity=\"warn\" text=\"La solicitud no trae el tipo o el n\u00FAmero de documento del titular: no se pueden consultar sus datos.\"></p-message>\n }\n @case ('error') {\n <p-message severity=\"error\">\n <div class=\"sfs-inline\">\n <span>No se pudieron cargar los datos de la persona.</span>\n <p-button label=\"Reintentar\" icon=\"pi pi-refresh\" [text]=\"true\" (onClick)=\"loadPerson()\"></p-button>\n </div>\n </p-message>\n }\n @case ('ready') {\n <dl class=\"sfs-person-grid sfs-dl\">\n @for (field of generalFields(); track field.label) {\n <div class=\"sfs-field\">\n <dt>{{ field.label }}</dt>\n <dd>{{ field.value }}</dd>\n </div>\n }\n </dl>\n }\n }\n </section>\n\n @if (personState() === 'ready') {\n <section [attr.aria-labelledby]=\"ids.prefix + '-contact'\" [attr.aria-busy]=\"refreshingPerson() || null\">\n <div class=\"sfs-head\">\n <h3 [id]=\"ids.prefix + '-contact'\" class=\"sfs-section-title\" tabindex=\"-1\"><i class=\"pi pi-phone\" aria-hidden=\"true\"></i> Informaci\u00F3n de contacto</h3>\n @if (canEdit().contacts) {\n <p-button label=\"Agregar\" icon=\"pi pi-plus\" severity=\"secondary\" [text]=\"true\" ariaLabel=\"Agregar contacto\"\n (onClick)=\"edit({ kind: 'contact', item: null }, $event)\"></p-button>\n }\n </div>\n <p-table [value]=\"contacts()\" styleClass=\"p-datatable-sm\" [scrollable]=\"true\">\n <ng-template #header>\n <tr><th>Tipo</th><th>Descripci\u00F3n</th><th>Valor</th>@if (canEdit().contacts) { <th><span class=\"sfs-sr-only\">Acciones</span></th> }</tr>\n </ng-template>\n <ng-template #body let-c>\n <tr>\n <td>{{ c.type || '\u2014' }}</td>\n <td>{{ c.description || '\u2014' }}</td>\n <td class=\"sfs-break\">\n {{ c.value || '\u2014' }}\n @if (c.primary) { <span class=\"sfs-tag-gap\"><p-tag value=\"Principal\" severity=\"info\"></p-tag></span> }\n </td>\n @if (canEdit().contacts) {\n <td class=\"sfs-row-actions\">\n @if (c.id != null) {\n <p-button icon=\"pi pi-pencil\" severity=\"secondary\" [text]=\"true\" [rounded]=\"true\"\n [ariaLabel]=\"'Editar contacto ' + (c.value || '')\" [pTooltip]=\"'Editar contacto'\" tooltipPosition=\"left\"\n (onClick)=\"edit({ kind: 'contact', item: c }, $event)\"></p-button>\n }\n </td>\n }\n </tr>\n </ng-template>\n <ng-template #emptymessage>\n <tr><td [attr.colspan]=\"canEdit().contacts ? 4 : 3\">La persona no tiene medios de contacto registrados.</td></tr>\n </ng-template>\n </p-table>\n </section>\n\n <section [attr.aria-labelledby]=\"ids.prefix + '-address'\" [attr.aria-busy]=\"refreshingPerson() || null\">\n <div class=\"sfs-head\">\n <h3 [id]=\"ids.prefix + '-address'\" class=\"sfs-section-title\" tabindex=\"-1\"><i class=\"pi pi-home\" aria-hidden=\"true\"></i> Direcciones</h3>\n @if (canEdit().addresses) {\n <p-button label=\"Agregar\" icon=\"pi pi-plus\" severity=\"secondary\" [text]=\"true\" ariaLabel=\"Agregar direcci\u00F3n\"\n (onClick)=\"edit({ kind: 'address', item: null }, $event)\"></p-button>\n }\n </div>\n <p-table [value]=\"addresses()\" styleClass=\"p-datatable-sm\" [scrollable]=\"true\">\n <ng-template #header>\n <tr><th>Direcci\u00F3n</th><th>Pa\u00EDs</th><th>Ciudad</th><th>Barrio</th><th>Tel\u00E9fono</th>@if (canEdit().addresses) { <th><span class=\"sfs-sr-only\">Acciones</span></th> }</tr>\n </ng-template>\n <ng-template #body let-a>\n <tr>\n <td>{{ a.address || '\u2014' }}</td>\n <td>{{ a.country || '\u2014' }}</td>\n <td>{{ a.city || '\u2014' }}</td>\n <td>{{ a.neighborhood || '\u2014' }}</td>\n <td>{{ a.phone || '\u2014' }}</td>\n @if (canEdit().addresses) {\n <td class=\"sfs-row-actions\">\n @if (a.id != null) {\n <p-button icon=\"pi pi-pencil\" severity=\"secondary\" [text]=\"true\" [rounded]=\"true\"\n [ariaLabel]=\"'Editar direcci\u00F3n ' + (a.address || '')\" [pTooltip]=\"'Editar direcci\u00F3n'\" tooltipPosition=\"left\"\n (onClick)=\"edit({ kind: 'address', item: a }, $event)\"></p-button>\n }\n </td>\n }\n </tr>\n </ng-template>\n <ng-template #emptymessage>\n <tr><td [attr.colspan]=\"canEdit().addresses ? 6 : 5\">La persona no tiene direcciones registradas.</td></tr>\n </ng-template>\n </p-table>\n </section>\n }\n\n @if (hasAccounts && accountsState() !== 'missing') {\n <section [attr.aria-labelledby]=\"ids.prefix + '-accounts'\" [attr.aria-busy]=\"refreshingAccounts() || null\">\n <div class=\"sfs-head\">\n <h3 [id]=\"ids.prefix + '-accounts'\" class=\"sfs-section-title\" tabindex=\"-1\"><i class=\"pi pi-wallet\" aria-hidden=\"true\"></i> Cuentas</h3>\n @if (canEdit().accounts && accountsState() === 'ready') {\n <p-button label=\"Agregar\" icon=\"pi pi-plus\" severity=\"secondary\" [text]=\"true\" ariaLabel=\"Agregar cuenta\"\n (onClick)=\"edit({ kind: 'account', item: null }, $event)\"></p-button>\n }\n </div>\n @switch (accountsState()) {\n @case ('loading') { <p-skeleton height=\"5rem\" aria-busy=\"true\"></p-skeleton> }\n @case ('error') {\n <p-message severity=\"error\">\n <div class=\"sfs-inline\">\n <span>No se pudieron cargar las cuentas.</span>\n <p-button label=\"Reintentar\" icon=\"pi pi-refresh\" [text]=\"true\" (onClick)=\"loadAccounts()\"></p-button>\n </div>\n </p-message>\n }\n @case ('ready') {\n <p-table [value]=\"accounts()\" styleClass=\"p-datatable-sm\" [scrollable]=\"true\">\n <ng-template #header>\n <tr><th>Banco</th><th>Tipo de cuenta</th><th>N\u00FAmero</th>@if (canEdit().accounts) { <th><span class=\"sfs-sr-only\">Acciones</span></th> }</tr>\n </ng-template>\n <ng-template #body let-a>\n <tr>\n <td>{{ a.bank || '\u2014' }}</td>\n <td>{{ a.accountType || '\u2014' }}</td>\n <td>\n {{ a.number || '\u2014' }}\n @if (a.primary) { <span class=\"sfs-tag-gap\"><p-tag value=\"Principal\" severity=\"info\"></p-tag></span> }\n </td>\n @if (canEdit().accounts) {\n <td class=\"sfs-row-actions\">\n @if (a.id) {\n <p-button icon=\"pi pi-pencil\" severity=\"secondary\" [text]=\"true\" [rounded]=\"true\"\n [ariaLabel]=\"'Editar cuenta ' + (a.number || '')\" [pTooltip]=\"'Editar cuenta'\" tooltipPosition=\"left\"\n (onClick)=\"edit({ kind: 'account', item: a }, $event)\"></p-button>\n }\n </td>\n }\n </tr>\n </ng-template>\n <ng-template #emptymessage>\n <tr><td [attr.colspan]=\"canEdit().accounts ? 4 : 3\">La persona no tiene cuentas registradas.</td></tr>\n </ng-template>\n </p-table>\n }\n }\n </section>\n }\n\n @if (others().length) {\n <section [attr.aria-labelledby]=\"ids.prefix + '-others'\">\n <h3 [id]=\"ids.prefix + '-others'\" class=\"sfs-section-title\"><i class=\"pi pi-users\" aria-hidden=\"true\"></i> Otras personas de la solicitud</h3>\n <p-table [value]=\"others()\" styleClass=\"p-datatable-sm\" [scrollable]=\"true\" dataKey=\"documentNumber\">\n <ng-template #header>\n <tr><th>Rol</th><th>Documento</th><th>Nombre</th><th>Edad</th><th>Celular</th><th>Correo</th></tr>\n </ng-template>\n <ng-template #body let-p>\n <tr>\n <td>{{ p.role || '\u2014' }}</td>\n <td>{{ p.documentNumber || '\u2014' }}</td>\n <td>{{ p.name || '\u2014' }}</td>\n <td>{{ p.age != null ? (p.age | number: '1.0-0' : locale) : '\u2014' }}</td>\n <td>{{ p.phone || '\u2014' }}</td>\n <td class=\"sfs-break\">{{ p.email || '\u2014' }}</td>\n </tr>\n </ng-template>\n </p-table>\n </section>\n }\n </div>\n }\n\n @if (editing(); as target) {\n <lib-person-edit-dialog [target]=\"target\" [documentType]=\"titular.documentType ?? ''\" [documentNumber]=\"titular.documentNumber\"\n [personName]=\"titular.name\" [options]=\"editOptions()\" [optionsState]=\"editOptionsState()\" (saved)=\"onEditSaved($event)\" (closed)=\"onEditClosed()\"\n (retryOptions)=\"loadEditOptions(true)\"></lib-person-edit-dialog>\n }\n } @else {\n <p-message severity=\"info\" text=\"La solicitud no tiene titular registrado.\"></p-message>\n }\n</p-card>\n", styles: [".sfs-title{margin:0;font-size:1.125rem;font-weight:600}.sfs-subtitle{margin:0;font-size:1rem;font-weight:600}.sfs-muted{color:var(--p-text-muted-color)}.sfs-section-title{display:flex;align-items:center;gap:.5rem;margin:0 0 .75rem;font-size:1rem;font-weight:600}.sfs-section-title i{color:var(--primary-color, var(--p-primary-color))}.sfs-inline{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.sfs-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.5rem;margin-bottom:.75rem}.sfs-break{overflow-wrap:anywhere}.sfs-nowrap{white-space:nowrap}.sfs-right{text-align:right}.sfs-strong{font-weight:600}.sfs-tag-gap{margin-left:.5rem}.sfs-stack{display:flex;flex-direction:column;gap:1rem}.sfs-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sfs-summary{display:grid;grid-template-columns:minmax(8rem,max-content) 1fr;gap:.25rem 1rem;margin:0}.sfs-summary dt{color:var(--p-text-muted-color)}.sfs-summary dd{margin:0;text-align:right;font-variant-numeric:tabular-nums}@media (max-width: 575px){:host ::ng-deep .sfs-stack-table .p-datatable-table-container{overflow:visible!important}:host ::ng-deep .sfs-stack-table table,:host ::ng-deep .sfs-stack-table tbody{display:block;width:100%}:host ::ng-deep .sfs-stack-table thead{display:block!important;position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%);white-space:nowrap}:host ::ng-deep .sfs-stack-table tbody tr{display:flex;flex-direction:column;margin-bottom:.5rem;padding:.5rem .75rem;border:1px solid var(--p-content-border-color);border-radius:var(--p-content-border-radius, 6px)}:host ::ng-deep .sfs-stack-table tbody td{display:flex;align-items:center;justify-content:flex-end;gap:.375rem;padding:.3rem 0;border:0;text-align:right}:host ::ng-deep .sfs-stack-table tbody td[data-label]:before{content:attr(data-label);margin-right:auto;padding-right:1rem;color:var(--p-text-muted-color);text-align:left}:host ::ng-deep .sfs-stack-table tbody td.sfs-stack-title{order:-1;display:block;font-weight:600;text-align:left}:host ::ng-deep .sfs-stack-table tfoot,:host ::ng-deep .sfs-stack-table .sfs-stack-hide{display:none}}\n", ".sfs-person-head{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.sfs-person-avatar{display:flex;align-items:center;justify-content:center;width:3.5rem;height:3.5rem;flex-shrink:0;border-radius:50%;font-size:1.25rem;font-weight:700;color:var(--primary-color, var(--p-primary-color));background:var(--p-highlight-background)}.sfs-person-main{display:flex;flex-direction:column;gap:.25rem;flex:1 1 14rem;min-width:0}@media (max-width: 575px){:host ::ng-deep .sfs-person-toggle.p-button{width:100%;justify-content:space-between}}.sfs-person-name{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem .75rem}.sfs-person-facts{display:flex;flex-wrap:wrap;gap:.25rem 1rem;font-size:.875rem;color:var(--p-text-muted-color)}.sfs-person-facts i{font-size:.8rem}.sfs-person-contact{display:inline-flex;flex-wrap:wrap;align-items:center;gap:.35rem}:host ::ng-deep .sfs-contact-tag{font-size:.75rem;padding:.1rem .4rem}.sfs-person-more{display:flex;flex-direction:column;gap:1.25rem;margin-top:1rem;padding-top:1rem;border-top:1px solid var(--p-content-border-color)}.sfs-person-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem 1rem}@media (min-width: 768px){.sfs-person-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}.sfs-dl{margin:0}.sfs-field{display:flex;flex-direction:column;min-width:0}.sfs-field dt{font-size:.8rem;color:var(--p-text-muted-color)}.sfs-field dd{margin:0;overflow-wrap:anywhere}.sfs-head .sfs-section-title{margin:0}.sfs-row-actions{width:1%;white-space:nowrap;text-align:right}.sfs-section-title:focus:not(:focus-visible){outline:none}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "pipe", type: i1$1.DecimalPipe, name: "number" }, { kind: "ngmodule", type: ButtonModule }, { kind: "directive", type: i3.ButtonDirective, selector: "[pButton]", inputs: ["iconPos", "loadingIcon", "loading", "severity", "raised", "rounded", "text", "outlined", "size", "plain", "fluid", "label", "icon", "buttonProps"] }, { kind: "component", type: i3.Button, selector: "p-button", inputs: ["type", "iconPos", "icon", "badge", "label", "disabled", "loading", "loadingIcon", "raised", "rounded", "text", "plain", "severity", "outlined", "link", "tabindex", "size", "variant", "style", "styleClass", "badgeClass", "badgeSeverity", "ariaLabel", "autofocus", "fluid", "buttonProps"], outputs: ["onClick", "onFocus", "onBlur"] }, { kind: "ngmodule", type: CardModule }, { kind: "component", type: i3$1.Card, selector: "p-card", inputs: ["header", "subheader", "style", "styleClass"] }, { kind: "ngmodule", type: MessageModule }, { kind: "component", type: i7.Message, selector: "p-message", inputs: ["severity", "text", "escape", "style", "styleClass", "closable", "icon", "closeIcon", "life", "showTransitionOptions", "hideTransitionOptions", "size", "variant"], outputs: ["onClose"] }, { kind: "ngmodule", type: SkeletonModule }, { kind: "component", type: i5$1.Skeleton, selector: "p-skeleton", inputs: ["styleClass", "style", "shape", "animation", "borderRadius", "size", "width", "height"] }, { kind: "ngmodule", type: TableModule }, { kind: "component", type: i6$1.Table, selector: "p-table", inputs: ["frozenColumns", "frozenValue", "style", "styleClass", "tableStyle", "tableStyleClass", "paginator", "pageLinks", "rowsPerPageOptions", "alwaysShowPaginator", "paginatorPosition", "paginatorStyleClass", "paginatorDropdownAppendTo", "paginatorDropdownScrollHeight", "currentPageReportTemplate", "showCurrentPageReport", "showJumpToPageDropdown", "showJumpToPageInput", "showFirstLastIcon", "showPageLinks", "defaultSortOrder", "sortMode", "resetPageOnSort", "selectionMode", "selectionPageOnly", "contextMenuSelection", "contextMenuSelectionMode", "dataKey", "metaKeySelection", "rowSelectable", "rowTrackBy", "lazy", "lazyLoadOnInit", "compareSelectionBy", "csvSeparator", "exportFilename", "filters", "globalFilterFields", "filterDelay", "filterLocale", "expandedRowKeys", "editingRowKeys", "rowExpandMode", "scrollable", "scrollDirection", "rowGroupMode", "scrollHeight", "virtualScroll", "virtualScrollItemSize", "virtualScrollOptions", "virtualScrollDelay", "frozenWidth", "responsive", "contextMenu", "resizableColumns", "columnResizeMode", "reorderableColumns", "loading", "loadingIcon", "showLoader", "rowHover", "customSort", "showInitialSortBadge", "autoLayout", "exportFunction", "exportHeader", "stateKey", "stateStorage", "editMode", "groupRowsBy", "size", "showGridlines", "stripedRows", "groupRowsByOrder", "responsiveLayout", "breakpoint", "paginatorLocale", "value", "columns", "first", "rows", "totalRecords", "sortField", "sortOrder", "multiSortMeta", "selection", "virtualRowHeight", "selectAll"], outputs: ["contextMenuSelectionChange", "selectAllChange", "selectionChange", "onRowSelect", "onRowUnselect", "onPage", "onSort", "onFilter", "onLazyLoad", "onRowExpand", "onRowCollapse", "onContextMenuSelect", "onColResize", "onColReorder", "onRowReorder", "onEditInit", "onEditComplete", "onEditCancel", "onHeaderCheckboxToggle", "sortFunction", "firstChange", "rowsChange", "onStateSave", "onStateRestore"] }, { kind: "ngmodule", type: TagModule }, { kind: "component", type: i7$1.Tag, selector: "p-tag", inputs: ["style", "styleClass", "severity", "value", "icon", "rounded"] }, { kind: "ngmodule", type: TooltipModule }, { kind: "directive", type: i8$1.Tooltip, selector: "[pTooltip]", inputs: ["tooltipPosition", "tooltipEvent", "appendTo", "positionStyle", "tooltipStyleClass", "tooltipZIndex", "escape", "showDelay", "hideDelay", "life", "positionTop", "positionLeft", "autoHide", "fitContent", "hideOnEscape", "pTooltip", "tooltipDisabled", "tooltipOptions"] }, { kind: "component", type: PersonEditDialogComponent, selector: "lib-person-edit-dialog", inputs: ["target", "documentType", "documentNumber", "personName", "options", "optionsState"], outputs: ["saved", "closed", "retryOptions"] }] });
796
829
  }
797
830
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.17", ngImport: i0, type: ApplicationPersonComponent, decorators: [{
798
831
  type: Component,
799
- args: [{ selector: 'lib-application-person', imports: [CommonModule, ButtonModule, CardModule, MessageModule, SkeletonModule, TableModule, TagModule, TooltipModule, PersonEditDialogComponent], template: "<p-card>\n @if (holder(); as titular) {\n <div class=\"sfs-person-head\">\n <div class=\"sfs-person-avatar\" aria-hidden=\"true\">{{ initials() }}</div>\n <div class=\"sfs-person-main\">\n <div class=\"sfs-person-name\">\n <h2 class=\"sfs-title\">{{ titular.name || '\u2014' }}</h2>\n @if (holderIdentity(); as identity) {\n <p-tag [value]=\"identity.label\" [icon]=\"identity.icon\" [severity]=\"identity.severity\"></p-tag>\n }\n </div>\n <div class=\"sfs-person-facts\">\n <span>Documento {{ titular.documentNumber || '\u2014' }}</span>\n <span>{{ titular.age != null ? (titular.age | number: '1.0-0' : locale) + ' a\u00F1os' : 'Edad: \u2014' }}</span>\n <span><i class=\"pi pi-mobile\" aria-hidden=\"true\"></i><span class=\"sfs-sr-only\">Celular: </span> {{ titular.phone || '\u2014' }}</span>\n <span class=\"sfs-break\"><i class=\"pi pi-envelope\" aria-hidden=\"true\"></i><span class=\"sfs-sr-only\">Correo: </span> {{ titular.email || '\u2014' }}</span>\n @if (others().length) {\n <span>{{ others().length }} {{ others().length === 1 ? 'persona m\u00E1s' : 'personas m\u00E1s' }} en la solicitud</span>\n }\n </div>\n </div>\n <!-- pButton y no p-button: el componente no deja poner aria-expanded en su <button>. -->\n <button pButton type=\"button\" class=\"sfs-person-toggle\" severity=\"secondary\" [text]=\"true\" label=\"Datos de la persona\" aria-label=\"Datos de la persona\"\n [icon]=\"expanded() ? 'pi pi-chevron-up' : 'pi pi-chevron-down'\" iconPos=\"right\"\n [attr.aria-expanded]=\"expanded()\" [attr.aria-controls]=\"ids.more\"\n (click)=\"toggle()\"></button>\n </div>\n\n @if (expanded()) {\n <div [id]=\"ids.more\" class=\"sfs-person-more\">\n <div aria-live=\"polite\">\n @if (editNotice(); as notice) {\n <p-message [severity]=\"notice.severity\" [text]=\"notice.text\"></p-message>\n }\n </div>\n\n <section [attr.aria-labelledby]=\"ids.prefix + '-general'\" [attr.aria-busy]=\"refreshingPerson() || null\">\n <div class=\"sfs-head\">\n <h3 [id]=\"ids.prefix + '-general'\" class=\"sfs-section-title\" tabindex=\"-1\"><i class=\"pi pi-id-card\" aria-hidden=\"true\"></i> Informaci\u00F3n general</h3>\n @if (canEdit().data && personState() === 'ready') {\n <p-button label=\"Editar\" icon=\"pi pi-pencil\" severity=\"secondary\" [text]=\"true\" ariaLabel=\"Editar datos b\u00E1sicos\"\n (onClick)=\"edit({ kind: 'data', item: person()?.edit ?? null }, $event)\"></p-button>\n }\n </div>\n @switch (personState()) {\n @case ('loading') {\n <div class=\"sfs-person-grid\" aria-busy=\"true\">\n @for (i of [1, 2, 3, 4, 5, 6, 7, 8]; track i) { <p-skeleton height=\"2.5rem\"></p-skeleton> }\n </div>\n }\n @case ('empty') {\n <p-message severity=\"info\" text=\"La persona no est\u00E1 registrada: se muestran solo los datos de la solicitud.\"></p-message>\n }\n @case ('missing') {\n <p-message severity=\"warn\" text=\"La solicitud no trae el tipo o el n\u00FAmero de documento del titular: no se pueden consultar sus datos.\"></p-message>\n }\n @case ('error') {\n <p-message severity=\"error\">\n <div class=\"sfs-inline\">\n <span>No se pudieron cargar los datos de la persona.</span>\n <p-button label=\"Reintentar\" icon=\"pi pi-refresh\" [text]=\"true\" (onClick)=\"loadPerson()\"></p-button>\n </div>\n </p-message>\n }\n @case ('ready') {\n <dl class=\"sfs-person-grid sfs-dl\">\n @for (field of generalFields(); track field.label) {\n <div class=\"sfs-field\">\n <dt>{{ field.label }}</dt>\n <dd>{{ field.value }}</dd>\n </div>\n }\n </dl>\n }\n }\n </section>\n\n @if (personState() === 'ready') {\n <section [attr.aria-labelledby]=\"ids.prefix + '-contact'\" [attr.aria-busy]=\"refreshingPerson() || null\">\n <div class=\"sfs-head\">\n <h3 [id]=\"ids.prefix + '-contact'\" class=\"sfs-section-title\" tabindex=\"-1\"><i class=\"pi pi-phone\" aria-hidden=\"true\"></i> Informaci\u00F3n de contacto</h3>\n @if (canEdit().contacts) {\n <p-button label=\"Agregar\" icon=\"pi pi-plus\" severity=\"secondary\" [text]=\"true\" ariaLabel=\"Agregar contacto\"\n (onClick)=\"edit({ kind: 'contact', item: null }, $event)\"></p-button>\n }\n </div>\n <p-table [value]=\"contacts()\" styleClass=\"p-datatable-sm\" [scrollable]=\"true\">\n <ng-template #header>\n <tr><th>Tipo</th><th>Descripci\u00F3n</th><th>Valor</th>@if (canEdit().contacts) { <th><span class=\"sfs-sr-only\">Acciones</span></th> }</tr>\n </ng-template>\n <ng-template #body let-c>\n <tr>\n <td>{{ c.type || '\u2014' }}</td>\n <td>{{ c.description || '\u2014' }}</td>\n <td class=\"sfs-break\">\n {{ c.value || '\u2014' }}\n @if (c.primary) { <span class=\"sfs-tag-gap\"><p-tag value=\"Principal\" severity=\"info\"></p-tag></span> }\n </td>\n @if (canEdit().contacts) {\n <td class=\"sfs-row-actions\">\n @if (c.id != null) {\n <p-button icon=\"pi pi-pencil\" severity=\"secondary\" [text]=\"true\" [rounded]=\"true\"\n [ariaLabel]=\"'Editar contacto ' + (c.value || '')\" [pTooltip]=\"'Editar contacto'\" tooltipPosition=\"left\"\n (onClick)=\"edit({ kind: 'contact', item: c }, $event)\"></p-button>\n }\n </td>\n }\n </tr>\n </ng-template>\n <ng-template #emptymessage>\n <tr><td [attr.colspan]=\"canEdit().contacts ? 4 : 3\">La persona no tiene medios de contacto registrados.</td></tr>\n </ng-template>\n </p-table>\n </section>\n\n <section [attr.aria-labelledby]=\"ids.prefix + '-address'\" [attr.aria-busy]=\"refreshingPerson() || null\">\n <div class=\"sfs-head\">\n <h3 [id]=\"ids.prefix + '-address'\" class=\"sfs-section-title\" tabindex=\"-1\"><i class=\"pi pi-home\" aria-hidden=\"true\"></i> Direcciones</h3>\n @if (canEdit().addresses) {\n <p-button label=\"Agregar\" icon=\"pi pi-plus\" severity=\"secondary\" [text]=\"true\" ariaLabel=\"Agregar direcci\u00F3n\"\n (onClick)=\"edit({ kind: 'address', item: null }, $event)\"></p-button>\n }\n </div>\n <p-table [value]=\"addresses()\" styleClass=\"p-datatable-sm\" [scrollable]=\"true\">\n <ng-template #header>\n <tr><th>Direcci\u00F3n</th><th>Pa\u00EDs</th><th>Ciudad</th><th>Barrio</th><th>Tel\u00E9fono</th>@if (canEdit().addresses) { <th><span class=\"sfs-sr-only\">Acciones</span></th> }</tr>\n </ng-template>\n <ng-template #body let-a>\n <tr>\n <td>{{ a.address || '\u2014' }}</td>\n <td>{{ a.country || '\u2014' }}</td>\n <td>{{ a.city || '\u2014' }}</td>\n <td>{{ a.neighborhood || '\u2014' }}</td>\n <td>{{ a.phone || '\u2014' }}</td>\n @if (canEdit().addresses) {\n <td class=\"sfs-row-actions\">\n @if (a.id != null) {\n <p-button icon=\"pi pi-pencil\" severity=\"secondary\" [text]=\"true\" [rounded]=\"true\"\n [ariaLabel]=\"'Editar direcci\u00F3n ' + (a.address || '')\" [pTooltip]=\"'Editar direcci\u00F3n'\" tooltipPosition=\"left\"\n (onClick)=\"edit({ kind: 'address', item: a }, $event)\"></p-button>\n }\n </td>\n }\n </tr>\n </ng-template>\n <ng-template #emptymessage>\n <tr><td [attr.colspan]=\"canEdit().addresses ? 6 : 5\">La persona no tiene direcciones registradas.</td></tr>\n </ng-template>\n </p-table>\n </section>\n }\n\n @if (hasAccounts && accountsState() !== 'missing') {\n <section [attr.aria-labelledby]=\"ids.prefix + '-accounts'\" [attr.aria-busy]=\"refreshingAccounts() || null\">\n <div class=\"sfs-head\">\n <h3 [id]=\"ids.prefix + '-accounts'\" class=\"sfs-section-title\" tabindex=\"-1\"><i class=\"pi pi-wallet\" aria-hidden=\"true\"></i> Cuentas</h3>\n @if (canEdit().accounts && accountsState() === 'ready') {\n <p-button label=\"Agregar\" icon=\"pi pi-plus\" severity=\"secondary\" [text]=\"true\" ariaLabel=\"Agregar cuenta\"\n (onClick)=\"edit({ kind: 'account', item: null }, $event)\"></p-button>\n }\n </div>\n @switch (accountsState()) {\n @case ('loading') { <p-skeleton height=\"5rem\" aria-busy=\"true\"></p-skeleton> }\n @case ('error') {\n <p-message severity=\"error\">\n <div class=\"sfs-inline\">\n <span>No se pudieron cargar las cuentas.</span>\n <p-button label=\"Reintentar\" icon=\"pi pi-refresh\" [text]=\"true\" (onClick)=\"loadAccounts()\"></p-button>\n </div>\n </p-message>\n }\n @case ('ready') {\n <p-table [value]=\"accounts()\" styleClass=\"p-datatable-sm\" [scrollable]=\"true\">\n <ng-template #header>\n <tr><th>Banco</th><th>Tipo de cuenta</th><th>N\u00FAmero</th>@if (canEdit().accounts) { <th><span class=\"sfs-sr-only\">Acciones</span></th> }</tr>\n </ng-template>\n <ng-template #body let-a>\n <tr>\n <td>{{ a.bank || '\u2014' }}</td>\n <td>{{ a.accountType || '\u2014' }}</td>\n <td>\n {{ a.number || '\u2014' }}\n @if (a.primary) { <span class=\"sfs-tag-gap\"><p-tag value=\"Principal\" severity=\"info\"></p-tag></span> }\n </td>\n @if (canEdit().accounts) {\n <td class=\"sfs-row-actions\">\n @if (a.id) {\n <p-button icon=\"pi pi-pencil\" severity=\"secondary\" [text]=\"true\" [rounded]=\"true\"\n [ariaLabel]=\"'Editar cuenta ' + (a.number || '')\" [pTooltip]=\"'Editar cuenta'\" tooltipPosition=\"left\"\n (onClick)=\"edit({ kind: 'account', item: a }, $event)\"></p-button>\n }\n </td>\n }\n </tr>\n </ng-template>\n <ng-template #emptymessage>\n <tr><td [attr.colspan]=\"canEdit().accounts ? 4 : 3\">La persona no tiene cuentas registradas.</td></tr>\n </ng-template>\n </p-table>\n }\n }\n </section>\n }\n\n @if (others().length) {\n <section [attr.aria-labelledby]=\"ids.prefix + '-others'\">\n <h3 [id]=\"ids.prefix + '-others'\" class=\"sfs-section-title\"><i class=\"pi pi-users\" aria-hidden=\"true\"></i> Otras personas de la solicitud</h3>\n <p-table [value]=\"others()\" styleClass=\"p-datatable-sm\" [scrollable]=\"true\" dataKey=\"documentNumber\">\n <ng-template #header>\n <tr><th>Rol</th><th>Documento</th><th>Nombre</th><th>Identidad</th><th>Edad</th><th>Celular</th><th>Correo</th></tr>\n </ng-template>\n <ng-template #body let-p>\n <tr>\n <td>{{ p.role || '\u2014' }}</td>\n <td>{{ p.documentNumber || '\u2014' }}</td>\n <td>{{ p.name || '\u2014' }}</td>\n <td class=\"sfs-nowrap\">\n @if (identityView(p.identity); as identity) {\n <p-tag [value]=\"identity.short\" [icon]=\"identity.icon\" [severity]=\"identity.severity\"></p-tag>\n } @else { \u2014 }\n </td>\n <td>{{ p.age != null ? (p.age | number: '1.0-0' : locale) : '\u2014' }}</td>\n <td>{{ p.phone || '\u2014' }}</td>\n <td class=\"sfs-break\">{{ p.email || '\u2014' }}</td>\n </tr>\n </ng-template>\n </p-table>\n </section>\n }\n </div>\n }\n\n @if (editing(); as target) {\n <lib-person-edit-dialog [target]=\"target\" [documentType]=\"titular.documentType ?? ''\" [documentNumber]=\"titular.documentNumber\"\n [personName]=\"titular.name\" [options]=\"editOptions()\" [optionsState]=\"editOptionsState()\" (saved)=\"onEditSaved($event)\" (closed)=\"onEditClosed()\"\n (retryOptions)=\"loadEditOptions(true)\"></lib-person-edit-dialog>\n }\n } @else {\n <p-message severity=\"info\" text=\"La solicitud no tiene titular registrado.\"></p-message>\n }\n</p-card>\n", styles: [".sfs-title{margin:0;font-size:1.125rem;font-weight:600}.sfs-subtitle{margin:0;font-size:1rem;font-weight:600}.sfs-muted{color:var(--p-text-muted-color)}.sfs-section-title{display:flex;align-items:center;gap:.5rem;margin:0 0 .75rem;font-size:1rem;font-weight:600}.sfs-section-title i{color:var(--primary-color, var(--p-primary-color))}.sfs-inline{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.sfs-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.5rem;margin-bottom:.75rem}.sfs-break{overflow-wrap:anywhere}.sfs-nowrap{white-space:nowrap}.sfs-right{text-align:right}.sfs-strong{font-weight:600}.sfs-tag-gap{margin-left:.5rem}.sfs-stack{display:flex;flex-direction:column;gap:1rem}.sfs-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sfs-summary{display:grid;grid-template-columns:minmax(8rem,max-content) 1fr;gap:.25rem 1rem;margin:0}.sfs-summary dt{color:var(--p-text-muted-color)}.sfs-summary dd{margin:0;text-align:right;font-variant-numeric:tabular-nums}@media (max-width: 575px){:host ::ng-deep .sfs-stack-table .p-datatable-table-container{overflow:visible!important}:host ::ng-deep .sfs-stack-table table,:host ::ng-deep .sfs-stack-table tbody{display:block;width:100%}:host ::ng-deep .sfs-stack-table thead{display:block!important;position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%);white-space:nowrap}:host ::ng-deep .sfs-stack-table tbody tr{display:flex;flex-direction:column;margin-bottom:.5rem;padding:.5rem .75rem;border:1px solid var(--p-content-border-color);border-radius:var(--p-content-border-radius, 6px)}:host ::ng-deep .sfs-stack-table tbody td{display:flex;align-items:center;justify-content:flex-end;gap:.375rem;padding:.3rem 0;border:0;text-align:right}:host ::ng-deep .sfs-stack-table tbody td[data-label]:before{content:attr(data-label);margin-right:auto;padding-right:1rem;color:var(--p-text-muted-color);text-align:left}:host ::ng-deep .sfs-stack-table tbody td.sfs-stack-title{order:-1;display:block;font-weight:600;text-align:left}:host ::ng-deep .sfs-stack-table tfoot,:host ::ng-deep .sfs-stack-table .sfs-stack-hide{display:none}}\n", ".sfs-person-head{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.sfs-person-avatar{display:flex;align-items:center;justify-content:center;width:3.5rem;height:3.5rem;flex-shrink:0;border-radius:50%;font-size:1.25rem;font-weight:700;color:var(--primary-color, var(--p-primary-color));background:var(--p-highlight-background)}.sfs-person-main{display:flex;flex-direction:column;gap:.25rem;flex:1 1 14rem;min-width:0}@media (max-width: 575px){:host ::ng-deep .sfs-person-toggle.p-button{width:100%;justify-content:space-between}}.sfs-person-name{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem .75rem}.sfs-person-facts{display:flex;flex-wrap:wrap;gap:.25rem 1rem;font-size:.875rem;color:var(--p-text-muted-color)}.sfs-person-facts i{font-size:.8rem}.sfs-person-more{display:flex;flex-direction:column;gap:1.25rem;margin-top:1rem;padding-top:1rem;border-top:1px solid var(--p-content-border-color)}.sfs-person-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem 1rem}@media (min-width: 768px){.sfs-person-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}.sfs-dl{margin:0}.sfs-field{display:flex;flex-direction:column;min-width:0}.sfs-field dt{font-size:.8rem;color:var(--p-text-muted-color)}.sfs-field dd{margin:0;overflow-wrap:anywhere}.sfs-head .sfs-section-title{margin:0}.sfs-row-actions{width:1%;white-space:nowrap;text-align:right}.sfs-section-title:focus:not(:focus-visible){outline:none}\n"] }]
832
+ args: [{ selector: 'lib-application-person', imports: [CommonModule, ButtonModule, CardModule, MessageModule, SkeletonModule, TableModule, TagModule, TooltipModule, PersonEditDialogComponent], template: "<p-card>\n @if (holder(); as titular) {\n <div class=\"sfs-person-head\">\n <div class=\"sfs-person-avatar\" aria-hidden=\"true\">{{ initials() }}</div>\n <div class=\"sfs-person-main\">\n <div class=\"sfs-person-name\">\n <h2 class=\"sfs-title\">{{ titular.name || '\u2014' }}</h2>\n @if (holderIdentity(); as identity) {\n <p-tag [value]=\"identity.label\" [icon]=\"identity.icon\" [severity]=\"identity.severity\"></p-tag>\n }\n </div>\n <div class=\"sfs-person-facts\">\n <span>Documento {{ titular.documentNumber || '\u2014' }}</span>\n <span>{{ titular.age != null ? (titular.age | number: '1.0-0' : locale) + ' a\u00F1os' : 'Edad: \u2014' }}</span>\n <span class=\"sfs-person-contact\">\n <i class=\"pi pi-mobile\" aria-hidden=\"true\"></i><span class=\"sfs-sr-only\">Celular: </span> {{ titular.phone || '\u2014' }}\n @if (phoneCheck(); as check) {\n <p-tag [value]=\"check.label\" [icon]=\"check.icon\" [severity]=\"check.severity\" styleClass=\"sfs-contact-tag\"></p-tag>\n }\n </span>\n <span class=\"sfs-break sfs-person-contact\">\n <i class=\"pi pi-envelope\" aria-hidden=\"true\"></i><span class=\"sfs-sr-only\">Correo: </span> {{ titular.email || '\u2014' }}\n @if (emailCheck(); as check) {\n <p-tag [value]=\"check.label\" [icon]=\"check.icon\" [severity]=\"check.severity\" styleClass=\"sfs-contact-tag\"></p-tag>\n }\n </span>\n @if (others().length) {\n <span>{{ others().length }} {{ others().length === 1 ? 'persona m\u00E1s' : 'personas m\u00E1s' }} en la solicitud</span>\n }\n </div>\n </div>\n <!-- pButton y no p-button: el componente no deja poner aria-expanded en su <button>. -->\n <button pButton type=\"button\" class=\"sfs-person-toggle\" severity=\"secondary\" [text]=\"true\" label=\"Datos de la persona\" aria-label=\"Datos de la persona\"\n [icon]=\"expanded() ? 'pi pi-chevron-up' : 'pi pi-chevron-down'\" iconPos=\"right\"\n [attr.aria-expanded]=\"expanded()\" [attr.aria-controls]=\"ids.more\"\n (click)=\"toggle()\"></button>\n </div>\n\n @if (expanded()) {\n <div [id]=\"ids.more\" class=\"sfs-person-more\">\n <div aria-live=\"polite\">\n @if (editNotice(); as notice) {\n <p-message [severity]=\"notice.severity\" [text]=\"notice.text\"></p-message>\n }\n </div>\n\n <section [attr.aria-labelledby]=\"ids.prefix + '-general'\" [attr.aria-busy]=\"refreshingPerson() || null\">\n <div class=\"sfs-head\">\n <h3 [id]=\"ids.prefix + '-general'\" class=\"sfs-section-title\" tabindex=\"-1\"><i class=\"pi pi-id-card\" aria-hidden=\"true\"></i> Informaci\u00F3n general</h3>\n @if (canEdit().data && personState() === 'ready') {\n <p-button label=\"Editar\" icon=\"pi pi-pencil\" severity=\"secondary\" [text]=\"true\" ariaLabel=\"Editar datos b\u00E1sicos\"\n (onClick)=\"edit({ kind: 'data', item: person()?.edit ?? null }, $event)\"></p-button>\n }\n </div>\n @switch (personState()) {\n @case ('loading') {\n <div class=\"sfs-person-grid\" aria-busy=\"true\">\n @for (i of [1, 2, 3, 4, 5, 6, 7, 8]; track i) { <p-skeleton height=\"2.5rem\"></p-skeleton> }\n </div>\n }\n @case ('empty') {\n <p-message severity=\"info\" text=\"La persona no est\u00E1 registrada: se muestran solo los datos de la solicitud.\"></p-message>\n }\n @case ('missing') {\n <p-message severity=\"warn\" text=\"La solicitud no trae el tipo o el n\u00FAmero de documento del titular: no se pueden consultar sus datos.\"></p-message>\n }\n @case ('error') {\n <p-message severity=\"error\">\n <div class=\"sfs-inline\">\n <span>No se pudieron cargar los datos de la persona.</span>\n <p-button label=\"Reintentar\" icon=\"pi pi-refresh\" [text]=\"true\" (onClick)=\"loadPerson()\"></p-button>\n </div>\n </p-message>\n }\n @case ('ready') {\n <dl class=\"sfs-person-grid sfs-dl\">\n @for (field of generalFields(); track field.label) {\n <div class=\"sfs-field\">\n <dt>{{ field.label }}</dt>\n <dd>{{ field.value }}</dd>\n </div>\n }\n </dl>\n }\n }\n </section>\n\n @if (personState() === 'ready') {\n <section [attr.aria-labelledby]=\"ids.prefix + '-contact'\" [attr.aria-busy]=\"refreshingPerson() || null\">\n <div class=\"sfs-head\">\n <h3 [id]=\"ids.prefix + '-contact'\" class=\"sfs-section-title\" tabindex=\"-1\"><i class=\"pi pi-phone\" aria-hidden=\"true\"></i> Informaci\u00F3n de contacto</h3>\n @if (canEdit().contacts) {\n <p-button label=\"Agregar\" icon=\"pi pi-plus\" severity=\"secondary\" [text]=\"true\" ariaLabel=\"Agregar contacto\"\n (onClick)=\"edit({ kind: 'contact', item: null }, $event)\"></p-button>\n }\n </div>\n <p-table [value]=\"contacts()\" styleClass=\"p-datatable-sm\" [scrollable]=\"true\">\n <ng-template #header>\n <tr><th>Tipo</th><th>Descripci\u00F3n</th><th>Valor</th>@if (canEdit().contacts) { <th><span class=\"sfs-sr-only\">Acciones</span></th> }</tr>\n </ng-template>\n <ng-template #body let-c>\n <tr>\n <td>{{ c.type || '\u2014' }}</td>\n <td>{{ c.description || '\u2014' }}</td>\n <td class=\"sfs-break\">\n {{ c.value || '\u2014' }}\n @if (c.primary) { <span class=\"sfs-tag-gap\"><p-tag value=\"Principal\" severity=\"info\"></p-tag></span> }\n </td>\n @if (canEdit().contacts) {\n <td class=\"sfs-row-actions\">\n @if (c.id != null) {\n <p-button icon=\"pi pi-pencil\" severity=\"secondary\" [text]=\"true\" [rounded]=\"true\"\n [ariaLabel]=\"'Editar contacto ' + (c.value || '')\" [pTooltip]=\"'Editar contacto'\" tooltipPosition=\"left\"\n (onClick)=\"edit({ kind: 'contact', item: c }, $event)\"></p-button>\n }\n </td>\n }\n </tr>\n </ng-template>\n <ng-template #emptymessage>\n <tr><td [attr.colspan]=\"canEdit().contacts ? 4 : 3\">La persona no tiene medios de contacto registrados.</td></tr>\n </ng-template>\n </p-table>\n </section>\n\n <section [attr.aria-labelledby]=\"ids.prefix + '-address'\" [attr.aria-busy]=\"refreshingPerson() || null\">\n <div class=\"sfs-head\">\n <h3 [id]=\"ids.prefix + '-address'\" class=\"sfs-section-title\" tabindex=\"-1\"><i class=\"pi pi-home\" aria-hidden=\"true\"></i> Direcciones</h3>\n @if (canEdit().addresses) {\n <p-button label=\"Agregar\" icon=\"pi pi-plus\" severity=\"secondary\" [text]=\"true\" ariaLabel=\"Agregar direcci\u00F3n\"\n (onClick)=\"edit({ kind: 'address', item: null }, $event)\"></p-button>\n }\n </div>\n <p-table [value]=\"addresses()\" styleClass=\"p-datatable-sm\" [scrollable]=\"true\">\n <ng-template #header>\n <tr><th>Direcci\u00F3n</th><th>Pa\u00EDs</th><th>Ciudad</th><th>Barrio</th><th>Tel\u00E9fono</th>@if (canEdit().addresses) { <th><span class=\"sfs-sr-only\">Acciones</span></th> }</tr>\n </ng-template>\n <ng-template #body let-a>\n <tr>\n <td>{{ a.address || '\u2014' }}</td>\n <td>{{ a.country || '\u2014' }}</td>\n <td>{{ a.city || '\u2014' }}</td>\n <td>{{ a.neighborhood || '\u2014' }}</td>\n <td>{{ a.phone || '\u2014' }}</td>\n @if (canEdit().addresses) {\n <td class=\"sfs-row-actions\">\n @if (a.id != null) {\n <p-button icon=\"pi pi-pencil\" severity=\"secondary\" [text]=\"true\" [rounded]=\"true\"\n [ariaLabel]=\"'Editar direcci\u00F3n ' + (a.address || '')\" [pTooltip]=\"'Editar direcci\u00F3n'\" tooltipPosition=\"left\"\n (onClick)=\"edit({ kind: 'address', item: a }, $event)\"></p-button>\n }\n </td>\n }\n </tr>\n </ng-template>\n <ng-template #emptymessage>\n <tr><td [attr.colspan]=\"canEdit().addresses ? 6 : 5\">La persona no tiene direcciones registradas.</td></tr>\n </ng-template>\n </p-table>\n </section>\n }\n\n @if (hasAccounts && accountsState() !== 'missing') {\n <section [attr.aria-labelledby]=\"ids.prefix + '-accounts'\" [attr.aria-busy]=\"refreshingAccounts() || null\">\n <div class=\"sfs-head\">\n <h3 [id]=\"ids.prefix + '-accounts'\" class=\"sfs-section-title\" tabindex=\"-1\"><i class=\"pi pi-wallet\" aria-hidden=\"true\"></i> Cuentas</h3>\n @if (canEdit().accounts && accountsState() === 'ready') {\n <p-button label=\"Agregar\" icon=\"pi pi-plus\" severity=\"secondary\" [text]=\"true\" ariaLabel=\"Agregar cuenta\"\n (onClick)=\"edit({ kind: 'account', item: null }, $event)\"></p-button>\n }\n </div>\n @switch (accountsState()) {\n @case ('loading') { <p-skeleton height=\"5rem\" aria-busy=\"true\"></p-skeleton> }\n @case ('error') {\n <p-message severity=\"error\">\n <div class=\"sfs-inline\">\n <span>No se pudieron cargar las cuentas.</span>\n <p-button label=\"Reintentar\" icon=\"pi pi-refresh\" [text]=\"true\" (onClick)=\"loadAccounts()\"></p-button>\n </div>\n </p-message>\n }\n @case ('ready') {\n <p-table [value]=\"accounts()\" styleClass=\"p-datatable-sm\" [scrollable]=\"true\">\n <ng-template #header>\n <tr><th>Banco</th><th>Tipo de cuenta</th><th>N\u00FAmero</th>@if (canEdit().accounts) { <th><span class=\"sfs-sr-only\">Acciones</span></th> }</tr>\n </ng-template>\n <ng-template #body let-a>\n <tr>\n <td>{{ a.bank || '\u2014' }}</td>\n <td>{{ a.accountType || '\u2014' }}</td>\n <td>\n {{ a.number || '\u2014' }}\n @if (a.primary) { <span class=\"sfs-tag-gap\"><p-tag value=\"Principal\" severity=\"info\"></p-tag></span> }\n </td>\n @if (canEdit().accounts) {\n <td class=\"sfs-row-actions\">\n @if (a.id) {\n <p-button icon=\"pi pi-pencil\" severity=\"secondary\" [text]=\"true\" [rounded]=\"true\"\n [ariaLabel]=\"'Editar cuenta ' + (a.number || '')\" [pTooltip]=\"'Editar cuenta'\" tooltipPosition=\"left\"\n (onClick)=\"edit({ kind: 'account', item: a }, $event)\"></p-button>\n }\n </td>\n }\n </tr>\n </ng-template>\n <ng-template #emptymessage>\n <tr><td [attr.colspan]=\"canEdit().accounts ? 4 : 3\">La persona no tiene cuentas registradas.</td></tr>\n </ng-template>\n </p-table>\n }\n }\n </section>\n }\n\n @if (others().length) {\n <section [attr.aria-labelledby]=\"ids.prefix + '-others'\">\n <h3 [id]=\"ids.prefix + '-others'\" class=\"sfs-section-title\"><i class=\"pi pi-users\" aria-hidden=\"true\"></i> Otras personas de la solicitud</h3>\n <p-table [value]=\"others()\" styleClass=\"p-datatable-sm\" [scrollable]=\"true\" dataKey=\"documentNumber\">\n <ng-template #header>\n <tr><th>Rol</th><th>Documento</th><th>Nombre</th><th>Edad</th><th>Celular</th><th>Correo</th></tr>\n </ng-template>\n <ng-template #body let-p>\n <tr>\n <td>{{ p.role || '\u2014' }}</td>\n <td>{{ p.documentNumber || '\u2014' }}</td>\n <td>{{ p.name || '\u2014' }}</td>\n <td>{{ p.age != null ? (p.age | number: '1.0-0' : locale) : '\u2014' }}</td>\n <td>{{ p.phone || '\u2014' }}</td>\n <td class=\"sfs-break\">{{ p.email || '\u2014' }}</td>\n </tr>\n </ng-template>\n </p-table>\n </section>\n }\n </div>\n }\n\n @if (editing(); as target) {\n <lib-person-edit-dialog [target]=\"target\" [documentType]=\"titular.documentType ?? ''\" [documentNumber]=\"titular.documentNumber\"\n [personName]=\"titular.name\" [options]=\"editOptions()\" [optionsState]=\"editOptionsState()\" (saved)=\"onEditSaved($event)\" (closed)=\"onEditClosed()\"\n (retryOptions)=\"loadEditOptions(true)\"></lib-person-edit-dialog>\n }\n } @else {\n <p-message severity=\"info\" text=\"La solicitud no tiene titular registrado.\"></p-message>\n }\n</p-card>\n", styles: [".sfs-title{margin:0;font-size:1.125rem;font-weight:600}.sfs-subtitle{margin:0;font-size:1rem;font-weight:600}.sfs-muted{color:var(--p-text-muted-color)}.sfs-section-title{display:flex;align-items:center;gap:.5rem;margin:0 0 .75rem;font-size:1rem;font-weight:600}.sfs-section-title i{color:var(--primary-color, var(--p-primary-color))}.sfs-inline{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.sfs-head{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:.5rem;margin-bottom:.75rem}.sfs-break{overflow-wrap:anywhere}.sfs-nowrap{white-space:nowrap}.sfs-right{text-align:right}.sfs-strong{font-weight:600}.sfs-tag-gap{margin-left:.5rem}.sfs-stack{display:flex;flex-direction:column;gap:1rem}.sfs-sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.sfs-summary{display:grid;grid-template-columns:minmax(8rem,max-content) 1fr;gap:.25rem 1rem;margin:0}.sfs-summary dt{color:var(--p-text-muted-color)}.sfs-summary dd{margin:0;text-align:right;font-variant-numeric:tabular-nums}@media (max-width: 575px){:host ::ng-deep .sfs-stack-table .p-datatable-table-container{overflow:visible!important}:host ::ng-deep .sfs-stack-table table,:host ::ng-deep .sfs-stack-table tbody{display:block;width:100%}:host ::ng-deep .sfs-stack-table thead{display:block!important;position:absolute!important;width:1px!important;height:1px!important;overflow:hidden!important;clip-path:inset(50%);white-space:nowrap}:host ::ng-deep .sfs-stack-table tbody tr{display:flex;flex-direction:column;margin-bottom:.5rem;padding:.5rem .75rem;border:1px solid var(--p-content-border-color);border-radius:var(--p-content-border-radius, 6px)}:host ::ng-deep .sfs-stack-table tbody td{display:flex;align-items:center;justify-content:flex-end;gap:.375rem;padding:.3rem 0;border:0;text-align:right}:host ::ng-deep .sfs-stack-table tbody td[data-label]:before{content:attr(data-label);margin-right:auto;padding-right:1rem;color:var(--p-text-muted-color);text-align:left}:host ::ng-deep .sfs-stack-table tbody td.sfs-stack-title{order:-1;display:block;font-weight:600;text-align:left}:host ::ng-deep .sfs-stack-table tfoot,:host ::ng-deep .sfs-stack-table .sfs-stack-hide{display:none}}\n", ".sfs-person-head{display:flex;flex-wrap:wrap;align-items:center;gap:.75rem}.sfs-person-avatar{display:flex;align-items:center;justify-content:center;width:3.5rem;height:3.5rem;flex-shrink:0;border-radius:50%;font-size:1.25rem;font-weight:700;color:var(--primary-color, var(--p-primary-color));background:var(--p-highlight-background)}.sfs-person-main{display:flex;flex-direction:column;gap:.25rem;flex:1 1 14rem;min-width:0}@media (max-width: 575px){:host ::ng-deep .sfs-person-toggle.p-button{width:100%;justify-content:space-between}}.sfs-person-name{display:flex;flex-wrap:wrap;align-items:center;gap:.25rem .75rem}.sfs-person-facts{display:flex;flex-wrap:wrap;gap:.25rem 1rem;font-size:.875rem;color:var(--p-text-muted-color)}.sfs-person-facts i{font-size:.8rem}.sfs-person-contact{display:inline-flex;flex-wrap:wrap;align-items:center;gap:.35rem}:host ::ng-deep .sfs-contact-tag{font-size:.75rem;padding:.1rem .4rem}.sfs-person-more{display:flex;flex-direction:column;gap:1.25rem;margin-top:1rem;padding-top:1rem;border-top:1px solid var(--p-content-border-color)}.sfs-person-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:.75rem 1rem}@media (min-width: 768px){.sfs-person-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}.sfs-dl{margin:0}.sfs-field{display:flex;flex-direction:column;min-width:0}.sfs-field dt{font-size:.8rem;color:var(--p-text-muted-color)}.sfs-field dd{margin:0;overflow-wrap:anywhere}.sfs-head .sfs-section-title{margin:0}.sfs-row-actions{width:1%;white-space:nowrap;text-align:right}.sfs-section-title:focus:not(:focus-visible){outline:none}\n"] }]
800
833
  }], ctorParameters: () => [] });
834
+ /** Solo los dígitos de un teléfono, para comparar el mismo número escrito distinto. */
835
+ function digits(value) {
836
+ return value.replace(/\D/g, '');
837
+ }
801
838
 
802
839
  /** Métodos de cargo que se configuran en pesos; el resto es un porcentaje (fracción en el core). */
803
840
  const FIXED_METHODS = new Set(['FIJO', 'DESCUENTOSGIRO']);