@miden-npm/angular 0.0.17 → 0.0.19

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.
@@ -3,8 +3,12 @@ import { Component, InjectionToken, inject, makeEnvironmentProviders, Input, Cha
3
3
  import * as i1$1 from '@angular/common/http';
4
4
  import { provideHttpClient, withInterceptors } from '@angular/common/http';
5
5
  import * as i1 from '@angular/common';
6
- import { CommonModule } from '@angular/common';
7
- import { NG_VALUE_ACCESSOR } from '@angular/forms';
6
+ import { CommonModule, DatePipe } from '@angular/common';
7
+ import * as i3 from '@angular/forms';
8
+ import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
9
+ import * as i2 from 'angular-imask';
10
+ import { IMaskModule } from 'angular-imask';
11
+ import * as CryptoJS from 'crypto-js';
8
12
 
9
13
  class MidenPGAngular {
10
14
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: MidenPGAngular, deps: [], target: i0.ɵɵFactoryTarget.Component });
@@ -389,6 +393,14 @@ const checkObjectTruthy = (obj) => {
389
393
  return false;
390
394
  return Object.values(obj).every(Boolean);
391
395
  };
396
+ const getQueryParams = (url) => {
397
+ const params = {};
398
+ const searchParams = new URL(url).searchParams;
399
+ searchParams.forEach((value, key) => {
400
+ params[key] = value;
401
+ });
402
+ return params;
403
+ };
392
404
 
