@datarailsshared/datarailsshared 1.4.177 → 1.4.179

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.
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/material/core'), require('@angular/material-moment-adapter'), require('lodash'), require('@angular/forms'), require('@angular/common'), require('rxjs'), require('rxjs/operators'), require('@ng-select/ng-select'), require('@angular/animations'), require('@angular/cdk/overlay'), require('@angular/cdk/portal'), require('@angular/material/dialog'), require('@angular/material/datepicker'), require('moment'), require('@angular/material/tooltip'), require('@angular/material/tabs'), require('@angular/platform-browser')) :
3
- typeof define === 'function' && define.amd ? define('@datarailsshared/datarailsshared', ['exports', '@angular/core', '@angular/material/core', '@angular/material-moment-adapter', 'lodash', '@angular/forms', '@angular/common', 'rxjs', 'rxjs/operators', '@ng-select/ng-select', '@angular/animations', '@angular/cdk/overlay', '@angular/cdk/portal', '@angular/material/dialog', '@angular/material/datepicker', 'moment', '@angular/material/tooltip', '@angular/material/tabs', '@angular/platform-browser'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.datarailsshared = global.datarailsshared || {}, global.datarailsshared.datarailsshared = {}), global.ng.core, global.ng.material.core, global.ng.materialMomentAdapter, global._, global.ng.forms, global.ng.common, global.rxjs, global.rxjs.operators, global.ngSelect, global.ng.animations, global.ng.cdk.overlay, global.ng.cdk.portal, global.ng.material.dialog, global.ng.material.datepicker, global.moment$9, global.ng.material.tooltip, global.ng.material.tabs, global.ng.platformBrowser));
5
- })(this, (function (exports, i0, core, materialMomentAdapter, _, forms, common, rxjs, operators, ngSelect, animations, i1, portal, i1$1, datepicker, moment$9, tooltip, tabs, platformBrowser) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/material/core'), require('@angular/material-moment-adapter'), require('lodash'), require('@angular/forms'), require('@angular/common'), require('rxjs'), require('rxjs/operators'), require('@ng-select/ng-select'), require('@angular/animations'), require('@angular/cdk/overlay'), require('@angular/cdk/portal'), require('@angular/material/dialog'), require('@angular/platform-browser'), require('@angular/material/datepicker'), require('moment'), require('@angular/material/tooltip'), require('@angular/material/tabs')) :
3
+ typeof define === 'function' && define.amd ? define('@datarailsshared/datarailsshared', ['exports', '@angular/core', '@angular/material/core', '@angular/material-moment-adapter', 'lodash', '@angular/forms', '@angular/common', 'rxjs', 'rxjs/operators', '@ng-select/ng-select', '@angular/animations', '@angular/cdk/overlay', '@angular/cdk/portal', '@angular/material/dialog', '@angular/platform-browser', '@angular/material/datepicker', 'moment', '@angular/material/tooltip', '@angular/material/tabs'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.datarailsshared = global.datarailsshared || {}, global.datarailsshared.datarailsshared = {}), global.ng.core, global.ng.material.core, global.ng.materialMomentAdapter, global._, global.ng.forms, global.ng.common, global.rxjs, global.rxjs.operators, global.ngSelect, global.ng.animations, global.ng.cdk.overlay, global.ng.cdk.portal, global.ng.material.dialog, global.ng.platformBrowser, global.ng.material.datepicker, global.moment$9, global.ng.material.tooltip, global.ng.material.tabs));
5
+ })(this, (function (exports, i0, core, materialMomentAdapter, _, forms, common, rxjs, operators, ngSelect, animations, i1, portal, i1$1, platformBrowser, datepicker, moment$9, tooltip, tabs) { 'use strict';
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -4221,58 +4221,6 @@
4221
4221
  collapse: [{ type: i0.Input }]
4222
4222
  };
4223
4223
 
4224
- exports.TooltipPosition = void 0;
4225
- (function (TooltipPosition) {
4226
- TooltipPosition["TOP"] = "top";
4227
- TooltipPosition["BOTTOM"] = "bottom";
4228
- TooltipPosition["LEFT"] = "left";
4229
- TooltipPosition["RIGHT"] = "right";
4230
- TooltipPosition["TOP_RIGHT"] = "top-right";
4231
- TooltipPosition["TOP_LEFT"] = "top-left";
4232
- TooltipPosition["BOTTOM_RIGHT"] = "bottom-right";
4233
- TooltipPosition["BOTTOM_LEFT"] = "bottom-left";
4234
- TooltipPosition["RIGHT_TOP"] = "right-top";
4235
- TooltipPosition["RIGHT_BOTTOM"] = "right-bottom";
4236
- TooltipPosition["LEFT_TOP"] = "left-top";
4237
- TooltipPosition["LEFT_BOTTOM"] = "left-bottom";
4238
- })(exports.TooltipPosition || (exports.TooltipPosition = {}));
4239
-
4240
- exports.Scenario = void 0;
4241
- (function (Scenario) {
4242
- Scenario["ACTUALS"] = "Actuals";
4243
- Scenario["FORECAST"] = "Forecast";
4244
- Scenario["BUDGET"] = "Budget";
4245
- Scenario["NONE"] = "None";
4246
- })(exports.Scenario || (exports.Scenario = {}));
4247
-
4248
- var DrModelDebounceChangeDirective = /** @class */ (function () {
4249
- function DrModelDebounceChangeDirective(ngModel) {
4250
- this.ngModel = ngModel;
4251
- this.debounce = 200;
4252
- this.ngModelDebounceChange = new i0.EventEmitter();
4253
- }
4254
- DrModelDebounceChangeDirective.prototype.ngOnInit = function () {
4255
- var _this = this;
4256
- this.subscription = this.ngModel.control.valueChanges.pipe(operators.skip(1), operators.debounceTime(this.debounce), operators.distinctUntilChanged()).subscribe(function (value) { return _this.ngModelDebounceChange.emit(value); });
4257
- };
4258
- DrModelDebounceChangeDirective.prototype.ngOnDestroy = function () {
4259
- this.subscription.unsubscribe();
4260
- };
4261
- return DrModelDebounceChangeDirective;
4262
- }());
4263
- DrModelDebounceChangeDirective.decorators = [
4264
- { type: i0.Directive, args: [{
4265
- selector: '[ngModelDebounceChange]'
4266
- },] }
4267
- ];
4268
- DrModelDebounceChangeDirective.ctorParameters = function () { return [
4269
- { type: forms.NgModel }
4270
- ]; };
4271
- DrModelDebounceChangeDirective.propDecorators = {
4272
- debounce: [{ type: i0.Input }],
4273
- ngModelDebounceChange: [{ type: i0.Output }]
4274
- };
4275
-
4276
4224
  var IMAGE_TYPES = ['image/png', 'image/jpeg', 'image/gif'];
4277
4225
  exports.CHAT_MESSAGE_TYPE = void 0;
4278
4226
  (function (CHAT_MESSAGE_TYPE) {
@@ -4310,314 +4258,856 @@
4310
4258
  return ChatMessage;
4311
4259
  }());
4312
4260
 
4313
- exports.BadgeStatus = void 0;
4314
- (function (BadgeStatus) {
4315
- BadgeStatus["INFO"] = "info";
4316
- BadgeStatus["ERROR"] = "error";
4317
- BadgeStatus["WARNING"] = "warning";
4318
- BadgeStatus["SUCCESS"] = "success";
4319
- BadgeStatus["REGULAR"] = "regular";
4320
- BadgeStatus["PROGRESS"] = "progress";
4321
- BadgeStatus["DOTTED"] = "dotted";
4322
- })(exports.BadgeStatus || (exports.BadgeStatus = {}));
4323
-
4324
- var _a;
4325
- var allDateTags = (_a = {},
4326
- _a[TagsConfigSubType.YEAR] = {
4327
- name: 'Date',
4328
- toggle: false,
4329
- },
4330
- _a[TagsConfigSubType.QUARTER] = {
4331
- name: 'Date',
4332
- toggle: false,
4333
- },
4334
- _a[TagsConfigSubType.MONTH] = {
4335
- name: 'Date',
4336
- toggle: false,
4337
- },
4338
- _a[TagsConfigSubType.DAY] = {
4339
- name: 'Date',
4340
- toggle: false,
4341
- },
4342
- _a[TagsConfigSubType.WEEK] = {
4343
- name: 'Date',
4344
- toggle: false,
4345
- },
4346
- _a);
4347
- function getScenarioTagDataConfig(isMultipleDimension) {
4348
- var _a, _b, _c, _d, _e;
4349
- return _a = {},
4350
- _a[exports.Scenario.ACTUALS] = Object.assign(Object.assign({}, allDateTags), (_b = {}, _b[TagsConfigSubType.MONTH] = {
4351
- name: 'Date',
4352
- toggle: true,
4353
- }, _b[TagsConfigSubType.FILE_STATUS] = {
4354
- toggle: false,
4355
- }, _b)),
4356
- _a[exports.Scenario.BUDGET] = (_c = {},
4357
- _c[TagsConfigSubType.BUDGET_CYCLE] = {
4358
- toggle: true,
4359
- acceptableDateTags: [TagsConfigSubType.YEAR],
4360
- hidden: !isMultipleDimension,
4361
- },
4362
- _c[TagsConfigSubType.PLAN] = {
4363
- toggle: false,
4364
- turnOffDateTags: true,
4365
- hidden: isMultipleDimension,
4366
- },
4367
- _c[TagsConfigSubType.YEAR] = {
4368
- name: 'Date',
4369
- toggle: true,
4370
- },
4371
- _c[TagsConfigSubType.QUARTER] = {
4372
- name: 'Date',
4373
- toggle: false,
4374
- },
4375
- _c[TagsConfigSubType.FILE_STATUS] = {
4376
- toggle: false,
4377
- },
4378
- _c),
4379
- _a[exports.Scenario.FORECAST] = (_d = {},
4380
- _d[TagsConfigSubType.FORECAST_NEW] = {
4381
- toggle: true,
4382
- name: 'Date',
4383
- },
4384
- _d[TagsConfigSubType.FILE_STATUS] = {
4385
- toggle: false,
4386
- },
4387
- _d),
4388
- _a[exports.Scenario.NONE] = Object.assign(Object.assign({}, allDateTags), (_e = {}, _e[TagsConfigSubType.MONTH] = {
4389
- name: 'Date',
4390
- toggle: true,
4391
- }, _e[TagsConfigSubType.FILE_STATUS] = {
4392
- toggle: true,
4393
- }, _e)),
4394
- _a;
4395
- }
4396
-
4397
- var ScenarioService = /** @class */ (function () {
4398
- function ScenarioService() {
4399
- this.DEFAULT_FORECAST_DATE_TAG = 'Month';
4261
+ var DrChatFormComponent = /** @class */ (function () {
4262
+ function DrChatFormComponent(cdr, domSanitizer) {
4263
+ this.cdr = cdr;
4264
+ this.domSanitizer = domSanitizer;
4265
+ this._textareaInitialHeight = true;
4266
+ this.inputFocus = false;
4267
+ this.inputHover = false;
4268
+ this.droppedFiles = [];
4269
+ /**
4270
+ * Predefined message text
4271
+ *
4272
+ * @type {string}
4273
+ */
4274
+ this.message = '';
4275
+ /**
4276
+ * Message placeholder text
4277
+ *
4278
+ * @type {string}
4279
+ */
4280
+ this.messagePlaceholder = 'Type a message';
4281
+ /**
4282
+ * Show send button
4283
+ *
4284
+ * @type {boolean}
4285
+ */
4286
+ this.dropFiles = false;
4287
+ /**
4288
+ * File drop placeholder text
4289
+ *
4290
+ * @type {string}
4291
+ */
4292
+ this.dropFilePlaceholder = 'Drop file to send';
4293
+ /**
4294
+ * Parameter to check is send message function available
4295
+ *
4296
+ * @type {boolean}
4297
+ */
4298
+ this.waitForReply = false;
4299
+ /**
4300
+ *
4301
+ * @type {EventEmitter<{ message: string, files: File[] }>}
4302
+ */
4303
+ this.send = new i0.EventEmitter();
4304
+ this.abort = new i0.EventEmitter();
4305
+ /**
4306
+ * Emits when message input value has been changed
4307
+ *
4308
+ * @type {EventEmitter<string>}
4309
+ */
4310
+ this.inputChange = new i0.EventEmitter();
4311
+ this.fileOver = false;
4400
4312
  }
4401
- Object.defineProperty(ScenarioService.prototype, "scenarios", {
4402
- get: function () {
4403
- return _.orderBy(Object.values(exports.Scenario), function (scenario) { return scenario === exports.Scenario.NONE ? 1 : 0; });
4404
- },
4405
- enumerable: false,
4406
- configurable: true
4407
- });
4408
- Object.defineProperty(ScenarioService.prototype, "areExistingTagsConfig", {
4409
- get: function () {
4410
- return !!this.currentTagsConfig;
4411
- },
4412
- enumerable: false,
4413
- configurable: true
4414
- });
4415
- ScenarioService.prototype.initScenarioTags = function (wholeTagsConfig, currentTagsConfig, isMultipleDimension) {
4416
- if (!(wholeTagsConfig === null || wholeTagsConfig === void 0 ? void 0 : wholeTagsConfig.length))
4417
- return;
4418
- this.wholeTagsConfig = _.cloneDeep(wholeTagsConfig);
4419
- this.currentTagsConfig = currentTagsConfig;
4420
- this.isMultipleDimension = isMultipleDimension;
4313
+ DrChatFormComponent.prototype.onDrop = function (event) {
4314
+ var e_1, _b;
4315
+ var _this = this;
4316
+ var _a;
4317
+ if (this.dropFiles) {
4318
+ event.preventDefault();
4319
+ event.stopPropagation();
4320
+ this.fileOver = false;
4321
+ if ((_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) {
4322
+ var _loop_1 = function (file) {
4323
+ var res = file;
4324
+ if (IMAGE_TYPES.includes(file.type)) {
4325
+ var fr = new FileReader();
4326
+ fr.onload = function (e) {
4327
+ res.src = e.target.result;
4328
+ res.urlStyle = _this.domSanitizer.bypassSecurityTrustStyle("url(" + res.src + ")");
4329
+ _this.cdr.detectChanges();
4330
+ };
4331
+ fr.readAsDataURL(file);
4332
+ }
4333
+ this_1.droppedFiles.push(res);
4334
+ };
4335
+ var this_1 = this;
4336
+ try {
4337
+ for (var _c = __values(event.dataTransfer.files), _d = _c.next(); !_d.done; _d = _c.next()) {
4338
+ var file = _d.value;
4339
+ _loop_1(file);
4340
+ }
4341
+ }
4342
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
4343
+ finally {
4344
+ try {
4345
+ if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
4346
+ }
4347
+ finally { if (e_1) throw e_1.error; }
4348
+ }
4349
+ }
4350
+ }
4421
4351
  };
4422
- ScenarioService.prototype.getTagsConfigByScenarioTags = function (scenarioTags, tagsConfig) {
4423
- var scenarioTagsConfig = _.filter(tagsConfig, function (tagConfig) { return _.some(scenarioTags, function (scenarioTag) { return scenarioTag.toggle && scenarioTag.selectedTagSubType === tagConfig.options.sub_type; }); });
4424
- return this.sortScenarioTags(scenarioTagsConfig);
4352
+ DrChatFormComponent.prototype.removeFile = function (file) {
4353
+ var index = this.droppedFiles.indexOf(file);
4354
+ if (index >= 0) {
4355
+ this.droppedFiles.splice(index, 1);
4356
+ }
4425
4357
  };
4426
- ScenarioService.prototype.getScenarioTagsByScenario = function (scenario) {
4427
- var _this = this;
4428
- var scenarioTagsConfig = this.getScenarioTagsConfig(scenario, this.wholeTagsConfig);
4429
- var scenarioTagsUi = [];
4430
- _.forEach(scenarioTagsConfig, function (scenarioTag) {
4431
- var isTagWithSubTags = scenarioTag.type === exports.TagTypes.DATE;
4432
- var tagWithSubTags = isTagWithSubTags && _.find(scenarioTagsUi, { type: scenarioTag.type });
4433
- var tag = tagWithSubTags || _this.prepareScenarioTag(scenarioTagsConfig, scenarioTag, scenario, isTagWithSubTags);
4434
- if (isTagWithSubTags) {
4435
- _this.updateScenarioSubTags(tag, scenarioTag);
4436
- tag.subTags = _this.sortedScenarioSubTags(tag);
4437
- }
4438
- if (tagWithSubTags)
4439
- return;
4440
- scenarioTagsUi.push(tag);
4441
- });
4442
- if (this.areExistingTagsConfig) {
4443
- this.initExistingTagsConfig(scenario, scenarioTagsUi);
4444
- }
4445
- var isTagNotSupportingDates = _.some(scenarioTagsUi, { turnOffDateTags: true, toggle: true });
4446
- if (isTagNotSupportingDates) {
4447
- this.turnOffDateTag(scenarioTagsUi);
4448
- }
4449
- var tagWithSpecificDateTags = _.find(scenarioTagsUi, function (tag) { var _a; return tag.toggle && !!((_a = tag.acceptableDateTags) === null || _a === void 0 ? void 0 : _a.length); });
4450
- if (tagWithSpecificDateTags) {
4451
- this.hideNotAvailableTags(tagWithSpecificDateTags, scenarioTagsUi);
4452
- }
4453
- return this.sortScenarioTags(scenarioTagsUi);
4454
- };
4455
- ScenarioService.prototype.sortScenarioTags = function (scenarioTagsUi) {
4456
- return _.orderBy(scenarioTagsUi, [
4457
- function (tag) { return (tag.type === exports.TagTypes.DATE ? 0 : 1); },
4458
- function (tag) { return (tag.name === 'File Status'); }
4459
- ]);
4460
- };
4461
- ScenarioService.prototype.initExistingTagsConfig = function (scenario, scenarioTagsUi) {
4462
- var _this = this;
4463
- _.forEach(this.currentTagsConfig, function (tagConfig) {
4464
- var _a;
4465
- var tagSubType = (_a = tagConfig === null || tagConfig === void 0 ? void 0 : tagConfig.options) === null || _a === void 0 ? void 0 : _a.sub_type;
4466
- var scenarioTagDataConfig = getScenarioTagDataConfig(_this.isMultipleDimension);
4467
- if (!scenarioTagDataConfig || !scenarioTagDataConfig[scenario] || !scenarioTagDataConfig[scenario][tagSubType]) {
4468
- return;
4469
- }
4470
- var scenarioTagUi = tagConfig.type === exports.TagTypes.DATE
4471
- ? _.find(scenarioTagsUi, { type: tagConfig.type })
4472
- : _.find(scenarioTagsUi, { selectedTagSubType: tagSubType });
4473
- scenarioTagUi.toggle = true;
4474
- scenarioTagUi.selectedTagSubType = tagSubType;
4475
- });
4476
- };
4477
- ScenarioService.prototype.prepareScenarioTag = function (scenarioTagsConfig, scenarioTag, scenario, isDateTag) {
4478
- var toggleStatus = isDateTag
4479
- ? _.some(scenarioTagsConfig, function (tag) { return tag.type === exports.TagTypes.DATE && tag.scenarioData.toggle; })
4480
- : scenarioTag.scenarioData.toggle;
4481
- var selectedTagSubType = isDateTag
4482
- ? this.getScenarioSelectedDateTag(scenario, scenarioTagsConfig)
4483
- : scenarioTag.options.sub_type;
4484
- var tag = {
4485
- toggle: this.areExistingTagsConfig ? false : toggleStatus,
4486
- name: scenarioTag.scenarioData.name || scenarioTag.name,
4487
- description: scenarioTag.scenarioData.description || scenarioTag.description,
4488
- type: scenarioTag.type,
4489
- selectedTagSubType: selectedTagSubType,
4490
- };
4491
- if (scenarioTag.scenarioData.turnOffDateTags) {
4492
- tag.turnOffDateTags = scenarioTag.scenarioData.turnOffDateTags;
4493
- }
4494
- if (scenarioTag.scenarioData.acceptableDateTags) {
4495
- tag.acceptableDateTags = scenarioTag.scenarioData.acceptableDateTags;
4358
+ DrChatFormComponent.prototype.onDragOver = function (event) {
4359
+ event.preventDefault();
4360
+ event.stopPropagation();
4361
+ if (this.dropFiles) {
4362
+ this.fileOver = true;
4496
4363
  }
4497
- return tag;
4498
- };
4499
- ScenarioService.prototype.sortedScenarioSubTags = function (tag) {
4500
- var SUB_TAGS_ORDER = [TagsConfigSubType.DAY, TagsConfigSubType.WEEK, TagsConfigSubType.MONTH, TagsConfigSubType.QUARTER, TagsConfigSubType.YEAR];
4501
- return _.orderBy(tag.subTags, function (subTag) { return _.indexOf(SUB_TAGS_ORDER, subTag.subType); });
4502
4364
  };
4503
- ScenarioService.prototype.updateScenarioSubTags = function (tag, scenarioTag) {
4504
- if (!tag.subTags) {
4505
- tag.subTags = [];
4365
+ DrChatFormComponent.prototype.onDragLeave = function (event) {
4366
+ event.preventDefault();
4367
+ event.stopPropagation();
4368
+ if (this.dropFiles) {
4369
+ this.fileOver = false;
4506
4370
  }
4507
- var tagSubType = scenarioTag.options.sub_type;
4508
- tag.subTags.push({
4509
- subType: tagSubType,
4510
- name: tagSubType === TagsConfigSubType.FORECAST_NEW ? this.DEFAULT_FORECAST_DATE_TAG : scenarioTag.name,
4511
- });
4512
4371
  };
4513
- ScenarioService.prototype.turnOffDateTag = function (scenarioTags) {
4514
- var dateTag = _.find(scenarioTags, { type: exports.TagTypes.DATE });
4515
- if (!dateTag)
4372
+ DrChatFormComponent.prototype.sendMessage = function () {
4373
+ if (this.waitForReply) {
4516
4374
  return;
4517
- dateTag.toggle = false;
4375
+ }
4376
+ if (this.droppedFiles.length || String(this.message).trim().length) {
4377
+ this._textareaInitialHeight = true;
4378
+ this.send.emit({ message: this.message, files: this.droppedFiles });
4379
+ this.message = '';
4380
+ this.droppedFiles = [];
4381
+ this.cdr.markForCheck();
4382
+ }
4518
4383
  };
4519
- ScenarioService.prototype.hideNotAvailableTags = function (tagWithSpecificDateTags, scenarioTags) {
4520
- var _a;
4521
- var subTags = (_a = _.find(scenarioTags, { type: exports.TagTypes.DATE })) === null || _a === void 0 ? void 0 : _a.subTags;
4522
- if (!subTags.length)
4523
- return;
4524
- _.forEach(scenarioTags, function (tag) {
4525
- var _a;
4526
- if (!((_a = tag.acceptableDateTags) === null || _a === void 0 ? void 0 : _a.length))
4527
- return;
4528
- if (tag !== tagWithSpecificDateTags) {
4529
- tag.toggle = false;
4530
- }
4531
- });
4532
- _.forEach(subTags, function (subTag) {
4533
- subTag.hidden = !tagWithSpecificDateTags.acceptableDateTags.includes(subTag.subType);
4534
- });
4384
+ DrChatFormComponent.prototype.abortMessage = function () {
4385
+ this.abort.emit();
4535
4386
  };
4536
- ScenarioService.prototype.getScenarioSelectedDateTag = function (scenario, dateTags) {
4537
- var _c;
4538
- var _a, _b;
4539
- var monthSubType = (_b = (_a = _.find(dateTags, function (tag) { return tag.options.sub_type === TagsConfigSubType.MONTH; })) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.sub_type;
4540
- var scenarioSelectedDateTag = (_c = {},
4541
- _c[exports.Scenario.ACTUALS] = function () { return monthSubType; },
4542
- _c[exports.Scenario.BUDGET] = function () { var _a, _b; return (_b = (_a = _.find(dateTags, function (tag) { return tag.options.sub_type === TagsConfigSubType.YEAR; })) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.sub_type; },
4543
- _c[exports.Scenario.FORECAST] = function () { var _a, _b; return (_b = (_a = _.find(dateTags, function (tag) { return tag.options.sub_type === TagsConfigSubType.FORECAST_NEW; })) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.sub_type; },
4544
- _c[exports.Scenario.NONE] = function () { return monthSubType; },
4545
- _c);
4546
- if (!scenarioSelectedDateTag[scenario])
4547
- return;
4548
- return scenarioSelectedDateTag[scenario]();
4387
+ DrChatFormComponent.prototype.onModelChange = function (value) {
4388
+ this._textareaInitialHeight = false;
4389
+ this.inputChange.emit(value);
4549
4390
  };
4550
- ScenarioService.prototype.getScenarioTagsConfig = function (scenario, tagsConfig) {
4551
- var _this = this;
4552
- return _.reduce(tagsConfig, function (acc, tagConfig) {
4553
- var _a;
4554
- var tagSubType = (_a = tagConfig === null || tagConfig === void 0 ? void 0 : tagConfig.options) === null || _a === void 0 ? void 0 : _a.sub_type;
4555
- var scenarioTagDataConfig = getScenarioTagDataConfig(_this.isMultipleDimension);
4556
- var scenarioTagConfig = scenarioTagDataConfig && scenarioTagDataConfig[scenario] ?
4557
- scenarioTagDataConfig[scenario][tagSubType] : null;
4558
- if (!scenarioTagConfig || scenarioTagConfig.hidden)
4559
- return acc;
4560
- var clonedTagConfig = _.cloneDeep(tagConfig);
4561
- var scenarioTag = Object.assign(Object.assign({}, clonedTagConfig), { scenarioData: scenarioTagConfig });
4562
- acc.push(scenarioTag);
4563
- return acc;
4564
- }, []);
4391
+ DrChatFormComponent.prototype.getTextAreaHeight = function (textAreaElement) {
4392
+ var height;
4393
+ if (this._textareaInitialHeight) {
4394
+ height = 50;
4395
+ }
4396
+ else {
4397
+ height = textAreaElement.scrollHeight + 2;
4398
+ }
4399
+ return "height: " + height + "px;";
4565
4400
  };
4566
- return ScenarioService;
4401
+ return DrChatFormComponent;
4567
4402
  }());
4568
- ScenarioService.decorators = [
4569
- { type: i0.Injectable }
4403
+ DrChatFormComponent.decorators = [
4404
+ { type: i0.Component, args: [{
4405
+ selector: 'dr-chat-form',
4406
+ template: "<div class=\"dropped-files\" *ngIf=\"droppedFiles?.length\">\n <div class=\"dropped-files__item\" *ngFor=\"let file of droppedFiles\">\n <div class=\"dropped-files__item__preview\" [style.background-image]=\"file.urlStyle || 'none'\">\n <i class=\"dr-icon-file\" *ngIf=\"!file.urlStyle\"></i>\n </div>\n <div class=\"dropped-files__item__name\">{{ file.name }}</div>\n <i class=\"dropped-files__item__remove dr-icon-exit\" (click)=\"removeFile(file)\"></i>\n </div>\n</div>\n<div class=\"message-row\">\n <div class=\"message-row__input\">\n <textarea #textAreaElement\n (focus)=\"inputFocus = true\"\n (blur)=\"inputFocus = false\"\n (mouseenter)=\"inputHover = true\"\n (mouseleave)=\"inputHover = false\"\n [(ngModel)]=\"message\"\n [rows]=\"1\"\n [style]=\"getTextAreaHeight(textAreaElement)\"\n (ngModelChange)=\"onModelChange($event)\"\n type=\"text\"\n placeholder=\"{{ fileOver ? dropFilePlaceholder : messagePlaceholder }}\"\n (keyup.enter)=\"sendMessage()\">\n </textarea>\n <i *ngIf=\"!waitForReply\" (click)=\"sendMessage()\" class=\"dr-icon-notify send-button\"></i>\n <dr-dot-flashing *ngIf=\"waitForReply\" class=\"wait-reply-dot-flashing\"></dr-dot-flashing>\n <dr-button *ngIf=\"waitForReply\" (click)=\"abortMessage()\" theme=\"ghost\" class=\"abort-button\">Stop generating</dr-button>\n </div>\n</div>\n",
4407
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
4408
+ styles: [":host{display:flex;flex-direction:column;align-items:center;padding:0 24px;margin-top:12px}:host .message-row{display:flex;justify-content:center;width:100%;padding:0 0 21px;max-width:970px}:host .message-row__input{position:relative;display:flex;align-items:center;flex-grow:1;flex-direction:row;height:auto;overflow:visible;min-width:265px}:host .message-row__input textarea{font-size:14px;line-height:22px;max-height:100%;flex-grow:1;resize:none;padding:14px 40px 12px 23px;margin:auto;border:1px solid #DFE0E3;border-radius:12px;min-height:50px}:host .message-row__input textarea:focus{border:1px solid #7F7FDD}:host .message-row__input textarea::placeholder{color:#9ea1aa}:host .message-row__input .send-button{position:absolute;right:14px;cursor:pointer;color:#dfe0e3;font-size:28px}:host .message-row__input .wait-reply-dot-flashing{position:absolute;right:20px}:host .message-row__input textarea:focus+.send-button,:host .message-row__input .send-button:hover{color:#25258c}:host .message-row__input .abort-button{position:absolute;right:0;top:-44px}:host .message-row__input .abort-button::ng-deep button{background:#F2F2FF!important;border-radius:4px}:host input{flex:1}:host input.with-button{border-bottom-right-radius:0;border-top-right-radius:0}:host .dropped-files{display:flex;flex-direction:row;margin-bottom:.5rem;flex-wrap:wrap}:host .dropped-files__item{display:flex;flex-direction:column;justify-content:center;margin:0 10px 10px 0;position:relative}:host .dropped-files__item__preview{background-size:cover;background-position:center;width:64px;height:64px;border-radius:8px;border:1px solid #ccc}:host .dropped-files__item__preview i{font-size:62px}:host .dropped-files__item__name{white-space:nowrap;font-size:12px;color:#8f929e;margin-top:4px;max-width:64px;overflow:hidden;text-overflow:ellipsis}:host .dropped-files__item__remove{position:absolute;right:-4px;top:-4px;cursor:pointer;background:white;border-radius:12px;color:#8f929e;border:1px solid #8f929e;font-size:14px}\n"]
4409
+ },] }
4570
4410
  ];
4411
+ DrChatFormComponent.ctorParameters = function () { return [
4412
+ { type: i0.ChangeDetectorRef },
4413
+ { type: platformBrowser.DomSanitizer }
4414
+ ]; };
4415
+ DrChatFormComponent.propDecorators = {
4416
+ message: [{ type: i0.Input }],
4417
+ messagePlaceholder: [{ type: i0.Input }],
4418
+ dropFiles: [{ type: i0.Input }],
4419
+ dropFilePlaceholder: [{ type: i0.Input }],
4420
+ waitForReply: [{ type: i0.Input }],
4421
+ send: [{ type: i0.Output }],
4422
+ abort: [{ type: i0.Output }],
4423
+ inputChange: [{ type: i0.Output }],
4424
+ fileOver: [{ type: i0.HostBinding, args: ['class.file-over',] }],
4425
+ onDrop: [{ type: i0.HostListener, args: ['drop', ['$event'],] }],
4426
+ onDragOver: [{ type: i0.HostListener, args: ['dragover', ['$event'],] }],
4427
+ onDragLeave: [{ type: i0.HostListener, args: ['dragleave', ['$event'],] }]
4428
+ };
4571
4429
 
4572
- var DrSharedUtils = /** @class */ (function () {
4573
- function DrSharedUtils() {
4430
+ /**
4431
+ * `DrCustomMessageService` is used to store instances of `DrChatCustomMessageDirective`s which
4432
+ * were provided in the chat component.
4433
+ */
4434
+ var DrChatCustomMessageService = /** @class */ (function () {
4435
+ function DrChatCustomMessageService() {
4436
+ this.customMessages = new Map();
4574
4437
  }
4575
- /**
4576
- * Get timeframe (day, year, month, quarter) based on passed format
4577
- *
4578
- * @param format - date format string. Examples: MM/DD/YYYY, Q/YYYY
4579
- */
4580
- DrSharedUtils.getTimeframeByDateFormat = function (format) {
4581
- var defaultFrame = exports.TimeframeOption.DAY;
4582
- if (!format) {
4583
- return defaultFrame;
4584
- }
4585
- var lowerCaseFormat = format.toLowerCase();
4586
- switch (true) {
4587
- case lowerCaseFormat.includes('q'):
4588
- return exports.TimeframeOption.QUARTER;
4589
- case lowerCaseFormat.includes('d'):
4590
- return exports.TimeframeOption.DAY;
4591
- case lowerCaseFormat.includes('w'):
4592
- return exports.TimeframeOption.WEEK;
4593
- case lowerCaseFormat.includes('m'):
4594
- return exports.TimeframeOption.MONTH;
4595
- case lowerCaseFormat.includes('y'):
4596
- return exports.TimeframeOption.YEAR;
4597
- default:
4598
- return defaultFrame;
4599
- }
4438
+ DrChatCustomMessageService.prototype.register = function (type, instance) {
4439
+ this.customMessages.set(type, instance);
4600
4440
  };
4601
- DrSharedUtils.getDateByTag = function (tag) {
4602
- var todayDate = moment__namespace().utc().endOf('day');
4603
- switch (tag) {
4604
- case exports.DateTags.TODAY:
4605
- return todayDate;
4606
- case exports.DateTags.YESTERDAY:
4607
- todayDate.subtract(1, 'days');
4608
- return todayDate;
4609
- case exports.DateTags.THIS_MONTH:
4610
- todayDate.endOf('month');
4611
- return todayDate;
4612
- case exports.DateTags.PREV_MONTH:
4613
- todayDate.subtract(1, 'months').endOf('month');
4614
- return todayDate;
4615
- }
4441
+ DrChatCustomMessageService.prototype.unregister = function (type) {
4442
+ return this.customMessages.delete(type);
4616
4443
  };
4617
- return DrSharedUtils;
4444
+ DrChatCustomMessageService.prototype.getInstance = function (type) {
4445
+ return this.customMessages.get(type);
4446
+ };
4447
+ return DrChatCustomMessageService;
4618
4448
  }());
4449
+ DrChatCustomMessageService.decorators = [
4450
+ { type: i0.Injectable }
4451
+ ];
4619
4452
 
4620
- // @ts-ignore
4453
+ var DrChatMessageComponent = /** @class */ (function () {
4454
+ function DrChatMessageComponent(customMessageService) {
4455
+ this.customMessageService = customMessageService;
4456
+ this.MESSAGE_TYPE = exports.CHAT_MESSAGE_TYPE;
4457
+ this._reply = false;
4458
+ }
4459
+ Object.defineProperty(DrChatMessageComponent.prototype, "flyInOut", {
4460
+ get: function () {
4461
+ return true;
4462
+ },
4463
+ enumerable: false,
4464
+ configurable: true
4465
+ });
4466
+ Object.defineProperty(DrChatMessageComponent.prototype, "notReply", {
4467
+ get: function () {
4468
+ return !this.reply;
4469
+ },
4470
+ enumerable: false,
4471
+ configurable: true
4472
+ });
4473
+ Object.defineProperty(DrChatMessageComponent.prototype, "reply", {
4474
+ /**
4475
+ * Determines if a message is a reply
4476
+ */
4477
+ get: function () {
4478
+ return this._reply;
4479
+ },
4480
+ set: function (value) {
4481
+ this._reply = !!value;
4482
+ },
4483
+ enumerable: false,
4484
+ configurable: true
4485
+ });
4486
+ DrChatMessageComponent.prototype.getTemplate = function () {
4487
+ this.customMessage = true;
4488
+ var customMessage = this.getCustomMessage(this.type);
4489
+ return customMessage.templateRef;
4490
+ };
4491
+ DrChatMessageComponent.prototype.getTemplateContext = function () {
4492
+ return { $implicit: this.customMessageData, isReply: this.reply };
4493
+ };
4494
+ DrChatMessageComponent.prototype.getCustomMessage = function (type) {
4495
+ var customMessageDirective = this.customMessageService.getInstance(type);
4496
+ if (!customMessageDirective) {
4497
+ throw new Error("dr-chat: Can't find template for custom type '" + type + "'. " +
4498
+ ("Make sure you provide it in the chat component with *drCustomMessage='" + type + "'."));
4499
+ }
4500
+ return customMessageDirective;
4501
+ };
4502
+ return DrChatMessageComponent;
4503
+ }());
4504
+ DrChatMessageComponent.decorators = [
4505
+ { type: i0.Component, args: [{
4506
+ selector: 'dr-chat-message',
4507
+ template: "<ng-container *ngIf=\"message.avatarUrl; else userAvatar\">\n <div class=\"avatar\" [style.background-image]=\"'url(' + message.avatarUrl + ')'\"></div>\n</ng-container>\n<ng-template #userAvatar>\n <dr-avatar *ngIf=\"message.user\" [users]=\"message.user\"></dr-avatar>\n</ng-template>\n<div class=\"message\" [class.message--custom]=\"customMessage\">\n <ng-container [ngSwitch]=\"message.kind\">\n <dr-chat-message-text *ngSwitchCase=\"MESSAGE_TYPE.TEXT\" [message]=\"message\"></dr-chat-message-text>\n <dr-chat-message-file *ngSwitchCase=\"MESSAGE_TYPE.DOWNLOAD_FILE\" [message]=\"message\"></dr-chat-message-file>\n <ng-container *ngSwitchDefault>\n <ng-container [ngTemplateOutlet]=\"getTemplate()\" [ngTemplateOutletContext]=\"getTemplateContext()\"></ng-container>\n </ng-container>\n </ng-container>\n <div class=\"message__actions\" *ngIf=\"drChatMessageActions;\">\n <ng-container [ngTemplateOutlet]=\"drChatMessageActions\"></ng-container>\n </div>\n</div>\n",
4508
+ animations: [
4509
+ animations.trigger('flyInOut', [
4510
+ animations.state('in', animations.style({ transform: 'translateX(0)' })),
4511
+ animations.transition('void => *', [animations.style({ transform: 'translateX(-100%)' }), animations.animate(80)]),
4512
+ animations.transition('* => void', [animations.animate(80, animations.style({ transform: 'translateX(100%)' }))]),
4513
+ ]),
4514
+ ],
4515
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
4516
+ styles: [":host{position:relative;display:flex;flex-direction:row;width:100%;background:rgba(249,250,255,.7);border-top:1px solid #E5E5E5;padding:16px 24px}:host:first-child{border:none}:host:last-child{border-bottom:1px solid #E5E5E5}.reply+:host.reply,.not-reply+:host.not-reply{border-top:none;padding-top:0;padding-left:75px}.reply+:host.reply .avatar,.reply+:host.reply dr-avatar,.not-reply+:host.not-reply .avatar,.not-reply+:host.not-reply dr-avatar{display:none}:host.not-reply{background-color:#fff}:host .avatar{display:flex;width:28px;height:28px;background-color:#fff;border-radius:16px;flex-shrink:0;box-shadow:0 1px 3px 1px #0003;background-image:url(\"data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22UTF-8%22%3F%3E%3Csvg id%3D%22Layer_1%22 data-name%3D%22Layer 1%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22 viewBox%3D%220 0 74 65%22%3E %3Cdefs%3E %3Cstyle%3E .cls-1%2C .cls-2%2C .cls-3 %7B fill%3A none%3B %7D .cls-4 %7B fill%3A url(%23linear-gradient)%3B %7D .cls-5 %7B fill%3A %234eb7df%3B %7D .cls-2 %7B stroke%3A %23a6a8aa%3B stroke-miterlimit%3A 10%3B stroke-width%3A .37px%3B %7D .cls-6 %7B fill%3A url(%23linear-gradient-3)%3B %7D .cls-7 %7B fill%3A url(%23linear-gradient-2)%3B %7D .cls-3 %7B clip-path%3A url(%23clippath)%3B %7D %3C%2Fstyle%3E %3CclipPath id%3D%22clippath%22%3E %3Crect class%3D%22cls-1%22 width%3D%2274%22 height%3D%2265%22%2F%3E %3C%2FclipPath%3E %3ClinearGradient id%3D%22linear-gradient%22 x1%3D%2224.26%22 y1%3D%22-3.79%22 x2%3D%2295.63%22 y2%3D%2288.82%22 gradientTransform%3D%22translate(0 65.89) scale(1 -1)%22 gradientUnits%3D%22userSpaceOnUse%22%3E %3Cstop offset%3D%220%22 stop-color%3D%22%237676ff%22%2F%3E %3Cstop offset%3D%22.18%22 stop-color%3D%22%235959ff%22%2F%3E %3Cstop offset%3D%22.35%22 stop-color%3D%22%235757e0%22%2F%3E %3Cstop offset%3D%22.61%22 stop-color%3D%22%234646ce%22%2F%3E %3Cstop offset%3D%22.84%22 stop-color%3D%22%234b4be4%22%2F%3E %3Cstop offset%3D%221%22 stop-color%3D%22%234444eb%22%2F%3E %3C%2FlinearGradient%3E %3ClinearGradient id%3D%22linear-gradient-2%22 x1%3D%2212.05%22 y1%3D%2277.06%22 x2%3D%2210.77%22 y2%3D%2213.85%22 gradientTransform%3D%22translate(0 65.89) scale(1 -1)%22 gradientUnits%3D%22userSpaceOnUse%22%3E %3Cstop offset%3D%22.45%22 stop-color%3D%22%232f92b8%22%2F%3E %3Cstop offset%3D%22.84%22 stop-color%3D%22%234eb7df%22%2F%3E %3Cstop offset%3D%221%22 stop-color%3D%22%234eb7df%22%2F%3E %3C%2FlinearGradient%3E %3ClinearGradient id%3D%22linear-gradient-3%22 x1%3D%2262.26%22 y1%3D%22-2.54%22 x2%3D%2261.76%22 y2%3D%2285.91%22 gradientTransform%3D%22translate(0 65.89) scale(1 -1)%22 gradientUnits%3D%22userSpaceOnUse%22%3E %3Cstop offset%3D%220%22 stop-color%3D%22%2336369b%22%2F%3E %3Cstop offset%3D%22.52%22 stop-color%3D%22%234848d0%22%2F%3E %3C%2FlinearGradient%3E %3C%2Fdefs%3E %3Cg class%3D%22cls-3%22%3E %3Cg%3E %3Cpath class%3D%22cls-4%22 d%3D%22m73.32%2C24.79v15.73c0%2C13.12-9.87%2C23.79-22%2C23.79h-21.32c-3.46-.06-6.25-3.11-6.25-6.87s2.79-6.81%2C6.25-6.87h21.32c5.13%2C0%2C9.29-4.51%2C9.29-10.05v-15.73c0-5.54-4.17-10.05-9.29-10.05h-7.46c3.51%2C0%2C6.35-3.08%2C6.35-6.88s-2.79-6.8-6.25-6.87h7.35c12.12%2C0%2C22%2C10.67%2C22%2C23.79h0Z%22%2F%3E %3Cpath class%3D%22cls-5%22 d%3D%22m50.26%2C7.82c0%2C3.8-2.9%2C6.93-6.41%2C6.93h-21.86c-5.13%2C0-9.29%2C4.51-9.29%2C10.05v15.73c0%2C5.54%2C4.17%2C10.05%2C9.29%2C10.05h8.01c-3.46.06-6.25%2C3.11-6.25%2C6.87s2.79%2C6.81%2C6.25%2C6.87h-8.01c-12.12%2C0-22-10.67-22-23.79v-15.73C0%2C11.68%2C9.87%2C1%2C21.99%2C1h21.97c3.46.06%2C6.3%2C3.06%2C6.3%2C6.82Z%22%2F%3E %3Cpath class%3D%22cls-2%22 d%3D%22m66.45%2C1h-.22.22%2C0Z%22%2F%3E %3Cpath class%3D%22cls-2%22 d%3D%22m36.05%2C50.58h-.22.22%2C0Z%22%2F%3E %3Cpath class%3D%22cls-7%22 d%3D%22m0%2C33.78v-2.76C0%2C12.9%2C13.62%2C14.48%2C13.62%2C14.48h8.38c-5.5.46-9.5%2C4.71-9.5%2C9.96l.02%2C15.8c0%2C5.54%2C4.44%2C10.59%2C9.48%2C10.59l-8-.5S0%2C51.88%2C0%2C33.77h0Z%22%2F%3E %3Cpath class%3D%22cls-6%22 d%3D%22m73%2C31.51v2.76c0%2C18.12-13.62%2C16.53-13.62%2C16.53h-7.99c5.61-.85%2C9.09-4.76%2C9.09-10.02l.02-16.33c0-5.54-4.46-10-9.5-10h8s13.99-1.05%2C13.99%2C17.07h0Z%22%2F%3E %3C%2Fg%3E %3C%2Fg%3E%3C%2Fsvg%3E\");background-size:20px 22px;background-repeat:no-repeat;background-position-x:4px;background-position-y:3px}:host .avatar,:host dr-avatar{margin:0 23px 0 0}:host .message{display:flex;align-items:center;flex-grow:1}:host .message__actions{display:flex;align-items:center;margin-left:24px;flex-grow:1;justify-content:flex-end}:host .message__actions::ng-deep button:not(:hover) i[class*=dr-icon]{color:#b9b9ec!important}\n"]
4517
+ },] }
4518
+ ];
4519
+ DrChatMessageComponent.ctorParameters = function () { return [
4520
+ { type: DrChatCustomMessageService }
4521
+ ]; };
4522
+ DrChatMessageComponent.propDecorators = {
4523
+ flyInOut: [{ type: i0.HostBinding, args: ['@flyInOut',] }],
4524
+ notReply: [{ type: i0.HostBinding, args: ['class.not-reply',] }],
4525
+ reply: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.reply',] }],
4526
+ type: [{ type: i0.Input }],
4527
+ message: [{ type: i0.Input }],
4528
+ customMessageData: [{ type: i0.Input }],
4529
+ user: [{ type: i0.Input }],
4530
+ drChatMessageActions: [{ type: i0.ContentChild, args: ['drChatMessageActions',] }]
4531
+ };
4532
+
4533
+ var DrChatSuggestionsComponent = /** @class */ (function () {
4534
+ function DrChatSuggestionsComponent(cdr) {
4535
+ this.cdr = cdr;
4536
+ this._nonHiddenValues = [];
4537
+ this.visibleValues = [];
4538
+ this.isSuggestedMenuOpen = false;
4539
+ this.values = [];
4540
+ this.fullScreen = false;
4541
+ this.buttonMode = false;
4542
+ /**
4543
+ * Parameter to check is send message function available
4544
+ *
4545
+ * @type {boolean}
4546
+ */
4547
+ this.waitForReply = false;
4548
+ this.suggestionSelect = new i0.EventEmitter();
4549
+ }
4550
+ Object.defineProperty(DrChatSuggestionsComponent.prototype, "hiddenValues", {
4551
+ get: function () {
4552
+ return JSON.parse(localStorage.getItem('aiChatSuggestions')) || [];
4553
+ },
4554
+ set: function (values) {
4555
+ localStorage.setItem('aiChatSuggestions', JSON.stringify(values));
4556
+ },
4557
+ enumerable: false,
4558
+ configurable: true
4559
+ });
4560
+ DrChatSuggestionsComponent.prototype.ngOnInit = function () {
4561
+ this.filterValues();
4562
+ };
4563
+ DrChatSuggestionsComponent.prototype.onItemClick = function (item) {
4564
+ if (this.waitForReply) {
4565
+ return;
4566
+ }
4567
+ this.isSuggestedMenuOpen = false;
4568
+ this.suggestionSelect.emit(item);
4569
+ this.hiddenValues = __spreadArray(__spreadArray([], __read(this.hiddenValues)), [item]);
4570
+ this.filterValues();
4571
+ };
4572
+ DrChatSuggestionsComponent.prototype.filterValues = function () {
4573
+ var hiddenValues = this.hiddenValues;
4574
+ this._nonHiddenValues = ___namespace.filter(this.values, function (val) { return !hiddenValues.includes(val); });
4575
+ this.fillVisibleValues();
4576
+ };
4577
+ DrChatSuggestionsComponent.prototype.fillVisibleValues = function () {
4578
+ var maxItemsCount = this.fullScreen ? 6 : 4;
4579
+ var nonHiddenValues = ___namespace.clone(this._nonHiddenValues);
4580
+ this.visibleValues.length = 0;
4581
+ for (var i = 0; i < maxItemsCount; i++) {
4582
+ if (!nonHiddenValues.length) {
4583
+ break;
4584
+ }
4585
+ var randomIndex = Math.floor(Math.random() * nonHiddenValues.length);
4586
+ var item = nonHiddenValues.splice(randomIndex, 1)[0];
4587
+ this.visibleValues.push(item);
4588
+ }
4589
+ this.cdr.markForCheck();
4590
+ };
4591
+ DrChatSuggestionsComponent.prototype.clearHidden = function () {
4592
+ localStorage.setItem('aiChatSuggestions', null);
4593
+ this.filterValues();
4594
+ };
4595
+ DrChatSuggestionsComponent.prototype.toggleSuggestedMenu = function () {
4596
+ this.isSuggestedMenuOpen = !this.isSuggestedMenuOpen;
4597
+ if (this.isSuggestedMenuOpen) {
4598
+ this.fillVisibleValues();
4599
+ }
4600
+ this.cdr.markForCheck();
4601
+ };
4602
+ return DrChatSuggestionsComponent;
4603
+ }());
4604
+ DrChatSuggestionsComponent.decorators = [
4605
+ { type: i0.Component, args: [{
4606
+ selector: 'dr-chat-suggestions',
4607
+ template: "<div class=\"chat-suggestions\">\n <ng-container *ngIf=\"buttonMode; else suggestionCards\">\n <div class=\"chat-suggestions__container\"\n [class.chat-suggestions__container--opened]=\"isSuggestedMenuOpen\"\n *ngIf=\"visibleValues.length\">\n <dr-button theme=\"ghost\" class=\"chat-suggestions__container__button\" (click)=\"toggleSuggestedMenu()\">\n Suggested chats\n </dr-button>\n <ng-container *ngTemplateOutlet=\"suggestionCards\"></ng-container>\n </div>\n </ng-container>\n</div>\n\n<ng-template #suggestionCards>\n <div class=\"chat-suggestions__items\">\n <div class=\"chat-suggestions__items__background\"></div>\n <div *ngFor=\"let item of visibleValues\"\n class=\"chat-suggestions__items__item\" (click)=\"onItemClick(item)\">\n {{ item }}\n </div>\n </div>\n</ng-template>\n",
4608
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
4609
+ styles: [":host{display:flex;align-items:flex-start;justify-content:center}:host .chat-suggestions{display:flex;width:100%;max-width:970px}:host .chat-suggestions__container{display:flex;position:relative;width:auto;margin-top:12px;padding:0 24px}:host .chat-suggestions__container__button{z-index:3}:host .chat-suggestions__container__button::ng-deep button{background:#F2F2FB!important;border-radius:4px;cursor:pointer}:host .chat-suggestions__container .chat-suggestions__items{display:none;position:absolute;width:100%;bottom:0;left:0;padding-bottom:32px;z-index:2}:host .chat-suggestions__container--opened{width:100%}:host .chat-suggestions__container--opened .chat-suggestions__container__button::ng-deep button{color:#4646ce;background:#F2F2FB}:host .chat-suggestions__container--opened .chat-suggestions__items,:host .chat-suggestions__container--opened .chat-suggestions__items__background{display:flex}:host .chat-suggestions__items{display:flex;flex-wrap:wrap;width:100%;justify-content:space-between;padding:0 24px}:host .chat-suggestions__items__background{display:none;position:absolute;top:-32px;right:0;bottom:32px;left:0;background:#FFFFFF;opacity:.7;z-index:-1}:host .chat-suggestions__items__item{margin:0 0 20px;display:inline-flex;height:76px;width:275px;padding:16px;border-radius:8px;background:#F2F2FB;box-shadow:0 1px 2px #00000026;font-size:14px;line-height:24px;color:#25258c}:host .chat-suggestions__items__item:hover{cursor:pointer;background:#EAEAFF}\n"]
4610
+ },] }
4611
+ ];
4612
+ DrChatSuggestionsComponent.ctorParameters = function () { return [
4613
+ { type: i0.ChangeDetectorRef }
4614
+ ]; };
4615
+ DrChatSuggestionsComponent.propDecorators = {
4616
+ values: [{ type: i0.Input }],
4617
+ fullScreen: [{ type: i0.Input }],
4618
+ buttonMode: [{ type: i0.Input }],
4619
+ waitForReply: [{ type: i0.Input }],
4620
+ suggestionSelect: [{ type: i0.Output }]
4621
+ };
4622
+
4623
+ var DrChatComponent = /** @class */ (function () {
4624
+ function DrChatComponent(cdr) {
4625
+ this.cdr = cdr;
4626
+ this.destroy$ = new rxjs.Subject();
4627
+ this.showClearButton = true;
4628
+ this.noMessagesPlaceholder = 'No messages yet.';
4629
+ this._scrollBottom = true;
4630
+ this.suggestions = [];
4631
+ /**
4632
+ * Parameter to check is send message function available
4633
+ *
4634
+ * @type {boolean}
4635
+ */
4636
+ this.waitForReply = false;
4637
+ this.clear = new i0.EventEmitter();
4638
+ this.close = new i0.EventEmitter();
4639
+ this.suggestionSelect = new i0.EventEmitter();
4640
+ }
4641
+ Object.defineProperty(DrChatComponent.prototype, "contentUpdateSubject", {
4642
+ set: function (value) {
4643
+ var _this = this;
4644
+ if (value) {
4645
+ value.pipe(operators.takeUntil(this.destroy$)).subscribe(function () {
4646
+ _this.updateView();
4647
+ });
4648
+ }
4649
+ },
4650
+ enumerable: false,
4651
+ configurable: true
4652
+ });
4653
+ ;
4654
+ Object.defineProperty(DrChatComponent.prototype, "scrollBottom", {
4655
+ /**
4656
+ * Scroll chat to the bottom of the list when a new message arrives
4657
+ */
4658
+ get: function () {
4659
+ return this._scrollBottom;
4660
+ },
4661
+ set: function (value) {
4662
+ this._scrollBottom = !!value;
4663
+ },
4664
+ enumerable: false,
4665
+ configurable: true
4666
+ });
4667
+ Object.defineProperty(DrChatComponent.prototype, "messagesContainerWithScroll", {
4668
+ get: function () {
4669
+ return this.messagesContainer && this.messagesContainer.nativeElement.scrollHeight > this.messagesContainer.nativeElement.offsetHeight;
4670
+ },
4671
+ enumerable: false,
4672
+ configurable: true
4673
+ });
4674
+ ;
4675
+ DrChatComponent.prototype.ngAfterViewInit = function () {
4676
+ var _this = this;
4677
+ this.messages.changes.subscribe(function (messages) {
4678
+ _this.messages = messages;
4679
+ _this.updateView();
4680
+ });
4681
+ this.updateView();
4682
+ };
4683
+ DrChatComponent.prototype.updateView = function () {
4684
+ if (this.scrollBottom) {
4685
+ this.scrollListBottom();
4686
+ }
4687
+ };
4688
+ DrChatComponent.prototype.scrollListBottom = function () {
4689
+ var _this = this;
4690
+ setTimeout(function () {
4691
+ if (_this.messagesContainer) {
4692
+ var scrollToOptions = {
4693
+ top: _this.messagesContainer.nativeElement.scrollHeight,
4694
+ };
4695
+ if (!_this.reopen) {
4696
+ scrollToOptions.behavior = 'smooth';
4697
+ }
4698
+ _this.messagesContainer.nativeElement.scrollTo(scrollToOptions);
4699
+ _this.cdr.markForCheck();
4700
+ }
4701
+ });
4702
+ };
4703
+ DrChatComponent.prototype.ngOnDestroy = function () {
4704
+ this.destroy$.next();
4705
+ this.destroy$.complete();
4706
+ };
4707
+ DrChatComponent.prototype.onClearClick = function ($event) {
4708
+ this.clear.emit($event);
4709
+ if (this._chatSuggestions) {
4710
+ this._chatSuggestions.clearHidden();
4711
+ }
4712
+ };
4713
+ DrChatComponent.prototype.hideSuggestions = function () {
4714
+ if (this._chatSuggestions.isSuggestedMenuOpen) {
4715
+ this._chatSuggestions.toggleSuggestedMenu();
4716
+ }
4717
+ };
4718
+ return DrChatComponent;
4719
+ }());
4720
+ DrChatComponent.decorators = [
4721
+ { type: i0.Component, args: [{
4722
+ selector: 'dr-chat',
4723
+ template: "<div class=\"chat\" [class.chat--in-full-screen]=\"fullScreen\">\n <div class=\"chat__header\">\n <div class=\"chat__header__logo\"></div>\n\n <div class=\"chat__header__text\">\n <div class=\"chat__header__text__title\">{{ title }}</div>\n <div *ngIf=\"subtitle\" class=\"chat__header__text__subtitle\">{{ subtitle }}</div>\n </div>\n\n <dr-button *ngIf=\"showClearButton\"\n (click)=\"onClearClick($event)\"\n theme=\"icon\"\n icon=\"dr-icon-clear\"\n class=\"ml-auto\"\n drTooltip=\"Clear chat\">\n </dr-button>\n\n <dr-button *ngIf=\"!fullScreen\"\n (click)=\"close.emit($event)\"\n theme=\"icon\"\n icon=\"dr-icon-exit\"\n class=\"ml-4\"\n drTooltip=\"Close\">\n </dr-button>\n </div>\n\n <div *ngIf=\"!messages?.length\" class=\"chat__empty-state\">\n <span class=\"chat__empty-state__text\">{{ noMessagesPlaceholder }}</span>\n </div>\n\n <div *ngIf=\"messages?.length\" class=\"chat__messages\">\n <div #messagesContainer class=\"chat__messages__container\"\n [class.chat__messages__container--scroll]=\"messagesContainerWithScroll\">\n <ng-content select=\"dr-chat-message\"></ng-content>\n </div>\n </div>\n\n <dr-chat-suggestions *ngIf=\"suggestions?.length\"\n [values]=\"suggestions\"\n [fullScreen]=\"fullScreen\"\n [waitForReply]=\"waitForReply\"\n class=\"chat__suggestions\"\n [class.chat__suggestions--full-height]=\"fullScreen && !messages?.length\"\n [buttonMode]=\"!!messages?.length\"\n (suggestionSelect)=\"suggestionSelect.emit($event)\">\n </dr-chat-suggestions>\n\n <div class=\"form\">\n <ng-content select=\"dr-chat-form\"></ng-content>\n </div>\n</div>\n",
4724
+ providers: [DrChatCustomMessageService],
4725
+ styles: [":host{height:100%;width:100%;display:flex;flex-direction:column}.chat{position:relative;display:flex;flex-grow:1;flex-direction:column;height:100%;background-color:#fff;color:#4e566c;font-family:\"Poppins\",sans-serif;font-size:14px;font-weight:400;line-height:22px}.chat__header{display:flex;align-items:center;background-color:#f2f2ff;color:#25258c;padding:15px 24px;font-weight:400;font-size:20px;line-height:28px;box-shadow:0 1px 3px #0003;z-index:1}.chat__header__logo{display:flex;width:43px;height:38px;background:url(\"data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22UTF-8%22%3F%3E%3Csvg id%3D%22Layer_1%22 data-name%3D%22Layer 1%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22 viewBox%3D%220 0 74 65%22%3E %3Cdefs%3E %3Cstyle%3E .cls-1%2C .cls-2%2C .cls-3 %7B fill%3A none%3B %7D .cls-4 %7B fill%3A url(%23linear-gradient)%3B %7D .cls-5 %7B fill%3A %234eb7df%3B %7D .cls-2 %7B stroke%3A %23a6a8aa%3B stroke-miterlimit%3A 10%3B stroke-width%3A .37px%3B %7D .cls-6 %7B fill%3A url(%23linear-gradient-3)%3B %7D .cls-7 %7B fill%3A url(%23linear-gradient-2)%3B %7D .cls-3 %7B clip-path%3A url(%23clippath)%3B %7D %3C%2Fstyle%3E %3CclipPath id%3D%22clippath%22%3E %3Crect class%3D%22cls-1%22 width%3D%2274%22 height%3D%2265%22%2F%3E %3C%2FclipPath%3E %3ClinearGradient id%3D%22linear-gradient%22 x1%3D%2224.26%22 y1%3D%22-3.79%22 x2%3D%2295.63%22 y2%3D%2288.82%22 gradientTransform%3D%22translate(0 65.89) scale(1 -1)%22 gradientUnits%3D%22userSpaceOnUse%22%3E %3Cstop offset%3D%220%22 stop-color%3D%22%237676ff%22%2F%3E %3Cstop offset%3D%22.18%22 stop-color%3D%22%235959ff%22%2F%3E %3Cstop offset%3D%22.35%22 stop-color%3D%22%235757e0%22%2F%3E %3Cstop offset%3D%22.61%22 stop-color%3D%22%234646ce%22%2F%3E %3Cstop offset%3D%22.84%22 stop-color%3D%22%234b4be4%22%2F%3E %3Cstop offset%3D%221%22 stop-color%3D%22%234444eb%22%2F%3E %3C%2FlinearGradient%3E %3ClinearGradient id%3D%22linear-gradient-2%22 x1%3D%2212.05%22 y1%3D%2277.06%22 x2%3D%2210.77%22 y2%3D%2213.85%22 gradientTransform%3D%22translate(0 65.89) scale(1 -1)%22 gradientUnits%3D%22userSpaceOnUse%22%3E %3Cstop offset%3D%22.45%22 stop-color%3D%22%232f92b8%22%2F%3E %3Cstop offset%3D%22.84%22 stop-color%3D%22%234eb7df%22%2F%3E %3Cstop offset%3D%221%22 stop-color%3D%22%234eb7df%22%2F%3E %3C%2FlinearGradient%3E %3ClinearGradient id%3D%22linear-gradient-3%22 x1%3D%2262.26%22 y1%3D%22-2.54%22 x2%3D%2261.76%22 y2%3D%2285.91%22 gradientTransform%3D%22translate(0 65.89) scale(1 -1)%22 gradientUnits%3D%22userSpaceOnUse%22%3E %3Cstop offset%3D%220%22 stop-color%3D%22%2336369b%22%2F%3E %3Cstop offset%3D%22.52%22 stop-color%3D%22%234848d0%22%2F%3E %3C%2FlinearGradient%3E %3C%2Fdefs%3E %3Cg class%3D%22cls-3%22%3E %3Cg%3E %3Cpath class%3D%22cls-4%22 d%3D%22m73.32%2C24.79v15.73c0%2C13.12-9.87%2C23.79-22%2C23.79h-21.32c-3.46-.06-6.25-3.11-6.25-6.87s2.79-6.81%2C6.25-6.87h21.32c5.13%2C0%2C9.29-4.51%2C9.29-10.05v-15.73c0-5.54-4.17-10.05-9.29-10.05h-7.46c3.51%2C0%2C6.35-3.08%2C6.35-6.88s-2.79-6.8-6.25-6.87h7.35c12.12%2C0%2C22%2C10.67%2C22%2C23.79h0Z%22%2F%3E %3Cpath class%3D%22cls-5%22 d%3D%22m50.26%2C7.82c0%2C3.8-2.9%2C6.93-6.41%2C6.93h-21.86c-5.13%2C0-9.29%2C4.51-9.29%2C10.05v15.73c0%2C5.54%2C4.17%2C10.05%2C9.29%2C10.05h8.01c-3.46.06-6.25%2C3.11-6.25%2C6.87s2.79%2C6.81%2C6.25%2C6.87h-8.01c-12.12%2C0-22-10.67-22-23.79v-15.73C0%2C11.68%2C9.87%2C1%2C21.99%2C1h21.97c3.46.06%2C6.3%2C3.06%2C6.3%2C6.82Z%22%2F%3E %3Cpath class%3D%22cls-2%22 d%3D%22m66.45%2C1h-.22.22%2C0Z%22%2F%3E %3Cpath class%3D%22cls-2%22 d%3D%22m36.05%2C50.58h-.22.22%2C0Z%22%2F%3E %3Cpath class%3D%22cls-7%22 d%3D%22m0%2C33.78v-2.76C0%2C12.9%2C13.62%2C14.48%2C13.62%2C14.48h8.38c-5.5.46-9.5%2C4.71-9.5%2C9.96l.02%2C15.8c0%2C5.54%2C4.44%2C10.59%2C9.48%2C10.59l-8-.5S0%2C51.88%2C0%2C33.77h0Z%22%2F%3E %3Cpath class%3D%22cls-6%22 d%3D%22m73%2C31.51v2.76c0%2C18.12-13.62%2C16.53-13.62%2C16.53h-7.99c5.61-.85%2C9.09-4.76%2C9.09-10.02l.02-16.33c0-5.54-4.46-10-9.5-10h8s13.99-1.05%2C13.99%2C17.07h0Z%22%2F%3E %3C%2Fg%3E %3C%2Fg%3E%3C%2Fsvg%3E\") no-repeat;background-size:100% 100%}.chat__header__text{display:flex;flex-direction:column;flex-grow:1;margin-left:20px}.chat__header__text__title{display:flex;align-items:center}.chat__header__text__title:after{content:\"BETA\";display:inline-flex;padding:2px 10px;background:#25258C;color:#f4f4f3;font-weight:600;font-size:10px;line-height:14px;border-radius:8px;margin-left:12px;font-family:\"Nunito Sans\",sans-serif}.chat__header__text__subtitle{font-size:14px;line-height:22px}.chat__header dr-button::ng-deep button:not(:hover){color:#25258c}.chat__empty-state{display:flex;justify-content:center}.chat__empty-state__text{padding:20px 0;font-family:Poppins,sans-serif;font-size:20px;font-weight:300;line-height:30px;text-align:center;max-width:440px;color:#4646ce}.chat__messages{display:flex;flex-grow:1;overflow-x:hidden;overflow-y:auto;height:100%;width:100%}.chat__messages__container{overflow-y:auto;overflow-x:hidden;display:flex;flex-shrink:0;flex-direction:column;width:100%;padding-bottom:1px}.chat__messages__container--scroll::ng-deep dr-chat-message{padding-right:16px}.chat__suggestions--full-height{flex-grow:1;height:1px;overflow:auto}.chat--in-full-screen .chat__header{padding-left:48px;padding-right:48px}.chat--in-full-screen .chat__empty-state__text{padding:77px 0;font-size:28px;line-height:46px;max-width:570px}.chat--in-full-screen .chat__messages::ng-deep dr-chat-message{justify-content:center}.chat--in-full-screen .chat__messages::ng-deep .message{max-width:919px}.chat--in-full-screen .chat__suggestions::ng-deep .chat-suggestions__items{padding-left:0;padding-right:0}.chat--in-full-screen .chat__suggestions::ng-deep .chat-suggestions__items__item{margin:0 0 26px;height:80px;width:310px;font-size:16px}.chat--in-full-screen .chat__suggestions::ng-deep .chat-suggestions__container{padding:0}\n"]
4726
+ },] }
4727
+ ];
4728
+ DrChatComponent.ctorParameters = function () { return [
4729
+ { type: i0.ChangeDetectorRef }
4730
+ ]; };
4731
+ DrChatComponent.propDecorators = {
4732
+ fullScreen: [{ type: i0.Input }],
4733
+ title: [{ type: i0.Input }],
4734
+ subtitle: [{ type: i0.Input }],
4735
+ showClearButton: [{ type: i0.Input }],
4736
+ noMessagesPlaceholder: [{ type: i0.Input }],
4737
+ contentUpdateSubject: [{ type: i0.Input }],
4738
+ scrollBottom: [{ type: i0.Input }],
4739
+ suggestions: [{ type: i0.Input }],
4740
+ reopen: [{ type: i0.Input }],
4741
+ waitForReply: [{ type: i0.Input }],
4742
+ messagesContainer: [{ type: i0.ViewChild, args: ['messagesContainer',] }],
4743
+ messages: [{ type: i0.ContentChildren, args: [DrChatMessageComponent,] }],
4744
+ chatForm: [{ type: i0.ContentChild, args: [DrChatFormComponent,] }],
4745
+ clear: [{ type: i0.Output }],
4746
+ close: [{ type: i0.Output }],
4747
+ suggestionSelect: [{ type: i0.Output }],
4748
+ _chatSuggestions: [{ type: i0.ViewChild, args: [DrChatSuggestionsComponent,] }]
4749
+ };
4750
+
4751
+ exports.TooltipPosition = void 0;
4752
+ (function (TooltipPosition) {
4753
+ TooltipPosition["TOP"] = "top";
4754
+ TooltipPosition["BOTTOM"] = "bottom";
4755
+ TooltipPosition["LEFT"] = "left";
4756
+ TooltipPosition["RIGHT"] = "right";
4757
+ TooltipPosition["TOP_RIGHT"] = "top-right";
4758
+ TooltipPosition["TOP_LEFT"] = "top-left";
4759
+ TooltipPosition["BOTTOM_RIGHT"] = "bottom-right";
4760
+ TooltipPosition["BOTTOM_LEFT"] = "bottom-left";
4761
+ TooltipPosition["RIGHT_TOP"] = "right-top";
4762
+ TooltipPosition["RIGHT_BOTTOM"] = "right-bottom";
4763
+ TooltipPosition["LEFT_TOP"] = "left-top";
4764
+ TooltipPosition["LEFT_BOTTOM"] = "left-bottom";
4765
+ })(exports.TooltipPosition || (exports.TooltipPosition = {}));
4766
+
4767
+ exports.Scenario = void 0;
4768
+ (function (Scenario) {
4769
+ Scenario["ACTUALS"] = "Actuals";
4770
+ Scenario["FORECAST"] = "Forecast";
4771
+ Scenario["BUDGET"] = "Budget";
4772
+ Scenario["NONE"] = "None";
4773
+ })(exports.Scenario || (exports.Scenario = {}));
4774
+
4775
+ var DrModelDebounceChangeDirective = /** @class */ (function () {
4776
+ function DrModelDebounceChangeDirective(ngModel) {
4777
+ this.ngModel = ngModel;
4778
+ this.debounce = 200;
4779
+ this.ngModelDebounceChange = new i0.EventEmitter();
4780
+ }
4781
+ DrModelDebounceChangeDirective.prototype.ngOnInit = function () {
4782
+ var _this = this;
4783
+ this.subscription = this.ngModel.control.valueChanges.pipe(operators.skip(1), operators.debounceTime(this.debounce), operators.distinctUntilChanged()).subscribe(function (value) { return _this.ngModelDebounceChange.emit(value); });
4784
+ };
4785
+ DrModelDebounceChangeDirective.prototype.ngOnDestroy = function () {
4786
+ this.subscription.unsubscribe();
4787
+ };
4788
+ return DrModelDebounceChangeDirective;
4789
+ }());
4790
+ DrModelDebounceChangeDirective.decorators = [
4791
+ { type: i0.Directive, args: [{
4792
+ selector: '[ngModelDebounceChange]'
4793
+ },] }
4794
+ ];
4795
+ DrModelDebounceChangeDirective.ctorParameters = function () { return [
4796
+ { type: forms.NgModel }
4797
+ ]; };
4798
+ DrModelDebounceChangeDirective.propDecorators = {
4799
+ debounce: [{ type: i0.Input }],
4800
+ ngModelDebounceChange: [{ type: i0.Output }]
4801
+ };
4802
+
4803
+ exports.BadgeStatus = void 0;
4804
+ (function (BadgeStatus) {
4805
+ BadgeStatus["INFO"] = "info";
4806
+ BadgeStatus["ERROR"] = "error";
4807
+ BadgeStatus["WARNING"] = "warning";
4808
+ BadgeStatus["SUCCESS"] = "success";
4809
+ BadgeStatus["REGULAR"] = "regular";
4810
+ BadgeStatus["PROGRESS"] = "progress";
4811
+ BadgeStatus["DOTTED"] = "dotted";
4812
+ })(exports.BadgeStatus || (exports.BadgeStatus = {}));
4813
+
4814
+ var _a;
4815
+ var allDateTags = (_a = {},
4816
+ _a[TagsConfigSubType.YEAR] = {
4817
+ name: 'Date',
4818
+ toggle: false,
4819
+ },
4820
+ _a[TagsConfigSubType.QUARTER] = {
4821
+ name: 'Date',
4822
+ toggle: false,
4823
+ },
4824
+ _a[TagsConfigSubType.MONTH] = {
4825
+ name: 'Date',
4826
+ toggle: false,
4827
+ },
4828
+ _a[TagsConfigSubType.DAY] = {
4829
+ name: 'Date',
4830
+ toggle: false,
4831
+ },
4832
+ _a[TagsConfigSubType.WEEK] = {
4833
+ name: 'Date',
4834
+ toggle: false,
4835
+ },
4836
+ _a);
4837
+ function getScenarioTagDataConfig(isMultipleDimension) {
4838
+ var _a, _b, _c, _d, _e;
4839
+ return _a = {},
4840
+ _a[exports.Scenario.ACTUALS] = Object.assign(Object.assign({}, allDateTags), (_b = {}, _b[TagsConfigSubType.MONTH] = {
4841
+ name: 'Date',
4842
+ toggle: true,
4843
+ }, _b[TagsConfigSubType.FILE_STATUS] = {
4844
+ toggle: false,
4845
+ }, _b)),
4846
+ _a[exports.Scenario.BUDGET] = (_c = {},
4847
+ _c[TagsConfigSubType.BUDGET_CYCLE] = {
4848
+ toggle: true,
4849
+ acceptableDateTags: [TagsConfigSubType.YEAR],
4850
+ hidden: !isMultipleDimension,
4851
+ },
4852
+ _c[TagsConfigSubType.PLAN] = {
4853
+ toggle: false,
4854
+ turnOffDateTags: true,
4855
+ hidden: isMultipleDimension,
4856
+ },
4857
+ _c[TagsConfigSubType.YEAR] = {
4858
+ name: 'Date',
4859
+ toggle: true,
4860
+ },
4861
+ _c[TagsConfigSubType.QUARTER] = {
4862
+ name: 'Date',
4863
+ toggle: false,
4864
+ },
4865
+ _c[TagsConfigSubType.FILE_STATUS] = {
4866
+ toggle: false,
4867
+ },
4868
+ _c),
4869
+ _a[exports.Scenario.FORECAST] = (_d = {},
4870
+ _d[TagsConfigSubType.FORECAST_NEW] = {
4871
+ toggle: true,
4872
+ name: 'Date',
4873
+ },
4874
+ _d[TagsConfigSubType.FILE_STATUS] = {
4875
+ toggle: false,
4876
+ },
4877
+ _d),
4878
+ _a[exports.Scenario.NONE] = Object.assign(Object.assign({}, allDateTags), (_e = {}, _e[TagsConfigSubType.MONTH] = {
4879
+ name: 'Date',
4880
+ toggle: true,
4881
+ }, _e[TagsConfigSubType.FILE_STATUS] = {
4882
+ toggle: true,
4883
+ }, _e)),
4884
+ _a;
4885
+ }
4886
+
4887
+ var ScenarioService = /** @class */ (function () {
4888
+ function ScenarioService() {
4889
+ this.DEFAULT_FORECAST_DATE_TAG = 'Month';
4890
+ }
4891
+ Object.defineProperty(ScenarioService.prototype, "scenarios", {
4892
+ get: function () {
4893
+ return _.orderBy(Object.values(exports.Scenario), function (scenario) { return scenario === exports.Scenario.NONE ? 1 : 0; });
4894
+ },
4895
+ enumerable: false,
4896
+ configurable: true
4897
+ });
4898
+ Object.defineProperty(ScenarioService.prototype, "areExistingTagsConfig", {
4899
+ get: function () {
4900
+ return !!this.currentTagsConfig;
4901
+ },
4902
+ enumerable: false,
4903
+ configurable: true
4904
+ });
4905
+ ScenarioService.prototype.initScenarioTags = function (wholeTagsConfig, currentTagsConfig, isMultipleDimension) {
4906
+ if (!(wholeTagsConfig === null || wholeTagsConfig === void 0 ? void 0 : wholeTagsConfig.length))
4907
+ return;
4908
+ this.wholeTagsConfig = _.cloneDeep(wholeTagsConfig);
4909
+ this.currentTagsConfig = currentTagsConfig;
4910
+ this.isMultipleDimension = isMultipleDimension;
4911
+ };
4912
+ ScenarioService.prototype.getTagsConfigByScenarioTags = function (scenarioTags, tagsConfig) {
4913
+ var scenarioTagsConfig = _.filter(tagsConfig, function (tagConfig) { return _.some(scenarioTags, function (scenarioTag) { return scenarioTag.toggle && scenarioTag.selectedTagSubType === tagConfig.options.sub_type; }); });
4914
+ return this.sortScenarioTags(scenarioTagsConfig);
4915
+ };
4916
+ ScenarioService.prototype.getScenarioTagsByScenario = function (scenario) {
4917
+ var _this = this;
4918
+ var scenarioTagsConfig = this.getScenarioTagsConfig(scenario, this.wholeTagsConfig);
4919
+ var scenarioTagsUi = [];
4920
+ _.forEach(scenarioTagsConfig, function (scenarioTag) {
4921
+ var isTagWithSubTags = scenarioTag.type === exports.TagTypes.DATE;
4922
+ var tagWithSubTags = isTagWithSubTags && _.find(scenarioTagsUi, { type: scenarioTag.type });
4923
+ var tag = tagWithSubTags || _this.prepareScenarioTag(scenarioTagsConfig, scenarioTag, scenario, isTagWithSubTags);
4924
+ if (isTagWithSubTags) {
4925
+ _this.updateScenarioSubTags(tag, scenarioTag);
4926
+ tag.subTags = _this.sortedScenarioSubTags(tag);
4927
+ }
4928
+ if (tagWithSubTags)
4929
+ return;
4930
+ scenarioTagsUi.push(tag);
4931
+ });
4932
+ if (this.areExistingTagsConfig) {
4933
+ this.initExistingTagsConfig(scenario, scenarioTagsUi);
4934
+ }
4935
+ var isTagNotSupportingDates = _.some(scenarioTagsUi, { turnOffDateTags: true, toggle: true });
4936
+ if (isTagNotSupportingDates) {
4937
+ this.turnOffDateTag(scenarioTagsUi);
4938
+ }
4939
+ var tagWithSpecificDateTags = _.find(scenarioTagsUi, function (tag) { var _a; return tag.toggle && !!((_a = tag.acceptableDateTags) === null || _a === void 0 ? void 0 : _a.length); });
4940
+ if (tagWithSpecificDateTags) {
4941
+ this.hideNotAvailableTags(tagWithSpecificDateTags, scenarioTagsUi);
4942
+ }
4943
+ return this.sortScenarioTags(scenarioTagsUi);
4944
+ };
4945
+ ScenarioService.prototype.sortScenarioTags = function (scenarioTagsUi) {
4946
+ return _.orderBy(scenarioTagsUi, [
4947
+ function (tag) { return (tag.type === exports.TagTypes.DATE ? 0 : 1); },
4948
+ function (tag) { return (tag.name === 'File Status'); }
4949
+ ]);
4950
+ };
4951
+ ScenarioService.prototype.initExistingTagsConfig = function (scenario, scenarioTagsUi) {
4952
+ var _this = this;
4953
+ _.forEach(this.currentTagsConfig, function (tagConfig) {
4954
+ var _a;
4955
+ var tagSubType = (_a = tagConfig === null || tagConfig === void 0 ? void 0 : tagConfig.options) === null || _a === void 0 ? void 0 : _a.sub_type;
4956
+ var scenarioTagDataConfig = getScenarioTagDataConfig(_this.isMultipleDimension);
4957
+ if (!scenarioTagDataConfig || !scenarioTagDataConfig[scenario] || !scenarioTagDataConfig[scenario][tagSubType]) {
4958
+ return;
4959
+ }
4960
+ var scenarioTagUi = tagConfig.type === exports.TagTypes.DATE
4961
+ ? _.find(scenarioTagsUi, { type: tagConfig.type })
4962
+ : _.find(scenarioTagsUi, { selectedTagSubType: tagSubType });
4963
+ scenarioTagUi.toggle = true;
4964
+ scenarioTagUi.selectedTagSubType = tagSubType;
4965
+ });
4966
+ };
4967
+ ScenarioService.prototype.prepareScenarioTag = function (scenarioTagsConfig, scenarioTag, scenario, isDateTag) {
4968
+ var toggleStatus = isDateTag
4969
+ ? _.some(scenarioTagsConfig, function (tag) { return tag.type === exports.TagTypes.DATE && tag.scenarioData.toggle; })
4970
+ : scenarioTag.scenarioData.toggle;
4971
+ var selectedTagSubType = isDateTag
4972
+ ? this.getScenarioSelectedDateTag(scenario, scenarioTagsConfig)
4973
+ : scenarioTag.options.sub_type;
4974
+ var tag = {
4975
+ toggle: this.areExistingTagsConfig ? false : toggleStatus,
4976
+ name: scenarioTag.scenarioData.name || scenarioTag.name,
4977
+ description: scenarioTag.scenarioData.description || scenarioTag.description,
4978
+ type: scenarioTag.type,
4979
+ selectedTagSubType: selectedTagSubType,
4980
+ };
4981
+ if (scenarioTag.scenarioData.turnOffDateTags) {
4982
+ tag.turnOffDateTags = scenarioTag.scenarioData.turnOffDateTags;
4983
+ }
4984
+ if (scenarioTag.scenarioData.acceptableDateTags) {
4985
+ tag.acceptableDateTags = scenarioTag.scenarioData.acceptableDateTags;
4986
+ }
4987
+ return tag;
4988
+ };
4989
+ ScenarioService.prototype.sortedScenarioSubTags = function (tag) {
4990
+ var SUB_TAGS_ORDER = [TagsConfigSubType.DAY, TagsConfigSubType.WEEK, TagsConfigSubType.MONTH, TagsConfigSubType.QUARTER, TagsConfigSubType.YEAR];
4991
+ return _.orderBy(tag.subTags, function (subTag) { return _.indexOf(SUB_TAGS_ORDER, subTag.subType); });
4992
+ };
4993
+ ScenarioService.prototype.updateScenarioSubTags = function (tag, scenarioTag) {
4994
+ if (!tag.subTags) {
4995
+ tag.subTags = [];
4996
+ }
4997
+ var tagSubType = scenarioTag.options.sub_type;
4998
+ tag.subTags.push({
4999
+ subType: tagSubType,
5000
+ name: tagSubType === TagsConfigSubType.FORECAST_NEW ? this.DEFAULT_FORECAST_DATE_TAG : scenarioTag.name,
5001
+ });
5002
+ };
5003
+ ScenarioService.prototype.turnOffDateTag = function (scenarioTags) {
5004
+ var dateTag = _.find(scenarioTags, { type: exports.TagTypes.DATE });
5005
+ if (!dateTag)
5006
+ return;
5007
+ dateTag.toggle = false;
5008
+ };
5009
+ ScenarioService.prototype.hideNotAvailableTags = function (tagWithSpecificDateTags, scenarioTags) {
5010
+ var _a;
5011
+ var subTags = (_a = _.find(scenarioTags, { type: exports.TagTypes.DATE })) === null || _a === void 0 ? void 0 : _a.subTags;
5012
+ if (!subTags.length)
5013
+ return;
5014
+ _.forEach(scenarioTags, function (tag) {
5015
+ var _a;
5016
+ if (!((_a = tag.acceptableDateTags) === null || _a === void 0 ? void 0 : _a.length))
5017
+ return;
5018
+ if (tag !== tagWithSpecificDateTags) {
5019
+ tag.toggle = false;
5020
+ }
5021
+ });
5022
+ _.forEach(subTags, function (subTag) {
5023
+ subTag.hidden = !tagWithSpecificDateTags.acceptableDateTags.includes(subTag.subType);
5024
+ });
5025
+ };
5026
+ ScenarioService.prototype.getScenarioSelectedDateTag = function (scenario, dateTags) {
5027
+ var _c;
5028
+ var _a, _b;
5029
+ var monthSubType = (_b = (_a = _.find(dateTags, function (tag) { return tag.options.sub_type === TagsConfigSubType.MONTH; })) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.sub_type;
5030
+ var scenarioSelectedDateTag = (_c = {},
5031
+ _c[exports.Scenario.ACTUALS] = function () { return monthSubType; },
5032
+ _c[exports.Scenario.BUDGET] = function () { var _a, _b; return (_b = (_a = _.find(dateTags, function (tag) { return tag.options.sub_type === TagsConfigSubType.YEAR; })) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.sub_type; },
5033
+ _c[exports.Scenario.FORECAST] = function () { var _a, _b; return (_b = (_a = _.find(dateTags, function (tag) { return tag.options.sub_type === TagsConfigSubType.FORECAST_NEW; })) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.sub_type; },
5034
+ _c[exports.Scenario.NONE] = function () { return monthSubType; },
5035
+ _c);
5036
+ if (!scenarioSelectedDateTag[scenario])
5037
+ return;
5038
+ return scenarioSelectedDateTag[scenario]();
5039
+ };
5040
+ ScenarioService.prototype.getScenarioTagsConfig = function (scenario, tagsConfig) {
5041
+ var _this = this;
5042
+ return _.reduce(tagsConfig, function (acc, tagConfig) {
5043
+ var _a;
5044
+ var tagSubType = (_a = tagConfig === null || tagConfig === void 0 ? void 0 : tagConfig.options) === null || _a === void 0 ? void 0 : _a.sub_type;
5045
+ var scenarioTagDataConfig = getScenarioTagDataConfig(_this.isMultipleDimension);
5046
+ var scenarioTagConfig = scenarioTagDataConfig && scenarioTagDataConfig[scenario] ?
5047
+ scenarioTagDataConfig[scenario][tagSubType] : null;
5048
+ if (!scenarioTagConfig || scenarioTagConfig.hidden)
5049
+ return acc;
5050
+ var clonedTagConfig = _.cloneDeep(tagConfig);
5051
+ var scenarioTag = Object.assign(Object.assign({}, clonedTagConfig), { scenarioData: scenarioTagConfig });
5052
+ acc.push(scenarioTag);
5053
+ return acc;
5054
+ }, []);
5055
+ };
5056
+ return ScenarioService;
5057
+ }());
5058
+ ScenarioService.decorators = [
5059
+ { type: i0.Injectable }
5060
+ ];
5061
+
5062
+ var DrSharedUtils = /** @class */ (function () {
5063
+ function DrSharedUtils() {
5064
+ }
5065
+ /**
5066
+ * Get timeframe (day, year, month, quarter) based on passed format
5067
+ *
5068
+ * @param format - date format string. Examples: MM/DD/YYYY, Q/YYYY
5069
+ */
5070
+ DrSharedUtils.getTimeframeByDateFormat = function (format) {
5071
+ var defaultFrame = exports.TimeframeOption.DAY;
5072
+ if (!format) {
5073
+ return defaultFrame;
5074
+ }
5075
+ var lowerCaseFormat = format.toLowerCase();
5076
+ switch (true) {
5077
+ case lowerCaseFormat.includes('q'):
5078
+ return exports.TimeframeOption.QUARTER;
5079
+ case lowerCaseFormat.includes('d'):
5080
+ return exports.TimeframeOption.DAY;
5081
+ case lowerCaseFormat.includes('w'):
5082
+ return exports.TimeframeOption.WEEK;
5083
+ case lowerCaseFormat.includes('m'):
5084
+ return exports.TimeframeOption.MONTH;
5085
+ case lowerCaseFormat.includes('y'):
5086
+ return exports.TimeframeOption.YEAR;
5087
+ default:
5088
+ return defaultFrame;
5089
+ }
5090
+ };
5091
+ DrSharedUtils.getDateByTag = function (tag) {
5092
+ var todayDate = moment__namespace().utc().endOf('day');
5093
+ switch (tag) {
5094
+ case exports.DateTags.TODAY:
5095
+ return todayDate;
5096
+ case exports.DateTags.YESTERDAY:
5097
+ todayDate.subtract(1, 'days');
5098
+ return todayDate;
5099
+ case exports.DateTags.THIS_MONTH:
5100
+ todayDate.endOf('month');
5101
+ return todayDate;
5102
+ case exports.DateTags.PREV_MONTH:
5103
+ todayDate.subtract(1, 'months').endOf('month');
5104
+ return todayDate;
5105
+ }
5106
+ };
5107
+ return DrSharedUtils;
5108
+ }());
5109
+
5110
+ // @ts-ignore
4621
5111
  var moment$2 = require('moment');
4622
5112
  var DrDatePickerService = /** @class */ (function () {
4623
5113
  function DrDatePickerService() {
@@ -5367,1307 +5857,831 @@
5367
5857
  this.setValueFromMoment(newValue);
5368
5858
  }
5369
5859
  };
5370
- /**
5371
- * Set inner value from timestamp and propagate
5372
- *
5373
- * @param timestamp
5374
- */
5375
- DrDatePickerWithTimeframeComponent.prototype.setValue = function (timestamp) {
5376
- this.datePickerService.resetPresetTag();
5377
- _super.prototype.setValue.call(this, timestamp);
5378
- };
5379
- DrDatePickerWithTimeframeComponent.prototype.writeValue = function (value) {
5380
- _super.prototype.writeValue.call(this, value);
5381
- if (!value)
5382
- return;
5383
- this.restrictPagination();
5384
- };
5385
- DrDatePickerWithTimeframeComponent.prototype.getNextDate = function (actionCall, amount, forward) {
5386
- var _a, _b;
5387
- return (_b = (_a = this.dateAdapter)[actionCall]) === null || _b === void 0 ? void 0 : _b.call(_a, this.innerValue, forward ? amount : -amount);
5388
- };
5389
- DrDatePickerWithTimeframeComponent.prototype.restrictPagination = function () {
5390
- if (!this._min && !this._max)
5391
- return;
5392
- var nextValue = this.pagingSetup[this.datePickerService.timeframe](true);
5393
- var prevValue = this.pagingSetup[this.datePickerService.timeframe](false);
5394
- this.isNextDateDisabled = this._max && nextValue && nextValue.unix() > this._max.unix();
5395
- this.isPrevDateDisabled = this._min && prevValue && prevValue.unix() < this._min.unix();
5396
- };
5397
- return DrDatePickerWithTimeframeComponent;
5398
- }(DrDatePickerComponent));
5399
- DrDatePickerWithTimeframeComponent.decorators = [
5400
- { type: i0.Component, args: [{
5401
- selector: 'dr-date-picker-with-timeframe',
5402
- template: "<dr-button [disabled]=\"isPrevDateDisabled\" *ngIf=\"!disabled\" theme=\"icon\" icon=\"dr-icon-arrow-left\" (click)=\"pagingClicked(false)\"></dr-button>\n<div class=\"dr-datepicker-input-container\">\n <i *ngIf=\"isDashboardDatepicker\" class=\"dr-icon-date\"></i>\n\n <div class=\"dr-datepicker-input-container__formatted-value-display\" (click)=\"datepickerInput.click()\">\n <span *ngIf=\"presetTagSelected && datePickerService.isUsingDateTagPresets\"> {{ presetTagSelected }} </span>\n <span>{{ presetTagSelected && datePickerService.isUsingDateTagPresets ? '(' + displayedFormattedValue + ')' : displayedFormattedValue }}</span>\n </div>\n <input\n #datepickerInput\n [(ngModel)]=\"value\"\n (click)=\"datePicker.open()\"\n [matDatepicker]=\"datePicker\"\n [readonly]=\"readonly\"\n [min]=\"_min\"\n [max]=\"_max\"\n />\n</div>\n<dr-button [disabled]=\"isNextDateDisabled\" *ngIf=\"!disabled\" theme=\"icon\" icon=\"dr-icon-arrow-right\" (click)=\"pagingClicked(true)\"></dr-button>\n<mat-datepicker #datePicker\n class=\"dr-timeframe-datepicker\"\n [calendarHeaderComponent]=\"customHeader\"\n (yearSelected)=\"chosenPeriodHandler($event, timeframeOption.YEAR)\"\n (monthSelected)=\"chosenPeriodHandler($event, timeframeOption.MONTH)\"\n [panelClass]=\"datePickerService.isUsingDateTagPresets ? 'date-picker-preset-tag' : 'dr-timeframe-datepicker'\"\n >\n</mat-datepicker>\n",
5403
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
5404
- providers: [
5405
- { provide: forms.NG_VALUE_ACCESSOR, useExisting: DrDatePickerWithTimeframeComponent, multi: true },
5406
- { provide: DrDatePickerService }
5407
- ],
5408
- styles: [":host{position:relative;width:100%;display:flex;flex-direction:row;min-height:32px;height:32px;font-size:14px;font-family:\"Poppins\",sans-serif;background-color:#fff;border:1px solid #9EA1AA;border-radius:6px;color:#85889c;overflow:hidden;outline:none;cursor:pointer}:host:hover{border-color:#85889c}:host:focus-within{border-color:#4646ce!important;color:#151b3f}:host.disabled{pointer-events:none;border:1px solid #aeabac;background:#f0f1f4}:host.disabled:after{color:#aeabac}:host.ng-valid.ng-dirty{border-color:#03a678}:host.ng-invalid.ng-dirty:not(:focus-within){border-color:#de2833!important}:host.ng-untouched.ng-valid{border-color:#9ea1aa}:host:after,:host:before{position:absolute;display:flex;border-color:#999999 transparent transparent;color:#999}:host:after{content:\"\\e9b6\";font-family:DataRails;font-size:24px;color:#6d6e6f;top:0;bottom:0;right:8px;position:absolute;display:flex;align-items:center;justify-content:center}:host i{display:flex;align-items:center;position:absolute;color:#999;left:8px;top:0;bottom:0}:host input{display:flex;flex-grow:1;height:100%;border:none;text-align:left;padding-left:35px;padding-right:25px;cursor:pointer!important;outline:none}:host input.when-quarter{position:absolute;visibility:hidden}:host input:disabled{border:none;color:#aeabac;background:transparent}:host input::-webkit-search-decoration,:host input::-webkit-search-cancel-button,:host input::-webkit-search-results-button,:host input::-webkit-search-results-decoration{-webkit-appearance:none}::ng-deep .mat-datepicker-content{margin:7px 0;box-shadow:0 4px 8px 1px #00000040;border-radius:12px!important}::ng-deep .mat-datepicker-content button[disabled]{border:inherit;color:inherit;background-color:inherit}::ng-deep .mat-datepicker-content button[disabled]:hover{border:inherit}::ng-deep .mat-calendar-body-cell:not(.mat-calendar-body-disabled):hover>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){background:#f2f2fb;color:#4646ce;font-weight:600}::ng-deep .mat-calendar-body-selected{background-color:#4646ce;color:#f2f2fb;font-weight:600}::ng-deep .mat-calendar-body-today.mat-calendar-body-selected{box-shadow:none}::ng-deep .mat-button-focus-overlay{background:#f3f7ff}::ng-deep .mat-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:1!important;background:#f3f7ff;transition:opacity .2s cubic-bezier(.35,0,.25,1)}::ng-deep .mat-calendar-controls .mat-calendar-period-button:hover{background:#f3f7ff;transition:background .2s cubic-bezier(.35,0,.25,1)}::ng-deep .mat-calendar-table-header th{font-size:14px;font-weight:600;color:#19181a}::ng-deep .mat-calendar-table-header-divider{display:none}::ng-deep .mat-calendar-body-label{color:#fff;padding:0}:host{border:none;display:flex;align-items:center}:host.disabled{background:transparent;color:inherit}:host.disabled.dr-date-picker-on-dashboard .dr-datepicker-input-container__formatted-value-display{text-decoration:none;color:#6d6e6f;font-weight:normal}:host.dr-date-picker-on-dashboard{width:-moz-fit-content;width:fit-content;justify-content:space-between}:host.dr-date-picker-on-dashboard mat-datepicker{position:absolute}:host.dr-date-picker-on-dashboard:after{visibility:hidden}:host.dr-date-picker-on-dashboard .dr-datepicker-input-container{display:flex;flex-direction:row;justify-content:center;align-items:center;margin-left:-10px}:host.dr-date-picker-on-dashboard .dr-datepicker-input-container__formatted-value-display{font-weight:600;width:auto;margin-left:5px}:host.dr-date-picker-on-dashboard .dr-datepicker-input-container .dr-icon-date{display:block;position:relative;top:0;margin-right:8px;color:#4e566c}:host .dr-datepicker-input-container input{visibility:hidden;position:absolute;width:100%}:host .dr-datepicker-input-container__formatted-value-display{width:90px;height:22px;padding-left:0;text-align:center;line-height:22px;color:#0c142b;-webkit-text-decoration-line:underline;text-decoration-line:underline}:host .dr-datepicker-input-container__formatted-value-display:hover{background-color:#f2f2fb;border-radius:5px;cursor:pointer;-webkit-text-decoration-line:underline;text-decoration-line:underline;color:#4646ce}::ng-deep .date-picker-preset-tag{width:386px!important}::ng-deep .date-picker-preset-tag .mat-calendar-content{padding-left:32px!important;padding-right:32px!important}\n"]
5409
- },] }
5410
- ];
5411
- DrDatePickerWithTimeframeComponent.ctorParameters = function () { return [
5412
- { type: i0.ChangeDetectorRef },
5413
- { type: core.DateAdapter },
5414
- { type: DrDatePickerService }
5415
- ]; };
5416
- DrDatePickerWithTimeframeComponent.propDecorators = {
5417
- isDashboardClassDisplayed: [{ type: i0.HostBinding, args: ['class.dr-date-picker-on-dashboard',] }],
5418
- isDashboardDatepicker: [{ type: i0.Input }],
5419
- dateFormatConfig: [{ type: i0.Input }],
5420
- canSelectTimeframe: [{ type: i0.Input }],
5421
- availableTimeframes: [{ type: i0.Input }],
5422
- paginationDebounce: [{ type: i0.Input }],
5423
- isUsingDateTagPresets: [{ type: i0.Input }],
5424
- presetTag: [{ type: i0.Input }],
5425
- onChangeFormat: [{ type: i0.Output }],
5426
- onChangePresetTag: [{ type: i0.Output }]
5427
- };
5428
-
5429
- var DrDatePickerFormatDirective = /** @class */ (function () {
5430
- function DrDatePickerFormatDirective(matDateFormat, ngControl) {
5431
- this.matDateFormat = matDateFormat;
5432
- this.ngControl = ngControl;
5433
- }
5434
- Object.defineProperty(DrDatePickerFormatDirective.prototype, "datePickerFormat", {
5435
- set: function (format) {
5436
- var _a;
5437
- if (this.configDateParse) {
5438
- this.matDateFormat.updateDateFormat(this.configDateParse, this.configDateDisplay);
5439
- }
5440
- else {
5441
- this.matDateFormat.updateDateFormat({ dateInput: format });
5442
- }
5443
- var value = this.ngControl.value;
5444
- (_a = this.ngControl.valueAccessor) === null || _a === void 0 ? void 0 : _a.writeValue(value);
5445
- },
5446
- enumerable: false,
5447
- configurable: true
5448
- });
5449
- return DrDatePickerFormatDirective;
5450
- }());
5451
- DrDatePickerFormatDirective.decorators = [
5452
- { type: i0.Directive, args: [{
5453
- selector: '[drDatePickerFormat]',
5454
- providers: [
5455
- {
5456
- provide: core.DateAdapter,
5457
- useClass: materialMomentAdapter.MomentDateAdapter
5458
- },
5459
- {
5460
- provide: core.MAT_DATE_FORMATS,
5461
- useClass: CustomDateFormat
5462
- }
5463
- ]
5464
- },] }
5465
- ];
5466
- DrDatePickerFormatDirective.ctorParameters = function () { return [
5467
- { type: CustomDateFormat, decorators: [{ type: i0.Inject, args: [core.MAT_DATE_FORMATS,] }] },
5468
- { type: forms.NgControl, decorators: [{ type: i0.Optional }] }
5469
- ]; };
5470
- DrDatePickerFormatDirective.propDecorators = {
5471
- configDateParse: [{ type: i0.Input }],
5472
- configDateDisplay: [{ type: i0.Input }],
5473
- datePickerFormat: [{ type: i0.Input, args: ['drDatePickerFormat',] }]
5474
- };
5475
-
5476
- var DrShowTimeframePipe = /** @class */ (function () {
5477
- function DrShowTimeframePipe() {
5478
- }
5479
- DrShowTimeframePipe.prototype.transform = function (arr, showOptions) {
5480
- return arr.filter(function (item) { return showOptions.includes(item.timeframe); });
5481
- };
5482
- return DrShowTimeframePipe;
5483
- }());
5484
- DrShowTimeframePipe.decorators = [
5485
- { type: i0.Pipe, args: [{
5486
- name: 'drShowTimeframePipe'
5487
- },] }
5488
- ];
5489
-
5490
- var DrSelectAddItemComponent = /** @class */ (function () {
5491
- function DrSelectAddItemComponent(drSelect) {
5492
- this.drSelect = drSelect;
5493
- this.currentValues = [];
5494
- this.dynamicAddLabel = 'Add new';
5495
- this.values = [];
5496
- this.dynamicValueAdded = new i0.EventEmitter();
5497
- }
5498
- Object.defineProperty(DrSelectAddItemComponent.prototype, "inputRef", {
5499
- set: function (input) {
5500
- if (!input)
5501
- return;
5502
- input.focus();
5503
- },
5504
- enumerable: false,
5505
- configurable: true
5506
- });
5507
- DrSelectAddItemComponent.prototype.ngOnChanges = function (changes) {
5508
- this.calculateCurrentValues();
5509
- };
5510
- DrSelectAddItemComponent.prototype.ngOnInit = function () {
5511
- this.calculateCurrentValues();
5512
- };
5513
- DrSelectAddItemComponent.prototype.onDynamicAdding = function () {
5514
- this.isDynamicAdding = true;
5515
- };
5516
- DrSelectAddItemComponent.prototype.onDynamicAddingClose = function () {
5517
- this.isDynamicAdding = false;
5518
- this.dynamicValue = '';
5519
- };
5520
- DrSelectAddItemComponent.prototype.isDynamicValueValid = function () {
5521
- var _a;
5522
- var trimmedValue = (_a = this.dynamicValue) === null || _a === void 0 ? void 0 : _a.trim();
5523
- if (!trimmedValue)
5524
- return false;
5525
- return !this.currentValues.includes(trimmedValue);
5526
- };
5527
- DrSelectAddItemComponent.prototype.onDynamicAdd = function (value, keydownEvent) {
5528
- this.isDirty = true;
5529
- if (!this.isDynamicValueValid())
5530
- return;
5531
- if (keydownEvent && keydownEvent.key !== 'Enter')
5532
- return;
5533
- this.onDynamicAddingClose();
5534
- this.drSelect.close();
5535
- this.dynamicValueAdded.emit(value === null || value === void 0 ? void 0 : value.trim());
5536
- };
5537
- DrSelectAddItemComponent.prototype.calculateCurrentValues = function () {
5538
- var _this = this;
5539
- this.currentValues = this.bindValue
5540
- ? _.reduce(this.values, function (acc, curr) {
5541
- acc.push(curr[_this.bindValue]);
5542
- return acc;
5543
- }, [])
5544
- : this.values;
5545
- };
5546
- return DrSelectAddItemComponent;
5547
- }());
5548
- DrSelectAddItemComponent.decorators = [
5549
- { type: i0.Component, args: [{
5550
- selector: 'dr-select-add-item',
5551
- template: "<div class=\"dr-select__dynamic-add dynamic-add\">\n <div class=\"dynamic-add__add-item\" (click)=\"onDynamicAdding()\">\n <i class=\"dr-icon-add\"></i>\n <p class=\"dynamic-add__add-item__text\">{{ dynamicAddLabel }}</p>\n </div>\n <div *ngIf=\"isDynamicAdding\" class=\"dynamic-add__field\">\n <dr-input #dynamicInputRef\n class=\"dynamic-add__field__input\"\n [class.dynamic-add__field__input--error]=\"!isDynamicValueValid() && isDirty\"\n [(ngModel)]=\"dynamicValue\"\n (keydown)=\"onDynamicAdd(dynamicValue, $event)\"\n placeholder=\"Type...\"></dr-input>\n <div class=\"dynamic-add__field__buttons\">\n <dr-button *ngIf=\"dynamicValue && isDynamicValueValid()\"\n theme=\"icon\"\n icon=\"dr-icon-approve\"\n iconSize=\"18px\"\n (click)=\"onDynamicAdd(dynamicValue)\"></dr-button>\n <dr-button theme=\"icon\"\n icon=\"dr-icon-exit\"\n iconSize=\"18px\"\n (click)=\"onDynamicAddingClose()\"></dr-button>\n </div>\n </div>\n</div>\n",
5552
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
5553
- styles: [".dynamic-add__add-item{cursor:pointer;display:flex;align-items:center;border-bottom:1px solid #dfe0e3;padding:6px}.dynamic-add__add-item:hover{background:#f9f7ff}.dynamic-add__add-item__text{font-size:14px;line-height:22px;margin:0}.dynamic-add__field{position:relative}.dynamic-add__field__buttons{position:absolute;top:0;right:0;bottom:0;display:flex;align-items:center}::ng-deep .ng-dropdown-panel .ng-dropdown-header:has(.dynamic-add){padding:0;border:none}::ng-deep .dynamic-add__field__input{padding-left:12px!important;height:36px!important;border:none!important;background:#f9f7ff!important;border-radius:0!important}::ng-deep .dynamic-add__field__input>input{background:#f9f7ff}::ng-deep .dynamic-add__field__input>input::placeholder{line-height:22px;font-size:14px;font-weight:400;color:#9ea1aa}::ng-deep .dynamic-add__field__input--error{background:#ffdfe4!important}::ng-deep .dynamic-add__field__input--error>input{background:#ffdfe4}\n"]
5554
- },] }
5555
- ];
5556
- DrSelectAddItemComponent.ctorParameters = function () { return [
5557
- { type: DrSelectComponent }
5558
- ]; };
5559
- DrSelectAddItemComponent.propDecorators = {
5560
- dynamicAddLabel: [{ type: i0.Input }],
5561
- bindValue: [{ type: i0.Input }],
5562
- values: [{ type: i0.Input }],
5563
- dynamicValueAdded: [{ type: i0.Output }],
5564
- inputRef: [{ type: i0.ViewChild, args: ['dynamicInputRef',] }]
5565
- };
5566
-
5567
- var TooltipInfoComponent = /** @class */ (function () {
5568
- function TooltipInfoComponent() {
5569
- }
5570
- return TooltipInfoComponent;
5571
- }());
5572
- TooltipInfoComponent.decorators = [
5573
- { type: i0.Component, args: [{
5574
- selector: 'dr-tooltip-info',
5575
- template: "<div class=\"tooltip-info\">\n <i *ngIf=\"data?.icon else defaultIcon\" class=\"fa\" [class]=\"data.icon\" [style.fontSize.px]=\"14\"\n [style.margin.px]=\"12\" [style.color]=\"data?.iconColor || '#7B61FF'\"></i>\n <div class=\"tooltip-info-content-wrapper\">\n <div *ngIf=\"data?.title\" class=\"tooltip-info_header\">\n <span>{{data.title}}</span>\n </div>\n <div *ngIf=\"data?.description\" class=\"tooltip-info_description\"\n [class.tooltip-info_description-no-border]=\"!data.title\">\n <ng-container *ngIf=\"!data.title\"></ng-container>\n <span *ngIf=\"!useDescriptionAsHTML\">{{data.description}}</span>\n <div *ngIf=\"useDescriptionAsHTML\" [innerHTML]=\"data.description\"></div>\n </div>\n </div>\n</div>\n\n<ng-template #defaultIcon>\n <ng-container *ngIf=\"!data.icon\">\n <div class=\"default-icon\"></div>\n </ng-container>\n</ng-template>\n",
5576
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
5577
- styles: [".tooltip-info{width:316px;display:flex}.tooltip-info-content-wrapper{display:flex;flex-direction:column;padding-top:10px}.tooltip-info_header{padding:0 16px 6px 0;font-weight:bold;font-size:14px;line-height:16px;letter-spacing:.25px;display:flex;justify-content:flex-start}.tooltip-info_header>i{margin-right:10px}.tooltip-info-content-wrapper{padding-top:10px}.tooltip-info_description{display:flex;align-items:flex-start;border-top:1px solid #aeb5bb;padding:12px 10px 10px 0;text-align:left;font-weight:normal;font-size:14px;line-height:22px}.tooltip-info_description-no-border{padding-top:0;border-top:none}.tooltip-info_description>i{margin-right:10px}:host.tooltip-info-medium .tooltip-info{max-width:272px}:host.tooltip-info-medium .tooltip-info-content-wrapper{padding-top:10px}:host.tooltip-info-medium .tooltip-info_header,:host.tooltip-info-medium .tooltip-info_description{min-height:unset;border-top:none;font-size:14px;line-height:22px}:host.tooltip-info-medium .tooltip-info_header{padding:10px 10px 0 0}:host.tooltip-info-medium .tooltip-info_description{padding:10px 12px 10px 0}:host.tooltip-info-medium .tooltip-info .default-icon:before{background:url(\"data:image/svg+xml,%3Csvg width%3D%2216%22 height%3D%2216%22 viewBox%3D%220 0 16 16%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E %3Cpath d%3D%22M8.00008 2.66669C5.05341 2.66669 2.66675 5.05335 2.66675 8.00002C2.66675 10.9467 5.05341 13.3334 8.00008 13.3334C10.9467 13.3334 13.3334 10.9467 13.3334 8.00002C13.3334 5.05335 10.9467 2.66669 8.00008 2.66669ZM8.53341 10.6667H7.46675V7.46669H8.53341V10.6667ZM8.53341 6.40002H7.46675V5.33335H8.53341V6.40002Z%22 fill%3D%22%237B61FF%22%2F%3E%3C%2Fsvg%3E\") no-repeat;background-size:100% 100%;display:inline-block;height:20px;width:20px;content:\"\"}:host.tooltip-info-small .tooltip-info{width:auto}:host.tooltip-info-small .tooltip-info-content-wrapper{padding-top:10px}:host.tooltip-info-small .tooltip-info_header,:host.tooltip-info-small .tooltip-info_description{min-height:unset;border-top:none;font-size:14px;line-height:22px}:host.tooltip-info-small .tooltip-info_header{padding:0 10px 0 0}:host.tooltip-info-small .tooltip-info_description{padding:0 12px 10px 0}:host.tooltip-info-small .tooltip-info .default-icon:before{background:url(\"data:image/svg+xml,%3Csvg width%3D%2216%22 height%3D%2216%22 viewBox%3D%220 0 16 16%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E %3Cpath d%3D%22M8.00008 2.66669C5.05341 2.66669 2.66675 5.05335 2.66675 8.00002C2.66675 10.9467 5.05341 13.3334 8.00008 13.3334C10.9467 13.3334 13.3334 10.9467 13.3334 8.00002C13.3334 5.05335 10.9467 2.66669 8.00008 2.66669ZM8.53341 10.6667H7.46675V7.46669H8.53341V10.6667ZM8.53341 6.40002H7.46675V5.33335H8.53341V6.40002Z%22 fill%3D%22%237B61FF%22%2F%3E%3C%2Fsvg%3E\") no-repeat;background-size:100% 100%;display:inline-block;height:20px;width:20px;content:\"\"}.default-icon{position:relative;width:18px;height:18px;margin:10px}.default-icon:before{background:url(\"data:image/svg+xml,%3Csvg width%3D%2216%22 height%3D%2216%22 viewBox%3D%220 0 16 16%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E %3Cpath d%3D%22M8.00008 2.66669C5.05341 2.66669 2.66675 5.05335 2.66675 8.00002C2.66675 10.9467 5.05341 13.3334 8.00008 13.3334C10.9467 13.3334 13.3334 10.9467 13.3334 8.00002C13.3334 5.05335 10.9467 2.66669 8.00008 2.66669ZM8.53341 10.6667H7.46675V7.46669H8.53341V10.6667ZM8.53341 6.40002H7.46675V5.33335H8.53341V6.40002Z%22 fill%3D%22%237B61FF%22%2F%3E%3C%2Fsvg%3E\") no-repeat;background-size:100% 100%;display:inline-block;height:18px;width:18px;content:\"\"}\n"]
5578
- },] }
5579
- ];
5580
- TooltipInfoComponent.ctorParameters = function () { return []; };
5581
- TooltipInfoComponent.propDecorators = {
5582
- data: [{ type: i0.Input }],
5583
- useDescriptionAsHTML: [{ type: i0.Input }]
5584
- };
5585
-
5586
- var TooltipInfoSimpleComponent = /** @class */ (function () {
5587
- function TooltipInfoSimpleComponent() {
5588
- }
5589
- return TooltipInfoSimpleComponent;
5590
- }());
5591
- TooltipInfoSimpleComponent.decorators = [
5592
- { type: i0.Component, args: [{
5593
- selector: 'dr-tooltip-info-simple',
5594
- template: "<div class=\"tooltip-info-simple\">\n <div *ngIf=\"context?.title\" class=\"tooltip-info-simple__title\">{{context?.title}}</div>\n <div *ngIf=\"context?.description\" class=\"tooltip-info-simple__description\">{{context?.description}}</div>\n</div>\n",
5595
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
5596
- styles: [".tooltip-info-simple{max-width:250px;font-size:14px;line-height:22px;padding:10px 12px;color:#0c142b}.tooltip-info-simple__title{font-weight:600;overflow:hidden;text-overflow:ellipsis}\n"]
5597
- },] }
5598
- ];
5599
- TooltipInfoSimpleComponent.ctorParameters = function () { return []; };
5600
- TooltipInfoSimpleComponent.propDecorators = {
5601
- context: [{ type: i0.Input }]
5602
- };
5603
-
5604
- var TooltipNoBodyComponent = /** @class */ (function () {
5605
- function TooltipNoBodyComponent() {
5606
- }
5607
- TooltipNoBodyComponent.prototype.ngOnInit = function () {
5608
- };
5609
- return TooltipNoBodyComponent;
5610
- }());
5611
- TooltipNoBodyComponent.decorators = [
5612
- { type: i0.Component, args: [{
5613
- selector: 'dr-tooltip-no-body',
5614
- template: "<div class=\"tooltip-bold\" [ngClass]=\"{'tooltip-bold--icon': context?.icon}\">\n <div class=\"tooltip-bold__title\">\n <i *ngIf=\"context?.icon\" [class]=\"context?.icon\" [style.color]=\"context?.iconColor || 'black'\"></i>\n {{ context.title }}\n </div>\n <div class=\"tooltip-bold-text\">\n {{ context.text }}\n </div>\n</div>",
5615
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
5616
- styles: [".tooltip-bold{position:relative;box-shadow:0 4px 8px 1px #00000040;border:1px solid #c3c4ce;border-radius:8px;font-size:14px;line-height:22px;padding:10px 12px;background-color:#fff}.tooltip-bold--icon{padding-left:44px}.tooltip-bold__title{font-weight:bold}.tooltip-bold__title>i{position:absolute;width:16px;height:16px;left:10px}\n"]
5617
- },] }
5618
- ];
5619
- TooltipNoBodyComponent.ctorParameters = function () { return []; };
5620
- TooltipNoBodyComponent.propDecorators = {
5621
- context: [{ type: i0.Input }]
5622
- };
5623
-
5624
- var TooltipProcessDefaultComponent = /** @class */ (function () {
5625
- function TooltipProcessDefaultComponent() {
5626
- }
5627
- return TooltipProcessDefaultComponent;
5628
- }());
5629
- TooltipProcessDefaultComponent.decorators = [
5860
+ /**
5861
+ * Set inner value from timestamp and propagate
5862
+ *
5863
+ * @param timestamp
5864
+ */
5865
+ DrDatePickerWithTimeframeComponent.prototype.setValue = function (timestamp) {
5866
+ this.datePickerService.resetPresetTag();
5867
+ _super.prototype.setValue.call(this, timestamp);
5868
+ };
5869
+ DrDatePickerWithTimeframeComponent.prototype.writeValue = function (value) {
5870
+ _super.prototype.writeValue.call(this, value);
5871
+ if (!value)
5872
+ return;
5873
+ this.restrictPagination();
5874
+ };
5875
+ DrDatePickerWithTimeframeComponent.prototype.getNextDate = function (actionCall, amount, forward) {
5876
+ var _a, _b;
5877
+ return (_b = (_a = this.dateAdapter)[actionCall]) === null || _b === void 0 ? void 0 : _b.call(_a, this.innerValue, forward ? amount : -amount);
5878
+ };
5879
+ DrDatePickerWithTimeframeComponent.prototype.restrictPagination = function () {
5880
+ if (!this._min && !this._max)
5881
+ return;
5882
+ var nextValue = this.pagingSetup[this.datePickerService.timeframe](true);
5883
+ var prevValue = this.pagingSetup[this.datePickerService.timeframe](false);
5884
+ this.isNextDateDisabled = this._max && nextValue && nextValue.unix() > this._max.unix();
5885
+ this.isPrevDateDisabled = this._min && prevValue && prevValue.unix() < this._min.unix();
5886
+ };
5887
+ return DrDatePickerWithTimeframeComponent;
5888
+ }(DrDatePickerComponent));
5889
+ DrDatePickerWithTimeframeComponent.decorators = [
5630
5890
  { type: i0.Component, args: [{
5631
- selector: 'dr-tooltip-process-default',
5632
- template: "\n <div class=\"container\" [innerHTML]=\"text\"></div>\n ",
5891
+ selector: 'dr-date-picker-with-timeframe',
5892
+ template: "<dr-button [disabled]=\"isPrevDateDisabled\" *ngIf=\"!disabled\" theme=\"icon\" icon=\"dr-icon-arrow-left\" (click)=\"pagingClicked(false)\"></dr-button>\n<div class=\"dr-datepicker-input-container\">\n <i *ngIf=\"isDashboardDatepicker\" class=\"dr-icon-date\"></i>\n\n <div class=\"dr-datepicker-input-container__formatted-value-display\" (click)=\"datepickerInput.click()\">\n <span *ngIf=\"presetTagSelected && datePickerService.isUsingDateTagPresets\"> {{ presetTagSelected }} </span>\n <span>{{ presetTagSelected && datePickerService.isUsingDateTagPresets ? '(' + displayedFormattedValue + ')' : displayedFormattedValue }}</span>\n </div>\n <input\n #datepickerInput\n [(ngModel)]=\"value\"\n (click)=\"datePicker.open()\"\n [matDatepicker]=\"datePicker\"\n [readonly]=\"readonly\"\n [min]=\"_min\"\n [max]=\"_max\"\n />\n</div>\n<dr-button [disabled]=\"isNextDateDisabled\" *ngIf=\"!disabled\" theme=\"icon\" icon=\"dr-icon-arrow-right\" (click)=\"pagingClicked(true)\"></dr-button>\n<mat-datepicker #datePicker\n class=\"dr-timeframe-datepicker\"\n [calendarHeaderComponent]=\"customHeader\"\n (yearSelected)=\"chosenPeriodHandler($event, timeframeOption.YEAR)\"\n (monthSelected)=\"chosenPeriodHandler($event, timeframeOption.MONTH)\"\n [panelClass]=\"datePickerService.isUsingDateTagPresets ? 'date-picker-preset-tag' : 'dr-timeframe-datepicker'\"\n >\n</mat-datepicker>\n",
5633
5893
  changeDetection: i0.ChangeDetectionStrategy.OnPush,
5634
- styles: ["\n .container {\n width: auto;\n max-width: 388px;\n text-align: start;\n font-size: 14px;\n line-height: 22px;\n padding: 10px 12px;\n color: #151B3F;\n background-color: #FFF;\n border-radius: 8px;\n box-shadow: 0px 4px 8px 1px rgba(0, 0, 0, 0.25);\n border: 1px solid #C3C4CE;\n }\n "]
5635
- },] }
5636
- ];
5637
- TooltipProcessDefaultComponent.ctorParameters = function () { return []; };
5638
- TooltipProcessDefaultComponent.propDecorators = {
5639
- text: [{ type: i0.Input }]
5640
- };
5641
-
5642
- var TOOLTIP_COMPONENTS = [
5643
- TooltipInfoComponent,
5644
- TooltipInfoSimpleComponent,
5645
- TooltipNoBodyComponent,
5646
- TooltipProcessDefaultComponent
5647
- ];
5648
- var DrTooltipModule = /** @class */ (function () {
5649
- function DrTooltipModule() {
5650
- }
5651
- return DrTooltipModule;
5652
- }());
5653
- DrTooltipModule.decorators = [
5654
- { type: i0.NgModule, args: [{
5655
- imports: [
5656
- common.CommonModule
5894
+ providers: [
5895
+ { provide: forms.NG_VALUE_ACCESSOR, useExisting: DrDatePickerWithTimeframeComponent, multi: true },
5896
+ { provide: DrDatePickerService }
5657
5897
  ],
5658
- exports: __spreadArray([
5659
- TooltipComponent,
5660
- DrTooltipDirective
5661
- ], __read(TOOLTIP_COMPONENTS)),
5662
- providers: [],
5663
- declarations: __spreadArray([
5664
- TooltipComponent,
5665
- DrTooltipDirective
5666
- ], __read(TOOLTIP_COMPONENTS)),
5898
+ styles: [":host{position:relative;width:100%;display:flex;flex-direction:row;min-height:32px;height:32px;font-size:14px;font-family:\"Poppins\",sans-serif;background-color:#fff;border:1px solid #9EA1AA;border-radius:6px;color:#85889c;overflow:hidden;outline:none;cursor:pointer}:host:hover{border-color:#85889c}:host:focus-within{border-color:#4646ce!important;color:#151b3f}:host.disabled{pointer-events:none;border:1px solid #aeabac;background:#f0f1f4}:host.disabled:after{color:#aeabac}:host.ng-valid.ng-dirty{border-color:#03a678}:host.ng-invalid.ng-dirty:not(:focus-within){border-color:#de2833!important}:host.ng-untouched.ng-valid{border-color:#9ea1aa}:host:after,:host:before{position:absolute;display:flex;border-color:#999999 transparent transparent;color:#999}:host:after{content:\"\\e9b6\";font-family:DataRails;font-size:24px;color:#6d6e6f;top:0;bottom:0;right:8px;position:absolute;display:flex;align-items:center;justify-content:center}:host i{display:flex;align-items:center;position:absolute;color:#999;left:8px;top:0;bottom:0}:host input{display:flex;flex-grow:1;height:100%;border:none;text-align:left;padding-left:35px;padding-right:25px;cursor:pointer!important;outline:none}:host input.when-quarter{position:absolute;visibility:hidden}:host input:disabled{border:none;color:#aeabac;background:transparent}:host input::-webkit-search-decoration,:host input::-webkit-search-cancel-button,:host input::-webkit-search-results-button,:host input::-webkit-search-results-decoration{-webkit-appearance:none}::ng-deep .mat-datepicker-content{margin:7px 0;box-shadow:0 4px 8px 1px #00000040;border-radius:12px!important}::ng-deep .mat-datepicker-content button[disabled]{border:inherit;color:inherit;background-color:inherit}::ng-deep .mat-datepicker-content button[disabled]:hover{border:inherit}::ng-deep .mat-calendar-body-cell:not(.mat-calendar-body-disabled):hover>.mat-calendar-body-cell-content:not(.mat-calendar-body-selected):not(.mat-calendar-body-comparison-identical){background:#f2f2fb;color:#4646ce;font-weight:600}::ng-deep .mat-calendar-body-selected{background-color:#4646ce;color:#f2f2fb;font-weight:600}::ng-deep .mat-calendar-body-today.mat-calendar-body-selected{box-shadow:none}::ng-deep .mat-button-focus-overlay{background:#f3f7ff}::ng-deep .mat-calendar-controls .mat-icon-button:hover .mat-button-focus-overlay{opacity:1!important;background:#f3f7ff;transition:opacity .2s cubic-bezier(.35,0,.25,1)}::ng-deep .mat-calendar-controls .mat-calendar-period-button:hover{background:#f3f7ff;transition:background .2s cubic-bezier(.35,0,.25,1)}::ng-deep .mat-calendar-table-header th{font-size:14px;font-weight:600;color:#19181a}::ng-deep .mat-calendar-table-header-divider{display:none}::ng-deep .mat-calendar-body-label{color:#fff;padding:0}:host{border:none;display:flex;align-items:center}:host.disabled{background:transparent;color:inherit}:host.disabled.dr-date-picker-on-dashboard .dr-datepicker-input-container__formatted-value-display{text-decoration:none;color:#6d6e6f;font-weight:normal}:host.dr-date-picker-on-dashboard{width:-moz-fit-content;width:fit-content;justify-content:space-between}:host.dr-date-picker-on-dashboard mat-datepicker{position:absolute}:host.dr-date-picker-on-dashboard:after{visibility:hidden}:host.dr-date-picker-on-dashboard .dr-datepicker-input-container{display:flex;flex-direction:row;justify-content:center;align-items:center;margin-left:-10px}:host.dr-date-picker-on-dashboard .dr-datepicker-input-container__formatted-value-display{font-weight:600;width:auto;margin-left:5px}:host.dr-date-picker-on-dashboard .dr-datepicker-input-container .dr-icon-date{display:block;position:relative;top:0;margin-right:8px;color:#4e566c}:host .dr-datepicker-input-container input{visibility:hidden;position:absolute;width:100%}:host .dr-datepicker-input-container__formatted-value-display{width:90px;height:22px;padding-left:0;text-align:center;line-height:22px;color:#0c142b;-webkit-text-decoration-line:underline;text-decoration-line:underline}:host .dr-datepicker-input-container__formatted-value-display:hover{background-color:#f2f2fb;border-radius:5px;cursor:pointer;-webkit-text-decoration-line:underline;text-decoration-line:underline;color:#4646ce}::ng-deep .date-picker-preset-tag{width:386px!important}::ng-deep .date-picker-preset-tag .mat-calendar-content{padding-left:32px!important;padding-right:32px!important}\n"]
5667
5899
  },] }
5668
5900
  ];
5669
-
5670
- // !!! Please do not use such approach in other places
5671
- // Hard fix for 'none' calendar view selection
5672
- datepicker.MatCalendar.prototype.focusActiveCell = function () {
5673
- var _a;
5674
- (_a = this._getCurrentViewComponent()) === null || _a === void 0 ? void 0 : _a._focusActiveCell(false);
5901
+ DrDatePickerWithTimeframeComponent.ctorParameters = function () { return [
5902
+ { type: i0.ChangeDetectorRef },
5903
+ { type: core.DateAdapter },
5904
+ { type: DrDatePickerService }
5905
+ ]; };
5906
+ DrDatePickerWithTimeframeComponent.propDecorators = {
5907
+ isDashboardClassDisplayed: [{ type: i0.HostBinding, args: ['class.dr-date-picker-on-dashboard',] }],
5908
+ isDashboardDatepicker: [{ type: i0.Input }],
5909
+ dateFormatConfig: [{ type: i0.Input }],
5910
+ canSelectTimeframe: [{ type: i0.Input }],
5911
+ availableTimeframes: [{ type: i0.Input }],
5912
+ paginationDebounce: [{ type: i0.Input }],
5913
+ isUsingDateTagPresets: [{ type: i0.Input }],
5914
+ presetTag: [{ type: i0.Input }],
5915
+ onChangeFormat: [{ type: i0.Output }],
5916
+ onChangePresetTag: [{ type: i0.Output }]
5675
5917
  };
5676
- var components$3 = [
5677
- DrButtonComponent,
5678
- RadioButtonComponent,
5679
- RadioGroupComponent,
5680
- CheckboxComponent,
5681
- DrInputComponent,
5682
- DrSelectComponent,
5683
- DrToggleComponent,
5684
- DrToggleButtonComponent,
5685
- DrDatePickerComponent,
5686
- DrDatePickerWithTimeframeComponent,
5687
- DrDatePickerFormatDirective,
5688
- DrDatePickerCustomHeaderComponent,
5689
- DrModelDebounceChangeDirective,
5690
- DrShowTimeframePipe,
5691
- DrSelectAddItemComponent
5692
- ];
5693
- var DrInputsModule = /** @class */ (function () {
5694
- function DrInputsModule() {
5695
- }
5696
- return DrInputsModule;
5697
- }());
5698
- DrInputsModule.decorators = [
5699
- { type: i0.NgModule, args: [{
5700
- declarations: components$3,
5701
- exports: components$3,
5702
- imports: [
5703
- forms.FormsModule,
5704
- forms.ReactiveFormsModule,
5705
- common.CommonModule,
5706
- ngSelect.NgSelectModule,
5707
- core.MatNativeDateModule,
5708
- datepicker.MatDatepickerModule,
5709
- tooltip.MatTooltipModule,
5710
- DrTooltipModule
5711
- ],
5712
- entryComponents: [DrDatePickerCustomHeaderComponent]
5713
- },] }
5714
- ];
5715
5918
 
5716
- var components$2 = [DateTagComponent,
5717
- DayTagComponent,
5718
- WeekTagComponent,
5719
- MonthTagComponent,
5720
- QuarterTagComponent,
5721
- AnyTagComponent,
5722
- YearTagComponent,
5723
- ForecastTagComponent];
5724
- var DateTagModule = /** @class */ (function () {
5725
- function DateTagModule() {
5919
+ var DrDatePickerFormatDirective = /** @class */ (function () {
5920
+ function DrDatePickerFormatDirective(matDateFormat, ngControl) {
5921
+ this.matDateFormat = matDateFormat;
5922
+ this.ngControl = ngControl;
5726
5923
  }
5727
- return DateTagModule;
5924
+ Object.defineProperty(DrDatePickerFormatDirective.prototype, "datePickerFormat", {
5925
+ set: function (format) {
5926
+ var _a;
5927
+ if (this.configDateParse) {
5928
+ this.matDateFormat.updateDateFormat(this.configDateParse, this.configDateDisplay);
5929
+ }
5930
+ else {
5931
+ this.matDateFormat.updateDateFormat({ dateInput: format });
5932
+ }
5933
+ var value = this.ngControl.value;
5934
+ (_a = this.ngControl.valueAccessor) === null || _a === void 0 ? void 0 : _a.writeValue(value);
5935
+ },
5936
+ enumerable: false,
5937
+ configurable: true
5938
+ });
5939
+ return DrDatePickerFormatDirective;
5728
5940
  }());
5729
- DateTagModule.decorators = [
5730
- { type: i0.NgModule, args: [{
5731
- imports: [
5732
- common.CommonModule,
5733
- forms.FormsModule,
5734
- forms.ReactiveFormsModule,
5735
- DrInputsModule,
5736
- ngSelect.NgSelectModule
5737
- ],
5738
- exports: components$2,
5739
- declarations: components$2,
5941
+ DrDatePickerFormatDirective.decorators = [
5942
+ { type: i0.Directive, args: [{
5943
+ selector: '[drDatePickerFormat]',
5944
+ providers: [
5945
+ {
5946
+ provide: core.DateAdapter,
5947
+ useClass: materialMomentAdapter.MomentDateAdapter
5948
+ },
5949
+ {
5950
+ provide: core.MAT_DATE_FORMATS,
5951
+ useClass: CustomDateFormat
5952
+ }
5953
+ ]
5740
5954
  },] }
5741
5955
  ];
5956
+ DrDatePickerFormatDirective.ctorParameters = function () { return [
5957
+ { type: CustomDateFormat, decorators: [{ type: i0.Inject, args: [core.MAT_DATE_FORMATS,] }] },
5958
+ { type: forms.NgControl, decorators: [{ type: i0.Optional }] }
5959
+ ]; };
5960
+ DrDatePickerFormatDirective.propDecorators = {
5961
+ configDateParse: [{ type: i0.Input }],
5962
+ configDateDisplay: [{ type: i0.Input }],
5963
+ datePickerFormat: [{ type: i0.Input, args: ['drDatePickerFormat',] }]
5964
+ };
5742
5965
 
5743
- var ListTagModule = /** @class */ (function () {
5744
- function ListTagModule() {
5966
+ var DrShowTimeframePipe = /** @class */ (function () {
5967
+ function DrShowTimeframePipe() {
5745
5968
  }
5746
- return ListTagModule;
5969
+ DrShowTimeframePipe.prototype.transform = function (arr, showOptions) {
5970
+ return arr.filter(function (item) { return showOptions.includes(item.timeframe); });
5971
+ };
5972
+ return DrShowTimeframePipe;
5747
5973
  }());
5748
- ListTagModule.decorators = [
5749
- { type: i0.NgModule, args: [{
5750
- imports: [
5751
- common.CommonModule,
5752
- forms.FormsModule,
5753
- forms.ReactiveFormsModule,
5754
- DrInputsModule,
5755
- ],
5756
- exports: [ListTagComponent],
5757
- providers: [],
5758
- declarations: [
5759
- ListTagComponent
5760
- ],
5974
+ DrShowTimeframePipe.decorators = [
5975
+ { type: i0.Pipe, args: [{
5976
+ name: 'drShowTimeframePipe'
5761
5977
  },] }
5762
5978
  ];
5763
5979
 
5764
- var DrDynamicTagComponent = /** @class */ (function () {
5765
- function DrDynamicTagComponent() {
5766
- this.lockedTags = [];
5767
- this.tagChange = new i0.EventEmitter();
5768
- this.tagAdd = new i0.EventEmitter();
5769
- }
5770
- Object.defineProperty(DrDynamicTagComponent.prototype, "isPrimitiveDataSource", {
5771
- get: function () {
5772
- var values = Object.values(this.values) || [];
5773
- return !_.isObject(values[0]);
5980
+ var DrSelectAddItemComponent = /** @class */ (function () {
5981
+ function DrSelectAddItemComponent(drSelect) {
5982
+ this.drSelect = drSelect;
5983
+ this.currentValues = [];
5984
+ this.dynamicAddLabel = 'Add new';
5985
+ this.values = [];
5986
+ this.dynamicValueAdded = new i0.EventEmitter();
5987
+ }
5988
+ Object.defineProperty(DrSelectAddItemComponent.prototype, "inputRef", {
5989
+ set: function (input) {
5990
+ if (!input)
5991
+ return;
5992
+ input.focus();
5774
5993
  },
5775
5994
  enumerable: false,
5776
5995
  configurable: true
5777
5996
  });
5778
- DrDynamicTagComponent.prototype.ngOnChanges = function (changes) {
5779
- this.updateDynamicTagValues();
5997
+ DrSelectAddItemComponent.prototype.ngOnChanges = function (changes) {
5998
+ this.calculateCurrentValues();
5780
5999
  };
5781
- DrDynamicTagComponent.prototype.onTagChanged = function ($event) {
5782
- var _a, _b;
5783
- var resultEvent = {
5784
- id: this.tagConfig.id,
5785
- name: this.tagConfig.name,
5786
- value: $event,
5787
- locked: this.lockedTags.includes($event)
5788
- };
5789
- if (!_.isNil((_a = this.selectedTag) === null || _a === void 0 ? void 0 : _a.locked)) {
5790
- resultEvent.locked = this.selectedTag.locked;
5791
- }
5792
- if (!_.isNil((_b = this.selectedTag) === null || _b === void 0 ? void 0 : _b.label)) {
5793
- resultEvent.label = this.selectedTag.label;
5794
- }
5795
- this.isLockedTagSelected = resultEvent.locked;
5796
- this.tagChange.emit(resultEvent);
6000
+ DrSelectAddItemComponent.prototype.ngOnInit = function () {
6001
+ this.calculateCurrentValues();
5797
6002
  };
5798
- DrDynamicTagComponent.prototype.onOptionClick = function ($event, tagValue) {
5799
- if (this.lockedTags.includes(tagValue)) {
5800
- $event.stopImmediatePropagation();
5801
- }
6003
+ DrSelectAddItemComponent.prototype.onDynamicAdding = function () {
6004
+ this.isDynamicAdding = true;
5802
6005
  };
5803
- DrDynamicTagComponent.prototype.onDynamicValueAdd = function ($event) {
5804
- var parentValueKey = this.getParentValueKey();
5805
- var parentValues = this.values[parentValueKey] || [];
5806
- if (this.isPrimitiveDataSource) {
5807
- this.values[parentValueKey] = __spreadArray([$event], __read(parentValues));
5808
- }
5809
- else {
5810
- this.values[parentValueKey] = __spreadArray([{ value: $event }], __read(parentValues));
5811
- }
5812
- this.selectedDynamicTag = $event;
5813
- this.currentValues = this.values[parentValueKey];
5814
- this.onTagChanged($event);
5815
- this.tagAdd.emit($event);
6006
+ DrSelectAddItemComponent.prototype.onDynamicAddingClose = function () {
6007
+ this.isDynamicAdding = false;
6008
+ this.dynamicValue = '';
5816
6009
  };
5817
- DrDynamicTagComponent.prototype.updateDynamicTagValues = function () {
6010
+ DrSelectAddItemComponent.prototype.isDynamicValueValid = function () {
5818
6011
  var _a;
5819
- var parentValueKey = this.getParentValueKey();
5820
- this.currentValues = this.values[parentValueKey];
5821
- this.selectedDynamicTag = this.getSelectedDynamicTag(this.currentValues, (_a = this.selectedTag) === null || _a === void 0 ? void 0 : _a.value);
5822
- this.onTagChanged(this.selectedDynamicTag);
5823
- };
5824
- DrDynamicTagComponent.prototype.getSelectedDynamicTag = function (currentValues, selectedValue) {
5825
- if (!(currentValues === null || currentValues === void 0 ? void 0 : currentValues.length))
5826
- return null;
5827
- if (_.isObject(currentValues[0])) {
5828
- var valueFromConfig_1 = _.find(currentValues, { value: selectedValue });
5829
- var favoriteValue = _.find(currentValues, { is_favorite: true });
5830
- return (valueFromConfig_1 || favoriteValue || currentValues[0]).value;
5831
- }
5832
- var valueFromConfig = _.find(currentValues, function (value) { return value === selectedValue; });
5833
- return (valueFromConfig || currentValues[0]);
6012
+ var trimmedValue = (_a = this.dynamicValue) === null || _a === void 0 ? void 0 : _a.trim();
6013
+ if (!trimmedValue)
6014
+ return false;
6015
+ return !this.currentValues.includes(trimmedValue);
5834
6016
  };
5835
- DrDynamicTagComponent.prototype.getParentValueKey = function () {
5836
- return _.map(this.connectedTags, this.tryToParseParentValue).join('__');
6017
+ DrSelectAddItemComponent.prototype.onDynamicAdd = function (value, keydownEvent) {
6018
+ this.isDirty = true;
6019
+ if (!this.isDynamicValueValid())
6020
+ return;
6021
+ if (keydownEvent && keydownEvent.key !== 'Enter')
6022
+ return;
6023
+ this.onDynamicAddingClose();
6024
+ this.drSelect.close();
6025
+ this.dynamicValueAdded.emit(value === null || value === void 0 ? void 0 : value.trim());
5837
6026
  };
5838
- DrDynamicTagComponent.prototype.tryToParseParentValue = function (connectedTags) {
5839
- if (_.isNumber(connectedTags.value)) {
5840
- var momentData = moment__namespace.unix(connectedTags.value);
5841
- var convertedParentValue = momentData.get('year'); // TODO: add input prop (selectedTimeDimension) or Format
5842
- if (momentData.isValid() && convertedParentValue) {
5843
- return convertedParentValue;
5844
- }
5845
- }
5846
- return connectedTags.value;
6027
+ DrSelectAddItemComponent.prototype.calculateCurrentValues = function () {
6028
+ var _this = this;
6029
+ this.currentValues = this.bindValue
6030
+ ? _.reduce(this.values, function (acc, curr) {
6031
+ acc.push(curr[_this.bindValue]);
6032
+ return acc;
6033
+ }, [])
6034
+ : this.values;
5847
6035
  };
5848
- return DrDynamicTagComponent;
6036
+ return DrSelectAddItemComponent;
5849
6037
  }());
5850
- DrDynamicTagComponent.decorators = [
6038
+ DrSelectAddItemComponent.decorators = [
5851
6039
  { type: i0.Component, args: [{
5852
- selector: 'dr-dynamic-tag',
5853
- template: "<p class=\"dynamic-tag__label\">{{ tagConfig.name }}</p>\n<dr-select [(ngModel)]=\"selectedDynamicTag\"\n [class.dynamic-tag__locked]=\"isLockedTagSelected\"\n bindLabel=\"value\"\n bindValue=\"value\"\n [items]=\"currentValues\"\n [disabled]=\"disabled\"\n dropdownClass=\"dynamic-tag__select dr-tag__select\"\n (ngModelChange)=\"onTagChanged($event)\">\n <ng-template #optionHeaderTemplate *ngIf=\"isDynamicTagAddEnabled\">\n <dr-select-add-item bindValue=\"value\"\n [values]=\"currentValues\"\n [dynamicAddLabel]=\"' Add new ' + tagConfig.name\"\n (dynamicValueAdded)=\"onDynamicValueAdd($event)\"></dr-select-add-item>\n </ng-template>\n <ng-template #labelTemplate let-item=\"item\">\n <div class=\"dynamic-tag__field--label\">\n <p class=\"dynamic-tag__field__text\">{{ item?.value || item }}</p>\n <i *ngIf=\"item?.is_favorite\" class=\"dynamic-tag__field__icon dr-icon-star-fill\"></i>\n </div>\n </ng-template>\n <ng-template #optionTemplate let-item=\"item\">\n <div class=\"dynamic-tag__field--option\"\n [class.disabled]=\"lockedTags.includes(item?.value || item)\"\n (click)=\"onOptionClick($event, item?.value || item)\">\n <p class=\"dynamic-tag__field__text\">{{ item?.value || item }}</p>\n <i *ngIf=\"item?.is_favorite\" class=\"dynamic-tag__field__icon dr-icon-star-fill\"></i>\n </div>\n </ng-template>\n</dr-select>\n",
5854
- styles: [".dynamic-tag__label{margin:0 0 4px;color:#0c142b;font-size:14px;font-weight:400;line-height:22px}.dynamic-tag__field,.dynamic-tag__field--option,.dynamic-tag__field--label{cursor:pointer;height:24px}.dynamic-tag__field--option{padding:8px 12px;width:100%;display:flex;justify-content:space-between;align-items:center}.dynamic-tag__field--option.disabled{opacity:.5;box-sizing:content-box}.dynamic-tag__field--label{display:flex;align-items:center}.dynamic-tag__field--label>.dynamic-tag__field__icon{position:absolute;right:25px}.dynamic-tag__field--label>dynamic-tag__field__text{margin:0}.dr-icon-star-fill{color:#f0bc57}::ng-deep dr-select.dynamic-tag__locked>ng-select>.ng-select-container{opacity:.4}::ng-deep .ng-option:has(.dynamic-tag__field--option){padding:0!important}\n"]
6040
+ selector: 'dr-select-add-item',
6041
+ template: "<div class=\"dr-select__dynamic-add dynamic-add\">\n <div class=\"dynamic-add__add-item\" (click)=\"onDynamicAdding()\">\n <i class=\"dr-icon-add\"></i>\n <p class=\"dynamic-add__add-item__text\">{{ dynamicAddLabel }}</p>\n </div>\n <div *ngIf=\"isDynamicAdding\" class=\"dynamic-add__field\">\n <dr-input #dynamicInputRef\n class=\"dynamic-add__field__input\"\n [class.dynamic-add__field__input--error]=\"!isDynamicValueValid() && isDirty\"\n [(ngModel)]=\"dynamicValue\"\n (keydown)=\"onDynamicAdd(dynamicValue, $event)\"\n placeholder=\"Type...\"></dr-input>\n <div class=\"dynamic-add__field__buttons\">\n <dr-button *ngIf=\"dynamicValue && isDynamicValueValid()\"\n theme=\"icon\"\n icon=\"dr-icon-approve\"\n iconSize=\"18px\"\n (click)=\"onDynamicAdd(dynamicValue)\"></dr-button>\n <dr-button theme=\"icon\"\n icon=\"dr-icon-exit\"\n iconSize=\"18px\"\n (click)=\"onDynamicAddingClose()\"></dr-button>\n </div>\n </div>\n</div>\n",
6042
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
6043
+ styles: [".dynamic-add__add-item{cursor:pointer;display:flex;align-items:center;border-bottom:1px solid #dfe0e3;padding:6px}.dynamic-add__add-item:hover{background:#f9f7ff}.dynamic-add__add-item__text{font-size:14px;line-height:22px;margin:0}.dynamic-add__field{position:relative}.dynamic-add__field__buttons{position:absolute;top:0;right:0;bottom:0;display:flex;align-items:center}::ng-deep .ng-dropdown-panel .ng-dropdown-header:has(.dynamic-add){padding:0;border:none}::ng-deep .dynamic-add__field__input{padding-left:12px!important;height:36px!important;border:none!important;background:#f9f7ff!important;border-radius:0!important}::ng-deep .dynamic-add__field__input>input{background:#f9f7ff}::ng-deep .dynamic-add__field__input>input::placeholder{line-height:22px;font-size:14px;font-weight:400;color:#9ea1aa}::ng-deep .dynamic-add__field__input--error{background:#ffdfe4!important}::ng-deep .dynamic-add__field__input--error>input{background:#ffdfe4}\n"]
5855
6044
  },] }
5856
6045
  ];
5857
- DrDynamicTagComponent.propDecorators = {
6046
+ DrSelectAddItemComponent.ctorParameters = function () { return [
6047
+ { type: DrSelectComponent }
6048
+ ]; };
6049
+ DrSelectAddItemComponent.propDecorators = {
6050
+ dynamicAddLabel: [{ type: i0.Input }],
6051
+ bindValue: [{ type: i0.Input }],
5858
6052
  values: [{ type: i0.Input }],
5859
- tagConfig: [{ type: i0.Input }],
5860
- selectedTag: [{ type: i0.Input }],
5861
- lockedTags: [{ type: i0.Input }],
5862
- connectedTags: [{ type: i0.Input }],
5863
- isDynamicTagAddEnabled: [{ type: i0.Input }],
5864
- disabled: [{ type: i0.Input }],
5865
- tagChange: [{ type: i0.Output }],
5866
- tagAdd: [{ type: i0.Output }]
6053
+ dynamicValueAdded: [{ type: i0.Output }],
6054
+ inputRef: [{ type: i0.ViewChild, args: ['dynamicInputRef',] }]
5867
6055
  };
5868
6056
 
5869
- var DrDynamicTagModule = /** @class */ (function () {
5870
- function DrDynamicTagModule() {
6057
+ var TooltipInfoComponent = /** @class */ (function () {
6058
+ function TooltipInfoComponent() {
5871
6059
  }
5872
- return DrDynamicTagModule;
6060
+ return TooltipInfoComponent;
5873
6061
  }());
5874
- DrDynamicTagModule.decorators = [
5875
- { type: i0.NgModule, args: [{
5876
- declarations: [DrDynamicTagComponent],
5877
- imports: [
5878
- common.CommonModule,
5879
- DrInputsModule,
5880
- forms.FormsModule,
5881
- ],
5882
- exports: [DrDynamicTagComponent]
6062
+ TooltipInfoComponent.decorators = [
6063
+ { type: i0.Component, args: [{
6064
+ selector: 'dr-tooltip-info',
6065
+ template: "<div class=\"tooltip-info\">\n <i *ngIf=\"data?.icon else defaultIcon\" class=\"fa\" [class]=\"data.icon\" [style.fontSize.px]=\"14\"\n [style.margin.px]=\"12\" [style.color]=\"data?.iconColor || '#7B61FF'\"></i>\n <div class=\"tooltip-info-content-wrapper\">\n <div *ngIf=\"data?.title\" class=\"tooltip-info_header\">\n <span>{{data.title}}</span>\n </div>\n <div *ngIf=\"data?.description\" class=\"tooltip-info_description\"\n [class.tooltip-info_description-no-border]=\"!data.title\">\n <ng-container *ngIf=\"!data.title\"></ng-container>\n <span *ngIf=\"!useDescriptionAsHTML\">{{data.description}}</span>\n <div *ngIf=\"useDescriptionAsHTML\" [innerHTML]=\"data.description\"></div>\n </div>\n </div>\n</div>\n\n<ng-template #defaultIcon>\n <ng-container *ngIf=\"!data.icon\">\n <div class=\"default-icon\"></div>\n </ng-container>\n</ng-template>\n",
6066
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
6067
+ styles: [".tooltip-info{width:316px;display:flex}.tooltip-info-content-wrapper{display:flex;flex-direction:column;padding-top:10px}.tooltip-info_header{padding:0 16px 6px 0;font-weight:bold;font-size:14px;line-height:16px;letter-spacing:.25px;display:flex;justify-content:flex-start}.tooltip-info_header>i{margin-right:10px}.tooltip-info-content-wrapper{padding-top:10px}.tooltip-info_description{display:flex;align-items:flex-start;border-top:1px solid #aeb5bb;padding:12px 10px 10px 0;text-align:left;font-weight:normal;font-size:14px;line-height:22px}.tooltip-info_description-no-border{padding-top:0;border-top:none}.tooltip-info_description>i{margin-right:10px}:host.tooltip-info-medium .tooltip-info{max-width:272px}:host.tooltip-info-medium .tooltip-info-content-wrapper{padding-top:10px}:host.tooltip-info-medium .tooltip-info_header,:host.tooltip-info-medium .tooltip-info_description{min-height:unset;border-top:none;font-size:14px;line-height:22px}:host.tooltip-info-medium .tooltip-info_header{padding:10px 10px 0 0}:host.tooltip-info-medium .tooltip-info_description{padding:10px 12px 10px 0}:host.tooltip-info-medium .tooltip-info .default-icon:before{background:url(\"data:image/svg+xml,%3Csvg width%3D%2216%22 height%3D%2216%22 viewBox%3D%220 0 16 16%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E %3Cpath d%3D%22M8.00008 2.66669C5.05341 2.66669 2.66675 5.05335 2.66675 8.00002C2.66675 10.9467 5.05341 13.3334 8.00008 13.3334C10.9467 13.3334 13.3334 10.9467 13.3334 8.00002C13.3334 5.05335 10.9467 2.66669 8.00008 2.66669ZM8.53341 10.6667H7.46675V7.46669H8.53341V10.6667ZM8.53341 6.40002H7.46675V5.33335H8.53341V6.40002Z%22 fill%3D%22%237B61FF%22%2F%3E%3C%2Fsvg%3E\") no-repeat;background-size:100% 100%;display:inline-block;height:20px;width:20px;content:\"\"}:host.tooltip-info-small .tooltip-info{width:auto}:host.tooltip-info-small .tooltip-info-content-wrapper{padding-top:10px}:host.tooltip-info-small .tooltip-info_header,:host.tooltip-info-small .tooltip-info_description{min-height:unset;border-top:none;font-size:14px;line-height:22px}:host.tooltip-info-small .tooltip-info_header{padding:0 10px 0 0}:host.tooltip-info-small .tooltip-info_description{padding:0 12px 10px 0}:host.tooltip-info-small .tooltip-info .default-icon:before{background:url(\"data:image/svg+xml,%3Csvg width%3D%2216%22 height%3D%2216%22 viewBox%3D%220 0 16 16%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E %3Cpath d%3D%22M8.00008 2.66669C5.05341 2.66669 2.66675 5.05335 2.66675 8.00002C2.66675 10.9467 5.05341 13.3334 8.00008 13.3334C10.9467 13.3334 13.3334 10.9467 13.3334 8.00002C13.3334 5.05335 10.9467 2.66669 8.00008 2.66669ZM8.53341 10.6667H7.46675V7.46669H8.53341V10.6667ZM8.53341 6.40002H7.46675V5.33335H8.53341V6.40002Z%22 fill%3D%22%237B61FF%22%2F%3E%3C%2Fsvg%3E\") no-repeat;background-size:100% 100%;display:inline-block;height:20px;width:20px;content:\"\"}.default-icon{position:relative;width:18px;height:18px;margin:10px}.default-icon:before{background:url(\"data:image/svg+xml,%3Csvg width%3D%2216%22 height%3D%2216%22 viewBox%3D%220 0 16 16%22 fill%3D%22none%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E %3Cpath d%3D%22M8.00008 2.66669C5.05341 2.66669 2.66675 5.05335 2.66675 8.00002C2.66675 10.9467 5.05341 13.3334 8.00008 13.3334C10.9467 13.3334 13.3334 10.9467 13.3334 8.00002C13.3334 5.05335 10.9467 2.66669 8.00008 2.66669ZM8.53341 10.6667H7.46675V7.46669H8.53341V10.6667ZM8.53341 6.40002H7.46675V5.33335H8.53341V6.40002Z%22 fill%3D%22%237B61FF%22%2F%3E%3C%2Fsvg%3E\") no-repeat;background-size:100% 100%;display:inline-block;height:18px;width:18px;content:\"\"}\n"]
5883
6068
  },] }
5884
6069
  ];
6070
+ TooltipInfoComponent.ctorParameters = function () { return []; };
6071
+ TooltipInfoComponent.propDecorators = {
6072
+ data: [{ type: i0.Input }],
6073
+ useDescriptionAsHTML: [{ type: i0.Input }]
6074
+ };
5885
6075
 
5886
- var DrTagModule = /** @class */ (function () {
5887
- function DrTagModule() {
6076
+ var TooltipInfoSimpleComponent = /** @class */ (function () {
6077
+ function TooltipInfoSimpleComponent() {
5888
6078
  }
5889
- return DrTagModule;
6079
+ return TooltipInfoSimpleComponent;
5890
6080
  }());
5891
- DrTagModule.decorators = [
5892
- { type: i0.NgModule, args: [{
5893
- imports: [
5894
- common.CommonModule,
5895
- DateTagModule,
5896
- ListTagModule,
5897
- DrDynamicTagModule
5898
- ],
5899
- exports: [DrTagComponent],
5900
- providers: [],
5901
- declarations: [
5902
- DrTagComponent
5903
- ],
6081
+ TooltipInfoSimpleComponent.decorators = [
6082
+ { type: i0.Component, args: [{
6083
+ selector: 'dr-tooltip-info-simple',
6084
+ template: "<div class=\"tooltip-info-simple\">\n <div *ngIf=\"context?.title\" class=\"tooltip-info-simple__title\">{{context?.title}}</div>\n <div *ngIf=\"context?.description\" class=\"tooltip-info-simple__description\">{{context?.description}}</div>\n</div>\n",
6085
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
6086
+ styles: [".tooltip-info-simple{max-width:250px;font-size:14px;line-height:22px;padding:10px 12px;color:#0c142b}.tooltip-info-simple__title{font-weight:600;overflow:hidden;text-overflow:ellipsis}\n"]
5904
6087
  },] }
5905
6088
  ];
6089
+ TooltipInfoSimpleComponent.ctorParameters = function () { return []; };
6090
+ TooltipInfoSimpleComponent.propDecorators = {
6091
+ context: [{ type: i0.Input }]
6092
+ };
5906
6093
 
5907
- var DrAvatarModule = /** @class */ (function () {
5908
- function DrAvatarModule() {
6094
+ var TooltipNoBodyComponent = /** @class */ (function () {
6095
+ function TooltipNoBodyComponent() {
5909
6096
  }
5910
- return DrAvatarModule;
6097
+ TooltipNoBodyComponent.prototype.ngOnInit = function () {
6098
+ };
6099
+ return TooltipNoBodyComponent;
5911
6100
  }());
5912
- DrAvatarModule.decorators = [
5913
- { type: i0.NgModule, args: [{
5914
- declarations: [
5915
- DrAvatarComponent,
5916
- DrAvatarPipe
5917
- ],
5918
- exports: [
5919
- DrAvatarComponent,
5920
- DrAvatarPipe
5921
- ],
5922
- imports: [
5923
- tooltip.MatTooltipModule,
5924
- DrTooltipModule,
5925
- common.CommonModule
5926
- ]
6101
+ TooltipNoBodyComponent.decorators = [
6102
+ { type: i0.Component, args: [{
6103
+ selector: 'dr-tooltip-no-body',
6104
+ template: "<div class=\"tooltip-bold\" [ngClass]=\"{'tooltip-bold--icon': context?.icon}\">\n <div class=\"tooltip-bold__title\">\n <i *ngIf=\"context?.icon\" [class]=\"context?.icon\" [style.color]=\"context?.iconColor || 'black'\"></i>\n {{ context.title }}\n </div>\n <div class=\"tooltip-bold-text\">\n {{ context.text }}\n </div>\n</div>",
6105
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
6106
+ styles: [".tooltip-bold{position:relative;box-shadow:0 4px 8px 1px #00000040;border:1px solid #c3c4ce;border-radius:8px;font-size:14px;line-height:22px;padding:10px 12px;background-color:#fff}.tooltip-bold--icon{padding-left:44px}.tooltip-bold__title{font-weight:bold}.tooltip-bold__title>i{position:absolute;width:16px;height:16px;left:10px}\n"]
5927
6107
  },] }
5928
6108
  ];
6109
+ TooltipNoBodyComponent.ctorParameters = function () { return []; };
6110
+ TooltipNoBodyComponent.propDecorators = {
6111
+ context: [{ type: i0.Input }]
6112
+ };
5929
6113
 
5930
- var components$1 = [DrSpinnerComponent];
5931
- var directives = [DrSpinnerDirective];
5932
- var DrSpinnerModule = /** @class */ (function () {
5933
- function DrSpinnerModule() {
6114
+ var TooltipProcessDefaultComponent = /** @class */ (function () {
6115
+ function TooltipProcessDefaultComponent() {
5934
6116
  }
5935
- return DrSpinnerModule;
6117
+ return TooltipProcessDefaultComponent;
5936
6118
  }());
5937
- DrSpinnerModule.decorators = [
5938
- { type: i0.NgModule, args: [{
5939
- imports: [
5940
- common.CommonModule,
5941
- ],
5942
- exports: __spreadArray(__spreadArray([], __read(components$1)), __read(directives)),
5943
- declarations: __spreadArray(__spreadArray([], __read(components$1)), __read(directives))
6119
+ TooltipProcessDefaultComponent.decorators = [
6120
+ { type: i0.Component, args: [{
6121
+ selector: 'dr-tooltip-process-default',
6122
+ template: "\n <div class=\"container\" [innerHTML]=\"text\"></div>\n ",
6123
+ changeDetection: i0.ChangeDetectionStrategy.OnPush,
6124
+ styles: ["\n .container {\n width: auto;\n max-width: 388px;\n text-align: start;\n font-size: 14px;\n line-height: 22px;\n padding: 10px 12px;\n color: #151B3F;\n background-color: #FFF;\n border-radius: 8px;\n box-shadow: 0px 4px 8px 1px rgba(0, 0, 0, 0.25);\n border: 1px solid #C3C4CE;\n }\n "]
5944
6125
  },] }
5945
6126
  ];
6127
+ TooltipProcessDefaultComponent.ctorParameters = function () { return []; };
6128
+ TooltipProcessDefaultComponent.propDecorators = {
6129
+ text: [{ type: i0.Input }]
6130
+ };
5946
6131
 
5947
- var DrPopoverModule = /** @class */ (function () {
5948
- function DrPopoverModule() {
6132
+ var TOOLTIP_COMPONENTS = [
6133
+ TooltipInfoComponent,
6134
+ TooltipInfoSimpleComponent,
6135
+ TooltipNoBodyComponent,
6136
+ TooltipProcessDefaultComponent
6137
+ ];
6138
+ var DrTooltipModule = /** @class */ (function () {
6139
+ function DrTooltipModule() {
5949
6140
  }
5950
- return DrPopoverModule;
6141
+ return DrTooltipModule;
5951
6142
  }());
5952
- DrPopoverModule.decorators = [
6143
+ DrTooltipModule.decorators = [
5953
6144
  { type: i0.NgModule, args: [{
5954
6145
  imports: [
5955
- common.CommonModule,
5956
- ],
5957
- exports: [
5958
- DrPopoverDirective,
5959
- DrPopoverComponent,
6146
+ common.CommonModule
5960
6147
  ],
6148
+ exports: __spreadArray([
6149
+ TooltipComponent,
6150
+ DrTooltipDirective
6151
+ ], __read(TOOLTIP_COMPONENTS)),
5961
6152
  providers: [],
5962
- declarations: [
5963
- DrPopoverDirective,
5964
- DrPopoverComponent,
5965
- ],
6153
+ declarations: __spreadArray([
6154
+ TooltipComponent,
6155
+ DrTooltipDirective
6156
+ ], __read(TOOLTIP_COMPONENTS)),
5966
6157
  },] }
5967
6158
  ];
5968
6159
 
5969
- var DrDropdownModule = /** @class */ (function () {
5970
- function DrDropdownModule() {
6160
+ // !!! Please do not use such approach in other places
6161
+ // Hard fix for 'none' calendar view selection
6162
+ datepicker.MatCalendar.prototype.focusActiveCell = function () {
6163
+ var _a;
6164
+ (_a = this._getCurrentViewComponent()) === null || _a === void 0 ? void 0 : _a._focusActiveCell(false);
6165
+ };
6166
+ var components$3 = [
6167
+ DrButtonComponent,
6168
+ RadioButtonComponent,
6169
+ RadioGroupComponent,
6170
+ CheckboxComponent,
6171
+ DrInputComponent,
6172
+ DrSelectComponent,
6173
+ DrToggleComponent,
6174
+ DrToggleButtonComponent,
6175
+ DrDatePickerComponent,
6176
+ DrDatePickerWithTimeframeComponent,
6177
+ DrDatePickerFormatDirective,
6178
+ DrDatePickerCustomHeaderComponent,
6179
+ DrModelDebounceChangeDirective,
6180
+ DrShowTimeframePipe,
6181
+ DrSelectAddItemComponent
6182
+ ];
6183
+ var DrInputsModule = /** @class */ (function () {
6184
+ function DrInputsModule() {
5971
6185
  }
5972
- return DrDropdownModule;
6186
+ return DrInputsModule;
5973
6187
  }());
5974
- DrDropdownModule.decorators = [
6188
+ DrInputsModule.decorators = [
5975
6189
  { type: i0.NgModule, args: [{
6190
+ declarations: components$3,
6191
+ exports: components$3,
5976
6192
  imports: [
6193
+ forms.FormsModule,
6194
+ forms.ReactiveFormsModule,
5977
6195
  common.CommonModule,
5978
- DrTooltipModule,
5979
- ],
5980
- declarations: [
5981
- DrDropdownDirective,
5982
- DrDropdownPositionDirective,
5983
- DrDropdownComponent,
5984
- DrDropdownItemShowPipe,
5985
- ],
5986
- exports: [
5987
- DrDropdownDirective,
5988
- DrDropdownPositionDirective,
5989
- DrDropdownComponent,
5990
- DrDropdownItemShowPipe,
5991
- ],
5992
- providers: [
5993
- DrDropdownService,
6196
+ ngSelect.NgSelectModule,
6197
+ core.MatNativeDateModule,
6198
+ datepicker.MatDatepickerModule,
6199
+ tooltip.MatTooltipModule,
6200
+ DrTooltipModule
5994
6201
  ],
6202
+ entryComponents: [DrDatePickerCustomHeaderComponent]
5995
6203
  },] }
5996
6204
  ];
5997
6205
 
5998
- var DrTabsModule = /** @class */ (function () {
5999
- function DrTabsModule() {
6206
+ var components$2 = [DateTagComponent,
6207
+ DayTagComponent,
6208
+ WeekTagComponent,
6209
+ MonthTagComponent,
6210
+ QuarterTagComponent,
6211
+ AnyTagComponent,
6212
+ YearTagComponent,
6213
+ ForecastTagComponent];
6214
+ var DateTagModule = /** @class */ (function () {
6215
+ function DateTagModule() {
6000
6216
  }
6001
- return DrTabsModule;
6217
+ return DateTagModule;
6002
6218
  }());
6003
- DrTabsModule.decorators = [
6219
+ DateTagModule.decorators = [
6004
6220
  { type: i0.NgModule, args: [{
6005
6221
  imports: [
6006
6222
  common.CommonModule,
6007
- tabs.MatTabsModule,
6008
6223
  forms.FormsModule,
6009
6224
  forms.ReactiveFormsModule,
6010
6225
  DrInputsModule,
6011
- DrTooltipModule
6012
- ],
6013
- exports: [
6014
- DrTabsComponent,
6015
- DrTabComponent
6016
- ],
6017
- providers: [],
6018
- declarations: [
6019
- DrTabsComponent,
6020
- DrTabComponent
6226
+ ngSelect.NgSelectModule
6021
6227
  ],
6228
+ exports: components$2,
6229
+ declarations: components$2,
6022
6230
  },] }
6023
6231
  ];
6024
6232
 
6025
- var DR_ACCORDION_COMPONENTS = [
6026
- DrAccordionComponent,
6027
- DrAccordionItemComponent,
6028
- DrAccordionItemHeaderComponent,
6029
- DrAccordionItemBodyComponent,
6030
- ];
6031
- var DrAccordionModule = /** @class */ (function () {
6032
- function DrAccordionModule() {
6033
- }
6034
- return DrAccordionModule;
6035
- }());
6036
- DrAccordionModule.decorators = [
6037
- { type: i0.NgModule, args: [{
6038
- imports: [common.CommonModule],
6039
- exports: __spreadArray([], __read(DR_ACCORDION_COMPONENTS)),
6040
- declarations: __spreadArray([], __read(DR_ACCORDION_COMPONENTS)),
6041
- providers: [],
6042
- },] }
6043
- ];
6044
-
6045
- var components = [
6046
- DrLayoutComponent,
6047
- DrLayoutHeaderComponent,
6048
- DrLayoutBodyComponent
6049
- ];
6050
- var DrLayoutModule = /** @class */ (function () {
6051
- function DrLayoutModule() {
6052
- }
6053
- return DrLayoutModule;
6054
- }());
6055
- DrLayoutModule.decorators = [
6056
- { type: i0.NgModule, args: [{
6057
- imports: [common.CommonModule],
6058
- exports: __spreadArray([], __read(components)),
6059
- declarations: __spreadArray([], __read(components)),
6060
- },] }
6061
- ];
6062
-
6063
- var DrErrorModule = /** @class */ (function () {
6064
- function DrErrorModule() {
6233
+ var ListTagModule = /** @class */ (function () {
6234
+ function ListTagModule() {
6065
6235
  }
6066
- return DrErrorModule;
6236
+ return ListTagModule;
6067
6237
  }());
6068
- DrErrorModule.decorators = [
6238
+ ListTagModule.decorators = [
6069
6239
  { type: i0.NgModule, args: [{
6070
6240
  imports: [
6071
6241
  common.CommonModule,
6072
6242
  forms.FormsModule,
6073
- DrTooltipModule
6243
+ forms.ReactiveFormsModule,
6244
+ DrInputsModule,
6074
6245
  ],
6075
- exports: [DrErrorComponent],
6246
+ exports: [ListTagComponent],
6076
6247
  providers: [],
6077
6248
  declarations: [
6078
- DrErrorComponent
6249
+ ListTagComponent
6079
6250
  ],
6080
6251
  },] }
6081
6252
  ];
6082
6253
 
6083
- var StepperComponent = /** @class */ (function () {
6084
- function StepperComponent() {
6085
- this.withoutConnectors = false;
6086
- this.hiddenNames = false;
6087
- this.inlineLabels = false;
6088
- this.disabled = false;
6089
- this.hiddenIndex = false;
6090
- this.stepChange = new i0.EventEmitter();
6254
+ var DrDynamicTagComponent = /** @class */ (function () {
6255
+ function DrDynamicTagComponent() {
6256
+ this.lockedTags = [];
6257
+ this.tagChange = new i0.EventEmitter();
6258
+ this.tagAdd = new i0.EventEmitter();
6091
6259
  }
6092
- StepperComponent.prototype.selectStep = function (step) {
6093
- if (step !== this.currentStep && !this.disabled) {
6094
- this.stepChange.emit(step);
6260
+ Object.defineProperty(DrDynamicTagComponent.prototype, "isPrimitiveDataSource", {
6261
+ get: function () {
6262
+ var values = Object.values(this.values) || [];
6263
+ return !_.isObject(values[0]);
6264
+ },
6265
+ enumerable: false,
6266
+ configurable: true
6267
+ });
6268
+ DrDynamicTagComponent.prototype.ngOnChanges = function (changes) {
6269
+ this.updateDynamicTagValues();
6270
+ };
6271
+ DrDynamicTagComponent.prototype.onTagChanged = function ($event) {
6272
+ var _a, _b;
6273
+ var resultEvent = {
6274
+ id: this.tagConfig.id,
6275
+ name: this.tagConfig.name,
6276
+ value: $event,
6277
+ locked: this.lockedTags.includes($event)
6278
+ };
6279
+ if (!_.isNil((_a = this.selectedTag) === null || _a === void 0 ? void 0 : _a.locked)) {
6280
+ resultEvent.locked = this.selectedTag.locked;
6281
+ }
6282
+ if (!_.isNil((_b = this.selectedTag) === null || _b === void 0 ? void 0 : _b.label)) {
6283
+ resultEvent.label = this.selectedTag.label;
6095
6284
  }
6285
+ this.isLockedTagSelected = resultEvent.locked;
6286
+ this.tagChange.emit(resultEvent);
6096
6287
  };
6097
- StepperComponent.prototype.getWidth = function (step) {
6098
- if (this.withoutConnectors)
6099
- return '0%';
6100
- if (step.completed)
6101
- return '100%';
6102
- if (step.index === 0 || this.steps[step.index - 1].completed)
6103
- return (((step === null || step === void 0 ? void 0 : step.completedTasks) / (step === null || step === void 0 ? void 0 : step.requiredTasks) * 100) || 0) + "%";
6104
- return '0%';
6288
+ DrDynamicTagComponent.prototype.onOptionClick = function ($event, tagValue) {
6289
+ if (this.lockedTags.includes(tagValue)) {
6290
+ $event.stopImmediatePropagation();
6291
+ }
6105
6292
  };
6106
- StepperComponent.prototype.scrollLeft = function () {
6107
- this.stepper.nativeElement.scrollLeft -= 80;
6293
+ DrDynamicTagComponent.prototype.onDynamicValueAdd = function ($event) {
6294
+ var parentValueKey = this.getParentValueKey();
6295
+ var parentValues = this.values[parentValueKey] || [];
6296
+ if (this.isPrimitiveDataSource) {
6297
+ this.values[parentValueKey] = __spreadArray([$event], __read(parentValues));
6298
+ }
6299
+ else {
6300
+ this.values[parentValueKey] = __spreadArray([{ value: $event }], __read(parentValues));
6301
+ }
6302
+ this.selectedDynamicTag = $event;
6303
+ this.currentValues = this.values[parentValueKey];
6304
+ this.onTagChanged($event);
6305
+ this.tagAdd.emit($event);
6108
6306
  };
6109
- StepperComponent.prototype.scrollRight = function () {
6110
- this.stepper.nativeElement.scrollLeft += 80;
6307
+ DrDynamicTagComponent.prototype.updateDynamicTagValues = function () {
6308
+ var _a;
6309
+ var parentValueKey = this.getParentValueKey();
6310
+ this.currentValues = this.values[parentValueKey];
6311
+ this.selectedDynamicTag = this.getSelectedDynamicTag(this.currentValues, (_a = this.selectedTag) === null || _a === void 0 ? void 0 : _a.value);
6312
+ this.onTagChanged(this.selectedDynamicTag);
6111
6313
  };
6112
- StepperComponent.prototype.roundWidth = function (width) {
6113
- return Math.round(width);
6314
+ DrDynamicTagComponent.prototype.getSelectedDynamicTag = function (currentValues, selectedValue) {
6315
+ if (!(currentValues === null || currentValues === void 0 ? void 0 : currentValues.length))
6316
+ return null;
6317
+ if (_.isObject(currentValues[0])) {
6318
+ var valueFromConfig_1 = _.find(currentValues, { value: selectedValue });
6319
+ var favoriteValue = _.find(currentValues, { is_favorite: true });
6320
+ return (valueFromConfig_1 || favoriteValue || currentValues[0]).value;
6321
+ }
6322
+ var valueFromConfig = _.find(currentValues, function (value) { return value === selectedValue; });
6323
+ return (valueFromConfig || currentValues[0]);
6324
+ };
6325
+ DrDynamicTagComponent.prototype.getParentValueKey = function () {
6326
+ return _.map(this.connectedTags, this.tryToParseParentValue).join('__');
6327
+ };
6328
+ DrDynamicTagComponent.prototype.tryToParseParentValue = function (connectedTags) {
6329
+ if (_.isNumber(connectedTags.value)) {
6330
+ var momentData = moment__namespace.unix(connectedTags.value);
6331
+ var convertedParentValue = momentData.get('year'); // TODO: add input prop (selectedTimeDimension) or Format
6332
+ if (momentData.isValid() && convertedParentValue) {
6333
+ return convertedParentValue;
6334
+ }
6335
+ }
6336
+ return connectedTags.value;
6114
6337
  };
6115
- return StepperComponent;
6338
+ return DrDynamicTagComponent;
6116
6339
  }());
6117
- StepperComponent.decorators = [
6340
+ DrDynamicTagComponent.decorators = [
6118
6341
  { type: i0.Component, args: [{
6119
- selector: 'dr-stepper',
6120
- template: "<div class=\"scroll-section\" *ngIf=\"stepper?.scrollLeft !== 0\" (click)=\"scrollLeft()\">\n <i class=\"dr-icon-arrow-right\"></i>\n</div>\n<div #stepper class=\"stepper\" [ngClass]=\"{'stepper--disabled': disabled}\">\n <ng-container *ngFor=\"let step of steps; let index = index; last as isLast; first as isFirst\">\n <div *ngIf=\"!step.hide\" class=\"step\" (click)=\"selectStep(step)\"\n [class.step-setup]=\"inlineLabels\">\n <div class=\"step-wrapper\" [drTooltip]=\"step.description && tooltip\"\n [drTooltipContext]=\"{ step: step }\"\n [drTooltipPosition]=\"'bottom'\">\n <div data-test=\"step_point\" class=\"step-point\" [class.active]=\"currentStep === step\" [class.completed]=\"step.completed\">\n <div *ngIf=\"step === currentStep;\" class=\"ellipse\"></div>\n <ng-container [ngSwitch]=\"step.completed\">\n <ng-template [ngSwitchCase]=\"true\">\n <div class=\"pointer blue\">\n <i class=\"dr-icon-approve\"></i>\n </div>\n </ng-template>\n <ng-template [ngSwitchCase]=\"false\">\n <div class=\"pointer\" [class.gray]=\"step !== currentStep\"\n [ngClass]=\"{'blue with-ellipse': step === currentStep}\">\n <div [hidden]=\"step === currentStep || hiddenIndex\" class=\"text\">{{index + 1}}</div>\n </div>\n </ng-template>\n </ng-container>\n </div>\n <div data-test=\"step_label_name\" class=\"step-label\" [class.active]=\"currentStep === step\"\n [ngClass]=\"step.completed ? 'completed' : 'uncompleted'\">\n <span [hidden]=\"hiddenNames\">{{step.name}}</span>\n </div>\n <ng-container *ngIf=\"inlineLabels\" [ngTemplateOutlet]=\"connector\"\n [ngTemplateOutletContext]=\"{ index, isLast, step }\">\n </ng-container>\n <span *ngIf=\"step.showProgress\"\n data-test=\"step_progress\"\n class=\"step-progress\">\n {{(step.requiredTasks ? step.completedTasks : step.requiredTasks) + '/' + step.requiredTasks}}\n </span>\n </div>\n <ng-container *ngIf=\"!inlineLabels\" [ngTemplateOutlet]=\"connector\"\n [ngTemplateOutletContext]=\"{ index, isLast, step }\">\n </ng-container>\n </div>\n </ng-container>\n</div>\n<div (click)=\"scrollRight()\" class=\"scroll-section\"\n *ngIf=\"stepper?.scrollWidth > stepper?.clientWidth && roundWidth(stepper?.scrollLeft + stepper?.clientWidth) < stepper?.scrollWidth\">\n <i class=\"dr-icon-arrow-right\"></i>\n</div>\n\n<ng-template #tooltip let-step=\"step\">\n <div class=\"step-tooltip\">\n <div class=\"step-tooltip_name\">{{step.name}}</div>\n <div class=\"step-tooltip_description\">{{step.description}}</div>\n </div>\n</ng-template>\n\n<ng-template #connector let-step=\"step\" let-isLast=\"isLast\" let-index=\"index\">\n <div class=\"step-connector\" [class.only-one-step]=\"steps.length === 1\"\n [class]=\"'step-connector--' + (!inlineLabels ? 'absolute' : 'inline')\"\n *ngIf=\"steps.length === 1 || !isLast\"\n [style.visibility]=\"withoutConnectors || steps[step.index + 1]?.hide ? 'hidden' : 'unset'\"\n [class.connector-grand]=\"!inlineLabels && (index === 0 || index === steps.length - 2)\">\n <div class=\"progress\" [style.width]=\"getWidth(step)\"></div>\n </div>\n</ng-template>\n",
6121
- changeDetection: i0.ChangeDetectionStrategy.Default,
6122
- styles: [":host{font-family:\"Poppins\",sans-serif;display:flex;justify-content:center;height:100%;position:relative}:host .scroll-section{position:absolute;top:0;height:100%;width:108px;display:flex;align-items:center;z-index:10}:host .scroll-section i{font-size:24px;color:#2969b0;background:#f3f7ff;border-radius:24px}:host .scroll-section i:hover{background:#cde1fb;cursor:pointer}:host .scroll-section:first-child{left:0;padding-left:16px;background:linear-gradient(90deg,#ffffff 36.08%,rgba(255,255,255,0) 87.17%)}:host .scroll-section:first-child i{transform:rotate(180deg)}:host .scroll-section:last-child{right:0;padding-right:16px;background:linear-gradient(270deg,#ffffff 36.08%,rgba(255,255,255,0) 87.17%);justify-content:flex-end}:host .stepper{display:flex;align-items:center;height:100%;width:100%;overflow:auto;scroll-behavior:smooth}:host .stepper::-webkit-scrollbar{display:none}:host .stepper--disabled .step:hover{cursor:default}:host .stepper--disabled .step-point .ellipse{border-color:#bcbcbc}:host .stepper--disabled .step-point .pointer{color:#fff;background-color:#bcbcbc;cursor:default}:host .stepper--disabled .step-label{color:#bcbcbc}:host .stepper--disabled .step-connector{background-color:#bcbcbc}:host .stepper--disabled .step-connector .progress{background-color:#bcbcbc}:host .step{position:relative;display:flex;flex-direction:column;width:120px;align-items:center;flex-shrink:0;flex-grow:1}:host .step:hover{cursor:pointer}:host .step:not(.step-setup) .step-wrapper{width:100%}:host .step:not(.step-setup):first-child .step-wrapper,:host .step:not(.step-setup):first-child .step-point,:host .step:not(.step-setup):first-child .step-label,:host .step:not(.step-setup):first-child .step-progress{margin-left:8px}:host .step:not(.step-setup):first-child .only-one-step{left:0!important;margin-left:25px}:host .step-point{display:flex;justify-content:center;width:100%;height:28px;position:relative;align-items:center}:host .step-point .ellipse{width:28px;height:28px;position:absolute;border-radius:50px;border-color:#4646ce;border-style:solid;border-width:2px;background:white;display:flex;justify-content:center;align-items:center;z-index:2}:host .step-point .pointer{width:24px;height:24px;position:absolute;z-index:4;border-radius:20px;display:flex;align-items:center;justify-content:center;font-weight:bold;font-size:16px;line-height:1.4;color:#51566f;transition:box-shadow .2s ease-in-out}:host .step-point .pointer i{color:#fff;font-size:22px}:host .step-point .pointer.blue{background:#4646ce}:host .step-point .pointer.gray{background:#e5e6ea}:host .step-point .pointer.gray:hover{box-shadow:0 0 4px 2px #00000026}:host .step-point.completed :host .step-point.active{background:#4646ce}:host .step-point.active .ellipse{width:28px;height:28px}:host .step-point.active .pointer{width:20px;height:20px}:host .step-label{font-weight:normal;font-size:14px;line-height:22px;line-height:1.5;color:#6d6e6f;display:flex;justify-content:center;overflow:hidden;margin-top:8px}:host .step-label span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}:host .step-label.active{font-weight:600;color:#333}:host .step-label:last-child{margin-bottom:23px}:host .step-progress{margin-top:3px;font-style:normal;font-weight:normal;font-size:12px;line-height:1.4;display:flex;justify-content:center}:host .step-connector{background-color:#e5e5e5;height:2px}:host .step-connector.connector-grand{width:calc(100% - 25px)}:host .step-connector.connector-grand.only-one-step{width:calc(100% - 50px)}:host .step-connector .progress{background-color:#4646ce;height:2px;width:0}:host .step-connector--absolute{position:absolute;top:calc(28px / 2);width:100%;left:calc(100% / 2 + 12px)}:host .step-connector--inline{width:50px;margin-left:32px;margin-right:32px}:host .step-setup{width:auto}:host .step-setup .step-wrapper{display:flex;flex-direction:row;align-items:center;width:auto}:host .step-setup+.step-setup{margin-left:0}:host .step-setup .step-progress{display:none}:host .step-setup .step-label{position:relative;transform:none;align-items:center;justify-content:start;margin:0 0 0 8px;font-size:16px}:host .step-setup .step-point{width:28px;height:28px}:host .step-setup .step-point .pointer i{font-size:22px}:host .step-setup .step-point .pointer .text{font-size:16px}::ng-deep .step-tooltip{max-width:250px;font-size:14px;line-height:22px;padding:10px 12px}::ng-deep .step-tooltip_name{font-weight:700;overflow:hidden;text-overflow:ellipsis}@media screen and (min-width: 1367px){.stepper .step-label{font-size:14px}}\n"]
6342
+ selector: 'dr-dynamic-tag',
6343
+ template: "<p class=\"dynamic-tag__label\">{{ tagConfig.name }}</p>\n<dr-select [(ngModel)]=\"selectedDynamicTag\"\n [class.dynamic-tag__locked]=\"isLockedTagSelected\"\n bindLabel=\"value\"\n bindValue=\"value\"\n [items]=\"currentValues\"\n [disabled]=\"disabled\"\n dropdownClass=\"dynamic-tag__select dr-tag__select\"\n (ngModelChange)=\"onTagChanged($event)\">\n <ng-template #optionHeaderTemplate *ngIf=\"isDynamicTagAddEnabled\">\n <dr-select-add-item bindValue=\"value\"\n [values]=\"currentValues\"\n [dynamicAddLabel]=\"' Add new ' + tagConfig.name\"\n (dynamicValueAdded)=\"onDynamicValueAdd($event)\"></dr-select-add-item>\n </ng-template>\n <ng-template #labelTemplate let-item=\"item\">\n <div class=\"dynamic-tag__field--label\">\n <p class=\"dynamic-tag__field__text\">{{ item?.value || item }}</p>\n <i *ngIf=\"item?.is_favorite\" class=\"dynamic-tag__field__icon dr-icon-star-fill\"></i>\n </div>\n </ng-template>\n <ng-template #optionTemplate let-item=\"item\">\n <div class=\"dynamic-tag__field--option\"\n [class.disabled]=\"lockedTags.includes(item?.value || item)\"\n (click)=\"onOptionClick($event, item?.value || item)\">\n <p class=\"dynamic-tag__field__text\">{{ item?.value || item }}</p>\n <i *ngIf=\"item?.is_favorite\" class=\"dynamic-tag__field__icon dr-icon-star-fill\"></i>\n </div>\n </ng-template>\n</dr-select>\n",
6344
+ styles: [".dynamic-tag__label{margin:0 0 4px;color:#0c142b;font-size:14px;font-weight:400;line-height:22px}.dynamic-tag__field,.dynamic-tag__field--option,.dynamic-tag__field--label{cursor:pointer;height:24px}.dynamic-tag__field--option{padding:8px 12px;width:100%;display:flex;justify-content:space-between;align-items:center}.dynamic-tag__field--option.disabled{opacity:.5;box-sizing:content-box}.dynamic-tag__field--label{display:flex;align-items:center}.dynamic-tag__field--label>.dynamic-tag__field__icon{position:absolute;right:25px}.dynamic-tag__field--label>dynamic-tag__field__text{margin:0}.dr-icon-star-fill{color:#f0bc57}::ng-deep dr-select.dynamic-tag__locked>ng-select>.ng-select-container{opacity:.4}::ng-deep .ng-option:has(.dynamic-tag__field--option){padding:0!important}\n"]
6123
6345
  },] }
6124
6346
  ];
6125
- StepperComponent.ctorParameters = function () { return []; };
6126
- StepperComponent.propDecorators = {
6127
- steps: [{ type: i0.Input }],
6128
- currentStep: [{ type: i0.Input }],
6129
- withoutConnectors: [{ type: i0.Input }],
6130
- hiddenNames: [{ type: i0.Input }],
6131
- inlineLabels: [{ type: i0.Input }],
6347
+ DrDynamicTagComponent.propDecorators = {
6348
+ values: [{ type: i0.Input }],
6349
+ tagConfig: [{ type: i0.Input }],
6350
+ selectedTag: [{ type: i0.Input }],
6351
+ lockedTags: [{ type: i0.Input }],
6352
+ connectedTags: [{ type: i0.Input }],
6353
+ isDynamicTagAddEnabled: [{ type: i0.Input }],
6132
6354
  disabled: [{ type: i0.Input }],
6133
- hiddenIndex: [{ type: i0.Input }],
6134
- stepChange: [{ type: i0.Output }],
6135
- stepper: [{ type: i0.ViewChild, args: ['stepper', { read: i0.ElementRef },] }]
6355
+ tagChange: [{ type: i0.Output }],
6356
+ tagAdd: [{ type: i0.Output }]
6136
6357
  };
6137
6358
 
6138
- var DrStepperModule = /** @class */ (function () {
6139
- function DrStepperModule() {
6359
+ var DrDynamicTagModule = /** @class */ (function () {
6360
+ function DrDynamicTagModule() {
6140
6361
  }
6141
- return DrStepperModule;
6362
+ return DrDynamicTagModule;
6142
6363
  }());
6143
- DrStepperModule.decorators = [
6364
+ DrDynamicTagModule.decorators = [
6144
6365
  { type: i0.NgModule, args: [{
6145
- declarations: [StepperComponent],
6366
+ declarations: [DrDynamicTagComponent],
6146
6367
  imports: [
6147
6368
  common.CommonModule,
6148
- DrTooltipModule
6369
+ DrInputsModule,
6370
+ forms.FormsModule,
6149
6371
  ],
6150
- exports: [StepperComponent]
6372
+ exports: [DrDynamicTagComponent]
6151
6373
  },] }
6152
6374
  ];
6153
6375
 
6154
- var DrDetailsListModule = /** @class */ (function () {
6155
- function DrDetailsListModule() {
6376
+ var DrTagModule = /** @class */ (function () {
6377
+ function DrTagModule() {
6156
6378
  }
6157
- return DrDetailsListModule;
6379
+ return DrTagModule;
6158
6380
  }());
6159
- DrDetailsListModule.decorators = [
6381
+ DrTagModule.decorators = [
6160
6382
  { type: i0.NgModule, args: [{
6161
6383
  imports: [
6162
6384
  common.CommonModule,
6385
+ DateTagModule,
6386
+ ListTagModule,
6387
+ DrDynamicTagModule
6163
6388
  ],
6164
- exports: [DrDetailsListComponent],
6389
+ exports: [DrTagComponent],
6165
6390
  providers: [],
6166
- declarations: [DrDetailsListComponent],
6391
+ declarations: [
6392
+ DrTagComponent
6393
+ ],
6167
6394
  },] }
6168
6395
  ];
6169
6396
 
6170
- var ɵ0$1 = {}, ɵ1 = {};
6171
- var DrDialogModule = /** @class */ (function () {
6172
- function DrDialogModule() {
6397
+ var DrAvatarModule = /** @class */ (function () {
6398
+ function DrAvatarModule() {
6173
6399
  }
6174
- return DrDialogModule;
6400
+ return DrAvatarModule;
6175
6401
  }());
6176
- DrDialogModule.decorators = [
6402
+ DrAvatarModule.decorators = [
6177
6403
  { type: i0.NgModule, args: [{
6178
- declarations: [DialogWrapperComponent, DialogModalWrapperComponent],
6404
+ declarations: [
6405
+ DrAvatarComponent,
6406
+ DrAvatarPipe
6407
+ ],
6408
+ exports: [
6409
+ DrAvatarComponent,
6410
+ DrAvatarPipe
6411
+ ],
6179
6412
  imports: [
6180
- common.CommonModule,
6181
- i1$1.MatDialogModule,
6182
- DrInputsModule,
6183
- forms.ReactiveFormsModule,
6413
+ tooltip.MatTooltipModule,
6184
6414
  DrTooltipModule,
6185
- DrDetailsListModule
6186
- ],
6187
- exports: [DialogWrapperComponent, DialogModalWrapperComponent],
6188
- providers: [
6189
- { provide: i1$1.MatDialogRef, useValue: ɵ0$1 },
6190
- { provide: i1$1.MAT_DIALOG_DATA, useValue: ɵ1 },
6191
- DialogService
6415
+ common.CommonModule
6192
6416
  ]
6193
6417
  },] }
6194
6418
  ];
6195
6419
 
6196
- var DrChatFormComponent = /** @class */ (function () {
6197
- function DrChatFormComponent(cdr, domSanitizer) {
6198
- this.cdr = cdr;
6199
- this.domSanitizer = domSanitizer;
6200
- this._textareaInitialHeight = true;
6201
- this.inputFocus = false;
6202
- this.inputHover = false;
6203
- this.droppedFiles = [];
6204
- /**
6205
- * Predefined message text
6206
- *
6207
- * @type {string}
6208
- */
6209
- this.message = '';
6210
- /**
6211
- * Message placeholder text
6212
- *
6213
- * @type {string}
6214
- */
6215
- this.messagePlaceholder = 'Type a message';
6216
- /**
6217
- * Show send button
6218
- *
6219
- * @type {boolean}
6220
- */
6221
- this.dropFiles = false;
6222
- /**
6223
- * File drop placeholder text
6224
- *
6225
- * @type {string}
6226
- */
6227
- this.dropFilePlaceholder = 'Drop file to send';
6228
- /**
6229
- * Parameter to check is send message function available
6230
- *
6231
- * @type {boolean}
6232
- */
6233
- this.waitForReply = false;
6234
- /**
6235
- *
6236
- * @type {EventEmitter<{ message: string, files: File[] }>}
6237
- */
6238
- this.send = new i0.EventEmitter();
6239
- this.abort = new i0.EventEmitter();
6240
- /**
6241
- * Emits when message input value has been changed
6242
- *
6243
- * @type {EventEmitter<string>}
6244
- */
6245
- this.inputChange = new i0.EventEmitter();
6246
- this.fileOver = false;
6420
+ var components$1 = [DrSpinnerComponent];
6421
+ var directives = [DrSpinnerDirective];
6422
+ var DrSpinnerModule = /** @class */ (function () {
6423
+ function DrSpinnerModule() {
6247
6424
  }
6248
- DrChatFormComponent.prototype.onDrop = function (event) {
6249
- var e_1, _b;
6250
- var _this = this;
6251
- var _a;
6252
- if (this.dropFiles) {
6253
- event.preventDefault();
6254
- event.stopPropagation();
6255
- this.fileOver = false;
6256
- if ((_a = event.dataTransfer) === null || _a === void 0 ? void 0 : _a.files) {
6257
- var _loop_1 = function (file) {
6258
- var res = file;
6259
- if (IMAGE_TYPES.includes(file.type)) {
6260
- var fr = new FileReader();
6261
- fr.onload = function (e) {
6262
- res.src = e.target.result;
6263
- res.urlStyle = _this.domSanitizer.bypassSecurityTrustStyle("url(" + res.src + ")");
6264
- _this.cdr.detectChanges();
6265
- };
6266
- fr.readAsDataURL(file);
6267
- }
6268
- this_1.droppedFiles.push(res);
6269
- };
6270
- var this_1 = this;
6271
- try {
6272
- for (var _c = __values(event.dataTransfer.files), _d = _c.next(); !_d.done; _d = _c.next()) {
6273
- var file = _d.value;
6274
- _loop_1(file);
6275
- }
6276
- }
6277
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
6278
- finally {
6279
- try {
6280
- if (_d && !_d.done && (_b = _c.return)) _b.call(_c);
6281
- }
6282
- finally { if (e_1) throw e_1.error; }
6283
- }
6284
- }
6285
- }
6286
- };
6287
- DrChatFormComponent.prototype.removeFile = function (file) {
6288
- var index = this.droppedFiles.indexOf(file);
6289
- if (index >= 0) {
6290
- this.droppedFiles.splice(index, 1);
6291
- }
6292
- };
6293
- DrChatFormComponent.prototype.onDragOver = function (event) {
6294
- event.preventDefault();
6295
- event.stopPropagation();
6296
- if (this.dropFiles) {
6297
- this.fileOver = true;
6298
- }
6299
- };
6300
- DrChatFormComponent.prototype.onDragLeave = function (event) {
6301
- event.preventDefault();
6302
- event.stopPropagation();
6303
- if (this.dropFiles) {
6304
- this.fileOver = false;
6305
- }
6306
- };
6307
- DrChatFormComponent.prototype.sendMessage = function () {
6308
- if (this.waitForReply) {
6309
- return;
6310
- }
6311
- if (this.droppedFiles.length || String(this.message).trim().length) {
6312
- this._textareaInitialHeight = true;
6313
- this.send.emit({ message: this.message, files: this.droppedFiles });
6314
- this.message = '';
6315
- this.droppedFiles = [];
6316
- this.cdr.markForCheck();
6317
- }
6318
- };
6319
- DrChatFormComponent.prototype.abortMessage = function () {
6320
- this.abort.emit();
6321
- };
6322
- DrChatFormComponent.prototype.onModelChange = function (value) {
6323
- this._textareaInitialHeight = false;
6324
- this.inputChange.emit(value);
6325
- };
6326
- DrChatFormComponent.prototype.getTextAreaHeight = function (textAreaElement) {
6327
- var height;
6328
- if (this._textareaInitialHeight) {
6329
- height = 50;
6330
- }
6331
- else {
6332
- height = textAreaElement.scrollHeight + 2;
6333
- }
6334
- return "height: " + height + "px;";
6335
- };
6336
- return DrChatFormComponent;
6425
+ return DrSpinnerModule;
6426
+ }());
6427
+ DrSpinnerModule.decorators = [
6428
+ { type: i0.NgModule, args: [{
6429
+ imports: [
6430
+ common.CommonModule,
6431
+ ],
6432
+ exports: __spreadArray(__spreadArray([], __read(components$1)), __read(directives)),
6433
+ declarations: __spreadArray(__spreadArray([], __read(components$1)), __read(directives))
6434
+ },] }
6435
+ ];
6436
+
6437
+ var DrPopoverModule = /** @class */ (function () {
6438
+ function DrPopoverModule() {
6439
+ }
6440
+ return DrPopoverModule;
6337
6441
  }());
6338
- DrChatFormComponent.decorators = [
6339
- { type: i0.Component, args: [{
6340
- selector: 'dr-chat-form',
6341
- template: "<div class=\"dropped-files\" *ngIf=\"droppedFiles?.length\">\n <div class=\"dropped-files__item\" *ngFor=\"let file of droppedFiles\">\n <div class=\"dropped-files__item__preview\" [style.background-image]=\"file.urlStyle || 'none'\">\n <i class=\"dr-icon-file\" *ngIf=\"!file.urlStyle\"></i>\n </div>\n <div class=\"dropped-files__item__name\">{{ file.name }}</div>\n <i class=\"dropped-files__item__remove dr-icon-exit\" (click)=\"removeFile(file)\"></i>\n </div>\n</div>\n<div class=\"message-row\">\n <div class=\"message-row__input\">\n <textarea #textAreaElement\n (focus)=\"inputFocus = true\"\n (blur)=\"inputFocus = false\"\n (mouseenter)=\"inputHover = true\"\n (mouseleave)=\"inputHover = false\"\n [(ngModel)]=\"message\"\n [rows]=\"1\"\n [style]=\"getTextAreaHeight(textAreaElement)\"\n (ngModelChange)=\"onModelChange($event)\"\n type=\"text\"\n placeholder=\"{{ fileOver ? dropFilePlaceholder : messagePlaceholder }}\"\n (keyup.enter)=\"sendMessage()\">\n </textarea>\n <i *ngIf=\"!waitForReply\" (click)=\"sendMessage()\" class=\"dr-icon-notify send-button\"></i>\n <dr-dot-flashing *ngIf=\"waitForReply\" class=\"wait-reply-dot-flashing\"></dr-dot-flashing>\n <dr-button *ngIf=\"waitForReply\" (click)=\"abortMessage()\" theme=\"ghost\" class=\"abort-button\">Stop generating</dr-button>\n </div>\n</div>\n",
6342
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
6343
- styles: [":host{display:flex;flex-direction:column;align-items:center;padding:0 24px;margin-top:12px}:host .message-row{display:flex;justify-content:center;width:100%;padding:0 0 21px;max-width:970px}:host .message-row__input{position:relative;display:flex;align-items:center;flex-grow:1;flex-direction:row;height:auto;overflow:visible;min-width:265px}:host .message-row__input textarea{font-size:14px;line-height:22px;max-height:100%;flex-grow:1;resize:none;padding:14px 40px 12px 23px;margin:auto;border:1px solid #DFE0E3;border-radius:12px;min-height:50px}:host .message-row__input textarea:focus{border:1px solid #7F7FDD}:host .message-row__input textarea::placeholder{color:#9ea1aa}:host .message-row__input .send-button{position:absolute;right:14px;cursor:pointer;color:#dfe0e3;font-size:28px}:host .message-row__input .wait-reply-dot-flashing{position:absolute;right:20px}:host .message-row__input textarea:focus+.send-button,:host .message-row__input .send-button:hover{color:#25258c}:host .message-row__input .abort-button{position:absolute;right:0;top:-44px}:host .message-row__input .abort-button::ng-deep button{background:#F2F2FF!important;border-radius:4px}:host input{flex:1}:host input.with-button{border-bottom-right-radius:0;border-top-right-radius:0}:host .dropped-files{display:flex;flex-direction:row;margin-bottom:.5rem;flex-wrap:wrap}:host .dropped-files__item{display:flex;flex-direction:column;justify-content:center;margin:0 10px 10px 0;position:relative}:host .dropped-files__item__preview{background-size:cover;background-position:center;width:64px;height:64px;border-radius:8px;border:1px solid #ccc}:host .dropped-files__item__preview i{font-size:62px}:host .dropped-files__item__name{white-space:nowrap;font-size:12px;color:#8f929e;margin-top:4px;max-width:64px;overflow:hidden;text-overflow:ellipsis}:host .dropped-files__item__remove{position:absolute;right:-4px;top:-4px;cursor:pointer;background:white;border-radius:12px;color:#8f929e;border:1px solid #8f929e;font-size:14px}\n"]
6442
+ DrPopoverModule.decorators = [
6443
+ { type: i0.NgModule, args: [{
6444
+ imports: [
6445
+ common.CommonModule,
6446
+ ],
6447
+ exports: [
6448
+ DrPopoverDirective,
6449
+ DrPopoverComponent,
6450
+ ],
6451
+ providers: [],
6452
+ declarations: [
6453
+ DrPopoverDirective,
6454
+ DrPopoverComponent,
6455
+ ],
6344
6456
  },] }
6345
6457
  ];
6346
- DrChatFormComponent.ctorParameters = function () { return [
6347
- { type: i0.ChangeDetectorRef },
6348
- { type: platformBrowser.DomSanitizer }
6349
- ]; };
6350
- DrChatFormComponent.propDecorators = {
6351
- message: [{ type: i0.Input }],
6352
- messagePlaceholder: [{ type: i0.Input }],
6353
- dropFiles: [{ type: i0.Input }],
6354
- dropFilePlaceholder: [{ type: i0.Input }],
6355
- waitForReply: [{ type: i0.Input }],
6356
- send: [{ type: i0.Output }],
6357
- abort: [{ type: i0.Output }],
6358
- inputChange: [{ type: i0.Output }],
6359
- fileOver: [{ type: i0.HostBinding, args: ['class.file-over',] }],
6360
- onDrop: [{ type: i0.HostListener, args: ['drop', ['$event'],] }],
6361
- onDragOver: [{ type: i0.HostListener, args: ['dragover', ['$event'],] }],
6362
- onDragLeave: [{ type: i0.HostListener, args: ['dragleave', ['$event'],] }]
6363
- };
6364
6458
 
6365
- /**
6366
- * `DrCustomMessageService` is used to store instances of `DrChatCustomMessageDirective`s which
6367
- * were provided in the chat component.
6368
- */
6369
- var DrChatCustomMessageService = /** @class */ (function () {
6370
- function DrChatCustomMessageService() {
6371
- this.customMessages = new Map();
6459
+ var DrDropdownModule = /** @class */ (function () {
6460
+ function DrDropdownModule() {
6372
6461
  }
6373
- DrChatCustomMessageService.prototype.register = function (type, instance) {
6374
- this.customMessages.set(type, instance);
6375
- };
6376
- DrChatCustomMessageService.prototype.unregister = function (type) {
6377
- return this.customMessages.delete(type);
6378
- };
6379
- DrChatCustomMessageService.prototype.getInstance = function (type) {
6380
- return this.customMessages.get(type);
6381
- };
6382
- return DrChatCustomMessageService;
6462
+ return DrDropdownModule;
6383
6463
  }());
6384
- DrChatCustomMessageService.decorators = [
6385
- { type: i0.Injectable }
6464
+ DrDropdownModule.decorators = [
6465
+ { type: i0.NgModule, args: [{
6466
+ imports: [
6467
+ common.CommonModule,
6468
+ DrTooltipModule,
6469
+ ],
6470
+ declarations: [
6471
+ DrDropdownDirective,
6472
+ DrDropdownPositionDirective,
6473
+ DrDropdownComponent,
6474
+ DrDropdownItemShowPipe,
6475
+ ],
6476
+ exports: [
6477
+ DrDropdownDirective,
6478
+ DrDropdownPositionDirective,
6479
+ DrDropdownComponent,
6480
+ DrDropdownItemShowPipe,
6481
+ ],
6482
+ providers: [
6483
+ DrDropdownService,
6484
+ ],
6485
+ },] }
6386
6486
  ];
6387
6487
 
6388
- var DrChatMessageComponent = /** @class */ (function () {
6389
- function DrChatMessageComponent(customMessageService) {
6390
- this.customMessageService = customMessageService;
6391
- this.MESSAGE_TYPE = exports.CHAT_MESSAGE_TYPE;
6392
- this._reply = false;
6488
+ var DrTabsModule = /** @class */ (function () {
6489
+ function DrTabsModule() {
6393
6490
  }
6394
- Object.defineProperty(DrChatMessageComponent.prototype, "flyInOut", {
6395
- get: function () {
6396
- return true;
6397
- },
6398
- enumerable: false,
6399
- configurable: true
6400
- });
6401
- Object.defineProperty(DrChatMessageComponent.prototype, "notReply", {
6402
- get: function () {
6403
- return !this.reply;
6404
- },
6405
- enumerable: false,
6406
- configurable: true
6407
- });
6408
- Object.defineProperty(DrChatMessageComponent.prototype, "reply", {
6409
- /**
6410
- * Determines if a message is a reply
6411
- */
6412
- get: function () {
6413
- return this._reply;
6414
- },
6415
- set: function (value) {
6416
- this._reply = !!value;
6417
- },
6418
- enumerable: false,
6419
- configurable: true
6420
- });
6421
- DrChatMessageComponent.prototype.getTemplate = function () {
6422
- this.customMessage = true;
6423
- var customMessage = this.getCustomMessage(this.type);
6424
- return customMessage.templateRef;
6425
- };
6426
- DrChatMessageComponent.prototype.getTemplateContext = function () {
6427
- return { $implicit: this.customMessageData, isReply: this.reply };
6428
- };
6429
- DrChatMessageComponent.prototype.getCustomMessage = function (type) {
6430
- var customMessageDirective = this.customMessageService.getInstance(type);
6431
- if (!customMessageDirective) {
6432
- throw new Error("dr-chat: Can't find template for custom type '" + type + "'. " +
6433
- ("Make sure you provide it in the chat component with *drCustomMessage='" + type + "'."));
6434
- }
6435
- return customMessageDirective;
6436
- };
6437
- return DrChatMessageComponent;
6491
+ return DrTabsModule;
6438
6492
  }());
6439
- DrChatMessageComponent.decorators = [
6440
- { type: i0.Component, args: [{
6441
- selector: 'dr-chat-message',
6442
- template: "<ng-container *ngIf=\"message.avatarUrl; else userAvatar\">\n <div class=\"avatar\" [style.background-image]=\"'url(' + message.avatarUrl + ')'\"></div>\n</ng-container>\n<ng-template #userAvatar>\n <dr-avatar *ngIf=\"message.user\" [users]=\"message.user\"></dr-avatar>\n</ng-template>\n<div class=\"message\" [class.message--custom]=\"customMessage\">\n <ng-container [ngSwitch]=\"message.kind\">\n <dr-chat-message-text *ngSwitchCase=\"MESSAGE_TYPE.TEXT\" [message]=\"message\"></dr-chat-message-text>\n <dr-chat-message-file *ngSwitchCase=\"MESSAGE_TYPE.DOWNLOAD_FILE\" [message]=\"message\"></dr-chat-message-file>\n <ng-container *ngSwitchDefault>\n <ng-container [ngTemplateOutlet]=\"getTemplate()\" [ngTemplateOutletContext]=\"getTemplateContext()\"></ng-container>\n </ng-container>\n </ng-container>\n <div class=\"message__actions\" *ngIf=\"drChatMessageActions;\">\n <ng-container [ngTemplateOutlet]=\"drChatMessageActions\"></ng-container>\n </div>\n</div>\n",
6443
- animations: [
6444
- animations.trigger('flyInOut', [
6445
- animations.state('in', animations.style({ transform: 'translateX(0)' })),
6446
- animations.transition('void => *', [animations.style({ transform: 'translateX(-100%)' }), animations.animate(80)]),
6447
- animations.transition('* => void', [animations.animate(80, animations.style({ transform: 'translateX(100%)' }))]),
6448
- ]),
6493
+ DrTabsModule.decorators = [
6494
+ { type: i0.NgModule, args: [{
6495
+ imports: [
6496
+ common.CommonModule,
6497
+ tabs.MatTabsModule,
6498
+ forms.FormsModule,
6499
+ forms.ReactiveFormsModule,
6500
+ DrInputsModule,
6501
+ DrTooltipModule
6502
+ ],
6503
+ exports: [
6504
+ DrTabsComponent,
6505
+ DrTabComponent
6506
+ ],
6507
+ providers: [],
6508
+ declarations: [
6509
+ DrTabsComponent,
6510
+ DrTabComponent
6449
6511
  ],
6450
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
6451
- styles: [":host{position:relative;display:flex;flex-direction:row;width:100%;background:rgba(249,250,255,.7);border-top:1px solid #E5E5E5;padding:16px 24px}:host:first-child{border:none}:host:last-child{border-bottom:1px solid #E5E5E5}.reply+:host.reply,.not-reply+:host.not-reply{border-top:none;padding-top:0;padding-left:75px}.reply+:host.reply .avatar,.reply+:host.reply dr-avatar,.not-reply+:host.not-reply .avatar,.not-reply+:host.not-reply dr-avatar{display:none}:host.not-reply{background-color:#fff}:host .avatar{display:flex;width:28px;height:28px;background-color:#fff;border-radius:16px;flex-shrink:0;box-shadow:0 1px 3px 1px #0003;background-image:url(\"data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22UTF-8%22%3F%3E%3Csvg id%3D%22Layer_1%22 data-name%3D%22Layer 1%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22 viewBox%3D%220 0 74 65%22%3E %3Cdefs%3E %3Cstyle%3E .cls-1%2C .cls-2%2C .cls-3 %7B fill%3A none%3B %7D .cls-4 %7B fill%3A url(%23linear-gradient)%3B %7D .cls-5 %7B fill%3A %234eb7df%3B %7D .cls-2 %7B stroke%3A %23a6a8aa%3B stroke-miterlimit%3A 10%3B stroke-width%3A .37px%3B %7D .cls-6 %7B fill%3A url(%23linear-gradient-3)%3B %7D .cls-7 %7B fill%3A url(%23linear-gradient-2)%3B %7D .cls-3 %7B clip-path%3A url(%23clippath)%3B %7D %3C%2Fstyle%3E %3CclipPath id%3D%22clippath%22%3E %3Crect class%3D%22cls-1%22 width%3D%2274%22 height%3D%2265%22%2F%3E %3C%2FclipPath%3E %3ClinearGradient id%3D%22linear-gradient%22 x1%3D%2224.26%22 y1%3D%22-3.79%22 x2%3D%2295.63%22 y2%3D%2288.82%22 gradientTransform%3D%22translate(0 65.89) scale(1 -1)%22 gradientUnits%3D%22userSpaceOnUse%22%3E %3Cstop offset%3D%220%22 stop-color%3D%22%237676ff%22%2F%3E %3Cstop offset%3D%22.18%22 stop-color%3D%22%235959ff%22%2F%3E %3Cstop offset%3D%22.35%22 stop-color%3D%22%235757e0%22%2F%3E %3Cstop offset%3D%22.61%22 stop-color%3D%22%234646ce%22%2F%3E %3Cstop offset%3D%22.84%22 stop-color%3D%22%234b4be4%22%2F%3E %3Cstop offset%3D%221%22 stop-color%3D%22%234444eb%22%2F%3E %3C%2FlinearGradient%3E %3ClinearGradient id%3D%22linear-gradient-2%22 x1%3D%2212.05%22 y1%3D%2277.06%22 x2%3D%2210.77%22 y2%3D%2213.85%22 gradientTransform%3D%22translate(0 65.89) scale(1 -1)%22 gradientUnits%3D%22userSpaceOnUse%22%3E %3Cstop offset%3D%22.45%22 stop-color%3D%22%232f92b8%22%2F%3E %3Cstop offset%3D%22.84%22 stop-color%3D%22%234eb7df%22%2F%3E %3Cstop offset%3D%221%22 stop-color%3D%22%234eb7df%22%2F%3E %3C%2FlinearGradient%3E %3ClinearGradient id%3D%22linear-gradient-3%22 x1%3D%2262.26%22 y1%3D%22-2.54%22 x2%3D%2261.76%22 y2%3D%2285.91%22 gradientTransform%3D%22translate(0 65.89) scale(1 -1)%22 gradientUnits%3D%22userSpaceOnUse%22%3E %3Cstop offset%3D%220%22 stop-color%3D%22%2336369b%22%2F%3E %3Cstop offset%3D%22.52%22 stop-color%3D%22%234848d0%22%2F%3E %3C%2FlinearGradient%3E %3C%2Fdefs%3E %3Cg class%3D%22cls-3%22%3E %3Cg%3E %3Cpath class%3D%22cls-4%22 d%3D%22m73.32%2C24.79v15.73c0%2C13.12-9.87%2C23.79-22%2C23.79h-21.32c-3.46-.06-6.25-3.11-6.25-6.87s2.79-6.81%2C6.25-6.87h21.32c5.13%2C0%2C9.29-4.51%2C9.29-10.05v-15.73c0-5.54-4.17-10.05-9.29-10.05h-7.46c3.51%2C0%2C6.35-3.08%2C6.35-6.88s-2.79-6.8-6.25-6.87h7.35c12.12%2C0%2C22%2C10.67%2C22%2C23.79h0Z%22%2F%3E %3Cpath class%3D%22cls-5%22 d%3D%22m50.26%2C7.82c0%2C3.8-2.9%2C6.93-6.41%2C6.93h-21.86c-5.13%2C0-9.29%2C4.51-9.29%2C10.05v15.73c0%2C5.54%2C4.17%2C10.05%2C9.29%2C10.05h8.01c-3.46.06-6.25%2C3.11-6.25%2C6.87s2.79%2C6.81%2C6.25%2C6.87h-8.01c-12.12%2C0-22-10.67-22-23.79v-15.73C0%2C11.68%2C9.87%2C1%2C21.99%2C1h21.97c3.46.06%2C6.3%2C3.06%2C6.3%2C6.82Z%22%2F%3E %3Cpath class%3D%22cls-2%22 d%3D%22m66.45%2C1h-.22.22%2C0Z%22%2F%3E %3Cpath class%3D%22cls-2%22 d%3D%22m36.05%2C50.58h-.22.22%2C0Z%22%2F%3E %3Cpath class%3D%22cls-7%22 d%3D%22m0%2C33.78v-2.76C0%2C12.9%2C13.62%2C14.48%2C13.62%2C14.48h8.38c-5.5.46-9.5%2C4.71-9.5%2C9.96l.02%2C15.8c0%2C5.54%2C4.44%2C10.59%2C9.48%2C10.59l-8-.5S0%2C51.88%2C0%2C33.77h0Z%22%2F%3E %3Cpath class%3D%22cls-6%22 d%3D%22m73%2C31.51v2.76c0%2C18.12-13.62%2C16.53-13.62%2C16.53h-7.99c5.61-.85%2C9.09-4.76%2C9.09-10.02l.02-16.33c0-5.54-4.46-10-9.5-10h8s13.99-1.05%2C13.99%2C17.07h0Z%22%2F%3E %3C%2Fg%3E %3C%2Fg%3E%3C%2Fsvg%3E\");background-size:20px 22px;background-repeat:no-repeat;background-position-x:4px;background-position-y:3px}:host .avatar,:host dr-avatar{margin:0 23px 0 0}:host .message{display:flex;align-items:center;flex-grow:1}:host .message__actions{display:flex;align-items:center;margin-left:24px;flex-grow:1;justify-content:flex-end}:host .message__actions::ng-deep button:not(:hover) i[class*=dr-icon]{color:#b9b9ec!important}\n"]
6452
6512
  },] }
6453
6513
  ];
6454
- DrChatMessageComponent.ctorParameters = function () { return [
6455
- { type: DrChatCustomMessageService }
6456
- ]; };
6457
- DrChatMessageComponent.propDecorators = {
6458
- flyInOut: [{ type: i0.HostBinding, args: ['@flyInOut',] }],
6459
- notReply: [{ type: i0.HostBinding, args: ['class.not-reply',] }],
6460
- reply: [{ type: i0.Input }, { type: i0.HostBinding, args: ['class.reply',] }],
6461
- type: [{ type: i0.Input }],
6462
- message: [{ type: i0.Input }],
6463
- customMessageData: [{ type: i0.Input }],
6464
- user: [{ type: i0.Input }],
6465
- drChatMessageActions: [{ type: i0.ContentChild, args: ['drChatMessageActions',] }]
6466
- };
6467
6514
 
6468
- var DrChatSuggestionsComponent = /** @class */ (function () {
6469
- function DrChatSuggestionsComponent() {
6470
- this._nonHiddenValues = [];
6471
- this.visibleValues = [];
6472
- this.values = [];
6473
- this.fullScreen = false;
6474
- this.buttonMode = false;
6475
- /**
6476
- * Parameter to check is send message function available
6477
- *
6478
- * @type {boolean}
6479
- */
6480
- this.waitForReply = false;
6481
- this.suggestionSelect = new i0.EventEmitter();
6515
+ var DR_ACCORDION_COMPONENTS = [
6516
+ DrAccordionComponent,
6517
+ DrAccordionItemComponent,
6518
+ DrAccordionItemHeaderComponent,
6519
+ DrAccordionItemBodyComponent,
6520
+ ];
6521
+ var DrAccordionModule = /** @class */ (function () {
6522
+ function DrAccordionModule() {
6523
+ }
6524
+ return DrAccordionModule;
6525
+ }());
6526
+ DrAccordionModule.decorators = [
6527
+ { type: i0.NgModule, args: [{
6528
+ imports: [common.CommonModule],
6529
+ exports: __spreadArray([], __read(DR_ACCORDION_COMPONENTS)),
6530
+ declarations: __spreadArray([], __read(DR_ACCORDION_COMPONENTS)),
6531
+ providers: [],
6532
+ },] }
6533
+ ];
6534
+
6535
+ var components = [
6536
+ DrLayoutComponent,
6537
+ DrLayoutHeaderComponent,
6538
+ DrLayoutBodyComponent
6539
+ ];
6540
+ var DrLayoutModule = /** @class */ (function () {
6541
+ function DrLayoutModule() {
6542
+ }
6543
+ return DrLayoutModule;
6544
+ }());
6545
+ DrLayoutModule.decorators = [
6546
+ { type: i0.NgModule, args: [{
6547
+ imports: [common.CommonModule],
6548
+ exports: __spreadArray([], __read(components)),
6549
+ declarations: __spreadArray([], __read(components)),
6550
+ },] }
6551
+ ];
6552
+
6553
+ var DrErrorModule = /** @class */ (function () {
6554
+ function DrErrorModule() {
6555
+ }
6556
+ return DrErrorModule;
6557
+ }());
6558
+ DrErrorModule.decorators = [
6559
+ { type: i0.NgModule, args: [{
6560
+ imports: [
6561
+ common.CommonModule,
6562
+ forms.FormsModule,
6563
+ DrTooltipModule
6564
+ ],
6565
+ exports: [DrErrorComponent],
6566
+ providers: [],
6567
+ declarations: [
6568
+ DrErrorComponent
6569
+ ],
6570
+ },] }
6571
+ ];
6572
+
6573
+ var StepperComponent = /** @class */ (function () {
6574
+ function StepperComponent() {
6575
+ this.withoutConnectors = false;
6576
+ this.hiddenNames = false;
6577
+ this.inlineLabels = false;
6578
+ this.disabled = false;
6579
+ this.hiddenIndex = false;
6580
+ this.stepChange = new i0.EventEmitter();
6482
6581
  }
6483
- Object.defineProperty(DrChatSuggestionsComponent.prototype, "hiddenValues", {
6484
- get: function () {
6485
- return JSON.parse(localStorage.getItem('aiChatSuggestions')) || [];
6486
- },
6487
- set: function (values) {
6488
- localStorage.setItem('aiChatSuggestions', JSON.stringify(values));
6489
- },
6490
- enumerable: false,
6491
- configurable: true
6492
- });
6493
- DrChatSuggestionsComponent.prototype.ngOnInit = function () {
6494
- this.filterValues();
6495
- };
6496
- DrChatSuggestionsComponent.prototype.onItemClick = function (item) {
6497
- var _this = this;
6498
- if (this.waitForReply) {
6499
- return;
6582
+ StepperComponent.prototype.selectStep = function (step) {
6583
+ if (step !== this.currentStep && !this.disabled) {
6584
+ this.stepChange.emit(step);
6500
6585
  }
6501
- this.suggestionSelect.emit(item);
6502
- this.hiddenValues = __spreadArray(__spreadArray([], __read(this.hiddenValues)), [item]);
6503
- this.filterValues();
6504
- this.suggestionCardsList.nativeElement.style.visibility = 'hidden';
6505
- setTimeout(function () { return _this.suggestionCardsList.nativeElement.style.visibility = ''; }, 10);
6506
6586
  };
6507
- DrChatSuggestionsComponent.prototype.filterValues = function () {
6508
- var hiddenValues = this.hiddenValues;
6509
- this._nonHiddenValues = ___namespace.filter(this.values, function (val) { return !hiddenValues.includes(val); });
6510
- this.fillVisibleValues();
6587
+ StepperComponent.prototype.getWidth = function (step) {
6588
+ if (this.withoutConnectors)
6589
+ return '0%';
6590
+ if (step.completed)
6591
+ return '100%';
6592
+ if (step.index === 0 || this.steps[step.index - 1].completed)
6593
+ return (((step === null || step === void 0 ? void 0 : step.completedTasks) / (step === null || step === void 0 ? void 0 : step.requiredTasks) * 100) || 0) + "%";
6594
+ return '0%';
6511
6595
  };
6512
- DrChatSuggestionsComponent.prototype.fillVisibleValues = function () {
6513
- var maxItemsCount = this.fullScreen ? 6 : 4;
6514
- var nonHiddenValues = ___namespace.clone(this._nonHiddenValues);
6515
- this.visibleValues.length = 0;
6516
- for (var i = 0; i < maxItemsCount; i++) {
6517
- if (!nonHiddenValues.length) {
6518
- break;
6519
- }
6520
- var randomIndex = Math.floor(Math.random() * nonHiddenValues.length);
6521
- var item = nonHiddenValues.splice(randomIndex, 1)[0];
6522
- this.visibleValues.push(item);
6523
- }
6596
+ StepperComponent.prototype.scrollLeft = function () {
6597
+ this.stepper.nativeElement.scrollLeft -= 80;
6524
6598
  };
6525
- DrChatSuggestionsComponent.prototype.clearHidden = function () {
6526
- localStorage.setItem('aiChatSuggestions', null);
6527
- this.filterValues();
6599
+ StepperComponent.prototype.scrollRight = function () {
6600
+ this.stepper.nativeElement.scrollLeft += 80;
6528
6601
  };
6529
- return DrChatSuggestionsComponent;
6602
+ StepperComponent.prototype.roundWidth = function (width) {
6603
+ return Math.round(width);
6604
+ };
6605
+ return StepperComponent;
6530
6606
  }());
6531
- DrChatSuggestionsComponent.decorators = [
6607
+ StepperComponent.decorators = [
6532
6608
  { type: i0.Component, args: [{
6533
- selector: 'dr-chat-suggestions',
6534
- template: "<div class=\"chat-suggestions\">\n <ng-container *ngIf=\"buttonMode; else suggestionCards\">\n <div class=\"chat-suggestions__container\" (mouseenter)=\"fillVisibleValues()\">\n <dr-button theme=\"ghost\" class=\"chat-suggestions__container__button\">\n Suggested chats\n </dr-button>\n <ng-container *ngTemplateOutlet=\"suggestionCards\"></ng-container>\n </div>\n </ng-container>\n</div>\n\n<ng-template #suggestionCards>\n <div class=\"chat-suggestions__items\" #suggestionCardsList>\n <div class=\"chat-suggestions__items__background\"></div>\n <div *ngFor=\"let item of visibleValues\"\n class=\"chat-suggestions__items__item\" (click)=\"onItemClick(item)\">\n {{ item }}\n </div>\n </div>\n</ng-template>\n",
6535
- changeDetection: i0.ChangeDetectionStrategy.OnPush,
6536
- styles: [":host{display:flex;align-items:flex-start;justify-content:center}:host .chat-suggestions{display:flex;width:100%;max-width:970px}:host .chat-suggestions__container{display:flex;position:relative;width:auto;margin-top:12px;padding:0 24px}:host .chat-suggestions__container:hover{width:100%}:host .chat-suggestions__container:hover .chat-suggestions__container__button::ng-deep button{color:#4646ce;background:#f2f2fb}:host .chat-suggestions__container:hover .chat-suggestions__items,:host .chat-suggestions__container:hover .chat-suggestions__items__background{display:flex}:host .chat-suggestions__container__button::ng-deep button{background:#F2F2FF!important;border-radius:4px}:host .chat-suggestions__container .chat-suggestions__items{display:none;position:absolute;width:100%;bottom:0;left:0;padding-bottom:32px;z-index:2}:host .chat-suggestions__items{display:flex;flex-wrap:wrap;width:100%;justify-content:space-between;padding:0 24px}:host .chat-suggestions__items__background{display:none;position:absolute;top:-32px;right:0;bottom:32px;left:0;background:white;opacity:.7;z-index:-1}:host .chat-suggestions__items__item{margin:0 0 20px;display:inline-flex;height:76px;width:275px;padding:16px;border-radius:8px;background:#F2F2FF;box-shadow:0 1px 2px #00000026;font-size:14px;line-height:24px;color:#25258c}:host .chat-suggestions__items__item:hover{cursor:pointer;background:#EAEAFF}\n"]
6609
+ selector: 'dr-stepper',
6610
+ template: "<div class=\"scroll-section\" *ngIf=\"stepper?.scrollLeft !== 0\" (click)=\"scrollLeft()\">\n <i class=\"dr-icon-arrow-right\"></i>\n</div>\n<div #stepper class=\"stepper\" [ngClass]=\"{'stepper--disabled': disabled}\">\n <ng-container *ngFor=\"let step of steps; let index = index; last as isLast; first as isFirst\">\n <div *ngIf=\"!step.hide\" class=\"step\" (click)=\"selectStep(step)\"\n [class.step-setup]=\"inlineLabels\">\n <div class=\"step-wrapper\" [drTooltip]=\"step.description && tooltip\"\n [drTooltipContext]=\"{ step: step }\"\n [drTooltipPosition]=\"'bottom'\">\n <div data-test=\"step_point\" class=\"step-point\" [class.active]=\"currentStep === step\" [class.completed]=\"step.completed\">\n <div *ngIf=\"step === currentStep;\" class=\"ellipse\"></div>\n <ng-container [ngSwitch]=\"step.completed\">\n <ng-template [ngSwitchCase]=\"true\">\n <div class=\"pointer blue\">\n <i class=\"dr-icon-approve\"></i>\n </div>\n </ng-template>\n <ng-template [ngSwitchCase]=\"false\">\n <div class=\"pointer\" [class.gray]=\"step !== currentStep\"\n [ngClass]=\"{'blue with-ellipse': step === currentStep}\">\n <div [hidden]=\"step === currentStep || hiddenIndex\" class=\"text\">{{index + 1}}</div>\n </div>\n </ng-template>\n </ng-container>\n </div>\n <div data-test=\"step_label_name\" class=\"step-label\" [class.active]=\"currentStep === step\"\n [ngClass]=\"step.completed ? 'completed' : 'uncompleted'\">\n <span [hidden]=\"hiddenNames\">{{step.name}}</span>\n </div>\n <ng-container *ngIf=\"inlineLabels\" [ngTemplateOutlet]=\"connector\"\n [ngTemplateOutletContext]=\"{ index, isLast, step }\">\n </ng-container>\n <span *ngIf=\"step.showProgress\"\n data-test=\"step_progress\"\n class=\"step-progress\">\n {{(step.requiredTasks ? step.completedTasks : step.requiredTasks) + '/' + step.requiredTasks}}\n </span>\n </div>\n <ng-container *ngIf=\"!inlineLabels\" [ngTemplateOutlet]=\"connector\"\n [ngTemplateOutletContext]=\"{ index, isLast, step }\">\n </ng-container>\n </div>\n </ng-container>\n</div>\n<div (click)=\"scrollRight()\" class=\"scroll-section\"\n *ngIf=\"stepper?.scrollWidth > stepper?.clientWidth && roundWidth(stepper?.scrollLeft + stepper?.clientWidth) < stepper?.scrollWidth\">\n <i class=\"dr-icon-arrow-right\"></i>\n</div>\n\n<ng-template #tooltip let-step=\"step\">\n <div class=\"step-tooltip\">\n <div class=\"step-tooltip_name\">{{step.name}}</div>\n <div class=\"step-tooltip_description\">{{step.description}}</div>\n </div>\n</ng-template>\n\n<ng-template #connector let-step=\"step\" let-isLast=\"isLast\" let-index=\"index\">\n <div class=\"step-connector\" [class.only-one-step]=\"steps.length === 1\"\n [class]=\"'step-connector--' + (!inlineLabels ? 'absolute' : 'inline')\"\n *ngIf=\"steps.length === 1 || !isLast\"\n [style.visibility]=\"withoutConnectors || steps[step.index + 1]?.hide ? 'hidden' : 'unset'\"\n [class.connector-grand]=\"!inlineLabels && (index === 0 || index === steps.length - 2)\">\n <div class=\"progress\" [style.width]=\"getWidth(step)\"></div>\n </div>\n</ng-template>\n",
6611
+ changeDetection: i0.ChangeDetectionStrategy.Default,
6612
+ styles: [":host{font-family:\"Poppins\",sans-serif;display:flex;justify-content:center;height:100%;position:relative}:host .scroll-section{position:absolute;top:0;height:100%;width:108px;display:flex;align-items:center;z-index:10}:host .scroll-section i{font-size:24px;color:#2969b0;background:#f3f7ff;border-radius:24px}:host .scroll-section i:hover{background:#cde1fb;cursor:pointer}:host .scroll-section:first-child{left:0;padding-left:16px;background:linear-gradient(90deg,#ffffff 36.08%,rgba(255,255,255,0) 87.17%)}:host .scroll-section:first-child i{transform:rotate(180deg)}:host .scroll-section:last-child{right:0;padding-right:16px;background:linear-gradient(270deg,#ffffff 36.08%,rgba(255,255,255,0) 87.17%);justify-content:flex-end}:host .stepper{display:flex;align-items:center;height:100%;width:100%;overflow:auto;scroll-behavior:smooth}:host .stepper::-webkit-scrollbar{display:none}:host .stepper--disabled .step:hover{cursor:default}:host .stepper--disabled .step-point .ellipse{border-color:#bcbcbc}:host .stepper--disabled .step-point .pointer{color:#fff;background-color:#bcbcbc;cursor:default}:host .stepper--disabled .step-label{color:#bcbcbc}:host .stepper--disabled .step-connector{background-color:#bcbcbc}:host .stepper--disabled .step-connector .progress{background-color:#bcbcbc}:host .step{position:relative;display:flex;flex-direction:column;width:120px;align-items:center;flex-shrink:0;flex-grow:1}:host .step:hover{cursor:pointer}:host .step:not(.step-setup) .step-wrapper{width:100%}:host .step:not(.step-setup):first-child .step-wrapper,:host .step:not(.step-setup):first-child .step-point,:host .step:not(.step-setup):first-child .step-label,:host .step:not(.step-setup):first-child .step-progress{margin-left:8px}:host .step:not(.step-setup):first-child .only-one-step{left:0!important;margin-left:25px}:host .step-point{display:flex;justify-content:center;width:100%;height:28px;position:relative;align-items:center}:host .step-point .ellipse{width:28px;height:28px;position:absolute;border-radius:50px;border-color:#4646ce;border-style:solid;border-width:2px;background:white;display:flex;justify-content:center;align-items:center;z-index:2}:host .step-point .pointer{width:24px;height:24px;position:absolute;z-index:4;border-radius:20px;display:flex;align-items:center;justify-content:center;font-weight:bold;font-size:16px;line-height:1.4;color:#51566f;transition:box-shadow .2s ease-in-out}:host .step-point .pointer i{color:#fff;font-size:22px}:host .step-point .pointer.blue{background:#4646ce}:host .step-point .pointer.gray{background:#e5e6ea}:host .step-point .pointer.gray:hover{box-shadow:0 0 4px 2px #00000026}:host .step-point.completed :host .step-point.active{background:#4646ce}:host .step-point.active .ellipse{width:28px;height:28px}:host .step-point.active .pointer{width:20px;height:20px}:host .step-label{font-weight:normal;font-size:14px;line-height:22px;line-height:1.5;color:#6d6e6f;display:flex;justify-content:center;overflow:hidden;margin-top:8px}:host .step-label span{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}:host .step-label.active{font-weight:600;color:#333}:host .step-label:last-child{margin-bottom:23px}:host .step-progress{margin-top:3px;font-style:normal;font-weight:normal;font-size:12px;line-height:1.4;display:flex;justify-content:center}:host .step-connector{background-color:#e5e5e5;height:2px}:host .step-connector.connector-grand{width:calc(100% - 25px)}:host .step-connector.connector-grand.only-one-step{width:calc(100% - 50px)}:host .step-connector .progress{background-color:#4646ce;height:2px;width:0}:host .step-connector--absolute{position:absolute;top:calc(28px / 2);width:100%;left:calc(100% / 2 + 12px)}:host .step-connector--inline{width:50px;margin-left:32px;margin-right:32px}:host .step-setup{width:auto}:host .step-setup .step-wrapper{display:flex;flex-direction:row;align-items:center;width:auto}:host .step-setup+.step-setup{margin-left:0}:host .step-setup .step-progress{display:none}:host .step-setup .step-label{position:relative;transform:none;align-items:center;justify-content:start;margin:0 0 0 8px;font-size:16px}:host .step-setup .step-point{width:28px;height:28px}:host .step-setup .step-point .pointer i{font-size:22px}:host .step-setup .step-point .pointer .text{font-size:16px}::ng-deep .step-tooltip{max-width:250px;font-size:14px;line-height:22px;padding:10px 12px}::ng-deep .step-tooltip_name{font-weight:700;overflow:hidden;text-overflow:ellipsis}@media screen and (min-width: 1367px){.stepper .step-label{font-size:14px}}\n"]
6537
6613
  },] }
6538
6614
  ];
6539
- DrChatSuggestionsComponent.ctorParameters = function () { return []; };
6540
- DrChatSuggestionsComponent.propDecorators = {
6541
- values: [{ type: i0.Input }],
6542
- fullScreen: [{ type: i0.Input }],
6543
- buttonMode: [{ type: i0.Input }],
6544
- waitForReply: [{ type: i0.Input }],
6545
- suggestionSelect: [{ type: i0.Output }],
6546
- suggestionCardsList: [{ type: i0.ViewChild, args: ['suggestionCardsList',] }]
6615
+ StepperComponent.ctorParameters = function () { return []; };
6616
+ StepperComponent.propDecorators = {
6617
+ steps: [{ type: i0.Input }],
6618
+ currentStep: [{ type: i0.Input }],
6619
+ withoutConnectors: [{ type: i0.Input }],
6620
+ hiddenNames: [{ type: i0.Input }],
6621
+ inlineLabels: [{ type: i0.Input }],
6622
+ disabled: [{ type: i0.Input }],
6623
+ hiddenIndex: [{ type: i0.Input }],
6624
+ stepChange: [{ type: i0.Output }],
6625
+ stepper: [{ type: i0.ViewChild, args: ['stepper', { read: i0.ElementRef },] }]
6547
6626
  };
6548
6627
 
6549
- var DrChatComponent = /** @class */ (function () {
6550
- function DrChatComponent(cdr) {
6551
- this.cdr = cdr;
6552
- this.destroy$ = new rxjs.Subject();
6553
- this.showClearButton = true;
6554
- this.noMessagesPlaceholder = 'No messages yet.';
6555
- this._scrollBottom = true;
6556
- this.suggestions = [];
6557
- /**
6558
- * Parameter to check is send message function available
6559
- *
6560
- * @type {boolean}
6561
- */
6562
- this.waitForReply = false;
6563
- this.clear = new i0.EventEmitter();
6564
- this.close = new i0.EventEmitter();
6565
- this.suggestionSelect = new i0.EventEmitter();
6628
+ var DrStepperModule = /** @class */ (function () {
6629
+ function DrStepperModule() {
6566
6630
  }
6567
- Object.defineProperty(DrChatComponent.prototype, "contentUpdateSubject", {
6568
- set: function (value) {
6569
- var _this = this;
6570
- if (value) {
6571
- value.pipe(operators.takeUntil(this.destroy$)).subscribe(function () {
6572
- _this.updateView();
6573
- });
6574
- }
6575
- },
6576
- enumerable: false,
6577
- configurable: true
6578
- });
6579
- ;
6580
- Object.defineProperty(DrChatComponent.prototype, "scrollBottom", {
6581
- /**
6582
- * Scroll chat to the bottom of the list when a new message arrives
6583
- */
6584
- get: function () {
6585
- return this._scrollBottom;
6586
- },
6587
- set: function (value) {
6588
- this._scrollBottom = !!value;
6589
- },
6590
- enumerable: false,
6591
- configurable: true
6592
- });
6593
- Object.defineProperty(DrChatComponent.prototype, "messagesContainerWithScroll", {
6594
- get: function () {
6595
- return this.messagesContainer && this.messagesContainer.nativeElement.scrollHeight > this.messagesContainer.nativeElement.offsetHeight;
6596
- },
6597
- enumerable: false,
6598
- configurable: true
6599
- });
6600
- ;
6601
- DrChatComponent.prototype.ngAfterViewInit = function () {
6602
- var _this = this;
6603
- this.messages.changes.subscribe(function (messages) {
6604
- _this.messages = messages;
6605
- _this.updateView();
6606
- });
6607
- this.updateView();
6608
- };
6609
- DrChatComponent.prototype.updateView = function () {
6610
- if (this.scrollBottom) {
6611
- this.scrollListBottom();
6612
- }
6613
- };
6614
- DrChatComponent.prototype.scrollListBottom = function () {
6615
- var _this = this;
6616
- setTimeout(function () {
6617
- if (_this.messagesContainer) {
6618
- var scrollToOptions = {
6619
- top: _this.messagesContainer.nativeElement.scrollHeight,
6620
- };
6621
- if (!_this.reopen) {
6622
- scrollToOptions.behavior = 'smooth';
6623
- }
6624
- _this.messagesContainer.nativeElement.scrollTo(scrollToOptions);
6625
- _this.cdr.markForCheck();
6626
- }
6627
- });
6628
- };
6629
- DrChatComponent.prototype.ngOnDestroy = function () {
6630
- this.destroy$.next();
6631
- this.destroy$.complete();
6632
- };
6633
- DrChatComponent.prototype.onClearClick = function ($event) {
6634
- this.clear.emit($event);
6635
- if (this._chatSuggestions) {
6636
- this._chatSuggestions.clearHidden();
6637
- }
6638
- };
6639
- return DrChatComponent;
6631
+ return DrStepperModule;
6640
6632
  }());
6641
- DrChatComponent.decorators = [
6642
- { type: i0.Component, args: [{
6643
- selector: 'dr-chat',
6644
- template: "<div class=\"chat\" [class.chat--in-full-screen]=\"fullScreen\">\n <div class=\"chat__header\">\n <div class=\"chat__header__logo\"></div>\n\n <div class=\"chat__header__text\">\n <div class=\"chat__header__text__title\">{{ title }}</div>\n <div *ngIf=\"subtitle\" class=\"chat__header__text__subtitle\">{{ subtitle }}</div>\n </div>\n\n <dr-button *ngIf=\"showClearButton\"\n (click)=\"onClearClick($event)\"\n theme=\"icon\"\n icon=\"dr-icon-clear\"\n class=\"ml-auto\"\n drTooltip=\"Clear chat\">\n </dr-button>\n\n <dr-button *ngIf=\"!fullScreen\"\n (click)=\"close.emit($event)\"\n theme=\"icon\"\n icon=\"dr-icon-exit\"\n class=\"ml-4\"\n drTooltip=\"Close\">\n </dr-button>\n </div>\n\n <div *ngIf=\"!messages?.length\" class=\"chat__empty-state\">\n <span class=\"chat__empty-state__text\">{{ noMessagesPlaceholder }}</span>\n </div>\n\n <div *ngIf=\"messages?.length\" class=\"chat__messages\">\n <div #messagesContainer class=\"chat__messages__container\"\n [class.chat__messages__container--scroll]=\"messagesContainerWithScroll\">\n <ng-content select=\"dr-chat-message\"></ng-content>\n </div>\n </div>\n\n <dr-chat-suggestions *ngIf=\"suggestions?.length\"\n [values]=\"suggestions\"\n [fullScreen]=\"fullScreen\"\n [waitForReply]=\"waitForReply\"\n class=\"chat__suggestions\"\n [class.chat__suggestions--full-height]=\"fullScreen && !messages?.length\"\n [buttonMode]=\"!!messages?.length\"\n (suggestionSelect)=\"suggestionSelect.emit($event)\">\n </dr-chat-suggestions>\n\n <div class=\"form\">\n <ng-content select=\"dr-chat-form\"></ng-content>\n </div>\n</div>\n",
6645
- providers: [DrChatCustomMessageService],
6646
- styles: [":host{height:100%;width:100%;display:flex;flex-direction:column}.chat{position:relative;display:flex;flex-grow:1;flex-direction:column;height:100%;background-color:#fff;color:#4e566c;font-family:\"Poppins\",sans-serif;font-size:14px;font-weight:400;line-height:22px}.chat__header{display:flex;align-items:center;background-color:#f2f2ff;color:#25258c;padding:15px 24px;font-weight:400;font-size:20px;line-height:28px;box-shadow:0 1px 3px #0003;z-index:1}.chat__header__logo{display:flex;width:43px;height:38px;background:url(\"data:image/svg+xml,%3C%3Fxml version%3D%221.0%22 encoding%3D%22UTF-8%22%3F%3E%3Csvg id%3D%22Layer_1%22 data-name%3D%22Layer 1%22 xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22 xmlns%3Axlink%3D%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxlink%22 viewBox%3D%220 0 74 65%22%3E %3Cdefs%3E %3Cstyle%3E .cls-1%2C .cls-2%2C .cls-3 %7B fill%3A none%3B %7D .cls-4 %7B fill%3A url(%23linear-gradient)%3B %7D .cls-5 %7B fill%3A %234eb7df%3B %7D .cls-2 %7B stroke%3A %23a6a8aa%3B stroke-miterlimit%3A 10%3B stroke-width%3A .37px%3B %7D .cls-6 %7B fill%3A url(%23linear-gradient-3)%3B %7D .cls-7 %7B fill%3A url(%23linear-gradient-2)%3B %7D .cls-3 %7B clip-path%3A url(%23clippath)%3B %7D %3C%2Fstyle%3E %3CclipPath id%3D%22clippath%22%3E %3Crect class%3D%22cls-1%22 width%3D%2274%22 height%3D%2265%22%2F%3E %3C%2FclipPath%3E %3ClinearGradient id%3D%22linear-gradient%22 x1%3D%2224.26%22 y1%3D%22-3.79%22 x2%3D%2295.63%22 y2%3D%2288.82%22 gradientTransform%3D%22translate(0 65.89) scale(1 -1)%22 gradientUnits%3D%22userSpaceOnUse%22%3E %3Cstop offset%3D%220%22 stop-color%3D%22%237676ff%22%2F%3E %3Cstop offset%3D%22.18%22 stop-color%3D%22%235959ff%22%2F%3E %3Cstop offset%3D%22.35%22 stop-color%3D%22%235757e0%22%2F%3E %3Cstop offset%3D%22.61%22 stop-color%3D%22%234646ce%22%2F%3E %3Cstop offset%3D%22.84%22 stop-color%3D%22%234b4be4%22%2F%3E %3Cstop offset%3D%221%22 stop-color%3D%22%234444eb%22%2F%3E %3C%2FlinearGradient%3E %3ClinearGradient id%3D%22linear-gradient-2%22 x1%3D%2212.05%22 y1%3D%2277.06%22 x2%3D%2210.77%22 y2%3D%2213.85%22 gradientTransform%3D%22translate(0 65.89) scale(1 -1)%22 gradientUnits%3D%22userSpaceOnUse%22%3E %3Cstop offset%3D%22.45%22 stop-color%3D%22%232f92b8%22%2F%3E %3Cstop offset%3D%22.84%22 stop-color%3D%22%234eb7df%22%2F%3E %3Cstop offset%3D%221%22 stop-color%3D%22%234eb7df%22%2F%3E %3C%2FlinearGradient%3E %3ClinearGradient id%3D%22linear-gradient-3%22 x1%3D%2262.26%22 y1%3D%22-2.54%22 x2%3D%2261.76%22 y2%3D%2285.91%22 gradientTransform%3D%22translate(0 65.89) scale(1 -1)%22 gradientUnits%3D%22userSpaceOnUse%22%3E %3Cstop offset%3D%220%22 stop-color%3D%22%2336369b%22%2F%3E %3Cstop offset%3D%22.52%22 stop-color%3D%22%234848d0%22%2F%3E %3C%2FlinearGradient%3E %3C%2Fdefs%3E %3Cg class%3D%22cls-3%22%3E %3Cg%3E %3Cpath class%3D%22cls-4%22 d%3D%22m73.32%2C24.79v15.73c0%2C13.12-9.87%2C23.79-22%2C23.79h-21.32c-3.46-.06-6.25-3.11-6.25-6.87s2.79-6.81%2C6.25-6.87h21.32c5.13%2C0%2C9.29-4.51%2C9.29-10.05v-15.73c0-5.54-4.17-10.05-9.29-10.05h-7.46c3.51%2C0%2C6.35-3.08%2C6.35-6.88s-2.79-6.8-6.25-6.87h7.35c12.12%2C0%2C22%2C10.67%2C22%2C23.79h0Z%22%2F%3E %3Cpath class%3D%22cls-5%22 d%3D%22m50.26%2C7.82c0%2C3.8-2.9%2C6.93-6.41%2C6.93h-21.86c-5.13%2C0-9.29%2C4.51-9.29%2C10.05v15.73c0%2C5.54%2C4.17%2C10.05%2C9.29%2C10.05h8.01c-3.46.06-6.25%2C3.11-6.25%2C6.87s2.79%2C6.81%2C6.25%2C6.87h-8.01c-12.12%2C0-22-10.67-22-23.79v-15.73C0%2C11.68%2C9.87%2C1%2C21.99%2C1h21.97c3.46.06%2C6.3%2C3.06%2C6.3%2C6.82Z%22%2F%3E %3Cpath class%3D%22cls-2%22 d%3D%22m66.45%2C1h-.22.22%2C0Z%22%2F%3E %3Cpath class%3D%22cls-2%22 d%3D%22m36.05%2C50.58h-.22.22%2C0Z%22%2F%3E %3Cpath class%3D%22cls-7%22 d%3D%22m0%2C33.78v-2.76C0%2C12.9%2C13.62%2C14.48%2C13.62%2C14.48h8.38c-5.5.46-9.5%2C4.71-9.5%2C9.96l.02%2C15.8c0%2C5.54%2C4.44%2C10.59%2C9.48%2C10.59l-8-.5S0%2C51.88%2C0%2C33.77h0Z%22%2F%3E %3Cpath class%3D%22cls-6%22 d%3D%22m73%2C31.51v2.76c0%2C18.12-13.62%2C16.53-13.62%2C16.53h-7.99c5.61-.85%2C9.09-4.76%2C9.09-10.02l.02-16.33c0-5.54-4.46-10-9.5-10h8s13.99-1.05%2C13.99%2C17.07h0Z%22%2F%3E %3C%2Fg%3E %3C%2Fg%3E%3C%2Fsvg%3E\") no-repeat;background-size:100% 100%}.chat__header__text{display:flex;flex-direction:column;flex-grow:1;margin-left:20px}.chat__header__text__title{display:flex;align-items:center}.chat__header__text__title:after{content:\"BETA\";display:inline-flex;padding:2px 10px;background:#25258C;color:#f4f4f3;font-weight:600;font-size:10px;line-height:14px;border-radius:8px;margin-left:12px;font-family:\"Nunito Sans\",sans-serif}.chat__header__text__subtitle{font-size:14px;line-height:22px}.chat__header dr-button::ng-deep button:not(:hover){color:#25258c}.chat__empty-state{display:flex;justify-content:center}.chat__empty-state__text{padding:20px 0;font-family:Poppins,sans-serif;font-size:20px;font-weight:300;line-height:30px;text-align:center;max-width:440px;color:#4646ce}.chat__messages{display:flex;flex-grow:1;overflow-x:hidden;overflow-y:auto;height:100%;width:100%}.chat__messages__container{overflow-y:auto;overflow-x:hidden;display:flex;flex-shrink:0;flex-direction:column;width:100%;padding-bottom:1px}.chat__messages__container--scroll::ng-deep dr-chat-message{padding-right:16px}.chat__suggestions--full-height{flex-grow:1;height:1px;overflow:auto}.chat--in-full-screen .chat__header{padding-left:48px;padding-right:48px}.chat--in-full-screen .chat__empty-state__text{padding:77px 0;font-size:28px;line-height:46px;max-width:570px}.chat--in-full-screen .chat__messages::ng-deep dr-chat-message{justify-content:center}.chat--in-full-screen .chat__messages::ng-deep .message{max-width:919px}.chat--in-full-screen .chat__suggestions::ng-deep .chat-suggestions__items{padding-left:0;padding-right:0}.chat--in-full-screen .chat__suggestions::ng-deep .chat-suggestions__items__item{margin:0 0 26px;height:80px;width:310px;font-size:16px}.chat--in-full-screen .chat__suggestions::ng-deep .chat-suggestions__container{padding:0}\n"]
6633
+ DrStepperModule.decorators = [
6634
+ { type: i0.NgModule, args: [{
6635
+ declarations: [StepperComponent],
6636
+ imports: [
6637
+ common.CommonModule,
6638
+ DrTooltipModule
6639
+ ],
6640
+ exports: [StepperComponent]
6641
+ },] }
6642
+ ];
6643
+
6644
+ var DrDetailsListModule = /** @class */ (function () {
6645
+ function DrDetailsListModule() {
6646
+ }
6647
+ return DrDetailsListModule;
6648
+ }());
6649
+ DrDetailsListModule.decorators = [
6650
+ { type: i0.NgModule, args: [{
6651
+ imports: [
6652
+ common.CommonModule,
6653
+ ],
6654
+ exports: [DrDetailsListComponent],
6655
+ providers: [],
6656
+ declarations: [DrDetailsListComponent],
6657
+ },] }
6658
+ ];
6659
+
6660
+ var ɵ0$1 = {}, ɵ1 = {};
6661
+ var DrDialogModule = /** @class */ (function () {
6662
+ function DrDialogModule() {
6663
+ }
6664
+ return DrDialogModule;
6665
+ }());
6666
+ DrDialogModule.decorators = [
6667
+ { type: i0.NgModule, args: [{
6668
+ declarations: [DialogWrapperComponent, DialogModalWrapperComponent],
6669
+ imports: [
6670
+ common.CommonModule,
6671
+ i1$1.MatDialogModule,
6672
+ DrInputsModule,
6673
+ forms.ReactiveFormsModule,
6674
+ DrTooltipModule,
6675
+ DrDetailsListModule
6676
+ ],
6677
+ exports: [DialogWrapperComponent, DialogModalWrapperComponent],
6678
+ providers: [
6679
+ { provide: i1$1.MatDialogRef, useValue: ɵ0$1 },
6680
+ { provide: i1$1.MAT_DIALOG_DATA, useValue: ɵ1 },
6681
+ DialogService
6682
+ ]
6647
6683
  },] }
6648
6684
  ];
6649
- DrChatComponent.ctorParameters = function () { return [
6650
- { type: i0.ChangeDetectorRef }
6651
- ]; };
6652
- DrChatComponent.propDecorators = {
6653
- fullScreen: [{ type: i0.Input }],
6654
- title: [{ type: i0.Input }],
6655
- subtitle: [{ type: i0.Input }],
6656
- showClearButton: [{ type: i0.Input }],
6657
- noMessagesPlaceholder: [{ type: i0.Input }],
6658
- contentUpdateSubject: [{ type: i0.Input }],
6659
- scrollBottom: [{ type: i0.Input }],
6660
- suggestions: [{ type: i0.Input }],
6661
- reopen: [{ type: i0.Input }],
6662
- waitForReply: [{ type: i0.Input }],
6663
- messagesContainer: [{ type: i0.ViewChild, args: ['messagesContainer',] }],
6664
- messages: [{ type: i0.ContentChildren, args: [DrChatMessageComponent,] }],
6665
- chatForm: [{ type: i0.ContentChild, args: [DrChatFormComponent,] }],
6666
- clear: [{ type: i0.Output }],
6667
- close: [{ type: i0.Output }],
6668
- suggestionSelect: [{ type: i0.Output }],
6669
- _chatSuggestions: [{ type: i0.ViewChild, args: [DrChatSuggestionsComponent,] }]
6670
- };
6671
6685
 
6672
6686
  /**
6673
6687
  * Chat text message component.
@@ -7116,6 +7130,7 @@
7116
7130
  exports.DrAvatarPipe = DrAvatarPipe;
7117
7131
  exports.DrBadgeStatusModule = DrBadgeStatusModule;
7118
7132
  exports.DrButtonComponent = DrButtonComponent;
7133
+ exports.DrChatComponent = DrChatComponent;
7119
7134
  exports.DrChatModule = DrChatModule;
7120
7135
  exports.DrDetailsListComponent = DrDetailsListComponent;
7121
7136
  exports.DrDetailsListModule = DrDetailsListModule;
@@ -7170,34 +7185,33 @@
7170
7185
  exports.YearTagComponent = YearTagComponent;
7171
7186
  exports["ɵa"] = components$2;
7172
7187
  exports["ɵb"] = POPUP_ANIMATION;
7173
- exports["ɵba"] = DrChatCustomMessageDirective;
7174
- exports["ɵbb"] = DrScenarioConfigurationComponent;
7175
- exports["ɵbc"] = DrScenarioTagConfigurationComponent;
7176
- exports["ɵbd"] = DrBadgeStatusComponent;
7177
- exports["ɵc"] = DrDatePickerComponent;
7178
- exports["ɵd"] = DrDatePickerService;
7179
- exports["ɵe"] = DrDatePickerWithTimeframeComponent;
7180
- exports["ɵf"] = DrDatePickerFormatDirective;
7181
- exports["ɵg"] = DrDatePickerCustomHeaderComponent;
7182
- exports["ɵh"] = DrShowTimeframePipe;
7183
- exports["ɵi"] = DrSelectAddItemComponent;
7184
- exports["ɵj"] = TooltipInfoComponent;
7185
- exports["ɵk"] = TooltipInfoSimpleComponent;
7186
- exports["ɵl"] = TooltipNoBodyComponent;
7187
- exports["ɵm"] = TooltipProcessDefaultComponent;
7188
- exports["ɵn"] = DrDynamicTagModule;
7189
- exports["ɵo"] = DrDynamicTagComponent;
7190
- exports["ɵp"] = StepperComponent;
7191
- exports["ɵq"] = DialogWrapperComponent;
7192
- exports["ɵr"] = DialogModalWrapperComponent;
7193
- exports["ɵs"] = DrChatComponent;
7194
- exports["ɵt"] = DrChatCustomMessageService;
7195
- exports["ɵu"] = DrChatMessageComponent;
7196
- exports["ɵv"] = DrChatFormComponent;
7197
- exports["ɵw"] = DrChatSuggestionsComponent;
7198
- exports["ɵx"] = DrChatMessageTextComponent;
7199
- exports["ɵy"] = DrChatMessageFileComponent;
7200
- exports["ɵz"] = DrDotFlashingComponent;
7188
+ exports["ɵba"] = DrScenarioConfigurationComponent;
7189
+ exports["ɵbb"] = DrScenarioTagConfigurationComponent;
7190
+ exports["ɵbc"] = DrBadgeStatusComponent;
7191
+ exports["ɵc"] = DrChatCustomMessageService;
7192
+ exports["ɵd"] = DrChatMessageComponent;
7193
+ exports["ɵe"] = DrChatFormComponent;
7194
+ exports["ɵf"] = DrChatSuggestionsComponent;
7195
+ exports["ɵg"] = DrDatePickerComponent;
7196
+ exports["ɵh"] = DrDatePickerService;
7197
+ exports["ɵi"] = DrDatePickerWithTimeframeComponent;
7198
+ exports["ɵj"] = DrDatePickerFormatDirective;
7199
+ exports["ɵk"] = DrDatePickerCustomHeaderComponent;
7200
+ exports["ɵl"] = DrShowTimeframePipe;
7201
+ exports["ɵm"] = DrSelectAddItemComponent;
7202
+ exports["ɵn"] = TooltipInfoComponent;
7203
+ exports["ɵo"] = TooltipInfoSimpleComponent;
7204
+ exports["ɵp"] = TooltipNoBodyComponent;
7205
+ exports["ɵq"] = TooltipProcessDefaultComponent;
7206
+ exports["ɵr"] = DrDynamicTagModule;
7207
+ exports["ɵs"] = DrDynamicTagComponent;
7208
+ exports["ɵt"] = StepperComponent;
7209
+ exports["ɵu"] = DialogWrapperComponent;
7210
+ exports["ɵv"] = DialogModalWrapperComponent;
7211
+ exports["ɵw"] = DrChatMessageTextComponent;
7212
+ exports["ɵx"] = DrChatMessageFileComponent;
7213
+ exports["ɵy"] = DrDotFlashingComponent;
7214
+ exports["ɵz"] = DrChatCustomMessageDirective;
7201
7215
 
7202
7216
  Object.defineProperty(exports, '__esModule', { value: true });
7203
7217