@unipin/angular-applet 21.0.1 → 21.1.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.
Files changed (63) hide show
  1. package/README.md +334 -37
  2. package/common/assets/styles/theme.css +3 -0
  3. package/fesm2022/unipin-angular-applet-accordion.mjs +30 -30
  4. package/fesm2022/unipin-angular-applet-accordion.mjs.map +1 -1
  5. package/fesm2022/unipin-angular-applet-alert-dialog.mjs +92 -93
  6. package/fesm2022/unipin-angular-applet-alert-dialog.mjs.map +1 -1
  7. package/fesm2022/unipin-angular-applet-alert.mjs +16 -16
  8. package/fesm2022/unipin-angular-applet-alert.mjs.map +1 -1
  9. package/fesm2022/unipin-angular-applet-approval.mjs +129 -0
  10. package/fesm2022/unipin-angular-applet-approval.mjs.map +1 -0
  11. package/fesm2022/unipin-angular-applet-auth.mjs +45 -26
  12. package/fesm2022/unipin-angular-applet-auth.mjs.map +1 -1
  13. package/fesm2022/unipin-angular-applet-avatar.mjs +6 -6
  14. package/fesm2022/unipin-angular-applet-avatar.mjs.map +1 -1
  15. package/fesm2022/unipin-angular-applet-badge.mjs +6 -6
  16. package/fesm2022/unipin-angular-applet-badge.mjs.map +1 -1
  17. package/fesm2022/unipin-angular-applet-buttons.mjs +13 -17
  18. package/fesm2022/unipin-angular-applet-buttons.mjs.map +1 -1
  19. package/fesm2022/unipin-angular-applet-calendar.mjs +25 -25
  20. package/fesm2022/unipin-angular-applet-calendar.mjs.map +1 -1
  21. package/fesm2022/unipin-angular-applet-collapsible.mjs +17 -17
  22. package/fesm2022/unipin-angular-applet-collapsible.mjs.map +1 -1
  23. package/fesm2022/unipin-angular-applet-common.mjs +60 -23
  24. package/fesm2022/unipin-angular-applet-common.mjs.map +1 -1
  25. package/fesm2022/unipin-angular-applet-containers.mjs +22 -22
  26. package/fesm2022/unipin-angular-applet-containers.mjs.map +1 -1
  27. package/fesm2022/unipin-angular-applet-dialog.mjs +62 -73
  28. package/fesm2022/unipin-angular-applet-dialog.mjs.map +1 -1
  29. package/fesm2022/unipin-angular-applet-forms.mjs +394 -152
  30. package/fesm2022/unipin-angular-applet-forms.mjs.map +1 -1
  31. package/fesm2022/unipin-angular-applet-froala.mjs +10 -12
  32. package/fesm2022/unipin-angular-applet-froala.mjs.map +1 -1
  33. package/fesm2022/unipin-angular-applet-infinite-scroll.mjs +5 -5
  34. package/fesm2022/unipin-angular-applet-infinite-scroll.mjs.map +1 -1
  35. package/fesm2022/unipin-angular-applet-json-viewer.mjs +8 -8
  36. package/fesm2022/unipin-angular-applet-json-viewer.mjs.map +1 -1
  37. package/fesm2022/unipin-angular-applet-kbd.mjs +32 -0
  38. package/fesm2022/unipin-angular-applet-kbd.mjs.map +1 -0
  39. package/fesm2022/unipin-angular-applet-loading-dialog.mjs +8 -8
  40. package/fesm2022/unipin-angular-applet-loading-dialog.mjs.map +1 -1
  41. package/fesm2022/unipin-angular-applet-markdown.mjs +19 -21
  42. package/fesm2022/unipin-angular-applet-markdown.mjs.map +1 -1
  43. package/fesm2022/unipin-angular-applet-popover.mjs +21 -25
  44. package/fesm2022/unipin-angular-applet-popover.mjs.map +1 -1
  45. package/fesm2022/unipin-angular-applet-progress-bar.mjs +8 -8
  46. package/fesm2022/unipin-angular-applet-progress-bar.mjs.map +1 -1
  47. package/fesm2022/unipin-angular-applet-skeleton.mjs +5 -5
  48. package/fesm2022/unipin-angular-applet-skeleton.mjs.map +1 -1
  49. package/fesm2022/unipin-angular-applet-spinner.mjs +6 -6
  50. package/fesm2022/unipin-angular-applet-spinner.mjs.map +1 -1
  51. package/fesm2022/unipin-angular-applet-swipeable.mjs +26 -26
  52. package/fesm2022/unipin-angular-applet-swipeable.mjs.map +1 -1
  53. package/fesm2022/unipin-angular-applet-tabs.mjs +22 -22
  54. package/fesm2022/unipin-angular-applet-tabs.mjs.map +1 -1
  55. package/fesm2022/unipin-angular-applet-tooltip.mjs +5 -5
  56. package/fesm2022/unipin-angular-applet-tooltip.mjs.map +1 -1
  57. package/package.json +9 -1
  58. package/types/unipin-angular-applet-alert-dialog.d.ts +3 -1
  59. package/types/unipin-angular-applet-approval.d.ts +55 -0
  60. package/types/unipin-angular-applet-common.d.ts +12 -2
  61. package/types/unipin-angular-applet-dialog.d.ts +1 -2
  62. package/types/unipin-angular-applet-forms.d.ts +70 -2
  63. package/types/unipin-angular-applet-kbd.d.ts +11 -0