393
405
  const currencySign = (currency) => {
394
406
  if (currency === 'USD')
@@ -422,6 +434,150 @@ const truncateString = (str, num) => {
422
434
  return str.slice(0, num) + '...';
423
435
  };
424
436
 
437
+ function getValidationErrorMessage(control, fieldLabel = 'This field') {
438
+ if (!control || !control.errors || !control.touched)
439
+ return null;
440
+ if (control.errors['required']) {
441
+ return `${fieldLabel} is required`;
442
+ }
443
+ if (control.errors['minlength']) {
444
+ const requiredLength = control.errors['minlength'].requiredLength;
445
+ return `${fieldLabel} must be at least ${requiredLength} characters`;
446
+ }
447
+ if (control.errors['maxlength']) {
448
+ const requiredLength = control.errors['maxlength'].requiredLength;
449
+ return `${fieldLabel} must be at most ${requiredLength} characters`;
450
+ }
451
+ if (control.errors['pattern']) {
452
+ return `${fieldLabel} format is invalid`;
453
+ }
454
+ return `${fieldLabel} is invalid`;
455
+ }
456
+
457
+ const urlValidator = () => {
458
+ return (control) => {
459
+ if (!control.value)
460
+ return null;
461
+ // More permissive URL pattern that accepts localhost and various URL formats
462
+ const urlPattern = /^(https?:\/\/)?([\w\-]+(\.[\w\-]+)*|localhost)(:\d+)?([\w\-\._~:/?#[\]@!$&'()*+,;=.]+)?$/i;
463
+ return urlPattern.test(control.value) ? null : { invalidUrl: true };
464
+ };
465
+ };
466
+
467
+ var CardSchemes;
468
+ (function (CardSchemes) {
469
+ CardSchemes[CardSchemes["Visa"] = 1] = "Visa";
470
+ CardSchemes[CardSchemes["MasterCard"] = 2] = "MasterCard";
471
+ CardSchemes[CardSchemes["Verve"] = 3] = "Verve";
472
+ CardSchemes[CardSchemes["MastercardAndVisa"] = 4] = "MastercardAndVisa";
473
+ CardSchemes[CardSchemes["AmericanExpress"] = 5] = "AmericanExpress";
474
+ CardSchemes[CardSchemes["Discover"] = 6] = "Discover";
475
+ CardSchemes[CardSchemes["JCB"] = 7] = "JCB";
476
+ CardSchemes[CardSchemes["DinersClub"] = 8] = "DinersClub";
477
+ CardSchemes[CardSchemes["Maestro"] = 9] = "Maestro";
478
+ CardSchemes[CardSchemes["UnionPay"] = 10] = "UnionPay";
479
+ CardSchemes[CardSchemes["UnionPay3DS"] = 11] = "UnionPay3DS";
480
+ CardSchemes[CardSchemes["UnionPayNon3DS"] = 12] = "UnionPayNon3DS";
481
+ CardSchemes[CardSchemes["UATP"] = 13] = "UATP";
482
+ CardSchemes[CardSchemes["PayPak"] = 14] = "PayPak";
483
+ CardSchemes[CardSchemes["Jaywan"] = 15] = "Jaywan";
484
+ CardSchemes[CardSchemes["Mada"] = 16] = "Mada";
485
+ CardSchemes[CardSchemes["MadaVisa"] = 17] = "MadaVisa";
486
+ CardSchemes[CardSchemes["MadaMastercard"] = 18] = "MadaMastercard";
487
+ CardSchemes[CardSchemes["Unknown"] = 19] = "Unknown";
488
+ })(CardSchemes || (CardSchemes = {}));
489
+ // ---------- Generic scheme regexes ----------
490
+ const VISA_RE = /^4\d{12}(\d{3}){0,2}$/; // 13, 16, 19 digits
491
+ const MC_RE = /^(?:5[1-5]\d{14}|2(?:2(?:2[1-9]|[3-9]\d)|[3-6]\d{2}|7(?:[01]\d|20))\d{12})(?:\d{0,3})?$/; // 16-19
492
+ const AMEX_RE = /^(34|37)\d{13}$/; // 15
493
+ const DISCOVER_RE = /^(?:6011|65|64[4-9]|622(?:12[6-9]|1[3-9]\d|[2-8]\d{2}|9(?:0\d|1\d|2[0-5])))\d{12,15}$/; // 16-19
494
+ const JCB_RE = /^(?:35(?:2[8-9]|[3-8]\d))\d{12,15}$/; // 16-19
495
+ const DINERS_RE = /^(?:3(?:0[0-5]\d|095|6\d|[89]\d))\d{11,13}$/; // 14-16
496
+ const MAESTRO_RE = /^(?:50|5[6-9]|6[0-9])\d{10,17}$/; // 12-19
497
+ const UNIONPAY_RE = /^62\d{14,17}$/; // 16-19
498
+ const UATP_RE = /^1\d{14}$/; // 15
499
+ // ---------- Known local/test BINs ----------
500
+ const VERVE_BIN6_RANGES = [
501
+ [506099, 506198],
502
+ [650002, 650027],
503
+ ];
504
+ const VERVE_BIN6_SINGLES = new Set([507865, 507866]);
505
+ const PAYPAK_BIN6 = new Set([220545, 220543]);
506
+ const JAYWAN_BIN7 = new Set([6690109]);
507
+ const MADA_ONLY_BIN6 = new Set([968209, 873646]);
508
+ const MADA_VISA_BIN6 = new Set([422818, 486094]);
509
+ const MADA_MC_BIN6 = new Set([529741, 543357]);
510
+ const UNIONPAY_3DS_BIN6 = new Set([620108]);
511
+ const UNIONPAY_NON3DS_BIN6 = new Set([621423]);
512
+ function cardType(cardNumber) {
513
+ const scheme = detect(cardNumber);
514
+ return CardSchemes[scheme]; // numeric enum reverse mapping -> name
515
+ }
516
+ function detect(cardNumber) {
517
+ if (!cardNumber || !cardNumber.trim())
518
+ return CardSchemes.Unknown;
519
+ // Normalize: digits only
520
+ const digits = cardNumber.replace(/\D/g, '');
521
+ if (digits.length < 12 || digits.length > 19)
522
+ return CardSchemes.Unknown;
523
+ // ---------- 1) Exact local/test BIN routing FIRST ----------
524
+ if (digits.length >= 6) {
525
+ const bin6 = parseInt(digits.slice(0, 6), 10);
526
+ // mada-only
527
+ if (MADA_ONLY_BIN6.has(bin6) && digits.length >= 16 && digits.length <= 19)
528
+ return CardSchemes.Mada;
529
+ // mada Visa
530
+ if (MADA_VISA_BIN6.has(bin6) && VISA_RE.test(digits))
531
+ return CardSchemes.MadaVisa;
532
+ // mada Mastercard
533
+ if (MADA_MC_BIN6.has(bin6) && MC_RE.test(digits))
534
+ return CardSchemes.MadaMastercard;
535
+ // PayPak
536
+ if (PAYPAK_BIN6.has(bin6) && digits.length === 16)
537
+ return CardSchemes.PayPak;
538
+ // UnionPay test BINs with 3DS status
539
+ if (UNIONPAY_3DS_BIN6.has(bin6) && UNIONPAY_RE.test(digits))
540
+ return CardSchemes.UnionPay3DS;
541
+ if (UNIONPAY_NON3DS_BIN6.has(bin6) && UNIONPAY_RE.test(digits))
542
+ return CardSchemes.UnionPayNon3DS;
543
+ // Verve
544
+ if (isVerve(bin6, digits.length))
545
+ return CardSchemes.Verve;
546
+ }
547
+ if (digits.length >= 7) {
548
+ const bin7 = parseInt(digits.slice(0, 7), 10);
549
+ // Jaywan
550
+ if (JAYWAN_BIN7.has(bin7) && digits.length === 16)
551
+ return CardSchemes.Jaywan;
552
+ }
553
+ // ---------- 2) Generic schemes ----------
554
+ if (UATP_RE.test(digits))
555
+ return CardSchemes.UATP;
556
+ if (AMEX_RE.test(digits))
557
+ return CardSchemes.AmericanExpress;
558
+ if (DISCOVER_RE.test(digits))
559
+ return CardSchemes.Discover;
560
+ if (JCB_RE.test(digits))
561
+ return CardSchemes.JCB;
562
+ if (DINERS_RE.test(digits))
563
+ return CardSchemes.DinersClub;
564
+ if (MC_RE.test(digits))
565
+ return CardSchemes.MasterCard;
566
+ if (VISA_RE.test(digits))
567
+ return CardSchemes.Visa;
568
+ if (UNIONPAY_RE.test(digits))
569
+ return CardSchemes.UnionPay;
570
+ if (MAESTRO_RE.test(digits))
571
+ return CardSchemes.Maestro;
572
+ return CardSchemes.Unknown;
573
+ }
574
+ function isVerve(bin6, length) {
575
+ if (length < 16 || length > 19)
576
+ return false;
577
+ const inRange = VERVE_BIN6_RANGES.some(([start, end]) => bin6 >= start && bin6 <= end);
578
+ return inRange || VERVE_BIN6_SINGLES.has(bin6);
579
+ }
580
+
425
581
  class InputComponent {
426
582
  value = '';
427
583
  formattedValue = '';
@@ -493,17 +649,25 @@ class InputComponent {
493
649
  useExisting: forwardRef(() => InputComponent),
494
650
  multi: true,
495
651
  },
496
- ], ngImport: i0, template: "<div class=\"flex flex-col gap-2\">\n @if (label) {\n <p class=\"mb-0 text-body-2xs font-normal text-heading-text\">\n {{ label }}\n @if (required) {\n <span class=\"text-orange-required\">*</span>\n }\n </p>\n }\n\n <div\n class=\"border-c px-3 py-2 flex items-center justify-between rounded-md h-12\"\n [ngClass]=\"[\n disabled ? 'bg-grey-50 cursor-not-allowed' : 'bg-white',\n validationError ? 'border-red-300 bg-red-50' : 'border-grey-100',\n ]\"\n >\n <ng-content select=\"[slot=prefix]\"></ng-content>\n <input\n [type]=\"type\"\n [value]=\"formattedValue\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\"\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder ? placeholder : 'Enter ' + label.toLowerCase()\"\n inputmode=\"decimal\"\n class=\"search-input bg-transparent outline-none border-none focus:outline-none focus:ring-0 text-body-2xs text-light-copy font-normal w-full\"\n />\n\n @if (!loading) {\n <ng-container>\n <ng-content select=\"[slot=suffix]\"></ng-content>\n <!-- Copy icon -->\n @if (showCopyIcon && value && value.trim() !== '') {\n <div class=\"ml-2 flex items-center\">\n <base-image\n src=\"assets/images/copyIcon.svg\"\n alt=\"copy\"\n [width]=\"16\"\n [height]=\"16\"\n class=\"cursor-pointer hover:opacity-70 transition-opacity\"\n (onClick)=\"copyHandler()\"\n ></base-image>\n </div>\n }\n </ng-container>\n } @else {\n <ng-template>\n <icon-loader></icon-loader>\n </ng-template>\n }\n </div>\n @if (hint) {\n <base-hint [hint]=\"hint\"></base-hint>\n }\n @if (validationError) {\n <base-input-error [errorMessage]=\"validationError\"></base-input-error>\n }\n</div>\n", styles: [":host{--select-placeholder-color: #9dbfde}:host .search-input::placeholder{color:var(--select-placeholder-color);opacity:1}:host .search-input::-webkit-input-placeholder{color:var(--select-placeholder-color)}:host .search-input::-moz-placeholder{color:var(--select-placeholder-color)}:host .search-input:-ms-input-placeholder{color:var(--select-placeholder-color)}:host .search-input::-ms-input-placeholder{color:var(--select-placeholder-color)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: IconLoaderComponent, selector: "icon-loader", inputs: ["color", "size"] }, { kind: "component", type: HintComponent, selector: "base-hint", inputs: ["hint"] }, { kind: "component", type: InputErrorComponent, selector: "base-input-error", inputs: ["errorMessage"] }, { kind: "component", type: ImageComponent, selector: "base-image", inputs: ["src", "alt", "isFullWidth", "width", "height", "customClass"], outputs: ["onClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
652
+ ], ngImport: i0, template: "<div class=\"flex flex-col gap-2\">\n @if (label) {\n <p class=\"mb-0 text-body-2xs font-normal text-heading-text\">\n {{ label }}\n @if (required) {\n <span class=\"text-orange-required\">*</span>\n }\n </p>\n }\n\n <div\n class=\"border-c px-3 py-2 flex items-center justify-between rounded-md h-12\"\n [ngClass]=\"[\n disabled ? 'bg-grey-50 cursor-not-allowed' : 'bg-white',\n validationError ? 'border-red-300 bg-red-50' : 'border-grey-100',\n ]\"\n >\n <ng-content select=\"[slot=prefix]\"></ng-content>\n <input\n [type]=\"type\"\n [imask]=\"mask ? { mask, lazy: true } : undefined\"\n [unmask]=\"mask ? 'typed' : false\"\n [(ngModel)]=\"formattedValue\"\n [disabled]=\"disabled\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\"\n [placeholder]=\"placeholder ? placeholder : 'Enter ' + label.toLowerCase()\"\n inputmode=\"decimal\"\n class=\"search-input bg-transparent outline-none border-none focus:outline-none focus:ring-0 text-body-2xs text-light-copy font-normal w-full\"\n />\n\n @if (!loading) {\n <ng-container>\n <ng-content select=\"[slot=suffix]\"></ng-content>\n <!-- Copy icon -->\n @if (showCopyIcon && value && value.trim() !== '') {\n <div class=\"ml-2 flex items-center\">\n <base-image\n src=\"assets/images/copyIcon.svg\"\n alt=\"copy\"\n [width]=\"16\"\n [height]=\"16\"\n class=\"cursor-pointer hover:opacity-70 transition-opacity\"\n (onClick)=\"copyHandler()\"\n ></base-image>\n </div>\n }\n </ng-container>\n } @else {\n <ng-template>\n <icon-loader></icon-loader>\n </ng-template>\n }\n </div>\n @if (hint) {\n <base-hint [hint]=\"hint\"></base-hint>\n }\n @if (validationError) {\n <base-input-error [errorMessage]=\"validationError\"></base-input-error>\n }\n</div>\n", styles: [":host{--select-placeholder-color: #9dbfde}:host .search-input::placeholder{color:var(--select-placeholder-color);opacity:1}:host .search-input::-webkit-input-placeholder{color:var(--select-placeholder-color)}:host .search-input::-moz-placeholder{color:var(--select-placeholder-color)}:host .search-input:-ms-input-placeholder{color:var(--select-placeholder-color)}:host .search-input::-ms-input-placeholder{color:var(--select-placeholder-color)}\n"], dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: IconLoaderComponent, selector: "icon-loader", inputs: ["color", "size"] }, { kind: "component", type: HintComponent, selector: "base-hint", inputs: ["hint"] }, { kind: "component", type: InputErrorComponent, selector: "base-input-error", inputs: ["errorMessage"] }, { kind: "component", type: ImageComponent, selector: "base-image", inputs: ["src", "alt", "isFullWidth", "width", "height", "customClass"], outputs: ["onClick"] }, { kind: "ngmodule", type: IMaskModule }, { kind: "directive", type: i2.IMaskDirective, selector: "[imask]", inputs: ["imask", "unmask", "imaskElement"], outputs: ["accept", "complete"], exportAs: ["imask"] }, { kind: "ngmodule", type: FormsModule }, { kind: "directive", type: i3.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
497
653
  }
498
654
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: InputComponent, decorators: [{
499
655
  type: Component,
500
- args: [{ selector: 'base-input', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, IconLoaderComponent, HintComponent, InputErrorComponent, ImageComponent], providers: [
656
+ args: [{ selector: 'base-input', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [
657
+ CommonModule,
658
+ IconLoaderComponent,
659
+ HintComponent,
660
+ InputErrorComponent,
661
+ ImageComponent,
662
+ IMaskModule,
663
+ FormsModule,
664
+ ], providers: [
501
665
  {
502
666
  provide: NG_VALUE_ACCESSOR,
503
667
  useExisting: forwardRef(() => InputComponent),
504
668
  multi: true,
505
669
  },
506
- ], template: "<div class=\"flex flex-col gap-2\">\n @if (label) {\n <p class=\"mb-0 text-body-2xs font-normal text-heading-text\">\n {{ label }}\n @if (required) {\n <span class=\"text-orange-required\">*</span>\n }\n </p>\n }\n\n <div\n class=\"border-c px-3 py-2 flex items-center justify-between rounded-md h-12\"\n [ngClass]=\"[\n disabled ? 'bg-grey-50 cursor-not-allowed' : 'bg-white',\n validationError ? 'border-red-300 bg-red-50' : 'border-grey-100',\n ]\"\n >\n <ng-content select=\"[slot=prefix]\"></ng-content>\n <input\n [type]=\"type\"\n [value]=\"formattedValue\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\"\n [disabled]=\"disabled\"\n [placeholder]=\"placeholder ? placeholder : 'Enter ' + label.toLowerCase()\"\n inputmode=\"decimal\"\n class=\"search-input bg-transparent outline-none border-none focus:outline-none focus:ring-0 text-body-2xs text-light-copy font-normal w-full\"\n />\n\n @if (!loading) {\n <ng-container>\n <ng-content select=\"[slot=suffix]\"></ng-content>\n <!-- Copy icon -->\n @if (showCopyIcon && value && value.trim() !== '') {\n <div class=\"ml-2 flex items-center\">\n <base-image\n src=\"assets/images/copyIcon.svg\"\n alt=\"copy\"\n [width]=\"16\"\n [height]=\"16\"\n class=\"cursor-pointer hover:opacity-70 transition-opacity\"\n (onClick)=\"copyHandler()\"\n ></base-image>\n </div>\n }\n </ng-container>\n } @else {\n <ng-template>\n <icon-loader></icon-loader>\n </ng-template>\n }\n </div>\n @if (hint) {\n <base-hint [hint]=\"hint\"></base-hint>\n }\n @if (validationError) {\n <base-input-error [errorMessage]=\"validationError\"></base-input-error>\n }\n</div>\n", styles: [":host{--select-placeholder-color: #9dbfde}:host .search-input::placeholder{color:var(--select-placeholder-color);opacity:1}:host .search-input::-webkit-input-placeholder{color:var(--select-placeholder-color)}:host .search-input::-moz-placeholder{color:var(--select-placeholder-color)}:host .search-input:-ms-input-placeholder{color:var(--select-placeholder-color)}:host .search-input::-ms-input-placeholder{color:var(--select-placeholder-color)}\n"] }]
670
+ ], template: "<div class=\"flex flex-col gap-2\">\n @if (label) {\n <p class=\"mb-0 text-body-2xs font-normal text-heading-text\">\n {{ label }}\n @if (required) {\n <span class=\"text-orange-required\">*</span>\n }\n </p>\n }\n\n <div\n class=\"border-c px-3 py-2 flex items-center justify-between rounded-md h-12\"\n [ngClass]=\"[\n disabled ? 'bg-grey-50 cursor-not-allowed' : 'bg-white',\n validationError ? 'border-red-300 bg-red-50' : 'border-grey-100',\n ]\"\n >\n <ng-content select=\"[slot=prefix]\"></ng-content>\n <input\n [type]=\"type\"\n [imask]=\"mask ? { mask, lazy: true } : undefined\"\n [unmask]=\"mask ? 'typed' : false\"\n [(ngModel)]=\"formattedValue\"\n [disabled]=\"disabled\"\n (input)=\"onInput($event)\"\n (blur)=\"onBlur()\"\n (keydown)=\"onKeyDown($event)\"\n [placeholder]=\"placeholder ? placeholder : 'Enter ' + label.toLowerCase()\"\n inputmode=\"decimal\"\n class=\"search-input bg-transparent outline-none border-none focus:outline-none focus:ring-0 text-body-2xs text-light-copy font-normal w-full\"\n />\n\n @if (!loading) {\n <ng-container>\n <ng-content select=\"[slot=suffix]\"></ng-content>\n <!-- Copy icon -->\n @if (showCopyIcon && value && value.trim() !== '') {\n <div class=\"ml-2 flex items-center\">\n <base-image\n src=\"assets/images/copyIcon.svg\"\n alt=\"copy\"\n [width]=\"16\"\n [height]=\"16\"\n class=\"cursor-pointer hover:opacity-70 transition-opacity\"\n (onClick)=\"copyHandler()\"\n ></base-image>\n </div>\n }\n </ng-container>\n } @else {\n <ng-template>\n <icon-loader></icon-loader>\n </ng-template>\n }\n </div>\n @if (hint) {\n <base-hint [hint]=\"hint\"></base-hint>\n }\n @if (validationError) {\n <base-input-error [errorMessage]=\"validationError\"></base-input-error>\n }\n</div>\n", styles: [":host{--select-placeholder-color: #9dbfde}:host .search-input::placeholder{color:var(--select-placeholder-color);opacity:1}:host .search-input::-webkit-input-placeholder{color:var(--select-placeholder-color)}:host .search-input::-moz-placeholder{color:var(--select-placeholder-color)}:host .search-input:-ms-input-placeholder{color:var(--select-placeholder-color)}:host .search-input::-ms-input-placeholder{color:var(--select-placeholder-color)}\n"] }]
507
671
  }], ctorParameters: () => [], propDecorators: { label: [{
508
672
  type: Input
509
673
  }], type: [{
@@ -744,7 +908,7 @@ class SelectComponent {
744
908
  useExisting: forwardRef(() => SelectComponent),
745
909
  multi: true,
746
910
  },
747
- ], viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["triggerRef"], descendants: true }, { propertyName: "menuRef", first: true, predicate: ["menuRef"], descendants: true }, { propertyName: "searchRef", first: true, predicate: ["searchRef"], descendants: true }], ngImport: i0, template: "<div class=\"flex flex-col gap-2 relative\">\n @if (label) {\n <p class=\"mb-0 text-body-2xs font-normal text-heading-text\">\n {{ label }}\n @if (required) {\n <span class=\"text-orange-required\">*</span>\n }\n </p>\n }\n\n <!-- Trigger -->\n <div\n #triggerRef\n class=\"border-c rounded-md flex items-center justify-between h-12 cursor-pointer px-3 py-2\"\n [ngClass]=\"[\n disabled ? 'bg-grey-100 cursor-not-allowed' : 'bg-white',\n validationError ? 'border-red-300 bg-red-50' : 'border-grey-100 bg-white',\n ]\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-controls]=\"isOpen ? 'select-menu' : null\"\n [attr.aria-disabled]=\"disabled || null\"\n [attr.aria-activedescendant]=\"isOpen && activeIndex >= 0 ? 'option-' + activeIndex : null\"\n tabindex=\"0\"\n (click)=\"toggle()\"\n (keydown)=\"onTriggerKeydown($event)\"\n >\n <div class=\"flex items-center gap-2\">\n <ng-content select=\"[slot=prefix]\"></ng-content>\n <div class=\"flex items-center gap-2\">\n @if (selectedOption && itemImageType === 'country') {\n <base-image\n [src]=\"'https://flagcdn.com/w40/' + selectedOption.countryCode?.toLowerCase() + '.png'\"\n [alt]=\"selectedOption.countryCode\"\n [width]=\"28\"\n customClass=\"rounded-lg\"\n ></base-image>\n }\n\n @if (selectedOption && itemImageType === 'bank') {\n <!-- <base-image\n [src]=\"bankLogoHandler(selectedOption?.['bankCode'] || selectedOption?.value)\"\n [alt]=\"selectedOption?.value\"\n [width]=\"28\"\n customClass=\"rounded-lg\"\n ></base-image> -->\n }\n\n <p\n class=\"text-body-2xs font-normal mb-0\"\n [ngClass]=\"[selectedOption?.label ? 'text-sub-copy' : 'text-grey-500']\"\n >\n {{ displayText }}\n </p>\n </div>\n </div>\n\n @if (loading) {\n <icon-loader></icon-loader>\n } @else {\n @if (isOpen) {\n <icon-chevron-up width=\"20\" height=\"20\" color=\"#8FAECA\"></icon-chevron-up>\n } @else {\n <icon-chevron-down width=\"20\" height=\"20\" color=\"#8FAECA\"></icon-chevron-down>\n }\n }\n </div>\n\n <!-- Menu -->\n @if (isOpen) {\n <div\n #menuRef\n id=\"select-menu\"\n class=\"border-c bg-white rounded-md border-grey-border text-body-xs font-normal text-input-grey w-full mt-2 max-h-22rem overflow-y-auto\"\n role=\"listbox\"\n [attr.aria-label]=\"label || 'Options'\"\n style=\"position: absolute; top: 100%; z-index: 10;\"\n (keydown)=\"onMenuKeydown($event)\"\n >\n @if (hasSearch) {\n <div class=\"px-4 pt-2 pb-1\">\n <input\n #searchRef\n type=\"text\"\n (input)=\"onInput($event)\"\n [placeholder]=\"'Search ' + label\"\n class=\"bg-transparent outline-none border-b pb-2 w-full focus:outline-none focus:ring-0 text-body-2xs text-light-copy font-normal\"\n />\n </div>\n }\n\n <div\n class=\"px-4 py-3 first:pt-0 hover:bg-gray-100 flex items-center gap-2 cursor-pointer\"\n *ngFor=\"let option of filteredOptions; let i = index\"\n (click)=\"onSelect(option.value)\"\n [attr.id]=\"'option-' + i\"\n data-option\n role=\"option\"\n [attr.aria-selected]=\"selectedOption?.value === option.value\"\n [ngClass]=\"{ 'bg-gray-100': i === activeIndex }\"\n >\n @if (itemImageType === 'country') {\n <base-image\n [src]=\"'https://flagcdn.com/w40/' + (option.countryCode || '').toLowerCase() + '.png'\"\n [alt]=\"option.countryCode\"\n [width]=\"28\"\n customClass=\"rounded-lg\"\n ></base-image>\n }\n\n @if (itemImageType === 'bank') {\n <!-- <base-image\n [src]=\"bankLogoHandler(option['bankCode'] || option.value)\"\n [alt]=\"option.value\"\n [width]=\"28\"\n customClass=\"rounded-lg\"\n ></base-image> -->\n }\n\n <p class=\"mb-0 text-body-2xs font-medium\">\n {{ option.label }}\n </p>\n </div>\n </div>\n }\n\n @if (hint) {\n <base-hint [hint]=\"hint\"></base-hint>\n }\n @if (validationError) {\n <base-input-error [errorMessage]=\"validationError\"></base-input-error>\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: IconLoaderComponent, selector: "icon-loader", inputs: ["color", "size"] }, { kind: "component", type: IconChevronUpComponent, selector: "icon-chevron-up", inputs: ["color", "width", "height"] }, { kind: "component", type: IconChevronDownComponent, selector: "icon-chevron-down", inputs: ["color", "width", "height"] }, { kind: "component", type: HintComponent, selector: "base-hint", inputs: ["hint"] }, { kind: "component", type: InputErrorComponent, selector: "base-input-error", inputs: ["errorMessage"] }, { kind: "component", type: ImageComponent, selector: "base-image", inputs: ["src", "alt", "isFullWidth", "width", "height", "customClass"], outputs: ["onClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
911
+ ], viewQueries: [{ propertyName: "triggerRef", first: true, predicate: ["triggerRef"], descendants: true }, { propertyName: "menuRef", first: true, predicate: ["menuRef"], descendants: true }, { propertyName: "searchRef", first: true, predicate: ["searchRef"], descendants: true }], ngImport: i0, template: "<div class=\"flex flex-col gap-2 relative\">\n @if (label) {\n <p class=\"mb-0 text-body-2xs font-normal text-heading-text\">\n {{ label }}\n @if (required) {\n <span class=\"text-orange-required\">*</span>\n }\n </p>\n }\n\n <!-- Trigger -->\n <div\n #triggerRef\n class=\"border-c rounded-md flex items-center justify-between h-12 cursor-pointer px-3 py-2\"\n [ngClass]=\"[\n disabled ? 'bg-grey-100 cursor-not-allowed' : 'bg-white',\n validationError ? 'border-red-300' : 'border-grey-100 bg-white',\n ]\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-controls]=\"isOpen ? 'select-menu' : null\"\n [attr.aria-disabled]=\"disabled || null\"\n [attr.aria-activedescendant]=\"isOpen && activeIndex >= 0 ? 'option-' + activeIndex : null\"\n tabindex=\"0\"\n (click)=\"toggle()\"\n (keydown)=\"onTriggerKeydown($event)\"\n >\n <div class=\"flex items-center gap-2\">\n <ng-content select=\"[slot=prefix]\"></ng-content>\n <div class=\"flex items-center gap-2\">\n @if (selectedOption && itemImageType === 'country') {\n <base-image\n [src]=\"'https://flagcdn.com/w40/' + selectedOption.countryCode?.toLowerCase() + '.png'\"\n [alt]=\"selectedOption.countryCode\"\n [width]=\"28\"\n customClass=\"rounded-lg\"\n ></base-image>\n }\n\n @if (selectedOption && itemImageType === 'bank') {\n <!-- <base-image\n [src]=\"bankLogoHandler(selectedOption?.['bankCode'] || selectedOption?.value)\"\n [alt]=\"selectedOption?.value\"\n [width]=\"28\"\n customClass=\"rounded-lg\"\n ></base-image> -->\n }\n\n <p\n class=\"text-body-2xs font-normal mb-0\"\n [ngClass]=\"[selectedOption?.label ? 'text-sub-copy' : 'text-grey-500']\"\n >\n {{ displayText }}\n </p>\n </div>\n </div>\n\n @if (loading) {\n <icon-loader></icon-loader>\n } @else {\n @if (isOpen) {\n <icon-chevron-up width=\"20\" height=\"20\" color=\"#8FAECA\"></icon-chevron-up>\n } @else {\n <icon-chevron-down width=\"20\" height=\"20\" color=\"#8FAECA\"></icon-chevron-down>\n }\n }\n </div>\n\n <!-- Dropdown -->\n @if (isOpen) {\n <div\n #menuRef\n id=\"select-menu\"\n class=\"absolute top-20 h-44 border-c bg-white rounded-md border-grey-border text-body-xs font-normal text-input-grey w-full mt-2 overflow-y-auto\"\n role=\"listbox\"\n [attr.aria-label]=\"label || 'Options'\"\n style=\"position: absolute; top: 100%; z-index: 10;\"\n (keydown)=\"onMenuKeydown($event)\"\n >\n @if (hasSearch) {\n <div class=\"px-4 pt-2 pb-1\">\n <input\n #searchRef\n type=\"text\"\n (input)=\"onInput($event)\"\n [placeholder]=\"'Search ' + label\"\n class=\"bg-transparent outline-none border-b pb-2 w-full focus:outline-none focus:ring-0 text-body-2xs text-light-copy font-normal\"\n />\n </div>\n }\n\n <div\n class=\"px-4 py-3 first:pt-0 hover:bg-gray-100 flex items-center gap-2 cursor-pointer\"\n *ngFor=\"let option of filteredOptions; let i = index\"\n (click)=\"onSelect(option.value)\"\n [attr.id]=\"'option-' + i\"\n data-option\n role=\"option\"\n [attr.aria-selected]=\"selectedOption?.value === option.value\"\n [ngClass]=\"{ 'bg-gray-100': i === activeIndex }\"\n >\n @if (itemImageType === 'country') {\n <base-image\n [src]=\"'https://flagcdn.com/w40/' + (option.countryCode || '').toLowerCase() + '.png'\"\n [alt]=\"option.countryCode\"\n [width]=\"28\"\n customClass=\"rounded-lg\"\n ></base-image>\n }\n\n @if (itemImageType === 'bank') {\n <!-- <base-image\n [src]=\"bankLogoHandler(option['bankCode'] || option.value)\"\n [alt]=\"option.value\"\n [width]=\"28\"\n customClass=\"rounded-lg\"\n ></base-image> -->\n }\n\n <p class=\"mb-0 text-body-2xs font-medium\">\n {{ option.label }}\n </p>\n </div>\n </div>\n }\n\n @if (hint) {\n <base-hint [hint]=\"hint\"></base-hint>\n }\n @if (validationError) {\n <base-input-error [errorMessage]=\"validationError\"></base-input-error>\n }\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: IconLoaderComponent, selector: "icon-loader", inputs: ["color", "size"] }, { kind: "component", type: IconChevronUpComponent, selector: "icon-chevron-up", inputs: ["color", "width", "height"] }, { kind: "component", type: IconChevronDownComponent, selector: "icon-chevron-down", inputs: ["color", "width", "height"] }, { kind: "component", type: HintComponent, selector: "base-hint", inputs: ["hint"] }, { kind: "component", type: InputErrorComponent, selector: "base-input-error", inputs: ["errorMessage"] }, { kind: "component", type: ImageComponent, selector: "base-image", inputs: ["src", "alt", "isFullWidth", "width", "height", "customClass"], outputs: ["onClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
748
912
  }
