@thescaffold/ngx-apps-capital 0.2.21 → 0.2.31

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 (59) hide show
  1. package/fesm2022/{thescaffold-ngx-apps-capital-card.module-Cl6xh18C.mjs → thescaffold-ngx-apps-capital-card.module-BPQG2WD9.mjs} +7 -9
  2. package/fesm2022/thescaffold-ngx-apps-capital-card.module-BPQG2WD9.mjs.map +1 -0
  3. package/fesm2022/{thescaffold-ngx-apps-capital-card.provider-BcIUxmO1.mjs → thescaffold-ngx-apps-capital-card.provider-CebuwlQl.mjs} +59 -58
  4. package/fesm2022/thescaffold-ngx-apps-capital-card.provider-CebuwlQl.mjs.map +1 -0
  5. package/fesm2022/thescaffold-ngx-apps-capital-dashboard.module-C08wnnHw.mjs +788 -0
  6. package/fesm2022/thescaffold-ngx-apps-capital-dashboard.module-C08wnnHw.mjs.map +1 -0
  7. package/fesm2022/{thescaffold-ngx-apps-capital-payment.module-DmQlflfD.mjs → thescaffold-ngx-apps-capital-payment.module-BuzjSS_y.mjs} +7 -8
  8. package/fesm2022/thescaffold-ngx-apps-capital-payment.module-BuzjSS_y.mjs.map +1 -0
  9. package/fesm2022/{thescaffold-ngx-apps-capital-payment.provider-B1jZij0H.mjs → thescaffold-ngx-apps-capital-payment.provider-DAlEfzgr.mjs} +56 -55
  10. package/fesm2022/thescaffold-ngx-apps-capital-payment.provider-DAlEfzgr.mjs.map +1 -0
  11. package/fesm2022/{thescaffold-ngx-apps-capital-voucher.module-DMt7Jj8o.mjs → thescaffold-ngx-apps-capital-voucher.module-D6hqVD4l.mjs} +157 -139
  12. package/fesm2022/thescaffold-ngx-apps-capital-voucher.module-D6hqVD4l.mjs.map +1 -0
  13. package/fesm2022/thescaffold-ngx-apps-capital.mjs +23 -23
  14. package/fesm2022/thescaffold-ngx-apps-capital.mjs.map +1 -1
  15. package/package.json +77 -27
  16. package/types/thescaffold-ngx-apps-capital.d.ts +37 -0
  17. package/esm2022/lib/app.config.mjs +0 -81
  18. package/esm2022/lib/app.module.mjs +0 -17
  19. package/esm2022/lib/index.mjs +0 -11
  20. package/esm2022/lib/pages/card/card.component.mjs +0 -161
  21. package/esm2022/lib/pages/card/card.module.mjs +0 -32
  22. package/esm2022/lib/pages/card/card.provider.mjs +0 -249
  23. package/esm2022/lib/pages/dashboard/dashboard.component.mjs +0 -703
  24. package/esm2022/lib/pages/dashboard/dashboard.module.mjs +0 -45
  25. package/esm2022/lib/pages/pages.component.mjs +0 -49
  26. package/esm2022/lib/pages/pages.module.mjs +0 -107
  27. package/esm2022/lib/pages/payment/payment.component.mjs +0 -119
  28. package/esm2022/lib/pages/payment/payment.module.mjs +0 -32
  29. package/esm2022/lib/pages/payment/payment.provider.mjs +0 -212
  30. package/esm2022/lib/pages/voucher/voucher.component.mjs +0 -167
  31. package/esm2022/lib/pages/voucher/voucher.module.mjs +0 -46
  32. package/esm2022/lib/pages/voucher/voucher.provider.mjs +0 -201
  33. package/esm2022/public-api.mjs +0 -5
  34. package/esm2022/thescaffold-ngx-apps-capital.mjs +0 -5
  35. package/fesm2022/thescaffold-ngx-apps-capital-card.module-Cl6xh18C.mjs.map +0 -1
  36. package/fesm2022/thescaffold-ngx-apps-capital-card.provider-BcIUxmO1.mjs.map +0 -1
  37. package/fesm2022/thescaffold-ngx-apps-capital-dashboard.module-lX-8-L9H.mjs +0 -744
  38. package/fesm2022/thescaffold-ngx-apps-capital-dashboard.module-lX-8-L9H.mjs.map +0 -1
  39. package/fesm2022/thescaffold-ngx-apps-capital-payment.module-DmQlflfD.mjs.map +0 -1
  40. package/fesm2022/thescaffold-ngx-apps-capital-payment.provider-B1jZij0H.mjs.map +0 -1
  41. package/fesm2022/thescaffold-ngx-apps-capital-voucher.module-DMt7Jj8o.mjs.map +0 -1
  42. package/index.d.ts +0 -5
  43. package/lib/app.config.d.ts +0 -13
  44. package/lib/app.module.d.ts +0 -8
  45. package/lib/index.d.ts +0 -10
  46. package/lib/pages/card/card.component.d.ts +0 -18
  47. package/lib/pages/card/card.module.d.ts +0 -10
  48. package/lib/pages/card/card.provider.d.ts +0 -136
  49. package/lib/pages/dashboard/dashboard.component.d.ts +0 -49
  50. package/lib/pages/dashboard/dashboard.module.d.ts +0 -10
  51. package/lib/pages/pages.component.d.ts +0 -8
  52. package/lib/pages/pages.module.d.ts +0 -11
  53. package/lib/pages/payment/payment.component.d.ts +0 -13
  54. package/lib/pages/payment/payment.module.d.ts +0 -10
  55. package/lib/pages/payment/payment.provider.d.ts +0 -134
  56. package/lib/pages/voucher/voucher.component.d.ts +0 -11
  57. package/lib/pages/voucher/voucher.module.d.ts +0 -10
  58. package/lib/pages/voucher/voucher.provider.d.ts +0 -125
  59. package/public-api.d.ts +0 -1
