@adlfe/campaign-management-library 2.11.3 → 2.11.4

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 (45) hide show
  1. package/adlfe-campaign-management-library.d.ts +6 -4
  2. package/adlfe-campaign-management-library.metadata.json +1 -1
  3. package/bundles/adlfe-campaign-management-library.umd.js +285 -86
  4. package/bundles/adlfe-campaign-management-library.umd.js.map +1 -1
  5. package/bundles/adlfe-campaign-management-library.umd.min.js +1 -1
  6. package/bundles/adlfe-campaign-management-library.umd.min.js.map +1 -1
  7. package/esm2015/adlfe-campaign-management-library.js +7 -5
  8. package/esm2015/lib/campaign-management/campaign-management.module.js +4 -2
  9. package/esm2015/lib/campaign-management/components/input-numeric/input-numeric.component.js +113 -0
  10. package/esm2015/lib/campaign-management/components/input-numeric/input-numeric.module.js +18 -0
  11. package/esm2015/lib/campaign-management/models/general-information-wa-req.model.js +2 -1
  12. package/esm2015/lib/campaign-management/modules/campaign-index/dialog/pending-approval-dialog-view/pending-approval-dialog-view.component.js +40 -38
  13. package/esm2015/lib/campaign-management/modules/new-campaign/components/general-information-wa/general-information-wa.component.js +17 -7
  14. package/esm2015/lib/campaign-management/modules/new-campaign/new-campaign.component.js +41 -39
  15. package/esm2015/lib/campaign-management/validators/index.js +12 -0
  16. package/esm2015/lib/campaign-management/validators/max.validator.js +14 -0
  17. package/esm2015/lib/campaign-management/validators/min.validator.js +14 -0
  18. package/esm2015/lib/campaign-management/validators/required.validator.js +10 -0
  19. package/esm2015/lib/core/const/validation-message.const.js +5 -2
  20. package/esm5/adlfe-campaign-management-library.js +7 -5
  21. package/esm5/lib/campaign-management/campaign-management.module.js +4 -2
  22. package/esm5/lib/campaign-management/components/input-numeric/input-numeric.component.js +127 -0
  23. package/esm5/lib/campaign-management/components/input-numeric/input-numeric.module.js +21 -0
  24. package/esm5/lib/campaign-management/models/general-information-wa-req.model.js +2 -1
  25. package/esm5/lib/campaign-management/modules/campaign-index/dialog/pending-approval-dialog-view/pending-approval-dialog-view.component.js +40 -38
  26. package/esm5/lib/campaign-management/modules/new-campaign/components/general-information-wa/general-information-wa.component.js +17 -7
  27. package/esm5/lib/campaign-management/modules/new-campaign/new-campaign.component.js +41 -39
  28. package/esm5/lib/campaign-management/validators/index.js +12 -0
  29. package/esm5/lib/campaign-management/validators/max.validator.js +14 -0
  30. package/esm5/lib/campaign-management/validators/min.validator.js +14 -0
  31. package/esm5/lib/campaign-management/validators/required.validator.js +10 -0
  32. package/esm5/lib/core/const/validation-message.const.js +5 -2
  33. package/fesm2015/adlfe-campaign-management-library.js +345 -165
  34. package/fesm2015/adlfe-campaign-management-library.js.map +1 -1
  35. package/fesm5/adlfe-campaign-management-library.js +362 -165
  36. package/fesm5/adlfe-campaign-management-library.js.map +1 -1
  37. package/lib/campaign-management/components/input-numeric/input-numeric.component.d.ts +30 -0
  38. package/lib/campaign-management/components/input-numeric/input-numeric.module.d.ts +2 -0
  39. package/lib/campaign-management/models/general-information-wa-req.model.d.ts +1 -0
  40. package/lib/campaign-management/validators/index.d.ts +8 -0
  41. package/lib/campaign-management/validators/max.validator.d.ts +2 -0
  42. package/lib/campaign-management/validators/min.validator.d.ts +2 -0
  43. package/lib/campaign-management/validators/required.validator.d.ts +2 -0
  44. package/package.json +1 -1
  45. package/types.d.ts +0 -1
@@ -1,5 +1,5 @@
1
1
  import { __decorate, __param } from 'tslib';
2
- import { Component, EventEmitter, Output, Input, NgModule, NgZone, Directive, ɵɵdefineInjectable, ɵɵinject, Injectable, Inject, ViewChild } from '@angular/core';
2
+ import { Component, EventEmitter, Output, Input, NgModule, ContentChild, forwardRef, NgZone, Directive, ɵɵdefineInjectable, ɵɵinject, Injectable, Inject, ViewChild } from '@angular/core';
3
3
  import { MapsAPILoader, AgmCoreModule } from '@agm/core';
4
4
  import { CommonModule, DatePipe } from '@angular/common';
5
5
  import { HttpHeaders, HttpClient, HttpParams, HttpClientModule } from '@angular/common/http';
@@ -8,7 +8,7 @@ import { MatPaginatorIntl, MatPaginatorModule } from '@angular/material/paginato
8
8
  import { NgxEchartsModule } from 'ngx-echarts';
9
9
  import { ToastrService, ToastrModule } from 'ngx-toastr';
10
10
  import { moveItemInArray, DragDropModule } from '@angular/cdk/drag-drop';
11
- import { FormControl, FormsModule, ReactiveFormsModule, FormGroup, Validators, FormArray } from '@angular/forms';
11
+ import { FormControl, FormsModule, ReactiveFormsModule, ControlContainer, NG_VALUE_ACCESSOR, FormGroup, Validators as Validators$1, FormArray } from '@angular/forms';
12
12
  import { MatAutocompleteModule } from '@angular/material/autocomplete';
13
13
  import { MatBadgeModule } from '@angular/material/badge';
14
14
  import { MatButtonModule } from '@angular/material/button';
@@ -159,6 +159,125 @@ CampaignManagementComponent = __decorate([
159
159
  })
160
160
  ], CampaignManagementComponent);
161
161
 