749
913
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: SelectComponent, decorators: [{
750
914
  type: Component,
@@ -762,7 +926,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImpor
762
926
  HintComponent,
763
927
  InputErrorComponent,
764
928
  ImageComponent,
765
- ], template: "<div class=\"flex flex-col gap-2 relative\">\n @if (label) {\n <p class=\"mb-0 text-body-2xs font-normal text-heading-text\">\n {{ label }}\n @if (required) {\n <span class=\"text-orange-required\">*</span>\n }\n </p>\n }\n\n <!-- Trigger -->\n <div\n #triggerRef\n class=\"border-c rounded-md flex items-center justify-between h-12 cursor-pointer px-3 py-2\"\n [ngClass]=\"[\n disabled ? 'bg-grey-100 cursor-not-allowed' : 'bg-white',\n validationError ? 'border-red-300 bg-red-50' : 'border-grey-100 bg-white',\n ]\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-controls]=\"isOpen ? 'select-menu' : null\"\n [attr.aria-disabled]=\"disabled || null\"\n [attr.aria-activedescendant]=\"isOpen && activeIndex >= 0 ? 'option-' + activeIndex : null\"\n tabindex=\"0\"\n (click)=\"toggle()\"\n (keydown)=\"onTriggerKeydown($event)\"\n >\n <div class=\"flex items-center gap-2\">\n <ng-content select=\"[slot=prefix]\"></ng-content>\n <div class=\"flex items-center gap-2\">\n @if (selectedOption && itemImageType === 'country') {\n <base-image\n [src]=\"'https://flagcdn.com/w40/' + selectedOption.countryCode?.toLowerCase() + '.png'\"\n [alt]=\"selectedOption.countryCode\"\n [width]=\"28\"\n customClass=\"rounded-lg\"\n ></base-image>\n }\n\n @if (selectedOption && itemImageType === 'bank') {\n <!-- <base-image\n [src]=\"bankLogoHandler(selectedOption?.['bankCode'] || selectedOption?.value)\"\n [alt]=\"selectedOption?.value\"\n [width]=\"28\"\n customClass=\"rounded-lg\"\n ></base-image> -->\n }\n\n <p\n class=\"text-body-2xs font-normal mb-0\"\n [ngClass]=\"[selectedOption?.label ? 'text-sub-copy' : 'text-grey-500']\"\n >\n {{ displayText }}\n </p>\n </div>\n </div>\n\n @if (loading) {\n <icon-loader></icon-loader>\n } @else {\n @if (isOpen) {\n <icon-chevron-up width=\"20\" height=\"20\" color=\"#8FAECA\"></icon-chevron-up>\n } @else {\n <icon-chevron-down width=\"20\" height=\"20\" color=\"#8FAECA\"></icon-chevron-down>\n }\n }\n </div>\n\n <!-- Menu -->\n @if (isOpen) {\n <div\n #menuRef\n id=\"select-menu\"\n class=\"border-c bg-white rounded-md border-grey-border text-body-xs font-normal text-input-grey w-full mt-2 max-h-22rem overflow-y-auto\"\n role=\"listbox\"\n [attr.aria-label]=\"label || 'Options'\"\n style=\"position: absolute; top: 100%; z-index: 10;\"\n (keydown)=\"onMenuKeydown($event)\"\n >\n @if (hasSearch) {\n <div class=\"px-4 pt-2 pb-1\">\n <input\n #searchRef\n type=\"text\"\n (input)=\"onInput($event)\"\n [placeholder]=\"'Search ' + label\"\n class=\"bg-transparent outline-none border-b pb-2 w-full focus:outline-none focus:ring-0 text-body-2xs text-light-copy font-normal\"\n />\n </div>\n }\n\n <div\n class=\"px-4 py-3 first:pt-0 hover:bg-gray-100 flex items-center gap-2 cursor-pointer\"\n *ngFor=\"let option of filteredOptions; let i = index\"\n (click)=\"onSelect(option.value)\"\n [attr.id]=\"'option-' + i\"\n data-option\n role=\"option\"\n [attr.aria-selected]=\"selectedOption?.value === option.value\"\n [ngClass]=\"{ 'bg-gray-100': i === activeIndex }\"\n >\n @if (itemImageType === 'country') {\n <base-image\n [src]=\"'https://flagcdn.com/w40/' + (option.countryCode || '').toLowerCase() + '.png'\"\n [alt]=\"option.countryCode\"\n [width]=\"28\"\n customClass=\"rounded-lg\"\n ></base-image>\n }\n\n @if (itemImageType === 'bank') {\n <!-- <base-image\n [src]=\"bankLogoHandler(option['bankCode'] || option.value)\"\n [alt]=\"option.value\"\n [width]=\"28\"\n customClass=\"rounded-lg\"\n ></base-image> -->\n }\n\n <p class=\"mb-0 text-body-2xs font-medium\">\n {{ option.label }}\n </p>\n </div>\n </div>\n }\n\n @if (hint) {\n <base-hint [hint]=\"hint\"></base-hint>\n }\n @if (validationError) {\n <base-input-error [errorMessage]=\"validationError\"></base-input-error>\n }\n</div>\n" }]
929
+ ], template: "<div class=\"flex flex-col gap-2 relative\">\n @if (label) {\n <p class=\"mb-0 text-body-2xs font-normal text-heading-text\">\n {{ label }}\n @if (required) {\n <span class=\"text-orange-required\">*</span>\n }\n </p>\n }\n\n <!-- Trigger -->\n <div\n #triggerRef\n class=\"border-c rounded-md flex items-center justify-between h-12 cursor-pointer px-3 py-2\"\n [ngClass]=\"[\n disabled ? 'bg-grey-100 cursor-not-allowed' : 'bg-white',\n validationError ? 'border-red-300' : 'border-grey-100 bg-white',\n ]\"\n role=\"combobox\"\n aria-haspopup=\"listbox\"\n [attr.aria-expanded]=\"isOpen\"\n [attr.aria-controls]=\"isOpen ? 'select-menu' : null\"\n [attr.aria-disabled]=\"disabled || null\"\n [attr.aria-activedescendant]=\"isOpen && activeIndex >= 0 ? 'option-' + activeIndex : null\"\n tabindex=\"0\"\n (click)=\"toggle()\"\n (keydown)=\"onTriggerKeydown($event)\"\n >\n <div class=\"flex items-center gap-2\">\n <ng-content select=\"[slot=prefix]\"></ng-content>\n <div class=\"flex items-center gap-2\">\n @if (selectedOption && itemImageType === 'country') {\n <base-image\n [src]=\"'https://flagcdn.com/w40/' + selectedOption.countryCode?.toLowerCase() + '.png'\"\n [alt]=\"selectedOption.countryCode\"\n [width]=\"28\"\n customClass=\"rounded-lg\"\n ></base-image>\n }\n\n @if (selectedOption && itemImageType === 'bank') {\n <!-- <base-image\n [src]=\"bankLogoHandler(selectedOption?.['bankCode'] || selectedOption?.value)\"\n [alt]=\"selectedOption?.value\"\n [width]=\"28\"\n customClass=\"rounded-lg\"\n ></base-image> -->\n }\n\n <p\n class=\"text-body-2xs font-normal mb-0\"\n [ngClass]=\"[selectedOption?.label ? 'text-sub-copy' : 'text-grey-500']\"\n >\n {{ displayText }}\n </p>\n </div>\n </div>\n\n @if (loading) {\n <icon-loader></icon-loader>\n } @else {\n @if (isOpen) {\n <icon-chevron-up width=\"20\" height=\"20\" color=\"#8FAECA\"></icon-chevron-up>\n } @else {\n <icon-chevron-down width=\"20\" height=\"20\" color=\"#8FAECA\"></icon-chevron-down>\n }\n }\n </div>\n\n <!-- Dropdown -->\n @if (isOpen) {\n <div\n #menuRef\n id=\"select-menu\"\n class=\"absolute top-20 h-44 border-c bg-white rounded-md border-grey-border text-body-xs font-normal text-input-grey w-full mt-2 overflow-y-auto\"\n role=\"listbox\"\n [attr.aria-label]=\"label || 'Options'\"\n style=\"position: absolute; top: 100%; z-index: 10;\"\n (keydown)=\"onMenuKeydown($event)\"\n >\n @if (hasSearch) {\n <div class=\"px-4 pt-2 pb-1\">\n <input\n #searchRef\n type=\"text\"\n (input)=\"onInput($event)\"\n [placeholder]=\"'Search ' + label\"\n class=\"bg-transparent outline-none border-b pb-2 w-full focus:outline-none focus:ring-0 text-body-2xs text-light-copy font-normal\"\n />\n </div>\n }\n\n <div\n class=\"px-4 py-3 first:pt-0 hover:bg-gray-100 flex items-center gap-2 cursor-pointer\"\n *ngFor=\"let option of filteredOptions; let i = index\"\n (click)=\"onSelect(option.value)\"\n [attr.id]=\"'option-' + i\"\n data-option\n role=\"option\"\n [attr.aria-selected]=\"selectedOption?.value === option.value\"\n [ngClass]=\"{ 'bg-gray-100': i === activeIndex }\"\n >\n @if (itemImageType === 'country') {\n <base-image\n [src]=\"'https://flagcdn.com/w40/' + (option.countryCode || '').toLowerCase() + '.png'\"\n [alt]=\"option.countryCode\"\n [width]=\"28\"\n customClass=\"rounded-lg\"\n ></base-image>\n }\n\n @if (itemImageType === 'bank') {\n <!-- <base-image\n [src]=\"bankLogoHandler(option['bankCode'] || option.value)\"\n [alt]=\"option.value\"\n [width]=\"28\"\n customClass=\"rounded-lg\"\n ></base-image> -->\n }\n\n <p class=\"mb-0 text-body-2xs font-medium\">\n {{ option.label }}\n </p>\n </div>\n </div>\n }\n\n @if (hint) {\n <base-hint [hint]=\"hint\"></base-hint>\n }\n @if (validationError) {\n <base-input-error [errorMessage]=\"validationError\"></base-input-error>\n }\n</div>\n" }]
766
930
  }], propDecorators: { options: [{
767
931
  type: Input
768
932
  }], placeholder: [{
@@ -857,18 +1021,18 @@ class LabelInfoComponent {
857
1021
  valueImageCustomClass = '';
858
1022
  valueImagePosition = 'prefix';
859
1023
  hasValueCopy = false;
860
- value = '';
1024
+ value = null;
861
1025
  valueCustomClass = 'text-body-2xs font-medium text-sub-copy';
862
1026
  alignRight = false;
863
1027
  truncateStringHandler(str, num) {
864
1028
  return truncateString(str, num);
865
1029
  }
866
1030
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: LabelInfoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
867
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.1", type: LabelInfoComponent, isStandalone: true, selector: "base-label-info", inputs: { type: "type", label: "label", labelCustomClass: "labelCustomClass", valueImageSrc: "valueImageSrc", valueImageCustomClass: "valueImageCustomClass", valueImagePosition: "valueImagePosition", hasValueCopy: "hasValueCopy", value: "value", valueCustomClass: "valueCustomClass", alignRight: "alignRight" }, ngImport: i0, template: "@if (type === 'vertical') {\n <div class=\"flex flex-col gap-1\" [ngClass]=\"{ 'text-right items-end': alignRight }\">\n <p [ngClass]=\"labelCustomClass\">{{ label.toUpperCase() }}</p>\n <div class=\"flex items-center gap-1\">\n @if (valueImageSrc && valueImagePosition === 'prefix') {\n <base-image\n [src]=\"valueImageSrc\"\n [alt]=\"value\"\n [width]=\"22\"\n [customClass]=\"valueImageCustomClass\"\n ></base-image>\n }\n\n @if (!hasValueCopy) {\n <p [ngClass]=\"valueCustomClass\">\n {{ value }}\n </p>\n } @else {\n <p [ngClass]=\"valueCustomClass\" class=\"truncate\">\n {{ truncateStringHandler(value, 40) }}\n </p>\n }\n\n @if (hasValueCopy) {\n <base-copy [copyText]=\"value\" color=\"#9DBFDE\"></base-copy>\n }\n\n @if (valueImageSrc && valueImagePosition === 'suffix') {\n <base-image\n [src]=\"valueImageSrc\"\n [alt]=\"value\"\n [width]=\"22\"\n [customClass]=\"valueImageCustomClass\"\n ></base-image>\n }\n </div>\n </div>\n} @else {\n <div class=\"flex items-center justify-between\">\n <p [ngClass]=\"labelCustomClass\">{{ label.toUpperCase() }}</p>\n <div class=\"flex items-center gap-1\">\n @if (valueImageSrc && valueImagePosition === 'prefix') {\n <base-image\n [src]=\"valueImageSrc\"\n [alt]=\"value\"\n [width]=\"22\"\n [customClass]=\"valueImageCustomClass\"\n ></base-image>\n }\n <p [ngClass]=\"valueCustomClass\">\n {{ value }}\n </p>\n\n @if (hasValueCopy) {\n <base-copy [copyText]=\"value\" color=\"#9DBFDE\"></base-copy>\n }\n\n @if (valueImageSrc && valueImagePosition === 'suffix') {\n <base-image\n [src]=\"valueImageSrc\"\n [alt]=\"value\"\n [width]=\"22\"\n [customClass]=\"valueImageCustomClass\"\n ></base-image>\n }\n </div>\n </div>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: CopyComponent, selector: "base-copy", inputs: ["copyText", "color"] }, { kind: "component", type: ImageComponent, selector: "base-image", inputs: ["src", "alt", "isFullWidth", "width", "height", "customClass"], outputs: ["onClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1031
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.2.1", type: LabelInfoComponent, isStandalone: true, selector: "base-label-info", inputs: { type: "type", label: "label", labelCustomClass: "labelCustomClass", valueImageSrc: "valueImageSrc", valueImageCustomClass: "valueImageCustomClass", valueImagePosition: "valueImagePosition", hasValueCopy: "hasValueCopy", value: "value", valueCustomClass: "valueCustomClass", alignRight: "alignRight" }, ngImport: i0, template: "@if (type === 'vertical') {\n <div class=\"flex flex-col gap-1\" [ngClass]=\"{ 'text-right items-end': alignRight }\">\n <p [ngClass]=\"labelCustomClass\">{{ label.toUpperCase() }}</p>\n <div class=\"flex items-center gap-1\">\n @if (valueImageSrc && valueImagePosition === 'prefix') {\n <base-image\n [src]=\"valueImageSrc\"\n [alt]=\"value ?? '-'\"\n [width]=\"22\"\n [customClass]=\"valueImageCustomClass\"\n ></base-image>\n }\n\n @if (!hasValueCopy) {\n <p [ngClass]=\"valueCustomClass\">\n {{ value }}\n </p>\n } @else {\n <p [ngClass]=\"valueCustomClass\" class=\"truncate\">\n {{ truncateStringHandler(value ?? '-', 40) }}\n </p>\n }\n\n @if (hasValueCopy) {\n <base-copy [copyText]=\"value ?? '-'\" color=\"#9DBFDE\"></base-copy>\n }\n\n @if (valueImageSrc && valueImagePosition === 'suffix') {\n <base-image\n [src]=\"valueImageSrc\"\n [alt]=\"value ?? '-'\"\n [width]=\"22\"\n [customClass]=\"valueImageCustomClass\"\n ></base-image>\n }\n </div>\n </div>\n} @else {\n <div class=\"flex items-center justify-between\">\n <p [ngClass]=\"labelCustomClass\">{{ label.toUpperCase() }}</p>\n <div class=\"flex items-center gap-1\">\n @if (valueImageSrc && valueImagePosition === 'prefix') {\n <base-image\n [src]=\"valueImageSrc\"\n [alt]=\"value ?? '-'\"\n [width]=\"22\"\n [customClass]=\"valueImageCustomClass\"\n ></base-image>\n }\n <p [ngClass]=\"valueCustomClass\">\n {{ value }}\n </p>\n\n @if (hasValueCopy) {\n <base-copy [copyText]=\"value ?? '-'\" color=\"#9DBFDE\"></base-copy>\n }\n\n @if (valueImageSrc && valueImagePosition === 'suffix') {\n <base-image\n [src]=\"valueImageSrc\"\n [alt]=\"value ?? '-'\"\n [width]=\"22\"\n [customClass]=\"valueImageCustomClass\"\n ></base-image>\n }\n </div>\n </div>\n}\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: CopyComponent, selector: "base-copy", inputs: ["copyText", "color"] }, { kind: "component", type: ImageComponent, selector: "base-image", inputs: ["src", "alt", "isFullWidth", "width", "height", "customClass"], outputs: ["onClick"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
868
1032
  }
869
1033
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: LabelInfoComponent, decorators: [{
870
1034
  type: Component,
871
- args: [{ selector: 'base-label-info', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, CopyComponent, ImageComponent], template: "@if (type === 'vertical') {\n <div class=\"flex flex-col gap-1\" [ngClass]=\"{ 'text-right items-end': alignRight }\">\n <p [ngClass]=\"labelCustomClass\">{{ label.toUpperCase() }}</p>\n <div class=\"flex items-center gap-1\">\n @if (valueImageSrc && valueImagePosition === 'prefix') {\n <base-image\n [src]=\"valueImageSrc\"\n [alt]=\"value\"\n [width]=\"22\"\n [customClass]=\"valueImageCustomClass\"\n ></base-image>\n }\n\n @if (!hasValueCopy) {\n <p [ngClass]=\"valueCustomClass\">\n {{ value }}\n </p>\n } @else {\n <p [ngClass]=\"valueCustomClass\" class=\"truncate\">\n {{ truncateStringHandler(value, 40) }}\n </p>\n }\n\n @if (hasValueCopy) {\n <base-copy [copyText]=\"value\" color=\"#9DBFDE\"></base-copy>\n }\n\n @if (valueImageSrc && valueImagePosition === 'suffix') {\n <base-image\n [src]=\"valueImageSrc\"\n [alt]=\"value\"\n [width]=\"22\"\n [customClass]=\"valueImageCustomClass\"\n ></base-image>\n }\n </div>\n </div>\n} @else {\n <div class=\"flex items-center justify-between\">\n <p [ngClass]=\"labelCustomClass\">{{ label.toUpperCase() }}</p>\n <div class=\"flex items-center gap-1\">\n @if (valueImageSrc && valueImagePosition === 'prefix') {\n <base-image\n [src]=\"valueImageSrc\"\n [alt]=\"value\"\n [width]=\"22\"\n [customClass]=\"valueImageCustomClass\"\n ></base-image>\n }\n <p [ngClass]=\"valueCustomClass\">\n {{ value }}\n </p>\n\n @if (hasValueCopy) {\n <base-copy [copyText]=\"value\" color=\"#9DBFDE\"></base-copy>\n }\n\n @if (valueImageSrc && valueImagePosition === 'suffix') {\n <base-image\n [src]=\"valueImageSrc\"\n [alt]=\"value\"\n [width]=\"22\"\n [customClass]=\"valueImageCustomClass\"\n ></base-image>\n }\n </div>\n </div>\n}\n" }]
1035
+ args: [{ selector: 'base-label-info', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [CommonModule, CopyComponent, ImageComponent], template: "@if (type === 'vertical') {\n <div class=\"flex flex-col gap-1\" [ngClass]=\"{ 'text-right items-end': alignRight }\">\n <p [ngClass]=\"labelCustomClass\">{{ label.toUpperCase() }}</p>\n <div class=\"flex items-center gap-1\">\n @if (valueImageSrc && valueImagePosition === 'prefix') {\n <base-image\n [src]=\"valueImageSrc\"\n [alt]=\"value ?? '-'\"\n [width]=\"22\"\n [customClass]=\"valueImageCustomClass\"\n ></base-image>\n }\n\n @if (!hasValueCopy) {\n <p [ngClass]=\"valueCustomClass\">\n {{ value }}\n </p>\n } @else {\n <p [ngClass]=\"valueCustomClass\" class=\"truncate\">\n {{ truncateStringHandler(value ?? '-', 40) }}\n </p>\n }\n\n @if (hasValueCopy) {\n <base-copy [copyText]=\"value ?? '-'\" color=\"#9DBFDE\"></base-copy>\n }\n\n @if (valueImageSrc && valueImagePosition === 'suffix') {\n <base-image\n [src]=\"valueImageSrc\"\n [alt]=\"value ?? '-'\"\n [width]=\"22\"\n [customClass]=\"valueImageCustomClass\"\n ></base-image>\n }\n </div>\n </div>\n} @else {\n <div class=\"flex items-center justify-between\">\n <p [ngClass]=\"labelCustomClass\">{{ label.toUpperCase() }}</p>\n <div class=\"flex items-center gap-1\">\n @if (valueImageSrc && valueImagePosition === 'prefix') {\n <base-image\n [src]=\"valueImageSrc\"\n [alt]=\"value ?? '-'\"\n [width]=\"22\"\n [customClass]=\"valueImageCustomClass\"\n ></base-image>\n }\n <p [ngClass]=\"valueCustomClass\">\n {{ value }}\n </p>\n\n @if (hasValueCopy) {\n <base-copy [copyText]=\"value ?? '-'\" color=\"#9DBFDE\"></base-copy>\n }\n\n @if (valueImageSrc && valueImagePosition === 'suffix') {\n <base-image\n [src]=\"valueImageSrc\"\n [alt]=\"value ?? '-'\"\n [width]=\"22\"\n [customClass]=\"valueImageCustomClass\"\n ></base-image>\n }\n </div>\n </div>\n}\n" }]
872
1036
  }], propDecorators: { type: [{
873
1037
  type: Input
874
1038
  }], label: [{
@@ -892,13 +1056,35 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImpor
892
1056
  }] } });
893
1057
 
894
1058
  class SuccessComponent {
1059
+ successObject = {
1060
+ paymentDate: '',
1061
+ paymentId: '',
1062
+ paymentStatus: '',
1063
+ };
1064
+ amount = 0;
1065
+ currency = '';
1066
+ redirectUrl = '';
1067
+ get formatAmountHandler() {
1068
+ return formatAmount(this.amount, this.currency);
1069
+ }
1070
+ goToRedirectUrl() {
1071
+ window.open(this.redirectUrl, '_self', 'noopener,noreferrer');
1072
+ }
895
1073
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: SuccessComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
896
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.1", type: SuccessComponent, isStandalone: true, selector: "base-success", ngImport: i0, template: "<div class=\"flex flex-col gap-8 p-16\">\n <div class=\"flex flex-col gap-8\">\n <div class=\"flex flex-col gap-8\">\n <icon-check-circle color=\"#F47A1F\" class=\"mx-auto\"></icon-check-circle>\n <div class=\"flex flex-col text-center\" style=\"gap: 2px\">\n <p class=\"text-heading-text font-medium text-header-2xl\">\u20A62,500.00</p>\n <p class=\"text-sub-copy font-regular text-body-3xs\">Has been paid successfully</p>\n </div>\n </div>\n\n <div class=\"flex flex-col\">\n <div class=\"py-4 border-b border-grey-100\">\n <base-label-info\n type=\"horizontal\"\n label=\"Order ID\"\n value=\"9900009000-8890-8829hd7\"\n ></base-label-info>\n </div>\n <div class=\"py-4\">\n <base-label-info\n type=\"horizontal\"\n label=\"Payment date\"\n value=\"July 24, 2025\"\n ></base-label-info>\n </div>\n </div>\n </div>\n\n <div class=\"mx-auto\" style=\"width: 80%;\">\n <base-button\n label=\"Return to Merchant Website\"\n type=\"secondary\"\n customClass=\"w-full\"\n ></base-button>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: LabelInfoComponent, selector: "base-label-info", inputs: ["type", "label", "labelCustomClass", "valueImageSrc", "valueImageCustomClass", "valueImagePosition", "hasValueCopy", "value", "valueCustomClass", "alignRight"] }, { kind: "component", type: ButtonComponent, selector: "base-button", inputs: ["label", "type", "size", "paddingClassX", "disabled", "loading", "customClass"], outputs: ["onClick"] }, { kind: "component", type: IconCheckCircleComponent, selector: "icon-check-circle", inputs: ["color", "width", "height"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
1074
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "20.2.1", type: SuccessComponent, isStandalone: true, selector: "base-success", inputs: { successObject: "successObject", amount: "amount", currency: "currency", redirectUrl: "redirectUrl" }, ngImport: i0, template: "<div class=\"flex flex-col gap-8 p-16\">\n <div class=\"flex flex-col gap-8\">\n <div class=\"flex flex-col gap-8\">\n <icon-check-circle color=\"#F47A1F\" class=\"mx-auto\"></icon-check-circle>\n <div class=\"flex flex-col text-center\" style=\"gap: 2px\">\n <p class=\"text-heading-text font-medium text-header-2xl\">{{ formatAmountHandler }}</p>\n <p class=\"text-sub-copy font-regular text-body-3xs\">Has been paid successfully</p>\n </div>\n </div>\n\n <div class=\"flex flex-col\">\n <div class=\"py-4 border-b border-grey-100\">\n <base-label-info\n type=\"horizontal\"\n label=\"Order ID\"\n [value]=\"successObject.paymentId\"\n ></base-label-info>\n </div>\n <div class=\"py-4\">\n <base-label-info\n type=\"horizontal\"\n label=\"Payment date\"\n [value]=\"successObject.paymentDate | date\"\n ></base-label-info>\n </div>\n </div>\n </div>\n\n <div class=\"mx-auto\" style=\"width: 80%\">\n <base-button\n label=\"Return to Merchant Website\"\n type=\"secondary\"\n customClass=\"w-full\"\n (onClick)=\"goToRedirectUrl()\"\n ></base-button>\n </div>\n</div>\n", dependencies: [{ kind: "component", type: LabelInfoComponent, selector: "base-label-info", inputs: ["type", "label", "labelCustomClass", "valueImageSrc", "valueImageCustomClass", "valueImagePosition", "hasValueCopy", "value", "valueCustomClass", "alignRight"] }, { kind: "component", type: ButtonComponent, selector: "base-button", inputs: ["label", "type", "size", "paddingClassX", "disabled", "loading", "customClass"], outputs: ["onClick"] }, { kind: "component", type: IconCheckCircleComponent, selector: "icon-check-circle", inputs: ["color", "width", "height"] }, { kind: "pipe", type: DatePipe, name: "date" }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
897
1075
  }
898
1076
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: SuccessComponent, decorators: [{
899
1077
  type: Component,
900
- args: [{ selector: 'base-success', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [LabelInfoComponent, ButtonComponent, IconCheckCircleComponent], template: "<div class=\"flex flex-col gap-8 p-16\">\n <div class=\"flex flex-col gap-8\">\n <div class=\"flex flex-col gap-8\">\n <icon-check-circle color=\"#F47A1F\" class=\"mx-auto\"></icon-check-circle>\n <div class=\"flex flex-col text-center\" style=\"gap: 2px\">\n <p class=\"text-heading-text font-medium text-header-2xl\">\u20A62,500.00</p>\n <p class=\"text-sub-copy font-regular text-body-3xs\">Has been paid successfully</p>\n </div>\n </div>\n\n <div class=\"flex flex-col\">\n <div class=\"py-4 border-b border-grey-100\">\n <base-label-info\n type=\"horizontal\"\n label=\"Order ID\"\n value=\"9900009000-8890-8829hd7\"\n ></base-label-info>\n </div>\n <div class=\"py-4\">\n <base-label-info\n type=\"horizontal\"\n label=\"Payment date\"\n value=\"July 24, 2025\"\n ></base-label-info>\n </div>\n </div>\n </div>\n\n <div class=\"mx-auto\" style=\"width: 80%;\">\n <base-button\n label=\"Return to Merchant Website\"\n type=\"secondary\"\n customClass=\"w-full\"\n ></base-button>\n </div>\n</div>\n" }]
901
- }] });
1078
+ args: [{ selector: 'base-success', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, imports: [LabelInfoComponent, ButtonComponent, IconCheckCircleComponent, DatePipe], template: "<div class=\"flex flex-col gap-8 p-16\">\n <div class=\"flex flex-col gap-8\">\n <div class=\"flex flex-col gap-8\">\n <icon-check-circle color=\"#F47A1F\" class=\"mx-auto\"></icon-check-circle>\n <div class=\"flex flex-col text-center\" style=\"gap: 2px\">\n <p class=\"text-heading-text font-medium text-header-2xl\">{{ formatAmountHandler }}</p>\n <p class=\"text-sub-copy font-regular text-body-3xs\">Has been paid successfully</p>\n </div>\n </div>\n\n <div class=\"flex flex-col\">\n <div class=\"py-4 border-b border-grey-100\">\n <base-label-info\n type=\"horizontal\"\n label=\"Order ID\"\n [value]=\"successObject.paymentId\"\n ></base-label-info>\n </div>\n <div class=\"py-4\">\n <base-label-info\n type=\"horizontal\"\n label=\"Payment date\"\n [value]=\"successObject.paymentDate | date\"\n ></base-label-info>\n </div>\n </div>\n </div>\n\n <div class=\"mx-auto\" style=\"width: 80%\">\n <base-button\n label=\"Return to Merchant Website\"\n type=\"secondary\"\n customClass=\"w-full\"\n (onClick)=\"goToRedirectUrl()\"\n ></base-button>\n </div>\n</div>\n" }]
1079
+ }], propDecorators: { successObject: [{
1080
+ type: Input
1081
+ }], amount: [{
1082
+ type: Input
1083
+ }], currency: [{
1084
+ type: Input
1085
+ }], redirectUrl: [{
1086
+ type: Input
1087
+ }] } });
902
1088
 
