@propmix/profet-common-header 3.0.15-utility-unstable.4 → 3.0.15-utility-unstable.6

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 (31) hide show
  1. package/esm2020/lib/api-endpoints.def.mjs +3 -2
  2. package/esm2020/lib/api-gateway.service.mjs +5 -13
  3. package/esm2020/lib/appraisal-assistant/appraisal-assistant-chat-widget.component.mjs +179 -0
  4. package/esm2020/lib/appraisal-assistant/appraisal-assistant.interface.mjs +2 -0
  5. package/esm2020/lib/closable.mixin.mjs +14 -0
  6. package/esm2020/lib/common-header.interface.mjs +1 -1
  7. package/esm2020/lib/common-header.service.mjs +28 -1
  8. package/esm2020/lib/header/header.component.mjs +44 -11
  9. package/esm2020/lib/utility-widget-config.token.mjs +3 -0
  10. package/esm2020/lib/utils/chat-time.pipe.mjs +35 -0
  11. package/esm2020/lib/utils/text-to-html.pipe.mjs +42 -0
  12. package/fesm2015/propmix-profet-common-header-appraisal-assistant-chat-widget.component-56a1672f.mjs +281 -0
  13. package/fesm2015/propmix-profet-common-header-appraisal-assistant-chat-widget.component-56a1672f.mjs.map +1 -0
  14. package/fesm2015/propmix-profet-common-header.mjs +83 -24
  15. package/fesm2015/propmix-profet-common-header.mjs.map +1 -1
  16. package/fesm2020/propmix-profet-common-header-appraisal-assistant-chat-widget.component-8816b836.mjs +276 -0
  17. package/fesm2020/propmix-profet-common-header-appraisal-assistant-chat-widget.component-8816b836.mjs.map +1 -0
  18. package/fesm2020/propmix-profet-common-header.mjs +77 -24
  19. package/fesm2020/propmix-profet-common-header.mjs.map +1 -1
  20. package/lib/api-endpoints.def.d.ts +1 -0
  21. package/lib/api-gateway.service.d.ts +2 -1
  22. package/lib/appraisal-assistant/appraisal-assistant-chat-widget.component.d.ts +37 -0
  23. package/lib/appraisal-assistant/appraisal-assistant.interface.d.ts +4 -0
  24. package/lib/closable.mixin.d.ts +7 -0
  25. package/lib/common-header.interface.d.ts +12 -2
  26. package/lib/common-header.service.d.ts +4 -0
  27. package/lib/header/header.component.d.ts +10 -4
  28. package/lib/utility-widget-config.token.d.ts +2 -0
  29. package/lib/utils/chat-time.pipe.d.ts +7 -0
  30. package/lib/utils/text-to-html.pipe.d.ts +21 -0
  31. package/package.json +1 -1