@@ -0,0 +1,129 @@
1
+ import * as i0 from '@angular/core';
2
+ import { Injectable, input, model, signal, effect, ChangeDetectionStrategy, Component } from '@angular/core';
3
+ import * as i1 from '@unipin/angular-gql';
4
+ import { DatePipe, JsonPipe } from '@angular/common';
5
+ import { UpInputDirective } from '@unipin/angular-applet/forms';
6
+ import { UpBadgeDirective } from '@unipin/angular-applet/badge';
7
+ import { UpCapitalizaPipe } from '@unipin/angular-applet/common';
8
+ import { UpSkeletonDirective } from '@unipin/angular-applet/skeleton';
9
+
10
+ class ApprovalService {
11
+ constructor(gql) {
12
+ this.gql = gql;
13
+ }
14
+ query(input, extraAttr = '', cacheStrategy) {
15
+ return this.gql.query({
16
+ operationName: 'QueryApproval',
17
+ cacheStrategy,
18
+ variables: {
19
+ input
20
+ },
21
+ query: `
22
+ query QueryApproval($input: ApprovalCriteria) {
23
+ approvalMsApprovals(input: $input) {
24
+ data {
25
+ guid
26
+ createdAt
27
+ entity
28
+ remark
29
+ sourcePlatform
30
+ status
31
+ type
32
+ createdByUser {
33
+ guid
34
+ name
35
+ }
36
+ approvalGroup {
37
+ guid
38
+ }
39
+ ${extraAttr}
40
+ }
41
+ ${input.page === 0 ? 'totalRecord' : ''}
42
+ }
43
+ }
44
+ `
45
+ });
46
+ }
47
+ request(variables) {
48
+ return this.gql.mutate({
49
+ variables,
50
+ operationName: variables.isApprove ? 'ApproveApproval' : 'DeclineApproval',
51
+ mutation: `
52
+ mutation ${variables.isApprove ? 'ApproveApproval' : 'DeclineApproval'} ($approvalGroupGuid: String, $guids: [String], $isApprove: Boolean, $reason: String) {
53
+ approvalMsApproveOrDeclineRequest(approvalGroupGuid: $approvalGroupGuid, guids: $guids, isApprove: $isApprove, reason: $reason)
54
+ }
55
+ `
56
+ });
57
+ }
58
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: ApprovalService, deps: [{ token: i1.GqlParser }], target: i0.ɵɵFactoryTarget.Injectable }); }
59
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: ApprovalService, providedIn: 'root' }); }
60
+ }
61
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: ApprovalService, decorators: [{
62
+ type: Injectable,
63
+ args: [{
64
+ providedIn: 'root'
65
+ }]
66
+ }], ctorParameters: () => [{ type: i1.GqlParser }] });
67
+
68
+ class UpApprovalFormComponent {
69
+ constructor() {
70
+ this.approvalData = input.required({ ...(ngDevMode ? { debugName: "approvalData" } : {}) });
71
+ this.isLoading = model(true, { ...(ngDevMode ? { debugName: "isLoading" } : {}) });
72
+ this.borderColors = signal({}, { ...(ngDevMode ? { debugName: "borderColors" } : {}) });
73
+ this.backgroundColors = signal({}, { ...(ngDevMode ? { debugName: "backgroundColors" } : {}) });
74
+ this.STATUS_COLOR_MAP = {
75
+ PENDING: {
76
+ bg: 'bg-yellow-500',
77
+ border: 'border-yellow-500'
78
+ },
79
+ APPROVED: {
80
+ bg: 'bg-green-700',
81
+ border: 'border-green-700'
82
+ },
83
+ DECLINED: {
84
+ bg: 'bg-destructive',
85
+ border: 'border-destructive'
86
+ },
87
+ DEFAULT: {
88
+ bg: 'bg-primary',
89
+ border: 'border-primary'
90
+ },
91
+ };
92
+ effect(() => {
93
+ const bg = {};
94
+ const border = {};
95
+ this.approvalData().forEach((item, index) => {
96
+ const colors = this.getColors(item.status);
97
+ bg[index] = colors.bg;
98
+ border[index] = colors.border;
99
+ });
100
+ this.backgroundColors.set(bg);
101
+ this.borderColors.set(border);
102
+ });
103
+ }
104
+ getColors(status) {
105
+ return this.STATUS_COLOR_MAP[status] ?? this.STATUS_COLOR_MAP.DEFAULT;
106
+ }
107
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: UpApprovalFormComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
108
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.2", type: UpApprovalFormComponent, isStandalone: true, selector: "up-approval-form", inputs: { approvalData: { classPropertyName: "approvalData", publicName: "approvalData", isSignal: true, isRequired: true, transformFunction: null }, isLoading: { classPropertyName: "isLoading", publicName: "isLoading", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { isLoading: "isLoadingChange" }, host: { classAttribute: "block space-y-4" }, ngImport: i0, template: "@if (isLoading()) {\n @for (i of [1,2,3,4,5]; track $index) {\n <div class=\"border border-border rounded-md px-2 select-none\">\n <div class=\"px-2 py-4 border-b border-border flex justify-between items-center gap-4\">\n <div class=\"grow flex items-center gap-2\">\n <div \n upSkeleton\n class=\"h-6 w-4/5 max-w-50\"\n ></div>\n </div>\n\n <div class=\"shrink-0 text-sm\">\n <div \n upSkeleton\n class=\"h-6 w-screen max-w-30\"\n ></div>\n </div>\n </div>\n\n <div class=\"px-2 py-4 space-y-4\">\n <div class=\"grid grid-cols-1 lg:grid-cols-2 gap-4\">\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n Entity\n </label>\n\n <div \n upSkeleton\n class=\"h-9 w-full\"\n ></div>\n </div>\n\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n User\n </label>\n\n <div \n upSkeleton\n class=\"h-9 w-full\"\n ></div>\n </div>\n </div>\n\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n Remark\n </label>\n\n <div \n upSkeleton\n class=\"h-9 w-full\"\n ></div>\n </div>\n\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n Data\n </label>\n\n <div \n upSkeleton\n class=\"h-20 w-full\"\n ></div>\n </div>\n </div>\n </div>\n }\n}\n@else {\n @for (d of approvalData(); track $index) {\n <div \n class=\"border rounded-md px-2 select-none\"\n [class]=\"borderColors()[$index]\"\n >\n <div \n class=\"px-2 py-4 border-b flex justify-between items-center gap-4\"\n [class]=\"borderColors()[$index]\"\n >\n <div class=\"grow flex items-center gap-2\">\n <div \n upBadge \n class=\"text-white shrink-0\" \n [class]=\"backgroundColors()[$index]\"\n >\n {{ (d.status?? 'Unknown') | upCapitalize }}\n </div>\n </div>\n\n @if (d.createdAt) {\n <div class=\"shrink-0 text-sm text-muted-foreground\">\n {{ d.createdAt | date: 'dd LLL yyyy HH:mm' }}\n </div>\n }\n </div>\n\n <div class=\"px-2 py-4 space-y-6\">\n <div class=\"grid grid-cols-1 lg:grid-cols-2 gap-4\">\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n Entity\n </label>\n\n <input \n upInput \n readonly \n [value]=\"d.entity\"\n />\n </div>\n\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n User\n </label>\n\n <input \n upInput \n readonly \n [value]=\"d.createdByUser?.name?? '-'\"\n />\n </div>\n </div>\n\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n Remark\n </label>\n\n <input \n upInput \n readonly \n [value]=\"d.remark\"\n />\n </div>\n\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n Data\n </label>\n\n <textarea \n upInput \n readonly\n class=\"min-h-50 resize-none\"\n [value]=\"d.data | json\"\n >\n </textarea>\n </div>\n </div>\n </div>\n }\n}\n", dependencies: [{ kind: "directive", type: UpInputDirective, selector: "[upInput]", inputs: ["class"], exportAs: ["upInput"] }, { kind: "directive", type: UpBadgeDirective, selector: "[upBadge]", inputs: ["variant", "class"], exportAs: ["upBadge"] }, { kind: "directive", type: UpSkeletonDirective, selector: "[upSkeleton]", inputs: ["class"], exportAs: ["upSkeleton"] }, { kind: "pipe", type: DatePipe, name: "date" }, { kind: "pipe", type: JsonPipe, name: "json" }, { kind: "pipe", type: UpCapitalizaPipe, name: "upCapitalize" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
109
+ }
110
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: UpApprovalFormComponent, decorators: [{
111
+ type: Component,
112
+ args: [{ standalone: true, selector: 'up-approval-form', changeDetection: ChangeDetectionStrategy.OnPush, host: {
113
+ class: 'block space-y-4'
114
+ }, imports: [
115
+ DatePipe,
116
+ JsonPipe,
117
+ UpCapitalizaPipe,
118
+ UpInputDirective,
119
+ UpBadgeDirective,
120
+ UpSkeletonDirective
121
+ ], template: "@if (isLoading()) {\n @for (i of [1,2,3,4,5]; track $index) {\n <div class=\"border border-border rounded-md px-2 select-none\">\n <div class=\"px-2 py-4 border-b border-border flex justify-between items-center gap-4\">\n <div class=\"grow flex items-center gap-2\">\n <div \n upSkeleton\n class=\"h-6 w-4/5 max-w-50\"\n ></div>\n </div>\n\n <div class=\"shrink-0 text-sm\">\n <div \n upSkeleton\n class=\"h-6 w-screen max-w-30\"\n ></div>\n </div>\n </div>\n\n <div class=\"px-2 py-4 space-y-4\">\n <div class=\"grid grid-cols-1 lg:grid-cols-2 gap-4\">\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n Entity\n </label>\n\n <div \n upSkeleton\n class=\"h-9 w-full\"\n ></div>\n </div>\n\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n User\n </label>\n\n <div \n upSkeleton\n class=\"h-9 w-full\"\n ></div>\n </div>\n </div>\n\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n Remark\n </label>\n\n <div \n upSkeleton\n class=\"h-9 w-full\"\n ></div>\n </div>\n\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n Data\n </label>\n\n <div \n upSkeleton\n class=\"h-20 w-full\"\n ></div>\n </div>\n </div>\n </div>\n }\n}\n@else {\n @for (d of approvalData(); track $index) {\n <div \n class=\"border rounded-md px-2 select-none\"\n [class]=\"borderColors()[$index]\"\n >\n <div \n class=\"px-2 py-4 border-b flex justify-between items-center gap-4\"\n [class]=\"borderColors()[$index]\"\n >\n <div class=\"grow flex items-center gap-2\">\n <div \n upBadge \n class=\"text-white shrink-0\" \n [class]=\"backgroundColors()[$index]\"\n >\n {{ (d.status?? 'Unknown') | upCapitalize }}\n </div>\n </div>\n\n @if (d.createdAt) {\n <div class=\"shrink-0 text-sm text-muted-foreground\">\n {{ d.createdAt | date: 'dd LLL yyyy HH:mm' }}\n </div>\n }\n </div>\n\n <div class=\"px-2 py-4 space-y-6\">\n <div class=\"grid grid-cols-1 lg:grid-cols-2 gap-4\">\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n Entity\n </label>\n\n <input \n upInput \n readonly \n [value]=\"d.entity\"\n />\n </div>\n\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n User\n </label>\n\n <input \n upInput \n readonly \n [value]=\"d.createdByUser?.name?? '-'\"\n />\n </div>\n </div>\n\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n Remark\n </label>\n\n <input \n upInput \n readonly \n [value]=\"d.remark\"\n />\n </div>\n\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n Data\n </label>\n\n <textarea \n upInput \n readonly\n class=\"min-h-50 resize-none\"\n [value]=\"d.data | json\"\n >\n </textarea>\n </div>\n </div>\n </div>\n }\n}\n" }]
122
+ }], ctorParameters: () => [], propDecorators: { approvalData: [{ type: i0.Input, args: [{ isSignal: true, alias: "approvalData", required: true }] }], isLoading: [{ type: i0.Input, args: [{ isSignal: true, alias: "isLoading", required: false }] }, { type: i0.Output, args: ["isLoadingChange"] }] } });
123
+
124
+ /**
125
+ * Generated bundle index. Do not edit.
126
+ */
127
+
128
+ export { ApprovalService, UpApprovalFormComponent };
129
+ //# sourceMappingURL=unipin-angular-applet-approval.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"unipin-angular-applet-approval.mjs","sources":["../../../projects/unipin-angular/approval/services/approval.service.ts","../../../projects/unipin-angular/approval/component/form/approval-form.component.ts","../../../projects/unipin-angular/approval/component/form/approval-form.component.html","../../../projects/unipin-angular/approval/unipin-angular-applet-approval.ts"],"sourcesContent":["import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { CacheStrategy, GqlParser, MutationResult, QueryResult } from '@unipin/angular-gql';\nimport { ApprovalCriteria, PageableResponse, MutationApprovalMsApproveOrDeclineRequestArgs } from '@unipin/graphql-schema';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ApprovalService {\n\n constructor(\n protected readonly gql: GqlParser\n ) { }\n\n public query(\n input: ApprovalCriteria, \n extraAttr: string = '', \n cacheStrategy?: CacheStrategy\n ): Observable<QueryResult<{ approvalMsApprovals: PageableResponse }>>{\n \n return this.gql.query({\n operationName: 'QueryApproval',\n cacheStrategy,\n variables: { \n input \n },\n query: `\n query QueryApproval($input: ApprovalCriteria) {\n approvalMsApprovals(input: $input) {\n data {\n guid \n createdAt \n entity \n remark \n sourcePlatform \n status \n type \n createdByUser {\n guid\n name\n }\n approvalGroup { \n guid \n }\n ${ extraAttr }\n }\n ${ input.page === 0? 'totalRecord' : '' }\n }\n }\n `\n });\n }\n\n public request(variables: MutationApprovalMsApproveOrDeclineRequestArgs): Observable<MutationResult<{ approvalMsApproveOrDeclineRequest: string }>>{\n \n return this.gql.mutate({\n variables,\n operationName: variables.isApprove? 'ApproveApproval' : 'DeclineApproval',\n mutation: `\n mutation ${ variables.isApprove? 'ApproveApproval' : 'DeclineApproval'} ($approvalGroupGuid: String, $guids: [String], $isApprove: Boolean, $reason: String) {\n approvalMsApproveOrDeclineRequest(approvalGroupGuid: $approvalGroupGuid, guids: $guids, isApprove: $isApprove, reason: $reason)\n }\n `\n });\n }\n}\n","import { ChangeDetectionStrategy, Component, effect, input, model, signal } from '@angular/core';\nimport { DatePipe, JsonPipe } from '@angular/common';\nimport { Approval } from '@unipin/graphql-schema';\nimport { UpInputDirective } from '@unipin/angular-applet/forms';\nimport { UpBadgeDirective } from '@unipin/angular-applet/badge';\nimport { UpCapitalizaPipe } from '@unipin/angular-applet/common';\nimport { UpSkeletonDirective } from '@unipin/angular-applet/skeleton';\n\n\n@Component({\n standalone: true,\n selector: 'up-approval-form',\n templateUrl: './approval-form.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'block space-y-4'\n },\n imports: [\n DatePipe,\n JsonPipe,\n UpCapitalizaPipe,\n UpInputDirective,\n UpBadgeDirective,\n UpSkeletonDirective\n ]\n})\nexport class UpApprovalFormComponent {\n \n public readonly approvalData = input.required<Approval[]>();\n public readonly isLoading = model<boolean>(true);\n\n public readonly borderColors = signal<{ [key: number]: string }>({});\n public readonly backgroundColors = signal<{ [key: number]: string }>({});\n\n protected readonly STATUS_COLOR_MAP = {\n PENDING: { \n bg: 'bg-yellow-500', \n border: 'border-yellow-500' \n },\n APPROVED: { \n bg: 'bg-green-700', \n border: 'border-green-700' \n },\n DECLINED: { \n bg: 'bg-destructive', \n border: 'border-destructive' \n },\n DEFAULT: { \n bg: 'bg-primary', \n border: 'border-primary' \n },\n };\n\n constructor() {\n effect(\n () => {\n const bg: any = {};\n const border: any = {};\n \n this.approvalData().forEach(\n (item, index) => {\n const colors = this.getColors(item.status);\n \n bg[index] = colors.bg;\n border[index] = colors.border;\n }\n );\n \n this.backgroundColors.set(bg);\n this.borderColors.set(border);\n }\n );\n }\n\n protected getColors(status?: string | null): { bg: string, border: string}{\n return this.STATUS_COLOR_MAP[status as keyof typeof this.STATUS_COLOR_MAP]?? this.STATUS_COLOR_MAP.DEFAULT;\n }\n}\n","@if (isLoading()) {\n @for (i of [1,2,3,4,5]; track $index) {\n <div class=\"border border-border rounded-md px-2 select-none\">\n <div class=\"px-2 py-4 border-b border-border flex justify-between items-center gap-4\">\n <div class=\"grow flex items-center gap-2\">\n <div \n upSkeleton\n class=\"h-6 w-4/5 max-w-50\"\n ></div>\n </div>\n\n <div class=\"shrink-0 text-sm\">\n <div \n upSkeleton\n class=\"h-6 w-screen max-w-30\"\n ></div>\n </div>\n </div>\n\n <div class=\"px-2 py-4 space-y-4\">\n <div class=\"grid grid-cols-1 lg:grid-cols-2 gap-4\">\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n Entity\n </label>\n\n <div \n upSkeleton\n class=\"h-9 w-full\"\n ></div>\n </div>\n\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n User\n </label>\n\n <div \n upSkeleton\n class=\"h-9 w-full\"\n ></div>\n </div>\n </div>\n\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n Remark\n </label>\n\n <div \n upSkeleton\n class=\"h-9 w-full\"\n ></div>\n </div>\n\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n Data\n </label>\n\n <div \n upSkeleton\n class=\"h-20 w-full\"\n ></div>\n </div>\n </div>\n </div>\n }\n}\n@else {\n @for (d of approvalData(); track $index) {\n <div \n class=\"border rounded-md px-2 select-none\"\n [class]=\"borderColors()[$index]\"\n >\n <div \n class=\"px-2 py-4 border-b flex justify-between items-center gap-4\"\n [class]=\"borderColors()[$index]\"\n >\n <div class=\"grow flex items-center gap-2\">\n <div \n upBadge \n class=\"text-white shrink-0\" \n [class]=\"backgroundColors()[$index]\"\n >\n {{ (d.status?? 'Unknown') | upCapitalize }}\n </div>\n </div>\n\n @if (d.createdAt) {\n <div class=\"shrink-0 text-sm text-muted-foreground\">\n {{ d.createdAt | date: 'dd LLL yyyy HH:mm' }}\n </div>\n }\n </div>\n\n <div class=\"px-2 py-4 space-y-6\">\n <div class=\"grid grid-cols-1 lg:grid-cols-2 gap-4\">\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n Entity\n </label>\n\n <input \n upInput \n readonly \n [value]=\"d.entity\"\n />\n </div>\n\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n User\n </label>\n\n <input \n upInput \n readonly \n [value]=\"d.createdByUser?.name?? '-'\"\n />\n </div>\n </div>\n\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n Remark\n </label>\n\n <input \n upInput \n readonly \n [value]=\"d.remark\"\n />\n </div>\n\n <div class=\"flex flex-col gap-2\">\n <label class=\"text-sm font-medium leading-none\">\n Data\n </label>\n\n <textarea \n upInput \n readonly\n class=\"min-h-50 resize-none\"\n [value]=\"d.data | json\"\n >\n </textarea>\n </div>\n </div>\n </div>\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;;;;;;MAQa,eAAe,CAAA;AAE1B,IAAA,WAAA,CACqB,GAAc,EAAA;QAAd,IAAA,CAAA,GAAG,GAAH,GAAG;IACpB;AAEG,IAAA,KAAK,CACV,KAAuB,EACvB,SAAA,GAAoB,EAAE,EACtB,aAA6B,EAAA;AAG7B,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;AACpB,YAAA,aAAa,EAAE,eAAe;YAC9B,aAAa;AACb,YAAA,SAAS,EAAE;gBACT;AACD,aAAA;AACD,YAAA,KAAK,EAAE;;;;;;;;;;;;;;;;;;gBAkBI,SAAU;;cAEZ,KAAK,CAAC,IAAI,KAAK,CAAC,GAAE,aAAa,GAAG,EAAG;;;AAG7C,MAAA;AACF,SAAA,CAAC;IACJ;AAEO,IAAA,OAAO,CAAC,SAAwD,EAAA;AAErE,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC;YACrB,SAAS;YACT,aAAa,E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A,EAEX,uBAAuB,CAAC,MAAM,EAAA,IAAA,EACzC;AACJ,wBAAA,KAAK,EAAE;qBACR,EAAA,OAAA,EACQ;wBACP,QAAQ;wBACR,QAAQ;wBACR,gBAAgB;wBAChB,gBAAgB;wBAChB,gBAAgB;wBAChB;AACD,qBAAA,EAAA,QAAA,EAAA,yrKAAA,EAAA;;;AExBH;;AAEG;;;;"}
@@ -108,10 +108,10 @@ class ProfileService {
108
108
  `,
109
109
  });
110
110
  }
111
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: ProfileService, deps: [{ token: i1.GqlParser }], target: i0.ɵɵFactoryTarget.Injectable }); }
112
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: ProfileService, providedIn: 'root' }); }
111
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: ProfileService, deps: [{ token: i1.GqlParser }], target: i0.ɵɵFactoryTarget.Injectable }); }
112
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: ProfileService, providedIn: 'root' }); }
113
113
  }
114
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: ProfileService, decorators: [{
114
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: ProfileService, decorators: [{
115
115
  type: Injectable,
116
116
  args: [{
117
117
  providedIn: 'root'
@@ -136,11 +136,12 @@ class AuthService {
136
136
  * @type {User} An interface contain user information.
137
137
  * @default {} as User
138
138
  */
139
- this.user = signal({}, ...(ngDevMode ? [{ debugName: "user" }] : []));
139
+ this.user = signal({}, { ...(ngDevMode ? { debugName: "user" } : {}) });
140
140
  }
141
141
  static logout() {
142
142
  AuthService.authToken = '';
143
143
  AuthService.refreshToken = '';
144
+ localStorage.removeItem('userGuid');
144
145
  localStorage.removeItem('authToken');
145
146
  localStorage.removeItem('refreshToken');
146
147
  }
@@ -237,15 +238,14 @@ class AuthService {
237
238
  if (suggestedAction !== 'CHANGE_PASSWORD') {
238
239
  localStorage.setItem('authToken', AuthService.authToken);
239
240
  }
240
- localStorage.setItem('roles', JSON.stringify(roles));
241
241
  localStorage.setItem('userGuid', this.user().guid ?? '');
242
242
  localStorage.setItem('refreshToken', AuthService.refreshToken);
243
243
  }));
244
244
  }
245
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: AuthService, deps: [{ token: i1.GqlParser }, { token: ProfileService }], target: i0.ɵɵFactoryTarget.Injectable }); }
246
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: AuthService, providedIn: 'root' }); }
245
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AuthService, deps: [{ token: i1.GqlParser }, { token: ProfileService }], target: i0.ɵɵFactoryTarget.Injectable }); }
246
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AuthService, providedIn: 'root' }); }
247
247
  }
248
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: AuthService, decorators: [{
248
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AuthService, decorators: [{
249
249
  type: Injectable,
250
250
  args: [{
251
251
  providedIn: 'root'
@@ -378,10 +378,10 @@ class AuthResolver {
378
378
  buffer = chars.indexOf(buffer);
379
379
  return output;
380
380
  }
381
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: AuthResolver, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
382
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: AuthResolver, providedIn: 'root' }); }
381
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AuthResolver, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
382
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AuthResolver, providedIn: 'root' }); }
383
383
  }
384
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: AuthResolver, decorators: [{
384
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: AuthResolver, decorators: [{
385
385
  type: Injectable,
386
386
  args: [{
387
387
  providedIn: 'root'
@@ -401,7 +401,7 @@ const authGuard = () => {
401
401
  class PermissionService {
402
402
  constructor(gql) {
403
403
  this.gql = gql;
404
- this.permissions = signal(new Map(), ...(ngDevMode ? [{ debugName: "permissions" }] : []));
404
+ this.permissions = signal(new Map(), { ...(ngDevMode ? { debugName: "permissions" } : {}) });
405
405
  /**
406
406
  * A boolean value that tells the permission service is initiated (permissions list is retrieved from Backend) or not.
407
407
  * @default false
@@ -456,10 +456,10 @@ class PermissionService {
456
456
  `
457
457
  });
458
458
  }
