@vgroup/dialbox 0.0.6 → 0.0.8

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.
@@ -2,19 +2,19 @@ import { __awaiter } from 'tslib';
2
2
  import * as i0 from '@angular/core';
3
3
  import { Injectable, EventEmitter, Component, Input, Output, ViewChild, Inject, NgModule } from '@angular/core';
4
4
  import { AsYouType } from 'libphonenumber-js';
5
- import { BehaviorSubject, throwError, Subscription, interval } from 'rxjs';
5
+ import { BehaviorSubject, throwError, interval, Subscription } from 'rxjs';
6
6
  import * as i1 from '@angular/common/http';
7
7
  import { HttpHeaders, HttpParams, HttpClientModule } from '@angular/common/http';
8
8
  import { catchError, switchMap, map } from 'rxjs/operators';
9
9
  import * as i4 from '@angular/router';
10
10
  import { RouterLink } from '@angular/router';
11
- import * as i5 from '@angular/common';
11
+ import * as i3 from '@angular/common';
12
12
  import { CommonModule } from '@angular/common';
13
- import * as i6 from '@angular/forms';
13
+ import * as i3$1 from '@angular/forms';
14
14
  import { FormsModule, ReactiveFormsModule } from '@angular/forms';
15
15
  import { Device } from '@twilio/voice-sdk';
16
16
  import swal from 'sweetalert2';
17
- import * as i3 from '@angular/material/dialog';
17
+ import * as i3$2 from '@angular/material/dialog';
18
18
  import { MAT_DIALOG_DATA } from '@angular/material/dialog';
19
19
 
20
20
  const keypad = [
@@ -1418,1598 +1418,1600 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
1418
1418
  }]
1419
1419
  }], ctorParameters: function () { return [{ type: i1.HttpClient }, { type: IpAddressService }]; } });
1420
1420
 