162
+ var InputNumericComponent_1;
163
+ let InputNumericComponent = InputNumericComponent_1 = class InputNumericComponent {
164
+ constructor(controlContainer) {
165
+ this.controlContainer = controlContainer;
166
+ this.allowDecimal = true;
167
+ }
168
+ handleInput(event) {
169
+ const inputElement = event.target;
170
+ const value = inputElement.value || '';
171
+ let numeric = this.allowDecimal ? value.replace(/[^0-9.]/g, '') : value.replace(/\D/g, '');
172
+ if (this.allowDecimal) {
173
+ const parts = numeric.split('.');
174
+ if (parts.length > 2) {
175
+ numeric = parts[0] + '.' + parts.slice(1).join('');
176
+ }
177
+ }
178
+ if (this.disallowLeadingZero &&
179
+ numeric.startsWith('0') &&
180
+ numeric.length > 1 &&
181
+ numeric[1] !== '.') {
182
+ numeric = numeric.replace(/^0+/, '');
183
+ }
184
+ let finalValue = numeric;
185
+ if (this.trimLeadingZeros && numeric !== '' && !numeric.includes('.')) {
186
+ finalValue = +numeric;
187
+ }
188
+ this.formControl.patchValue(finalValue, { emitEvent: false });
189
+ }
190
+ ngOnInit() {
191
+ this.setBaseStateInitialization();
192
+ }
193
+ setBaseStateInitialization() {
194
+ if (!this.formControlName)
195
+ return;
196
+ const formGroup = this.controlContainer.control;
197
+ this.formControl = formGroup.get(this.formControlName);
198
+ }
199
+ get isValid() {
200
+ var _a, _b;
201
+ return !!(((_a = this.formControl) === null || _a === void 0 ? void 0 : _a.touched) && ((_b = this.formControl) === null || _b === void 0 ? void 0 : _b.valid));
202
+ }
203
+ get isInvalid() {
204
+ var _a, _b;
205
+ return !!(((_a = this.formControl) === null || _a === void 0 ? void 0 : _a.touched) && ((_b = this.formControl) === null || _b === void 0 ? void 0 : _b.invalid));
206
+ }
207
+ get errors() {
208
+ return this.formControl.errors;
209
+ }
210
+ writeValue(value) {
211
+ this._value = value;
212
+ }
213
+ registerOnChange(fn) {
214
+ this._onBaseChange = fn;
215
+ }
216
+ registerOnTouched(fn) {
217
+ this._onBaseTouched = fn;
218
+ }
219
+ setDisabledState(isDisabled) {
220
+ this._isDisabled = isDisabled;
221
+ }
222
+ };
223
+ InputNumericComponent.ctorParameters = () => [
224
+ { type: ControlContainer }
225
+ ];
226
+ __decorate([
227
+ Input()
228
+ ], InputNumericComponent.prototype, "formControlName", void 0);
229
+ __decorate([
230
+ Input()
231
+ ], InputNumericComponent.prototype, "formControl", void 0);
232
+ __decorate([
233
+ Input()
234
+ ], InputNumericComponent.prototype, "trimLeadingZeros", void 0);
235
+ __decorate([
236
+ Input()
237
+ ], InputNumericComponent.prototype, "disallowLeadingZero", void 0);
238
+ __decorate([
239
+ Input()
240
+ ], InputNumericComponent.prototype, "allowDecimal", void 0);
241
+ __decorate([
242
+ Input()
243
+ ], InputNumericComponent.prototype, "identifier", void 0);
244
+ __decorate([
245
+ Input()
246
+ ], InputNumericComponent.prototype, "placeholder", void 0);
247
+ __decorate([
248
+ Input()
249
+ ], InputNumericComponent.prototype, "label", void 0);
250
+ __decorate([
251
+ Input()
252
+ ], InputNumericComponent.prototype, "maxLength", void 0);
253
+ __decorate([
254
+ ContentChild('suffix')
255
+ ], InputNumericComponent.prototype, "suffixTmpl", void 0);
256
+ InputNumericComponent = InputNumericComponent_1 = __decorate([
257
+ Component({
258
+ selector: 'app-input[type=numeric]',
259
+ template: "<div class=\"grid\">\r\n <mat-form-field class=\"w-full\" appearance=\"outline\" floatLabel=\"always\">\r\n <mat-label *ngIf=\"label\">\r\n <span>{{ label }}</span>\r\n </mat-label>\r\n <input\r\n type=\"text\"\r\n [id]=\"identifier\"\r\n [attr.data-testid]=\"identifier\"\r\n matInput\r\n [placeholder]=\"placeholder\"\r\n [formControl]=\"formControl\"\r\n (input)=\"handleInput($event)\"\r\n [attr.maxlength]=\"maxLength\"\r\n />\r\n <span *ngIf=\"suffixTmpl\" matSuffix>\r\n <ng-container *ngTemplateOutlet=\"suffixTmpl\"></ng-container>\r\n </span>\r\n </mat-form-field>\r\n <mat-error align=\"end\" class=\"leading-zero\" *ngIf=\"isInvalid\">\r\n <small class=\"text-xs\">\r\n {{ errors?.message }}\r\n </small>\r\n </mat-error>\r\n</div>\r\n",
260
+ providers: [
261
+ {
262
+ provide: NG_VALUE_ACCESSOR,
263
+ useExisting: forwardRef(() => InputNumericComponent_1),
264
+ multi: true,
265
+ },
266
+ ],
267
+ styles: [":host ::ng-deep .mat-form-field-appearance-outline .mat-form-field-prefix,:host ::ng-deep .mat-form-field-appearance-outline .mat-form-field-suffix{top:0}"]
268
+ })
269
+ ], InputNumericComponent);
270
+
271
+ let InputNumericModule = class InputNumericModule {
272
+ };
273
+ InputNumericModule = __decorate([
274
+ NgModule({
275
+ imports: [MatFormFieldModule, MatInputModule, ReactiveFormsModule, CommonModule],
276
+ declarations: [InputNumericComponent],
277
+ exports: [InputNumericComponent],
278
+ })
279
+ ], InputNumericModule);
280
+
162
281
  let MatSelectInfiniteScrollDirective = class MatSelectInfiniteScrollDirective {
163
282
  constructor(matSelect, ngZone) {
164
283
  this.matSelect = matSelect;
@@ -1250,7 +1369,10 @@ const GeneralInformationMessageValidationConst = {
1250
1369
  const GeneralInformationWAMessageValidationConst = {
1251
1370
  channel: [{ type: 'required', message: 'Message Type is required' }],
1252
1371
  from: [{ type: 'required', message: 'From is required' }],
1253
- text: [{ type: 'required', message: 'Text is required' }],
1372
+ text: [
1373
+ { type: 'required', message: 'Text is required' },
1374
+ { type: 'maxlength', message: 'Maximum character 1024' },
1375
+ ],
1254
1376
  media: [{ type: 'required', message: 'Media Type is required' }],
1255
1377
  fileName: [{ type: 'required', message: 'File is required' }],
1256
1378
  template: [{ type: 'required', message: 'Template is required' }],
@@ -1622,7 +1744,7 @@ let PendingApprovalDialogViewComponent = class PendingApprovalDialogViewComponen
1622
1744
  const subs = this.apiAdapterService
1623
1745
  .executeApiRequest([], `/campaign/${(_d = (_c = this.getCampaignStorage) === null || _c === void 0 ? void 0 : _c.generalInformation) === null || _d === void 0 ? void 0 : _d.id}`, 'GET')
1624
1746
  .subscribe((resp) => {
1625
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63;
1747
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67;
1626
1748
  if (!resp)
1627
1749
  return;
1628
1750
  const generalInformation = {
@@ -1634,59 +1756,61 @@ let PendingApprovalDialogViewComponent = class PendingApprovalDialogViewComponen
1634
1756
  : (_f = (_e = resp.data) === null || _e === void 0 ? void 0 : _e.type) === null || _f === void 0 ? void 0 : _f.toUpperCase(),
1635
1757
  media: (_h = (_g = resp.data) === null || _g === void 0 ? void 0 : _g.type) === null || _h === void 0 ? void 0 : _h.toUpperCase(),
1636
1758
  isPrevTemplate: (_k = (_j = resp) === null || _j === void 0 ? void 0 : _j.data) === null || _k === void 0 ? void 0 : _k.isPrevTemplate,
1759
+ templateName: (_m = (_l = resp) === null || _l === void 0 ? void 0 : _l.data) === null || _m === void 0 ? void 0 : _m.templateName,
1760
+ ttl: (_p = (_o = resp) === null || _o === void 0 ? void 0 : _o.data) === null || _p === void 0 ? void 0 : _p.ttlSeconds,
1637
1761
  from: {
1638
- id: (_l = resp.data) === null || _l === void 0 ? void 0 : _l.accountId,
1639
- name: (_m = resp.data) === null || _m === void 0 ? void 0 : _m.accountName,
1640
- platform: (_o = resp.data) === null || _o === void 0 ? void 0 : _o.platform,
1641
- clientId: (_p = resp.data) === null || _p === void 0 ? void 0 : _p.clientId,
1642
- clientName: (_q = resp.data) === null || _q === void 0 ? void 0 : _q.clientName,
1643
- accountNo: (_r = resp.data) === null || _r === void 0 ? void 0 : _r.accountNo,
1644
- wabaId: (_t = (_s = resp.data) === null || _s === void 0 ? void 0 : _s.wabaId, (_t !== null && _t !== void 0 ? _t : '')),
1762
+ id: (_q = resp.data) === null || _q === void 0 ? void 0 : _q.accountId,
1763
+ name: (_r = resp.data) === null || _r === void 0 ? void 0 : _r.accountName,
1764
+ platform: (_s = resp.data) === null || _s === void 0 ? void 0 : _s.platform,
1765
+ clientId: (_t = resp.data) === null || _t === void 0 ? void 0 : _t.clientId,
1766
+ clientName: (_u = resp.data) === null || _u === void 0 ? void 0 : _u.clientName,
1767
+ accountNo: (_v = resp.data) === null || _v === void 0 ? void 0 : _v.accountNo,
1768
+ wabaId: (_x = (_w = resp.data) === null || _w === void 0 ? void 0 : _w.wabaId, (_x !== null && _x !== void 0 ? _x : '')),
1645
1769
  },
1646
- text: (_v = (_u = resp.data) === null || _u === void 0 ? void 0 : _u.details) === null || _v === void 0 ? void 0 : _v.text,
1647
- targetURL: (_7 = (_3 = (_z = (_y = (_x = (_w = resp.data) === null || _w === void 0 ? void 0 : _w.details) === null || _x === void 0 ? void 0 : _x.image) === null || _y === void 0 ? void 0 : _y.url, (_z !== null && _z !== void 0 ? _z : (_2 = (_1 = (_0 = resp.data) === null || _0 === void 0 ? void 0 : _0.details) === null || _1 === void 0 ? void 0 : _1.document) === null || _2 === void 0 ? void 0 : _2.url)), (_3 !== null && _3 !== void 0 ? _3 : (_6 = (_5 = (_4 = resp.data) === null || _4 === void 0 ? void 0 : _4.details) === null || _5 === void 0 ? void 0 : _5.video) === null || _6 === void 0 ? void 0 : _6.url)), (_7 !== null && _7 !== void 0 ? _7 : (_10 = (_9 = (_8 = resp.data) === null || _8 === void 0 ? void 0 : _8.details) === null || _9 === void 0 ? void 0 : _9.template) === null || _10 === void 0 ? void 0 : _10.headerURL)),
1648
- paramHeader: (_13 = (_12 = (_11 = resp.data) === null || _11 === void 0 ? void 0 : _11.details) === null || _12 === void 0 ? void 0 : _12.template) === null || _13 === void 0 ? void 0 : _13.header,
1649
- paramBody: (_16 = (_15 = (_14 = resp.data) === null || _14 === void 0 ? void 0 : _14.details) === null || _15 === void 0 ? void 0 : _15.template) === null || _16 === void 0 ? void 0 : _16.data,
1650
- paramButton: (_19 = (_18 = (_17 = resp.data) === null || _17 === void 0 ? void 0 : _17.details) === null || _18 === void 0 ? void 0 : _18.template) === null || _19 === void 0 ? void 0 : _19.button,
1651
- otpValue: (_24 = [...(_23 = (_22 = (_21 = (_20 = resp.data) === null || _20 === void 0 ? void 0 : _20.details) === null || _21 === void 0 ? void 0 : _21.template) === null || _22 === void 0 ? void 0 : _22.data, (_23 !== null && _23 !== void 0 ? _23 : []))]) === null || _24 === void 0 ? void 0 : _24.pop(),
1770
+ text: (_z = (_y = resp.data) === null || _y === void 0 ? void 0 : _y.details) === null || _z === void 0 ? void 0 : _z.text,
1771
+ targetURL: (_11 = (_7 = (_3 = (_2 = (_1 = (_0 = resp.data) === null || _0 === void 0 ? void 0 : _0.details) === null || _1 === void 0 ? void 0 : _1.image) === null || _2 === void 0 ? void 0 : _2.url, (_3 !== null && _3 !== void 0 ? _3 : (_6 = (_5 = (_4 = resp.data) === null || _4 === void 0 ? void 0 : _4.details) === null || _5 === void 0 ? void 0 : _5.document) === null || _6 === void 0 ? void 0 : _6.url)), (_7 !== null && _7 !== void 0 ? _7 : (_10 = (_9 = (_8 = resp.data) === null || _8 === void 0 ? void 0 : _8.details) === null || _9 === void 0 ? void 0 : _9.video) === null || _10 === void 0 ? void 0 : _10.url)), (_11 !== null && _11 !== void 0 ? _11 : (_14 = (_13 = (_12 = resp.data) === null || _12 === void 0 ? void 0 : _12.details) === null || _13 === void 0 ? void 0 : _13.template) === null || _14 === void 0 ? void 0 : _14.headerURL)),
1772
+ paramHeader: (_17 = (_16 = (_15 = resp.data) === null || _15 === void 0 ? void 0 : _15.details) === null || _16 === void 0 ? void 0 : _16.template) === null || _17 === void 0 ? void 0 : _17.header,
1773
+ paramBody: (_20 = (_19 = (_18 = resp.data) === null || _18 === void 0 ? void 0 : _18.details) === null || _19 === void 0 ? void 0 : _19.template) === null || _20 === void 0 ? void 0 : _20.data,
1774
+ paramButton: (_23 = (_22 = (_21 = resp.data) === null || _21 === void 0 ? void 0 : _21.details) === null || _22 === void 0 ? void 0 : _22.template) === null || _23 === void 0 ? void 0 : _23.button,
1775
+ otpValue: (_28 = [...(_27 = (_26 = (_25 = (_24 = resp.data) === null || _24 === void 0 ? void 0 : _24.details) === null || _25 === void 0 ? void 0 : _25.template) === null || _26 === void 0 ? void 0 : _26.data, (_27 !== null && _27 !== void 0 ? _27 : []))]) === null || _28 === void 0 ? void 0 : _28.pop(),
1652
1776
  template: {
1653
- ID: (_27 = (_26 = (_25 = resp.data) === null || _25 === void 0 ? void 0 : _25.details) === null || _26 === void 0 ? void 0 : _26.template) === null || _27 === void 0 ? void 0 : _27.id,
1654
- name: (_30 = (_29 = (_28 = resp.data) === null || _28 === void 0 ? void 0 : _28.details) === null || _29 === void 0 ? void 0 : _29.template) === null || _30 === void 0 ? void 0 : _30.name,
1655
- lang: (_33 = (_32 = (_31 = resp.data) === null || _31 === void 0 ? void 0 : _31.details) === null || _32 === void 0 ? void 0 : _32.template) === null || _33 === void 0 ? void 0 : _33.lang,
1656
- platform: (_34 = resp.data) === null || _34 === void 0 ? void 0 : _34.platform,
1657
- headerURL: (_37 = (_36 = (_35 = resp.data) === null || _35 === void 0 ? void 0 : _35.details) === null || _36 === void 0 ? void 0 : _36.template) === null || _37 === void 0 ? void 0 : _37.headerURL,
1777
+ ID: (_31 = (_30 = (_29 = resp.data) === null || _29 === void 0 ? void 0 : _29.details) === null || _30 === void 0 ? void 0 : _30.template) === null || _31 === void 0 ? void 0 : _31.id,
1778
+ name: (_34 = (_33 = (_32 = resp.data) === null || _32 === void 0 ? void 0 : _32.details) === null || _33 === void 0 ? void 0 : _33.template) === null || _34 === void 0 ? void 0 : _34.name,
1779
+ lang: (_37 = (_36 = (_35 = resp.data) === null || _35 === void 0 ? void 0 : _35.details) === null || _36 === void 0 ? void 0 : _36.template) === null || _37 === void 0 ? void 0 : _37.lang,
1780
+ platform: (_38 = resp.data) === null || _38 === void 0 ? void 0 : _38.platform,
1781
+ headerURL: (_41 = (_40 = (_39 = resp.data) === null || _39 === void 0 ? void 0 : _39.details) === null || _40 === void 0 ? void 0 : _40.template) === null || _41 === void 0 ? void 0 : _41.headerURL,
1658
1782
  header: {
1659
- examples: (_40 = (_39 = (_38 = resp.data) === null || _38 === void 0 ? void 0 : _38.details) === null || _39 === void 0 ? void 0 : _39.template) === null || _40 === void 0 ? void 0 : _40.header,
1783
+ examples: (_44 = (_43 = (_42 = resp.data) === null || _42 === void 0 ? void 0 : _42.details) === null || _43 === void 0 ? void 0 : _43.template) === null || _44 === void 0 ? void 0 : _44.header,
1660
1784
  },
1661
1785
  body: {
1662
- examples: (_43 = (_42 = (_41 = resp.data) === null || _41 === void 0 ? void 0 : _41.details) === null || _42 === void 0 ? void 0 : _42.template) === null || _43 === void 0 ? void 0 : _43.data,
1786
+ examples: (_47 = (_46 = (_45 = resp.data) === null || _45 === void 0 ? void 0 : _45.details) === null || _46 === void 0 ? void 0 : _46.template) === null || _47 === void 0 ? void 0 : _47.data,
1663
1787
  },
1664
- buttons: (_46 = (_45 = (_44 = resp.data) === null || _44 === void 0 ? void 0 : _44.details) === null || _45 === void 0 ? void 0 : _45.template) === null || _46 === void 0 ? void 0 : _46.button,
1665
- ClientId: (_47 = resp.data) === null || _47 === void 0 ? void 0 : _47.clientId,
1666
- ClientName: (_48 = resp.data) === null || _48 === void 0 ? void 0 : _48.clientName,
1788
+ buttons: (_50 = (_49 = (_48 = resp.data) === null || _48 === void 0 ? void 0 : _48.details) === null || _49 === void 0 ? void 0 : _49.template) === null || _50 === void 0 ? void 0 : _50.button,
1789
+ ClientId: (_51 = resp.data) === null || _51 === void 0 ? void 0 : _51.clientId,
1790
+ ClientName: (_52 = resp.data) === null || _52 === void 0 ? void 0 : _52.clientName,
1667
1791
  },
1668
- isUpload: ((_49 = resp.data) === null || _49 === void 0 ? void 0 : _49.fileId) !== '',
1669
- fileId: (_50 = resp.data) === null || _50 === void 0 ? void 0 : _50.fileId,
1792
+ isUpload: ((_53 = resp.data) === null || _53 === void 0 ? void 0 : _53.fileId) !== '',
1793
+ fileId: (_54 = resp.data) === null || _54 === void 0 ? void 0 : _54.fileId,
1670
1794
  };
1671
1795
  localStorage.setItem('telin.campaign', JSON.stringify(Object.assign(Object.assign({}, this.getCampaignStorage), {
1672
1796
  generalInformation: {
1673
- id: (_51 = resp.data) === null || _51 === void 0 ? void 0 : _51.id,
1797
+ id: (_55 = resp.data) === null || _55 === void 0 ? void 0 : _55.id,
1674
1798
  form: generalInformation,
1675
1799
  },
1676
- failover: (_52 = resp.data) === null || _52 === void 0 ? void 0 : _52.failover,
1677
- targetAudience: (_53 = resp.data) === null || _53 === void 0 ? void 0 : _53.targets,
1800
+ failover: (_56 = resp.data) === null || _56 === void 0 ? void 0 : _56.failover,
1801
+ targetAudience: (_57 = resp.data) === null || _57 === void 0 ? void 0 : _57.targets,
1678
1802
  targetAudienceFile: {
1679
- name: (_54 = resp.data) === null || _54 === void 0 ? void 0 : _54.fileName,
1680
- targetURL: (_55 = resp.data) === null || _55 === void 0 ? void 0 : _55.targetURL,
1803
+ name: (_58 = resp.data) === null || _58 === void 0 ? void 0 : _58.fileName,
1804
+ targetURL: (_59 = resp.data) === null || _59 === void 0 ? void 0 : _59.targetURL,
1681
1805
  },
1682
1806
  scheduler: {
1683
- schedulerType: ((_56 = resp.data) === null || _56 === void 0 ? void 0 : _56.scheduleType) === 'MULTI'
1807
+ schedulerType: ((_60 = resp.data) === null || _60 === void 0 ? void 0 : _60.scheduleType) === 'MULTI'
1684
1808
  ? 'ONE_TIME'
1685
- : (_57 = resp.data) === null || _57 === void 0 ? void 0 : _57.scheduleType,
1686
- startDate: (_59 = (_58 = resp.data) === null || _58 === void 0 ? void 0 : _58.startTime) === null || _59 === void 0 ? void 0 : _59.split(' ')[0],
1687
- startTime: (_61 = (_60 = resp.data) === null || _60 === void 0 ? void 0 : _60.startTime) === null || _61 === void 0 ? void 0 : _61.split(' ')[1],
1688
- isRepeat: ((_62 = resp.data) === null || _62 === void 0 ? void 0 : _62.scheduleType) === 'MULTI',
1689
- delivery: (_63 = resp.data) === null || _63 === void 0 ? void 0 : _63.repeat,
1809
+ : (_61 = resp.data) === null || _61 === void 0 ? void 0 : _61.scheduleType,
1810
+ startDate: (_63 = (_62 = resp.data) === null || _62 === void 0 ? void 0 : _62.startTime) === null || _63 === void 0 ? void 0 : _63.split(' ')[0],
1811
+ startTime: (_65 = (_64 = resp.data) === null || _64 === void 0 ? void 0 : _64.startTime) === null || _65 === void 0 ? void 0 : _65.split(' ')[1],
1812
+ isRepeat: ((_66 = resp.data) === null || _66 === void 0 ? void 0 : _66.scheduleType) === 'MULTI',
1813
+ delivery: (_67 = resp.data) === null || _67 === void 0 ? void 0 : _67.repeat,
1690
1814
  },
1691
1815
  })));
1692
1816
  this.isLoading = false;
@@ -2322,6 +2446,7 @@ class GeneralInformationWAReqModel {
2322
2446
  this.category = 'utility';
2323
2447
  this.template = ((_l = source) === null || _l === void 0 ? void 0 : _l.isUseExistingTemplate) ? (_m = source) === null || _m === void 0 ? void 0 : _m.template : { name: '', lang: 'id', header: null, button: null, data: [] };
2324
2448
  this.isNeedSave = source.isNeedSave;
2449
+ this.ttlSeconds = source.ttl;
2325
2450
  if ((_o = source) === null || _o === void 0 ? void 0 : _o.isUseExistingTemplate) {
2326
2451
  this.text = (_r = (_q = (_p = source) === null || _p === void 0 ? void 0 : _p.template) === null || _q === void 0 ? void 0 : _q.body) === null || _r === void 0 ? void 0 : _r.text;
2327
2452
  }
@@ -2447,7 +2572,7 @@ let NewCampaignComponent = class NewCampaignComponent {
2447
2572
  const subs = this.apiAdapterService
2448
2573
  .executeApiRequest([], `/campaign/${this.campaignID}`, 'GET')
2449
2574
  .subscribe((resp) => {
2450
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64;
2575
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, _17, _18, _19, _20, _21, _22, _23, _24, _25, _26, _27, _28, _29, _30, _31, _32, _33, _34, _35, _36, _37, _38, _39, _40, _41, _42, _43, _44, _45, _46, _47, _48, _49, _50, _51, _52, _53, _54, _55, _56, _57, _58, _59, _60, _61, _62, _63, _64, _65, _66, _67, _68;
2451
2576
  if (!resp)
2452
2577
  return;
2453
2578
  const generalInformation = {
@@ -2459,62 +2584,64 @@ let NewCampaignComponent = class NewCampaignComponent {
2459
2584
  : (_f = (_e = resp.data) === null || _e === void 0 ? void 0 : _e.type) === null || _f === void 0 ? void 0 : _f.toUpperCase(),
2460
2585
  media: (_h = (_g = resp.data) === null || _g === void 0 ? void 0 : _g.type) === null || _h === void 0 ? void 0 : _h.toUpperCase(),
2461
2586
  isPrevTemplate: (_k = (_j = resp) === null || _j === void 0 ? void 0 : _j.data) === null || _k === void 0 ? void 0 : _k.isPrevTemplate,
2587
+ templateName: (_m = (_l = resp) === null || _l === void 0 ? void 0 : _l.data) === null || _m === void 0 ? void 0 : _m.templateName,
2588
+ ttl: (_p = (_o = resp) === null || _o === void 0 ? void 0 : _o.data) === null || _p === void 0 ? void 0 : _p.ttlSeconds,
2462
2589
  from: {
2463
- id: (_l = resp.data) === null || _l === void 0 ? void 0 : _l.accountId,
2464
- name: (_m = resp.data) === null || _m === void 0 ? void 0 : _m.accountName,
2465
- platform: (_o = resp.data) === null || _o === void 0 ? void 0 : _o.platform,
2466
- clientId: (_p = resp.data) === null || _p === void 0 ? void 0 : _p.clientId,
2467
- clientName: (_q = resp.data) === null || _q === void 0 ? void 0 : _q.clientName,
2468
- accountNo: (_r = resp.data) === null || _r === void 0 ? void 0 : _r.accountNo,
2469
- wabaId: (_t = (_s = resp.data) === null || _s === void 0 ? void 0 : _s.wabaId, (_t !== null && _t !== void 0 ? _t : '')),
2590
+ id: (_q = resp.data) === null || _q === void 0 ? void 0 : _q.accountId,
2591
+ name: (_r = resp.data) === null || _r === void 0 ? void 0 : _r.accountName,
2592
+ platform: (_s = resp.data) === null || _s === void 0 ? void 0 : _s.platform,
2593
+ clientId: (_t = resp.data) === null || _t === void 0 ? void 0 : _t.clientId,
2594
+ clientName: (_u = resp.data) === null || _u === void 0 ? void 0 : _u.clientName,
2595
+ accountNo: (_v = resp.data) === null || _v === void 0 ? void 0 : _v.accountNo,
2596
+ wabaId: (_x = (_w = resp.data) === null || _w === void 0 ? void 0 : _w.wabaId, (_x !== null && _x !== void 0 ? _x : '')),
2470
2597
  },
2471
- text: (_v = (_u = resp.data) === null || _u === void 0 ? void 0 : _u.details) === null || _v === void 0 ? void 0 : _v.text,
2472
- targetURL: (_7 = (_3 = (_z = (_y = (_x = (_w = resp.data) === null || _w === void 0 ? void 0 : _w.details) === null || _x === void 0 ? void 0 : _x.image) === null || _y === void 0 ? void 0 : _y.url, (_z !== null && _z !== void 0 ? _z : (_2 = (_1 = (_0 = resp.data) === null || _0 === void 0 ? void 0 : _0.details) === null || _1 === void 0 ? void 0 : _1.document) === null || _2 === void 0 ? void 0 : _2.url)), (_3 !== null && _3 !== void 0 ? _3 : (_6 = (_5 = (_4 = resp.data) === null || _4 === void 0 ? void 0 : _4.details) === null || _5 === void 0 ? void 0 : _5.video) === null || _6 === void 0 ? void 0 : _6.url)), (_7 !== null && _7 !== void 0 ? _7 : (_10 = (_9 = (_8 = resp.data) === null || _8 === void 0 ? void 0 : _8.details) === null || _9 === void 0 ? void 0 : _9.template) === null || _10 === void 0 ? void 0 : _10.headerURL)),
2473
- paramHeader: (_13 = (_12 = (_11 = resp.data) === null || _11 === void 0 ? void 0 : _11.details) === null || _12 === void 0 ? void 0 : _12.template) === null || _13 === void 0 ? void 0 : _13.header,
2474
- paramBody: (_16 = (_15 = (_14 = resp.data) === null || _14 === void 0 ? void 0 : _14.details) === null || _15 === void 0 ? void 0 : _15.template) === null || _16 === void 0 ? void 0 : _16.data,
2475
- paramButton: (_19 = (_18 = (_17 = resp.data) === null || _17 === void 0 ? void 0 : _17.details) === null || _18 === void 0 ? void 0 : _18.template) === null || _19 === void 0 ? void 0 : _19.button,
2476
- otpValue: (_24 = [...(_23 = (_22 = (_21 = (_20 = resp.data) === null || _20 === void 0 ? void 0 : _20.details) === null || _21 === void 0 ? void 0 : _21.template) === null || _22 === void 0 ? void 0 : _22.data, (_23 !== null && _23 !== void 0 ? _23 : []))]) === null || _24 === void 0 ? void 0 : _24.pop(),
2598
+ text: (_z = (_y = resp.data) === null || _y === void 0 ? void 0 : _y.details) === null || _z === void 0 ? void 0 : _z.text,
2599
+ targetURL: (_11 = (_7 = (_3 = (_2 = (_1 = (_0 = resp.data) === null || _0 === void 0 ? void 0 : _0.details) === null || _1 === void 0 ? void 0 : _1.image) === null || _2 === void 0 ? void 0 : _2.url, (_3 !== null && _3 !== void 0 ? _3 : (_6 = (_5 = (_4 = resp.data) === null || _4 === void 0 ? void 0 : _4.details) === null || _5 === void 0 ? void 0 : _5.document) === null || _6 === void 0 ? void 0 : _6.url)), (_7 !== null && _7 !== void 0 ? _7 : (_10 = (_9 = (_8 = resp.data) === null || _8 === void 0 ? void 0 : _8.details) === null || _9 === void 0 ? void 0 : _9.video) === null || _10 === void 0 ? void 0 : _10.url)), (_11 !== null && _11 !== void 0 ? _11 : (_14 = (_13 = (_12 = resp.data) === null || _12 === void 0 ? void 0 : _12.details) === null || _13 === void 0 ? void 0 : _13.template) === null || _14 === void 0 ? void 0 : _14.headerURL)),
2600
+ paramHeader: (_17 = (_16 = (_15 = resp.data) === null || _15 === void 0 ? void 0 : _15.details) === null || _16 === void 0 ? void 0 : _16.template) === null || _17 === void 0 ? void 0 : _17.header,
2601
+ paramBody: (_20 = (_19 = (_18 = resp.data) === null || _18 === void 0 ? void 0 : _18.details) === null || _19 === void 0 ? void 0 : _19.template) === null || _20 === void 0 ? void 0 : _20.data,
2602
+ paramButton: (_23 = (_22 = (_21 = resp.data) === null || _21 === void 0 ? void 0 : _21.details) === null || _22 === void 0 ? void 0 : _22.template) === null || _23 === void 0 ? void 0 : _23.button,
2603
+ otpValue: (_28 = [...(_27 = (_26 = (_25 = (_24 = resp.data) === null || _24 === void 0 ? void 0 : _24.details) === null || _25 === void 0 ? void 0 : _25.template) === null || _26 === void 0 ? void 0 : _26.data, (_27 !== null && _27 !== void 0 ? _27 : []))]) === null || _28 === void 0 ? void 0 : _28.pop(),
2477
2604
  template: {
2478
- ID: (_27 = (_26 = (_25 = resp.data) === null || _25 === void 0 ? void 0 : _25.details) === null || _26 === void 0 ? void 0 : _26.template) === null || _27 === void 0 ? void 0 : _27.id,
2479
- name: (_30 = (_29 = (_28 = resp.data) === null || _28 === void 0 ? void 0 : _28.details) === null || _29 === void 0 ? void 0 : _29.template) === null || _30 === void 0 ? void 0 : _30.name,
2480
- lang: (_33 = (_32 = (_31 = resp.data) === null || _31 === void 0 ? void 0 : _31.details) === null || _32 === void 0 ? void 0 : _32.template) === null || _33 === void 0 ? void 0 : _33.lang,
2481
- platform: (_34 = resp.data) === null || _34 === void 0 ? void 0 : _34.platform,
2482
- headerURL: (_37 = (_36 = (_35 = resp.data) === null || _35 === void 0 ? void 0 : _35.details) === null || _36 === void 0 ? void 0 : _36.template) === null || _37 === void 0 ? void 0 : _37.headerURL,
2605
+ ID: (_31 = (_30 = (_29 = resp.data) === null || _29 === void 0 ? void 0 : _29.details) === null || _30 === void 0 ? void 0 : _30.template) === null || _31 === void 0 ? void 0 : _31.id,
2606
+ name: (_34 = (_33 = (_32 = resp.data) === null || _32 === void 0 ? void 0 : _32.details) === null || _33 === void 0 ? void 0 : _33.template) === null || _34 === void 0 ? void 0 : _34.name,
2607
+ lang: (_37 = (_36 = (_35 = resp.data) === null || _35 === void 0 ? void 0 : _35.details) === null || _36 === void 0 ? void 0 : _36.template) === null || _37 === void 0 ? void 0 : _37.lang,
2608
+ platform: (_38 = resp.data) === null || _38 === void 0 ? void 0 : _38.platform,
2609
+ headerURL: (_41 = (_40 = (_39 = resp.data) === null || _39 === void 0 ? void 0 : _39.details) === null || _40 === void 0 ? void 0 : _40.template) === null || _41 === void 0 ? void 0 : _41.headerURL,
2483
2610
  header: {
2484
- examples: (_40 = (_39 = (_38 = resp.data) === null || _38 === void 0 ? void 0 : _38.details) === null || _39 === void 0 ? void 0 : _39.template) === null || _40 === void 0 ? void 0 : _40.header,
2611
+ examples: (_44 = (_43 = (_42 = resp.data) === null || _42 === void 0 ? void 0 : _42.details) === null || _43 === void 0 ? void 0 : _43.template) === null || _44 === void 0 ? void 0 : _44.header,
2485
2612
  },
2486
2613
  body: {
2487
- examples: (_43 = (_42 = (_41 = resp.data) === null || _41 === void 0 ? void 0 : _41.details) === null || _42 === void 0 ? void 0 : _42.template) === null || _43 === void 0 ? void 0 : _43.data,
2614
+ examples: (_47 = (_46 = (_45 = resp.data) === null || _45 === void 0 ? void 0 : _45.details) === null || _46 === void 0 ? void 0 : _46.template) === null || _47 === void 0 ? void 0 : _47.data,
2488
2615
  },
2489
- buttons: (_46 = (_45 = (_44 = resp.data) === null || _44 === void 0 ? void 0 : _44.details) === null || _45 === void 0 ? void 0 : _45.template) === null || _46 === void 0 ? void 0 : _46.button,
2490
- ClientId: (_47 = resp.data) === null || _47 === void 0 ? void 0 : _47.clientId,
2491
- ClientName: (_48 = resp.data) === null || _48 === void 0 ? void 0 : _48.clientName,
2616
+ buttons: (_50 = (_49 = (_48 = resp.data) === null || _48 === void 0 ? void 0 : _48.details) === null || _49 === void 0 ? void 0 : _49.template) === null || _50 === void 0 ? void 0 : _50.button,
2617
+ ClientId: (_51 = resp.data) === null || _51 === void 0 ? void 0 : _51.clientId,
2618
+ ClientName: (_52 = resp.data) === null || _52 === void 0 ? void 0 : _52.clientName,
2492
2619
  },
2493
- isUpload: ((_49 = resp.data) === null || _49 === void 0 ? void 0 : _49.fileId) !== '',
2494
- fileId: (_50 = resp.data) === null || _50 === void 0 ? void 0 : _50.fileId,
2620
+ isUpload: ((_53 = resp.data) === null || _53 === void 0 ? void 0 : _53.fileId) !== '',
2621
+ fileId: (_54 = resp.data) === null || _54 === void 0 ? void 0 : _54.fileId,
2495
2622
  };
2496
2623
  localStorage.setItem('telin.campaign', JSON.stringify(Object.assign(Object.assign({}, this.getCampaignStorage), {
2497
2624
  generalInformation: {
2498
- id: (_51 = resp.data) === null || _51 === void 0 ? void 0 : _51.id,
2625
+ id: (_55 = resp.data) === null || _55 === void 0 ? void 0 : _55.id,
2499
2626
  form: generalInformation,
2500
2627
  },
2501
- failover: (_52 = resp.data) === null || _52 === void 0 ? void 0 : _52.failover,
2502
- targetAudience: (_53 = resp.data) === null || _53 === void 0 ? void 0 : _53.targets,
2628
+ failover: (_56 = resp.data) === null || _56 === void 0 ? void 0 : _56.failover,
2629
+ targetAudience: (_57 = resp.data) === null || _57 === void 0 ? void 0 : _57.targets,
2503
2630
  targetAudienceFile: {
2504
- name: (_54 = resp.data) === null || _54 === void 0 ? void 0 : _54.fileName,
2505
- targetURL: (_55 = resp.data) === null || _55 === void 0 ? void 0 : _55.targetURL,
2631
+ name: (_58 = resp.data) === null || _58 === void 0 ? void 0 : _58.fileName,
2632
+ targetURL: (_59 = resp.data) === null || _59 === void 0 ? void 0 : _59.targetURL,
2506
2633
  },
2507
2634
  scheduler: {
2508
- schedulerType: ((_56 = resp.data) === null || _56 === void 0 ? void 0 : _56.scheduleType) === 'MULTI'
2635
+ schedulerType: ((_60 = resp.data) === null || _60 === void 0 ? void 0 : _60.scheduleType) === 'MULTI'
2509
2636
  ? 'ONE_TIME'
2510
- : (_57 = resp.data) === null || _57 === void 0 ? void 0 : _57.scheduleType,
2511
- startDate: (_59 = (_58 = resp.data) === null || _58 === void 0 ? void 0 : _58.startTime) === null || _59 === void 0 ? void 0 : _59.split(' ')[0],
2512
- startTime: (_61 = (_60 = resp.data) === null || _60 === void 0 ? void 0 : _60.startTime) === null || _61 === void 0 ? void 0 : _61.split(' ')[1],
2513
- isRepeat: ((_62 = resp.data) === null || _62 === void 0 ? void 0 : _62.scheduleType) === 'MULTI',
2514
- delivery: (_63 = resp.data) === null || _63 === void 0 ? void 0 : _63.repeat,
2637
+ : (_61 = resp.data) === null || _61 === void 0 ? void 0 : _61.scheduleType,
2638
+ startDate: (_63 = (_62 = resp.data) === null || _62 === void 0 ? void 0 : _62.startTime) === null || _63 === void 0 ? void 0 : _63.split(' ')[0],
2639
+ startTime: (_65 = (_64 = resp.data) === null || _64 === void 0 ? void 0 : _64.startTime) === null || _65 === void 0 ? void 0 : _65.split(' ')[1],
2640
+ isRepeat: ((_66 = resp.data) === null || _66 === void 0 ? void 0 : _66.scheduleType) === 'MULTI',
2641
+ delivery: (_67 = resp.data) === null || _67 === void 0 ? void 0 : _67.repeat,
2515
2642
  },
2516
2643
  })));
2517
- this.isLine = ((_64 = resp.data) === null || _64 === void 0 ? void 0 : _64.platform) === 'LINE';
2644
+ this.isLine = ((_68 = resp.data) === null || _68 === void 0 ? void 0 : _68.platform) === 'LINE';
2518
2645
  this.isLoading = false;
2519
2646
  this.initWizard();
2520
2647
  }, () => {
@@ -2836,11 +2963,11 @@ let GeneralInformationEmailComponent = class GeneralInformationEmailComponent {
2836
2963
  }
2837
2964
  initForm() {
2838
2965
  this.form = new FormGroup({
2839
- channel: new FormControl(null, Validators.required),
2840
- from: new FormControl(null, Validators.required),
2841
- text: new FormControl(null, Validators.required),
2842
- template: new FormControl(null, Validators.required),
2843
- paramBody: new FormArray([], Validators.required),
2966
+ channel: new FormControl(null, Validators$1.required),
2967
+ from: new FormControl(null, Validators$1.required),
2968
+ text: new FormControl(null, Validators$1.required),
2969
+ template: new FormControl(null, Validators$1.required),
2970
+ paramBody: new FormArray([], Validators$1.required),
2844
2971
  isUpload: new FormControl(false),
2845
2972
  fileId: new FormControl(''),
2846
2973
  });
@@ -2893,16 +3020,16 @@ let GeneralInformationEmailComponent = class GeneralInformationEmailComponent {
2893
3020
  this.form.controls[key].clearValidators();
2894
3021
  this.form.controls[key].updateValueAndValidity();
2895
3022
  }
2896
- this.form.get('channel').setValidators(Validators.required);
2897
- this.form.get('from').setValidators(Validators.required);
3023
+ this.form.get('channel').setValidators(Validators$1.required);
3024
+ this.form.get('from').setValidators(Validators$1.required);
2898
3025
  if (this.getIsTemplate) {
2899
- this.form.get('template').setValidators(Validators.required);
3026
+ this.form.get('template').setValidators(Validators$1.required);
2900
3027
  this.form.get('template').updateValueAndValidity();
2901
- this.form.get('paramBody').setValidators(Validators.required);
3028
+ this.form.get('paramBody').setValidators(Validators$1.required);
2902
3029
  this.form.get('paramBody').updateValueAndValidity();
2903
3030
  }
2904
3031
  else {
2905
- this.form.get('text').setValidators(Validators.required);
3032
+ this.form.get('text').setValidators(Validators$1.required);
2906
3033
  this.form.get('text').updateValueAndValidity();
2907
3034
  }
2908
3035
  }
@@ -2981,7 +3108,7 @@ let GeneralInformationEmailComponent = class GeneralInformationEmailComponent {
2981
3108
  value: value,
2982
3109
  disabled: this.isReadOnlyMode ||
2983
3110
  ['UnsubscribeAccount'].includes(value),
2984
- }, Validators.required),
3111
+ }, Validators$1.required),
2985
3112
  });
2986
3113
  return form;
2987
3114
  }
@@ -3021,7 +3148,7 @@ let GeneralInformationEmailComponent = class GeneralInformationEmailComponent {
3021
3148
  return;
3022
3149
  this.isHaveTemplateParam = ((_a = template.body.examples) === null || _a === void 0 ? void 0 : _a.length) > 0;
3023
3150
  ((_b = template.body.examples) === null || _b === void 0 ? void 0 : _b.length) > 0
3024
- ? this.form.get('paramBody').setValidators(Validators.required)
3151
+ ? this.form.get('paramBody').setValidators(Validators$1.required)
3025
3152
  : this.form.get('paramBody').clearValidators();
3026
3153
  this.form.get('paramBody').controls = [];
3027
3154
  this.form.get('paramBody').reset();
@@ -3119,12 +3246,12 @@ let GeneralInformationLineComponent = class GeneralInformationLineComponent {
3119
3246
  }
3120
3247
  initForm() {
3121
3248
  this.form = new FormGroup({
3122
- channel: new FormControl(null, Validators.required),
3123
- from: new FormControl(null, Validators.required),
3249
+ channel: new FormControl(null, Validators$1.required),
3250
+ from: new FormControl(null, Validators$1.required),
3124
3251
  text: new FormControl(null),
3125
3252
  template: new FormControl(null),
3126
3253
  isJSON: new FormControl(false),
3127
- paramBody: new FormArray([], Validators.required),
3254
+ paramBody: new FormArray([], Validators$1.required),
3128
3255
  });
3129
3256
  this.form.valueChanges.subscribe(() => {
3130
3257
  setTimeout(() => {
@@ -3162,16 +3289,16 @@ let GeneralInformationLineComponent = class GeneralInformationLineComponent {
3162
3289
  this.form.controls[key].clearValidators();
3163
3290
  this.form.controls[key].updateValueAndValidity();
3164
3291
  }
3165
- this.form.get('channel').setValidators(Validators.required);
3166
- this.form.get('from').setValidators(Validators.required);
3292
+ this.form.get('channel').setValidators(Validators$1.required);
3293
+ this.form.get('from').setValidators(Validators$1.required);
3167
3294
  if (this.isText) {
3168
- this.form.get('text').setValidators(Validators.required);
3295
+ this.form.get('text').setValidators(Validators$1.required);
3169
3296
  this.form.get('text').updateValueAndValidity();
3170
3297
  return;
3171
3298
  }
3172
- this.form.get('template').setValidators(Validators.required);
3299
+ this.form.get('template').setValidators(Validators$1.required);
3173
3300
  this.form.get('template').updateValueAndValidity();
3174
- this.form.get('paramBody').setValidators(Validators.required);
3301
+ this.form.get('paramBody').setValidators(Validators$1.required);
3175
3302
  this.form.get('paramBody').updateValueAndValidity();
3176
3303
  }
3177
3304
  formReset() {
@@ -3242,7 +3369,7 @@ let GeneralInformationLineComponent = class GeneralInformationLineComponent {
3242
3369
  }
3243
3370
  initParameter(value = '') {
3244
3371
  const form = new FormGroup({
3245
- name: new FormControl({ value: value, disabled: this.isReadOnlyMode }, Validators.required),
3372
+ name: new FormControl({ value: value, disabled: this.isReadOnlyMode }, Validators$1.required),
3246
3373
  });
3247
3374
  return form;
3248
3375
  }
@@ -3300,7 +3427,7 @@ let GeneralInformationLineComponent = class GeneralInformationLineComponent {
3300
3427
  const findBrackets = (_a = bodyText) === null || _a === void 0 ? void 0 : _a.match(/{{/g);
3301
3428
  const formStorage = (_c = (_b = this.getCampaignStorage) === null || _b === void 0 ? void 0 : _b.generalInformation) === null || _c === void 0 ? void 0 : _c.form;
3302
3429
  ((_d = findBrackets) === null || _d === void 0 ? void 0 : _d.length) > 0
3303
- ? this.form.get('paramBody').setValidators(Validators.required)
3430
+ ? this.form.get('paramBody').setValidators(Validators$1.required)
3304
3431
  : this.form.get('paramBody').clearValidators();
3305
3432
  (_e = findBrackets) === null || _e === void 0 ? void 0 : _e.forEach((_, index) => {
3306
3433
  var _a, _b, _c, _d, _e, _f, _g;
@@ -3391,11 +3518,11 @@ let GeneralInformationSMSComponent = class GeneralInformationSMSComponent {
3391
3518
  }
3392
3519
  initForm() {
3393
3520
  this.form = new FormGroup({
3394
- channel: new FormControl(null, Validators.required),
3395
- from: new FormControl(null, Validators.required),
3396
- text: new FormControl(null, Validators.required),
3397
- template: new FormControl(null, Validators.required),
3398
- paramBody: new FormArray([], Validators.required),
3521
+ channel: new FormControl(null, Validators$1.required),
3522
+ from: new FormControl(null, Validators$1.required),
3523
+ text: new FormControl(null, Validators$1.required),
3524
+ template: new FormControl(null, Validators$1.required),
3525
+ paramBody: new FormArray([], Validators$1.required),
3399
3526
  isUpload: new FormControl(false),
3400
3527
  fileId: new FormControl(''),
3401
3528
  });
@@ -3447,16 +3574,16 @@ let GeneralInformationSMSComponent = class GeneralInformationSMSComponent {
3447
3574
  this.form.controls[key].clearValidators();
3448
3575
  this.form.controls[key].updateValueAndValidity();
3449
3576
  }
3450
- this.form.get('channel').setValidators(Validators.required);
3451
- this.form.get('from').setValidators(Validators.required);
3577
+ this.form.get('channel').setValidators(Validators$1.required);
3578
+ this.form.get('from').setValidators(Validators$1.required);
3452
3579
  if (this.getIsTemplate) {
3453
- this.form.get('template').setValidators(Validators.required);
3454
- this.form.get('paramBody').setValidators(Validators.required);
3580
+ this.form.get('template').setValidators(Validators$1.required);
3581
+ this.form.get('paramBody').setValidators(Validators$1.required);
3455
3582
  this.form.get('template').updateValueAndValidity();
3456
3583
  this.form.get('paramBody').updateValueAndValidity();
3457
3584
  }
3458
3585
  else {
3459
- this.form.get('text').setValidators(Validators.required);
3586
+ this.form.get('text').setValidators(Validators$1.required);
3460
3587
  this.form.get('text').updateValueAndValidity();
3461
3588
  }
3462
3589
  }
@@ -3535,7 +3662,7 @@ let GeneralInformationSMSComponent = class GeneralInformationSMSComponent {
3535
3662
  value: value,
3536
3663
  disabled: this.isReadOnlyMode ||
3537
3664
  ['UnsubscribeAccount'].includes(value),
3538
- }, Validators.required),
3665
+ }, Validators$1.required),
3539
3666
  });
3540
3667
  return form;
3541
3668
  }
@@ -3575,7 +3702,7 @@ let GeneralInformationSMSComponent = class GeneralInformationSMSComponent {
3575
3702
  return;
3576
3703
  this.isHaveTemplateParam = ((_a = template.body.examples) === null || _a === void 0 ? void 0 : _a.length) > 0;
3577
3704
  ((_b = template.body.examples) === null || _b === void 0 ? void 0 : _b.length) > 0
3578
- ? this.form.get('paramBody').setValidators(Validators.required)
3705
+ ? this.form.get('paramBody').setValidators(Validators$1.required)
3579
3706
  : this.form.get('paramBody').clearValidators();
3580
3707
  this.form.get('paramBody').controls = [];
3581
3708
  this.form.get('paramBody').reset();
@@ -3648,6 +3775,49 @@ var EnumData;
3648
3775
  EnumData["SCHEDULER_TYPE_MULTIPLE"] = "MULTIPLE";
3649
3776
  })(EnumData || (EnumData = {}));
3650
3777
 
3778
+ const maxValidator = (max, message) => {
3779
+ return (AC) => {
3780
+ const isError = Validators$1.max(max)(AC);
3781
+ if (isError)
3782
+ return {
3783
+ max: max,
3784
+ actual: AC.value,
3785
+ message: message || `Max Value equals to ${max}`,
3786
+ };
3787
+ return null;
3788
+ };
3789
+ };
3790
+
3791
+ const minValidator = (min, message) => {
3792
+ return (AC) => {
3793
+ const isError = Validators$1.min(min)(AC);
3794
+ if (isError)
3795
+ return {
3796
+ min: min,
3797
+ actual: AC.value,
3798
+ message: message || `Min Value equals to ${min}`,
3799
+ };
3800
+ return null;
3801
+ };
3802
+ };
3803
+
3804
+ const requiredValidator = (message) => {
3805
+ return (ac) => {
3806
+ const isError = Validators$1.required(ac);
3807
+ if (isError)
3808
+ return { message };
3809
+ return null;
3810
+ };
3811
+ };
3812
+
3813
+ const Validators = {
3814
+ compose: Validators$1.compose,
3815
+ composeAync: Validators$1.composeAsync,
3816
+ max: maxValidator,
3817
+ min: minValidator,
3818
+ required: requiredValidator,
3819
+ };
3820
+
3651
3821
  let GeneralInformationWAComponent = class GeneralInformationWAComponent {
3652
3822
  constructor(ngZone, mapsAPILoader, apiAdapterService, toastr) {
3653
3823
  this.ngZone = ngZone;
@@ -3710,7 +3880,7 @@ let GeneralInformationWAComponent = class GeneralInformationWAComponent {
3710
3880
  }
3711
3881
  initForm() {
3712
3882
  this.form = new FormGroup({
3713
- channel: new FormControl(null, Validators.required),
3883
+ channel: new FormControl(null, Validators$1.required),
3714
3884
  media: new FormControl(null),
3715
3885
  from: new FormControl(null),
3716
3886
  text: new FormControl(null),
@@ -3721,9 +3891,9 @@ let GeneralInformationWAComponent = class GeneralInformationWAComponent {
3721
3891
  latitude: new FormControl(null),
3722
3892
  longitude: new FormControl(null),
3723
3893
  template: new FormControl(null),
3724
- paramHeader: new FormArray([], Validators.required),
3725
- paramBody: new FormArray([], Validators.required),
3726
- paramButton: new FormArray([], Validators.required),
3894
+ paramHeader: new FormArray([], Validators$1.required),
3895
+ paramBody: new FormArray([], Validators$1.required),
3896
+ paramButton: new FormArray([], Validators$1.required),
3727
3897
  otpValue: new FormControl(''),
3728
3898
  isUpload: new FormControl(false),
3729
3899
  fileId: new FormControl(''),
@@ -3733,6 +3903,7 @@ let GeneralInformationWAComponent = class GeneralInformationWAComponent {
3733
3903
  body: new FormControl(null),
3734
3904
  isUseExistingTemplate: new FormControl(false),
3735
3905
  isNeedSave: new FormControl(false),
3906
+ ttl: new FormControl(null),
3736
3907
  });
3737
3908
  this.form.valueChanges.subscribe(() => {
3738
3909
  setTimeout(() => {
@@ -3747,7 +3918,7 @@ let GeneralInformationWAComponent = class GeneralInformationWAComponent {
3747
3918
  this.form.disable();
3748
3919
  }
3749
3920
  initEdit() {
3750
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6;
3921
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _0, _1, _2, _3, _4, _5, _6, _7, _8, _9;
3751
3922
  if (Object.entries(this.getCampaignStorage).length === 0 ||
3752
3923
  ((_c = (_b = (_a = this.getCampaignStorage) === null || _a === void 0 ? void 0 : _a.generalInformation) === null || _b === void 0 ? void 0 : _b.form) === null || _c === void 0 ? void 0 : _c.medium) !== 'WA')
3753
3924
  return;
@@ -3775,39 +3946,40 @@ let GeneralInformationWAComponent = class GeneralInformationWAComponent {
3775
3946
  .setValue((_z = (_y = this.getCampaignStorage) === null || _y === void 0 ? void 0 : _y.generalInformation) === null || _z === void 0 ? void 0 : _z.form.otpValue);
3776
3947
  this.form
3777
3948
  .get('isUseExistingTemplate')
3778
- .setValue(!!((_2 = (_1 = (_0 = this.getCampaignStorage) === null || _0 === void 0 ? void 0 : _0.generalInformation) === null || _1 === void 0 ? void 0 : _1.form) === null || _2 === void 0 ? void 0 : _2.isPrevTemplate));
3949
+ .setValue(!!((_2 = (_1 = (_0 = this.getCampaignStorage) === null || _0 === void 0 ? void 0 : _0.generalInformation) === null || _1 === void 0 ? void 0 : _1.form) === null || _2 === void 0 ? void 0 : _2.templateName));
3779
3950
  this.form
3780
3951
  .get('isNeedSave')
3781
3952
  .setValue(!!((_5 = (_4 = (_3 = this.getCampaignStorage) === null || _3 === void 0 ? void 0 : _3.generalInformation) === null || _4 === void 0 ? void 0 : _4.form) === null || _5 === void 0 ? void 0 : _5.isNeedSave));
3953
+ this.form.get('ttl').setValue((_8 = (_7 = (_6 = this.getCampaignStorage) === null || _6 === void 0 ? void 0 : _6.generalInformation) === null || _7 === void 0 ? void 0 : _7.form) === null || _8 === void 0 ? void 0 : _8.ttl);
3782
3954
  this.isHaveTemplateParam = this.form.get('isUpload').value;
3783
- this.getTemplateOptionService(null, (_6 = this.form.get('template').value) === null || _6 === void 0 ? void 0 : _6.name);
3955
+ this.getTemplateOptionService(null, (_9 = this.form.get('template').value) === null || _9 === void 0 ? void 0 : _9.name);
3784
3956
  }
3785
3957
  initValidation() {
3786
3958
  for (const key in this.form.controls) {
3787
3959
  this.form.controls[key].clearValidators();
3788
3960
  this.form.controls[key].updateValueAndValidity();
3789
3961
  }
3790
- this.form.get('channel').setValidators(Validators.required);
3962
+ this.form.get('channel').setValidators(Validators$1.required);
3791
3963
  if (this.getIsText) {
3792
- this.form.get('from').setValidators(Validators.required);
3793
- this.form.get('text').setValidators(Validators.required);
3964
+ this.form.get('from').setValidators(Validators$1.required);
3965
+ this.form.get('text').setValidators(Validators$1.required);
3794
3966
  this.form.get('from').updateValueAndValidity();
3795
3967
  this.form.get('text').updateValueAndValidity();
3796
3968
  }
3797
3969
  else if (this.getIsMedia) {
3798
- this.form.get('media').setValidators(Validators.required);
3799
- this.form.get('from').setValidators(Validators.required);
3800
- this.form.get('fileName').setValidators(Validators.required);
3970
+ this.form.get('media').setValidators(Validators$1.required);
3971
+ this.form.get('from').setValidators(Validators$1.required);
3972
+ this.form.get('fileName').setValidators(Validators$1.required);
3801
3973
  this.form.get('media').updateValueAndValidity();
3802
3974
  this.form.get('from').updateValueAndValidity();
3803
3975
  this.form.get('fileName').updateValueAndValidity();
3804
3976
  }
3805
3977
  else if (this.getIsTemplate) {
3806
- this.form.get('from').setValidators(Validators.required);
3807
- this.form.get('template').setValidators(Validators.required);
3808
- this.form.get('paramHeader').setValidators(Validators.required);
3809
- this.form.get('paramBody').setValidators(Validators.required);
3810
- this.form.get('paramButton').setValidators(Validators.required);
3978
+ this.form.get('from').setValidators(Validators$1.required);
3979
+ this.form.get('template').setValidators(Validators$1.required);
3980
+ this.form.get('paramHeader').setValidators(Validators$1.required);
3981
+ this.form.get('paramBody').setValidators(Validators$1.required);
3982
+ this.form.get('paramButton').setValidators(Validators$1.required);
3811
3983
  this.form.get('from').updateValueAndValidity();
3812
3984
  this.form.get('template').updateValueAndValidity();
3813
3985
  this.form.get('paramHeader').updateValueAndValidity();
@@ -3815,11 +3987,11 @@ let GeneralInformationWAComponent = class GeneralInformationWAComponent {
3815
3987
  this.form.get('paramButton').updateValueAndValidity();
3816
3988
  }
3817
3989
  else if (this.getIsCatalogue) {
3818
- this.form.get('from').setValidators(Validators.required);
3819
- this.form.get('category').setValidators(Validators.required);
3820
- this.form.get('catalogue').setValidators(Validators.required);
3821
- this.form.get('product').setValidators(Validators.required);
3822
- this.form.get('body').setValidators(Validators.maxLength(100));
3990
+ this.form.get('from').setValidators(Validators$1.required);
3991
+ this.form.get('category').setValidators(Validators$1.required);
3992
+ this.form.get('catalogue').setValidators(Validators$1.required);
3993
+ this.form.get('product').setValidators(Validators$1.required);
3994
+ this.form.get('body').setValidators(Validators$1.maxLength(100));
3823
3995
  this.form.get('from').updateValueAndValidity();
3824
3996
  this.form.get('category').updateValueAndValidity();
3825
3997
  this.form.get('catalogue').updateValueAndValidity();
@@ -3827,14 +3999,21 @@ let GeneralInformationWAComponent = class GeneralInformationWAComponent {
3827
3999
  this.form.get('body').updateValueAndValidity();
3828
4000
  }
3829
4001
  else if (this.getIsUtility) {
3830
- this.form.get('from').setValidators(Validators.required);
3831
- this.form.get('text').setValidators(Validators.required);
4002
+ this.form.get('from').setValidators(Validators$1.required);
4003
+ this.form.get('text').setValidators([Validators$1.required, Validators$1.maxLength(1024)]);
4004
+ this.form
4005
+ .get('ttl')
4006
+ .setValidators([
4007
+ Validators.min(30, 'Minimum TTL 30'),
4008
+ Validators.max(43200, 'Maximum TTL 43200'),
4009
+ ]);
3832
4010
  this.form.get('from').updateValueAndValidity();
3833
4011
  this.form.get('text').updateValueAndValidity();
4012
+ this.form.get('ttl').updateValueAndValidity();
3834
4013
  }
3835
4014
  else {
3836
- this.form.get('from').setValidators(Validators.required);
3837
- this.form.get('text').setValidators(Validators.required);
4015
+ this.form.get('from').setValidators(Validators$1.required);
4016
+ this.form.get('text').setValidators(Validators$1.required);
3838
4017
  this.form.get('from').updateValueAndValidity();
3839
4018
  this.form.get('text').updateValueAndValidity();
3840
4019
  }
@@ -3933,13 +4112,13 @@ let GeneralInformationWAComponent = class GeneralInformationWAComponent {
3933
4112
  initParameter(isButton = false, value = '') {
3934
4113
  const form = isButton
3935
4114
  ? new FormGroup({
3936
- name: new FormArray([], Validators.required),
4115
+ name: new FormArray([], Validators$1.required),
3937
4116
  })
3938
4117
  : new FormGroup({
3939
4118
  name: new FormControl({
3940
4119
  value: value,
3941
4120
  disabled: this.isReadOnlyMode || ['$UnsubscribeAccount'].includes(value),
3942
- }, Validators.required),
4121
+ }, Validators$1.required),
3943
4122
  });
3944
4123
  return form;
3945
4124
  }
@@ -4034,7 +4213,7 @@ let GeneralInformationWAComponent = class GeneralInformationWAComponent {
4034
4213
  this.form.get('file').setValue(file[0]);
4035
4214
  this.form.get('fileType').setValue('image');
4036
4215
  this.form.get('fileName').setValue(file[0].name);
4037
- this.form.get('targetURL').setValidators(Validators.required);
4216
+ this.form.get('targetURL').setValidators(Validators$1.required);
4038
4217
  this.form.get('targetURL').updateValueAndValidity();
4039
4218
  if (file[0].type.indexOf('video') > -1)
4040
4219
  this.form.get('fileType').setValue('video');
@@ -4079,13 +4258,13 @@ let GeneralInformationWAComponent = class GeneralInformationWAComponent {
4079
4258
  this.fileTypeChange((_t = (_s = (_r = template) === null || _r === void 0 ? void 0 : _r.header) === null || _s === void 0 ? void 0 : _s.type) === null || _t === void 0 ? void 0 : _t.toLowerCase());
4080
4259
  }
4081
4260
  ((_u = template.header.examples) === null || _u === void 0 ? void 0 : _u.length) > 0
4082
- ? this.form.get('paramHeader').setValidators(Validators.required)
4261
+ ? this.form.get('paramHeader').setValidators(Validators$1.required)
4083
4262
  : this.form.get('paramHeader').clearValidators();
4084
4263
  ((_v = template.body.examples) === null || _v === void 0 ? void 0 : _v.length) > 0
4085
- ? this.form.get('paramBody').setValidators(Validators.required)
4264
+ ? this.form.get('paramBody').setValidators(Validators$1.required)
4086
4265
  : this.form.get('paramBody').clearValidators();
4087
4266
  ((_w = template.buttons) === null || _w === void 0 ? void 0 : _w.length) > 0
4088
- ? this.form.get('paramButton').setValidators(Validators.required)
4267
+ ? this.form.get('paramButton').setValidators(Validators$1.required)
4089
4268
  : this.form.get('paramButton').clearValidators();
4090
4269
  this.form.get('paramHeader').controls = [];
4091
4270
  this.form.get('paramHeader').reset();
@@ -4104,7 +4283,7 @@ let GeneralInformationWAComponent = class GeneralInformationWAComponent {
4104
4283
  this.form
4105
4284
  .get('otpValue')
4106
4285
  .setValue((_6 = (_0 = (_z = formStorage) === null || _z === void 0 ? void 0 : _z.otpValue, (_0 !== null && _0 !== void 0 ? _0 : (_5 = [...(_4 = (_3 = (_2 = (_1 = formStorage) === null || _1 === void 0 ? void 0 : _1.template) === null || _2 === void 0 ? void 0 : _2.body) === null || _3 === void 0 ? void 0 : _3.examples, (_4 !== null && _4 !== void 0 ? _4 : []))]) === null || _5 === void 0 ? void 0 : _5.pop())), (_6 !== null && _6 !== void 0 ? _6 : '')));
4107
- this.form.get('otpValue').setValidators(Validators.required);
4286
+ this.form.get('otpValue').setValidators(Validators$1.required);
4108
4287
  this.form.get('otpValue').updateValueAndValidity();
4109
4288
  }
4110
4289
  (_7 = template.header.examples) === null || _7 === void 0 ? void 0 : _7.forEach((each, index) => {
@@ -4227,7 +4406,7 @@ let GeneralInformationWAComponent = class GeneralInformationWAComponent {
4227
4406
  }
4228
4407
  handleChangeTemplate(useExisting) {
4229
4408
  if (useExisting) {
4230
- this.form.get('template').setValidators(Validators.required);
4409
+ this.form.get('template').setValidators(Validators$1.required);
4231
4410
  this.form.get('text').reset();
4232
4411
  this.form.get('text').clearValidators();
4233
4412
  this.form.get('text').updateValueAndValidity();
@@ -4236,7 +4415,7 @@ let GeneralInformationWAComponent = class GeneralInformationWAComponent {
4236
4415
  else {
4237
4416
  this.form.get('template').reset();
4238
4417
  this.form.get('template').clearValidators();
4239
- this.form.get('text').setValidators(Validators.required);
4418
+ this.form.get('text').setValidators([Validators$1.required, Validators$1.max(1024)]);
4240
4419
  this.form.get('text').updateValueAndValidity();
4241
4420
  this.form.get('template').updateValueAndValidity();
4242
4421
  }
@@ -4272,7 +4451,7 @@ __decorate([
4272
4451
  GeneralInformationWAComponent = __decorate([
4273
4452
  Component({
4274
4453
  selector: 'lib-general-information-wa',
4275
- template: "<form autocomplete=\"off\" [formGroup]=\"form\">\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">Message Type</mat-label>\r\n\r\n <mat-select placeholder=\"Select message type\" formControlName=\"channel\">\r\n <mat-option\r\n *ngFor=\"let option of msgTypeWAOption\"\r\n [value]=\"option.code\"\r\n (click)=\"formReset()\"\r\n >\r\n {{ option.name }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.channel\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('channel')?.touched && form.get('channel')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n\r\n <div\r\n *ngIf=\"!getIsTemplate\"\r\n role=\"alert\"\r\n class=\"alert alert-warning d-flex align-items-center\"\r\n style=\"margin-top: 16px; border: 1px solid rgb(243, 124, 44)\"\r\n >\r\n <mat-icon style=\"margin-right: 10px !important\">error_outline</mat-icon>\r\n <div>\r\n If you select this channel, keep in mind that the message might not be delivered to\r\n all selected customers. This is because the customer must have had a conversation\r\n previously with BSP.\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <ng-container *ngIf=\"getIsText\">\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">From</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"from\"\r\n placeholder=\"Select from\"\r\n [complete]=\"isHaveNextAccountOption === false\"\r\n [compareWith]=\"accountSelectedDisplay\"\r\n (infiniteScroll)=\"getNextAccountBatch()\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('from').value?.name\"\r\n (searchRes)=\"updateSearchAccount($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name + ' (' + option.accountNo + ')' }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingAccountOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.from\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('from').touched && form.get('from').hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\">\r\n <mat-label class=\"asterix--after\">Text</mat-label>\r\n\r\n <textarea\r\n matInput\r\n rows=\"6\"\r\n cols=\"50\"\r\n cdkTextareaAutosize\r\n cdkAutosizeMinRows=\"2\"\r\n cdkAutosizeMaxRows=\"15\"\r\n formControlName=\"text\"\r\n placeholder=\"Enter text\"\r\n #autosize=\"cdkTextareaAutosize\"\r\n ></textarea>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.text\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('text')?.touched && form.get('text')?.hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getIsMedia\">\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">Media Type</mat-label>\r\n\r\n <mat-select\r\n placeholder=\"Select media type\"\r\n formControlName=\"media\"\r\n (selectionChange)=\"updateMediaType($event.value)\"\r\n >\r\n <mat-option *ngFor=\"let option of mediaTypeOption\" [value]=\"option.code\">\r\n {{ option.name }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.media\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('media').touched && form.get('media').hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">From</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"from\"\r\n placeholder=\"Select from\"\r\n [complete]=\"isHaveNextAccountOption === false\"\r\n [compareWith]=\"accountSelectedDisplay\"\r\n (infiniteScroll)=\"getNextAccountBatch()\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('from').value?.name\"\r\n (searchRes)=\"updateSearchAccount($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name + ' (' + option.accountNo + ')' }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingAccountOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.from\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('from').touched && form.get('from').hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <ng-container *ngIf=\"form.get('media').value?.toLowerCase() !== 'location'\">\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">File</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n autocomplete=\"off\"\r\n (click)=\"filePicker.click()\"\r\n formControlName=\"fileName\"\r\n />\r\n\r\n <button\r\n mat-button\r\n matSuffix\r\n mat-icon-button\r\n aria-label=\"Choose File\"\r\n (click)=\"filePicker.click()\"\r\n >\r\n <mat-icon>attach_file</mat-icon>\r\n </button>\r\n\r\n <input\r\n #filePicker\r\n hidden\r\n type=\"file\"\r\n [accept]=\"extFileAccepted\"\r\n (change)=\"onFileSelected($event)\"\r\n />\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.fileName\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('fileName').touched &&\r\n form.get('fileName').hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"form.get('media').value?.toLowerCase() === 'location'\">\r\n <div class=\"w-100\">\r\n <h4 class=\"asterix--after\">Location</h4>\r\n\r\n <div class=\"w-100\">\r\n <agm-map\r\n style=\"width: 100%; height: 400px\"\r\n [latitude]=\"maps.latitude\"\r\n [longitude]=\"maps.longitude\"\r\n [disableDoubleClickZoom]=\"maps.isDoubleClickZoom\"\r\n [zoom]=\"maps.zoom\"\r\n >\r\n <agm-marker\r\n [latitude]=\"maps.latitude\"\r\n [longitude]=\"maps.longitude\"\r\n [markerDraggable]=\"maps.isDraggable\"\r\n (dragEnd)=\"markerDragEnd($event)\"\r\n ></agm-marker>\r\n </agm-map>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label>Location</mat-label>\r\n\r\n <input\r\n #mapSearch\r\n matInput\r\n type=\"text\"\r\n maxlength=\"100\"\r\n placeholder=\"Enter location here\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getIsTemplate\">\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">From</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"from\"\r\n placeholder=\"Select from\"\r\n [complete]=\"isHaveNextAccountOption === false\"\r\n [compareWith]=\"accountSelectedDisplay\"\r\n (infiniteScroll)=\"getNextAccountBatch()\"\r\n (selectionChange)=\"getTemplateOptionService($event.value)\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('from').value?.name\"\r\n (searchRes)=\"updateSearchAccount($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name + ' (' + option.accountNo + ')' }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingAccountOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.from\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('from')?.touched && form.get('from')?.hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">Template</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"template\"\r\n placeholder=\"Select template\"\r\n [complete]=\"isHaveNextTemplateOption === false\"\r\n [compareWith]=\"templateSelectedDisplay\"\r\n (infiniteScroll)=\"getNextTemplateBatch()\"\r\n (selectionChange)=\"updateTemplate($event.value)\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('template').value?.name\"\r\n (searchRes)=\"updateSearch($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of templateOption\" [value]=\"option\">\r\n {{ option.name }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingTemplateOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.template\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('template')?.touched &&\r\n form.get('template')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div *ngIf=\"isHaveTemplateParam\" class=\"d-flex justify-content-end\">\r\n <mat-checkbox\r\n labelPosition=\"before\"\r\n formControlName=\"isUpload\"\r\n (change)=\"updateDownloadCSV($event.checked)\"\r\n >\r\n Using Download XLSX\r\n </mat-checkbox>\r\n </div>\r\n\r\n <ng-container *ngIf=\"!form.get('isUpload')?.value\">\r\n <div\r\n *ngIf=\"form.get('template')?.value?.category === 'AUTHENTICATION'\"\r\n class=\"form-group\"\r\n >\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label> OTP Value </mat-label>\r\n\r\n <input matInput type=\"text\" formControlName=\"otpValue\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <ng-container *ngIf=\"getParamHeader?.length > 0\">\r\n <p class=\"font-16px font-PoppinsBold\">Header Parameter</p>\r\n\r\n <div\r\n *ngFor=\"let param of getParamHeader; let paramHeaderIndex = index\"\r\n class=\"form-group\"\r\n >\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label>Parameter {{ paramHeaderIndex + 1 }}</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n [placeholder]=\"'Parameter ' + (paramHeaderIndex + 1)\"\r\n [formControl]=\"param.get('name')\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getParamBody?.length > 0\">\r\n <p class=\"font-16px font-PoppinsBold mt-3\">Body Parameter</p>\r\n\r\n <div\r\n *ngFor=\"let param of getParamBody; let paramBodyIndex = index\"\r\n class=\"form-group\"\r\n >\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label>Parameter {{ paramBodyIndex + 1 }}</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n [placeholder]=\"'Parameter ' + (paramBodyIndex + 1)\"\r\n [formControl]=\"param.get('name')\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"isShowParameter\">\r\n <p class=\"font-16px font-PoppinsBold mt-3\">Button Parameter</p>\r\n\r\n <ng-container *ngFor=\"let button of getButton; let buttonIndex = index\">\r\n <ng-container *ngIf=\"getParamButton(buttonIndex)?.length > 0\">\r\n <p class=\"font-14px font-PoppinsBold mt-3\">Button {{ buttonIndex + 1 }}</p>\r\n\r\n <div\r\n *ngFor=\"\r\n let param of getParamButton(buttonIndex);\r\n let paramIndex = index\r\n \"\r\n class=\"form-group\"\r\n >\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label>Parameter {{ paramIndex + 1 }}</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n [placeholder]=\"'Parameter ' + (paramIndex + 1)\"\r\n [formControl]=\"param.get('name')\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <ng-container\r\n *ngIf=\"\r\n ['image', 'video', 'document'].includes(\r\n form.get('template')?.value?.header?.type?.toLowerCase()\r\n )\r\n \"\r\n >\r\n <p class=\"font-16px font-PoppinsBold mt-3\">File</p>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">File</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n autocomplete=\"off\"\r\n (click)=\"filePicker.click()\"\r\n formControlName=\"fileName\"\r\n />\r\n\r\n <button\r\n mat-button\r\n matSuffix\r\n mat-icon-button\r\n aria-label=\"Choose File\"\r\n (click)=\"filePicker.click()\"\r\n >\r\n <mat-icon>attach_file</mat-icon>\r\n </button>\r\n\r\n <input\r\n #filePicker\r\n hidden\r\n type=\"file\"\r\n [accept]=\"extFileAccepted\"\r\n (change)=\"onFileSelected($event)\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getIsCatalogue\">\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">From</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"from\"\r\n placeholder=\"Select from\"\r\n [complete]=\"isHaveNextAccountOption === false\"\r\n [compareWith]=\"accountSelectedDisplay\"\r\n (infiniteScroll)=\"getNextAccountBatch()\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('from').value?.name\"\r\n (searchRes)=\"updateSearchAccount($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name + ' (' + option.accountNo + ')' }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingAccountOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.from\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('from')?.touched && form.get('from')?.hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">Category</mat-label>\r\n\r\n <mat-select formControlName=\"category\" placeholder=\"Select category\">\r\n <mat-option *ngFor=\"let option of categoryOption\" [value]=\"option.value\">\r\n {{ option.label }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.category\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('category')?.touched &&\r\n form.get('category')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">Catalog</mat-label>\r\n\r\n <mat-select formControlName=\"catalogue\" placeholder=\"Select catalog\">\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.catalogue\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('catalogue')?.touched &&\r\n form.get('catalogue')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"form.get('category')?.value === 'product'\"\r\n style=\"padding: 8px; border-radius: 8px; border: 1px solid #6177c4\"\r\n >\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">Product</mat-label>\r\n\r\n <mat-select formControlName=\"product\" placeholder=\"Select product\">\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.product\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('product')?.touched &&\r\n form.get('product')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label>Body</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n maxlength=\"100\"\r\n formControlName=\"body\"\r\n placeholder=\"Enter body\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getIsUtility\">\r\n <div style=\"display: grid; gap: 0.5rem\">\r\n <mat-label class=\"asterix--after\">Template</mat-label>\r\n <mat-radio-group\r\n style=\"display: flex; gap: 0.5rem; flex-wrap: wrap\"\r\n formControlName=\"isUseExistingTemplate\"\r\n (change)=\"handleChangeTemplate($event.value)\"\r\n >\r\n <mat-radio-button\r\n [value]=\"option.value\"\r\n *ngFor=\"let option of templates\"\r\n color=\"primary\"\r\n >\r\n {{ option.label }}\r\n </mat-radio-button>\r\n </mat-radio-group>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">From</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"from\"\r\n placeholder=\"Select from\"\r\n [complete]=\"isHaveNextAccountOption === false\"\r\n [compareWith]=\"accountSelectedDisplay\"\r\n (infiniteScroll)=\"getNextAccountBatch()\"\r\n (selectionChange)=\"handleChangeFrom($event.value)\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('from').value?.name\"\r\n (searchRes)=\"updateSearchAccount($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name + ' (' + option.accountNo + ')' }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingAccountOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.from\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('from')?.touched && form.get('from')?.hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <ng-container *ngIf=\"!form.get('isUseExistingTemplate')?.value; else existingTmpl\">\r\n <div\r\n role=\"alert\"\r\n class=\"alert alert-warning d-flex align-items-center\"\r\n style=\"margin-top: 8px; border: 1px solid rgb(243, 124, 44)\"\r\n >\r\n <mat-icon style=\"margin-right: 10px !important\">error_outline</mat-icon>\r\n <div>\r\n Direct Send access restricted for 30 days due to continued misuse. Final warning\r\n before permanent revocation.\r\n </div>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\">\r\n <mat-label class=\"asterix--after\">Body</mat-label>\r\n\r\n <textarea\r\n matInput\r\n rows=\"6\"\r\n cols=\"50\"\r\n cdkTextareaAutosize\r\n cdkAutosizeMinRows=\"2\"\r\n cdkAutosizeMaxRows=\"15\"\r\n formControlName=\"text\"\r\n placeholder=\"Enter text\"\r\n #autosize=\"cdkTextareaAutosize\"\r\n ></textarea>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.text\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('text').touched && form.get('text').hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div *ngIf=\"!isReadOnlyMode\">\r\n <mat-checkbox formControlName=\"isNeedSave\">\r\n Save this message as future template\r\n </mat-checkbox>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-template #existingTmpl>\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">Template</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"template\"\r\n placeholder=\"Select template\"\r\n [complete]=\"isHaveNextTemplateOption === false\"\r\n [compareWith]=\"templateSelectedDisplay\"\r\n (infiniteScroll)=\"getNextTemplateBatch()\"\r\n (selectionChange)=\"updateTemplate($event.value)\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('template').value?.name\"\r\n (searchRes)=\"updateSearch($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of templateOption\" [value]=\"option\">\r\n {{ option.name }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingTemplateOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.template\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('template')?.touched &&\r\n form.get('template')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n</form>\r\n",
4454
+ template: "<form autocomplete=\"off\" [formGroup]=\"form\">\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">Message Type</mat-label>\r\n\r\n <mat-select placeholder=\"Select message type\" formControlName=\"channel\">\r\n <mat-option\r\n *ngFor=\"let option of msgTypeWAOption\"\r\n [value]=\"option.code\"\r\n (click)=\"formReset()\"\r\n >\r\n {{ option.name }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.channel\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('channel')?.touched && form.get('channel')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n\r\n <div\r\n *ngIf=\"!getIsTemplate\"\r\n role=\"alert\"\r\n class=\"alert alert-warning d-flex align-items-center\"\r\n style=\"margin-top: 16px; border: 1px solid rgb(243, 124, 44)\"\r\n >\r\n <mat-icon style=\"margin-right: 10px !important\">error_outline</mat-icon>\r\n <div>\r\n If you select this channel, keep in mind that the message might not be delivered to\r\n all selected customers. This is because the customer must have had a conversation\r\n previously with BSP.\r\n </div>\r\n </div>\r\n </div>\r\n\r\n <ng-container *ngIf=\"getIsText\">\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">From</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"from\"\r\n placeholder=\"Select from\"\r\n [complete]=\"isHaveNextAccountOption === false\"\r\n [compareWith]=\"accountSelectedDisplay\"\r\n (infiniteScroll)=\"getNextAccountBatch()\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('from').value?.name\"\r\n (searchRes)=\"updateSearchAccount($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name + ' (' + option.accountNo + ')' }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingAccountOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.from\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('from').touched && form.get('from').hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\">\r\n <mat-label class=\"asterix--after\">Text</mat-label>\r\n\r\n <textarea\r\n matInput\r\n rows=\"6\"\r\n cols=\"50\"\r\n cdkTextareaAutosize\r\n cdkAutosizeMinRows=\"2\"\r\n cdkAutosizeMaxRows=\"15\"\r\n formControlName=\"text\"\r\n placeholder=\"Enter text\"\r\n #autosize=\"cdkTextareaAutosize\"\r\n ></textarea>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.text\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('text')?.touched && form.get('text')?.hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getIsMedia\">\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">Media Type</mat-label>\r\n\r\n <mat-select\r\n placeholder=\"Select media type\"\r\n formControlName=\"media\"\r\n (selectionChange)=\"updateMediaType($event.value)\"\r\n >\r\n <mat-option *ngFor=\"let option of mediaTypeOption\" [value]=\"option.code\">\r\n {{ option.name }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.media\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('media').touched && form.get('media').hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">From</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"from\"\r\n placeholder=\"Select from\"\r\n [complete]=\"isHaveNextAccountOption === false\"\r\n [compareWith]=\"accountSelectedDisplay\"\r\n (infiniteScroll)=\"getNextAccountBatch()\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('from').value?.name\"\r\n (searchRes)=\"updateSearchAccount($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name + ' (' + option.accountNo + ')' }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingAccountOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.from\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('from').touched && form.get('from').hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <ng-container *ngIf=\"form.get('media').value?.toLowerCase() !== 'location'\">\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">File</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n autocomplete=\"off\"\r\n (click)=\"filePicker.click()\"\r\n formControlName=\"fileName\"\r\n />\r\n\r\n <button\r\n mat-button\r\n matSuffix\r\n mat-icon-button\r\n aria-label=\"Choose File\"\r\n (click)=\"filePicker.click()\"\r\n >\r\n <mat-icon>attach_file</mat-icon>\r\n </button>\r\n\r\n <input\r\n #filePicker\r\n hidden\r\n type=\"file\"\r\n [accept]=\"extFileAccepted\"\r\n (change)=\"onFileSelected($event)\"\r\n />\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.fileName\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('fileName').touched &&\r\n form.get('fileName').hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"form.get('media').value?.toLowerCase() === 'location'\">\r\n <div class=\"w-100\">\r\n <h4 class=\"asterix--after\">Location</h4>\r\n\r\n <div class=\"w-100\">\r\n <agm-map\r\n style=\"width: 100%; height: 400px\"\r\n [latitude]=\"maps.latitude\"\r\n [longitude]=\"maps.longitude\"\r\n [disableDoubleClickZoom]=\"maps.isDoubleClickZoom\"\r\n [zoom]=\"maps.zoom\"\r\n >\r\n <agm-marker\r\n [latitude]=\"maps.latitude\"\r\n [longitude]=\"maps.longitude\"\r\n [markerDraggable]=\"maps.isDraggable\"\r\n (dragEnd)=\"markerDragEnd($event)\"\r\n ></agm-marker>\r\n </agm-map>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label>Location</mat-label>\r\n\r\n <input\r\n #mapSearch\r\n matInput\r\n type=\"text\"\r\n maxlength=\"100\"\r\n placeholder=\"Enter location here\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getIsTemplate\">\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">From</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"from\"\r\n placeholder=\"Select from\"\r\n [complete]=\"isHaveNextAccountOption === false\"\r\n [compareWith]=\"accountSelectedDisplay\"\r\n (infiniteScroll)=\"getNextAccountBatch()\"\r\n (selectionChange)=\"getTemplateOptionService($event.value)\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('from').value?.name\"\r\n (searchRes)=\"updateSearchAccount($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name + ' (' + option.accountNo + ')' }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingAccountOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.from\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('from')?.touched && form.get('from')?.hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">Template</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"template\"\r\n placeholder=\"Select template\"\r\n [complete]=\"isHaveNextTemplateOption === false\"\r\n [compareWith]=\"templateSelectedDisplay\"\r\n (infiniteScroll)=\"getNextTemplateBatch()\"\r\n (selectionChange)=\"updateTemplate($event.value)\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('template').value?.name\"\r\n (searchRes)=\"updateSearch($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of templateOption\" [value]=\"option\">\r\n {{ option.name }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingTemplateOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.template\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('template')?.touched &&\r\n form.get('template')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div *ngIf=\"isHaveTemplateParam\" class=\"d-flex justify-content-end\">\r\n <mat-checkbox\r\n labelPosition=\"before\"\r\n formControlName=\"isUpload\"\r\n (change)=\"updateDownloadCSV($event.checked)\"\r\n >\r\n Using Download XLSX\r\n </mat-checkbox>\r\n </div>\r\n\r\n <ng-container *ngIf=\"!form.get('isUpload')?.value\">\r\n <div\r\n *ngIf=\"form.get('template')?.value?.category === 'AUTHENTICATION'\"\r\n class=\"form-group\"\r\n >\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label> OTP Value </mat-label>\r\n\r\n <input matInput type=\"text\" formControlName=\"otpValue\" />\r\n </mat-form-field>\r\n </div>\r\n\r\n <ng-container *ngIf=\"getParamHeader?.length > 0\">\r\n <p class=\"font-16px font-PoppinsBold\">Header Parameter</p>\r\n\r\n <div\r\n *ngFor=\"let param of getParamHeader; let paramHeaderIndex = index\"\r\n class=\"form-group\"\r\n >\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label>Parameter {{ paramHeaderIndex + 1 }}</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n [placeholder]=\"'Parameter ' + (paramHeaderIndex + 1)\"\r\n [formControl]=\"param.get('name')\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getParamBody?.length > 0\">\r\n <p class=\"font-16px font-PoppinsBold mt-3\">Body Parameter</p>\r\n\r\n <div\r\n *ngFor=\"let param of getParamBody; let paramBodyIndex = index\"\r\n class=\"form-group\"\r\n >\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label>Parameter {{ paramBodyIndex + 1 }}</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n [placeholder]=\"'Parameter ' + (paramBodyIndex + 1)\"\r\n [formControl]=\"param.get('name')\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"isShowParameter\">\r\n <p class=\"font-16px font-PoppinsBold mt-3\">Button Parameter</p>\r\n\r\n <ng-container *ngFor=\"let button of getButton; let buttonIndex = index\">\r\n <ng-container *ngIf=\"getParamButton(buttonIndex)?.length > 0\">\r\n <p class=\"font-14px font-PoppinsBold mt-3\">Button {{ buttonIndex + 1 }}</p>\r\n\r\n <div\r\n *ngFor=\"\r\n let param of getParamButton(buttonIndex);\r\n let paramIndex = index\r\n \"\r\n class=\"form-group\"\r\n >\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label>Parameter {{ paramIndex + 1 }}</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n [placeholder]=\"'Parameter ' + (paramIndex + 1)\"\r\n [formControl]=\"param.get('name')\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <ng-container\r\n *ngIf=\"\r\n ['image', 'video', 'document'].includes(\r\n form.get('template')?.value?.header?.type?.toLowerCase()\r\n )\r\n \"\r\n >\r\n <p class=\"font-16px font-PoppinsBold mt-3\">File</p>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">File</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n autocomplete=\"off\"\r\n (click)=\"filePicker.click()\"\r\n formControlName=\"fileName\"\r\n />\r\n\r\n <button\r\n mat-button\r\n matSuffix\r\n mat-icon-button\r\n aria-label=\"Choose File\"\r\n (click)=\"filePicker.click()\"\r\n >\r\n <mat-icon>attach_file</mat-icon>\r\n </button>\r\n\r\n <input\r\n #filePicker\r\n hidden\r\n type=\"file\"\r\n [accept]=\"extFileAccepted\"\r\n (change)=\"onFileSelected($event)\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </ng-container>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getIsCatalogue\">\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">From</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"from\"\r\n placeholder=\"Select from\"\r\n [complete]=\"isHaveNextAccountOption === false\"\r\n [compareWith]=\"accountSelectedDisplay\"\r\n (infiniteScroll)=\"getNextAccountBatch()\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('from').value?.name\"\r\n (searchRes)=\"updateSearchAccount($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name + ' (' + option.accountNo + ')' }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingAccountOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.from\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('from')?.touched && form.get('from')?.hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">Category</mat-label>\r\n\r\n <mat-select formControlName=\"category\" placeholder=\"Select category\">\r\n <mat-option *ngFor=\"let option of categoryOption\" [value]=\"option.value\">\r\n {{ option.label }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.category\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('category')?.touched &&\r\n form.get('category')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">Catalog</mat-label>\r\n\r\n <mat-select formControlName=\"catalogue\" placeholder=\"Select catalog\">\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.catalogue\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('catalogue')?.touched &&\r\n form.get('catalogue')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div\r\n *ngIf=\"form.get('category')?.value === 'product'\"\r\n style=\"padding: 8px; border-radius: 8px; border: 1px solid #6177c4\"\r\n >\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">Product</mat-label>\r\n\r\n <mat-select formControlName=\"product\" placeholder=\"Select product\">\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name }}\r\n </mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.product\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('product')?.touched &&\r\n form.get('product')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label>Body</mat-label>\r\n\r\n <input\r\n matInput\r\n type=\"text\"\r\n maxlength=\"100\"\r\n formControlName=\"body\"\r\n placeholder=\"Enter body\"\r\n />\r\n </mat-form-field>\r\n </div>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-container *ngIf=\"getIsUtility\">\r\n <div style=\"display: grid; gap: 0.5rem\">\r\n <mat-label class=\"asterix--after\">Template</mat-label>\r\n <mat-radio-group\r\n style=\"display: flex; gap: 0.5rem; flex-wrap: wrap\"\r\n formControlName=\"isUseExistingTemplate\"\r\n (change)=\"handleChangeTemplate($event.value)\"\r\n >\r\n <mat-radio-button\r\n [value]=\"option.value\"\r\n *ngFor=\"let option of templates\"\r\n color=\"primary\"\r\n >\r\n {{ option.label }}\r\n </mat-radio-button>\r\n </mat-radio-group>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field\r\n appearance=\"outline\"\r\n floatLabel=\"always\"\r\n class=\"w-100\"\r\n style=\"margin-bottom: 20\"\r\n >\r\n <mat-label class=\"asterix--after\">From</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"from\"\r\n placeholder=\"Select from\"\r\n [complete]=\"isHaveNextAccountOption === false\"\r\n [compareWith]=\"accountSelectedDisplay\"\r\n (infiniteScroll)=\"getNextAccountBatch()\"\r\n (selectionChange)=\"handleChangeFrom($event.value)\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('from').value?.name\"\r\n (searchRes)=\"updateSearchAccount($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of accountOption\" [value]=\"option\">\r\n {{ option.name + ' (' + option.accountNo + ')' }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingAccountOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.from\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"form.get('from')?.touched && form.get('from')?.hasError(validation.type)\"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <ng-container *ngIf=\"!form.get('isUseExistingTemplate')?.value; else existingTmpl\">\r\n <div\r\n role=\"alert\"\r\n class=\"alert alert-warning d-flex align-items-center\"\r\n style=\"margin-top: 8px; border: 1px solid rgb(243, 124, 44)\"\r\n >\r\n <mat-icon style=\"margin-right: 10px !important\">error_outline</mat-icon>\r\n <div>\r\n Direct Send access restricted for 30 days due to continued misuse. Final warning\r\n before permanent revocation.\r\n </div>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\">\r\n <mat-label class=\"asterix--after\">Body</mat-label>\r\n\r\n <textarea\r\n matInput\r\n rows=\"6\"\r\n cols=\"50\"\r\n cdkTextareaAutosize\r\n cdkAutosizeMinRows=\"2\"\r\n cdkAutosizeMaxRows=\"15\"\r\n formControlName=\"text\"\r\n placeholder=\"Enter text\"\r\n #autosize=\"cdkTextareaAutosize\"\r\n ></textarea>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.text\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('text').touched && form.get('text').hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <app-input\r\n type=\"numeric\"\r\n formControlName=\"ttl\"\r\n label=\"TTL\"\r\n placeholder=\"Enter ttl\"\r\n [trimLeadingZeros]=\"true\"\r\n ></app-input>\r\n </div>\r\n\r\n <div *ngIf=\"!isReadOnlyMode\">\r\n <mat-checkbox formControlName=\"isNeedSave\">\r\n Save this message as future template\r\n </mat-checkbox>\r\n </div>\r\n </ng-container>\r\n\r\n <ng-template #existingTmpl>\r\n <div\r\n role=\"alert\"\r\n class=\"alert alert-warning d-flex align-items-center\"\r\n style=\"margin-top: 8px; border: 1px solid rgb(243, 124, 44)\"\r\n >\r\n <mat-icon style=\"margin-right: 10px !important\">error_outline</mat-icon>\r\n <div>\r\n Direct Send access restricted for 30 days due to continued misuse. Final warning\r\n before permanent revocation.\r\n </div>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <mat-form-field appearance=\"outline\" floatLabel=\"always\" class=\"w-100\">\r\n <mat-label class=\"asterix--after\">Template</mat-label>\r\n\r\n <mat-select\r\n matSelectInfiniteScroll\r\n formControlName=\"template\"\r\n placeholder=\"Select template\"\r\n [complete]=\"isHaveNextTemplateOption === false\"\r\n [compareWith]=\"templateSelectedDisplay\"\r\n (infiniteScroll)=\"getNextTemplateBatch()\"\r\n (selectionChange)=\"updateTemplate($event.value)\"\r\n >\r\n <div style=\"margin: 20px\">\r\n <lib-search\r\n [placeholder]=\"'Search'\"\r\n [currentValue]=\"form?.get('template').value?.name\"\r\n (searchRes)=\"updateSearch($event)\"\r\n ></lib-search>\r\n </div>\r\n\r\n <mat-option *ngFor=\"let option of templateOption\" [value]=\"option\">\r\n {{ option.name }}\r\n </mat-option>\r\n <mat-option *ngIf=\"isLoadingTemplateOption\">Loading...</mat-option>\r\n </mat-select>\r\n </mat-form-field>\r\n\r\n <mat-error align=\"end\" *ngFor=\"let validation of validationMessages.template\">\r\n <p\r\n class=\"font-12px mb-0\"\r\n *ngIf=\"\r\n form.get('template')?.touched &&\r\n form.get('template')?.hasError(validation.type)\r\n \"\r\n >\r\n {{ validation.message }}\r\n </p>\r\n </mat-error>\r\n </div>\r\n\r\n <div class=\"form-group\">\r\n <app-input\r\n type=\"numeric\"\r\n formControlName=\"ttl\"\r\n label=\"TTL\"\r\n placeholder=\"Enter ttl\"\r\n [trimLeadingZeros]=\"true\"\r\n ></app-input>\r\n </div>\r\n </ng-template>\r\n </ng-container>\r\n</form>\r\n",
4276
4455
  styles: [".asterix--after:after{content:\"*\";color:red}"]
4277
4456
  })
4278
4457
  ], GeneralInformationWAComponent);
@@ -4340,7 +4519,7 @@ let FailoverMechanismComponent = class FailoverMechanismComponent {
4340
4519
  }
4341
4520
  initForm() {
4342
4521
  this.form = new FormGroup({
4343
- active: new FormControl(false, Validators.required),
4522
+ active: new FormControl(false, Validators$1.required),
4344
4523
  type: new FormControl(''),
4345
4524
  interval: new FormControl(null),
4346
4525
  accounts: new FormArray([]),
@@ -4388,7 +4567,7 @@ let FailoverMechanismComponent = class FailoverMechanismComponent {
4388
4567
  }
4389
4568
  : (_g = (_f = data) === null || _f === void 0 ? void 0 : _f.accountId, (_g !== null && _g !== void 0 ? _g : '')),
4390
4569
  disabled: this.isReadOnlyMode,
4391
- }, Validators.required),
4570
+ }, Validators$1.required),
4392
4571
  accountName: new FormControl((_j = (_h = data) === null || _h === void 0 ? void 0 : _h.accountName, (_j !== null && _j !== void 0 ? _j : ''))),
4393
4572
  subject: new FormControl({
4394
4573
  value: (_l = (_k = data) === null || _k === void 0 ? void 0 : _k.subject, (_l !== null && _l !== void 0 ? _l : '')),
@@ -4414,7 +4593,7 @@ let FailoverMechanismComponent = class FailoverMechanismComponent {
4414
4593
  }
4415
4594
  initParameter() {
4416
4595
  const form = new FormGroup({
4417
- name: new FormControl('', Validators.required),
4596
+ name: new FormControl('', Validators$1.required),
4418
4597
  });
4419
4598
  return form;
4420
4599
  }
@@ -4517,7 +4696,7 @@ let FailoverMechanismComponent = class FailoverMechanismComponent {
4517
4696
  this.form
4518
4697
  .get('type')
4519
4698
  .setValue((_c = (_b = (_a = this.getCampaignStorage) === null || _a === void 0 ? void 0 : _a.failover) === null || _b === void 0 ? void 0 : _b.type, (_c !== null && _c !== void 0 ? _c : '')));
4520
- this.form.get('type').setValidators(Validators.required);
4699
+ this.form.get('type').setValidators(Validators$1.required);
4521
4700
  this.form.get('type').updateValueAndValidity();
4522
4701
  if (_active) {
4523
4702
  const accounts = (_f = (_e = (_d = this.getCampaignStorage) === null || _d === void 0 ? void 0 : _d.failover) === null || _e === void 0 ? void 0 : _e.accounts) === null || _f === void 0 ? void 0 : _f.filter((t) => {
@@ -4553,7 +4732,7 @@ let FailoverMechanismComponent = class FailoverMechanismComponent {
4553
4732
  .setValue((_c = (_b = (_a = this.getCampaignStorage) === null || _a === void 0 ? void 0 : _a.failover) === null || _b === void 0 ? void 0 : _b.interval, (_c !== null && _c !== void 0 ? _c : null)));
4554
4733
  this.form
4555
4734
  .get('interval')
4556
- .setValidators([Validators.required, intervalTimeValidator()]);
4735
+ .setValidators([Validators$1.required, intervalTimeValidator()]);
4557
4736
  this.form.get('interval').updateValueAndValidity();
4558
4737
  return;
4559
4738
  }
@@ -4566,9 +4745,9 @@ let FailoverMechanismComponent = class FailoverMechanismComponent {
4566
4745
  const isChooseAccount = this.getAccount.filter(control => control.get('accountId').value);
4567
4746
  this.getAccount.forEach(control => {
4568
4747
  var _a;
4569
- control.get('accountId').setValidators(Validators.required);
4570
- control.get('subject').setValidators(Validators.required);
4571
- control.get('template').setValidators(Validators.required);
4748
+ control.get('accountId').setValidators(Validators$1.required);
4749
+ control.get('subject').setValidators(Validators$1.required);
4750
+ control.get('template').setValidators(Validators$1.required);
4572
4751
  if (!control.get('accountId').value &&
4573
4752
  ((_a = isChooseAccount) === null || _a === void 0 ? void 0 : _a.length) > 0) {
4574
4753
  control.get('accountId').clearValidators();
@@ -4674,10 +4853,10 @@ let GeneralInformationComponent = class GeneralInformationComponent {
4674
4853
  this.form = new FormGroup({
4675
4854
  id: new FormControl(null),
4676
4855
  campaignName: new FormControl(null, [
4677
- Validators.required,
4678
- Validators.maxLength(100),
4856
+ Validators$1.required,
4857
+ Validators$1.maxLength(100),
4679
4858
  ]),
4680
- medium: new FormControl(null, [Validators.required]),
4859
+ medium: new FormControl(null, [Validators$1.required]),
4681
4860
  });
4682
4861
  this.form.valueChanges.subscribe(() => {
4683
4862
  this.isTouchedWAForm = !this.isTouchedWAForm;
@@ -5128,7 +5307,7 @@ let SchedulerComponent = class SchedulerComponent {
5128
5307
  }
5129
5308
  initForm() {
5130
5309
  this.form = new FormGroup({
5131
- schedulerType: new FormControl(null, Validators.required),
5310
+ schedulerType: new FormControl(null, Validators$1.required),
5132
5311
  startDate: new FormControl(null),
5133
5312
  startTime: new FormControl(null),
5134
5313
  isRepeat: new FormControl(false),
@@ -5183,9 +5362,9 @@ let SchedulerComponent = class SchedulerComponent {
5183
5362
  this.form.get('isRepeat').setValue(false);
5184
5363
  return;
5185
5364
  }
5186
- this.form.get('startDate').setValidators(Validators.required);
5365
+ this.form.get('startDate').setValidators(Validators$1.required);
5187
5366
  this.form.get('startDate').updateValueAndValidity();
5188
- this.form.get('startTime').setValidators(Validators.required);
5367
+ this.form.get('startTime').setValidators(Validators$1.required);
5189
5368
  this.form.get('startTime').updateValueAndValidity();
5190
5369
  this.initEdit(false);
5191
5370
  }
@@ -5201,7 +5380,7 @@ let SchedulerComponent = class SchedulerComponent {
5201
5380
  }
5202
5381
  updateRepeat(isChecked) {
5203
5382
  if (isChecked) {
5204
- this.form.get('delivery').setValidators(Validators.required);
5383
+ this.form.get('delivery').setValidators(Validators$1.required);
5205
5384
  this.form.get('delivery').updateValueAndValidity();
5206
5385
  return;
5207
5386
  }
@@ -5321,6 +5500,7 @@ CampaignManagementModule = __decorate([
5321
5500
  MatSlideToggleModule,
5322
5501
  DragDropModule,
5323
5502
  CampaignIndexModule,
5503
+ InputNumericModule,
5324
5504
  ],
5325
5505
  exports: [CampaignManagementComponent, SummaryComponent],
5326
5506
  entryComponents: [PendingApprovalDialogViewComponent],
@@ -5368,5 +5548,5 @@ ConfirmationModule = __decorate([
5368
5548
  * Generated bundle index. Do not edit.
5369
5549
  */
5370
5550
 
5371
- export { AdlCampaignManagementLibraryInternalComponent, AdlCampaignManagementLibraryInternalModule, CampaignIndexModule, CampaignManagementComponent, CampaignManagementModule, ConfirmationComponent, ConfirmationModule, DashboardModule, SearchModule, WizardComponent as ɵa, NewCampaignComponent as ɵb, GeneralInformationComponent as ɵc, SchedulerComponent as ɵd, SummaryComponent as ɵe, NewNumberBasesComponent as ɵf, GeneralInformationLineComponent as ɵg, GeneralInformationWAComponent as ɵh, GeneralInformationSMSComponent as ɵi, GeneralInformationEmailComponent as ɵj, PendingApprovalDialogViewComponent as ɵk, FailoverMechanismComponent as ɵl, DashboardComponent as ɵm, ApiAdapterServiceService as ɵn, SearchComponent as ɵo, ViewingListOfCampaignTableComponent as ɵp, FilterInListOfCampaignComponent as ɵq, CampaignIndexComponent as ɵr, ApiAdapterServiceService as ɵs, MatSelectInfiniteScrollDirective as ɵt, CustomPaginator as ɵu, ConfirmationComponent as ɵv, ConfirmationModel as ɵw, SharedServicesService as ɵx };
5551
+ export { AdlCampaignManagementLibraryInternalComponent, AdlCampaignManagementLibraryInternalModule, CampaignIndexModule, CampaignManagementComponent, CampaignManagementModule, ConfirmationComponent, ConfirmationModule, DashboardModule, SearchModule, WizardComponent as ɵa, NewCampaignComponent as ɵb, GeneralInformationComponent as ɵc, SchedulerComponent as ɵd, SummaryComponent as ɵe, NewNumberBasesComponent as ɵf, GeneralInformationLineComponent as ɵg, GeneralInformationWAComponent as ɵh, GeneralInformationSMSComponent as ɵi, GeneralInformationEmailComponent as ɵj, PendingApprovalDialogViewComponent as ɵk, FailoverMechanismComponent as ɵl, DashboardComponent as ɵm, ApiAdapterServiceService as ɵn, SearchComponent as ɵo, ViewingListOfCampaignTableComponent as ɵp, FilterInListOfCampaignComponent as ɵq, CampaignIndexComponent as ɵr, ApiAdapterServiceService as ɵs, MatSelectInfiniteScrollDirective as ɵt, InputNumericModule as ɵu, InputNumericComponent as ɵv, CustomPaginator as ɵw, ConfirmationComponent as ɵx, ConfirmationModel as ɵy, SharedServicesService as ɵz };
5372
5552
  //# sourceMappingURL=adlfe-campaign-management-library.js.map