ngx-t-forms 2.0.7 → 2.0.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (125) hide show
  1. package/fesm2022/{ngx-t-forms-api-value-access-rules.component-Cp0BeYD7.mjs → ngx-t-forms-api-value-access-rules.component-DjZDnTHz.mjs} +11 -11
  2. package/fesm2022/{ngx-t-forms-api-value-access-rules.component-Cp0BeYD7.mjs.map → ngx-t-forms-api-value-access-rules.component-DjZDnTHz.mjs.map} +1 -1
  3. package/fesm2022/ngx-t-forms-api-value-access-rules.component-Zg1ddSDb.mjs +813 -0
  4. package/fesm2022/ngx-t-forms-api-value-access-rules.component-Zg1ddSDb.mjs.map +1 -0
  5. package/fesm2022/{ngx-t-forms-calculated-field-rules.component-C1v-xiGd.mjs → ngx-t-forms-calculated-field-rules.component-E3l7DQo7.mjs} +11 -11
  6. package/fesm2022/{ngx-t-forms-calculated-field-rules.component-C1v-xiGd.mjs.map → ngx-t-forms-calculated-field-rules.component-E3l7DQo7.mjs.map} +1 -1
  7. package/fesm2022/ngx-t-forms-calculated-field-rules.component-ZepKycLR.mjs +532 -0
  8. package/fesm2022/ngx-t-forms-calculated-field-rules.component-ZepKycLR.mjs.map +1 -0
  9. package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-DLnB3R7t.mjs +297 -0
  10. package/fesm2022/ngx-t-forms-config-mscoa-additional-inputs.component-DLnB3R7t.mjs.map +1 -0
  11. package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-jgXTh0do.mjs → ngx-t-forms-config-mscoa-additional-inputs.component-sOC54w4T.mjs} +9 -9
  12. package/fesm2022/{ngx-t-forms-config-mscoa-additional-inputs.component-jgXTh0do.mjs.map → ngx-t-forms-config-mscoa-additional-inputs.component-sOC54w4T.mjs.map} +1 -1
  13. package/fesm2022/ngx-t-forms-form-input-selector.component-BjwzDiCY.mjs +187 -0
  14. package/fesm2022/ngx-t-forms-form-input-selector.component-BjwzDiCY.mjs.map +1 -0
  15. package/fesm2022/{ngx-t-forms-form-input-selector.component-DbKhNmVM.mjs → ngx-t-forms-form-input-selector.component-CB03sPjA.mjs} +6 -6
  16. package/fesm2022/{ngx-t-forms-form-input-selector.component-DbKhNmVM.mjs.map → ngx-t-forms-form-input-selector.component-CB03sPjA.mjs.map} +1 -1
  17. package/fesm2022/{ngx-t-forms-form-json-view.component-DSnLKnfH.mjs → ngx-t-forms-form-json-view.component-C1AZujJH.mjs} +2 -2
  18. package/fesm2022/{ngx-t-forms-form-json-view.component-DSnLKnfH.mjs.map → ngx-t-forms-form-json-view.component-C1AZujJH.mjs.map} +1 -1
  19. package/fesm2022/ngx-t-forms-form-json-view.component-CqtTYCRH.mjs +28 -0
  20. package/fesm2022/ngx-t-forms-form-json-view.component-CqtTYCRH.mjs.map +1 -0
  21. package/fesm2022/ngx-t-forms-form-section-stepper.component-Ba5WCLzp.mjs +673 -0
  22. package/fesm2022/ngx-t-forms-form-section-stepper.component-Ba5WCLzp.mjs.map +1 -0
  23. package/fesm2022/ngx-t-forms-form-section-stepper.component-C_dciQhe.mjs +225 -0
  24. package/fesm2022/ngx-t-forms-form-section-stepper.component-C_dciQhe.mjs.map +1 -0
  25. package/fesm2022/{ngx-t-forms-forms-builder-menu.component-DQ8JYw6g.mjs → ngx-t-forms-forms-builder-menu.component-CPIcPREp.mjs} +13 -13
  26. package/fesm2022/{ngx-t-forms-forms-builder-menu.component-DQ8JYw6g.mjs.map → ngx-t-forms-forms-builder-menu.component-CPIcPREp.mjs.map} +1 -1
  27. package/fesm2022/ngx-t-forms-forms-builder-menu.component-DbxEBvpt.mjs +735 -0
  28. package/fesm2022/ngx-t-forms-forms-builder-menu.component-DbxEBvpt.mjs.map +1 -0
  29. package/fesm2022/ngx-t-forms-input-editor.component-BnsC-jsN.mjs +445 -0
  30. package/fesm2022/ngx-t-forms-input-editor.component-BnsC-jsN.mjs.map +1 -0
  31. package/fesm2022/{ngx-t-forms-input-editor.component-Gi9MgyHB.mjs → ngx-t-forms-input-editor.component-__grERM8.mjs} +7 -10
  32. package/fesm2022/ngx-t-forms-input-editor.component-__grERM8.mjs.map +1 -0
  33. package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-DS6s98ZX.mjs +111 -0
  34. package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-DS6s98ZX.mjs.map +1 -0
  35. package/fesm2022/{ngx-t-forms-mat-chip-list-editor.component-C2jw_2gf.mjs → ngx-t-forms-mat-chip-list-editor.component-DcdHYqhN.mjs} +2 -3
  36. package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-DcdHYqhN.mjs.map +1 -0
  37. package/fesm2022/{ngx-t-forms-mat-slider-editor.component-D_IMC63r.mjs → ngx-t-forms-mat-slider-editor.component-C9rintm4.mjs} +2 -2
  38. package/fesm2022/{ngx-t-forms-mat-slider-editor.component-D_IMC63r.mjs.map → ngx-t-forms-mat-slider-editor.component-C9rintm4.mjs.map} +1 -1
  39. package/fesm2022/ngx-t-forms-mat-slider-editor.component-ChiiJYK2.mjs +130 -0
  40. package/fesm2022/ngx-t-forms-mat-slider-editor.component-ChiiJYK2.mjs.map +1 -0
  41. package/fesm2022/{ngx-t-forms-mat-slider-toggle-editor.component-DeKGDDuU.mjs → ngx-t-forms-mat-slider-toggle-editor.component-CItK6kXf.mjs} +2 -2
  42. package/fesm2022/{ngx-t-forms-mat-slider-toggle-editor.component-DeKGDDuU.mjs.map → ngx-t-forms-mat-slider-toggle-editor.component-CItK6kXf.mjs.map} +1 -1
  43. package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-DFcLzkSF.mjs +171 -0
  44. package/fesm2022/ngx-t-forms-mat-slider-toggle-editor.component-DFcLzkSF.mjs.map +1 -0
  45. package/fesm2022/ngx-t-forms-missing-form-configs.component-DNkGCH0e.mjs +104 -0
  46. package/fesm2022/ngx-t-forms-missing-form-configs.component-DNkGCH0e.mjs.map +1 -0
  47. package/fesm2022/{ngx-t-forms-missing-form-configs.component-BvsopeCg.mjs → ngx-t-forms-missing-form-configs.component-Da3SdUn6.mjs} +4 -4
  48. package/fesm2022/{ngx-t-forms-missing-form-configs.component-BvsopeCg.mjs.map → ngx-t-forms-missing-form-configs.component-Da3SdUn6.mjs.map} +1 -1
  49. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-4hrEpLk3.mjs +258 -0
  50. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-4hrEpLk3.mjs.map +1 -0
  51. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-CrHAIRAw.mjs +455 -0
  52. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-CrHAIRAw.mjs.map +1 -0
  53. package/fesm2022/{ngx-t-forms-ngx-t-forms-DtoFU6uQ.mjs → ngx-t-forms-ngx-t-forms-1Roar4qK.mjs} +710 -1294
  54. package/fesm2022/ngx-t-forms-ngx-t-forms-1Roar4qK.mjs.map +1 -0
  55. package/fesm2022/ngx-t-forms-ngx-t-forms-DaAFB-HX.mjs +14694 -0
  56. package/fesm2022/ngx-t-forms-ngx-t-forms-DaAFB-HX.mjs.map +1 -0
  57. package/fesm2022/{ngx-t-forms-pipeline-generator.component-IwmDgCk9.mjs → ngx-t-forms-pipeline-generator.component-BQDykLNH.mjs} +14 -14
  58. package/fesm2022/{ngx-t-forms-pipeline-generator.component-IwmDgCk9.mjs.map → ngx-t-forms-pipeline-generator.component-BQDykLNH.mjs.map} +1 -1
  59. package/fesm2022/ngx-t-forms-pipeline-generator.component-U0d8jQKW.mjs +1362 -0
  60. package/fesm2022/ngx-t-forms-pipeline-generator.component-U0d8jQKW.mjs.map +1 -0
  61. package/fesm2022/{ngx-t-forms-required-inputs.component-DdNLYKY6.mjs → ngx-t-forms-required-inputs.component-BGK3DNu0.mjs} +10 -10
  62. package/fesm2022/{ngx-t-forms-required-inputs.component-DdNLYKY6.mjs.map → ngx-t-forms-required-inputs.component-BGK3DNu0.mjs.map} +1 -1
  63. package/fesm2022/ngx-t-forms-required-inputs.component-S3cbA-zG.mjs +383 -0
  64. package/fesm2022/ngx-t-forms-required-inputs.component-S3cbA-zG.mjs.map +1 -0
  65. package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-DH5GpWKn.mjs → ngx-t-forms-rest-api-call-setup.component-CCaRUSVQ.mjs} +4 -4
  66. package/fesm2022/{ngx-t-forms-rest-api-call-setup.component-DH5GpWKn.mjs.map → ngx-t-forms-rest-api-call-setup.component-CCaRUSVQ.mjs.map} +1 -1
  67. package/fesm2022/ngx-t-forms-rest-api-call-setup.component-DDg4fCFx.mjs +457 -0
  68. package/fesm2022/ngx-t-forms-rest-api-call-setup.component-DDg4fCFx.mjs.map +1 -0
  69. package/fesm2022/{ngx-t-forms-section-report.component-BAddUET-.mjs → ngx-t-forms-section-report.component-C8Ja_G_3.mjs} +5 -5
  70. package/fesm2022/{ngx-t-forms-section-report.component-BAddUET-.mjs.map → ngx-t-forms-section-report.component-C8Ja_G_3.mjs.map} +1 -1
  71. package/fesm2022/ngx-t-forms-section-report.component-C_h0KIR4.mjs +314 -0
  72. package/fesm2022/ngx-t-forms-section-report.component-C_h0KIR4.mjs.map +1 -0
  73. package/fesm2022/ngx-t-forms-selection-options-editor.component-CllhwZ5Y.mjs +231 -0
  74. package/fesm2022/ngx-t-forms-selection-options-editor.component-CllhwZ5Y.mjs.map +1 -0
  75. package/fesm2022/{ngx-t-forms-selection-options-editor.component-CQh-InJ6.mjs → ngx-t-forms-selection-options-editor.component-cYkn1O48.mjs} +6 -6
  76. package/fesm2022/{ngx-t-forms-selection-options-editor.component-CQh-InJ6.mjs.map → ngx-t-forms-selection-options-editor.component-cYkn1O48.mjs.map} +1 -1
  77. package/fesm2022/ngx-t-forms-validators-config.component-BPJZRtjT.mjs +434 -0
  78. package/fesm2022/ngx-t-forms-validators-config.component-BPJZRtjT.mjs.map +1 -0
  79. package/fesm2022/{ngx-t-forms-validators-config.component-SyL_Vln8.mjs → ngx-t-forms-validators-config.component-CGXCCl45.mjs} +8 -8
  80. package/fesm2022/{ngx-t-forms-validators-config.component-SyL_Vln8.mjs.map → ngx-t-forms-validators-config.component-CGXCCl45.mjs.map} +1 -1
  81. package/fesm2022/ngx-t-forms.mjs +1 -1
  82. package/lib/components/form-builder/elements/form-section-stepper/form-section-stepper.component.d.ts +2 -0
  83. package/lib/components/form-builder/elements/form-submissions-config/form-submissions-config.component.d.ts +1 -1
  84. package/lib/components/form-builder/elements/input-element-editor/input-element-editor.component.d.ts +2 -2
  85. package/lib/components/forms/forms.component.d.ts +1 -1
  86. package/lib/components/forms/store/Form-actions-formBuilder.d.ts +1 -0
  87. package/lib/components/forms/store/Form-selectors-FormBuilder.d.ts +1 -1
  88. package/lib/components/forms/store/forms-store.service.d.ts +2 -1
  89. package/lib/components/index.d.ts +2 -1
  90. package/lib/components/t-dynamic-data-edit/elements/mscoa-segment-config/mscoa-segment-config.component.d.ts +5 -9
  91. package/lib/components/t-form-input/elements/mscoa-form-input/elements/account-value/account-value.component.d.ts +3 -3
  92. package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-chart/mscoa-chart.component.d.ts +67 -52
  93. package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-computation/mscoa-computation.component.d.ts +10 -10
  94. package/lib/components/t-form-input/elements/mscoa-form-input/elements/mscoa-reactive-form-field/mscoa-reactive-form-field.component.d.ts +8 -6
  95. package/lib/components/t-form-input/elements/mscoa-form-input/elements/scoa-account-table/scoa-account-table.component.d.ts +8 -8
  96. package/lib/components/t-form-input/elements/mscoa-form-input/elements/scoa-input/scoa-input.component.d.ts +1 -1
  97. package/lib/components/t-form-input/elements/mscoa-form-input/mscoa-form-input.component.d.ts +4 -3
  98. package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-actions.d.ts +5 -5
  99. package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-component-store.service.d.ts +27 -31
  100. package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-effects.d.ts +2 -2
  101. package/lib/components/t-form-input/elements/mscoa-form-input/store/mscoa-selectors.d.ts +20 -24
  102. package/lib/components/t-form-input/elements/multiple-input-input-element/core/multiple-input-table-edit/multiple-input-table-edit.component.d.ts +1 -1
  103. package/lib/components/t-form-input/elements/select-input-element/elements/select-input/select-input.component.d.ts +20 -0
  104. package/lib/components/t-form-input/elements/select-input-element/select-input-element.component.d.ts +0 -3
  105. package/lib/components/t-form-input/t-form-input.component.d.ts +3 -2
  106. package/lib/components/user-form-stepper/user-form-stepper.component.d.ts +5 -0
  107. package/lib/components/workflow-builder/store/workflow-builder-store.service.d.ts +18 -0
  108. package/lib/components/workflow-builder/store/workflowEditorActions.d.ts +4 -0
  109. package/lib/components/workflow-builder/store/workflowEditorEffects.d.ts +2 -0
  110. package/lib/components/workflow-builder/store/workflowEditorSelectors.d.ts +2 -0
  111. package/lib/components/workflow-builder/workflow-builder.component.d.ts +12 -0
  112. package/lib/services/core/t-form-builder/functions/addScoaExtensionInput.d.ts +2 -0
  113. package/lib/services/core/t-form-tower-controller/form-tower-controller.service.d.ts +2 -0
  114. package/lib/services/core/t-form-tower-controller/functions/allFormInputs.d.ts +2 -3
  115. package/lib/services/core/t-form-tower-controller/functions/getAllFunctionTypes.d.ts +2 -0
  116. package/lib/shared/functions/textIconsForUserHints.d.ts +2 -1
  117. package/package.json +3 -2
  118. package/fesm2022/ngx-t-forms-form-section-stepper.component-hnOcnZGc.mjs +0 -220
  119. package/fesm2022/ngx-t-forms-form-section-stepper.component-hnOcnZGc.mjs.map +0 -1
  120. package/fesm2022/ngx-t-forms-input-editor.component-Gi9MgyHB.mjs.map +0 -1
  121. package/fesm2022/ngx-t-forms-mat-chip-list-editor.component-C2jw_2gf.mjs.map +0 -1
  122. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-D_IIYPud.mjs +0 -230
  123. package/fesm2022/ngx-t-forms-mscoa-segment-config.component-D_IIYPud.mjs.map +0 -1
  124. package/fesm2022/ngx-t-forms-ngx-t-forms-DtoFU6uQ.mjs.map +0 -1
  125. package/testForm.d.ts +0 -797