1421
- class DialboxComponent {
1422
- constructor(twilioService, extService,
1423
- // private dialog: MatDialog,
1424
- ipService, extensionService, router) {
1425
- this.twilioService = twilioService;
1426
- this.extService = extService;
1427
- this.ipService = ipService;
1421
+ const GlobalConstant = {
1422
+ ErrorMsg500: "Unable to process request. Please try again later.",
1423
+ isSMSVisible: true,
1424
+ dedicatedNumText: 'C2C Number'
1425
+ };
1426
+
1427
+ class IncomingCallComponent {
1428
+ constructor(extensionService, twilioService) {
1428
1429
  this.extensionService = extensionService;
1429
- this.router = router;
1430
- this.isDialpadHidden = false;
1431
- this.closeDialpadEvent = new EventEmitter();
1432
- this.callInitiated = new EventEmitter();
1433
- this.endCallEvent = new EventEmitter();
1434
- this.minimiseEvent = new EventEmitter();
1435
- this.incomingCallsNewInfoEvent = new EventEmitter();
1436
- this.incomingCallInitiated = new EventEmitter();
1437
- this.numberDialed = new EventEmitter();
1438
- this.isCallInProgress = false;
1439
- this.keypadVal = keypad;
1440
- this.showInputClearBtn = false;
1441
- this.dialedNumber = '';
1442
- this.contactList = [];
1443
- this.filteredContactList = [];
1444
- this.callerIdList = [];
1445
- this.isCallerIdHidden = true;
1446
- this.isTrialPeriodOver = false;
1447
- this.isPaymentDue = false;
1448
- this.terminateCall = false;
1449
- this.toastTimeout = 7000;
1450
- this.callNumberToast = {
1451
- show: false,
1452
- type: 'alert-success',
1453
- number: '',
1454
- displayNum: ''
1455
- };
1456
- this.callData = {
1457
- phone: '',
1458
- displayNum: '',
1459
- dial: false,
1460
- name: '',
1461
- img: 'assets/images/user.jpg',
1462
- isIncomingCall: false,
1463
- extNum: ''
1464
- };
1465
- this.lastDialed = null;
1466
- this.dialAlert = {
1467
- msg: '',
1468
- show: false
1469
- };
1470
- this.showDedicatedPopup = false;
1471
- this.newIncomingCalls = [];
1472
- this.incomingCallsList = [];
1473
- this.subscriptions = new Subscription();
1474
- this.shakeDedicatedBtn = false;
1475
- this.isSmartDialCall = false;
1476
- this.isMinimised = false;
1430
+ this.twilioService = twilioService;
1431
+ this.showRingAnimation = true;
1432
+ this.selectedIncomingCall = {};
1433
+ this.twilioAuthId = '';
1434
+ this.dedicatedNum = '';
1435
+ this.recordCall = false;
1436
+ this.shouldRecordCall = false;
1437
+ this.isClickExpand = false;
1438
+ this.disbaleEndCallBtn = true;
1439
+ this.closeIncomingCallDiv = new EventEmitter();
1440
+ this.incomingCallsNewList = new EventEmitter();
1441
+ this.selectedIncomingCallInfo = new EventEmitter();
1442
+ this.isMute = false;
1477
1443
  }
1478
1444
  ngOnInit() {
1479
1445
  try {
1480
- this.token = localStorage.getItem('ext_token');
1481
- //this.isCallInProgress = true;
1482
- this.getContactList();
1483
- // this.getUserCallSetting();
1484
- const sub1 = this.twilioService.dialNumberFromOtherModule.subscribe((contact) => {
1485
- if (contact.number) {
1486
- this.isSmartDialCall = false;
1487
- if (contact.isDialFromHistory) {
1488
- //handle dialing from history page
1489
- if (contact.callerId == 'smartDialing') {
1490
- this.selectedCallerId = { number: contact.from };
1491
- this.isSmartDialCall = true;
1492
- setTimeout(() => {
1493
- this.isDialpadHidden = false;
1494
- }, 2000);
1495
- this.callData.phone = contact.number;
1496
- this.callData.name = contact.name;
1497
- this.callData.img = contact.img;
1498
- this.callData.from = contact.from;
1499
- this.sanitizedNum = contact.number;
1500
- // this.getUserInformation(contact);
1501
- // this.incomingCallsList.push(contact)
1502
- this.initiateCall();
1503
- }
1504
- else {
1505
- // this.getUserCallSetting();
1506
- setTimeout(() => {
1507
- this.isDialpadHidden = false;
1508
- }, 1000);
1509
- // this.getUserInformation(contact);
1510
- // this.incomingCallsList.push(contact)
1511
- this.dialedNumber = contact.number;
1512
- this.sanitizedNum = contact.number;
1513
- }
1514
- }
1515
- else {
1516
- if (contact.callerId == 'alwaysAsk' || contact.callerId == 'smartDialing') {
1517
- // this.getUserCallSetting();
1518
- setTimeout(() => {
1519
- this.isDialpadHidden = false;
1520
- }, 1000);
1521
- this.dialedNumber = contact.number;
1522
- this.sanitizedNum = contact.number;
1523
- }
1524
- else {
1525
- setTimeout(() => {
1526
- this.isDialpadHidden = false;
1527
- }, 2000);
1528
- this.callData.phone = contact.number;
1529
- this.callData.name = contact.name;
1530
- this.callData.img = contact.img;
1531
- this.sanitizedNum = contact.number;
1532
- this.initiateCall();
1533
- }
1534
- }
1535
- }
1536
- });
1537
- // handle incoming call
1538
- const sub2 = this.twilioService.currentCall.subscribe(incomingCallData => {
1539
- // if (incomingCallData) {
1540
- // this.isCallInProgress = true;
1541
- // this.isDialpadHidden = false;
1542
- // this.callData.phone = incomingCallData.parameters.From;
1543
- // this.callData.name = incomingCallData.customParameters.get('name');
1544
- // this.callData.img = incomingCallData.customParameters.get('image');
1545
- // this.callData.isIncomingCall = true;
1546
- // }
1547
- if (incomingCallData) {
1548
- if (this.isCallInProgress) {
1549
- this.newIncomingCalls.push(incomingCallData);
1550
- // this.getUserInformation(incomingCallData);
1551
- }
1552
- else {
1553
- this.isCallInProgress = true;
1554
- this.isDialpadHidden = false;
1555
- this.callData.phone = incomingCallData.parameters['From'];
1556
- // this.getUserInformation(incomingCallData);
1557
- this.callData.name = incomingCallData.customParameters.get('name');
1558
- this.callData.img = incomingCallData.customParameters.get('image') || 'assets/images/user.jpg';
1559
- this.callData.isIncomingCall = true;
1446
+ this.twilioService.currentCall.subscribe(call => {
1447
+ if (call) {
1448
+ this.twilioCallData = call;
1449
+ this.twilioAuthId = call.customParameters.get('twilioAuthId') || '';
1450
+ if (!call.parameters) {
1451
+ call.parameters = {};
1560
1452
  }
1561
- incomingCallData.on('cancel', () => {
1562
- // this.incomingCallsList = this.incomingCallsList.filter((item:any) => item.parameters.CallSid !== incomingCallData.parameters.CallSid);
1563
- if (this.incomingCallsList.length == 0) {
1564
- this.isCallInProgress = false;
1453
+ this.sendIPforIncomingCall(this.twilioAuthId, '');
1454
+ call.on('cancel', () => {
1455
+ if (this.incomingCallData && this.incomingCallData.parameters && this.incomingCallData.parameters.CallSid) {
1456
+ this.newIncomingCallsList = this.newIncomingCallsList.filter((item) => item.parameters && item.parameters.CallSid !== this.incomingCallData.parameters.CallSid);
1565
1457
  }
1458
+ this.rejectCallFromList(call);
1566
1459
  });
1567
- incomingCallData.on('disconnect', () => {
1568
- // this.incomingCallsList = this.incomingCallsList.filter((item:any) => item.parameters.CallSid !== incomingCallData.parameters.CallSid);
1569
- if (this.incomingCallsList.length == 0) {
1570
- this.isCallInProgress = false;
1460
+ call.on('disconnect', () => {
1461
+ if (this.incomingCallData && this.incomingCallData.parameters && this.incomingCallData.parameters.CallSid) {
1462
+ this.newIncomingCallsList = this.newIncomingCallsList.filter((item) => item.parameters && item.parameters.CallSid !== this.incomingCallData.parameters.CallSid);
1571
1463
  }
1464
+ this.rejectCallFromList(call);
1572
1465
  });
1573
1466
  }
1574
1467
  });
1575
- this.subscriptions.add(sub1);
1576
- this.subscriptions.add(sub2);
1577
1468
  }
1578
1469
  catch (e) {
1579
1470
  console.log(e);
1580
1471
  }
1581
1472
  }
1582
- // getUserInformation(incomingCallData: any) {
1583
- // let data = this.fromEntries(Array.from(incomingCallData.customParameters.entries()));
1584
- // this.extensionService.getUserInformation(data.twilioAuthId).subscribe(
1585
- // response => {
1586
- // incomingCallData['userInfo']=response
1587
- // this.incomingCallsList.push(incomingCallData);
1588
- // }, error => {
1589
- // console.error('Error starting recording', error);
1590
- // });
1591
- // }
1592
- fromEntries(entries) {
1593
- return entries.reduce((acc, [key, value]) => {
1594
- acc[key] = value;
1595
- return acc;
1596
- }, {});
1597
- }
1598
- ngAfterViewInit() {
1599
- this.registerDragElement();
1473
+ acceptCallFromList(data) {
1474
+ console.log(data, 'checking dii');
1475
+ data.accept();
1476
+ // data.parameters['isCallConnected'] = true;
1477
+ data.isCallConnected = true;
1478
+ this.sendIPforIncomingCall(data.customParameters.get('twilioAuthId'), 'answered').then(() => {
1479
+ if (this.shouldRecordCall) { // default recording
1480
+ this.extensionService.setCallSid(this.CallSid, this.recordCall);
1481
+ this.closeIncomingCallWrapper(1);
1482
+ }
1483
+ else { // manual recording
1484
+ this.extensionService.setCallSid(this.CallSid, this.recordCall);
1485
+ this.closeIncomingCallWrapper(1);
1486
+ }
1487
+ });
1600
1488
  }
1601
- ngOnChanges(changes) {
1602
- if (changes['isDialpadHidden'] && !this.isDialpadHidden) {
1603
- this.getContactList();
1604
- // this.getUserCallSetting();
1605
- setTimeout(() => {
1606
- this.dialInputElement.nativeElement.focus();
1607
- }, 0);
1489
+ rejectCallFromList(data) {
1490
+ if (!data)
1491
+ return;
1492
+ if (data.reject)
1493
+ data.reject();
1494
+ if (data.disconnect)
1495
+ data.disconnect();
1496
+ if (data.parameters) {
1497
+ data.parameters['isCallConnected'] = false; // Should be false when rejecting
1498
+ }
1499
+ if (data.customParameters) {
1500
+ this.sendIPforIncomingCall(data.customParameters.get('twilioAuthId'), 'answered');
1501
+ }
1502
+ if (this.newIncomingCallsList && data && data.parameters && data.parameters.CallSid) {
1503
+ this.newIncomingCallsList = this.newIncomingCallsList.filter((item) => item.parameters && item.parameters.CallSid !== data.parameters.CallSid);
1504
+ this.incomingCallsNewList.emit(this.newIncomingCallsList);
1505
+ if (this.newIncomingCallsList.length == 0) {
1506
+ this.closeIncomingCallDiv.emit({ show: 0, call: data });
1507
+ }
1608
1508
  }
1609
1509
  }
1610
- registerDragElement() {
1611
- try {
1612
- const elmnt = document.getElementById('dragparent1');
1613
- let pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
1614
- const dragMouseDown = (e) => {
1615
- // If the target is an input, return and don't initiate dragging
1616
- if (e.target.tagName.toLowerCase() === 'input') {
1617
- return;
1618
- }
1619
- e = e || window.event;
1620
- // get the mouse cursor position at startup:
1621
- pos3 = e.clientX;
1622
- pos4 = e.clientY;
1623
- document.onmouseup = closeDragElement;
1624
- // call a function whenever the cursor moves:
1625
- document.onmousemove = elementDrag;
1626
- };
1627
- const elementDrag = (e) => {
1628
- e = e || window.event;
1629
- // calculate the new cursor position:
1630
- pos1 = pos3 - e.clientX;
1631
- pos2 = pos4 - e.clientY;
1632
- pos3 = e.clientX;
1633
- pos4 = e.clientY;
1634
- // set the element's new position:
1635
- // elmnt.style.top = elmnt.offsetTop - pos2 + 'px';
1636
- // elmnt.style.left = elmnt.offsetLeft - pos1 + 'px';
1637
- };
1638
- const closeDragElement = () => {
1639
- /* stop moving when mouse button is released:*/
1640
- document.onmouseup = null;
1641
- document.onmousemove = null;
1642
- };
1643
- // if (document.getElementById(elmnt.id + 'header')) {
1644
- // /* if present, the header is where you move the DIV from:*/
1645
- // document.getElementById(elmnt.id + 'header').onmousedown = dragMouseDown;
1646
- // } else {
1647
- // /* otherwise, move the DIV from anywhere inside the DIV:*/
1648
- // elmnt.onmousedown = dragMouseDown;
1649
- // }
1650
- }
1651
- catch (e) {
1652
- console.log(e);
1653
- }
1510
+ closeIncomingCallWrapper(val) {
1511
+ this.closeIncomingCallDiv.emit({ show: val, call: this.twilioCallData });
1654
1512
  }
1655
- addNumber(num) {
1656
- if (num == '#' || num == '*' || num == '+' || Number.isInteger(num)) {
1657
- if (num == '#') {
1658
- new Audio(`/assets/dial-tones/dtmf/dtmf-hash-.mp3`).play();
1659
- }
1660
- else if (num == '*') {
1661
- new Audio(`/assets/dial-tones/dtmf/dtmf-star-.mp3`).play();
1662
- }
1663
- else {
1664
- new Audio(`/assets/dial-tones/dtmf/dtmf-${num}-.mp3`).play();
1665
- }
1666
- this.dialedNumber += num;
1667
- this.showInputClearBtn = true;
1668
- this.numberDialed.emit(this.dialedNumber);
1669
- this.onDialInputChange(this.dialedNumber);
1670
- // this.dialInputRef.nativeElement.focus();
1671
- }
1672
- else if (num === 'voicemail') {
1673
- // this.showDedicatedPopup = true;
1674
- this.router.navigate(['extension/voicemail/' + this.token]);
1675
- }
1513
+ toggleMute(data) {
1514
+ this.isMute = !this.isMute;
1515
+ data.mute(this.isMute);
1676
1516
  }
1677
- hideDialpad() {
1678
- this.isDialpadHidden = true;
1679
- this.closeDialpadEvent.emit();
1680
- this.clearAllDialed();
1681
- this.filteredContactList = [];
1517
+ sendIPforIncomingCall(recordId, callstatus) {
1518
+ return new Promise((resolve, reject) => {
1519
+ this.extensionService.getIPDetailsForCall(recordId, callstatus).subscribe((res) => {
1520
+ const resp = res;
1521
+ if (res.status == 200) {
1522
+ if (resp.callAuth) {
1523
+ this.CallSid = resp.callAuth.callSid;
1524
+ this.recordCall = resp.callAuth.recordCall;
1525
+ // Handle the recordCall flag
1526
+ if (resp.callAuth.recordCall) {
1527
+ this.shouldRecordCall = true;
1528
+ }
1529
+ else {
1530
+ this.shouldRecordCall = false;
1531
+ }
1532
+ }
1533
+ else {
1534
+ // swal("Error", "Missing call authentication details.", "error");
1535
+ }
1536
+ resolve();
1537
+ }
1538
+ else {
1539
+ swal("Error", resp.message.join("<br/>"), "error");
1540
+ resolve();
1541
+ }
1542
+ }, (error) => {
1543
+ swal("Error", GlobalConstant.ErrorMsg500, "error");
1544
+ resolve();
1545
+ });
1546
+ });
1682
1547
  }
1683
- onDialInputChange(inputVal) {
1684
- try {
1685
- // Updated regex to include x, X, ext., Ext., and ,
1686
- const isNumericInput = /^[\d\s+\-]+$/.test(inputVal);
1687
- let mainNumber = inputVal;
1688
- // Check for extension indicators and split the input
1689
- const extMatch = inputVal.match(/(x|X|ext\.|Ext\.|,)(.*)/);
1690
- if (extMatch) {
1691
- mainNumber = inputVal.substring(0, extMatch.index).trim();
1692
- this.callData.extNum = extMatch[2].trim();
1693
- }
1694
- this.sanitizedNum = isNumericInput ? mainNumber.replace(/[\s\-]+/g, '') : mainNumber;
1695
- this.callData.phone = isNumericInput ? this.sanitizedNum : '';
1696
- this.showInputClearBtn = inputVal.length > 0;
1697
- if (isNumericInput) {
1698
- this.dialedNumber = new AsYouType().input(this.sanitizedNum);
1699
- }
1700
- // emit current number whenever input changes
1701
- this.numberDialed.emit(this.dialedNumber);
1702
- if (inputVal.length > 2) {
1703
- this.filteredContactList = this.contactList.filter(contact => {
1704
- const fullName = `${contact.firstName} ${contact.middleName} ${contact.lastName}`.toLowerCase();
1705
- // return fullName.includes(this.sanitizedNum.toLowerCase()) || contact.numbersList.some(num => num.number.includes(this.sanitizedNum));
1706
- }).slice(0, 2);
1548
+ onUserInfoByCallSid() {
1549
+ if (this.selectedIncomingCall && this.selectedIncomingCall.userInfo) {
1550
+ }
1551
+ return this.selectedIncomingCall ? Object.keys(this.selectedIncomingCall).length ? true : false : false;
1552
+ }
1553
+ onClickExpand(data) {
1554
+ if (this.selectedIncomingCall === data && this.isClickExpand) {
1555
+ this.isClickExpand = false;
1556
+ this.selectedIncomingCall = null;
1557
+ this.selectedIncomingCallInfo.emit({});
1558
+ return;
1559
+ }
1560
+ this.isClickExpand = true;
1561
+ this.selectedIncomingCall = data;
1562
+ if (this.selectedIncomingCall) {
1563
+ this.selectedIncomingCall['isClickExpand'] = true;
1564
+ if (this.newIncomingCallsList && this.newIncomingCallsList.length > 0) {
1565
+ this.newIncomingCallsList.forEach((call) => {
1566
+ if (call !== this.selectedIncomingCall) {
1567
+ call['isClickExpand'] = false;
1568
+ }
1569
+ });
1707
1570
  }
1708
- else {
1709
- this.filteredContactList = [];
1571
+ this.selectedIncomingCallInfo.emit(this.selectedIncomingCall);
1572
+ if (!this.selectedIncomingCall.userInfo || this.selectedIncomingCall.userInfo.status == 201) {
1573
+ this.getUserInformation(this.selectedIncomingCall);
1710
1574
  }
1711
1575
  }
1712
- catch (e) {
1713
- console.log(e);
1714
- }
1715
1576
  }
1716
- getFirstLetter(name) {
1717
- return name ? name.charAt(0).toUpperCase() : '';
1577
+ getUserInformation(incomingCallData) {
1578
+ let data = this.fromEntries(Array.from(incomingCallData.customParameters.entries()));
1579
+ this.extensionService.getUserInformation(data['twilioAuthId']).subscribe(response => {
1580
+ setTimeout(() => {
1581
+ incomingCallData['userInfo'] = response;
1582
+ }, 5000);
1583
+ }, error => {
1584
+ console.error('Error starting recording', error);
1585
+ });
1718
1586
  }
1719
- clearInput() {
1720
- if (this.dialedNumber.length > 0) {
1721
- this.dialedNumber = this.dialedNumber.slice(0, -1);
1722
- this.showInputClearBtn = this.dialedNumber.length !== 0;
1723
- this.onDialInputChange(this.dialedNumber);
1724
- }
1587
+ fromEntries(entries) {
1588
+ return entries.reduce((acc, [key, value]) => {
1589
+ acc[key] = value;
1590
+ return acc;
1591
+ }, {});
1725
1592
  }
1726
- clearAllDialed() {
1727
- this.dialedNumber = '';
1728
- this.sanitizedNum = '';
1729
- this.showInputClearBtn = false;
1593
+ }
1594
+ IncomingCallComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IncomingCallComponent, deps: [{ token: ExtensionService }, { token: TwilioService }], target: i0.ɵɵFactoryTarget.Component });
1595
+ IncomingCallComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: IncomingCallComponent, selector: "lib-incoming-call", inputs: { incomingCallData: "incomingCallData", newIncomingCallsList: "newIncomingCallsList" }, outputs: { closeIncomingCallDiv: "closeIncomingCallDiv", incomingCallsNewList: "incomingCallsNewList", selectedIncomingCallInfo: "selectedIncomingCallInfo" }, ngImport: i0, template: "<div class=\"call-container\" style=\"width: 100%;\" *ngIf=\"newIncomingCallsList.length > 0\">\n <div class=\"collops\">\n <div class=\"d-flex w-100\">\n <div class=\"d-flex flex-column container-fluid\">\n <div class=\"callToNum\">Incoming call <br/><span>{{dedicatedNum}}</span></div>\n <ng-container *ngFor=\"let data of newIncomingCallsList\">\n <div class=\"p-2 \">\n <div class=\"call-info-wrapper w-100 d-flex align-items-center\">\n <div class=\"img\">\n <img class=\"avatar-img-wrapper\" [src]=\"incomingCallData.img\" alt=\"\" width=\"45\" />\n </div>\n <div class=\"d-flex justify-content-between w-100 align-items-center mr-2\">\n <div class=\"callerDetails-wrapper\">\n <h5 class=\"break-word\">{{data?.userInfo?.c2cInformation?.name || '-'}}</h5>\n <p class=\"break-word\">{{data.userInfo?.displayNum ? data.userInfo?.c2cInformation.number : data.userInfo?.c2cInformation.number }}</p>\n </div> \n <div class=\"d-flex align-items-center\">\n <button class=\"call-btn-wrapper receive-btn\" [disabled]=\"!data?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(data)\"> call </span>\n </button>\n <button class=\"call-btn-wrapper mute-btn\" *ngIf=\"data?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (click)=\"toggleMute(data)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"call-btn-wrapper reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(data)\"> call_end </span>\n </button>\n <div class=\"togglearrow-arrow me-2\" id=\"togglearrow\" (click)=\"onClickExpand(data)\"><i class=\"fa fa-angle-right\"></i></div>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n <div class=\"call-container p-3 text-white model-content\" *ngIf=\"isClickExpand\"> \n <div class=\"mb-2\" style=\"width: 100%; height: 100%;\">\n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\n <img class=\"avatar-img\" [src]=\"incomingCallData.img\" alt=\"\" width=\"100\" />\n </div>\n <div class=\"text-center\">\n <h3 class=\"text-white\">{{selectedIncomingCall?.userInfo?.c2cInformation?.name || '-'}}</h3>\n </div>\n <div class=\"f-13\">\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Subject:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.subject || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Email:</div>\n <div>{{selectedIncomingCall?.userInfo?.c2cInformation?.email || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Number:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.number}}</div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Language:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.language || '-'}}</div>\n </div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Extension:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.extension || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Image:</div>\n <div class=\"text-ellipsis\">\n <ng-container *ngIf=\"selectedIncomingCall?.userInfo?.c2cInformation?.image && selectedIncomingCall?.userInfo?.c2cInformation?.image !== '-'; else noImage\">\n <img src=\"{{selectedIncomingCall?.userInfo?.c2cInformation?.image}}\" alt=\"\" width=\"42\" height=\"42\" class=\"ml-2\"/>\n </ng-container>\n <ng-template #noImage>\n <span class=\"ml-2\">No Image Available</span>\n </ng-template>\n </div>\n </div> \n </div>\n\n <div class=\" mb-4\">\n <div class=\"\">\n <div class=\"\">Message:</div>\n <div class=\"text-ellipsis\">{{selectedIncomingCall?.userInfo?.c2cInformation?.message || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Point Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.pointName || '-'}}</div>\n </div>\n <div class=\"col-6 mb-2\">\n <div class=\"\">Source Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.sourceName || '-'}}</div>\n </div>\n </div>\n </div>\n <div class=\"call-action-btns mt-0\">\n <button class=\"call-btn receive-btn\" *ngIf=\"!selectedIncomingCall?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(selectedIncomingCall)\"> call </span>\n </button>\n <button class=\"call-btn mute-btn\" *ngIf=\"selectedIncomingCall?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (click)=\"toggleMute(selectedIncomingCall)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"call-btn reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(selectedIncomingCall)\"> call_end </span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"wave-container\">\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\" [ngStyle]=\"{'width': '756px'}\">\n <defs>\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\n </defs>\n <g class=\"parallax\">\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" /> \n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\n </g>\n </svg>\n </div>\n</div>", styles: [".call-container{width:385px;height:646px;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{display:flex;flex-direction:column;width:100%;height:100%}.container-fluid{width:680px;height:100%;margin-top:10px}.model-content{background-color:#0d6efd;border-radius:20px;width:645px}.calls-side-by-side{position:fixed;top:0;width:30%;height:498px;z-index:1050;pointer-events:auto;display:flex;align-items:flex-start;left:-10rem;transform:translate(.2rem);transition:left 1s ease-in-out}.move{left:41vw!important}.f-13{font-size:13px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto;border-radius:100%;border:solid 4px #fff}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.avatar-img-wrapper{border-radius:100%;margin:0 5px}.call-btn-wrapper{height:38px;background-color:#fff;border-radius:30px;margin:0 4px;opacity:.9;width:40px;span {color: white; line-height: unset !important;}}.hold-btn{background-color:#bebebe26;border:none}.hold-btn span,.mute-btn span{color:#fff!important}.active-hold{background-color:#fff!important}.active-hold span{color:#000!important}.active-mute{background-color:transparent}.call-info-wrapper{border:1px solid white;border-radius:7px;padding:8px 1px!important;word-break:break-all}.call-animation-play{animation:play 3s linear infinite}.avatar-img{width:94px;height:94px;border-radius:100%;position:absolute;left:0;top:0}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{margin:12px 0 0;color:#fff}.callerDetails-wrapper{margin:0 5px;color:#fff;display:flex;flex-direction:column}.callerDetails-wrapper h3,.callerDetails-wrapper h5{margin:0;color:#fff}.togglearrow-arrow{left:100%;background-color:#fff;width:25px;height:25px;text-align:center;cursor:pointer;border:1px solid #ccc;border-radius:50%;line-height:22px}.callerDetails h4{margin:0;color:#fff}.callerDetails p,.callerDetails-wrapper p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;width:50px;height:50px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:48px;height:45px;background-color:#fff;border-radius:30px;box-sizing:border-box;margin:0 8px;opacity:.9}.call-btn:hover{opacity:1}.call-btn span{color:#fff;line-height:unset!important}.receive-btn{background-color:#28a745;border:2px solid #28a745}.mute-btn{position:relative;border:none;background-color:#bebebe26}.reject-btn{background-color:#e03131;border:2px solid #e03131}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.call-action-btns{text-align:center;margin-top:240px}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}.callToNum{color:#fff;font-weight:400;text-align:center}.callToNum span{font-weight:600}.text-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;display:block}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
1596
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IncomingCallComponent, decorators: [{
1597
+ type: Component,
1598
+ args: [{ selector: 'lib-incoming-call', template: "<div class=\"call-container\" style=\"width: 100%;\" *ngIf=\"newIncomingCallsList.length > 0\">\n <div class=\"collops\">\n <div class=\"d-flex w-100\">\n <div class=\"d-flex flex-column container-fluid\">\n <div class=\"callToNum\">Incoming call <br/><span>{{dedicatedNum}}</span></div>\n <ng-container *ngFor=\"let data of newIncomingCallsList\">\n <div class=\"p-2 \">\n <div class=\"call-info-wrapper w-100 d-flex align-items-center\">\n <div class=\"img\">\n <img class=\"avatar-img-wrapper\" [src]=\"incomingCallData.img\" alt=\"\" width=\"45\" />\n </div>\n <div class=\"d-flex justify-content-between w-100 align-items-center mr-2\">\n <div class=\"callerDetails-wrapper\">\n <h5 class=\"break-word\">{{data?.userInfo?.c2cInformation?.name || '-'}}</h5>\n <p class=\"break-word\">{{data.userInfo?.displayNum ? data.userInfo?.c2cInformation.number : data.userInfo?.c2cInformation.number }}</p>\n </div> \n <div class=\"d-flex align-items-center\">\n <button class=\"call-btn-wrapper receive-btn\" [disabled]=\"!data?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(data)\"> call </span>\n </button>\n <button class=\"call-btn-wrapper mute-btn\" *ngIf=\"data?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (click)=\"toggleMute(data)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"call-btn-wrapper reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(data)\"> call_end </span>\n </button>\n <div class=\"togglearrow-arrow me-2\" id=\"togglearrow\" (click)=\"onClickExpand(data)\"><i class=\"fa fa-angle-right\"></i></div>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n <div class=\"call-container p-3 text-white model-content\" *ngIf=\"isClickExpand\"> \n <div class=\"mb-2\" style=\"width: 100%; height: 100%;\">\n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\n <img class=\"avatar-img\" [src]=\"incomingCallData.img\" alt=\"\" width=\"100\" />\n </div>\n <div class=\"text-center\">\n <h3 class=\"text-white\">{{selectedIncomingCall?.userInfo?.c2cInformation?.name || '-'}}</h3>\n </div>\n <div class=\"f-13\">\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Subject:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.subject || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Email:</div>\n <div>{{selectedIncomingCall?.userInfo?.c2cInformation?.email || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Number:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.number}}</div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Language:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.language || '-'}}</div>\n </div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Extension:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.extension || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Image:</div>\n <div class=\"text-ellipsis\">\n <ng-container *ngIf=\"selectedIncomingCall?.userInfo?.c2cInformation?.image && selectedIncomingCall?.userInfo?.c2cInformation?.image !== '-'; else noImage\">\n <img src=\"{{selectedIncomingCall?.userInfo?.c2cInformation?.image}}\" alt=\"\" width=\"42\" height=\"42\" class=\"ml-2\"/>\n </ng-container>\n <ng-template #noImage>\n <span class=\"ml-2\">No Image Available</span>\n </ng-template>\n </div>\n </div> \n </div>\n\n <div class=\" mb-4\">\n <div class=\"\">\n <div class=\"\">Message:</div>\n <div class=\"text-ellipsis\">{{selectedIncomingCall?.userInfo?.c2cInformation?.message || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Point Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.pointName || '-'}}</div>\n </div>\n <div class=\"col-6 mb-2\">\n <div class=\"\">Source Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.sourceName || '-'}}</div>\n </div>\n </div>\n </div>\n <div class=\"call-action-btns mt-0\">\n <button class=\"call-btn receive-btn\" *ngIf=\"!selectedIncomingCall?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(selectedIncomingCall)\"> call </span>\n </button>\n <button class=\"call-btn mute-btn\" *ngIf=\"selectedIncomingCall?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (click)=\"toggleMute(selectedIncomingCall)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"call-btn reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(selectedIncomingCall)\"> call_end </span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"wave-container\">\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\" [ngStyle]=\"{'width': '756px'}\">\n <defs>\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\n </defs>\n <g class=\"parallax\">\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" /> \n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\n </g>\n </svg>\n </div>\n</div>", styles: [".call-container{width:385px;height:646px;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{display:flex;flex-direction:column;width:100%;height:100%}.container-fluid{width:680px;height:100%;margin-top:10px}.model-content{background-color:#0d6efd;border-radius:20px;width:645px}.calls-side-by-side{position:fixed;top:0;width:30%;height:498px;z-index:1050;pointer-events:auto;display:flex;align-items:flex-start;left:-10rem;transform:translate(.2rem);transition:left 1s ease-in-out}.move{left:41vw!important}.f-13{font-size:13px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto;border-radius:100%;border:solid 4px #fff}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.avatar-img-wrapper{border-radius:100%;margin:0 5px}.call-btn-wrapper{height:38px;background-color:#fff;border-radius:30px;margin:0 4px;opacity:.9;width:40px;span {color: white; line-height: unset !important;}}.hold-btn{background-color:#bebebe26;border:none}.hold-btn span,.mute-btn span{color:#fff!important}.active-hold{background-color:#fff!important}.active-hold span{color:#000!important}.active-mute{background-color:transparent}.call-info-wrapper{border:1px solid white;border-radius:7px;padding:8px 1px!important;word-break:break-all}.call-animation-play{animation:play 3s linear infinite}.avatar-img{width:94px;height:94px;border-radius:100%;position:absolute;left:0;top:0}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{margin:12px 0 0;color:#fff}.callerDetails-wrapper{margin:0 5px;color:#fff;display:flex;flex-direction:column}.callerDetails-wrapper h3,.callerDetails-wrapper h5{margin:0;color:#fff}.togglearrow-arrow{left:100%;background-color:#fff;width:25px;height:25px;text-align:center;cursor:pointer;border:1px solid #ccc;border-radius:50%;line-height:22px}.callerDetails h4{margin:0;color:#fff}.callerDetails p,.callerDetails-wrapper p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;width:50px;height:50px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:48px;height:45px;background-color:#fff;border-radius:30px;box-sizing:border-box;margin:0 8px;opacity:.9}.call-btn:hover{opacity:1}.call-btn span{color:#fff;line-height:unset!important}.receive-btn{background-color:#28a745;border:2px solid #28a745}.mute-btn{position:relative;border:none;background-color:#bebebe26}.reject-btn{background-color:#e03131;border:2px solid #e03131}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.call-action-btns{text-align:center;margin-top:240px}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}.callToNum{color:#fff;font-weight:400;text-align:center}.callToNum span{font-weight:600}.text-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;display:block}\n"] }]
1599
+ }], ctorParameters: function () { return [{ type: ExtensionService }, { type: TwilioService }]; }, propDecorators: { incomingCallData: [{
1600
+ type: Input
1601
+ }], newIncomingCallsList: [{
1602
+ type: Input
1603
+ }], closeIncomingCallDiv: [{
1604
+ type: Output
1605
+ }], incomingCallsNewList: [{
1606
+ type: Output
1607
+ }], selectedIncomingCallInfo: [{
1608
+ type: Output
1609
+ }] } });
1610
+
1611
+ class CallProgressComponent {
1612
+ constructor(extensionService, cdr) {
1613
+ this.extensionService = extensionService;
1614
+ this.cdr = cdr;
1615
+ this.endCallEvent = new EventEmitter();
1616
+ this.incomingCallsNewInfo = new EventEmitter();
1617
+ this.minimiseEvent = new EventEmitter();
1618
+ this.showRingAnimation = false;
1619
+ this.timer = '00:00';
1620
+ this.showKeypad = false;
1621
+ this.keypadVal = keypad;
1622
+ this.callInput = '';
1623
+ this.isMute = false;
1624
+ this.disbaleEndCallBtn = true;
1625
+ this.showClearBtn = false;
1626
+ this.isCollops = false;
1627
+ // Incoming call variables
1628
+ this.incomingCallDiv = false;
1629
+ this.showCallProgressEvent = new EventEmitter();
1630
+ this.incomingCallInitiated = new EventEmitter();
1631
+ this.isRecording = false;
1632
+ this.isPaused = false;
1633
+ this.timeElapsed = 0; // in seconds
1634
+ this.recordCall = false;
1635
+ this.callStatus = 'ringing';
1636
+ this.isMinimised = false;
1730
1637
  }
1731
- getCallerIdList() {
1732
- this.extService.displayID(this.token || '').subscribe((res) => {
1733
- //this.callerIdList = res.callerIdList.filter(item => item.type === "C2C Softphone Number");
1734
- this.callerIdList = res.callerIdList.filter((item) => item.voiceFeature === true);
1735
- // this.callerIdList = res.callerIdList;
1736
- if (this.callerIdList.length == 1) {
1737
- this.selectedCallerId = this.callerIdList[0];
1638
+ ngOnInit() {
1639
+ console.log('Call Progress Component');
1640
+ }
1641
+ ngOnChanges(changes) {
1642
+ var _a, _b, _c, _d;
1643
+ console.log('Call Progress Component ngOnChanges');
1644
+ if (changes['callData']) {
1645
+ console.log('Call Progress Component ngOnChanges callData', changes['callData']);
1646
+ if (changes['callData'].currentValue.isIncomingCall) {
1647
+ this.incomingCallDiv = true;
1738
1648
  }
1739
1649
  else {
1740
- if (this.callPreference === 'alwaysAsk' || this.callPreference === 'smartDialing') {
1741
- this.selectedCallerId = null;
1742
- }
1743
- else {
1744
- this.selectedCallerId = this.callerIdList.find(item => (item.number == this.callPreference));
1650
+ //for outgoing call
1651
+ this.startCall(changes['callData'].currentValue);
1652
+ }
1653
+ }
1654
+ if (changes['newIncomingCallData']) {
1655
+ try {
1656
+ if (changes['newIncomingCallData'].currentValue) {
1657
+ if (this.call && (this.call.status() == 'open')) {
1658
+ this.call.disconnect();
1659
+ this.call = changes['newIncomingCallData'].currentValue;
1660
+ (_a = this.call) === null || _a === void 0 ? void 0 : _a.accept();
1661
+ this.callData.phone = (_b = this.call) === null || _b === void 0 ? void 0 : _b.parameters['From'];
1662
+ this.callData.name = (_c = this.call) === null || _c === void 0 ? void 0 : _c.customParameters.get('name');
1663
+ this.callData.img = ((_d = this.call) === null || _d === void 0 ? void 0 : _d.customParameters.get('image')) || 'assets/images/user.jpg';
1664
+ this.incomingCallInitiated.emit();
1665
+ this.startTimer();
1666
+ }
1745
1667
  }
1746
1668
  }
1747
- });
1669
+ catch (e) {
1670
+ console.log(e);
1671
+ }
1672
+ }
1748
1673
  }
1749
- getContactList() {
1750
- this.twilioService.getContactList().subscribe((resp) => {
1751
- if (resp.response == 'Success') {
1752
- this.contactList = resp.phoneBook;
1674
+ ngAfterViewInit() { }
1675
+ startCall(callData) {
1676
+ return __awaiter(this, void 0, void 0, function* () {
1677
+ try {
1678
+ this.showRingAnimation = true;
1679
+ const payload = {
1680
+ channelId: environment.channelId,
1681
+ userId: localStorage.getItem('userId'),
1682
+ to: callData.phone,
1683
+ scope: 'local',
1684
+ fromNumber: callData.from
1685
+ };
1686
+ const response = yield this.initiateCall(payload);
1687
+ if (response.status == 200) {
1688
+ const { id: callAuthId, recordCall } = yield this.getCallAuthId(response);
1689
+ this.getUserInformation(callAuthId);
1690
+ this.recordCall = recordCall; // Store the recordCall value
1691
+ const tokenData = yield this.getOutgoingCallToken(callAuthId);
1692
+ yield this.connectToDevice(tokenData.token, callData);
1693
+ // Poll the status for 30-45 seconds
1694
+ this.pollCallStatus(callAuthId);
1695
+ }
1696
+ else if (response.status == 201) {
1697
+ swal("Error", response.message.join("<br/>"), "error");
1698
+ this.endCall();
1699
+ }
1753
1700
  }
1754
- }, err => {
1701
+ catch (error) {
1702
+ this.showRingAnimation = false;
1703
+ this.handleError(error);
1704
+ this.endCall();
1705
+ }
1706
+ });
1707
+ }
1708
+ initiateCall(payload) {
1709
+ return __awaiter(this, void 0, void 0, function* () {
1710
+ return yield this.extensionService.initiateCall(payload).toPromise();
1711
+ });
1712
+ }
1713
+ getCallAuthId(response) {
1714
+ return __awaiter(this, void 0, void 0, function* () {
1715
+ return {
1716
+ id: response.callauth.id,
1717
+ recordCall: response.callauth.recordCall
1718
+ };
1719
+ });
1720
+ }
1721
+ getOutgoingCallToken(callAuthId) {
1722
+ return __awaiter(this, void 0, void 0, function* () {
1723
+ return yield this.extensionService.getOutgoingCallToken({ authId: callAuthId }).toPromise();
1724
+ });
1725
+ }
1726
+ connectToDevice(token, callData) {
1727
+ return __awaiter(this, void 0, void 0, function* () {
1728
+ const options = {
1729
+ codecPreferences: ['opus', 'pcmu'],
1730
+ closeProtection: true,
1731
+ };
1732
+ this.device = new Device(token.value, options);
1733
+ this.call = yield this.device.connect({
1734
+ params: {
1735
+ From: callData.from,
1736
+ To: callData.phone,
1737
+ Env: environment.abb,
1738
+ Token: token.id,
1739
+ Ext: callData.extNum
1740
+ },
1741
+ rtcConstraints: { audio: { deviceId: 'default' } },
1742
+ });
1743
+ this.setupEventListeners();
1744
+ });
1745
+ }
1746
+ setupEventListeners() {
1747
+ var _a, _b, _c, _d, _e, _f, _g;
1748
+ this.startTimer();
1749
+ (_a = this.device) === null || _a === void 0 ? void 0 : _a.on('error', (err) => {
1755
1750
  console.log(err);
1751
+ this.showRingAnimation = false;
1752
+ this.stopTimer();
1753
+ });
1754
+ (_b = this.call) === null || _b === void 0 ? void 0 : _b.on('error', (error) => {
1755
+ this.showRingAnimation = false;
1756
+ this.stopTimer();
1757
+ });
1758
+ (_c = this.call) === null || _c === void 0 ? void 0 : _c.on('disconnect', () => {
1759
+ this.endCall();
1760
+ });
1761
+ (_d = this.call) === null || _d === void 0 ? void 0 : _d.on('ringing', () => {
1762
+ });
1763
+ (_e = this.call) === null || _e === void 0 ? void 0 : _e.on('reject', () => {
1764
+ this.endCall();
1765
+ });
1766
+ (_f = this.call) === null || _f === void 0 ? void 0 : _f.on('accept', () => {
1767
+ this.showRingAnimation = false;
1768
+ this.disbaleEndCallBtn = false;
1769
+ // Start recording if recordCall is true and call is accepted for 30 seconds
1770
+ // if (this.recordCall) {
1771
+ // setTimeout(() => {
1772
+ // if (this.isRecording) return; // If already recording, skip
1773
+ // this.startRecording();
1774
+ // }, 30000);
1775
+ // } else {
1776
+ // this.stopRecording();
1777
+ // }
1778
+ });
1779
+ (_g = this.call) === null || _g === void 0 ? void 0 : _g.on('messageReceived', (message) => {
1756
1780
  });
1757
1781
  }
1758
- getFullName(contact) {
1759
- let fullName = contact.firstName || '';
1760
- if (contact.middleName) {
1761
- fullName += ` ${contact.middleName}`;
1762
- }
1763
- if (contact.lastName) {
1764
- fullName += ` ${contact.lastName}`;
1765
- }
1766
- return fullName.trim();
1782
+ startTimer() {
1783
+ let seconds = 0;
1784
+ this.intervalId = setInterval(() => {
1785
+ seconds++;
1786
+ this.timer = this.formatTime(seconds);
1787
+ }, 1000);
1767
1788
  }
1768
- toggleCallerIdDiv() {
1769
- this.isCallerIdHidden = !this.isCallerIdHidden;
1789
+ stopTimer() {
1790
+ clearInterval(this.intervalId);
1791
+ this.timer = '00:00';
1770
1792
  }
1771
- onContactSelect(contact) {
1772
- this.dialedNumber = contact.numbersList[0].number;
1773
- this.callData.name = this.getFullName(contact);
1774
- this.callData.img = contact.image || 'assets/images/user.jpg';
1775
- this.onDialInputChange(this.dialedNumber);
1776
- this.filteredContactList = [];
1793
+ formatTime(totalSeconds) {
1794
+ const minutes = Math.floor(totalSeconds / 60);
1795
+ const seconds = totalSeconds % 60;
1796
+ return `${this.pad(minutes)}:${this.pad(seconds)}`;
1797
+ }
1798
+ pad(value) {
1799
+ return value < 10 ? `0${value}` : `${value}`;
1800
+ }
1801
+ handleError(error) {
1802
+ swal("Error", error, "error");
1777
1803
  }
1778
1804
  endCall() {
1805
+ this.endCallEvent.emit();
1806
+ if (this.call) {
1807
+ this.call.disconnect();
1808
+ }
1809
+ this.showRingAnimation = false;
1810
+ this.stopTimer();
1811
+ this.maximiseDialpad();
1812
+ }
1813
+ toggleMute() {
1814
+ var _a;
1815
+ this.isMute = !this.isMute;
1816
+ (_a = this.call) === null || _a === void 0 ? void 0 : _a.mute(this.isMute);
1817
+ }
1818
+ toggleKeypad() {
1819
+ this.showKeypad = !this.showKeypad;
1820
+ this.callInput = '';
1821
+ }
1822
+ onCallInputs(num) {
1823
+ var _a;
1779
1824
  try {
1780
- console.log('Ending call');
1781
- this.isCallInProgress = false;
1782
- this.filteredContactList = [];
1783
- // Reset call data
1784
- this.callData = {
1785
- phone: '',
1786
- name: '',
1787
- img: 'assets/images/user.jpg',
1788
- isIncomingCall: false,
1789
- dial: false,
1790
- displayNum: '',
1791
- extNum: ''
1792
- };
1793
- // Reset dialed number
1794
- this.dialedNumber = '';
1795
- this.sanitizedNum = '';
1796
- // Emit end call event
1797
- this.endCallEvent.emit();
1798
- console.log('Call ended successfully');
1825
+ if (Number.isInteger(num) || num == '+' || num == '*' || num == '#') {
1826
+ if (num == '#') {
1827
+ new Audio(`/assets/dial-tones/dtmf/dtmf-hash-.mp3`).play();
1828
+ }
1829
+ else if (num == '*') {
1830
+ new Audio(`/assets/dial-tones/dtmf/dtmf-star-.mp3`).play();
1831
+ }
1832
+ else {
1833
+ new Audio(`/assets/dial-tones/dtmf/dtmf-${num}-.mp3`).play();
1834
+ }
1835
+ this.callInput = this.callInput + String(num);
1836
+ this.showClearBtn = true;
1837
+ }
1838
+ let str = String(num);
1839
+ (_a = this.call) === null || _a === void 0 ? void 0 : _a.sendDigits(str);
1799
1840
  }
1800
- catch (error) {
1801
- console.error('Error in endCall:', error);
1802
- // Even if there's an error, try to reset the state
1803
- this.isCallInProgress = false;
1804
- this.callData = {
1805
- phone: '',
1806
- name: '',
1807
- img: 'assets/images/user.jpg',
1808
- isIncomingCall: false,
1809
- dial: false,
1810
- displayNum: '',
1811
- extNum: ''
1812
- };
1841
+ catch (e) {
1842
+ console.log(e);
1843
+ }
1844
+ }
1845
+ onCallInputEnter(ev) {
1846
+ var _a;
1847
+ try {
1848
+ (_a = this.call) === null || _a === void 0 ? void 0 : _a.sendDigits(String(ev.key));
1849
+ }
1850
+ catch (e) {
1851
+ console.log(e);
1852
+ }
1853
+ }
1854
+ closeIncomingCall(data) {
1855
+ // this.incomingCallDiv = false;
1856
+ if (data.show) {
1857
+ //this.showCallProgressEvent.emit()
1858
+ // handle incoming call accepted
1859
+ this.startTimer();
1860
+ this.disbaleEndCallBtn = false;
1861
+ this.call = data.call;
1862
+ const incomingDetail = this.extensionService.getCallSid();
1863
+ this.incomingRecordCall = incomingDetail.recordCall;
1864
+ // Start recording if the call is answered and recording is enabled
1865
+ if (this.incomingRecordCall) {
1866
+ this.startRecording();
1867
+ }
1868
+ else {
1869
+ this.isRecording = false;
1870
+ }
1871
+ this.cdr.detectChanges();
1872
+ }
1873
+ else {
1874
+ // incoming call rejected
1813
1875
  this.endCallEvent.emit();
1814
1876
  }
1815
1877
  }
1816
- // async initiateCall() {
1817
- // try {
1818
- // console.log('Initiating call with number:', this.dialedNumber);
1819
- // if (!this.dialedNumber && this.lastDialed) {
1820
- // console.log('Using last dialed number:', this.lastDialed.number);
1821
- // this.sanitizedNum = this.lastDialed.number;
1822
- // }
1823
- // const isInvalid = await this.isInvalidNumber();
1824
- // if (isInvalid) {
1825
- // console.error('Invalid number format');
1826
- // return false;
1827
- // }
1828
- // this.saveLastDialed();
1829
- // this.isSavedContactDialled();
1830
- // // Check payment status
1831
- // this.isPaymentDue = localStorage.getItem('paymentDue') === 'true';
1832
- // if (this.isPaymentDue) {
1833
- // console.warn('Payment is due');
1834
- // swal('Warning', 'Please note that your payment is due. To continue using our services, kindly subscribe to avoid interruptions.');
1835
- // return false;
1836
- // }
1837
- // // Check if dialing own number
1838
- // if (this.sanitizedNum === localStorage.getItem('twilioNumber')) {
1839
- // console.error('Attempted to dial own number');
1840
- // swal('Error', 'You cannot dial your own number');
1841
- // return false;
1842
- // }
1843
- // // Check microphone permissions
1844
- // const hasPermission = await this.checkMicrophonePermission();
1845
- // if (!hasPermission) {
1846
- // console.warn('Microphone permission not granted');
1847
- // await this.askForMicrophonePermission();
1848
- // return false;
1849
- // }
1850
- // if (!this.selectedCallerId) {
1851
- // console.error('No caller ID selected');
1852
- // this.shakeDedicatedBtn = true;
1853
- // this.showDialAlert('Please select a C2C number to call from');
1854
- // setTimeout(() => {
1855
- // this.shakeDedicatedBtn = false;
1856
- // }, 3000);
1857
- // return false;
1858
- // }
1859
- // console.log('Getting number with country code...');
1860
- // this.callData.displayNum = '';
1861
- // try {
1862
- // await this.getToNumber(this.sanitizedNum);
1863
- // } catch (error) {
1864
- // console.error('Error getting number with country code:', error);
1865
- // this.showDialAlert('Error processing number. Please try again.');
1866
- // return false;
1867
- // }
1868
- // if (this.terminateCall) {
1869
- // console.log('Call terminated by user');
1870
- // this.terminateCall = false;
1871
- // return false;
1872
- // }
1873
- // // Prepare call data
1874
- // this.callData = {
1875
- // ...this.callData,
1876
- // phone: this.sanitizedNum,
1877
- // isIncomingCall: false,
1878
- // dial: true,
1879
- // from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
1880
- // timestamp: new Date().toISOString()
1881
- // };
1882
- // console.log('Initiating call with data:', this.callData);
1883
- // this.isCallInProgress = true;
1884
- // this.callInitiated.emit({ ...this.callData });
1885
- // return true;
1886
- // } catch (error) {
1887
- // console.error('Error in initiateCall:', error);
1888
- // this.showDialAlert('Failed to initiate call. Please try again.');
1889
- // this.isCallInProgress = false;
1890
- // return false;
1891
- // }
1892
- // //this.clearAllDialed();
1893
- // // } else {
1894
- // // swal('Error', 'Trial period is over. Please setup payment method to continue services')
1895
- // // }
1896
- // }
1897
- // async initiateCall() {
1898
- // if (!this.dialedNumber && this.lastDialed) {
1899
- // this.sanitizedNum = this.lastDialed.number;
1900
- // }
1901
- // const isInvalid = await this.isInvalidNumber();
1902
- // if (isInvalid) {
1903
- // return false;
1904
- // }
1905
- // this.saveLastDialed();
1906
- // this.isSavedContactDialled();
1907
- // //let isCallerIdSet = await this.isCallerIdSet();
1908
- // this.isPaymentDue = localStorage.getItem('paymentDue') == 'false' ? false : true;
1909
- // if (this.isPaymentDue) {
1910
- // swal('Warning', 'Please note that your payment is due, To continue on your services kindly subscribe to use uninterrupted services.');
1911
- // return;
1912
- // }
1913
- // this.isTrialPeriodOver = localStorage.getItem('trialOver') == 'false' ? false : true;
1914
- // // if (!this.isTrialPeriodOver) {
1915
- // if (this.sanitizedNum == localStorage.getItem('twilioNumber')) {
1916
- // swal('Error', 'You can not dial this number');
1917
- // return;
1918
- // }
1919
- // const hasPermission = await this.checkMicrophonePermission();
1920
- // if (hasPermission) {
1921
- // if (this.selectedCallerId) {
1922
- // //clear displayNum if value is binded from previous call
1923
- // this.callData.displayNum = '';
1924
- // // get number to be dialled from backend
1925
- // await this.getToNumber(this.sanitizedNum);
1926
- // if (this.terminateCall) {
1927
- // this.terminateCall = false;
1928
- // return;
1929
- // }
1930
- // this.callData.phone = this.sanitizedNum;
1931
- // this.callData.isIncomingCall = false;
1932
- // this.callData.dial = true;
1933
- // if (!this.isSmartDialCall) {
1934
- // this.callData.from = this.selectedCallerId.number;
1935
- // }
1936
- // this.isCallInProgress = true;
1937
- // this.callData = {
1938
- // ...this.callData,
1939
- // phone: this.sanitizedNum,
1940
- // isIncomingCall: false,
1941
- // dial: true,
1942
- // from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
1943
- // timestamp: new Date().toISOString()
1944
- // };
1945
- // console.log('Initiating call with data:', this.callData);
1946
- // this.isCallInProgress = true;
1947
- // this.callInitiated.emit({ ...this.callData });
1948
- // return true;
1949
- // } else {
1950
- // this.shakeDedicatedBtn = true;
1951
- // this.showDialAlert('Select a C2C number to call');
1952
- // setTimeout(() => {
1953
- // this.shakeDedicatedBtn = false;
1954
- // }, 3000);
1955
- // return false;
1956
- // }
1957
- // //this.callingOpenEvent.emit({ phone: this.dialedNumber });
1958
- // } else {
1959
- // await this.askForMicrophonePermission();
1960
- // }
1961
- // //this.clearAllDialed();
1962
- // // } else {
1963
- // // swal('Error', 'Trial period is over. Please setup payment method to continue services')
1964
- // // }
1965
- // }
1966
- // async initiateCall() {
1967
- // try{
1968
- // if (!this.dialedNumber && this.lastDialed) {
1969
- // this.sanitizedNum = this.lastDialed.number;
1970
- // }
1971
- // const isInvalid = await this.isInvalidNumber();
1972
- // if (isInvalid) {
1973
- // return false;
1974
- // }
1975
- // this.saveLastDialed();
1976
- // this.isSavedContactDialled();
1977
- // //let isCallerIdSet = await this.isCallerIdSet();
1978
- // this.isPaymentDue = localStorage.getItem('paymentDue') == 'false' ? false : true;
1979
- // if (this.isPaymentDue) {
1980
- // swal('Warning', 'Please note that your payment is due, To continue on your services kindly subscribe to use uninterrupted services.');
1981
- // return false;
1982
- // }
1983
- // this.isTrialPeriodOver = localStorage.getItem('trialOver') == 'false' ? false : true;
1984
- // // if (!this.isTrialPeriodOver) {
1985
- // if (this.sanitizedNum == localStorage.getItem('twilioNumber')) {
1986
- // swal('Error', 'You can not dial this number');
1987
- // return false;
1988
- // }
1989
- // const hasPermission = await this.checkMicrophonePermission();
1990
- // if (hasPermission) {
1991
- // if (this.selectedCallerId) {
1992
- // //clear displayNum if value is binded from previous call
1993
- // this.callData.displayNum = '';
1994
- // // get number to be dialled from backend
1995
- // await this.getToNumber(this.sanitizedNum);
1996
- // if (this.terminateCall) {
1997
- // this.terminateCall = false;
1998
- // return;
1999
- // }
2000
- // this.callData.phone = this.sanitizedNum;
2001
- // this.callData.isIncomingCall = false;
2002
- // this.callData.dial = true;
2003
- // if (!this.isSmartDialCall) {
2004
- // this.callData.from = this.selectedCallerId.number;
2005
- // }
2006
- // this.isCallInProgress = true;
2007
- // this.callData = {
2008
- // ...this.callData,
2009
- // phone: this.sanitizedNum,
2010
- // isIncomingCall: false,
2011
- // dial: true,
2012
- // from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
2013
- // timestamp: new Date().toISOString()
2014
- // };
2015
- // console.log('Initiating call with data:', this.callData);
2016
- // this.isCallInProgress = true;
2017
- // this.callInitiated.emit({ ...this.callData });
2018
- // return true;
2019
- // } else {
2020
- // this.shakeDedicatedBtn = true;
2021
- // this.showDialAlert('Select a C2C number to call');
2022
- // setTimeout(() => {
2023
- // this.shakeDedicatedBtn = false;
2024
- // }, 3000);
2025
- // return false;
2026
- // }
2027
- // //this.callingOpenEvent.emit({ phone: this.dialedNumber });
2028
- // } else {
2029
- // await this.askForMicrophonePermission();
2030
- // }
2031
- // //this.clearAllDialed();
2032
- // // } else {
2033
- // // swal('Error', 'Trial period is over. Please setup payment method to continue services')
2034
- // // }
2035
- // }catch(e){
2036
- // console.error('Error in initiateCall:', e);
2037
- // this.showDialAlert('Failed to initiate call. Please try again.');
2038
- // this.isCallInProgress = false;
2039
- // return false;
2040
- // }
2041
- // }
2042
- initiateCall() {
2043
- return __awaiter(this, void 0, void 0, function* () {
2044
- try {
2045
- if (!this.dialedNumber && this.lastDialed) {
2046
- this.sanitizedNum = this.lastDialed.number;
2047
- }
2048
- const isInvalid = yield this.isInvalidNumber();
2049
- if (isInvalid) {
2050
- return false;
2051
- }
2052
- // this.saveLastDialed();
2053
- this.isSavedContactDialled();
2054
- this.isPaymentDue = localStorage.getItem('paymentDue') === 'false' ? false : true;
2055
- if (this.isPaymentDue) {
2056
- // swal('Warning', 'Please note that your payment is due, To continue on your services kindly subscribe to use uninterrupted services.');
2057
- return false;
2058
- }
2059
- this.isTrialPeriodOver = localStorage.getItem('trialOver') === 'false' ? false : true;
2060
- if (this.sanitizedNum === localStorage.getItem('twilioNumber')) {
2061
- // swal('Error', 'You can not dial this number');
2062
- return false;
2063
- }
2064
- // const hasPermission = await this.checkMicrophonePermission();
2065
- // if (!hasPermission) {
2066
- // await this.askForMicrophonePermission();
2067
- // return false;
2068
- // }
2069
- if (!this.selectedCallerId) {
2070
- this.shakeDedicatedBtn = true;
2071
- this.showDialAlert('Select a C2C number to call');
2072
- setTimeout(() => {
2073
- this.shakeDedicatedBtn = false;
2074
- }, 3000);
2075
- return false;
2076
- }
2077
- // Clear displayNum if value is bound from previous call
2078
- this.callData.displayNum = '';
2079
- // Get number to be dialed from backend
2080
- // await this.getToNumber(this.sanitizedNum);
2081
- if (this.terminateCall) {
2082
- this.terminateCall = false;
2083
- return;
2084
- }
2085
- // Update call data in a single operation
2086
- this.callData = Object.assign(Object.assign({}, this.callData), { phone: this.sanitizedNum, isIncomingCall: false, dial: true, from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number, timestamp: new Date().toISOString() });
2087
- console.log('Initiating call with data:', this.callData);
2088
- this.isCallInProgress = true;
2089
- this.callInitiated.emit(Object.assign({}, this.callData));
2090
- return true;
2091
- }
2092
- catch (e) {
2093
- console.error('Error in initiateCall:', e);
2094
- this.showDialAlert('Failed to initiate call. Please try again.');
2095
- this.isCallInProgress = false;
2096
- return false;
2097
- }
1878
+ clearInputs() {
1879
+ this.callInput = this.callInput.slice(0, -1);
1880
+ }
1881
+ minimiseDialpad() {
1882
+ this.minimiseEvent.emit(true);
1883
+ this.isMinimised = true;
1884
+ }
1885
+ maximiseDialpad() {
1886
+ this.minimiseEvent.emit(false);
1887
+ this.isMinimised = false;
1888
+ }
1889
+ toggleRecording() {
1890
+ if (this.isRecording) {
1891
+ this.stopRecording();
1892
+ }
1893
+ else {
1894
+ this.startRecording();
1895
+ }
1896
+ }
1897
+ startRecording() {
1898
+ let sid;
1899
+ const details = this.extensionService.getCallSid();
1900
+ this.incomingCallSid = details.callSid;
1901
+ this.incomingRecordCall = details.recordCall;
1902
+ sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
1903
+ // if (!this.incomingRecordCall && !this.recordCall) {
1904
+ // return;
1905
+ // }
1906
+ this.extensionService.getCallRecording(sid).subscribe(response => {
1907
+ this.isRecording = true;
1908
+ this.isPaused = false;
1909
+ this.timeElapsed = 0;
1910
+ this.startTimer1();
1911
+ }, error => {
1912
+ console.error('Error starting recording', error);
1913
+ });
1914
+ }
1915
+ stopRecording() {
1916
+ // if (!this.incomingRecordCall && !this.recordCall) {
1917
+ // return;
1918
+ // }
1919
+ this.isRecording = false;
1920
+ this.isPaused = false;
1921
+ if (this.timerSubscription) {
1922
+ this.timerSubscription.unsubscribe();
1923
+ }
1924
+ }
1925
+ pauseRecording() {
1926
+ const details = this.extensionService.getCallSid();
1927
+ this.incomingCallSid = details.callSid;
1928
+ this.incomingRecordCall = details.recordCall;
1929
+ const sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
1930
+ // if (!this.incomingRecordCall && !this.recordCall) {
1931
+ // return;
1932
+ // }
1933
+ this.extensionService.pauseOrResumeRecording(sid, 'pause').subscribe(response => {
1934
+ this.stopRecordingTimer();
1935
+ this.isPaused = true;
1936
+ }, error => {
1937
+ console.error('Error pausing recording:', error);
1938
+ // Consider updating the UI to show the error state
1939
+ });
1940
+ }
1941
+ resumeRecording() {
1942
+ let sid;
1943
+ const details = this.extensionService.getCallSid();
1944
+ this.incomingCallSid = details.callSid;
1945
+ this.incomingRecordCall = details.recordCall;
1946
+ sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
1947
+ // if (!this.incomingRecordCall && !this.recordCall) {
1948
+ // return; // Skip if recording is not enabled
1949
+ // }
1950
+ this.extensionService.pauseOrResumeRecording(sid, 'resume').subscribe(response => {
1951
+ this.isPaused = false;
1952
+ this.startTimer1();
1953
+ }, error => {
1954
+ console.error('Error resuming recording', error);
2098
1955
  });
2099
1956
  }
2100
- isInvalidNumber() {
2101
- return __awaiter(this, void 0, void 0, function* () {
1957
+ startTimer1() {
1958
+ this.timerSubscription = interval(1000).subscribe(() => {
1959
+ this.timeElapsed++;
1960
+ });
1961
+ }
1962
+ stopRecordingTimer() {
1963
+ if (this.timerSubscription) {
1964
+ this.timerSubscription.unsubscribe(); // Pause the timer
1965
+ this.timerSubscription = undefined; // Optionally reset the subscription
1966
+ }
1967
+ }
1968
+ getFormattedTime() {
1969
+ const minutes = Math.floor(this.timeElapsed / 60);
1970
+ const seconds = this.timeElapsed % 60;
1971
+ return `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
1972
+ }
1973
+ pollCallStatus(callAuthId) {
1974
+ const maxTime = 30000; // Poll for up to 30 seconds
1975
+ const pollInterval = 3000; // Poll every 3 seconds
1976
+ let elapsedTime = 0;
1977
+ const intervalId = setInterval(() => __awaiter(this, void 0, void 0, function* () {
1978
+ elapsedTime += pollInterval;
2102
1979
  try {
2103
- if (this.sanitizedNum == '') {
2104
- this.showDialAlert('Invalid Number');
2105
- return true;
2106
- }
2107
- const validNumberPattern = /^[+\d\s()-]*$/; // Regular expression to match valid characters
2108
- const phoneNumber = this.sanitizedNum;
2109
- if (!validNumberPattern.test(phoneNumber)) {
2110
- this.showDialAlert('Invalid Number');
2111
- return true;
1980
+ const statusResponse = yield this.extensionService.getCallStatus(callAuthId).toPromise();
1981
+ if (statusResponse && statusResponse.callDetails) {
1982
+ this.callStatus = statusResponse.callDetails.callStatus;
1983
+ if (this.callStatus === 'in-progress') {
1984
+ this.callSid = statusResponse.callDetails.callSid;
1985
+ if (this.recordCall && !this.isRecording) {
1986
+ this.startRecording();
1987
+ }
1988
+ clearInterval(intervalId);
1989
+ }
1990
+ else if (this.callStatus === 'completed') {
1991
+ clearInterval(intervalId);
1992
+ this.endCall();
1993
+ this.stopRecording();
1994
+ }
1995
+ else if (this.callStatus === 'ringing') {
1996
+ // Continue polling; do not clear the interval yet
1997
+ }
2112
1998
  }
2113
- return false;
2114
1999
  }
2115
2000
  catch (error) {
2116
- this.showDialAlert('Invalid Number');
2117
- return true; // Return true if an error occurred, meaning the number is invalid
2001
+ clearInterval(intervalId);
2118
2002
  }
2119
- });
2003
+ if (elapsedTime >= maxTime) {
2004
+ // console.log('Max polling time reached. Stopping poll.');
2005
+ clearInterval(intervalId);
2006
+ }
2007
+ }), pollInterval);
2120
2008
  }
2121
- // saveLastDialed() {
2122
- // const contact = this.filteredContactList.find(c => c.numbersList.some(n => n.number === this.dialedNumber));
2123
- // if (contact) {
2124
- // this.lastDialed = {
2125
- // name: contact.name,
2126
- // image: contact.image,
2127
- // number: this.dialedNumber
2128
- // };
2129
- // } else {
2130
- // if(this.dialedNumber){
2131
- // this.lastDialed = { number: this.dialedNumber };
2132
- // }
2133
- // }
2134
- // }
2135
- isSavedContactDialled() {
2136
- let phoneNum = this.sanitizedNum.replace(/\s+/g, '');
2137
- let contact = this.contactList.filter(contact => {
2138
- // return contact.numbersList.some(num => num.number === phoneNum)
2009
+ getUserInformation(id) {
2010
+ this.extensionService.getUserInformation(id).subscribe(response => {
2011
+ console.log(response);
2012
+ }, error => {
2013
+ console.error('Error starting recording', error);
2139
2014
  });
2140
- if (contact.length) {
2141
- this.callData.name = `${contact[0].firstName} ${contact[0].middleName} ${contact[0].lastName}`.toLowerCase();
2142
- this.callData.img = contact[0].image || 'assets/images/user.jpg';
2143
- this.callData.phone = this.sanitizedNum;
2144
- return true;
2015
+ }
2016
+ incomingCallsNewList(data) {
2017
+ this.newIncomingCallsList = data;
2018
+ this.incomingCallsNewInfo.emit(this.newIncomingCallsList);
2019
+ }
2020
+ selectedIncomingCallInfo(data) {
2021
+ this.selectedIncomingCall = data;
2022
+ }
2023
+ ngOnDestroy() {
2024
+ this.callData.dial = false;
2025
+ if (this.timerSubscription) {
2026
+ this.timerSubscription.unsubscribe();
2145
2027
  }
2146
- return false;
2147
2028
  }
2148
- showDialAlert(message) {
2029
+ }
2030
+ CallProgressComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallProgressComponent, deps: [{ token: ExtensionService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2031
+ CallProgressComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CallProgressComponent, selector: "lib-call-progress", inputs: { callData: "callData", newIncomingCallData: "newIncomingCallData", newIncomingCallsList: "newIncomingCallsList" }, outputs: { endCallEvent: "endCallEvent", incomingCallsNewInfo: "incomingCallsNewInfo", minimiseEvent: "minimiseEvent", showCallProgressEvent: "showCallProgressEvent", incomingCallInitiated: "incomingCallInitiated" }, usesOnChanges: true, ngImport: i0, template: "<div class=\"call-container\" *ngIf=\"!isMinimised\" [ngClass]=\"{'collops': isCollops, 'incoming-call-container': selectedIncomingCall?.isClickExpand}\">\n <div id=\"minimize-btn-div\">\n <span class=\"material-symbols-outlined minimize-btn\" (click)=\"minimiseDialpad()\">\n minimize\n </span>\n </div>\n <lib-incoming-call *ngIf=\"incomingCallDiv\" [incomingCallData]=\"callData\" [newIncomingCallsList]=\"newIncomingCallsList\" (closeIncomingCallDiv)=\"closeIncomingCall($event)\" \n (incomingCallsNewList)=\"incomingCallsNewList($event)\" (selectedIncomingCallInfo)=\"selectedIncomingCallInfo($event)\"></lib-incoming-call>\n <div style=\"display: flex; flex-direction: column;position: relative; width: 100%;\">\n \n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\n <img class=\"avatar-img\" [src]=\"callData.img\" alt=\"\" width=\"120\" />\n </div>\n <div class=\"callerDetails\">\n <h1 [ngStyle]=\"{'margin-top': showKeypad ? '0': '8px'}\">{{callData.name}}</h1>\n <p>{{callData.displayNum ? callData.displayNum : callData.phone }}</p>\n <h4 style=\"margin-top: 4px\">{{timer}}</h4>\n </div>\n <div class=\"record-action-btns\" [ngStyle]=\"{'margin-top': showKeypad ? '0': '20px'}\">\n <div class=\"record-btn-container\">\n <button class=\"record-btn start-stop\" *ngIf=\"!isRecording\" [ngClass]=\"{'recording': isRecording, 'stopped': !isRecording}\" (click)=\"toggleRecording()\" [title]=\"isRecording ? 'Stop Recording' : 'Start Recording'\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"recording-icon\"></span>\n </button>\n <div class=\"pause-resume-btns\">\n <button class=\"record-btn pause-resume\" *ngIf=\"isRecording && !isPaused\" (click)=\"pauseRecording()\">\n <span class=\"material-symbols-outlined\"> pause </span>\n </button>\n <button class=\"record-btn pause-resume\" *ngIf=\"isPaused\" (click)=\"resumeRecording()\">\n <span class=\"material-symbols-outlined\"> play_arrow </span>\n </button>\n </div>\n </div>\n <div *ngIf=\"isRecording\" class=\"timer-display\">\n {{ getFormattedTime() }}\n </div>\n </div>\n <div *ngIf=\"showKeypad\" class=\"sendDigit\">\n <input type=\"text\" name=\"call-inputs\" id=\"call-input\" [(ngModel)]=\"callInput\" (keyup)=\"onCallInputEnter($event)\">\n <span class=\"material-symbols-outlined input-clear-btn\" *ngIf=\"callInput\" (click)=\"clearInputs()\">close_small</span>\n </div>\n <div class=\"btn-container justify-content-center\" *ngIf=\"showKeypad\">\n <div class=\"key-btn\" *ngFor=\"let key of keypadVal\" (click)=\"onCallInputs(key.num)\">\n {{key.num}}\n <span class=\"btn-albhabets\">{{key.text ? key.text : '&nbsp;'}}</span>\n </div>\n </div>\n <div class=\"call-action-btns\" [ngStyle]=\"{'margin-top': showKeypad ? '0': '160px'}\">\n <button class=\"call-sec-btn\" [disabled]=\"disbaleEndCallBtn\" [ngStyle]=\"{'top': showKeypad ? '0': '-70px'}\" (click)=\"toggleMute()\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n\n </button>\n <button class=\"call-btn end-call-btn\" [disabled]=\"disbaleEndCallBtn\" (click)=\"endCall()\">\n <span class=\"material-symbols-outlined\"> call_end </span>\n </button>\n <button class=\"call-sec-btn\" [ngStyle]=\"{'top': showKeypad ? '0': '-70px'}\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"material-symbols-outlined\" (click)=\"toggleKeypad()\"> transition_dissolve </span>\n </button>\n </div>\n <!-- <div class=\"mt-2 px-3 call-info-wrapper \" [ngClass]=\"{'open-collops': isCollops}\">\n <div class=\"text-center\" >\n <i class=\"fa fa-angle-down\" *ngIf=\"isCollops\" (click)=\"isCollops = !isCollops\"></i>\n <i class=\"fa fa-angle-up\" *ngIf=\"!isCollops\" (click)=\"isCollops = !isCollops\"></i>\n </div>\n <ng-container *ngIf=\"isCollops\">\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div >First Name:</div>\n <div >test ttttt</div>\n </div>\n <div class=\"col-6\">\n <div>Last Name:</div>\n <div>tetst test </div>\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"\">Email:</div>\n <div class=\"\">abcdeft@vgroup.com</div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div class=\"\">Number:</div>\n <div class=\"\">63545985264225</div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Language:</div>\n <div class=\"\">English</div>\n </div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div class=\"\">Image :</div>\n <div class=\"\">test.jpg </div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Extension :</div>\n <div class=\"\">4596</div>\n </div>\n </div>\n <div class=\" mb-2\">\n <div class=\"\">Note :</div>\n <div class=\"\">tes test test </div>\n </div>\n <div class=\" mb-2\">\n <div class=\"\">\n <div class=\"\">Subject:</div>\n <div class=\"\">hello world | test</div>\n </div>\n </div>\n <div class=\" mb-4\">\n <div class=\"\">\n <div class=\"\">Message:</div>\n <div class=\"\">test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test </div>\n </div>\n </div>\n </ng-container>\n </div> -->\n </div>\n\n <div class=\"wave-container\">\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\">\n <defs>\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\n </defs>\n <g class=\"parallax\">\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" />\n <!-- <use\n xlink:href=\"#gentle-wave\"\n x=\"48\"\n y=\"5\"\n fill=\"rgba(255,255,255,0.3)\"\n /> -->\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\n </g>\n </svg>\n </div>\n</div>\n\n<div class=\"min-call-container\" *ngIf=\"isMinimised\">\n <span class=\"material-symbols-outlined fullscreen\" (click)=\"maximiseDialpad()\"> open_in_full </span>\n <div style=\"display: flex; width: 100%\">\n <div>\n <div class=\"min-call-animation\" id=\"call-avatar\">\n <img class=\"min-avatar-img\" [src]=\"callData.img\" alt=\"\" />\n </div>\n </div>\n <div>\n <div class=\"min-callerDetails\">\n <div class=\"name\">\n {{callData.name}}\n </div>\n <p style=\"margin: 0\">{{callData.displayNum ? callData.displayNum : callData.phone }}</p>\n </div>\n </div>\n </div>\n <div class=\"min-btn-container\">\n <div class=\"min-timer\">{{timer}}</div>\n <button class=\"min-call-sec-btn\" (click)=\"toggleMute()\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"min-call-btn end-call-btn\" [disabled]=\"disbaleEndCallBtn\" (click)=\"endCall()\">\n <span class=\"material-symbols-outlined\"> call_end </span>\n </button>\n </div>\n</div>", styles: [".call-container{width:385px;height:646px;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{height:660px!important}.incoming-call-container{width:752px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto 0;border-radius:100%;border:solid 4px #fff;display:flex;align-items:center;justify-content:center}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.call-animation-play{animation:play 3s linear infinite}.call-info-wrapper{height:20px;overflow-y:auto;background:white;transition:height 1s}.open-collops{height:180px!important}.avatar-img{width:94px;height:94px;border-radius:100%}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{width:230px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:12px 0 0;color:#fff;text-transform:capitalize;text-align:center}.callerDetails h4{margin:0;color:#fff}.callerDetails p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:60px;height:60px;background-color:#fff;border-radius:30px;box-sizing:border-box;border:2px solid white;margin:0 16px}.end-call-btn{background-color:#e14e4e}.end-call-btn span{color:#fff!important}.call-btn span{color:#234de8}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.call-action-btns{text-align:center}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.sendDigit{position:relative;text-align:center;width:80%;margin:auto;background-color:#ffffff1a;padding:2px 0;border-radius:3px}.input-clear-btn{position:absolute;right:6px;color:#fff;cursor:pointer}#minimize-btn-div{position:absolute;right:14px;top:12px;z-index:10}.minimize-btn{color:#fff;cursor:pointer}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}app-incoming-call{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1001}.min-call-container{width:320px;height:124px;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;flex-direction:column;box-sizing:border-box;position:relative;overflow:hidden;margin:auto;align-items:center;padding:12px 16px;color:#fff}.min-call-animation{background:#fff;width:48px;height:48px;position:relative;margin:0 12px 0 auto;border-radius:100%;border:solid 2px #fff}.min-avatar-img{width:46px;height:46px;border-radius:100%;position:absolute;left:0;top:0}.min-callerDetails{color:#fff;display:flex;flex-direction:column;align-items:flex-start}.name{width:170px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:20px;margin:0;color:#fff}.min-callerDetails p{margin:0;color:#fff}.min-btn-container{position:relative;display:flex;width:100%;justify-content:flex-start;align-items:center;margin-top:6px}.min-call-sec-btn{width:40px;height:40px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:20px;display:flex;align-items:center;justify-content:center;margin-right:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.min-call-sec-btn span{color:#cccbcb}.min-call-btn{width:40px;height:40px;border-radius:20px;box-sizing:border-box;border:2px solid white;display:flex;align-items:center;justify-content:center}.fullscreen{position:absolute;right:18px;top:14px;color:#e8e8e8;font-size:18px;cursor:pointer}.btn-container{display:flex;flex-wrap:wrap;padding:0 24px}.dial-btn{width:40px;height:40px;background-color:transparent;text-align:center;box-sizing:border-box;margin:4px 25px;font-size:24px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#b5b5b5;cursor:pointer}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.min-timer{width:50px;font-size:18px;margin-right:10px;border-radius:4px;height:35px;display:flex;align-items:center}.record-action-btns{display:flex;flex-direction:column;align-items:center}.record-btn-container{position:relative}.record-btn{border:none;border-radius:50%;width:50px;height:50px;display:flex;align-items:center;justify-content:center;cursor:pointer;margin:0 5px;position:relative;overflow:hidden}.record-btn.start-stop .recording-icon{width:50%;height:50%;border-radius:50%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.record-btn.start-stop.recording .recording-icon{background-color:#000}.record-btn.start-stop.recording{border:3px solid #000}.record-btn.start-stop.stopped .recording-icon{background-color:red;border:3px solid #ff0000;border-radius:50%;position:absolute}.record-btn.start-stop.stopped{border:3px solid #ff0000}.record-btn.start-stop.stopped .recording-icon{width:40%;height:40%;border-radius:0;background-color:red}.pause-resume-btns{display:flex;flex-direction:column;align-items:center;margin-top:10px}.record-btn.pause-resume{border:none;border-radius:50%;width:50px;height:50px;background:white;display:flex;align-items:center;justify-content:center;margin:5px 0}.record-btn.pause-resume .material-symbols-outlined{font-size:20px;color:#000}.timer-display{font-size:1.2em;margin-top:10px;color:#000}.w-40{width:40%}.w-60{width:60%}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { 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.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "component", type: IncomingCallComponent, selector: "lib-incoming-call", inputs: ["incomingCallData", "newIncomingCallsList"], outputs: ["closeIncomingCallDiv", "incomingCallsNewList", "selectedIncomingCallInfo"] }] });
2032
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallProgressComponent, decorators: [{
2033
+ type: Component,
2034
+ args: [{ selector: 'lib-call-progress', template: "<div class=\"call-container\" *ngIf=\"!isMinimised\" [ngClass]=\"{'collops': isCollops, 'incoming-call-container': selectedIncomingCall?.isClickExpand}\">\n <div id=\"minimize-btn-div\">\n <span class=\"material-symbols-outlined minimize-btn\" (click)=\"minimiseDialpad()\">\n minimize\n </span>\n </div>\n <lib-incoming-call *ngIf=\"incomingCallDiv\" [incomingCallData]=\"callData\" [newIncomingCallsList]=\"newIncomingCallsList\" (closeIncomingCallDiv)=\"closeIncomingCall($event)\" \n (incomingCallsNewList)=\"incomingCallsNewList($event)\" (selectedIncomingCallInfo)=\"selectedIncomingCallInfo($event)\"></lib-incoming-call>\n <div style=\"display: flex; flex-direction: column;position: relative; width: 100%;\">\n \n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\n <img class=\"avatar-img\" [src]=\"callData.img\" alt=\"\" width=\"120\" />\n </div>\n <div class=\"callerDetails\">\n <h1 [ngStyle]=\"{'margin-top': showKeypad ? '0': '8px'}\">{{callData.name}}</h1>\n <p>{{callData.displayNum ? callData.displayNum : callData.phone }}</p>\n <h4 style=\"margin-top: 4px\">{{timer}}</h4>\n </div>\n <div class=\"record-action-btns\" [ngStyle]=\"{'margin-top': showKeypad ? '0': '20px'}\">\n <div class=\"record-btn-container\">\n <button class=\"record-btn start-stop\" *ngIf=\"!isRecording\" [ngClass]=\"{'recording': isRecording, 'stopped': !isRecording}\" (click)=\"toggleRecording()\" [title]=\"isRecording ? 'Stop Recording' : 'Start Recording'\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"recording-icon\"></span>\n </button>\n <div class=\"pause-resume-btns\">\n <button class=\"record-btn pause-resume\" *ngIf=\"isRecording && !isPaused\" (click)=\"pauseRecording()\">\n <span class=\"material-symbols-outlined\"> pause </span>\n </button>\n <button class=\"record-btn pause-resume\" *ngIf=\"isPaused\" (click)=\"resumeRecording()\">\n <span class=\"material-symbols-outlined\"> play_arrow </span>\n </button>\n </div>\n </div>\n <div *ngIf=\"isRecording\" class=\"timer-display\">\n {{ getFormattedTime() }}\n </div>\n </div>\n <div *ngIf=\"showKeypad\" class=\"sendDigit\">\n <input type=\"text\" name=\"call-inputs\" id=\"call-input\" [(ngModel)]=\"callInput\" (keyup)=\"onCallInputEnter($event)\">\n <span class=\"material-symbols-outlined input-clear-btn\" *ngIf=\"callInput\" (click)=\"clearInputs()\">close_small</span>\n </div>\n <div class=\"btn-container justify-content-center\" *ngIf=\"showKeypad\">\n <div class=\"key-btn\" *ngFor=\"let key of keypadVal\" (click)=\"onCallInputs(key.num)\">\n {{key.num}}\n <span class=\"btn-albhabets\">{{key.text ? key.text : '&nbsp;'}}</span>\n </div>\n </div>\n <div class=\"call-action-btns\" [ngStyle]=\"{'margin-top': showKeypad ? '0': '160px'}\">\n <button class=\"call-sec-btn\" [disabled]=\"disbaleEndCallBtn\" [ngStyle]=\"{'top': showKeypad ? '0': '-70px'}\" (click)=\"toggleMute()\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n\n </button>\n <button class=\"call-btn end-call-btn\" [disabled]=\"disbaleEndCallBtn\" (click)=\"endCall()\">\n <span class=\"material-symbols-outlined\"> call_end </span>\n </button>\n <button class=\"call-sec-btn\" [ngStyle]=\"{'top': showKeypad ? '0': '-70px'}\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"material-symbols-outlined\" (click)=\"toggleKeypad()\"> transition_dissolve </span>\n </button>\n </div>\n <!-- <div class=\"mt-2 px-3 call-info-wrapper \" [ngClass]=\"{'open-collops': isCollops}\">\n <div class=\"text-center\" >\n <i class=\"fa fa-angle-down\" *ngIf=\"isCollops\" (click)=\"isCollops = !isCollops\"></i>\n <i class=\"fa fa-angle-up\" *ngIf=\"!isCollops\" (click)=\"isCollops = !isCollops\"></i>\n </div>\n <ng-container *ngIf=\"isCollops\">\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div >First Name:</div>\n <div >test ttttt</div>\n </div>\n <div class=\"col-6\">\n <div>Last Name:</div>\n <div>tetst test </div>\n </div>\n </div>\n <div class=\"mb-2\">\n <div class=\"\">Email:</div>\n <div class=\"\">abcdeft@vgroup.com</div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div class=\"\">Number:</div>\n <div class=\"\">63545985264225</div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Language:</div>\n <div class=\"\">English</div>\n </div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6\">\n <div class=\"\">Image :</div>\n <div class=\"\">test.jpg </div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Extension :</div>\n <div class=\"\">4596</div>\n </div>\n </div>\n <div class=\" mb-2\">\n <div class=\"\">Note :</div>\n <div class=\"\">tes test test </div>\n </div>\n <div class=\" mb-2\">\n <div class=\"\">\n <div class=\"\">Subject:</div>\n <div class=\"\">hello world | test</div>\n </div>\n </div>\n <div class=\" mb-4\">\n <div class=\"\">\n <div class=\"\">Message:</div>\n <div class=\"\">test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test test </div>\n </div>\n </div>\n </ng-container>\n </div> -->\n </div>\n\n <div class=\"wave-container\">\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\">\n <defs>\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\n </defs>\n <g class=\"parallax\">\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" />\n <!-- <use\n xlink:href=\"#gentle-wave\"\n x=\"48\"\n y=\"5\"\n fill=\"rgba(255,255,255,0.3)\"\n /> -->\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\n </g>\n </svg>\n </div>\n</div>\n\n<div class=\"min-call-container\" *ngIf=\"isMinimised\">\n <span class=\"material-symbols-outlined fullscreen\" (click)=\"maximiseDialpad()\"> open_in_full </span>\n <div style=\"display: flex; width: 100%\">\n <div>\n <div class=\"min-call-animation\" id=\"call-avatar\">\n <img class=\"min-avatar-img\" [src]=\"callData.img\" alt=\"\" />\n </div>\n </div>\n <div>\n <div class=\"min-callerDetails\">\n <div class=\"name\">\n {{callData.name}}\n </div>\n <p style=\"margin: 0\">{{callData.displayNum ? callData.displayNum : callData.phone }}</p>\n </div>\n </div>\n </div>\n <div class=\"min-btn-container\">\n <div class=\"min-timer\">{{timer}}</div>\n <button class=\"min-call-sec-btn\" (click)=\"toggleMute()\" [disabled]=\"disbaleEndCallBtn\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"min-call-btn end-call-btn\" [disabled]=\"disbaleEndCallBtn\" (click)=\"endCall()\">\n <span class=\"material-symbols-outlined\"> call_end </span>\n </button>\n </div>\n</div>", styles: [".call-container{width:385px;height:646px;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{height:660px!important}.incoming-call-container{width:752px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto 0;border-radius:100%;border:solid 4px #fff;display:flex;align-items:center;justify-content:center}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.call-animation-play{animation:play 3s linear infinite}.call-info-wrapper{height:20px;overflow-y:auto;background:white;transition:height 1s}.open-collops{height:180px!important}.avatar-img{width:94px;height:94px;border-radius:100%}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{width:230px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:12px 0 0;color:#fff;text-transform:capitalize;text-align:center}.callerDetails h4{margin:0;color:#fff}.callerDetails p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:60px;height:60px;background-color:#fff;border-radius:30px;box-sizing:border-box;border:2px solid white;margin:0 16px}.end-call-btn{background-color:#e14e4e}.end-call-btn span{color:#fff!important}.call-btn span{color:#234de8}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.call-action-btns{text-align:center}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.sendDigit{position:relative;text-align:center;width:80%;margin:auto;background-color:#ffffff1a;padding:2px 0;border-radius:3px}.input-clear-btn{position:absolute;right:6px;color:#fff;cursor:pointer}#minimize-btn-div{position:absolute;right:14px;top:12px;z-index:10}.minimize-btn{color:#fff;cursor:pointer}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}app-incoming-call{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1001}.min-call-container{width:320px;height:124px;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;flex-direction:column;box-sizing:border-box;position:relative;overflow:hidden;margin:auto;align-items:center;padding:12px 16px;color:#fff}.min-call-animation{background:#fff;width:48px;height:48px;position:relative;margin:0 12px 0 auto;border-radius:100%;border:solid 2px #fff}.min-avatar-img{width:46px;height:46px;border-radius:100%;position:absolute;left:0;top:0}.min-callerDetails{color:#fff;display:flex;flex-direction:column;align-items:flex-start}.name{width:170px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:20px;margin:0;color:#fff}.min-callerDetails p{margin:0;color:#fff}.min-btn-container{position:relative;display:flex;width:100%;justify-content:flex-start;align-items:center;margin-top:6px}.min-call-sec-btn{width:40px;height:40px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:20px;display:flex;align-items:center;justify-content:center;margin-right:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.min-call-sec-btn span{color:#cccbcb}.min-call-btn{width:40px;height:40px;border-radius:20px;box-sizing:border-box;border:2px solid white;display:flex;align-items:center;justify-content:center}.fullscreen{position:absolute;right:18px;top:14px;color:#e8e8e8;font-size:18px;cursor:pointer}.btn-container{display:flex;flex-wrap:wrap;padding:0 24px}.dial-btn{width:40px;height:40px;background-color:transparent;text-align:center;box-sizing:border-box;margin:4px 25px;font-size:24px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#b5b5b5;cursor:pointer}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.min-timer{width:50px;font-size:18px;margin-right:10px;border-radius:4px;height:35px;display:flex;align-items:center}.record-action-btns{display:flex;flex-direction:column;align-items:center}.record-btn-container{position:relative}.record-btn{border:none;border-radius:50%;width:50px;height:50px;display:flex;align-items:center;justify-content:center;cursor:pointer;margin:0 5px;position:relative;overflow:hidden}.record-btn.start-stop .recording-icon{width:50%;height:50%;border-radius:50%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.record-btn.start-stop.recording .recording-icon{background-color:#000}.record-btn.start-stop.recording{border:3px solid #000}.record-btn.start-stop.stopped .recording-icon{background-color:red;border:3px solid #ff0000;border-radius:50%;position:absolute}.record-btn.start-stop.stopped{border:3px solid #ff0000}.record-btn.start-stop.stopped .recording-icon{width:40%;height:40%;border-radius:0;background-color:red}.pause-resume-btns{display:flex;flex-direction:column;align-items:center;margin-top:10px}.record-btn.pause-resume{border:none;border-radius:50%;width:50px;height:50px;background:white;display:flex;align-items:center;justify-content:center;margin:5px 0}.record-btn.pause-resume .material-symbols-outlined{font-size:20px;color:#000}.timer-display{font-size:1.2em;margin-top:10px;color:#000}.w-40{width:40%}.w-60{width:60%}\n"] }]
2035
+ }], ctorParameters: function () { return [{ type: ExtensionService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { callData: [{
2036
+ type: Input
2037
+ }], newIncomingCallData: [{
2038
+ type: Input
2039
+ }], newIncomingCallsList: [{
2040
+ type: Input
2041
+ }], endCallEvent: [{
2042
+ type: Output
2043
+ }], incomingCallsNewInfo: [{
2044
+ type: Output
2045
+ }], minimiseEvent: [{
2046
+ type: Output
2047
+ }], showCallProgressEvent: [{
2048
+ type: Output
2049
+ }], incomingCallInitiated: [{
2050
+ type: Output
2051
+ }] } });
2052
+
2053
+ class DialboxComponent {
2054
+ constructor(twilioService, extService,
2055
+ // private dialog: MatDialog,
2056
+ ipService, extensionService, router) {
2057
+ this.twilioService = twilioService;
2058
+ this.extService = extService;
2059
+ this.ipService = ipService;
2060
+ this.extensionService = extensionService;
2061
+ this.router = router;
2062
+ this.isDialpadHidden = false;
2063
+ this.closeDialpadEvent = new EventEmitter();
2064
+ this.callInitiated = new EventEmitter();
2065
+ this.endCallEvent = new EventEmitter();
2066
+ this.minimiseEvent = new EventEmitter();
2067
+ this.incomingCallsNewInfoEvent = new EventEmitter();
2068
+ this.incomingCallInitiated = new EventEmitter();
2069
+ this.numberDialed = new EventEmitter();
2070
+ this.isCallInProgress = false;
2071
+ this.keypadVal = keypad;
2072
+ this.showInputClearBtn = false;
2073
+ this.dialedNumber = '';
2074
+ this.contactList = [];
2075
+ this.filteredContactList = [];
2076
+ this.callerIdList = [];
2077
+ this.isCallerIdHidden = true;
2078
+ this.isTrialPeriodOver = false;
2079
+ this.isPaymentDue = false;
2080
+ this.terminateCall = false;
2081
+ this.toastTimeout = 7000;
2082
+ this.callNumberToast = {
2083
+ show: false,
2084
+ type: 'alert-success',
2085
+ number: '',
2086
+ displayNum: ''
2087
+ };
2088
+ this.callData = {
2089
+ phone: '',
2090
+ displayNum: '',
2091
+ dial: false,
2092
+ name: '',
2093
+ img: 'assets/images/user.jpg',
2094
+ isIncomingCall: false,
2095
+ extNum: ''
2096
+ };
2097
+ this.lastDialed = null;
2149
2098
  this.dialAlert = {
2150
- msg: message,
2151
- show: true
2099
+ msg: '',
2100
+ show: false
2152
2101
  };
2153
- setTimeout(() => {
2154
- this.dialAlert.show = false;
2155
- }, 3000);
2156
- }
2157
- isCallerIdSet() {
2158
- return __awaiter(this, void 0, void 0, function* () {
2159
- try {
2160
- const tkn = localStorage.getItem('ext_token');
2161
- const res = yield this.extService.fetchCallerId(tkn || '').toPromise();
2162
- if (res.status == 200) {
2163
- localStorage.setItem('trialOver', res.trialOver);
2164
- this.twilioService.isTrialOver.next(res.trialOver);
2165
- localStorage.setItem('paymentDue', res.paymentDue);
2166
- this.twilioService.isPaymentDue.next(res.paymentDue);
2167
- }
2168
- if (res.callerid) {
2169
- localStorage.setItem('callerID', res.callerid);
2170
- this.extService.changeMessage(res.callerid);
2171
- }
2172
- else {
2173
- localStorage.setItem('callerID', 'Not set');
2174
- this.extService.changeMessage('Not set');
2175
- }
2176
- return (localStorage.getItem('callerID') !== 'Not set');
2177
- }
2178
- catch (e) {
2179
- console.log(e);
2180
- return false;
2181
- }
2182
- });
2102
+ this.showDedicatedPopup = false;
2103
+ this.newIncomingCalls = [];
2104
+ this.incomingCallsList = [];
2105
+ this.subscriptions = new Subscription();
2106
+ this.shakeDedicatedBtn = false;
2107
+ this.isSmartDialCall = false;
2108
+ this.isMinimised = false;
2183
2109
  }
2184
- checkMicrophonePermission() {
2185
- return __awaiter(this, void 0, void 0, function* () {
2186
- try {
2187
- const stream = yield navigator.mediaDevices.getUserMedia({ audio: true });
2188
- stream.getTracks().forEach(track => track.stop());
2189
- return true;
2190
- }
2191
- catch (error) {
2192
- if (error instanceof DOMException && error.name === 'NotAllowedError') {
2193
- return false;
2194
- }
2195
- else {
2196
- return false;
2110
+ ngOnInit() {
2111
+ try {
2112
+ this.token = localStorage.getItem('ext_token');
2113
+ //this.isCallInProgress = true;
2114
+ this.getContactList();
2115
+ // this.getUserCallSetting();
2116
+ const sub1 = this.twilioService.dialNumberFromOtherModule.subscribe((contact) => {
2117
+ if (contact.number) {
2118
+ this.isSmartDialCall = false;
2119
+ if (contact.isDialFromHistory) {
2120
+ //handle dialing from history page
2121
+ if (contact.callerId == 'smartDialing') {
2122
+ this.selectedCallerId = { number: contact.from };
2123
+ this.isSmartDialCall = true;
2124
+ setTimeout(() => {
2125
+ this.isDialpadHidden = false;
2126
+ }, 2000);
2127
+ this.callData.phone = contact.number;
2128
+ this.callData.name = contact.name;
2129
+ this.callData.img = contact.img;
2130
+ this.callData.from = contact.from;
2131
+ this.sanitizedNum = contact.number;
2132
+ // this.getUserInformation(contact);
2133
+ // this.incomingCallsList.push(contact)
2134
+ this.initiateCall();
2135
+ }
2136
+ else {
2137
+ // this.getUserCallSetting();
2138
+ setTimeout(() => {
2139
+ this.isDialpadHidden = false;
2140
+ }, 1000);
2141
+ // this.getUserInformation(contact);
2142
+ // this.incomingCallsList.push(contact)
2143
+ this.dialedNumber = contact.number;
2144
+ this.sanitizedNum = contact.number;
2145
+ }
2146
+ }
2147
+ else {
2148
+ if (contact.callerId == 'alwaysAsk' || contact.callerId == 'smartDialing') {
2149
+ // this.getUserCallSetting();
2150
+ setTimeout(() => {
2151
+ this.isDialpadHidden = false;
2152
+ }, 1000);
2153
+ this.dialedNumber = contact.number;
2154
+ this.sanitizedNum = contact.number;
2155
+ }
2156
+ else {
2157
+ setTimeout(() => {
2158
+ this.isDialpadHidden = false;
2159
+ }, 2000);
2160
+ this.callData.phone = contact.number;
2161
+ this.callData.name = contact.name;
2162
+ this.callData.img = contact.img;
2163
+ this.sanitizedNum = contact.number;
2164
+ this.initiateCall();
2165
+ }
2166
+ }
2197
2167
  }
2198
- }
2199
- });
2200
- }
2201
- askForMicrophonePermission() {
2202
- return __awaiter(this, void 0, void 0, function* () {
2203
- try {
2204
- const stream = yield navigator.mediaDevices.getUserMedia({ audio: true });
2205
- stream.getTracks().forEach(track => track.stop());
2206
- }
2207
- catch (error) {
2208
- console.error('User denied microphone permission:', error);
2209
- }
2210
- });
2211
- }
2212
- // below function is to get the country code with number from server
2213
- getToNumber(dialedNumber) {
2214
- return __awaiter(this, void 0, void 0, function* () {
2215
- if (dialedNumber[0] !== '+') {
2216
- // this is case when user geolocation dial code is on
2217
- let ipAddress = yield this.ipService.getIpAddressInfo().toPromise();
2218
- const res = yield this.twilioService.getToNumber(dialedNumber, ipAddress.address.countryCode).toPromise();
2219
- if (res.status == 200) {
2220
- this.toastTimeout = res.timeInterval * 1000;
2221
- yield this.showNumberToast(res);
2168
+ });
2169
+ // handle incoming call
2170
+ const sub2 = this.twilioService.currentCall.subscribe(incomingCallData => {
2171
+ // if (incomingCallData) {
2172
+ // this.isCallInProgress = true;
2173
+ // this.isDialpadHidden = false;
2174
+ // this.callData.phone = incomingCallData.parameters.From;
2175
+ // this.callData.name = incomingCallData.customParameters.get('name');
2176
+ // this.callData.img = incomingCallData.customParameters.get('image');
2177
+ // this.callData.isIncomingCall = true;
2178
+ // }
2179
+ if (incomingCallData) {
2180
+ if (this.isCallInProgress) {
2181
+ this.newIncomingCalls.push(incomingCallData);
2182
+ // this.getUserInformation(incomingCallData);
2183
+ }
2184
+ else {
2185
+ this.isCallInProgress = true;
2186
+ this.isDialpadHidden = false;
2187
+ this.callData.phone = incomingCallData.parameters['From'];
2188
+ // this.getUserInformation(incomingCallData);
2189
+ this.callData.name = incomingCallData.customParameters.get('name');
2190
+ this.callData.img = incomingCallData.customParameters.get('image') || 'assets/images/user.jpg';
2191
+ this.callData.isIncomingCall = true;
2192
+ }
2193
+ incomingCallData.on('cancel', () => {
2194
+ // this.incomingCallsList = this.incomingCallsList.filter((item:any) => item.parameters.CallSid !== incomingCallData.parameters.CallSid);
2195
+ if (this.incomingCallsList.length == 0) {
2196
+ this.isCallInProgress = false;
2197
+ }
2198
+ });
2199
+ incomingCallData.on('disconnect', () => {
2200
+ // this.incomingCallsList = this.incomingCallsList.filter((item:any) => item.parameters.CallSid !== incomingCallData.parameters.CallSid);
2201
+ if (this.incomingCallsList.length == 0) {
2202
+ this.isCallInProgress = false;
2203
+ }
2204
+ });
2222
2205
  }
2223
- }
2224
- });
2225
- }
2226
- isAlertEnable() {
2227
- return localStorage.getItem('isAlertEnable');
2228
- }
2229
- showNumberToast(data) {
2230
- return __awaiter(this, void 0, void 0, function* () {
2231
- const isAlertOn = (localStorage.getItem('isCountryCodeToastOn'));
2232
- if (isAlertOn == 'true') {
2233
- this.callNumberToast.show = true;
2234
- this.callNumberToast.number = data.toNumber;
2235
- this.callNumberToast.displayNum = data.displayNumber;
2236
- }
2237
- this.callData.displayNum = data.displayNumber;
2238
- //this.callData.phone = data.toNumber;
2239
- yield this.delay(this.toastTimeout);
2240
- this.dialedNumber = data.toNumber;
2241
- this.sanitizedNum = data.toNumber;
2242
- this.callNumberToast.show = false;
2243
- this.callNumberToast.number = '';
2244
- this.callNumberToast.displayNum = '';
2245
- });
2206
+ });
2207
+ this.subscriptions.add(sub1);
2208
+ this.subscriptions.add(sub2);
2209
+ }
2210
+ catch (e) {
2211
+ console.log(e);
2212
+ }
2246
2213
  }
2247
- delay(ms) {
2248
- return new Promise(resolve => setTimeout(resolve, ms));
2214
+ // getUserInformation(incomingCallData: any) {
2215
+ // let data = this.fromEntries(Array.from(incomingCallData.customParameters.entries()));
2216
+ // this.extensionService.getUserInformation(data.twilioAuthId).subscribe(
2217
+ // response => {
2218
+ // incomingCallData['userInfo']=response
2219
+ // this.incomingCallsList.push(incomingCallData);
2220
+ // }, error => {
2221
+ // console.error('Error starting recording', error);
2222
+ // });
2223
+ // }
2224
+ fromEntries(entries) {
2225
+ return entries.reduce((acc, [key, value]) => {
2226
+ acc[key] = value;
2227
+ return acc;
2228
+ }, {});
2249
2229
  }
2250
- onMinimise(isMinimised) {
2251
- this.isMinimised = isMinimised;
2252
- this.minimiseEvent.emit(isMinimised);
2230
+ ngAfterViewInit() {
2231
+ this.registerDragElement();
2253
2232
  }
2254
- handleNumberPaste(event) {
2255
- event.preventDefault();
2256
- const clipboardData = event.clipboardData || window.clipboardData;
2257
- const pastedData = clipboardData.getData('text');
2258
- // Log the pasted content to the console
2259
- if (pastedData) {
2260
- this.dialedNumber = pastedData;
2261
- this.sanitizedNum = pastedData;
2233
+ ngOnChanges(changes) {
2234
+ if (changes['isDialpadHidden'] && !this.isDialpadHidden) {
2235
+ this.getContactList();
2236
+ // this.getUserCallSetting();
2237
+ setTimeout(() => {
2238
+ this.dialInputElement.nativeElement.focus();
2239
+ }, 0);
2262
2240
  }
2263
2241
  }
2264
- onEnter(num) {
2265
- console.log(num, 'number fn');
2266
- this.dialedNumber = this.dialedNumber + num;
2267
- this.sanitizedNum = this.dialedNumber;
2268
- this.showInputClearBtn = true;
2269
- this.numberDialed.emit(this.dialedNumber);
2242
+ registerDragElement() {
2243
+ try {
2244
+ const elmnt = document.getElementById('dragparent1');
2245
+ let pos1 = 0, pos2 = 0, pos3 = 0, pos4 = 0;
2246
+ const dragMouseDown = (e) => {
2247
+ // If the target is an input, return and don't initiate dragging
2248
+ if (e.target.tagName.toLowerCase() === 'input') {
2249
+ return;
2250
+ }
2251
+ e = e || window.event;
2252
+ // get the mouse cursor position at startup:
2253
+ pos3 = e.clientX;
2254
+ pos4 = e.clientY;
2255
+ document.onmouseup = closeDragElement;
2256
+ // call a function whenever the cursor moves:
2257
+ document.onmousemove = elementDrag;
2258
+ };
2259
+ const elementDrag = (e) => {
2260
+ e = e || window.event;
2261
+ // calculate the new cursor position:
2262
+ pos1 = pos3 - e.clientX;
2263
+ pos2 = pos4 - e.clientY;
2264
+ pos3 = e.clientX;
2265
+ pos4 = e.clientY;
2266
+ // set the element's new position:
2267
+ // elmnt.style.top = elmnt.offsetTop - pos2 + 'px';
2268
+ // elmnt.style.left = elmnt.offsetLeft - pos1 + 'px';
2269
+ };
2270
+ const closeDragElement = () => {
2271
+ /* stop moving when mouse button is released:*/
2272
+ document.onmouseup = null;
2273
+ document.onmousemove = null;
2274
+ };
2275
+ // if (document.getElementById(elmnt.id + 'header')) {
2276
+ // /* if present, the header is where you move the DIV from:*/
2277
+ // document.getElementById(elmnt.id + 'header').onmousedown = dragMouseDown;
2278
+ // } else {
2279
+ // /* otherwise, move the DIV from anywhere inside the DIV:*/
2280
+ // elmnt.onmousedown = dragMouseDown;
2281
+ // }
2282
+ }
2283
+ catch (e) {
2284
+ console.log(e);
2285
+ }
2270
2286
  }
2271
- getUserCallSetting() {
2272
- const tkn = localStorage.getItem('ext_token');
2273
- this.extService.fetchCallerId(tkn || '').subscribe((resp) => {
2274
- if (resp.status == 200) {
2275
- //this.callPrefernce = resp.userSetting;
2276
- this.callPreference = resp.callerid;
2277
- this.getCallerIdList();
2287
+ addNumber(num) {
2288
+ if (num == '#' || num == '*' || num == '+' || Number.isInteger(num)) {
2289
+ if (num == '#') {
2290
+ new Audio(`/assets/dial-tones/dtmf/dtmf-hash-.mp3`).play();
2278
2291
  }
2279
- });
2280
- }
2281
- onDedicatedNumSelect(id) {
2282
- this.selectedCallerId = id;
2283
- this.isCallerIdHidden = true;
2284
- this.extService.setCallerId(id);
2285
- }
2286
- cancelDialNumber() {
2287
- this.terminateCall = true;
2288
- this.callNumberToast.show = false;
2289
- }
2290
- handleDivKeydown(ev) {
2291
- if (this.dialedNumber.length == 0) {
2292
- this.dialInputElement.nativeElement.focus();
2293
- }
2294
- if (ev.key === 'Enter') {
2295
- // Check if the dialpad is open
2296
- if (!this.isDialpadHidden) {
2297
- if (this.dialedNumber.length > 2 && this.selectedCallerId) {
2298
- this.initiateCall();
2299
- }
2300
- if (!this.selectedCallerId) {
2301
- this.shakeDedicatedBtn = true;
2302
- setTimeout(() => {
2303
- this.shakeDedicatedBtn = false;
2304
- }, 10000);
2305
- }
2292
+ else if (num == '*') {
2293
+ new Audio(`/assets/dial-tones/dtmf/dtmf-star-.mp3`).play();
2294
+ }
2295
+ else {
2296
+ new Audio(`/assets/dial-tones/dtmf/dtmf-${num}-.mp3`).play();
2306
2297
  }
2298
+ this.dialedNumber += num;
2299
+ this.showInputClearBtn = true;
2300
+ this.numberDialed.emit(this.dialedNumber);
2301
+ this.onDialInputChange(this.dialedNumber);
2302
+ // this.dialInputRef.nativeElement.focus();
2307
2303
  }
2308
- }
2309
- onCallBtnMouseEnter(ev) {
2310
- if (!this.selectedCallerId || (this.selectedCallerId == 'alwaysAsk') || (this.selectedCallerId == 'smartDialing')) {
2311
- this.shakeDedicatedBtn = true;
2312
- }
2313
- }
2314
- onCallBtnMouseLeave(ev) {
2315
- if (!this.selectedCallerId || (this.selectedCallerId == 'alwaysAsk') || (this.selectedCallerId == 'smartDialing')) {
2316
- this.shakeDedicatedBtn = false;
2304
+ else if (num === 'voicemail') {
2305
+ // this.showDedicatedPopup = true;
2306
+ this.router.navigate(['extension/voicemail/' + this.token]);
2317
2307
  }
2318
2308
  }
2319
- acceptNewIncomingCall(call) {
2320
- //first cut the current call
2321
- //this.callData = call;
2322
- this.newIncomingCallData = call;
2323
- }
2324
- rejectNewIncomingCall(call) {
2325
- call.reject();
2326
- this.newIncomingCalls = this.newIncomingCalls.filter((item) => item.parameters['CallSid'] !== call.parameters['CallSid']);
2327
- this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== call.parameters['CallSid']);
2328
- }
2329
- newIncomingCallInitiated() {
2330
- this.isCallInProgress = true;
2331
- this.newIncomingCalls = [];
2332
- this.incomingCallInitiated.emit();
2333
- }
2334
- incomingCallsNewInfo(data) {
2335
- this.incomingCallsList = data;
2336
- this.incomingCallsNewInfoEvent.emit(data);
2309
+ hideDialpad() {
2310
+ this.isDialpadHidden = true;
2311
+ this.closeDialpadEvent.emit();
2312
+ this.clearAllDialed();
2313
+ this.filteredContactList = [];
2337
2314
  }
2338
- ngOnDestroy() {
2315
+ onDialInputChange(inputVal) {
2339
2316
  try {
2340
- console.log('Cleaning up C2cDialpadComponent');
2341
- // Unsubscribe from all subscriptions
2342
- if (this.subscriptions) {
2343
- this.subscriptions.unsubscribe();
2317
+ // Updated regex to include x, X, ext., Ext., and ,
2318
+ const isNumericInput = /^[\d\s+\-]+$/.test(inputVal);
2319
+ let mainNumber = inputVal;
2320
+ // Check for extension indicators and split the input
2321
+ const extMatch = inputVal.match(/(x|X|ext\.|Ext\.|,)(.*)/);
2322
+ if (extMatch) {
2323
+ mainNumber = inputVal.substring(0, extMatch.index).trim();
2324
+ this.callData.extNum = extMatch[2].trim();
2344
2325
  }
2345
- // End any active call
2346
- if (this.isCallInProgress) {
2347
- this.endCall();
2326
+ this.sanitizedNum = isNumericInput ? mainNumber.replace(/[\s\-]+/g, '') : mainNumber;
2327
+ this.callData.phone = isNumericInput ? this.sanitizedNum : '';
2328
+ this.showInputClearBtn = inputVal.length > 0;
2329
+ if (isNumericInput) {
2330
+ this.dialedNumber = new AsYouType().input(this.sanitizedNum);
2348
2331
  }
2349
- // Clear any timeouts or intervals if they exist
2350
- if (this.toastTimeout) {
2351
- clearTimeout(this.toastTimeout);
2332
+ // emit current number whenever input changes
2333
+ this.numberDialed.emit(this.dialedNumber);
2334
+ if (inputVal.length > 2) {
2335
+ this.filteredContactList = this.contactList.filter(contact => {
2336
+ const fullName = `${contact.firstName} ${contact.middleName} ${contact.lastName}`.toLowerCase();
2337
+ // return fullName.includes(this.sanitizedNum.toLowerCase()) || contact.numbersList.some(num => num.number.includes(this.sanitizedNum));
2338
+ }).slice(0, 2);
2339
+ }
2340
+ else {
2341
+ this.filteredContactList = [];
2352
2342
  }
2353
- console.log('C2cDialpadComponent cleanup complete');
2354
2343
  }
2355
- catch (error) {
2356
- console.error('Error during component cleanup:', error);
2344
+ catch (e) {
2345
+ console.log(e);
2357
2346
  }
2358
2347
  }
2359
- }
2360
- DialboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxComponent, deps: [{ token: TwilioService }, { token: ExtensionService }, { token: IpAddressService }, { token: ExtensionService }, { token: i4.Router }], target: i0.ɵɵFactoryTarget.Component });
2361
- DialboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DialboxComponent, selector: "lib-dialbox", inputs: { isDialpadHidden: "isDialpadHidden" }, outputs: { closeDialpadEvent: "closeDialpadEvent", callInitiated: "callInitiated", endCallEvent: "endCallEvent", minimiseEvent: "minimiseEvent", incomingCallsNewInfoEvent: "incomingCallsNewInfoEvent", incomingCallInitiated: "incomingCallInitiated", numberDialed: "numberDialed" }, viewQueries: [{ propertyName: "dialInputElement", first: true, predicate: ["dialInput"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div id=\"dragparent1\" [ngStyle]=\"{'display':isDialpadHidden ? 'none': 'block'}\">\r\n <!-- <app-call-progress *ngIf=\"isCallInProgress\"\r\n (endCallEvent)=\"endCall()\"\r\n (minimiseEvent) = \"onMinimise($event)\"\r\n (incomingCallInitiated)=\"newIncomingCallInitiated()\"\r\n [newIncomingCallData]=\"newIncomingCallData\"\r\n [newIncomingCallsList]=\"incomingCallsList\"\r\n (incomingCallsNewInfo)=\"incomingCallsNewInfo($event)\"\r\n [callData]=\"callData\"></app-call-progress> -->\r\n <div class=\"dialpad-container\" [ngClass]=\"{'mini-dialpad': isMinimised}\" tabindex=\"0\" (keydown)=\"handleDivKeydown($event)\">\r\n <div id=\"topPanel\" [ngStyle]=\"{'height': callerIdList.length ? '40%' : '39%'}\">\r\n <div class=\"dialpad-alerts\" *ngIf=\"dialAlert.show\">\r\n <div class=\"no-selection-alert\">\r\n <!-- <p class=\"mb-0\">Select C2C number to call</p> -->\r\n <p class=\"mb-0\">{{dialAlert.msg}}</p>\r\n <span class=\"fa fa-times\" (click)=\"shakeDedicatedBtn = false\"></span>\r\n </div>\r\n </div>\r\n <div class=\"dialpad-alerts\" *ngIf=\"callNumberToast.show\">\r\n <div class=\"dialbox-pop1 alert fade show\" [ngClass]=\"callNumberToast.type\" role=\"alert\">\r\n <div class=\"d-flex justify-content-between\">\r\n <div class=\"flex-grow-1 my-auto text-left\">\r\n You'r calling <strong>{{callNumberToast.displayNum}}</strong>\r\n </div>\r\n <div class=\"text-right\">\r\n <button class=\"btn btn-link btn-disc p-0 px-1\" (click)=\"cancelDialNumber()\">Cancel Call</button>\r\n <!-- <button class=\"btn btn-link btn-success btn-disc p-0 px-2\">Continue</button> -->\r\n </div>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n <div style=\"padding: 0 18px\" (paste)=\"handleNumberPaste($event)\">\r\n <div class=\"d-flex justify-content-between mt-2\">\r\n <p></p>\r\n <span class=\"material-symbols-outlined dial-close-btn\" (click)=\"hideDialpad()\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#ffffff\"><path d=\"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z\"/></svg>\r\n </span>\r\n </div>\r\n <div class=\"input-box\">\r\n <input type=\"text\" #dialInput placeholder=\"Enter a name or number\" tabindex=\"1\" [(ngModel)]=\"dialedNumber\" (ngModelChange)=\"onDialInputChange($event)\"/>\r\n <span class=\"\" id=\"input-clear-btn\" (click)=\"clearInput()\" *ngIf=\"showInputClearBtn\">\r\n <svg width=\"50px\" height=\"30px\" viewBox=\"0 10 40 60\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" baseProfile=\"full\" enable-background=\"new 0 0 76.00 76.00\" xml:space=\"preserve\">\r\n <path fill=\"#5d6061\" fill-opacity=\"1\" stroke-width=\"0.2\" stroke-linejoin=\"round\" d=\"M 47.5282,42.9497L 42.5784,38L 47.5282,33.0502L 44.9497,30.4718L 40,35.4216L 35.0502,30.4718L 32.4718,33.0502L 37.4216,38L 32.4718,42.9497L 35.0502,45.5282L 40,40.5784L 44.9497,45.5282L 47.5282,42.9497 Z M 18.0147,41.5355L 26.9646,50.4854C 28.0683,51.589 29,52 31,52L 52,52C 54.7614,52 57,49.7614 57,47L 57,29C 57,26.2386 54.7614,24 52,24L 31,24C 29,24 28.0683,24.4113 26.9646,25.5149L 18.0147,34.4645C 16.0621,36.4171 16.0621,39.5829 18.0147,41.5355 Z M 31,49C 30,49 29.6048,48.8828 29.086,48.3641L 20.1361,39.4142C 19.355,38.6332 19.355,37.3669 20.1361,36.5858L 29.086,27.6362C 29.6048,27.1175 30,27 31,27.0001L 52,27.0001C 53.1046,27.0001 54,27.8955 54,29.0001L 54,47.0001C 54,48.1046 53.1046,49.0001 52,49.0001L 31,49 Z \"/>\r\n </svg> \r\n </span>\r\n <span class=\"input-info-icon\" placement=\"bottom-right\" tooltipClass=\"input-tooltip\" ngbTooltip=\"For extension dialing, use formats like +12345678910 x123,+12345678910 ext.123, +12345678910,123\"><i class=\"fa fa-info-circle\"></i></span>\r\n </div>\r\n <div class=\"guide\" *ngIf=\"callerIdList.length && !(dialedNumber.length > 2)\">\r\n <span class=\"guidetext\">Please enter a number or select a saved contact</span>\r\n </div>\r\n <!-- <div class=\"input-error\" *ngIf=\"dialAlert.show\">\r\n <span>{{dialAlert.msg}}</span>\r\n </div> -->\r\n <div>\r\n <div class=\"contact-card\" *ngFor=\"let contact of filteredContactList\" (click)=\"onContactSelect(contact)\">\r\n <div class=\"contact-img\">\r\n <img [src]=\"contact.image\" alt=\"user image\" loading=\"lazy\" *ngIf=\"contact.image else alphaName\"/>\r\n <ng-template #alphaName>\r\n <span class=\"contact-alpha-img\">{{getFirstLetter(contact.firstName)}}</span>\r\n </ng-template>\r\n </div>\r\n <div class=\"contact-details\">\r\n <p style=\"margin-bottom: 4px\" class=\"contact-name\">{{getFullName(contact) }}</p>\r\n <p>{{contact.numbersList[0].number}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"wave-container\">\r\n <svg\r\n class=\"waves\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\r\n viewBox=\"0 24 150 28\"\r\n preserveAspectRatio=\"none\"\r\n shape-rendering=\"auto\"\r\n >\r\n <defs>\r\n <path\r\n id=\"gentle-wave\"\r\n d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\"\r\n />\r\n </defs>\r\n <g class=\"parallax\">\r\n <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"0\"\r\n fill=\"rgba(255,255,255,0.7)\"\r\n />\r\n <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"3\"\r\n fill=\"rgba(255,255,255,0.5)\"\r\n />\r\n <!-- <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"5\"\r\n fill=\"rgba(255,255,255,0.3)\"\r\n /> -->\r\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\r\n </g>\r\n </svg>\r\n </div>\r\n </div>\r\n <div class=\"btn-container\" *ngIf=\"!isMinimised\">\r\n <button class=\"dial-btn\" *ngFor=\"let key of keypadVal;let i = index\"\r\n (keydown.enter)=\"onEnter(key.num)\" (click)=\"addNumber(key.num)\"\r\n [ngStyle]=\"{'margin-top': key.text === '+' ? '3px' : '0'}\"\r\n [tabindex]=\"dialedNumber.length ? '0': i+2\" longPress (longPress)=\"addNumber(key.text)\" shortPress (shortPress)=\"addNumber(key.num)\">\r\n {{key.num}} \r\n <span *ngIf=\"key.num == 1;else otherThanOne\" class=\"material-symbols-outlined voicemail\">\r\n voicemail\r\n </span>\r\n <ng-template #otherThanOne>\r\n <span class=\"btn-albhabets\" [ngClass]=\"{'plusSign': key.text === '+'}\">{{key.text ? key.text : '&nbsp;'}}</span>\r\n </ng-template>\r\n </button>\r\n </div>\r\n <div class=\"call-btn-container\" *ngIf=\"!isMinimised\" (mouseenter)=\"onCallBtnMouseEnter($event)\" (mouseleave)=\"onCallBtnMouseLeave($event)\">\r\n <div class=\"call-btn\" (click)=\"initiateCall()\" [tabindex]=\"dialedNumber.length ? '2': '15'\"\r\n [ngStyle]=\"{'pointer-events': dialedNumber.length && selectedCallerId ? 'auto' : 'none', 'opacity': dialedNumber.length && selectedCallerId ? '1' : '0.5'}\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call\r\n </span>\r\n </div>\r\n </div>\r\n <div *ngIf=\"callerIdList.length && !isMinimised\" class=\"position-relative\">\r\n <div class=\"shownCallerId\" *ngIf=\"selectedCallerId; else askBlock\" (click)=\"toggleCallerIdDiv()\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + selectedCallerId?.isoCode?.toLowerCase()\"></span>\r\n {{selectedCallerId?.number}}\r\n </div>\r\n </div>\r\n <ng-template #askBlock>\r\n <div class=\"shownCallerId\" (click)=\"toggleCallerIdDiv()\" [ngClass]=\"{ 'tilt-shaking': shakeDedicatedBtn }\">\r\n <div class=\"d-flex justify-content-center\">\r\n <h5 class=\"mb-0\">Select C2C number</h5>\r\n <!-- <span class=\"ml-2\" style=\"opacity:.8;margin-top:2px\">\r\n <img src=\"assets/images/icon_down_arrow.svg\" alt=\"down\" width=\"10px\">\r\n </span> -->\r\n <span class=\"fa fa-angle-down ml-2 text-blue\" style=\"margin-top:2px\"></span>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <div class=\"guide2\" *ngIf=\"shakeDedicatedBtn\">\r\n <span class=\"guidetext\">Please select a number from below dropdown</span>\r\n </div>\r\n </div>\r\n \r\n <div *ngIf=\"callerIdList.length; else noCallerIdMessage\">\r\n <div class=\"caller-id-list-container\" *ngIf=\"callerIdList.length && !isMinimised\" id=\"callerIdContainer\" [ngClass]=\"{'visible': !isCallerIdHidden}\" >\r\n <div style=\"display: flex; justify-content: space-between\">\r\n <!-- <h4>Select C2C Softphone Number</h4> -->\r\n <h4>Make outgoing call using</h4>\r\n <span\r\n class=\"material-symbols-outlined\"\r\n style=\"cursor: pointer\"\r\n (click)=\"isCallerIdHidden = true\"\r\n >\r\n close\r\n </span>\r\n </div>\r\n <ul>\r\n <ng-container *ngFor=\"let callerId of callerIdList\">\r\n <!-- <li [ngClass]=\"{'selectedCallerIdClass': callerId?.number == selectedCallerId?.number}\" (click)=\"onDedicatedNumSelect(callerId)\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + callerId?.isoCode?.toLowerCase()\"></span>\r\n {{callerId?.number}}\r\n </div>\r\n <span>{{callerId?.countryName}}</span>\r\n </li> -->\r\n </ng-container>\r\n </ul>\r\n </div>\r\n </div>\r\n <ng-template #noCallerIdMessage>\r\n <span class=\"no-caller-id-message\">To make any voice calls, please <a routerLink=\"/extension/dedicatednumber/{{token}}\" class=\"click-here-link\" title=\"Settings > C2C Number\">subscribe</a> to a voice capable C2C Number.\r\n </span>\r\n </ng-template>\r\n <div class=\"dedicated-overlay\" *ngIf=\"showDedicatedPopup\">\r\n <div class=\"card dedicatedNumPopup\">\r\n <div class=\"card-header chooseDedicatedHeader\">\r\n <h5>Choose C2C Number</h5>\r\n <span class=\"material-symbols-outlined dial-close-btn\" (click)=\"showDedicatedPopup = false\">close</span>\r\n </div>\r\n <div class=\"card-body dedicatedNumList\">\r\n <ul>\r\n <ng-container *ngFor=\"let callerId of callerIdList\">\r\n <li [ngClass]=\"{'selectedCallerIdClass': callerId?.number == selectedCallerId?.number}\" (click)=\"showDedicatedPopup = false\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + callerId?.isoCode?.toLowerCase()\"></span>\r\n {{callerId?.number}}\r\n </div>\r\n <span>{{callerId?.countryName}}</span>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"incoming-call-widget\" *ngFor=\"let call of newIncomingCalls;let i = index\" [ngStyle]=\"{'top': (30 + i * 72) + 'px'}\">\r\n <div>\r\n <div class=\"inc-user-img\">\r\n <img src=\"assets/images/user.jpg\" alt=\"user image\">\r\n </div>\r\n \r\n </div>\r\n <div class=\"flex-grow-1\">\r\n <!-- <h6 class=\"mb-1 font-weight-bold\">Incoming Call</h6> -->\r\n <p class=\"inc-user-name\">{{call.customParameters.get('name')}}</p>\r\n <p>{{call.parameters.From}}</p>\r\n \r\n <!-- <p class=\"inc-user-name\">John Doe</p> \r\n <p>+12337472489</p>\r\n <p style=\"font-size: 12px;color:#d5d5d5 !important;margin-top:2px\">Call on +12264584100</p> -->\r\n \r\n </div>\r\n <div class=\"d-flex\">\r\n <button class=\"inc-call-btn inc-accept-btn mr-2\" (click)=\"acceptNewIncomingCall(call)\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call\r\n </span>\r\n </button>\r\n <!-- <button class=\"inc-call-btn inc-reject-btn\" (click)=\"rejectNewIncomingCall(call)\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call_end\r\n </span>\r\n </button> -->\r\n </div>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n ", styles: ["#dragparent1{position:fixed;left:100px;z-index:9999999;font-family:Lato,sans-serif;display:none}.dialpad-container{width:320px;height:600px;background:white;margin:auto;border-radius:30px;box-shadow:#00000040 0 54px 55px,#0000001f 0 -12px 30px,#0000001f 0 4px 6px,#0000002b 0 12px 13px,#00000017 0 -3px 5px;display:flex;flex-direction:column;box-sizing:border-box;position:relative;line-height:1.1}.dialpad-alerts{position:absolute;width:calc(100% - 28px);left:14px;top:8px;z-index:1200}.btn-disc{font-size:12px}.dialbox-pop1{font-size:.8rem;z-index:9;padding:8px}.input-error>span{color:#dfdfdf;margin-bottom:2px}.dial-close-btn{cursor:pointer;opacity:.6}.dial-close-btn:hover{opacity:1}.btn-container{display:flex;flex-wrap:wrap;padding:0 18px}.dial-btn{width:50px;height:50px;background-color:#fff;border-radius:4px;text-align:center;box-sizing:border-box;margin:4px 22px;font-size:28px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#2b434d;cursor:pointer;opacity:.8;border:none}.dial-btn:hover{opacity:1;box-shadow:#00000026 0 2px 8px}.dial-btn:focus{opacity:1;box-shadow:#00000026 0 2px 8px}.dial-btn:active{box-shadow:#32325d40 0 30px 60px -12px inset,#0000004d 0 18px 36px -18px inset}.call-btn-container{display:flex;margin-top:8px;justify-content:center;position:relative}.call-btn{display:flex;align-items:center;justify-content:center;width:54px;height:54px;border-radius:27px;background-color:#2ecc71;outline:none;border:none;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;opacity:.8;cursor:pointer}.call-btn:hover{opacity:1}.call-btn:focus{opacity:1}.caller-id-list-container{width:100%;height:auto;position:absolute;bottom:-100%;left:0;border-radius:0 0 30px 30px/0px 0px 30px 30px;padding:8px 12px 32px;box-sizing:border-box;color:#8a8a8a}.visible{animation:slideUp .8s forwards}#callerIdContainer ul{list-style:none;padding-left:0;margin:0}.dialpad-container h4{font-family:Lato,sans-serif;margin:0 0 8px}#callerIdContainer ul li{background-color:#fff;padding:8px;margin-top:7px;display:flex;border-radius:4px;justify-content:space-between;font-size:14px;cursor:pointer}.fi{border-radius:2px;margin-right:2px}@keyframes slideUp{0%{bottom:-100%}to{bottom:0}}.selectedCallerIdClass{box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;border:1px solid #e0e0e0;color:#3a3a3a}.toggleBtn{color:gray;border:none;background-color:#e5eef1}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.plusSign{font-weight:600;font-size:14px}.shownCallerId{text-align:center;padding:8px 10px;font-family:Lato,sans-serif;color:#2ecc71;border:1px solid #d7d7d7;background-color:#fff;width:80%;margin:12px auto auto;border-radius:12px;position:relative;cursor:pointer}.input-box{width:100%;background-color:#fff;padding:4px 10px;border:1px solid rgb(197,197,197);box-sizing:border-box;border-radius:24px;margin-top:12px;display:flex;justify-content:space-between}.input-box:focus-within{box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026}.input-box input{font-size:18px;padding:8px 6px;width:100%;box-sizing:border-box;border:none;outline:none;font-weight:600;color:#2b434d}.input-box input::placeholder{font-size:16px;font-weight:500}#input-clear-btn{color:gray;display:flex;align-items:center;cursor:pointer}.contact-card{width:100%;height:54px;display:flex;border-radius:12px;overflow:hidden;margin-top:4px;box-shadow:6px 6px 10px -1px #e6eefc26;cursor:pointer;opacity:0;transform:translateY(20px);animation:slideIn .5s forwards}@keyframes slideIn{to{opacity:1;transform:translateY(0)}}.contact-img{width:50px;display:flex;align-items:center;justify-content:center;border-right:1px solid #bebebe;background-color:#fff}.contact-img img{max-width:50px}.contact-alpha-img{width:50px;display:flex;justify-content:center;align-items:center;font-size:38px;font-weight:600}.contact-details{padding:4px 8px;display:flex;flex-direction:column;justify-content:center}.contact-details p{margin:0;line-height:1;color:#fff}.contact-name{font-weight:600}#topPanel{height:39%;position:relative;margin-bottom:4px;padding:0;border-top-right-radius:30px;border-top-left-radius:30px}.wave-container{position:absolute;bottom:2px}.waves{width:320px;position:relative;margin-bottom:-7px;height:31px;min-height:31px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}app-call-progress{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1000}.mini-dialpad{height:124px!important}.voicemail{line-height:.7;font-size:18px}.dedicated-overlay{position:absolute;width:100%;height:100%;background-color:#2b434d99;display:flex;align-items:center;justify-content:center}.dedicatedNumPopup{width:90%;height:auto;box-sizing:border-box;color:#8a8a8a;background-color:#cbe7df}.chooseDedicatedHeader{padding:.75rem;display:flex;justify-content:space-between}.chooseDedicatedHeader h5{margin-bottom:0}.dedicatedNumList>ul{list-style-type:none;padding:0}.dedicatedNumList>ul li{background-color:#fff;padding:4px;cursor:pointer}@keyframes tilt-shaking{0%{transform:rotate(0)}25%{transform:rotate(5deg)}50%{transform:rotate(0)}75%{transform:rotate(-5deg)}to{transform:rotate(0)}}.tilt-shaking{background-color:#d45858;animation:tilt-shaking .5s infinite;color:#fff}.tilt-shaking h5,.dark .tilt-shaking span,.tilt-shaking span{color:#fff}.no-caller-id-message{display:inline-block;text-align:center;height:10vh;background-color:#fff3cd;color:#000;font-size:.9rem;line-height:1.5;padding:8px}.click-here-link{color:#0f9aee;text-decoration:underline;font-weight:700}.input-info-icon{margin-top:9px;cursor:pointer;color:#2b434d;opacity:.7}::ng-deep .input-tooltip .tooltip-inner{background-color:#000!important}.no-selection-alert{padding:3px 11px;border:1px solid;border-radius:4px;display:flex;justify-content:space-between;color:#721c24;background-color:#f8d7da;border-color:#f5c6cb;align-items:center}.guide{position:relative;padding:8px;background-color:#303030;color:#fff;border-radius:8px;margin-top:8px;font-size:12px}.guide:before{content:\"\";position:absolute;top:-8px;left:8px;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #303030}.guide2{position:absolute;top:-32px;left:24px;padding:8px;background-color:#303030;color:#fff;border-radius:8px;margin-top:8px;font-size:12px;pointer-events:none}.guide2:before{content:\"\";position:absolute;bottom:-8px;left:8px;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #303030}.incoming-call-widget{position:absolute;right:-320px;top:30px;width:320px;height:68px;background-color:#3052cd;border-top-right-radius:8px;border-bottom-right-radius:8px;display:flex;align-items:center;padding:4px 12px}.incoming-call-widget h6,.incoming-call-widget p{margin-bottom:0;line-height:1.2;color:#fff}.inc-user-img{width:48px;height:48px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;box-sizing:border-box;margin-right:8px}.inc-user-img img{width:100%}.inc-call-btn{width:40px;height:40px;border-radius:50%;outline:none;border-width:0;display:flex;align-items:center;justify-content:center}.inc-call-btn span{font-size:16px}.inc-accept-btn{background-color:#2ecc71;color:#fff}.inc-reject-btn{background-color:#e14e4e;color:#fff}.inc-user-name{font-weight:600}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { kind: "directive", type: i6.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: i6.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i6.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }] });
2362
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxComponent, decorators: [{
2363
- type: Component,
2364
- args: [{ selector: 'lib-dialbox', template: "<div id=\"dragparent1\" [ngStyle]=\"{'display':isDialpadHidden ? 'none': 'block'}\">\r\n <!-- <app-call-progress *ngIf=\"isCallInProgress\"\r\n (endCallEvent)=\"endCall()\"\r\n (minimiseEvent) = \"onMinimise($event)\"\r\n (incomingCallInitiated)=\"newIncomingCallInitiated()\"\r\n [newIncomingCallData]=\"newIncomingCallData\"\r\n [newIncomingCallsList]=\"incomingCallsList\"\r\n (incomingCallsNewInfo)=\"incomingCallsNewInfo($event)\"\r\n [callData]=\"callData\"></app-call-progress> -->\r\n <div class=\"dialpad-container\" [ngClass]=\"{'mini-dialpad': isMinimised}\" tabindex=\"0\" (keydown)=\"handleDivKeydown($event)\">\r\n <div id=\"topPanel\" [ngStyle]=\"{'height': callerIdList.length ? '40%' : '39%'}\">\r\n <div class=\"dialpad-alerts\" *ngIf=\"dialAlert.show\">\r\n <div class=\"no-selection-alert\">\r\n <!-- <p class=\"mb-0\">Select C2C number to call</p> -->\r\n <p class=\"mb-0\">{{dialAlert.msg}}</p>\r\n <span class=\"fa fa-times\" (click)=\"shakeDedicatedBtn = false\"></span>\r\n </div>\r\n </div>\r\n <div class=\"dialpad-alerts\" *ngIf=\"callNumberToast.show\">\r\n <div class=\"dialbox-pop1 alert fade show\" [ngClass]=\"callNumberToast.type\" role=\"alert\">\r\n <div class=\"d-flex justify-content-between\">\r\n <div class=\"flex-grow-1 my-auto text-left\">\r\n You'r calling <strong>{{callNumberToast.displayNum}}</strong>\r\n </div>\r\n <div class=\"text-right\">\r\n <button class=\"btn btn-link btn-disc p-0 px-1\" (click)=\"cancelDialNumber()\">Cancel Call</button>\r\n <!-- <button class=\"btn btn-link btn-success btn-disc p-0 px-2\">Continue</button> -->\r\n </div>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n <div style=\"padding: 0 18px\" (paste)=\"handleNumberPaste($event)\">\r\n <div class=\"d-flex justify-content-between mt-2\">\r\n <p></p>\r\n <span class=\"material-symbols-outlined dial-close-btn\" (click)=\"hideDialpad()\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#ffffff\"><path d=\"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z\"/></svg>\r\n </span>\r\n </div>\r\n <div class=\"input-box\">\r\n <input type=\"text\" #dialInput placeholder=\"Enter a name or number\" tabindex=\"1\" [(ngModel)]=\"dialedNumber\" (ngModelChange)=\"onDialInputChange($event)\"/>\r\n <span class=\"\" id=\"input-clear-btn\" (click)=\"clearInput()\" *ngIf=\"showInputClearBtn\">\r\n <svg width=\"50px\" height=\"30px\" viewBox=\"0 10 40 60\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" baseProfile=\"full\" enable-background=\"new 0 0 76.00 76.00\" xml:space=\"preserve\">\r\n <path fill=\"#5d6061\" fill-opacity=\"1\" stroke-width=\"0.2\" stroke-linejoin=\"round\" d=\"M 47.5282,42.9497L 42.5784,38L 47.5282,33.0502L 44.9497,30.4718L 40,35.4216L 35.0502,30.4718L 32.4718,33.0502L 37.4216,38L 32.4718,42.9497L 35.0502,45.5282L 40,40.5784L 44.9497,45.5282L 47.5282,42.9497 Z M 18.0147,41.5355L 26.9646,50.4854C 28.0683,51.589 29,52 31,52L 52,52C 54.7614,52 57,49.7614 57,47L 57,29C 57,26.2386 54.7614,24 52,24L 31,24C 29,24 28.0683,24.4113 26.9646,25.5149L 18.0147,34.4645C 16.0621,36.4171 16.0621,39.5829 18.0147,41.5355 Z M 31,49C 30,49 29.6048,48.8828 29.086,48.3641L 20.1361,39.4142C 19.355,38.6332 19.355,37.3669 20.1361,36.5858L 29.086,27.6362C 29.6048,27.1175 30,27 31,27.0001L 52,27.0001C 53.1046,27.0001 54,27.8955 54,29.0001L 54,47.0001C 54,48.1046 53.1046,49.0001 52,49.0001L 31,49 Z \"/>\r\n </svg> \r\n </span>\r\n <span class=\"input-info-icon\" placement=\"bottom-right\" tooltipClass=\"input-tooltip\" ngbTooltip=\"For extension dialing, use formats like +12345678910 x123,+12345678910 ext.123, +12345678910,123\"><i class=\"fa fa-info-circle\"></i></span>\r\n </div>\r\n <div class=\"guide\" *ngIf=\"callerIdList.length && !(dialedNumber.length > 2)\">\r\n <span class=\"guidetext\">Please enter a number or select a saved contact</span>\r\n </div>\r\n <!-- <div class=\"input-error\" *ngIf=\"dialAlert.show\">\r\n <span>{{dialAlert.msg}}</span>\r\n </div> -->\r\n <div>\r\n <div class=\"contact-card\" *ngFor=\"let contact of filteredContactList\" (click)=\"onContactSelect(contact)\">\r\n <div class=\"contact-img\">\r\n <img [src]=\"contact.image\" alt=\"user image\" loading=\"lazy\" *ngIf=\"contact.image else alphaName\"/>\r\n <ng-template #alphaName>\r\n <span class=\"contact-alpha-img\">{{getFirstLetter(contact.firstName)}}</span>\r\n </ng-template>\r\n </div>\r\n <div class=\"contact-details\">\r\n <p style=\"margin-bottom: 4px\" class=\"contact-name\">{{getFullName(contact) }}</p>\r\n <p>{{contact.numbersList[0].number}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"wave-container\">\r\n <svg\r\n class=\"waves\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\r\n viewBox=\"0 24 150 28\"\r\n preserveAspectRatio=\"none\"\r\n shape-rendering=\"auto\"\r\n >\r\n <defs>\r\n <path\r\n id=\"gentle-wave\"\r\n d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\"\r\n />\r\n </defs>\r\n <g class=\"parallax\">\r\n <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"0\"\r\n fill=\"rgba(255,255,255,0.7)\"\r\n />\r\n <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"3\"\r\n fill=\"rgba(255,255,255,0.5)\"\r\n />\r\n <!-- <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"5\"\r\n fill=\"rgba(255,255,255,0.3)\"\r\n /> -->\r\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\r\n </g>\r\n </svg>\r\n </div>\r\n </div>\r\n <div class=\"btn-container\" *ngIf=\"!isMinimised\">\r\n <button class=\"dial-btn\" *ngFor=\"let key of keypadVal;let i = index\"\r\n (keydown.enter)=\"onEnter(key.num)\" (click)=\"addNumber(key.num)\"\r\n [ngStyle]=\"{'margin-top': key.text === '+' ? '3px' : '0'}\"\r\n [tabindex]=\"dialedNumber.length ? '0': i+2\" longPress (longPress)=\"addNumber(key.text)\" shortPress (shortPress)=\"addNumber(key.num)\">\r\n {{key.num}} \r\n <span *ngIf=\"key.num == 1;else otherThanOne\" class=\"material-symbols-outlined voicemail\">\r\n voicemail\r\n </span>\r\n <ng-template #otherThanOne>\r\n <span class=\"btn-albhabets\" [ngClass]=\"{'plusSign': key.text === '+'}\">{{key.text ? key.text : '&nbsp;'}}</span>\r\n </ng-template>\r\n </button>\r\n </div>\r\n <div class=\"call-btn-container\" *ngIf=\"!isMinimised\" (mouseenter)=\"onCallBtnMouseEnter($event)\" (mouseleave)=\"onCallBtnMouseLeave($event)\">\r\n <div class=\"call-btn\" (click)=\"initiateCall()\" [tabindex]=\"dialedNumber.length ? '2': '15'\"\r\n [ngStyle]=\"{'pointer-events': dialedNumber.length && selectedCallerId ? 'auto' : 'none', 'opacity': dialedNumber.length && selectedCallerId ? '1' : '0.5'}\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call\r\n </span>\r\n </div>\r\n </div>\r\n <div *ngIf=\"callerIdList.length && !isMinimised\" class=\"position-relative\">\r\n <div class=\"shownCallerId\" *ngIf=\"selectedCallerId; else askBlock\" (click)=\"toggleCallerIdDiv()\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + selectedCallerId?.isoCode?.toLowerCase()\"></span>\r\n {{selectedCallerId?.number}}\r\n </div>\r\n </div>\r\n <ng-template #askBlock>\r\n <div class=\"shownCallerId\" (click)=\"toggleCallerIdDiv()\" [ngClass]=\"{ 'tilt-shaking': shakeDedicatedBtn }\">\r\n <div class=\"d-flex justify-content-center\">\r\n <h5 class=\"mb-0\">Select C2C number</h5>\r\n <!-- <span class=\"ml-2\" style=\"opacity:.8;margin-top:2px\">\r\n <img src=\"assets/images/icon_down_arrow.svg\" alt=\"down\" width=\"10px\">\r\n </span> -->\r\n <span class=\"fa fa-angle-down ml-2 text-blue\" style=\"margin-top:2px\"></span>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <div class=\"guide2\" *ngIf=\"shakeDedicatedBtn\">\r\n <span class=\"guidetext\">Please select a number from below dropdown</span>\r\n </div>\r\n </div>\r\n \r\n <div *ngIf=\"callerIdList.length; else noCallerIdMessage\">\r\n <div class=\"caller-id-list-container\" *ngIf=\"callerIdList.length && !isMinimised\" id=\"callerIdContainer\" [ngClass]=\"{'visible': !isCallerIdHidden}\" >\r\n <div style=\"display: flex; justify-content: space-between\">\r\n <!-- <h4>Select C2C Softphone Number</h4> -->\r\n <h4>Make outgoing call using</h4>\r\n <span\r\n class=\"material-symbols-outlined\"\r\n style=\"cursor: pointer\"\r\n (click)=\"isCallerIdHidden = true\"\r\n >\r\n close\r\n </span>\r\n </div>\r\n <ul>\r\n <ng-container *ngFor=\"let callerId of callerIdList\">\r\n <!-- <li [ngClass]=\"{'selectedCallerIdClass': callerId?.number == selectedCallerId?.number}\" (click)=\"onDedicatedNumSelect(callerId)\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + callerId?.isoCode?.toLowerCase()\"></span>\r\n {{callerId?.number}}\r\n </div>\r\n <span>{{callerId?.countryName}}</span>\r\n </li> -->\r\n </ng-container>\r\n </ul>\r\n </div>\r\n </div>\r\n <ng-template #noCallerIdMessage>\r\n <span class=\"no-caller-id-message\">To make any voice calls, please <a routerLink=\"/extension/dedicatednumber/{{token}}\" class=\"click-here-link\" title=\"Settings > C2C Number\">subscribe</a> to a voice capable C2C Number.\r\n </span>\r\n </ng-template>\r\n <div class=\"dedicated-overlay\" *ngIf=\"showDedicatedPopup\">\r\n <div class=\"card dedicatedNumPopup\">\r\n <div class=\"card-header chooseDedicatedHeader\">\r\n <h5>Choose C2C Number</h5>\r\n <span class=\"material-symbols-outlined dial-close-btn\" (click)=\"showDedicatedPopup = false\">close</span>\r\n </div>\r\n <div class=\"card-body dedicatedNumList\">\r\n <ul>\r\n <ng-container *ngFor=\"let callerId of callerIdList\">\r\n <li [ngClass]=\"{'selectedCallerIdClass': callerId?.number == selectedCallerId?.number}\" (click)=\"showDedicatedPopup = false\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + callerId?.isoCode?.toLowerCase()\"></span>\r\n {{callerId?.number}}\r\n </div>\r\n <span>{{callerId?.countryName}}</span>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"incoming-call-widget\" *ngFor=\"let call of newIncomingCalls;let i = index\" [ngStyle]=\"{'top': (30 + i * 72) + 'px'}\">\r\n <div>\r\n <div class=\"inc-user-img\">\r\n <img src=\"assets/images/user.jpg\" alt=\"user image\">\r\n </div>\r\n \r\n </div>\r\n <div class=\"flex-grow-1\">\r\n <!-- <h6 class=\"mb-1 font-weight-bold\">Incoming Call</h6> -->\r\n <p class=\"inc-user-name\">{{call.customParameters.get('name')}}</p>\r\n <p>{{call.parameters.From}}</p>\r\n \r\n <!-- <p class=\"inc-user-name\">John Doe</p> \r\n <p>+12337472489</p>\r\n <p style=\"font-size: 12px;color:#d5d5d5 !important;margin-top:2px\">Call on +12264584100</p> -->\r\n \r\n </div>\r\n <div class=\"d-flex\">\r\n <button class=\"inc-call-btn inc-accept-btn mr-2\" (click)=\"acceptNewIncomingCall(call)\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call\r\n </span>\r\n </button>\r\n <!-- <button class=\"inc-call-btn inc-reject-btn\" (click)=\"rejectNewIncomingCall(call)\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call_end\r\n </span>\r\n </button> -->\r\n </div>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n ", styles: ["#dragparent1{position:fixed;left:100px;z-index:9999999;font-family:Lato,sans-serif;display:none}.dialpad-container{width:320px;height:600px;background:white;margin:auto;border-radius:30px;box-shadow:#00000040 0 54px 55px,#0000001f 0 -12px 30px,#0000001f 0 4px 6px,#0000002b 0 12px 13px,#00000017 0 -3px 5px;display:flex;flex-direction:column;box-sizing:border-box;position:relative;line-height:1.1}.dialpad-alerts{position:absolute;width:calc(100% - 28px);left:14px;top:8px;z-index:1200}.btn-disc{font-size:12px}.dialbox-pop1{font-size:.8rem;z-index:9;padding:8px}.input-error>span{color:#dfdfdf;margin-bottom:2px}.dial-close-btn{cursor:pointer;opacity:.6}.dial-close-btn:hover{opacity:1}.btn-container{display:flex;flex-wrap:wrap;padding:0 18px}.dial-btn{width:50px;height:50px;background-color:#fff;border-radius:4px;text-align:center;box-sizing:border-box;margin:4px 22px;font-size:28px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#2b434d;cursor:pointer;opacity:.8;border:none}.dial-btn:hover{opacity:1;box-shadow:#00000026 0 2px 8px}.dial-btn:focus{opacity:1;box-shadow:#00000026 0 2px 8px}.dial-btn:active{box-shadow:#32325d40 0 30px 60px -12px inset,#0000004d 0 18px 36px -18px inset}.call-btn-container{display:flex;margin-top:8px;justify-content:center;position:relative}.call-btn{display:flex;align-items:center;justify-content:center;width:54px;height:54px;border-radius:27px;background-color:#2ecc71;outline:none;border:none;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;opacity:.8;cursor:pointer}.call-btn:hover{opacity:1}.call-btn:focus{opacity:1}.caller-id-list-container{width:100%;height:auto;position:absolute;bottom:-100%;left:0;border-radius:0 0 30px 30px/0px 0px 30px 30px;padding:8px 12px 32px;box-sizing:border-box;color:#8a8a8a}.visible{animation:slideUp .8s forwards}#callerIdContainer ul{list-style:none;padding-left:0;margin:0}.dialpad-container h4{font-family:Lato,sans-serif;margin:0 0 8px}#callerIdContainer ul li{background-color:#fff;padding:8px;margin-top:7px;display:flex;border-radius:4px;justify-content:space-between;font-size:14px;cursor:pointer}.fi{border-radius:2px;margin-right:2px}@keyframes slideUp{0%{bottom:-100%}to{bottom:0}}.selectedCallerIdClass{box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;border:1px solid #e0e0e0;color:#3a3a3a}.toggleBtn{color:gray;border:none;background-color:#e5eef1}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.plusSign{font-weight:600;font-size:14px}.shownCallerId{text-align:center;padding:8px 10px;font-family:Lato,sans-serif;color:#2ecc71;border:1px solid #d7d7d7;background-color:#fff;width:80%;margin:12px auto auto;border-radius:12px;position:relative;cursor:pointer}.input-box{width:100%;background-color:#fff;padding:4px 10px;border:1px solid rgb(197,197,197);box-sizing:border-box;border-radius:24px;margin-top:12px;display:flex;justify-content:space-between}.input-box:focus-within{box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026}.input-box input{font-size:18px;padding:8px 6px;width:100%;box-sizing:border-box;border:none;outline:none;font-weight:600;color:#2b434d}.input-box input::placeholder{font-size:16px;font-weight:500}#input-clear-btn{color:gray;display:flex;align-items:center;cursor:pointer}.contact-card{width:100%;height:54px;display:flex;border-radius:12px;overflow:hidden;margin-top:4px;box-shadow:6px 6px 10px -1px #e6eefc26;cursor:pointer;opacity:0;transform:translateY(20px);animation:slideIn .5s forwards}@keyframes slideIn{to{opacity:1;transform:translateY(0)}}.contact-img{width:50px;display:flex;align-items:center;justify-content:center;border-right:1px solid #bebebe;background-color:#fff}.contact-img img{max-width:50px}.contact-alpha-img{width:50px;display:flex;justify-content:center;align-items:center;font-size:38px;font-weight:600}.contact-details{padding:4px 8px;display:flex;flex-direction:column;justify-content:center}.contact-details p{margin:0;line-height:1;color:#fff}.contact-name{font-weight:600}#topPanel{height:39%;position:relative;margin-bottom:4px;padding:0;border-top-right-radius:30px;border-top-left-radius:30px}.wave-container{position:absolute;bottom:2px}.waves{width:320px;position:relative;margin-bottom:-7px;height:31px;min-height:31px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}app-call-progress{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1000}.mini-dialpad{height:124px!important}.voicemail{line-height:.7;font-size:18px}.dedicated-overlay{position:absolute;width:100%;height:100%;background-color:#2b434d99;display:flex;align-items:center;justify-content:center}.dedicatedNumPopup{width:90%;height:auto;box-sizing:border-box;color:#8a8a8a;background-color:#cbe7df}.chooseDedicatedHeader{padding:.75rem;display:flex;justify-content:space-between}.chooseDedicatedHeader h5{margin-bottom:0}.dedicatedNumList>ul{list-style-type:none;padding:0}.dedicatedNumList>ul li{background-color:#fff;padding:4px;cursor:pointer}@keyframes tilt-shaking{0%{transform:rotate(0)}25%{transform:rotate(5deg)}50%{transform:rotate(0)}75%{transform:rotate(-5deg)}to{transform:rotate(0)}}.tilt-shaking{background-color:#d45858;animation:tilt-shaking .5s infinite;color:#fff}.tilt-shaking h5,.dark .tilt-shaking span,.tilt-shaking span{color:#fff}.no-caller-id-message{display:inline-block;text-align:center;height:10vh;background-color:#fff3cd;color:#000;font-size:.9rem;line-height:1.5;padding:8px}.click-here-link{color:#0f9aee;text-decoration:underline;font-weight:700}.input-info-icon{margin-top:9px;cursor:pointer;color:#2b434d;opacity:.7}::ng-deep .input-tooltip .tooltip-inner{background-color:#000!important}.no-selection-alert{padding:3px 11px;border:1px solid;border-radius:4px;display:flex;justify-content:space-between;color:#721c24;background-color:#f8d7da;border-color:#f5c6cb;align-items:center}.guide{position:relative;padding:8px;background-color:#303030;color:#fff;border-radius:8px;margin-top:8px;font-size:12px}.guide:before{content:\"\";position:absolute;top:-8px;left:8px;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #303030}.guide2{position:absolute;top:-32px;left:24px;padding:8px;background-color:#303030;color:#fff;border-radius:8px;margin-top:8px;font-size:12px;pointer-events:none}.guide2:before{content:\"\";position:absolute;bottom:-8px;left:8px;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #303030}.incoming-call-widget{position:absolute;right:-320px;top:30px;width:320px;height:68px;background-color:#3052cd;border-top-right-radius:8px;border-bottom-right-radius:8px;display:flex;align-items:center;padding:4px 12px}.incoming-call-widget h6,.incoming-call-widget p{margin-bottom:0;line-height:1.2;color:#fff}.inc-user-img{width:48px;height:48px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;box-sizing:border-box;margin-right:8px}.inc-user-img img{width:100%}.inc-call-btn{width:40px;height:40px;border-radius:50%;outline:none;border-width:0;display:flex;align-items:center;justify-content:center}.inc-call-btn span{font-size:16px}.inc-accept-btn{background-color:#2ecc71;color:#fff}.inc-reject-btn{background-color:#e14e4e;color:#fff}.inc-user-name{font-weight:600}\n"] }]
2365
- }], ctorParameters: function () { return [{ type: TwilioService }, { type: ExtensionService }, { type: IpAddressService }, { type: ExtensionService }, { type: i4.Router }]; }, propDecorators: { isDialpadHidden: [{
2366
- type: Input
2367
- }], closeDialpadEvent: [{
2368
- type: Output
2369
- }], callInitiated: [{
2370
- type: Output
2371
- }], endCallEvent: [{
2372
- type: Output
2373
- }], minimiseEvent: [{
2374
- type: Output
2375
- }], incomingCallsNewInfoEvent: [{
2376
- type: Output
2377
- }], incomingCallInitiated: [{
2378
- type: Output
2379
- }], dialInputElement: [{
2380
- type: ViewChild,
2381
- args: ['dialInput']
2382
- }], numberDialed: [{
2383
- type: Output
2384
- }] } });
2385
-
2386
- class CallProgressComponent {
2387
- constructor(extensionService, cdr) {
2388
- this.extensionService = extensionService;
2389
- this.cdr = cdr;
2390
- this.endCallEvent = new EventEmitter();
2391
- this.incomingCallsNewInfo = new EventEmitter();
2392
- this.minimiseEvent = new EventEmitter();
2393
- this.showRingAnimation = false;
2394
- this.timer = '00:00';
2395
- this.showKeypad = false;
2396
- this.keypadVal = keypad;
2397
- this.callInput = '';
2398
- this.isMute = false;
2399
- this.disbaleEndCallBtn = true;
2400
- this.showClearBtn = false;
2401
- this.isCollops = false;
2402
- // Incoming call variables
2403
- this.incomingCallDiv = false;
2404
- //@Output() showCallProgressEvent: EventEmitter<void> = new EventEmitter<void>();
2405
- this.incomingCallInitiated = new EventEmitter();
2406
- this.isRecording = false;
2407
- this.isPaused = false;
2408
- this.timeElapsed = 0; // in seconds
2409
- this.recordCall = false;
2410
- this.callStatus = 'ringing';
2411
- this.isMinimised = false;
2348
+ getFirstLetter(name) {
2349
+ return name ? name.charAt(0).toUpperCase() : '';
2412
2350
  }
2413
- ngOnInit() {
2414
- console.log('Call Progress Component');
2351
+ clearInput() {
2352
+ if (this.dialedNumber.length > 0) {
2353
+ this.dialedNumber = this.dialedNumber.slice(0, -1);
2354
+ this.showInputClearBtn = this.dialedNumber.length !== 0;
2355
+ this.onDialInputChange(this.dialedNumber);
2356
+ }
2415
2357
  }
2416
- ngOnChanges(changes) {
2417
- var _a, _b, _c, _d;
2418
- console.log('Call Progress Component ngOnChanges');
2419
- if (changes['callData']) {
2420
- console.log('Call Progress Component ngOnChanges callData', changes['callData']);
2421
- if (changes['callData'].currentValue.isIncomingCall) {
2422
- this.incomingCallDiv = true;
2358
+ clearAllDialed() {
2359
+ this.dialedNumber = '';
2360
+ this.sanitizedNum = '';
2361
+ this.showInputClearBtn = false;
2362
+ }
2363
+ getCallerIdList() {
2364
+ this.extService.displayID(this.token || '').subscribe((res) => {
2365
+ //this.callerIdList = res.callerIdList.filter(item => item.type === "C2C Softphone Number");
2366
+ this.callerIdList = res.callerIdList.filter((item) => item.voiceFeature === true);
2367
+ // this.callerIdList = res.callerIdList;
2368
+ if (this.callerIdList.length == 1) {
2369
+ this.selectedCallerId = this.callerIdList[0];
2423
2370
  }
2424
2371
  else {
2425
- //for outgoing call
2426
- this.startCall(changes['callData'].currentValue);
2427
- }
2428
- }
2429
- if (changes['newIncomingCallData']) {
2430
- try {
2431
- if (changes['newIncomingCallData'].currentValue) {
2432
- if (this.call && (this.call.status() == 'open')) {
2433
- this.call.disconnect();
2434
- this.call = changes['newIncomingCallData'].currentValue;
2435
- (_a = this.call) === null || _a === void 0 ? void 0 : _a.accept();
2436
- this.callData.phone = (_b = this.call) === null || _b === void 0 ? void 0 : _b.parameters['From'];
2437
- this.callData.name = (_c = this.call) === null || _c === void 0 ? void 0 : _c.customParameters.get('name');
2438
- this.callData.img = ((_d = this.call) === null || _d === void 0 ? void 0 : _d.customParameters.get('image')) || 'assets/images/user.jpg';
2439
- this.incomingCallInitiated.emit();
2440
- this.startTimer();
2441
- }
2442
- }
2443
- }
2444
- catch (e) {
2445
- console.log(e);
2446
- }
2447
- }
2448
- }
2449
- ngAfterViewInit() { }
2450
- startCall(callData) {
2451
- return __awaiter(this, void 0, void 0, function* () {
2452
- try {
2453
- this.showRingAnimation = true;
2454
- const payload = {
2455
- channelId: environment.channelId,
2456
- userId: localStorage.getItem('userId'),
2457
- to: callData.phone,
2458
- scope: 'local',
2459
- fromNumber: callData.from
2460
- };
2461
- const response = yield this.initiateCall(payload);
2462
- if (response.status == 200) {
2463
- const { id: callAuthId, recordCall } = yield this.getCallAuthId(response);
2464
- this.getUserInformation(callAuthId);
2465
- this.recordCall = recordCall; // Store the recordCall value
2466
- const tokenData = yield this.getOutgoingCallToken(callAuthId);
2467
- yield this.connectToDevice(tokenData.token, callData);
2468
- // Poll the status for 30-45 seconds
2469
- this.pollCallStatus(callAuthId);
2372
+ if (this.callPreference === 'alwaysAsk' || this.callPreference === 'smartDialing') {
2373
+ this.selectedCallerId = null;
2470
2374
  }
2471
- else if (response.status == 201) {
2472
- swal("Error", response.message.join("<br/>"), "error");
2473
- this.endCall();
2375
+ else {
2376
+ this.selectedCallerId = this.callerIdList.find(item => (item.number == this.callPreference));
2474
2377
  }
2475
2378
  }
2476
- catch (error) {
2477
- this.showRingAnimation = false;
2478
- this.handleError(error);
2479
- this.endCall();
2480
- }
2481
2379
  });
2482
2380
  }
2483
- initiateCall(payload) {
2484
- return __awaiter(this, void 0, void 0, function* () {
2485
- return yield this.extensionService.initiateCall(payload).toPromise();
2381
+ getContactList() {
2382
+ this.twilioService.getContactList().subscribe((resp) => {
2383
+ if (resp.response == 'Success') {
2384
+ this.contactList = resp.phoneBook;
2385
+ }
2386
+ }, err => {
2387
+ console.log(err);
2486
2388
  });
2487
2389
  }
2488
- getCallAuthId(response) {
2489
- return __awaiter(this, void 0, void 0, function* () {
2490
- return {
2491
- id: response.callauth.id,
2492
- recordCall: response.callauth.recordCall
2390
+ getFullName(contact) {
2391
+ let fullName = contact.firstName || '';
2392
+ if (contact.middleName) {
2393
+ fullName += ` ${contact.middleName}`;
2394
+ }
2395
+ if (contact.lastName) {
2396
+ fullName += ` ${contact.lastName}`;
2397
+ }
2398
+ return fullName.trim();
2399
+ }
2400
+ toggleCallerIdDiv() {
2401
+ this.isCallerIdHidden = !this.isCallerIdHidden;
2402
+ }
2403
+ onContactSelect(contact) {
2404
+ this.dialedNumber = contact.numbersList[0].number;
2405
+ this.callData.name = this.getFullName(contact);
2406
+ this.callData.img = contact.image || 'assets/images/user.jpg';
2407
+ this.onDialInputChange(this.dialedNumber);
2408
+ this.filteredContactList = [];
2409
+ }
2410
+ endCall() {
2411
+ try {
2412
+ console.log('Ending call');
2413
+ this.isCallInProgress = false;
2414
+ this.filteredContactList = [];
2415
+ // Reset call data
2416
+ this.callData = {
2417
+ phone: '',
2418
+ name: '',
2419
+ img: 'assets/images/user.jpg',
2420
+ isIncomingCall: false,
2421
+ dial: false,
2422
+ displayNum: '',
2423
+ extNum: ''
2493
2424
  };
2494
- });
2495
- }
2496
- getOutgoingCallToken(callAuthId) {
2497
- return __awaiter(this, void 0, void 0, function* () {
2498
- return yield this.extensionService.getOutgoingCallToken({ authId: callAuthId }).toPromise();
2499
- });
2425
+ // Reset dialed number
2426
+ this.dialedNumber = '';
2427
+ this.sanitizedNum = '';
2428
+ // Emit end call event
2429
+ this.endCallEvent.emit();
2430
+ console.log('Call ended successfully');
2431
+ }
2432
+ catch (error) {
2433
+ console.error('Error in endCall:', error);
2434
+ // Even if there's an error, try to reset the state
2435
+ this.isCallInProgress = false;
2436
+ this.callData = {
2437
+ phone: '',
2438
+ name: '',
2439
+ img: 'assets/images/user.jpg',
2440
+ isIncomingCall: false,
2441
+ dial: false,
2442
+ displayNum: '',
2443
+ extNum: ''
2444
+ };
2445
+ this.endCallEvent.emit();
2446
+ }
2500
2447
  }
2501
- connectToDevice(token, callData) {
2448
+ // async initiateCall() {
2449
+ // try {
2450
+ // console.log('Initiating call with number:', this.dialedNumber);
2451
+ // if (!this.dialedNumber && this.lastDialed) {
2452
+ // console.log('Using last dialed number:', this.lastDialed.number);
2453
+ // this.sanitizedNum = this.lastDialed.number;
2454
+ // }
2455
+ // const isInvalid = await this.isInvalidNumber();
2456
+ // if (isInvalid) {
2457
+ // console.error('Invalid number format');
2458
+ // return false;
2459
+ // }
2460
+ // this.saveLastDialed();
2461
+ // this.isSavedContactDialled();
2462
+ // // Check payment status
2463
+ // this.isPaymentDue = localStorage.getItem('paymentDue') === 'true';
2464
+ // if (this.isPaymentDue) {
2465
+ // console.warn('Payment is due');
2466
+ // swal('Warning', 'Please note that your payment is due. To continue using our services, kindly subscribe to avoid interruptions.');
2467
+ // return false;
2468
+ // }
2469
+ // // Check if dialing own number
2470
+ // if (this.sanitizedNum === localStorage.getItem('twilioNumber')) {
2471
+ // console.error('Attempted to dial own number');
2472
+ // swal('Error', 'You cannot dial your own number');
2473
+ // return false;
2474
+ // }
2475
+ // // Check microphone permissions
2476
+ // const hasPermission = await this.checkMicrophonePermission();
2477
+ // if (!hasPermission) {
2478
+ // console.warn('Microphone permission not granted');
2479
+ // await this.askForMicrophonePermission();
2480
+ // return false;
2481
+ // }
2482
+ // if (!this.selectedCallerId) {
2483
+ // console.error('No caller ID selected');
2484
+ // this.shakeDedicatedBtn = true;
2485
+ // this.showDialAlert('Please select a C2C number to call from');
2486
+ // setTimeout(() => {
2487
+ // this.shakeDedicatedBtn = false;
2488
+ // }, 3000);
2489
+ // return false;
2490
+ // }
2491
+ // console.log('Getting number with country code...');
2492
+ // this.callData.displayNum = '';
2493
+ // try {
2494
+ // await this.getToNumber(this.sanitizedNum);
2495
+ // } catch (error) {
2496
+ // console.error('Error getting number with country code:', error);
2497
+ // this.showDialAlert('Error processing number. Please try again.');
2498
+ // return false;
2499
+ // }
2500
+ // if (this.terminateCall) {
2501
+ // console.log('Call terminated by user');
2502
+ // this.terminateCall = false;
2503
+ // return false;
2504
+ // }
2505
+ // // Prepare call data
2506
+ // this.callData = {
2507
+ // ...this.callData,
2508
+ // phone: this.sanitizedNum,
2509
+ // isIncomingCall: false,
2510
+ // dial: true,
2511
+ // from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
2512
+ // timestamp: new Date().toISOString()
2513
+ // };
2514
+ // console.log('Initiating call with data:', this.callData);
2515
+ // this.isCallInProgress = true;
2516
+ // this.callInitiated.emit({ ...this.callData });
2517
+ // return true;
2518
+ // } catch (error) {
2519
+ // console.error('Error in initiateCall:', error);
2520
+ // this.showDialAlert('Failed to initiate call. Please try again.');
2521
+ // this.isCallInProgress = false;
2522
+ // return false;
2523
+ // }
2524
+ // //this.clearAllDialed();
2525
+ // // } else {
2526
+ // // swal('Error', 'Trial period is over. Please setup payment method to continue services')
2527
+ // // }
2528
+ // }
2529
+ // async initiateCall() {
2530
+ // if (!this.dialedNumber && this.lastDialed) {
2531
+ // this.sanitizedNum = this.lastDialed.number;
2532
+ // }
2533
+ // const isInvalid = await this.isInvalidNumber();
2534
+ // if (isInvalid) {
2535
+ // return false;
2536
+ // }
2537
+ // this.saveLastDialed();
2538
+ // this.isSavedContactDialled();
2539
+ // //let isCallerIdSet = await this.isCallerIdSet();
2540
+ // this.isPaymentDue = localStorage.getItem('paymentDue') == 'false' ? false : true;
2541
+ // if (this.isPaymentDue) {
2542
+ // swal('Warning', 'Please note that your payment is due, To continue on your services kindly subscribe to use uninterrupted services.');
2543
+ // return;
2544
+ // }
2545
+ // this.isTrialPeriodOver = localStorage.getItem('trialOver') == 'false' ? false : true;
2546
+ // // if (!this.isTrialPeriodOver) {
2547
+ // if (this.sanitizedNum == localStorage.getItem('twilioNumber')) {
2548
+ // swal('Error', 'You can not dial this number');
2549
+ // return;
2550
+ // }
2551
+ // const hasPermission = await this.checkMicrophonePermission();
2552
+ // if (hasPermission) {
2553
+ // if (this.selectedCallerId) {
2554
+ // //clear displayNum if value is binded from previous call
2555
+ // this.callData.displayNum = '';
2556
+ // // get number to be dialled from backend
2557
+ // await this.getToNumber(this.sanitizedNum);
2558
+ // if (this.terminateCall) {
2559
+ // this.terminateCall = false;
2560
+ // return;
2561
+ // }
2562
+ // this.callData.phone = this.sanitizedNum;
2563
+ // this.callData.isIncomingCall = false;
2564
+ // this.callData.dial = true;
2565
+ // if (!this.isSmartDialCall) {
2566
+ // this.callData.from = this.selectedCallerId.number;
2567
+ // }
2568
+ // this.isCallInProgress = true;
2569
+ // this.callData = {
2570
+ // ...this.callData,
2571
+ // phone: this.sanitizedNum,
2572
+ // isIncomingCall: false,
2573
+ // dial: true,
2574
+ // from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
2575
+ // timestamp: new Date().toISOString()
2576
+ // };
2577
+ // console.log('Initiating call with data:', this.callData);
2578
+ // this.isCallInProgress = true;
2579
+ // this.callInitiated.emit({ ...this.callData });
2580
+ // return true;
2581
+ // } else {
2582
+ // this.shakeDedicatedBtn = true;
2583
+ // this.showDialAlert('Select a C2C number to call');
2584
+ // setTimeout(() => {
2585
+ // this.shakeDedicatedBtn = false;
2586
+ // }, 3000);
2587
+ // return false;
2588
+ // }
2589
+ // //this.callingOpenEvent.emit({ phone: this.dialedNumber });
2590
+ // } else {
2591
+ // await this.askForMicrophonePermission();
2592
+ // }
2593
+ // //this.clearAllDialed();
2594
+ // // } else {
2595
+ // // swal('Error', 'Trial period is over. Please setup payment method to continue services')
2596
+ // // }
2597
+ // }
2598
+ // async initiateCall() {
2599
+ // try{
2600
+ // if (!this.dialedNumber && this.lastDialed) {
2601
+ // this.sanitizedNum = this.lastDialed.number;
2602
+ // }
2603
+ // const isInvalid = await this.isInvalidNumber();
2604
+ // if (isInvalid) {
2605
+ // return false;
2606
+ // }
2607
+ // this.saveLastDialed();
2608
+ // this.isSavedContactDialled();
2609
+ // //let isCallerIdSet = await this.isCallerIdSet();
2610
+ // this.isPaymentDue = localStorage.getItem('paymentDue') == 'false' ? false : true;
2611
+ // if (this.isPaymentDue) {
2612
+ // swal('Warning', 'Please note that your payment is due, To continue on your services kindly subscribe to use uninterrupted services.');
2613
+ // return false;
2614
+ // }
2615
+ // this.isTrialPeriodOver = localStorage.getItem('trialOver') == 'false' ? false : true;
2616
+ // // if (!this.isTrialPeriodOver) {
2617
+ // if (this.sanitizedNum == localStorage.getItem('twilioNumber')) {
2618
+ // swal('Error', 'You can not dial this number');
2619
+ // return false;
2620
+ // }
2621
+ // const hasPermission = await this.checkMicrophonePermission();
2622
+ // if (hasPermission) {
2623
+ // if (this.selectedCallerId) {
2624
+ // //clear displayNum if value is binded from previous call
2625
+ // this.callData.displayNum = '';
2626
+ // // get number to be dialled from backend
2627
+ // await this.getToNumber(this.sanitizedNum);
2628
+ // if (this.terminateCall) {
2629
+ // this.terminateCall = false;
2630
+ // return;
2631
+ // }
2632
+ // this.callData.phone = this.sanitizedNum;
2633
+ // this.callData.isIncomingCall = false;
2634
+ // this.callData.dial = true;
2635
+ // if (!this.isSmartDialCall) {
2636
+ // this.callData.from = this.selectedCallerId.number;
2637
+ // }
2638
+ // this.isCallInProgress = true;
2639
+ // this.callData = {
2640
+ // ...this.callData,
2641
+ // phone: this.sanitizedNum,
2642
+ // isIncomingCall: false,
2643
+ // dial: true,
2644
+ // from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number,
2645
+ // timestamp: new Date().toISOString()
2646
+ // };
2647
+ // console.log('Initiating call with data:', this.callData);
2648
+ // this.isCallInProgress = true;
2649
+ // this.callInitiated.emit({ ...this.callData });
2650
+ // return true;
2651
+ // } else {
2652
+ // this.shakeDedicatedBtn = true;
2653
+ // this.showDialAlert('Select a C2C number to call');
2654
+ // setTimeout(() => {
2655
+ // this.shakeDedicatedBtn = false;
2656
+ // }, 3000);
2657
+ // return false;
2658
+ // }
2659
+ // //this.callingOpenEvent.emit({ phone: this.dialedNumber });
2660
+ // } else {
2661
+ // await this.askForMicrophonePermission();
2662
+ // }
2663
+ // //this.clearAllDialed();
2664
+ // // } else {
2665
+ // // swal('Error', 'Trial period is over. Please setup payment method to continue services')
2666
+ // // }
2667
+ // }catch(e){
2668
+ // console.error('Error in initiateCall:', e);
2669
+ // this.showDialAlert('Failed to initiate call. Please try again.');
2670
+ // this.isCallInProgress = false;
2671
+ // return false;
2672
+ // }
2673
+ // }
2674
+ initiateCall() {
2502
2675
  return __awaiter(this, void 0, void 0, function* () {
2503
- const options = {
2504
- codecPreferences: ['opus', 'pcmu'],
2505
- closeProtection: true,
2506
- };
2507
- this.device = new Device(token.value, options);
2508
- this.call = yield this.device.connect({
2509
- params: {
2510
- From: callData.from,
2511
- To: callData.phone,
2512
- Env: environment.abb,
2513
- Token: token.id,
2514
- Ext: callData.extNum
2515
- },
2516
- rtcConstraints: { audio: { deviceId: 'default' } },
2517
- });
2518
- this.setupEventListeners();
2519
- });
2520
- }
2521
- setupEventListeners() {
2522
- var _a, _b, _c, _d, _e, _f, _g;
2523
- this.startTimer();
2524
- (_a = this.device) === null || _a === void 0 ? void 0 : _a.on('error', (err) => {
2525
- console.log(err);
2526
- this.showRingAnimation = false;
2527
- this.stopTimer();
2528
- });
2529
- (_b = this.call) === null || _b === void 0 ? void 0 : _b.on('error', (error) => {
2530
- this.showRingAnimation = false;
2531
- this.stopTimer();
2532
- });
2533
- (_c = this.call) === null || _c === void 0 ? void 0 : _c.on('disconnect', () => {
2534
- this.endCall();
2535
- });
2536
- (_d = this.call) === null || _d === void 0 ? void 0 : _d.on('ringing', () => {
2537
- });
2538
- (_e = this.call) === null || _e === void 0 ? void 0 : _e.on('reject', () => {
2539
- this.endCall();
2540
- });
2541
- (_f = this.call) === null || _f === void 0 ? void 0 : _f.on('accept', () => {
2542
- this.showRingAnimation = false;
2543
- this.disbaleEndCallBtn = false;
2544
- // Start recording if recordCall is true and call is accepted for 30 seconds
2545
- // if (this.recordCall) {
2546
- // setTimeout(() => {
2547
- // if (this.isRecording) return; // If already recording, skip
2548
- // this.startRecording();
2549
- // }, 30000);
2550
- // } else {
2551
- // this.stopRecording();
2552
- // }
2553
- });
2554
- (_g = this.call) === null || _g === void 0 ? void 0 : _g.on('messageReceived', (message) => {
2555
- });
2556
- }
2557
- startTimer() {
2558
- let seconds = 0;
2559
- this.intervalId = setInterval(() => {
2560
- seconds++;
2561
- this.timer = this.formatTime(seconds);
2562
- }, 1000);
2563
- }
2564
- stopTimer() {
2565
- clearInterval(this.intervalId);
2566
- this.timer = '00:00';
2567
- }
2568
- formatTime(totalSeconds) {
2569
- const minutes = Math.floor(totalSeconds / 60);
2570
- const seconds = totalSeconds % 60;
2571
- return `${this.pad(minutes)}:${this.pad(seconds)}`;
2572
- }
2573
- pad(value) {
2574
- return value < 10 ? `0${value}` : `${value}`;
2575
- }
2576
- handleError(error) {
2577
- swal("Error", error, "error");
2578
- }
2579
- endCall() {
2580
- this.endCallEvent.emit();
2581
- if (this.call) {
2582
- this.call.disconnect();
2583
- }
2584
- this.showRingAnimation = false;
2585
- this.stopTimer();
2586
- this.maximiseDialpad();
2587
- }
2588
- toggleMute() {
2589
- var _a;
2590
- this.isMute = !this.isMute;
2591
- (_a = this.call) === null || _a === void 0 ? void 0 : _a.mute(this.isMute);
2592
- }
2593
- toggleKeypad() {
2594
- this.showKeypad = !this.showKeypad;
2595
- this.callInput = '';
2596
- }
2597
- onCallInputs(num) {
2598
- var _a;
2599
- try {
2600
- if (Number.isInteger(num) || num == '+' || num == '*' || num == '#') {
2601
- if (num == '#') {
2602
- new Audio(`/assets/dial-tones/dtmf/dtmf-hash-.mp3`).play();
2676
+ try {
2677
+ if (!this.dialedNumber && this.lastDialed) {
2678
+ this.sanitizedNum = this.lastDialed.number;
2603
2679
  }
2604
- else if (num == '*') {
2605
- new Audio(`/assets/dial-tones/dtmf/dtmf-star-.mp3`).play();
2680
+ const isInvalid = yield this.isInvalidNumber();
2681
+ if (isInvalid) {
2682
+ return false;
2606
2683
  }
2607
- else {
2608
- new Audio(`/assets/dial-tones/dtmf/dtmf-${num}-.mp3`).play();
2684
+ // this.saveLastDialed();
2685
+ this.isSavedContactDialled();
2686
+ this.isPaymentDue = localStorage.getItem('paymentDue') === 'false' ? false : true;
2687
+ if (this.isPaymentDue) {
2688
+ // swal('Warning', 'Please note that your payment is due, To continue on your services kindly subscribe to use uninterrupted services.');
2689
+ return false;
2609
2690
  }
2610
- this.callInput = this.callInput + String(num);
2611
- this.showClearBtn = true;
2612
- }
2613
- let str = String(num);
2614
- (_a = this.call) === null || _a === void 0 ? void 0 : _a.sendDigits(str);
2615
- }
2616
- catch (e) {
2617
- console.log(e);
2618
- }
2619
- }
2620
- onCallInputEnter(ev) {
2621
- var _a;
2622
- try {
2623
- (_a = this.call) === null || _a === void 0 ? void 0 : _a.sendDigits(String(ev.key));
2624
- }
2625
- catch (e) {
2626
- console.log(e);
2627
- }
2628
- }
2629
- closeIncomingCall(data) {
2630
- // this.incomingCallDiv = false;
2631
- if (data.show) {
2632
- //this.showCallProgressEvent.emit()
2633
- // handle incoming call accepted
2634
- this.startTimer();
2635
- this.disbaleEndCallBtn = false;
2636
- this.call = data.call;
2637
- const incomingDetail = this.extensionService.getCallSid();
2638
- this.incomingRecordCall = incomingDetail.recordCall;
2639
- // Start recording if the call is answered and recording is enabled
2640
- if (this.incomingRecordCall) {
2641
- this.startRecording();
2642
- }
2643
- else {
2644
- this.isRecording = false;
2645
- }
2646
- this.cdr.detectChanges();
2647
- }
2648
- else {
2649
- // incoming call rejected
2650
- this.endCallEvent.emit();
2651
- }
2652
- }
2653
- clearInputs() {
2654
- this.callInput = this.callInput.slice(0, -1);
2655
- }
2656
- minimiseDialpad() {
2657
- this.minimiseEvent.emit(true);
2658
- this.isMinimised = true;
2659
- }
2660
- maximiseDialpad() {
2661
- this.minimiseEvent.emit(false);
2662
- this.isMinimised = false;
2663
- }
2664
- toggleRecording() {
2665
- if (this.isRecording) {
2666
- this.stopRecording();
2667
- }
2668
- else {
2669
- this.startRecording();
2670
- }
2671
- }
2672
- startRecording() {
2673
- let sid;
2674
- const details = this.extensionService.getCallSid();
2675
- this.incomingCallSid = details.callSid;
2676
- this.incomingRecordCall = details.recordCall;
2677
- sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
2678
- // if (!this.incomingRecordCall && !this.recordCall) {
2679
- // return;
2680
- // }
2681
- this.extensionService.getCallRecording(sid).subscribe(response => {
2682
- this.isRecording = true;
2683
- this.isPaused = false;
2684
- this.timeElapsed = 0;
2685
- this.startTimer1();
2686
- }, error => {
2687
- console.error('Error starting recording', error);
2688
- });
2689
- }
2690
- stopRecording() {
2691
- // if (!this.incomingRecordCall && !this.recordCall) {
2692
- // return;
2693
- // }
2694
- this.isRecording = false;
2695
- this.isPaused = false;
2696
- if (this.timerSubscription) {
2697
- this.timerSubscription.unsubscribe();
2698
- }
2699
- }
2700
- pauseRecording() {
2701
- const details = this.extensionService.getCallSid();
2702
- this.incomingCallSid = details.callSid;
2703
- this.incomingRecordCall = details.recordCall;
2704
- const sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
2705
- // if (!this.incomingRecordCall && !this.recordCall) {
2706
- // return;
2707
- // }
2708
- this.extensionService.pauseOrResumeRecording(sid, 'pause').subscribe(response => {
2709
- this.stopRecordingTimer();
2710
- this.isPaused = true;
2711
- }, error => {
2712
- console.error('Error pausing recording:', error);
2713
- // Consider updating the UI to show the error state
2691
+ this.isTrialPeriodOver = localStorage.getItem('trialOver') === 'false' ? false : true;
2692
+ if (this.sanitizedNum === localStorage.getItem('twilioNumber')) {
2693
+ // swal('Error', 'You can not dial this number');
2694
+ return false;
2695
+ }
2696
+ // const hasPermission = await this.checkMicrophonePermission();
2697
+ // if (!hasPermission) {
2698
+ // await this.askForMicrophonePermission();
2699
+ // return false;
2700
+ // }
2701
+ if (!this.selectedCallerId) {
2702
+ this.shakeDedicatedBtn = true;
2703
+ this.showDialAlert('Select a C2C number to call');
2704
+ setTimeout(() => {
2705
+ this.shakeDedicatedBtn = false;
2706
+ }, 3000);
2707
+ return false;
2708
+ }
2709
+ // Clear displayNum if value is bound from previous call
2710
+ this.callData.displayNum = '';
2711
+ // Get number to be dialed from backend
2712
+ // await this.getToNumber(this.sanitizedNum);
2713
+ if (this.terminateCall) {
2714
+ this.terminateCall = false;
2715
+ return;
2716
+ }
2717
+ // Update call data in a single operation
2718
+ this.callData = Object.assign(Object.assign({}, this.callData), { phone: this.sanitizedNum, isIncomingCall: false, dial: true, from: this.isSmartDialCall ? this.callData.from : this.selectedCallerId.number, timestamp: new Date().toISOString() });
2719
+ console.log('Initiating call with data:', this.callData);
2720
+ this.isCallInProgress = true;
2721
+ this.callInitiated.emit(Object.assign({}, this.callData));
2722
+ return true;
2723
+ }
2724
+ catch (e) {
2725
+ console.error('Error in initiateCall:', e);
2726
+ this.showDialAlert('Failed to initiate call. Please try again.');
2727
+ this.isCallInProgress = false;
2728
+ return false;
2729
+ }
2714
2730
  });
2715
2731
  }
2716
- resumeRecording() {
2717
- let sid;
2718
- const details = this.extensionService.getCallSid();
2719
- this.incomingCallSid = details.callSid;
2720
- this.incomingRecordCall = details.recordCall;
2721
- sid = this.incomingCallSid ? this.incomingCallSid : this.callSid;
2722
- // if (!this.incomingRecordCall && !this.recordCall) {
2723
- // return; // Skip if recording is not enabled
2724
- // }
2725
- this.extensionService.pauseOrResumeRecording(sid, 'resume').subscribe(response => {
2726
- this.isPaused = false;
2727
- this.startTimer1();
2728
- }, error => {
2729
- console.error('Error resuming recording', error);
2732
+ isInvalidNumber() {
2733
+ return __awaiter(this, void 0, void 0, function* () {
2734
+ try {
2735
+ if (this.sanitizedNum == '') {
2736
+ this.showDialAlert('Invalid Number');
2737
+ return true;
2738
+ }
2739
+ const validNumberPattern = /^[+\d\s()-]*$/; // Regular expression to match valid characters
2740
+ const phoneNumber = this.sanitizedNum;
2741
+ if (!validNumberPattern.test(phoneNumber)) {
2742
+ this.showDialAlert('Invalid Number');
2743
+ return true;
2744
+ }
2745
+ return false;
2746
+ }
2747
+ catch (error) {
2748
+ this.showDialAlert('Invalid Number');
2749
+ return true; // Return true if an error occurred, meaning the number is invalid
2750
+ }
2730
2751
  });
2731
2752
  }
2732
- startTimer1() {
2733
- this.timerSubscription = interval(1000).subscribe(() => {
2734
- this.timeElapsed++;
2753
+ // saveLastDialed() {
2754
+ // const contact = this.filteredContactList.find(c => c.numbersList.some(n => n.number === this.dialedNumber));
2755
+ // if (contact) {
2756
+ // this.lastDialed = {
2757
+ // name: contact.name,
2758
+ // image: contact.image,
2759
+ // number: this.dialedNumber
2760
+ // };
2761
+ // } else {
2762
+ // if(this.dialedNumber){
2763
+ // this.lastDialed = { number: this.dialedNumber };
2764
+ // }
2765
+ // }
2766
+ // }
2767
+ isSavedContactDialled() {
2768
+ let phoneNum = this.sanitizedNum.replace(/\s+/g, '');
2769
+ let contact = this.contactList.filter(contact => {
2770
+ // return contact.numbersList.some(num => num.number === phoneNum)
2735
2771
  });
2736
- }
2737
- stopRecordingTimer() {
2738
- if (this.timerSubscription) {
2739
- this.timerSubscription.unsubscribe(); // Pause the timer
2740
- this.timerSubscription = undefined; // Optionally reset the subscription
2772
+ if (contact.length) {
2773
+ this.callData.name = `${contact[0].firstName} ${contact[0].middleName} ${contact[0].lastName}`.toLowerCase();
2774
+ this.callData.img = contact[0].image || 'assets/images/user.jpg';
2775
+ this.callData.phone = this.sanitizedNum;
2776
+ return true;
2741
2777
  }
2778
+ return false;
2742
2779
  }
2743
- getFormattedTime() {
2744
- const minutes = Math.floor(this.timeElapsed / 60);
2745
- const seconds = this.timeElapsed % 60;
2746
- return `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
2780
+ showDialAlert(message) {
2781
+ this.dialAlert = {
2782
+ msg: message,
2783
+ show: true
2784
+ };
2785
+ setTimeout(() => {
2786
+ this.dialAlert.show = false;
2787
+ }, 3000);
2747
2788
  }
2748
- pollCallStatus(callAuthId) {
2749
- const maxTime = 30000; // Poll for up to 30 seconds
2750
- const pollInterval = 3000; // Poll every 3 seconds
2751
- let elapsedTime = 0;
2752
- const intervalId = setInterval(() => __awaiter(this, void 0, void 0, function* () {
2753
- elapsedTime += pollInterval;
2789
+ isCallerIdSet() {
2790
+ return __awaiter(this, void 0, void 0, function* () {
2754
2791
  try {
2755
- const statusResponse = yield this.extensionService.getCallStatus(callAuthId).toPromise();
2756
- if (statusResponse && statusResponse.callDetails) {
2757
- this.callStatus = statusResponse.callDetails.callStatus;
2758
- if (this.callStatus === 'in-progress') {
2759
- this.callSid = statusResponse.callDetails.callSid;
2760
- if (this.recordCall && !this.isRecording) {
2761
- this.startRecording();
2762
- }
2763
- clearInterval(intervalId);
2764
- }
2765
- else if (this.callStatus === 'completed') {
2766
- clearInterval(intervalId);
2767
- this.endCall();
2768
- this.stopRecording();
2769
- }
2770
- else if (this.callStatus === 'ringing') {
2771
- // Continue polling; do not clear the interval yet
2772
- }
2792
+ const tkn = localStorage.getItem('ext_token');
2793
+ const res = yield this.extService.fetchCallerId(tkn || '').toPromise();
2794
+ if (res.status == 200) {
2795
+ localStorage.setItem('trialOver', res.trialOver);
2796
+ this.twilioService.isTrialOver.next(res.trialOver);
2797
+ localStorage.setItem('paymentDue', res.paymentDue);
2798
+ this.twilioService.isPaymentDue.next(res.paymentDue);
2773
2799
  }
2800
+ if (res.callerid) {
2801
+ localStorage.setItem('callerID', res.callerid);
2802
+ this.extService.changeMessage(res.callerid);
2803
+ }
2804
+ else {
2805
+ localStorage.setItem('callerID', 'Not set');
2806
+ this.extService.changeMessage('Not set');
2807
+ }
2808
+ return (localStorage.getItem('callerID') !== 'Not set');
2774
2809
  }
2775
- catch (error) {
2776
- clearInterval(intervalId);
2777
- }
2778
- if (elapsedTime >= maxTime) {
2779
- // console.log('Max polling time reached. Stopping poll.');
2780
- clearInterval(intervalId);
2810
+ catch (e) {
2811
+ console.log(e);
2812
+ return false;
2781
2813
  }
2782
- }), pollInterval);
2783
- }
2784
- getUserInformation(id) {
2785
- this.extensionService.getUserInformation(id).subscribe(response => {
2786
- console.log(response);
2787
- }, error => {
2788
- console.error('Error starting recording', error);
2789
2814
  });
2790
2815
  }
2791
- incomingCallsNewList(data) {
2792
- this.newIncomingCallsList = data;
2793
- this.incomingCallsNewInfo.emit(this.newIncomingCallsList);
2794
- }
2795
- selectedIncomingCallInfo(data) {
2796
- this.selectedIncomingCall = data;
2797
- }
2798
- ngOnDestroy() {
2799
- this.callData.dial = false;
2800
- if (this.timerSubscription) {
2801
- this.timerSubscription.unsubscribe();
2802
- }
2803
- }
2804
- }
2805
- CallProgressComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallProgressComponent, deps: [{ token: ExtensionService }, { token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
2806
- CallProgressComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CallProgressComponent, selector: "lib-call-progress", inputs: { callData: "callData", newIncomingCallData: "newIncomingCallData", newIncomingCallsList: "newIncomingCallsList" }, outputs: { endCallEvent: "endCallEvent", incomingCallsNewInfo: "incomingCallsNewInfo", minimiseEvent: "minimiseEvent", incomingCallInitiated: "incomingCallInitiated" }, usesOnChanges: true, ngImport: i0, template: "<p>call-progress works!</p>\n", styles: [".call-container{width:385px;height:646px;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{height:660px!important}.incoming-call-container{width:752px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto 0;border-radius:100%;border:solid 4px #fff;display:flex;align-items:center;justify-content:center}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.call-animation-play{animation:play 3s linear infinite}.call-info-wrapper{height:20px;overflow-y:auto;background:white;transition:height 1s}.open-collops{height:180px!important}.avatar-img{width:94px;height:94px;border-radius:100%}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{width:230px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:12px 0 0;color:#fff;text-transform:capitalize;text-align:center}.callerDetails h4{margin:0;color:#fff}.callerDetails p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:60px;height:60px;background-color:#fff;border-radius:30px;box-sizing:border-box;border:2px solid white;margin:0 16px}.end-call-btn{background-color:#e14e4e}.end-call-btn span{color:#fff!important}.call-btn span{color:#234de8}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.call-action-btns{text-align:center}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.sendDigit{position:relative;text-align:center;width:80%;margin:auto;background-color:#ffffff1a;padding:2px 0;border-radius:3px}.input-clear-btn{position:absolute;right:6px;color:#fff;cursor:pointer}#minimize-btn-div{position:absolute;right:14px;top:12px;z-index:10}.minimize-btn{color:#fff;cursor:pointer}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}app-incoming-call{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1001}.min-call-container{width:320px;height:124px;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;flex-direction:column;box-sizing:border-box;position:relative;overflow:hidden;margin:auto;align-items:center;padding:12px 16px;color:#fff}.min-call-animation{background:#fff;width:48px;height:48px;position:relative;margin:0 12px 0 auto;border-radius:100%;border:solid 2px #fff}.min-avatar-img{width:46px;height:46px;border-radius:100%;position:absolute;left:0;top:0}.min-callerDetails{color:#fff;display:flex;flex-direction:column;align-items:flex-start}.name{width:170px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:20px;margin:0;color:#fff}.min-callerDetails p{margin:0;color:#fff}.min-btn-container{position:relative;display:flex;width:100%;justify-content:flex-start;align-items:center;margin-top:6px}.min-call-sec-btn{width:40px;height:40px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:20px;display:flex;align-items:center;justify-content:center;margin-right:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.min-call-sec-btn span{color:#cccbcb}.min-call-btn{width:40px;height:40px;border-radius:20px;box-sizing:border-box;border:2px solid white;display:flex;align-items:center;justify-content:center}.fullscreen{position:absolute;right:18px;top:14px;color:#e8e8e8;font-size:18px;cursor:pointer}.btn-container{display:flex;flex-wrap:wrap;padding:0 24px}.dial-btn{width:40px;height:40px;background-color:transparent;text-align:center;box-sizing:border-box;margin:4px 25px;font-size:24px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#b5b5b5;cursor:pointer}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.min-timer{width:50px;font-size:18px;margin-right:10px;border-radius:4px;height:35px;display:flex;align-items:center}.record-action-btns{display:flex;flex-direction:column;align-items:center}.record-btn-container{position:relative}.record-btn{border:none;border-radius:50%;width:50px;height:50px;display:flex;align-items:center;justify-content:center;cursor:pointer;margin:0 5px;position:relative;overflow:hidden}.record-btn.start-stop .recording-icon{width:50%;height:50%;border-radius:50%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.record-btn.start-stop.recording .recording-icon{background-color:#000}.record-btn.start-stop.recording{border:3px solid #000}.record-btn.start-stop.stopped .recording-icon{background-color:red;border:3px solid #ff0000;border-radius:50%;position:absolute}.record-btn.start-stop.stopped{border:3px solid #ff0000}.record-btn.start-stop.stopped .recording-icon{width:40%;height:40%;border-radius:0;background-color:red}.pause-resume-btns{display:flex;flex-direction:column;align-items:center;margin-top:10px}.record-btn.pause-resume{border:none;border-radius:50%;width:50px;height:50px;background:white;display:flex;align-items:center;justify-content:center;margin:5px 0}.record-btn.pause-resume .material-symbols-outlined{font-size:20px;color:#000}.timer-display{font-size:1.2em;margin-top:10px;color:#000}.w-40{width:40%}.w-60{width:60%}\n"] });
2807
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallProgressComponent, decorators: [{
2808
- type: Component,
2809
- args: [{ selector: 'lib-call-progress', template: "<p>call-progress works!</p>\n", styles: [".call-container{width:385px;height:646px;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{height:660px!important}.incoming-call-container{width:752px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto 0;border-radius:100%;border:solid 4px #fff;display:flex;align-items:center;justify-content:center}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.call-animation-play{animation:play 3s linear infinite}.call-info-wrapper{height:20px;overflow-y:auto;background:white;transition:height 1s}.open-collops{height:180px!important}.avatar-img{width:94px;height:94px;border-radius:100%}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{width:230px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin:12px 0 0;color:#fff;text-transform:capitalize;text-align:center}.callerDetails h4{margin:0;color:#fff}.callerDetails p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:60px;height:60px;background-color:#fff;border-radius:30px;box-sizing:border-box;border:2px solid white;margin:0 16px}.end-call-btn{background-color:#e14e4e}.end-call-btn span{color:#fff!important}.call-btn span{color:#234de8}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.call-action-btns{text-align:center}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.sendDigit{position:relative;text-align:center;width:80%;margin:auto;background-color:#ffffff1a;padding:2px 0;border-radius:3px}.input-clear-btn{position:absolute;right:6px;color:#fff;cursor:pointer}#minimize-btn-div{position:absolute;right:14px;top:12px;z-index:10}.minimize-btn{color:#fff;cursor:pointer}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}app-incoming-call{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1001}.min-call-container{width:320px;height:124px;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;flex-direction:column;box-sizing:border-box;position:relative;overflow:hidden;margin:auto;align-items:center;padding:12px 16px;color:#fff}.min-call-animation{background:#fff;width:48px;height:48px;position:relative;margin:0 12px 0 auto;border-radius:100%;border:solid 2px #fff}.min-avatar-img{width:46px;height:46px;border-radius:100%;position:absolute;left:0;top:0}.min-callerDetails{color:#fff;display:flex;flex-direction:column;align-items:flex-start}.name{width:170px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:20px;margin:0;color:#fff}.min-callerDetails p{margin:0;color:#fff}.min-btn-container{position:relative;display:flex;width:100%;justify-content:flex-start;align-items:center;margin-top:6px}.min-call-sec-btn{width:40px;height:40px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:20px;display:flex;align-items:center;justify-content:center;margin-right:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.min-call-sec-btn span{color:#cccbcb}.min-call-btn{width:40px;height:40px;border-radius:20px;box-sizing:border-box;border:2px solid white;display:flex;align-items:center;justify-content:center}.fullscreen{position:absolute;right:18px;top:14px;color:#e8e8e8;font-size:18px;cursor:pointer}.btn-container{display:flex;flex-wrap:wrap;padding:0 24px}.dial-btn{width:40px;height:40px;background-color:transparent;text-align:center;box-sizing:border-box;margin:4px 25px;font-size:24px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#b5b5b5;cursor:pointer}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.min-timer{width:50px;font-size:18px;margin-right:10px;border-radius:4px;height:35px;display:flex;align-items:center}.record-action-btns{display:flex;flex-direction:column;align-items:center}.record-btn-container{position:relative}.record-btn{border:none;border-radius:50%;width:50px;height:50px;display:flex;align-items:center;justify-content:center;cursor:pointer;margin:0 5px;position:relative;overflow:hidden}.record-btn.start-stop .recording-icon{width:50%;height:50%;border-radius:50%;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.record-btn.start-stop.recording .recording-icon{background-color:#000}.record-btn.start-stop.recording{border:3px solid #000}.record-btn.start-stop.stopped .recording-icon{background-color:red;border:3px solid #ff0000;border-radius:50%;position:absolute}.record-btn.start-stop.stopped{border:3px solid #ff0000}.record-btn.start-stop.stopped .recording-icon{width:40%;height:40%;border-radius:0;background-color:red}.pause-resume-btns{display:flex;flex-direction:column;align-items:center;margin-top:10px}.record-btn.pause-resume{border:none;border-radius:50%;width:50px;height:50px;background:white;display:flex;align-items:center;justify-content:center;margin:5px 0}.record-btn.pause-resume .material-symbols-outlined{font-size:20px;color:#000}.timer-display{font-size:1.2em;margin-top:10px;color:#000}.w-40{width:40%}.w-60{width:60%}\n"] }]
2810
- }], ctorParameters: function () { return [{ type: ExtensionService }, { type: i0.ChangeDetectorRef }]; }, propDecorators: { callData: [{
2811
- type: Input
2812
- }], newIncomingCallData: [{
2813
- type: Input
2814
- }], newIncomingCallsList: [{
2815
- type: Input
2816
- }], endCallEvent: [{
2817
- type: Output
2818
- }], incomingCallsNewInfo: [{
2819
- type: Output
2820
- }], minimiseEvent: [{
2821
- type: Output
2822
- }], incomingCallInitiated: [{
2823
- type: Output
2824
- }] } });
2825
-
2826
- const GlobalConstant = {
2827
- ErrorMsg500: "Unable to process request. Please try again later.",
2828
- isSMSVisible: true,
2829
- dedicatedNumText: 'C2C Number'
2830
- };
2831
-
2832
- class IncomingCallComponent {
2833
- constructor(extensionService, twilioService) {
2834
- this.extensionService = extensionService;
2835
- this.twilioService = twilioService;
2836
- this.showRingAnimation = true;
2837
- this.selectedIncomingCall = {};
2838
- this.twilioAuthId = '';
2839
- this.dedicatedNum = '';
2840
- this.recordCall = false;
2841
- this.shouldRecordCall = false;
2842
- this.isClickExpand = false;
2843
- this.disbaleEndCallBtn = true;
2844
- this.closeIncomingCallDiv = new EventEmitter();
2845
- this.incomingCallsNewList = new EventEmitter();
2846
- this.selectedIncomingCallInfo = new EventEmitter();
2847
- this.isMute = false;
2848
- }
2849
- ngOnInit() {
2850
- try {
2851
- this.twilioService.currentCall.subscribe(call => {
2852
- if (call) {
2853
- this.twilioCallData = call;
2854
- this.twilioAuthId = call.customParameters.get('twilioAuthId') || '';
2855
- if (!call.parameters) {
2856
- call.parameters = {};
2857
- }
2858
- this.sendIPforIncomingCall(this.twilioAuthId, '');
2859
- call.on('cancel', () => {
2860
- if (this.incomingCallData && this.incomingCallData.parameters && this.incomingCallData.parameters.CallSid) {
2861
- this.newIncomingCallsList = this.newIncomingCallsList.filter((item) => item.parameters && item.parameters.CallSid !== this.incomingCallData.parameters.CallSid);
2862
- }
2863
- this.rejectCallFromList(call);
2864
- });
2865
- call.on('disconnect', () => {
2866
- if (this.incomingCallData && this.incomingCallData.parameters && this.incomingCallData.parameters.CallSid) {
2867
- this.newIncomingCallsList = this.newIncomingCallsList.filter((item) => item.parameters && item.parameters.CallSid !== this.incomingCallData.parameters.CallSid);
2868
- }
2869
- this.rejectCallFromList(call);
2870
- });
2816
+ checkMicrophonePermission() {
2817
+ return __awaiter(this, void 0, void 0, function* () {
2818
+ try {
2819
+ const stream = yield navigator.mediaDevices.getUserMedia({ audio: true });
2820
+ stream.getTracks().forEach(track => track.stop());
2821
+ return true;
2822
+ }
2823
+ catch (error) {
2824
+ if (error instanceof DOMException && error.name === 'NotAllowedError') {
2825
+ return false;
2871
2826
  }
2872
- });
2873
- }
2874
- catch (e) {
2875
- console.log(e);
2876
- }
2827
+ else {
2828
+ return false;
2829
+ }
2830
+ }
2831
+ });
2832
+ }
2833
+ askForMicrophonePermission() {
2834
+ return __awaiter(this, void 0, void 0, function* () {
2835
+ try {
2836
+ const stream = yield navigator.mediaDevices.getUserMedia({ audio: true });
2837
+ stream.getTracks().forEach(track => track.stop());
2838
+ }
2839
+ catch (error) {
2840
+ console.error('User denied microphone permission:', error);
2841
+ }
2842
+ });
2877
2843
  }
2878
- acceptCallFromList(data) {
2879
- console.log(data, 'checking dii');
2880
- data.accept();
2881
- // data.parameters['isCallConnected'] = true;
2882
- data.isCallConnected = true;
2883
- this.sendIPforIncomingCall(data.customParameters.get('twilioAuthId'), 'answered').then(() => {
2884
- if (this.shouldRecordCall) { // default recording
2885
- this.extensionService.setCallSid(this.CallSid, this.recordCall);
2886
- this.closeIncomingCallWrapper(1);
2844
+ // below function is to get the country code with number from server
2845
+ getToNumber(dialedNumber) {
2846
+ return __awaiter(this, void 0, void 0, function* () {
2847
+ if (dialedNumber[0] !== '+') {
2848
+ // this is case when user geolocation dial code is on
2849
+ let ipAddress = yield this.ipService.getIpAddressInfo().toPromise();
2850
+ const res = yield this.twilioService.getToNumber(dialedNumber, ipAddress.address.countryCode).toPromise();
2851
+ if (res.status == 200) {
2852
+ this.toastTimeout = res.timeInterval * 1000;
2853
+ yield this.showNumberToast(res);
2854
+ }
2887
2855
  }
2888
- else { // manual recording
2889
- this.extensionService.setCallSid(this.CallSid, this.recordCall);
2890
- this.closeIncomingCallWrapper(1);
2856
+ });
2857
+ }
2858
+ isAlertEnable() {
2859
+ return localStorage.getItem('isAlertEnable');
2860
+ }
2861
+ showNumberToast(data) {
2862
+ return __awaiter(this, void 0, void 0, function* () {
2863
+ const isAlertOn = (localStorage.getItem('isCountryCodeToastOn'));
2864
+ if (isAlertOn == 'true') {
2865
+ this.callNumberToast.show = true;
2866
+ this.callNumberToast.number = data.toNumber;
2867
+ this.callNumberToast.displayNum = data.displayNumber;
2891
2868
  }
2869
+ this.callData.displayNum = data.displayNumber;
2870
+ //this.callData.phone = data.toNumber;
2871
+ yield this.delay(this.toastTimeout);
2872
+ this.dialedNumber = data.toNumber;
2873
+ this.sanitizedNum = data.toNumber;
2874
+ this.callNumberToast.show = false;
2875
+ this.callNumberToast.number = '';
2876
+ this.callNumberToast.displayNum = '';
2892
2877
  });
2893
2878
  }
2894
- rejectCallFromList(data) {
2895
- if (!data)
2896
- return;
2897
- if (data.reject)
2898
- data.reject();
2899
- if (data.disconnect)
2900
- data.disconnect();
2901
- if (data.parameters) {
2902
- data.parameters['isCallConnected'] = false; // Should be false when rejecting
2903
- }
2904
- if (data.customParameters) {
2905
- this.sendIPforIncomingCall(data.customParameters.get('twilioAuthId'), 'answered');
2879
+ delay(ms) {
2880
+ return new Promise(resolve => setTimeout(resolve, ms));
2881
+ }
2882
+ onMinimise(isMinimised) {
2883
+ this.isMinimised = isMinimised;
2884
+ this.minimiseEvent.emit(isMinimised);
2885
+ }
2886
+ handleNumberPaste(event) {
2887
+ event.preventDefault();
2888
+ const clipboardData = event.clipboardData || window.clipboardData;
2889
+ const pastedData = clipboardData.getData('text');
2890
+ // Log the pasted content to the console
2891
+ if (pastedData) {
2892
+ this.dialedNumber = pastedData;
2893
+ this.sanitizedNum = pastedData;
2906
2894
  }
2907
- if (this.newIncomingCallsList && data && data.parameters && data.parameters.CallSid) {
2908
- this.newIncomingCallsList = this.newIncomingCallsList.filter((item) => item.parameters && item.parameters.CallSid !== data.parameters.CallSid);
2909
- this.incomingCallsNewList.emit(this.newIncomingCallsList);
2910
- if (this.newIncomingCallsList.length == 0) {
2911
- this.closeIncomingCallDiv.emit({ show: 0, call: data });
2895
+ }
2896
+ onEnter(num) {
2897
+ console.log(num, 'number fn');
2898
+ this.dialedNumber = this.dialedNumber + num;
2899
+ this.sanitizedNum = this.dialedNumber;
2900
+ this.showInputClearBtn = true;
2901
+ this.numberDialed.emit(this.dialedNumber);
2902
+ }
2903
+ getUserCallSetting() {
2904
+ const tkn = localStorage.getItem('ext_token');
2905
+ this.extService.fetchCallerId(tkn || '').subscribe((resp) => {
2906
+ if (resp.status == 200) {
2907
+ //this.callPrefernce = resp.userSetting;
2908
+ this.callPreference = resp.callerid;
2909
+ this.getCallerIdList();
2912
2910
  }
2913
- }
2911
+ });
2914
2912
  }
2915
- closeIncomingCallWrapper(val) {
2916
- this.closeIncomingCallDiv.emit({ show: val, call: this.twilioCallData });
2913
+ onDedicatedNumSelect(id) {
2914
+ this.selectedCallerId = id;
2915
+ this.isCallerIdHidden = true;
2916
+ this.extService.setCallerId(id);
2917
2917
  }
2918
- toggleMute(data) {
2919
- this.isMute = !this.isMute;
2920
- data.mute(this.isMute);
2918
+ cancelDialNumber() {
2919
+ this.terminateCall = true;
2920
+ this.callNumberToast.show = false;
2921
2921
  }
2922
- sendIPforIncomingCall(recordId, callstatus) {
2923
- return new Promise((resolve, reject) => {
2924
- this.extensionService.getIPDetailsForCall(recordId, callstatus).subscribe((res) => {
2925
- const resp = res;
2926
- if (res.status == 200) {
2927
- if (resp.callAuth) {
2928
- this.CallSid = resp.callAuth.callSid;
2929
- this.recordCall = resp.callAuth.recordCall;
2930
- // Handle the recordCall flag
2931
- if (resp.callAuth.recordCall) {
2932
- this.shouldRecordCall = true;
2933
- }
2934
- else {
2935
- this.shouldRecordCall = false;
2936
- }
2937
- }
2938
- else {
2939
- // swal("Error", "Missing call authentication details.", "error");
2940
- }
2941
- resolve();
2922
+ handleDivKeydown(ev) {
2923
+ if (this.dialedNumber.length == 0) {
2924
+ this.dialInputElement.nativeElement.focus();
2925
+ }
2926
+ if (ev.key === 'Enter') {
2927
+ // Check if the dialpad is open
2928
+ if (!this.isDialpadHidden) {
2929
+ if (this.dialedNumber.length > 2 && this.selectedCallerId) {
2930
+ this.initiateCall();
2942
2931
  }
2943
- else {
2944
- swal("Error", resp.message.join("<br/>"), "error");
2945
- resolve();
2932
+ if (!this.selectedCallerId) {
2933
+ this.shakeDedicatedBtn = true;
2934
+ setTimeout(() => {
2935
+ this.shakeDedicatedBtn = false;
2936
+ }, 10000);
2946
2937
  }
2947
- }, (error) => {
2948
- swal("Error", GlobalConstant.ErrorMsg500, "error");
2949
- resolve();
2950
- });
2951
- });
2938
+ }
2939
+ }
2952
2940
  }
2953
- onUserInfoByCallSid() {
2954
- if (this.selectedIncomingCall && this.selectedIncomingCall.userInfo) {
2941
+ onCallBtnMouseEnter(ev) {
2942
+ if (!this.selectedCallerId || (this.selectedCallerId == 'alwaysAsk') || (this.selectedCallerId == 'smartDialing')) {
2943
+ this.shakeDedicatedBtn = true;
2955
2944
  }
2956
- return this.selectedIncomingCall ? Object.keys(this.selectedIncomingCall).length ? true : false : false;
2957
2945
  }
2958
- onClickExpand(data) {
2959
- if (this.selectedIncomingCall === data && this.isClickExpand) {
2960
- this.isClickExpand = false;
2961
- this.selectedIncomingCall = null;
2962
- this.selectedIncomingCallInfo.emit({});
2963
- return;
2946
+ onCallBtnMouseLeave(ev) {
2947
+ if (!this.selectedCallerId || (this.selectedCallerId == 'alwaysAsk') || (this.selectedCallerId == 'smartDialing')) {
2948
+ this.shakeDedicatedBtn = false;
2964
2949
  }
2965
- this.isClickExpand = true;
2966
- this.selectedIncomingCall = data;
2967
- if (this.selectedIncomingCall) {
2968
- this.selectedIncomingCall['isClickExpand'] = true;
2969
- if (this.newIncomingCallsList && this.newIncomingCallsList.length > 0) {
2970
- this.newIncomingCallsList.forEach((call) => {
2971
- if (call !== this.selectedIncomingCall) {
2972
- call['isClickExpand'] = false;
2973
- }
2974
- });
2950
+ }
2951
+ acceptNewIncomingCall(call) {
2952
+ //first cut the current call
2953
+ //this.callData = call;
2954
+ this.newIncomingCallData = call;
2955
+ }
2956
+ rejectNewIncomingCall(call) {
2957
+ call.reject();
2958
+ this.newIncomingCalls = this.newIncomingCalls.filter((item) => item.parameters['CallSid'] !== call.parameters['CallSid']);
2959
+ this.incomingCallsList = this.incomingCallsList.filter((item) => item.parameters['CallSid'] !== call.parameters['CallSid']);
2960
+ }
2961
+ newIncomingCallInitiated() {
2962
+ this.isCallInProgress = true;
2963
+ this.newIncomingCalls = [];
2964
+ this.incomingCallInitiated.emit();
2965
+ }
2966
+ incomingCallsNewInfo(data) {
2967
+ this.incomingCallsList = data;
2968
+ this.incomingCallsNewInfoEvent.emit(data);
2969
+ }
2970
+ ngOnDestroy() {
2971
+ try {
2972
+ console.log('Cleaning up C2cDialpadComponent');
2973
+ // Unsubscribe from all subscriptions
2974
+ if (this.subscriptions) {
2975
+ this.subscriptions.unsubscribe();
2975
2976
  }
2976
- this.selectedIncomingCallInfo.emit(this.selectedIncomingCall);
2977
- if (!this.selectedIncomingCall.userInfo || this.selectedIncomingCall.userInfo.status == 201) {
2978
- this.getUserInformation(this.selectedIncomingCall);
2977
+ // End any active call
2978
+ if (this.isCallInProgress) {
2979
+ this.endCall();
2980
+ }
2981
+ // Clear any timeouts or intervals if they exist
2982
+ if (this.toastTimeout) {
2983
+ clearTimeout(this.toastTimeout);
2979
2984
  }
2985
+ console.log('C2cDialpadComponent cleanup complete');
2986
+ }
2987
+ catch (error) {
2988
+ console.error('Error during component cleanup:', error);
2980
2989
  }
2981
- }
2982
- getUserInformation(incomingCallData) {
2983
- let data = this.fromEntries(Array.from(incomingCallData.customParameters.entries()));
2984
- this.extensionService.getUserInformation(data['twilioAuthId']).subscribe(response => {
2985
- setTimeout(() => {
2986
- incomingCallData['userInfo'] = response;
2987
- }, 5000);
2988
- }, error => {
2989
- console.error('Error starting recording', error);
2990
- });
2991
- }
2992
- fromEntries(entries) {
2993
- return entries.reduce((acc, [key, value]) => {
2994
- acc[key] = value;
2995
- return acc;
2996
- }, {});
2997
2990
  }
2998
2991
  }
2999
- IncomingCallComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IncomingCallComponent, deps: [{ token: ExtensionService }, { token: TwilioService }], target: i0.ɵɵFactoryTarget.Component });
3000
- IncomingCallComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: IncomingCallComponent, selector: "lib-incoming-call", inputs: { incomingCallData: "incomingCallData", newIncomingCallsList: "newIncomingCallsList" }, outputs: { closeIncomingCallDiv: "closeIncomingCallDiv", incomingCallsNewList: "incomingCallsNewList", selectedIncomingCallInfo: "selectedIncomingCallInfo" }, ngImport: i0, template: "<div class=\"call-container\" style=\"width: 100%;\" *ngIf=\"newIncomingCallsList.length > 0\">\n <div class=\"collops\">\n <div class=\"d-flex w-100\">\n <div class=\"d-flex flex-column container-fluid\">\n <div class=\"callToNum\">Incoming call <br/><span>{{dedicatedNum}}</span></div>\n <ng-container *ngFor=\"let data of newIncomingCallsList\">\n <div class=\"p-2 \">\n <div class=\"call-info-wrapper w-100 d-flex align-items-center\">\n <div class=\"img\">\n <img class=\"avatar-img-wrapper\" [src]=\"incomingCallData.img\" alt=\"\" width=\"45\" />\n </div>\n <div class=\"d-flex justify-content-between w-100 align-items-center mr-2\">\n <div class=\"callerDetails-wrapper\">\n <h5 class=\"break-word\">{{data?.userInfo?.c2cInformation?.name || '-'}}</h5>\n <p class=\"break-word\">{{data.userInfo?.displayNum ? data.userInfo?.c2cInformation.number : data.userInfo?.c2cInformation.number }}</p>\n </div> \n <div class=\"d-flex align-items-center\">\n <button class=\"call-btn-wrapper receive-btn\" [disabled]=\"!data?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(data)\"> call </span>\n </button>\n <button class=\"call-btn-wrapper mute-btn\" *ngIf=\"data?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (click)=\"toggleMute(data)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"call-btn-wrapper reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(data)\"> call_end </span>\n </button>\n <div class=\"togglearrow-arrow me-2\" id=\"togglearrow\" (click)=\"onClickExpand(data)\"><i class=\"fa fa-angle-right\"></i></div>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n <div class=\"call-container p-3 text-white model-content\" *ngIf=\"isClickExpand\"> \n <div class=\"mb-2\" style=\"width: 100%; height: 100%;\">\n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\n <img class=\"avatar-img\" [src]=\"incomingCallData.img\" alt=\"\" width=\"100\" />\n </div>\n <div class=\"text-center\">\n <h3 class=\"text-white\">{{selectedIncomingCall?.userInfo?.c2cInformation?.name || '-'}}</h3>\n </div>\n <div class=\"f-13\">\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Subject:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.subject || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Email:</div>\n <div>{{selectedIncomingCall?.userInfo?.c2cInformation?.email || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Number:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.number}}</div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Language:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.language || '-'}}</div>\n </div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Extension:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.extension || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Image:</div>\n <div class=\"text-ellipsis\">\n <ng-container *ngIf=\"selectedIncomingCall?.userInfo?.c2cInformation?.image && selectedIncomingCall?.userInfo?.c2cInformation?.image !== '-'; else noImage\">\n <img src=\"{{selectedIncomingCall?.userInfo?.c2cInformation?.image}}\" alt=\"\" width=\"42\" height=\"42\" class=\"ml-2\"/>\n </ng-container>\n <ng-template #noImage>\n <span class=\"ml-2\">No Image Available</span>\n </ng-template>\n </div>\n </div> \n </div>\n\n <div class=\" mb-4\">\n <div class=\"\">\n <div class=\"\">Message:</div>\n <div class=\"text-ellipsis\">{{selectedIncomingCall?.userInfo?.c2cInformation?.message || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Point Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.pointName || '-'}}</div>\n </div>\n <div class=\"col-6 mb-2\">\n <div class=\"\">Source Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.sourceName || '-'}}</div>\n </div>\n </div>\n </div>\n <div class=\"call-action-btns mt-0\">\n <button class=\"call-btn receive-btn\" *ngIf=\"!selectedIncomingCall?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(selectedIncomingCall)\"> call </span>\n </button>\n <button class=\"call-btn mute-btn\" *ngIf=\"selectedIncomingCall?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (click)=\"toggleMute(selectedIncomingCall)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"call-btn reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(selectedIncomingCall)\"> call_end </span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"wave-container\">\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\" [ngStyle]=\"{'width': '756px'}\">\n <defs>\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\n </defs>\n <g class=\"parallax\">\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" /> \n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\n </g>\n </svg>\n </div>\n</div>", styles: [".call-container{width:385px;height:646px;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{display:flex;flex-direction:column;width:100%;height:100%}.container-fluid{width:680px;height:100%;margin-top:10px}.model-content{background-color:#0d6efd;border-radius:20px;width:645px}.calls-side-by-side{position:fixed;top:0;width:30%;height:498px;z-index:1050;pointer-events:auto;display:flex;align-items:flex-start;left:-10rem;transform:translate(.2rem);transition:left 1s ease-in-out}.move{left:41vw!important}.f-13{font-size:13px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto;border-radius:100%;border:solid 4px #fff}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.avatar-img-wrapper{border-radius:100%;margin:0 5px}.call-btn-wrapper{height:38px;background-color:#fff;border-radius:30px;margin:0 4px;opacity:.9;width:40px;span {color: white; line-height: unset !important;}}.hold-btn{background-color:#bebebe26;border:none}.hold-btn span,.mute-btn span{color:#fff!important}.active-hold{background-color:#fff!important}.active-hold span{color:#000!important}.active-mute{background-color:transparent}.call-info-wrapper{border:1px solid white;border-radius:7px;padding:8px 1px!important;word-break:break-all}.call-animation-play{animation:play 3s linear infinite}.avatar-img{width:94px;height:94px;border-radius:100%;position:absolute;left:0;top:0}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{margin:12px 0 0;color:#fff}.callerDetails-wrapper{margin:0 5px;color:#fff;display:flex;flex-direction:column}.callerDetails-wrapper h3,.callerDetails-wrapper h5{margin:0;color:#fff}.togglearrow-arrow{left:100%;background-color:#fff;width:25px;height:25px;text-align:center;cursor:pointer;border:1px solid #ccc;border-radius:50%;line-height:22px}.callerDetails h4{margin:0;color:#fff}.callerDetails p,.callerDetails-wrapper p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;width:50px;height:50px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:48px;height:45px;background-color:#fff;border-radius:30px;box-sizing:border-box;margin:0 8px;opacity:.9}.call-btn:hover{opacity:1}.call-btn span{color:#fff;line-height:unset!important}.receive-btn{background-color:#28a745;border:2px solid #28a745}.mute-btn{position:relative;border:none;background-color:#bebebe26}.reject-btn{background-color:#e03131;border:2px solid #e03131}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.call-action-btns{text-align:center;margin-top:240px}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}.callToNum{color:#fff;font-weight:400;text-align:center}.callToNum span{font-weight:600}.text-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;display:block}\n"], dependencies: [{ kind: "directive", type: i5.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i5.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i5.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i5.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }] });
3001
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: IncomingCallComponent, decorators: [{
2992
+ DialboxComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxComponent, deps: [{ token: TwilioService }, { token: ExtensionService }, { token: IpAddressService }, { token: ExtensionService }, { token: i4.Router }], target: i0.ɵɵFactoryTarget.Component });
2993
+ DialboxComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: DialboxComponent, selector: "lib-dialbox", inputs: { isDialpadHidden: "isDialpadHidden" }, outputs: { closeDialpadEvent: "closeDialpadEvent", callInitiated: "callInitiated", endCallEvent: "endCallEvent", minimiseEvent: "minimiseEvent", incomingCallsNewInfoEvent: "incomingCallsNewInfoEvent", incomingCallInitiated: "incomingCallInitiated", numberDialed: "numberDialed" }, viewQueries: [{ propertyName: "dialInputElement", first: true, predicate: ["dialInput"], descendants: true }], usesOnChanges: true, ngImport: i0, template: "<div>\r\n msssmsm\r\n</div>\r\n<div id=\"dragparent1\" [ngStyle]=\"{'display':isDialpadHidden ? 'none': 'block'}\">\r\n <lib-call-progress *ngIf=\"isCallInProgress\"\r\n (endCallEvent)=\"endCall()\"\r\n (minimiseEvent)=\"onMinimise($event)\"\r\n (incomingCallInitiated)=\"newIncomingCallInitiated()\"\r\n [newIncomingCallData]=\"newIncomingCallData\"\r\n [newIncomingCallsList]=\"incomingCallsList\"\r\n (incomingCallsNewInfo)=\"incomingCallsNewInfo($event)\"\r\n [callData]=\"callData\">\r\n </lib-call-progress>\r\n <div class=\"dialpad-container\" [ngClass]=\"{'mini-dialpad': isMinimised}\" tabindex=\"0\" (keydown)=\"handleDivKeydown($event)\">\r\n <div id=\"topPanel\" [ngStyle]=\"{'height': callerIdList.length ? '40%' : '39%'}\">\r\n <div class=\"dialpad-alerts\" *ngIf=\"dialAlert.show\">\r\n <div class=\"no-selection-alert\">\r\n <!-- <p class=\"mb-0\">Select C2C number to call</p> -->\r\n <p class=\"mb-0\">{{dialAlert.msg}}</p>\r\n <span class=\"fa fa-times\" (click)=\"shakeDedicatedBtn = false\"></span>\r\n </div>\r\n </div>\r\n <div class=\"dialpad-alerts\" *ngIf=\"callNumberToast.show\">\r\n <div class=\"dialbox-pop1 alert fade show\" [ngClass]=\"callNumberToast.type\" role=\"alert\">\r\n <div class=\"d-flex justify-content-between\">\r\n <div class=\"flex-grow-1 my-auto text-left\">\r\n You'r calling <strong>{{callNumberToast.displayNum}}</strong>\r\n </div>\r\n <div class=\"text-right\">\r\n <button class=\"btn btn-link btn-disc p-0 px-1\" (click)=\"cancelDialNumber()\">Cancel Call</button>\r\n <!-- <button class=\"btn btn-link btn-success btn-disc p-0 px-2\">Continue</button> -->\r\n </div>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n <div style=\"padding: 0 18px\" (paste)=\"handleNumberPaste($event)\">\r\n <div class=\"d-flex justify-content-between mt-2\">\r\n <p></p>\r\n <span class=\"material-symbols-outlined dial-close-btn\" (click)=\"hideDialpad()\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#ffffff\"><path d=\"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z\"/></svg>\r\n </span>\r\n </div>\r\n <div class=\"input-box\">\r\n <input type=\"text\" #dialInput placeholder=\"Enter a name or number\" tabindex=\"1\" [(ngModel)]=\"dialedNumber\" (ngModelChange)=\"onDialInputChange($event)\"/>\r\n <span class=\"\" id=\"input-clear-btn\" (click)=\"clearInput()\" *ngIf=\"showInputClearBtn\">\r\n <svg width=\"50px\" height=\"30px\" viewBox=\"0 10 40 60\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" baseProfile=\"full\" enable-background=\"new 0 0 76.00 76.00\" xml:space=\"preserve\">\r\n <path fill=\"#5d6061\" fill-opacity=\"1\" stroke-width=\"0.2\" stroke-linejoin=\"round\" d=\"M 47.5282,42.9497L 42.5784,38L 47.5282,33.0502L 44.9497,30.4718L 40,35.4216L 35.0502,30.4718L 32.4718,33.0502L 37.4216,38L 32.4718,42.9497L 35.0502,45.5282L 40,40.5784L 44.9497,45.5282L 47.5282,42.9497 Z M 18.0147,41.5355L 26.9646,50.4854C 28.0683,51.589 29,52 31,52L 52,52C 54.7614,52 57,49.7614 57,47L 57,29C 57,26.2386 54.7614,24 52,24L 31,24C 29,24 28.0683,24.4113 26.9646,25.5149L 18.0147,34.4645C 16.0621,36.4171 16.0621,39.5829 18.0147,41.5355 Z M 31,49C 30,49 29.6048,48.8828 29.086,48.3641L 20.1361,39.4142C 19.355,38.6332 19.355,37.3669 20.1361,36.5858L 29.086,27.6362C 29.6048,27.1175 30,27 31,27.0001L 52,27.0001C 53.1046,27.0001 54,27.8955 54,29.0001L 54,47.0001C 54,48.1046 53.1046,49.0001 52,49.0001L 31,49 Z \"/>\r\n </svg> \r\n </span>\r\n <span class=\"input-info-icon\" placement=\"bottom-right\" tooltipClass=\"input-tooltip\" ngbTooltip=\"For extension dialing, use formats like +12345678910 x123,+12345678910 ext.123, +12345678910,123\"><i class=\"fa fa-info-circle\"></i></span>\r\n </div>\r\n <div class=\"guide\" *ngIf=\"callerIdList.length && !(dialedNumber.length > 2)\">\r\n <span class=\"guidetext\">Please enter a number or select a saved contact</span>\r\n </div>\r\n <!-- <div class=\"input-error\" *ngIf=\"dialAlert.show\">\r\n <span>{{dialAlert.msg}}</span>\r\n </div> -->\r\n <div>\r\n <div class=\"contact-card\" *ngFor=\"let contact of filteredContactList\" (click)=\"onContactSelect(contact)\">\r\n <div class=\"contact-img\">\r\n <img [src]=\"contact.image\" alt=\"user image\" loading=\"lazy\" *ngIf=\"contact.image else alphaName\"/>\r\n <ng-template #alphaName>\r\n <span class=\"contact-alpha-img\">{{getFirstLetter(contact.firstName)}}</span>\r\n </ng-template>\r\n </div>\r\n <div class=\"contact-details\">\r\n <p style=\"margin-bottom: 4px\" class=\"contact-name\">{{getFullName(contact) }}</p>\r\n <p>{{contact.numbersList[0].number}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"wave-container\">\r\n <svg\r\n class=\"waves\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\r\n viewBox=\"0 24 150 28\"\r\n preserveAspectRatio=\"none\"\r\n shape-rendering=\"auto\"\r\n >\r\n <defs>\r\n <path\r\n id=\"gentle-wave\"\r\n d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\"\r\n />\r\n </defs>\r\n <g class=\"parallax\">\r\n <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"0\"\r\n fill=\"rgba(255,255,255,0.7)\"\r\n />\r\n <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"3\"\r\n fill=\"rgba(255,255,255,0.5)\"\r\n />\r\n <!-- <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"5\"\r\n fill=\"rgba(255,255,255,0.3)\"\r\n /> -->\r\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\r\n </g>\r\n </svg>\r\n </div>\r\n </div>\r\n <div class=\"btn-container\" *ngIf=\"!isMinimised\">\r\n <button class=\"dial-btn\" *ngFor=\"let key of keypadVal;let i = index\"\r\n (keydown.enter)=\"onEnter(key.num)\" (click)=\"addNumber(key.num)\"\r\n [ngStyle]=\"{'margin-top': key.text === '+' ? '3px' : '0'}\"\r\n [tabindex]=\"dialedNumber.length ? '0': i+2\" longPress (longPress)=\"addNumber(key.text)\" shortPress (shortPress)=\"addNumber(key.num)\">\r\n {{key.num}} \r\n <span *ngIf=\"key.num == 1;else otherThanOne\" class=\"material-symbols-outlined voicemail\">\r\n voicemail\r\n </span>\r\n <ng-template #otherThanOne>\r\n <span class=\"btn-albhabets\" [ngClass]=\"{'plusSign': key.text === '+'}\">{{key.text ? key.text : '&nbsp;'}}</span>\r\n </ng-template>\r\n </button>\r\n </div>\r\n <div class=\"call-btn-container\" *ngIf=\"!isMinimised\" (mouseenter)=\"onCallBtnMouseEnter($event)\" (mouseleave)=\"onCallBtnMouseLeave($event)\">\r\n <div class=\"call-btn\" (click)=\"initiateCall()\" [tabindex]=\"dialedNumber.length ? '2': '15'\"\r\n [ngStyle]=\"{'pointer-events': dialedNumber.length && selectedCallerId ? 'auto' : 'none', 'opacity': dialedNumber.length && selectedCallerId ? '1' : '0.5'}\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call\r\n </span>\r\n </div>\r\n </div>\r\n <div *ngIf=\"callerIdList.length && !isMinimised\" class=\"position-relative\">\r\n <div class=\"shownCallerId\" *ngIf=\"selectedCallerId; else askBlock\" (click)=\"toggleCallerIdDiv()\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + selectedCallerId?.isoCode?.toLowerCase()\"></span>\r\n {{selectedCallerId?.number}}\r\n </div>\r\n </div>\r\n <ng-template #askBlock>\r\n <div class=\"shownCallerId\" (click)=\"toggleCallerIdDiv()\" [ngClass]=\"{ 'tilt-shaking': shakeDedicatedBtn }\">\r\n <div class=\"d-flex justify-content-center\">\r\n <h5 class=\"mb-0\">Select C2C number</h5>\r\n <!-- <span class=\"ml-2\" style=\"opacity:.8;margin-top:2px\">\r\n <img src=\"assets/images/icon_down_arrow.svg\" alt=\"down\" width=\"10px\">\r\n </span> -->\r\n <span class=\"fa fa-angle-down ml-2 text-blue\" style=\"margin-top:2px\"></span>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <div class=\"guide2\" *ngIf=\"shakeDedicatedBtn\">\r\n <span class=\"guidetext\">Please select a number from below dropdown</span>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"callerIdList.length; else noCallerIdMessage\">\r\n <div class=\"caller-id-list-container\" *ngIf=\"callerIdList.length && !isMinimised\" id=\"callerIdContainer\" [ngClass]=\"{'visible': !isCallerIdHidden}\" >\r\n <div style=\"display: flex; justify-content: space-between\">\r\n <!-- <h4>Select C2C Softphone Number</h4> -->\r\n <h4>Make outgoing call using</h4>\r\n <span\r\n class=\"material-symbols-outlined\"\r\n style=\"cursor: pointer\"\r\n (click)=\"isCallerIdHidden = true\"\r\n >\r\n close\r\n </span>\r\n </div>\r\n <ul>\r\n <ng-container *ngFor=\"let callerId of callerIdList\">\r\n <li [ngClass]=\"{'selectedCallerIdClass': callerId?.number == selectedCallerId?.number}\" (click)=\"onDedicatedNumSelect(callerId)\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + callerId?.isoCode?.toLowerCase()\"></span>\r\n {{callerId?.number}}\r\n </div>\r\n <span>{{callerId?.countryName}}</span>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </div>\r\n </div>\r\n <ng-template #noCallerIdMessage>\r\n <span class=\"no-caller-id-message\">To make any voice calls, please <a routerLink=\"/extension/dedicatednumber/{{token}}\" class=\"click-here-link\" title=\"Settings > C2C Number\">subscribe</a> to a voice capable C2C Number.\r\n </span>\r\n </ng-template>\r\n <div class=\"dedicated-overlay\" *ngIf=\"showDedicatedPopup\">\r\n <div class=\"card dedicatedNumPopup\">\r\n <div class=\"card-header chooseDedicatedHeader\">\r\n <h5>Choose C2C Number</h5>\r\n <span class=\"material-symbols-outlined dial-close-btn\" (click)=\"showDedicatedPopup = false\">close</span>\r\n </div>\r\n <div class=\"card-body dedicatedNumList\">\r\n <ul>\r\n <ng-container *ngFor=\"let callerId of callerIdList\">\r\n <li [ngClass]=\"{'selectedCallerIdClass': callerId?.number == selectedCallerId?.number}\" (click)=\"showDedicatedPopup = false\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + callerId?.isoCode?.toLowerCase()\"></span>\r\n {{callerId?.number}}\r\n </div>\r\n <span>{{callerId?.countryName}}</span>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"incoming-call-widget\" *ngFor=\"let call of newIncomingCalls;let i = index\" [ngStyle]=\"{'top': (30 + i * 72) + 'px'}\">\r\n <div>\r\n <div class=\"inc-user-img\">\r\n <img src=\"assets/images/user.jpg\" alt=\"user image\">\r\n </div>\r\n \r\n </div>\r\n <div class=\"flex-grow-1\">\r\n <!-- <h6 class=\"mb-1 font-weight-bold\">Incoming Call</h6> -->\r\n <p class=\"inc-user-name\">{{call.customParameters.get('name')}}</p>\r\n <p>{{call.parameters.From}}</p>\r\n\r\n <!-- <p class=\"inc-user-name\">John Doe</p> \r\n <p>+12337472489</p>\r\n <p style=\"font-size: 12px;color:#d5d5d5 !important;margin-top:2px\">Call on +12264584100</p> -->\r\n\r\n </div>\r\n <div class=\"d-flex\">\r\n <button class=\"inc-call-btn inc-accept-btn mr-2\" (click)=\"acceptNewIncomingCall(call)\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call\r\n </span>\r\n </button>\r\n <button class=\"inc-call-btn inc-reject-btn\" (click)=\"rejectNewIncomingCall(call)\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call_end\r\n </span>\r\n </button>\r\n </div>\r\n \r\n </div>\r\n </div>\r\n</div>\r\n", styles: ["#dragparent1{position:fixed;left:100px;z-index:9999999;font-family:Lato,sans-serif;display:none}.dialpad-container{width:320px;height:600px;background:white;margin:auto;border-radius:30px;box-shadow:#00000040 0 54px 55px,#0000001f 0 -12px 30px,#0000001f 0 4px 6px,#0000002b 0 12px 13px,#00000017 0 -3px 5px;display:flex;flex-direction:column;box-sizing:border-box;position:relative;line-height:1.1}.dialpad-alerts{position:absolute;width:calc(100% - 28px);left:14px;top:8px;z-index:1200}.btn-disc{font-size:12px}.dialbox-pop1{font-size:.8rem;z-index:9;padding:8px}.input-error>span{color:#dfdfdf;margin-bottom:2px}.dial-close-btn{cursor:pointer;opacity:.6}.dial-close-btn:hover{opacity:1}.btn-container{display:flex;flex-wrap:wrap;padding:0 18px}.dial-btn{width:50px;height:50px;background-color:#fff;border-radius:4px;text-align:center;box-sizing:border-box;margin:4px 22px;font-size:28px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#2b434d;cursor:pointer;opacity:.8;border:none}.dial-btn:hover{opacity:1;box-shadow:#00000026 0 2px 8px}.dial-btn:focus{opacity:1;box-shadow:#00000026 0 2px 8px}.dial-btn:active{box-shadow:#32325d40 0 30px 60px -12px inset,#0000004d 0 18px 36px -18px inset}.call-btn-container{display:flex;margin-top:8px;justify-content:center;position:relative}.call-btn{display:flex;align-items:center;justify-content:center;width:54px;height:54px;border-radius:27px;background-color:#2ecc71;outline:none;border:none;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;opacity:.8;cursor:pointer}.call-btn:hover{opacity:1}.call-btn:focus{opacity:1}.caller-id-list-container{width:100%;height:auto;position:absolute;bottom:-100%;left:0;border-radius:0 0 30px 30px/0px 0px 30px 30px;padding:8px 12px 32px;box-sizing:border-box;color:#8a8a8a}.visible{animation:slideUp .8s forwards}#callerIdContainer ul{list-style:none;padding-left:0;margin:0}.dialpad-container h4{font-family:Lato,sans-serif;margin:0 0 8px}#callerIdContainer ul li{background-color:#fff;padding:8px;margin-top:7px;display:flex;border-radius:4px;justify-content:space-between;font-size:14px;cursor:pointer}.fi{border-radius:2px;margin-right:2px}@keyframes slideUp{0%{bottom:-100%}to{bottom:0}}.selectedCallerIdClass{box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;border:1px solid #e0e0e0;color:#3a3a3a}.toggleBtn{color:gray;border:none;background-color:#e5eef1}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.plusSign{font-weight:600;font-size:14px}.shownCallerId{text-align:center;padding:8px 10px;font-family:Lato,sans-serif;color:#2ecc71;border:1px solid #d7d7d7;background-color:#fff;width:80%;margin:12px auto auto;border-radius:12px;position:relative;cursor:pointer}.input-box{width:100%;background-color:#fff;padding:4px 10px;border:1px solid rgb(197,197,197);box-sizing:border-box;border-radius:24px;margin-top:12px;display:flex;justify-content:space-between}.input-box:focus-within{box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026}.input-box input{font-size:18px;padding:8px 6px;width:100%;box-sizing:border-box;border:none;outline:none;font-weight:600;color:#2b434d}.input-box input::placeholder{font-size:16px;font-weight:500}#input-clear-btn{color:gray;display:flex;align-items:center;cursor:pointer}.contact-card{width:100%;height:54px;display:flex;border-radius:12px;overflow:hidden;margin-top:4px;box-shadow:6px 6px 10px -1px #e6eefc26;cursor:pointer;opacity:0;transform:translateY(20px);animation:slideIn .5s forwards}@keyframes slideIn{to{opacity:1;transform:translateY(0)}}.contact-img{width:50px;display:flex;align-items:center;justify-content:center;border-right:1px solid #bebebe;background-color:#fff}.contact-img img{max-width:50px}.contact-alpha-img{width:50px;display:flex;justify-content:center;align-items:center;font-size:38px;font-weight:600}.contact-details{padding:4px 8px;display:flex;flex-direction:column;justify-content:center}.contact-details p{margin:0;line-height:1;color:#fff}.contact-name{font-weight:600}#topPanel{height:39%;position:relative;margin-bottom:4px;padding:0;border-top-right-radius:30px;border-top-left-radius:30px}.wave-container{position:absolute;bottom:2px}.waves{width:320px;position:relative;margin-bottom:-7px;height:31px;min-height:31px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}app-call-progress{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1000}.mini-dialpad{height:124px!important}.voicemail{line-height:.7;font-size:18px}.dedicated-overlay{position:absolute;width:100%;height:100%;background-color:#2b434d99;display:flex;align-items:center;justify-content:center}.dedicatedNumPopup{width:90%;height:auto;box-sizing:border-box;color:#8a8a8a;background-color:#cbe7df}.chooseDedicatedHeader{padding:.75rem;display:flex;justify-content:space-between}.chooseDedicatedHeader h5{margin-bottom:0}.dedicatedNumList>ul{list-style-type:none;padding:0}.dedicatedNumList>ul li{background-color:#fff;padding:4px;cursor:pointer}@keyframes tilt-shaking{0%{transform:rotate(0)}25%{transform:rotate(5deg)}50%{transform:rotate(0)}75%{transform:rotate(-5deg)}to{transform:rotate(0)}}.tilt-shaking{background-color:#d45858;animation:tilt-shaking .5s infinite;color:#fff}.tilt-shaking h5,.dark .tilt-shaking span,.tilt-shaking span{color:#fff}.no-caller-id-message{display:inline-block;text-align:center;height:10vh;background-color:#fff3cd;color:#000;font-size:.9rem;line-height:1.5;padding:8px}.click-here-link{color:#0f9aee;text-decoration:underline;font-weight:700}.input-info-icon{margin-top:9px;cursor:pointer;color:#2b434d;opacity:.7}::ng-deep .input-tooltip .tooltip-inner{background-color:#000!important}.no-selection-alert{padding:3px 11px;border:1px solid;border-radius:4px;display:flex;justify-content:space-between;color:#721c24;background-color:#f8d7da;border-color:#f5c6cb;align-items:center}.guide{position:relative;padding:8px;background-color:#303030;color:#fff;border-radius:8px;margin-top:8px;font-size:12px}.guide:before{content:\"\";position:absolute;top:-8px;left:8px;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #303030}.guide2{position:absolute;top:-32px;left:24px;padding:8px;background-color:#303030;color:#fff;border-radius:8px;margin-top:8px;font-size:12px;pointer-events:none}.guide2:before{content:\"\";position:absolute;bottom:-8px;left:8px;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #303030}.incoming-call-widget{position:absolute;right:-320px;top:30px;width:320px;height:68px;background-color:#3052cd;border-top-right-radius:8px;border-bottom-right-radius:8px;display:flex;align-items:center;padding:4px 12px}.incoming-call-widget h6,.incoming-call-widget p{margin-bottom:0;line-height:1.2;color:#fff}.inc-user-img{width:48px;height:48px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;box-sizing:border-box;margin-right:8px}.inc-user-img img{width:100%}.inc-call-btn{width:40px;height:40px;border-radius:50%;outline:none;border-width:0;display:flex;align-items:center;justify-content:center}.inc-call-btn span{font-size:16px}.inc-accept-btn{background-color:#2ecc71;color:#fff}.inc-reject-btn{background-color:#e14e4e;color:#fff}.inc-user-name{font-weight:600}\n"], dependencies: [{ kind: "directive", type: i3.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i3.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i3.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i3.NgStyle, selector: "[ngStyle]", inputs: ["ngStyle"] }, { 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.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }, { kind: "directive", type: i4.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "component", type: CallProgressComponent, selector: "lib-call-progress", inputs: ["callData", "newIncomingCallData", "newIncomingCallsList"], outputs: ["endCallEvent", "incomingCallsNewInfo", "minimiseEvent", "showCallProgressEvent", "incomingCallInitiated"] }] });
2994
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: DialboxComponent, decorators: [{
3002
2995
  type: Component,
3003
- args: [{ selector: 'lib-incoming-call', template: "<div class=\"call-container\" style=\"width: 100%;\" *ngIf=\"newIncomingCallsList.length > 0\">\n <div class=\"collops\">\n <div class=\"d-flex w-100\">\n <div class=\"d-flex flex-column container-fluid\">\n <div class=\"callToNum\">Incoming call <br/><span>{{dedicatedNum}}</span></div>\n <ng-container *ngFor=\"let data of newIncomingCallsList\">\n <div class=\"p-2 \">\n <div class=\"call-info-wrapper w-100 d-flex align-items-center\">\n <div class=\"img\">\n <img class=\"avatar-img-wrapper\" [src]=\"incomingCallData.img\" alt=\"\" width=\"45\" />\n </div>\n <div class=\"d-flex justify-content-between w-100 align-items-center mr-2\">\n <div class=\"callerDetails-wrapper\">\n <h5 class=\"break-word\">{{data?.userInfo?.c2cInformation?.name || '-'}}</h5>\n <p class=\"break-word\">{{data.userInfo?.displayNum ? data.userInfo?.c2cInformation.number : data.userInfo?.c2cInformation.number }}</p>\n </div> \n <div class=\"d-flex align-items-center\">\n <button class=\"call-btn-wrapper receive-btn\" [disabled]=\"!data?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(data)\"> call </span>\n </button>\n <button class=\"call-btn-wrapper mute-btn\" *ngIf=\"data?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (click)=\"toggleMute(data)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"call-btn-wrapper reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(data)\"> call_end </span>\n </button>\n <div class=\"togglearrow-arrow me-2\" id=\"togglearrow\" (click)=\"onClickExpand(data)\"><i class=\"fa fa-angle-right\"></i></div>\n </div>\n </div>\n </div>\n </div>\n </ng-container>\n </div>\n <div class=\"call-container p-3 text-white model-content\" *ngIf=\"isClickExpand\"> \n <div class=\"mb-2\" style=\"width: 100%; height: 100%;\">\n <div class=\"call-animation\" [ngClass]=\"{'call-animation-play': showRingAnimation}\">\n <img class=\"avatar-img\" [src]=\"incomingCallData.img\" alt=\"\" width=\"100\" />\n </div>\n <div class=\"text-center\">\n <h3 class=\"text-white\">{{selectedIncomingCall?.userInfo?.c2cInformation?.name || '-'}}</h3>\n </div>\n <div class=\"f-13\">\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Subject:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.subject || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Email:</div>\n <div>{{selectedIncomingCall?.userInfo?.c2cInformation?.email || '-'}}</div>\n </div> \n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Number:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.number}}</div>\n </div>\n <div class=\"col-6\">\n <div class=\"\">Language:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.language || '-'}}</div>\n </div>\n </div>\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Extension:</div>\n <div class=\"ml-2\">{{selectedIncomingCall?.userInfo?.c2cInformation?.extension || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-3\">\n <div class=\"col-12 d-flex align-items-center mb-2\">\n <div class=\"me-2\">Image:</div>\n <div class=\"text-ellipsis\">\n <ng-container *ngIf=\"selectedIncomingCall?.userInfo?.c2cInformation?.image && selectedIncomingCall?.userInfo?.c2cInformation?.image !== '-'; else noImage\">\n <img src=\"{{selectedIncomingCall?.userInfo?.c2cInformation?.image}}\" alt=\"\" width=\"42\" height=\"42\" class=\"ml-2\"/>\n </ng-container>\n <ng-template #noImage>\n <span class=\"ml-2\">No Image Available</span>\n </ng-template>\n </div>\n </div> \n </div>\n\n <div class=\" mb-4\">\n <div class=\"\">\n <div class=\"\">Message:</div>\n <div class=\"text-ellipsis\">{{selectedIncomingCall?.userInfo?.c2cInformation?.message || '-'}}</div>\n </div>\n </div>\n\n <div class=\"row mb-2\">\n <div class=\"col-6 mb-2\">\n <div class=\"\">Point Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.pointName || '-'}}</div>\n </div>\n <div class=\"col-6 mb-2\">\n <div class=\"\">Source Name:</div>\n <div class=\"\">{{selectedIncomingCall?.userInfo?.c2cInformation?.sourceName || '-'}}</div>\n </div>\n </div>\n </div>\n <div class=\"call-action-btns mt-0\">\n <button class=\"call-btn receive-btn\" *ngIf=\"!selectedIncomingCall?.parameters?.isCallConnected\">\n <span class=\"material-symbols-outlined\" (click)=\"acceptCallFromList(selectedIncomingCall)\"> call </span>\n </button>\n <button class=\"call-btn mute-btn\" *ngIf=\"selectedIncomingCall?.parameters?.isCallConnected\" [disabled]=\"disbaleEndCallBtn\" (click)=\"toggleMute(selectedIncomingCall)\" [ngClass]=\"{'active-mute': isMute}\">\n <span class=\"material-symbols-outlined\" *ngIf=\"isMute\"> mic_off </span>\n <span class=\"material-symbols-outlined\" *ngIf=\"!isMute\"> mic </span>\n </button>\n <button class=\"call-btn reject-btn\">\n <span class=\"material-symbols-outlined\" (click)=\"rejectCallFromList(selectedIncomingCall)\"> call_end </span>\n </button>\n </div>\n </div>\n </div>\n </div>\n </div>\n\n <div class=\"wave-container\">\n <svg class=\"waves\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\"\n viewBox=\"0 24 150 28\" preserveAspectRatio=\"none\" shape-rendering=\"auto\" [ngStyle]=\"{'width': '756px'}\">\n <defs>\n <path id=\"gentle-wave\" d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\" />\n </defs>\n <g class=\"parallax\">\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"0\" fill=\"rgba(255,255,255,0.7)\" />\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"3\" fill=\"rgba(255,255,255,0.5)\" /> \n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\n </g>\n </svg>\n </div>\n</div>", styles: [".call-container{width:385px;height:646px;margin:auto;border-radius:30px;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;display:flex;box-sizing:border-box;position:relative;overflow:hidden;justify-content:center;align-items:center}.collops{display:flex;flex-direction:column;width:100%;height:100%}.container-fluid{width:680px;height:100%;margin-top:10px}.model-content{background-color:#0d6efd;border-radius:20px;width:645px}.calls-side-by-side{position:fixed;top:0;width:30%;height:498px;z-index:1050;pointer-events:auto;display:flex;align-items:flex-start;left:-10rem;transform:translate(.2rem);transition:left 1s ease-in-out}.move{left:41vw!important}.f-13{font-size:13px!important}.call-animation{background:#fff;width:100px;height:100px;position:relative;margin:20px auto;border-radius:100%;border:solid 4px #fff}.call-animation:before{position:absolute;content:\"\";top:0;left:0;width:100%;height:100%;backface-visibility:hidden;border-radius:50%}.avatar-img-wrapper{border-radius:100%;margin:0 5px}.call-btn-wrapper{height:38px;background-color:#fff;border-radius:30px;margin:0 4px;opacity:.9;width:40px;span {color: white; line-height: unset !important;}}.hold-btn{background-color:#bebebe26;border:none}.hold-btn span,.mute-btn span{color:#fff!important}.active-hold{background-color:#fff!important}.active-hold span{color:#000!important}.active-mute{background-color:transparent}.call-info-wrapper{border:1px solid white;border-radius:7px;padding:8px 1px!important;word-break:break-all}.call-animation-play{animation:play 3s linear infinite}.avatar-img{width:94px;height:94px;border-radius:100%;position:absolute;left:0;top:0}@keyframes play{0%{transform:scale(1)}15%{box-shadow:0 0 0 2px #fff6}25%{box-shadow:0 0 0 4px #fff6,0 0 0 8px #fff3}25%{box-shadow:0 0 0 8px #fff6,0 0 0 16px #fff3}50%{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3}to{box-shadow:0 0 0 10px #fff6,0 0 0 20px #fff3;transform:scale(1.1);opacity:0}}.callerDetails{margin-top:8px;color:#fff;display:flex;flex-direction:column;align-items:center}.callerDetails h1{margin:12px 0 0;color:#fff}.callerDetails-wrapper{margin:0 5px;color:#fff;display:flex;flex-direction:column}.callerDetails-wrapper h3,.callerDetails-wrapper h5{margin:0;color:#fff}.togglearrow-arrow{left:100%;background-color:#fff;width:25px;height:25px;text-align:center;cursor:pointer;border:1px solid #ccc;border-radius:50%;line-height:22px}.callerDetails h4{margin:0;color:#fff}.callerDetails p,.callerDetails-wrapper p{margin-top:-3px;margin-bottom:0;color:#fff}.call-sec-btn{position:relative;width:50px;height:50px;box-sizing:border-box;border:1px solid #cccbcb;background-color:transparent;border-radius:25px;padding:12px;box-shadow:6px 6px 10px -1px #bebebe26,-5px -4px 10px -1px #d2d2d226}.call-sec-btn span{color:#cccbcb}.call-btn{width:48px;height:45px;background-color:#fff;border-radius:30px;box-sizing:border-box;margin:0 8px;opacity:.9}.call-btn:hover{opacity:1}.call-btn span{color:#fff;line-height:unset!important}.receive-btn{background-color:#28a745;border:2px solid #28a745}.mute-btn{position:relative;border:none;background-color:#bebebe26}.reject-btn{background-color:#e03131;border:2px solid #e03131}.btn-container{display:flex;flex-wrap:wrap;padding:0 30px}.key-btn{width:50px;height:50px;background-color:transparent;text-align:center;box-sizing:border-box;margin:0 18px;font-size:22px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#d3d3d3;cursor:pointer;opacity:.8}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.call-action-btns{text-align:center;margin-top:240px}#call-input{background-color:transparent;border:none;outline:none;text-align:center;color:#fff}.wave-container{position:absolute;bottom:0}.waves{width:660px;position:relative;margin-bottom:-7px;height:40px;min-height:40px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}.animated-margin{transition:margin-top .5s ease}.callToNum{color:#fff;font-weight:400;text-align:center}.callToNum span{font-weight:600}.text-ellipsis{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%;display:block}\n"] }]
3004
- }], ctorParameters: function () { return [{ type: ExtensionService }, { type: TwilioService }]; }, propDecorators: { incomingCallData: [{
3005
- type: Input
3006
- }], newIncomingCallsList: [{
2996
+ args: [{ selector: 'lib-dialbox', template: "<div>\r\n msssmsm\r\n</div>\r\n<div id=\"dragparent1\" [ngStyle]=\"{'display':isDialpadHidden ? 'none': 'block'}\">\r\n <lib-call-progress *ngIf=\"isCallInProgress\"\r\n (endCallEvent)=\"endCall()\"\r\n (minimiseEvent)=\"onMinimise($event)\"\r\n (incomingCallInitiated)=\"newIncomingCallInitiated()\"\r\n [newIncomingCallData]=\"newIncomingCallData\"\r\n [newIncomingCallsList]=\"incomingCallsList\"\r\n (incomingCallsNewInfo)=\"incomingCallsNewInfo($event)\"\r\n [callData]=\"callData\">\r\n </lib-call-progress>\r\n <div class=\"dialpad-container\" [ngClass]=\"{'mini-dialpad': isMinimised}\" tabindex=\"0\" (keydown)=\"handleDivKeydown($event)\">\r\n <div id=\"topPanel\" [ngStyle]=\"{'height': callerIdList.length ? '40%' : '39%'}\">\r\n <div class=\"dialpad-alerts\" *ngIf=\"dialAlert.show\">\r\n <div class=\"no-selection-alert\">\r\n <!-- <p class=\"mb-0\">Select C2C number to call</p> -->\r\n <p class=\"mb-0\">{{dialAlert.msg}}</p>\r\n <span class=\"fa fa-times\" (click)=\"shakeDedicatedBtn = false\"></span>\r\n </div>\r\n </div>\r\n <div class=\"dialpad-alerts\" *ngIf=\"callNumberToast.show\">\r\n <div class=\"dialbox-pop1 alert fade show\" [ngClass]=\"callNumberToast.type\" role=\"alert\">\r\n <div class=\"d-flex justify-content-between\">\r\n <div class=\"flex-grow-1 my-auto text-left\">\r\n You'r calling <strong>{{callNumberToast.displayNum}}</strong>\r\n </div>\r\n <div class=\"text-right\">\r\n <button class=\"btn btn-link btn-disc p-0 px-1\" (click)=\"cancelDialNumber()\">Cancel Call</button>\r\n <!-- <button class=\"btn btn-link btn-success btn-disc p-0 px-2\">Continue</button> -->\r\n </div>\r\n \r\n </div>\r\n </div>\r\n </div>\r\n <div style=\"padding: 0 18px\" (paste)=\"handleNumberPaste($event)\">\r\n <div class=\"d-flex justify-content-between mt-2\">\r\n <p></p>\r\n <span class=\"material-symbols-outlined dial-close-btn\" (click)=\"hideDialpad()\">\r\n <svg xmlns=\"http://www.w3.org/2000/svg\" height=\"24px\" viewBox=\"0 -960 960 960\" width=\"24px\" fill=\"#ffffff\"><path d=\"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z\"/></svg>\r\n </span>\r\n </div>\r\n <div class=\"input-box\">\r\n <input type=\"text\" #dialInput placeholder=\"Enter a name or number\" tabindex=\"1\" [(ngModel)]=\"dialedNumber\" (ngModelChange)=\"onDialInputChange($event)\"/>\r\n <span class=\"\" id=\"input-clear-btn\" (click)=\"clearInput()\" *ngIf=\"showInputClearBtn\">\r\n <svg width=\"50px\" height=\"30px\" viewBox=\"0 10 40 60\" xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" version=\"1.1\" baseProfile=\"full\" enable-background=\"new 0 0 76.00 76.00\" xml:space=\"preserve\">\r\n <path fill=\"#5d6061\" fill-opacity=\"1\" stroke-width=\"0.2\" stroke-linejoin=\"round\" d=\"M 47.5282,42.9497L 42.5784,38L 47.5282,33.0502L 44.9497,30.4718L 40,35.4216L 35.0502,30.4718L 32.4718,33.0502L 37.4216,38L 32.4718,42.9497L 35.0502,45.5282L 40,40.5784L 44.9497,45.5282L 47.5282,42.9497 Z M 18.0147,41.5355L 26.9646,50.4854C 28.0683,51.589 29,52 31,52L 52,52C 54.7614,52 57,49.7614 57,47L 57,29C 57,26.2386 54.7614,24 52,24L 31,24C 29,24 28.0683,24.4113 26.9646,25.5149L 18.0147,34.4645C 16.0621,36.4171 16.0621,39.5829 18.0147,41.5355 Z M 31,49C 30,49 29.6048,48.8828 29.086,48.3641L 20.1361,39.4142C 19.355,38.6332 19.355,37.3669 20.1361,36.5858L 29.086,27.6362C 29.6048,27.1175 30,27 31,27.0001L 52,27.0001C 53.1046,27.0001 54,27.8955 54,29.0001L 54,47.0001C 54,48.1046 53.1046,49.0001 52,49.0001L 31,49 Z \"/>\r\n </svg> \r\n </span>\r\n <span class=\"input-info-icon\" placement=\"bottom-right\" tooltipClass=\"input-tooltip\" ngbTooltip=\"For extension dialing, use formats like +12345678910 x123,+12345678910 ext.123, +12345678910,123\"><i class=\"fa fa-info-circle\"></i></span>\r\n </div>\r\n <div class=\"guide\" *ngIf=\"callerIdList.length && !(dialedNumber.length > 2)\">\r\n <span class=\"guidetext\">Please enter a number or select a saved contact</span>\r\n </div>\r\n <!-- <div class=\"input-error\" *ngIf=\"dialAlert.show\">\r\n <span>{{dialAlert.msg}}</span>\r\n </div> -->\r\n <div>\r\n <div class=\"contact-card\" *ngFor=\"let contact of filteredContactList\" (click)=\"onContactSelect(contact)\">\r\n <div class=\"contact-img\">\r\n <img [src]=\"contact.image\" alt=\"user image\" loading=\"lazy\" *ngIf=\"contact.image else alphaName\"/>\r\n <ng-template #alphaName>\r\n <span class=\"contact-alpha-img\">{{getFirstLetter(contact.firstName)}}</span>\r\n </ng-template>\r\n </div>\r\n <div class=\"contact-details\">\r\n <p style=\"margin-bottom: 4px\" class=\"contact-name\">{{getFullName(contact) }}</p>\r\n <p>{{contact.numbersList[0].number}}</p>\r\n </div>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"wave-container\">\r\n <svg\r\n class=\"waves\"\r\n xmlns=\"http://www.w3.org/2000/svg\"\r\n xmlns:xlink=\"http://www.w3.org/1999/xlink\"\r\n viewBox=\"0 24 150 28\"\r\n preserveAspectRatio=\"none\"\r\n shape-rendering=\"auto\"\r\n >\r\n <defs>\r\n <path\r\n id=\"gentle-wave\"\r\n d=\"M-160 44c30 0 58-18 88-18s 58 18 88 18 58-18 88-18 58 18 88 18 v44h-352z\"\r\n />\r\n </defs>\r\n <g class=\"parallax\">\r\n <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"0\"\r\n fill=\"rgba(255,255,255,0.7)\"\r\n />\r\n <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"3\"\r\n fill=\"rgba(255,255,255,0.5)\"\r\n />\r\n <!-- <use\r\n xlink:href=\"#gentle-wave\"\r\n x=\"48\"\r\n y=\"5\"\r\n fill=\"rgba(255,255,255,0.3)\"\r\n /> -->\r\n <use xlink:href=\"#gentle-wave\" x=\"48\" y=\"7\" fill=\"#fff\" />\r\n </g>\r\n </svg>\r\n </div>\r\n </div>\r\n <div class=\"btn-container\" *ngIf=\"!isMinimised\">\r\n <button class=\"dial-btn\" *ngFor=\"let key of keypadVal;let i = index\"\r\n (keydown.enter)=\"onEnter(key.num)\" (click)=\"addNumber(key.num)\"\r\n [ngStyle]=\"{'margin-top': key.text === '+' ? '3px' : '0'}\"\r\n [tabindex]=\"dialedNumber.length ? '0': i+2\" longPress (longPress)=\"addNumber(key.text)\" shortPress (shortPress)=\"addNumber(key.num)\">\r\n {{key.num}} \r\n <span *ngIf=\"key.num == 1;else otherThanOne\" class=\"material-symbols-outlined voicemail\">\r\n voicemail\r\n </span>\r\n <ng-template #otherThanOne>\r\n <span class=\"btn-albhabets\" [ngClass]=\"{'plusSign': key.text === '+'}\">{{key.text ? key.text : '&nbsp;'}}</span>\r\n </ng-template>\r\n </button>\r\n </div>\r\n <div class=\"call-btn-container\" *ngIf=\"!isMinimised\" (mouseenter)=\"onCallBtnMouseEnter($event)\" (mouseleave)=\"onCallBtnMouseLeave($event)\">\r\n <div class=\"call-btn\" (click)=\"initiateCall()\" [tabindex]=\"dialedNumber.length ? '2': '15'\"\r\n [ngStyle]=\"{'pointer-events': dialedNumber.length && selectedCallerId ? 'auto' : 'none', 'opacity': dialedNumber.length && selectedCallerId ? '1' : '0.5'}\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call\r\n </span>\r\n </div>\r\n </div>\r\n <div *ngIf=\"callerIdList.length && !isMinimised\" class=\"position-relative\">\r\n <div class=\"shownCallerId\" *ngIf=\"selectedCallerId; else askBlock\" (click)=\"toggleCallerIdDiv()\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + selectedCallerId?.isoCode?.toLowerCase()\"></span>\r\n {{selectedCallerId?.number}}\r\n </div>\r\n </div>\r\n <ng-template #askBlock>\r\n <div class=\"shownCallerId\" (click)=\"toggleCallerIdDiv()\" [ngClass]=\"{ 'tilt-shaking': shakeDedicatedBtn }\">\r\n <div class=\"d-flex justify-content-center\">\r\n <h5 class=\"mb-0\">Select C2C number</h5>\r\n <!-- <span class=\"ml-2\" style=\"opacity:.8;margin-top:2px\">\r\n <img src=\"assets/images/icon_down_arrow.svg\" alt=\"down\" width=\"10px\">\r\n </span> -->\r\n <span class=\"fa fa-angle-down ml-2 text-blue\" style=\"margin-top:2px\"></span>\r\n </div>\r\n </div>\r\n </ng-template>\r\n <div class=\"guide2\" *ngIf=\"shakeDedicatedBtn\">\r\n <span class=\"guidetext\">Please select a number from below dropdown</span>\r\n </div>\r\n </div>\r\n\r\n <div *ngIf=\"callerIdList.length; else noCallerIdMessage\">\r\n <div class=\"caller-id-list-container\" *ngIf=\"callerIdList.length && !isMinimised\" id=\"callerIdContainer\" [ngClass]=\"{'visible': !isCallerIdHidden}\" >\r\n <div style=\"display: flex; justify-content: space-between\">\r\n <!-- <h4>Select C2C Softphone Number</h4> -->\r\n <h4>Make outgoing call using</h4>\r\n <span\r\n class=\"material-symbols-outlined\"\r\n style=\"cursor: pointer\"\r\n (click)=\"isCallerIdHidden = true\"\r\n >\r\n close\r\n </span>\r\n </div>\r\n <ul>\r\n <ng-container *ngFor=\"let callerId of callerIdList\">\r\n <li [ngClass]=\"{'selectedCallerIdClass': callerId?.number == selectedCallerId?.number}\" (click)=\"onDedicatedNumSelect(callerId)\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + callerId?.isoCode?.toLowerCase()\"></span>\r\n {{callerId?.number}}\r\n </div>\r\n <span>{{callerId?.countryName}}</span>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </div>\r\n </div>\r\n <ng-template #noCallerIdMessage>\r\n <span class=\"no-caller-id-message\">To make any voice calls, please <a routerLink=\"/extension/dedicatednumber/{{token}}\" class=\"click-here-link\" title=\"Settings > C2C Number\">subscribe</a> to a voice capable C2C Number.\r\n </span>\r\n </ng-template>\r\n <div class=\"dedicated-overlay\" *ngIf=\"showDedicatedPopup\">\r\n <div class=\"card dedicatedNumPopup\">\r\n <div class=\"card-header chooseDedicatedHeader\">\r\n <h5>Choose C2C Number</h5>\r\n <span class=\"material-symbols-outlined dial-close-btn\" (click)=\"showDedicatedPopup = false\">close</span>\r\n </div>\r\n <div class=\"card-body dedicatedNumList\">\r\n <ul>\r\n <ng-container *ngFor=\"let callerId of callerIdList\">\r\n <li [ngClass]=\"{'selectedCallerIdClass': callerId?.number == selectedCallerId?.number}\" (click)=\"showDedicatedPopup = false\">\r\n <div>\r\n <span [ngClass]=\"'fi fi-' + callerId?.isoCode?.toLowerCase()\"></span>\r\n {{callerId?.number}}\r\n </div>\r\n <span>{{callerId?.countryName}}</span>\r\n </li>\r\n </ng-container>\r\n </ul>\r\n </div>\r\n </div>\r\n </div>\r\n <div class=\"incoming-call-widget\" *ngFor=\"let call of newIncomingCalls;let i = index\" [ngStyle]=\"{'top': (30 + i * 72) + 'px'}\">\r\n <div>\r\n <div class=\"inc-user-img\">\r\n <img src=\"assets/images/user.jpg\" alt=\"user image\">\r\n </div>\r\n \r\n </div>\r\n <div class=\"flex-grow-1\">\r\n <!-- <h6 class=\"mb-1 font-weight-bold\">Incoming Call</h6> -->\r\n <p class=\"inc-user-name\">{{call.customParameters.get('name')}}</p>\r\n <p>{{call.parameters.From}}</p>\r\n\r\n <!-- <p class=\"inc-user-name\">John Doe</p> \r\n <p>+12337472489</p>\r\n <p style=\"font-size: 12px;color:#d5d5d5 !important;margin-top:2px\">Call on +12264584100</p> -->\r\n\r\n </div>\r\n <div class=\"d-flex\">\r\n <button class=\"inc-call-btn inc-accept-btn mr-2\" (click)=\"acceptNewIncomingCall(call)\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call\r\n </span>\r\n </button>\r\n <button class=\"inc-call-btn inc-reject-btn\" (click)=\"rejectNewIncomingCall(call)\">\r\n <span class=\"material-symbols-outlined\" style=\"color: white\">\r\n call_end\r\n </span>\r\n </button>\r\n </div>\r\n \r\n </div>\r\n </div>\r\n</div>\r\n", styles: ["#dragparent1{position:fixed;left:100px;z-index:9999999;font-family:Lato,sans-serif;display:none}.dialpad-container{width:320px;height:600px;background:white;margin:auto;border-radius:30px;box-shadow:#00000040 0 54px 55px,#0000001f 0 -12px 30px,#0000001f 0 4px 6px,#0000002b 0 12px 13px,#00000017 0 -3px 5px;display:flex;flex-direction:column;box-sizing:border-box;position:relative;line-height:1.1}.dialpad-alerts{position:absolute;width:calc(100% - 28px);left:14px;top:8px;z-index:1200}.btn-disc{font-size:12px}.dialbox-pop1{font-size:.8rem;z-index:9;padding:8px}.input-error>span{color:#dfdfdf;margin-bottom:2px}.dial-close-btn{cursor:pointer;opacity:.6}.dial-close-btn:hover{opacity:1}.btn-container{display:flex;flex-wrap:wrap;padding:0 18px}.dial-btn{width:50px;height:50px;background-color:#fff;border-radius:4px;text-align:center;box-sizing:border-box;margin:4px 22px;font-size:28px;display:flex;flex-direction:column;justify-content:center;align-items:center;font-family:Lato,sans-serif;font-weight:900;font-style:normal;color:#2b434d;cursor:pointer;opacity:.8;border:none}.dial-btn:hover{opacity:1;box-shadow:#00000026 0 2px 8px}.dial-btn:focus{opacity:1;box-shadow:#00000026 0 2px 8px}.dial-btn:active{box-shadow:#32325d40 0 30px 60px -12px inset,#0000004d 0 18px 36px -18px inset}.call-btn-container{display:flex;margin-top:8px;justify-content:center;position:relative}.call-btn{display:flex;align-items:center;justify-content:center;width:54px;height:54px;border-radius:27px;background-color:#2ecc71;outline:none;border:none;box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;opacity:.8;cursor:pointer}.call-btn:hover{opacity:1}.call-btn:focus{opacity:1}.caller-id-list-container{width:100%;height:auto;position:absolute;bottom:-100%;left:0;border-radius:0 0 30px 30px/0px 0px 30px 30px;padding:8px 12px 32px;box-sizing:border-box;color:#8a8a8a}.visible{animation:slideUp .8s forwards}#callerIdContainer ul{list-style:none;padding-left:0;margin:0}.dialpad-container h4{font-family:Lato,sans-serif;margin:0 0 8px}#callerIdContainer ul li{background-color:#fff;padding:8px;margin-top:7px;display:flex;border-radius:4px;justify-content:space-between;font-size:14px;cursor:pointer}.fi{border-radius:2px;margin-right:2px}@keyframes slideUp{0%{bottom:-100%}to{bottom:0}}.selectedCallerIdClass{box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026;border:1px solid #e0e0e0;color:#3a3a3a}.toggleBtn{color:gray;border:none;background-color:#e5eef1}.btn-albhabets{font-family:Lato,sans-serif;font-size:12px;font-weight:400}.plusSign{font-weight:600;font-size:14px}.shownCallerId{text-align:center;padding:8px 10px;font-family:Lato,sans-serif;color:#2ecc71;border:1px solid #d7d7d7;background-color:#fff;width:80%;margin:12px auto auto;border-radius:12px;position:relative;cursor:pointer}.input-box{width:100%;background-color:#fff;padding:4px 10px;border:1px solid rgb(197,197,197);box-sizing:border-box;border-radius:24px;margin-top:12px;display:flex;justify-content:space-between}.input-box:focus-within{box-shadow:6px 6px 10px -1px #00000026,-5px -4px 10px -1px #00000026}.input-box input{font-size:18px;padding:8px 6px;width:100%;box-sizing:border-box;border:none;outline:none;font-weight:600;color:#2b434d}.input-box input::placeholder{font-size:16px;font-weight:500}#input-clear-btn{color:gray;display:flex;align-items:center;cursor:pointer}.contact-card{width:100%;height:54px;display:flex;border-radius:12px;overflow:hidden;margin-top:4px;box-shadow:6px 6px 10px -1px #e6eefc26;cursor:pointer;opacity:0;transform:translateY(20px);animation:slideIn .5s forwards}@keyframes slideIn{to{opacity:1;transform:translateY(0)}}.contact-img{width:50px;display:flex;align-items:center;justify-content:center;border-right:1px solid #bebebe;background-color:#fff}.contact-img img{max-width:50px}.contact-alpha-img{width:50px;display:flex;justify-content:center;align-items:center;font-size:38px;font-weight:600}.contact-details{padding:4px 8px;display:flex;flex-direction:column;justify-content:center}.contact-details p{margin:0;line-height:1;color:#fff}.contact-name{font-weight:600}#topPanel{height:39%;position:relative;margin-bottom:4px;padding:0;border-top-right-radius:30px;border-top-left-radius:30px}.wave-container{position:absolute;bottom:2px}.waves{width:320px;position:relative;margin-bottom:-7px;height:31px;min-height:31px}.parallax>use{animation:move-forever 25s cubic-bezier(.55,.5,.45,.5) infinite}.parallax>use:nth-child(1){animation-delay:-2s;animation-duration:7s}.parallax>use:nth-child(2){animation-delay:-3s;animation-duration:10s}.parallax>use:nth-child(3){animation-delay:-4s;animation-duration:13s}.parallax>use:nth-child(4){animation-delay:-5s;animation-duration:20s}@keyframes move-forever{0%{transform:translate3d(-90px,0,0)}to{transform:translate3d(85px,0,0)}}app-call-progress{position:absolute;top:0;left:0;width:100%;height:100%;background-color:transparent;z-index:1000}.mini-dialpad{height:124px!important}.voicemail{line-height:.7;font-size:18px}.dedicated-overlay{position:absolute;width:100%;height:100%;background-color:#2b434d99;display:flex;align-items:center;justify-content:center}.dedicatedNumPopup{width:90%;height:auto;box-sizing:border-box;color:#8a8a8a;background-color:#cbe7df}.chooseDedicatedHeader{padding:.75rem;display:flex;justify-content:space-between}.chooseDedicatedHeader h5{margin-bottom:0}.dedicatedNumList>ul{list-style-type:none;padding:0}.dedicatedNumList>ul li{background-color:#fff;padding:4px;cursor:pointer}@keyframes tilt-shaking{0%{transform:rotate(0)}25%{transform:rotate(5deg)}50%{transform:rotate(0)}75%{transform:rotate(-5deg)}to{transform:rotate(0)}}.tilt-shaking{background-color:#d45858;animation:tilt-shaking .5s infinite;color:#fff}.tilt-shaking h5,.dark .tilt-shaking span,.tilt-shaking span{color:#fff}.no-caller-id-message{display:inline-block;text-align:center;height:10vh;background-color:#fff3cd;color:#000;font-size:.9rem;line-height:1.5;padding:8px}.click-here-link{color:#0f9aee;text-decoration:underline;font-weight:700}.input-info-icon{margin-top:9px;cursor:pointer;color:#2b434d;opacity:.7}::ng-deep .input-tooltip .tooltip-inner{background-color:#000!important}.no-selection-alert{padding:3px 11px;border:1px solid;border-radius:4px;display:flex;justify-content:space-between;color:#721c24;background-color:#f8d7da;border-color:#f5c6cb;align-items:center}.guide{position:relative;padding:8px;background-color:#303030;color:#fff;border-radius:8px;margin-top:8px;font-size:12px}.guide:before{content:\"\";position:absolute;top:-8px;left:8px;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-bottom:8px solid #303030}.guide2{position:absolute;top:-32px;left:24px;padding:8px;background-color:#303030;color:#fff;border-radius:8px;margin-top:8px;font-size:12px;pointer-events:none}.guide2:before{content:\"\";position:absolute;bottom:-8px;left:8px;width:0;height:0;border-left:8px solid transparent;border-right:8px solid transparent;border-top:8px solid #303030}.incoming-call-widget{position:absolute;right:-320px;top:30px;width:320px;height:68px;background-color:#3052cd;border-top-right-radius:8px;border-bottom-right-radius:8px;display:flex;align-items:center;padding:4px 12px}.incoming-call-widget h6,.incoming-call-widget p{margin-bottom:0;line-height:1.2;color:#fff}.inc-user-img{width:48px;height:48px;border-radius:50%;overflow:hidden;display:flex;align-items:center;justify-content:center;box-sizing:border-box;margin-right:8px}.inc-user-img img{width:100%}.inc-call-btn{width:40px;height:40px;border-radius:50%;outline:none;border-width:0;display:flex;align-items:center;justify-content:center}.inc-call-btn span{font-size:16px}.inc-accept-btn{background-color:#2ecc71;color:#fff}.inc-reject-btn{background-color:#e14e4e;color:#fff}.inc-user-name{font-weight:600}\n"] }]
2997
+ }], ctorParameters: function () { return [{ type: TwilioService }, { type: ExtensionService }, { type: IpAddressService }, { type: ExtensionService }, { type: i4.Router }]; }, propDecorators: { isDialpadHidden: [{
3007
2998
  type: Input
3008
- }], closeIncomingCallDiv: [{
2999
+ }], closeDialpadEvent: [{
3009
3000
  type: Output
3010
- }], incomingCallsNewList: [{
3001
+ }], callInitiated: [{
3011
3002
  type: Output
3012
- }], selectedIncomingCallInfo: [{
3003
+ }], endCallEvent: [{
3004
+ type: Output
3005
+ }], minimiseEvent: [{
3006
+ type: Output
3007
+ }], incomingCallsNewInfoEvent: [{
3008
+ type: Output
3009
+ }], incomingCallInitiated: [{
3010
+ type: Output
3011
+ }], dialInputElement: [{
3012
+ type: ViewChild,
3013
+ args: ['dialInput']
3014
+ }], numberDialed: [{
3013
3015
  type: Output
3014
3016
  }] } });
3015
3017
 
@@ -3048,14 +3050,17 @@ class CallerIdDialogComponent {
3048
3050
  let val = ev.target.checked ? 'true' : 'false';
3049
3051
  localStorage.setItem('isAlertEnable', val);
3050
3052
  }
3053
+ doNotShowAgain() {
3054
+ console.log('doNotShowAgain');
3055
+ }
3051
3056
  }
3052
- CallerIdDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallerIdDialogComponent, deps: [{ token: i4.Router }, { token: TwilioService }, { token: i3.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
3053
- CallerIdDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CallerIdDialogComponent, selector: "lib-caller-id-dialog", ngImport: i0, template: "<!-- <div class=\"main-theme {{storedTheme}}\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\"> Caller ID Not Set</h5>\n <button class=\"close\" (click)=\"closeModal()\">\n <span>x</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <p class=\"mb-1\"><strong>There is no caller ID set in your account</strong> <br /></p>\n <p>The receiver will not be able to identify your call or call you back</p>\n <div class=\"d-flex align-items-center justify-content-center\">\n <input type=\"checkbox\" checked (change)=\"hideMessage($event)\" [(ngModel)]=\"alertToggle\" class=\"mr-2\">\n <label for=\"\" class=\"mb-0 text-muted\">I do not want to see this message again</label>\n </div>\n <button class=\"btn btn-black-outline\" (click)=\"doNotShowAgain()\">Do not show this message again</button>\n </div>\n <div class=\"modal-footer border-top d-flex justify-content-between\">\n <button class=\"btn btn-black-outline\" (click)=\"redirectToCallingPreference()\">Click to set caller ID</button>\n \n <button class=\"btn btn-blue ms-2\" (click)=\"proceed()\">Proceed without Caller ID</button>\n </div>\n</div> -->", styles: [""] });
3057
+ CallerIdDialogComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallerIdDialogComponent, deps: [{ token: i4.Router }, { token: TwilioService }, { token: i3$2.MatDialogRef }, { token: MAT_DIALOG_DATA }], target: i0.ɵɵFactoryTarget.Component });
3058
+ CallerIdDialogComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "15.2.10", type: CallerIdDialogComponent, selector: "lib-caller-id-dialog", ngImport: i0, template: "<div class=\"main-theme {{storedTheme}}\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\"> Caller ID Not Set</h5>\n <button class=\"close\" (click)=\"closeModal()\">\n <span>x</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <p class=\"mb-1\"><strong>There is no caller ID set in your account</strong> <br /></p>\n <p>The receiver will not be able to identify your call or call you back</p>\n <div class=\"d-flex align-items-center justify-content-center\">\n <input type=\"checkbox\" checked (change)=\"hideMessage($event)\" [(ngModel)]=\"alertToggle\" class=\"mr-2\">\n <label for=\"\" class=\"mb-0 text-muted\">I do not want to see this message again</label>\n </div>\n <button class=\"btn btn-black-outline\" (click)=\"doNotShowAgain()\">Do not show this message again</button>\n </div>\n <div class=\"modal-footer border-top d-flex justify-content-between\">\n <button class=\"btn btn-black-outline\" (click)=\"redirectToCallingPreference()\">Click to set caller ID</button>\n \n <button class=\"btn btn-blue ms-2\" (click)=\"proceed()\">Proceed without Caller ID</button>\n </div>\n</div>", styles: [""], dependencies: [{ kind: "directive", type: i3$1.CheckboxControlValueAccessor, selector: "input[type=checkbox][formControlName],input[type=checkbox][formControl],input[type=checkbox][ngModel]" }, { kind: "directive", type: i3$1.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i3$1.NgModel, selector: "[ngModel]:not([formControlName]):not([formControl])", inputs: ["name", "disabled", "ngModel", "ngModelOptions"], outputs: ["ngModelChange"], exportAs: ["ngModel"] }] });
3054
3059
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImport: i0, type: CallerIdDialogComponent, decorators: [{
3055
3060
  type: Component,
3056
- args: [{ selector: 'lib-caller-id-dialog', template: "<!-- <div class=\"main-theme {{storedTheme}}\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\"> Caller ID Not Set</h5>\n <button class=\"close\" (click)=\"closeModal()\">\n <span>x</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <p class=\"mb-1\"><strong>There is no caller ID set in your account</strong> <br /></p>\n <p>The receiver will not be able to identify your call or call you back</p>\n <div class=\"d-flex align-items-center justify-content-center\">\n <input type=\"checkbox\" checked (change)=\"hideMessage($event)\" [(ngModel)]=\"alertToggle\" class=\"mr-2\">\n <label for=\"\" class=\"mb-0 text-muted\">I do not want to see this message again</label>\n </div>\n <button class=\"btn btn-black-outline\" (click)=\"doNotShowAgain()\">Do not show this message again</button>\n </div>\n <div class=\"modal-footer border-top d-flex justify-content-between\">\n <button class=\"btn btn-black-outline\" (click)=\"redirectToCallingPreference()\">Click to set caller ID</button>\n \n <button class=\"btn btn-blue ms-2\" (click)=\"proceed()\">Proceed without Caller ID</button>\n </div>\n</div> -->" }]
3061
+ args: [{ selector: 'lib-caller-id-dialog', template: "<div class=\"main-theme {{storedTheme}}\">\n <div class=\"modal-header\">\n <h5 class=\"modal-title\"> Caller ID Not Set</h5>\n <button class=\"close\" (click)=\"closeModal()\">\n <span>x</span>\n </button>\n </div>\n <div class=\"modal-body\">\n <p class=\"mb-1\"><strong>There is no caller ID set in your account</strong> <br /></p>\n <p>The receiver will not be able to identify your call or call you back</p>\n <div class=\"d-flex align-items-center justify-content-center\">\n <input type=\"checkbox\" checked (change)=\"hideMessage($event)\" [(ngModel)]=\"alertToggle\" class=\"mr-2\">\n <label for=\"\" class=\"mb-0 text-muted\">I do not want to see this message again</label>\n </div>\n <button class=\"btn btn-black-outline\" (click)=\"doNotShowAgain()\">Do not show this message again</button>\n </div>\n <div class=\"modal-footer border-top d-flex justify-content-between\">\n <button class=\"btn btn-black-outline\" (click)=\"redirectToCallingPreference()\">Click to set caller ID</button>\n \n <button class=\"btn btn-blue ms-2\" (click)=\"proceed()\">Proceed without Caller ID</button>\n </div>\n</div>" }]
3057
3062
  }], ctorParameters: function () {
3058
- return [{ type: i4.Router }, { type: TwilioService }, { type: i3.MatDialogRef }, { type: undefined, decorators: [{
3063
+ return [{ type: i4.Router }, { type: TwilioService }, { type: i3$2.MatDialogRef }, { type: undefined, decorators: [{
3059
3064
  type: Inject,
3060
3065
  args: [MAT_DIALOG_DATA]
3061
3066
  }] }];
@@ -3086,20 +3091,20 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "15.2.10", ngImpo
3086
3091
  DialboxComponent,
3087
3092
  CallProgressComponent,
3088
3093
  CallerIdDialogComponent,
3089
- IncomingCallComponent,
3094
+ IncomingCallComponent
3090
3095
  ],
3091
3096
  imports: [
3092
3097
  CommonModule,
3093
3098
  FormsModule,
3094
3099
  ReactiveFormsModule,
3095
3100
  HttpClientModule,
3096
- RouterLink,
3101
+ RouterLink
3097
3102
  ],
3098
3103
  exports: [
3099
3104
  DialboxComponent,
3100
3105
  CallProgressComponent,
3101
3106
  CallerIdDialogComponent,
3102
- IncomingCallComponent,
3107
+ IncomingCallComponent
3103
3108
  ]
3104
3109
  }]
3105
3110
  }] });