903
1089
  class BackComponent {
904
1090
  back = new EventEmitter();
@@ -968,6 +1154,10 @@ class CheckoutService {
968
1154
  constructor(http) {
969
1155
  this.http = http;
970
1156
  }
1157
+ billingInformation = {};
1158
+ setBillingInfo(info) {
1159
+ this.billingInformation = { ...info };
1160
+ }
971
1161
  createPaymentLink(payload, environment, secretKey) {
972
1162
  const baseUrl = getBaseUrl(environment);
973
1163
  return this.http.post(`${baseUrl}/api/v1/checkout/generate-payment-link2`, { ...payload, linkName: `${Date.now()}-link` }, {
@@ -976,6 +1166,34 @@ class CheckoutService {
976
1166
  },
977
1167
  });
978
1168
  }
1169
+ generatePaymentAccount(environment, { merchantId, ...rest }) {
1170
+ const baseUrl = getBaseUrl(environment);
1171
+ return this.http.post(`${baseUrl}/api/v1/checkout/generate-payment-account`, rest, {
1172
+ headers: {
1173
+ merchantId,
1174
+ },
1175
+ });
1176
+ }
1177
+ authorizeCardPayment(environment, { merchantId, ...rest }) {
1178
+ const baseUrl = getBaseUrl(environment);
1179
+ return this.http.post(`${baseUrl}/api/v1/checkout/authorize-card-3ds-payment`, rest, {
1180
+ headers: {
1181
+ merchantId,
1182
+ },
1183
+ });
1184
+ }
1185
+ getPaymentReferenceDetails(environment, paymentReference) {
1186
+ const baseUrl = getBaseUrl(environment);
1187
+ return this.http.get(`${baseUrl}/api/v1/checkout/details/${paymentReference}`);
1188
+ }
1189
+ generateStableCoinAddress(environment, { merchantId, ...rest }) {
1190
+ const baseUrl = getBaseUrl(environment);
1191
+ return this.http.post(`${baseUrl}/api/v1/checkout/generate-payment-walletaddress`, rest, {
1192
+ headers: {
1193
+ merchantId,
1194
+ },
1195
+ });
1196
+ }
979
1197
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: CheckoutService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
980
1198
  static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: CheckoutService, providedIn: 'root' });