459
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: PermissionService, deps: [{ token: i1.GqlParser }], target: i0.ɵɵFactoryTarget.Injectable }); }
460
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: PermissionService, providedIn: 'root' }); }
459
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: PermissionService, deps: [{ token: i1.GqlParser }], target: i0.ɵɵFactoryTarget.Injectable }); }
460
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: PermissionService, providedIn: 'root' }); }
461
461
  }
462
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: PermissionService, decorators: [{
462
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: PermissionService, decorators: [{
463
463
  type: Injectable,
464
464
  args: [{
465
465
  providedIn: 'root'
@@ -518,8 +518,27 @@ const authorizationInterceptor = (request, next) => {
518
518
  const refreshTokenInterceptor = (request, next) => {
519
519
  const router = inject(Router);
520
520
  const authService = inject(AuthService);
521
- return next(request).pipe(catchError(({ error: { errors } }) => {
522
- if (errors[0].extensions.code !== 'USER_INVALID_TOKEN') {
521
+ return next(request).pipe(tap(({ type, body }) => {
522
+ if (type === 0 ||
523
+ !body) {
524
+ return;
525
+ }
526
+ const { errors } = body;
527
+ if (!errors ||
528
+ !errors.length ||
529
+ errors[0].extensions.code !== 'USER_INVALID_TOKEN') {
530
+ return;
531
+ }
532
+ throw body;
533
+ }), catchError((error) => {
534
+ const { errors } = error;
535
+ if (!errors ||
536
+ !errors.length) {
537
+ return throwError(() => error);
538
+ }
539
+ if ((errors[0].message &&
540
+ errors[0].extensions.code !== 'USER_INVALID_TOKEN') ||
541
+ request.url.includes('RefreshToken')) {
523
542
  return throwError(() => errors[0]);
524
543
  }
525
544
  return authService.refreshToken({ refreshToken: AuthService.refreshToken }).pipe(switchMap(({ data }) => {
@@ -563,10 +582,10 @@ class PermissionDirective {
563
582
  }
564
583
  this.viewContainer.clear();
565
584
  }
566
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: PermissionDirective, deps: [{ token: PermissionService }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
567
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.0", type: PermissionDirective, isStandalone: true, selector: "[hasPermission]", inputs: { hasPermission: "hasPermission" }, exportAs: ["hasPermission"], ngImport: i0 }); }
585
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: PermissionDirective, deps: [{ token: PermissionService }, { token: i0.TemplateRef }, { token: i0.ViewContainerRef }], target: i0.ɵɵFactoryTarget.Directive }); }
586
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "21.0.2", type: PermissionDirective, isStandalone: true, selector: "[hasPermission]", inputs: { hasPermission: "hasPermission" }, exportAs: ["hasPermission"], ngImport: i0 }); }
568
587
  }
569
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: PermissionDirective, decorators: [{
588
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: PermissionDirective, decorators: [{
570
589
  type: Directive,
571
590
  args: [{
572
591
  standalone: true,
@@ -578,8 +597,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImpor
578
597
  }] } });
579
598
 
580
599
  class UnauthorizedPage {
581
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: UnauthorizedPage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
582
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.0", type: UnauthorizedPage, isStandalone: true, selector: "up-unauthorized", host: { classAttribute: "flex flex-col items-center justify-center size-full gap-4 p-5 select-none" }, providers: [
600
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: UnauthorizedPage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
601
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.2", type: UnauthorizedPage, isStandalone: true, selector: "up-unauthorized", host: { classAttribute: "flex flex-col items-center justify-center size-full gap-4 p-5 select-none" }, providers: [
583
602
  provideIcons({
584
603
  matLockRound
585
604
  })
@@ -595,7 +614,7 @@ class UnauthorizedPage {
595
614
  <p class="text-center">Please log in or re-check your permissions.</p>
596
615
  `, isInline: true, dependencies: [{ kind: "component", type: NgIcon, selector: "ng-icon", inputs: ["name", "svg", "size", "strokeWidth", "color"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
597
616
  }
598
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: UnauthorizedPage, decorators: [{
617
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: UnauthorizedPage, decorators: [{
599
618
  type: Component,
600
619
  args: [{
601
620
  standalone: true,
@@ -665,8 +684,8 @@ class LoadingPage {
665
684
  ngOnDestroy() {
666
685
  this.sub?.unsubscribe();
667
686
  }
668
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: LoadingPage, deps: [{ token: LOADING_CONFIG }, { token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: PermissionService }], target: i0.ɵɵFactoryTarget.Component }); }
669
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.0", type: LoadingPage, isStandalone: true, selector: "up-loading", host: { classAttribute: "flex flex-col items-center gap-6 p-5 justify-center size-full select-none" }, ngImport: i0, template: `
687
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: LoadingPage, deps: [{ token: LOADING_CONFIG }, { token: i1$1.Router }, { token: i1$1.ActivatedRoute }, { token: PermissionService }], target: i0.ɵɵFactoryTarget.Component }); }
688
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.0.2", type: LoadingPage, isStandalone: true, selector: "up-loading", host: { classAttribute: "flex flex-col items-center gap-6 p-5 justify-center size-full select-none" }, ngImport: i0, template: `
670
689
  <up-spinner class="size-10" />
671
690
 
672
691
  <h3 class="text-center text-lg lg:text-2xl font-bold">
@@ -674,7 +693,7 @@ class LoadingPage {
674
693
  </h3>
675
694
  `, isInline: true, dependencies: [{ kind: "component", type: UpSpinnerComponent, selector: "up-spinner", inputs: ["stokeWidth", "inlineClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
676
695
  }
677
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: LoadingPage, decorators: [{
696
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: LoadingPage, decorators: [{
678
697
  type: Component,
679
698
  args: [{
680
699
  standalone: true,
@@ -1 +1 @@
1
- {"version":3,"file":"unipin-angular-applet-auth.mjs","sources":["../../../projects/unipin-angular/auth/authorization/utils/provide-loading-config.util.ts","../../../projects/unipin-angular/auth/authentication/services/profile.service.ts","../../../projects/unipin-angular/auth/authentication/services/auth.service.ts","../../../projects/unipin-angular/auth/authentication/resolvers/auth.resolver.ts","../../../projects/unipin-angular/auth/authentication/guards/auth.guard.ts","../../../projects/unipin-angular/auth/authorization/services/permission.service.ts","../../../projects/unipin-angular/auth/authorization/guards/permission.guard.ts","../../../projects/unipin-angular/auth/authorization/interceptors/authorization.interceptor.ts","../../../projects/unipin-angular/auth/authentication/interceptors/refresh-token.interceptor.ts","../../../projects/unipin-angular/auth/authorization/directives/permission.directive.ts","../../../projects/unipin-angular/auth/authorization/pages/unauthorized.page.ts","../../../projects/unipin-angular/auth/authorization/pages/loading.page.ts","../../../projects/unipin-angular/auth/unipin-angular-applet-auth.ts"],"sourcesContent":["import { InjectionToken, Provider } from '@angular/core';\n\nexport const LOADING_CONFIG = new InjectionToken<LoadingConfig>('LOADING_CONFIG');\n\nexport type LoadingConfig = {\n permTypes: string[];\n permModules: string[];\n subjectGuidStorageKey?: string;\n}\n\nexport function provideLoadingConfig(config: LoadingConfig): Provider{\n return {\n provide: LOADING_CONFIG,\n useValue: config\n };\n}\n","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { GqlParser, CacheStrategy, QueryResult } from '@unipin/angular-gql';\nimport type { AppLoginSubject, Maybe } from '@unipin/graphql-schema';\nimport { User } from '../types/user.type';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ProfileService {\n\n constructor(\n protected readonly gql: GqlParser\n ) { }\n\n public transformSubjetToUser(subject: AppLoginSubject): User{\n const user: User = { \n ...subject,\n email: '',\n photo: '/assets/imgs/profile.svg'\n };\n\n subject.appLoginExt?.forEach(\n ({ paramCode, file: { publicUrl }}: any) => {\n if (paramCode === 'USER_PROFILE_PHOTO') {\n user.photo = publicUrl;\n }\n }\n ); \n\n subject.appLoginPrincipal?.forEach(\n ({ principalId, principalType }: any) => {\n if (principalType === 'EMAIL_USERNAME') {\n user.email = principalId;\n }\n }\n );\n return user;\n }\n\n /**\n * A method to get the user profile information.\n * @param {string} extraAttr - Contain extra attribute to get the user profile information.\n * @param {CacheStrategy | undefined} cacheStrategy - Specifies how Apollo Client should handle data retrieval, determining whether it should make a network request to fetch fresh data from the server or use data from the local cache.\n * \n * @returns {Observable<QueryResult<{ authMsMyProfile: Maybe<AppLoginSubject> }>>} Contain user profile information.\n */\n public getMyProfile(extraAttr = '', cacheStrategy?: CacheStrategy): Observable<QueryResult<{ authMsMyProfile: Maybe<AppLoginSubject> }>>{\n return this.gql.query({\n cacheStrategy,\n operationName: 'getMyProfile',\n query: `\n query getMyProfile {\n authMsMyProfile {\n guid\n name\n status\n gender\n birthday\n category\n totpSecretGuid\n appLoginPrincipal {\n guid\n principalId\n principalType\n }\n appLoginExt {\n guid\n paramCode\n paramType\n file {\n publicUrl\n }\n }\n company {\n code\n guid\n isInternal\n name\n status\n }\n merchants {\n guid\n name\n status\n }\n roles {\n guid\n code\n name\n status\n isInternal\n }\n departments {\n isLead\n department {\n hierarchyCode\n hierarchyPath\n name\n guid\n status\n }\n }\n ${ extraAttr }\n }\n }\n `,\n });\n }\n}\n","import { Injectable, signal, WritableSignal } from '@angular/core';\nimport { Observable, tap } from 'rxjs';\nimport { GqlParser, MutationResult } from '@unipin/angular-gql';\nimport type { LoginResponse, LoginRq, MutationAuthMsRefreshAccessTokenArgs, Token } from '@unipin/graphql-schema';\nimport { User } from '../types/user.type';\nimport { ProfileService } from './profile.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthService {\n\n /**\n * Both `authToken` and `refreshToken` are public static variable to store the auth token and refresh token obtained form the login API.\n * They will be set as header param inside API calls.\n * @type {string}\n * \n * @default ''\n */\n public static authToken: string = '';\n public static refreshToken: string = '';\n\n /**\n * A public variable to store the logined user information.\n * @type {User} An interface contain user information.\n * @default {} as User\n */\n public user: WritableSignal<User> = signal({} as User);\n\n constructor(\n protected readonly gql: GqlParser,\n protected readonly profileService: ProfileService\n ) { }\n\n public static logout(): void{\n AuthService.authToken = '';\n AuthService.refreshToken = '';\n \n localStorage.removeItem('authToken');\n localStorage.removeItem('refreshToken');\n }\n\n public logout(): void{\n this.user.set({} as User);\n AuthService.logout();\n }\n\n /**\n * This method is used by the `refreshTokenInterceptor`, to get the new token shortly before the auth token is expired.\n * @param {MutationAuthMsRefreshAccessTokenArgs} variables - Contain `refreshToken` attribute which is the current refresh token.\n * @returns {Observable<MutationResult<{ authMsRefreshAccessToken: Token }>>} Contain new `authToken` and `refreshToken`.\n */\n public refreshToken(variables: MutationAuthMsRefreshAccessTokenArgs): Observable<MutationResult<{ authMsRefreshAccessToken: Token }>>{\n return this.gql.mutate({\n variables,\n operationName: 'RefreshToken',\n headers: {\n 'operation-type': 'Mutation',\n 'operation-name': 'RefreshToken'\n },\n mutation: `\n mutation RefreshToken($refreshToken: String!) {\n authMsRefreshAccessToken(refreshToken: $refreshToken) {\n accessToken\n refreshToken\n }\n }\n `\n });\n } \n\n /**\n * A method to authenticate the user to get the session for applet or platform.\n * When successful it will set the user information to the `user` variable, `authToken` and `refreshToken`.\n * It will set the `authToken`, `refreshToken`, `userGuid` and `roles` to the localStorage also for API calls.\n * \n * @param {{ email: string, password: string, sourcePlatform: string }} input - Contain `email` which is registered user email, `password` which is registered user password and `sourcePlatform` it's value can be `ADMIN` to get the applet session or `CP_COMMERCE` to get the platform session.\n * \n * @returns {Observable<MutationResult<{ authMsLogin: LoginResponse }>>} Contain logined user information.\n */\n public login(input: LoginRq): Observable<MutationResult<{ authMsLogin: LoginResponse }>>{\n return this.gql.mutate<{ authMsLogin: LoginResponse }>({\n operationName: 'Login',\n variables: { \n input \n },\n mutation: `\n mutation Login($input: LoginRq!) {\n authMsLogin(input: $input) {\n accessToken\n refreshToken\n suggestedAction\n user {\n birthday\n category\n email\n gender\n guid\n mobileNumber\n name\n status\n departments {\n department {\n hierarchyCode\n hierarchyPath\n name\n guid\n status\n }\n isLead\n }\n }\n roles {\n guid\n code\n name\n isInternal\n status\n }\n }\n }\n `\n }).pipe(\n tap(({ data }) => {\n if (!data?.authMsLogin){\n return;\n }\n const { accessToken, user, refreshToken, suggestedAction, roles } = data.authMsLogin;\n\n this.user.set(\n {\n ...user as any,\n roles: roles as any,\n photo: '/assets/imgs/profile.svg'\n }\n );\n\n AuthService.authToken = accessToken ?? '';\n AuthService.refreshToken = refreshToken ?? '';\n\n if (suggestedAction !== 'CHANGE_PASSWORD') { \n localStorage.setItem('authToken', AuthService.authToken); \n }\n\n localStorage.setItem('roles', JSON.stringify(roles));\n localStorage.setItem('userGuid', this.user().guid ?? '');\n localStorage.setItem('refreshToken', AuthService.refreshToken);\n })\n );\n }\n}\n","import { Injectable } from '@angular/core';\nimport { AuthService } from '../services/auth.service';\n\n/**\n * The `AuthResolver` service provides methods for handling authentication-related tasks,\n * such as checking user login status, retrieving authentication tokens, and managing token expiration.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthResolver {\n\n /**\n * Checks if the user is logged in by verifying the presence of an authentication token.\n * @returns {boolean} - True if the user is logged in; otherwise, false.\n */\n public isUserLoggedIn(): boolean{ \n return AuthService.authToken !== ''; \n }\n\n /**\n * Retrieves the authentication token, resolving it if needed.\n * @returns {string | null} - The authentication token if the user is logged in; otherwise, null.\n */\n public getAuthToken(): string | null{\n this.resolveUserAuthToken();\n \n if (this.isUserLoggedIn()) {\n return AuthService.authToken;\n }\n return null;\n }\n\n /**\n * Resolves the user's authentication token by checking expiration and whether the user still logged in or not.\n */\n protected resolveUserAuthToken(): void{\n if (\n !this.isUserLoggedIn() || \n !this.isTokenExpired(AuthService.authToken)\n ) {\n return;\n }\n AuthService.logout();\n }\n\n /**\n * Checks if a given token is expired or not yet.\n * @param {string | null} token - The token to be checked for expiration.\n * @returns {boolean} - True if the token is expired; otherwise, false.\n */\n protected isTokenExpired(token: string | null): boolean{\n if (!token || token === '') {\n return true;\n }\n \n const date = this.getTokenExpirationDate(token);\n if (date === null) {\n return false;\n }\n return !(<number>date.valueOf() > new Date().valueOf() + 0 * 1000);\n }\n\n /**\n * Retrieves the expiration date of a token.\n * @param {string | null} token - The token for which to retrieve the expiration date.\n * @returns {Date | null} - The expiration date of the token if available; otherwise, null.\n */\n protected getTokenExpirationDate(token: string | null): Date | null{\n const decoded: any = this.decodeToken(token); \n if (!decoded || !decoded.hasOwnProperty('exp')) {\n return null;\n }\n \n const date = new Date(0);\n date.setUTCSeconds(decoded.exp);\n return date;\n }\n\n /**\n * Decodes a JWT token to extract payload information.\n * @param {string | null} token - The JWT token to be decoded.\n * @returns {string | null} - The decoded payload as a string if successful; otherwise, null.\n */\n protected decodeToken(token: string | null): string | null{\n if (!token || token === '') {\n return null;\n }\n\n const parts = token.split('.');\n if (parts.length !== 3) {\n throw new Error(`The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.`);\n }\n\n const decoded = this.urlBase64Decode(parts[1]);\n if (!decoded) {\n throw new Error('Cannot decode the token.');\n }\n return JSON.parse(decoded);\n }\n\n /**\n * Decodes a base64url-encoded string.\n * @param {string} str - The base64url-encoded string to be decoded.\n * @returns {string} - The decoded string.\n */\n protected urlBase64Decode(str: string): string{\n let output = str.replace(/-/g, '+').replace(/_/g, '/');\n switch (output.length % 4) {\n case 0:\n break;\n \n case 2: \n output += '==';\n break;\n\n case 3:\n output += '=';\n break;\n\n default: \n throw new Error('Illegal base64url string!');\n }\n return this.b64DecodeUnicode(output);\n }\n\n /**\n * Decodes a Unicode string from a base64-encoded string.\n * @param {string} str - The base64-encoded string to be decoded.\n * @returns {string} - The decoded Unicode string.\n */\n protected b64DecodeUnicode(str: string): string{\n return decodeURIComponent(\n Array.prototype.map.call(\n this.b64decode(str), \n (c: any) => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)\n ).join('')\n );\n }\n\n /**\n * Decodes a base64-encoded string.\n * @param {string} str - The base64-encoded string to be decoded.\n * @returns {string} - The decoded string.\n */\n protected b64decode(str: string): string{\n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n let output = '';\n\n str = String(str).replace(/=+$/, '');\n if (str.length % 4 === 1) {\n throw new Error(`'atob' failed: The string to be decoded is not correctly encoded.`);\n }\n\n for (\n let bc = 0, bs: any, buffer: any, idx = 0;\n (buffer = str.charAt(idx++));\n \n ~buffer && ((bs = bc % 4? bs * 64 + buffer : buffer), bc++ % 4)? (output += String.fromCharCode(255 & (bs >> ((-2 * bc) & 6)))) : 0\n ) buffer = chars.indexOf(buffer);\n\n return output;\n }\n}\n","import { inject } from '@angular/core';\nimport { CanActivateFn, Router } from '@angular/router';\nimport { AuthResolver } from '../resolvers/auth.resolver';\n\nexport const authGuard: CanActivateFn = (): boolean => {\n \n const router = inject(Router);\n const resolver = inject(AuthResolver);\n \n if (!resolver.isUserLoggedIn()) {\n router.navigateByUrl('/auth/login');\n return false;\n }\n return true;\n};\n","import { Injectable, signal } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { GqlParser, CacheStrategy, QueryResult } from '@unipin/angular-gql';\nimport type { AppPermDfn, PermissionFilter } from '@unipin/graphql-schema';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class PermissionService {\n\n public readonly permissions = signal(new Map<string, boolean>());\n\n /**\n * A boolean value that tells the permission service is initiated (permissions list is retrieved from Backend) or not.\n * @default false\n */\n public isInitiated = false;\n\n constructor(\n protected readonly gql: GqlParser\n ) { }\n\n /**\n * A method that checking if the user has the permission or not based on the params value.\n * @param {string} permission - Permission code that wanted to be checked\n * \n * @returns {boolean} Contain boolean value that tells the user has the permission or not.\n */\n public has(permission: string): boolean{\n const permissions = this.permissions();\n const [ scope, module, type ] = permission.split('.');\n\n return (\n permissions.has(`${ scope }.${ module }.ADMIN`) ||\n permissions.has(`${ scope }.${ module }.${ type }`)\n );\n }\n\n /**\n * A method that set the permissions and permission modules.\n * @param {string[]} permCodes - Contain list of permission codes.\n */\n public setPermission(permCodes: string[]): void{\n this.permissions.update(\n (map) => {\n const newMap = new Map(map);\n \n for (const code of permCodes) {\n newMap.set(code, true);\n }\n return newMap;\n }\n );\n }\n\n /**\n * A method that get the query value with authMsPermission as the object.\n * @param {PermissionFilter} filter - Contain filter as a conditions for the query.\n * @returns {Observable<ApolloQueryResult<{ authMsPermission: { data: AppPermDfn[] }}>>} Contain query value.\n */\n public getPermissions(filter: PermissionFilter, cacheStrategy?: CacheStrategy): Observable<QueryResult<{ authMsPermission: { data: AppPermDfn[] }}>>{\n return this.gql.query({\n cacheStrategy,\n operationName: 'QueryPermission',\n variables: { \n filter \n },\n query: `\n query QueryPermission($filter: PermissionFilter!) {\n authMsPermission(filter: $filter) {\n data {\n permCode\n }\n }\n }\n `\n });\n }\n}\n","import { inject } from '@angular/core';\nimport { Location } from '@angular/common';\nimport { ActivatedRouteSnapshot, CanActivateFn, Router } from '@angular/router';\nimport { PermissionService } from '../services/permission.service';\n\nexport const permissionGuard: CanActivateFn = (route: ActivatedRouteSnapshot): boolean => {\n \n const router: Router = inject(Router);\n const location: Location = inject(Location);\n const permissionService: PermissionService = inject(PermissionService);\n\n const permissions: string[] = route.data['permissions'];\n const aggregator: 'AND' | 'OR' = route.data['aggregator']?? 'OR';\n\n if (\n !permissions ||\n !permissions.length\n ) {\n console.error('Invalid config: permissions is a required parameter in route data for PermissionGuard');\n return false;\n }\n\n if (!permissionService.isInitiated) {\n router.navigate(\n [ 'loading' ], \n { \n queryParams: { \n url: `${ location.path() + window.location.hash }` \n } \n }\n );\n return false;\n }\n \n if (aggregator === 'OR') {\n for (let i = 0; i < permissions.length; i++) {\n if (permissionService.has(permissions[i])) {\n return true;\n }\n }\n }\n\n let hasPermission = true;\n for (let i = 0; i < permissions.length; i++) {\n if (!permissionService.has(permissions[i])) {\n hasPermission = false;\n break;\n }\n }\n\n if (hasPermission) {\n return true;\n }\n router.navigateByUrl('/401');\n return false;\n};\n","import { HttpEvent, HttpHandlerFn, HttpInterceptorFn, HttpRequest } from '@angular/common/http';\nimport { Observable } from 'rxjs';\nimport { AuthService } from '../../authentication/services/auth.service';\n\nexport const authorizationInterceptor: HttpInterceptorFn = (\n request: HttpRequest<any>,\n next: HttpHandlerFn\n): Observable<HttpEvent<any>> => {\n \n return next(\n request.clone(\n {\n headers: request.headers,\n setHeaders: {\n authorization: AuthService.authToken,\n }\n }\n )\n );\n};\n","import { inject } from '@angular/core';\nimport { HttpEvent, HttpHandlerFn, HttpInterceptorFn, HttpRequest } from '@angular/common/http';\nimport { Router } from '@angular/router';\nimport { catchError, Observable, switchMap, throwError } from 'rxjs';\nimport { AuthService } from '../services/auth.service';\n\nexport const refreshTokenInterceptor: HttpInterceptorFn = (\n request: HttpRequest<any>, \n next: HttpHandlerFn\n): Observable<HttpEvent<any>> => {\n \n const router = inject(Router);\n const authService = inject(AuthService);\n\n return next(request).pipe(\n catchError(\n ({ error: { errors }}) => {\n if (errors[0].extensions.code !== 'USER_INVALID_TOKEN') {\n return throwError(() => errors[0]);\n }\n\n return authService.refreshToken({ refreshToken: AuthService.refreshToken }).pipe(\n switchMap(\n ({ data }) => {\n const { accessToken, refreshToken } = data!.authMsRefreshAccessToken;\n\n AuthService.authToken = accessToken!;\n AuthService.refreshToken = refreshToken!;\n\n localStorage.setItem('authToken', accessToken!);\n localStorage.setItem('refreshToken', refreshToken!);\n\n return next(\n request.clone(\n {\n setHeaders: {\n authorization: accessToken!,\n },\n }\n )\n );\n }\n ),\n catchError(\n () => {\n authService.logout();\n location.href = `/auth/login?url=${ encodeURIComponent(router.url + location.hash) }`;\n return throwError(() => errors[0]);\n }\n )\n );\n }\n )\n );\n};\n","import { Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { PermissionService } from '../services/permission.service';\n\n/**\n * The `PermissionDirective` is a directive that conditionally renders content based on user permissions.\n * @selector '[hasPermission]'\n * \n * @example\n * ```html\n * <div *hasPermission=\"'MERCHANT.CONTRACT.READ'\"></div>\n * ```\n */\n@Directive({\n standalone: true,\n exportAs: 'hasPermission',\n selector: '[hasPermission]'\n})\nexport class PermissionDirective {\n\n constructor(\n protected readonly service: PermissionService,\n protected readonly templateRef: TemplateRef<any>,\n protected readonly viewContainer: ViewContainerRef,\n ) { }\n\n @Input()\n set hasPermission(permission: string) {\n if (this.service.has(permission)) {\n this.viewContainer.createEmbeddedView(\n this.templateRef\n );\n return;\n }\n this.viewContainer.clear();\n }\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport { matLockRound } from '@ng-icons/material-icons/round';\n\n@Component({\n standalone: true,\n selector: 'up-unauthorized',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'flex flex-col items-center justify-center size-full gap-4 p-5 select-none'\n },\n providers: [\n provideIcons(\n { \n matLockRound \n }\n )\n ],\n imports: [\n NgIcon\n ],\n template: `\n <ng-icon \n name=\"matLockRound\" \n class=\"text-3xl lg:text-5xl\" \n />\n \n <h3 class=\"text-center text-lg lg:text-2xl font-bold\">\n Oops! You're not authorized to access this page.\n </h3>\n <p class=\"text-center\">Please log in or re-check your permissions.</p>\n `,\n})\nexport class UnauthorizedPage {}\n","import { ChangeDetectionStrategy, Component, Inject, OnDestroy, OnInit } from '@angular/core';\nimport { Router, ActivatedRoute } from '@angular/router';\nimport { Subscription } from 'rxjs';\nimport { UpSpinnerComponent } from '@unipin/angular-applet/spinner';\nimport { LOADING_CONFIG, LoadingConfig } from '../utils/provide-loading-config.util';\nimport { PermissionService } from '../services/permission.service';\n\n@Component({\n standalone: true,\n selector: 'up-loading',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'flex flex-col items-center gap-6 p-5 justify-center size-full select-none'\n },\n imports: [\n UpSpinnerComponent\n ],\n template: `\n <up-spinner class=\"size-10\" />\n \n <h3 class=\"text-center text-lg lg:text-2xl font-bold\">\n Please wait, we're preparing the applet. Drink water or coffee while waiting.\n </h3>\n `,\n})\nexport class LoadingPage implements OnInit, OnDestroy {\n\n protected sub?: Subscription;\n\n constructor(\n @Inject(LOADING_CONFIG) public readonly config: LoadingConfig,\n protected readonly router: Router,\n protected readonly route: ActivatedRoute,\n protected readonly permissionService: PermissionService\n ) { }\n\n public ngOnInit(): void{\n const subjectGuid = localStorage.getItem(this.config.subjectGuidStorageKey || 'userGuid');\n if (!subjectGuid) {\n this.router.navigate([ '401' ]);\n return;\n }\n\n const permCodeList: string[] = [];\n this.sub = this.permissionService.getPermissions(\n { \n subjectGuid, \n pageSize: 1000,\n permType: this.config.permTypes,\n permModule: this.config.permModules, \n }, \n 'no-cache'\n ).subscribe({\n error: () => {\n this.router.navigate([ '401' ]);\n },\n next: ({ data: { authMsPermission: { data }}}) => {\n data.forEach(\n ({ permCode }) => {\n if (!permCode) {\n return;\n }\n permCodeList.push(permCode);\n }\n );\n\n this.permissionService.isInitiated = true;\n this.permissionService.setPermission(permCodeList);\n this.router.navigateByUrl(this.route.snapshot.queryParamMap.get('url')?? '');\n }\n });\n }\n\n public ngOnDestroy(): void{\n this.sub?.unsubscribe();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i2.ProfileService","i1.PermissionService","i1","i2.PermissionService"],"mappings":";;;;;;;;;;;AAEO,MAAM,cAAc,GAAG,IAAI,cAAc,CAAgB,gBAAgB,CAAC;AAQ3E,SAAU,oBAAoB,CAAC,MAAqB,EAAA;IACxD,OAAO;AACL,QAAA,OAAO,EAAE,cAAc;AACvB,QAAA,QAAQ,EAAE;KACX;AACH;;MCNa,cAAc,CAAA;AAEzB,IAAA,WAAA,CACqB,GAAc,EAAA;QAAd,IAAA,CAAA,GAAG,GAAH,GAAG;IACpB;AAEG,IAAA,qBAAqB,CAAC,OAAwB,EAAA;AACnD,QAAA,MAAM,IAAI,GAAS;AACjB,YAAA,GAAG,OAAO;AACV,YAAA,KAAK,EAAE,EAAE;AACT,YAAA,KAAK,EAAE;SACR;AAED,QAAA,OAAO,CAAC,WAAW,EAAE,OAAO,CAC1B,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,SAAS,EAAE,EAAM,KAAI;AACzC,YAAA,IAAI,SAAS,KAAK,oBAAoB,EAAE;AACtC,gBAAA,IAAI,CAAC,KAAK,GAAG,SAAS;YACxB;AACF,QAAA,CAAC,CACF;AAED,QAAA,OAAO,CAAC,iBAAiB,EAAE,OAAO,CAChC,CAAC,EAAE,WAAW,EAAE,aAAa,EAAO,KAAI;AACtC,YAAA,IAAI,aAAa,KAAK,gBAAgB,EAAE;AACtC,gBAAA,IAAI,CAAC,KAAK,GAAG,WAAW;YAC1B;AACF,QAAA,CAAC,CACF;AACD,QAAA,OAAO,IAAI;IACb;AAEA;;;;;;AAMG;AACI,IAAA,YAAY,CAAC,SAAS,GAAG,EAAE,EAAE,aAA6B,EAAA;AAC/D,QAAA,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC;YACpB,aAAa;AACb,YAAA,aAAa,EAAE,cAAc;AAC7B,YAAA,KAAK,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AE;;;;;;AAMT,EAAA,CAAA;AACF,iBAAA;;0BAMI,MAAM;2BAAC,cAAc;;;AC9B1B;;AAEG;;;;"}
1
+ {"version":3,"file":"unipin-angular-applet-auth.mjs","sources":["../../../projects/unipin-angular/auth/authorization/utils/provide-loading-config.util.ts","../../../projects/unipin-angular/auth/authentication/services/profile.service.ts","../../../projects/unipin-angular/auth/authentication/services/auth.service.ts","../../../projects/unipin-angular/auth/authentication/resolvers/auth.resolver.ts","../../../projects/unipin-angular/auth/authentication/guards/auth.guard.ts","../../../projects/unipin-angular/auth/authorization/services/permission.service.ts","../../../projects/unipin-angular/auth/authorization/guards/permission.guard.ts","../../../projects/unipin-angular/auth/authorization/interceptors/authorization.interceptor.ts","../../../projects/unipin-angular/auth/authentication/interceptors/refresh-token.interceptor.ts","../../../projects/unipin-angular/auth/authorization/directives/permission.directive.ts","../../../projects/unipin-angular/auth/authorization/pages/unauthorized.page.ts","../../../projects/unipin-angular/auth/authorization/pages/loading.page.ts","../../../projects/unipin-angular/auth/unipin-angular-applet-auth.ts"],"sourcesContent":["import { InjectionToken, Provider } from '@angular/core';\n\nexport const LOADING_CONFIG = new InjectionToken<LoadingConfig>('LOADING_CONFIG');\n\nexport type LoadingConfig = {\n permTypes: string[];\n permModules: string[];\n subjectGuidStorageKey?: string;\n}\n\nexport function provideLoadingConfig(config: LoadingConfig): Provider{\n return {\n provide: LOADING_CONFIG,\n useValue: config\n };\n}\n","import { Injectable } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { GqlParser, CacheStrategy, QueryResult } from '@unipin/angular-gql';\nimport type { AppLoginSubject, Maybe } from '@unipin/graphql-schema';\nimport { User } from '../types/user.type';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class ProfileService {\n\n constructor(\n protected readonly gql: GqlParser\n ) { }\n\n public transformSubjetToUser(subject: AppLoginSubject): User{\n const user: User = { \n ...subject,\n email: '',\n photo: '/assets/imgs/profile.svg'\n };\n\n subject.appLoginExt?.forEach(\n ({ paramCode, file: { publicUrl }}: any) => {\n if (paramCode === 'USER_PROFILE_PHOTO') {\n user.photo = publicUrl;\n }\n }\n ); \n\n subject.appLoginPrincipal?.forEach(\n ({ principalId, principalType }: any) => {\n if (principalType === 'EMAIL_USERNAME') {\n user.email = principalId;\n }\n }\n );\n return user;\n }\n\n /**\n * A method to get the user profile information.\n * @param {string} extraAttr - Contain extra attribute to get the user profile information.\n * @param {CacheStrategy | undefined} cacheStrategy - Specifies how Apollo Client should handle data retrieval, determining whether it should make a network request to fetch fresh data from the server or use data from the local cache.\n * \n * @returns {Observable<QueryResult<{ authMsMyProfile: Maybe<AppLoginSubject> }>>} Contain user profile information.\n */\n public getMyProfile(extraAttr = '', cacheStrategy?: CacheStrategy): Observable<QueryResult<{ authMsMyProfile: Maybe<AppLoginSubject> }>>{\n return this.gql.query({\n cacheStrategy,\n operationName: 'getMyProfile',\n query: `\n query getMyProfile {\n authMsMyProfile {\n guid\n name\n status\n gender\n birthday\n category\n totpSecretGuid\n appLoginPrincipal {\n guid\n principalId\n principalType\n }\n appLoginExt {\n guid\n paramCode\n paramType\n file {\n publicUrl\n }\n }\n company {\n code\n guid\n isInternal\n name\n status\n }\n merchants {\n guid\n name\n status\n }\n roles {\n guid\n code\n name\n status\n isInternal\n }\n departments {\n isLead\n department {\n hierarchyCode\n hierarchyPath\n name\n guid\n status\n }\n }\n ${ extraAttr }\n }\n }\n `,\n });\n }\n}\n","import { Injectable, signal, WritableSignal } from '@angular/core';\nimport { Observable, tap } from 'rxjs';\nimport { GqlParser, MutationResult } from '@unipin/angular-gql';\nimport type { LoginResponse, LoginRq, MutationAuthMsRefreshAccessTokenArgs, Token } from '@unipin/graphql-schema';\nimport { User } from '../types/user.type';\nimport { ProfileService } from './profile.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthService {\n\n /**\n * Both `authToken` and `refreshToken` are public static variable to store the auth token and refresh token obtained form the login API.\n * They will be set as header param inside API calls.\n * @type {string}\n * \n * @default ''\n */\n public static authToken: string = '';\n public static refreshToken: string = '';\n\n /**\n * A public variable to store the logined user information.\n * @type {User} An interface contain user information.\n * @default {} as User\n */\n public user: WritableSignal<User> = signal({} as User);\n\n constructor(\n protected readonly gql: GqlParser,\n protected readonly profileService: ProfileService\n ) { }\n\n public static logout(): void{\n AuthService.authToken = '';\n AuthService.refreshToken = '';\n \n localStorage.removeItem('userGuid');\n localStorage.removeItem('authToken');\n localStorage.removeItem('refreshToken');\n }\n\n public logout(): void{\n this.user.set({} as User);\n AuthService.logout();\n }\n\n /**\n * This method is used by the `refreshTokenInterceptor`, to get the new token shortly before the auth token is expired.\n * @param {MutationAuthMsRefreshAccessTokenArgs} variables - Contain `refreshToken` attribute which is the current refresh token.\n * @returns {Observable<MutationResult<{ authMsRefreshAccessToken: Token }>>} Contain new `authToken` and `refreshToken`.\n */\n public refreshToken(variables: MutationAuthMsRefreshAccessTokenArgs): Observable<MutationResult<{ authMsRefreshAccessToken: Token }>>{\n return this.gql.mutate({\n variables,\n operationName: 'RefreshToken',\n headers: {\n 'operation-type': 'Mutation',\n 'operation-name': 'RefreshToken'\n },\n mutation: `\n mutation RefreshToken($refreshToken: String!) {\n authMsRefreshAccessToken(refreshToken: $refreshToken) {\n accessToken\n refreshToken\n }\n }\n `\n });\n } \n\n /**\n * A method to authenticate the user to get the session for applet or platform.\n * When successful it will set the user information to the `user` variable, `authToken` and `refreshToken`.\n * It will set the `authToken`, `refreshToken`, `userGuid` and `roles` to the localStorage also for API calls.\n * \n * @param {{ email: string, password: string, sourcePlatform: string }} input - Contain `email` which is registered user email, `password` which is registered user password and `sourcePlatform` it's value can be `ADMIN` to get the applet session or `CP_COMMERCE` to get the platform session.\n * \n * @returns {Observable<MutationResult<{ authMsLogin: LoginResponse }>>} Contain logined user information.\n */\n public login(input: LoginRq): Observable<MutationResult<{ authMsLogin: LoginResponse }>>{\n return this.gql.mutate<{ authMsLogin: LoginResponse }>({\n operationName: 'Login',\n variables: { \n input \n },\n mutation: `\n mutation Login($input: LoginRq!) {\n authMsLogin(input: $input) {\n accessToken\n refreshToken\n suggestedAction\n user {\n birthday\n category\n email\n gender\n guid\n mobileNumber\n name\n status\n departments {\n department {\n hierarchyCode\n hierarchyPath\n name\n guid\n status\n }\n isLead\n }\n }\n roles {\n guid\n code\n name\n isInternal\n status\n }\n }\n }\n `\n }).pipe(\n tap(({ data }) => {\n if (!data?.authMsLogin){\n return;\n }\n const { accessToken, user, refreshToken, suggestedAction, roles } = data.authMsLogin;\n\n this.user.set(\n {\n ...user as any,\n roles: roles as any,\n photo: '/assets/imgs/profile.svg'\n }\n );\n\n AuthService.authToken = accessToken ?? '';\n AuthService.refreshToken = refreshToken ?? '';\n\n if (suggestedAction !== 'CHANGE_PASSWORD') { \n localStorage.setItem('authToken', AuthService.authToken); \n }\n\n localStorage.setItem('userGuid', this.user().guid ?? '');\n localStorage.setItem('refreshToken', AuthService.refreshToken);\n })\n );\n }\n}\n","import { Injectable } from '@angular/core';\nimport { AuthService } from '../services/auth.service';\n\n/**\n * The `AuthResolver` service provides methods for handling authentication-related tasks,\n * such as checking user login status, retrieving authentication tokens, and managing token expiration.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class AuthResolver {\n\n /**\n * Checks if the user is logged in by verifying the presence of an authentication token.\n * @returns {boolean} - True if the user is logged in; otherwise, false.\n */\n public isUserLoggedIn(): boolean{ \n return AuthService.authToken !== ''; \n }\n\n /**\n * Retrieves the authentication token, resolving it if needed.\n * @returns {string | null} - The authentication token if the user is logged in; otherwise, null.\n */\n public getAuthToken(): string | null{\n this.resolveUserAuthToken();\n \n if (this.isUserLoggedIn()) {\n return AuthService.authToken;\n }\n return null;\n }\n\n /**\n * Resolves the user's authentication token by checking expiration and whether the user still logged in or not.\n */\n protected resolveUserAuthToken(): void{\n if (\n !this.isUserLoggedIn() || \n !this.isTokenExpired(AuthService.authToken)\n ) {\n return;\n }\n AuthService.logout();\n }\n\n /**\n * Checks if a given token is expired or not yet.\n * @param {string | null} token - The token to be checked for expiration.\n * @returns {boolean} - True if the token is expired; otherwise, false.\n */\n protected isTokenExpired(token: string | null): boolean{\n if (!token || token === '') {\n return true;\n }\n \n const date = this.getTokenExpirationDate(token);\n if (date === null) {\n return false;\n }\n return !(<number>date.valueOf() > new Date().valueOf() + 0 * 1000);\n }\n\n /**\n * Retrieves the expiration date of a token.\n * @param {string | null} token - The token for which to retrieve the expiration date.\n * @returns {Date | null} - The expiration date of the token if available; otherwise, null.\n */\n protected getTokenExpirationDate(token: string | null): Date | null{\n const decoded: any = this.decodeToken(token); \n if (!decoded || !decoded.hasOwnProperty('exp')) {\n return null;\n }\n \n const date = new Date(0);\n date.setUTCSeconds(decoded.exp);\n return date;\n }\n\n /**\n * Decodes a JWT token to extract payload information.\n * @param {string | null} token - The JWT token to be decoded.\n * @returns {string | null} - The decoded payload as a string if successful; otherwise, null.\n */\n protected decodeToken(token: string | null): string | null{\n if (!token || token === '') {\n return null;\n }\n\n const parts = token.split('.');\n if (parts.length !== 3) {\n throw new Error(`The inspected token doesn't appear to be a JWT. Check to make sure it has three parts and see https://jwt.io for more.`);\n }\n\n const decoded = this.urlBase64Decode(parts[1]);\n if (!decoded) {\n throw new Error('Cannot decode the token.');\n }\n return JSON.parse(decoded);\n }\n\n /**\n * Decodes a base64url-encoded string.\n * @param {string} str - The base64url-encoded string to be decoded.\n * @returns {string} - The decoded string.\n */\n protected urlBase64Decode(str: string): string{\n let output = str.replace(/-/g, '+').replace(/_/g, '/');\n switch (output.length % 4) {\n case 0:\n break;\n \n case 2: \n output += '==';\n break;\n\n case 3:\n output += '=';\n break;\n\n default: \n throw new Error('Illegal base64url string!');\n }\n return this.b64DecodeUnicode(output);\n }\n\n /**\n * Decodes a Unicode string from a base64-encoded string.\n * @param {string} str - The base64-encoded string to be decoded.\n * @returns {string} - The decoded Unicode string.\n */\n protected b64DecodeUnicode(str: string): string{\n return decodeURIComponent(\n Array.prototype.map.call(\n this.b64decode(str), \n (c: any) => '%' + ('00' + c.charCodeAt(0).toString(16)).slice(-2)\n ).join('')\n );\n }\n\n /**\n * Decodes a base64-encoded string.\n * @param {string} str - The base64-encoded string to be decoded.\n * @returns {string} - The decoded string.\n */\n protected b64decode(str: string): string{\n const chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';\n let output = '';\n\n str = String(str).replace(/=+$/, '');\n if (str.length % 4 === 1) {\n throw new Error(`'atob' failed: The string to be decoded is not correctly encoded.`);\n }\n\n for (\n let bc = 0, bs: any, buffer: any, idx = 0;\n (buffer = str.charAt(idx++));\n \n ~buffer && ((bs = bc % 4? bs * 64 + buffer : buffer), bc++ % 4)? (output += String.fromCharCode(255 & (bs >> ((-2 * bc) & 6)))) : 0\n ) buffer = chars.indexOf(buffer);\n\n return output;\n }\n}\n","import { inject } from '@angular/core';\nimport { CanActivateFn, Router } from '@angular/router';\nimport { AuthResolver } from '../resolvers/auth.resolver';\n\nexport const authGuard: CanActivateFn = (): boolean => {\n \n const router = inject(Router);\n const resolver = inject(AuthResolver);\n \n if (!resolver.isUserLoggedIn()) {\n router.navigateByUrl('/auth/login');\n return false;\n }\n return true;\n};\n","import { Injectable, signal } from '@angular/core';\nimport { Observable } from 'rxjs';\nimport { GqlParser, CacheStrategy, QueryResult } from '@unipin/angular-gql';\nimport type { AppPermDfn, PermissionFilter } from '@unipin/graphql-schema';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class PermissionService {\n\n public readonly permissions = signal(new Map<string, boolean>());\n\n /**\n * A boolean value that tells the permission service is initiated (permissions list is retrieved from Backend) or not.\n * @default false\n */\n public isInitiated = false;\n\n constructor(\n protected readonly gql: GqlParser\n ) { }\n\n /**\n * A method that checking if the user has the permission or not based on the params value.\n * @param {string} permission - Permission code that wanted to be checked\n * \n * @returns {boolean} Contain boolean value that tells the user has the permission or not.\n */\n public has(permission: string): boolean{\n const permissions = this.permissions();\n const [ scope, module, type ] = permission.split('.');\n\n return (\n permissions.has(`${ scope }.${ module }.ADMIN`) ||\n permissions.has(`${ scope }.${ module }.${ type }`)\n );\n }\n\n /**\n * A method that set the permissions and permission modules.\n * @param {string[]} permCodes - Contain list of permission codes.\n */\n public setPermission(permCodes: string[]): void{\n this.permissions.update(\n (map) => {\n const newMap = new Map(map);\n \n for (const code of permCodes) {\n newMap.set(code, true);\n }\n return newMap;\n }\n );\n }\n\n /**\n * A method that get the query value with authMsPermission as the object.\n * @param {PermissionFilter} filter - Contain filter as a conditions for the query.\n * @returns {Observable<ApolloQueryResult<{ authMsPermission: { data: AppPermDfn[] }}>>} Contain query value.\n */\n public getPermissions(filter: PermissionFilter, cacheStrategy?: CacheStrategy): Observable<QueryResult<{ authMsPermission: { data: AppPermDfn[] }}>>{\n return this.gql.query({\n cacheStrategy,\n operationName: 'QueryPermission',\n variables: { \n filter \n },\n query: `\n query QueryPermission($filter: PermissionFilter!) {\n authMsPermission(filter: $filter) {\n data {\n permCode\n }\n }\n }\n `\n });\n }\n}\n","import { inject } from '@angular/core';\nimport { Location } from '@angular/common';\nimport { ActivatedRouteSnapshot, CanActivateFn, Router } from '@angular/router';\nimport { PermissionService } from '../services/permission.service';\n\nexport const permissionGuard: CanActivateFn = (route: ActivatedRouteSnapshot): boolean => {\n \n const router: Router = inject(Router);\n const location: Location = inject(Location);\n const permissionService: PermissionService = inject(PermissionService);\n\n const permissions: string[] = route.data['permissions'];\n const aggregator: 'AND' | 'OR' = route.data['aggregator']?? 'OR';\n\n if (\n !permissions ||\n !permissions.length\n ) {\n console.error('Invalid config: permissions is a required parameter in route data for PermissionGuard');\n return false;\n }\n\n if (!permissionService.isInitiated) {\n router.navigate(\n [ 'loading' ], \n { \n queryParams: { \n url: `${ location.path() + window.location.hash }` \n } \n }\n );\n return false;\n }\n \n if (aggregator === 'OR') {\n for (let i = 0; i < permissions.length; i++) {\n if (permissionService.has(permissions[i])) {\n return true;\n }\n }\n }\n\n let hasPermission = true;\n for (let i = 0; i < permissions.length; i++) {\n if (!permissionService.has(permissions[i])) {\n hasPermission = false;\n break;\n }\n }\n\n if (hasPermission) {\n return true;\n }\n router.navigateByUrl('/401');\n return false;\n};\n","import { HttpEvent, HttpHandlerFn, HttpInterceptorFn, HttpRequest } from '@angular/common/http';\nimport { Observable } from 'rxjs';\nimport { AuthService } from '../../authentication/services/auth.service';\n\nexport const authorizationInterceptor: HttpInterceptorFn = (\n request: HttpRequest<any>,\n next: HttpHandlerFn\n): Observable<HttpEvent<any>> => {\n \n return next(\n request.clone(\n {\n headers: request.headers,\n setHeaders: {\n authorization: AuthService.authToken,\n }\n }\n )\n );\n};\n","import { inject } from '@angular/core';\nimport { HttpEvent, HttpHandlerFn, HttpInterceptorFn, HttpRequest } from '@angular/common/http';\nimport { Router } from '@angular/router';\nimport { catchError, Observable, switchMap, tap, throwError } from 'rxjs';\nimport { AuthService } from '../services/auth.service';\n\n\nexport const refreshTokenInterceptor: HttpInterceptorFn = (\n request: HttpRequest<any>, \n next: HttpHandlerFn\n): Observable<HttpEvent<any>> => {\n \n const router = inject(Router);\n const authService = inject(AuthService);\n\n return next(request).pipe(\n tap(\n ({ type, body }: any) => {\n if (\n type === 0 ||\n !body\n ) {\n return;\n }\n \n const { errors } = body;\n if (\n !errors ||\n !errors.length ||\n errors[0].extensions.code !== 'USER_INVALID_TOKEN'\n ) {\n return;\n }\n throw body;\n }\n ),\n catchError(\n (error: any) => {\n const { errors } = error;\n if (\n !errors || \n !errors.length\n ) {\n return throwError(() => error);\n }\n \n if (\n (\n errors[0].message &&\n errors[0].extensions.code !== 'USER_INVALID_TOKEN'\n ) ||\n request.url.includes('RefreshToken')\n ) {\n return throwError(() => errors[0]);\n }\n \n return authService.refreshToken({ refreshToken: AuthService.refreshToken }).pipe(\n switchMap(\n ({ data }) => {\n const { accessToken, refreshToken } = data!.authMsRefreshAccessToken;\n\n AuthService.authToken = accessToken!;\n AuthService.refreshToken = refreshToken!;\n\n localStorage.setItem('authToken', accessToken!);\n localStorage.setItem('refreshToken', refreshToken!);\n\n return next(\n request.clone(\n {\n setHeaders: {\n authorization: accessToken!,\n },\n }\n )\n );\n }\n ),\n catchError(\n () => {\n authService.logout();\n location.href = `/auth/login?url=${ encodeURIComponent(router.url + location.hash) }`;\n return throwError(() => errors[0]);\n }\n )\n );\n }\n )\n );\n};\n","import { Directive, Input, TemplateRef, ViewContainerRef } from '@angular/core';\nimport { PermissionService } from '../services/permission.service';\n\n/**\n * The `PermissionDirective` is a directive that conditionally renders content based on user permissions.\n * @selector '[hasPermission]'\n * \n * @example\n * ```html\n * <div *hasPermission=\"'MERCHANT.CONTRACT.READ'\"></div>\n * ```\n */\n@Directive({\n standalone: true,\n exportAs: 'hasPermission',\n selector: '[hasPermission]'\n})\nexport class PermissionDirective {\n\n constructor(\n protected readonly service: PermissionService,\n protected readonly templateRef: TemplateRef<any>,\n protected readonly viewContainer: ViewContainerRef,\n ) { }\n\n @Input()\n set hasPermission(permission: string) {\n if (this.service.has(permission)) {\n this.viewContainer.createEmbeddedView(\n this.templateRef\n );\n return;\n }\n this.viewContainer.clear();\n }\n}\n","import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { NgIcon, provideIcons } from '@ng-icons/core';\nimport { matLockRound } from '@ng-icons/material-icons/round';\n\n@Component({\n standalone: true,\n selector: 'up-unauthorized',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'flex flex-col items-center justify-center size-full gap-4 p-5 select-none'\n },\n providers: [\n provideIcons(\n { \n matLockRound \n }\n )\n ],\n imports: [\n NgIcon\n ],\n template: `\n <ng-icon \n name=\"matLockRound\" \n class=\"text-3xl lg:text-5xl\" \n />\n \n <h3 class=\"text-center text-lg lg:text-2xl font-bold\">\n Oops! You're not authorized to access this page.\n </h3>\n <p class=\"text-center\">Please log in or re-check your permissions.</p>\n `,\n})\nexport class UnauthorizedPage {}\n","import { ChangeDetectionStrategy, Component, Inject, OnDestroy, OnInit } from '@angular/core';\nimport { Router, ActivatedRoute } from '@angular/router';\nimport { Subscription } from 'rxjs';\nimport { UpSpinnerComponent } from '@unipin/angular-applet/spinner';\nimport { LOADING_CONFIG, LoadingConfig } from '../utils/provide-loading-config.util';\nimport { PermissionService } from '../services/permission.service';\n\n@Component({\n standalone: true,\n selector: 'up-loading',\n changeDetection: ChangeDetectionStrategy.OnPush,\n host: {\n class: 'flex flex-col items-center gap-6 p-5 justify-center size-full select-none'\n },\n imports: [\n UpSpinnerComponent\n ],\n template: `\n <up-spinner class=\"size-10\" />\n \n <h3 class=\"text-center text-lg lg:text-2xl font-bold\">\n Please wait, we're preparing the applet. Drink water or coffee while waiting.\n </h3>\n `,\n})\nexport class LoadingPage implements OnInit, OnDestroy {\n\n protected sub?: Subscription;\n\n constructor(\n @Inject(LOADING_CONFIG) public readonly config: LoadingConfig,\n protected readonly router: Router,\n protected readonly route: ActivatedRoute,\n protected readonly permissionService: PermissionService\n ) { }\n\n public ngOnInit(): void{\n const subjectGuid = localStorage.getItem(this.config.subjectGuidStorageKey || 'userGuid');\n if (!subjectGuid) {\n this.router.navigate([ '401' ]);\n return;\n }\n\n const permCodeList: string[] = [];\n this.sub = this.permissionService.getPermissions(\n { \n subjectGuid, \n pageSize: 1000,\n permType: this.config.permTypes,\n permModule: this.config.permModules, \n }, \n 'no-cache'\n ).subscribe({\n error: () => {\n this.router.navigate([ '401' ]);\n },\n next: ({ data: { authMsPermission: { data }}}) => {\n data.forEach(\n ({ permCode }) => {\n if (!permCode) {\n return;\n }\n permCodeList.push(permCode);\n }\n );\n\n this.permissionService.isInitiated = true;\n this.permissionService.setPermission(permCodeList);\n this.router.navigateByUrl(this.route.snapshot.queryParamMap.get('url')?? '');\n }\n });\n }\n\n public ngOnDestroy(): void{\n this.sub?.unsubscribe();\n }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i2.ProfileService","i1.PermissionService","i1","i2.PermissionService"],"mappings":";;;;;;;;;;;AAEO,MAAM,cAAc,GAAG,IAAI,cAAc,CAAgB,gBAAgB,CAAC;AAQ3E,SAAU,oBAAo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EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAUT,WAAW,EAAA,UAAA,EAAA,CAAA;kBAlBvB,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,QAAQ,EAAE,YAAY;oBACtB,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAC/C,oBAAA,IAAI,EAAE;AACJ,wBAAA,KAAK,EAAE;AACR,qBAAA;AACD,oBAAA,OAAO,EAAE;wBACP;AACD,qBAAA;AACD,oBAAA,QAAQ,EAAE;;;;;;AAMT,EAAA,CAAA;AACF,iBAAA;;0BAMI,MAAM;2BAAC,cAAc;;;AC9B1B;;AAEG;;;;"}
@@ -6,11 +6,11 @@ class UpAvatarDirective {
6
6
  constructor(el, renderer) {
7
7
  this.el = el;
8
8
  this.renderer = renderer;
9
- this.initialText = input('', ...(ngDevMode ? [{ debugName: "initialText", alias: 'initial' }] : [{ alias: 'initial' }]));
10
- this.inlineClass = input('', ...(ngDevMode ? [{ debugName: "inlineClass", alias: 'class' }] : [{ alias: 'class' }]));
9
+ this.initialText = input('', { ...(ngDevMode ? { debugName: "initialText" } : {}), alias: 'initial' });
10
+ this.inlineClass = input('', { ...(ngDevMode ? { debugName: "inlineClass" } : {}), alias: 'class' });
11
11
  this._computedClass = computed(() => {
12
12
  return up('inline-flex items-center justify-center rounded-full overflow-hidden select-none size-16', this.initialText() ? 'bg-gray-400 text-white font-semibold text-3xl' : 'object-cover', this.inlineClass());
13
- }, ...(ngDevMode ? [{ debugName: "_computedClass" }] : []));
13
+ }, { ...(ngDevMode ? { debugName: "_computedClass" } : {}) });
14
14
  effect(() => {
15
15
  if (this.initialText()) {
16
16
  const el = this.el.nativeElement;
@@ -18,10 +18,10 @@ class UpAvatarDirective {
18
18
  }
19
19
  });
20
20
  }
21
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: UpAvatarDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
22
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.0", type: UpAvatarDirective, isStandalone: true, selector: "[upAvatar]", inputs: { initialText: { classPropertyName: "initialText", publicName: "initial", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, exportAs: ["upAvatar"], ngImport: i0 }); }
21
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: UpAvatarDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
22
+ static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.0.2", type: UpAvatarDirective, isStandalone: true, selector: "[upAvatar]", inputs: { initialText: { classPropertyName: "initialText", publicName: "initial", isSignal: true, isRequired: false, transformFunction: null }, inlineClass: { classPropertyName: "inlineClass", publicName: "class", isSignal: true, isRequired: false, transformFunction: null } }, host: { properties: { "class": "_computedClass()" } }, exportAs: ["upAvatar"], ngImport: i0 }); }
23
23
  }
24
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.0", ngImport: i0, type: UpAvatarDirective, decorators: [{
24
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.2", ngImport: i0, type: UpAvatarDirective, decorators: [{
25
25
  type: Directive,
26
26
  args: [{
27
27
  standalone: true,