@@ -0,0 +1,276 @@
1
+ import * as i1$1 from '@angular/common';
2
+ import { CommonModule } from '@angular/common';
3
+ import * as i0 from '@angular/core';
4
+ import { inject, Pipe, Component, ViewChild, ViewChildren } from '@angular/core';
5
+ import * as i3$1 from '@angular/forms';
6
+ import { FormControl, ReactiveFormsModule } from '@angular/forms';
7
+ import * as i4 from '@angular/material/button';
8
+ import { MatButtonModule } from '@angular/material/button';
9
+ import { MatFormFieldModule } from '@angular/material/form-field';
10
+ import * as i3 from '@angular/material/icon';
11
+ import { MatIconModule } from '@angular/material/icon';
12
+ import { MatInputModule } from '@angular/material/input';
13
+ import * as i5 from '@angular/material/progress-spinner';
14
+ import { MatProgressSpinnerModule } from '@angular/material/progress-spinner';
15
+ import { MatSidenavModule } from '@angular/material/sidenav';
16
+ import * as i7 from '@angular/material/tooltip';
17
+ import { MatTooltipModule } from '@angular/material/tooltip';
18
+ import { CommonHeaderService } from './propmix-profet-common-header.mjs';
19
+ import * as i1 from '@angular/platform-browser';
20
+ import '@angular/common/http';
21
+ import '@angular/material/dialog';
22
+ import 'rxjs';
23
+ import '@angular/material/divider';
24
+ import '@angular/material/list';
25
+ import '@angular/material/menu';
26
+ import '@angular/material/select';
27
+ import '@angular/material/snack-bar';
28
+ import '@angular/material/toolbar';
29
+ import '@angular/router';
30
+ import 'aws-amplify/auth';
31
+ import '@angular/material/core';
32
+
33
+ function WithClosable(Base) {
34
+ return class extends Base {
35
+ constructor() {
36
+ super(...arguments);
37
+ this._ser = inject(CommonHeaderService);
38
+ }
39
+ close() {
40
+ this._ser.toggleUtilityContentDrawer();
41
+ }
42
+ };
43
+ }
44
+
45
+ class ChatTimePipe {
46
+ transform(value) {
47
+ const date = new Date(value);
48
+ const now = new Date();
49
+ const isToday = date.getDate() === now.getDate() &&
50
+ date.getMonth() === now.getMonth() &&
51
+ date.getFullYear() === now.getFullYear();
52
+ const timeString = date.toLocaleTimeString([], {
53
+ hour: '2-digit',
54
+ minute: '2-digit',
55
+ hour12: true,
56
+ });
57
+ if (isToday) {
58
+ return timeString;
59
+ }
60
+ const dateString = date.toLocaleDateString([], {
61
+ year: 'numeric',
62
+ month: 'short',
63
+ day: 'numeric',
64
+ });
65
+ return `${dateString} ${timeString}`;
66
+ }
67
+ }
68
+ ChatTimePipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ChatTimePipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe });
69
+ ChatTimePipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: ChatTimePipe, isStandalone: true, name: "chatTime" });
70
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: ChatTimePipe, decorators: [{
71
+ type: Pipe,
72
+ args: [{
73
+ name: 'chatTime',
74
+ standalone: true
75
+ }]
76
+ }] });
77
+
78
+ /**
79
+ * Pipe to convert text with special characters to HTML.
80
+ * It replaces:
81
+ * - \n with <br>
82
+ * - \t with &emsp;
83
+ * - \' with '
84
+ * - \" with "
85
+ * - \\ with \
86
+ * - **text** with <strong>text</strong>
87
+ * - _text_ with <em>text</em>
88
+ */
89
+ class TextToHtmlPipe {
90
+ constructor(sanitizer) {
91
+ this.sanitizer = sanitizer;
92
+ }
93
+ transform(value) {
94
+ if (!value)
95
+ return '';
96
+ let html = value
97
+ .replace(/\\n|\n/g, '<br>')
98
+ .replace(/\\t|\t/g, '&emsp;');
99
+ // .replace(/\\'/g, `'`)
100
+ // .replace(/\\"/g, '"')
101
+ // .replace(/\\\\/g, `\\`)
102
+ // .replace(/\*\*(.+?)\*\*/g, '<strong>$1</strong>')
103
+ // .replace(/_(.+?)_/g, '<em>$1</em>');
104
+ return this.sanitizer.bypassSecurityTrustHtml(html);
105
+ }
106
+ }
107
+ TextToHtmlPipe.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TextToHtmlPipe, deps: [{ token: i1.DomSanitizer }], target: i0.ɵɵFactoryTarget.Pipe });
108
+ TextToHtmlPipe.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "15.2.10", ngImport: i0, type: TextToHtmlPipe, isStandalone: true, name: "textToHtml" });
109
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: TextToHtmlPipe, decorators: [{
110
+ type: Pipe,
111
+ args: [{
112
+ name: 'textToHtml',
113
+ standalone: true
114
+ }]
115
+ }], ctorParameters: function () { return [{ type: i1.DomSanitizer }]; } });
116
+
117
+ class EmptyBase {
118
+ }
119
+ class AppraisalAssistantChatWidgetComponent extends WithClosable(class {
120
+ }) {
121
+ constructor() {
122
+ super(...arguments);
123
+ this.isOpen = false;
124
+ this.message = '';
125
+ this.messages = [];
126
+ this.isLoading = false;
127
+ this.conversationId = '';
128
+ this.msgControl = new FormControl('');
129
+ this._chatSer = inject(CommonHeaderService);
130
+ this.shouldScroll = false;
131
+ this.welcomeMessage = '';
132
+ }
133
+ ngOnInit() {
134
+ if ((this.messages.length === 0)) {
135
+ this.sendMessage();
136
+ }
137
+ }
138
+ ngAfterViewChecked() {
139
+ if (this.shouldScroll) {
140
+ setTimeout(() => {
141
+ this.scrollToLastMessage();
142
+ this.shouldScroll = false;
143
+ }, 100);
144
+ }
145
+ }
146
+ toggleChat() {
147
+ this.close();
148
+ // this.isOpen = !this.isOpen;
149
+ // if (this.isOpen && (this.messages.length === 0)) {
150
+ // this.sendMessage();
151
+ // }
152
+ }
153
+ sendMessage() {
154
+ this.isLoading = true;
155
+ this.msgControl.disable();
156
+ let req = {
157
+ query: this.msgControl.value?.trim() ? this.msgControl.value.trim() : null,
158
+ };
159
+ if (this.msgControl.value?.trim()?.length > 0) {
160
+ this.messages.push({ response: this.msgControl.value?.trim(), isUser: true, timeStamp: new Date() });
161
+ }
162
+ this.shouldScroll = true;
163
+ if (this.conversationId)
164
+ req.conversationId = this.conversationId;
165
+ this.msgControl.setValue('');
166
+ this._chatSer.getQueryResponse(req)
167
+ .subscribe({
168
+ next: ((res) => {
169
+ if (res) {
170
+ if (res.message) {
171
+ this.messages.push({ response: res.message, timeStamp: new Date() });
172
+ this.welcomeMessage = res.message;
173
+ }
174
+ else if (res.result?.httpCode == 200) {
175
+ if (res.result.data.response) {
176
+ this.conversationId = res.result.data.conversationId;
177
+ res.result.data.timeStamp = new Date();
178
+ this.messages.push(res.result.data);
179
+ }
180
+ }
181
+ else if (res.result?.httpCode == 204) {
182
+ this.messages.push({ response: res.result.message, timeStamp: new Date() });
183
+ }
184
+ this.shouldScroll = true;
185
+ }
186
+ this.isLoading = false;
187
+ this.msgControl.enable();
188
+ this.focusInput();
189
+ }),
190
+ error: ((err) => {
191
+ this.isLoading = false;
192
+ this.msgControl.enable();
193
+ this.focusInput();
194
+ })
195
+ });
196
+ }
197
+ // scrollToLastMessage() {
198
+ // const container = this.chatContainer?.nativeElement;
199
+ // if (container && container.scrollHeight > container.clientHeight) {
200
+ // container.scrollTop = container.scrollHeight;
201
+ // }
202
+ // }
203
+ scrollToLastMessage() {
204
+ const container = this.chatContainer?.nativeElement;
205
+ if (container && this.lastMessageRefs && this.lastMessageRefs.length > 0) {
206
+ const lastMsg = this.lastMessageRefs.last.nativeElement;
207
+ const lastMsgRect = lastMsg.getBoundingClientRect();
208
+ const containerRect = container.getBoundingClientRect();
209
+ // If last message is below the visible area of the container
210
+ if (lastMsgRect.bottom > containerRect.bottom) {
211
+ const scrollOffset = lastMsg.offsetTop - container.offsetTop;
212
+ container.scrollTop = scrollOffset;
213
+ }
214
+ // If last message is above the visible area of the container
215
+ else if (lastMsgRect.top < containerRect.top) {
216
+ const scrollOffset = lastMsg.offsetTop - container.offsetTop;
217
+ container.scrollTop = scrollOffset;
218
+ }
219
+ // Else, it's already visible; do nothing
220
+ }
221
+ }
222
+ handleKeyDown(event) {
223
+ if (event.key === 'Enter' && !event.shiftKey) {
224
+ event.preventDefault();
225
+ if (this.msgControl.value?.trim()?.length > 0) {
226
+ this.sendMessage();
227
+ }
228
+ }
229
+ // Shift+Enter will be allowed by default
230
+ }
231
+ focusInput() {
232
+ if (this.msgInputRef) {
233
+ this.msgInputRef.nativeElement.focus();
234
+ }
235
+ }
236
+ resetChat() {
237
+ let message = [{ response: this.welcomeMessage, timeStamp: new Date() }];
238
+ this.messages = message;
239
+ this.conversationId = '';
240
+ this.msgControl.setValue('');
241
+ this.shouldScroll = false;
242
+ if (this.msgInputRef) {
243
+ this.msgInputRef.nativeElement.focus();
244
+ }
245
+ }
246
+ }
247
+ AppraisalAssistantChatWidgetComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppraisalAssistantChatWidgetComponent, deps: null, target: i0.ɵɵFactoryTarget.Component });
248
+ AppraisalAssistantChatWidgetComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: AppraisalAssistantChatWidgetComponent, isStandalone: true, selector: "appraisal-assistant-agent", viewQueries: [{ propertyName: "chatContainer", first: true, predicate: ["chatContainer"], descendants: true }, { propertyName: "msgInputRef", first: true, predicate: ["msgInput"], descendants: true }, { propertyName: "lastMessageRefs", predicate: ["lastMessageRef"], descendants: true }], usesInheritance: true, ngImport: i0, template: "<div [class]=\"isOpen?'chat-container-wrap':''\">\n <div class=\"chatbot-container\">\n <div class=\"chatbot-sidenav\">\n <div class=\"chat-header\"><span>Appraisal Assistant (Beta)</span>\n <div class=\"chat-header-actions\">\n <button tabindex=\"-1\" mat-button class=\"reset-button small_btn\" [disabled]=\"isLoading\"\n (click)=\"resetChat()\">Reset\n </button>\n <!-- <span>Reset</span> -->\n <!-- <button mat-icon-button matTooltip=\"Collapse\" class=\"d-flex align-item-center\" (click)=\"toggleChat()\">\n <mat-icon>chevron_right</mat-icon>\n </button> -->\n <button matTooltip=\"Collapse\" class=\"d-flex align-item-center collapse_btn\" (click)=\"toggleChat()\">\n <mat-icon>chevron_right</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"chat-messages\" #chatContainer>\n <div *ngFor=\"let message of messages; let isLast = last\" class=\"message-container\"\n [ngClass]=\"{'user-message': message.isUser, 'bot-message': !message.isUser}\"\n style=\"margin-bottom: 15px;\" #lastMessageRef>\n <div class=\"message-content\">\n <span [innerHTML]=\"message.response | textToHtml\"></span>\n <span class=\"message-time\">{{ message.timeStamp | chatTime }} </span>\n </div>\n </div>\n </div>\n <form class=\"chat-input-container\" (submit)=\"sendMessage()\">\n <textarea class=\"chat-textarea\" [formControl]=\"msgControl\" placeholder=\"Start typing here...\" rows=\"1\"\n (keydown)=\"handleKeyDown($event)\" #msgInput></textarea>\n <mat-spinner *ngIf=\"isLoading\" [diameter]=\"24\" strokeWidth=\"3\" color=\"primary\" class=\"position-absolute\"\n style=\"right:22px\"></mat-spinner>\n <button color=\"primary\" [disabled]=\"isLoading || (msgControl.value?.trim()?.length <= 0)\"\n mat-icon-button class=\"d-flex align-items-center\" (click)=\"sendMessage()\">\n <mat-icon *ngIf=\"!isLoading\">send</mat-icon>\n <!-- <mat-spinner *ngIf=\"isLoading\" [diameter]=\"24\" strokeWidth=\"3\"></mat-spinner> -->\n </button>\n </form>\n </div>\n </div>\n <!-- <mat-sidenav-container [hasBackdrop]=\"true\" class=\"chatbot-container\"><mat-sidenav #sidenav position=\"end\"\n mode=\"over\" [(opened)]=\"isOpen\" [disableClose]=\"true\" class=\"chatbot-sidenav\">\n </mat-sidenav></mat-sidenav-container> -->\n</div>\n<!-- <div *ngIf=\"!isOpen\" class=\"chat-launcher\" (click)=\"toggleChat()\">\n <div>\n <div class=\"list-icons-cell\">\n <mat-icon class=\"list-icons\">3p</mat-icon>\n </div>\n </div>\n</div> -->", styles: [":host .chatbot-container{top:0;right:0;height:100vh;background:transparent}:host .chatbot-container .mat-sidenav{z-index:5;pointer-events:auto;width:650px;display:flex;flex-direction:column}:host .chatbot-container .chat-header{display:flex;justify-content:space-between;align-items:center;padding:5px 16px;background:linear-gradient(to right,#3966b6,var(--themelightblue));color:#fff;position:sticky;top:0;z-index:100;box-shadow:0 2px 5px #0000004d;line-height:20px;letter-spacing:normal}:host .chatbot-container .chat-header span{font-size:13.12px;font-weight:550!important;line-height:20px;letter-spacing:normal}:host .chatbot-container .chat-header button:first-child{background-color:#4076d5!important}:host .chatbot-container .chat-messages{flex:1;padding:60px 16px 16px;background-color:#fff;overflow-y:auto;overscroll-behavior:contain;position:relative}:host .chatbot-container .message-container{display:flex;margin-bottom:12px;align-items:flex-start}:host .chat-launcher{background-color:#fff!important;border-radius:3px}:host .chat-launcher span{white-space:nowrap;border-right:1px solid #999999;font-size:13.12px!important;padding-right:5px;color:#fff!important}:host .chat-launcher .list-icons-cell{padding:8px;text-align:center;vertical-align:middle;height:40px;width:40px;cursor:pointer;border-radius:30px;margin-top:10px}:host .chat-launcher .list-icons-cell .list-icons{font-size:25px!important;color:#4b85ea!important}:host .list-icons-cell:hover{background-color:#ccc}:host .chat-header-actions{display:flex;align-items:center;gap:8px}:host .chat-header-actions .reset-button{color:#fff;line-height:20px!important;letter-spacing:.5px!important;font-size:13.12px!important}:host .user-message{justify-content:flex-end}:host .user-message .message-content{background-color:RGB(235,243,255);color:#212121;border:1px solid RGB(220,233,251);padding:10px 14px;border-radius:10px;max-width:70%;margin-left:auto;font-size:13px;line-height:21px!important}:host .user-message .message-time{display:block;font-size:9px;color:#555;margin-top:0;text-align:right}:host .bot-message{justify-content:flex-start}:host .bot-message .message-content{color:#212121;padding:10px 14px;border-radius:10px;width:98%;margin-right:auto;font-size:13px;line-height:21px!important}:host .bot-message .message-time{display:block;font-size:9px;color:#555;margin-top:0;text-align:left}:host .message-content{display:inline-block;word-break:break-word}:host .chat-input-container{display:flex;align-items:center;padding:12px;background-color:#fff;position:sticky;bottom:0;border-top:1px solid #e0e0e0;z-index:10}:host .chat-textarea{flex:1;resize:none;padding:12px 16px;border-radius:20px;font-size:14px;background-color:#f1f1f1;border:none;outline:none;line-height:1.4;max-height:150px;overflow-y:auto}:host .send-button{margin-left:8px;width:40px;height:40px;border-radius:50%;border:none;background-color:#3f51b5;color:#fff;display:flex;align-items:center;justify-content:center}:host .send-button:disabled{background-color:#ccc}:host .chat-container-wrap{position:fixed;inset:0;z-index:99999}:host ::ng-deep .mat-drawer-inner-container{display:flex;flex-direction:column}:host .collapse_btn{width:35px;height:35px;border-radius:50px;display:flex!important;align-items:center;justify-content:center;background-color:transparent!important;border:none}:host .collapse_btn mat-icon{font-size:24px!important;width:24px!important;height:24px!important;color:#fff!important}:host .collapse_btn:hover{background-color:#4076d5!important;transition:all .2s}\n"], dependencies: [{ kind: "ngmodule", type: MatSidenavModule }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i3.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i4.MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "component", type: i4.MatIconButton, selector: "button[mat-icon-button]", inputs: ["disabled", "disableRipple", "color"], exportAs: ["matButton"] }, { kind: "ngmodule", type: MatFormFieldModule }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i3$1.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i3$1.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i3$1.FormControlDirective, selector: "[formControl]", inputs: ["formControl", "disabled", "ngModel"], outputs: ["ngModelChange"], exportAs: ["ngForm"] }, { kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i1$1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatInputModule }, { kind: "ngmodule", type: MatProgressSpinnerModule }, { kind: "component", type: i5.MatProgressSpinner, selector: "mat-progress-spinner, mat-spinner", inputs: ["color", "mode", "value", "diameter", "strokeWidth"], exportAs: ["matProgressSpinner"] }, { kind: "pipe", type: ChatTimePipe, name: "chatTime" }, { kind: "pipe", type: TextToHtmlPipe, name: "textToHtml" }, { kind: "ngmodule", type: MatTooltipModule }, { kind: "directive", type: i7.MatTooltip, selector: "[matTooltip]", exportAs: ["matTooltip"] }] });
249
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: AppraisalAssistantChatWidgetComponent, decorators: [{
250
+ type: Component,
251
+ args: [{ selector: 'appraisal-assistant-agent', standalone: true, imports: [
252
+ MatSidenavModule,
253
+ MatIconModule,
254
+ MatButtonModule,
255
+ MatFormFieldModule,
256
+ ReactiveFormsModule,
257
+ CommonModule,
258
+ MatInputModule,
259
+ MatProgressSpinnerModule,
260
+ ChatTimePipe,
261
+ TextToHtmlPipe,
262
+ MatTooltipModule
263
+ ], template: "<div [class]=\"isOpen?'chat-container-wrap':''\">\n <div class=\"chatbot-container\">\n <div class=\"chatbot-sidenav\">\n <div class=\"chat-header\"><span>Appraisal Assistant (Beta)</span>\n <div class=\"chat-header-actions\">\n <button tabindex=\"-1\" mat-button class=\"reset-button small_btn\" [disabled]=\"isLoading\"\n (click)=\"resetChat()\">Reset\n </button>\n <!-- <span>Reset</span> -->\n <!-- <button mat-icon-button matTooltip=\"Collapse\" class=\"d-flex align-item-center\" (click)=\"toggleChat()\">\n <mat-icon>chevron_right</mat-icon>\n </button> -->\n <button matTooltip=\"Collapse\" class=\"d-flex align-item-center collapse_btn\" (click)=\"toggleChat()\">\n <mat-icon>chevron_right</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"chat-messages\" #chatContainer>\n <div *ngFor=\"let message of messages; let isLast = last\" class=\"message-container\"\n [ngClass]=\"{'user-message': message.isUser, 'bot-message': !message.isUser}\"\n style=\"margin-bottom: 15px;\" #lastMessageRef>\n <div class=\"message-content\">\n <span [innerHTML]=\"message.response | textToHtml\"></span>\n <span class=\"message-time\">{{ message.timeStamp | chatTime }} </span>\n </div>\n </div>\n </div>\n <form class=\"chat-input-container\" (submit)=\"sendMessage()\">\n <textarea class=\"chat-textarea\" [formControl]=\"msgControl\" placeholder=\"Start typing here...\" rows=\"1\"\n (keydown)=\"handleKeyDown($event)\" #msgInput></textarea>\n <mat-spinner *ngIf=\"isLoading\" [diameter]=\"24\" strokeWidth=\"3\" color=\"primary\" class=\"position-absolute\"\n style=\"right:22px\"></mat-spinner>\n <button color=\"primary\" [disabled]=\"isLoading || (msgControl.value?.trim()?.length <= 0)\"\n mat-icon-button class=\"d-flex align-items-center\" (click)=\"sendMessage()\">\n <mat-icon *ngIf=\"!isLoading\">send</mat-icon>\n <!-- <mat-spinner *ngIf=\"isLoading\" [diameter]=\"24\" strokeWidth=\"3\"></mat-spinner> -->\n </button>\n </form>\n </div>\n </div>\n <!-- <mat-sidenav-container [hasBackdrop]=\"true\" class=\"chatbot-container\"><mat-sidenav #sidenav position=\"end\"\n mode=\"over\" [(opened)]=\"isOpen\" [disableClose]=\"true\" class=\"chatbot-sidenav\">\n </mat-sidenav></mat-sidenav-container> -->\n</div>\n<!-- <div *ngIf=\"!isOpen\" class=\"chat-launcher\" (click)=\"toggleChat()\">\n <div>\n <div class=\"list-icons-cell\">\n <mat-icon class=\"list-icons\">3p</mat-icon>\n </div>\n </div>\n</div> -->", styles: [":host .chatbot-container{top:0;right:0;height:100vh;background:transparent}:host .chatbot-container .mat-sidenav{z-index:5;pointer-events:auto;width:650px;display:flex;flex-direction:column}:host .chatbot-container .chat-header{display:flex;justify-content:space-between;align-items:center;padding:5px 16px;background:linear-gradient(to right,#3966b6,var(--themelightblue));color:#fff;position:sticky;top:0;z-index:100;box-shadow:0 2px 5px #0000004d;line-height:20px;letter-spacing:normal}:host .chatbot-container .chat-header span{font-size:13.12px;font-weight:550!important;line-height:20px;letter-spacing:normal}:host .chatbot-container .chat-header button:first-child{background-color:#4076d5!important}:host .chatbot-container .chat-messages{flex:1;padding:60px 16px 16px;background-color:#fff;overflow-y:auto;overscroll-behavior:contain;position:relative}:host .chatbot-container .message-container{display:flex;margin-bottom:12px;align-items:flex-start}:host .chat-launcher{background-color:#fff!important;border-radius:3px}:host .chat-launcher span{white-space:nowrap;border-right:1px solid #999999;font-size:13.12px!important;padding-right:5px;color:#fff!important}:host .chat-launcher .list-icons-cell{padding:8px;text-align:center;vertical-align:middle;height:40px;width:40px;cursor:pointer;border-radius:30px;margin-top:10px}:host .chat-launcher .list-icons-cell .list-icons{font-size:25px!important;color:#4b85ea!important}:host .list-icons-cell:hover{background-color:#ccc}:host .chat-header-actions{display:flex;align-items:center;gap:8px}:host .chat-header-actions .reset-button{color:#fff;line-height:20px!important;letter-spacing:.5px!important;font-size:13.12px!important}:host .user-message{justify-content:flex-end}:host .user-message .message-content{background-color:RGB(235,243,255);color:#212121;border:1px solid RGB(220,233,251);padding:10px 14px;border-radius:10px;max-width:70%;margin-left:auto;font-size:13px;line-height:21px!important}:host .user-message .message-time{display:block;font-size:9px;color:#555;margin-top:0;text-align:right}:host .bot-message{justify-content:flex-start}:host .bot-message .message-content{color:#212121;padding:10px 14px;border-radius:10px;width:98%;margin-right:auto;font-size:13px;line-height:21px!important}:host .bot-message .message-time{display:block;font-size:9px;color:#555;margin-top:0;text-align:left}:host .message-content{display:inline-block;word-break:break-word}:host .chat-input-container{display:flex;align-items:center;padding:12px;background-color:#fff;position:sticky;bottom:0;border-top:1px solid #e0e0e0;z-index:10}:host .chat-textarea{flex:1;resize:none;padding:12px 16px;border-radius:20px;font-size:14px;background-color:#f1f1f1;border:none;outline:none;line-height:1.4;max-height:150px;overflow-y:auto}:host .send-button{margin-left:8px;width:40px;height:40px;border-radius:50%;border:none;background-color:#3f51b5;color:#fff;display:flex;align-items:center;justify-content:center}:host .send-button:disabled{background-color:#ccc}:host .chat-container-wrap{position:fixed;inset:0;z-index:99999}:host ::ng-deep .mat-drawer-inner-container{display:flex;flex-direction:column}:host .collapse_btn{width:35px;height:35px;border-radius:50px;display:flex!important;align-items:center;justify-content:center;background-color:transparent!important;border:none}:host .collapse_btn mat-icon{font-size:24px!important;width:24px!important;height:24px!important;color:#fff!important}:host .collapse_btn:hover{background-color:#4076d5!important;transition:all .2s}\n"] }]
264
+ }], propDecorators: { chatContainer: [{
265
+ type: ViewChild,
266
+ args: ['chatContainer']
267
+ }], lastMessageRefs: [{
268
+ type: ViewChildren,
269
+ args: ['lastMessageRef']
270
+ }], msgInputRef: [{
271
+ type: ViewChild,
272
+ args: ['msgInput']
273
+ }] } });
274
+
275
+ export { AppraisalAssistantChatWidgetComponent };
276
+ //# sourceMappingURL=propmix-profet-common-header-appraisal-assistant-chat-widget.component-8816b836.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"propmix-profet-common-header-appraisal-assistant-chat-widget.component-8816b836.mjs","sources":["../../../projects/common-header/src/lib/closable.mixin.ts","../../../projects/common-header/src/lib/utils/chat-time.pipe.ts","../../../projects/common-header/src/lib/utils/text-to-html.pipe.ts","../../../projects/common-header/src/lib/appraisal-assistant/appraisal-assistant-chat-widget.component.ts","../../../projects/common-header/src/lib/appraisal-assistant/appraisal-assistant-chat-widget.component.html"],"sourcesContent":["import { inject } from \"@angular/core\";\nimport { CommonHeaderService } from \"./common-header.service\";\n\nexport function WithClosable<T extends new (...args: any[]) => {}>(Base: T) {\n return class extends Base {\n _ser = inject(CommonHeaderService);\n\n close() {\n this._ser.toggleUtilityContentDrawer();\n }\n };\n}","import { Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({\n name: 'chatTime',\n standalone: true\n})\nexport class ChatTimePipe implements PipeTransform {\n\n transform(value: string | number | Date): string {\n const date = new Date(value);\n const now = new Date();\n\n const isToday =\n date.getDate() === now.getDate() &&\n date.getMonth() === now.getMonth() &&\n date.getFullYear() === now.getFullYear();\n\n const timeString = date.toLocaleTimeString([], {\n hour: '2-digit',\n minute: '2-digit',\n hour12: true,\n });\n\n if (isToday) {\n return timeString;\n }\n\n const dateString = date.toLocaleDateString([], {\n year: 'numeric',\n month: 'short', // like \"May\"\n day: 'numeric',\n });\n\n return `${dateString} ${timeString}`;\n }\n\n}\n","import { Pipe, PipeTransform } from '@angular/core';\nimport { DomSanitizer, SafeHtml } from '@angular/platform-browser';\n\n/**\n * Pipe to convert text with special characters to HTML.\n * It replaces:\n * - \\n with <br>\n * - \\t with &emsp;\n * - \\' with '\n * - \\\" with \"\n * - \\\\ with \\\n * - **text** with <strong>text</strong>\n * - _text_ with <em>text</em>\n */\n\n@Pipe({\n name: 'textToHtml',\n standalone: true\n})\nexport class TextToHtmlPipe implements PipeTransform {\n\n constructor(private sanitizer: DomSanitizer) { }\n\n transform(value: string): SafeHtml {\n if (!value) return '';\n\n let html = value\n .replace(/\\\\n|\\n/g, '<br>')\n .replace(/\\\\t|\\t/g, '&emsp;')\n // .replace(/\\\\'/g, `'`)\n // .replace(/\\\\\"/g, '\"')\n // .replace(/\\\\\\\\/g, `\\\\`)\n // .replace(/\\*\\*(.+?)\\*\\*/g, '<strong>$1</strong>')\n // .replace(/_(.+?)_/g, '<em>$1</em>');\n\n return this.sanitizer.bypassSecurityTrustHtml(html);\n }\n\n}\n","import { CommonModule } from '@angular/common';\nimport { AfterViewChecked, Component, ElementRef, inject, OnInit, QueryList, ViewChild, ViewChildren } from '@angular/core';\nimport { FormControl, ReactiveFormsModule } from '@angular/forms';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatFormFieldModule } from '@angular/material/form-field';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatInputModule } from '@angular/material/input';\nimport { MatProgressSpinnerModule } from '@angular/material/progress-spinner';\nimport { MatSidenavModule } from '@angular/material/sidenav';\nimport { MatTooltipModule } from '@angular/material/tooltip';\nimport { WithClosable } from '../closable.mixin';\nimport { CommonHeaderService } from '../common-header.service';\nimport { ChatTimePipe } from '../utils/chat-time.pipe';\nimport { TextToHtmlPipe } from \"../utils/text-to-html.pipe\";\nimport { AppraisalChatRequest } from './appraisal-assistant.interface';\n\nclass EmptyBase { }\n\n@Component({\n selector: 'appraisal-assistant-agent',\n templateUrl: './appraisal-assistant-chat-widget.component.html',\n styleUrls: ['./appraisal-assistant-chat-widget.component.scss'],\n standalone: true,\n imports: [\n MatSidenavModule,\n MatIconModule,\n MatButtonModule,\n MatFormFieldModule,\n ReactiveFormsModule,\n CommonModule,\n MatInputModule,\n MatProgressSpinnerModule,\n ChatTimePipe,\n TextToHtmlPipe,\n MatTooltipModule\n ]\n})\nexport class AppraisalAssistantChatWidgetComponent extends WithClosable(class {}) implements OnInit, AfterViewChecked {\n isOpen = false;\n message = '';\n messages: any[] = [];\n isLoading: boolean = false;\n conversationId: string = '';\n msgControl: FormControl = new FormControl('');\n public _chatSer = inject(CommonHeaderService);\n @ViewChild('chatContainer') private chatContainer!: ElementRef;\n @ViewChildren('lastMessageRef') lastMessageRefs!: QueryList<ElementRef>;\n @ViewChild('msgInput') msgInputRef!: ElementRef<HTMLTextAreaElement>;\n\n private shouldScroll = false;\n welcomeMessage: string = '';\n\n\n ngOnInit(): void {\n if ((this.messages.length === 0)) {\n this.sendMessage();\n }\n }\n\n\n\n ngAfterViewChecked(): void {\n if (this.shouldScroll) {\n setTimeout(() => {\n this.scrollToLastMessage();\n this.shouldScroll = false;\n }, 100);\n\n }\n }\n\n toggleChat() {\n this.close();\n // this.isOpen = !this.isOpen;\n // if (this.isOpen && (this.messages.length === 0)) {\n // this.sendMessage();\n // }\n }\n\n sendMessage() {\n this.isLoading = true;\n this.msgControl.disable();\n let req: AppraisalChatRequest = {\n query: this.msgControl.value?.trim() ? this.msgControl.value.trim() : null,\n }\n if (this.msgControl.value?.trim()?.length > 0) {\n this.messages.push({ response: this.msgControl.value?.trim(), isUser: true, timeStamp: new Date() });\n }\n this.shouldScroll = true;\n if (this.conversationId) req.conversationId = this.conversationId;\n this.msgControl.setValue('');\n this._chatSer.getQueryResponse(req)\n .subscribe({\n next: ((res: any) => {\n if (res) {\n if (res.message) {\n this.messages.push({ response: res.message, timeStamp: new Date() });\n this.welcomeMessage = res.message;\n }\n else if (res.result?.httpCode == 200) {\n if (res.result.data.response) {\n this.conversationId = res.result.data.conversationId;\n res.result.data.timeStamp = new Date();\n this.messages.push(res.result.data);\n }\n }\n else if (res.result?.httpCode == 204) {\n this.messages.push({ response: res.result.message, timeStamp: new Date() });\n }\n this.shouldScroll = true;\n }\n this.isLoading = false;\n this.msgControl.enable();\n this.focusInput();\n }),\n error: ((err: any) => {\n this.isLoading = false;\n this.msgControl.enable();\n this.focusInput();\n })\n });\n }\n\n // scrollToLastMessage() {\n // const container = this.chatContainer?.nativeElement;\n // if (container && container.scrollHeight > container.clientHeight) {\n // container.scrollTop = container.scrollHeight;\n // }\n // }\n scrollToLastMessage() {\n const container = this.chatContainer?.nativeElement;\n if (container && this.lastMessageRefs && this.lastMessageRefs.length > 0) {\n const lastMsg: HTMLElement = this.lastMessageRefs.last.nativeElement;\n const lastMsgRect = lastMsg.getBoundingClientRect();\n const containerRect = container.getBoundingClientRect();\n\n // If last message is below the visible area of the container\n if (lastMsgRect.bottom > containerRect.bottom) {\n const scrollOffset = lastMsg.offsetTop - container.offsetTop;\n container.scrollTop = scrollOffset;\n }\n // If last message is above the visible area of the container\n else if (lastMsgRect.top < containerRect.top) {\n const scrollOffset = lastMsg.offsetTop - container.offsetTop;\n container.scrollTop = scrollOffset;\n }\n // Else, it's already visible; do nothing\n }\n }\n\n\n handleKeyDown(event: KeyboardEvent): void {\n if (event.key === 'Enter' && !event.shiftKey) {\n event.preventDefault();\n if (this.msgControl.value?.trim()?.length > 0) {\n this.sendMessage();\n }\n }\n // Shift+Enter will be allowed by default\n }\n\n focusInput() {\n if (this.msgInputRef) {\n this.msgInputRef.nativeElement.focus();\n }\n }\n\n resetChat() {\n let message = [{ response: this.welcomeMessage, timeStamp: new Date() }]\n this.messages = message;\n this.conversationId = '';\n this.msgControl.setValue('');\n this.shouldScroll = false;\n if (this.msgInputRef) {\n this.msgInputRef.nativeElement.focus();\n }\n }\n}\n","<div [class]=\"isOpen?'chat-container-wrap':''\">\n <div class=\"chatbot-container\">\n <div class=\"chatbot-sidenav\">\n <div class=\"chat-header\"><span>Appraisal Assistant (Beta)</span>\n <div class=\"chat-header-actions\">\n <button tabindex=\"-1\" mat-button class=\"reset-button small_btn\" [disabled]=\"isLoading\"\n (click)=\"resetChat()\">Reset\n </button>\n <!-- <span>Reset</span> -->\n <!-- <button mat-icon-button matTooltip=\"Collapse\" class=\"d-flex align-item-center\" (click)=\"toggleChat()\">\n <mat-icon>chevron_right</mat-icon>\n </button> -->\n <button matTooltip=\"Collapse\" class=\"d-flex align-item-center collapse_btn\" (click)=\"toggleChat()\">\n <mat-icon>chevron_right</mat-icon>\n </button>\n </div>\n </div>\n <div class=\"chat-messages\" #chatContainer>\n <div *ngFor=\"let message of messages; let isLast = last\" class=\"message-container\"\n [ngClass]=\"{'user-message': message.isUser, 'bot-message': !message.isUser}\"\n style=\"margin-bottom: 15px;\" #lastMessageRef>\n <div class=\"message-content\">\n <span [innerHTML]=\"message.response | textToHtml\"></span>\n <span class=\"message-time\">{{ message.timeStamp | chatTime }} </span>\n </div>\n </div>\n </div>\n <form class=\"chat-input-container\" (submit)=\"sendMessage()\">\n <textarea class=\"chat-textarea\" [formControl]=\"msgControl\" placeholder=\"Start typing here...\" rows=\"1\"\n (keydown)=\"handleKeyDown($event)\" #msgInput></textarea>\n <mat-spinner *ngIf=\"isLoading\" [diameter]=\"24\" strokeWidth=\"3\" color=\"primary\" class=\"position-absolute\"\n style=\"right:22px\"></mat-spinner>\n <button color=\"primary\" [disabled]=\"isLoading || (msgControl.value?.trim()?.length <= 0)\"\n mat-icon-button class=\"d-flex align-items-center\" (click)=\"sendMessage()\">\n <mat-icon *ngIf=\"!isLoading\">send</mat-icon>\n <!-- <mat-spinner *ngIf=\"isLoading\" [diameter]=\"24\" strokeWidth=\"3\"></mat-spinner> -->\n </button>\n </form>\n </div>\n </div>\n <!-- <mat-sidenav-container [hasBackdrop]=\"true\" class=\"chatbot-container\"><mat-sidenav #sidenav position=\"end\"\n mode=\"over\" [(opened)]=\"isOpen\" [disableClose]=\"true\" class=\"chatbot-sidenav\">\n </mat-sidenav></mat-sidenav-container> -->\n</div>\n<!-- <div *ngIf=\"!isOpen\" class=\"chat-launcher\" (click)=\"toggleChat()\">\n <div>\n <div class=\"list-icons-cell\">\n <mat-icon class=\"list-icons\">3p</mat-icon>\n </div>\n </div>\n</div> -->"],"names":["i1","i2","i3","i4","i6"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGM,SAAU,YAAY,CAAuC,IAAO,EAAA;IACtE,OAAO,cAAc,IAAI,CAAA;AAAlB,QAAA,WAAA,GAAA;;AACH,YAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,mBAAmB,CAAC,CAAC;SAKtC;QAHG,KAAK,GAAA;AACD,YAAA,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAAE,CAAC;SAC1C;KACJ,CAAC;AACN;;MCLa,YAAY,CAAA;AAEvB,IAAA,SAAS,CAAC,KAA6B,EAAA;AACrC,QA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