981
1199
  }
@@ -986,6 +1204,88 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImpor
986
1204
  }]
987
1205
  }], ctorParameters: () => [{ type: i1$1.HttpClient }] });
988
1206
 
1207
+ class ResourceService {
1208
+ http;
1209
+ constructor(http) {
1210
+ this.http = http;
1211
+ }
1212
+ getCountries(environment, secretKey) {
1213
+ const baseUrl = getBaseUrl(environment);
1214
+ return this.http.get(`${baseUrl}/api/v1/countries-iso`, {
1215
+ headers: {
1216
+ merchantId: secretKey,
1217
+ },
1218
+ });
1219
+ }
1220
+ getCountryStates(countryIso3, environment, secretKey) {
1221
+ const baseUrl = getBaseUrl(environment);
1222
+ return this.http.get(`${baseUrl}/api/v1/state-by-country/${countryIso3}`, {
1223
+ headers: {
1224
+ merchantId: secretKey,
1225
+ },
1226
+ });
1227
+ }
1228
+ getStableCoins(environment) {
1229
+ const baseUrl = getBaseUrl(environment);
1230
+ return this.http.get(`${baseUrl}/api/v1/checkout/stable-coin`);
1231
+ }
1232
+ getStableCoinNetworks(environment, stableCoin) {
1233
+ const baseUrl = getBaseUrl(environment);
1234
+ return this.http.get(`${baseUrl}/api/v1/checkout/networks/${stableCoin}`);
1235
+ }
1236
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: ResourceService, deps: [{ token: i1$1.HttpClient }], target: i0.ɵɵFactoryTarget.Injectable });
1237
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: ResourceService, providedIn: 'root' });
1238
+ }
1239
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: ResourceService, decorators: [{
1240
+ type: Injectable,
1241
+ args: [{
1242
+ providedIn: 'root',
1243
+ }]
1244
+ }], ctorParameters: () => [{ type: i1$1.HttpClient }] });
1245
+
1246
+ class EncryptService {
1247
+ constructor() { }
1248
+ encryptPayload(environment, formData = {}) {
1249
+ const baseUrl = getBaseUrl(environment);
1250
+ const key = CryptoJS.enc.Utf8.parse(baseUrl);
1251
+ const iv = CryptoJS.enc.Utf8.parse(baseUrl);
1252
+ const postDataObj = JSON.stringify(formData);
1253
+ const encryptedData = CryptoJS.AES.encrypt(CryptoJS.enc.Utf8.parse(postDataObj), key, {
1254
+ keySize: 128 / 8,
1255
+ iv: iv,
1256
+ mode: CryptoJS.mode.CBC,
1257
+ padding: CryptoJS.pad.Pkcs7,
1258
+ });
1259
+ const payload = encryptedData.toString();
1260
+ const formSending = {
1261
+ requestParam: payload,
1262
+ };
1263
+ return formSending;
1264
+ }
1265
+ decryptPayload(environment, payload) {
1266
+ const baseUrl = getBaseUrl(environment);
1267
+ const key = CryptoJS.enc.Utf8.parse(baseUrl);
1268
+ const iv = CryptoJS.enc.Utf8.parse(baseUrl);
1269
+ const decryptedData = CryptoJS.AES.decrypt(payload, key, {
1270
+ keySize: 128 / 8,
1271
+ iv: iv,
1272
+ mode: CryptoJS.mode.CBC,
1273
+ padding: CryptoJS.pad.Pkcs7,
1274
+ });
1275
+ const decryptedText = decryptedData.toString(CryptoJS.enc.Utf8);
1276
+ const decryptedObj = JSON.parse(decryptedText);
1277
+ return decryptedObj;
1278
+ }
1279
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: EncryptService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
1280
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: EncryptService, providedIn: 'root' });
1281
+ }
1282
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImport: i0, type: EncryptService, decorators: [{
1283
+ type: Injectable,
1284
+ args: [{
1285
+ providedIn: 'root',
1286
+ }]
1287
+ }], ctorParameters: () => [] });
1288
+
989
1289
  /*
990
1290
  * Public API Surface of miden-pg-angular
991
1291
  */