@@ -0,0 +1,788 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, TemplateRef, ViewChild, Component, NgModule } from '@angular/core';
3
+ import * as i1$1 from '@thescaffold/ngx-common';
4
+ import { PeriodService, DefaultPeriodType, PaymentModule as PaymentModule$1 } from '@thescaffold/ngx-common';
5
+ import * as i3 from '@thescaffold/ngx-core';
6
+ import { BaseDirective, ControlService, getEnv, navigateExternal, using, SharedModule, PipesModule } from '@thescaffold/ngx-core';
7
+ import * as i2 from '@thescaffold/ngx-ui';
8
+ import { FlyoutService, WizardService, WebgetsModule, ElementsModule, DashboardModule as DashboardModule$1 } from '@thescaffold/ngx-ui';
9
+ import { C as CardProvider } from './thescaffold-ngx-apps-capital-card.provider-CebuwlQl.mjs';
10
+ import { P as PaymentProvider } from './thescaffold-ngx-apps-capital-payment.provider-DAlEfzgr.mjs';
11
+ import { of, takeUntil, map, switchMap, forkJoin } from 'rxjs';
12
+ import * as i1 from '@angular/common';
13
+
14
+ class DashboardComponent extends BaseDirective {
15
+ constructor() {
16
+ super(...arguments);
17
+ this.flyoutService = inject(FlyoutService);
18
+ this.controlService = inject(ControlService);
19
+ this.wizardService = inject(WizardService);
20
+ this.periodService = inject(PeriodService);
21
+ this.paymentMeta$ = () => of({
22
+ type: this.actionType,
23
+ planTypeId: this.selectedPlanTypeId,
24
+ periodType: this.periodType,
25
+ });
26
+ this.verifyPaymentData = {
27
+ mode: 'verify',
28
+ appName: getEnv('APP_NAME'),
29
+ amount: 0.0,
30
+ hooks: {},
31
+ options: [],
32
+ };
33
+ this.wizardData = {
34
+ name: 'upgrade-plan',
35
+ showProgress: true,
36
+ showNav: false,
37
+ };
38
+ this.context = this.controlService.getContext();
39
+ this.planTypes$ = this.apiService
40
+ .on('apps/capital/plan-type')
41
+ .getMany({
42
+ page: 1,
43
+ perPage: 12,
44
+ clientId: this.context?.clientId,
45
+ currency: getEnv('X_PREFERENCE_CURRENCY'),
46
+ })
47
+ .pipe(takeUntil(this.$), map(({ data }) => data));
48
+ this.currentPlan = null;
49
+ this.capital$ = this.apiService.post('apps/capital/wallet/init').pipe(takeUntil(this.$), switchMap((wallet) => forkJoin([
50
+ this.apiService.get('apps/capital/user-plan'),
51
+ of(wallet),
52
+ this.apiService.get('apps/capital/debt'),
53
+ this.apiService.get('apps/capital/cost', { type: 'current' }),
54
+ ])), map(([plan, wallet, pending, estimate]) => {
55
+ this.currentPlan = plan?.data;
56
+ return {
57
+ plan: plan?.data,
58
+ wallet: wallet?.data,
59
+ pending: pending?.data,
60
+ estimate: estimate?.data,
61
+ };
62
+ }));
63
+ this.periodType = DefaultPeriodType;
64
+ this.periodData$ = this.periodService.list().pipe(map((list) => ({
65
+ default: list.find((item) => item.value == DefaultPeriodType),
66
+ list,
67
+ size: 'btn-lg',
68
+ showSearch: false,
69
+ })));
70
+ }
71
+ get paymentData() {
72
+ const amount = (this.actionType == 'apps.capital.dashboard.upgrade-plan'
73
+ ? this.upgradePlanAmount
74
+ : this.actionType == 'apps.capital.dashboard.pay-debt'
75
+ ? this.payNowAmount
76
+ : 0);
77
+ return {
78
+ mode: 'pay',
79
+ appName: getEnv('APP_NAME'),
80
+ amount: amount == 0 ? -1 : amount,
81
+ hooks: {
82
+ meta: () => this.paymentMeta$(),
83
+ },
84
+ options: ['card', 'provider', 'wallet'],
85
+ redirect: (provider, amount, reference, currency) => {
86
+ navigateExternal(`${getEnv('BASE_URL')}${this.router.url}?type=${provider}&reference=${reference}`);
87
+ },
88
+ };
89
+ }
90
+ onPeriodSelect({ value }) {
91
+ this.periodType = value;
92
+ }
93
+ upgradePlan() {
94
+ this.actionType = 'apps.capital.dashboard.upgrade-plan';
95
+ this.flyoutService.open(this.upgradePlanFlyout);
96
+ }
97
+ payNow(payNowAmount) {
98
+ this.actionType = 'apps.capital.dashboard.pay-debt';
99
+ this.payNowAmount = payNowAmount;
100
+ this.flyoutService.open(this.payNowFlyout);
101
+ }
102
+ selectPlanType(planType) {
103
+ this.selectedPlanTypeId = planType.id;
104
+ this.apiService
105
+ .post('apps/capital/user-plan/compute-upgrade', {
106
+ planTypeId: planType.id,
107
+ periodType: this.periodType,
108
+ })
109
+ .pipe(takeUntil(this.$))
110
+ .subscribe(using(({ data }) => {
111
+ this.upgradePlanAmount = data.diff;
112
+ this.wizardService.goto(this.wizardData.name, 'make-payment');
113
+ }));
114
+ }
115
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: DashboardComponent, deps: null, target: i0.ɵɵFactoryTarget.Component }); }
116
+ static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.4", type: DashboardComponent, isStandalone: false, selector: "app-dashboard", viewQueries: [{ propertyName: "beforeMetricsTemplate", first: true, predicate: ["beforeMetricsTemplate"], descendants: true, read: TemplateRef, static: true }, { propertyName: "upgradePlanFlyout", first: true, predicate: ["upgradePlanFlyout"], descendants: true, read: TemplateRef, static: true }, { propertyName: "payNowFlyout", first: true, predicate: ["payNowFlyout"], descendants: true, read: TemplateRef, static: true }], usesInheritance: true, ngImport: i0, template: `
117
+ <ng-template #beforeMetricsTemplate>
118
+ <!-- verify payment -->
119
+ <x-common-payment [data]="verifyPaymentData"></x-common-payment>
120
+
121
+ @if (capital$ | async; as capital) {
122
+ <div class="">
123
+ <div class="row gx-5 d-flex flex-wrap">
124
+ <div class="col d-flex flex-column">
125
+ <div class="card card-body">
126
+ <div class="d-flex justify-content-between align-items-center">
127
+ <span class="fs-6">
128
+ {{
129
+ 'apps.capital.component.dashboard.message.plan' | xTranslate
130
+ }}
131
+ </span>
132
+ @if (capital.plan?.type?.name) {
133
+ <span class="fs-3"
134
+ >{{ capital.plan?.type?.name }}
135
+ </span>
136
+ }
137
+ <!-- <span *ngIf="capital.plan?.type?.name" class="fs-3"
138
+ >{{
139
+ capital.plan.type[capital.plan.periodType]
140
+ | xMajor | number: '1.2-2'
141
+ }}<span class="fs-6">{{ capital.plan.type.currency }}</span>
142
+ </span> -->
143
+ @if (!capital.plan?.type?.name) {
144
+ <span class="fs-3">
145
+ ...
146
+ </span>
147
+ }
148
+ </div>
149
+ @if (
150
+ capital.plan?.type?.name &&
151
+ capital.plan?.type?.name?.toLowerCase() != 'pro'
152
+ ) {
153
+ <div
154
+ class="d-flex justify-content-end align-items-center"
155
+ >
156
+ <button
157
+ class="btn btn-outline-warning btn-sm small-text"
158
+ (click)="upgradePlan()"
159
+ >
160
+ {{
161
+ 'apps.capital.component.dashboard.button.upgrade-plan'
162
+ | xTranslate
163
+ }}
164
+ </button>
165
+ </div>
166
+ }
167
+ @if (!capital.plan?.type?.name) {
168
+ <div
169
+ class="d-flex justify-content-end align-items-center"
170
+ >
171
+ <button
172
+ class="btn btn-outline-warning btn-sm small-text"
173
+ (click)="upgradePlan()"
174
+ >
175
+ {{
176
+ 'apps.capital.component.dashboard.button.select-plan'
177
+ | xTranslate
178
+ }}
179
+ </button>
180
+ </div>
181
+ }
182
+ </div>
183
+ </div>
184
+ <!-- <div class="col d-flex flex-column">
185
+ <div class="card card-body">
186
+ <div class="d-flex justify-content-between align-items-center">
187
+ <span class="fs-6">{{
188
+ 'apps.capital.component.dashboard.message.balance'
189
+ | xTranslate
190
+ }}</span>
191
+ <span class="fs-3"
192
+ >{{ capital.wallet.availableBalance | xMajor | number: '1.2-2'
193
+ }}<span class="fs-6">{{
194
+ capital.wallet.currency
195
+ }}</span></span
196
+ >
197
+ </div>
198
+ </div>
199
+ </div> -->
200
+ <div class="col d-flex flex-column">
201
+ <div class="card card-body">
202
+ <div class="d-flex justify-content-between align-items-center">
203
+ <span class="fs-6">
204
+ {{
205
+ 'apps.capital.component.dashboard.message.pending'
206
+ | xTranslate
207
+ }}
208
+ </span>
209
+ <span
210
+ class="fs-3"
211
+ [ngClass]="{ 'text-warning': capital.pending.debt }"
212
+ >{{ capital.pending.debt | xMajor | number: '1.2-2'
213
+ }}<span class="fs-6">{{ capital.wallet.currency }}</span>
214
+ </span>
215
+ </div>
216
+ @if (capital.pending.debt > 0) {
217
+ <div
218
+ class="d-flex justify-content-end align-items-center"
219
+ >
220
+ <button
221
+ class="btn btn-outline-warning btn-sm small-text"
222
+ (click)="payNow(capital.pending.debt)"
223
+ >
224
+ {{
225
+ 'apps.capital.component.dashboard.button.pay-now'
226
+ | xTranslate
227
+ }}
228
+ </button>
229
+ </div>
230
+ }
231
+ </div>
232
+ </div>
233
+ <div class="col d-flex flex-column">
234
+ <div class="card card-body">
235
+ <div class="d-flex justify-content-between align-items-center">
236
+ <span class="fs-6">{{
237
+ 'apps.capital.component.dashboard.message.cost' | xTranslate
238
+ }}</span>
239
+ <span class="fs-3"
240
+ >{{ capital.estimate.cost | xMajor | number: '1.2-2'
241
+ }}<span class="fs-6">{{
242
+ capital.wallet.currency
243
+ }}</span></span
244
+ >
245
+ </div>
246
+ </div>
247
+ </div>
248
+ </div>
249
+ </div>
250
+ } @else {
251
+ <x-element-loader></x-element-loader>
252
+ }
253
+ </ng-template>
254
+
255
+ <!-- upgrade plan flyout -->
256
+ <ng-template #upgradePlanFlyout>
257
+ <x-webget-flyout [data]="{ title: 'Upgrade Plan' }">
258
+ <x-webget-wizard [data]="wizardData">
259
+ <ng-template [xWizard]="'select-plan'">
260
+ @if (periodData$ | async; as periodData) {
261
+ @if (
262
+ planTypes$ && planTypes$ | async; as planTypes) {
263
+ <div
264
+ class="d-flex flex-column"
265
+ >
266
+ <div class="d-flex flex-column my-3 align-items-center">
267
+ <p class="text-secondary text-center">
268
+ {{
269
+ 'apps.capital.component.dashboard.message.select-plan'
270
+ | xTranslate
271
+ }}
272
+ </p>
273
+ </div>
274
+ <div class="d-flex justify-content-end align-items-center my-3">
275
+ <x-picker
276
+ [data]="periodData"
277
+ (select)="onPeriodSelect($event)"
278
+ ></x-picker>
279
+ </div>
280
+ @if (planTypes.length) {
281
+ <div
282
+ class="accordion"
283
+ id="plan-accordion"
284
+ >
285
+ @for (planType of planTypes; track planType; let i = $index) {
286
+ <div
287
+ class="accordion-item w-100"
288
+ >
289
+ @if (planType.id != currentPlan?.type?.id) {
290
+ <div
291
+ class="accordion-header"
292
+ >
293
+ <button
294
+ class="accordion-button d-flex justify-content-between align-items-center"
295
+ [ngClass]="{ collapsed: planType.type !== 'popular' }"
296
+ type="button"
297
+ data-bs-toggle="collapse"
298
+ [attr.data-bs-target]="'#collapse' + i"
299
+ >
300
+ <div class="col-8">
301
+ <div class="h3">{{ planType.name | titlecase }}</div>
302
+ @if (planType.desc) {
303
+ <div
304
+ class="h6 text-body-secondary"
305
+ >
306
+ {{ planType.desc }}
307
+ </div>
308
+ }
309
+ </div>
310
+ <div class="col-3">
311
+ <div class="fw-bolder fst-italic h3">
312
+ {{ planType.currency ?? '...' }}
313
+ {{
314
+ (planType[periodType]
315
+ | xMajor
316
+ | number: '1.2-2') ?? '...'
317
+ }}
318
+ </div>
319
+ </div>
320
+ </button>
321
+ </div>
322
+ }
323
+ <div
324
+ [attr.id]="'collapse' + i"
325
+ class="accordion-collapse collapse"
326
+ [ngClass]="{ show: planType.type == 'popular' }"
327
+ data-bs-parent="#plan-accordion"
328
+ >
329
+ <div class="accordion-body">
330
+ <div
331
+ class="d-flex justify-content-start align-items-center"
332
+ >
333
+ @if (planType.detail) {
334
+ <p
335
+ class="text-body-secondary"
336
+ >
337
+ {{ planType.detail }}
338
+ </p>
339
+ }
340
+ </div>
341
+ @if (planType?.meta?.features?.length) {
342
+ <ul
343
+ class="list-group list-group-flush"
344
+ >
345
+ @for (feature of planType?.meta?.features; track feature) {
346
+ <li
347
+ class="list-group-item"
348
+ >
349
+ {{ feature }}
350
+ </li>
351
+ }
352
+ </ul>
353
+ }
354
+ <div
355
+ class="d-flex justify-content-end align-items-center my-3"
356
+ >
357
+ <button
358
+ class="btn btn-primary"
359
+ (click)="selectPlanType(planType)"
360
+ >
361
+ Choose {{ planType.name }}
362
+ <i class="fa-solid fa-arrow-right-long"></i>
363
+ </button>
364
+ </div>
365
+ </div>
366
+ </div>
367
+ </div>
368
+ }
369
+ </div>
370
+ } @else {
371
+ <x-element-blank></x-element-blank>
372
+ }
373
+ <div
374
+ class="d-flex justify-content-center align-items-center my-3"
375
+ >
376
+ <p class="text-center mb-1">
377
+ {{
378
+ 'apps.capital.component.dashboard.message.terms'
379
+ | xTranslate
380
+ }}
381
+ </p>
382
+ </div>
383
+ </div>
384
+ } @else {
385
+ <x-element-loader></x-element-loader>
386
+ }
387
+ } @else {
388
+ <x-element-loader></x-element-loader>
389
+ }
390
+ </ng-template>
391
+ <ng-template [xWizard]="'make-payment'">
392
+ @if (false) {
393
+ } @else {
394
+ <x-common-payment [data]="paymentData"></x-common-payment>
395
+ }
396
+ </ng-template>
397
+ </x-webget-wizard>
398
+ </x-webget-flyout>
399
+ </ng-template>
400
+
401
+ <!-- pay now flyout -->
402
+ <ng-template #payNowFlyout>
403
+ <x-webget-flyout [data]="{ title: 'Pay Now' }">
404
+ @if (false) {
405
+ } @else {
406
+ <x-common-payment [data]="paymentData"></x-common-payment>
407
+ }
408
+ </x-webget-flyout>
409
+ </ng-template>
410
+
411
+ <!-- upgrade payment flyout -->
412
+ <ng-template #makePaymentTemplate>
413
+ <x-common-payment [data]="paymentData"></x-common-payment>
414
+ </ng-template>
415
+
416
+ <!-- misc -->
417
+ <ng-template #loader>
418
+ <x-element-loader></x-element-loader>
419
+ </ng-template>
420
+
421
+ <ng-template #empty>
422
+ <x-element-blank></x-element-blank>
423
+ </ng-template>
424
+ `, isInline: true, styles: [".small-text{font-size:.7rem!important}\n"], dependencies: [{ kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i2.FlyoutComponent, selector: "x-webget-flyout", inputs: ["data"] }, { kind: "component", type: i2.WizardComponent, selector: "x-webget-wizard", inputs: ["data"] }, { kind: "directive", type: i2.WizardDirective, selector: "ng-template[xWizard]", inputs: ["xWizard"] }, { kind: "component", type: i2.BlankComponent, selector: "x-element-blank", inputs: ["image", "icon", "type"] }, { kind: "component", type: i2.LoaderComponent, selector: "x-element-loader", inputs: ["data"] }, { kind: "component", type: i2.PickerComponent, selector: "x-picker", inputs: ["data"], outputs: ["select"] }, { kind: "component", type: i1$1.PaymentComponent, selector: "x-common-payment", inputs: ["data"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }, { kind: "pipe", type: i1.DecimalPipe, name: "number" }, { kind: "pipe", type: i1.TitleCasePipe, name: "titlecase" }, { kind: "pipe", type: i3.TranslatePipe, name: "xTranslate" }, { kind: "pipe", type: i3.MajorPipe, name: "xMajor" }] }); }
425
+ }
426
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: DashboardComponent, decorators: [{
427
+ type: Component,
428
+ args: [{ standalone: false, selector: 'app-dashboard', template: `
429
+ <ng-template #beforeMetricsTemplate>
430
+ <!-- verify payment -->
431
+ <x-common-payment [data]="verifyPaymentData"></x-common-payment>
432
+
433
+ @if (capital$ | async; as capital) {
434
+ <div class="">
435
+ <div class="row gx-5 d-flex flex-wrap">
436
+ <div class="col d-flex flex-column">
437
+ <div class="card card-body">
438
+ <div class="d-flex justify-content-between align-items-center">
439
+ <span class="fs-6">
440
+ {{
441
+ 'apps.capital.component.dashboard.message.plan' | xTranslate
442
+ }}
443
+ </span>
444
+ @if (capital.plan?.type?.name) {
445
+ <span class="fs-3"
446
+ >{{ capital.plan?.type?.name }}
447
+ </span>
448
+ }
449
+ <!-- <span *ngIf="capital.plan?.type?.name" class="fs-3"
450
+ >{{
451
+ capital.plan.type[capital.plan.periodType]
452
+ | xMajor | number: '1.2-2'
453
+ }}<span class="fs-6">{{ capital.plan.type.currency }}</span>
454
+ </span> -->
455
+ @if (!capital.plan?.type?.name) {
456
+ <span class="fs-3">
457
+ ...
458
+ </span>
459
+ }
460
+ </div>
461
+ @if (
462
+ capital.plan?.type?.name &&
463
+ capital.plan?.type?.name?.toLowerCase() != 'pro'
464
+ ) {
465
+ <div
466
+ class="d-flex justify-content-end align-items-center"
467
+ >
468
+ <button
469
+ class="btn btn-outline-warning btn-sm small-text"
470
+ (click)="upgradePlan()"
471
+ >
472
+ {{
473
+ 'apps.capital.component.dashboard.button.upgrade-plan'
474
+ | xTranslate
475
+ }}
476
+ </button>
477
+ </div>
478
+ }
479
+ @if (!capital.plan?.type?.name) {
480
+ <div
481
+ class="d-flex justify-content-end align-items-center"
482
+ >
483
+ <button
484
+ class="btn btn-outline-warning btn-sm small-text"
485
+ (click)="upgradePlan()"
486
+ >
487
+ {{
488
+ 'apps.capital.component.dashboard.button.select-plan'
489
+ | xTranslate
490
+ }}
491
+ </button>
492
+ </div>
493
+ }
494
+ </div>
495
+ </div>
496
+ <!-- <div class="col d-flex flex-column">
497
+ <div class="card card-body">
498
+ <div class="d-flex justify-content-between align-items-center">
499
+ <span class="fs-6">{{
500
+ 'apps.capital.component.dashboard.message.balance'
501
+ | xTranslate
502
+ }}</span>
503
+ <span class="fs-3"
504
+ >{{ capital.wallet.availableBalance | xMajor | number: '1.2-2'
505
+ }}<span class="fs-6">{{
506
+ capital.wallet.currency
507
+ }}</span></span
508
+ >
509
+ </div>
510
+ </div>
511
+ </div> -->
512
+ <div class="col d-flex flex-column">
513
+ <div class="card card-body">
514
+ <div class="d-flex justify-content-between align-items-center">
515
+ <span class="fs-6">
516
+ {{
517
+ 'apps.capital.component.dashboard.message.pending'
518
+ | xTranslate
519
+ }}
520
+ </span>
521
+ <span
522
+ class="fs-3"
523
+ [ngClass]="{ 'text-warning': capital.pending.debt }"
524
+ >{{ capital.pending.debt | xMajor | number: '1.2-2'
525
+ }}<span class="fs-6">{{ capital.wallet.currency }}</span>
526
+ </span>
527
+ </div>
528
+ @if (capital.pending.debt > 0) {
529
+ <div
530
+ class="d-flex justify-content-end align-items-center"
531
+ >
532
+ <button
533
+ class="btn btn-outline-warning btn-sm small-text"
534
+ (click)="payNow(capital.pending.debt)"
535
+ >
536
+ {{
537
+ 'apps.capital.component.dashboard.button.pay-now'
538
+ | xTranslate
539
+ }}
540
+ </button>
541
+ </div>
542
+ }
543
+ </div>
544
+ </div>
545
+ <div class="col d-flex flex-column">
546
+ <div class="card card-body">
547
+ <div class="d-flex justify-content-between align-items-center">
548
+ <span class="fs-6">{{
549
+ 'apps.capital.component.dashboard.message.cost' | xTranslate
550
+ }}</span>
551
+ <span class="fs-3"
552
+ >{{ capital.estimate.cost | xMajor | number: '1.2-2'
553
+ }}<span class="fs-6">{{
554
+ capital.wallet.currency
555
+ }}</span></span
556
+ >
557
+ </div>
558
+ </div>
559
+ </div>
560
+ </div>
561
+ </div>
562
+ } @else {
563
+ <x-element-loader></x-element-loader>
564
+ }
565
+ </ng-template>
566
+
567
+ <!-- upgrade plan flyout -->
568
+ <ng-template #upgradePlanFlyout>
569
+ <x-webget-flyout [data]="{ title: 'Upgrade Plan' }">
570
+ <x-webget-wizard [data]="wizardData">
571
+ <ng-template [xWizard]="'select-plan'">
572
+ @if (periodData$ | async; as periodData) {
573
+ @if (
574
+ planTypes$ && planTypes$ | async; as planTypes) {
575
+ <div
576
+ class="d-flex flex-column"
577
+ >
578
+ <div class="d-flex flex-column my-3 align-items-center">
579
+ <p class="text-secondary text-center">
580
+ {{
581
+ 'apps.capital.component.dashboard.message.select-plan'
582
+ | xTranslate
583
+ }}
584
+ </p>
585
+ </div>
586
+ <div class="d-flex justify-content-end align-items-center my-3">
587
+ <x-picker
588
+ [data]="periodData"
589
+ (select)="onPeriodSelect($event)"
590
+ ></x-picker>
591
+ </div>
592
+ @if (planTypes.length) {
593
+ <div
594
+ class="accordion"
595
+ id="plan-accordion"
596
+ >
597
+ @for (planType of planTypes; track planType; let i = $index) {
598
+ <div
599
+ class="accordion-item w-100"
600
+ >
601
+ @if (planType.id != currentPlan?.type?.id) {
602
+ <div
603
+ class="accordion-header"
604
+ >
605
+ <button
606
+ class="accordion-button d-flex justify-content-between align-items-center"
607
+ [ngClass]="{ collapsed: planType.type !== 'popular' }"
608
+ type="button"
609
+ data-bs-toggle="collapse"
610
+ [attr.data-bs-target]="'#collapse' + i"
611
+ >
612
+ <div class="col-8">
613
+ <div class="h3">{{ planType.name | titlecase }}</div>
614
+ @if (planType.desc) {
615
+ <div
616
+ class="h6 text-body-secondary"
617
+ >
618
+ {{ planType.desc }}
619
+ </div>
620
+ }
621
+ </div>
622
+ <div class="col-3">
623
+ <div class="fw-bolder fst-italic h3">
624
+ {{ planType.currency ?? '...' }}
625
+ {{
626
+ (planType[periodType]
627
+ | xMajor
628
+ | number: '1.2-2') ?? '...'
629
+ }}
630
+ </div>
631
+ </div>
632
+ </button>
633
+ </div>
634
+ }
635
+ <div
636
+ [attr.id]="'collapse' + i"
637
+ class="accordion-collapse collapse"
638
+ [ngClass]="{ show: planType.type == 'popular' }"
639
+ data-bs-parent="#plan-accordion"
640
+ >
641
+ <div class="accordion-body">
642
+ <div
643
+ class="d-flex justify-content-start align-items-center"
644
+ >
645
+ @if (planType.detail) {
646
+ <p
647
+ class="text-body-secondary"
648
+ >
649
+ {{ planType.detail }}
650
+ </p>
651
+ }
652
+ </div>
653
+ @if (planType?.meta?.features?.length) {
654
+ <ul
655
+ class="list-group list-group-flush"
656
+ >
657
+ @for (feature of planType?.meta?.features; track feature) {
658
+ <li
659
+ class="list-group-item"
660
+ >
661
+ {{ feature }}
662
+ </li>
663
+ }
664
+ </ul>
665
+ }
666
+ <div
667
+ class="d-flex justify-content-end align-items-center my-3"
668
+ >
669
+ <button
670
+ class="btn btn-primary"
671
+ (click)="selectPlanType(planType)"
672
+ >
673
+ Choose {{ planType.name }}
674
+ <i class="fa-solid fa-arrow-right-long"></i>
675
+ </button>
676
+ </div>
677
+ </div>
678
+ </div>
679
+ </div>
680
+ }
681
+ </div>
682
+ } @else {
683
+ <x-element-blank></x-element-blank>
684
+ }
685
+ <div
686
+ class="d-flex justify-content-center align-items-center my-3"
687
+ >
688
+ <p class="text-center mb-1">
689
+ {{
690
+ 'apps.capital.component.dashboard.message.terms'
691
+ | xTranslate
692
+ }}
693
+ </p>
694
+ </div>
695
+ </div>
696
+ } @else {
697
+ <x-element-loader></x-element-loader>
698
+ }
699
+ } @else {
700
+ <x-element-loader></x-element-loader>
701
+ }
702
+ </ng-template>
703
+ <ng-template [xWizard]="'make-payment'">
704
+ @if (false) {
705
+ } @else {
706
+ <x-common-payment [data]="paymentData"></x-common-payment>
707
+ }
708
+ </ng-template>
709
+ </x-webget-wizard>
710
+ </x-webget-flyout>
711
+ </ng-template>
712
+
713
+ <!-- pay now flyout -->
714
+ <ng-template #payNowFlyout>
715
+ <x-webget-flyout [data]="{ title: 'Pay Now' }">
716
+ @if (false) {
717
+ } @else {
718
+ <x-common-payment [data]="paymentData"></x-common-payment>
719
+ }
720
+ </x-webget-flyout>
721
+ </ng-template>
722
+
723
+ <!-- upgrade payment flyout -->
724
+ <ng-template #makePaymentTemplate>
725
+ <x-common-payment [data]="paymentData"></x-common-payment>
726
+ </ng-template>
727
+
728
+ <!-- misc -->
729
+ <ng-template #loader>
730
+ <x-element-loader></x-element-loader>
731
+ </ng-template>
732
+
733
+ <ng-template #empty>
734
+ <x-element-blank></x-element-blank>
735
+ </ng-template>
736
+ `, styles: [".small-text{font-size:.7rem!important}\n"] }]
737
+ }], propDecorators: { beforeMetricsTemplate: [{
738
+ type: ViewChild,
739
+ args: ['beforeMetricsTemplate', {
740
+ read: TemplateRef,
741
+ static: true,
742
+ }]
743
+ }], upgradePlanFlyout: [{
744
+ type: ViewChild,
745
+ args: ['upgradePlanFlyout', { read: TemplateRef, static: true }]
746
+ }], payNowFlyout: [{
747
+ type: ViewChild,
748
+ args: ['payNowFlyout', { read: TemplateRef, static: true }]
749
+ }] } });
750
+
751
+ class DashboardModule {
752
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: DashboardModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
753
+ static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "21.1.4", ngImport: i0, type: DashboardModule, declarations: [DashboardComponent], imports: [SharedModule, i2.DashboardModule, WebgetsModule,
754
+ ElementsModule,
755
+ PipesModule,
756
+ PaymentModule$1] }); }
757
+ static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: DashboardModule, imports: [SharedModule,
758
+ DashboardModule$1.register({
759
+ metrics: [],
760
+ providers: [CardProvider, PaymentProvider],
761
+ templateSource: DashboardComponent,
762
+ }),
763
+ WebgetsModule,
764
+ ElementsModule,
765
+ PipesModule,
766
+ PaymentModule$1] }); }
767
+ }
768
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.4", ngImport: i0, type: DashboardModule, decorators: [{
769
+ type: NgModule,
770
+ args: [{
771
+ declarations: [DashboardComponent],
772
+ imports: [
773
+ SharedModule,
774
+ DashboardModule$1.register({
775
+ metrics: [],
776
+ providers: [CardProvider, PaymentProvider],
777
+ templateSource: DashboardComponent,
778
+ }),
779
+ WebgetsModule,
780
+ ElementsModule,
781
+ PipesModule,
782
+ PaymentModule$1,
783
+ ],
784
+ }]
785
+ }] });
786
+
787
+ export { DashboardModule };
788
+ //# sourceMappingURL=thescaffold-ngx-apps-capital-dashboard.module-C08wnnHw.mjs.map