1import { 2 ChatMessages, 3 ChatService, 4 ChatSession 5} from "./chunk-MURIMZ77.js"; 6import { 7 AuthService, 8 UserService 9} from "./chunk-LUNLMFQL.js"; 10import { 11 MatError, 12 MatFormField, 13 MatInput, 14 MatOption, 15 MatRadioButton, 16 MatRadioGroup, 17 MatSelect, 18 MatTab, 19 MatTabGroup, 20 MaterialModule 21} from "./chunk-OMISA5JX.js"; 22import { 23 ActivatedRoute, 24 AppCacheService, 25 AppUtilService, 26 CacheConstant, 27 ChatGroups, 28 ChatRoutes, 29 CommonModule, 30 Component, 31 DefaultValueAccessor, 32 FormsModule, 33 HostListener, 34 MatButton, 35 MatDialog, 36 MatDialogActions, 37 MatDialogClose, 38 MatDialogContent, 39 MatDialogRef, 40 MatDialogTitle, 41 MaxLengthValidator, 42 NgControlStatus, 43 NgControlStatusGroup, 44 NgForOf, 45 NgForm, 46 NgIf, 47 NgModel, 48 NgModule, 49 PatternValidator, 50 ReactiveFormsModule, 51 Regex, 52 RequiredValidator, 53 RoutePrefix, 54 RouterModule, 55 ViewChild, 56 setClassMetadata, 57 ɵNgNoValidate, 58 ɵsetClassDebugInfo, 59 ɵɵadvance, 60 ɵɵdefineComponent, 61 ɵɵdefineInjector, 62 ɵɵdefineNgModule, 63 ɵɵdirectiveInject, 64 ɵɵelement, 65 ɵɵelementEnd, 66 ɵɵelementStart, 67 ɵɵgetCurrentView, 68 ɵɵinterpolate, 69 ɵɵinterpolate1, 70 ɵɵlistener, 71 ɵɵloadQuery, 72 ɵɵnextContext, 73 ɵɵproperty, 74 ɵɵqueryRefresh, 75 ɵɵreference, 76 ɵɵresetView, 77 ɵɵresolveWindow, 78 ɵɵrestoreView, 79 ɵɵsanitizeHtml, 80 ɵɵsanitizeUrl, 81 ɵɵtemplate, 82 ɵɵtext, 83 ɵɵtextInterpolate, 84 ɵɵtextInterpolate1, 85 ɵɵtwoWayBindingSet, 86 ɵɵtwoWayListener, 87 ɵɵtwoWayProperty, 88 ɵɵviewQuery 89} from "./chunk-5HMRJJF3.js"; 90import "./chunk-Y3GAN3BX.js"; 91
92// src/app/modules/chat/chat-landing/chat-landing.component.ts 93function ChatLandingComponent_div_5_div_6_mat_radio_button_4_Template(rf, ctx) { 94 if (rf & 1) { 95 \u0275\u0275elementStart(0, "mat-radio-button", 25); 96 \u0275\u0275text(1); 97 \u0275\u0275elementEnd(); 98 } 99 if (rf & 2) { 100 const chat_r4 = ctx.$implicit; 101 const i_r5 = ctx.index; 102 \u0275\u0275property("id", \u0275\u0275interpolate1("chat-options-", i_r5 + 1))("value", chat_r4.value); 103 \u0275\u0275advance(); 104 \u0275\u0275textInterpolate1("\n ", chat_r4.description, "\n "); 105 } 106} 107function ChatLandingComponent_div_5_div_6_form_7_div_36_li_2_Template(rf, ctx) { 108 if (rf & 1) { 109 \u0275\u0275elementStart(0, "li", 31); 110 \u0275\u0275text(1, "\n "); 111 \u0275\u0275elementStart(2, "mat-error"); 112 \u0275\u0275text(3); 113 \u0275\u0275elementEnd(); 114 \u0275\u0275text(4, "\n "); 115 \u0275\u0275elementEnd(); 116 } 117 if (rf & 2) { 118 const ctx_r2 = \u0275\u0275nextContext(5); 119 \u0275\u0275advance(3); 120 \u0275\u0275textInterpolate1("\n ", ctx_r2.messages.NameRequiredMesssage, "\n "); 121 } 122} 123function ChatLandingComponent_div_5_div_6_form_7_div_36_li_4_Template(rf, ctx) { 124 if (rf & 1) { 125 \u0275\u0275elementStart(0, "li", 31); 126 \u0275\u0275text(1, "\n "); 127 \u0275\u0275elementStart(2, "mat-error"); 128 \u0275\u0275text(3); 129 \u0275\u0275elementEnd(); 130 \u0275\u0275text(4, "\n "); 131 \u0275\u0275elementEnd(); 132 } 133 if (rf & 2) { 134 const ctx_r2 = \u0275\u0275nextContext(5); 135 \u0275\u0275advance(3); 136 \u0275\u0275textInterpolate1("\n ", ctx_r2.messages.EmailValidationMessage, "\n "); 137 } 138} 139function ChatLandingComponent_div_5_div_6_form_7_div_36_li_6_Template(rf, ctx) { 140 if (rf & 1) { 141 \u0275\u0275elementStart(0, "li", 31); 142 \u0275\u0275text(1, "\n "); 143 \u0275\u0275elementStart(2, "mat-error"); 144 \u0275\u0275text(3); 145 \u0275\u0275elementEnd(); 146 \u0275\u0275text(4, "\n "); 147 \u0275\u0275elementEnd(); 148 } 149 if (rf & 2) { 150 const ctx_r2 = \u0275\u0275nextContext(5); 151 \u0275\u0275advance(3); 152 \u0275\u0275textInterpolate1("\n ", ctx_r2.messages.PhoneNumberValidation, "\n "); 153 } 154} 155function ChatLandingComponent_div_5_div_6_form_7_div_36_Template(rf, ctx) { 156 if (rf & 1) { 157 \u0275\u0275elementStart(0, "div"); 158 \u0275\u0275text(1, "\n "); 159 \u0275\u0275template(2, ChatLandingComponent_div_5_div_6_form_7_div_36_li_2_Template, 5, 1, "li", 30); 160 \u0275\u0275text(3, "\n "); 161 \u0275\u0275template(4, ChatLandingComponent_div_5_div_6_form_7_div_36_li_4_Template, 5, 1, "li", 30); 162 \u0275\u0275text(5, "\n "); 163 \u0275\u0275template(6, ChatLandingComponent_div_5_div_6_form_7_div_36_li_6_Template, 5, 1, "li", 30); 164 \u0275\u0275text(7, "\n "); 165 \u0275\u0275elementEnd(); 166 } 167 if (rf & 2) { 168 \u0275\u0275nextContext(); 169 const name_r8 = \u0275\u0275reference(8); 170 const email_r9 = \u0275\u0275reference(17); 171 const phone_r10 = \u0275\u0275reference(26); 172 \u0275\u0275advance(2); 173 \u0275\u0275property("ngIf", name_r8.errors == null ? null : name_r8.errors.required); 174 \u0275\u0275advance(2); 175 \u0275\u0275property("ngIf", email_r9.errors == null ? null : email_r9.errors.pattern); 176 \u0275\u0275advance(2); 177 \u0275\u0275property("ngIf", phone_r10.errors == null ? null : phone_r10.errors.pattern); 178 } 179} 180function ChatLandingComponent_div_5_div_6_form_7_Template(rf, ctx) { 181 if (rf & 1) { 182 const _r6 = \u0275\u0275getCurrentView(); 183 \u0275\u0275elementStart(0, "form", 15, 4); 184 \u0275\u0275listener("ngSubmit", function ChatLandingComponent_div_5_div_6_form_7_Template_form_ngSubmit_0_listener() { 185 \u0275\u0275restoreView(_r6); 186 const chatForm_r7 = \u0275\u0275reference(1); 187 const ctx_r2 = \u0275\u0275nextContext(3); 188 return \u0275\u0275resetView(ctx_r2.onChatSubmit(chatForm_r7)); 189 }); 190 \u0275\u0275text(2, "\n "); 191 \u0275\u0275elementStart(3, "div"); 192 \u0275\u0275text(4, "\n "); 193 \u0275\u0275elementStart(5, "mat-form-field"); 194 \u0275\u0275text(6, "\n "); 195 \u0275\u0275elementStart(7, "input", 26, 1); 196 \u0275\u0275twoWayListener("ngModelChange", function ChatLandingComponent_div_5_div_6_form_7_Template_input_ngModelChange_7_listener($event) { 197 \u0275\u0275restoreView(_r6); 198 const ctx_r2 = \u0275\u0275nextContext(3); 199 \u0275\u0275twoWayBindingSet(ctx_r2.chatConfig.name, $event) || (ctx_r2.chatConfig.name = $event);
200 return \u0275\u0275resetView($event); 201 }); 202 \u0275\u0275elementEnd(); 203 \u0275\u0275text(9, "\n "); 204 \u0275\u0275elementEnd(); 205 \u0275\u0275text(10, "\n "); 206 \u0275\u0275elementEnd(); 207 \u0275\u0275text(11, "\n "); 208 \u0275\u0275elementStart(12, "div"); 209 \u0275\u0275text(13, "\n "); 210 \u0275\u0275elementStart(14, "mat-form-field"); 211 \u0275\u0275text(15, "\n "); 212 \u0275\u0275elementStart(16, "input", 27, 5); 213 \u0275\u0275twoWayListener("ngModelChange", function ChatLandingComponent_div_5_div_6_form_7_Template_input_ngModelChange_16_listener($event) { 214 \u0275\u0275restoreView(_r6); 215 const ctx_r2 = \u0275\u0275nextContext(3); 216 \u0275\u0275twoWayBindingSet(ctx_r2.chatConfig.email, $event) || (ctx_r2.chatConfig.email = $event); 217 return \u0275\u0275resetView($event); 218 }); 219 \u0275\u0275elementEnd(); 220 \u0275\u0275text(18, "\n "); 221 \u0275\u0275elementEnd(); 222 \u0275\u0275text(19, "\n "); 223 \u0275\u0275elementEnd(); 224 \u0275\u0275text(20, "\n "); 225 \u0275\u0275elementStart(21, "div"); 226 \u0275\u0275text(22, "\n "); 227 \u0275\u0275elementStart(23, "mat-form-field"); 228 \u0275\u0275text(24, "\n "); 229 \u0275\u0275elementStart(25, "input", 28, 2); 230 \u0275\u0275twoWayListener("ngModelChange", function ChatLandingComponent_div_5_div_6_form_7_Template_input_ngModelChange_25_listener($event) { 231 \u0275\u0275restoreView(_r6); 232 const ctx_r2 = \u0275\u0275nextContext(3); 233 \u0275\u0275twoWayBindingSet(ctx_r2.chatConfig.phone, $event) || (ctx_r2.chatConfig.phone = $event); 234 return \u0275\u0275resetView($event); 235 }); 236 \u0275\u0275elementEnd(); 237 \u0275\u0275text(27, "\n "); 238 \u0275\u0275elementEnd(); 239 \u0275\u0275text(28, "\n "); 240 \u0275\u0275elementEnd(); 241 \u0275\u0275text(29, "\n "); 242 \u0275\u0275elementStart(30, "div", 19); 243 \u0275\u0275text(31, "\n "); 244 \u0275\u0275elementStart(32, "button", 29); 245 \u0275\u0275text(33, "Start Chat"); 246 \u0275\u0275elementEnd(); 247 \u0275\u0275text(34, "\n "); 248 \u0275\u0275elementEnd(); 249 \u0275\u0275text(35, "\n "); 250 \u0275\u0275template(36, ChatLandingComponent_div_5_div_6_form_7_div_36_Template, 8, 3, "div", 9); 251 \u0275\u0275text(37, "\n "); 252 \u0275\u0275elementEnd(); 253 } 254 if (rf & 2) { 255 const chatForm_r7 = \u0275\u0275reference(1); 256 const ctx_r2 = \u0275\u0275nextContext(3); 257 \u0275\u0275advance(7); 258 \u0275\u0275twoWayProperty("ngModel", ctx_r2.chatConfig.name); 259 \u0275\u0275advance(9); 260 \u0275\u0275twoWayProperty("ngModel", ctx_r2.chatConfig.email); 261 \u0275\u0275property("pattern", ctx_r2.regex.email); 262 \u0275\u0275advance(9); 263 \u0275\u0275twoWayProperty("ngModel", ctx_r2.chatConfig.phone); 264 \u0275\u0275property("pattern", ctx_r2.regex.phone); 265 \u0275\u0275advance(11); 266 \u0275\u0275property("ngIf", chatForm_r7.submitted); 267 } 268} 269function ChatLandingComponent_div_5_div_6_div_9_Template(rf, ctx) { 270 if (rf & 1) { 271 \u0275\u0275elementStart(0, "div", 32); 272 \u0275\u0275text(1, "\n "); 273 \u0275\u0275elementStart(2, "h2"); 274 \u0275\u0275text(3, "Please exit this chat window and log in to your ParMed web account, then re-open the chat."); 275 \u0275\u0275elementEnd(); 276 \u0275\u0275text(4, "\n "); 277 \u0275\u0275elementEnd(); 278 } 279} 280function ChatLandingComponent_div_5_div_6_Template(rf, ctx) { 281 if (rf & 1) { 282 const _r2 = \u0275\u0275getCurrentView(); 283 \u0275\u0275elementStart(0, "div", 14); 284 \u0275\u0275text(1, "\n "); 285 \u0275\u0275elementStart(2, "mat-radio-group", 21); 286 \u0275\u0275twoWayListener("ngModelChange", function ChatLandingComponent_div_5_div_6_Template_mat_radio_group_ngModelChange_2_listener($event) { 287 \u0275\u0275restoreView(_r2); 288 const ctx_r2 = \u0275\u0275nextContext(2); 289 \u0275\u0275twoWayBindingSet(ctx_r2.chatConfig.isAuthenticatedChat, $event) || (ctx_r2.chatConfig.isAuthenticatedChat = $event);
290 return \u0275\u0275resetView($event); 291 }); 292 \u0275\u0275text(3, "\n "); 293 \u0275\u0275template(4, ChatLandingComponent_div_5_div_6_mat_radio_button_4_Template, 2, 4, "mat-radio-button", 22); 294 \u0275\u0275text(5, "\n "); 295 \u0275\u0275elementEnd(); 296 \u0275\u0275text(6, "\n "); 297 \u0275\u0275template(7, ChatLandingComponent_div_5_div_6_form_7_Template, 38, 6, "form", 23); 298 \u0275\u0275text(8, "\n "); 299 \u0275\u0275template(9, ChatLandingComponent_div_5_div_6_div_9_Template, 5, 0, "div", 24); 300 \u0275\u0275text(10, "\n "); 301 \u0275\u0275elementEnd(); 302 } 303 if (rf & 2) { 304 const ctx_r2 = \u0275\u0275nextContext(2); 305 \u0275\u0275advance(2); 306 \u0275\u0275twoWayProperty("ngModel", ctx_r2.chatConfig.isAuthenticatedChat); 307 \u0275\u0275advance(2); 308 \u0275\u0275property("ngForOf", ctx_r2.chatOptions); 309 \u0275\u0275advance(3); 310 \u0275\u0275property("ngIf", !ctx_r2.chatConfig.isAuthenticatedChat); 311 \u0275\u0275advance(2); 312 \u0275\u0275property("ngIf", ctx_r2.chatConfig.isAuthenticatedChat); 313 } 314} 315function ChatLandingComponent_div_5_div_8_mat_option_24_Template(rf, ctx) { 316 if (rf & 1) { 317 \u0275\u0275elementStart(0, "mat-option", 38); 318 \u0275\u0275text(1, "\n "); 319 \u0275\u0275elementStart(2, "span", 39); 320 \u0275\u0275text(3); 321 \u0275\u0275elementEnd(); 322 \u0275\u0275text(4, "\n "); 323 \u0275\u0275elementEnd(); 324 } 325 if (rf & 2) { 326 const topic_r13 = ctx.$implicit; 327 const i_r14 = ctx.index; 328 \u0275\u0275property("value", \u0275\u0275interpolate(topic_r13.value)); 329 \u0275\u0275advance(2); 330 \u0275\u0275property("id", \u0275\u0275interpolate1("topic-", i_r14 + 1)); 331 \u0275\u0275advance(); 332 \u0275\u0275textInterpolate1(" ", topic_r13.description, " "); 333 } 334} 335function ChatLandingComponent_div_5_div_8_div_35_li_2_Template(rf, ctx) { 336 if (rf & 1) { 337 \u0275\u0275elementStart(0, "li", 31); 338 \u0275\u0275text(1, "\n "); 339 \u0275\u0275elementStart(2, "mat-error"); 340 \u0275\u0275text(3); 341 \u0275\u0275elementEnd(); 342 \u0275\u0275text(4, "\n "); 343 \u0275\u0275elementEnd(); 344 } 345 if (rf & 2) { 346 const ctx_r2 = \u0275\u0275nextContext(4); 347 \u0275\u0275advance(3); 348 \u0275\u0275textInterpolate1("\n ", ctx_r2.messages.NameRequiredMesssage, "\n "); 349 } 350} 351function ChatLandingComponent_div_5_div_8_div_35_li_4_Template(rf, ctx) { 352 if (rf & 1) { 353 \u0275\u0275elementStart(0, "li", 31); 354 \u0275\u0275text(1, "\n "); 355 \u0275\u0275elementStart(2, "mat-error"); 356 \u0275\u0275text(3); 357 \u0275\u0275elementEnd(); 358 \u0275\u0275text(4, "\n "); 359 \u0275\u0275elementEnd(); 360 } 361 if (rf & 2) { 362 const ctx_r2 = \u0275\u0275nextContext(4); 363 \u0275\u0275advance(3); 364 \u0275\u0275textInterpolate1("\n ", ctx_r2.messages.TopicRequiredMesssage, "\n "); 365 } 366} 367function ChatLandingComponent_div_5_div_8_div_35_Template(rf, ctx) { 368 if (rf & 1) { 369 \u0275\u0275elementStart(0, "div"); 370 \u0275\u0275text(1, "\n "); 371 \u0275\u0275template(2, ChatLandingComponent_div_5_div_8_div_35_li_2_Template, 5, 1, "li", 30); 372 \u0275\u0275text(3, "\n "); 373 \u0275\u0275template(4, ChatLandingComponent_div_5_div_8_div_35_li_4_Template, 5, 1, "li", 30); 374 \u0275\u0275text(5, "\n "); 375 \u0275\u0275elementEnd(); 376 } 377 if (rf & 2) { 378 \u0275\u0275nextContext(); 379 const name_r15 = \u0275\u0275reference(10); 380 const topic_r16 = \u0275\u0275reference(19); 381 \u0275\u0275advance(2); 382 \u0275\u0275property("ngIf", name_r15.errors == null ? null : name_r15.errors.required); 383 \u0275\u0275advance(2); 384 \u0275\u0275property("ngIf", topic_r16.errors == null ? null : topic_r16.errors.required); 385 } 386} 387function ChatLandingComponent_div_5_div_8_Template(rf, ctx) { 388 if (rf & 1) { 389 const _r11 = \u0275\u0275getCurrentView(); 390 \u0275\u0275elementStart(0, "div", 14); 391 \u0275\u0275text(1, "\n "); 392 \u0275\u0275elementStart(2, "form", 33, 4); 393 \u0275\u0275listener("ngSubmit", function ChatLandingComponent_div_5_div_8_Template_form_ngSubmit_2_listener() { 394 \u0275\u0275restoreView(_r11); 395 const chatForm_r12 = \u0275\u0275reference(3); 396 const ctx_r2 = \u0275\u0275nextContext(2);
397 return \u0275\u0275resetView(ctx_r2.onChatSubmit(chatForm_r12)); 398 }); 399 \u0275\u0275text(4, "\n "); 400 \u0275\u0275elementStart(5, "div"); 401 \u0275\u0275text(6, "\n "); 402 \u0275\u0275elementStart(7, "mat-form-field"); 403 \u0275\u0275text(8, "\n "); 404 \u0275\u0275elementStart(9, "input", 34, 1); 405 \u0275\u0275twoWayListener("ngModelChange", function ChatLandingComponent_div_5_div_8_Template_input_ngModelChange_9_listener($event) { 406 \u0275\u0275restoreView(_r11); 407 const ctx_r2 = \u0275\u0275nextContext(2); 408 \u0275\u0275twoWayBindingSet(ctx_r2.chatConfig.name, $event) || (ctx_r2.chatConfig.name = $event); 409 return \u0275\u0275resetView($event); 410 }); 411 \u0275\u0275elementEnd(); 412 \u0275\u0275text(11, "\n "); 413 \u0275\u0275elementEnd(); 414 \u0275\u0275text(12, "\n "); 415 \u0275\u0275elementEnd(); 416 \u0275\u0275text(13, "\n "); 417 \u0275\u0275elementStart(14, "div"); 418 \u0275\u0275text(15, "\n "); 419 \u0275\u0275elementStart(16, "mat-form-field"); 420 \u0275\u0275text(17, "\n "); 421 \u0275\u0275elementStart(18, "mat-select", 35, 6); 422 \u0275\u0275twoWayListener("ngModelChange", function ChatLandingComponent_div_5_div_8_Template_mat_select_ngModelChange_18_listener($event) { 423 \u0275\u0275restoreView(_r11); 424 const ctx_r2 = \u0275\u0275nextContext(2); 425 \u0275\u0275twoWayBindingSet(ctx_r2.chatConfig.topic, $event) || (ctx_r2.chatConfig.topic = $event); 426 return \u0275\u0275resetView($event); 427 }); 428 \u0275\u0275text(20, "\n "); 429 \u0275\u0275elementStart(21, "mat-option", 36); 430 \u0275\u0275text(22, "--Select--"); 431 \u0275\u0275elementEnd(); 432 \u0275\u0275text(23, "\n "); 433 \u0275\u0275template(24, ChatLandingComponent_div_5_div_8_mat_option_24_Template, 5, 5, "mat-option", 37); 434 \u0275\u0275text(25, "\n "); 435 \u0275\u0275elementEnd(); 436 \u0275\u0275text(26, "\n "); 437 \u0275\u0275elementEnd(); 438 \u0275\u0275text(27, "\n "); 439 \u0275\u0275elementEnd(); 440 \u0275\u0275text(28, "\n "); 441 \u0275\u0275elementStart(29, "div", 19); 442 \u0275\u0275text(30, "\n "); 443 \u0275\u0275elementStart(31, "button", 29); 444 \u0275\u0275text(32, "Start Chat"); 445 \u0275\u0275elementEnd(); 446 \u0275\u0275text(33, "\n "); 447 \u0275\u0275elementEnd(); 448 \u0275\u0275text(34, "\n "); 449 \u0275\u0275template(35, ChatLandingComponent_div_5_div_8_div_35_Template, 6, 2, "div", 9); 450 \u0275\u0275text(36, "\n "); 451 \u0275\u0275elementEnd(); 452 \u0275\u0275text(37, "\n "); 453 \u0275\u0275elementEnd(); 454 } 455 if (rf & 2) { 456 const chatForm_r12 = \u0275\u0275reference(3); 457 const ctx_r2 = \u0275\u0275nextContext(2); 458 \u0275\u0275advance(9); 459 \u0275\u0275twoWayProperty("ngModel", ctx_r2.chatConfig.name); 460 \u0275\u0275advance(9); 461 \u0275\u0275twoWayProperty("ngModel", ctx_r2.chatConfig.topic); 462 \u0275\u0275advance(6); 463 \u0275\u0275property("ngForOf", ctx_r2.chatTopics); 464 \u0275\u0275advance(11); 465 \u0275\u0275property("ngIf", chatForm_r12.submitted); 466 } 467} 468function ChatLandingComponent_div_5_div_54_li_2_span_4_span_2_Template(rf, ctx) { 469 if (rf & 1) { 470 \u0275\u0275elementStart(0, "span"); 471 \u0275\u0275text(1, ","); 472 \u0275\u0275elementEnd(); 473 } 474} 475function ChatLandingComponent_div_5_div_54_li_2_span_4_Template(rf, ctx) { 476 if (rf & 1) { 477 \u0275\u0275elementStart(0, "span"); 478 \u0275\u0275text(1, " name\n "); 479 \u0275\u0275template(2, ChatLandingComponent_div_5_div_54_li_2_span_4_span_2_Template, 2, 0, "span", 9); 480 \u0275\u0275text(3, "\n "); 481 \u0275\u0275elementEnd(); 482 } 483 if (rf & 2) { 484 \u0275\u0275nextContext(3); 485 const phone_r18 = \u0275\u0275reference(35); 486 const message_r19 = \u0275\u0275reference(44); 487 \u0275\u0275advance(2); 488 \u0275\u0275property("ngIf", (phone_r18.errors == null ? null : phone_r18.errors.required) || (message_r19.errors == null ? null : message_r19.errors.required)); 489 } 490} 491function ChatLandingComponent_div_5_div_54_li_2_span_6_span_2_Template(rf, ctx) { 492 if (rf & 1) { 493 \u0275\u0275elementStart(0, "span"); 494 \u0275\u0275text(1, ","); 495 \u0275\u0275elementEnd(); 496 } 497} 498function ChatLandingComponent_div_5_div_54_li_2_span_6_Template(rf, ctx) { 499 if (rf & 1) { 500 \u0275\u0275elementStart(0, "span"); 501 \u0275\u0275text(1, " phone number\n "); 502 \u0275\u0275template(2, ChatLandingComponent_div_5_div_54_li_2_span_6_span_2_Template, 2, 0, "span", 9); 503 \u0275\u0275text(3, "\n "); 504 \u0275\u0275elementEnd(); 505 } 506 if (rf & 2) { 507 \u0275\u0275nextContext(3); 508 const message_r19 = \u0275\u0275reference(44); 509 \u0275\u0275advance(2); 510 \u0275\u0275property("ngIf", message_r19.errors == null ? null : message_r19.errors.required); 511 } 512} 513function ChatLandingComponent_div_5_div_54_li_2_span_8_Template(rf, ctx) { 514 if (rf & 1) { 515 \u0275\u0275elementStart(0, "span"); 516 \u0275\u0275text(1, " message"); 517 \u0275\u0275elementEnd(); 518 } 519} 520function ChatLandingComponent_div_5_div_54_li_2_Template(rf, ctx) { 521 if (rf & 1) { 522 \u0275\u0275elementStart(0, "li", 31); 523 \u0275\u0275text(1, "\n "); 524 \u0275\u0275elementStart(2, "mat-error"); 525 \u0275\u0275text(3, "\n Please enter a\n "); 526 \u0275\u0275template(4, ChatLandingComponent_div_5_div_54_li_2_span_4_Template, 4, 1, "span", 9); 527 \u0275\u0275text(5, "\n "); 528 \u0275\u0275template(6, ChatLandingComponent_div_5_div_54_li_2_span_6_Template, 4, 1, "span", 9); 529 \u0275\u0275text(7, "\n "); 530 \u0275\u0275template(8, ChatLandingComponent_div_5_div_54_li_2_span_8_Template, 2, 0, "span", 9); 531 \u0275\u0275text(9, "\n "); 532 \u0275\u0275elementEnd(); 533 \u0275\u0275text(10, "\n "); 534 \u0275\u0275elementEnd(); 535 } 536 if (rf & 2) { 537 \u0275\u0275nextContext(2); 538 const name_r20 = \u0275\u0275reference(26); 539 const phone_r18 = \u0275\u0275reference(35); 540 const message_r19 = \u0275\u0275reference(44); 541 \u0275\u0275advance(4); 542 \u0275\u0275property("ngIf", name_r20.errors == null ? null : name_r20.errors.required); 543 \u0275\u0275advance(2); 544 \u0275\u0275property("ngIf", phone_r18.errors == null ? null : phone_r18.errors.required); 545 \u0275\u0275advance(2); 546 \u0275\u0275property("ngIf", message_r19.errors == null ? null : message_r19.errors.required); 547 } 548} 549function ChatLandingComponent_div_5_div_54_li_4_Template(rf, ctx) { 550 if (rf & 1) { 551 \u0275\u0275elementStart(0, "li", 31); 552 \u0275\u0275text(1, "\n "); 553 \u0275\u0275elementStart(2, "mat-error"); 554 \u0275\u0275text(3, "\n Please enter a 10-digit phone number without any spaces or characters.\n "); 555 \u0275\u0275elementEnd(); 556 \u0275\u0275text(4, "\n "); 557 \u0275\u0275elementEnd(); 558 } 559} 560function ChatLandingComponent_div_5_div_54_Template(rf, ctx) { 561 if (rf & 1) { 562 \u0275\u0275elementStart(0, "div"); 563 \u0275\u0275text(1, "\n "); 564 \u0275\u0275template(2, ChatLandingComponent_div_5_div_54_li_2_Template, 11, 3, "li", 30); 565 \u0275\u0275text(3, "\n "); 566 \u0275\u0275template(4, ChatLandingComponent_div_5_div_54_li_4_Template, 5, 0, "li", 30); 567 \u0275\u0275text(5, "\n "); 568 \u0275\u0275elementEnd(); 569 } 570 if (rf & 2) { 571 \u0275\u0275nextContext(); 572 const name_r20 = \u0275\u0275reference(26); 573 const phone_r18 = \u0275\u0275reference(35); 574 const message_r19 = \u0275\u0275reference(44); 575 \u0275\u0275advance(2); 576 \u0275\u0275property("ngIf", (name_r20.errors == null ? null : name_r20.errors.required) || (phone_r18.errors == null ? null : phone_r18.errors.required) || (message_r19.errors == null ? null : message_r19.errors.required)); 577 \u0275\u0275advance(2); 578 \u0275\u0275property("ngIf", phone_r18.value && (phone_r18.errors == null ? null : phone_r18.errors.pattern)); 579 } 580} 581function ChatLandingComponent_div_5_Template(rf, ctx) { 582 if (rf & 1) { 583 const _r1 = \u0275\u0275getCurrentView(); 584 \u0275\u0275elementStart(0, "div"); 585 \u0275\u0275text(1, "\n "); 586 \u0275\u0275elementStart(2, "mat-tab-group"); 587 \u0275\u0275text(3, "\n "); 588 \u0275\u0275elementStart(4, "mat-tab", 11); 589 \u0275\u0275text(5, "\n "); 590 \u0275\u0275template(6, ChatLandingComponent_div_5_div_6_Template, 11, 4, "div", 12); 591 \u0275\u0275text(7, "\n "); 592 \u0275\u0275template(8, ChatLandingComponent_div_5_div_8_Template, 38, 4, "div", 12); 593 \u0275\u0275text(9, "\n "); 594 \u0275\u0275elementEnd(); 595 \u0275\u0275text(10, "\n "); 596 \u0275\u0275elementStart(11, "mat-tab", 13); 597 \u0275\u0275text(12, "\n "); 598 \u0275\u0275elementStart(13, "div", 14); 599 \u0275\u0275text(14, "\n "); 600 \u0275\u0275elementStart(15, "p"); 601 \u0275\u0275text(16, "Leave a message and one of our Customer Service representatives will call you."); 602 \u0275\u0275elementEnd(); 603 \u0275\u0275text(17, "\n "); 604 \u0275\u0275elementStart(18, "form", 15, 0); 605 \u0275\u0275listener("ngSubmit", function ChatLandingComponent_div_5_Template_form_ngSubmit_18_listener() { 606 \u0275\u0275restoreView(_r1); 607 const callBackForm_r17 = \u0275\u0275reference(19); 608 const ctx_r2 = \u0275\u0275nextContext();
609 return \u0275\u0275resetView(ctx_r2.onRequestCallbackSubmit(callBackForm_r17)); 610 }); 611 \u0275\u0275text(20, "\n "); 612 \u0275\u0275elementStart(21, "div"); 613 \u0275\u0275text(22, "\n "); 614 \u0275\u0275elementStart(23, "mat-form-field"); 615 \u0275\u0275text(24, "\n "); 616 \u0275\u0275elementStart(25, "input", 16, 1); 617 \u0275\u0275twoWayListener("ngModelChange", function ChatLandingComponent_div_5_Template_input_ngModelChange_25_listener($event) { 618 \u0275\u0275restoreView(_r1); 619 const ctx_r2 = \u0275\u0275nextContext(); 620 \u0275\u0275twoWayBindingSet(ctx_r2.callback.name, $event) || (ctx_r2.callback.name = $event); 621 return \u0275\u0275resetView($event); 622 }); 623 \u0275\u0275elementEnd(); 624 \u0275\u0275text(27, "\n "); 625 \u0275\u0275elementEnd(); 626 \u0275\u0275text(28, "\n "); 627 \u0275\u0275elementEnd(); 628 \u0275\u0275text(29, "\n "); 629 \u0275\u0275elementStart(30, "div"); 630 \u0275\u0275text(31, "\n "); 631 \u0275\u0275elementStart(32, "mat-form-field"); 632 \u0275\u0275text(33, "\n "); 633 \u0275\u0275elementStart(34, "input", 17, 2); 634 \u0275\u0275twoWayListener("ngModelChange", function ChatLandingComponent_div_5_Template_input_ngModelChange_34_listener($event) { 635 \u0275\u0275restoreView(_r1); 636 const ctx_r2 = \u0275\u0275nextContext(); 637 \u0275\u0275twoWayBindingSet(ctx_r2.callback.phone, $event) || (ctx_r2.callback.phone = $event); 638 return \u0275\u0275resetView($event); 639 }); 640 \u0275\u0275elementEnd(); 641 \u0275\u0275text(36, "\n "); 642 \u0275\u0275elementEnd(); 643 \u0275\u0275text(37, "\n "); 644 \u0275\u0275elementEnd(); 645 \u0275\u0275text(38, "\n "); 646 \u0275\u0275elementStart(39, "div"); 647 \u0275\u0275text(40, "\n "); 648 \u0275\u0275elementStart(41, "mat-form-field"); 649 \u0275\u0275text(42, "\n "); 650 \u0275\u0275elementStart(43, "textarea", 18, 3); 651 \u0275\u0275twoWayListener("ngModelChange", function ChatLandingComponent_div_5_Template_textarea_ngModelChange_43_listener($event) { 652 \u0275\u0275restoreView(_r1); 653 const ctx_r2 = \u0275\u0275nextContext(); 654 \u0275\u0275twoWayBindingSet(ctx_r2.callback.message, $event) || (ctx_r2.callback.message = $event); 655 return \u0275\u0275resetView($event); 656 }); 657 \u0275\u0275elementEnd(); 658 \u0275\u0275text(45, "\n "); 659 \u0275\u0275elementEnd(); 660 \u0275\u0275text(46, "\n "); 661 \u0275\u0275elementEnd(); 662 \u0275\u0275text(47, "\n "); 663 \u0275\u0275elementStart(48, "div", 19); 664 \u0275\u0275text(49, "\n "); 665 \u0275\u0275elementStart(50, "button", 20); 666 \u0275\u0275text(51, "Request Callback"); 667 \u0275\u0275elementEnd(); 668 \u0275\u0275text(52, "\n "); 669 \u0275\u0275elementEnd(); 670 \u0275\u0275text(53, "\n "); 671 \u0275\u0275template(54, ChatLandingComponent_div_5_div_54_Template, 6, 2, "div", 9); 672 \u0275\u0275text(55, "\n "); 673 \u0275\u0275elementEnd(); 674 \u0275\u0275text(56, "\n "); 675 \u0275\u0275elementEnd(); 676 \u0275\u0275text(57, "\n "); 677 \u0275\u0275elementEnd(); 678 \u0275\u0275text(58, "\n "); 679 \u0275\u0275elementEnd(); 680 \u0275\u0275text(59, "\n"); 681 \u0275\u0275elementEnd(); 682 } 683 if (rf & 2) { 684 const callBackForm_r17 = \u0275\u0275reference(19); 685 const ctx_r2 = \u0275\u0275nextContext(); 686 \u0275\u0275advance(6); 687 \u0275\u0275property("ngIf", !ctx_r2.chatConfig.userAuthenticated); 688 \u0275\u0275advance(2); 689 \u0275\u0275property("ngIf", ctx_r2.chatConfig.userAuthenticated); 690 \u0275\u0275advance(17); 691 \u0275\u0275twoWayProperty("ngModel", ctx_r2.callback.name); 692 \u0275\u0275advance(9); 693 \u0275\u0275property("pattern", ctx_r2.regex.phone); 694 \u0275\u0275twoWayProperty("ngModel", ctx_r2.callback.phone); 695 \u0275\u0275advance(9); 696 \u0275\u0275twoWayProperty("ngModel", ctx_r2.callback.message); 697 \u0275\u0275advance(11); 698 \u0275\u0275property("ngIf", callBackForm_r17.submitted); 699 } 700} 701function ChatLandingComponent_div_7_Template(rf, ctx) { 702 if (rf & 1) { 703 \u0275\u0275elementStart(0, "div", 40); 704 \u0275\u0275text(1, "\n "); 705 \u0275\u0275elementStart(2, "p"); 706 \u0275\u0275text(3, "Your request for a phone call from one of our Customer Service representatives has been received."); 707 \u0275\u0275elementEnd(); 708 \u0275\u0275text(4, "\n "); 709 \u0275\u0275elementStart(5, "p"); 710 \u0275\u0275text(6, "If you require urgent assistance prior to re
710ceiving a call, please contact us at 800.727.6331."); 711 \u0275\u0275elementEnd(); 712 \u0275\u0275text(7, "\n "); 713 \u0275\u0275elementStart(8, "p"); 714 \u0275\u0275text(9, "Thank you!"); 715 \u0275\u0275elementEnd(); 716 \u0275\u0275text(10, "\n"); 717 \u0275\u0275elementEnd(); 718 } 719} 720var ChatLandingComponent = class _ChatLandingComponent { 721 /***************Properties***************/ 722 /***************Constructor***************/ 723 constructor(cache, messages, chatService, userService, route, authService) { 724 this.cache = cache; 725 this.messages = messages; 726 this.chatService = chatService; 727 this.userService = userService; 728 this.route = route; 729 this.authService = authService; 730 this.websiteName = this.cache.get(CacheConstant.Env_Properties).theme; 731 this.chatOptions = [ 732 { value: true, description: "I have a ParMed web account" }, 733 { value: false, description: "I do not have a ParMed web account" } 734 ]; 735 this.chatTopics = [ 736 { value: ChatGroups.CUSTOMER_CARE, description: "Billing" }, 737 { 738 value: ChatGroups.SALES, 739 description: "Chat with Sales Rep" 740 }, 741 { 742 value: ChatGroups.CUSTOMER_CARE, 743 description: "Delivery/Shipping" 744 }, 745 { 746 value: ChatGroups.CUSTOMER_CARE, 747 description: "Opening an account" 748 }, 749 { 750 value: ChatGroups.CUSTOMER_CARE, 751 description: "Returning products" 752 }, 753 { 754 value: ChatGroups.CUSTOMER_CARE, 755 description: "Technical/website issue" 756 }, 757 { value: ChatGroups.CUSTOMER_CARE, description: "Other" } 758 ]; 759 this.chatConfig = { 760 isAuthenticatedChat: false, 761 userAuthenticated: false, 762 name: "", 763 email: "", 764 phone: "", 765 topic: "" 766 }; 767 this.callback = { name: "", phone: "", message: "" }; 768 this.callBackSuccess = false; 769 this.regex = { email: Regex.Email, phone: Regex.Phone }; 770 } 771 ngOnInit() { 772 this.chatConfig.userAuthenticated = this.authService.isAuthenticated(); 773 } 774 /***************Constructor***************/ 775 /******************Component Methods******************/ 776 onChatSubmit(form) { 777 if (form.invalid) { 778 return; 779 } 780 this.setStartChatRequest(); 781 AppUtilService.router.navigate([ChatRoutes.StartChat]); 782 } 783 onRequestCallbackSubmit(form) { 784 if (form.invalid) { 785 return; 786 } 787 let accountNumber = ""; 788 if (this.chatConfig.userAuthenticated) { 789 const defaultAccount = this.userService.getDefaultAccSoldtoShipToObj(); 790 accountNumber = defaultAccount.shipToNum; 791 } 792 const _participant = { 793 name: this.callback.name, 794 credentials: "", 795 telephone: this.callback.phone 796 }; 797 const _attributes = { 798 phone: "", 799 accountnumber: accountNumber.toString(), 800 repInitiatedChat: "false" 801 }; 802 const createCallbackRequest = { 803 participant: _participant, 804 target: ChatGroups.CUSTOMER_CARE, 805 targettype: "Workgroup", 806 attributes: _attributes, 807 subject: this.callback.message 808 }; 809 this.chatService.callBack(createCallbackRequest).subscribe((response) => { 810 const createCallbackResponse = response.callback; 811 this.callBackSuccess = createCallbackResponse.status.type === "success"; 812 }); 813 } 814 /******************Component Methods******************/ 815 /******************Private Methods******************/ 816 setStartChatRequest() { 817 const participant = { 818 name: this.chatConfig.name, 819 credentials: "" 820 }; 821 let accountNumber = ""; 822 if (this.chatConfig.userAuthenticated) { 823 const defaultAccount = this.userService.getDefaultAccSoldtoShipToObj(); 824 accountNumber = defaultAccount.shipToNum; 825 } 826 const attributes = { 827 phone: this.chatConfig.phone, 828 accountnumber: accountNumber.toString(), 829 repInitiatedChat: "false" 830 }; 831 this.chatService.startChatRequest = { 832 supportedContentTypes: "text/plain", 833 participant, 834 attributes, 835 emailAddress: this.chatConfig.email, 836 transcriptRequired: false, 837 target: this.chatConfig.userAuthenticated ? this.chatConfig.topic : ChatGroups.CUSTOMER_CARE, 838 targettype: "Workgroup", 839 language: "en-us", 840 clientToken: "deprecated" 841 }; 842 } 843 static { 844 this.\u0275fac = function ChatLandingComponent_Factory(__ngFactoryType__) { 845 return new (__ngFactoryType__ || _ChatLandingComponent)(\u0275\u0275directiveInject(AppCacheService), \u0275\u0275directiveInject(ChatMessages), \u0275\u0275directiveInject(ChatService), \u0275\u0275directiveInject(UserService), \u0275\u0275directiveInject(ActivatedRoute), \u0275\u0275directiveInject(AuthService)); 846 }; 847 } 848 static { 849 this.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({ type: _ChatLandingComponent, selectors: [["par-chat-landing"]], standalone: false, decls: 8, vars: 4, consts: [["callBackForm", "ngForm"], ["name", "ngModel"], ["phone", "ngModel"], ["message", "ngModel"], ["chatForm", "ngForm"], ["email", "ngModel"], ["to
849pic", "ngModel"], [1, "chat-header-logo"], ["alt", "", "title", "", 3, "src"], [4, "ngIf"], ["class", "call-back-success", 4, "ngIf"], ["label", "CHAT"], ["class", "chat-mat-tab", 4, "ngIf"], ["label", "CALLBACK"], [1, "chat-mat-tab"], [3, "ngSubmit"], ["id", "callback-name", "matInput", "", "name", "name", "required", "", "maxlength", "50", "placeholder", "Name", 3, "ngModelChange", "ngModel"], ["id", "callback-phone", "matInput", "", "name", "phone", "required", "", "maxlength", "10", "placeholder", "Telephone", 3, "ngModelChange", "pattern", "ngModel"], ["id", "callback-msg", "matInput", "", "name", "message", "required", "", "row", "4", "maxlength", "50", "placeholder", "Message", 3, "ngModelChange", "ngModel"], [1, "chat-start-button"], ["id", "btn-request-callback", "type", "submit", "mat-raised-button", "", "color", "accent"], [1, "chat-radio-group", 3, "ngModelChange", "ngModel"], ["class", "chat-radio-button", 3, "id", "value", 4, "ngFor", "ngForOf"], [3, "ngSubmit", 4, "ngIf"], ["class", "user-not-logged-in", 4, "ngIf"], [1, "chat-radio-button", 3, "id", "value"], ["id", "name", "matInput", "", "name", "name", "required", "", "maxlength", "50", "placeholder", "Name", 3, "ngModelChange", "ngModel"], ["id", "email", "matInput", "", "name", "email", "maxlength", "50", "placeholder", "Email", 3, "ngModelChange", "ngModel", "pattern"], ["id", "phone", "matInput", "", "name", "phone", "maxlength", "10", "placeholder", "Phone", 3, "ngModelChange", "ngModel", "pattern"], ["id", "btn-start", "type", "submit", "mat-raised-button", "", "color", "accent"], ["class", "error", 4, "ngIf"], [1, "error"], [1, "user-not-logged-in"], ["novalidate", "", 3, "ngSubmit"], ["id", "name", "matInput", "", "name", "name", "required", "", "placeholder", "Name", "maxlength", "50", 3, "ngModelChange", "ngModel"], ["id", "chat-topics", "name", "chatTopic", "required", "", "placeholder", "Topic", 3, "ngModelChange", "ngModel"], ["value", ""], [3, "value", 4, "ngFor", "ngForOf"], [3, "value"], [3, "id"], [1, "call-back-success"]], template: function ChatLandingComponent_Template(rf, ctx) { 850 if (rf & 1) { 851 \u0275\u0275elementStart(0, "div", 7); 852 \u0275\u0275text(1, "\n "); 853 \u0275\u0275element(2, "img", 8); 854 \u0275\u0275text(3, "\n"); 855 \u0275\u0275elementEnd(); 856 \u0275\u0275text(4, "\n"); 857 \u0275\u0275template(5, ChatLandingComponent_div_5_Template, 60, 7, "div", 9); 858 \u0275\u0275text(6, "\n"); 859 \u0275\u0275template(7, ChatLandingComponent_div_7_Template, 11, 0, "div", 10); 860 } 861 if (rf & 2) { 862 \u0275\u0275advance(2); 863 \u0275\u0275property("src", \u0275\u0275interpolate1("/assets/images/", ctx.websiteName, "/LogoNew.png"), \u0275\u0275sanitizeUrl); 864 \u0275\u0275advance(3); 865 \u0275\u0275property("ngIf", !ctx.callBackSuccess); 866 \u0275\u0275advance(2); 867 \u0275\u0275property("ngIf", ctx.callBackSuccess); 868 } 869 }, dependencies: [NgForOf, NgIf, \u0275NgNoValidate, DefaultValueAccessor, NgControlStatus, NgControlStatusGroup, RequiredValidator, MaxLengthValidator, PatternValidator, NgModel, NgForm, MatButton, MatFormField, MatError, MatInput, MatTab, MatTabGroup, MatRadioGroup, MatRadioButton, MatSelect, MatOption], styles: ["\n\nmat-form-field[_ngcontent-%COMP%] {\n display: inline;\n}\n.chat-header-logo[_ngcontent-%COMP%] {\n margin: 10px 0 20px;\n text-align: center;\n}\n.chat-mat-tab[_ngcontent-%COMP%] {\n padding: 15px 5px;\n}\n.chat-radio-group[_ngcontent-%COMP%] .chat-radio-button[_ngcontent-%COMP%] {\n display: list-item;\n padding: 5px 0px;\n}\n.chat-start-button[_ngcontent-%COMP%] {\n padding: 10px 0;\n}\n.user-not-logged-in[_ngcontent-%COMP%] {\n height: 350px;\n text-align: center;\n vertical-align: middle;\n display: table-cell;\n color: red;\n}\n.call-back-success[_ngcontent-%COMP%] {\n border-top: 1px solid #005180;\n padding: 20px 20px 0;\n}\n.error[_ngcontent-%COMP%] {\n color: #f44336;\n font-weight: bold;\n}\n.error[_ngcontent-%COMP%] .mat-mdc-form-field-error[_ngcontent-%COMP%] {\n display: inline;\n}"] }); 870 } 871}; 872(() => { 873 (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ChatLandingComponent, [{ 874 type: Component, 875 args: [{ selector: "par-chat-landing", standalone: false, template: `<div class="chat-header-logo"> 876 <img src='/assets/images/{{websiteName}}/LogoNew.png' alt="" title="" /> 877</div> 878<div *ngIf="!callBackSuccess"> 879 <mat-tab-group> 880 <mat-tab label="CHAT"> 881 <div class="chat-mat-tab" *ngIf="!chatConfig.userAuthenticated"> 882 <mat-radio-group class="chat-radio-group" [(ngModel)]="chatConfig.isAuthenticatedChat"> 883 <mat-radio-button id="chat-options-{{i+1}}" class="chat-radio-button" *ngFor="let chat of chatOptions; let i = index" [value]="chat.value"> 884 {{chat.description}} 885 </mat-radio-button>
885 886 </mat-radio-group> 887 <form (ngSubmit)="onChatSubmit(chatForm)" #chatForm="ngForm" *ngIf="!chatConfig.isAuthenticatedChat"> 888 <div> 889 <mat-form-field> 890 <input id="name" matInput name="name" [(ngModel)]="chatConfig.name" required #name="ngModel" maxlength="50" placeholder="Name"> 891 </mat-form-field> 892 </div> 893 <div> 894 <mat-form-field> 895 <input id="email" matInput name="email" [(ngModel)]="chatConfig.email" #email="ngModel" [pattern]="regex.email" maxlength="50" placeholder="Email"> 896 </mat-form-field> 897 </div> 898 <div> 899 <mat-form-field> 900 <input id="phone" matInput name="phone" [(ngModel)]="chatConfig.phone" #phone="ngModel" [pattern]="regex.phone" maxlength="10" placeholder="Phone"> 901 </mat-form-field> 902 </div> 903 <div class="chat-start-button"> 904 <button id="btn-start" type="submit" mat-raised-button color="accent">Start Chat</button> 905 </div> 906 <div *ngIf="chatForm.submitted"> 907 <li *ngIf="name.errors?.required" class="error"> 908 <mat-error> 909 {{messages.NameRequiredMesssage}} 910 </mat-error> 911 </li> 912 <li *ngIf="email.errors?.pattern" class="error"> 913 <mat-error> 914 {{messages.EmailValidationMessage}} 915 </mat-error> 916 </li> 917 <li *ngIf="phone.errors?.pattern" class="error"> 918 <mat-error> 919 {{messages.PhoneNumberValidation}} 920 </mat-error> 921 </li> 922 </div> 923 </form> 924 <div *ngIf="chatConfig.isAuthenticatedChat" class="user-not-logged-in"> 925 <h2>Please exit this chat window and log in to your ParMed web account, then re-open the chat.</h2> 926 </div> 927 </div> 928 <div class="chat-mat-tab" *ngIf="chatConfig.userAuthenticated"> 929 <form (ngSubmit)="onChatSubmit(chatForm)" #chatForm="ngForm" novalidate> 930 <div> 931 <mat-form-field> 932 <input id="name" matInput name="name" [(ngModel)]="chatConfig.name" required #name="ngModel" placeholder="Name" maxlength="50"> 933 </mat-form-field> 934 </div> 935 <div> 936 <mat-form-field> 937 <mat-select id="chat-topics" name="chatTopic" [(ngModel)]="chatConfig.topic" #topic="ngModel" required placeholder="Topic"> 938 <mat-option value="">--Select--</mat-option> 939 <mat-option *ngFor="let topic of chatTopics; let i = index" value="{{topic.value}}"> 940 <span id="topic-{{i+1}}"> {{topic.description}} </span> 941 </mat-option> 942 </mat-select> 943 </mat-form-field> 944 </div> 945 <div class="chat-start-button"> 946 <button id="btn-start" type="submit" mat-raised-button color="accent">Start Chat</button> 947 </div> 948 <div *ngIf="chatForm.submitted"> 949 <li *ngIf="name.errors?.required" class="error"> 950 <mat-error> 951 {{messages.NameRequiredMesssage}} 952 </mat-error> 953 </li> 954 <li *ngIf="topic.errors?.required" class="error"> 955 <mat-error> 956 {{messages.TopicRequiredMesssage}} 957 </mat-error> 958 </li> 959 </div> 960 </form> 961 </div> 962 </mat-tab> 963 <mat-tab label="CALLBACK"> 964 <div class="chat-mat-tab"> 965 <p>Leave a message and one of our Customer Service representatives will call you.</p> 966 <form (ngSubmit)="onRequestCallbackSubmit(callBackForm)" #callBackForm="ngForm"> 967 <div> 968 <mat-form-field> 969 <input id="callback-name" matInput name="name" required #name="ngModel" maxlength="50" placeholder="Name" [(ngModel)]="callback.name"> 970 </mat-form-field> 971 </div> 972 <div> 973 <mat-form-field> 974 <input id="callback-phone" matInput name="phone" required #phone="ngModel" [pattern]="regex.phone" maxlength="10" placeholder="Telephone" [(ngModel)]="callback.phone"> 975 </mat-form-field> 976 </div> 977 <div> 978 <mat-form-field> 979 <textarea id="callback-msg" matInput name="message" required #message="ngModel" row="4" maxlength="50" placeholder="Message" [(ngModel)]="callback.message"></textarea> 980 </mat-form-field> 981 </div> 982 <div class="chat-start-button"> 983 <button id="btn-request-callback" type="submit" mat-raised-button color="accent">Request Callback</button> 984 </div> 985 <div *ngIf="callBackForm.submitted"> 986 <li *ngIf="name.errors?.required || phone.errors?.required || message.errors?.required" class="error"> 987 <mat-error> 988 Please enter a
989 <span *ngIf="name.errors?.required"> name 990 <span *ngIf="phone.errors?.required || message.errors?.required">,</span> 991 </span> 992 <span *ngIf="phone.errors?.required"> phone number 993 <span *ngIf="message.errors?.required">,</span> 994 </span> 995 <span *ngIf="message.errors?.required"> message</span> 996 </mat-error> 997 </li> 998 <li *ngIf="phone.value && phone.errors?.pattern" class="error"> 999 <mat-error> 1000 Please enter a 10-digit phone number without any spaces or characters. 1001 </mat-error> 1002 </li> 1003 </div> 1004 </form> 1005 </div> 1006 </mat-tab> 1007 </mat-tab-group> 1008</div> 1009<div class="call-back-success" *ngIf="callBackSuccess"> 1010 <p>Your request for a phone call from one of our Customer Service representatives has been received.</p> 1011 <p>If you require urgent assistance prior to receiving a call, please contact us at 800.727.6331.</p> 1012 <p>Thank you!</p> 1013</div>`, styles: ["/* src/app/modules/chat/chat-landing/chat-landing.component.scss */\nmat-form-field {\n display: inline;\n}\n.chat-header-logo {\n margin: 10px 0 20px;\n text-align: center;\n}\n.chat-mat-tab {\n padding: 15px 5px;\n}\n.chat-radio-group .chat-radio-button {\n display: list-item;\n padding: 5px 0px;\n}\n.chat-start-button {\n padding: 10px 0;\n}\n.user-not-logged-in {\n height: 350px;\n text-align: center;\n vertical-align: middle;\n display: table-cell;\n color: red;\n}\n.call-back-success {\n border-top: 1px solid #005180;\n padding: 20px 20px 0;\n}\n.error {\n color: #f44336;\n font-weight: bold;\n}\n.error .mat-mdc-form-field-error {\n display: inline;\n}\n"] }] 1014 }], () => [{ type: AppCacheService }, { type: ChatMessages }, { type: ChatService }, { type: UserService }, { type: ActivatedRoute }, { type: AuthService }], null); 1015})(); 1016(() => { 1017 (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(ChatLandingComponent, { className: "ChatLandingComponent", filePath: "src/app/modules/chat/chat-landing/chat-landing.component.ts", lineNumber: 26 }); 1018})(); 1019
1020// src/app/modules/chat/chat-main/exit-chat-dialog/exit-chat-dialog.component.ts 1021var ExitChatDialogComponent = class _ExitChatDialogComponent { 1022 constructor(dialogRef) { 1023 this.dialogRef = dialogRef; 1024 } 1025 onClose() { 1026 this.dialogRef.close(false); 1027 } 1028 static { 1029 this.\u0275fac = function ExitChatDialogComponent_Factory(__ngFactoryType__) { 1030 return new (__ngFactoryType__ || _ExitChatDialogComponent)(\u0275\u0275directiveInject(MatDialogRef)); 1031 }; 1032 } 1033 static { 1034 this.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({ type: _ExitChatDialogComponent, selectors: [["par-exit-chat"]], standalone: false, decls: 22, vars: 2, consts: [["mat-dialog-title", ""], [1, "dialog-close-button"], ["id", "close", 3, "click"], ["src", "/assets/images/close-popup.png"], ["mat-dialog-content", "", "cdkFocusInitial", ""], ["mat-dialog-actions", ""], ["id", "btn-close", "mat-raised-button", "", 3, "mat-dialog-close"], ["id", "btn-cancel", "mat-raised-button", "", 3, "mat-dialog-close"]], template: function ExitChatDialogComponent_Template(rf, ctx) { 1035 if (rf & 1) { 1036 \u0275\u0275elementStart(0, "div", 0); 1037 \u0275\u0275text(1, "Exit Chat\n "); 1038 \u0275\u0275elementStart(2, "div", 1); 1039 \u0275\u0275text(3, "\n "); 1040 \u0275\u0275elementStart(4, "a", 2); 1041 \u0275\u0275listener("click", function ExitChatDialogComponent_Template_a_click_4_listener() { 1042 return ctx.onClose(); 1043 }); 1044 \u0275\u0275text(5, "\n "); 1045 \u0275\u0275element(6, "img", 3); 1046 \u0275\u0275text(7, "\n "); 1047 \u0275\u0275elementEnd(); 1048 \u0275\u0275text(8, "\n "); 1049 \u0275\u0275elementEnd(); 1050 \u0275\u0275text(9, "\n"); 1051 \u0275\u0275elementEnd(); 1052 \u0275\u0275text(10, "\n"); 1053 \u0275\u0275elementStart(11, "div", 4); 1054 \u0275\u0275text(12, "\n Are you sure you want to close this chat session?\n"); 1055 \u0275\u0275elementEnd(); 1056 \u0275\u0275text(13, "\n"); 1057 \u0275\u0275elementStart(14, "div", 5); 1058 \u0275\u0275text(15, "\n "); 1059 \u0275\u0275elementStart(16, "button", 6); 1060 \u0275\u0275text(17, "Close Chat"); 1061 \u0275\u0275elementEnd(); 1062 \u0275\u0275text(18, "\n "); 1063 \u0275\u0275elementStart(19, "button", 7); 1064 \u0275\u0275text(20, "Cancel"); 1065 \u0275\u0275elementEnd(); 1066 \u0275\u0275text(21, "\n"); 1067 \u0275\u0275elementEnd(); 1068 } 1069 if (rf & 2) { 1070 \u0275\u0275advance(16); 1071 \u0275\u0275property("mat-dialog-close", true); 1072 \u0275\u0275advance(3); 1073 \u0275\u0275property("mat-dialog-close", false); 1074 } 1075 }, dependencies: [MatButton, MatDialogClose, MatDialogTitle, MatDialogActions, MatDialogContent], encapsulation: 2 }); 1076 } 1077}; 1078(() => { 1079 (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ExitChatDialogComponent, [{ 1080 type: Component, 1081 args: [{ selector: "par-exit-chat", standalone: false, template: '<div mat-dialog-title>Exit Chat\n <div class="dialog-close-button">\n <a id="close" (click)="onClose()">\n <img src="/assets/images/close-popup.png">\n </a>\n </div>\n</div>\n<div mat-dialog-content cdkFocusInitial>\n Are you sure you want to close this chat session?\n</div>\n<div mat-dialog-actions>\n <button id="btn-close" mat-raised-button [mat-dialog-close]="true">Close Chat</button>\n <button id="btn-cancel" mat-raised-button [mat-dialog-close]="false">Cancel</button>\n</div>' }] 1082 }], () => [{ type: MatDialogRef }], null); 1083})(); 1084(() => { 1085 (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(ExitChatDialogComponent, { className: "ExitChatDialogComponent", filePath: "src/app/modules/chat/chat-main/exit-chat-dialog/exit-chat-dialog.component.ts", lineNumber: 11 }); 1086})(); 1087
1088// src/app/modules/chat/chat-main/chat-main.component.ts 1089var _c0 = ["chatContentElement"]; 1090function ChatMainComponent_div_7_div_2_Template(rf, ctx) { 1091 if (rf & 1) { 1092 \u0275\u0275elementStart(0, "div"); 1093 \u0275\u0275text(1, "\n "); 1094 \u0275\u0275elementStart(2, "div", 14); 1095 \u0275\u0275text(3, "\n Welcome\n "); 1096 \u0275\u0275elementStart(4, "span", 15); 1097 \u0275\u0275text(5); 1098 \u0275\u0275elementEnd(); 1099 \u0275\u0275text(6, ">\n "); 1100 \u0275\u0275elementEnd(); 1101 \u0275\u0275text(7, "\n "); 1102 \u0275\u0275elementStart(8, "table", 16); 1103 \u0275\u0275text(9, "\n "); 1104 \u0275\u0275elementStart(10, "tr"); 1105 \u0275\u0275text(11, "\n "); 1106 \u0275\u0275elementStart(12, "td", 17); 1107 \u0275\u0275text(13, "\n "); 1108 \u0275\u0275element(14, "img", 18); 1109 \u0275\u0275text(15, "\n "); 1110 \u0275\u0275elementEnd(); 1111 \u0275\u0275text(16, "\n "); 1112 \u0275\u0275elementStart(17, "td", 19); 1113 \u0275\u0275text(18, "\n "); 1114 \u0275\u0275elementStart(19, "span", 20); 1115 \u0275\u0275text(20); 1116 \u0275\u0275elementEnd(); 1117 \u0275\u0275text(21, "\n "); 1118 \u0275\u0275elementEnd(); 1119 \u0275\u0275text(22, "\n "); 1120 \u0275\u0275elementEnd(); 1121 \u0275\u0275text(23, "\n "); 1122 \u0275\u0275elementEnd(); 1123 \u0275\u0275text(24, "\n "); 1124 \u0275\u0275elementStart(25, "div", 21); 1125 \u0275\u0275text(26); 1126 \u0275\u0275elementEnd(); 1127 \u0275\u0275text(27, "\n "); 1128 \u0275\u0275elementEnd(); 1129 } 1130 if (rf & 2) { 1131 const ctx_r1 = \u0275\u0275nextContext(2); 1132 \u0275\u0275advance(5); 1133 \u0275\u0275textInterpolate(ctx_r1.currentChatSession.userDisplayName); 1134 \u0275\u0275advance(9); 1135 \u0275\u0275property("src", ctx_r1.currentChatSession.repImageURL, \u0275\u0275sanitizeUrl); 1136 \u0275\u0275advance(6); 1137 \u0275\u0275textInterpolate1(" ", ctx_r1.currentChatSession.repDisplayName); 1138 \u0275\u0275advance(6); 1139 \u0275\u0275textInterpolate(ctx_r1.chatConfig.todayDate); 1140 } 1141} 1142function ChatMainComponent_div_7_Template(rf, ctx) { 1143 if (rf & 1) { 1144 const _r1 = \u0275\u0275getCurrentView(); 1145 \u0275\u0275elementStart(0, "div"); 1146 \u0275\u0275text(1, "\n "); 1147 \u0275\u0275template(2, ChatMainComponent_div_7_div_2_Template, 28, 4, "div", 4); 1148 \u0275\u0275text(3, "\n "); 1149 \u0275\u0275elementStart(4, "div", 6, 0); 1150 \u0275\u0275text(6, "\n "); 1151 \u0275\u0275elementEnd(); 1152 \u0275\u0275text(7, "\n "); 1153 \u0275\u0275elementStart(8, "div", 7); 1154 \u0275\u0275text(9, "\n "); 1155 \u0275\u0275elementStart(10, "div", 8); 1156 \u0275\u0275text(11); 1157 \u0275\u0275elementEnd(); 1158 \u0275\u0275text(12, "\n "); 1159 \u0275\u0275elementEnd(); 1160 \u0275\u0275text(13, "\n "); 1161 \u0275\u0275elementStart(14, "form"); 1162 \u0275\u0275text(15, "\n "); 1163 \u0275\u0275elementStart(16, "div", 9); 1164 \u0275\u0275text(17, "\n "); 1165 \u0275\u0275elementStart(18, "div", 9); 1166 \u0275\u0275text(19, "\n "); 1167 \u0275\u0275elementStart(20, "input", 10); 1168 \u0275\u0275twoWayListener("ngModelChange", function ChatMainComponent_div_7_Template_input_ngModelChange_20_listener($event) { 1169 \u0275\u0275restoreView(_r1); 1170 const ctx_r1 = \u0275\u0275nextContext(); 1171 \u0275\u0275twoWayBindingSet(ctx_r1.chatConfig.message, $event) || (ctx_r1.chatConfig.message = $event); 1172 return \u0275\u0275resetView($event); 1173 }); 1174 \u0275\u0275listener("keyup", function ChatMainComponent_div_7_Template_input_keyup_20_listener($event) { 1175 \u0275\u0275restoreView(_r1); 1176 const ctx_r1 = \u0275\u0275nextContext(); 1177 return \u0275\u0275resetView(ctx_r1.onMessageKeyUp($event)); 1178 }); 1179 \u0275\u0275elementEnd(); 1180 \u0275\u0275text(21, "\n "); 1181 \u0275\u0275elementEnd(); 1182 \u0275\u0275text(22, "\n "); 1183 \u0275\u0275elementStart(23, "div", 11); 1184 \u0275\u0275text(24, "\n "); 1185 \u0275\u0275elementStart(25, "button", 12); 1186 \u0275\u0275listener("click", function ChatMainComponent_div_7_Template_button_click_25_listener() { 1187 \u0275\u0275restoreView(_r1); 1188 const ctx_r1 = \u0275\u0275nextContext();
1189 return \u0275\u0275resetView(ctx_r1.onMessageSubmit()); 1190 }); 1191 \u0275\u0275text(26, "Send"); 1192 \u0275\u0275elementEnd(); 1193 \u0275\u0275text(27, "\n "); 1194 \u0275\u0275elementEnd(); 1195 \u0275\u0275text(28, "\n "); 1196 \u0275\u0275elementEnd(); 1197 \u0275\u0275text(29, "\n "); 1198 \u0275\u0275elementEnd(); 1199 \u0275\u0275text(30, "\n "); 1200 \u0275\u0275elementStart(31, "div"); 1201 \u0275\u0275text(32, "\n "); 1202 \u0275\u0275elementStart(33, "div"); 1203 \u0275\u0275text(34, "\n "); 1204 \u0275\u0275elementStart(35, "button", 13); 1205 \u0275\u0275listener("click", function ChatMainComponent_div_7_Template_button_click_35_listener() { 1206 \u0275\u0275restoreView(_r1); 1207 const ctx_r1 = \u0275\u0275nextContext(); 1208 return \u0275\u0275resetView(ctx_r1.onExitChatClick()); 1209 }); 1210 \u0275\u0275text(36, "Exit Chat"); 1211 \u0275\u0275elementEnd(); 1212 \u0275\u0275text(37, "\n "); 1213 \u0275\u0275elementEnd(); 1214 \u0275\u0275text(38, "\n "); 1215 \u0275\u0275elementEnd(); 1216 \u0275\u0275text(39, "\n "); 1217 \u0275\u0275elementEnd(); 1218 } 1219 if (rf & 2) { 1220 const ctx_r1 = \u0275\u0275nextContext(); 1221 \u0275\u0275advance(2); 1222 \u0275\u0275property("ngIf", ctx_r1.currentChatSession.chatContent); 1223 \u0275\u0275advance(2); 1224 \u0275\u0275property("innerHTML", ctx_r1.currentChatSession.chatContent, \u0275\u0275sanitizeHtml); 1225 \u0275\u0275advance(7); 1226 \u0275\u0275textInterpolate1("\n ", ctx_r1.currentChatSession.typingIndicator, "\n "); 1227 \u0275\u0275advance(9); 1228 \u0275\u0275twoWayProperty("ngModel", ctx_r1.chatConfig.message); 1229 \u0275\u0275property("disabled", ctx_r1.currentChatSession.isDisconnectEventReceived); 1230 \u0275\u0275advance(5); 1231 \u0275\u0275property("disabled", ctx_r1.currentChatSession.isDisconnectEventReceived || !ctx_r1.chatConfig.message); 1232 } 1233} 1234function ChatMainComponent_div_9_Template(rf, ctx) { 1235 if (rf & 1) { 1236 \u0275\u0275elementStart(0, "div", 22); 1237 \u0275\u0275text(1, "\n Oops! Something went wrong on our end.\n "); 1238 \u0275\u0275element(2, "br"); 1239 \u0275\u0275text(3, "\n "); 1240 \u0275\u0275element(4, "br"); 1241 \u0275\u0275text(5, " If the problem continues, please contact our customer service department at 800.727.6331.\n "); 1242 \u0275\u0275element(6, "br"); 1243 \u0275\u0275text(7, "\n "); 1244 \u0275\u0275element(8, "br");
1245 \u0275\u0275text(9, " Thank you!\n "); 1246 \u0275\u0275elementEnd(); 1247 } 1248} 1249var ChatMainComponent = class _ChatMainComponent { 1250 /***************Properties***************/ 1251 /***************Events***************/ 1252 unloadHandler(event) { 1253 this.chatService.exitSync(this.currentChatSession.userParticipantID); 1254 } 1255 /***************Events***************/ 1256 /***************Constructor***************/ 1257 constructor(cache, messages, chatService, route, dialog) { 1258 this.cache = cache; 1259 this.messages = messages; 1260 this.chatService = chatService; 1261 this.route = route; 1262 this.dialog = dialog; 1263 this.websiteName = this.cache.get(CacheConstant.Env_Properties).theme; 1264 this.currentChatSession = new ChatSession(); 1265 this.chatConfig = { 1266 message: "", 1267 todayDate: (/* @__PURE__ */ new Date()).toDateString(), 1268 initiated: true 1269 }; 1270 this.startChatFailCounter = 0; 1271 } 1272 ngOnInit() { 1273 this.preventRefresh(); 1274 this.preventRightClick(); 1275 this.route.params.subscribe((params) => { 1276 this.initChat(params); 1277 }); 1278 } 1279 ngAfterViewChecked() { 1280 } 1281 /***************Constructor***************/ 1282 /******************Component Methods******************/ 1283 onMessageKeyUp(event) { 1284 if (event.keyCode === 13) { 1285 this.onMessageSubmit(); 1286 this.chatService.setTypingState(false, this.currentChatSession.userParticipantID); 1287 } else { 1288 this.chatService.setTypingState(true, this.currentChatSession.userParticipantID); 1289 } 1290 } 1291 onMessageSubmit() { 1292 if (this.currentChatSession) { 1293 const sendChatRequest = { 1294 message: this.chatConfig.message, 1295 contentType: "text/plain" 1296 }; 1297 const ajaxResponse = this.chatService.sendMessage(this.currentChatSession.userParticipantID, sendChatRequest); 1298 let sendChatMessageResponse; 1299 sendChatMessageResponse = JSON.parse(ajaxResponse.responseText).chat; 1300 if (sendChatMessageResponse) { 1301 if (sendChatMessageResponse && sendChatMessageResponse.status.type.toLowerCase() === "success") { 1302 this.chatConfig.message = ""; 1303 } 1304 this.pollChat(); 1305 } else { 1306 console.log(ajaxResponse); 1307 } 1308 } 1309 } 1310 onExitChatClick() { 1311 const dialogRef = this.dialog.open(ExitChatDialogComponent, {}); 1312 dialogRef.afterClosed().subscribe((result) => { 1313 if (result === true) { 1314 if (this.currentChatSession && this.currentChatSession.userParticipantID) { 1315 this.exitChatSession(); 1316 } 1317 } 1318 }); 1319 return false; 1320 } 1321 /******************Private Methods******************/ 1322 initChat(params) { 1323 if (params["chatID"] !== void 0) { 1324 this.currentChatSession.chatContent = ""; 1325 this.currentChatSession.chatID = params["chatID"]; 1326 this.currentChatSession.lastRepChatMessage = params["message"]; 1327 this.currentChatSession.repDisplayName = params["repname"]; 1328 this.currentChatSession.repParticipantName = params["repname"]; 1329 this.reconnectChat(); 1330 } else { 1331 this.startChat(); 1332 } 1333 } 1334 startChat() { 1335 this.chatService.start().subscribe((response) => { 1336 let startChatResponse; 1337 startChatResponse = response.chat; 1338 if (startChatResponse && startChatResponse.status.type.toLowerCase() === "success") { 1339 this.startChatFailCounter = 0; 1340 this.currentChatSession.chatID = startChatResponse.chatID; 1341 this.currentChatSession.userParticipantID = startChatResponse.participantID; 1342 this.currentChatSession.chatContent = ""; 1343 this.setRepImage(); 1344 this.pollingInterval = setInterval(() => { 1345 this.pollChat(); 1346 }, 2e3); 1347 } else if (this.startChatFailCounter < 3) { 1348 this.startChatFailCounter++; 1349 setTimeout(() => { 1350 this.startChat(); 1351 }, 2e3); 1352 } else { 1353 this.chatConfig.initiated = false; 1354 } 1355 }); 1356 } 1357 pollChat() { 1358 if (this.currentChatSession && this.currentChatSession.userParticipantID) { 1359 const ajaxResponse = this.chatService.poll(this.currentChatSession.userParticipantID); 1360 let pollChatResponse; 1361 pollChatResponse = JSON.parse(ajaxResponse.responseText).chat; 1362 if (pollChatResponse && pollChatResponse.events) { 1363 const msg = this.currentChatSession.chatContent; 1364 this.handleEvents(pollChatResponse.events); 1365 if (this.currentChatSession.isDisconnectEventReceived) { 1366 clearInterval(this.pollingInterval); 1367 } 1368 } else { 1369 console.log(ajaxResponse); 1370 } 1371 } 1372 } 1373 reconnectChat() { 1374 const reconnectChatRequest = { 1375 chatID: this.currentChatSession.chatID 1376 }; 1377 this.chatService.reconnect(reconnectChatRequest).subscribe((response) => { 1378 let reconnectChatResponse; 1379 reconnectChatResponse = response.chat; 1380 if (reconnectChatResponse && reconnectChatResponse.status.type === "success") { 1381 this.currentChatSession.chatContent += this.messages.RepChatMessageTemplate.replace("<<displayName>>", this.currentChatSession.repDisplayName).replace("<<chatTime>>", this.chatService.getChatTime()).replace("<<message>>", this.currentChatSession.lastRepChatMessage); 1382 this.currentChatSession.userParticipantID = reconnectChatResponse.participantID; 1383 if (reconnectChatResponse.events) {
1384 reconnectChatResponse.events.forEach((e) => { 1385 if (e.participantType === "System") { 1386 this.currentChatSession.repParticipantID = e.participantID; 1387 this.currentChatSession.repDisplayName = e.participantName; 1388 this.currentChatSession.repParticipantName = e.participantName; 1389 this.setRepImage(); 1390 } 1391 }); 1392 } 1393 this.pollingInterval = setInterval(() => { 1394 this.pollChat(); 1395 }, 2e3); 1396 } else if (this.startChatFailCounter < 3) { 1397 this.startChatFailCounter++; 1398 setTimeout(() => { 1399 this.reconnectChat(); 1400 }, 2e3); 1401 } else { 1402 this.chatConfig.initiated = false; 1403 } 1404 }); 1405 } 1406 setRepImage() { 1407 if (this.currentChatSession.repParticipantID !== void 0) { 1408 if (this.currentChatSession.repImageURL === void 0 || this.currentChatSession.repImageURL === "") { 1409 this.chatService.getPartyInfo(this.currentChatSession.userParticipantID, this.currentChatSession.repParticipantID).subscribe((res) => { 1410 let partyInfoResponse; 1411 partyInfoResponse = res.partyInfo; 1412 this.currentChatSession.repImageURL = this.cache.get(CacheConstant.Env_Properties).chatApiUrl + "/" + partyInfoResponse.photo; 1413 }); 1414 } 1415 } 1416 } 1417 preventRefresh() { 1418 document.onkeydown = function(event) { 1419 if (event.key === "F5" || event.key === "r" && event.ctrlKey) { 1420 event.preventDefault(); 1421 } 1422 }; 1423 window.addEventListener("unload", (event) => window.close()); 1424 window.addEventListener("beforeunload", (event) => window.close()); 1425 } 1426 preventRightClick() { 1427 document.addEventListener("contextmenu", (event) => event.preventDefault()); 1428 } 1429 exitChatSession() { 1430 if (this.chatConfig.initiated && this.currentChatSession.userParticipantID) { 1431 this.chatService.exit(this.currentChatSession.userParticipantID).subscribe((response) => { 1432 let pollChatResponse; 1433 pollChatResponse = response.chat; 1434 if (pollChatResponse.status.type === "success") { 1435 this.currentChatSession = null; 1436 window.close(); 1437 AppUtilService.router.navigate([RoutePrefix.Chat]); 1438 } 1439 }); 1440 } 1441 } 1442 showRecentMessages() { 1443 try { 1444 $("#chatContent").animate({ scrollTop: $("#chatContent")[0].scrollHeight }, 1e3); 1445 } catch (err) { 1446 } 1447 } 1448 handleEvents(events) { 1449 events.forEach((e) => { 1450 if (e.participantID !== this.currentChatSession.userParticipantID && e.participantType === "Agent") { 1451 this.currentChatSession.repParticipantID = e.participantID; 1452 this.setRepImage(); 1453 if (e.participantName !== void 0) { 1454 this.currentChatSession.repParticipantName = e.participantName; 1455 } else if (e.displayName !== void 0) { 1456 this.currentChatSession.repDisplayName = e.displayName; 1457 } 1458 } 1459 if (e.type === "text") { 1460 this.handleTextEvent(e); 1461 } else if (e.type === "participantStateChanged") { 1462 this.handleStateChangedEvent(e); 1463 } else if (e.type === "typingIndicator") { 1464 this.handleTypingIndicatorEvent(e); 1465 } 1466 }); 1467 } 1468 handleTextEvent(e) { 1469 if (e.participantID === this.currentChatSession.userParticipantID) { 1470 this.currentChatSession.chatContent += this.messages.UserChatMessageTemplate.replace("<<displayName>>", e.displayName).replace("<<chatTime>>", (/* @__PURE__ */ new Date()).toLocaleTimeString()).replace("<<message>>", e.value); 1471 } else { 1472 if (e.value.indexOf("transferred") > -1) { 1473 this.currentChatSession.isTransferEventReceived = true; 1474 this.currentChatSession.isDisconnectEventReceived = false; 1475 } 1476 this.currentChatSession.chatContent += this.messages.RepChatMessageTemplate.replace("<<displayName>>", e.displayName).replace("<<chatTime>>", (/* @__PURE__ */ new Date()).toLocaleTimeString()).replace("<<message>>", e.value); 1477 this.currentChatSession.lastRepChatMessage = e.value; 1478 } 1479 this.showRecentMessages(); 1480 } 1481 handleTypingIndicatorEvent(e) { 1482 if (e.participantID === this.currentChatSession.repParticipantID) { 1483 if (e.value.toString().toLowerCase() === "true") { 1484 this.currentChatSession.typingIndicator = this.currentChatSession.repDisplayName + " is typing..."; 1485 }
1485 else if (e.value.toString().toLowerCase() === "false") { 1486 this.currentChatSession.typingIndicator = ""; 1487 } 1488 } 1489 } 1490 handleStateChangedEvent(e) { 1491 if (e.state.toLowerCase() === "active") { 1492 switch (e.participantType.toLowerCase()) { 1493 case "agent": 1494 this.currentChatSession.repParticipantID = e.participantID; 1495 this.currentChatSession.repParticipantName = e.participantName; 1496 this.currentChatSession.repDisplayName = e.participantName; 1497 break; 1498 case "webuser": 1499 this.currentChatSession.userDisplayName = e.participantName; 1500 break; 1501 default: 1502 break; 1503 } 1504 if (this.currentChatSession.repDisplayName === e.participantName) { 1505 this.currentChatSession.repParticipantID = e.participantID; 1506 } 1507 } else if (e.state.toLowerCase() === "disconnected") { 1508 this.currentChatSession.isDisconnectEventReceived = true; 1509 } 1510 } 1511 static { 1512 this.\u0275fac = function ChatMainComponent_Factory(__ngFactoryType__) { 1513 return new (__ngFactoryType__ || _ChatMainComponent)(\u0275\u0275directiveInject(AppCacheService), \u0275\u0275directiveInject(ChatMessages), \u0275\u0275directiveInject(ChatService), \u0275\u0275directiveInject(ActivatedRoute), \u0275\u0275directiveInject(MatDialog)); 1514 }; 1515 } 1516 static { 1517 this.\u0275cmp = /* @__PURE__ */ \u0275\u0275defineComponent({ type: _ChatMainComponent, selectors: [["par-chat-main"]], viewQuery: function ChatMainComponent_Query(rf, ctx) { 1518 if (rf & 1) { 1519 \u0275\u0275viewQuery(_c0, 5); 1520 } 1521 if (rf & 2) { 1522 let _t; 1523 \u0275\u0275queryRefresh(_t = \u0275\u0275loadQuery()) && (ctx.chatContentElement = _t.first); 1524 } 1525 }, hostBindings: function ChatMainComponent_HostBindings(rf, ctx) { 1526 if (rf & 1) { 1527 \u0275\u0275listener("unload", function ChatMainComponent_unload_HostBindingHandler($event) { 1528 return ctx.unloadHandler($event); 1529 }, \u0275\u0275resolveWindow); 1530 } 1531 }, standalone: false, decls: 11, vars: 4, consts: [["chatContentElement", ""], [1, "chatMain"], [1, "chat-header-logo"], ["alt", "", "title", "", 3, "src"], [4, "ngIf"], ["class", "chat-initiate-fail", 4, "ngIf"], ["id", "chat", "id", "chatContent", 1, "chatContent", 3, "innerHTML"], [1, "typing-indicator-container"], ["id", "typing-indicator", 1, "chatTypingIndicator"], [1, "msg-container"], ["id", "message", "title", "type message", "name", "message", "autofocus", "true", 1, "chatInputText", 3, "ngModelChange", "keyup", "ngModel", "disabled"], [1, "btn-send-container"], ["id", "btn-send", "mat-raised-button", "", "color", "accent", "type", "button", "value", "Send", 1, "chatButtons", 3, "click", "disabled"], ["id", "btn-exit", "mat-raised-button", "", "color", "accent", "value", "Exit Chat", 1, "chatButtons", 3, "click"], [1, "chatParticipant"], ["id", "user-display-name"], ["width", "100%", 1, "chatParticipant"], ["width", "60px"], ["alt", "", "width", "40px", "height", "40px", 3, "src"], [1, "vertical-middle"], ["id", "rep-display-name"], ["id", "date", 1, "color-grey"], [1, "chat-initiate-fail"]], template: function ChatMainComponent_Template(rf, ctx) { 1532 if (rf & 1) { 1533 \u0275\u0275elementStart(0, "div", 1); 1534 \u0275\u0275text(1, "\n "); 1535 \u0275\u0275elementStart(2, "div", 2); 1536 \u0275\u0275text(3, "\n "); 1537 \u0275\u0275element(4, "img", 3); 1538 \u0275\u0275text(5, "\n "); 1539 \u0275\u0275elementEnd(); 1540 \u0275\u0275text(6, "\n "); 1541 \u0275\u0275template(7, ChatMainComponent_div_7_Template, 40, 6, "div", 4); 1542 \u0275\u0275text(8, "\n "); 1543 \u0275\u0275template(9, ChatMainComponent_div_9_Template, 10, 0, "div", 5); 1544 \u0275\u0275text(10, "\n"); 1545 \u0275\u0275elementEnd(); 1546 } 1547 if (rf & 2) { 1548 \u0275\u0275advance(4); 1549 \u0275\u0275property("src", \u0275\u0275interpolate1("/assets/images/", ctx.websiteName, "/LogoNew.png"), \u0275\u0275sanitizeUrl); 1550 \u0275\u0275advance(3); 1551 \u0275\u0275property("ngIf", ctx.chatConfig.initiated); 1552 \u0275\u0275advance(2); 1553 \u0275\u0275property("ngIf", !ctx.chatConfig.initiated); 1554 } 1555 }, dependencies: [NgIf, \u0275NgNoValidate, DefaultValueAccessor, NgControlStatus, NgControlStatusGroup, NgModel, NgForm, MatButton], styles: ["\n\n.chatMain[_ngcontent-%COMP%] {\n padding: 10px;\n}\n.chat-header-logo[_ngcontent-%COMP%] {\n margin: 10px 0 20px;\n text-align: center;\n}\n.color-grey[_ngcontent-%COMP%] {\n color: Gray;\n}\n.typing-indicator-container[_ngcontent-%COMP%] {\n height: 10px;\n margin-bottom: 10px;\n}\n.msg-container[_ngcontent-%COMP%] {\n display: table;\n width: 100%;\n}\n.btn-send-container[_ngcontent-%COMP%] {\n display: table-cell;\n padding-left: 5px;\n}\n.chatContent[_ngcontent-%COMP%] {\n border: 1px solid;\n height: 330px;\n margin-bottom: 0px;\n overflow: auto;\n font-size: 0.85em;\n}\n.chatTypingIndicator[_ngcontent-%COMP%] {\n font-size: 0.85em;\n}\n.chatButtons[_ngcontent-%COMP%] {\n height: 36px;\n font-weight: normal;\n font-size: large;\n margin-bottom: 10px;\n}\n.chatInputText[_ngcontent-%COMP%] {\n width: 100%;\n height: 36px;\n font-weight: normal;\n font-size: large;\n margin-bottom: 10px;\n}\n.chatUserMessage[_ngcontent-%COMP%] {\n padding: 5px;\n margin: 10px;\n border-bottom-left-radius: 10px;\n border-top-right-radius: 10px;\n width: 80%;\n border: 1px solid;\n position: relative;\n left: 12%;\n font-weight: normal;\n}\n.chatAgentMessage[_ngcontent-%COMP%] {\n padding: 5px;\n margin: 10px;\n border-bottom-right-radius: 10px;\n border-top-left-radius: 10px;\n width: 80%;\n border: 1px solid;\n position: relative;\n font-weight: normal;\n}\n.chatParticipant[_ngcontent-%COMP%] {\n color: #005180;\n font-weight: bold;\n vertical-align: middle;\n}\n.chat-initiate-fail[_ngcontent-%COMP%] {\n padding-top: 20px;\n color: red;\n}"] }); 1556 } 1557}; 1558(() => { 1559 (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ChatMainComponent, [{ 1560 type: Component, 1561 args: [{ selector: "par-chat-main", standalone: false, template: `<div class="chatMain"> 1562 <div class="chat-header-logo"> 1563 <img src="/assets/images/{{websiteName}}/LogoNew.png" alt="" title="" /> 1564 </div> 1565 <div *ngIf="chatConfig.initiated"> 1566 <div *ngIf="currentChatSession.chatContent"> 1567 <div class="chatParticipant"> 1568 Welcome
1569 <span id="user-display-name">{{currentChatSession.userDisplayName}}</span>> 1570 </div> 1571 <table width="100%" class="chatParticipant"> 1572 <tr> 1573 <td width="60px"> 1574 <img [src]="currentChatSession.repImageURL" alt="" width="40px" height="40px" /> 1575 </td> 1576 <td class="vertical-middle"> 1577 <span id="rep-display-name"> {{currentChatSession.repDisplayName}}</span> 1578 </td> 1579 </tr> 1580 </table> 1581 <div id="date" class="color-grey">{{chatConfig.todayDate}}</div> 1582 </div> 1583 <div id="chat" class="chatContent" [innerHTML]="currentChatSession.chatContent" #chatContentElement id='chatContent'> 1584 </div> 1585 <div class="typing-indicator-container"> 1586 <div id="typing-indicator" class="chatTypingIndicator"> 1587 {{currentChatSession.typingIndicator}} 1588 </div> 1589 </div> 1590 <form> 1591 <div class="msg-container"> 1592 <div class="msg-container"> 1593 <input id="message" title="type message" name="message" class="chatInputText" [(ngModel)]="chatConfig.message" [disabled]="currentChatSession.isDisconnectEventReceived" 1594 (keyup)="onMessageKeyUp($event)" autofocus="true" /> 1595 </div> 1596 <div class="btn-send-container"> 1597 <button id="btn-send" mat-raised-button color="accent" type="button" (click)="onMessageSubmit()" class="chatButtons" value="Send" 1598 [disabled]="currentChatSession.isDisconnectEventReceived || !chatConfig.message">Send</button> 1599 </div> 1600 </div> 1601 </form> 1602 <div> 1603 <div> 1604 <button id="btn-exit" mat-raised-button color="accent" class="chatButtons" (click)="onExitChatClick()" value="Exit Chat">Exit Chat</button> 1605 </div> 1606 </div> 1607 </div> 1608 <div *ngIf="!chatConfig.initiated" class="chat-initiate-fail"> 1609 Oops! Something went wrong on our end. 1610 <br /> 1611 <br /> If the problem continues, please contact our customer service department at 800.727.6331. 1612 <br /> 1613 <br /> Thank you! 1614 </div> 1615</div>`, styles: ["/* src/app/modules/chat/chat-main/chat-main.component.scss */\n.chatMain {\n padding: 10px;\n}\n.chat-header-logo {\n margin: 10px 0 20px;\n text-align: center;\n}\n.color-grey {\n color: Gray;\n}\n.typing-indicator-container {\n height: 10px;\n margin-bottom: 10px;\n}\n.msg-container {\n display: table;\n width: 100%;\n}\n.btn-send-container {\n display: table-cell;\n padding-left: 5px;\n}\n.chatContent {\n border: 1px solid;\n height: 330px;\n margin-bottom: 0px;\n overflow: auto;\n font-size: 0.85em;\n}\n.chatTypingIndicator {\n font-size: 0.85em;\n}\n.chatButtons {\n height: 36px;\n font-weight: normal;\n font-size: large;\n margin-bottom: 10px;\n}\n.chatInputText {\n width: 100%;\n height: 36px;\n font-weight: normal;\n font-size: large;\n margin-bottom: 10px;\n}\n.chatUserMessage {\n padding: 5px;\n margin: 10px;\n border-bottom-left-radius: 10px;\n border-top-right-radius: 10px;\n width: 80%;\n border: 1px solid;\n position: relative;\n left: 12%;\n font-weight: normal;\n}\n.chatAgentMessage {\n padding: 5px;\n margin: 10px;\n border-bottom-right-radius: 10px;\n border-top-left-radius: 10px;\n width: 80%;\n border: 1px solid;\n position: relative;\n font-weight: normal;\n}\n.chatParticipant {\n color: #005180;\n font-weight: bold;\n vertical-align: middle;\n}\n.chat-initiate-fail {\n padding-top: 20px;\n color: red;\n}\n"] }] 1616 }], () => [{ type: AppCacheService }, { type: ChatMessages }, { type: ChatService }, { type: ActivatedRoute }, { type: MatDialog }], { chatContentElement: [{ 1617 type: ViewChild, 1618 args: ["chatContentElement", { static: false }] 1619 }], unloadHandler: [{ 1620 type: HostListener, 1621 args: ["window:unload", ["$event"]] 1622 }] }); 1623})(); 1624(() => { 1625 (typeof ngDevMode === "undefined" || ngDevMode) && \u0275setClassDebugInfo(ChatMainComponent, { className: "ChatMainComponent", filePath: "src/app/modules/chat/chat-main/chat-main.component.ts", lineNumber: 44 }); 1626})(); 1627
1628// src/app/modules/chat/chat-routing.module.ts 1629var routes = [ 1630 { 1631 path: "", 1632 component: ChatLandingComponent 1633 }, 1634 { 1635 path: "parmed/start", 1636 component: ChatMainComponent 1637 } 1638]; 1639var ChatRoutingModule = class _ChatRoutingModule { 1640 static { 1641 this.\u0275fac = function ChatRoutingModule_Factory(__ngFactoryType__) { 1642 return new (__ngFactoryType__ || _ChatRoutingModule)(); 1643 }; 1644 } 1645 static { 1646 this.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({ type: _ChatRoutingModule }); 1647 } 1648 static { 1649 this.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({ imports: [RouterModule.forChild(routes), RouterModule] }); 1650 } 1651}; 1652(() => { 1653 (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ChatRoutingModule, [{ 1654 type: NgModule, 1655 args: [{ 1656 imports: [RouterModule.forChild(routes)], 1657 exports: [RouterModule] 1658 }] 1659 }], null, null); 1660})(); 1661
1662// src/app/modules/chat/chat.module.ts 1663var ChatModule = class _ChatModule { 1664 static { 1665 this.\u0275fac = function ChatModule_Factory(__ngFactoryType__) { 1666 return new (__ngFactoryType__ || _ChatModule)(); 1667 }; 1668 } 1669 static { 1670 this.\u0275mod = /* @__PURE__ */ \u0275\u0275defineNgModule({ type: _ChatModule }); 1671 } 1672 static { 1673 this.\u0275inj = /* @__PURE__ */ \u0275\u0275defineInjector({ imports: [ 1674 CommonModule, 1675 FormsModule, 1676 ReactiveFormsModule, 1677 MaterialModule, 1678 ChatRoutingModule 1679 ] }); 1680 } 1681}; 1682(() => { 1683 (typeof ngDevMode === "undefined" || ngDevMode) && setClassMetadata(ChatModule, [{ 1684 type: NgModule, 1685 args: [{ 1686 imports: [ 1687 CommonModule, 1688 FormsModule, 1689 ReactiveFormsModule, 1690 MaterialModule, 1691 ChatRoutingModule 1692 ], 1693 declarations: [ 1694 ChatLandingComponent, 1695 ChatMainComponent, 1696 ExitChatDialogComponent 1697 ] 1698 }] 1699 }], null, null); 1700})(); 1701export { 1702 ChatModule 1703};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.