@@ -994,5 +1294,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.2.1", ngImpor
994
1294
  * Generated bundle index. Do not edit.
995
1295
  */
996
1296
 
997
- export { BZP_CONFIG, BZP_CORRELATION_ID, BackComponent, ButtonComponent, CardComponent, CheckoutService, CopyComponent, CurrencyAmountComponent, HintComponent, IconArrowSwapComponent, IconBuzapayIconComponent, IconCheckCircleComponent, IconChevronDownComponent, IconChevronLeftComponent, IconChevronUpComponent, IconCopySuccessComponent, IconLoaderComponent, IconUsdcComponent, IconUsdtComponent, ImageComponent, InputComponent, InputErrorComponent, LabelInfoComponent, MidenPGAngular, RadioGroupComponent, SelectComponent, SuccessComponent, apiBaseUrl, checkObjectTruthy, currencySign, formatAmount, getBaseUrl, provideMidenPG, restrictToNumericKeys, truncateString };
1297
+ export { BZP_CONFIG, BZP_CORRELATION_ID, BackComponent, ButtonComponent, CardComponent, CardSchemes, CheckoutService, CopyComponent, CurrencyAmountComponent, EncryptService, HintComponent, IconArrowSwapComponent, IconBuzapayIconComponent, IconCheckCircleComponent, IconChevronDownComponent, IconChevronLeftComponent, IconChevronUpComponent, IconCopySuccessComponent, IconLoaderComponent, IconUsdcComponent, IconUsdtComponent, ImageComponent, InputComponent, InputErrorComponent, LabelInfoComponent, MidenPGAngular, RadioGroupComponent, ResourceService, SelectComponent, SuccessComponent, apiBaseUrl, cardType, checkObjectTruthy, currencySign, detect, formatAmount, getBaseUrl, getQueryParams, getValidationErrorMessage, provideMidenPG, restrictToNumericKeys, truncateString, urlValidator };
998
1298
  //# sourceMappingURL=miden-npm-angular.mjs.map