@@ -0,0 +1,1362 @@
1
+ import * as i2 from '@angular/common';
2
+ import { CommonModule } from '@angular/common';
3
+ import * as i0 from '@angular/core';
4
+ import { EventEmitter, Component, Output, Input, inject, Injectable, ElementRef, Optional, Self, ViewChild, HostBinding } from '@angular/core';
5
+ import * as i1 from '@angular/forms';
6
+ import { Validators, FormsModule, ReactiveFormsModule } from '@angular/forms';
7
+ import { Subscription, debounceTime, BehaviorSubject, switchMap, map, take, catchError, finalize, throwError, tap, combineLatest, filter, Subject, takeUntil, distinctUntilChanged } from 'rxjs';
8
+ import PipelineBuilder from 'db-aggregation-pipeline-builder';
9
+ import { M as MatModulesModule, N as NGX_T_FORMS_CONFIG_TOKEN, b as TDynamicDataViewComponent, D as DaysAgoPipe } from './ngx-t-forms-ngx-t-forms-DaAFB-HX.mjs';
10
+ import * as i6 from '@angular/material/icon';
11
+ import * as i3 from '@angular/material/core';
12
+ import * as i2$1 from '@angular/material/button';
13
+ import * as i3$1 from '@angular/material/card';
14
+ import * as i4 from '@angular/material/divider';
15
+ import * as i3$2 from '@angular/material/form-field';
16
+ import { MatFormFieldControl } from '@angular/material/form-field';
17
+ import * as i7 from '@angular/material/select';
18
+ import * as i8 from '@angular/material/tooltip';
19
+ import * as i4$1 from '@angular/material/chips';
20
+ import * as i6$1 from '@angular/material/list';
21
+ import * as i7$1 from '@angular/material/progress-spinner';
22
+ import * as i9 from '@angular/material/toolbar';
23
+ import { HttpClient } from '@angular/common/http';
24
+ import * as i5 from '@angular/material/expansion';
25
+
26
+ function JsonEditorComponent_div_1_Template(rf, ctx) { if (rf & 1) {
27
+ i0.ɵɵelementStart(0, "div", 5)(1, "mat-icon", 6);
28
+ i0.ɵɵtext(2, "info");
29
+ i0.ɵɵelementEnd();
30
+ i0.ɵɵelementStart(3, "span");
31
+ i0.ɵɵtext(4, " Paste or type JSON below. The editor will auto-beautify the text.");
32
+ i0.ɵɵelementEnd()();
33
+ } }
34
+ function JsonEditorComponent_div_2_Template(rf, ctx) { if (rf & 1) {
35
+ i0.ɵɵelementStart(0, "div", 7)(1, "span");
36
+ i0.ɵɵtext(2);
37
+ i0.ɵɵelementEnd()();
38
+ } if (rf & 2) {
39
+ const ctx_r0 = i0.ɵɵnextContext();
40
+ i0.ɵɵadvance(2);
41
+ i0.ɵɵtextInterpolate1(" ", ctx_r0.errorMessage, "");
42
+ } }
43
+ class JsonEditorComponent {
44
+ constructor(fb) {
45
+ this.fb = fb;
46
+ this.subscriptions = new Subscription();
47
+ this.valueChange = new EventEmitter();
48
+ this.jsonText = ''; // Placeholder for the JSON text
49
+ this.errorMessage = null;
50
+ this.jsonForm = this.fb.group({
51
+ jsonText: ['', Validators.required]
52
+ });
53
+ this.init();
54
+ }
55
+ ngOnDestroy() {
56
+ this.subscriptions.unsubscribe();
57
+ }
58
+ ngOnChanges(changes) {
59
+ if (changes['value'] && changes['value'].currentValue !== this._value) {
60
+ this._value = changes['value'].currentValue;
61
+ this.parseAndBeautifyJson(this._value, true);
62
+ }
63
+ }
64
+ init() {
65
+ this.subscriptions.add(this.jsonForm.get('jsonText').valueChanges
66
+ .pipe(debounceTime(1000))
67
+ .subscribe(value => {
68
+ this.parseAndBeautifyJson(value);
69
+ }));
70
+ }
71
+ parseAndBeautifyJson(value, hardSet) {
72
+ try {
73
+ // Attempt to parse the JSON
74
+ const parsedJson = typeof value === 'object' && value !== null ? value : JSON.parse(value);
75
+ // If valid, beautify the JSON
76
+ const beautifiedJson = JSON.stringify(parsedJson, null, 4);
77
+ // Update form control value with beautified JSON
78
+ const form = this.jsonForm.get('jsonText');
79
+ if (!form) {
80
+ this.errorMessage = 'Form control not found.';
81
+ return;
82
+ }
83
+ // Set beautified JSON without emitting another change event
84
+ form.setValue(beautifiedJson, { emitEvent: false });
85
+ this.errorMessage = null;
86
+ this.valueChange.emit({ value: parsedJson, valid: true });
87
+ }
88
+ catch (error) {
89
+ if (error instanceof SyntaxError) {
90
+ // Extract the position of the error from the error message
91
+ const errorMessage = this.getDetailedJsonError(value, error.message);
92
+ this.errorMessage = `JSON Syntax Error: ${errorMessage}`;
93
+ }
94
+ else {
95
+ this.errorMessage = 'Unexpected error occurred while parsing JSON.';
96
+ }
97
+ if (hardSet) {
98
+ console.log('hardset', value);
99
+ this.jsonForm.get('jsonText')?.setValue(value, { emitEvent: false });
100
+ }
101
+ this.valueChange.emit({ value: value, valid: false });
102
+ }
103
+ }
104
+ // Function to give detailed JSON error information
105
+ getDetailedJsonError(value, message) {
106
+ const positionMatch = message.match(/position (\d+)/);
107
+ if (!!positionMatch?.[1]) {
108
+ const position = parseInt(positionMatch[1], 10);
109
+ const excerpt = this.getErrorExcerpt(value, position);
110
+ return `at position ${position}: near "${excerpt}". Check for missing commas, brackets, or quotes.`;
111
+ }
112
+ return message;
113
+ }
114
+ // Helper function to extract a portion of the string around the error position
115
+ getErrorExcerpt(value, position, excerptLength = 20) {
116
+ const start = Math.max(0, position - excerptLength);
117
+ const end = Math.min(value.length, position + excerptLength);
118
+ return value.substring(start, end);
119
+ }
120
+ static { this.ɵfac = function JsonEditorComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || JsonEditorComponent)(i0.ɵɵdirectiveInject(i1.FormBuilder)); }; }
121
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: JsonEditorComponent, selectors: [["app-json-editor"]], inputs: { value: "value" }, outputs: { valueChange: "valueChange" }, features: [i0.ɵɵNgOnChangesFeature], decls: 5, vars: 5, consts: [[1, "json-editor-container"], ["style", "margin-top: 16px;", "class", "tree-instructions", 4, "ngIf"], ["style", "", "class", "tree-instructions json-error ", 4, "ngIf"], [3, "formGroup"], ["formControlName", "jsonText", "rows", "15", "placeholder", "Enter your JSON here...", 1, "json-textarea"], [1, "tree-instructions", 2, "margin-top", "16px"], ["color", "primary", 1, "info-icon"], [1, "tree-instructions", "json-error"]], template: function JsonEditorComponent_Template(rf, ctx) { if (rf & 1) {
122
+ i0.ɵɵelementStart(0, "div", 0);
123
+ i0.ɵɵtemplate(1, JsonEditorComponent_div_1_Template, 5, 0, "div", 1)(2, JsonEditorComponent_div_2_Template, 3, 1, "div", 2);
124
+ i0.ɵɵelementStart(3, "form", 3);
125
+ i0.ɵɵelement(4, "textarea", 4);
126
+ i0.ɵɵelementEnd()();
127
+ } if (rf & 2) {
128
+ i0.ɵɵadvance();
129
+ i0.ɵɵproperty("ngIf", ctx.jsonForm.invalid);
130
+ i0.ɵɵadvance();
131
+ i0.ɵɵproperty("ngIf", ctx.errorMessage);
132
+ i0.ɵɵadvance();
133
+ i0.ɵɵproperty("formGroup", ctx.jsonForm);
134
+ i0.ɵɵadvance();
135
+ i0.ɵɵclassProp("error-message", ctx.errorMessage);
136
+ } }, dependencies: [CommonModule, i2.NgIf, MatModulesModule, i6.MatIcon, FormsModule, i1.ɵNgNoValidate, i1.DefaultValueAccessor, i1.NgControlStatus, i1.NgControlStatusGroup, ReactiveFormsModule, i1.FormGroupDirective, i1.FormControlName], styles: [".json-editor-container[_ngcontent-%COMP%]{max-width:800px;margin:0 auto;border-radius:5px}.json-editor-container[_ngcontent-%COMP%] h1[_ngcontent-%COMP%]{font-size:24px;color:#333}.json-editor-container[_ngcontent-%COMP%] .lead[_ngcontent-%COMP%]{font-size:.9 rem;margin-bottom:10px;padding-left:16px}.json-editor-container[_ngcontent-%COMP%] .json-textarea[_ngcontent-%COMP%]{width:calc(100% - 24px);padding:12px;font-size:14px;color:#333;background-color:#fff;border:1px solid #ccc;border-radius:5px;font-family:Courier New,Courier,monospace}.json-editor-container[_ngcontent-%COMP%] .json-textarea[_ngcontent-%COMP%]:focus{outline:none;border-color:var(--ion-color-primary)}.error-message[_ngcontent-%COMP%]{border:solid 1px #e74c3c!important}.tree-instructions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:12px;border-radius:4px;margin-bottom:0;background:azure}.json-error[_ngcontent-%COMP%]{background:inherit;color:#e74c3c;margin-bottom:4px}.info-icon[_ngcontent-%COMP%]{width:38px}"] }); }
137
+ }
138
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(JsonEditorComponent, [{
139
+ type: Component,
140
+ args: [{ selector: 'app-json-editor', standalone: true, imports: [
141
+ CommonModule,
142
+ MatModulesModule,
143
+ FormsModule,
144
+ ReactiveFormsModule
145
+ ], template: "<div class=\"json-editor-container\">\n <div *ngIf=\"jsonForm.invalid\" \n style=\"margin-top: 16px;\"\n class=\"tree-instructions\">\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\n <span> Paste or type JSON below. The editor will auto-beautify the text.</span>\n </div>\n\n\n \n <!-- Error message if JSON is invalid -->\n <div *ngIf=\"errorMessage\" \n \n style=\"\" class=\"tree-instructions json-error \">\n <span> {{errorMessage}}</span>\n </div>\n \n <form [formGroup]=\"jsonForm\">\n <textarea\n formControlName=\"jsonText\"\n class=\"json-textarea\"\n [class.error-message]=\"errorMessage\"\n rows=\"15\"\n placeholder=\"Enter your JSON here...\"></textarea>\n </form>\n <!-- JSON Textarea -->\n\n</div>\n", styles: [".json-editor-container{max-width:800px;margin:0 auto;border-radius:5px}.json-editor-container h1{font-size:24px;color:#333}.json-editor-container .lead{font-size:.9 rem;margin-bottom:10px;padding-left:16px}.json-editor-container .json-textarea{width:calc(100% - 24px);padding:12px;font-size:14px;color:#333;background-color:#fff;border:1px solid #ccc;border-radius:5px;font-family:Courier New,Courier,monospace}.json-editor-container .json-textarea:focus{outline:none;border-color:var(--ion-color-primary)}.error-message{border:solid 1px #e74c3c!important}.tree-instructions{display:flex;align-items:center;gap:8px;padding:12px;border-radius:4px;margin-bottom:0;background:azure}.json-error{background:inherit;color:#e74c3c;margin-bottom:4px}.info-icon{width:38px}\n"] }]
146
+ }], () => [{ type: i1.FormBuilder }], { value: [{
147
+ type: Input
148
+ }], valueChange: [{
149
+ type: Output
150
+ }] }); })();
151
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(JsonEditorComponent, { className: "JsonEditorComponent", filePath: "lib/components/t-dynamic-data-edit/elements/json-editor/json-editor.component.ts", lineNumber: 21 }); })();
152
+
153
+ function AggregateStageEditorComponent_mat_option_8_Template(rf, ctx) { if (rf & 1) {
154
+ i0.ɵɵelementStart(0, "mat-option", 10);
155
+ i0.ɵɵtext(1);
156
+ i0.ɵɵelementEnd();
157
+ } if (rf & 2) {
158
+ const stage_r1 = ctx.$implicit;
159
+ i0.ɵɵproperty("value", stage_r1.stage);
160
+ i0.ɵɵadvance();
161
+ i0.ɵɵtextInterpolate1(" ", stage_r1.stage, "");
162
+ } }
163
+ function AggregateStageEditorComponent_mat_hint_11_Template(rf, ctx) { if (rf & 1) {
164
+ i0.ɵɵelementStart(0, "mat-hint", 11)(1, "mat-icon", 12);
165
+ i0.ɵɵtext(2, "info");
166
+ i0.ɵɵelementEnd()();
167
+ } if (rf & 2) {
168
+ const ctx_r1 = i0.ɵɵnextContext();
169
+ i0.ɵɵadvance();
170
+ i0.ɵɵproperty("matTooltip", ctx_r1.activeDescription);
171
+ } }
172
+ function AggregateStageEditorComponent_div_12_Template(rf, ctx) { if (rf & 1) {
173
+ i0.ɵɵelementStart(0, "div", 13)(1, "mat-icon", 14);
174
+ i0.ɵɵtext(2, "warning");
175
+ i0.ɵɵelementEnd();
176
+ i0.ɵɵelementStart(3, "span");
177
+ i0.ɵɵtext(4);
178
+ i0.ɵɵelementEnd()();
179
+ } if (rf & 2) {
180
+ const ctx_r1 = i0.ɵɵnextContext();
181
+ i0.ɵɵadvance(4);
182
+ i0.ɵɵtextInterpolate(ctx_r1.configValidationError);
183
+ } }
184
+ function AggregateStageEditorComponent_div_13_Template(rf, ctx) { if (rf & 1) {
185
+ const _r3 = i0.ɵɵgetCurrentView();
186
+ i0.ɵɵelementStart(0, "div", 15)(1, "app-json-editor", 16);
187
+ i0.ɵɵlistener("valueChange", function AggregateStageEditorComponent_div_13_Template_app_json_editor_valueChange_1_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.handleConfigChange($event)); });
188
+ i0.ɵɵelementEnd()();
189
+ } if (rf & 2) {
190
+ const ctx_r1 = i0.ɵɵnextContext();
191
+ i0.ɵɵadvance();
192
+ i0.ɵɵproperty("value", ctx_r1.selectedStage == null ? null : ctx_r1.selectedStage.config);
193
+ } }
194
+ class AggregateStageEditorComponent {
195
+ ngOnDestroy() {
196
+ this.subscription.unsubscribe();
197
+ }
198
+ constructor() {
199
+ this.subscription = new Subscription();
200
+ this.isRunningPipeline = false;
201
+ this.saveStage = new EventEmitter();
202
+ this.deleteStage = new EventEmitter();
203
+ this.activeStage = undefined; // Define the type appropriately if possible
204
+ this.allowedStages = [];
205
+ }
206
+ ngOnInit() {
207
+ // Debounce the config change to optimize performance
208
+ this.allowedStages = PipelineBuilder.getViewOnlyStages();
209
+ }
210
+ handleChange(event) {
211
+ const selectedStage = event.value;
212
+ if (this.activeStage === undefined) {
213
+ this.activeStage = {
214
+ stage: selectedStage,
215
+ ...this.selectedStage || {},
216
+ };
217
+ }
218
+ else {
219
+ this.activeStage = {
220
+ config: this.activeStage?.config || this.selectedStage?.config,
221
+ stage: selectedStage
222
+ };
223
+ }
224
+ { }
225
+ if (this.activeStage?.config && !!this.activeStage?.stage) {
226
+ this.validateConfig();
227
+ }
228
+ }
229
+ handleConfigChange(event) {
230
+ if (!this.activeStage) {
231
+ this.activeStage = {
232
+ ...this.selectedStage || {},
233
+ };
234
+ }
235
+ this.activeStage = {
236
+ stage: this.activeStage?.stage || this.selectedStage?.name,
237
+ config: event.value
238
+ };
239
+ this.validateConfig();
240
+ }
241
+ validateConfig() {
242
+ this.configValidationError = undefined;
243
+ const { config, stage } = this.activeStage || {};
244
+ // Check if config and stage are defined
245
+ if (!config && config !== 0 || !stage) {
246
+ console.error('Config or stage is not defined', config, stage);
247
+ this.activeStage.valid = false;
248
+ return; // Early exit if validation fails
249
+ }
250
+ try {
251
+ const valid = PipelineBuilder.validateStageConfig(stage, config);
252
+ this.activeStage.valid = valid;
253
+ // Set error message if config is invalid
254
+ if (!valid) {
255
+ this.configValidationError = undefined;
256
+ return;
257
+ }
258
+ }
259
+ catch (error) {
260
+ // Catch and handle errors from validation
261
+ this.configValidationError = error.message || JSON.stringify(error) || 'An unknown error occurred';
262
+ this.activeStage.valid = false;
263
+ console.error('Validation Error:', this.configValidationError);
264
+ }
265
+ }
266
+ canSaveConfig() {
267
+ return !!this.activeStage && !this.configValidationError;
268
+ }
269
+ saveConfiguration() {
270
+ // Logic for saving the configuration
271
+ if (this.canSaveConfig()) {
272
+ this.saveStage.emit(this.activeStage);
273
+ }
274
+ }
275
+ trackByStage(index, stage) {
276
+ return stage.stage;
277
+ }
278
+ get allowedStageNames() {
279
+ return this.allowedStages.map(stage => stage.stage);
280
+ }
281
+ get activeDescription() {
282
+ return this.allowedStages.find(stage => stage.stage === this.activeStage?.stage)?.description;
283
+ }
284
+ deleteActive() {
285
+ this.deleteStage.emit();
286
+ }
287
+ static { this.ɵfac = function AggregateStageEditorComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || AggregateStageEditorComponent)(); }; }
288
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: AggregateStageEditorComponent, selectors: [["app-aggregate-stage-editor"]], inputs: { selectedStage: "selectedStage", isRunningPipeline: "isRunningPipeline" }, outputs: { saveStage: "saveStage", deleteStage: "deleteStage" }, decls: 26, vars: 9, consts: [[2, "margin-bottom", "8px"], ["appearance", "outline", 2, "margin-bottom", "8px"], ["matNativeControl", "", "placeholder", "ChooseFunctionToRun", 3, "selectionChange", "value"], [3, "value", 4, "ngFor", "ngForOf", "ngForTrackBy"], ["align", "end", 4, "ngIf"], ["class", "tree-instructions", "style", "background: cornsilk;", 4, "ngIf"], ["class", "config-container", 4, "ngIf"], [1, "spacer"], ["color", "warn", "mat-button", "", 3, "click", "disabled"], ["color", "primary", "mat-flat-button", "", 2, "margin-left", "8px", 3, "click", "disabled"], [3, "value"], ["align", "end"], ["matTooltipHideDelay", "1000", "matSuffix", "", 3, "matTooltip"], [1, "tree-instructions", 2, "background", "cornsilk"], ["color", "warn", 1, "info-icon", 2, "margin-top", "4px", "margin-bottom", "auto"], [1, "config-container"], [3, "valueChange", "value"]], template: function AggregateStageEditorComponent_Template(rf, ctx) { if (rf & 1) {
289
+ i0.ɵɵelementStart(0, "mat-card", 0)(1, "mat-card-content")(2, "h5");
290
+ i0.ɵɵtext(3, " Aggregate Pipeline Stage Configuration ");
291
+ i0.ɵɵelementEnd();
292
+ i0.ɵɵelementStart(4, "mat-form-field", 1)(5, "mat-label");
293
+ i0.ɵɵtext(6, "Select Aggregate Stage");
294
+ i0.ɵɵelementEnd();
295
+ i0.ɵɵelementStart(7, "mat-select", 2);
296
+ i0.ɵɵlistener("selectionChange", function AggregateStageEditorComponent_Template_mat_select_selectionChange_7_listener($event) { return ctx.handleChange($event); });
297
+ i0.ɵɵtemplate(8, AggregateStageEditorComponent_mat_option_8_Template, 2, 2, "mat-option", 3);
298
+ i0.ɵɵelementEnd();
299
+ i0.ɵɵelementStart(9, "mat-hint");
300
+ i0.ɵɵtext(10);
301
+ i0.ɵɵelementEnd();
302
+ i0.ɵɵtemplate(11, AggregateStageEditorComponent_mat_hint_11_Template, 3, 1, "mat-hint", 4);
303
+ i0.ɵɵelementEnd();
304
+ i0.ɵɵtemplate(12, AggregateStageEditorComponent_div_12_Template, 5, 1, "div", 5)(13, AggregateStageEditorComponent_div_13_Template, 2, 1, "div", 6);
305
+ i0.ɵɵelement(14, "br");
306
+ i0.ɵɵelementEnd();
307
+ i0.ɵɵelement(15, "mat-divider");
308
+ i0.ɵɵelementStart(16, "mat-card-actions");
309
+ i0.ɵɵelement(17, "span", 7);
310
+ i0.ɵɵelementStart(18, "button", 8);
311
+ i0.ɵɵlistener("click", function AggregateStageEditorComponent_Template_button_click_18_listener() { return ctx.deleteActive(); });
312
+ i0.ɵɵtext(19, " Delete ");
313
+ i0.ɵɵelementStart(20, "mat-icon");
314
+ i0.ɵɵtext(21, "delete");
315
+ i0.ɵɵelementEnd()();
316
+ i0.ɵɵelementStart(22, "button", 9);
317
+ i0.ɵɵlistener("click", function AggregateStageEditorComponent_Template_button_click_22_listener() { return ctx.saveConfiguration(); });
318
+ i0.ɵɵtext(23, " Save ");
319
+ i0.ɵɵelementStart(24, "mat-icon");
320
+ i0.ɵɵtext(25, " save");
321
+ i0.ɵɵelementEnd()()()();
322
+ } if (rf & 2) {
323
+ i0.ɵɵadvance(7);
324
+ i0.ɵɵproperty("value", ctx.selectedStage == null ? null : ctx.selectedStage.name);
325
+ i0.ɵɵadvance();
326
+ i0.ɵɵproperty("ngForOf", ctx.allowedStages)("ngForTrackBy", ctx.trackByStage);
327
+ i0.ɵɵadvance(2);
328
+ i0.ɵɵtextInterpolate1(" ", ctx.activeDescription ? "Hover over the info icon to view stage details ." : "Please select an aggregation function from the list.", " ");
329
+ i0.ɵɵadvance();
330
+ i0.ɵɵproperty("ngIf", ctx.activeDescription);
331
+ i0.ɵɵadvance();
332
+ i0.ɵɵproperty("ngIf", ctx.configValidationError);
333
+ i0.ɵɵadvance();
334
+ i0.ɵɵproperty("ngIf", ctx.activeStage || (ctx.selectedStage == null ? null : ctx.selectedStage.config));
335
+ i0.ɵɵadvance(5);
336
+ i0.ɵɵproperty("disabled", ctx.isRunningPipeline);
337
+ i0.ɵɵadvance(4);
338
+ i0.ɵɵproperty("disabled", ctx.isRunningPipeline || !(ctx.activeStage == null ? null : ctx.activeStage.valid));
339
+ } }, dependencies: [MatModulesModule, i3.MatOption, i2$1.MatButton, i3$1.MatCard, i3$1.MatCardActions, i3$1.MatCardContent, i4.MatDivider, i6.MatIcon, i3$2.MatFormField, i3$2.MatLabel, i3$2.MatHint, i3$2.MatSuffix, i7.MatSelect, i8.MatTooltip, CommonModule, i2.NgForOf, i2.NgIf, FormsModule,
340
+ JsonEditorComponent], styles: [".title-icon[_ngcontent-%COMP%]{margin-right:8px;vertical-align:middle}.tree-instructions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:12px;background:var(--mdc-elevated-card-container-color, var(--mat-app-surface-container-low));border-radius:4px;margin-bottom:16px}.info-icon[_ngcontent-%COMP%]{min-width:38px!important;display:block}mat-form-field[_ngcontent-%COMP%]{min-width:100%;background:azure}.stageDescription[_ngcontent-%COMP%]{background:azure}.stage-button-container[_ngcontent-%COMP%]{display:flex;gap:4px;width:fit-content;align-items:center}.tree-instructions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:12px;background:azure;border-radius:4px;margin-bottom:16px}.info-icon[_ngcontent-%COMP%]{min-width:38px;margin:8px auto auto}"] }); }
341
+ }
342
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(AggregateStageEditorComponent, [{
343
+ type: Component,
344
+ args: [{ selector: 'app-aggregate-stage-editor', standalone: true, imports: [
345
+ MatModulesModule,
346
+ CommonModule,
347
+ FormsModule,
348
+ JsonEditorComponent
349
+ ], template: "<mat-card style=\"margin-bottom:8px\">\n <mat-card-content>\n\n <h5>\n Aggregate Pipeline Stage Configuration\n </h5>\n\n\n\n <mat-form-field style=\" margin-bottom: 8px;\" appearance=\"outline\">\n <mat-label>Select Aggregate Stage</mat-label>\n <mat-select matNativeControl [value]=\"selectedStage?.name\" (selectionChange)=\"handleChange($event)\"\n placeholder=\"ChooseFunctionToRun\">\n <mat-option *ngFor=\"let stage of allowedStages; trackBy: trackByStage\" [value]=\"stage.stage\">\n {{stage.stage}}</mat-option>\n\n\n\n </mat-select>\n <mat-hint>\n {{activeDescription ?\n 'Hover over the info icon to view stage details .'\n : 'Please select an aggregation function from the list.'}}\n </mat-hint>\n <mat-hint *ngIf=\"activeDescription\" align=\"end\">\n <mat-icon matTooltipHideDelay=\"1000\" [matTooltip]=\"activeDescription\" matSuffix>info</mat-icon>\n </mat-hint>\n </mat-form-field>\n\n\n\n <div class=\"tree-instructions\" style=\"background: cornsilk;\" *ngIf=\"configValidationError\">\n <mat-icon style=\"margin-top: 4px;margin-bottom:auto\" class=\"info-icon\" color=\"warn\">warning</mat-icon>\n <span>{{ configValidationError }}</span>\n </div>\n\n\n\n\n\n <div class=\"config-container\" *ngIf=\"activeStage ||selectedStage?.config\">\n <app-json-editor [value]=\"selectedStage?.config\" (valueChange)=\"handleConfigChange($event)\"></app-json-editor>\n </div>\n\n <br>\n\n\n\n </mat-card-content>\n <mat-divider>\n </mat-divider>\n <mat-card-actions>\n\n <span class=\"spacer\"></span>\n <button color=\"warn\" [disabled]=\"isRunningPipeline\" mat-button (click)=\"deleteActive()\">\n Delete\n <mat-icon >delete</mat-icon>\n </button>\n <button style=\"margin-left:8px;\" color=\"primary\" mat-flat-button (click)=\"saveConfiguration()\"\n [disabled]=\"isRunningPipeline ||!activeStage?.valid \">\n Save\n <mat-icon> save</mat-icon>\n </button>\n </mat-card-actions>\n</mat-card>", styles: [".title-icon{margin-right:8px;vertical-align:middle}.tree-instructions{display:flex;align-items:center;gap:8px;padding:12px;background:var(--mdc-elevated-card-container-color, var(--mat-app-surface-container-low));border-radius:4px;margin-bottom:16px}.info-icon{min-width:38px!important;display:block}mat-form-field{min-width:100%;background:azure}.stageDescription{background:azure}.stage-button-container{display:flex;gap:4px;width:fit-content;align-items:center}.tree-instructions{display:flex;align-items:center;gap:8px;padding:12px;background:azure;border-radius:4px;margin-bottom:16px}.info-icon{min-width:38px;margin:8px auto auto}\n"] }]
350
+ }], () => [], { selectedStage: [{
351
+ type: Input
352
+ }], isRunningPipeline: [{
353
+ type: Input
354
+ }], saveStage: [{
355
+ type: Output
356
+ }], deleteStage: [{
357
+ type: Output
358
+ }] }); })();
359
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(AggregateStageEditorComponent, { className: "AggregateStageEditorComponent", filePath: "lib/components/t-dynamic-data-edit/elements/pipeline-generator/elements/aggregate-stage-editor/aggregate-stage-editor.component.ts", lineNumber: 25 }); })();
360
+
361
+ const _forTrack0 = ($index, $item) => $item.id;
362
+ function TWorkflowPickerComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
363
+ i0.ɵɵelementStart(0, "mat-toolbar")(1, "span");
364
+ i0.ɵɵtext(2, " Failed to load workflow list ");
365
+ i0.ɵɵelementEnd();
366
+ i0.ɵɵelement(3, "span", 1);
367
+ i0.ɵɵelementStart(4, "button", 2);
368
+ i0.ɵɵtext(5, " Retry ");
369
+ i0.ɵɵelementEnd()();
370
+ } }
371
+ function TWorkflowPickerComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
372
+ i0.ɵɵelementStart(0, "div", 0);
373
+ i0.ɵɵelement(1, "mat-spinner");
374
+ i0.ɵɵelementEnd();
375
+ } }
376
+ function TWorkflowPickerComponent_Conditional_2_Conditional_2_For_1_Template(rf, ctx) { if (rf & 1) {
377
+ const _r1 = i0.ɵɵgetCurrentView();
378
+ i0.ɵɵelementStart(0, "mat-list-item", 4);
379
+ i0.ɵɵlistener("click", function TWorkflowPickerComponent_Conditional_2_Conditional_2_For_1_Template_mat_list_item_click_0_listener() { const option_r2 = i0.ɵɵrestoreView(_r1).$implicit; const ctx_r2 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r2.bindInput(option_r2)); });
380
+ i0.ɵɵelementStart(1, "mat-chip", 5)(2, "span", 6);
381
+ i0.ɵɵtext(3);
382
+ i0.ɵɵelementEnd()();
383
+ i0.ɵɵelementStart(4, "div", 7)(5, "div");
384
+ i0.ɵɵtext(6);
385
+ i0.ɵɵelementEnd();
386
+ i0.ɵɵelementStart(7, "div", 8);
387
+ i0.ɵɵtext(8);
388
+ i0.ɵɵpipe(9, "date");
389
+ i0.ɵɵelementEnd()();
390
+ i0.ɵɵelementStart(10, "button", 9)(11, "mat-icon");
391
+ i0.ɵɵtext(12, " radio_button_unchecked ");
392
+ i0.ɵɵelementEnd()()();
393
+ i0.ɵɵelement(13, "mat-divider");
394
+ } if (rf & 2) {
395
+ const option_r2 = ctx.$implicit;
396
+ i0.ɵɵadvance();
397
+ i0.ɵɵstyleProp("background", option_r2["isDocument"] ? "lightskyblue" : "");
398
+ i0.ɵɵadvance(2);
399
+ i0.ɵɵtextInterpolate1(" ", option_r2["isDocument"] ? "DOC" : "FLOW", " ");
400
+ i0.ɵɵadvance(3);
401
+ i0.ɵɵtextInterpolate1(" ", option_r2.name, " ");
402
+ i0.ɵɵadvance(2);
403
+ i0.ɵɵtextInterpolate2(" ", i0.ɵɵpipeBind2(9, 6, option_r2["createdAt"], "medium"), " \u00A0 ", option_r2.numberOfSteps, " ");
404
+ } }
405
+ function TWorkflowPickerComponent_Conditional_2_Conditional_2_Template(rf, ctx) { if (rf & 1) {
406
+ i0.ɵɵrepeaterCreate(0, TWorkflowPickerComponent_Conditional_2_Conditional_2_For_1_Template, 14, 9, null, null, _forTrack0);
407
+ } if (rf & 2) {
408
+ const ctx_r2 = i0.ɵɵnextContext(2);
409
+ i0.ɵɵrepeater(ctx_r2.workflowOptions);
410
+ } }
411
+ function TWorkflowPickerComponent_Conditional_2_Conditional_3_Template(rf, ctx) { if (rf & 1) {
412
+ const _r4 = i0.ɵɵgetCurrentView();
413
+ i0.ɵɵelementStart(0, "mat-list-item", 4);
414
+ i0.ɵɵlistener("click", function TWorkflowPickerComponent_Conditional_2_Conditional_3_Template_mat_list_item_click_0_listener() { i0.ɵɵrestoreView(_r4); const ctx_r2 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r2.unbindInput()); });
415
+ i0.ɵɵelementStart(1, "mat-chip", 5)(2, "span", 6);
416
+ i0.ɵɵtext(3);
417
+ i0.ɵɵelementEnd()();
418
+ i0.ɵɵelementStart(4, "div", 7)(5, "div");
419
+ i0.ɵɵtext(6);
420
+ i0.ɵɵelementEnd();
421
+ i0.ɵɵelementStart(7, "div", 8);
422
+ i0.ɵɵtext(8);
423
+ i0.ɵɵpipe(9, "date");
424
+ i0.ɵɵelementEnd()();
425
+ i0.ɵɵelementStart(10, "button", 9)(11, "mat-icon", 10);
426
+ i0.ɵɵtext(12, " check_circle ");
427
+ i0.ɵɵelementEnd()()();
428
+ } if (rf & 2) {
429
+ const ctx_r2 = i0.ɵɵnextContext(2);
430
+ i0.ɵɵadvance();
431
+ i0.ɵɵstyleProp("background", (ctx_r2.selectedWorkflow == null ? null : ctx_r2.selectedWorkflow["isDocument"]) ? "lightskyblue" : "");
432
+ i0.ɵɵadvance(2);
433
+ i0.ɵɵtextInterpolate1(" ", (ctx_r2.selectedWorkflow == null ? null : ctx_r2.selectedWorkflow["isDocument"]) ? "DOC" : "FLOW", " ");
434
+ i0.ɵɵadvance(3);
435
+ i0.ɵɵtextInterpolate1(" ", ctx_r2.selectedWorkflow == null ? null : ctx_r2.selectedWorkflow.name, " ");
436
+ i0.ɵɵadvance(2);
437
+ i0.ɵɵtextInterpolate2(" ", i0.ɵɵpipeBind2(9, 6, ctx_r2.selectedWorkflow == null ? null : ctx_r2.selectedWorkflow["createdAt"], "medium"), " \u00A0 ", ctx_r2.selectedWorkflow == null ? null : ctx_r2.selectedWorkflow.numberOfSteps, " ");
438
+ } }
439
+ function TWorkflowPickerComponent_Conditional_2_Template(rf, ctx) { if (rf & 1) {
440
+ i0.ɵɵelementStart(0, "mat-card")(1, "mat-nav-list", 3);
441
+ i0.ɵɵtemplate(2, TWorkflowPickerComponent_Conditional_2_Conditional_2_Template, 2, 0)(3, TWorkflowPickerComponent_Conditional_2_Conditional_3_Template, 13, 9, "mat-list-item");
442
+ i0.ɵɵelementEnd()();
443
+ } if (rf & 2) {
444
+ const ctx_r2 = i0.ɵɵnextContext();
445
+ i0.ɵɵadvance(2);
446
+ i0.ɵɵconditional(!ctx_r2.value ? 2 : -1);
447
+ i0.ɵɵadvance();
448
+ i0.ɵɵconditional(ctx_r2.value ? 3 : -1);
449
+ } }
450
+ class TWorkflowPickerComponent {
451
+ set getWorkflowOptions(value) {
452
+ if (value?.length === this._workflowOptions?.length && value?.every((workflow, index) => workflow.id === this._workflowOptions?.[index]?.id)) {
453
+ return;
454
+ }
455
+ this._workflowOptions = value;
456
+ }
457
+ constructor() {
458
+ this._workflowOptions = [];
459
+ this.value = undefined;
460
+ this.valueChanged = new EventEmitter();
461
+ this.error = undefined;
462
+ this.loading = false;
463
+ }
464
+ ngOnInit() {
465
+ }
466
+ get workflowOptions() {
467
+ return this._workflowOptions || [];
468
+ }
469
+ unbindInput() {
470
+ this.value = undefined;
471
+ this.valueChanged.emit(this.value);
472
+ }
473
+ bindInput(workflow) {
474
+ this.valueChanged.emit(workflow.id);
475
+ }
476
+ get selectedWorkflow() {
477
+ return this._workflowOptions?.find((workflow) => workflow.id === this.value);
478
+ }
479
+ static { this.ɵfac = function TWorkflowPickerComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || TWorkflowPickerComponent)(); }; }
480
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: TWorkflowPickerComponent, selectors: [["lib-t-workflow-picker"]], inputs: { getWorkflowOptions: "getWorkflowOptions", value: "value" }, outputs: { valueChanged: "valueChanged" }, decls: 3, vars: 3, consts: [[1, "loadingContainer"], [1, "spacer"], ["color", "primary", "mat-raised-button", ""], [2, "padding", "0px"], [3, "click"], ["matListItemIcon", "", 1, "docType"], [2, "font-size", "10px"], ["matListItemTitle", ""], [2, "font-size", "13px", "opacity", "0.6", "line-height", "normal"], ["matListItemMeta", "", "mat-icon-button", ""], ["color", "primary"]], template: function TWorkflowPickerComponent_Template(rf, ctx) { if (rf & 1) {
481
+ i0.ɵɵtemplate(0, TWorkflowPickerComponent_Conditional_0_Template, 6, 0, "mat-toolbar")(1, TWorkflowPickerComponent_Conditional_1_Template, 2, 0, "div", 0)(2, TWorkflowPickerComponent_Conditional_2_Template, 4, 2, "mat-card");
482
+ } if (rf & 2) {
483
+ i0.ɵɵconditional(ctx.error ? 0 : -1);
484
+ i0.ɵɵadvance();
485
+ i0.ɵɵconditional(ctx.loading ? 1 : -1);
486
+ i0.ɵɵadvance();
487
+ i0.ɵɵconditional(!ctx.loading && !ctx.error ? 2 : -1);
488
+ } }, dependencies: [CommonModule, i2.DatePipe, MatModulesModule, i2$1.MatButton, i2$1.MatIconButton, i3$1.MatCard, i4$1.MatChip, i4.MatDivider, i6.MatIcon, i6$1.MatNavList, i6$1.MatListItem, i6$1.MatListItemIcon, i6$1.MatListItemTitle, i6$1.MatListItemMeta, i7$1.MatProgressSpinner, i9.MatToolbar], styles: [".suggestion-container[_ngcontent-%COMP%]{display:flex;width:100%;gap:14px}.docType[_ngcontent-%COMP%]{width:min-content;margin-top:auto!important;margin-bottom:auto!important}mat-card[_ngcontent-%COMP%]{margin-bottom:8px;background:var(--mat-toolbar-container-background-color, var(--mat-app-surface))}"] }); }
489
+ }
490
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(TWorkflowPickerComponent, [{
491
+ type: Component,
492
+ args: [{ selector: 'lib-t-workflow-picker', standalone: true, imports: [CommonModule, MatModulesModule], template: "@if (error) {\r\n<mat-toolbar>\r\n <span>\r\n Failed to load workflow list\r\n </span>\r\n <span class=\"spacer\"></span>\r\n <button color=\"primary\" mat-raised-button>\r\n Retry\r\n\r\n </button>\r\n</mat-toolbar>\r\n}\r\n@if(loading){\r\n<div class=\"loadingContainer\">\r\n <mat-spinner></mat-spinner>\r\n</div>\r\n}\r\n@if(!loading&& !error){\r\n<mat-card>\r\n <mat-nav-list style=\"padding: 0px;\">\r\n @if(!value){\r\n @for (option of workflowOptions; track option.id) {\r\n <mat-list-item (click)=\"bindInput(option)\">\r\n\r\n <mat-chip class=\"docType\" [style.background]=\" option['isDocument'] ? 'lightskyblue' : ''\" matListItemIcon>\r\n <span style=\"font-size: 10px;\">\r\n {{ option[\"isDocument\"] ? \"DOC\" : \"FLOW\" }}\r\n </span>\r\n </mat-chip>\r\n\r\n\r\n <div matListItemTitle>\r\n <div>\r\n {{ option.name }}\r\n </div>\r\n\r\n <div style=\"font-size: 13px; opacity: 0.6;line-height:normal\">\r\n {{ option[\"createdAt\"] | date: \"medium\" }} &nbsp;\r\n {{ option.numberOfSteps }}\r\n </div>\r\n </div>\r\n <button matListItemMeta mat-icon-button>\r\n <mat-icon>\r\n radio_button_unchecked\r\n </mat-icon>\r\n </button>\r\n\r\n </mat-list-item>\r\n <mat-divider></mat-divider>\r\n }\r\n }\r\n @if(value){\r\n <mat-list-item (click)=\" unbindInput() \">\r\n\r\n <mat-chip class=\"docType\" [style.background]=\"selectedWorkflow?.['isDocument'] ? 'lightskyblue' : ''\" matListItemIcon>\r\n <span style=\"font-size: 10px;\">\r\n {{selectedWorkflow?.[\"isDocument\"] ? \"DOC\" : \"FLOW\" }}\r\n </span>\r\n </mat-chip>\r\n \r\n \r\n <div matListItemTitle>\r\n <div>\r\n {{ selectedWorkflow?.name }}\r\n </div>\r\n \r\n <div style=\"font-size: 13px; opacity: 0.6;line-height:normal\">\r\n {{selectedWorkflow?.[\"createdAt\"] | date: \"medium\" }} &nbsp;\r\n {{ selectedWorkflow?.numberOfSteps }}\r\n </div>\r\n </div>\r\n <button matListItemMeta mat-icon-button>\r\n <mat-icon color=\"primary\">\r\n check_circle\r\n </mat-icon>\r\n </button>\r\n \r\n </mat-list-item>\r\n }\r\n\r\n\r\n </mat-nav-list>\r\n</mat-card>\r\n\r\n}", styles: [".suggestion-container{display:flex;width:100%;gap:14px}.docType{width:min-content;margin-top:auto!important;margin-bottom:auto!important}mat-card{margin-bottom:8px;background:var(--mat-toolbar-container-background-color, var(--mat-app-surface))}\n"] }]
493
+ }], () => [], { getWorkflowOptions: [{
494
+ type: Input
495
+ }], value: [{
496
+ type: Input
497
+ }], valueChanged: [{
498
+ type: Output
499
+ }] }); })();
500
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(TWorkflowPickerComponent, { className: "TWorkflowPickerComponent", filePath: "lib/components/t-dynamic-data-edit/elements/t-workflow-picker/t-workflow-picker.component.ts", lineNumber: 15 }); })();
501
+
502
+ class PipelineService {
503
+ constructor() {
504
+ //LOADING INDICATORS
505
+ this.isRunningPipeline = false;
506
+ this.aiIsGeneratingPipeline = false;
507
+ this.isLoadingAllowedStages = false;
508
+ this.isLoadingWorkflowSchema = false;
509
+ //States
510
+ this.workflowId$ = new BehaviorSubject(undefined);
511
+ this.activeStage$ = new BehaviorSubject(undefined);
512
+ this.prompt$ = new BehaviorSubject(undefined);
513
+ this.schemaLoadError$ = new BehaviorSubject(undefined);
514
+ this.pipeline$ = new BehaviorSubject([]);
515
+ this.threadId$ = new BehaviorSubject(undefined);
516
+ this.schema$ = new BehaviorSubject(undefined);
517
+ this.allowedStages$ = new BehaviorSubject([]);
518
+ this.pipeLineResult$ = new BehaviorSubject([]);
519
+ this.chatHistory$ = new BehaviorSubject([]);
520
+ this.http = inject(HttpClient);
521
+ //Set local storage threadId
522
+ const threadId = localStorage.getItem('threadId');
523
+ if (threadId) {
524
+ this.threadId$.next(threadId);
525
+ }
526
+ }
527
+ get config$() {
528
+ return this.workflowId$.pipe(switchMap(workflowId => this.pipeline$.pipe(switchMap(pipeline => this.pipeLineResult$.pipe(map(responseBody => ({ workflowId, pipeline, responseBody })))))));
529
+ }
530
+ /**
531
+ * Fetch available pipeline stages for the user to select and generate pipelines.
532
+ * Ideally, this could be static or fetched from a backend.
533
+ */
534
+ runPipeLine(pipeline, workflowId) {
535
+ const url = "http://localhost:5000/api/v1/pipelineBuilder/runPipeline";
536
+ // For now, returning a static list of pipeline stages. In a real application, you can fetch from an API.
537
+ this.isRunningPipeline = true;
538
+ return this.http.post(url, { pipeline, workflowId }).pipe(take(1), catchError(this.handleError), // Error handling for the HTTP request,
539
+ finalize(() => this.isRunningPipeline = false));
540
+ }
541
+ /**
542
+ * Generate a MongoDB pipeline based on the given user prompt.
543
+ *
544
+ * @param prompt The user's input or description of the desired pipeline.
545
+ */
546
+ generatePipeline(query, schema, threadId, existingPipeline, previousError) {
547
+ if (!schema) {
548
+ throw new Error("Schema is required");
549
+ }
550
+ const payload = { query, schema, threadId, existingPipeline, previousError };
551
+ const url = "http://localhost:5000/api/v1/pipelineBuilder/generatePipeline";
552
+ this.aiIsGeneratingPipeline = true;
553
+ return this.http.post(`${url}`, payload)
554
+ .pipe(take(1), catchError(this.handleError), // Error handling for the HTTP request,
555
+ finalize(() => this.aiIsGeneratingPipeline = false));
556
+ }
557
+ /**
558
+ * Handle any errors from the HTTP request.
559
+ *
560
+ * @param error The error response from the HTTP request
561
+ */
562
+ handleError(error) {
563
+ console.error('An error occurred', error);
564
+ // Return an observable with a user-facing error message
565
+ return throwError(() => new Error('Something went wrong with the pipeline generation; please try again later.'));
566
+ }
567
+ getSchema(workflowId) {
568
+ if (!workflowId) {
569
+ throw new Error("WorkflowId is required");
570
+ }
571
+ const url = "http://localhost:5000/api/v1/pipelineBuilder/getSchema";
572
+ return this.http.get(`${url}`, { params: { workflowId: workflowId } }).pipe(take(1), catchError(this.handleError) // Error handling for the HTTP request
573
+ );
574
+ }
575
+ /** OPERATIONS */
576
+ isSchemaEmpty(object) {
577
+ }
578
+ workflowChanged(event) {
579
+ this.workflowId$.next(event);
580
+ if (!event) {
581
+ return;
582
+ }
583
+ this.getSchema(event).pipe(take(1), tap(({ schema }) => {
584
+ this.schema$.next(schema);
585
+ const isEmptySchema = Object.keys(schema)[0] === "" && Object.values(schema)[0] === "Array<>";
586
+ const error = isEmptySchema
587
+ ? "Document schema is missing. Please ensure at least one document exists for the selected workflow."
588
+ : undefined;
589
+ this.schemaLoadError$.next(error);
590
+ console.log("Workflow schema loaded,run pipeline");
591
+ this.runActivePipeline();
592
+ }), catchError((error) => {
593
+ this.schemaLoadError$.next("Error loading schema");
594
+ return this.handleError(error);
595
+ })).subscribe();
596
+ }
597
+ setActiveStage(i) {
598
+ const index = this.activeStage$.getValue();
599
+ if (index === i) {
600
+ this.activeStage$.next(undefined);
601
+ return;
602
+ }
603
+ this.activeStage$.next(i);
604
+ }
605
+ addStage() {
606
+ const newPipeline = this.pipeline$.getValue().concat({});
607
+ this.pipeline$.next(newPipeline);
608
+ }
609
+ onTextChange(event) {
610
+ this.prompt$.next(event);
611
+ console.log(event);
612
+ }
613
+ promptSubmit() {
614
+ // Use combineLatest to fetch the latest values from multiple sources
615
+ combineLatest([this.schema$, this.threadId$, this.pipeline$, this.prompt$, this.chatHistory$])
616
+ .pipe(take(1), tap(([schema, threadId, pipeline, prompt, history]) => {
617
+ if (!schema || !prompt) {
618
+ console.warn(`Missing values: schema ${schema} prompt ${prompt}`);
619
+ }
620
+ }), filter(([schema, , , prompt]) => !!schema && !!prompt), switchMap(([schema, threadId, pipeline, prompt, history]) => {
621
+ // Use a shallow copy of the pipeline
622
+ const previousError = history[history.length - 1]?.assistance?.error;
623
+ const pipelineCopy = pipeline.map(stage => JSON.parse(JSON.stringify(stage))) || [];
624
+ console.info('Generating pipeline with prompt:', prompt, 'schema:', schema, 'threadId:', threadId, 'pipeline:', pipeline);
625
+ return this.generatePipeline(prompt, schema, threadId, pipelineCopy, previousError).pipe(map((response) => ({ ...response, history, prompt })));
626
+ }), tap((response) => {
627
+ const { pipeline, threadId, history, prompt } = response;
628
+ const historyRecord = {
629
+ user: prompt,
630
+ assistance: response,
631
+ date: new Date()
632
+ };
633
+ // Use next with a concatenated value for chat history
634
+ this.chatHistory$.next([...(history || []), historyRecord]);
635
+ this.pipeline$.next(pipeline);
636
+ this.threadId$.next(threadId);
637
+ // Store threadID locally
638
+ localStorage.setItem('threadId', threadId);
639
+ // Run the active pipeline after all state updates are complete
640
+ console.log("prompt submitted run pipeline");
641
+ this.runActivePipeline();
642
+ }), catchError((error) => {
643
+ console.error('Error response:', error.message || error);
644
+ return this.handleError(error);
645
+ })).subscribe();
646
+ }
647
+ runActivePipeline() {
648
+ const pipeline = [...(this.pipeline$.getValue().map(stage => (JSON.parse(JSON.stringify(stage)))) || [])];
649
+ const someAreNotValid = pipeline.some(stage => Object.keys(stage).length === 0);
650
+ if (pipeline.length === 0 || someAreNotValid) {
651
+ return;
652
+ }
653
+ try {
654
+ PipelineBuilder.validatePipeline(pipeline);
655
+ }
656
+ catch (error) {
657
+ console.error(error, pipeline);
658
+ return;
659
+ }
660
+ const workflowId = this.workflowId$.getValue();
661
+ if (!workflowId) {
662
+ return;
663
+ }
664
+ this.runPipeLine(pipeline, workflowId).pipe(take(1), tap(({ results }) => {
665
+ this.pipeLineResult$.next(results);
666
+ }), catchError((error) => {
667
+ console.error('Error response:', error);
668
+ const err = JSON.parse(JSON.stringify(error));
669
+ const errorMessage = err.error;
670
+ if (errorMessage) {
671
+ this.pipelineErrorLogAndRetry(errorMessage);
672
+ }
673
+ return this.handleError(error);
674
+ })).subscribe();
675
+ }
676
+ pipelineErrorLogAndRetry(message) {
677
+ const history = this.chatHistory$.getValue();
678
+ const prompt = this.prompt$.getValue();
679
+ const historyRecord = {
680
+ user: prompt,
681
+ assistance: {
682
+ message
683
+ },
684
+ date: new Date()
685
+ };
686
+ this.chatHistory$.next([...(history || []), historyRecord]);
687
+ }
688
+ get activeStage() {
689
+ return this.pipeline$.asObservable().pipe(switchMap(pipeline => this.activeStage$.pipe(map(activeIndex => activeIndex === undefined ? undefined : {
690
+ name: Object.keys(pipeline[activeIndex] || {})[0] || '',
691
+ config: pipeline[activeIndex][Object.keys(pipeline[activeIndex] || {})?.[0] || '']
692
+ }))));
693
+ }
694
+ saveStage(index, stage) {
695
+ const pipeline = this.pipeline$.getValue();
696
+ if (index === undefined) {
697
+ return;
698
+ }
699
+ const newPipeline = pipeline.map((s, i) => {
700
+ if (i === index) {
701
+ return stage ? {
702
+ [stage.stage]: stage.config
703
+ } : s;
704
+ }
705
+ return s;
706
+ });
707
+ console.log("newPipeline", newPipeline);
708
+ this.pipeline$.next(newPipeline);
709
+ this.activeStage$.next(undefined);
710
+ console.log("stage saved run pipeline");
711
+ this.runActivePipeline();
712
+ }
713
+ deleteStage(index) {
714
+ const pipeline = this.pipeline$.getValue();
715
+ if (index === undefined) {
716
+ return;
717
+ }
718
+ const newPipeline = pipeline.filter((s, i) => i !== index);
719
+ console.log("newPipeline", newPipeline);
720
+ this.pipeline$.next(newPipeline);
721
+ this.activeStage$.next(undefined);
722
+ console.log("stage deleted run pipeline");
723
+ this.runActivePipeline();
724
+ }
725
+ get pipelineGeneralValid() {
726
+ return this.pipeline$.asObservable().pipe(map(pipeline => {
727
+ const allHaveTypes = pipeline.every(stage => Object.keys(stage).length === 1);
728
+ if (!allHaveTypes) {
729
+ return {
730
+ valid: false,
731
+ message: "All stages must be a valid pipeline stage"
732
+ };
733
+ }
734
+ const AllStagesMustHaveConfig = pipeline.every((stage) => stage[Object.keys(stage)?.[0] || ''] !== undefined);
735
+ if (!AllStagesMustHaveConfig) {
736
+ return {
737
+ valid: false,
738
+ message: "All stages must have a configuration"
739
+ };
740
+ }
741
+ return {
742
+ valid: true
743
+ };
744
+ }));
745
+ }
746
+ static { this.ɵfac = function PipelineService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PipelineService)(); }; }
747
+ static { this.ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: PipelineService, factory: PipelineService.ɵfac, providedIn: 'root' }); }
748
+ }
749
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PipelineService, [{
750
+ type: Injectable,
751
+ args: [{
752
+ providedIn: 'root'
753
+ }]
754
+ }], () => [], null); })();
755
+
756
+ const _c0 = ["textarea"];
757
+ function PipelineGeneratorComponent_Conditional_0_Template(rf, ctx) { if (rf & 1) {
758
+ i0.ɵɵelementStart(0, "div", 2);
759
+ i0.ɵɵelement(1, "mat-spinner", 3);
760
+ i0.ɵɵelementStart(2, "p");
761
+ i0.ɵɵtext(3, " Loading workflows... ");
762
+ i0.ɵɵelementEnd()();
763
+ } }
764
+ function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_mat_spinner_4_Template(rf, ctx) { if (rf & 1) {
765
+ i0.ɵɵelement(0, "mat-spinner", 30);
766
+ } }
767
+ function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_div_9_Template(rf, ctx) { if (rf & 1) {
768
+ i0.ɵɵelementStart(0, "div", 31)(1, "mat-icon", 32);
769
+ i0.ɵɵtext(2, "info");
770
+ i0.ɵɵelementEnd();
771
+ i0.ɵɵelementStart(3, "span");
772
+ i0.ɵɵtext(4, " Add stages to the pipeline below.");
773
+ i0.ɵɵelement(5, "br");
774
+ i0.ɵɵtext(6, " Each stage processes input documents by filtering, grouping, or calculating values. The output documents from one stage are passed to the next stage in the pipeline. ");
775
+ i0.ɵɵelementEnd()();
776
+ } }
777
+ function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_ng_container_12_div_10_Template(rf, ctx) { if (rf & 1) {
778
+ i0.ɵɵelementStart(0, "div", 40);
779
+ i0.ɵɵtext(1, " Incomplete , click to edit ");
780
+ i0.ɵɵelementEnd();
781
+ } }
782
+ function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_ng_container_12_button_12_mat_icon_1_Template(rf, ctx) { if (rf & 1) {
783
+ i0.ɵɵelementStart(0, "mat-icon", 44);
784
+ i0.ɵɵtext(1, "check_circle");
785
+ i0.ɵɵelementEnd();
786
+ } }
787
+ function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_ng_container_12_button_12_mat_icon_3_Template(rf, ctx) { if (rf & 1) {
788
+ i0.ɵɵelementStart(0, "mat-icon", 45);
789
+ i0.ɵɵtext(1, " warning ");
790
+ i0.ɵɵelementEnd();
791
+ } }
792
+ function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_ng_container_12_button_12_Template(rf, ctx) { if (rf & 1) {
793
+ i0.ɵɵelementStart(0, "button", 41);
794
+ i0.ɵɵtemplate(1, PipelineGeneratorComponent_Conditional_1_mat_accordion_5_ng_container_12_button_12_mat_icon_1_Template, 2, 0, "mat-icon", 42);
795
+ i0.ɵɵpipe(2, "async");
796
+ i0.ɵɵtemplate(3, PipelineGeneratorComponent_Conditional_1_mat_accordion_5_ng_container_12_button_12_mat_icon_3_Template, 2, 0, "mat-icon", 43);
797
+ i0.ɵɵpipe(4, "async");
798
+ i0.ɵɵelementEnd();
799
+ } if (rf & 2) {
800
+ const ctx_r5 = i0.ɵɵnextContext();
801
+ const stage_r7 = ctx_r5.$implicit;
802
+ const $index_r5 = ctx_r5.index;
803
+ const ctx_r1 = i0.ɵɵnextContext(3);
804
+ i0.ɵɵadvance();
805
+ i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(2, 2, ctx_r1.activeStageIndex) === $index_r5);
806
+ i0.ɵɵadvance(2);
807
+ i0.ɵɵproperty("ngIf", !stage_r7.valid && i0.ɵɵpipeBind1(4, 4, ctx_r1.activeStageIndex) !== $index_r5);
808
+ } }
809
+ function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_ng_container_12_app_aggregate_stage_editor_16_Template(rf, ctx) { if (rf & 1) {
810
+ const _r8 = i0.ɵɵgetCurrentView();
811
+ i0.ɵɵelementStart(0, "app-aggregate-stage-editor", 46);
812
+ i0.ɵɵlistener("deleteStage", function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_ng_container_12_app_aggregate_stage_editor_16_Template_app_aggregate_stage_editor_deleteStage_0_listener() { i0.ɵɵrestoreView(_r8); const $index_r5 = i0.ɵɵnextContext().index; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.deleteStage($index_r5)); })("saveStage", function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_ng_container_12_app_aggregate_stage_editor_16_Template_app_aggregate_stage_editor_saveStage_0_listener($event) { i0.ɵɵrestoreView(_r8); const $index_r5 = i0.ɵɵnextContext().index; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.saveStage($index_r5, $event)); });
813
+ i0.ɵɵelementEnd();
814
+ } if (rf & 2) {
815
+ const stage_r7 = i0.ɵɵnextContext().$implicit;
816
+ const ctx_r1 = i0.ɵɵnextContext(3);
817
+ i0.ɵɵproperty("selectedStage", stage_r7)("isRunningPipeline", ctx_r1.isRunningPipeline);
818
+ } }
819
+ function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_ng_container_12_Template(rf, ctx) { if (rf & 1) {
820
+ const _r4 = i0.ɵɵgetCurrentView();
821
+ i0.ɵɵelementContainerStart(0);
822
+ i0.ɵɵelementStart(1, "mat-list-item", 33);
823
+ i0.ɵɵpipe(2, "async");
824
+ i0.ɵɵpipe(3, "async");
825
+ i0.ɵɵpipe(4, "async");
826
+ i0.ɵɵlistener("click", function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_ng_container_12_Template_mat_list_item_click_1_listener() { const $index_r5 = i0.ɵɵrestoreView(_r4).index; const ctx_r1 = i0.ɵɵnextContext(3); return i0.ɵɵresetView(ctx_r1.setActiveStage($index_r5)); });
827
+ i0.ɵɵelementStart(5, "span", 34);
828
+ i0.ɵɵtext(6);
829
+ i0.ɵɵelementEnd();
830
+ i0.ɵɵelementStart(7, "div", 35)(8, "div", 36);
831
+ i0.ɵɵtext(9);
832
+ i0.ɵɵelementEnd();
833
+ i0.ɵɵtemplate(10, PipelineGeneratorComponent_Conditional_1_mat_accordion_5_ng_container_12_div_10_Template, 2, 0, "div", 37);
834
+ i0.ɵɵpipe(11, "async");
835
+ i0.ɵɵelementEnd();
836
+ i0.ɵɵtemplate(12, PipelineGeneratorComponent_Conditional_1_mat_accordion_5_ng_container_12_button_12_Template, 5, 6, "button", 38);
837
+ i0.ɵɵpipe(13, "async");
838
+ i0.ɵɵpipe(14, "async");
839
+ i0.ɵɵelementEnd();
840
+ i0.ɵɵelement(15, "mat-divider");
841
+ i0.ɵɵtemplate(16, PipelineGeneratorComponent_Conditional_1_mat_accordion_5_ng_container_12_app_aggregate_stage_editor_16_Template, 1, 2, "app-aggregate-stage-editor", 39);
842
+ i0.ɵɵpipe(17, "async");
843
+ i0.ɵɵelementContainerEnd();
844
+ } if (rf & 2) {
845
+ const stage_r7 = ctx.$implicit;
846
+ const $index_r5 = ctx.index;
847
+ const ctx_r1 = i0.ɵɵnextContext(3);
848
+ i0.ɵɵadvance();
849
+ i0.ɵɵstyleProp("margin-top", i0.ɵɵpipeBind1(2, 10, ctx_r1.activeStageIndex) === $index_r5 ? "4px" : "0px");
850
+ i0.ɵɵclassProp("mat-elevation-z8", i0.ɵɵpipeBind1(3, 12, ctx_r1.activeStageIndex) === $index_r5);
851
+ i0.ɵɵproperty("activated", i0.ɵɵpipeBind1(4, 14, ctx_r1.activeStageIndex) === $index_r5);
852
+ i0.ɵɵadvance(5);
853
+ i0.ɵɵtextInterpolate1("", $index_r5 + 1, " ");
854
+ i0.ɵɵadvance(3);
855
+ i0.ɵɵtextInterpolate1(" ", stage_r7.name || "Stage ", " ");
856
+ i0.ɵɵadvance();
857
+ i0.ɵɵproperty("ngIf", !stage_r7.name && i0.ɵɵpipeBind1(11, 16, ctx_r1.activeStageIndex) !== $index_r5);
858
+ i0.ɵɵadvance(2);
859
+ i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(13, 18, ctx_r1.activeStageIndex) === $index_r5 || !stage_r7.valid && i0.ɵɵpipeBind1(14, 20, ctx_r1.activeStageIndex) !== $index_r5);
860
+ i0.ɵɵadvance(4);
861
+ i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(17, 22, ctx_r1.activeStageIndex) === $index_r5);
862
+ } }
863
+ function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_mat_spinner_23_Template(rf, ctx) { if (rf & 1) {
864
+ i0.ɵɵelement(0, "mat-spinner", 30);
865
+ } }
866
+ function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_ng_container_28_lib_t_dynamic_data_view_1_Template(rf, ctx) { if (rf & 1) {
867
+ i0.ɵɵelement(0, "lib-t-dynamic-data-view", 49);
868
+ } if (rf & 2) {
869
+ const results_r9 = i0.ɵɵnextContext().ngIf;
870
+ i0.ɵɵproperty("data", results_r9);
871
+ } }
872
+ function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_ng_container_28_p_2_Template(rf, ctx) { if (rf & 1) {
873
+ i0.ɵɵelementStart(0, "p", 50);
874
+ i0.ɵɵtext(1, " No results available ");
875
+ i0.ɵɵelementEnd();
876
+ } }
877
+ function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_ng_container_28_Template(rf, ctx) { if (rf & 1) {
878
+ i0.ɵɵelementContainerStart(0);
879
+ i0.ɵɵtemplate(1, PipelineGeneratorComponent_Conditional_1_mat_accordion_5_ng_container_28_lib_t_dynamic_data_view_1_Template, 1, 1, "lib-t-dynamic-data-view", 47)(2, PipelineGeneratorComponent_Conditional_1_mat_accordion_5_ng_container_28_p_2_Template, 2, 0, "p", 48);
880
+ i0.ɵɵelementContainerEnd();
881
+ } if (rf & 2) {
882
+ const results_r9 = ctx.ngIf;
883
+ i0.ɵɵadvance();
884
+ i0.ɵɵproperty("ngIf", results_r9);
885
+ i0.ɵɵadvance();
886
+ i0.ɵɵproperty("ngIf", !results_r9);
887
+ } }
888
+ function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_ng_template_30_Template(rf, ctx) { if (rf & 1) {
889
+ i0.ɵɵelementStart(0, "p", 50);
890
+ i0.ɵɵtext(1, "No results available");
891
+ i0.ɵɵelementEnd();
892
+ } }
893
+ function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_mat_spinner_35_Template(rf, ctx) { if (rf & 1) {
894
+ i0.ɵɵelement(0, "mat-spinner", 51);
895
+ } }
896
+ function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_Conditional_40_Template(rf, ctx) { if (rf & 1) {
897
+ i0.ɵɵelementStart(0, "div", 22)(1, "mat-icon", 52);
898
+ i0.ɵɵtext(2, "error");
899
+ i0.ɵɵelementEnd();
900
+ i0.ɵɵelementStart(3, "span");
901
+ i0.ɵɵtext(4);
902
+ i0.ɵɵpipe(5, "async");
903
+ i0.ɵɵelementEnd()();
904
+ } if (rf & 2) {
905
+ const ctx_r1 = i0.ɵɵnextContext(3);
906
+ i0.ɵɵadvance(4);
907
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(5, 1, ctx_r1.schemaLoadError$), "");
908
+ } }
909
+ function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_mat_list_42_div_13_Template(rf, ctx) { if (rf & 1) {
910
+ i0.ɵɵelementStart(0, "div", 60)(1, "pre");
911
+ i0.ɵɵtext(2);
912
+ i0.ɵɵpipe(3, "json");
913
+ i0.ɵɵelementEnd()();
914
+ } if (rf & 2) {
915
+ const chat_r10 = i0.ɵɵnextContext().$implicit;
916
+ i0.ɵɵadvance(2);
917
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(3, 1, chat_r10.assistance.pipeline), "\n ");
918
+ } }
919
+ function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_mat_list_42_div_14_Template(rf, ctx) { if (rf & 1) {
920
+ i0.ɵɵelementStart(0, "div", 35);
921
+ i0.ɵɵtext(1);
922
+ i0.ɵɵelementEnd();
923
+ } if (rf & 2) {
924
+ const chat_r10 = i0.ɵɵnextContext().$implicit;
925
+ i0.ɵɵadvance();
926
+ i0.ɵɵtextInterpolate1(" ", chat_r10.assistance.error, " ");
927
+ } }
928
+ function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_mat_list_42_Template(rf, ctx) { if (rf & 1) {
929
+ i0.ɵɵelementStart(0, "mat-list")(1, "mat-list-item", 24)(2, "div", 53)(3, "div");
930
+ i0.ɵɵtext(4);
931
+ i0.ɵɵelementEnd();
932
+ i0.ɵɵelementStart(5, "div", 54);
933
+ i0.ɵɵtext(6);
934
+ i0.ɵɵpipe(7, "daysAgo");
935
+ i0.ɵɵelementStart(8, "mat-icon", 55);
936
+ i0.ɵɵtext(9, " done_all ");
937
+ i0.ɵɵelementEnd()()()();
938
+ i0.ɵɵelementStart(10, "mat-list-item", 56)(11, "mat-icon", 57);
939
+ i0.ɵɵtext(12, "smart_toy");
940
+ i0.ɵɵelementEnd();
941
+ i0.ɵɵtemplate(13, PipelineGeneratorComponent_Conditional_1_mat_accordion_5_mat_list_42_div_13_Template, 4, 3, "div", 58)(14, PipelineGeneratorComponent_Conditional_1_mat_accordion_5_mat_list_42_div_14_Template, 2, 1, "div", 59);
942
+ i0.ɵɵelementEnd()();
943
+ } if (rf & 2) {
944
+ const chat_r10 = ctx.$implicit;
945
+ i0.ɵɵadvance(4);
946
+ i0.ɵɵtextInterpolate1(" ", chat_r10.user, " ");
947
+ i0.ɵɵadvance(2);
948
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(7, 4, chat_r10.date), " ");
949
+ i0.ɵɵadvance(7);
950
+ i0.ɵɵproperty("ngIf", !(chat_r10.assistance == null ? null : chat_r10.assistance.error));
951
+ i0.ɵɵadvance();
952
+ i0.ɵɵproperty("ngIf", chat_r10.assistance == null ? null : chat_r10.assistance.error);
953
+ } }
954
+ function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_mat_spinner_52_Template(rf, ctx) { if (rf & 1) {
955
+ i0.ɵɵelement(0, "mat-spinner", 61);
956
+ } }
957
+ function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_section_53_button_8_Template(rf, ctx) { if (rf & 1) {
958
+ const _r11 = i0.ɵɵgetCurrentView();
959
+ i0.ɵɵelementStart(0, "button", 68);
960
+ i0.ɵɵlistener("click", function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_section_53_button_8_Template_button_click_0_listener() { const method_r12 = i0.ɵɵrestoreView(_r11).$implicit; const ctx_r1 = i0.ɵɵnextContext(4); return i0.ɵɵresetView(ctx_r1.selectSuggestionInput(method_r12.value)); });
961
+ i0.ɵɵtext(1);
962
+ i0.ɵɵpipe(2, "titlecase");
963
+ i0.ɵɵelementEnd();
964
+ } if (rf & 2) {
965
+ const method_r12 = ctx.$implicit;
966
+ i0.ɵɵadvance();
967
+ i0.ɵɵtextInterpolate1(" ", i0.ɵɵpipeBind1(2, 1, method_r12.label), " ");
968
+ } }
969
+ function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_section_53_Template(rf, ctx) { if (rf & 1) {
970
+ i0.ɵɵelementStart(0, "section", 62);
971
+ i0.ɵɵelement(1, "mat-divider");
972
+ i0.ɵɵelementStart(2, "div", 63)(3, "div", 64)(4, "div", 65)(5, "h5");
973
+ i0.ɵɵtext(6, "Collection document properties");
974
+ i0.ɵɵelementEnd();
975
+ i0.ɵɵelementStart(7, "div", 66);
976
+ i0.ɵɵtemplate(8, PipelineGeneratorComponent_Conditional_1_mat_accordion_5_section_53_button_8_Template, 3, 3, "button", 67);
977
+ i0.ɵɵpipe(9, "async");
978
+ i0.ɵɵelementEnd()()()()();
979
+ } if (rf & 2) {
980
+ const ctx_r1 = i0.ɵɵnextContext(3);
981
+ i0.ɵɵadvance(8);
982
+ i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind1(9, 2, ctx_r1.getSchemaProperties))("ngForTrackBy", ctx_r1.trackById);
983
+ } }
984
+ function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_Template(rf, ctx) { if (rf & 1) {
985
+ const _r3 = i0.ɵɵgetCurrentView();
986
+ i0.ɵɵelementStart(0, "mat-accordion", 7)(1, "mat-expansion-panel", 8)(2, "mat-expansion-panel-header")(3, "mat-panel-title");
987
+ i0.ɵɵtemplate(4, PipelineGeneratorComponent_Conditional_1_mat_accordion_5_mat_spinner_4_Template, 1, 0, "mat-spinner", 9);
988
+ i0.ɵɵelementStart(5, "mat-icon", 10);
989
+ i0.ɵɵtext(6, " dynamic_form ");
990
+ i0.ɵɵelementEnd();
991
+ i0.ɵɵtext(7);
992
+ i0.ɵɵelementEnd()();
993
+ i0.ɵɵelementStart(8, "div", 11);
994
+ i0.ɵɵtemplate(9, PipelineGeneratorComponent_Conditional_1_mat_accordion_5_div_9_Template, 7, 0, "div", 12);
995
+ i0.ɵɵpipe(10, "async");
996
+ i0.ɵɵelementStart(11, "mat-nav-list", 13);
997
+ i0.ɵɵtemplate(12, PipelineGeneratorComponent_Conditional_1_mat_accordion_5_ng_container_12_Template, 18, 24, "ng-container", 14);
998
+ i0.ɵɵpipe(13, "async");
999
+ i0.ɵɵelementStart(14, "mat-toolbar", 15);
1000
+ i0.ɵɵelement(15, "span", 16);
1001
+ i0.ɵɵelementStart(16, "button", 17);
1002
+ i0.ɵɵlistener("click", function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_Template_button_click_16_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.addStage()); });
1003
+ i0.ɵɵtext(17, " Add ");
1004
+ i0.ɵɵelementStart(18, "mat-icon");
1005
+ i0.ɵɵtext(19, "add");
1006
+ i0.ɵɵelementEnd()()()()()();
1007
+ i0.ɵɵelementStart(20, "mat-expansion-panel", 18)(21, "mat-expansion-panel-header")(22, "mat-panel-title");
1008
+ i0.ɵɵtemplate(23, PipelineGeneratorComponent_Conditional_1_mat_accordion_5_mat_spinner_23_Template, 1, 0, "mat-spinner", 9);
1009
+ i0.ɵɵelementStart(24, "mat-icon", 10);
1010
+ i0.ɵɵtext(25, "dataset");
1011
+ i0.ɵɵelementEnd();
1012
+ i0.ɵɵtext(26);
1013
+ i0.ɵɵelementEnd()();
1014
+ i0.ɵɵelementStart(27, "div", 11);
1015
+ i0.ɵɵtemplate(28, PipelineGeneratorComponent_Conditional_1_mat_accordion_5_ng_container_28_Template, 3, 2, "ng-container", 19);
1016
+ i0.ɵɵpipe(29, "async");
1017
+ i0.ɵɵtemplate(30, PipelineGeneratorComponent_Conditional_1_mat_accordion_5_ng_template_30_Template, 2, 0, "ng-template", null, 0, i0.ɵɵtemplateRefExtractor);
1018
+ i0.ɵɵelementEnd()();
1019
+ i0.ɵɵelementStart(32, "mat-expansion-panel", 20)(33, "mat-expansion-panel-header")(34, "mat-panel-title");
1020
+ i0.ɵɵtemplate(35, PipelineGeneratorComponent_Conditional_1_mat_accordion_5_mat_spinner_35_Template, 1, 0, "mat-spinner", 21);
1021
+ i0.ɵɵelementStart(36, "mat-icon", 10);
1022
+ i0.ɵɵtext(37, "tips_and_updates");
1023
+ i0.ɵɵelementEnd();
1024
+ i0.ɵɵtext(38);
1025
+ i0.ɵɵelementEnd()();
1026
+ i0.ɵɵelementStart(39, "div", 11);
1027
+ i0.ɵɵtemplate(40, PipelineGeneratorComponent_Conditional_1_mat_accordion_5_Conditional_40_Template, 6, 3, "div", 22);
1028
+ i0.ɵɵpipe(41, "async");
1029
+ i0.ɵɵtemplate(42, PipelineGeneratorComponent_Conditional_1_mat_accordion_5_mat_list_42_Template, 15, 6, "mat-list", 23);
1030
+ i0.ɵɵpipe(43, "async");
1031
+ i0.ɵɵelementStart(44, "mat-list")(45, "mat-list-item", 24)(46, "textarea", 25, 1);
1032
+ i0.ɵɵpipe(48, "async");
1033
+ i0.ɵɵlistener("input", function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_Template_textarea_input_46_listener($event) { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.onTextChange($event)); });
1034
+ i0.ɵɵelementEnd();
1035
+ i0.ɵɵelementStart(49, "button", 26);
1036
+ i0.ɵɵlistener("click", function PipelineGeneratorComponent_Conditional_1_mat_accordion_5_Template_button_click_49_listener() { i0.ɵɵrestoreView(_r3); const ctx_r1 = i0.ɵɵnextContext(2); return i0.ɵɵresetView(ctx_r1.promptSubmit()); });
1037
+ i0.ɵɵelementStart(50, "mat-icon", 27);
1038
+ i0.ɵɵtext(51, "send");
1039
+ i0.ɵɵelementEnd();
1040
+ i0.ɵɵtemplate(52, PipelineGeneratorComponent_Conditional_1_mat_accordion_5_mat_spinner_52_Template, 1, 0, "mat-spinner", 28);
1041
+ i0.ɵɵelementEnd()()();
1042
+ i0.ɵɵtemplate(53, PipelineGeneratorComponent_Conditional_1_mat_accordion_5_section_53_Template, 10, 4, "section", 29);
1043
+ i0.ɵɵelementEnd()()();
1044
+ } if (rf & 2) {
1045
+ let tmp_6_0;
1046
+ const noResults_r13 = i0.ɵɵreference(31);
1047
+ const ctx_r1 = i0.ɵɵnextContext(2);
1048
+ i0.ɵɵadvance(4);
1049
+ i0.ɵɵproperty("ngIf", ctx_r1.isRunningPipeline);
1050
+ i0.ɵɵadvance(3);
1051
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.isRunningPipeline ? "Executing current Data pipeline..." : "Data retrieval pipeline", " ");
1052
+ i0.ɵɵadvance(2);
1053
+ i0.ɵɵproperty("ngIf", (((tmp_6_0 = i0.ɵɵpipeBind1(10, 18, ctx_r1.stages)) == null ? null : tmp_6_0.length) || 0) === 0);
1054
+ i0.ɵɵadvance(3);
1055
+ i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind1(13, 20, ctx_r1.stages))("ngForTrackBy", ctx_r1.trackById);
1056
+ i0.ɵɵadvance(4);
1057
+ i0.ɵɵproperty("disabled", ctx_r1.isRunningPipeline);
1058
+ i0.ɵɵadvance(7);
1059
+ i0.ɵɵproperty("ngIf", ctx_r1.isRunningPipeline);
1060
+ i0.ɵɵadvance(3);
1061
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.isRunningPipeline ? "Running pipeline..." : "Data Results", " ");
1062
+ i0.ɵɵadvance(2);
1063
+ i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(29, 22, ctx_r1.pipeLineResults))("ngIfElse", noResults_r13);
1064
+ i0.ɵɵadvance(7);
1065
+ i0.ɵɵproperty("ngIf", ctx_r1.aiIsGeneratingPipeline);
1066
+ i0.ɵɵadvance(3);
1067
+ i0.ɵɵtextInterpolate1(" ", ctx_r1.aiIsGeneratingPipeline ? "Agent busy ..." : "AI AGENT prompt", " ");
1068
+ i0.ɵɵadvance(2);
1069
+ i0.ɵɵconditional(i0.ɵɵpipeBind1(41, 24, ctx_r1.schemaLoadError$) ? 40 : -1);
1070
+ i0.ɵɵadvance(2);
1071
+ i0.ɵɵproperty("ngForOf", i0.ɵɵpipeBind1(43, 26, ctx_r1.chatHistory));
1072
+ i0.ɵɵadvance(4);
1073
+ i0.ɵɵproperty("value", i0.ɵɵpipeBind1(48, 28, ctx_r1.prompt));
1074
+ i0.ɵɵadvance(3);
1075
+ i0.ɵɵproperty("disabled", ctx_r1.aiIsGeneratingPipeline);
1076
+ i0.ɵɵadvance(3);
1077
+ i0.ɵɵproperty("ngIf", ctx_r1.aiIsGeneratingPipeline);
1078
+ i0.ɵɵadvance();
1079
+ i0.ɵɵproperty("ngIf", ctx_r1.showSuggestions);
1080
+ } }
1081
+ function PipelineGeneratorComponent_Conditional_1_Template(rf, ctx) { if (rf & 1) {
1082
+ const _r1 = i0.ɵɵgetCurrentView();
1083
+ i0.ɵɵelementStart(0, "section", 4)(1, "p");
1084
+ i0.ɵɵtext(2, "MongoDB aggregation pipeline builder for selected workflows. ");
1085
+ i0.ɵɵelementEnd()();
1086
+ i0.ɵɵelementStart(3, "lib-t-workflow-picker", 5);
1087
+ i0.ɵɵpipe(4, "async");
1088
+ i0.ɵɵlistener("valueChanged", function PipelineGeneratorComponent_Conditional_1_Template_lib_t_workflow_picker_valueChanged_3_listener($event) { i0.ɵɵrestoreView(_r1); const ctx_r1 = i0.ɵɵnextContext(); return i0.ɵɵresetView(ctx_r1.workflowChanged($event)); });
1089
+ i0.ɵɵelementEnd();
1090
+ i0.ɵɵtemplate(5, PipelineGeneratorComponent_Conditional_1_mat_accordion_5_Template, 54, 30, "mat-accordion", 6);
1091
+ i0.ɵɵpipe(6, "async");
1092
+ } if (rf & 2) {
1093
+ const ctx_r1 = i0.ɵɵnextContext();
1094
+ i0.ɵɵadvance(3);
1095
+ i0.ɵɵproperty("getWorkflowOptions", ctx_r1.workflowOptions)("value", i0.ɵɵpipeBind1(4, 3, ctx_r1.workflowId));
1096
+ i0.ɵɵadvance(2);
1097
+ i0.ɵɵproperty("ngIf", i0.ɵɵpipeBind1(6, 5, ctx_r1.workflowId));
1098
+ } }
1099
+ class PipelineGeneratorComponent {
1100
+ static { this.nextId = 0; }
1101
+ constructor(ngControl, _elementRef) {
1102
+ this.ngControl = ngControl;
1103
+ this._elementRef = _elementRef;
1104
+ this.stateChanges = new Subject();
1105
+ this.NGX_T_FORMS_CONFIG = inject(NGX_T_FORMS_CONFIG_TOKEN);
1106
+ this.id = `app-pipeline-generator-${PipelineGeneratorComponent.nextId++}`;
1107
+ this.placeholder = '';
1108
+ this.focused = false;
1109
+ this.required = false;
1110
+ this.disabled = false;
1111
+ this.touched = false;
1112
+ this.onTouched = () => { };
1113
+ this.workflowOptions = [];
1114
+ this.loadingWorkflowOptions = false;
1115
+ this.workflowsInitialized = false;
1116
+ this.valueChanged = new EventEmitter();
1117
+ this.errors = [];
1118
+ this.destroy$ = new Subject();
1119
+ this.pipeline = new PipelineService();
1120
+ this.initiated = false;
1121
+ this.initiateSubscription = () => {
1122
+ this.pipeline.config$.pipe(takeUntil(this.destroy$), distinctUntilChanged((prev, curr) => JSON.stringify(prev) === JSON.stringify(curr))).subscribe(config => {
1123
+ if (!this.initiated) {
1124
+ this.initiated = true;
1125
+ return;
1126
+ }
1127
+ const newConfig = {
1128
+ ...this._value,
1129
+ ...config,
1130
+ "source": "mongoPipeline",
1131
+ };
1132
+ console.log('Pipeline config changed', newConfig);
1133
+ this.valueChanged.emit(newConfig);
1134
+ });
1135
+ };
1136
+ this.cursorPosition = 0;
1137
+ this.showSuggestions = false;
1138
+ this.optionsSearch = '';
1139
+ this.trackById = (index, stage) => index;
1140
+ }
1141
+ get empty() {
1142
+ return !this.value;
1143
+ }
1144
+ get shouldLabelFloat() {
1145
+ return this.focused || !this.empty;
1146
+ }
1147
+ get errorState() {
1148
+ const hasError = !!this.ngControl?.control?.errors || (this.errors || []).length > 0 && this.touched;
1149
+ return !this.value && !!this.required || hasError;
1150
+ }
1151
+ setDescribedByIds(ids) {
1152
+ // Ensure the component view is initialized
1153
+ if (this._elementRef && this._elementRef.nativeElement) {
1154
+ const controlElement = this._elementRef.nativeElement.querySelector('.app-pipeline-generator');
1155
+ // Check if the controlElement exists before attempting to set its attribute
1156
+ if (controlElement) {
1157
+ controlElement.setAttribute('aria-describedby', ids.join(' '));
1158
+ }
1159
+ }
1160
+ }
1161
+ onContainerClick(event) {
1162
+ this.markAsTouched();
1163
+ this.stateChanges.next();
1164
+ }
1165
+ markAsTouched() {
1166
+ console.log('markAsTouched');
1167
+ if (!this.touched) {
1168
+ this.onTouched();
1169
+ this.touched = true;
1170
+ }
1171
+ }
1172
+ set value(value) {
1173
+ const workflowIdChanged = this._value?.workflowId !== value?.workflowId;
1174
+ const pipelineLengthChanged = this._value?.pipeline?.length !== value?.pipeline?.length;
1175
+ const pipeLineContentChanged = JSON.stringify(this._value?.pipeline) !== JSON.stringify(value?.pipeline);
1176
+ if (workflowIdChanged || pipelineLengthChanged || pipeLineContentChanged) {
1177
+ this._value = value;
1178
+ if (value?.workflowId) {
1179
+ this.workflowChanged(value?.workflowId);
1180
+ }
1181
+ console.log('Pipeline value changed', value, this.pipeline.pipeline$.value);
1182
+ if (value?.pipeline) {
1183
+ this.pipeline.pipeline$.next(value?.pipeline || []);
1184
+ }
1185
+ }
1186
+ }
1187
+ set getWorkflowOptions(options$) {
1188
+ if (!this.workflowsInitialized && !!options$) {
1189
+ this.workflowsInitialized = true;
1190
+ this.loadingWorkflowOptions = true;
1191
+ options$.pipe(take(1), tap(options => {
1192
+ this.workflowOptions = options;
1193
+ this.loadingWorkflowOptions = false;
1194
+ })).subscribe();
1195
+ }
1196
+ }
1197
+ ngOnInit() {
1198
+ this.initiateSubscription();
1199
+ }
1200
+ ngOnDestroy() {
1201
+ this.destroy$.next();
1202
+ this.destroy$.complete();
1203
+ }
1204
+ workflowChanged(event) {
1205
+ this.pipeline.workflowChanged(event);
1206
+ }
1207
+ get workflowId() {
1208
+ return this.pipeline.workflowId$.asObservable();
1209
+ }
1210
+ get stages() {
1211
+ return this.pipeline.pipeline$.asObservable().pipe(map(stages => stages.map(stage => ({
1212
+ name: Object.keys(stage)[0],
1213
+ stage: Object.keys(stage)[0],
1214
+ config: stage[Object.keys(stage)?.[0] || ''],
1215
+ valid: !!Object.keys(stage)[0] && !!stage[Object.keys(stage)?.[0] || '']
1216
+ }))));
1217
+ }
1218
+ get pipeLineResults() {
1219
+ return this.pipeline.pipeLineResult$.asObservable();
1220
+ }
1221
+ get prompt() {
1222
+ return this.pipeline.prompt$.asObservable();
1223
+ }
1224
+ get aiIsGeneratingPipeline() {
1225
+ return this.pipeline.aiIsGeneratingPipeline;
1226
+ }
1227
+ get activeStageIndex() {
1228
+ return this.pipeline.activeStage$.asObservable();
1229
+ }
1230
+ get activeStage() {
1231
+ console.log(this.pipeline.activeStage);
1232
+ return this.pipeline.activeStage;
1233
+ }
1234
+ get isRunningPipeline() {
1235
+ return this.pipeline.isRunningPipeline;
1236
+ }
1237
+ get cannotAddStage() {
1238
+ return this.pipeline.pipelineGeneralValid.pipe(map(valid => !valid));
1239
+ }
1240
+ get schemaLoadError$() {
1241
+ return this.pipeline.schemaLoadError$.asObservable();
1242
+ }
1243
+ get chatHistory() {
1244
+ return this.pipeline.chatHistory$.asObservable();
1245
+ }
1246
+ onTextChange(event) {
1247
+ if (!this.textareaElementRef?.nativeElement) {
1248
+ return;
1249
+ }
1250
+ console.log('onTextChange', event);
1251
+ const newValue = event.target.value;
1252
+ const textarea = this.textareaElementRef.nativeElement;
1253
+ this.cursorPosition = textarea.selectionStart || 0;
1254
+ const lastChar = newValue[this.cursorPosition - 1];
1255
+ const match = newValue.slice(0, this.cursorPosition).match(/\$(\w*)$/);
1256
+ if (lastChar === '$' || (match && match[1] !== undefined)) {
1257
+ this.showSuggestions = true;
1258
+ this.optionsSearch = match ? match?.[1] || '' : '';
1259
+ }
1260
+ else {
1261
+ this.showSuggestions = false;
1262
+ this.optionsSearch = '';
1263
+ }
1264
+ this.pipeline.onTextChange(newValue);
1265
+ }
1266
+ selectSuggestionInput(suggestion) {
1267
+ this.pipeline.prompt$.asObservable().pipe(take(1), tap(prompt => {
1268
+ const match = prompt?.slice(0, this.cursorPosition).match(/\$(\w*)$/);
1269
+ const beforeCursor = prompt?.slice(0, match ? match.index : this.cursorPosition - 1);
1270
+ const afterCursor = prompt?.slice(this.cursorPosition);
1271
+ prompt = beforeCursor + suggestion + ' ' + afterCursor;
1272
+ this.pipeline.prompt$.next(prompt);
1273
+ this.applyNewValueToPrompt(suggestion);
1274
+ })).subscribe();
1275
+ }
1276
+ applyNewValueToPrompt(suggestion) {
1277
+ this.showSuggestions = false;
1278
+ const textarea = this.textareaElementRef.nativeElement;
1279
+ textarea.focus();
1280
+ const newCursorPosition = this.cursorPosition + suggestion.length;
1281
+ setTimeout(() => {
1282
+ textarea.setSelectionRange(newCursorPosition, newCursorPosition);
1283
+ }, 0);
1284
+ }
1285
+ onSearchChange(event) {
1286
+ this.optionsSearch = event.detail.value;
1287
+ }
1288
+ promptSubmit() {
1289
+ this.pipeline.promptSubmit();
1290
+ console.log('promptSubmit');
1291
+ }
1292
+ setActiveStage(index) {
1293
+ this.pipeline.setActiveStage(index);
1294
+ }
1295
+ addStage() {
1296
+ this.pipeline.addStage();
1297
+ }
1298
+ get getSchemaProperties() {
1299
+ return this.pipeline.schema$.asObservable().pipe(map(schema => Object.keys(schema || {}).map(key => ({ label: key, value: key, })).filter(key => this.optionsSearch ? key.label.toLowerCase().includes(this.optionsSearch.toLowerCase()) : true)));
1300
+ }
1301
+ deleteStage(index) {
1302
+ this.pipeline.deleteStage(index);
1303
+ }
1304
+ saveStage(index, stage) {
1305
+ this.pipeline.saveStage(index, stage);
1306
+ this.setActiveStage(undefined);
1307
+ }
1308
+ static { this.ɵfac = function PipelineGeneratorComponent_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || PipelineGeneratorComponent)(i0.ɵɵdirectiveInject(i1.NgControl, 10), i0.ɵɵdirectiveInject(i0.ElementRef)); }; }
1309
+ static { this.ɵcmp = /*@__PURE__*/ i0.ɵɵdefineComponent({ type: PipelineGeneratorComponent, selectors: [["app-pipeline-generator"]], viewQuery: function PipelineGeneratorComponent_Query(rf, ctx) { if (rf & 1) {
1310
+ i0.ɵɵviewQuery(_c0, 5, ElementRef);
1311
+ } if (rf & 2) {
1312
+ let _t;
1313
+ i0.ɵɵqueryRefresh(_t = i0.ɵɵloadQuery()) && (ctx.textareaElementRef = _t.first);
1314
+ } }, hostVars: 1, hostBindings: function PipelineGeneratorComponent_HostBindings(rf, ctx) { if (rf & 2) {
1315
+ i0.ɵɵhostProperty("id", ctx.id);
1316
+ } }, inputs: { value: "value", getWorkflowOptions: "getWorkflowOptions", userName: "userName", errors: "errors" }, outputs: { valueChanged: "valueChanged" }, features: [i0.ɵɵProvidersFeature([{ provide: MatFormFieldControl, useExisting: PipelineGeneratorComponent }])], decls: 2, vars: 2, consts: [["noResults", ""], ["textarea", ""], [2, "display", "flex", "flex-direction", "column", "justify-content", "center", "align-items", "center", "padding", "24px"], [2, "margin-bottom", "16px"], [1, "ion-margin"], [3, "valueChanged", "getWorkflowOptions", "value"], ["multi", "", 4, "ngIf"], ["multi", ""], ["value", "pipeline"], ["color", "accent", "class", "header-spinner", 4, "ngIf"], [1, "title-icon"], [1, "content"], ["class", "tree-instructions", 4, "ngIf"], [2, "background", "var(--mat-tree-container-background-color)", "padding", "0px", "border-radius", "8px"], [4, "ngFor", "ngForOf", "ngForTrackBy"], [2, "padding", "0px"], [1, "spacer"], ["color", "primary", "mat-raised-button", "", 1, "stage-button", 3, "click", "disabled"], ["value", "results"], [4, "ngIf", "ngIfElse"], ["value", "ai"], ["style", "position: absolute;", "class", "header-spinner", 4, "ngIf"], [1, "tree-instructions", 2, "background", "antiquewhite !important"], [4, "ngFor", "ngForOf"], [1, "chatContent", "chatItem"], ["matListItemTitle", "", "placeholder", "Provide a pipeline generation prompt", 1, "chat", 2, "width", "calc(100% - 13px)", "border-radius", "14px", "padding-right", "3px", "padding-left", "8px", 3, "input", "value"], ["matListItemMeta", "", "color", "primary", "mat-mini-fab", "", 2, "margin-left", "4px", "margin-right", "0px", 3, "click", "disabled"], [2, "margin", "0px !important", "color", "white"], ["color", "accent", "class", "submit-spinner", 4, "ngIf"], ["class", "showSuggestionContainer", 4, "ngIf"], ["color", "accent", 1, "header-spinner"], [1, "tree-instructions"], ["color", "primary", 1, "info-icon"], [1, "stage-item", 3, "click", "activated"], ["matListItemAvatar", "", 1, "stage-index"], ["matListItemTitle", ""], [2, "line-height", "normal"], ["class", "stage-inner-message", 4, "ngIf"], ["mat-icon-button", "", "matListItemMeta", "", 4, "ngIf"], [3, "selectedStage", "isRunningPipeline", "deleteStage", "saveStage", 4, "ngIf"], [1, "stage-inner-message"], ["mat-icon-button", "", "matListItemMeta", ""], ["color", "primary", 4, "ngIf"], ["color", "warn", 4, "ngIf"], ["color", "primary"], ["color", "warn"], [3, "deleteStage", "saveStage", "selectedStage", "isRunningPipeline"], [3, "data", 4, "ngIf"], ["color", "medium", 4, "ngIf"], [3, "data"], ["color", "medium"], [1, "header-spinner", 2, "position", "absolute"], ["color", "warn", 1, "info-icon"], ["matListItemTitle", "", 1, "chat", 2, "background", "bisque", "text-align", "end", "border-radius", "18px 18px 0px 18px"], [2, "opacity", "0.6", "line-height", "normal", "display", "flex", "align-items", "center", "justify-content", "flex-end"], [1, "sent-icon"], ["color", "light", "lines", "full", 1, "chatContent", "chatItem", 2, "margin-top", "16px"], ["matListItemIcon", "", 2, "margin-left", "0px", "margin-top", "16px", "margin-bottom", "auto"], ["class", "chat", "style", "text-align: left; \n padding-left: 16px; \n background: azure;\n border-radius: 0px 18px 18px 18px;", "matListItemTitle", "", 4, "ngIf"], ["matListItemTitle", "", 4, "ngIf"], ["matListItemTitle", "", 1, "chat", 2, "text-align", "left", "padding-left", "16px", "background", "azure", "border-radius", "0px 18px 18px 18px"], ["color", "accent", 1, "submit-spinner"], [1, "showSuggestionContainer"], [2, "padding", "8px"], [1, "suggestion-container"], [1, "suggestion-column"], [1, "button-container"], ["color", "accent", "mat-flat-button", "", "class", "suggestion-button", 3, "click", 4, "ngFor", "ngForOf", "ngForTrackBy"], ["color", "accent", "mat-flat-button", "", 1, "suggestion-button", 3, "click"]], template: function PipelineGeneratorComponent_Template(rf, ctx) { if (rf & 1) {
1317
+ i0.ɵɵtemplate(0, PipelineGeneratorComponent_Conditional_0_Template, 4, 0, "div", 2)(1, PipelineGeneratorComponent_Conditional_1_Template, 7, 7);
1318
+ } if (rf & 2) {
1319
+ i0.ɵɵconditional(!!ctx.loadingWorkflowOptions ? 0 : -1);
1320
+ i0.ɵɵadvance();
1321
+ i0.ɵɵconditional(!ctx.loadingWorkflowOptions ? 1 : -1);
1322
+ } }, dependencies: [CommonModule, i2.NgForOf, i2.NgIf, i2.AsyncPipe, i2.JsonPipe, i2.TitleCasePipe, TWorkflowPickerComponent,
1323
+ FormsModule,
1324
+ TDynamicDataViewComponent,
1325
+ MatModulesModule, i2$1.MatButton, i2$1.MatIconButton, i2$1.MatMiniFabButton, i4.MatDivider, i5.MatAccordion, i5.MatExpansionPanel, i5.MatExpansionPanelHeader, i5.MatExpansionPanelTitle, i6.MatIcon, i6$1.MatList, i6$1.MatNavList, i6$1.MatListItem, i6$1.MatListItemAvatar, i6$1.MatListItemIcon, i6$1.MatListItemTitle, i6$1.MatListItemMeta, i7$1.MatProgressSpinner, i9.MatToolbar, AggregateStageEditorComponent,
1326
+ DaysAgoPipe], styles: ["ion-card[_ngcontent-%COMP%]{margin:0 auto}.head[_ngcontent-%COMP%]{font-weight:500;font-size:.9rem;padding-left:8px}.chat[_ngcontent-%COMP%]{margin-top:0;padding-bottom:8px;padding-top:9px;padding-right:16px;white-space:normal;font-size:.8rem}.icon[_ngcontent-%COMP%]{margin-top:auto;margin-bottom:auto;margin-right:16px}.container[_ngcontent-%COMP%]{max-width:600px;margin:0 auto}ion-accordion-group[_ngcontent-%COMP%]{margin:16px}ion-icon[_ngcontent-%COMP%]{margin-right:16PX}.suggestion-container[_ngcontent-%COMP%]{display:flex;width:100%;gap:14px}.suggestion-column[_ngcontent-%COMP%]{flex:1;min-width:0}.button-container[_ngcontent-%COMP%]{display:flex;flex-wrap:wrap}.suggestion-button[_ngcontent-%COMP%]{height:auto;text-transform:capitalize;margin:2px;padding:8px;line-height:normal;text-align:left;font-size:.8em}h5[_ngcontent-%COMP%]{margin-bottom:8px;font-size:1em}mat-expansion-panel-header[_ngcontent-%COMP%]{padding-left:16px;padding-right:16px}mat-expansion-panel[_ngcontent-%COMP%]{background:var(--mat-toolbar-container-background-color, var(--mat-app-surface))}mat-form-field[_ngcontent-%COMP%]{width:100%;background:azure}.chatItem[_ngcontent-%COMP%]{padding:0}.chatItem[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{margin-left:16px;margin-right:16px}.chatContent[_ngcontent-%COMP%]{height:fit-content!important}.stage-button[_ngcontent-%COMP%]{margin:4px}.stage-index[_ngcontent-%COMP%]{font-size:14px;display:flex;width:28px;height:28px;justify-content:center;background:azure;align-items:center;border:solid var(--mat-divider-color, var(--mat-app-outline)) 1px}.stage-inner-message[_ngcontent-%COMP%]{font-size:14px;display:flex;line-height:normal;opacity:.6}.stage-item[_ngcontent-%COMP%]{height:54px!important}.tree-instructions[_ngcontent-%COMP%]{display:flex;align-items:center;gap:8px;padding:12px;background:azure;border-radius:4px;margin-bottom:16px}.info-icon[_ngcontent-%COMP%]{min-width:38px!important;display:block}.title-icon[_ngcontent-%COMP%]{margin-right:8px;vertical-align:middle}.header-spinner[_ngcontent-%COMP%]{position:absolute;width:24px!important;height:24px!important}.sent-icon[_ngcontent-%COMP%]{font-size:14px;height:14px;margin-right:0!important;margin-left:0!important}.submit-spinner[_ngcontent-%COMP%]{position:absolute;width:40px!important;right:-8px;top:-20px;height:40px!important;--mdc-circular-progress-size: 40px !important;--mdc-circular-progress-active-indicator-width: 40px !important}"] }); }
1327
+ }
1328
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(PipelineGeneratorComponent, [{
1329
+ type: Component,
1330
+ args: [{ selector: 'app-pipeline-generator', standalone: true, imports: [
1331
+ CommonModule,
1332
+ TWorkflowPickerComponent,
1333
+ FormsModule,
1334
+ TDynamicDataViewComponent,
1335
+ MatModulesModule,
1336
+ AggregateStageEditorComponent,
1337
+ DaysAgoPipe
1338
+ ], providers: [{ provide: MatFormFieldControl, useExisting: PipelineGeneratorComponent }], template: "@if(!!loadingWorkflowOptions){\n<div style=\"display: flex; flex-direction: column; justify-content: center; align-items: center; padding: 24px;\">\n <mat-spinner style=\"margin-bottom: 16px;\"></mat-spinner>\n <p>\n Loading workflows...\n </p>\n</div>\n}\n\n@if(!loadingWorkflowOptions){\n<section class=\"ion-margin\">\n <p>MongoDB aggregation pipeline builder for selected workflows. </p>\n</section>\n<lib-t-workflow-picker \n(valueChanged)=\"workflowChanged($event)\" \n[getWorkflowOptions]=\" workflowOptions\"\n [value]=\"workflowId|async\">\n</lib-t-workflow-picker>\n<mat-accordion multi *ngIf=\"workflowId|async\">\n <!-- Pipeline Accordion -->\n <mat-expansion-panel value=\"pipeline\">\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-spinner color=\"accent\" *ngIf=\"isRunningPipeline\" class=\"header-spinner\"></mat-spinner>\n <mat-icon class=\"title-icon\">\n dynamic_form\n </mat-icon>\n {{isRunningPipeline?'Executing current Data pipeline...':'Data retrieval pipeline'}}\n </mat-panel-title>\n\n </mat-expansion-panel-header>\n <div class=\"content\">\n <!-- Mongodb aggregate pipelione stages management and edit start-->\n <div *ngIf=\"((stages | async)?.length || 0) ===0\" class=\"tree-instructions\">\n <mat-icon class=\"info-icon\" color=\"primary\">info</mat-icon>\n <span>\n Add stages to the pipeline below.<br>\n Each stage processes input documents by filtering, grouping, or calculating values. The output documents from\n one stage are passed to the next stage in the pipeline.\n </span>\n </div>\n\n <mat-nav-list style=\" background: var(--mat-tree-container-background-color);padding:0px;border-radius:8px\">\n\n\n <ng-container *ngFor=\"let stage of stages | async; trackBy: trackById;index as $index;last as isLast\">\n <mat-list-item [style.margin-top]=\"(activeStageIndex|async) ===$index?'4px':'0px'\"\n [class.mat-elevation-z8]=\"(activeStageIndex|async) ===$index\" class=\"stage-item\"\n (click)=\"setActiveStage($index)\" [activated]=\" (activeStageIndex|async) ===$index\">\n <span class=\"stage-index\" matListItemAvatar>{{$index + 1}} </span>\n <div matListItemTitle>\n <div style=\"line-height: normal;\">\n {{ stage.name || 'Stage ' }}\n </div>\n <div class=\"stage-inner-message\" *ngIf=\"!stage.name && (activeStageIndex|async) !==$index \">\n Incomplete , click to edit\n </div>\n\n </div>\n\n <button *ngIf=\"(activeStageIndex|async) ===$index||!stage.valid && (activeStageIndex|async) !==$index\"\n mat-icon-button matListItemMeta>\n <mat-icon color=\"primary\" *ngIf=\"(activeStageIndex|async) ===$index\">check_circle</mat-icon>\n\n <mat-icon color=\"warn\" *ngIf=\"!stage.valid && (activeStageIndex|async) !==$index\">\n warning\n </mat-icon>\n </button>\n </mat-list-item>\n <mat-divider></mat-divider>\n\n <app-aggregate-stage-editor [selectedStage]=\"stage\" [isRunningPipeline]=\"isRunningPipeline\"\n (deleteStage)=\"deleteStage($index)\" (saveStage)=\"saveStage($index,$event)\"\n *ngIf=\"(activeStageIndex|async) ===$index\"></app-aggregate-stage-editor>\n\n\n </ng-container>\n\n <mat-toolbar style=\"padding: 0px;\">\n\n <span class=\"spacer\"></span>\n <button class=\"stage-button\" [disabled]=\"isRunningPipeline\" color=\"primary\" (click)=\"addStage()\"\n mat-raised-button>\n Add\n <mat-icon>add</mat-icon>\n </button>\n </mat-toolbar>\n </mat-nav-list>\n\n <!-- Mongodb aggregate pipelione stages management and edit end -->\n </div>\n </mat-expansion-panel>\n\n <!-- Results Accordion -->\n <mat-expansion-panel value=\"results\">\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-spinner color=\"accent\" *ngIf=\"isRunningPipeline\" class=\"header-spinner\"></mat-spinner>\n <mat-icon class=\"title-icon\">dataset</mat-icon>\n {{isRunningPipeline?'Running pipeline...':'Data Results'}}\n </mat-panel-title>\n </mat-expansion-panel-header>\n <div class=\"content\">\n <ng-container *ngIf=\"pipeLineResults | async as results; else noResults\">\n\n <lib-t-dynamic-data-view *ngIf=\"results\" [data]=\"results\"></lib-t-dynamic-data-view>\n <p *ngIf=\"!results\" color=\"medium\">\n\n No results available\n\n </p>\n\n </ng-container>\n <ng-template #noResults>\n <p color=\"medium\">No results available</p>\n </ng-template>\n </div>\n </mat-expansion-panel>\n\n <!-- AI Agent Accordion -->\n <mat-expansion-panel value=\"ai\">\n <mat-expansion-panel-header>\n <mat-panel-title>\n <mat-spinner *ngIf=\" aiIsGeneratingPipeline \" style=\"position: absolute;\" class=\"header-spinner\"></mat-spinner>\n <mat-icon class=\"title-icon\">tips_and_updates</mat-icon>\n {{ aiIsGeneratingPipeline ? 'Agent busy ...' : 'AI AGENT prompt' }}\n </mat-panel-title>\n </mat-expansion-panel-header>\n\n <div class=\"content\">\n @if( schemaLoadError$ | async){\n <div class=\"tree-instructions\" style=\"background: antiquewhite !important;\">\n <mat-icon class=\"info-icon\" color=\"warn\">error</mat-icon>\n <span> {{ schemaLoadError$ | async }}</span>\n </div>\n \n }\n <mat-list *ngFor=\"let chat of chatHistory|async;\">\n\n <mat-list-item class=\"chatContent chatItem\">\n <div class=\"chat\" style=\"background:bisque;text-align:end;\n border-radius: 18px 18px 0px 18px;\" matListItemTitle>\n <div>\n {{chat.user}}\n </div>\n <div style=\"opacity:0.6;line-height: normal;display: flex;align-items: center;justify-content: flex-end;\">\n {{chat.date|daysAgo}}\n <mat-icon class=\"sent-icon\">\n done_all\n </mat-icon>\n </div>\n </div>\n </mat-list-item>\n\n <mat-list-item style=\"margin-top: 16px;\" class=\"chatContent chatItem\" color=\"light\" lines=\"full\">\n <mat-icon style=\" margin-left: 0px;\n margin-top: 16px;\n margin-bottom: auto;\" matListItemIcon>smart_toy</mat-icon>\n <div class=\"chat\" style=\"text-align: left; \n padding-left: 16px; \n background: azure;\n border-radius: 0px 18px 18px 18px;\" *ngIf=\"!chat.assistance?.error\" matListItemTitle>\n <pre>\n {{chat. assistance.pipeline |json}}\n </pre>\n </div>\n <div *ngIf=\"chat.assistance?.error\" matListItemTitle>\n {{chat.assistance.error}}\n </div>\n </mat-list-item>\n\n\n </mat-list>\n <mat-list>\n <mat-list-item class=\"chatContent chatItem\">\n <textarea matListItemTitle #textarea style=\" width: calc(100% - 13px);\n border-radius: 14px;\n padding-right: 3px;\n padding-left: 8px;\" class=\"chat\" [value]=\" prompt|async\" (input)=\"onTextChange($event)\"\n placeholder=\"Provide a pipeline generation prompt\"></textarea>\n <button matListItemMeta style=\" margin-left: 4px;\n margin-right: 0px;\" color=\"primary\" mat-mini-fab [disabled]=\"aiIsGeneratingPipeline\" (click)=\"promptSubmit()\">\n\n <mat-icon style=\"margin: 0px !important;color:white\">send</mat-icon>\n <mat-spinner color=\"accent\" *ngIf=\" aiIsGeneratingPipeline \" \n class=\"submit-spinner\" ></mat-spinner>\n </button>\n \n </mat-list-item>\n\n </mat-list>\n\n\n <section *ngIf=\"showSuggestions\" class=\"showSuggestionContainer\">\n <!-- <mat-toolbar class=\"search-container\" style=\"background: inherit;\">\n\n\n <input type=\"search\" placeholder=\"Search options\" class=\"search-field\" (change)=\"onSearchChange($event)\">\n\n <mat-icon>\n search\n </mat-icon>\n </mat-toolbar> -->\n <mat-divider></mat-divider>\n <div style=\"padding: 8px;\">\n <div class=\"suggestion-container\">\n <div class=\"suggestion-column\">\n <h5>Collection document properties</h5>\n <div class=\"button-container\">\n <button *ngFor=\"let method of getSchemaProperties | async;trackBy: trackById\"\n (click)=\"selectSuggestionInput(method.value)\" color=\"accent\" mat-flat-button\n class=\"suggestion-button\">\n {{ method.label | titlecase }}\n </button>\n </div>\n </div>\n\n </div>\n\n\n </div>\n </section>\n\n\n\n\n\n\n\n </div>\n </mat-expansion-panel>\n</mat-accordion>\n\n\n}", styles: ["ion-card{margin:0 auto}.head{font-weight:500;font-size:.9rem;padding-left:8px}.chat{margin-top:0;padding-bottom:8px;padding-top:9px;padding-right:16px;white-space:normal;font-size:.8rem}.icon{margin-top:auto;margin-bottom:auto;margin-right:16px}.container{max-width:600px;margin:0 auto}ion-accordion-group{margin:16px}ion-icon{margin-right:16PX}.suggestion-container{display:flex;width:100%;gap:14px}.suggestion-column{flex:1;min-width:0}.button-container{display:flex;flex-wrap:wrap}.suggestion-button{height:auto;text-transform:capitalize;margin:2px;padding:8px;line-height:normal;text-align:left;font-size:.8em}h5{margin-bottom:8px;font-size:1em}mat-expansion-panel-header{padding-left:16px;padding-right:16px}mat-expansion-panel{background:var(--mat-toolbar-container-background-color, var(--mat-app-surface))}mat-form-field{width:100%;background:azure}.chatItem{padding:0}.chatItem mat-icon{margin-left:16px;margin-right:16px}.chatContent{height:fit-content!important}.stage-button{margin:4px}.stage-index{font-size:14px;display:flex;width:28px;height:28px;justify-content:center;background:azure;align-items:center;border:solid var(--mat-divider-color, var(--mat-app-outline)) 1px}.stage-inner-message{font-size:14px;display:flex;line-height:normal;opacity:.6}.stage-item{height:54px!important}.tree-instructions{display:flex;align-items:center;gap:8px;padding:12px;background:azure;border-radius:4px;margin-bottom:16px}.info-icon{min-width:38px!important;display:block}.title-icon{margin-right:8px;vertical-align:middle}.header-spinner{position:absolute;width:24px!important;height:24px!important}.sent-icon{font-size:14px;height:14px;margin-right:0!important;margin-left:0!important}.submit-spinner{position:absolute;width:40px!important;right:-8px;top:-20px;height:40px!important;--mdc-circular-progress-size: 40px !important;--mdc-circular-progress-active-indicator-width: 40px !important}\n"] }]
1339
+ }], () => [{ type: i1.NgControl, decorators: [{
1340
+ type: Optional
1341
+ }, {
1342
+ type: Self
1343
+ }] }, { type: i0.ElementRef }], { id: [{
1344
+ type: HostBinding
1345
+ }], textareaElementRef: [{
1346
+ type: ViewChild,
1347
+ args: ['textarea', { read: ElementRef, static: false }]
1348
+ }], value: [{
1349
+ type: Input
1350
+ }], getWorkflowOptions: [{
1351
+ type: Input
1352
+ }], userName: [{
1353
+ type: Input
1354
+ }], valueChanged: [{
1355
+ type: Output
1356
+ }], errors: [{
1357
+ type: Input
1358
+ }] }); })();
1359
+ (() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassDebugInfo(PipelineGeneratorComponent, { className: "PipelineGeneratorComponent", filePath: "lib/components/t-dynamic-data-edit/elements/pipeline-generator/pipeline-generator.component.ts", lineNumber: 41 }); })();
1360
+
1361
+ export { PipelineGeneratorComponent };
1362
+ //# sourceMappingURL=ngx-t-forms-pipeline-generator.component-U0d8jQKW.mjs.map