{"version":3,"sources":["scripts/app-acd4e80f01.js"],"names":["stReset","directive","require","restrict","scope","link","element","attrs","ctrl","bind","$apply","tableState","search","predicateObject","pipe","angular","module","filter","collection","keyname","output","keys","forEach","item","key","indexOf","push","input","map","undefined","isNaN","replace","utilities","elapsedTime","startDateTime","endDateTime","Date","getTimeDisplay","getTime","diffSeconds","convertSecondsToDisplayString","userservice","$http","$q","exception","logger","enums","usermessageservice","stringResources","accountservice","acceptAlert","resourceAlertId","resourceRequestId","isTestCall","callId","isScheduleCall","success","response","data","fail","e","catcher","logMessage","LogLevel","Debug","put","baseUrl","params","then","rejectAlert","getCurrentAlert","get","showChangeStatusReason","statusName","time","reason","notify","Events","ShowInstructionMessage","message","reasonToDisplay","PersonStatusMessage","timeToDisplay","getLocalDate","PersonStatusNames","Available","stringFormat","personStatusMessageFormat","addCallEvent","eventName","metadata","body","getUserSetting","userSetting","defaultValue","getUserFullSetting","setUserSetting","value","updateContactMethod","contactMethod","setMetadata","metaData","setSipdata","sipData","endConference","disconnectCall","interpreterDispositionMenu","testCall","service","factory","$inject","$rootScope","subscribe","event","callback","handler","$on","args","$emit","twiliowebrtcservice","twilio","$cookies","callEvents","appsettingsservice","preferences","constants","initializePreferences","getAppSetting","TwilioErrorLimitToLog","twilioErrorLimitToLog","twilioSDKLogLevel","TokenRefreshMilliseconds","tokenRefreshMilliseconds","currentRole","ShowNetworkQualityIndicator","showNetworkQualityIndicatorDefault","DisableTokenGenerationLocalHost","disableTokenGenerationLocalHost","WebRTCTokenAgeMinutes","tokenAgeMinutes","tokenAgeMilliseconds","preFlight","preFlightEnabled","WebRTCEdgeLocations","defaultEdgeLocations","toString","split","CodecPreferences","codecPreferences","CreateTokenOnError","createTokenOnError","LogTwilioErrorsOnConsole","logTwilioErrorsOnConsole","ShowWebRTCReconnectionStatus","showWebRTCReconnectionStatus","RegisterDeviceWhenOffline","registerDeviceWhenOffline","enable","regereratingTokenDueToError","setup","disable","userId","devices","length","device","removeListener","DeviceStatus","Error","deviceEventHandlerError","Incoming","deviceEventHandlerIncoming","Unregistered","deviceEventHandlerUnregistered","Registered","deviceEventHandlerRegistered","Destroyed","deviceEventHandlerDestroyed","Registering","deviceEventHandlerRegistering","TokenWillExpire","deviceEventHandlerTokenWillExpire","destroy","console","log","every","state","runningPreflight","curStatus","runPreflightTests","setTimeout","getPreflightAccessToken","setupOptions","logLevel","edge","appName","closeProtection","preflightTest","Device","runPreflight","on","preflightSuccess","preflightError","report","callSid","getUserId","callQuality","selectedEdge","Info","error","code","TwilioError","causes","Warn","cachedUserId","cachedCurrentUserId","getCurrentUserId","refreshTokenInProgress","updateToken","getWebRTCAccessTokens","index","timeStamp","connectionEventHandlerWarning","warning","isError","$broadcast","WebRtcConnectionQualityChanged","LowMosWebRTCError","HighRttWebRTCError","HighJitterWebRTCError","HighPacketLossWebRTCError","AudioDeviceChanged","HighPacketsLossFractionWebRTCError","connectionEventHandlerWarningCleared","WebRTCErrorCleared","handleWebRTCErrors","connection","lastConnection","connectionEventHandlerReconnected","connectionEventHandlerReconnecting","connectionEventHandlerRinging","accept","twilioError","isReady","isInCall","inCall","some","isBusy","hangUp","disconnectAll","setPortalRefresh","emptyDevice","pageRefresh","clearDeviceAndCreateNew","force","hangupNeedsRefreshToken","isWebRTCSupported","window","mute","logConnectionStatus","unmute","sendDigits","digit","conn","methodName","status","disconnect","UserHangup","regererateTokenDueToError","location","hostname","tokenRefreshMs","webRTCToken","token","twilioDevice","register","numTokens","Trace","generateTokenDueToErrorMessage","ErorCode","twilioErrorCookie","JSON","parse","Code","UserId","Count","stringify","today","tomorrow","setDate","getDate","expires","solutions","clearDevice","userRole","telemetryservice","$injector","applicationInsightsService","resetSettings","settings","enabled","defaultEnabled","telemetryEnabled","defer","resolve","reject","appSettingsService","loadingSettings","SendCustomUITelemetry","isTrue","promise","normalizeEvent","o","Object","k","toISOString","logEvent","properties","measurements","trackEvent","signalservice","interpretersignalreceiver","operatorsignalreceiver","monitorsignalreceiver","session","signalreceiversmonitorservice","connect","roles","done","track","unTrack","$interval","$window","activate","settingsPromise","refreshBrowserOnSignalRDisconnectPromise","minimumMsSinceLastDisconnectBrowserRefreshPromise","signalReceiver","seconds","refreshBrowserOnSignalRDisconnect","minimumMsSinceLastDisconnectBrowserRefresh","interval","getIsConnected","checkConnection","isBrowserRefreshAllowed","reload","convertSecondsToMilliseconds","intervals","cancel","logSignalRTimeout","opeartionResult","hub","resolved","timeout","timer","proxy","id","navigator","userAgent","vendor","clearTimeout","lastRefreshTime","currentTime","now","parseInt","reducecallfrequencyservice","$timeout","callFunction","method","delay","callsDictionary","needToCall","instance","runTimer","call","phonenumberservice","validatePhoneNumber","phoneNumber","callablePhoneNumber","phoneNumberInfo","operatorservice","findInterpreter","languageId","findInterpreterwithGender","genderId","updateInterpreterHoldStatus","interpreterId","onHold","updateCustomerHoldStatus","getLanguageServiceUsers","customerId","getLanguageServiceUsersByGroup","groupId","checkLanguageServiceTimeout","callInterpreter","holdCustomer","connectInterpreter","callLanguageService","languageServiceId","conferenceJoin","getCurrentCall","acceptCall","rejectCall","fromPhoneNumber","hangupCall","sayMessage","addParticipant","post","deleteParticipant","participantCallSid","user","Id","username","Username","role","setUser","getAll","getInterpreters","setStatus","setKeepAlive","setLoginStatus","setPhoneNumber","getInCallInterpreters","getLoggedInInterpreters","findLanguageServiceInterpreter","onGetLanguageServiceUsers","onError","findLanguageServiceInterpreterByGroup","lsGroupId","workingResourceRequestExists","joinInterpretersWithCustomer","relayInterpreterId","onConnectInterpreter","onSuccess","getInterpreterStatistics","interpreterPoolId","secondaryInterpreterPoolId","thirdInterpreterPoolId","fourthInterpreterPoolId","url","monitorservice","listen","latencyservice","telemetryService","init","measureLatency","serviceEnabled","sentTime","receivedTime","latencyMs","userName","eventMetrics","measuringInterval","defaultMeasuringInterval","loggedUserInfo","getCurrentUser","name","LatencyMeasuringInterval","run","interpreterservice","setStatusAtomic","originalStatus","expectedStatus","reconnectCall","internetConnectionChecker","setInternetConnectionState","connectionState","InternetConnectionStateChanged","getInternetConnectionState","checkConnectionDeferred","$$state","head","checkConnectionUrl","Math","random","isInternetConnectionResponse","config","httpInterceptor","buildEvent","requestInfo","result","headers","cleanupRequests","requests","utcNow","requestDuration","requestTimeout","waitingTimeMs","minRequestDuration","defaultRequestMinDuration","UIRequestMinDuration","setInterval","request","rawRequest","guid","createGuid","rawResponse","statusText","statusCode","durationMs","dataservice","getLanguages","reduce","language","Name","cache","getPools","when","pool","getCaseDisplay","callservice","interpreterDropped","findLastEventIndex","getInterpreterDroppedInfo","interpreters","eventIndex","StatusEvent","j","LanguagePayrates","LanguageID","UserFirstName","UserLastName","i","cacheservice","CacheFactory","expirationTime","dataCache","maxAge","cacheFlushInterval","deleteOnExpire","DataCacheExpirationTimeMilliseconds","$$maxAge","appSetting","getIVPFrontEndUrl","getOVPFrontEndUrl","getAppVersion","adminservice","getCalls","recentCallHours","forceGet","login","password","Password","RememberMe","loginADB2C","Failure","Roles","loginADB2CAzureOnly","logout","userInfo","voicePortalLoginMode","getRoles","suppressError","routerHelperProvider","$locationProvider","$stateProvider","$urlRouterProvider","RouterHelper","$location","$state","$uibModalStack","configureStates","states","otherwisePath","extend","resolveAlways","hasOtherwise","otherwise","handleRoutingErrors","toState","toParams","fromState","fromParams","handlingStateChangeError","stateCounts","errors","destination","title","loadedTemplateUrl","msg","path","stateChangeStart","updateDocTitle","getStates","options","dismissAll","changes","docTitle","html5Mode","this","configure","cfg","$get","provider","$log","toastr","info","warn","debug","showToasts","thrownDescription","newMessage","description","exceptionHandlerProvider","appErrorPrefix","$provide","decorator","extendExceptionHandler","$delegate","exceptionHandler","cause","errorData","voxWebRtcConnectionQuality","bindToController","controller","WebRtcConnectionQualityController","controllerAs","templateUrl","$scope","showWarning","vm","statusTitle","statusClass","defaultStatusTitle","errorLevel","voxTestCallButton","TestCallButtonController","person","setupVarsAndMethods","enableTestButton","testButtonDisabledFactory","forceButtonToDisable","test","waiting","isDisabledByPoorLatency","EnableDisableTestButon","DisableStatusChange","IsDisabledStatusChange","TestButtonDisabled","testButtonDisabledDefault","statusShouldEnableButton","Status","Unavailable","NotAvailable","Away","Monitoring","UserStatusReason","PersonStatusReason","PoorLatency","replaceAll","StatusName","voxSipData","SipDataController","showSipdata","sipdata","showSipdataItem","sipdataItem","showOrEditSipdata","Visible","editSipdataItem","Editable","reset","showUpdateMessage","ValueText","sipdataCopy","save","updatedSipdata","showSaveMessage","oldValue","SipCallHeaderChanged","copy","sipdataChanged","handlePattern","nameRegex","validateSipdata","MatchPattern","operator","interpreter","ValidateSipdata","sipCallData","visible","voxSignalRStatus","SignalRStatusController","signalRStateName","signalRStateNames","signalRObject","signalRData","classes","0","1","2","4","signalRStates","connecting","connected","reconnecting","disconnected","SignalRStateChanged","voxPhoneNumber","PhoneNumberController","userCountryName","phoneErrorMessage","allowBlankNumbers","allowMobileNumbers","validating","setUserStatus","personStatus","defaultNumber","thirdParty","watch","$watch","newVal","validatePhoneCheck","number","phoneNumberCookie","TwilioNumber","PhoneNumber","setupPhoneResponse","setPhoneMessage","getInvalidErrorMessage","phoneCountryName","Valid","Callable","AllowMobilePhone","getDenyMobileUseErrorMessage","getNotAllowedErrorMessage","color","phoneErrorMessageChanged","initValidationTimeoutDuration","ContactMethodChanged","phoneChanged","SetTempPhoneNumber","isTemporaryPhonenumber","PremiumRatePhoneNumberPrefix","premiumRatePhoneNumberPrefixes","callerName","country","usRequireLengthErrorMessage","isPremiumRatePhoneNumber","getPremiumRateNumbersNotEnabledMessage","Promise","caller","Operator","Interpreter","Monitor","resetClicked","InCall","Reconnect","validationTimeoutDuration","countryName","errorMessage","isPuertoRico","replaceText","startsWith","countryDisabled","phoneNumberNoPlus","firstFour","substr","countryCodes","firstThree","firstTwo","firstOne","PhoneErrorMessageChanged","prefix","res","213","376","244","1264","1268","54","374","297","61","43","994","1242","973","880","1246","375","32","501","229","1441","975","591","387","267","55","673","359","226","257","855","237","238","1345","236","56","86","57","269","242","682","506","385","53","90392","357","42","45","253","1809","593","20","503","240","291","372","251","500","298","679","358","33","594","689","241","220","7880","49","233","350","30","299","1473","590","671","502","224","245","592","509","504","852","36","354","91","62","98","964","353","972","39","1876","81","962","7","254","686","850","82","965","996","856","371","961","266","231","218","417","370","352","853","389","261","265","60","960","223","356","692","596","222","52","691","373","377","976","1664","212","258","95","264","674","977","31","687","64","505","227","234","683","672","670","47","968","680","507","675","595","51","63","48","351","974","262","40","250","378","239","966","221","381","248","232","65","421","386","677","252","27","34","94","290","1869","1758","249","597","268","46","41","963","886","66","228","676","1868","216","90","993","1649","688","256","44","380","971","598","678","379","58","84","1284","1340","681","969","967","260","263","voxParticipants","ParticipantsController","currentCall","customer","participantWatch","oldVal","buildParticipants","isAddParticipantClick","thirdPartyMessage","newParticipantPhoneNumber","CallId","isPhoneNumberAlreadyPresent","participantId","participants","ParticipantId","removeParticipant","participant","idx","splice","thirdPartyStatusEvent","Call","Participants","showThirdPartyMessage","callCenterStatusEvent","showCallCenterMessage","isDisabled","phoneIsValidating","thirdPartyStatus","ThirdPartyEventMessages","ThirdPartyBusy","ThirdPartyNoAnswer","ThirdPartyCanceled","ThirdPartyFailed","AnsweringMachineDetected","callCenterStatus","callCenterMessage","callCenterEventMessages","CallCenterBusy","CallCenterNoAnswer","CallCenterCanceled","CallCenterFailed","InterpreterId","OperatorId","MonitorId","CustomerId","IsCallCenter","voxNotalkActionMenu","NotalkActionMenuController","getNoTalkActionMenu","notalkOptions","submitNotalkAction","personCurrentStatus","notalkActionSelected","CustomerPutCallOnHold","LEPPutCallOnHoldOrDelayedCall","CustomerOrLEPNotJoinedCall","ActiveInterpretationGoingOn","AudioOrTechnicalIssue","QualityMonitorOnCall","displaymessage","notalkMessage","callEvent","notalkActionOptions","submitted","NoTalkActionMessage1","NoTalkActionMessage2","data2","voxMetaData","MetaDataController","validateMetadata","Label","AllowedCharacters","Length","showMetadata","showMetadataItem","metadataItem","showOrEditMetadata","editMetadataItem","updatedMetadata","metadataCopy","AnswerText","MetadataAnswerChanged","metadataChanged","ValidateMetadata","voxDispositionMenu","DispositionMenuController","getDispositionMenu","dispositionOptions","showDisposition","submitTimer","countDown","callDispositionTimeout","startTimer","submitDisposition","stopTimer","AfterCallWork","dispositionSelected","DispositionMenuCallWasSuccessfull","DispositionMenuAudioLossAndOrCantHear","DispositionMenuNoCustomerAndOrOnlyLEP","DispositionMenuWrongLanguageSelected","DispositionMenuOther","NoDispositionOptionSelected","NoInterpreter","CancelledCall","comment","customerName","commentMaxLength","GetCallDispositionMenuTimeOutSeconds","DispositionMaxAllowedChars","maxLength","voxCountup","CountupController","alternateDateTime","hideDays","thresholds","toggle","timeDisplay","$digest","startDate","alternateDate","dateTimeMs","max","checkThresholds","threshold","limitInSeconds","raise","voxCountdown","CountdownController","started","stop","progress","endInterval","voxConsoleWebrtcDialpad","ConsoleWebRtcDialpadController","setupMethods","unMute","sendDigit","minimize","muteUnmute","muteTheMic","enteredDigits","dialpadMuteStatus","muted","digits","voxConsoleWebrtcDialpadMin","ConsoleWebRtcDialpadMinController","maximize","voxConsoleContactMethods","ConsoleContactMethodsController","setupVars","browserSupportsWebRTC","contactMethods","selectedContactMethod","contactMethodsCookie","buildContactMethodsArray","setStatusIntoCookie","contactMethodChanged","contactMethodSelectDisabled","createContactMethodObject","all","values","setInitialContactMethod","faClass","ContactMethodDesc","ReceiveViaPhone","ReceiveViaComputer","contactMethodObj","notifyContactMethodChange","ContactMethod","WebRTC","contactMethodId","TempPhoneNumber","notifyConsoleStatus","Alerting","Ringing","Quarantine","voxConnectInterpreter","ConnectInterpreterController","languageService","callParticipants","callLanguage","currentLanguages","disableAllLanguageSelect","case","disableIfNotSelected","filterOverflow","languageSelectWatch","disableLanguageSelect","disableAllConnect","$filter","setupFunctions","callLanguageSelect","close","connectMe","loadStatistics","showInterpreterStatistics","logButtonShowEvent","changeLanguageServiceSelection","changeGenderInterpreterSelection","genderOptions","setupVariables","callingLanguageSelect","connectingInterpreter","connectingMe","connectInterpreterDisabled","findingInterpreter","findInterpreterSelect","hasInterpreters","interpreterStatisticsShown","statisticsLoading","languageServiceList","getLanguageServiceList","showErrorMessage","languageServiceIds","buildLanguageServiceIds","showLanguageSelectForScheduled","showNoInterpsFoundError","statistics","LanguageSelect","getSelectedLanguageService","LanguageSelectGroupId","genderSelect","getSelectedGenderInterpreter","showLanguageSelect","setInCall","hasOfflineInterpreters","callAnsweredEvent","callAnswered","callNotAnsweredEvent","languageServiceCallEndedEvent","languageServiceCallEnded","defaultList","lsDirect","LanguageId","allOther","concat","lang","callParticipant","isLanguageServiceAvailable","indexPosition","interpreterIsInCall","customerIsOnHold","ids","messagePart1","messagePart2","messagePart3","callStatus","checkWorkingResourceRequest","ConnectButtonClicked","addGenderSpecificEvent","ConnectClickFailedNoInterpreters","languageSelect","GroupId","LSButtonClicked","LSClickedFailed","genderOption","ConnectInterpreterButtonClicked","ConnectInterpreterClickedFailed","ConnectMeButtonClicked","ConnectMeClickedFailed","onStatisticsReceived","AvailablePortal","AvailablePhone","Offline","preSelectedGroupId","preSelectedGenderOption","ConnectToMale","ConnectToFemale","voxCase","CaseController","currentCase","caseDisplay","voxAlert","$document","AlertController","alert","reCreateTokens","which","alertResponse","action","keypress","unbind","stopTheAlarm","actionedAlert","triggeredBy","ResourceAlertId","ResourceRequestId","waitingForAcceptResponse","refreshWebRTCToken","IsTestCall","IsScheduleCall","requestId","hideAlertPromise","hideAlert","waitingForRejectResponse","updateAlert","changedAlertStyle","alertMessage","alertType","soundTheAlarm","defaultAudioFilePath","AudioFilePath","beepSound","Audio","autoplay","pause","alertPromise","newValue","AlertButtonVisible","AlertSoundPlaying","NewInterpreterPortalController","$uibModalInstance","interpreterVoicePortalFrontEndUrl","stayInOldVoicePortal","isSwitchAborted","IvrNewVoicePortalUsedByInterpreter","redirectToInterpreterVoicePortal","href","hasRequiredStatusToStayInOldVoicePortal","switchToInterpreterTimeout","acceptableStatuses","NewCallOperatorsPortalController","callOperatorsVoicePortalFrontEndUrl","IvrNewVoicePortalUsedByOperator","redirectToCallOperatorsVoicePortal","switchToCallOperatorsTimeout","ModalFeedbackController","buildFeedbackTypesList","list","attribute","dividedAttribute","submitFeedback","submitting","feedbackDescription","FirstName","LastName","Email","referenceId","profileName","feedbackType","getBrowserInfo","setRootScopeTitle","tem","matchArray","match","exec","slice","join","appVersion","opened","includes","feedbackTypes","ModalCallController","waitingForResponse","timerStarted","interpreterid","FromPhoneNumber","callRejectedMessage","getCallRejectedMessage","missedCallTitle","operatorid","actionAttempted","callid","callRejected","setInterpreterStatus","from","ProfileName","Language","responseTimeout","ResponseTimeout","organizationName","OrganizationName","scheduledCase","ScheduledCase","modalOpened","rendered","renderDelay","floor","drag","dragOptions","DraggableController","elem","attr","mousemove","y","clientY","startY","x","clientX","startX","setPosition","mouseup","container","left","right","width","top","bottom","height","css","start","offsetWidth","offsetHeight","preventDefault","offsetLeft","offsetTop","voxScheduledRelayInterpretation","ScheduledRelayInterpretationController","initialize","isRareLanguageInterpreterConnected","isRelayInterpreterConnected","relayInterpreterConnectFailed","arePartiesConnected","isCustomerOnHold","isRareLanguageInterpreterOnHold","isRelayInterpreterOnHold","connectingRareLanguageInterpreter","connectingRelayInterpreter","callingLanguageService","connectingParties","switchingParticipant","onCurrentCallChanged","interpreterMissedTheCall","interpreterAnsweredTheCall","interpreterLeftTheCallEvent","interpreterLeftTheCall","findInterpreterTimeoutEvent","findRelayInterpreterTiemout","showInstructionMessage","connectRelayInterpreterDisabled","callLanguageServiceDisabled","updateInstructionMessage","relayInterpreterPhoneNumber","checkParticipantsOnCall","rareDropped","ralayDropped","interpreterDroppedInfo","switchParticipant","muteCustomer","muteRareInterpreter","muteRelayInterpreter","promises","areControlsDisabled","isConnectRelayInterpreterButtonDisabled","connectRareLanguageInterpreter","callHoldSuccess","callSuccess","callError","connectRelayInterpreter","RelayLanguageId","languageServiceIsTimeouted","conferenceAllParties","connectSuccess","connectError","connectFinally","isOnHold","getRareInterpreterPhone","InterpreterPhone","rareInterpreter","voxReconnectSpecificInterpreter","ReconnectSpecificInterpreterController","interpreterName","checkIfInterpreterOnCall","callDisabled","connectDisabled","stopLadda","callShowError","interpreterUnavailable","callHideError","callingInterpreter","cantConnectInterpreter","connectHideError","callTitle","connectTitle","voxReconnectInterpreter","ReconnectInterpreterController","isReconnectInterpreterDisabled","callInterpreterDisabled","callEventsWatch","eventInfo","disconnectMessage","isInterpreterUnavailable","voxOperatorsTable","OperatorsTableController","operators","operatorCount","val","voxOperator","OperatorController","callType","$uibModal","listeners","languages","pools","getAllOperators","getAllInterpreters","getOperator","getLoggedInInterpretersCall","buildLanguages","showNonIVRLanguagesDropdown","Languages","buildOperators","buildInterpreters","go","currentCustomer","currentMetaData","languageList","inCallInterpreters","loggedInInterpreters","selectedLanguage","activeTable","interpreterCount","loggedInInterpreterCount","showCallDetails","disconnectButtonDisabled","callEventType","changeActiveTable","showThirdParty","allOperatorsTableNeedsRefresh","configureAppSettings","alertStartEvent","alertStart","alertStopEvent","alertStop","callConnectedEvent","callConnected","testCallConnectedEvent","testCallConnected","callEndedEvent","callEnded","missedCallEvent","missedCall","refreshDataEvent","refreshData","youHaveACallEvent","youHaveACall","setAllOperatorsTable","operatorToSingleUpdate","find","rowToUpdate","operatorGetAllOperators","getOperatorDelay","GetLoggedInInterpretersDelayMilliseconds","getLoggedInInterpretersDelay","GetOperatorDelayMilliseconds","tableName","Customer","Metadata","currentSipCallData","SipCallData","Case","currentCallLanguage","getCallLanguage","getNonIVRLanguages","enableCallDisposition","operatordata","customerdata","events","CallStatusNames","LanguageSelected","languagesCache","filteredLanguages","Pools","buildPoolsList","desiredStatus","caseData","ReferenceId","LSButtonVisible","ConnectInterpreterButtonVisible","ConnectMeButtonVisible","HangupButtonVisible","operatorGetLoggedInInterpreters","buildLoggedInInterpreters","property","interpreterEnvelope","changeLoggedInInterpreterState","Action","updateInterpreters","removeInterpreter","updateInterpreterStatusInfoInAllInterpretersTab","indexInListOfAll","lodash","findIndex","LastLogin","LastLoginDisplay","IsLanguageService","getInterpreterLoginLogoutButtonState","loggedInInterpreter","buildLoggedInInterpreter","orderBy","modalInstance","open","animation","backdrop","_","GetCallDispositionTimeoutMilliseconds","GetCallDispositionFlag","ShowNonIVRLanguagesDropdown","filterOverflowVendorsBasedOnLanguage","FilterOverflowVendorsBasedOnLanguage","voxLoggedinInterpretersTable","LoggedinInterpretersTableController","interpreterLoginStatusChange","loginStatus","Login","Logout","statuses","$parent","PersonStatus","voxInterpretersTable","InterpretersTableController","Hub","operatorId","DesiredStatus","operatorStatusEvent","callNotAnswered","isLanguageServiceTimeoutExpired","sipcalldata","operatorStatus","operatorPostServerMessage","timeStarted","operatorPostServerMessageEvent","isPreReqPending","httpPendingReqList","pendingRequests","req","urlsToCheck","redirectToLogin","redirectToLoginEvent","logOutUser","logOutUserEvent","findInterpreterTimeout","operatorRefreshAll","refreshBrowser","InterpreterStatus","OperatorStatus","RefreshData","RecentCalls","useSharedConnection","methods","logging","autoConnect","transport","queryParams","errorHandler","stateChanged","oldState","newState","voxMonitor","MonitorController","monitor","monitorCurrentCallIdEvent","monitorCurrentCallId","CurrentCallId","currentCallId","monitorStatus","monitorId","monitorStatusEvent","monitorRefreshAll","appRun","routerHelper","LoginController","redirect","activated","loginError","loginWaiting","setOldLoginVisible","oldLoginVisible","redirectToADB2C","version","voxTopNav","TopNavController","initSwitching","isInterpreter","isOtherThanInterpreter","PortalSwitchingPortalsDelay","switchingPortalDelay","hasRequiredStatusToSwitchNewVoicePortal","initInterpreterSwitching","ivrNewVoicePortalUsedByInterpreter","ivrNewVoicePortalUsedByInterpreterMaxAge","timespanToTotalSeconds","updateInterpreterVoicePortalAccess","initOperatorMonitorSwitching","updateOperatorVoicePortalAccess","switchingPortalMaxAge","showModalSwitchingToNewInterpreterPortal","hasAccessToNewInterpreterVoicePortal","switchToInterpreterVoicePortal","timespan","shouldReload","warnStatus","isWarnStatus","refreshRetainsCall","confirm","refreshing","signOut","logOut","remove","keyboard","feedback","RefreshRetainsCall","onbeforeunload","voxInterpreter","InterpreterController","getInterpreter","currentLanguageName","LanguageName","callCenterPhoneNumber","CallCenterPhoneNumber","interpreterdata","languageName","interpreterDropAbruptly","voxInterpreterConference","InterpreterConferenceController","reconnectInterpreter","isAutoReconnect","ReconnectButtonClicked","reconnectButtonDisabled","showReconnectButton","showHideReconnect","ReconnectWarningButtonVisible","reconnectButton","phoneNumberError","isC2C","IVRApplicationId","IVRApplication","ClickToCall","isHostedIVR","HostedIVR","showCallCenterNumber","refreshReminder","RefreshReminder","ShowScheduledCallAlert","showAlert","interpreterStatusEvent","str","CaseId","interpreterPostServerMessage","interpreterStatus","interpreterPostServerMessageEvent","interpreterNoTalkActivity","interpreterNoTalkActivityEvent","interpreterRefreshAll","GetDeviceInfo","deviceList","os","deviceInfo","isMobile","userAgentData","platform","mobile","identifyUserDevice","deviceArray","startKeepAliveInterval","setKeepAliveIntervalSeconds","userRoles","TimeZone","GroupName","buildLanguagesList","addEventFlag","ConnectButtonVisible","arr","hasOwnProperty","sort","a","b","languagePayrates","poolList","canLoginLogoutLSUsers","IsLSAllOther","WorkGroup","LastCallEnded","localDate","toLocaleString","s","arguments","reg","RegExp","convertMinutesToSeconds","minutes","days","hours","padZeros","getClientAppJavaScriptFileName","scripts","document","getElementsByTagName","src","getAttribute","substring","c","r","v","toLowerCase","String","prototype","pos","handleResponse","handleResponseError","responseError","$httpProvider","interceptors","constant","moment","Twilio","None","UnableToSendAlerts","UnableToCall","CallNotAccepted","CallRejected","CallNotAnswered","InvalidPhoneNumber","UnableToUpdateTheCall","ExceededReconnectAttempts","ExceededMissedAlerts","PhoneBusy","MissedAlert","CustomerInitiatedReconnect","UnableToCallVOIPOffline","DropThresholdExceeded","LoginViaApi","LogoutViaApi","ExceededUnableToSendAlerts","LostConnectivity","ImprovedLatency","3","5","6","8","9","10","11","15","16","17","18","19","21","22","Fatal","WebRtcStatus","Ready","Busy","Phone","OPI","EscalateToVoice","referenceCache","adminGetLoggedInInterpreters","RecentCallsRefreshIntervalSeconds","ReCreateTokens","IsInterpreterDispositionMenu","IsShowDefaultReminder","DefaultShowReminderText","IsShowDefaultOperatorReminder","DefaultShowOperatorReminderText","ShowWebRtcDialpad","DisconnectWebRtcActiveConnection","EnableStateMachine","StateMachineStatusForAlerting","StateMachineStatusForInCall","StateMachineStatusForRinging","IsCustomerMonitorRefresh","IsShowAppVersion","EnableTwilioClientDebugging","TwilioSDKVersion","ShowAdditionalStuckCalls","IvrNewVoicePortalUsedByOperatorByDefault","PhoneHangup","WebRTCHangup","DispositionMenuInaudibleNonEnglishSpeaker","DispositionMenuCustomerDropCallQuality","DispositionMenuCustomerDropAbruptly","DispositionMenuCustomerDropWhileConferencing","DispositionMenuInterpreterNolongerNeeded","DispositionMenuCouldNotHearCustomerAndOrLEP","DispositionMenuPoorAudioQuality","DispositionMenuCallDropped","DispositionMenuTechnicalProblem","DispositionMenuCustomerDidNotReturnFromHold","DispositionMenuCustomerHangupOrTransferContd","ShowedNoTalkDisposition","InterpreterOnAnotherCall","toastrConfig","timeOut","positionClass","$logProvider","applicationInsightsServiceProvider","debugEnabled","appTitle","applicationName","autoPageViewTracking","autoStateChangeTracking","autoLogTracking","autoExceptionTracking","sessionInactivityTimeout","developerMode","appInsightsInstrumentationKey","enableCorsCorrelationFlag","correlationHeaderExcludedDomains","appInsights","t","queue","apply","f","u","h","l","createElement","parentNode","appendChild","cookie","p","pop","disableExceptionTracking","instrumentationKey","enableCorsCorrelation","trackPageView","core","voxUserInformation","VoxUserInformationController","operatorPools","interpreterLanguagePayrates","isCustomerMonitor","voxConsoleStatus","ConsoleStatusController","handlePersonStatus","isVisibleStatusReasonChangedMessage","showStatusChangeReason","LastStatusChange","userStatusReason","statusReasonsToHideInitially","operatorWatch","logClientJavaScriptVersion","interpreterWatch","monitorWatch","errorMessageWatch","invalidPhoneOriginalStatus","showContactMethods","interpreterData","customerData","customerDetails","showDefaultReminderText","showDefaultOpertorReminderText","panelClass","showWebRtcDialpad","enableStateMachine","stateMachineStatusForAlerting","stateMachineStatusForInCall","stateMachineStatusForRinging","statusChanged","statusDisabled","statusOptionHidden","setTempPhoneNumber","displayStatus","contactMethodSelectShown","statusChangeTime","notifyTestButtonDirective","checkAllowedStatusChanges","removeModal","resetDialpad","currentStatus","validateAllowedStatus","allowedStatus","getStatus","testButtonDisabled","chkStatusName","userIsOnlyMonitor","getResultByStatus","personId","fileName","interpreterDetails","operatorDetails","voxConsoleReminder","ConsoleReminderController","getGreetingReminderText","setValues","getReminderTextDatabase","getGreetingText","getClosingText","customerGreeting","customerReminder","displayedGreeting","displayedReminder","reminder","getDefaultShowReminderText","reminderHasData","usedDefaultGreeting","greeting","interpreterPin","closing","InterpreterReminder","OperatorReminder","InterpreterGreeting","OperatorGreeting","OperatorClosing","customReminderText","customerGreetingText","Pin","voxConsoleInstructionMessage","ConsoleInstructionMessageController","setupSubscriptions","showMessage","userMessage","PostServerMessage","showInstructionalMessage","hideInstructionMessage","voxConsoleCallControlPanel","ConsoleCallControlPanelController","enableHangupButton","isHangUpDisabled","showNoTalkPopup","showing","setuplisteners","NoTalkActivity","dispositionMenuPrefFlag","isApplicableforDisposition","dissconnectCallAndAddEvent","disconnectWebRtcActiveConnection","voxConsoleAlert","ConsoleAlertController","tryGettingAlert","setupUser","setupAlertActionMessage","hideAlertActionMessage","alertActionMessage","voxCallEvents","CallEventsController","callConnectedTime","EventTime","getAdditionalInfo","additionalInfo","getUserFullName","firstName","lastName","callConnectedLocaleString","voxCallDuration","CallDurationController","betterVoiceCallId","getReconnectWarningThreshold","getAutoReconnectThreshold","startTime","reconnectWarningThreshold","autoReconnectThreshold","StartTime","reconnectWarningMinutes","autoReconnectMinutes","ConsoleController","keepAliveInterval","showAppVersionFlag","getApplicationVersion","identity","maximised","voxAdmin","AdminLayoutController","voxAdminCallsTable","AdminCallsTableController","isCustomerMonitorRefresh","additionalStuckCallCondition","recentHours","recentCallCriteriaList","hoursChanged","customerMonitor","recentCallsRefreshIntervalSeconds","setTimerToRefreshRecentCalls","refreshRecentCalls","refreshRecentCallsForMonitor","calls","updateCalls","getTerminameButtonAdditionalCondition","defaultCondition","selectedHour","additionalCondition","getCallsComplete","callsUpdating","getCallsFailed","CallConnectedDisplay","CallConnected","getFullYear","filterChange","monitorCall","requestingToListen","hasMonitoring","monitoringRestricted","hasAccess","userSpecRefreshRecentCallsInterval","terminateCall","showTerminateButton","AdminController","$templateCache"],"mappings":"AA8nNA,QAASA,WACL,GAAIC,IACAC,QAAS,WACTC,SAAU,KACVC,OAASJ,QAAS,YAClBK,KAAM,SAAkBD,EAAOE,EAASC,EAAOC,GAC3C,MAAOF,GAAQG,KAAK,QAAS,WACzB,MAAOL,GAAMM,OAAO,WAChB,GAAIC,EAGJ,OAFAA,GAAaH,EAAKG,aAClBA,EAAWC,OAAOC,mBACXL,EAAKM,YAK5B,OAAOb,IA9oNX,WACI,YAEAc,SACKC,OAAO,mBACJ,YAAa,UAAW,aAAc,YAAa,eACnD,UAAW,gBAAiB,eAAgB,uBAAwB,4BACpE,mBAAoB,gBAAiB,gBAAiB,cAAe,YAAa,gBAAiB,iBAG/G,WACI,YAEAD,SACKC,OAAO,mBACPC,OAAO,SAAU,WAGd,MAAO,UAAUC,EAAYC,GAEzB,GAAIC,MACAC,IAiBJ,OAbAN,SAAQO,QAAQJ,EAAY,SAAUK,GAElC,GAAIC,GAAMD,EAAKJ,EAEW,MAAtBE,EAAKI,QAAQD,KAEbH,EAAKK,KAAKF,GAEVJ,EAAOM,KAAKH,MAKbH,QAKvB,WAEI,YAEAL,SACKC,OAAO,mBACPC,OAAO,MAAO,WACX,MAAO,UAAUU,EAAOC,GACpB,MAAOA,GAAID,SAK3B,WACI,YAEAZ,SACKC,OAAO,mBACPC,OAAO,iBAAkB,WACtB,MAAO,UAAUU,GACb,MAAcE,UAAVF,GAAuBG,MAAMH,GAC7BA,EAAQA,EAAMI,QAAQ,kBAAmB,SAIlCJ,QAM3B,WACI,YAEAZ,SACKC,OAAO,mBACPC,OAAO,eAAgB,YAAa,SAAUe,GAE3C,QAASC,GAAYC,EAAeC,GAGhC,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18D,IAAI,8CAA8C,00BACjE08D,EAAe18D,IAAI,uDAAuD,k5BAC1E08D,EAAe18D,IAAI,uDAAuD;AAC1E08D,EAAe18D,IAAI,8BAA8B,msCACjD08D,EAAe18D,IAAI,kCAAkC,o0BACrD08D,EAAe18D,IAAI,mDAAmD,ikBACtE08D,EAAe18D,IAAI,gDAAgD,mmBACnE08D,EAAe18D,IAAI,6BAA6B,wfAChD08D,EAAe18D,IAAI,4BAA4B,s9CAC/C08D,EAAe18D,IAAI,2CAA2C,6+KAC9D08D,EAAe18D,IAAI,+CAA+C,inBAClE08D,EAAe18D,IAAI,kDAAkD,o0BACrE08D,EAAe18D,IAAI,8CAA8C,6iGACjE08D,EAAe18D,IAAI,iCAAiC,yGACpD08D,EAAe18D,IAAI,+BAA+B,mCAClD08D,EAAe18D,IAAI,wCAAwC,i0CAC3D08D,EAAe18D,IAAI,iCAAiC,q7CACpD08D,EAAe18D,IAAI,0CAA0C,08BAC7D08D,EAAe18D,IAAI,oCAAoC,o3DACvD08D,EAAe18D,IAAI,oCAAoC;AACvD08D,EAAe18D,IAAI,uCAAuC,wHAC1D08D,EAAe18D,IAAI,gCAAgC,y5CACnD08D,EAAe18D,IAAI,wCAAwC,ocAC3D08D,EAAe18D,IAAI,kDAAkD","file":"scripts/app-acd4e80f01.js","sourcesContent":["(function () {\r\n 'use strict';\r\n\r\n angular\n .module('vox-leonis.core', [\r\n 'ngAnimate', 'ngTouch', 'ngSanitize', 'ui.router', 'ui.bootstrap',\r\n 'SignalR', 'angular-ladda', 'ngScrollbars', 'angular-progress-arc', 'ApplicationInsightsModule',\r\n 'blocks.exception', 'blocks.logger', 'blocks.router', 'smart-table', 'ngCookies', 'angular-cache', 'ui.select']);\r\n})();\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.core')\r\n .filter('unique', function () {\r\n // we will return a function which will take in a collection\r\n // and a keyname\r\n return function (collection, keyname) {\r\n // we define our output and keys array;\r\n var output = [],\r\n keys = [];\r\n\r\n // we utilize angular's foreach function\r\n // this takes in our original collection and an iterator function\r\n angular.forEach(collection, function (item) {\r\n // we check to see whether our object exists\r\n var key = item[keyname];\r\n // if it's not already part of our keys array\r\n if (keys.indexOf(key) === -1) {\r\n // add it to our keys array\r\n keys.push(key);\r\n // push this item to our final output array\r\n output.push(item);\r\n }\r\n });\r\n // return our array which should be devoid of\r\n // any duplicates\r\n return output;\r\n };\r\n });\r\n})();\r\n\n(function ()\r\n{\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.core')\r\n .filter('map', function () {\r\n return function (input, map) {\r\n return map[input];\r\n };\r\n });\r\n})();\r\n \n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.core')\r\n .filter('camelcaseSpace', function () {\r\n return function (input) {\r\n if (input !== undefined && isNaN(input)) {\r\n input = input.replace(/([a-z])([A-Z])/g, '$1 $2');\r\n return input;\r\n }\r\n else {\r\n return input;\r\n }\r\n };\r\n });\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.core')\r\n .filter('elapsedTime', ['utilities', function (utilities) {\r\n\r\n function elapsedTime(startDateTime, endDateTime) {\r\n startDateTime = startDateTime ? new Date(startDateTime) : new Date();\r\n endDateTime = endDateTime ? new Date(endDateTime) : new Date();\n return getTimeDisplay(startDateTime.getTime(), endDateTime.getTime());\r\n }\r\n\r\n return elapsedTime;\r\n\r\n function getTimeDisplay(startDateTime, endDateTime) {\r\n\r\n if (startDateTime >= endDateTime) {\r\n return '0';\r\n }\r\n\r\n var diffSeconds = (endDateTime - startDateTime) / 1000;\r\n\r\n return utilities.convertSecondsToDisplayString(diffSeconds);\r\n }\r\n\r\n }]);\r\n})();\r\n\n(function () {\n 'use strict';\n\n angular\n .module('vox-leonis.core')\n .factory('userservice', userservice);\n\n userservice.$inject = ['$http', '$q', 'exception', 'logger', 'enums', 'usermessageservice', 'stringResources', 'utilities', 'accountservice'];\n /* @ngInject */\n function userservice($http, $q, exception, logger, enums, usermessageservice, stringResources, utilities, accountservice) {\n var baseUrl = '/api/User';\n\n var service = {\n acceptAlert: acceptAlert,\n rejectAlert: rejectAlert,\n getCurrentAlert: getCurrentAlert,\n showChangeStatusReason: showChangeStatusReason,\n addCallEvent: addCallEvent,\n updateContactMethod: updateContactMethod,\n setMetadata: setMetadata,\n setSipdata: setSipdata,\n getUserSetting: getUserSetting,\n getUserFullSetting: getUserFullSetting,\n setUserSetting: setUserSetting,\n endConference: endConference,\n disconnectCall: disconnectCall,\n interpreterDispositionMenu: interpreterDispositionMenu,\n testCall: testCall\n };\n\n return service;\n\n /* */\n\n function acceptAlert(resourceAlertId, resourceRequestId, isTestCall, callId, isScheduleCall) {\n accountservice.logMessage('AcceptAlert is triggered|ResourceRequestId = ' + resourceRequestId + '|ResourceAlertId = ' + resourceAlertId, enums.LogLevel.Debug);\n return $http.put(baseUrl + '/AcceptAlert', {},\n { params: { resourceAlertId: resourceAlertId, resourceRequestId: resourceRequestId, isTestCall: isTestCall, callId: callId, isScheduleCall: isScheduleCall } })\n .then(success)\n .catch(fail);\n\n function success(response) {\n return response.data;\n }\n\n function fail(e) {\n return exception.catcher('XHR failed for acceptAlert')(e);\n }\n }\n\n function rejectAlert(resourceAlertId, resourceRequestId, isTestCall, callId, isScheduleCall) {\n return $http.put(baseUrl + '/RejectAlert?resourceAlertId=' + resourceAlertId + '&resourceRequestId=' + resourceRequestId + '&isTestCall=' + isTestCall + '&callId=' + callId +\n '&isScheduleCall=' + isScheduleCall)\n .then(success)\n .catch(fail);\n\n function success(response) {\n return response.data;\n }\n\n function fail(e) {\n return exception.catcher('XHR failed for rejectAlert')(e);\n }\n }\n\n function getCurrentAlert() {\n return $http.get(baseUrl + '/Alert')\n .then(success)\n .catch(fail);\n\n function success(response) {\n return response.data;\n }\n\n function fail(e) {\n return exception.catcher('XHR failed for getCurrentAlert')(e);\n }\n }\n\n function showChangeStatusReason(statusName, time, reason) {\n // Don't show lost connectivity reasons to the user\n if (!time || !reason || reason === 21) {\n usermessageservice.notify(enums.Events.ShowInstructionMessage, { message: '' });\n return;\n }\n\n var reasonToDisplay = enums.PersonStatusMessage[reason];\n\n // Don't show reason dialog if there is no associated message text\n if (!reasonToDisplay || reasonToDisplay === '') {\n usermessageservice.notify(enums.Events.ShowInstructionMessage, { message: '' });\n return;\n }\n\n var timeToDisplay = utilities.getLocalDate(time);\n var message;\n\n if (statusName === enums.PersonStatusNames.Available) {\n message = utilities.stringFormat('{0}. {1}', reasonToDisplay, timeToDisplay);\n } else {\n message = utilities.stringFormat(\n stringResources.personStatusMessageFormat, statusName, reasonToDisplay, timeToDisplay);\n }\n\n usermessageservice.notify(enums.Events.ShowInstructionMessage, { message: message });\n }\n\n function addCallEvent(eventName, callId, metadata) {\n var body = { metadata: null };\n if (metadata !== undefined && metadata !== null && metadata !== '') {\n body = { metadata: metadata };\n }\n\n return $http.put(baseUrl + '/Call/' + callId + '/CallEvent/' + eventName, body)\n .then(success)\n .catch(fail);\n\n function success(response) {\n return response.data;\n }\n\n function fail(e) {\n return exception.catcher('XHR failed for addCallEvent')(e);\n }\n\n }\n\n function getUserSetting(userSetting, defaultValue) {\n return $http.get('/api/User/Settings/' + userSetting + '?defaultValue=' + defaultValue)\n .then(success)\n .catch(fail);\n\n function success(response) {\n return response.data;\n }\n\n function fail(e) {\n return exception.catcher('XHR failed for getUserSetting')(e);\n }\n }\n\n function getUserFullSetting(userSetting, defaultValue) {\n return $http.get('/api/User/FullSettings/' + userSetting)\n .then(success)\n .catch(fail);\n\n function success(response) {\n return response.data;\n }\n\n function fail(e) {\n return exception.catcher('XHR failed for getUserFullSetting')(e);\n }\n }\n\n function setUserSetting(userSetting, value) {\n return $http.put(baseUrl + '/Settings/' + userSetting, value)\n .then(success)\n .catch(fail);\n function success(response) {\n return response.data;\n }\n\n function fail(e) {\n return exception.catcher('XHR Failed for set user setting')(e);\n }\n }\n\n function updateContactMethod(contactMethod) {\n return $http.put('/api/User/ContactMethod', contactMethod)\n .then(success)\n .catch(fail);\n\n function success(response) {\n return response.data;\n }\n\n function fail(e) {\n return exception.catcher('XHR failed for updateContactMethod')(e);\n }\n }\n\n /* */\n function setMetadata(callId, metaData) {\n return $http.put(baseUrl + '/MetaData/' + callId, metaData)\n .then(success)\n .catch(fail);\n\n function success(response) {\n return response.data;\n }\n\n function fail(e) {\n return exception.catcher('XHR Failed for set meta data')(e);\n }\n }\n\n function setSipdata(callId, sipData) {\n return $http.put(baseUrl + '/SipData/' + callId, sipData)\n .then(success)\n .catch(fail);\n\n function success(response) {\n return response.data;\n }\n\n function fail(e) {\n return exception.catcher('XHR Failed for set sip data')(e);\n }\n }\n\n /* */\n function endConference(callId) {\n return $http.put(baseUrl + '/EndConference/' + callId)\n .then(success)\n .catch(fail);\n\n function success(response) {\n return response.data;\n }\n\n function fail(e) {\n return exception.catcher('XHR failed to end conference')(e);\n }\n }\n\n /* */\n function disconnectCall(callId) {\n return $http.put(baseUrl + '/Call/' + callId + '/Disconnect')\n .then(success)\n .catch(fail);\n\n function success(response) {\n return response.data;\n }\n\n function fail(e) {\n return exception.catcher('XHR failed for userservice.disconnectCall')(e);\n }\n }\n\n /* */\n function interpreterDispositionMenu() {\n return $http.get(baseUrl + '/Disposition/Interpreter')\n .then(success)\n .catch(fail);\n\n function success(response) {\n return response.data;\n }\n\n function fail(e) {\n return exception.catcher('XHR failed for userservice.interpreterDispositionMenu')(e);\n }\n }\n\n /* */\n function testCall() {\n return $http.put(baseUrl + '/TestCall')\n .then(success)\n .catch(fail);\n\n function success(response) {\n return response.data;\n }\n\n function fail(e) {\n return exception.catcher('XHR failed our userservice.testcall')(e);\n }\n }\n }\n})();\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.core')\r\n .factory('usermessageservice', usermessageservice);\r\n\r\n usermessageservice.$inject = ['$rootScope'];\r\n /* @ngInject */\r\n function usermessageservice($rootScope) {\r\n var service = {\r\n subscribe: subscribe,\r\n notify: notify\r\n };\r\n\r\n return service;\r\n\r\n /* */\r\n function subscribe(scope, event, callback) {\r\n var handler = $rootScope.$on(event, callback);\r\n scope.$on('$destroy', handler);\r\n }\r\n\r\n function notify(event, args) {\r\n $rootScope.$emit(event, args);\r\n }\r\n }\r\n})();\r\n\n(function (angular) {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.core')\r\n .factory('twiliowebrtcservice', twiliowebrtcservice);\r\n\r\n twiliowebrtcservice.$inject = ['$rootScope', 'accountservice', 'enums', 'twilio', '$cookies', 'callEvents', 'userservice',\n 'appsettingsservice', 'preferences', 'constants', 'usermessageservice'];\r\n\r\n function twiliowebrtcservice($rootScope, accountservice, enums, twilio, $cookies, callEvents, userservice,\r\n appsettingsservice, preferences, constants, usermessageservice) {\r\n var devices = [];\r\n var lastConnection;\n var preflightTest;\r\n var service = {\r\n enable: enable,\r\n disable: disable,\r\n hangUp: hangUp,\n setup: setup,\r\n isInCall: isInCall,\r\n isWebRTCSupported: isWebRTCSupported,\n mute: mute,\n unmute: unmute,\n sendDigits: sendDigits,\n disconnect: disconnect,\n clearDevice: clearDeviceAndCreateNew,\n setPortalRefresh: setPortalRefresh\n };\n\r\n var showNetworkQualityIndicatorDefault = 'false';\n var preFlightEnabled = false;\n var currentRole = $cookies.get(constants.userRole);\n var twilioErrorLimitToLog = 1000;\n var tokenRefreshMilliseconds = 60000;\n var settingUpPeriodicTokenUpdation = false;\n var pageRefresh = true;\n var hangupNeedsRefreshToken = false;\n // SDK 2.1.1\n var refreshTokenInProgress = false;\n var runningPreflight = false;\n var showWebRTCReconnectionStatus = false;\n // SDK 2.1.1\n var twilioSDKLogLevel = 5; //silent\n var createTokenOnError = false;\n var tokenAgeMinutes = 60;\n var tokenAgeMilliseconds = tokenAgeMinutes * 60000;\n var interval = false;\n var defaultEdgeLocations = ['roaming'];\n var codecPreferences = ['opus'];\n var disableTokenGenerationLocalHost = false;\n var logTwilioErrorsOnConsole = false;\n var registerDeviceWhenOffline = false;\n\n initializePreferences();\r\n\r\n return service;\r\n\n function initializePreferences() {\n appsettingsservice.getAppSetting(preferences.TwilioErrorLimitToLog, twilioErrorLimitToLog).then(function (data) {\r\n twilioErrorLimitToLog = +data;\r\n });\n\n userservice.getUserSetting('Portal_EnableTwilioClientDebugging', twilioSDKLogLevel).then(function (data) {\n if (data) {\n twilioSDKLogLevel = +data;\r\n }\r\n });\n\n appsettingsservice.getAppSetting(preferences.TokenRefreshMilliseconds, tokenRefreshMilliseconds).then(function (data) {\r\n tokenRefreshMilliseconds = +data;\r\n });\n\r\n if (currentRole !== undefined) {\r\n appsettingsservice.getAppSetting(preferences.ShowNetworkQualityIndicator, showNetworkQualityIndicatorDefault).then(function (data) {\r\n showNetworkQualityIndicatorDefault = data;\r\n });\n }\n\n appsettingsservice.getAppSetting(preferences.DisableTokenGenerationLocalHost, disableTokenGenerationLocalHost).then(function (data) {\r\n disableTokenGenerationLocalHost = (data === 'true');\r\n });\n\n appsettingsservice.getAppSetting(preferences.WebRTCTokenAgeMinutes, tokenAgeMinutes).then(function (data) {\r\n tokenAgeMinutes = +data;\n tokenAgeMilliseconds = tokenAgeMinutes * 60000;\r\n });\n\n userservice.getUserSetting(preferences.preFlight, preFlightEnabled).then(function (data) {\r\n preFlightEnabled = (data === 'true');\r\n });\n\r\n appsettingsservice.getAppSetting(preferences.WebRTCEdgeLocations, defaultEdgeLocations).then(function (data) {\r\n defaultEdgeLocations = data ? data.toString().split(',') : defaultEdgeLocations;\r\n });\n\n appsettingsservice.getAppSetting(preferences.CodecPreferences, codecPreferences).then(function (data) {\r\n codecPreferences = data ? data.toString().split(',') : codecPreferences;\r\n });\n\r\n appsettingsservice.getAppSetting(preferences.CreateTokenOnError, createTokenOnError).then(function (data) {\r\n createTokenOnError = (data === 'true');\r\n });\n\n userservice.getUserSetting(preferences.LogTwilioErrorsOnConsole, logTwilioErrorsOnConsole).then(function (data) {\r\n logTwilioErrorsOnConsole = (data === 'true');\r\n });\n\n appsettingsservice.getAppSetting(preferences.ShowWebRTCReconnectionStatus, showWebRTCReconnectionStatus).then(function (data) {\r\n showWebRTCReconnectionStatus = (data === 'true');\r\n });\n\n appsettingsservice.getAppSetting(preferences.RegisterDeviceWhenOffline, registerDeviceWhenOffline).then(function (data) {\r\n registerDeviceWhenOffline = (data === 'true');\r\n });\r\n }\r\n function enable() {\r\n var regereratingTokenDueToError = false;\r\n setup(regereratingTokenDueToError, 0);\r\n }\n\r\n function disable(userId) {\n if (devices.length > 0) {\r\n devices.forEach(function (device) {\r\n device.removeListener(enums.DeviceStatus.Error, deviceEventHandlerError);\r\n device.removeListener(enums.DeviceStatus.Incoming, deviceEventHandlerIncoming);\r\n device.removeListener(enums.DeviceStatus.Unregistered, deviceEventHandlerUnregistered);\r\n device.removeListener(enums.DeviceStatus.Registered, deviceEventHandlerRegistered);\n device.removeListener(enums.DeviceStatus.Destroyed, deviceEventHandlerDestroyed);\n device.removeListener(enums.DeviceStatus.Registering, deviceEventHandlerRegistering);\n device.removeListener(enums.DeviceStatus.TokenWillExpire, deviceEventHandlerTokenWillExpire);\n device.destroy();\r\n });\r\n\r\n // start over\r\n devices = [];\n //Use deleteDeviceUpdationJob in sdk 2.0.0\n //deleteDeviceUpdationJob();\n accountservice.logMessage('twiliowebrtcservice.disable|WebRTC disabled for User: ' + userId, enums.LogLevel.Debug);\n }\r\n }\n\r\n function deviceEventHandlerDestroyed() {\r\n console.log('Device Destroyed');\r\n //Use deleteDeviceUpdationJob in sdk 2.0.0\n //deleteDeviceUpdationJob();\r\n }\n\r\n function deleteDeviceUpdationJob() {\n if (interval) {\n clearInterval(interval);\n interval = undefined;\r\n }\r\n }\r\n function deviceEventHandlerRegistered() {\r\n devices.every(function (device) {\r\n\r\n console.log('registered... Device Status: ' + device.state);\r\n });\n //Call setUpTokenUpdation in sdk version 2.0.0\n //setUpTokenUpdation();\n\n if (runningPreflight) {\r\n console.log('Preflight Run in progress');\r\n return;\r\n }\r\n runningPreflight = true;\r\n\r\n if (preFlightEnabled) {\n var curStatus = $cookies.get('currentStatus');\n if (curStatus === 'Available' || curStatus === 'Away') {\n runPreflightTests();\r\n }\r\n }\n setTimeout(function () { runningPreflight = false; }, 2000);\r\n }\n\n function runPreflightTests() {\r\n if (preFlightEnabled) {\n accountservice.getPreflightAccessToken().then(function (data) {\r\n if (!!data) {\r\n var setupOptions = {\r\n // for testing:\r\n logLevel: twilioSDKLogLevel,\r\n //warnings: true,\r\n edge: defaultEdgeLocations,\r\n appName: 'Voice Portal Preflight',\r\n closeProtection: true,\r\n codecPreferences: ['opus', 'pcmu'],\r\n };\r\n\r\n preflightTest = twilio.Device.runPreflight(data, setupOptions);\r\n preflightTest.on('completed', preflightSuccess);\r\n preflightTest.on('failed', preflightError);\r\n }\r\n });\r\n }\r\n }\r\n\r\n function preflightSuccess(report) {\r\n console.log(report);\r\n if (!!report) {\r\n accountservice.logMessage('twiliowebrtcservice.preflightSuccess|CallSid: ' + report.callSid +\r\n ', userId: ' + getUserId() + ', result: ' + report.callQuality + ', edge: ' + report.edge +\r\n ', selectedEdge: ' + report.selectedEdge, enums.LogLevel.Info);\r\n }\r\n }\r\n\r\n function preflightError(error) {\r\n accountservice.logMessage('twiliowebrtcservice.preflightError|Code: ' + error.code + ', Message: ' + error.message +\r\n ' Causes: ' + error.TwilioError.causes + ', userId: ' + getUserId(), enums.LogLevel.Warn);\r\n }\r\n\r\n // due to old long-aged bug try to find userId by any suitable way\r\n function getUserId() {\r\n var cachedUserId = $cookies.get('userId');\r\n if (!!cachedUserId) {\r\n return cachedUserId;\r\n }\r\n\r\n var cachedCurrentUserId = $cookies.get('currentUserid');\r\n if (!!cachedCurrentUserId) {\r\n return cachedCurrentUserId;\r\n }\r\n\r\n return accountservice.getCurrentUserId();\r\n }\n\n //used in twilio sdk 2.1.1\n function deviceEventHandlerTokenWillExpire() {\r\n if (refreshTokenInProgress) {\r\n console.log('RefreshToken is in progress');\r\n return;\r\n }\r\n refreshTokenInProgress = true;\r\n console.log('Token expiration time nearing...updating new token');\r\n\r\n updateToken();\n setTimeout(function () { refreshTokenInProgress = false; }, 2000);\r\n }\r\n\n function setUpTokenUpdation() {\n //used in twilio sdk 2.0.0\n if (!settingUpPeriodicTokenUpdation && !interval && devices.length > 0) {\n settingUpPeriodicTokenUpdation = true;\n\r\n const REFRESH_TIMER = tokenAgeMilliseconds - tokenRefreshMilliseconds; // We update our token 30 seconds before expiration;\r\n interval = setInterval(updateToken, REFRESH_TIMER);\n console.log('Token will be renewed every ' + REFRESH_TIMER / 1000 + ' seconds.');\n setTimeout(function () {\n settingUpPeriodicTokenUpdation = false;\n }, 2000);\n\n }\r\n }\r\n\n function updateToken() {\n var callId = $cookies.get('callId');\r\n var userId = $cookies.get('userId');\n accountservice.getWebRTCAccessTokens().then(function (data) {\r\n if (data) {\n var index = 0;\n var timeStamp = new Date();\n console.log('received new token on ' + timeStamp);\n devices.forEach(function (device) {\n device.updateToken(data[index]);\n index++;\n accountservice.logMessage('twiliowebrtcservice.UpdateToken| Message: Token Updated , CallId: ' + callId + ', UserId: ' + userId +\n ' Next token will be renewed ' + tokenRefreshMilliseconds + ' ms before expiry (' + tokenAgeMilliseconds + ')', enums.LogLevel.Debug);\r\n });\r\n }\r\n });\r\n }\n\n function deviceEventHandlerRegistering() {\r\n devices.every(function (device) {\n console.log('registering... Device Status: ' + device.state);\r\n });\n }\r\n function deviceEventHandlerUnregistered() {\r\n var callId = $cookies.get('callId');\r\n var userId = $cookies.get('userId');\r\n console.log('Device Offline');\r\n accountservice.logMessage('twiliowebrtcservice.offline|: Received offline event from Twilio. CallId: ' + callId + ', UserId: ' +\n userId, enums.LogLevel.Debug);\r\n // start over\n if (registerDeviceWhenOffline) {\n devices = [];\n setup(false, 0);\r\n }\r\n }\n\n function connectionEventHandlerWarning(warning) {\r\n var isError = true;\r\n var callId = $cookies.get('callId');\r\n if (warning === 'low-mos') {\r\n $rootScope.$broadcast(enums.Events.WebRtcConnectionQualityChanged, isError);\r\n userservice.addCallEvent(callEvents.LowMosWebRTCError, callId);\r\n }\r\n if (warning === 'high-rtt') {\r\n $rootScope.$broadcast(enums.Events.WebRtcConnectionQualityChanged, isError);\r\n userservice.addCallEvent(callEvents.HighRttWebRTCError, callId);\r\n }\r\n if (warning === 'high-jitter') {\r\n $rootScope.$broadcast(enums.Events.WebRtcConnectionQualityChanged, isError);\r\n userservice.addCallEvent(callEvents.HighJitterWebRTCError, callId);\r\n }\r\n if (warning === 'high-packet-loss') {\r\n $rootScope.$broadcast(enums.Events.WebRtcConnectionQualityChanged, isError);\r\n userservice.addCallEvent(callEvents.HighPacketLossWebRTCError, callId);\r\n }\n if (warning === 'device-change') {\r\n $rootScope.$broadcast(enums.Events.WebRtcConnectionQualityChanged, isError);\r\n userservice.addCallEvent(callEvents.AudioDeviceChanged, callId);\r\n }\n if (warning === 'high-packets-lost-fraction') {\r\n $rootScope.$broadcast(enums.Events.WebRtcConnectionQualityChanged, isError);\r\n userservice.addCallEvent(callEvents.HighPacketsLossFractionWebRTCError, callId);\r\n }\r\n }\n\r\n function connectionEventHandlerWarningCleared(warning) {\r\n var isError = false;\r\n var callId = $cookies.get('callId');\r\n if (warning === 'low-mos') {\r\n $rootScope.$broadcast(enums.Events.WebRtcConnectionQualityChanged, isError);\r\n userservice.addCallEvent(callEvents.WebRTCErrorCleared, callId);\r\n }\r\n if (warning === 'high-rtt') {\r\n $rootScope.$broadcast(enums.Events.WebRtcConnectionQualityChanged, isError);\r\n userservice.addCallEvent(callEvents.WebRTCErrorCleared, callId);\r\n }\r\n if (warning === 'high-jitter') {\r\n $rootScope.$broadcast(enums.Events.WebRtcConnectionQualityChanged, isError);\r\n userservice.addCallEvent(callEvents.WebRTCErrorCleared, callId);\r\n }\r\n if (warning === 'high-packet-loss') {\r\n $rootScope.$broadcast(enums.Events.WebRtcConnectionQualityChanged, isError);\r\n userservice.addCallEvent(callEvents.WebRTCErrorCleared, callId);\r\n }\r\n }\r\n\n function deviceEventHandlerError(error) {\r\n var callId = $cookies.get('callId');\r\n var userId = $cookies.get('userId');\n if (logTwilioErrorsOnConsole) {\n console.log('Twilio Error: ' + error);\r\n }\r\n switch (error.code) {\r\n case 31205:\n case 31202:\n case 31204:\r\n accountservice.logMessage('twiliowebrtcservice.deviceEventHandlerError|Code: ' + error.code + ', Message: ' + error.message +\n ' Causes: ' + error.TwilioError.causes + ', Refreshing the token again. CallId: ' + callId + ', userId: ' + userId, enums.LogLevel.Warn);\n if (createTokenOnError) { setup(true, error.code); }\r\n break;\r\n default:\n handleWebRTCErrors(error.code, userId, error.message, error.TwilioError, callId);\r\n }\r\n }\r\n\r\n function deviceEventHandlerIncoming(connection) {\r\n lastConnection = connection;\n\n if (showNetworkQualityIndicatorDefault === 'true') {\n lastConnection.on('warning', connectionEventHandlerWarning);\r\n lastConnection.on('warning-cleared', connectionEventHandlerWarningCleared);\n }\n\n //used in sdk version 2.1.1\n if (showWebRTCReconnectionStatus === true) {\r\n lastConnection.on('reconnected', connectionEventHandlerReconnected);\r\n lastConnection.on('reconnecting', connectionEventHandlerReconnecting);\r\n }\n\n lastConnection.on('ringing', connectionEventHandlerRinging);\n connection.accept();\r\n }\n\n function connectionEventHandlerReconnected() {\r\n console.log('The call has regained connectivity.');\r\n usermessageservice.notify('notify', { message: true, eventName: 'WebRTCReconnected' });\r\n }\n\n function connectionEventHandlerRinging() {\r\n console.log('Device Ringing');\r\n }\r\n\r\n function connectionEventHandlerReconnecting(twilioError) {\r\n usermessageservice.notify('notify', { message: true, eventName: 'WebRTCReconnecting' });\r\n console.log('Connectivity error: ', twilioError);\r\n }\r\n\r\n // returns true if all of the devices on the page are 'Ready'; otherwise false\r\n function isReady() {\r\n var isReady = devices.every(function (device) {\r\n return device.state === enums.DeviceStatus.Registered;\r\n });\r\n return isReady;\r\n }\r\n\r\n // returns true if at least one of the devices on the page is 'Busy'; otherwise false\r\n function isInCall() {\r\n var inCall = devices.some(function (device) {\r\n return device.isBusy;\r\n });\r\n return inCall;\r\n }\r\n\r\n function hangUp() {\n var callId = $cookies.get('callId');\n var userId = $cookies.get('userId');\r\n devices.forEach(function (device) {\r\n if (device.isBusy) {\r\n device.disconnectAll();\n }\r\n });\r\n }\n\n function setPortalRefresh(enable, emptyDevice) {\n console.log('setPortalRefresh called');\n pageRefresh = enable;\n if (emptyDevice) {\n devices = [];\r\n }\n else {\n var userId = $cookies.get('userId');\n disable(userId);\r\n }\n\r\n }\n\n function clearDeviceAndCreateNew(force) {\n console.log('clearDeviceAndCreateNew called');\n hangupNeedsRefreshToken = force ? true : hangupNeedsRefreshToken;\n if (hangupNeedsRefreshToken) {\n hangupNeedsRefreshToken = false;\n devices.forEach(function (device) {\r\n device.removeListener(enums.DeviceStatus.Error, deviceEventHandlerError);\r\n device.removeListener(enums.DeviceStatus.Incoming, deviceEventHandlerIncoming);\r\n device.removeListener(enums.DeviceStatus.Unregistered, deviceEventHandlerUnregistered);\r\n device.removeListener(enums.DeviceStatus.Registered, deviceEventHandlerRegistered);\n device.removeListener(enums.DeviceStatus.Destroyed, deviceEventHandlerDestroyed);\n device.removeListener(enums.DeviceStatus.Registering, deviceEventHandlerRegistering);\n device.removeListener(enums.DeviceStatus.TokenWillExpire, deviceEventHandlerTokenWillExpire);\n device.destroy();\r\n });\n devices = [];\n setup(false, 0);\r\n }\r\n }\r\n\r\n // If the window object has any of the following properties, WebRTC connections are possible\r\n function isWebRTCSupported() {\r\n return ['RTCPeerConnection', 'webkitRTCPeerConnection', 'mozRTCPeerConnection', 'RTCIceGatherer'].some(function (item) {\r\n if (item in window) {\r\n accountservice.logMessage('twiliowebrtcservice.isWebRTCSupported|Property: ' + item, enums.LogLevel.Debug);\r\n console.log('WebRTC Supported: true');\n return true;\r\n }\r\n accountservice.logMessage('twiliowebrtcservice.isWebRTCSupported false', enums.LogLevel.Debug);\r\n console.log('WebRTC Supported: false');\n return false;\r\n });\r\n }\r\n\n function mute() {\r\n if (lastConnection != null) {\r\n lastConnection.mute(true);\n }\n\n logConnectionStatus(lastConnection, 'mute');\r\n }\n\r\n function unmute() {\r\n if (lastConnection != null) {\r\n lastConnection.mute(false);\n }\n\n logConnectionStatus(lastConnection, 'unmute');\r\n }\n\n function sendDigits(digit) {\r\n if (lastConnection != null) {\r\n lastConnection.sendDigits(digit);\n }\n\n logConnectionStatus(lastConnection, 'sendDigits');\r\n }\n\n function logConnectionStatus(conn, methodName) {\n var callId = $cookies.get('callId');\n var userId = $cookies.get('userId');\n\n if (conn) {\n accountservice.logMessage('twiliowebrtcservice.' + methodName + ' | Message: CallId: ' + callId + ', UserId: ' + userId + ' Status: ' + conn.status(), enums.LogLevel.Debug);\r\n }\n else {\n accountservice.logMessage('twiliowebrtcservice.' + methodName + ' Connection is null | Message: CallId: ' + callId + ', UserId: ' + userId, enums.LogLevel.Warn);\r\n }\n }\n\n function disconnect() {\n var callId = $cookies.get('callId');\n var userId = $cookies.get('userId');\n\n if (lastConnection != null) {\r\n lastConnection.disconnect();\n userservice.addCallEvent(callEvents.UserHangup, callId);\n accountservice.logMessage('twiliowebrtcservice.disconnect| Message: Disconnect Called, CallId: ' + callId + ', UserId: ' + userId, enums.LogLevel.Debug);\n }\n else {\n accountservice.logMessage('twiliowebrtcservice.disconnect| Message: No Active Connection, CallId: ' + callId + ', UserId: ' + userId, enums.LogLevel.Warn);\r\n }\r\n }\n\r\n function setup(regererateTokenDueToError, code) {\n if (pageRefresh) {\n hangupNeedsRefreshToken = true;\n pageRefresh = false;\r\n }\r\n if (devices.length > 0) {\n if (isReady) {\n console.log('Devices Registered Already');\n return;\r\n }\n else {\n devices = [];\r\n }\r\n }\r\n\r\n if (disableTokenGenerationLocalHost && (location.hostname === 'localhost' || location.hostname === '127.0.0.1')) {\r\n return;\r\n }\r\n\r\n accountservice.getWebRTCAccessTokens().then(function (data) {\r\n if (data) {\r\n var setupOptions = {\r\n // for testing:\r\n logLevel: twilioSDKLogLevel,\r\n //warnings: true,\n edge: defaultEdgeLocations,\n appName: 'Voice Portal',\r\n closeProtection: true,\r\n codecPreferences: ['opus', 'pcmu'],\n tokenRefreshMs: tokenRefreshMilliseconds\r\n };\r\n var webRTCToken = null;\r\n data.forEach(function (token) {\n webRTCToken = token;\r\n // The Device constructor calls device.setup(token, setupOptions)\r\n var twilioDevice = new twilio.Device(token, setupOptions);\r\n devices.push(twilioDevice);\r\n });\r\n\n // Register a series of callback functions on each device...\r\n // See: https://www.twilio.com/docs/voice/client/javascript/device#twilio-device for more information.\r\n devices.forEach(function (device) {\r\n device.on(enums.DeviceStatus.Error, deviceEventHandlerError);\r\n device.on(enums.DeviceStatus.Incoming, deviceEventHandlerIncoming);\n device.on(enums.DeviceStatus.Unregistered, deviceEventHandlerUnregistered);\r\n device.on(enums.DeviceStatus.Registered, deviceEventHandlerRegistered);\r\n device.on(enums.DeviceStatus.Destroyed, deviceEventHandlerDestroyed);\r\n device.on(enums.DeviceStatus.Registering, deviceEventHandlerRegistering);\n device.on(enums.DeviceStatus.TokenWillExpire, deviceEventHandlerTokenWillExpire);\r\n device.register();\r\n });\r\n\r\n //devices.forEach(function (device) {\n // if (preFlightEnabled) {\r\n // preflightTest = twilio.Device.runPreflight(webRTCToken, setupOptions);\r\n\r\n // }\n //});\n //if (preFlightEnabled) {\n // preflightTest.on('completed', testPreflight);\r\n // preflightTest.on('failed', testPreflight);\n //}\r\n }\r\n\r\n var numTokens = devices.length;\r\n var logLevel = numTokens === 0 ? enums.LogLevel.Error : enums.LogLevel.Trace;\r\n var generateTokenDueToErrorMessage = regererateTokenDueToError === true ? ', TokenGenerated due to error, ErrorCode: ' + code : '';\r\n accountservice.logMessage('twiliowebrtcservice.setup ' + numTokens + ' token' + (numTokens === 1 ? '' : 's') + ' returned ' + generateTokenDueToErrorMessage, logLevel);\r\n });\n\r\n }\n\n function handleWebRTCErrors(ErorCode, userId, message, twilioError, callId) {\n if (twilioErrorLimitToLog > 0) {\n var twilioErrorCookie = $cookies.get(ErorCode);\n var error = {};\n if (twilioErrorCookie !== undefined) {\n error = JSON.parse(twilioErrorCookie);\n error.Code = ErorCode;\n error.UserId = userId !== undefined ? userId : error.UserId;\n error.Count = +error.Count + 1;\n $cookies.put(ErorCode, JSON.stringify(error));\r\n }\n else {\n error.Code = ErorCode;\n error.UserId = userId;\n error.Count = 1;\n var today = new Date();\r\n var tomorrow = new Date(today);\r\n tomorrow.setDate(today.getDate() + 1);\r\n var expires = new Date(tomorrow);\n $cookies.put(ErorCode, JSON.stringify(error), { 'expires': expires });\n accountservice.logMessage('twiliowebrtcservice.deviceEventHandlerError|Code: ' + error.Code + ', Message: ' + message + ', Causes: ' +\n twilioError.causes + ', Solution: ' + twilioError.solutions + ', CallId: ' +\n callId + ', userId: ' + error.UserId + ' ErrorCount: ' + error.Count, enums.LogLevel.Warn);\r\n }\n //Log Message to graylog if the count reaches the twilioErrorLimitToLog or on ever twilioErrorLimitToLog th interval\n if (+error.Count === twilioErrorLimitToLog || (+error.Count % twilioErrorLimitToLog === 0)) {\n usermessageservice.notify('notify', { message: true, eventName: 'TwilioErrors' });\n accountservice.logMessage('twiliowebrtcservice.deviceEventHandlerError|Code: ' + error.Code + ', Message: ' + message + ', Causes: ' +\n twilioError.causes + ', Solution: ' + twilioError.solutions + ', CallId: ' +\n callId + ', userId: ' + error.UserId + ' ErrorCount: ' + error.Count, enums.LogLevel.Warn);\r\n }\n }\r\n }\r\n }\r\n})(angular);\r\n\n/*jshint esversion: 6 */\r\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.core')\r\n .factory('telemetryservice', telemetryservice);\r\n\r\n telemetryservice.$inject = ['$injector', '$q', 'applicationInsightsService', 'preferences'];\r\n\r\n //this service should be used by all custom telemetry services instead of direct using applicationInsightsService\r\n function telemetryservice($injector, $q, applicationInsightsService, preferences) {\r\n var service = {\r\n logEvent: logEvent\r\n };\r\n\r\n var settings;\r\n\r\n //we need that to do not cause generation of multiple requests to retrieve settings till we not received response\r\n var loadingSettings = false;\r\n\r\n var defaultEnabled = false;\r\n\r\n resetSettings();\r\n\r\n return service;\r\n\r\n function resetSettings() {\r\n settings = {\r\n userId: null,\r\n enabled: defaultEnabled\r\n };\r\n }\r\n\r\n //request telemetry settings from server\r\n function telemetryEnabled() {\r\n var defer = $q.defer();\r\n\r\n var userId = $injector.get('accountservice').getCurrentUserId();\r\n\r\n // use default setting when user not logged\r\n if (!userId) {\r\n resetSettings();\r\n defer.reject();\r\n }\r\n else {\r\n //if the same logged user just use cached settings\r\n if (settings.userId === userId) {\r\n if (settings.enabled) {\r\n defer.resolve(settings);\r\n } else {\r\n defer.reject();\r\n }\r\n }\r\n //if logged user changed reload settings from server for new user.\r\n else {\r\n resetSettings();\r\n\r\n var appSettingsService = $injector.get('appsettingsservice');\r\n\r\n if (!loadingSettings) {\r\n loadingSettings = true;\r\n\r\n appSettingsService.getAppSetting(preferences.SendCustomUITelemetry, defaultEnabled, userId)\r\n .then(function (data) {\r\n //update cached settings\r\n settings.enabled = $injector.get('utilities').isTrue(data);\r\n settings.userId = userId;\r\n loadingSettings = false;\r\n if (settings.enabled) {\r\n defer.resolve(settings);\r\n }\r\n else {\r\n defer.reject();\r\n }\r\n })\r\n .catch(function (e) {\r\n //if can not receive from server than set to default\r\n resetSettings();\r\n loadingSettings = false;\r\n defer.reject();\r\n });\r\n }\r\n else {\r\n //disable telemetry while waiting for all telemetry settings from server\r\n defer.reject();\r\n }\r\n }\r\n }\r\n\r\n return defer.promise;\r\n }\r\n\r\n //Such format is required by angular-applicationinsights library. It should be object with string or numeric values.\r\n function normalizeEvent(o) {\r\n Object.keys(o).forEach(function (k) {\r\n //Date serializing to ISOString, example: 2018-09-12T10:43:03.123Z\r\n if (o[k] instanceof Date) {\r\n o[k] = o[k].toISOString();\r\n return;\r\n }\r\n //Any object values serializing to JSON string\r\n if (typeof o[k] === 'object') {\r\n o[k] = JSON.stringify(o[k]);\r\n }\r\n //any number and string keep as is\r\n });\r\n return o;\r\n }\r\n\r\n function logEvent(eventName, properties, measurements) {\r\n telemetryEnabled().then(\r\n function (settings) {\r\n if (measurements) {\r\n applicationInsightsService.trackEvent(eventName, normalizeEvent(properties), normalizeEvent(measurements));\r\n }\r\n else {\r\n applicationInsightsService.trackEvent(eventName, normalizeEvent(properties));\r\n }\r\n });\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.core')\r\n .factory('signalservice', signalservice);\r\n\r\n signalservice.$inject = ['interpretersignalreceiver', 'operatorsignalreceiver', 'monitorsignalreceiver', 'session', 'signalreceiversmonitorservice'];\r\n /* @ngInject */\r\n function signalservice(interpretersignalreceiver, operatorsignalreceiver, monitorsignalreceiver, session, signalreceiversmonitorservice) {\r\n\r\n var service = {\r\n connect: connect,\r\n disconnect: disconnect\r\n };\r\n\r\n return service;\r\n\r\n // Connect SignalR when logging in or refreshing the page\r\n function connect() {\r\n if (session.roles.indexOf('Interpreter') >= 0) {\r\n interpretersignalreceiver.connect().done(function() {\r\n signalreceiversmonitorservice.track(interpretersignalreceiver);\r\n });\r\n }\r\n\r\n if (session.roles.indexOf('Operator') >= 0 || session.roles.indexOf('Admin') >= 0 || session.roles.indexOf('SuperUser') >= 0) {\r\n operatorsignalreceiver.connect().done(function() {\r\n signalreceiversmonitorservice.track(operatorsignalreceiver);\r\n });\r\n }\r\n\r\n if (session.roles.indexOf('Monitor') >= 0) {\r\n monitorsignalreceiver.connect().done(function() {\r\n signalreceiversmonitorservice.track(monitorsignalreceiver);\r\n });\r\n }\r\n }\r\n\r\n // Disconnect SignalR when logging out\r\n // Avoids 'The user identity cannot change during an active SignalR connection' error if a different user subsequently logs in\r\n function disconnect() {\r\n if (session.roles.indexOf('Interpreter') >= 0) {\r\n interpretersignalreceiver.disconnect();\r\n signalreceiversmonitorservice.unTrack(interpretersignalreceiver.key);\r\n }\r\n\r\n if (session.roles.indexOf('Operator') >= 0 || session.roles.indexOf('Admin') >= 0 || session.roles.indexOf('SuperUser') >= 0) {\r\n operatorsignalreceiver.disconnect();\r\n signalreceiversmonitorservice.unTrack(operatorsignalreceiver.key);\r\n }\r\n\r\n if (session.roles.indexOf('Monitor') >= 0) {\r\n monitorsignalreceiver.disconnect();\r\n signalreceiversmonitorservice.unTrack(monitorsignalreceiver.key);\r\n }\r\n }\r\n }\r\n})();\r\n\n(function() {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.core')\r\n .factory('signalreceiversmonitorservice', signalreceiversmonitorservice);\r\n\r\n signalreceiversmonitorservice.$inject = ['$cookies', '$interval', '$window', 'accountservice', 'appsettingsservice', 'constants', 'enums', 'utilities'];\r\n\r\n /* @ngInject */\r\n function signalreceiversmonitorservice($cookies, $interval, $window, accountservice, appsettingsservice, constants, enums, utilities) {\r\n var intervals = {};\n var settingsPromise;\r\n var refreshBrowserOnSignalRDisconnectPromise;\r\n var minimumMsSinceLastDisconnectBrowserRefreshPromise;\r\n\r\n activate();\r\n\r\n return {\r\n track: track,\r\n unTrack: unTrack,\r\n logSignalRTimeout: logSignalRTimeout\r\n };\r\n\r\n function activate() {\n var currentRole = $cookies.get(constants.userRole);\r\n if (currentRole !== undefined) {\r\n settingsPromise = appsettingsservice.getAppSetting('Portal_SignalRCheckConnectionIntervalSeconds', 30);\r\n refreshBrowserOnSignalRDisconnectPromise = appsettingsservice.getAppSetting('Portal_RefreshBrowserOnSignalRDisconnect', true);\r\n minimumMsSinceLastDisconnectBrowserRefreshPromise = appsettingsservice.getAppSetting('Portal_MinimumSecondsSinceLastDisconnectBrowserRefresh', 30);\n }\r\n }\r\n\r\n function track(signalReceiver) {\n var currentRole = $cookies.get(constants.userRole);\r\n if (currentRole !== undefined) {\n if (settingsPromise === undefined) {\r\n activate();\r\n }\r\n settingsPromise.then(function (seconds) {\r\n refreshBrowserOnSignalRDisconnectPromise.then(function (refreshBrowserOnSignalRDisconnect) {\r\n minimumMsSinceLastDisconnectBrowserRefreshPromise.then(function (minimumMsSinceLastDisconnectBrowserRefresh) {\r\n minimumMsSinceLastDisconnectBrowserRefresh = minimumMsSinceLastDisconnectBrowserRefresh * 1000;\r\n\r\n var interval = $interval(function () {\r\n\r\n if (!signalReceiver.getIsConnected()) {\r\n return;\r\n }\r\n\r\n signalReceiver.checkConnection().done(function (response) {\r\n if (!response) {\r\n if (!refreshBrowserOnSignalRDisconnect) {\r\n signalReceiver.disconnect();\r\n signalReceiver.connect().done(function () {\r\n track(signalReceiver);\r\n });\r\n } else if (isBrowserRefreshAllowed(minimumMsSinceLastDisconnectBrowserRefresh)) {\r\n $window.location.reload();\r\n }\r\n }\r\n }).fail(function () {\r\n if (!refreshBrowserOnSignalRDisconnect) {\r\n signalReceiver.disconnect();\r\n signalReceiver.connect().done(function () {\r\n track(signalReceiver);\r\n });\r\n } else if (isBrowserRefreshAllowed(minimumMsSinceLastDisconnectBrowserRefresh)) {\r\n $window.location.reload();\r\n }\r\n });\r\n }, utilities.convertSecondsToMilliseconds(seconds));\r\n\r\n intervals[signalReceiver.key] = interval;\r\n\r\n return minimumMsSinceLastDisconnectBrowserRefresh;\r\n });\r\n\r\n return refreshBrowserOnSignalRDisconnect;\r\n });\r\n\r\n return seconds;\r\n });\n }\r\n }\r\n\r\n function unTrack(key) {\r\n if (!intervals[key]) {\r\n return;\r\n }\r\n\r\n $interval.cancel(intervals[key]);\r\n delete intervals[key];\r\n }\r\n\r\n function logSignalRTimeout(opeartionResult, hub, methodName) {\r\n if (!opeartionResult || !hub) {\r\n return;\r\n }\r\n var resolved = false;\r\n var timeout = 60000;\r\n var timer = setTimeout(function() {\r\n if (!resolved) {\r\n accountservice.logMessage(methodName + '|ConnectionId: ' + hub.proxy.connection.id + ', SignalR Timeout: ' + timeout +\r\n ', User Agent: ' + navigator.userAgent + ', Vendor: ' + navigator.vendor, enums.LogLevel.Info);\r\n }\r\n }, timeout);\r\n opeartionResult.promise().then(function() {\r\n resolved = true;\r\n clearTimeout(timer);\r\n });\r\n }\r\n\r\n function isBrowserRefreshAllowed(minimumMsSinceLastDisconnectBrowserRefresh) {\r\n var lastRefreshTime = $cookies.get(constants.lastRefreshTime);\r\n var currentTime = Date.now();\r\n\r\n return (currentTime - parseInt(lastRefreshTime)) >= minimumMsSinceLastDisconnectBrowserRefresh;\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.core')\r\n .factory('reducecallfrequencyservice', reducecallfrequencyservice);\r\n\r\n reducecallfrequencyservice.$inject = ['$timeout'];\r\n /* @ngInject */\r\n function reducecallfrequencyservice($timeout) {\r\n var callsDictionary = [];\r\n var service = {\r\n call: callFunction\r\n };\r\n\r\n return service;\r\n\r\n function callFunction(key, method, delay) {\r\n if (callsDictionary[key] === undefined) {\r\n callsDictionary[key] = { delay: delay, method: method, needToCall: true, timer: false };\r\n }\r\n var instance = callsDictionary[key];\r\n instance.method = method;\r\n instance.delay = delay;\r\n\r\n if (instance.timer === true) {\r\n instance.needToCall = true;\r\n } else {\r\n instance.method();\r\n instance.needToCall = false;\r\n runTimer(instance);\r\n }\r\n }\r\n\r\n function runTimer(instance) {\r\n instance.timer = true;\r\n $timeout(function (instance) {\r\n if (instance.needToCall === true) {\r\n instance.method();\r\n instance.needToCall = false;\r\n runTimer(instance);\r\n } else {\r\n instance.timer = false;\r\n }\r\n }, instance.delay, true, instance);\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.core')\r\n .factory('phonenumberservice', phonenumberservice);\r\n\r\n phonenumberservice.$inject = ['$http', 'exception','$cookies', 'constants'];\r\n /* @ngInject */\r\n function phonenumberservice($http, exception, $cookies, constants) {\r\n var baseUrl = '/api/Twilio';\r\n var service = {\r\n validatePhoneNumber: validatePhoneNumber,\r\n callablePhoneNumber: callablePhoneNumber,\r\n phoneNumberInfo: phoneNumberInfo\r\n };\r\n\r\n return service;\r\n\r\n /* Determines if a phone number if valid */\r\n function validatePhoneNumber(phoneNumber) {\r\n return $http.put(baseUrl + '/ValidatePhoneNumber', '\"' + phoneNumber + '\"')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR Failed for validate Phone Number')(e);\r\n }\r\n }\r\n\r\n // Determines if a phone number is callable. A callable number must also be valid.\r\n function callablePhoneNumber(phoneNumber) {\r\n return $http.put(baseUrl + '/CallablePhoneNumber', '\"' + phoneNumber + '\"')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR Failed for callable Phone Number')(e);\r\n }\r\n }\r\n\r\n // Gets the extended information about a phone number.\r\n function phoneNumberInfo(phoneNumber) {\r\n return $http.put(baseUrl + '/PhoneNumberInfo', '\"' + phoneNumber + '\"')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n $cookies.put(constants.phoneNumberInfo, JSON.stringify(response.data));\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR Failed for phone Number Info')(e);\r\n }\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.core')\r\n .factory('operatorservice', operatorservice);\r\n\r\n operatorservice.$inject = ['$http', '$q', 'exception', 'logger', 'accountservice', 'enums'];\r\n /* @ngInject */\r\n function operatorservice($http, $q, exception, logger, accountservice, enums) {\r\n var baseUrl = '/api/Operator';\r\n var service = {\r\n acceptCall: acceptCall,\r\n rejectCall: rejectCall,\r\n get: get,\r\n addParticipant: addParticipant,\r\n deleteParticipant: deleteParticipant,\r\n getAll: getAll,\r\n getInterpreters: getInterpreters,\r\n setPhoneNumber: setPhoneNumber,\r\n setStatus: setStatus,\r\n setKeepAlive: setKeepAlive,\r\n getInCallInterpreters: getInCallInterpreters,\r\n getLoggedInInterpreters: getLoggedInInterpreters,\r\n findInterpreter: findInterpreter,\n findInterpreterwithGender: findInterpreterwithGender,\r\n callInterpreter: callInterpreter,\r\n connectInterpreter: connectInterpreter,\r\n getCurrentCall: getCurrentCall,\r\n callLanguageService: callLanguageService,\r\n conferenceJoin: conferenceJoin,\r\n setLoginStatus: setLoginStatus,\r\n getLanguageServiceUsers: getLanguageServiceUsers,\r\n getLanguageServiceUsersByGroup: getLanguageServiceUsersByGroup,\r\n checkLanguageServiceTimeout: checkLanguageServiceTimeout,\r\n updateInterpreterHoldStatus: updateInterpreterHoldStatus,\r\n updateCustomerHoldStatus: updateCustomerHoldStatus,\r\n hangupCall: hangupCall,\r\n disconnectCall: disconnectCall,\r\n addCallEvent: addCallEvent,\r\n findLanguageServiceInterpreter: findLanguageServiceInterpreter,\r\n findLanguageServiceInterpreterByGroup: findLanguageServiceInterpreterByGroup,\r\n joinInterpretersWithCustomer: joinInterpretersWithCustomer,\r\n workingResourceRequestExists: workingResourceRequestExists,\r\n getInterpreterStatistics: getInterpreterStatistics\r\n };\r\n\r\n return service;\r\n\r\n /* */\r\n function findInterpreter(languageId, callId) {\r\n return $http.put(baseUrl + '/Interpreter/' + languageId, { 'callId': callId })\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.findInterpreter')(e);\r\n }\r\n }\n\n function findInterpreterwithGender(languageId, callId, genderId) {\n return $http.put(baseUrl + '/Interpreter/' + languageId, { 'callId': callId, 'genderId': genderId })\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.findInterpreter')(e);\r\n }\r\n }\r\n\r\n function updateInterpreterHoldStatus(interpreterId, onHold, callId) {\r\n return $http.put(baseUrl + '/Interpreter/' + interpreterId + '/Hold/' + onHold, {},\r\n { params: { callId: callId } })\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.updateInterpreterHoldStatus')(e);\r\n }\r\n }\r\n\r\n function updateCustomerHoldStatus(callId, onHold) {\r\n return $http.put(baseUrl + '/Customer/' + callId + '/Hold/' + onHold, {}, {})\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.updateCustomerHoldStatus')(e);\r\n }\r\n }\r\n\r\n function getLanguageServiceUsers(languageId, customerId) {\r\n return $http.get(baseUrl + '/LanguageService/' + languageId + '/Users/' + customerId)\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.getLanguageServiceUsers')(e);\r\n }\r\n }\r\n\r\n function getLanguageServiceUsersByGroup(languageId, customerId, groupId) {\r\n return $http.get(baseUrl + '/LanguageService/' + languageId + '/Users/' + customerId + '/' + groupId)\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.getLanguageServiceUsersByGroup')(e);\r\n }\r\n }\r\n\r\n function checkLanguageServiceTimeout(callId) {\r\n return $http.get(baseUrl + '/LanguageService/Timeout/' + callId)\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.checkLanguageServiceTimeout')(e);\r\n }\r\n }\r\n\r\n function callInterpreter(callId, interpreterId, holdCustomer) {\r\n return $http.put(baseUrl + '/Interpreter/' + interpreterId + '/Call/' + callId, {},\r\n { params: { holdCustomer: holdCustomer } })\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.callInterpreter')(e);\r\n }\r\n }\r\n\r\n function connectInterpreter(callId, interpreterId) {\r\n return $http.put(baseUrl + '/Interpreter/' + interpreterId + '/Connect/' + callId, {})\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.connectInterpreter')(e);\r\n }\r\n }\r\n\r\n function callLanguageService(callId, languageServiceId, languageId) {\r\n return $http.put(baseUrl + '/LanguageService/' + languageServiceId + '/Call/' + callId + '/LanguageId/' + languageId)\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.callLanguageService')(e);\r\n }\r\n }\r\n\r\n function conferenceJoin(callId) {\r\n return $http.put(baseUrl + '/Conference/Join/' + callId)\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.conferenceJoin')(e);\r\n }\r\n }\r\n\r\n function getCurrentCall() {\r\n return $http.get(baseUrl + '/CurrentCall/')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.getCurrentCall')(e);\r\n }\r\n }\r\n\r\n function acceptCall(callId, phoneNumber) {\r\n return $http.put(baseUrl + '/Call/' + callId + '/Accept', { 'phoneNumber': phoneNumber })\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.acceptCall')(e);\r\n }\r\n }\r\n\r\n function rejectCall(callId, fromPhoneNumber, customerId) {\r\n return $http.put(baseUrl + '/Call/' + callId + '/Reject', { 'fromPhoneNumber': fromPhoneNumber, 'customerId': customerId })\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.rejectCall')(e);\r\n }\r\n }\r\n\r\n function hangupCall(callId, sayMessage) {\r\n return $http.put(baseUrl + '/Call/' + callId + '/Hangup', {}, { params: { 'sayMessage': sayMessage } })\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.hangupCall')(e);\r\n }\r\n }\r\n\r\n function disconnectCall(callId) {\r\n return $http.put(baseUrl + '/Call/' + callId + '/Disconnect')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.disconnectCall')(e);\r\n }\r\n }\r\n\r\n function addCallEvent(eventName, callId) {\r\n return $http.put(baseUrl + '/Call/' + callId + '/CallEvent/' + eventName)\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.addCallEvent')(e);\r\n }\r\n }\r\n function addParticipant(callId, phoneNumber) {\r\n return $http.post(baseUrl + '/Call/' + callId + '/Participant', '\"' + phoneNumber + '\"')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.addParticipant')(e);\r\n }\r\n }\r\n\r\n function deleteParticipant(participantCallSid, callId) {\r\n return $http.delete(baseUrl + '/Call/' + callId + '/Participant/' + participantCallSid)\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.deleteParticipant')(e);\r\n }\r\n }\r\n\r\n /* */\r\n function get() {\r\n return $http.get(baseUrl)\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n var user = {\r\n userId: response.data.Id,\r\n username: response.data.Username,\r\n role: 'Operator'\r\n };\r\n accountservice.setUser(user);\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.get')(e);\r\n }\r\n }\r\n\r\n /* */\r\n function getAll() {\r\n return $http.get(baseUrl + '/Operators')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.getAll')(e);\r\n }\r\n }\r\n\r\n /* */\r\n function getInterpreters() {\r\n return $http.get(baseUrl + '/Interpreters')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.getInterpreters')(e);\r\n }\r\n }\r\n\r\n /* */\r\n function setStatus(status, reason) {\r\n return $http.post(baseUrl + '/Status', '\"' + status + '\"', { params: { reason: reason } })\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.setStatus')(e);\r\n }\r\n }\r\n\r\n /* */\r\n function setKeepAlive() {\r\n return $http.put(baseUrl + '/KeepAlive')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.setKeepAlive')(e);\r\n }\r\n }\r\n\r\n /* */\r\n function setLoginStatus(interpreterId, status, reason) {\r\n return $http.post(baseUrl + '/Status/Interpreter/' + interpreterId, '\"' + status + '\"', { params: { reason: reason } })\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.setLoginStatus')(e);\r\n }\r\n }\r\n\r\n /* */\r\n function setPhoneNumber(phoneNumber) {\r\n return $http.put(baseUrl + '/TempPhoneNumber', '\"' + phoneNumber + '\"')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.setPhoneNumber')(e);\r\n }\r\n }\r\n\r\n /* */\r\n function getInCallInterpreters() {\r\n return $http.get(baseUrl + '/InCallInterpreters')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.getInCallInterpreters')(e);\r\n }\r\n }\r\n\r\n /* */\r\n function getLoggedInInterpreters() {\r\n return $http.get(baseUrl + '/Interpreters/LoggedIn')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.getLoggedInInterpreters')(e);\r\n }\r\n }\r\n\r\n /* backward compatibility this function need to remove next release */\r\n function findLanguageServiceInterpreter(languageId, customerId, callId) {\r\n return getLanguageServiceUsers(languageId, customerId)\r\n .then(onGetLanguageServiceUsers)\r\n .then(function (languageServiceId) { return callLanguageService(callId, languageServiceId, languageId); })\r\n .then(function (data) { return data === false ? $q.reject() : $q.resolve(); })\r\n .catch(onError);\r\n\r\n function onGetLanguageServiceUsers(data) {\r\n if (data !== '' && data.length > 0 && data[0]) {\r\n return data[0];\r\n } else {\r\n return $q.reject();\r\n }\r\n }\r\n\r\n function onError() {\r\n accountservice.logMessage('operatorservice.findLanguageServiceInterpreter Action Failed|LanguageId:' +\r\n languageId + ', CallId:' + callId + ', CustomerId:' + customerId, enums.LogLevel.Warn);\r\n }\r\n }\r\n\r\n /**/\r\n function findLanguageServiceInterpreterByGroup(languageId, customerId, callId, lsGroupId) {\r\n return getLanguageServiceUsersByGroup(languageId, customerId, lsGroupId)\r\n .then(onGetLanguageServiceUsers)\r\n .then(function (languageServiceId) { return callLanguageService(callId, languageServiceId, languageId); })\r\n .then(function (data) { return data === false ? $q.reject() : $q.resolve(); })\r\n .catch(onError);\r\n\r\n function onGetLanguageServiceUsers(data) {\r\n if (data !== '' && data.length > 0 && data[0]) {\r\n return data[0];\r\n } else {\r\n return $q.reject();\r\n }\r\n }\r\n\r\n function onError() {\r\n accountservice.logMessage('operatorservice.findLanguageServiceInterpreterByGroup Action Failed|LanguageId:' +\r\n languageId + ', CallId:' + callId + ', CustomerId:' + customerId, enums.LogLevel.Warn);\r\n }\r\n }\r\n\r\n function workingResourceRequestExists(callId) {\r\n return $http.get(baseUrl + '/Call/' + callId + '/WorkingResourceRequestExists')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.workingResourceRequestExists')(e);\r\n }\r\n }\r\n\r\n function joinInterpretersWithCustomer(callId, interpreterId, relayInterpreterId) {\r\n if (!relayInterpreterId || !interpreterId) {\r\n return $q.reject();\r\n }\r\n\r\n return connectInterpreter(callId, interpreterId)\r\n .then(onConnectInterpreter)\r\n .then(function () { return connectInterpreter(callId, relayInterpreterId); })\r\n .then(onConnectInterpreter)\r\n .then(onSuccess)\r\n .catch(onError);\r\n\r\n function onConnectInterpreter(data) {\r\n return data === false ? $q.reject() : data;\r\n }\r\n\r\n function onSuccess(data) {\r\n hangupCall(callId, 'Thank you for connecting the interpreters.');\r\n }\r\n\r\n function onError() {\r\n accountservice.logMessage('operatorservice.joinInterpretersWithCustomer Action Failed|CallId:' +\r\n callId, enums.LogLevel.Warn);\r\n return $q.reject();\r\n }\r\n }\r\n\r\n function getInterpreterStatistics(languageId, interpreterPoolId, secondaryInterpreterPoolId, thirdInterpreterPoolId, fourthInterpreterPoolId) {\r\n var url = baseUrl + '/Interpreters/Statistic' + '/Language/' + languageId + '/Pool/' + interpreterPoolId;\n\n if (secondaryInterpreterPoolId) {\r\n url += '?secondaryPoolId=' + secondaryInterpreterPoolId;\n if (thirdInterpreterPoolId) {\r\n url += '&thirdPoolId=' + thirdInterpreterPoolId;\n if (fourthInterpreterPoolId) {\r\n url += '&fourthPoolId=' + fourthInterpreterPoolId;\r\n }\r\n }\r\n }\n\n return $http.get(url)\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR failed for operatorservice.getInterpreterStatistics')(e);\r\n }\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.core')\r\n .factory('monitorservice', monitorservice);\r\n\r\n monitorservice.$inject = ['$http', 'exception'];\r\n /* @ngInject */\r\n function monitorservice($http, exception) {\r\n var baseUrl = '/api/Monitor';\r\n var service = {\r\n get: get,\r\n setStatus: setStatus,\r\n setPhoneNumber: setPhoneNumber,\r\n listen: listen\r\n };\r\n\r\n return service;\r\n\r\n /* */\r\n function get() {\r\n return $http.get(baseUrl)\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR Failed for get monitor')(e);\r\n }\r\n }\r\n\r\n /* */\r\n function setStatus(status, reason) {\r\n return $http.post(baseUrl + '/Status', '\"' + status + '\"', { params: { reason: reason } })\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR Failed for set status')(e);\r\n }\r\n }\r\n\r\n /* */\r\n function setPhoneNumber(phoneNumber) {\r\n return $http.put(baseUrl + '/TempPhoneNumber', '\"' + phoneNumber + '\"')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR Failed for set phone number')(e);\r\n }\r\n }\r\n\r\n /* */\r\n function listen(callId) {\r\n return $http.put(baseUrl + '/Listen/' + callId)\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR Failed for listen')(e);\r\n }\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.core')\r\n .factory('latencyservice', latencyservice)\r\n .run(['latencyservice', function (latencyservice) {\r\n latencyservice.init();\r\n }]);\r\n\r\n latencyservice.$inject = ['$q', '$injector', '$http', 'preferences', 'telemetryservice'];\r\n\r\n //Uses '/api/Diagnostics/Ping API to measure request latency It means time of sending request from client to server + time of sending response from server to client. Server processing time will not be included.\r\n //This API is very fast, server processing time is less that 1 ms, so we can ignore it (assume it is 0 ms.)\r\n function latencyservice($q, $injector, $http, preferences, telemetryService) {\r\n //disable latency calculation by default\r\n var defaultMeasuringInterval = 0;\r\n\r\n var settings;\r\n\r\n function init() {\r\n resetSettings();\r\n\r\n //User initializes later that this code, so we need wait some time till user loggs in, then we will have userId needed to retrieve settings\r\n setTimeout(measureLatency, 3000);\r\n }\r\n\r\n return {\r\n init: init\r\n };\r\n\r\n function measureLatency() {\r\n serviceEnabled().then(\r\n function (settings) {\r\n var sentTime = new Date();\r\n\r\n $http.get('/api/Diagnostics/Ping')\r\n .then(function (data) {\r\n var receivedTime = new Date();\r\n var latencyMs = receivedTime.getTime() - sentTime.getTime();\r\n var event =\r\n {\r\n userId: settings.userId,\r\n userName: settings.userName,\r\n userRole: settings.userRole\r\n };\r\n var eventMetrics =\r\n {\r\n latencyMs: latencyMs\r\n };\r\n\r\n telemetryService.logEvent('Requests Latency', event, eventMetrics);\r\n });\r\n\r\n setTimeout(measureLatency, settings.measuringInterval * 60000);\r\n })\r\n .catch(function (e) {\r\n //even if latency calculation is not enabled for current user it could be enabled for other user that will login, so we keep executing this function (idle) with default interval\r\n setTimeout(measureLatency, defaultMeasuringInterval * 60000);\r\n });\r\n }\r\n\r\n function resetSettings() {\r\n settings = {\r\n userId: null,\r\n userName: null,\r\n userRole: null,\r\n measuringInterval: defaultMeasuringInterval\r\n };\r\n }\r\n\r\n //requests latency settings from server (LatencyMeasuringInterval)\r\n function serviceEnabled() {\r\n var defer = $q.defer();\r\n\r\n var loggedUserInfo = $injector.get('accountservice').getCurrentUser();\r\n\r\n // just using default latency setting when user not logged\r\n if (!loggedUserInfo || !loggedUserInfo.id || !loggedUserInfo.name || !loggedUserInfo.role) {\r\n resetSettings();\r\n defer.reject();\r\n }\r\n else {\r\n //if the same logged user just use cached settings\r\n if (settings.userId === loggedUserInfo.id) {\r\n if (settings.measuringInterval === 0) {\r\n defer.reject();\r\n }\r\n else {\r\n defer.resolve(settings);\r\n }\r\n }\r\n //if logged user changed reload settings from server for new user.\r\n else {\r\n resetSettings();\r\n\r\n var appSettingsService = $injector.get('appsettingsservice');\r\n\r\n appSettingsService.getAppSetting(preferences.LatencyMeasuringInterval, defaultMeasuringInterval, loggedUserInfo.id)\r\n .then(function (data) {\r\n //update cached settings if received from server\r\n settings.measuringInterval = parseInt(data, 10);\r\n settings.userId = loggedUserInfo.id;\r\n settings.userName = loggedUserInfo.name;\r\n settings.userRole = loggedUserInfo.role;\r\n //0 - means that it will be disabled\r\n //TODO: check if measuringInterval from server could be '0' (string). JSHint requires ===\r\n if (settings.measuringInterval === 0) {\r\n defer.reject();\r\n }\r\n else {\r\n defer.resolve(settings);\r\n }\r\n })\r\n .catch(function (e) {\r\n //if can not receive from server than set setting to default\r\n resetSettings();\r\n defer.reject();\r\n });\r\n }\r\n }\r\n\r\n return defer.promise;\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.core')\r\n .factory('interpreterservice', interpreterservice);\r\n\r\n interpreterservice.$inject = ['$http', '$q', 'exception', 'logger', 'accountservice'];\r\n /* @ngInject */\r\n function interpreterservice($http, $q, exception, logger, accountservice) {\r\n var baseUrl = '/api/Interpreter';\r\n var service = {\r\n acceptCall: acceptCall,\r\n rejectCall: rejectCall,\r\n get: get,\r\n addParticipant: addParticipant,\r\n deleteParticipant: deleteParticipant,\r\n setStatus: setStatus,\r\n setKeepAlive: setKeepAlive,\r\n setStatusAtomic: setStatusAtomic,\r\n setPhoneNumber: setPhoneNumber,\r\n getCurrentCall: getCurrentCall,\r\n reconnectCall: reconnectCall\r\n };\r\n\r\n return service;\r\n\r\n /* */\r\n\r\n function getCurrentCall() {\r\n return $http.get(baseUrl + '/CurrentCall/')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR Failed for get current call')(e);\r\n }\r\n }\r\n\r\n function acceptCall(callSid, phoneNumber, languageId, customerId, fromPhoneNumber) {\n console.log('callid from accept service' + callSid);\r\n return $http.put(baseUrl + '/Call/' + callSid + '/Accept',\r\n {\r\n 'phoneNumber': phoneNumber,\r\n 'languageId': languageId,\r\n 'customerId': customerId,\r\n 'fromPhoneNumber': fromPhoneNumber\r\n })\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR Failed for accept call')(e);\r\n }\r\n }\r\n\r\n /* */\r\n function rejectCall(callSid, languageId, customerId, fromPhoneNumber) {\n console.log('callid from reject service' + callSid);\r\n return $http.put(baseUrl + '/Call/' + callSid + '/Reject', { 'languageId': languageId, 'customerId': customerId, 'fromPhoneNumber': fromPhoneNumber })\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR Failed for reject call')(e);\r\n }\r\n }\r\n\r\n function addParticipant(callId, phoneNumber) {\r\n return $http.post(baseUrl + '/Call/' + callId + '/Participant', '\"' + phoneNumber + '\"')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR Failed for add participant')(e);\r\n }\r\n }\r\n\r\n function deleteParticipant(participantCallSid, callId) {\r\n return $http.delete(baseUrl + '/Call/' + callId + '/Participant/' + participantCallSid)\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR Failed for delete participant')(e);\r\n }\r\n }\r\n\r\n function get() {\r\n return $http.get(baseUrl)\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n var user = {\r\n userId: response.data.Id,\r\n username: response.data.Username,\r\n role: 'Interpreter'\r\n };\r\n accountservice.setUser(user);\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR Failed for get interpreter')(e);\r\n }\r\n }\r\n\r\n /* */\r\n function setStatus(status, reason) {\r\n return $http.post(baseUrl + '/Status', '\"' + status + '\"', { params: { reason: reason } })\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR Failed for set status')(e);\r\n }\r\n }\r\n\r\n /* */\r\n function setKeepAlive() {\r\n return $http.put(baseUrl + '/KeepAlive')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR Failed for set keep alive')(e);\r\n }\r\n }\r\n\r\n /* */\r\n function setStatusAtomic(originalStatus, expectedStatus, reason) {\r\n return $http.put('/api/Interpreter/Status',\r\n { 'status': expectedStatus, 'originalStatus': originalStatus }, {\r\n params: { reason: reason }\r\n })\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR Failed for set status atomic')(e);\r\n }\r\n }\r\n\r\n /* */\r\n function setPhoneNumber(phoneNumber) {\r\n return $http.put(baseUrl + '/TempPhoneNumber', '\"' + phoneNumber + '\"')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR Failed for set phone number')(e);\r\n }\r\n }\r\n\r\n /* */\r\n function reconnectCall(callId) {\r\n return $http.put(baseUrl + '/Reconnect', '\"' + callId + '\"')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR Failed for reconnect call process')(e);\r\n }\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n angular\r\n .module('vox-leonis.core')\r\n .factory('internetConnectionChecker', internetConnectionChecker);\r\n\r\n internetConnectionChecker.$inject = ['$injector', '$rootScope', 'enums', '$q'];\r\n\r\n function internetConnectionChecker($injector, $rootScope, enums, $q) {\r\n var checkConnectionDeferred;\r\n var connectionState = true;\r\n var checkConnectionUrl = '/favicon.ico';\r\n\r\n return {\r\n checkConnection: checkConnection,\r\n setInternetConnectionState: setInternetConnectionState,\r\n getInternetConnectionState: getInternetConnectionState,\r\n isInternetConnectionResponse: isInternetConnectionResponse\r\n };\r\n\r\n function setInternetConnectionState(state) {\r\n if (connectionState === state) {\r\n return;\r\n }\r\n \r\n connectionState = state;\r\n $rootScope.$broadcast(enums.Events.InternetConnectionStateChanged, state);\r\n }\r\n\r\n function getInternetConnectionState() {\r\n return connectionState;\r\n }\r\n\r\n function checkConnection() {\n //if we have active request for icon we're returning this requests promise\r\n if (checkConnectionDeferred && !checkConnectionDeferred.promise.$$state.status) {\r\n return checkConnectionDeferred.promise;\r\n }\r\n\r\n checkConnectionDeferred = $q.defer();\r\n\r\n var $http = $injector.get('$http');\r\n\n //we are checking if site icon is accesable if it's does - the request have failed because of another reason\n //but if icon is not accessable it's mean that internet connection is down (there is no trustworthy built-in ability to check internet connection without doing a request)\n //also to disable browser cache we are adding random number to questy string\n $http.head(checkConnectionUrl + '?v=' + Math.random())\r\n .then(function () {\r\n setInternetConnectionState(true);\r\n }, function () {\r\n setInternetConnectionState(false);\r\n }).finally(function () {\n checkConnectionDeferred.resolve();\r\n });\r\n\r\n return checkConnectionDeferred.promise;\r\n }\r\n\r\n function isInternetConnectionResponse(response) {\r\n return response.config.url.indexOf(checkConnectionUrl) >= 0;\r\n }\r\n }\r\n})();\r\n\n(function () {\n 'use strict';\n\n angular\n .module('vox-leonis.core')\n .factory('httpInterceptor', httpInterceptor);\n\n httpInterceptor.$inject = ['$injector', '$q', 'preferences', 'telemetryservice'];\n\n //Intercepts each http request made by Angular.\n //For more information please look https://docs.angularjs.org/api/ng/service/$http#interceptors\n function httpInterceptor($injector, $q, preferences, telemetryService) {\n\n var requests = {};\n\n //later it can be moved to preferences, milliseconds\n var requestTimeout = 10000;\n\n var settings;\n\n //we need that to do not cause generation of multiple requests to retrieve settings till we not received response\n var loadingSettings = false;\n\n var defaultEnabled = false;\n //if can not receive it from server\n var defaultRequestMinDuration = 1000;\n\n resetSettings();\n\n setInterval(cleanupRequests, 1000);\n\n function buildEvent(requestInfo) {\n var result = {\n url: requestInfo.url,\n sentTime: requestInfo.sentTime,\n method: requestInfo.method,\n userId: requestInfo.userId,\n userName: requestInfo.userName,\n userRole: requestInfo.userRole\n };\n if (requestInfo.headers) {\n result.headers = requestInfo.headers;\n }\n\n return result;\n }\n\n //removes from the dictionary requests for which timeout is passed.\n function cleanupRequests() {\n \n Object.keys(requests).forEach(function (key) {\n var requestInfo = requests[key];\n var utcNow = new Date();\n var requestDuration = utcNow.getTime() - requestInfo.sentTime.getTime();\n\n if (requestDuration > requestTimeout) {\n requestInfo.userId = settings.userId;\n requestInfo.userName = settings.userName;\n requestInfo.userRole = settings.userRole;\n\n var event = buildEvent(requestInfo);\n\n event.waitingTimeMs = requestDuration;\n\n // Add custom event for ui requests that did not received answers from server during 'requestTimeout'\n telemetryService.logEvent('Timeout request', event);\n\n //will anyway need to delete outdated item regarding of interceptor ON or OFF, because request can be from previously logged user, for which interceptor was ON, even if for current user interceptor OFF\n delete requests[key];\n }\n });\n }\n\n function resetSettings() {\n settings = {\n userId: null,\n userName: null,\n userRole: null,\n enabled: defaultEnabled,\n minRequestDuration: defaultRequestMinDuration\n };\n }\n\n //request interceptor settings from server\n function serviceEnabled() {\n var defer = $q.defer();\n\n var loggedUserInfo = $injector.get('accountservice').getCurrentUser();\n\n // use default setting when user not logged\n if (!loggedUserInfo || !loggedUserInfo.id || !loggedUserInfo.name || !loggedUserInfo.role) {\n resetSettings();\n defer.reject();\n }\n else {\n //if the same logged user just use cached settings\n if (settings.userId === loggedUserInfo.id) {\n if (settings.enabled) {\n defer.resolve(settings);\n }\n else {\n defer.reject();\n }\n }\n //if logged user changed reload settings from server for new user.\n else {\n var appSettingsService = $injector.get('appsettingsservice');\n\n if (!loadingSettings) {\n loadingSettings = true;\n\n appSettingsService.getAppSetting(preferences.UIRequestMinDuration, defaultRequestMinDuration, loggedUserInfo.id)\n .then(function (data) {\n //update cached value if received from server\n settings.minRequestDuration = parseInt(data, 10);\n //if 0 - turn off interceptor\n settings.enabled = settings.minRequestDuration > 0;\n settings.userId = loggedUserInfo.id;\n settings.userName = loggedUserInfo.name;\n settings.userRole = loggedUserInfo.role;\n loadingSettings = false;\n if (settings.enabled) {\n defer.resolve(settings);\n }\n else {\n defer.reject();\n }\n })\n .catch(function (e) {\n //if can not receive from server than set to default\n resetSettings();\n loadingSettings = false;\n defer.reject();\n });\n }\n else {\n //disable interceptor while waiting for settings from server\n defer.reject();\n }\n }\n }\n\n return defer.promise;\n }\n\n return {\n\n request: function (rawRequest) {\n\n serviceEnabled().then(\n function (settings) {\n rawRequest.guid = $injector.get('utilities').createGuid();\n\n //builds request object for storing in dictionary till receiving response.\n var requestInfo = {\n url: rawRequest.url,\n method: rawRequest.method,\n headers: rawRequest.headers ? rawRequest.headers : '',\n sentTime: new Date()\n };\n\n if (rawRequest.headers) {\n requestInfo.headers = rawRequest.headers;\n }\n\n //store requestInfo in dictionary\n requests[rawRequest.guid] = requestInfo;\n });\n\n return rawRequest;\n },\n\n response: function (rawResponse) {\n\n serviceEnabled().then(\n function (settings) {\n var requestInfo = requests[rawResponse.config.guid];\n //Request can be already removed by cleanupRequests() if the response came too late (after waiting timeout)\n if (requestInfo) {\n var utcNow = new Date();\n requestInfo.requestDuration = utcNow.getTime() - requestInfo.sentTime.getTime();\n\n //Ignore the request if it's duration less than specified. Only long requests are interesting.\n if (requestInfo.requestDuration >= settings.minRequestDuration) {\n\n requestInfo.userId = settings.userId;\n requestInfo.userName = settings.userName;\n requestInfo.userRole = settings.userRole;\n\n var event = buildEvent(requestInfo);\n\n if (rawResponse.status) {\n event.status = rawResponse.status.toString();\n }\n if (rawResponse.statusText) {\n event.statusCode = rawResponse.statusText.toString();\n }\n\n var eventMetrics = { 'durationMs': requestInfo.requestDuration };\n\n // Primary custom event. Writes duration of each request to each url (url, user, request params, response status code and additional params will be logged).\n telemetryService.logEvent('Request duration', event, eventMetrics);\n }\n }\n });\n\n return rawResponse;\n }\n };\n }\n})();\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.core')\r\n .factory('dataservice', dataservice);\r\n\r\n dataservice.$inject = ['$http', '$q', 'exception', 'logger'];\r\n /* @ngInject */\r\n function dataservice($http, $q, exception, logger) {\r\n var service = {\r\n getLanguages: getLanguages,\r\n getPools: getPools,\r\n getCaseDisplay: getCaseDisplay\r\n };\r\n\r\n return service;\r\n\r\n /* */\r\n function getLanguages() {\r\n return $http.get('/api/Languages', {cache: true}) // cached because we don't expect this to change during a session\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n // Convert from array to dictionary\r\n return response.data.reduce(function(map, language) {\r\n map[language.Id] = language.Name;\r\n return map;\r\n }, {});\r\n }\r\n\r\n function fail(e)\r\n {\r\n return exception.catcher('XHR Failed for get languages')(e);\r\n }\r\n }\r\n\r\n /* */\r\n function getPools() {\r\n return $q.when([{ Id: 0, Name: 'Default' }, { Id: 1, Name: 'Another Pool' }, { Id: 5, Name: 'Luke\\'s Pool' }]\r\n .reduce(function (map, pool) {\r\n map[pool.Id] = pool.Name;\r\n return map;\r\n }, {}));\r\n }\r\n\r\n // Return Case display data for a call\r\n function getCaseDisplay(callId) {\r\n return $http.get('/api/Case/Call/' + callId + '/Display')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('XHR Failed for get case display')(e);\r\n }\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.core')\r\n .factory('callservice', callservice);\r\n\r\n callservice.$inject = [];\r\n \r\n /* @ngInject */\r\n function callservice() {\r\n var service = {\r\n interpreterDropped: interpreterDropped,\r\n getInterpreterDroppedInfo: getInterpreterDroppedInfo,\r\n findLastEventIndex: findLastEventIndex\r\n };\r\n\r\n return service;\r\n\r\n function interpreterDropped(callEvents) {\r\n return findLastEventIndex(callEvents, 'InterpreterDisconnected') >= 0;\r\n }\r\n\r\n function getInterpreterDroppedInfo(callEvents, languageId, interpreters) {\r\n\r\n if (interpreters === undefined) {\r\n return null;\r\n }\r\n\r\n var eventIndex = findLastEventIndex(callEvents, 'InterpreterDisconnected', languageId);\r\n\r\n if (eventIndex < 0) {\r\n return null;\r\n }\r\n\r\n var event = callEvents[eventIndex];\r\n\r\n var reason = null;\r\n var userId = null;\r\n\r\n if (callEvents[eventIndex - 1] !== undefined && callEvents[eventIndex - 1].StatusEvent === 'RouteToOperator') {\r\n reason = 'Customer Pressed * to Operator.';\r\n }\r\n\r\n for (var j = 0; j < interpreters.length; j++) {\r\n if (interpreters[j].Id === event.UserId) {\r\n for (var k = 0; k < interpreters[j].LanguagePayrates.length; k++) {\r\n if (interpreters[j].LanguagePayrates[k].LanguageID === languageId) {\r\n reason = 'Interpreter ' + event.UserFirstName + ' ' + event.UserLastName + ' disconnected from the call.';\r\n userId = event.UserId;\r\n }\r\n }\r\n }\r\n }\r\n\r\n return {\r\n interpreterId: userId,\r\n reason: reason\r\n };\r\n }\r\n\r\n function findLastEventIndex(callEvents, eventName) {\r\n if (!callEvents) {\r\n return -1;\r\n }\r\n\r\n for (var i = callEvents.length - 1; i >= 0; i--) {\r\n var event = callEvents[i];\r\n\r\n if (event.StatusEvent === eventName) {\r\n return i;\r\n }\r\n }\r\n\r\n return -1;\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.core')\r\n .factory('cacheservice', cacheservice);\r\n\r\n cacheservice.$inject = ['CacheFactory', 'constants', 'preferences', 'appsettingsservice'];\r\n /* @ngInject */\r\n function cacheservice(CacheFactory, constants, preferences, appsettingsservice) {\r\n var expirationTime = 1000;\r\n if (!CacheFactory.get(constants.dataCache)) {\r\n var dataCache = new CacheFactory(constants.dataCache, {\r\n maxAge: expirationTime, // Items added to this cache expire after 1 second\r\n cacheFlushInterval: 60 * 60 * 1000, // This cache will clear itself every hour\r\n deleteOnExpire: 'aggressive' // Items will be deleted from this cache when they expire\r\n });\r\n }\r\n appsettingsservice.getAppSetting(preferences.DataCacheExpirationTimeMilliseconds, expirationTime).then(function (data) {\r\n var dataCache = CacheFactory.get(constants.dataCache);\r\n dataCache.$$maxAge = data;\r\n });\r\n\r\n var service = {\r\n dataCache: CacheFactory.get(constants.dataCache)\r\n };\r\n\r\n return service;\r\n }\r\n})();\r\n\n(function () {\n 'use strict';\n\n angular\n .module('vox-leonis.core')\n .factory('appsettingsservice', appsettingsservice);\n\n appsettingsservice.$inject = ['$http', 'exception'];\n /* @ngInject */\n function appsettingsservice($http, exception) {\n var service = {\n getAppSetting: getAppSetting,\n getIVPFrontEndUrl: getIVPFrontEndUrl,\n getOVPFrontEndUrl: getOVPFrontEndUrl,\n getAppVersion: getAppVersion\n };\n\n return service;\n\n /* */\n function getAppSetting(appSetting, defaultValue, userId) {\n return $http.get('/api/AppSettings/' + appSetting + '?defaultValue=' + defaultValue + '&userId=' + userId)\n .then(success)\n .catch(fail);\n\n function success(response) {\n return response.data;\n }\n\n function fail(e) {\n return exception.catcher('XHR Failed for get app setting')(e);\n }\n }\n\n function getIVPFrontEndUrl() {\n return $http.get('/api/AppSettings/GetIVPFrontEndUrl')\n .then(success)\n .catch(fail);\n\n function success(response) {\n return response.data;\n }\n\n function fail(e) {\n return exception.catcher('XHR Failed for get iVP FrontEnd Url')(e);\n }\n }\n\n function getOVPFrontEndUrl() {\n return $http.get('/api/AppSettings/GetOVPFrontEndUrl')\n .then(success)\n .catch(fail);\n\n function success(response) {\n return response.data;\n }\n\n function fail(e) {\n return exception.catcher('XHR Failed for get oVP FrontEnd Url')(e);\n }\n }\n\n function getAppVersion() {\n return $http.get('/api/AppVersion')\n .then(success)\n .catch(fail);\n\n function success(response) {\n return response.data;\n }\n\n function fail(e) {\n return 'unknown';\n }\n }\n }\n})();\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.core')\r\n .factory('adminservice', adminservice);\r\n\r\n adminservice.$inject = ['$http', '$q', 'exception', 'logger'];\r\n /* @ngInject */\r\n function adminservice($http, $q, exception, logger) {\r\n var service = {\r\n getCalls: getCalls\r\n };\r\n\r\n return service;\r\n\r\n /* */\r\n function getCalls(recentCallHours, forceGet) {\r\n return $http.get('/api/Admin/Calls/' + recentCallHours + '/ForceGet/' + forceGet)\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e)\r\n {\r\n return exception.catcher('XHR failed for adminservice.getCalls')(e);\r\n }\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.core')\r\n .factory('accountservice', accountservice);\r\n\r\n accountservice.$inject = ['$http', '$q', 'exception', 'logger'];\r\n /* @ngInject */\r\n function accountservice($http, $q, exception, logger)\n {\r\n var service = {\r\n login: login,\n loginADB2C: loginADB2C,\n loginADB2CAzureOnly: loginADB2CAzureOnly,\n voicePortalLoginMode: voicePortalLoginMode,\r\n logout: logout,\r\n getCurrentUser: getCurrentUser,\r\n getCurrentUserId: getCurrentUserId,\r\n setUser: setUser,\r\n getRoles: getRoles,\r\n logMessage: logMessage,\r\n\n getWebRTCAccessTokens: getWebRTCAccessTokens,\n getPreflightAccessToken: getPreflightAccessToken\r\n };\r\n\r\n var userInfo = null;\r\n\r\n return service;\r\n\r\n function login(username, password) {\r\n return $http.post('/api/Account/Login',\r\n {'Username': username, 'Password': password, 'RememberMe': false})\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('Login')(e);\r\n }\r\n }\r\n\n function loginADB2C() {\r\n return $http.get('/api/Account/ADB2CLogin')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\n if (e.status === 401) {\n return { Failure: null, Roles: null};\r\n }\r\n\r\n return exception.catcher('loginADB2C')(e);\r\n }\r\n }\n\n function loginADB2CAzureOnly() {\r\n return $http.get('/api/Account/ADB2CLogin')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\n if (e.status === 401) {\n location.replace('/ADB2C/Login');\n return { Failure: null, Roles: null };\r\n }\n return logout().finally(function () {\r\n location.replace('/ADB2C/Logout');\n return exception.catcher('loginADB2CAzureOnly')(e);\n });\r\n }\r\n }\r\n\r\n function logout() {\r\n return $http.post('/api/Account/Logoff')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n userInfo = null;\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('Logout')(e);\r\n }\r\n }\r\n\n function voicePortalLoginMode() {\r\n return $http.get('/api/Account/VoicePortalLoginMode')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\n\r\n return exception.catcher('voicePortalLoginMode')(e);\r\n }\r\n }\r\n\r\n function getCurrentUser() {\r\n return userInfo;\r\n }\r\n\r\n function getCurrentUserId() {\r\n return userInfo ? userInfo.id : '';\r\n }\r\n\r\n function setUser(user) {\r\n userInfo = {\r\n id: user.userId,\r\n name: user.username,\r\n role: user.role\r\n };\r\n }\r\n\r\n function getRoles(suppressError) {\r\n return $http.get('/api/Account/Roles')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('Roles', suppressError)(e);\r\n }\r\n }\r\n\r\n function logMessage(message, logLevel) {\r\n return $http.post('/api/Account/LogMessage/' + logLevel, '\"' + message + '\"')\r\n .catch(fail);\r\n\r\n function fail(e) {\r\n return exception.catcher('Log Message failed')(e);\r\n }\r\n }\r\n\r\n function getWebRTCAccessTokens() {\r\n return $http.get('/api/Account/WebRtcAccessTokens')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('AccessTokens')(e);\r\n }\r\n }\n\n function getPreflightAccessToken() {\r\n return $http.get('/api/Account/PreflightWebRtcAccessToken')\r\n .then(success)\r\n .catch(fail);\r\n\r\n function success(response) {\r\n return response.data;\r\n }\r\n\r\n function fail(e) {\r\n return exception.catcher('PreflightWebRtcAccessToken')(e);\r\n }\r\n }\r\n }\r\n})();\r\n\n(function() {\r\n 'use strict';\r\n\r\n angular.module('blocks.router', [\r\n 'ui.router',\r\n 'blocks.logger'\r\n ]);\r\n})();\r\n\n/* Help configure the state-base ui.router */\r\n(function() {\r\n 'use strict';\r\n\r\n angular\r\n .module('blocks.router')\r\n .provider('routerHelper', routerHelperProvider);\r\n\r\n routerHelperProvider.$inject = ['$locationProvider', '$stateProvider', '$urlRouterProvider'];\r\n /* @ngInject */\r\n function routerHelperProvider($locationProvider, $stateProvider, $urlRouterProvider) {\r\n /* jshint validthis:true */\r\n var config = {\r\n docTitle: undefined,\r\n resolveAlways: {}\r\n };\r\n\r\n $locationProvider.html5Mode(true);\r\n\r\n this.configure = function(cfg) {\r\n angular.extend(config, cfg);\r\n };\r\n\r\n this.$get = RouterHelper;\r\n RouterHelper.$inject = ['$location', '$rootScope', '$state', 'logger', '$uibModalStack'];\r\n /* @ngInject */\r\n function RouterHelper($location, $rootScope, $state, logger, $uibModalStack) {\r\n var handlingStateChangeError = false;\r\n var hasOtherwise = false;\r\n var stateCounts = {\r\n errors: 0,\r\n changes: 0\r\n };\r\n\r\n var service = {\r\n configureStates: configureStates,\r\n getStates: getStates,\r\n stateCounts: stateCounts\r\n };\r\n\r\n init();\r\n\r\n return service;\r\n\r\n ///////////////\r\n\r\n function configureStates(states, otherwisePath) {\r\n states.forEach(function(state) {\r\n state.config.resolve =\r\n angular.extend(state.config.resolve || {}, config.resolveAlways);\r\n $stateProvider.state(state.state, state.config);\r\n });\r\n if (otherwisePath && !hasOtherwise) {\r\n hasOtherwise = true;\r\n $urlRouterProvider.otherwise(otherwisePath);\r\n }\r\n }\r\n\r\n function handleRoutingErrors() {\r\n // Route cancellation:\r\n // On routing error, go to the dashboard.\r\n // Provide an exit clause if it tries to do it twice.\r\n $rootScope.$on('$stateChangeError',\r\n function(event, toState, toParams, fromState, fromParams, error) {\r\n if (handlingStateChangeError) {\r\n return;\r\n }\r\n stateCounts.errors++;\r\n handlingStateChangeError = true;\r\n var destination = (toState &&\r\n (toState.title || toState.name || toState.loadedTemplateUrl)) ||\r\n 'unknown target';\r\n var msg = 'Error routing to ' + destination + '. ' +\r\n (error.data || '') + '.
' + (error.statusText || '') +\r\n ': ' + (error.status || '');\r\n logger.warning(msg, [toState]);\r\n $location.path('/');\r\n }\r\n );\r\n }\r\n\r\n function init() {\r\n handleRoutingErrors();\r\n stateChangeStart();\r\n updateDocTitle();\r\n }\r\n\r\n function getStates() { return $state.get(); }\r\n\r\n function stateChangeStart() {\r\n $rootScope.$on('$stateChangeStart',\r\n function (event, toState, toParams, fromState, fromParams, options) {\r\n // get rid of any existing modals since we are switching to a new state\r\n $uibModalStack.dismissAll('');\r\n }\r\n );\r\n }\r\n\r\n function updateDocTitle() {\r\n $rootScope.$on('$stateChangeSuccess',\r\n function(event, toState, toParams, fromState, fromParams) {\r\n stateCounts.changes++;\r\n handlingStateChangeError = false;\r\n var title = config.docTitle;\r\n $rootScope.title = title; // data bind to \r\n }\r\n );\r\n }\r\n }\r\n }\r\n})();\r\n\n(function() {\r\n 'use strict';\r\n\r\n angular.module('blocks.logger', []);\r\n})();\r\n\n(function() {\n 'use strict';\n\n angular\n .module('blocks.logger')\n .factory('logger', logger);\n\n logger.$inject = ['$log', 'toastr'];\n\n /* @ngInject */\n function logger($log, toastr) {\n var service = {\n showToasts: true,\n\n error : error,\n info : info,\n success : success,\n warning : warning,\n debug : debug,\n\n // straight to console; bypass toastr\n log : $log.log\n };\n\n return service;\n /////////////////////\n\n function error(message, data, title) {\n toastr.error(message, title);\n data = (data === undefined) ? '' : data;\n $log.error('Error: ' + message, data);\n }\n\n function info(message, data, title) {\n //toastr.info(message, title);\n data = (data === undefined) ? '' : data;\n $log.info('Info: ' + message, data);\n }\n\n function success(message, data, title) {\n //toastr.success(message, title);\n data = (data === undefined) ? '' : data;\n $log.info('Success: ' + message, data);\n }\n\n function warning(message, data, title) {\n //toastr.warning(message, title);\n data = (data === undefined) ? '' : data;\n $log.warn('Warning: ' + message, data);\n }\n\n function debug(message, data, title) {\n toastr.error(message, title);\n data = (data === undefined) ? '' : data;\n $log.debug('Debug: ' + message, data);\n }\n }\n}());\n\n(function() {\r\n 'use strict';\r\n\r\n angular.module('blocks.exception', ['blocks.logger']);\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('blocks.exception')\r\n .factory('exception', exception);\r\n\r\n /* @ngInject */\r\n function exception($q, logger) {\r\n var service = {\r\n catcher: catcher\r\n };\r\n return service;\r\n\r\n function catcher(message, suppressError) {\r\n return function (e) {\r\n var thrownDescription;\r\n var newMessage = message;\r\n if (e.data && e.data.description) {\r\n thrownDescription = '\\n' + e.data.description;\r\n newMessage = newMessage + thrownDescription;\r\n e.data.description = newMessage;\r\n }\r\n else if (e.status && e.statusText) {\r\n thrownDescription = '\\n' + e.status + ':' + e.statusText;\r\n newMessage = newMessage + thrownDescription;\r\n if (e.data && typeof e.data === 'object') {\r\n e.data.description = newMessage;\r\n }\r\n }\r\n\r\n if (!suppressError) {\r\n logger.error(newMessage);\r\n }\r\n\r\n return $q.reject(e);\r\n };\r\n }\r\n }\r\n})();\r\n\n// Include in index.html so that app level exceptions are handled.\r\n// Exclude from testRunner.html which should run exactly what it wants to run\r\n(function() {\r\n 'use strict';\r\n\r\n angular\r\n .module('blocks.exception')\r\n .provider('exceptionHandler', exceptionHandlerProvider)\r\n .config(config);\r\n\r\n /**\r\n * Must configure the exception handling\r\n */\r\n function exceptionHandlerProvider() {\r\n /* jshint validthis:true */\r\n this.config = {\r\n appErrorPrefix: undefined\r\n };\r\n\r\n this.configure = function (appErrorPrefix) {\r\n this.config.appErrorPrefix = appErrorPrefix;\r\n };\r\n\r\n this.$get = function() {\r\n return {config: this.config};\r\n };\r\n }\r\n\r\n config.$inject = ['$provide'];\r\n\r\n /**\r\n * Configure by setting an optional string value for appErrorPrefix.\r\n * Accessible via config.appErrorPrefix (via config value).\r\n * @param {Object} $provide\r\n */\r\n /* @ngInject */\r\n function config($provide) {\r\n $provide.decorator('$exceptionHandler', extendExceptionHandler);\r\n }\r\n\r\n extendExceptionHandler.$inject = ['$delegate', 'exceptionHandler', 'logger'];\r\n\r\n /**\r\n * Extend the $exceptionHandler service to also display a toast.\r\n * @param {Object} $delegate\r\n * @param {Object} exceptionHandler\r\n * @param {Object} logger\r\n * @return {Function} the decorated $exceptionHandler service\r\n */\r\n function extendExceptionHandler($delegate, exceptionHandler, logger) {\r\n return function(exception, cause) {\r\n var appErrorPrefix = exceptionHandler.config.appErrorPrefix || '';\r\n var errorData = {exception: exception, cause: cause};\r\n exception.message = appErrorPrefix + exception.message;\r\n $delegate(exception, cause);\r\n /**\r\n * Could add the error to a service's collection,\r\n * add errors to $rootScope, log errors to remote web server,\r\n * or log locally. Or throw hard. It is entirely up to you.\r\n * throw exception;\r\n *\r\n * @example\r\n * throw { message: 'error message we added' };\r\n */\r\n logger.error(exception.message, errorData);\r\n };\r\n }\r\n})();\r\n\n(function ()\r\n{\r\n 'use strict';\n\n angular\r\n .module('vox-leonis.widgets', [\r\n 'vox-leonis.core'\r\n ]);\r\n})();\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.widgets')\r\n .directive('voxWebRtcConnectionQuality', voxWebRtcConnectionQuality);\r\n\r\n /* @ngInject */\r\n function voxWebRtcConnectionQuality() {\r\n var directive = {\r\n bindToController: true,\r\n controller: WebRtcConnectionQualityController,\r\n controllerAs: 'vm',\r\n restrict: 'E',\r\n replace: true,\r\n scope: {\r\n },\r\n templateUrl: 'app/widgets/vox-web-rtc-connection-quality.html'\r\n };\r\n\r\n return directive;\r\n }\r\n\r\n WebRtcConnectionQualityController.$inject = ['$scope', 'enums'];\r\n\n /* @ngInject */\r\n function WebRtcConnectionQualityController($scope, enums) {\r\n var vm = this;\n var defaultStatusTitle = 'All systems Go!';\n\n vm.statusClass = 'fad fa-signal';\r\n vm.statusTitle = defaultStatusTitle;\r\n vm.errorLevel = 0;\n\r\n $scope.$on(enums.Events.WebRtcConnectionQualityChanged, function (event, isError) {\r\n showWarning(isError);\r\n });\r\n\r\n function showWarning(isError) {\r\n if (isError) {\r\n vm.statusTitle = 'Poor network connection!';\r\n vm.statusClass = 'fas fa-signal-alt-3 blinkFast alertColor';\n }\r\n else {\r\n vm.statusTitle = 'All systems Go!';\r\n vm.statusClass = 'fad fa-signal';\r\n }\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.widgets')\r\n .directive('voxTestCallButton', voxTestCallButton);\n\r\n function voxTestCallButton() {\r\n var directive = {\r\n bindToController: true,\r\n controller: TestCallButtonController,\r\n controllerAs: 'vm',\r\n replace: true,\r\n restrict: 'E',\r\n scope: {\n 'person': '=',\r\n },\r\n templateUrl: 'app/widgets/vox-test-call-button.html'\r\n };\r\n return directive;\r\n }\r\n\r\n TestCallButtonController.$inject = ['$scope', 'accountservice', 'preferences', 'appsettingsservice', 'userservice', 'enums', 'usermessageservice'];\r\n\r\n /* @ngInject */\r\n function TestCallButtonController($scope, accountservice, preferences, appsettingsservice, userservice, enums, usermessageservice) {\r\n\r\n var vm = this;\r\n\n setupVarsAndMethods();\n\n function setupVarsAndMethods() {\n vm.enableTestButton = false;\r\n vm.testButtonDisabledFactory = true;\n vm.forceButtonToDisable = false;\n vm.logLevel = enums.LogLevel;\n vm.test = test;\n vm.waiting = false;\n vm.isDisabledByPoorLatency = false;\n vm.EnableDisableTestButon = EnableDisableTestButon;\n appsettingsservice.getAppSetting(preferences.DisableStatusChange, vm.IsDisabledStatusChange).then(function (data) {\n vm.isDisabledByPoorLatency = data;\r\n });\n appsettingsservice.getAppSetting(preferences.TestButtonDisabled, vm.testButtonDisabledDefault).then(function (data) {\r\n vm.testButtonDisabledFactory = (data === 'true');\n //call this method after getting the preference\n vm.EnableDisableTestButon();\r\n });\n }\n usermessageservice.subscribe($scope, 'callStatus', function (event, data) {\n\n vm.person.Status = data.StatusName;\n //Status change should again check the status of test button\n vm.EnableDisableTestButon();\r\n });\n\n function EnableDisableTestButon() {\n var statusShouldEnableButton = false;\n switch (vm.person.Status) {\r\n\r\n case enums.PersonStatusNames.Available:\n case enums.PersonStatusNames.Unavailable:\n case enums.PersonStatusNames.NotAvailable:\n case enums.PersonStatusNames.Away:\n case enums.PersonStatusNames.Monitoring:\n if (vm.isDisabledByPoorLatency && vm.person.UserStatusReason === enums.PersonStatusReason.PoorLatency) {\n statusShouldEnableButton = false;\r\n } else {\n statusShouldEnableButton = true;\n }\r\n }\n\n if (!vm.testButtonDisabledFactory && statusShouldEnableButton) {\n vm.enableTestButton = true;\n vm.forceButtonToDisable = false;\r\n }\n else {\n vm.enableTestButton = false;\r\n }\n\r\n }\n\n function test() {\n //set force to disable as clicking on test call takes some time for status to change from available to alerting, hence disable the button immediately\n vm.waiting = true;\r\n userservice.testCall().then(function (result) {\r\n if (result) {\r\n accountservice.logMessage('Message: testCall result:' + result, vm.logLevel.Info);\r\n }\r\n })\r\n .catch(function (result) {\n var msg = JSON.stringify(result);\n //graylog truncates double quotes before and after curly brackets\r\n msg = msg.replaceAll('\"', '');\n\r\n if (result.status === -1) {\r\n accountservice.logMessage('Message: testCallMethod failed, poor network connectivity. Message:' + msg + ' UserId:' + vm.person.Id, vm.logLevel.Warn);\r\n } else {\r\n accountservice.logMessage('Message: testCallMethod failed, Message:' + msg + ' UserId:' + vm.person.Id, vm.logLevel.Error);\r\n }\r\n })\r\n .finally(function () {\r\n vm.waiting = false;\r\n });\r\n }\r\n }\r\n})(angular);\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.widgets')\r\n .directive('voxSipData', voxSipData);\r\n\r\n /* @ngInject */\r\n function voxSipData() {\r\n var directive = {\r\n bindToController: true,\r\n controller: SipDataController,\r\n controllerAs: 'vm',\r\n replace: true,\r\n restrict: 'E',\r\n scope: {\r\n 'userId': '='\r\n },\r\n templateUrl: 'app/widgets/vox-sip-data.html'\r\n };\r\n return directive;\r\n }\r\n\r\n SipDataController.$inject = ['$scope', 'accountservice', 'callEvents', 'enums', 'session', 'usermessageservice', 'userservice', '$interval', 'preferences', 'appsettingsservice'];\r\n /* @ngInject */\r\n function SipDataController($scope, accountservice, callEvents, enums, session, usermessageservice, userservice, $interval, preferences, appsettingsservice) {\r\n var vm = this;\r\n\r\n vm.callId = undefined;\r\n vm.logLevel = enums.LogLevel;\r\n vm.sipdata = undefined;\r\n vm.sipdataCopy = undefined;\r\n vm.interpreter = undefined;\r\n vm.operator = undefined;\r\n vm.roles = session.roles;\n vm.save = save;\r\n vm.reset = reset;\n vm.sipdataChanged = sipdataChanged;\r\n vm.showSipdata = showSipdata;\n vm.showSipdataItem = showSipdataItem;\r\n vm.editSipdataItem = editSipdataItem;\r\n vm.showOrEditSipdata = showOrEditSipdata;\n vm.showUpdateMessage = false;\r\n vm.showSaveMessage = false;\n vm.validateSipdata = false;\n vm.handlePattern = handlePattern;\n\n appsettingsservice.getAppSetting(preferences.ValidateSipdata, 'false').then(function (data) {\r\n vm.validateSipdata = (data === 'true');\r\n });\r\n\r\n usermessageservice.subscribe($scope, 'notify', function (event, data) {\r\n if (data.eventName === 'sipCallDataDetails') {\r\n vm.callId = data.callId;\r\n vm.sipdata = [];\r\n if (!data.sipCallData) {\r\n return;\r\n }\r\n for (var i = 0; i < data.sipCallData.length; i++) {\r\n var item = data.sipCallData[i];\r\n if (showSipdataItem(item)) {\r\n vm.sipdata.push(item);\r\n }\r\n }\r\n vm.sipdataCopy = angular.copy(vm.sipdata);\r\n }\r\n });\r\n\r\n vm.interpreter = vm.roles.indexOf('Interpreter') >= 0;\r\n vm.operator = vm.roles.indexOf('Operator') >= 0;\n\r\n // Only show the Sipdata Details UI if the user is allowed to view at least 1 Sipdata item\r\n function showSipdata() {\r\n\r\n if (vm.sipdata) {\r\n for (var i = 0; i < vm.sipdata.length; i++) {\r\n if (showSipdataItem(vm.sipdata[i])) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n }\n function showSipdataItem(sipdataItem) {\r\n if (sipdataItem) {\r\n return showOrEditSipdata(sipdataItem.Visible);\r\n }\r\n\r\n return false;\r\n }\r\n\r\n // Only show the Sipdata Items the user is allowed to view\r\n function editSipdataItem(sipdataItem) {\r\n if (sipdataItem) {\r\n return showOrEditSipdata(sipdataItem.Editable);\r\n }\r\n\r\n return false;\r\n }\n\n function reset(index) {\r\n vm.showUpdateMessage = false;\r\n if (!vm.sipdata || !vm.sipdata[index]) {\r\n return;\r\n }\r\n vm.sipdata[index].ValueText = vm.sipdataCopy[index].ValueText;\r\n }\r\n\n function save(index) {\r\n vm.showUpdateMessage = false;\r\n var updatedSipdata = [vm.sipdata[index]];\r\n userservice.setSipdata(vm.callId, updatedSipdata).then(function (result) {\r\n if (result === false) {\r\n accountservice.logMessage('sipDataChanged Action Failed|CallId: ' + vm.callId, vm.logLevel.Warn);\r\n } else {\r\n vm.showSaveMessage = true;\r\n }\r\n vm.oldValue = vm.sipdataCopy[index].ValueText;\r\n userservice.addCallEvent(callEvents.SipCallHeaderChanged, vm.callId, vm.oldValue);\r\n vm.sipdataCopy = angular.copy(vm.sipdata);\r\n\r\n $interval(function () {\r\n vm.showSaveMessage = false;\r\n }, 2000);\r\n });\r\n }\n\r\n //This filter is for to show the Sipdata Items the user is allowed to view\r\n $scope.visible = function (sipdataItem) {\r\n return showSipdataItem(sipdataItem);\r\n };\r\n\n function sipdataChanged(index) {\r\n if (!vm.sipdata || !vm.sipdata[index]) {\r\n return;\r\n }\n\r\n if (vm.sipdata[index].ValueText === vm.sipdataCopy[index].ValueText) {\r\n vm.showUpdateMessage = false;\r\n } else {\n vm.showUpdateMessage = true;\r\n }\r\n }\n\n function handlePattern(index) {\n var nameRegex = '';\n\n if (!vm.validateSipdata) {\r\n return;\r\n }\n\n if (!vm.sipdata || !vm.sipdata[index]) {\r\n return;\r\n }\n\n if (vm.sipdata) {\r\n\n nameRegex = vm.sipdata[index].MatchPattern;\n return nameRegex;\n\r\n } else {\n return;\r\n }\r\n }\n\r\n function showOrEditSipdata(value) {\r\n var result = false;\r\n\r\n switch (value) {\r\n case 1:\r\n if (vm.operator) {\r\n result = true;\r\n }\r\n break;\r\n case 2:\r\n if (vm.interpreter) {\r\n result = true;\r\n }\r\n break;\r\n case 3:\r\n result = true;\r\n break;\r\n }\r\n\r\n return result;\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.widgets')\r\n .directive('voxSignalRStatus', voxSignalRStatus);\r\n\r\n /* @ngInject */\r\n function voxSignalRStatus() {\r\n var directive = {\r\n bindToController: true,\r\n controller: SignalRStatusController,\r\n controllerAs: 'vm',\r\n restrict: 'E',\r\n replace: true,\r\n scope: {\r\n },\r\n templateUrl: 'app/widgets/vox-signal-r-status.html'\r\n };\r\n\r\n return directive;\r\n }\r\n\r\n SignalRStatusController.$inject = ['$rootScope', '$scope', '$timeout', 'enums', 'internetConnectionChecker', 'appsettingsservice', 'preferences'];\r\n /* @ngInject */\r\n function SignalRStatusController($rootScope, $scope, $timeout, enums, internetConnectionChecker, appsettingsservice, preferences) {\r\n var vm = this;\r\n vm.showWarning = false;\r\n\r\n vm.signalRStateNames = { 0: 'connecting', 1: 'connected', 2: 'reconnecting', 4: 'disconnected' };\r\n vm.signalRStates = { connecting: 0, connected: 1, reconnecting: 2, disconnected: 4 };\r\n vm.signalRData = {\r\n connecting: {\r\n classes: 'blinkSlow warnColor',\r\n title: 'Connecting...'\r\n },\r\n reconnecting: {\r\n classes: 'blinkSlow warnColor',\r\n title: 'Reconnecting...'\r\n },\r\n disconnected: {\r\n classes: 'blinkFast alertColor',\r\n title: 'Connection lost. Refresh the page!'\r\n }\r\n };\n\r\n $scope.$on(enums.Events.InternetConnectionStateChanged, function (event, state) {\r\n if (!state) {\r\n showWarning(vm.signalRStates.disconnected);\r\n }\r\n else {\r\n vm.showWarning = false;\r\n }\r\n });\r\n\r\n $scope.$on(enums.Events.SignalRStateChanged, function (event, state) {\r\n $timeout(function () {\r\n if (!internetConnectionChecker.getInternetConnectionState()) {\r\n showWarning(vm.signalRStates.disconnected);\r\n }\r\n else {\r\n // when the status is connecting, reconnecting, or disconnected, no alerts will be received by the client\r\n switch (state) {\r\n case 0:\n case 2:\r\n case 4:\r\n showWarning(state);\r\n break;\r\n default:\r\n vm.showWarning = false;\r\n }\r\n }\r\n });\r\n });\r\n\r\n function showWarning(state) {\r\n var signalRStateName = vm.signalRStateNames[state];\r\n var signalRObject = vm.signalRData[signalRStateName];\r\n vm.statusClass = 'fa fa-warning ' + signalRObject.classes;\r\n vm.statusTitle = signalRObject.title;\r\n vm.showWarning = true;\n }\r\n }\r\n})();\r\n\n(function () {\n 'use strict';\n\n angular\n .module('vox-leonis.widgets')\n .directive('voxPhoneNumber', voxPhoneNumber, ['phonenumberservice']);\n\n /* @ngInject */\n function voxPhoneNumber(phonenumberservice) {\n var directive = {\n bindToController: true,\n controller: PhoneNumberController,\n controllerAs: 'vm',\n restrict: 'E',\n scope: {\n 'phoneNumber': '=',\n 'userCountryName': '=',\n 'phoneErrorMessage': '=',\n 'allowBlankNumbers': '=',\n 'allowMobileNumbers': '=',\n 'validating': '=?',\n 'setUserStatus': '=',\n 'personStatus': '=',\n 'defaultNumber': '=?',\n 'userId': '=?',\n 'thirdParty': '=',\n },\n templateUrl: 'app/widgets/vox-phone-number.html',\n link: function postLink(scope, element, attrs, vm) {\n\n var watch = scope.$watch('vm.phoneNumber', function (newVal) {\n vm.parse(newVal);\n if (newVal !== null && vm.validatePhoneCheck === false && (!vm.allowBlankNumbers || (vm.number !== undefined)))\n {\n var response = vm.phoneNumberCookie;\n if (response === null || response === undefined || (response !== undefined && (response.TwilioNumber === null || response.TwilioNumber.PhoneNumber !== newVal)))\n {\n return phonenumberservice.phoneNumberInfo(newVal).then(function (data) {\n if (data)\n {\n setupPhoneResponse(data, vm);\n }\n else\n {\n setPhoneMessage(vm, vm.getInvalidErrorMessage(vm.phoneCountryName, vm.phoneNumber), true);\n }\n });\n }\n else\n {\n setupPhoneResponse(response, vm);\n }\n }\n scope.$on('$destroy', function () {\n watch();\n });\n });\n }\n };\n return directive;\n }\n\n function setupPhoneResponse(response, vm) {\n if (!response.Valid)\n {\n setPhoneMessage(vm, vm.getInvalidErrorMessage(vm.phoneCountryName, vm.phoneNumber), true);\n }\n else if (!response.Callable)\n {\n setPhoneMessage(vm, vm.getNotAllowedErrorMessage(vm.phoneCountryName, vm.phoneNumber), true);\n }\n else if (!response.AllowMobilePhone && !vm.allowMobileNumbers)\n {\n setPhoneMessage(vm, vm.getDenyMobileUseErrorMessage(), true);\n }\n else\n {\n setPhoneMessage(vm, undefined, false);\n }\n }\n\n function setPhoneMessage(vm, message, isError) {\n vm.validating = false;\n vm.phoneErrorMessage = message;\n\n if (isError)\n {\n vm.color = { color: 'red' };\n vm.phoneErrorMessageChanged(message, vm.setUserStatus);\n } else\n {\n vm.color = {};\n }\n }\n\n PhoneNumberController.$inject = ['$scope', '$timeout', '$cookies', 'session', 'phonenumberservice', 'appsettingsservice', 'accountservice',\n 'constants', 'enums', 'interpreterservice', 'operatorservice', 'monitorservice', '$rootScope', 'preferences'];\n /* @ngInject */\n function PhoneNumberController($scope, $timeout, $cookies, session, phonenumberservice, appsettingsservice, accountservice, constants,\n enums, interpreterservice, operatorservice, monitorservice, $rootScope, preferences) {\n var vm = this;\n\n // Variables\n var usRequireLengthErrorMessage = 'US numbers require exactly 10 digits.';\n vm.country = undefined;\n vm.number = undefined;\n vm.phoneCountryName = undefined;\n vm.roles = session.roles;\n vm.validatePhoneCheck = false;\n vm.validating = false;\n vm.logLevel = enums.LogLevel;\n vm.phoneNumberCookie = $cookies.get(constants.phoneNumberInfo) !== (null || undefined) ? JSON.parse($cookies.get(constants.phoneNumberInfo)) : undefined;\n vm.premiumRatePhoneNumberPrefixes = [];\n\n // Functions\n vm.countryDisabled = countryDisabled;\n vm.getDenyMobileUseErrorMessage = getDenyMobileUseErrorMessage;\n vm.getInvalidErrorMessage = getInvalidErrorMessage;\n vm.getNotAllowedErrorMessage = getNotAllowedErrorMessage;\n vm.isPuertoRico = isPuertoRico;\n vm.parse = parse;\n vm.phoneChanged = phoneChanged;\n vm.phoneErrorMessageChanged = phoneErrorMessageChanged;\n vm.resetClicked = resetClicked;\n vm.save = save;\n\n activate();\n\n function activate() {\n initValidationTimeoutDuration();\n\n $scope.$on(enums.Events.ContactMethodChanged, function () {\n return phoneChanged('vox-phone-number_contact_method_changed_event');\n });\n\n $rootScope.$broadcast(enums.Events.SetTempPhoneNumber);\n if (!vm.thirdParty)\n {\n vm.isTemporaryPhonenumber = vm.defaultNumber !== vm.phoneNumber;\n }\n else\n {\n vm.isTemporaryPhonenumber = false;\n }\n\n appsettingsservice.getAppSetting(preferences.PremiumRatePhoneNumberPrefix, '', null).then(function (data) {\n try {\n vm.premiumRatePhoneNumberPrefixes = data.split(';').filter(function (value) { return value !== '';});\n }\n catch (e) {\n }\n });\n }\n\n function phoneChanged(callerName) {\n if (vm.number !== undefined)\n {\n vm.number = vm.number.replace(/[^\\d]/g, '');\n\n if ((vm.number === '') && vm.allowBlankNumbers)\n {\n setPhoneMessage(vm, undefined, false);\n return true;\n }\n\n if ((vm.country === '1') && (vm.number.length !== 10))\n {\n setPhoneMessage(vm, usRequireLengthErrorMessage, true);\n return false;\n }\n\n if ((vm.phoneErrorMessage !== usRequireLengthErrorMessage) && (vm.phoneNumber === '+' + vm.country + vm.number))\n {\n return false;\n }\n\n setPhoneMessage(vm, undefined, false);\n vm.validating = true;\n\n vm.phoneNumber = '+' + vm.country + vm.number;\n vm.validatePhoneCheck = true;\n\n accountservice.logMessage('vox-phone-number.phoneNumberChanged, Called by: ' + (callerName ? callerName : 'Unknown') + ', PhoneNumber: ' + vm.phoneNumber, vm.logLevel.Info);\n\n if (isPremiumRatePhoneNumber(vm.phoneNumber)) {\n setPhoneMessage(vm, getPremiumRateNumbersNotEnabledMessage(), true);\n return Promise.resolve();\n }\n\n return phonenumberservice.phoneNumberInfo(vm.phoneNumber).then(function (response) {\n if (response)\n {\n if (!response.Valid)\n {\n setPhoneMessage(vm, vm.getInvalidErrorMessage(vm.phoneCountryName, vm.phoneNumber), true);\n }\n else if (!response.Callable)\n {\n setPhoneMessage(vm, vm.getNotAllowedErrorMessage(vm.phoneCountryName, vm.phoneNumber), true);\n }\n else if (!response.AllowMobilePhone && !vm.allowMobileNumbers)\n {\n setPhoneMessage(vm, vm.getDenyMobileUseErrorMessage(), true);\n }\n else\n {\n setPhoneMessage(vm, undefined, false);\n }\n if (!vm.thirdParty && vm.userId)\n {\n $timeout(function () { vm.save(callerName); });\n }\n }\n else\n {\n setPhoneMessage(vm, vm.getInvalidErrorMessage(vm.phoneCountryName, vm.phoneNumber), true);\n }\n if (!vm.thirdParty)\n {\n vm.isTemporaryPhonenumber = vm.defaultNumber !== vm.phoneNumber;\n }\n else\n {\n vm.isTemporaryPhonenumber = false;\n }\n });\n }\n\n if (!vm.thirdParty && vm.userId)\n {\n $timeout(function () { vm.save(callerName); });\n }\n }\n function save(caller) {\n accountservice.logMessage('Message: vox-phone-number.Save, Called by: ' + (caller ? caller : '') + ', UserId: ' + vm.userId, vm.logLevel.Info);\n vm.currentRole = $cookies.get(constants.userRole);\n if (vm.currentRole === constants.Operator)\n {\n return operatorservice.setPhoneNumber(vm.phoneNumber).then(function (result) {\n if (result === false)\n {\n accountservice.logMessage('Message: vox-phone-number.Save action failed, UserId: ' + vm.userId + ', Role: Operator', vm.logLevel.Warn);\n }\n });\n }\n else if (vm.currentRole === constants.Interpreter)\n {\n return interpreterservice.setPhoneNumber(vm.phoneNumber).then(function (result) {\n if (result === false)\n {\n accountservice.logMessage('Message: vox-phone-number.Save action failed, UserId: ' + vm.userId + ', Role: Interpreter', vm.logLevel.Warn);\n }\n });\n }\n else if (vm.currentRole === constants.Monitor)\n {\n return monitorservice.setPhoneNumber(vm.phoneNumber).then(function (result) {\n if (result === false)\n {\n accountservice.logMessage('Message: phoneChanged action failed, UserId: ' + vm.userId + ', Role: Monitor', vm.logLevel.Warn);\n }\n });\n }\n else\n {\n accountservice.logMessage('Message: vox-phone-number.Save, Unable to fetch roles action failed, UserId: ' + vm.userId + ', Role: None', vm.logLevel.Warn);\n }\n }\n\n function resetClicked() {\n if (vm.personStatus === enums.PersonStatusNames.InCall || vm.personStatus === enums.PersonStatusNames.Reconnect)\n {\n return;\n }\n vm.currentRole = $cookies.get(constants.userRole);\n vm.phoneNumber = vm.defaultNumber;\n if (vm.currentRole === constants.Operator)\n {\n operatorservice.setPhoneNumber(vm.phoneNumber).then(function (data) {\n if (data === false)\n {\n accountservice.logMessage('Message: resetClicked action failed, UserId:' + vm.person.Id, vm.logLevel.Warn);\n }\n });\n }\n else if (vm.currentRole === constants.Interpreter)\n {\n interpreterservice.setPhoneNumber(vm.phoneNumber);\n }\n else if (vm.currentRole === constants.Monitor)\n {\n monitorservice.setPhoneNumber(vm.phoneNumber);\n }\n vm.isTemporaryPhonenumber = false;\n }\n\n function initValidationTimeoutDuration() {\n vm.validationTimeoutDuration = 1200;\n appsettingsservice.getAppSetting('Portal_PhoneValidationDelayMilliseconds', vm.validationTimeoutDuration).then(function (data) {\n vm.validationTimeoutDuration = data;\n });\n }\n\n function getInvalidErrorMessage(countryName, phoneNumber) {\n var errorMessage = 'This phone number is not valid';\n if (countryName === 'USA')\n {\n countryName = isPuertoRico(phoneNumber) ? 'Puerto Rico' : 'the USA';\n }\n errorMessage += (countryName ? (' in ' + countryName) : '.');\n\n return errorMessage;\n }\n\n function getPremiumRateNumbersNotEnabledMessage() {\n return 'Premium rate phone numbers are not callable';\n }\n\n function getNotAllowedErrorMessage(countryName, phoneNumber) {\n var errorMessage = 'Phone numbers in x are not allowed.';\n var replaceText = countryName ? countryName : 'this country';\n replaceText = (countryName === 'USA' && isPuertoRico(phoneNumber)) ? 'Puerto Rico' : replaceText;\n errorMessage = errorMessage.replace('x', replaceText);\n accountservice.logMessage('vox - phone - number.getNotAllowedErrorMessage NotAllowedErrorMessage: ' + errorMessage, ' PhoneNumber: ' + phoneNumber, vm.logLevel.Info);\n return errorMessage;\n }\n\n function isPuertoRico(phoneNumber) {\n if (phoneNumber !== undefined)\n {\n return phoneNumber.startsWith('+1787') || phoneNumber.startsWith('+1939');\n }\n }\n\n function getDenyMobileUseErrorMessage() {\n return 'Mobile devices are not allowed. Please set the phone number to a valid landline.';\n }\n\n function countryDisabled() {\n\n // SuperUsers have no restrictions\n if (vm.roles && (vm.roles.indexOf('SuperUser') >= 0))\n {\n return false;\n }\n\n if (vm.userCountryName && (vm.userCountryName !== 'USA'))\n {\n return false;\n }\n\n return true;\n }\n\n function parse() {\n if ((vm.phoneNumber !== undefined) && (vm.phoneNumber.length > 0))\n {\n var phoneNumberNoPlus = vm.phoneNumber.replace('+', '');\n\n var firstFour = phoneNumberNoPlus.substr(0, 4);\n\n if (countryCodes[firstFour] !== undefined)\n {\n vm.country = firstFour;\n vm.number = phoneNumberNoPlus.substr(4);\n vm.phoneCountryName = countryCodes[firstFour];\n return;\n }\n\n var firstThree = phoneNumberNoPlus.substr(0, 3);\n\n if (countryCodes[firstThree] !== undefined)\n {\n vm.country = firstThree;\n vm.number = phoneNumberNoPlus.substr(3);\n vm.phoneCountryName = countryCodes[firstThree];\n return;\n }\n\n var firstTwo = phoneNumberNoPlus.substr(0, 2);\n\n if (countryCodes[firstTwo] !== undefined)\n {\n vm.country = firstTwo;\n vm.number = phoneNumberNoPlus.substr(2);\n vm.phoneCountryName = countryCodes[firstTwo];\n return;\n }\n\n var firstOne = phoneNumberNoPlus.substr(0, 1);\n\n if (countryCodes[firstOne] !== undefined)\n {\n vm.country = firstOne;\n vm.number = phoneNumberNoPlus.substr(1);\n vm.phoneCountryName = countryCodes[firstOne];\n }\n } else\n {\n vm.country = '1';\n vm.number = undefined;\n vm.phoneCountryName = countryCodes[1];\n }\n }\n\n function phoneErrorMessageChanged(message, setUserStatus) {\n $rootScope.$broadcast(enums.Events.PhoneErrorMessageChanged, { message: message, setUserStatus: setUserStatus });\n }\n\n function isPremiumRatePhoneNumber(phoneNumber) {\n return vm.premiumRatePhoneNumberPrefixes\n .map(function (prefix) { return phoneNumber.startsWith(prefix); })\n .some(function (res) { return res; });\n }\n\n var countryCodes = {\n '1': 'USA',\n '213': 'Algeria',\n '376': 'Andorra',\n '244': 'Angola',\n '1264': 'Anguilla',\n '1268': 'Antigua & Barbuda',\n '54': 'Argentina',\n '374': 'Armenia',\n '297': 'Aruba',\n '61': 'Australia',\n '43': 'Austria',\n '994': 'Azerbaijan',\n '1242': 'Bahamas',\n '973': 'Bahrain',\n '880': 'Bangladesh',\n '1246': 'Barbados',\n '375': 'Belarus',\n '32': 'Belgium',\n '501': 'Belize',\n '229': 'Benin',\n '1441': 'Bermuda',\n '975': 'Bhutan',\n '591': 'Bolivia',\n '387': 'Bosnia Herzegovina',\n '267': 'Botswana',\n '55': 'Brazil',\n '673': 'Brunei',\n '359': 'Bulgaria',\n '226': 'Burkina Faso',\n '257': 'Burundi',\n '855': 'Cambodia',\n '237': 'Cameroon',\n '238': 'Cape Verde Islands',\n '1345': 'Cayman Islands',\n '236': 'Central African Republic',\n '56': 'Chile',\n '86': 'China',\n '57': 'Colombia',\n '269': 'Comoros',\n '242': 'Congo',\n '682': 'Cook Islands',\n '506': 'Costa Rica',\n '385': 'Croatia',\n '53': 'Cuba',\n '90392': 'Cyprus North',\n '357': 'Cyprus South',\n '42': 'Czech Republic',\n '45': 'Denmark',\n '253': 'Djibouti',\n '1809': 'Dominican Republic',\n '593': 'Ecuador',\n '20': 'Egypt',\n '503': 'El Salvador',\n '240': 'Equatorial Guinea',\n '291': 'Eritrea',\n '372': 'Estonia',\n '251': 'Ethiopia',\n '500': 'Falkland Islands',\n '298': 'Faroe Islands',\n '679': 'Fiji',\n '358': 'Finland',\n '33': 'France',\n '594': 'French Guiana',\n '689': 'French Polynesia',\n '241': 'Gabon',\n '220': 'Gambia',\n '7880': 'Georgia',\n '49': 'Germany',\n '233': 'Ghana',\n '350': 'Gibraltar',\n '30': 'Greece',\n '299': 'Greenland',\n '1473': 'Grenada',\n '590': 'Guadeloupe',\n '671': 'Guam',\n '502': 'Guatemala',\n '224': 'Guinea',\n '245': 'Guinea - Bissau',\n '592': 'Guyana',\n '509': 'Haiti',\n '504': 'Honduras',\n '852': 'Hong Kong',\n '36': 'Hungary',\n '354': 'Iceland',\n '91': 'India',\n '62': 'Indonesia',\n '98': 'Iran',\n '964': 'Iraq',\n '353': 'Ireland',\n '972': 'Israel',\n '39': 'Italy',\n '1876': 'Jamaica',\n '81': 'Japan',\n '962': 'Jordan',\n '7': 'Kazakhstan',\n '254': 'Kenya',\n '686': 'Kiribati',\n '850': 'Korea North',\n '82': 'Korea South',\n '965': 'Kuwait',\n '996': 'Kyrgyzstan',\n '856': 'Laos',\n '371': 'Latvia',\n '961': 'Lebanon',\n '266': 'Lesotho',\n '231': 'Liberia',\n '218': 'Libya',\n '417': 'Liechtenstein',\n '370': 'Lithuania',\n '352': 'Luxembourg',\n '853': 'Macao',\n '389': 'Macedonia',\n '261': 'Madagascar',\n '265': 'Malawi',\n '60': 'Malaysia',\n '960': 'Maldives',\n '223': 'Mali',\n '356': 'Malta',\n '692': 'Marshall Islands',\n '596': 'Martinique',\n '222': 'Mauritania',\n '52': 'Mexico',\n '691': 'Micronesia',\n '373': 'Moldova',\n '377': 'Monaco',\n '976': 'Mongolia',\n '1664': 'Montserrat',\n '212': 'Morocco',\n '258': 'Mozambique',\n '95': 'Myanmar',\n '264': 'Namibia',\n '674': 'Nauru',\n '977': 'Nepal',\n '31': 'Netherlands',\n '687': 'New Caledonia',\n '64': 'New Zealand',\n '505': 'Nicaragua',\n '227': 'Niger',\n '234': 'Nigeria',\n '683': 'Niue',\n '672': 'Norfolk Islands',\n '670': 'Northern Marianas',\n '47': 'Norway',\n '968': 'Oman',\n '680': 'Palau',\n '507': 'Panama',\n '675': 'Papua New Guinea',\n '595': 'Paraguay',\n '51': 'Peru',\n '63': 'Philippines',\n '48': 'Poland',\n '351': 'Portugal',\n //'1787': 'Puerto Rico',\n '974': 'Qatar',\n '262': 'Reunion',\n '40': 'Romania',\n '250': 'Rwanda',\n '378': 'San Marino',\n '239': 'Sao Tome & Principe',\n '966': 'Saudi Arabia',\n '221': 'Senegal',\n '381': 'Serbia',\n '248': 'Seychelles',\n '232': 'Sierra Leone',\n '65': 'Singapore',\n '421': 'Slovak Republic',\n '386': 'Slovenia',\n '677': 'Solomon Islands',\n '252': 'Somalia',\n '27': 'South Africa',\n '34': 'Spain',\n '94': 'Sri Lanka',\n '290': 'St. Helena',\n '1869': 'St. Kitts',\n '1758': 'St. Lucia',\n '249': 'Sudan',\n '597': 'Suriname',\n '268': 'Swaziland',\n '46': 'Sweden',\n '41': 'Switzerland',\n '963': 'Syria',\n '886': 'Taiwan',\n '66': 'Thailand',\n '228': 'Togo',\n '676': 'Tonga',\n '1868': 'Trinidad & Tobago',\n '216': 'Tunisia',\n '90': 'Turkey',\n '993': 'Turkmenistan',\n '1649': 'Turks & Caicos Islands',\n '688': 'Tuvalu',\n '256': 'Uganda',\n '44': 'UK',\n '380': 'Ukraine',\n '971': 'United Arab Emirates',\n '598': 'Uruguay',\n '678': 'Vanuatu',\n '379': 'Vatican City',\n '58': 'Venezuela',\n '84': 'Vietnam',\n '1284': 'Virgin Islands - British',\n '1340': 'Virgin Islands - US',\n '681': 'Wallis & Futuna',\n '969': 'Yemen',\n '967': 'Yemen',\n '260': 'Zambia',\n '263': 'Zimbabwe'\n };\n }\n})();\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.widgets')\r\n .directive('voxParticipants', voxParticipants);\r\n\r\n function voxParticipants() {\r\n var directive = {\r\n bindToController: true,\r\n controller: ParticipantsController,\r\n controllerAs: 'vm',\r\n replace: true,\r\n restrict: 'E',\r\n scope: {\r\n 'currentCall': '=',\r\n 'interpreter': '=',\r\n 'operator': '=',\r\n 'customer': '='\r\n },\r\n link: function postLink(scope, element, args, vm) {\r\n var participantWatch = scope.$watch('vm.participants', function (newVal, oldVal) {\r\n if (newVal !== undefined) {\r\n scope.vm.buildParticipants();\r\n }\r\n });\r\n\r\n scope.$on('$destroy', function () {\r\n participantWatch();\r\n });\r\n },\r\n templateUrl: 'app/widgets/vox-participants.html'\r\n };\r\n\r\n return directive;\r\n }\r\n\r\n ParticipantsController.$inject = ['$scope', 'interpreterservice', 'logger', 'session', 'interpretersignalreceiver', 'operatorservice', 'operatorsignalreceiver', 'accountservice', 'enums',\r\n 'stringResources'];\r\n /* @ngInject */\r\n function ParticipantsController($scope, interpreterservice, logger, session, interpretersignalreceiver, operatorservice, operatorsignalreceiver, accountservice, enums,\r\n stringResources) {\r\n var vm = this;\r\n vm.phoneErrorMessage = undefined;\r\n vm.phoneIsValidating = false;\r\n vm.participants = angular.copy(vm.currentCall.Participants);\r\n vm.logLevel = enums.LogLevel;\r\n vm.thirdPartyMessage = false;\n vm.callCenterMessage = false;\n vm.isAddParticipantClick = false;\r\n vm.buildParticipants = buildParticipants;\r\n\r\n vm.newParticipantPhoneNumber = '';\r\n vm.addParticipant = addParticipant;\r\n vm.removeParticipant = removeParticipant;\r\n vm.roles = session.roles;\r\n vm.isDisabled = isDisabled;\r\n\r\n $scope.$on(interpretersignalreceiver.thirdPartyStatusEvent, thirdPartyStatusEvent);\r\n $scope.$on(operatorsignalreceiver.thirdPartyStatusEvent, thirdPartyStatusEvent);\n\n $scope.$on(interpretersignalreceiver.callCenterStatusEvent, callCenterStatusEvent);\r\n $scope.$on(operatorsignalreceiver.callCenterStatusEvent, callCenterStatusEvent);\r\n\r\n function addParticipant() {\n vm.isAddParticipantClick = true;\r\n vm.thirdPartyMessage = false;\n var phoneNumber = vm.newParticipantPhoneNumber;\n var callId = vm.currentCall.CallId;\n\n //Check phone number is present in ParticipantList\n if (isPhoneNumberAlreadyPresent(phoneNumber) === true) {\r\n vm.isAddParticipantClick = false;\n return;\r\n }\r\n \r\n if (vm.interpreter !== undefined) {\r\n interpreterservice.addParticipant(callId, phoneNumber).then(function (participantId) {\r\n if (participantId !== '') {\r\n vm.participants.push({\r\n ParticipantId: participantId,\r\n PhoneNumber: phoneNumber,\r\n Status: 'ThirdPartyRinging',\r\n Name: undefined\r\n });\r\n logger.info('Participant added to conference');\r\n vm.newParticipantPhoneNumber = '';\n vm.isAddParticipantClick = false;\r\n }\r\n else {\r\n accountservice.logMessage('add Participant Action Failed. CallId: ' + callId, vm.logLevel.Warn);\r\n }\r\n });\r\n }\r\n else {\r\n operatorservice.addParticipant(callId, phoneNumber).then(function (participantId) {\r\n if (participantId !== '') {\r\n vm.participants.push({\r\n ParticipantId: participantId,\r\n PhoneNumber: phoneNumber,\r\n Status: 'ThirdPartyRinging',\r\n Name: undefined\r\n });\r\n logger.info('Participant added to conference');\r\n vm.newParticipantPhoneNumber = '';\n vm.isAddParticipantClick = false;\r\n }\r\n else {\r\n accountservice.logMessage('vox-participants.addParticipant Action Failed|CallId:' + callId, vm.logLevel.Warn);\r\n }\r\n });\r\n }\r\n }\r\n function removeParticipant(participant) {\r\n var idx = vm.participants.indexOf(participant);\r\n if (vm.interpreter !== undefined) {\r\n interpreterservice.deleteParticipant(participant.ParticipantId, vm.currentCall.CallId).then(function (result) {\r\n if (result === true) {\r\n vm.participants.splice(idx, 1);\r\n logger.warning('Participant removed from conference');\r\n }\r\n else {\r\n accountservice.logMessage('vox-participants.removeParticipant delete Participant Action Failed by Interpreter|ParticipantId:' + participant.ParticipantId, vm.logLevel.Warn);\r\n }\r\n });\r\n }\r\n else {\r\n operatorservice.deleteParticipant(participant.ParticipantId, vm.currentCall.CallId).then(function (result) {\r\n if (result === true) {\r\n vm.participants.splice(idx, 1);\r\n logger.warning('Participant removed from conference');\r\n }\r\n else {\r\n accountservice.logMessage('delete Participant Action Failed by Operator. ParticipantId: ' + participant.ParticipantId, vm.logLevel.Warn);\r\n }\r\n });\r\n }\r\n }\r\n\r\n function thirdPartyStatusEvent(event, data) {\r\n if (vm.interpreter !== undefined) {\r\n $scope.$apply(function () {\r\n interpreterservice.getCurrentCall().then(function (data) {\r\n if (data !== '') {\r\n vm.currentCall = data.Call;\r\n vm.participants = angular.copy(vm.currentCall.Participants);\r\n }\r\n else {\r\n accountservice.logMessage('vox-participants.thirdPartyStatusEvent interpreterservice.getCurrentCall() Action Failed.', vm.logLevel.Warn);\r\n }\r\n });\r\n for (var i in vm.participants) {\r\n if (vm.participants[i].ParticipantId === data.participantId) {\r\n vm.participants[i].Status = data.statusName;\r\n\r\n showThirdPartyMessage(data.statusName);\r\n\r\n break;\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n $scope.$apply(function () {\r\n operatorservice.getCurrentCall().then(function (data) {\r\n if (data !== '') {\r\n vm.currentCall = data.Call;\r\n vm.participants = angular.copy(vm.currentCall.Participants);\r\n }\r\n else {\r\n accountservice.logMessage('vox-participants.thirdPartyStatusEven operatorservice.getCurrentCall Action Failed.', vm.logLevel.Warn);\r\n }\r\n });\r\n for (var i in vm.participants) {\r\n if (vm.participants[i].ParticipantId === data.participantId) {\r\n vm.participants[i].Status = data.statusName;\r\n\r\n showThirdPartyMessage(data.statusName);\r\n\r\n break;\r\n }\r\n }\r\n });\r\n }\r\n }\n\n function callCenterStatusEvent(event, data) {\r\n if (vm.interpreter !== undefined) {\r\n $scope.$apply(function () {\r\n interpreterservice.getCurrentCall().then(function (data) {\r\n if (data !== '') {\r\n vm.currentCall = data.Call;\r\n vm.participants = angular.copy(vm.currentCall.Participants);\r\n }\r\n else {\r\n accountservice.logMessage('vox-participants.callCenterStatusEvent interpreterservice.getCurrentCall Action Failed.', vm.logLevel.Warn);\r\n }\r\n });\r\n for (var i in vm.participants) {\r\n if (vm.participants[i].ParticipantId === data.participantId) {\r\n vm.participants[i].Status = data.statusName;\r\n\r\n showCallCenterMessage(data.statusName);\r\n\r\n break;\r\n }\r\n }\r\n });\r\n }\r\n else {\r\n $scope.$apply(function () {\r\n operatorservice.getCurrentCall().then(function (data) {\r\n if (data !== '') {\r\n vm.currentCall = data.Call;\r\n vm.participants = angular.copy(vm.currentCall.Participants);\r\n }\r\n else {\r\n accountservice.logMessage('vox-participants.callCenterStatusEvent operatorservice.getCurrentCall Action Failed.', vm.logLevel.Warn);\r\n }\r\n });\r\n for (var i in vm.participants) {\r\n if (vm.participants[i].ParticipantId === data.participantId) {\r\n vm.participants[i].Status = data.statusName;\r\n\r\n showCallCenterMessage(data.statusName);\r\n\r\n break;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n\r\n function isDisabled() {\r\n if (vm.newParticipantPhoneNumber === '' || vm.phoneErrorMessage !== undefined || vm.phoneIsValidating || vm.isAddParticipantClick) {\r\n return true;\r\n }\r\n return false;\r\n }\r\n\r\n function showThirdPartyMessage(thirdPartyStatus) {\r\n console.log(thirdPartyStatus);\r\n\r\n switch (thirdPartyStatus) {\r\n case 'ThirdPartyBusy':\r\n vm.thirdPartyMessage = stringResources.ThirdPartyEventMessages.ThirdPartyBusy;\r\n break;\r\n case 'ThirdPartyNoAnswer':\r\n vm.thirdPartyMessage = stringResources.ThirdPartyEventMessages.ThirdPartyNoAnswer;\r\n break;\r\n case 'ThirdPartyCanceled':\r\n vm.thirdPartyMessage = stringResources.ThirdPartyEventMessages.ThirdPartyCanceled;\r\n break;\r\n case 'ThirdPartyFailed':\r\n vm.thirdPartyMessage = stringResources.ThirdPartyEventMessages.ThirdPartyFailed;\r\n break;\r\n case 'AnsweringMachineDetected':\r\n vm.thirdPartyMessage = stringResources.ThirdPartyEventMessages.AnsweringMachineDetected;\r\n break;\n case 'PhoneNumberAlreadyAdded':\n vm.thirdPartyMessage = 'The phone number you have entered is already added before. Please try adding different number OR Remove existing number from the list.';\n break;\r\n default:\r\n vm.thirdPartyMessage = false;\r\n break;\r\n }\r\n }\n\n function showCallCenterMessage(callCenterStatus) {\r\n console.log(callCenterStatus);\r\n\r\n switch (callCenterStatus) {\r\n case 'CallCenterBusy':\r\n vm.callCenterMessage = stringResources.callCenterEventMessages.CallCenterBusy;\r\n break;\r\n case 'CallCenterNoAnswer':\r\n vm.callCenterMessage = stringResources.callCenterEventMessages.CallCenterNoAnswer;\r\n break;\r\n case 'CallCenterCanceled':\r\n vm.callCenterMessage = stringResources.callCenterEventMessages.CallCenterCanceled;\r\n break;\r\n case 'CallCenterFailed':\r\n vm.callCenterMessage = stringResources.callCenterEventMessages.CallCenterFailed;\r\n break;\r\n default:\r\n vm.callCenterMessage = false;\r\n break;\r\n }\r\n }\r\n\r\n function buildParticipants() {\r\n for (var i = vm.participants.length - 1; i >= 0; i--) {\r\n var participant = vm.participants[i];\r\n if (participant.InterpreterId && vm.interpreter && participant.InterpreterId === vm.interpreter.Id) {\r\n participant.Status = 'InterpreterConnected';\r\n participant.Name = vm.interpreter !== undefined ? vm.interpreter.Name : participant.phoneNumber;\r\n $scope.$emit('showThirdParty');\r\n } else if (participant.InterpreterId) {\r\n participant.Status = 'InterpreterConnected';\r\n participant.Name = participant.phoneNumber;\r\n $scope.$emit('showThirdParty');\r\n }\r\n else if (participant.OperatorId || participant.MonitorId) {\r\n // Remove user from participants beacuse We don't show operators or monitors in the participant list\r\n vm.participants.splice(i, 1);\r\n }\r\n else if (participant.CustomerId && vm.customer && participant.CustomerId === vm.customer.Id) {\r\n participant.Status = 'CustomerConnected';\r\n participant.Name = vm.customer.Name;\r\n $scope.$emit('showThirdParty');\r\n }\r\n //User is LEP (ClickToCall and hostedIVR flow)\r\n else if (participant.CustomerId === null && participant.ParticipantId === vm.currentCall.CallId) {\r\n participant.Status = 'LEPConnected';\r\n participant.Name = vm.customer.Name;\r\n $scope.$emit('showThirdParty');\r\n }\r\n else if (participant.IsCallCenter) {\r\n participant.Status = 'CallCenterConnected';\r\n participant.Name = vm.customer.Name;\r\n $scope.$emit('showThirdParty');\r\n }\r\n else {\r\n // Assigning ThirdPartyConnected status If we refresh the page the Status shows blank for ThirdParty participant.\r\n participant.Status = 'ThirdPartyConnected';\r\n $scope.$emit('showThirdParty');\r\n }\r\n }\r\n }\n\n function isPhoneNumberAlreadyPresent(phoneNumber) {\n for (var i = vm.participants.length - 1; i >= 0; i--) {\r\n var participant = vm.participants[i];\n if (participant.PhoneNumber === phoneNumber) {\n showThirdPartyMessage('PhoneNumberAlreadyAdded');\r\n return true;\r\n }\r\n }\n return false;\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.widgets')\r\n .directive('voxNotalkActionMenu', voxNotalkActionMenu);\r\n\r\n function voxNotalkActionMenu() {\r\n var directive = {\r\n bindToController: true,\r\n controller: NotalkActionMenuController,\r\n controllerAs: 'vm',\r\n restrict: 'E',\r\n scope: { 'person': '=' },\r\n templateUrl: 'app/widgets/vox-notalk-action-menu.html'\r\n };\r\n\r\n return directive;\r\n }\r\n\r\n NotalkActionMenuController.$inject = ['$cookies', 'constants', 'userservice', 'enums', 'callEvents', 'accountservice', 'preferences',\n 'appsettingsservice', 'usermessageservice'];\r\n function NotalkActionMenuController($cookies, constants, userservice, enums, callEvents, accountservice, preferences,\n appsettingsservice, usermessageservice) {\r\n var vm = this;\r\n vm.submitNotalkAction = submitNotalkAction;\r\n vm.getNoTalkActionMenu = getNoTalkActionMenu;\r\n vm.notalkActionOptions = undefined;\r\n vm.displaymessage = displaymessage;\r\n vm.notalkActionSelected = undefined;\n vm.submitted = false;\r\n vm.message = '';\n vm.notalkMessage = '';\r\n vm.callId = $cookies.get(constants.callId);\n vm.currentRole = $cookies.get(constants.userRole);\n\r\n getNoTalkActionMenu();\n\n appsettingsservice.getAppSetting(preferences.NoTalkActionMessage1, vm.message).then(function (data) {\r\n if (data) {\n vm.notalkMessage = data;\n appsettingsservice.getAppSetting(preferences.NoTalkActionMessage2, vm.message).then(function (data2) {\r\n if (data2) {\n vm.notalkMessage += data2;\r\n }\r\n });\r\n }\r\n });\n\r\n function getNoTalkActionMenu() {\r\n if (vm.currentRole === constants.Interpreter) {\r\n vm.notalkOptions = [\r\n { key: 1, value: 'Customer agent has put the call on hold' },\r\n { key: 2, value: 'LEP has put the call on hold/delayed the call flow' },\r\n { key: 3, value: 'Customer agent or LEP has not joined the call at all' },\r\n { key: 4, value: 'Active interpretation is ongoing, there is no silence' },\r\n { key: 5, value: 'I am having an audio or technical issue' },\n { key: 6, value: 'The LEP speaks English and I have been instructed to listen and help if needed/I am a quality monitor for this call.' }\r\n ];\r\n }\n accountservice.logMessage('vox-notalk-action-menu.getNoTalkActionMenu|CallId: ' + vm.callId + ', CurrentRole:' + vm.currentRole + ', status:' + vm.person.Status +\n 'UserId: ' + vm.person.Id, enums.LogLevel.Debug);\r\n }\r\n\r\n function submitNotalkAction() {\r\n vm.currentRole = $cookies.get(constants.userRole);\r\n vm.callId = $cookies.get(constants.callId);\r\n vm.personCurrentStatus = $cookies.get('currentStatus');\r\n if (vm.personCurrentStatus === enums.PersonStatusNames.InCall) {\r\n if (vm.currentRole === constants.Interpreter) {\r\n\r\n switch (vm.notalkActionSelected) {\r\n case 1:\r\n addCallEvent(callEvents.CustomerPutCallOnHold);\r\n break;\r\n case 2:\r\n addCallEvent(callEvents.LEPPutCallOnHoldOrDelayedCall);\r\n break;\r\n case 3:\r\n addCallEvent(callEvents.CustomerOrLEPNotJoinedCall);\r\n break;\r\n case 4:\r\n addCallEvent(callEvents.ActiveInterpretationGoingOn);\r\n break;\r\n case 5:\r\n addCallEvent(callEvents.AudioOrTechnicalIssue);\r\n break;\n case 6:\r\n addCallEvent(callEvents.QualityMonitorOnCall);\r\n break;\r\n }\r\n }\r\n }\r\n }\n\n function displaymessage() {\n switch (vm.notalkActionSelected) {\n case 1:\n case 2:\n case 3:\n case 6:\n vm.message = vm.notalkMessage;\n break;\n default:\n vm.message = '';\n break;\n }\r\n }\r\n function addCallEvent(callEvent) {\n usermessageservice.notify('notalksubmitted', { message: true, eventName: 'notalksubmitted' });\n userservice.addCallEvent(callEvent, vm.callId);\r\n accountservice.logMessage('vox-notalk-action-menu.submit|CallId: ' + vm.callId + ', No-Talk action selected option: ' +\r\n callEvent, enums.LogLevel.Debug);\r\n vm.notalkActionSelected = undefined;\r\n vm.notalkActionOptions = undefined;\n vm.message = '';\n vm.submitted = true;\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.widgets')\r\n .directive('voxMetaData', voxMetaData);\r\n\r\n /* @ngInject */\r\n function voxMetaData() {\r\n var directive = {\r\n bindToController: true,\r\n controller: MetaDataController,\r\n controllerAs: 'vm',\r\n replace: true,\r\n restrict: 'E',\r\n scope: {\r\n 'userId': '='\r\n },\r\n templateUrl: 'app/widgets/vox-meta-data.html'\r\n };\r\n return directive;\r\n }\r\n\r\n MetaDataController.$inject = ['$scope', 'accountservice', 'callEvents', 'enums', 'session', 'usermessageservice', 'userservice', '$interval', 'preferences', 'appsettingsservice'];\r\n /* @ngInject */\r\n function MetaDataController($scope, accountservice, callEvents, enums, session, usermessageservice, userservice, $interval, preferences, appsettingsservice) {\r\n var vm = this;\r\n\r\n vm.callId = undefined;\r\n vm.logLevel = enums.LogLevel;\r\n vm.metaData = undefined;\r\n vm.metadataCopy = undefined;\r\n vm.interpreter = undefined;\r\n vm.operator = undefined;\r\n vm.roles = session.roles;\r\n\r\n vm.metadataChanged = metadataChanged;\r\n vm.showMetadata = showMetadata;\r\n vm.showMetadataItem = showMetadataItem;\r\n vm.editMetadataItem = editMetadataItem;\r\n vm.showOrEditMetadata = showOrEditMetadata;\r\n vm.showUpdateMessage = false;\r\n vm.showSaveMessage = false;\r\n vm.save = save;\r\n vm.reset = reset;\n vm.handlePattern = handlePattern;\n vm.validateMetadata = 'false';\n\n appsettingsservice.getAppSetting(preferences.ValidateMetadata, 'false').then(function (data) {\r\n vm.validateMetadata = data;\r\n });\r\n\r\n usermessageservice.subscribe($scope, 'notify', function (event, data) {\r\n if (data.eventName === 'metadataDetails') {\r\n vm.callId = data.callId;\r\n vm.metadata = [];\r\n if (!data.metadata) {\r\n return;\r\n }\r\n for (var i = 0; i < data.metadata.length; i++) {\r\n var item = data.metadata[i];\r\n if (showMetadataItem(item)) {\r\n vm.metadata.push(item);\r\n }\r\n }\r\n vm.metadataCopy = angular.copy(vm.metadata);\r\n }\r\n });\r\n\r\n vm.interpreter = vm.roles.indexOf('Interpreter') >= 0;\r\n vm.operator = vm.roles.indexOf('Operator') >= 0;\r\n\n function handlePattern(index) {\n var nameRegex = '';\n\n if (vm.validateMetadata !== 'true') {\r\n return;\r\n }\n\n if (!vm.metadata || !vm.metadata[index]) {\r\n return;\r\n }\n\n if (vm.metadata[index].Label === 'Reference Number' || vm.metadata[index].Label === 'Numeric Number') {\r\n \n if (vm.metadata[index].AllowedCharacters) {\r\n nameRegex = vm.metadata[index].AllowedCharacters;\r\n }\n else if (vm.metadata[index].Length) {\n nameRegex = '^[a-zA-Z0-9\\_\\-]{' + vm.metadata[index].Length + '}$';\r\n }\n\n return nameRegex;\n\r\n } else {\n return;\r\n }\r\n }\n\r\n // Only show the Metadata Details UI if the user is allowed to view at least 1 metadata item\r\n function showMetadata() {\r\n\r\n if (vm.metadata) {\r\n for (var i = 0; i < vm.metadata.length; i++) {\r\n if (showMetadataItem(vm.metadata[i])) {\r\n return true;\r\n }\r\n }\r\n }\r\n\r\n return false;\r\n }\r\n\r\n // Only show the Metadata Items the user is allowed to view\r\n function showMetadataItem(metadataItem) {\r\n if (metadataItem) {\r\n return showOrEditMetadata(metadataItem.Visible);\r\n }\r\n\r\n return false;\r\n }\r\n\r\n function editMetadataItem(metadataItem) {\r\n if (metadataItem) {\r\n return showOrEditMetadata(metadataItem.Editable);\r\n }\r\n\r\n return false;\r\n }\r\n\r\n function save(index) {\r\n vm.showUpdateMessage = false;\r\n var updatedMetadata = [vm.metadata[index]];\r\n userservice.setMetadata(vm.callId, updatedMetadata).then(function (result) {\r\n if (result === false) {\r\n accountservice.logMessage('metadataChanged Action Failed|CallId: ' + vm.callId, vm.logLevel.Warn);\r\n } else {\r\n vm.showSaveMessage = true;\r\n }\r\n vm.oldValue = vm.metadataCopy[index].AnswerText;\r\n userservice.addCallEvent(callEvents.MetadataAnswerChanged, vm.callId, vm.oldValue);\r\n vm.metadataCopy = angular.copy(vm.metadata);\r\n\r\n $interval(function() {\r\n vm.showSaveMessage = false;\r\n }, 2000);\r\n });\r\n }\r\n\r\n function reset(index) {\r\n vm.showUpdateMessage = false;\r\n if (!vm.metadata || !vm.metadata[index]) {\r\n return;\r\n }\r\n vm.metadata[index].AnswerText = vm.metadataCopy[index].AnswerText;\r\n }\r\n\r\n function metadataChanged(index) {\r\n if (!vm.metadata || !vm.metadata[index]) {\r\n return;\r\n }\n\r\n if (vm.metadata[index].AnswerText === vm.metadataCopy[index].AnswerText) {\r\n vm.showUpdateMessage = false;\r\n } else {\n vm.showUpdateMessage = true;\r\n }\r\n }\r\n\r\n //This filter is for to show the Metadata Items the user is allowed to view\r\n $scope.visible = function (metadataItem) {\r\n return showMetadataItem(metadataItem);\r\n };\r\n\r\n function showOrEditMetadata(value) {\r\n var result = false;\r\n\r\n switch (value) {\r\n case 1:\r\n if (vm.operator) {\r\n result = true;\r\n }\r\n break;\r\n case 2:\r\n if (vm.interpreter) {\r\n result = true;\r\n }\r\n break;\r\n case 3:\r\n result = true;\r\n break;\r\n }\r\n\r\n return result;\r\n }\r\n }\r\n})();\r\n\n(function () {\n 'use strict';\n\n angular\n .module('vox-leonis.widgets')\n .directive('voxDispositionMenu', voxDispositionMenu);\n\n function voxDispositionMenu() {\n var directive = {\n bindToController: true,\n controller: DispositionMenuController,\n controllerAs: 'vm',\n restrict: 'E',\n scope: { 'person': '=' },\n templateUrl: 'app/widgets/vox-disposition-menu.html'\n };\n\n return directive;\n }\n\n DispositionMenuController.$inject = ['$cookies', 'constants', 'userservice', 'preferences', 'appsettingsservice', '$interval', 'interpreterservice', 'enums', 'callEvents',\n 'usermessageservice', 'accountservice', 'operatorservice'];\n function DispositionMenuController($cookies, constants, userservice, preferences, appsettingsservice, $interval, interpreterservice, enums, callEvents,\n usermessageservice, accountservice, operatorservice) {\n var vm = this;\n vm.showDisposition = showDisposition;\n vm.submitDisposition = submitDisposition;\n vm.getDispositionMenu = getDispositionMenu;\n vm.startTimer = startTimer;\n vm.stopTimer = stopTimer;\n vm.dispositionOptions = undefined;\n vm.countDown = 10;\n var submitTimer = 0;\n vm.dispositionSelected = undefined;\n vm.comment = undefined;\n vm.callId = $cookies.get(constants.callId);\n vm.currentRole = $cookies.get(constants.userRole);\n var commentMaxLength = '500';\n var callDispositionTimeout = 10;\n\n //this function run when page first time loads so clear so clear timer if\n if (submitTimer !== 0)\n {\n $interval.cancel(submitTimer);\n submitTimer = 0;\n }\n getDispositionMenu();\n\n showDisposition();\n\n appsettingsservice.getAppSetting(preferences.GetCallDispositionMenuTimeOutSeconds, callDispositionTimeout).then(function (data) {\n callDispositionTimeout = data;\n vm.countDown = callDispositionTimeout;\n });\n appsettingsservice.getAppSetting(preferences.DispositionMaxAllowedChars, commentMaxLength).then(function (data) {\n commentMaxLength = data;\n vm.maxLength = commentMaxLength;\n });\n\n function getDispositionMenu() {\n if (vm.currentRole === constants.Interpreter)\n {\n vm.dispositionOptions = [\n { key: 1, value: 'Successful Call' },\n { key: 2, value: 'Audio Loss / Can’t Hear' },\n { key: 3, value: 'No Customer / Only LEP' },\n { key: 4, value: 'Wrong language selected' },\n { key: 5, value: 'Other' }\n ];\n }\n else if (vm.currentRole === constants.Operator) {\n vm.dispositionOptions = [\n { key: 1, value: 'No Interpreter Available' },\n { key: 2, value: 'Cancelled Call' }\n ];\n }\n accountservice.logMessage('vox-disposition-menu.getDispositionMenu|CallId: ' + vm.callId + ', CurrentRole:' + vm.currentRole + ', status:' + vm.person.Status , enums.LogLevel.Debug);\n }\n\n function showDisposition() {\n if (submitTimer === 0) {\n vm.countDown = callDispositionTimeout;\n startTimer();\n accountservice.logMessage('vox-disposition-menu.StartTimer|CallId: ' + vm.callId + ', CountdownTime:' + vm.countDown + ', submitTimer:' + submitTimer, enums.LogLevel.Debug);\n }\n }\n\n function startTimer() {\n submitTimer = $interval(function () {\n vm.countDown--;\n if (vm.countDown <= 0) {\n submitDisposition();\n }\n }, 1000);\n }\n\n function stopTimer() {\n if (submitTimer) {\n $interval.cancel(submitTimer);\n }\n }\n\n function submitDisposition() {\n $interval.cancel(submitTimer);\n submitTimer = 0;\n vm.currentRole = $cookies.get(constants.userRole);\n vm.callId = $cookies.get(constants.callId);\n vm.personCurrentStatus = $cookies.get('currentStatus');\n usermessageservice.notify('notify', { eventName: 'disableHangupButton', message: false });\n if (vm.personCurrentStatus === enums.PersonStatusNames.AfterCallWork) {\n if (vm.currentRole === constants.Interpreter) {\n interpreterservice.setStatus(enums.PersonStatusNames.Available, '0').then(function (data) {\n //update cookie\n $cookies.put('currentStatus', enums.PersonStatusNames.Available);\n usermessageservice.notify('notify', { eventName: 'currentStatus', statusName: enums.PersonStatusNames.Available });\n //while submit the disposition make sure we stop playing disposition menu on phone kill interpreters call.\n userservice.disconnectCall(vm.callId).then(function (data) {\n accountservice.logMessage('vox-disposition-menu.submitDisposition|CallId: ' + vm.callId + ', Hangup Interpreters call' + data, enums.LogLevel.Debug);\n });\n switch (vm.dispositionSelected) {\n case 1:\n addCallEvent(callEvents.DispositionMenuCallWasSuccessfull);\n break;\n case 2:\n addCallEvent(callEvents.DispositionMenuAudioLossAndOrCantHear);\n break;\n case 3:\n addCallEvent(callEvents.DispositionMenuNoCustomerAndOrOnlyLEP);\n break;\n case 4:\n addCallEvent(callEvents.DispositionMenuWrongLanguageSelected);\n break;\n case 5:\n addCallEvent(callEvents.DispositionMenuOther);\n break;\n default:\n addCallEvent(callEvents.NoDispositionOptionSelected);\n break;\n }\n });\n }\n else if (vm.currentRole === constants.Operator) {\n operatorservice.setStatus(enums.PersonStatusNames.Available, '0').then(function (data) {\n switch (vm.dispositionSelected) {\n case 1:\n addCallEvent(callEvents.NoInterpreter);\n break;\n case 2:\n addCallEvent(callEvents.CancelledCall);\n break;\n default:\n addCallEvent(callEvents.NoDispositionOptionSelected);\n break;\n }\n });\n }\n }\n }\n\n function addCallEvent(callEvent) {\n userservice.addCallEvent(callEvent, vm.callId, vm.comment);\n accountservice.logMessage('vox-disposition-menu.submitDisposition|CallId: ' + vm.callId + ', Disposition selected option: ' +\n callEvent, enums.LogLevel.Debug);\n\n vm.dispositionSelected = undefined;\n $cookies.put(constants.callId, undefined);\n $cookies.put(constants.customerName, undefined);\n vm.comment = undefined;\n vm.dispositionOptions = undefined;\n //Fail Safe\n vm.person.Status = enums.PersonStatusNames.Available;\n }\n }\n})();\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.widgets')\r\n .directive('voxCountup', voxCountup);\r\n\r\n /* @ngInject */\r\n function voxCountup() {\r\n var directive = {\r\n bindToController: true,\r\n controller: CountupController,\r\n controllerAs: 'vm',\r\n restrict: 'E',\r\n scope: {\r\n 'startDateTime': '=',\r\n 'alternateDateTime': '=',\r\n 'hideDays': '=',\r\n 'thresholds': '<',\r\n 'callId': '=',\r\n 'interpreterId': '='\r\n },\r\n templateUrl: 'app/widgets/vox-countup.html',\r\n link: function link(scope, element, attrs, vm) {\r\n scope.$on('$destroy', function () {\r\n vm.toggle(false);\r\n });\r\n }\r\n };\r\n\r\n return directive;\r\n }\r\n\r\n CountupController.$inject = ['$interval', '$scope', 'accountservice', 'appsettingsservice', 'enums', 'utilities'];\r\n /* @ngInject */\r\n function CountupController($interval, $scope, accountservice, appsettingsservice, enums, utilities) {\r\n var vm = this;\r\n\r\n vm.toggle = toggle;\r\n vm.timeDisplay = getTimeDisplay();\r\n\r\n var interval;\r\n toggle(true);\r\n\r\n function toggle(run) {\r\n if (run && interval === undefined) {\r\n interval = $interval(function () {\r\n // digest just this directive\r\n vm.timeDisplay = getTimeDisplay();\r\n $scope.$digest();\r\n }, 1000, 0, false);\r\n }\r\n else if (!run && interval !== undefined) {\r\n $interval.cancel(interval);\r\n interval = undefined;\r\n }\r\n }\r\n\n // For Interpreter Waiting time:\n // vm.startDateTime = Last Login Time\n // vm.alternateDateTime = Last Call Ended\n // For Call Duration:\n // vm.startDateTime = Call participant start time (null until joined the conference)\n // vm.aleternateDateTime = undefined\n\r\n // return hh:mm:ss string representing amount of time passed\r\n function getTimeDisplay() {\r\n var startDate = (new Date(vm.startDateTime)).getTime() || 0;\r\n var alternateDate = (new Date(vm.alternateDateTime)).getTime() || 0;\r\n // get the later of the 2 dates\r\n var dateTimeMs = Math.max(startDate, alternateDate);\r\n if (dateTimeMs <= 0) {\r\n return '';\r\n }\r\n\r\n var diffSeconds = (Date.now() - dateTimeMs) / 1000;\r\n\r\n checkThresholds(diffSeconds);\r\n\r\n return utilities.convertSecondsToDisplayString(diffSeconds, vm.hideDays);\r\n }\r\n\r\n function checkThresholds(diffSeconds) {\r\n if (!vm.thresholds) {\r\n return;\r\n }\r\n\r\n for (var i = vm.thresholds.length - 1; i >= 0; i--) {\r\n var threshold = vm.thresholds[i];\r\n\r\n if (threshold.limitInSeconds <= diffSeconds) {\r\n threshold.raise();\r\n\r\n accountservice.logMessage('vox-countup.checkThresholds|Message: ' + threshold.description +\r\n ', InterpreterId: ' + vm.interpreterId +\r\n ', CallDuration: ' + diffSeconds + ' seconds' +\r\n ', LimitInSeconds: ' + threshold.limitInSeconds +\r\n ', StartDateTime: ' + vm.startDateTime +\r\n ', AlternateDateTime: ' + vm.alternateDateTime +\r\n ', TimeDisplay: ' + vm.timeDisplay +\r\n ', CallId: ' + vm.callId, enums.LogLevel.Warn);\r\n\r\n vm.thresholds.splice(i, 1);\r\n }\r\n }\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.widgets')\r\n .directive('voxCountdown', voxCountdown);\r\n\r\n /* @ngInject */\r\n function voxCountdown() {\r\n var directive = {\r\n bindToController: true,\r\n controller: CountdownController,\r\n controllerAs: 'vm',\r\n restrict: 'E',\r\n scope: {\r\n 'seconds': '=',\r\n 'started': '='\r\n },\r\n templateUrl: 'app/widgets/vox-countdown.html',\r\n link: function postLink(scope, element, attrs, vm) {\r\n var watch = scope.$watch('vm.started', function (newVal) {\r\n vm.toggle(newVal);\r\n });\r\n\r\n scope.$on('$destroy', function () {\r\n watch();\r\n vm.toggle(false);\r\n });\r\n }\r\n };\r\n\r\n return directive;\r\n }\r\n\r\n CountdownController.$inject = ['$scope', '$interval'];\r\n /* @ngInject */\r\n function CountdownController($scope, $interval) {\r\n var vm = this;\r\n\r\n vm.progress = 0;\r\n vm.toggle = toggle;\r\n\r\n var stop;\r\n\r\n activate();\r\n\r\n function activate() {\r\n if (vm.started === true) {\r\n toggle(true);\r\n }\r\n }\r\n\r\n function toggle(run) {\r\n if (run && stop === undefined) {\r\n vm.progress = 1;\r\n stop = $interval(function () {\r\n vm.progress = vm.progress - (1.0 / (vm.seconds * 50.0));\r\n if (vm.progress < 0) {\r\n $scope.$emit('elapsed', { message: true });\r\n endInterval();\r\n }\r\n }, 20);\r\n }\r\n else if (!run && stop !== undefined) {\r\n endInterval();\r\n }\r\n }\r\n\r\n function endInterval() {\r\n $interval.cancel(stop);\r\n vm.progress = 0;\r\n stop = undefined;\r\n }\r\n }\r\n})();\r\n\n(function ()\r\n{\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.console', [\r\n 'vox-leonis.core'\r\n ]);\r\n})();\r\n\r\n\n(function (angular) {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.console')\r\n .directive('voxConsoleWebrtcDialpad', voxConsoleWebrtcDialpad);\n\n /* @ngInject */\r\n function voxConsoleWebrtcDialpad() {\r\n var directive = {\r\n bindToController: true,\r\n controller: ConsoleWebRtcDialpadController,\r\n controllerAs: 'vm',\n replace: true,\r\n restrict: 'E',\r\n scope: {\r\n\r\n },\r\n templateUrl: 'app/widgets/vox-console-webrtc-dialpad.html'\r\n };\r\n return directive;\r\n }\n\n ConsoleWebRtcDialpadController.$inject = ['$scope', 'twiliowebrtcservice', 'usermessageservice'];\n\n /* @ngInject */\r\n function ConsoleWebRtcDialpadController($scope, twiliowebrtcservice, usermessageservice) {\r\n\n var vm = this;\n setupMethods();\n vm.enteredDigits = '';\n\n function setupMethods() {\r\n vm.mute = mute;\n vm.unMute = unMute;\n vm.sendDigit = sendDigit;\n vm.minimize = minimize;\n vm.muteUnmute = muteUnmute;\n vm.hangUp = hangUp;\n }\n vm.muted = false;\n usermessageservice.subscribe($scope, 'dialpadMaximize', function (event, data) {\r\n vm.muted = data.dialpadMuteStatus;\r\n });\n\n usermessageservice.subscribe($scope, 'resetDialpad', function (event) {\r\n vm.muted = false;\n vm.enteredDigits = '';\r\n });\n\n function muteUnmute(muteTheMic) {\n if (muteTheMic) {\n mute();\r\n }\n else {\n unMute();\r\n }\r\n }\n function mute() {\n twiliowebrtcservice.mute();\r\n }\n function unMute() {\n twiliowebrtcservice.unmute();\r\n }\n function sendDigit(digit) {\n vm.enteredDigits = vm.enteredDigits + digit;\n twiliowebrtcservice.sendDigits(digit);\r\n }\n function minimize() {\n usermessageservice.notify('dialpadMaximize', { message: false, dialpadMuteStatus: vm.muted, digits: vm.enteredDigits });\r\n }\n function hangUp() {\n usermessageservice.notify('notify', { eventName: 'hangUp' });\n vm.muted = false;\n vm.enteredDigits = '';\r\n }\n }\n})(angular);\n\n(function (angular) {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.console')\r\n .directive('voxConsoleWebrtcDialpadMin', voxConsoleWebrtcDialpadMin);\n\n /* @ngInject */\r\n function voxConsoleWebrtcDialpadMin() {\r\n var directive = {\r\n bindToController: true,\r\n controller: ConsoleWebRtcDialpadMinController,\r\n controllerAs: 'vm',\n replace: true,\r\n restrict: 'E',\r\n scope: {\r\n\r\n },\r\n templateUrl: 'app/widgets/vox-console-webrtc-dialpad-min.html'\r\n };\r\n return directive;\r\n }\n\n ConsoleWebRtcDialpadMinController.$inject = ['$scope', '$cookies', 'enums', 'twiliowebrtcservice', 'usermessageservice', 'constants',\r\n 'interpreterservice', 'accountservice', 'appsettingsservice', 'preferences', 'operatorservice'];\n\n /* @ngInject */\r\n function ConsoleWebRtcDialpadMinController($scope, $cookies, enums, twiliowebrtcservice, usermessageservice, constants, interpreterservice,\r\n accountservice, appsettingsservice, preferences, operatorservice) {\r\n\n var vm = this;\n setupMethods();\n \n usermessageservice.subscribe($scope, 'dialpadMaximize', function (event, data) {\r\n vm.muted = data.dialpadMuteStatus;\n vm.enteredDigits = data.digits;\r\n });\n\n usermessageservice.subscribe($scope, 'resetDialpad', function (event) {\r\n vm.muted = false;\n vm.enteredDigits = '';\r\n });\n\n function setupMethods() {\n vm.maximize = maximize;\n vm.hangUp = hangUp;\n vm.muteUnmute = muteUnmute;\n }\n\n function muteUnmute(muteTheMic) {\r\n if (muteTheMic) {\r\n mute();\r\n }\r\n else {\r\n unMute();\r\n }\r\n }\n function maximize() {\n usermessageservice.notify('dialpadMaximize', { message: true, dialpadMuteStatus: vm.muted });\n }\n function mute() {\n twiliowebrtcservice.mute();\r\n }\n function unMute() {\n twiliowebrtcservice.unmute();\r\n }\n function hangUp() {\n usermessageservice.notify('notify', { eventName: 'hangUp' });\n usermessageservice.notify('resetDialpad');\r\n }\n \n }\n})(angular);\n\n(function () {\n 'use strict';\n\n angular\n .module('vox-leonis.widgets')\n .directive('voxConsoleContactMethods', voxConsoleContactMethods);\n\n function voxConsoleContactMethods() {\n var directive = {\n bindToController: true,\n controller: ConsoleContactMethodsController,\n controllerAs: 'vm',\n replace: true,\n restrict: 'E',\n scope: {\n 'person': '=',\n },\n templateUrl: 'app/widgets/vox-console-contact-methods.html'\n };\n return directive;\n }\n\n ConsoleContactMethodsController.$inject = ['$cookies', '$timeout', '$q', 'accountservice', 'userservice', 'enums', 'usermessageservice', 'twiliowebrtcservice',\n 'preferences', 'appsettingsservice'];\n\n /* @ngInject */\n function ConsoleContactMethodsController($cookies, $timeout, $q, accountservice, userservice, enums, usermessageservice, twiliowebrtcservice,\n preferences, appsettingsservice) {\n\n var vm = this;\n setupVars();\n setupMethods();\n\n function setupVars() {\n vm.browserSupportsWebRTC = undefined;\n vm.contactMethods = [];\n vm.selectedContactMethod = undefined;\n vm.logLevel = enums.LogLevel;\n vm.isDisabledByPoorLatency = false;\n vm.contactMethodsCookie = $cookies.get('UserContactMethods');\n\n appsettingsservice.getAppSetting(preferences.DisableStatusChange, vm.IsDisabledStatusChange).then(function (data) {\n vm.isDisabledByPoorLatency = data;\n });\n }\n\n function setupMethods() {\n userservice.getUserSetting('IVR_ContactMethods', '').then(function (contactMethods) {\n if (vm.contactMethodsCookie !== contactMethods) {\n vm.contactMethodsCookie = contactMethods;\n $cookies.put('UserContactMethods', vm.contactMethodsCookie);\n }\n console.log(vm.contactMethodsCookie);\n if (vm.contactMethodsCookie) {\n buildContactMethodsArray(vm.contactMethodsCookie);\n }\n else {\n buildContactMethodsArray(contactMethods);\n }\n });\n\n vm.setStatusIntoCookie = setStatusIntoCookie;\n vm.contactMethodChanged = contactMethodChanged;\n vm.contactMethodSelectDisabled = contactMethodSelectDisabled;\n vm.enums = enums;\n vm.updateContactMethod = updateContactMethod;\n vm.browserSupportsWebRTC = twiliowebrtcservice.isWebRTCSupported();\n }\n\n function buildContactMethodsArray(contactMethods) {\n var promise = contactMethods.split(',').map(function (contactMethod) {\n createContactMethodObject(+contactMethod);\n });\n $q.all(promise).then(function (values) {\n setInitialContactMethod();\n }).catch(function (e) {\n if (e.status === 401) {\n console.log('Error Fetching ContactMethods');\n }\n });\n }\n\n function createContactMethodObject(contactMethod) {\n var name;\n var faClass;\n switch (contactMethod) {\n case 1:\n name = enums.ContactMethodDesc.ReceiveViaPhone;\n faClass = 'fa-mobile';\n break;\n case 2:\n if (!vm.browserSupportsWebRTC) {\n return;\n }\n name = enums.ContactMethodDesc.ReceiveViaComputer;\n faClass = 'fa-desktop';\n break;\n default:\n return;\n }\n var contactMethodObj = { id: contactMethod, name: name, faClass: faClass };\n vm.contactMethods.push(contactMethodObj);\n return vm.contactMethods;\n }\n\n function setInitialContactMethod() {\n if (vm.contactMethods.length === 1) {\n vm.selectedContactMethod = vm.contactMethods[0];\n notifyContactMethodChange();\n }\n else {\n vm.contactMethods.some(function (contactMethod) {\n if (contactMethod.id === +vm.person.ContactMethod) {\n vm.selectedContactMethod = contactMethod;\n notifyContactMethodChange();\n return true;\n }\n return false;\n });\n }\n\n if (vm.selectedContactMethod === undefined && vm.contactMethods.length > 0) {\n vm.selectedContactMethod = vm.contactMethods[0];\n notifyContactMethodChange();\n }\n\n if (vm.selectedContactMethod) {\n if (vm.selectedContactMethod.id !== +vm.person.ContactMethod) {\n vm.person.ContactMethod = vm.selectedContactMethod.id;\n updateContactMethod(vm.person.ContactMethod);\n }\n else if (vm.selectedContactMethod.id === enums.ContactMethod.WebRTC) {\n notifyContactMethodChange();\n twiliowebrtcservice.enable();\n }\n }\n }\n\n function contactMethodChanged() {\n if (vm.selectedContactMethod) {\n vm.person.ContactMethod = vm.selectedContactMethod.id;\n updateContactMethod(vm.person.ContactMethod);\n notifyContactMethodChange();\n }\n }\n\n function updateContactMethod(contactMethodId) {\n userservice.updateContactMethod(contactMethodId).then(success).catch(fail);\n\n function success() {\n if (+vm.person.ContactMethod === enums.ContactMethod.WebRTC) {\n vm.TempPhoneNumber = vm.person.TempPhoneNumber;\n //vm.person.TempPhoneNumber = undefined;\n twiliowebrtcservice.enable();\n vm.person.Status = enums.PersonStatusNames.Available;\n vm.setStatusIntoCookie(vm.person.Status);\n vm.phoneErrorMessage = undefined;\n notifyConsoleStatus();\n } else {\n twiliowebrtcservice.disable(vm.person.Id);\n }\n }\n\n function fail(e) {\n accountservice.logMessage('voxConsoleContactMethods|Message: contactMethodChanged failed, UserId:' + vm.person.Id, vm.logLevel.Error);\n }\n }\n\n function setStatusIntoCookie(statusName) {\n $cookies.put('currentStatus', statusName);\n usermessageservice.notify('notify', { eventName: 'currentStatus', statusName: statusName });\n }\n\n function contactMethodSelectDisabled() {\n\n if (vm.isDisabledByPoorLatency && vm.person.UserStatusReason === enums.PersonStatusReason.PoorLatency) {\n return true;\n }\n\n if (vm.contactMethods.length < 2) {\n return true;\n }\n\n switch (vm.person.Status) {\n case enums.PersonStatusNames.Alerting:\n case enums.PersonStatusNames.InCall:\n case enums.PersonStatusNames.Ringing:\n case enums.PersonStatusNames.Reconnect:\n case enums.PersonStatusNames.Quarantine:\n return true;\n default:\n return false;\n }\n }\n\n function notifyContactMethodChange() {\n $cookies.put('UserlatestContactMethod', vm.selectedContactMethod.id);\n usermessageservice.notify('notify', { eventName: 'contactMethod', message: vm.selectedContactMethod });\n }\n\n function notifyConsoleStatus() {\n usermessageservice.notify('notify', { eventName: 'contactMethodChange' });\n }\n\n }\n})(angular);\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.widgets')\r\n .directive('voxConnectInterpreter', voxConnectInterpreter);\r\n\r\n /* @ngInject */\r\n function voxConnectInterpreter() {\r\n var directive = {\r\n bindToController: true,\r\n controller: ConnectInterpreterController,\r\n controllerAs: 'vm',\r\n restrict: 'E',\r\n scope: {\r\n 'callId': '=',\r\n 'languageId': '=',\r\n 'languageService': '=',\r\n 'customerId': '=',\r\n 'callParticipants': '=',\r\n 'callLanguage': '=',\r\n 'currentLanguages': '=',\r\n 'disableAllLanguageSelect': '=?',\r\n 'interpreterPoolId': '=',\n 'secondaryInterpreterPoolId': '=',\n 'thirdInterpreterPoolId': '=',\n 'fourthInterpreterPoolId': '=',\r\n 'case': '=',\r\n 'disableIfNotSelected': '=',\n 'filterOverflow': '='\r\n },\r\n link: function postLink(scope, element, args, vm) {\r\n var languageSelectWatch = scope.$watch('vm.disableAllLanguageSelect', function (newVal, oldVal) {\r\n if (newVal !== undefined) {\r\n if (vm.disableAllLanguageSelect !== undefined) {\r\n vm.disableLanguageSelect = vm.disableAllLanguageSelect;\r\n vm.disableAllConnect = vm.disableAllLanguageSelect;\r\n }\r\n }\r\n });\r\n scope.$on('$destroy', function () {\r\n languageSelectWatch();\r\n });\r\n },\r\n templateUrl: 'app/widgets/vox-connect-interpreter.html',\r\n };\r\n\r\n return directive;\r\n }\r\n\r\n ConnectInterpreterController.$inject = ['$scope', '$timeout', '$filter', 'operatorservice', 'operatorsignalreceiver',\n 'accountservice', 'enums', 'userservice', 'callEvents', 'utilities', 'preferences', 'appsettingsservice', '$cookies'];\r\n /* @ngInject */\r\n function ConnectInterpreterController($scope, $timeout, $filter, operatorservice, operatorsignalreceiver,\n accountservice, enums, userservice, callEvents, utilities, preferences, appsettingsservice, $cookies) {\r\n var vm = this;\r\n\r\n setupFunctions();\r\n setupVariables();\r\n activate();\r\n\r\n function setupFunctions() {\r\n vm.callLanguageSelect = callLanguageSelect;\r\n vm.close = close;\r\n vm.connectInterpreter = connectInterpreter;\r\n vm.connectMe = connectMe;\r\n vm.findInterpreter = findInterpreter;\r\n vm.loadStatistics = loadStatistics;\r\n vm.showInterpreterStatistics = showInterpreterStatistics;\r\n vm.logButtonShowEvent = logButtonShowEvent;\r\n vm.changeLanguageServiceSelection = changeLanguageServiceSelection;\n vm.changeGenderInterpreterSelection = changeGenderInterpreterSelection;\n vm.genderOptions = [{ 'Id': 0, 'Name': 'Connect' }, { 'Id': 1, 'Name': 'Connect to Male' }, { 'Id': 2, 'Name': 'Connect to Female' }];\r\n }\r\n\r\n function setupVariables() {\r\n vm.callingLanguageSelect = false;\r\n vm.connectingInterpreter = false;\r\n vm.connectingMe = false;\r\n vm.connectInterpreterDisabled = true;\r\n vm.disableAllLanguageSelect = false;\r\n vm.findingInterpreter = false;\r\n vm.findInterpreterSelect = undefined;\r\n vm.hasInterpreters = true;\r\n vm.inCall = false;\r\n vm.interpreterStatisticsShown = false;\r\n vm.statisticsLoading = false;\n vm.languageServiceList = vm.filterOverflow ? getLanguageServiceList() : vm.languageService;\r\n vm.languageServiceId = undefined;\r\n vm.logLevel = enums.LogLevel;\r\n vm.showErrorMessage = false;\r\n vm.errorMessage = undefined;\r\n vm.languageServiceIds = buildLanguageServiceIds(vm.languageService);\r\n vm.showLanguageSelectForScheduled = vm.case ? vm.languageServiceIds && vm.languageServiceIds.length > 0 : true;\r\n vm.showNoInterpsFoundError = false;\r\n vm.statistics = undefined;\r\n vm.LanguageSelect = getSelectedLanguageService();\r\n vm.LanguageSelectGroupId = 2;\n vm.genderSelect = getSelectedGenderInterpreter();\n \r\n }\r\n\r\n function activate() {\r\n vm.showLanguageSelect = true;\r\n setInCall();\r\n vm.hasOfflineInterpreters = true;\r\n $scope.$on(operatorsignalreceiver.callAnsweredEvent, callAnswered);\r\n $scope.$on(operatorsignalreceiver.callNotAnsweredEvent, callNotAnsweredEvent);\r\n $scope.$on(operatorsignalreceiver.languageServiceCallEndedEvent, languageServiceCallEnded);\r\n }\r\n\n function getLanguageServiceList()\n {\n var defaultList = vm.languageService;\n var lsDirect = $filter('filter')(vm.languageService, { LanguageId: vm.languageId });\n var allOther = $filter('filter')(vm.languageService, { LanguageId: null });\n defaultList = lsDirect.concat(allOther);\n return defaultList;\r\n }\n\r\n // determine whether the operator is talking to a language service for this language's buttons\r\n function setInCall() {\r\n if (vm.currentLanguages) {\r\n for (var i = 0; i < vm.currentLanguages.length; i++) {\r\n var lang = vm.currentLanguages[i];\r\n // don't enable this row's connect buttons because a connect button is already enabled on a different row\r\n if (lang.Id === vm.callLanguage) {\r\n return;\r\n }\r\n }\r\n }\r\n else if (vm.languageId !== vm.callLanguage) {\r\n // this row's language is not equal to the language on the call so don't enable the connect buttons for this row\r\n return;\r\n }\r\n\r\n if (!vm.callParticipants || !vm.callParticipants.length) {\r\n return;\r\n }\r\n\r\n for (var j = 0; j < vm.callParticipants.length; j++) {\r\n var callParticipant = vm.callParticipants[j];\r\n if (callParticipant.InterpreterId) {\r\n vm.interpreterId = callParticipant.InterpreterId;\r\n\r\n var isLanguageServiceAvailable = vm.languageServiceIds && vm.languageServiceIds.length;\r\n var indexPosition = isLanguageServiceAvailable ? vm.languageServiceIds.indexOf(callParticipant.InterpreterId) : -1;\r\n var interpreterIsInCall = callParticipant.Status === enums.PersonStatusNames.InCall;\r\n var customerIsOnHold = !!vm.callParticipants.filter(function (participant) {\r\n return participant.CustomerId && participant.Status === 'OnHold';\r\n }).length;\r\n\r\n if (indexPosition >= 0) {\r\n vm.languageServiceId = vm.languageServiceIds[indexPosition];\r\n vm.inCall = true;\r\n vm.connectInterpreterDisabled = false;\r\n vm.showLanguageSelect = false;\n vm.disableAllLanguageSelect = true;\r\n accountservice.logMessage('vox-connect-interpreter.setInCall|Message: Showing Connect Me, CallId:' + vm.callId +\r\n ', Interpreter Status: ' + callParticipant.Status + ', UserId: ' + callParticipant.InterpreterId, vm.logLevel.Debug);\r\n return;\r\n } else if (interpreterIsInCall && customerIsOnHold) {\r\n vm.connectInterpreterDisabled = false;\r\n vm.showLanguageSelect = false;\r\n vm.inCall = true;\r\n vm.disableAllLanguageSelect = true;\r\n }\r\n }\r\n else if ((callParticipant.CustomerId) && callParticipant.Status === 'OnHold') {\r\n vm.inCall = true;\r\n accountservice.logMessage('vox-connect-interpreter.setInCall|Message: Showing Connect Me, CallId: ' + vm.callId +\r\n ', Customer Status:' + callParticipant.Status + ', CustomerId: ' + callParticipant.CustomerId, vm.logLevel.Debug);\r\n }\r\n }\r\n }\r\n\r\n // Show a language service button if the language service timeout has expired for the call\r\n function checkLanguageServiceTimeout() {\r\n if (vm.callId && !vm.languageServiceId && !vm.showLanguageSelect) {\r\n operatorservice.checkLanguageServiceTimeout(vm.callId).then(function (data) {\r\n var logLevel = vm.logLevel.Info;\r\n\r\n if (data === true) {\r\n // The language service timeout has exipred for this call; show a language service button\r\n vm.showLanguageSelect = true;\r\n logLevel = vm.logLevel.Debug;\r\n }\r\n\r\n var logMessage = 'vox-connect-interpreter.checkLanguageServiceTimeout|Expired: ' + (data === true) + ', CallId: ' + vm.callId;\r\n accountservice.logMessage(logMessage, logLevel);\r\n });\r\n }\r\n }\r\n\r\n function buildLanguageServiceIds(languageService) {\r\n if (languageService) {\r\n return languageService.map(function (ids) { return ids.Id; });\r\n }\r\n return [];\r\n }\r\n\r\n function callAnswered(event, data) {\r\n var messagePart1 = 'vox-connect-interpreter.callAnswered|Message: Showing Connect Me/Connect Interpreter, LanguageId: ' + vm.languageId;\r\n var messagePart2 = ', CallLanguage: ' + vm.callLanguage + ', CallId: ' + vm.callId;\r\n var messagePart3 = ', LaguageServiceId: ' + data.interpreterId;\r\n\r\n if (vm.languageServiceIds && vm.languageServiceIds.indexOf(data.interpreterId) >= 0) {\r\n // the interpreter has answered the operator's call, make sure the operator can connect the interpreter to the customer\r\n vm.connectInterpreterDisabled = false;\n // disable connect and language service button when operator is connected LS interpreter\r\n vm.disableAllLanguageSelect = true;\r\n accountservice.logMessage(messagePart1 + messagePart2 + messagePart3, vm.logLevel.Debug);\r\n } else if (vm.languageId !== undefined && vm.callLanguage !== undefined && vm.languageId.toString() === vm.callLanguage.toString()) {\r\n vm.interpreterId = data.interpreterId;\r\n vm.inCall = true;\r\n vm.connectInterpreterDisabled = false;\r\n vm.showLanguageSelect = false;\r\n accountservice.logMessage(messagePart1 + messagePart2, vm.logLevel.Debug);\r\n }\r\n vm.findingInterpreter = false;\r\n }\r\n\r\n function callNotAnsweredEvent(event, data) {\r\n if (vm.languageId !== undefined && vm.callLanguage !== undefined && vm.languageId.toString() === vm.callLanguage.toString())\r\n {\r\n vm.disableAllLanguageSelect = false;\r\n vm.connectInterpreterDisabled = true;\r\n vm.inCall = true;\r\n //Connect the operator back to customer as the Interpreter didn't answer\r\n\r\n accountservice.logMessage('vox-connect-interpreter.callNotAnsweredEvent() |Message: log for bug 241330, before \"connectMe();\", CallId: ' + vm.callId, vm.logLevel.Trace);\r\n\r\n connectMe();\r\n\r\n accountservice.logMessage('vox-connect-interpreter.callNotAnsweredEvent() |Message: log for bug 241330, after \"connectMe();\", CallId: ' + vm.callId, vm.logLevel.Trace);\r\n\r\n vm.findingInterpreter = false;\r\n vm.errorMessage = 'Interpreter didn\\'t answer';\r\n if (data.callStatus === 'no-answer')\r\n {\r\n vm.errorMessage = 'Interpreter didn\\'t answer';\r\n }\r\n else if (data.callStatus === 'busy')\r\n {\r\n vm.errorMessage = 'Interpreter rejected the call';\r\n }\r\n else\r\n {\r\n vm.errorMessage = 'Interpreter dropped due to acceptance code verification timeout';\r\n }\r\n vm.showErrorMessage = true;\r\n accountservice.logMessage('vox-connect-interpreter.callNotAnsweredEvent|Message: Connecting back to Customer, LanguageId: ' + vm.languageId +\r\n ', CallLanguage: ' + vm.callLanguage + ', Reason: ' + data.callStatus + ', CallId: ' + vm.callId, vm.logLevel.Debug);\r\n $timeout(function () {\r\n vm.showErrorMessage = false;\r\n }, 5000);\r\n }\r\n }\r\n\r\n function languageServiceCallEnded(event, data) {\r\n if (!vm.connectInterpreterDisabled)\r\n {\r\n accountservice.logMessage('vox-connect-interpreter.languageServiceCallEnded() |Message: log for bug 241330, before \"connectMe();\", CallId: ' + vm.callId, vm.logLevel.Trace);\r\n\r\n connectMe();\r\n\r\n accountservice.logMessage('vox-connect-interpreter.languageServiceCallEnded() |Message: log for bug 241330, after \"connectMe();\", CallId: ' + vm.callId, vm.logLevel.Trace);\r\n\r\n vm.connectInterpreterDisabled = true;\n vm.disableAllLanguageSelect = false;\r\n }\r\n }\r\n // Find an interpreter\r\n function findInterpreter(genderSelect) {\r\n\r\n vm.connectInterpreterDisabled = true;\r\n vm.disableAllLanguageSelect = true;\r\n vm.findingInterpreter = true;\r\n vm.inCall = false;\r\n vm.showLanguageSelect = true;\r\n vm.showNoInterpsFoundError = false;\r\n vm.callLanguage = vm.languageId;\r\n accountservice.logMessage('vox-connect-interpreter.findInterpreter|Message: Enter, hasInterpreters: ' + vm.hasInterpreters +\r\n ', hasOfflineInterpreters: ' + vm.hasOfflineInterpreters + ', CallId: ' + vm.callId + ', GenderId: ' + genderSelect.Id, vm.logLevel.Info);\r\n\r\n checkWorkingResourceRequest();\r\n // log event connect button click\r\n userservice.addCallEvent(callEvents.ConnectButtonClicked, vm.callId);\n // log event when gender specific option is slected\n addGenderSpecificEvent(genderSelect, vm.callId);\n\r\n operatorservice.findInterpreterwithGender(vm.languageId, vm.callId, genderSelect.Id).then(function (data) {\r\n if (data === false) {\r\n accountservice.logMessage('vox-connect-interpreter.findInterpreter|Message: No interpreters found, CallId: ' + vm.callId, vm.logLevel.Debug);\r\n\r\n // log event connect button click failed\r\n userservice.addCallEvent(callEvents.ConnectClickFailedNoInterpreters, vm.callId);\r\n\r\n showInterpreterStatistics();\r\n\r\n // Update the UI based on the failure to find an interpreter\r\n vm.showLanguageSelect = vm.languageServiceIds && vm.languageServiceIds.length > 0;\r\n vm.showNoInterpsFoundError = true;\r\n vm.disableAllLanguageSelect = false;\r\n // Make the error disappear after 5 seconds\r\n $timeout(function() {\r\n vm.showNoInterpsFoundError = false;\r\n }, 5000);\r\n vm.findingInterpreter = false;\r\n } else {\r\n setInCall();\r\n }\r\n }).finally(function (e) {\r\n accountservice.logMessage('vox-connect-interpreter.findInterpreter|Message: Exit, CallId: ' + vm.callId, vm.logLevel.Info);\r\n });\r\n }\r\n\r\n // call the Language Select operator\r\n function callLanguageSelect(languageSelect) {\r\n vm.LanguageSelect = { GroupId: languageSelect.GroupId, Name: languageSelect.Name };\r\n vm.callingLanguageSelect = true;\r\n // log event Language select click button\r\n userservice.addCallEvent(callEvents.LSButtonClicked, vm.callId);\r\n\r\n accountservice.logMessage('vox-connect-interpreter.callLanguageSelect|Message: LS button clicked, CallId:' + vm.callId +\r\n ', LanguageId:' + vm.languageId + ', CustomerId:' + vm.customerId +\r\n ', LanguageServiceSelect:' + vm.LanguageSelect.GroupId, vm.logLevel.Trace);\r\n\r\n //Disable Rest of the LanguageSelect and Connect buttons\r\n vm.disableAllLanguageSelect = true;\r\n operatorservice.getLanguageServiceUsersByGroup(vm.languageId, vm.customerId, vm.LanguageSelect.GroupId).then(function (data) {\r\n if (data !== '' && data.length > 0) {\r\n vm.languageServiceId = data[0];\r\n if (vm.languageServiceId) {\r\n vm.showNoInterpsFoundError = false;\r\n operatorservice.callLanguageService(vm.callId, vm.languageServiceId, vm.languageId).then(function (data) {\r\n accountservice.logMessage('vox-connect-interpreter.callLanguageSelect|Message: Entered Method, CallId:' + vm.callId +\r\n ', LanguageId:' + vm.languageId + ', CustomerId:' + vm.customerId +\r\n ', LanguageServiceId:' + vm.languageServiceId, vm.logLevel.Trace);\r\n\r\n vm.callLanguage = vm.languageId;\r\n\r\n if (data === true) {\r\n vm.showLanguageSelect = false;\r\n vm.inCall = true;\r\n $scope.$emit('showThirdParty');\r\n accountservice.logMessage('vox-connect-interpreter.callLanguageSelect|Message: Success, CallId: ' + vm.callId +\r\n ', LanguageId:' + vm.languageId + ', CustomerId:' + vm.customerId +\r\n ', LanguageServiceId:' + vm.languageServiceId + ', InCall:' + vm.inCall, vm.logLevel.Trace);\r\n }\r\n else {\r\n // log event Language select click button failed\r\n userservice.addCallEvent(callEvents.LSClickedFailed, vm.callId);\r\n\r\n accountservice.logMessage('vox-connect-interpreter.callLanguageSelect|Message: Failed, CallId: ' + vm.callId +\r\n ', InCall: ' + vm.inCall, vm.logLevel.Warn);\r\n vm.showLanguageSelect = true;\r\n vm.inCall = true;\r\n vm.connectInterpreterDisabled = true;\r\n vm.errorMessage = 'Call Failed! Please try again';\r\n vm.showErrorMessage = true;\r\n $timeout(function () {\r\n vm.showErrorMessage = false;\r\n }, 5000);\r\n //Enable back the LanguageSelect and Connect Buttons\r\n vm.disableAllLanguageSelect = false;\r\n }\r\n }).catch(function (e) {\r\n vm.showLanguageSelect = false;\r\n vm.inCall = false;\r\n vm.connectInterpreterDisabled = true;\r\n vm.disableAllLanguageSelect = false;\r\n });\r\n }\r\n } else {\r\n accountservice.logMessage('vox-connect-interpreter.getLanguageServiceUsersByGroup Action Failed|LanguageId: ' + vm.languageId +\r\n ', CustomerId: ' + vm.customerId, vm.logLevel.Warn);\r\n }\r\n }).finally(function (e) {\r\n vm.callingLanguageSelect = false;\r\n });\r\n }\r\n\r\n function changeLanguageServiceSelection(languageService) {\r\n vm.LanguageSelect = { GroupId: languageService.GroupId, Name: languageService.Name };\r\n\r\n $cookies.put('SelectedLanguageServiceGroup_' + vm.languageId, languageService.GroupId);\r\n }\n\n function changeGenderInterpreterSelection(genderOption) {\n vm.genderSelect = { Id: genderOption.Id, Name: genderOption.Name };\n\n $cookies.put('SelectedGenderSpecificInterpreter_' + vm.languageId, genderOption.Id);\r\n }\r\n\r\n // add the Language Select interpreter to the customer conference\r\n function connectInterpreter() {\r\n var interpreterId = vm.languageServiceId || vm.interpreterId;\r\n accountservice.logMessage('vox-connect-interpreter.connectInterpreter|Message: Enter, InterpreterId: ' + vm.interpreterId +\r\n ', CallId: ' + vm.callId, vm.logLevel.Info);\r\n if (interpreterId) {\r\n ///Log event for connectInterpreter click button\r\n userservice.addCallEvent(callEvents.ConnectInterpreterButtonClicked, vm.callId);\r\n\r\n vm.connectingInterpreter = true;\r\n operatorservice.connectInterpreter(vm.callId, interpreterId).then(function (data) {\r\n if (data === true) {\r\n vm.inCall = false;\r\n vm.disableAllLanguageSelect = true;\r\n }\r\n else {\r\n // log event connectInterpreter click button failed\r\n userservice.addCallEvent(callEvents.ConnectInterpreterClickedFailed, vm.callId);\r\n accountservice.logMessage('vox-connect-interpreter.connectInterpreter|Message: Select interpreter connect Action Failed, CallId: ' +\r\n vm.callId, vm.logLevel.Warn);\r\n }\r\n }).finally(function (e) {\r\n vm.connectingInterpreter = false;\r\n vm.connectInterpreterDisabled = true;\r\n });\r\n }\r\n }\r\n\r\n // Move our operator to the customer conference\r\n function connectMe() {\r\n vm.connectingMe = true;\r\n\r\n accountservice.logMessage('vox-connect-interpreter.connectMe|Message: before userservice.addCallEvent, CallId: ' +\r\n vm.callId, vm.logLevel.Trace);\r\n\r\n //Log event for connectMe click button\r\n userservice.addCallEvent(callEvents.ConnectMeButtonClicked, vm.callId);\r\n\r\n accountservice.logMessage('vox-connect-interpreter.connectMe|Message: after userservice.addCallEvent, CallId: ' +\r\n vm.callId, vm.logLevel.Trace);\r\n operatorservice.conferenceJoin(vm.callId).then(function (data) {\r\n if (data === true) {\r\n $scope.$emit('hideThirdParty');\r\n vm.disableAllLanguageSelect = false;\r\n vm.showLanguageSelect = true;\r\n\r\n accountservice.logMessage('vox-connect-interpreter.connectMe|Message: after ' + vm.showLanguageSelect + ' , CallId: ' + vm.callId, vm.logLevel.Trace);\r\n }\r\n else {\r\n // log event connectMe click button failed\r\n userservice.addCallEvent(callEvents.ConnectMeClickedFailed, vm.callId);\r\n accountservice.logMessage('vox-connect-interpreter.connectMe|Message: Failed, CallId: ' + vm.callId, vm.logLevel.Warn);\r\n }\r\n }).finally(function (e) {\r\n vm.connectingMe = false;\r\n vm.inCall = false;\r\n });\r\n }\r\n\r\n function checkWorkingResourceRequest() {\r\n\r\n vm.showErrorMessage = false;\r\n\r\n operatorservice.workingResourceRequestExists(vm.callId).then(function (data) {\r\n if (data === true) {\r\n accountservice.logMessage('vox-connect-interpreter.checkWorkingResourceRequest|Message: working resource request found, CallId: ' +\r\n vm.callId, vm.logLevel.Debug);\r\n vm.errorMessage = 'Connecting interpreter';\r\n vm.showErrorMessage = true;\r\n vm.showLanguageSelect = true;\r\n $timeout(function () {\r\n vm.showErrorMessage = false;\r\n }, 5000);\r\n return;\r\n }\r\n }).finally(function (e) {\r\n });\r\n }\r\n\r\n function close() {\r\n vm.showNoInterpsFoundError = false;\r\n }\r\n\r\n function showInterpreterStatistics() {\r\n if (!vm.interpreterStatisticsShown) {\r\n vm.interpreterStatisticsShown = true;\r\n loadStatistics();\r\n }\r\n }\r\n\r\n /* When connectMe, Language select and connect interpreter button display on UI this method triggers*/\r\n function logButtonShowEvent(eventName) {\r\n if (eventName === 'ConnectMeButtonVisible' || eventName === 'ConnectInterpreterButtonVisible')\r\n {\r\n utilities.logButtonShowEvent(eventName, vm.callId);\r\n return true;\r\n }\r\n if (vm.languageServiceIds.length) {\r\n utilities.logButtonShowEvent(eventName, vm.callId);\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n function loadStatistics() {\r\n vm.statisticsLoading = true;\r\n close();\r\n\r\n operatorservice\r\n .getInterpreterStatistics(vm.languageId, vm.interpreterPoolId, vm.secondaryInterpreterPoolId, vm.thirdInterpreterPoolId, vm.fourthInterpreterPoolId)\r\n .then(onStatisticsReceived)\r\n .finally(function () {\r\n vm.statisticsLoading = false;\r\n });\r\n }\r\n\r\n function onStatisticsReceived(statistics) {\r\n vm.statistics = statistics;\r\n vm.hasInterpreters = vm.statistics.AvailablePortal > 0 || vm.statistics.AvailablePhone > 0;\r\n vm.hasOfflineInterpreters = vm.statistics.Offline > 0;\r\n if (vm.hasInterpreters === false) {\r\n //if any LS user available for that call then display LS button\r\n operatorservice.getLanguageServiceUsersByGroup(vm.languageId, vm.customerId, 0).then(function (data) {\r\n if (data !== '' && data.length > 0) {\r\n vm.showLanguageSelect = true;\r\n\r\n } else {\r\n accountservice.logMessage('vox-connect-interpreter.getLanguageServiceUsersByGroup Action Failed|LanguageId: ' + vm.languageId +\r\n ', CustomerId: ' + vm.customerId, vm.logLevel.Warn);\r\n }\r\n });\r\n\r\n }\r\n accountservice.logMessage('vox-connect-interpreter.onStatisticReceived|has Available or AvailablePhone Interpreters: ' + vm.hasInterpreters +\r\n ', hasOfflineInterpreters: ' + vm.hasOfflineInterpreters + ', CallId: ' + vm.callId, vm.logLevel.Debug);\r\n vm.showNoInterpsFoundError = !vm.hasInterpreters && !vm.hasOfflineInterpreters;\r\n }\r\n\r\n function getSelectedLanguageService() {\r\n if (vm.languageServiceIds.length <= 0) {\r\n return undefined;\r\n }\r\n\r\n var preSelectedGroupId = $cookies.get('SelectedLanguageServiceGroup_' + vm.languageId);\r\n\r\n if (preSelectedGroupId !== undefined && preSelectedGroupId > 0) {\r\n for (var i = 0; i < vm.languageService.length; i++) {\r\n if (vm.languageService[i].GroupId === preSelectedGroupId) {\r\n return { GroupId: vm.languageService[i].GroupId, Name: vm.languageService[i].Name };\r\n }\r\n }\r\n }\r\n\r\n return { GroupId: 0, Name: 'Language Service' };\r\n }\n\n function getSelectedGenderInterpreter() {\n var preSelectedGenderOption = $cookies.get('SelectedGenderSpecificInterpreter_' + vm.languageId);\n\n if (preSelectedGenderOption !== undefined) {\r\n for (var i = 0; i < vm.genderOptions.length; i++) {\r\n if (vm.genderOptions[i].Id === preSelectedGenderOption) {\r\n return { Id: vm.genderOptions[i].Id, Name: vm.genderOptions[i].Name };\r\n }\r\n }\r\n }\n\n return { Id: 0, Name: 'Connect' };\r\n }\n\n function addGenderSpecificEvent(genderSelect, callId) {\n switch (genderSelect.Id) {\r\n case 1:\n userservice.addCallEvent(callEvents.ConnectToMale, callId);\n break;\n case 2:\n userservice.addCallEvent(callEvents.ConnectToFemale, callId);\n break;\r\n default:\n accountservice.logMessage('vox-connect-interpreter.AddGenderSpecificEvent|No gender specific option is selected, CallId: ' + callId, vm.logLevel.Debug);\r\n }\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.widgets')\r\n .directive('voxCase', voxCase);\r\n\r\n function voxCase() {\r\n var directive = {\r\n bindToController: true,\r\n controller: CaseController,\r\n controllerAs: 'vm',\r\n restrict: 'E',\r\n scope: {\r\n 'currentCall': '=',\r\n 'currentCase': '=',\r\n 'operator': '=',\r\n 'callParticipants': '=',\r\n 'customer': '=',\r\n 'interpreters': '=',\r\n 'languageService': '='\r\n },\r\n templateUrl: 'app/widgets/vox-case.html',\r\n };\r\n\r\n return directive;\r\n }\r\n\r\n CaseController.$inject = ['dataservice'];\r\n\r\n function CaseController(dataservice) {\r\n var vm = this;\r\n\r\n activate();\r\n\r\n function activate() {\r\n getCaseDisplay();\r\n }\r\n\r\n function getCaseDisplay() {\r\n dataservice.getCaseDisplay(vm.currentCall.CallId).then(function (data) {\r\n vm.caseDisplay = data;\r\n });\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.widgets')\r\n .directive('voxAlert', voxAlert);\r\n\r\n function voxAlert($document) {\r\n var directive = {\r\n bindToController: true,\r\n controller: AlertController,\r\n controllerAs: 'vm',\r\n restrict: 'E',\r\n scope: {\r\n alert: '=',\n contactMethod: '=',\n reCreateTokens: '='\r\n },\r\n link: function (scope) {\r\n $document.bind('keydown', function (e) {\r\n if (scope.vm.alert) {\r\n if (e.which === 13) {\r\n scope.vm.alertResponse('Accept', true);\r\n }\r\n else if (e.which === 27) {\r\n scope.vm.alertResponse('Reject', true);\r\n }\r\n }\r\n });\r\n },\r\n templateUrl: 'app/widgets/vox-alert.html'\r\n };\r\n\r\n return directive;\r\n }\r\n\r\n AlertController.$inject = ['$document', '$interval', '$scope', 'accountservice', 'callEvents', 'enums', 'logger', 'usermessageservice', 'userservice', 'twiliowebrtcservice'];\r\n function AlertController($document, $interval, $scope, accountservice, callEvents, enums, logger, usermessageservice, userservice, twiliowebrtcservice) {\r\n var vm = this;\r\n var defaultAudioFilePath = '/assets/audio/PagerBeeps.mp3';\r\n\r\n // Functions\r\n vm.alertResponse = alertResponse;\r\n\r\n vm.alertType = 'alert alert-success';\r\n vm.alertMessage = undefined;\r\n vm.alertPromise = undefined;\r\n vm.hideAlertPromise = undefined;\r\n vm.beepSound = undefined;\r\n vm.waitingForAcceptResponse = false;\r\n vm.waitingForRejectResponse = false;\r\n vm.triggeredBy = '';\r\n vm.actionedAlert = undefined;\n activate();\r\n\r\n function activate() {\n }\r\n\r\n // No if/then/else test on 'newValue' is needed here because 'newValue' will always be the alert data.\r\n // If vm.alert ever was 'undefined', this directive and it's scope would be destroyed before this code\r\n // could run. Instead, I use $scope.$on($destroy'...) to stop the alarm sound.\r\n $scope.$watch('vm.alert', function (newValue, oldValue) {\r\n updateAlert('alert alert-success', undefined); //reset the alert - shouldn't be needed\r\n\r\n if (newValue !== undefined) {\r\n userservice.addCallEvent(callEvents.AlertButtonVisible, newValue.CallId, newValue.ResourceAlertId);\r\n }\r\n soundTheAlarm();\r\n\r\n if (newValue !== undefined) {\r\n userservice.addCallEvent(callEvents.AlertSoundPlaying, newValue.CallId);\r\n }\r\n\r\n // Play the alarm every 10 seconds (play for 5, wait for 5)...\r\n // but repeat only once so if the client loses connectivity for some reason, the sound won't play for ever.\r\n vm.alertPromise = $interval(soundTheAlarm, 10000, 1);\r\n });\r\n\r\n // Just before the controller scope is destroyed, stop the alarm (in case it's sounding).\r\n $scope.$on('$destroy', function () {\r\n $document.unbind('keydown');\r\n stopTheAlarm();\r\n });\r\n\r\n function alertResponse(action, keypress) {\r\n $document.unbind('keydown');\r\n stopTheAlarm();\r\n\r\n if (!vm.alert) {\r\n return;\r\n }\r\n vm.actionedAlert = vm.alert;\r\n\r\n vm.triggeredBy = keypress === true ? 'KeyPress' : 'MouseClick';\r\n accountservice.logMessage('vox-alert.directive|Message: AlertResponse triggered by ' + vm.triggeredBy +\r\n ', ResourceAlertId: ' + vm.actionedAlert.ResourceAlertId + ', ResourceRequestId: ' + vm.actionedAlert.ResourceRequestId, enums.LogLevel.Info);\r\n try {\r\n switch (action) {\r\n case 'Accept':\r\n vm.waitingForAcceptResponse = true;\n refreshWebRTCToken();\r\n userservice.acceptAlert(vm.actionedAlert.ResourceAlertId, vm.actionedAlert.ResourceRequestId, vm.actionedAlert.IsTestCall, vm.actionedAlert.CallId,\n vm.actionedAlert.IsScheduleCall).then(function (result) {\r\n if (result === true) {\r\n usermessageservice.notify('notify', { eventName: 'Accept' });\r\n logger.info('Call Accepted');\r\n }\r\n else {\r\n usermessageservice.notify('notify', { eventName: 'AlreadyAccept' });\r\n logger.info('Couldn\\'t Accept Call');\r\n }\r\n\r\n var requestId = vm.actionedAlert ? vm.actionedAlert.ResourceRequestId : undefined;\r\n vm.hideAlertPromise = $interval(hideAlert, 0, 1, true, requestId);\r\n\r\n }).finally(function () {\r\n vm.waitingForAcceptResponse = false;\r\n });\r\n break;\r\n case 'Reject':\r\n vm.waitingForRejectResponse = true;\r\n userservice.rejectAlert(vm.actionedAlert.ResourceAlertId, vm.actionedAlert.ResourceRequestId, vm.actionedAlert.IsTestCall, vm.actionedAlert.CallId,\n vm.actionedAlert.IsScheduleCall).then(function (result) {\r\n usermessageservice.notify('notify', { eventName: 'Reject' });\r\n\r\n var requestId = vm.actionedAlert ? vm.actionedAlert.ResourceRequestId : undefined;\r\n vm.hideAlertPromise = $interval(hideAlert, 0, 1, true, requestId);\r\n\r\n }).finally(function () {\r\n vm.waitingForRejectResponse = false;\r\n });\r\n break;\r\n default:\r\n logger.error('Unexpected action: \\'' + action + '\\'');\r\n break;\r\n }\r\n }\r\n catch (e) {\r\n vm.waitingForAcceptResponse = false;\r\n vm.waitingForRejectResponse = false;\r\n }\r\n }\r\n\n function refreshWebRTCToken()\n {\n if (+vm.contactMethod === enums.ContactMethod.WebRTC && vm.reCreateTokens)\n {\n twiliowebrtcservice.enable();\r\n }\r\n }\n\r\n //Change the alert level and message\r\n function updateAlert(changedAlertStyle, alertMessage) {\r\n vm.alertType = changedAlertStyle;\r\n vm.alertMessage = alertMessage;\r\n }\r\n\r\n // Start the alarm sound\r\n function soundTheAlarm() {\n var path = defaultAudioFilePath;\r\n if (vm.alert && vm.alert.AudioFilePath) {\n path = vm.alert.AudioFilePath;\r\n }\n vm.beepSound = new Audio(path);\r\n vm.beepSound.autoplay = true;\r\n }\r\n\r\n // Stop the alarm sound\r\n function stopTheAlarm() {\r\n if (vm.beepSound) {\r\n vm.beepSound.pause();\r\n }\r\n\r\n if (vm.alertPromise) {\r\n $interval.cancel(vm.alertPromise);\r\n }\r\n\r\n if (vm.hideAlertPromise) {\r\n $interval.cancel(vm.hideAlertPromise);\r\n }\r\n }\r\n\r\n // Hide the alert if the active alert hasn't changed since the user was alerted.\r\n // We're trying to guard against the rare possibility that the user receives a new\r\n // alert between the time they respond to the first one and the time the system\r\n // processes the response.\r\n function hideAlert(resourceRequestId) {\r\n if (vm.alert && (resourceRequestId !== undefined) && (vm.alert.ResourceRequestId === resourceRequestId)) {\r\n vm.alert = undefined;\r\n }\r\n\r\n vm.hideAlertPromise = undefined;\r\n }\r\n }\r\n})();\r\n\n'use strict';\r\n\r\nangular\r\n .module('smart-table')\r\n .directive('stReset', stReset);\r\n\r\n/* @ngInject */\r\nfunction stReset() {\r\n var directive = {\r\n require: '^stTable',\r\n restrict: 'EA',\r\n scope: { stReset: '=stReset' },\r\n link: function postLink(scope, element, attrs, ctrl) {\r\n return element.bind('click', function () {\r\n return scope.$apply(function () {\r\n var tableState;\r\n tableState = ctrl.tableState();\r\n tableState.search.predicateObject = {};\r\n return ctrl.pipe();\r\n });\r\n });\r\n }\r\n };\r\n return directive;\r\n}\r\n\n(function () {\n 'use strict';\n\n angular\n .module('vox-leonis.widgets')\n .controller('NewInterpreterPortalController', NewInterpreterPortalController);\n\n NewInterpreterPortalController.$inject = [\n '$timeout', '$uibModalInstance', '$window', '$scope',\n 'userservice', 'preferences', 'usermessageservice', 'enums',\n 'interpreterVoicePortalFrontEndUrl'\n ];\n\n /* @ngInject */\n function NewInterpreterPortalController(\n $timeout, $uibModalInstance, $window, $scope,\n userservice, preferences, usermessageservice, enums,\n interpreterVoicePortalFrontEndUrl\n ) {\n var vm = this;\n vm.interpreterVoicePortalFrontEndUrl = interpreterVoicePortalFrontEndUrl;\n vm.stayInOldVoicePortal = stayInOldVoicePortal;\n vm.hasRequiredStatusToStayInOldVoicePortal = false;\n\n var switchToInterpreterTimeout = 6000;\n var isSwitchAborted = false;\n\n $timeout(function () {\n if (!isSwitchAborted) {\n redirectToInterpreterVoicePortal();\n }\n }, switchToInterpreterTimeout);\n\n usermessageservice.subscribe($scope, 'notify', function (event, data) {\n if (data.eventName === 'currentStatus') {\n var acceptableStatuses = [\n enums.PersonStatusNames.NotAvailable,\n enums.PersonStatusNames.Available,\n enums.PersonStatusNames.Unavailable,\n enums.PersonStatusNames.Offline,\n enums.PersonStatusNames.Away,\n ];\n vm.hasRequiredStatusToStayInOldVoicePortal = acceptableStatuses.some(function (status) { return status === data.statusName; });\n }\n });\n\n function stayInOldVoicePortal() {\n isSwitchAborted = true;\n userservice.setUserSetting(preferences.IvrNewVoicePortalUsedByInterpreter, false)\n .then(function (data) {\n $uibModalInstance.close();\n });\n }\n\n function redirectToInterpreterVoicePortal() {\n $window.location.href = vm.interpreterVoicePortalFrontEndUrl;\n }\n\n }\n})();\n\n(function () {\n 'use strict';\n\n angular\n .module('vox-leonis.widgets')\n .controller('NewCallOperatorsPortalController', NewCallOperatorsPortalController);\n\n NewCallOperatorsPortalController.$inject = [\n '$timeout', '$uibModalInstance', '$window',\n 'userservice', 'preferences',\n 'callOperatorsVoicePortalFrontEndUrl'\n ];\n\n /* @ngInject */\n function NewCallOperatorsPortalController(\n $timeout, $uibModalInstance, $window,\n userservice, preferences,\n callOperatorsVoicePortalFrontEndUrl\n ) {\n var vm = this;\n vm.callOperatorsVoicePortalFrontEndUrl = callOperatorsVoicePortalFrontEndUrl;\n vm.stayInOldVoicePortal = stayInOldVoicePortal;\n\n var switchToCallOperatorsTimeout = 6000;\n var isSwitchAborted = false;\n\n $timeout(function () {\n if (!isSwitchAborted) {\n redirectToCallOperatorsVoicePortal();\n }\n }, switchToCallOperatorsTimeout);\n\n function stayInOldVoicePortal() {\n isSwitchAborted = true;\n userservice.setUserSetting(preferences.IvrNewVoicePortalUsedByOperator, false)\n .then(function (data) {\n $uibModalInstance.close();\n });\n }\n\n function redirectToCallOperatorsVoicePortal() {\n $window.location.href = vm.callOperatorsVoicePortalFrontEndUrl;\n }\n\n }\n})();\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.widgets')\r\n .controller('ModalFeedbackController', ModalFeedbackController);\r\n\r\n ModalFeedbackController.$inject = ['$scope', 'utilities', 'user', 'roles', '$uibModalInstance', 'appsettingsservice', 'accountservice', 'enums', '$cookies', 'constants'];\r\n /* @ngInject */\r\n function ModalFeedbackController($scope, utilities, user, roles, $uibModalInstance, appsettingsservice, accountservice, enums, $cookies, constants) {\r\n var vm = this;\r\n\r\n vm.submitFeedback = submitFeedback;\r\n vm.cancel = cancel;\r\n vm.title = 'Lionbridge Voice Portal';\r\n vm.feedbackDescription = '';\r\n vm.logLevel = enums.LogLevel;\r\n vm.user = user;\r\n vm.roles = roles;\r\n vm.buildFeedbackTypesList = buildFeedbackTypesList;\r\n vm.submitting = false;\r\n\r\n // This method is called when the modal is created (even if the tab on which the modal will be displayed is inactive)\r\n $uibModalInstance.opened.then(function () {\r\n vm.referenceId = $cookies.get(constants.referenceId);\r\n vm.profileName = $cookies.get(constants.profileName);\n\r\n if (vm.referenceId === undefined) {\r\n if (roles.includes(constants.Operator)) {\r\n vm.role = constants.Operator;\r\n } else {\r\n vm.role = constants.Interpreter;\r\n }\r\n vm.referenceId = 'undefined';\r\n } else {\r\n vm.role = $cookies.get(constants.userRole);\r\n }\r\n \r\n appsettingsservice.getAppSetting('Portal_' + vm.role + 'IssueTypes', 'Call Quality:0').then(function (data) {\r\n vm.feedbackTypes = buildFeedbackTypesList(data);\r\n });\r\n });\r\n\r\n function buildFeedbackTypesList(list) {\r\n\r\n return list.split('|').map(function (attribute) {\r\n var dividedAttribute = attribute.split(':');\r\n return {\r\n id: dividedAttribute[1],\r\n name: dividedAttribute[0]\r\n };\r\n });\r\n }\r\n\r\n function submitFeedback() {\r\n vm.submitting = true;\r\n var description = vm.feedbackDescription.replace(/(\\r\\n|\\n|\\r)/gm, ' ');\r\n description = description.replace(/\"/g, '\\x27');\r\n var message = 'VoicePortalFeedback|UserId: ' + user.Id + '|FirstName: ' + user.FirstName + '|LastName: ' + user.LastName + '|Email: ' + user.Email + ' ' +\n '|UserRole: ' + vm.role + '|ReferenceId: ' + vm.referenceId + '|Organization: ' + vm.profileName + '|IssueTypeId: ' + vm.feedbackType.id + '|IssueType: ' +\r\n vm.feedbackType.name + '|IssueDescription: ' + description + '|Browser: ' + getBrowserInfo();\r\n accountservice.logMessage(message, vm.logLevel.Info);\r\n cancel();\r\n }\r\n\r\n function cancel() {\r\n $uibModalInstance.close();\r\n utilities.setRootScopeTitle(vm.title);\r\n }\r\n\r\n function getBrowserInfo() {\r\n var userAgent = navigator.userAgent, tem,\r\n matchArray = userAgent.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\r\n if (/trident/i.test(matchArray[1])) {\r\n tem = /\\brv[ :]+(\\d+)/g.exec(userAgent) || [];\r\n return 'IE ' + (tem[1] || '');\r\n }\r\n if (matchArray[1] === 'Chrome') {\r\n tem = userAgent.match(/\\b(OPR|Edge)\\/(\\d+)/);\r\n if (tem != null) {\r\n return tem.slice(1).join(' ').replace('OPR', 'Opera');\r\n }\r\n }\r\n matchArray = matchArray[2] ? [matchArray[1], matchArray[2]] : [navigator.appName, navigator.appVersion, '-?'];\r\n if ((tem = userAgent.match(/version\\/(\\d+)/i)) != null) {\r\n matchArray.splice(1, 1, tem[1]);\r\n }\r\n return matchArray.join(',');\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.widgets')\r\n .controller('ModalCallController', ModalCallController);\r\n\r\n ModalCallController.$inject = ['$scope', 'utilities', '$uibModalInstance', 'data', 'session', 'interpreterservice', 'operatorservice', 'logger', 'accountservice', 'enums'];\r\n /* @ngInject */\r\n function ModalCallController($scope, utilities, $uibModalInstance, data, session, interpreterservice, operatorservice, logger, accountservice, enums) {\r\n var vm = this;\r\n\r\n vm.accept = accept;\r\n vm.from = data.FromPhoneNumber;\r\n vm.profileName = data.ProfileName;\r\n vm.reject = reject;\r\n vm.timerStarted = false;\r\n vm.language = data.Language;\r\n vm.interpreterid = data.InterpreterId;\r\n vm.operatorid = data.OperatorId;\r\n vm.roles = session.roles;\r\n vm.responseTimeout = data.ResponseTimeout;\r\n vm.organizationName = data.OrganizationName;\r\n vm.scheduledCase = data.ScheduledCase;\r\n vm.callRejectedMessage = '';\r\n vm.close = close;\r\n vm.waitingForResponse = false;\r\n vm.beepSound = undefined;\r\n vm.title = 'Lionbridge Voice Portal';\r\n vm.missedCallTitle = 'You missed a call';\r\n vm.modalOpened = undefined;\r\n vm.logLevel = enums.LogLevel;\n vm.callid = data.CallId;\r\n\r\n activate();\r\n\r\n $scope.$on('elapsed', function (event, args) {\r\n if (args.message) {\r\n reject('OutOfTime');\r\n utilities.setRootScopeTitle(vm.missedCallTitle);\r\n }\r\n });\r\n\r\n function activate() {\r\n vm.beepSound = new Audio('assets/audio/PagerBeeps.mp3');\r\n vm.beepSound.autoplay = true;\r\n }\r\n\r\n function accept() {\r\n vm.beepSound.pause();\r\n vm.waitingForResponse = true;\r\n vm.timerStarted = false;\r\n if (vm.interpreterid !== undefined) {\r\n interpreterservice.acceptCall(data.CallId, data.PhoneNumber, data.LanguageId, data.CustomerId, data.FromPhoneNumber).then(function (result) {\n console.log('from modal accept' + data.CallId);\r\n if (result !== true) {\r\n vm.callRejectedMessage = getCallRejectedMessage('Accept');\r\n utilities.setRootScopeTitle(vm.missedCallTitle);\r\n logger.error('Couldn\\'t Accept Call');\r\n }\r\n else {\r\n logger.info('Call Accepted');\r\n $uibModalInstance.close();\r\n utilities.setRootScopeTitle(vm.title);\r\n }\r\n })\r\n .catch(function (result) {\r\n vm.callRejectedMessage = getCallRejectedMessage('Accept');\r\n utilities.setRootScopeTitle(vm.missedCallTitle);\r\n })\r\n .finally(function () {\r\n vm.waitingForResponse = false;\r\n });\r\n }\r\n else if (vm.operatorid !== undefined) {\r\n operatorservice.acceptCall(data.CallId, data.PhoneNumber).then(function (result) {\r\n if (result === false) {\r\n vm.callRejectedMessage = getCallRejectedMessage('Accept');\r\n utilities.setRootScopeTitle(vm.missedCallTitle);\r\n logger.error('Couldn\\'t Accept Call');\r\n }\r\n else {\r\n logger.info('Call Accepted');\r\n $uibModalInstance.close();\r\n utilities.setRootScopeTitle(vm.title);\r\n }\r\n })\r\n .catch(function (result) {\r\n vm.callRejectedMessage = getCallRejectedMessage('Accept');\r\n utilities.setRootScopeTitle(vm.missedCallTitle);\r\n })\r\n .finally(function () {\r\n vm.waitingForResponse = false;\r\n });\r\n }\r\n }\r\n\r\n function reject(actionAttempted) {\r\n vm.beepSound.pause();\r\n vm.waitingForResponse = true;\r\n vm.timerStarted = false;\n console.log('callid' + vm.callid);\r\n utilities.setRootScopeTitle(vm.title);\r\n if (vm.interpreterid !== undefined) {\r\n interpreterservice.rejectCall(data.CallId, data.LanguageId, data.CustomerId, data.FromPhoneNumber).then(function (result) {\n console.log('from modal' + data.CallId);\r\n if (result === false) {\r\n accountservice.logMessage('modal-callController.reject Call Action Failed|CallId:' + data.CallId, vm.logLevel.Warn);\r\n }\r\n })\r\n .finally(function () {\r\n callRejected(actionAttempted);\r\n });\r\n }\r\n else if (vm.operatorid !== undefined) {\r\n operatorservice.rejectCall(data.CallId, data.FromPhoneNumber, data.CustomerId).then(function (result) {\r\n if (result === false) {\r\n accountservice.logMessage('modal-callController.reject Call Action Failed|CallId:' + data.CallId, vm.logLevel.Warn);\r\n }\r\n })\r\n .finally(function () {\r\n callRejected(actionAttempted);\r\n });\r\n }\r\n }\r\n\r\n function callRejected(actionAttempted) {\r\n vm.callRejectedMessage = getCallRejectedMessage(actionAttempted);\r\n vm.waitingForResponse = false;\r\n }\r\n\r\n // This method is called when the modal is actually rendered (not until the tab on which it is displayed becomes active)\r\n $uibModalInstance.rendered.then(function () {\r\n\r\n var renderDelay = Math.floor((Date.now() - vm.modalOpened) / 1000);\r\n vm.responseTimeout -= renderDelay;\r\n\r\n if (vm.responseTimeout <= 0) {\r\n reject('OutOfTime');\r\n utilities.setRootScopeTitle(vm.missedCallTitle);\r\n }\r\n else {\r\n vm.timerStarted = true;\r\n }\r\n });\r\n\r\n // This method is called when the modal is created (even if the tab on which the modal will be displayed is inactive)\r\n $uibModalInstance.opened.then(function () {\r\n vm.modalOpened = Date.now();\r\n });\r\n\r\n function close() {\r\n $uibModalInstance.close();\r\n utilities.setRootScopeTitle(vm.title);\r\n }\r\n\r\n function getCallRejectedMessage(actionAttempted) {\r\n var message;\r\n if (actionAttempted === 'Accept') {\r\n setInterpreterStatus();\r\n message = 'You clicked Accept too late.';\r\n }\r\n else if (actionAttempted === 'Reject') {\r\n message = 'You clicked Reject. Your status has been changed to Unavailable.';\r\n }\r\n else {\r\n setInterpreterStatus();\r\n message = 'You missed a call.';\r\n }\r\n return message;\r\n }\r\n\r\n function setInterpreterStatus()\r\n {\r\n if (vm.interpreterid !== undefined) {\r\n interpreterservice.setStatusAtomic(enums.PersonStatusNames.Unavailable, enums.PersonStatusNames.Available);\r\n }\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.widgets')\r\n .directive('ngDraggable', drag);\n\n function drag($document) {\n var directive = {\r\n restrict: 'EA',\r\n scope: {\r\n dragOptions: '=ngDraggable'\r\n },\n controller: DraggableController,\r\n controllerAs: 'vm',\r\n link: function (scope, elem, attr) {\r\n var startX, startY, x = 0, y = 0,\r\n start, stop, drag, container;\r\n\r\n var width = elem[0].offsetWidth,\r\n height = elem[0].offsetHeight;\r\n\r\n // Obtain drag options\r\n if (scope.dragOptions) {\r\n start = scope.dragOptions.start;\r\n drag = scope.dragOptions.drag;\r\n stop = scope.dragOptions.stop;\r\n var id = scope.dragOptions.container;\r\n }\r\n\r\n // Bind mousedown event\r\n elem.on('mousedown', function (e) {\r\n e.preventDefault();\r\n startX = e.clientX - elem[0].offsetLeft;\r\n startY = e.clientY - elem[0].offsetTop;\r\n $document.on('mousemove', mousemove);\r\n $document.on('mouseup', mouseup);\r\n if (start) { start(e); }\r\n });\r\n\r\n // Handle drag event\r\n function mousemove(e) {\r\n y = e.clientY - startY;\r\n x = e.clientX - startX;\r\n setPosition();\r\n if (drag) { drag(e); }\r\n }\r\n\r\n // Unbind drag events\r\n function mouseup(e) {\r\n $document.unbind('mousemove', mousemove);\r\n $document.unbind('mouseup', mouseup);\r\n if (stop) { stop(e); }\r\n }\r\n\r\n // Move element, within container if provided\r\n function setPosition() {\r\n if (container) {\r\n if (x < container.left) {\r\n x = container.left;\r\n } else if (x > container.right - width) {\r\n x = container.right - width;\r\n }\r\n if (y < container.top) {\r\n y = container.top;\r\n } else if (y > container.bottom - height) {\r\n y = container.bottom - height;\r\n }\r\n }\r\n\r\n elem.css({\r\n top: y + 'px',\r\n left: x + 'px'\r\n });\r\n }\r\n }\r\n };\n return directive;\r\n }\n DraggableController.$inject = ['$scope'];\n function DraggableController($scope) {\n $scope.dragOptions = {\r\n start: function (e) {\r\n console.log('STARTING');\r\n },\r\n drag: function (e) {\r\n console.log('DRAGGING');\r\n },\r\n stop: function (e) {\r\n console.log('STOPPING');\r\n },\r\n container: 'container'\r\n };\n }\r\n})();\r\n\n\n(function ()\r\n{\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.operator', [\r\n 'vox-leonis.core'\r\n ]);\r\n})();\r\n\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.operator')\r\n .directive('voxScheduledRelayInterpretation', voxScheduledRelayInterpretation);\r\n /* @ngInject */\r\n function voxScheduledRelayInterpretation() {\r\n var directive = {\r\n bindToController: true,\r\n controller: ScheduledRelayInterpretationController,\r\n controllerAs: 'vm',\r\n restrict: 'E',\r\n scope: {\r\n 'currentCall': '=',\r\n 'currentCase': '=',\r\n 'caseDisplay': '=',\r\n 'operator': '=',\r\n 'customer': '=',\r\n 'interpreters': '=',\r\n 'languageService': '='\r\n },\r\n templateUrl: 'app/operator/vox-scheduled-relay-interpretation.html'\r\n };\r\n\r\n return directive;\r\n }\r\n\r\n ScheduledRelayInterpretationController.$inject = ['$scope', '$rootScope', 'accountservice', 'enums', 'operatorservice', '$q',\r\n 'operatorsignalreceiver', 'usermessageservice', 'callservice', 'utilities', 'userservice', 'callEvents', '$cookies'];\r\n /* @ngInject */\r\n function ScheduledRelayInterpretationController($scope, $rootScope, accountservice, enums, operatorservice, $q,\r\n operatorsignalreceiver, usermessageservice, callservice, utilities, userservice, callEvents, $cookies) {\r\n var vm = this;\r\n\r\n vm.areControlsDisabled = areControlsDisabled;\r\n vm.isConnectRelayInterpreterButtonDisabled = isConnectRelayInterpreterButtonDisabled;\r\n vm.changeLanguageServiceSelection = changeLanguageServiceSelection;\r\n\r\n vm.connectRareLanguageInterpreter = connectRareLanguageInterpreter;\r\n vm.connectRelayInterpreter = connectRelayInterpreter;\r\n vm.callLanguageService = callLanguageService;\r\n vm.conferenceAllParties = conferenceAllParties;\r\n vm.switchParticipant = switchParticipant;\r\n vm.getRareInterpreterPhone = getRareInterpreterPhone;\r\n vm.logButtonShowEvent = logButtonShowEvent;\r\n vm.languageServiceIds = buildLanguageServiceIds(vm.languageService);\r\n vm.LanguageSelect = getSelectedLanguageService();\r\n var relayInterpreterId = null;\r\n\r\n initialize();\r\n activate();\r\n\r\n function initialize() {\r\n vm.isRareLanguageInterpreterConnected = false;\r\n vm.isRelayInterpreterConnected = false;\r\n vm.relayInterpreterConnectFailed = false;\r\n vm.arePartiesConnected = false;\r\n\r\n vm.isCustomerOnHold = false;\r\n vm.isRareLanguageInterpreterOnHold = false;\r\n vm.isRelayInterpreterOnHold = false;\r\n\r\n vm.connectingRareLanguageInterpreter = false;\r\n vm.connectingRelayInterpreter = false;\r\n vm.callingLanguageService = false;\r\n vm.connectingParties = false;\r\n vm.switchingParticipant = false;\r\n\r\n vm.logLevel = enums.LogLevel;\r\n }\r\n\r\n function activate() {\r\n onCurrentCallChanged();\r\n $scope.$watch('vm.currentCall', onCurrentCallChanged);\r\n $scope.$on(operatorsignalreceiver.callNotAnsweredEvent, interpreterMissedTheCall);\r\n $scope.$on(operatorsignalreceiver.callAnsweredEvent, interpreterAnsweredTheCall);\r\n $scope.$on(operatorsignalreceiver.interpreterLeftTheCallEvent, interpreterLeftTheCall);\r\n $scope.$on(operatorsignalreceiver.findInterpreterTimeoutEvent, findRelayInterpreterTiemout);\r\n\r\n $scope.$on('$destroy', function () {\r\n showInstructionMessage('');\r\n });\r\n }\r\n\r\n function buildLanguageServiceIds(languageService) {\r\n if (languageService) {\r\n return languageService.map(function (ids) {\r\n return ids.Id;\r\n });\r\n }\r\n return [];\r\n }\r\n\r\n function findRelayInterpreterTiemout() {\r\n vm.callingLanguageService = false;\r\n vm.connectingRelayInterpreter = false;\r\n vm.connectRelayInterpreterDisabled = false;\r\n vm.callLanguageServiceDisabled = false;\r\n vm.relayInterpreterConnectFailed = true;\r\n showInstructionMessage('Failed to connect Relay Interpreter. Click on Connect Language Service or ' +\r\n 'Connect Relay Interpreter button to connect Relay Interpreter.');\r\n }\r\n\r\n function interpreterMissedTheCall(event, data) {\r\n if (vm.currentCase.InterpreterId === data.interpreterId) {\r\n vm.connectingRareLanguageInterpreter = false;\r\n } else if (!!data.interpreterId) {\r\n findRelayInterpreterTiemout();\r\n }\r\n }\r\n\r\n function interpreterAnsweredTheCall(event, data) {\r\n if (vm.currentCase.InterpreterId === data.interpreterId) {\r\n vm.connectingRareLanguageInterpreter = false;\r\n vm.isRareLanguageInterpreterConnected = true;\r\n } else if (!!data.interpreterId) {\r\n vm.callingLanguageService = false;\r\n vm.connectingRelayInterpreter = false;\r\n vm.isRelayInterpreterConnected = true;\r\n relayInterpreterId = data.interpreterId;\r\n }\r\n updateInstructionMessage();\r\n }\r\n\r\n function interpreterLeftTheCall(event, data) {\r\n if (vm.currentCase.InterpreterId === data.interpreterId) {\r\n vm.isRareLanguageInterpreterConnected = false;\r\n vm.isRareLanguageInterpreterOnHold = false;\r\n } else if (!!data.interpreterId) {\r\n vm.isRelayInterpreterConnected = false;\r\n vm.connectingRelayInterpreter = false;\r\n vm.isRelayInterpreterOnHold = false;\r\n relayInterpreterId = null;\r\n vm.relayInterpreterPhoneNumber = null;\r\n }\r\n\r\n updateInstructionMessage();\r\n }\r\n\r\n function onCurrentCallChanged() {\r\n checkParticipantsOnCall();\r\n updateInstructionMessage();\r\n }\r\n\r\n function checkParticipantsOnCall() {\r\n vm.isRareLanguageInterpreterConnected = false;\r\n vm.isRelayInterpreterConnected = false;\r\n relayInterpreterId = null;\r\n vm.relayInterpreterPhoneNumber = null;\r\n\r\n if (vm.currentCall && vm.currentCall.Participants && vm.currentCall.Participants.length) {\r\n for (var k = 0; k < vm.currentCall.Participants.length; k++) {\r\n var callParticipant = vm.currentCall.Participants[k];\r\n if (callParticipant.CustomerId === vm.customer.Id) {\r\n vm.isCustomerOnHold = callParticipant.Status === 'OnHold';\r\n } else if (callParticipant.InterpreterId === vm.currentCase.InterpreterId) {\r\n vm.isRareLanguageInterpreterConnected = true;\r\n vm.isRareLanguageInterpreterOnHold = callParticipant.Status === 'OnHold';\r\n } else if (!!callParticipant.InterpreterId) {\r\n vm.isRelayInterpreterConnected = true;\r\n relayInterpreterId = callParticipant.InterpreterId;\r\n vm.relayInterpreterPhoneNumber = callParticipant.PhoneNumber;\r\n vm.isRelayInterpreterOnHold = callParticipant.Status === 'OnHold';\r\n }\r\n }\r\n }\r\n }\r\n\r\n function updateInstructionMessage() {\r\n var rareDropped = false;\r\n var ralayDropped = false;\r\n\r\n if (!vm.currentCall) {\r\n return;\r\n }\r\n\r\n var interpreterDroppedInfo = callservice.getInterpreterDroppedInfo(vm.currentCall.Events);\r\n if (interpreterDroppedInfo) {\r\n rareDropped = interpreterDroppedInfo.interpreterId === vm.currentCase.InterpreterId;\r\n ralayDropped = !rareDropped;\r\n }\r\n\r\n if (!vm.isRareLanguageInterpreterConnected) {\r\n if (rareDropped) {\r\n showInstructionMessage('Rare Interpreter was abruptly dropped from conference call with this customer');\r\n } else {\r\n showInstructionMessage('Scheduled Relay Interpretation Conference Call. Please Click Connect Rare Language ' +\r\n 'Interpreter button to connect interpreter.');\r\n }\r\n } else if (!vm.isRelayInterpreterConnected) {\r\n if (ralayDropped) {\r\n showInstructionMessage('Relay Interpreter was abruptly dropped from conference call with this customer');\r\n } else {\r\n showInstructionMessage('Successfully connected Rare Language Interpreter. Click on Connect Relay ' +\r\n 'Interpreter button to connect Relay Interpreter.');\r\n }\r\n } else {\r\n showInstructionMessage('Successfully connected Rare Language Interpreter and Relay Interpreter. ' +\r\n 'Click on the Conference button to connect Customer, Rare Language Interpreter and Relay Interpreter.');\r\n }\r\n }\r\n\r\n function switchParticipant(muteCustomer, muteRareInterpreter, muteRelayInterpreter) {\r\n vm.switchingParticipant = true;\r\n var promises = [];\r\n\r\n if (vm.isCustomerOnHold !== muteCustomer) {\r\n promises.push(updateCustomerHoldStatus(muteCustomer));\r\n }\r\n\r\n if (vm.isRareLanguageInterpreterConnected && (vm.isRareLanguageInterpreterOnHold !== muteRareInterpreter || muteRareInterpreter === true)) {\r\n promises.push(updateInterpreterHoldStatus(vm.currentCase.InterpreterId, muteRareInterpreter));\r\n }\r\n\r\n if (vm.isRelayInterpreterConnected && (vm.isRelayInterpreterOnHold !== muteRelayInterpreter || muteRelayInterpreter === true)) {\r\n promises.push(updateInterpreterHoldStatus(relayInterpreterId, muteRelayInterpreter));\r\n }\r\n\r\n return $q\r\n .all(promises)\r\n .finally(function () { vm.switchingParticipant = false; });\r\n }\r\n\r\n function areControlsDisabled() {\r\n return vm.connectingRareLanguageInterpreter ||\r\n vm.connectingRelayInterpreter ||\r\n vm.callingLanguageService ||\r\n vm.connectingParties ||\r\n vm.switchingParticipant;\r\n }\r\n\r\n function isConnectRelayInterpreterButtonDisabled() {\r\n return vm.relayInterpreterConnectFailed;\r\n }\r\n\r\n function connectRareLanguageInterpreter() {\r\n\r\n vm.connectingRareLanguageInterpreter = true;\r\n\r\n switchParticipant(true, true, true)\r\n .then(callHoldSuccess)\r\n .catch(callError);\r\n\r\n function callHoldSuccess() {\r\n return operatorservice\r\n .callInterpreter(vm.currentCall.CallId, vm.currentCase.InterpreterId, false)\r\n .then(callSuccess)\r\n .catch(callError);\r\n }\r\n\r\n function callSuccess(data) {\r\n if (data === false) {\r\n accountservice.logMessage('vox-scheduled-relay-interpretation.connectRareLanguageInterpreter Action Failed. CallId: ' +\r\n vm.currentCall.CallId, vm.logLevel.Warn);\r\n callError();\r\n } else {\r\n if (relayInterpreterId !== null) {\r\n accountservice.logMessage('vox-scheduled-relay-interpretation.connectRareLanguageInterpreter Put relay interpreter onHold. RelayInterpreterId: ' +\r\n relayInterpreterId + ' CallId: ' + vm.currentCall.CallId, vm.logLevel.Warn);\r\n updateInterpreterHoldStatus(relayInterpreterId, true);\r\n }\r\n vm.isCustomerOnHold = true;\r\n }\r\n }\r\n\r\n function callError() {\r\n vm.connectingRareLanguageInterpreter = false;\r\n showInstructionMessage('Failed to connect Rare Language Interpreter.');\r\n }\r\n }\r\n\r\n function connectRelayInterpreter() {\r\n vm.connectingRelayInterpreter = true;\r\n\r\n switchParticipant(true, true, true)\r\n .then(callHoldSuccess)\r\n .catch(callError);\r\n\r\n function callHoldSuccess() {\r\n return operatorservice\r\n .findInterpreter(vm.currentCase.RelayLanguageId, vm.currentCall.CallId)\r\n .then(callSuccess)\r\n .catch(callError);\r\n }\r\n\r\n function callSuccess(data) {\r\n if (data === false) {\r\n\r\n operatorservice\r\n .checkLanguageServiceTimeout(vm.currentCall.CallId)\r\n .then(function (languageServiceIsTimeouted) {\r\n vm.languageServiceIsTimeouted = languageServiceIsTimeouted;\r\n })\r\n .finally(function() {\r\n accountservice.logMessage('vox-scheduled-relay-interpretation.connectRelayInterpreter Action Failed|CallId:' +\r\n vm.currentCall.CallId, vm.logLevel.Warn);\r\n callError();\r\n });\r\n } else {\r\n accountservice.logMessage('vox-scheduled-relay-interpretation.connectRelayInterpreter. Put rare Interpreter on hold. RareInterpreterId: ' +\r\n vm.currentCase.InterpreterId + ' CallId: ' + vm.currentCall.CallId, vm.logLevel.Warn);\r\n updateInterpreterHoldStatus(vm.currentCase.InterpreterId, true);\r\n vm.relayInterpreterConnectFailed = false;\r\n }\r\n }\r\n\r\n function callError() {\r\n vm.connectingRelayInterpreter = false;\r\n vm.relayInterpreterConnectFailed = true;\r\n showInstructionMessage('Failed to connect Relay Interpreter. Click on Connect Language Service button to connect Language Service.');\r\n }\r\n }\r\n\r\n function callLanguageService(languageSelect) {\r\n vm.LanguageSelect = { GroupId: languageSelect.GroupId, Name: languageSelect.Name };\r\n vm.callingLanguageService = true;\r\n // log event Language select click button\r\n userservice.addCallEvent(callEvents.LSButtonClicked, vm.currentCall.CallId);\r\n\r\n switchParticipant(true, true, true)\r\n .then(callHoldSuccess)\r\n .catch(onError);\r\n\r\n function callHoldSuccess() {\r\n return operatorservice\r\n .findLanguageServiceInterpreterByGroup(vm.currentCase.RelayLanguageId, vm.currentCase.CustomerId, vm.currentCall.CallId, vm.LanguageSelect.GroupId)\r\n .catch(onError);\r\n }\r\n\r\n function onError() {\r\n vm.relayInterpreterConnectFailed = true;\r\n vm.callingLanguageService = false;\r\n showInstructionMessage('Failed to connect Relay Interpreter. Click on Connect Language Service or ' +\r\n 'Connect Relay Interpreter button to connect Relay Interpreter.');\r\n }\r\n }\r\n\r\n function conferenceAllParties() {\r\n vm.connectingParties = true;\r\n\r\n operatorservice\r\n .joinInterpretersWithCustomer(vm.currentCall.CallId, vm.currentCase.InterpreterId, relayInterpreterId)\r\n .then(connectSuccess)\r\n .catch(connectError)\r\n .finally(connectFinally);\r\n\r\n function connectSuccess() {\r\n vm.arePartiesConnected = true;\r\n showInstructionMessage('');\r\n }\r\n\r\n function connectError() {\r\n showInstructionMessage('Failed to conference all parties.');\r\n }\r\n\r\n function connectFinally() {\r\n vm.connectingParties = false;\r\n }\r\n }\r\n\r\n function updateInterpreterHoldStatus(interpreterId, isOnHold) {\r\n if (!interpreterId) {\r\n return $q.resolve();\r\n }\r\n\r\n return operatorservice\r\n .updateInterpreterHoldStatus(interpreterId, isOnHold, vm.currentCall.CallId)\r\n .then(function (data) {\r\n if (data === false) {\r\n accountservice.logMessage('vox-scheduled-relay-interpretation.holdCurrentCall Action Failed|CallId:' +\r\n vm.currentCall.CallId, vm.logLevel.Warn);\r\n return $q.reject();\r\n }\r\n\r\n if (interpreterId === relayInterpreterId) {\r\n vm.isRelayInterpreterOnHold = isOnHold;\r\n }\r\n\r\n if (interpreterId === vm.currentCase.InterpreterId) {\r\n vm.isRareLanguageInterpreterOnHold = isOnHold;\r\n }\r\n\r\n return $q.resolve();\r\n });\r\n }\r\n\r\n function updateCustomerHoldStatus(isOnHold) {\r\n return operatorservice.updateCustomerHoldStatus(vm.currentCall.CallId, isOnHold).then(function (data) {\r\n if (data === false) {\r\n accountservice.logMessage('vox-scheduled-relay-interpretation.updateCustomerHoldStatus Action Failed. CallId: ' +\r\n vm.currentCall.CallId, vm.logLevel.Warn);\r\n return $q.reject();\r\n }\r\n\r\n vm.isCustomerOnHold = isOnHold;\r\n return $q.resolve();\r\n });\r\n }\r\n\r\n function showInstructionMessage(message) {\r\n usermessageservice.notify(enums.Events.ShowInstructionMessage, { message: message });\r\n }\r\n\r\n function getRareInterpreterPhone() {\r\n if (vm.caseDisplay && vm.caseDisplay.InterpreterPhone) {\r\n return vm.caseDisplay.InterpreterPhone;\r\n }\r\n\r\n if (!vm.interpreters || !vm.currentCase) {\r\n return null;\r\n }\r\n\r\n var rareInterpreter = null;\r\n for (var i = 0; i < vm.interpreters.length; i++) {\r\n if (vm.interpreters[i].Id === vm.currentCase.InterpreterId) {\r\n rareInterpreter = vm.interpreters[i];\r\n break;\r\n }\r\n }\r\n\r\n if (!rareInterpreter) {\r\n return null;\r\n }\r\n\r\n return rareInterpreter.PhoneNumber;\r\n }\r\n\r\n /* This method is called when the connectMe, Language Select or Connect interpreter buttons are shown */\r\n function logButtonShowEvent(eventName) {\r\n if (vm.languageServiceIds && vm.languageServiceIds.length > 0) {\r\n return utilities.logButtonShowEvent(eventName, vm.currentCall.CallId);\r\n }\r\n\r\n return false;\r\n }\r\n\r\n function changeLanguageServiceSelection(languageService) {\r\n vm.LanguageSelect = { GroupId: languageService.GroupId, Name: languageService.Name };\r\n\r\n $cookies.put('SelectedLanguageServiceGroup_' + vm.languageId, languageService.GroupId);\r\n }\r\n\r\n function getSelectedLanguageService() {\r\n if (!vm.languageServiceIds || vm.languageServiceIds.length <= 0) {\r\n return undefined;\r\n }\r\n\r\n var preSelectedGroupId = $cookies.get('SelectedLanguageServiceGroup_' + vm.languageId);\r\n\r\n if (preSelectedGroupId !== undefined && preSelectedGroupId > 0 && vm.languageService) {\r\n for (var i = 0; i < vm.languageService.length; i++) {\r\n if (vm.languageService[i].GroupId === preSelectedGroupId) {\r\n return { GroupId: vm.languageService[i].GroupId, Name: vm.languageService[i].Name };\r\n }\r\n }\r\n }\r\n\r\n return { GroupId: 0, Name: 'Language Service' };\r\n }\r\n }\r\n})();\r\n\n(function () {\n 'use strict';\n\n angular\n .module('vox-leonis.operator')\n .directive('voxReconnectSpecificInterpreter', voxReconnectSpecificInterpreter);\n\n /* @ngInject */\n function voxReconnectSpecificInterpreter() {\n var directive = {\n bindToController: true,\n controller: ReconnectSpecificInterpreterController,\n controllerAs: 'vm',\n replace: true,\n restrict: 'E',\n scope: {\n 'callId': '=',\n 'callParticipants': '=',\n 'interpreterName': '=',\n 'interpreterId': '='\n },\n templateUrl: 'app/operator/vox-reconnect-specific-interpreter.html'\n };\n return directive;\n }\n\n ReconnectSpecificInterpreterController.$inject = ['$scope', '$timeout', 'accountservice', 'enums', 'operatorservice', 'operatorsignalreceiver', 'usermessageservice'];\n /* @ngInject */\n function ReconnectSpecificInterpreterController($scope, $timeout, accountservice, enums, operatorservice, operatorsignalreceiver, usermessageservice) {\n var vm = this;\n\n // functions called from the HTML\n vm.callInterpreter = callInterpreter;\n vm.connectInterpreter = connectInterpreter;\n\n // constants\n vm.callTitle = 'Put the customer on hold and call the interpreter';\n vm.connectTitle = 'Connect the interpreter with the customer';\n\n vm.callDisabled = false;\n vm.connectDisabled = true;\n vm.interpreterUnavailable = false;\n vm.logLevel = enums.LogLevel;\n\n activate();\n\n function activate() {\n $scope.$on(operatorsignalreceiver.callAnsweredEvent, callAnswered);\n $scope.$on(operatorsignalreceiver.callNotAnsweredEvent, interpreterMissedTheCall);\n checkIfInterpreterOnCall();\n }\n\n function interpreterMissedTheCall(event, data) {\n usermessageservice.notify(enums.Events.ShowInstructionMessage, {\n message: 'Failed to connect Scheduled Language Interpreter. Call status: ' + (data.callStatus.replace('-', ' ') || 'unknown') + '.'\n });\n }\n\n // If the interpreter is already on THIS call, don't enable the Call button (the Connect button is disabled by default)\n function checkIfInterpreterOnCall() {\n if (vm.callParticipants && vm.callParticipants.length) {\n for (var k = 0; k < vm.callParticipants.length; k++) {\n var callParticipant = vm.callParticipants[k];\n if (callParticipant.InterpreterId === vm.interpreterId) {\n vm.callDisabled = true;\n vm.connectDisabled = false;\n }\n }\n }\n }\n\n // Call the interpreter\n function callInterpreter() {\n vm.callDisabled = true;\n vm.connectDisabled = true;\n\n vm.callingInterpreter = true;\n vm.interpreterUnavailable = false;\n usermessageservice.notify('disableAllButtons', { message: true });\n var result = operatorservice.callInterpreter(vm.callId, vm.interpreterId, true);\n result.then(callSuccess, callShowError);\n\n // The service call succeeded!\n function callSuccess(data) {\n stopLadda();\n\n if (data === false) {\n accountservice.logMessage('vox-reconnect-specific-interpreter callInterpreter Action Failed. CallId: ' + vm.callId, vm.logLevel.Warn);\n callShowError();\n }\n else\n {\n usermessageservice.notify('disableAllButtons', { message: true });\n }\n }\n\n // If the service call fails or if it succeeds but we don't actually make a call...\n function callShowError() {\n stopLadda();\n vm.callDisabled = false;\n vm.interpreterUnavailable = true;\n usermessageservice.notify('disableAllButtons', { message: false });\n $timeout(callHideError, 5000);\n }\n\n // Hide the error\n function callHideError() {\n vm.interpreterUnavailable = false;\n }\n }\n\n // the interpreter has answered the operator's call, make sure the operator can connect the interpreter to the customer\n function callAnswered(event, data) {\n if (vm.interpreterId && (vm.interpreterId === data.interpreterId)) {\n vm.connectDisabled = false;\n usermessageservice.notify('disableAllButtons', { message: true });\n }\n }\n\n // (re)connect the interpreter with the customer\n function connectInterpreter() {\n vm.connectingInterpreter = true;\n vm.connectDisabled = true;\n\n operatorservice.connectInterpreter(vm.callId, vm.interpreterId).then(connectSuccess).finally(stopLadda);\n\n function connectSuccess(data) {\n\n accountservice.logMessage('vox-reconnect-specific-interpreter.connectInterpreter|Result: {(data === true ? \"Success\" : \"Fail\")}, CallId: ' + vm.callId, vm.logLevel.Trace);\n\n if (data === false) {\n // If we can't connect the interpreter with the customer, the intepreter probably hung up. Letting the Opertor click 'Connect'\n // again isn't likely to have any effect. Reset the UI so the Operator can try to call the interpreter again.\n vm.callDisabled = false;\n vm.connectDisabled = true;\n vm.cantConnectInterpreter = true;\n usermessageservice.notify('disableAllButtons', { message: false });\n $timeout(connectHideError, 5000);\n }\n }\n\n // Hide the error\n function connectHideError() {\n vm.cantConnectInterpreter = false;\n }\n }\n\n // stop the ladda animation\n function stopLadda() {\n vm.callingInterpreter = false;\n vm.connectingInterpreter = false;\n }\n }\n})();\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.operator')\r\n .directive('voxReconnectInterpreter', voxReconnectInterpreter);\r\n\r\n voxReconnectInterpreter.$inject = ['callservice'];\r\n\r\n /* @ngInject */\r\n function voxReconnectInterpreter(callservice) {\r\n var directive = {\r\n bindToController: true,\r\n controller: ReconnectInterpreterController,\r\n controllerAs: 'vm',\r\n replace: true,\r\n restrict: 'E',\r\n scope: {\r\n 'callId': '=',\r\n 'callEvents': '=',\r\n 'interpreters': '=',\r\n 'callParticipants': '=',\r\n 'languageId': '='\r\n },\r\n link: function postLink(scope) {\r\n var callEventsWatch = scope.$watch('vm.callEvents', function (callEvents) {\r\n if (callEvents) {\r\n\r\n var eventInfo = callservice.getInterpreterDroppedInfo(callEvents, scope.vm.languageId, scope.vm.interpreters);\r\n if (!eventInfo) {\r\n scope.vm.interpreterId = null;\r\n scope.vm.disconnectMessage = null;\r\n return;\r\n }\r\n\r\n scope.vm.interpreterId = eventInfo.interpreterId;\r\n scope.vm.disconnectMessage = eventInfo.reason;\r\n\r\n for (var j = 0; j < scope.vm.interpreters.length; j++) {\r\n if (scope.vm.interpreters[j].Id === scope.vm.interpreterId && scope.vm.interpreters[j].Status === 'InCall') {\r\n scope.vm.isReconnectInterpreterDisabled = false;\r\n break;\r\n }\r\n }\r\n\r\n checkIfInterpreterOnCall();\r\n }\r\n });\r\n\r\n function checkIfInterpreterOnCall() {\r\n // check if the interpreter is already on the call\r\n if (scope.vm.interpreterId && scope.vm.callParticipants && scope.vm.callParticipants.length) {\r\n for (var k = 0; k < scope.vm.callParticipants.length; k++) {\r\n var callParticipant = scope.vm.callParticipants[k];\r\n if (callParticipant.InterpreterId === scope.vm.interpreterId) {\r\n scope.vm.isReconnectInterpreterDisabled = false;\r\n scope.vm.callInterpreterDisabled = true;\r\n }\r\n }\r\n }\r\n }\r\n\r\n scope.$on('$destroy', function () {\r\n callEventsWatch();\r\n });\r\n },\r\n templateUrl: 'app/operator/vox-reconnect-interpreter.html'\r\n };\r\n return directive;\r\n }\r\n\r\n ReconnectInterpreterController.$inject = ['operatorservice', '$timeout', 'operatorsignalreceiver', '$scope', 'accountservice', 'enums'];\r\n /* @ngInject */\r\n function ReconnectInterpreterController(operatorservice, $timeout, operatorsignalreceiver, $scope, accountservice, enums) {\r\n var vm = this;\r\n vm.interpreterId = undefined;\r\n vm.callInterpreter = callInterpreter;\r\n vm.connectInterpreter = connectInterpreter;\r\n vm.disconnectMessage = undefined;\r\n vm.isReconnectInterpreterDisabled = true;\r\n vm.isInterpreterUnavailable = false;\r\n vm.callInterpreterDisabled = false;\r\n vm.logLevel = enums.LogLevel;\r\n\r\n activate();\r\n\r\n function activate() {\r\n $scope.$on(operatorsignalreceiver.callAnsweredEvent, callAnswered);\r\n }\r\n\r\n function callAnswered(event, data) {\r\n if (vm.interpreterId && vm.interpreterId === data.interpreterId) {\r\n // the interpreter has answered the operator's call, make sure the operator can connect the interpreter to the customer\r\n vm.isReconnectInterpreterDisabled = false;\r\n }\r\n }\r\n\r\n function callInterpreter() {\r\n vm.connectingInterpreter = true;\r\n var result = operatorservice.callInterpreter(vm.callId, vm.interpreterId, true);\r\n result.then(function (data) {\r\n if (data === true) {\r\n vm.isInterpreterUnavailable = false;\r\n vm.connectingInterpreter = false;\r\n vm.callInterpreterDisabled = true;\r\n }\r\n else {\r\n accountservice.logMessage('vox-reconnect-interpreterdirective.callInterpreter Action Failed|CallId:' + vm.callId, vm.logLevel.Warn);\r\n vm.isInterpreterUnavailable = true;\r\n vm.isReconnectInterpreterDisabled = true;\r\n vm.connectingInterpreter = false;\r\n vm.callInterpreterDisabled = false;\r\n\r\n // Make the error disappear after 5 seconds\r\n $timeout(function () {\r\n vm.isInterpreterUnavailable = false;\r\n }, 5000);\r\n }\r\n });\r\n }\r\n\r\n function connectInterpreter() {\r\n vm.connectingInterpreter = true;\r\n vm.isReconnectInterpreterDisabled = true;\r\n operatorservice\r\n .connectInterpreter(vm.callId, vm.interpreterId)\r\n .then(function (result) {\r\n if (result === false) {\r\n accountservice.logMessage('x-reconnect-interpreterdirective.connectInterpreter Action Failed|CallId:' + vm.callId, vm.logLevel.Warn);\r\n }\r\n })\r\n .finally(function () {\r\n vm.connectingInterpreter = false;\r\n });\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.operator')\r\n .directive('voxOperatorsTable', voxOperatorsTable);\r\n\r\n /* @ngInject */\r\n function voxOperatorsTable() {\r\n var directive = {\r\n bindToController: true,\r\n controller: OperatorsTableController,\r\n controllerAs: 'vm',\r\n replace: true,\r\n restrict: 'E',\r\n scope: {\r\n 'operators': '=',\r\n 'operatorCount': '='\r\n },\r\n link: function postLink(scope, element, attrs, vm) {\r\n scope.$watch('vm.displayedCollection', function (val) {\r\n if (val) {\r\n vm.operatorCount = val.length;\r\n }\r\n });\r\n },\r\n templateUrl: 'app/operator/vox-operators-table.html'\r\n };\r\n return directive;\r\n }\r\n\r\n /* @ngInject */\r\n function OperatorsTableController() {\r\n var vm = this;\r\n }\r\n})();\r\n\n(function () {\n 'use strict';\n\n angular\n .module('vox-leonis.operator')\n .directive('voxOperator', voxOperator);\n\n /* @ngInject */\n function voxOperator() {\n var directive = {\n bindToController: true,\n controller: OperatorController,\n controllerAs: 'vm',\n replace: true,\n restrict: 'E',\n scope: {\n 'operator': '=',\n 'roles': '=',\n 'callType': '='\n },\n templateUrl: 'app/operator/vox-operator.html'\n };\n return directive;\n }\n\n OperatorController.$inject = ['$cookies', '$q', '$scope', '$filter', '$state', '$timeout', '$uibModal', '$uibModalStack',\n 'accountservice', 'appsettingsservice', 'callEvents', 'callservice', 'constants', 'dataservice', 'enums',\n 'operatorservice', 'operatorsignalreceiver', 'preferences', 'reducecallfrequencyservice', 'usermessageservice', 'utilities'];\n /* @ngInject */\n function OperatorController($cookies, $q, $scope, $filter, $state, $timeout, $uibModal, $uibModalStack,\n accountservice, appsettingsservice, callEvents, callservice, constants, dataservice, enums,\n operatorservice, operatorsignalreceiver, preferences, reducecallfrequencyservice, usermessageservice, utilities) {\n\n var vm = this;\n\n var lodash = window._;\n var callDispositionTimeout = 10000;\n appsettingsservice.getAppSetting(preferences.GetCallDispositionTimeoutMilliseconds, callDispositionTimeout).then(function (data) {\n callDispositionTimeout = data;\n });\n\n var enableCallDisposition = 'true';\n appsettingsservice.getAppSetting(preferences.GetCallDispositionFlag, enableCallDisposition).then(function (data) {\n enableCallDisposition = data;\n });\n\n vm.showNonIVRLanguagesDropdown = false;\n appsettingsservice.getAppSetting(preferences.ShowNonIVRLanguagesDropdown, vm.showNonIVRLanguagesDropdown).then(function (data) {\n vm.showNonIVRLanguagesDropdown = (data === 'true');\n });\n\n vm.filterOverflowVendorsBasedOnLanguage = false;\n appsettingsservice.getAppSetting(preferences.FilterOverflowVendorsBasedOnLanguage, vm.filterOverflowVendorsBasedOnLanguage).then(function (data) {\n vm.filterOverflowVendorsBasedOnLanguage = (data === 'true');\n });\n\n vm.getLoggedInInterpretersDelay = 1000;\n vm.getOperatorDelay = 1000;\n\n vm.logButtonShowEvent = logButtonShowEvent;\n\n activate();\n\n $scope.$on('showThirdParty', function () {\n vm.showThirdParty = true;\n });\n $scope.$on('hideThirdParty', function () {\n vm.showThirdParty = false;\n });\n usermessageservice.subscribe($scope, 'disableAllButtons', function (event, data) {\n if (data.message) {\n vm.disableAllLanguageSelect = true;\n }\n else {\n vm.disableAllLanguageSelect = false;\n }\n });\n var submitTimer = 0;\n function activate() {\n initialize();\n listeners();\n\n var promises = {\n languages: getLanguages(),\n pools: getPools(),\n operators: getAllOperators(),\n interpreters: getAllInterpreters()\n };\n if (vm.roles.indexOf('Operator') >= 0) {\n promises.operator = getOperator();\n }\n getLoggedInInterpretersCall();\n\n return $q.all(promises).then(function (values) {\n vm.languages = utilities.buildLanguages(values.languages);\n if (vm.showNonIVRLanguagesDropdown) { $cookies.put(constants.Languages, JSON.stringify(vm.languages)); }\n vm.pools = values.pools;\n vm.operators = buildOperators(values.operators);\n vm.interpreters = utilities.buildInterpreters(values.interpreters, values.languages);\n getCurrentCall();\n }).catch(function (e) {\n if (e.status === 401) {\n $state.go('login');\n }\n });\n }\n\n // initialize variables\n function initialize() {\n // moved initialize code into separate function due to jshint error \"the function had too many statements\"\n vm.currentCall = undefined;\n vm.currentCustomer = undefined;\n vm.currentLanguages = undefined;\n vm.currentMetaData = undefined;\n vm.operators = undefined;\n vm.pools = undefined;\n vm.interpreters = undefined;\n vm.languages = undefined;\n vm.languageList = undefined;\n vm.inCallInterpreters = undefined;\n vm.loggedInInterpreters = undefined;\n vm.selectedLanguage = undefined;\n vm.currentCase = undefined;\n vm.activeTable = 'loggedInInterpreters';\n vm.interpreterCount = undefined;\n vm.loggedInInterpreterCount = undefined;\n vm.operatorCount = undefined;\n vm.showCallDetails = undefined;\n vm.disconnectButtonDisabled = undefined;\n vm.callId = $cookies.get(constants.callId);\n vm.callEventType = 'NoInterpreter';\n vm.customerName = $cookies.get(constants.customerName);\n vm.changeActiveTable = changeActiveTable;\n vm.showThirdParty = false;\n vm.allOperatorsTableNeedsRefresh = false;\n vm.logLevel = enums.LogLevel;\n vm.disableAllLanguageSelect = true;\n vm.configureAppSettings = configureAppSettings;\n }\n\n function listeners() {\n $scope.$on(operatorsignalreceiver.alertStartEvent, alertStart);\n $scope.$on(operatorsignalreceiver.alertStopEvent, alertStop);\n $scope.$on(operatorsignalreceiver.callConnectedEvent, callConnected);\n $scope.$on(operatorsignalreceiver.testCallConnectedEvent, testCallConnected);\n $scope.$on(operatorsignalreceiver.callEndedEvent, callEnded);\n $scope.$on(operatorsignalreceiver.missedCallEvent, missedCall);\n $scope.$on(operatorsignalreceiver.refreshDataEvent, refreshData);\n $scope.$on(operatorsignalreceiver.youHaveACallEvent, youHaveACall);\n\n $scope.$on(operatorsignalreceiver.callAnsweredEvent, getCurrentCall);\n $scope.$on(operatorsignalreceiver.interpreterLeftTheCallEvent, getCurrentCall);\n }\n\n function setAllInterpretersTable() {\n getAllInterpreters().then(function (interpreters) {\n vm.interpreters = utilities.buildInterpreters(interpreters, vm.languages);\n });\n }\n\n function setAllOperatorsTable() {\n vm.allOperatorsTableNeedsRefresh = false;\n\n if (vm.operators) {\n //update the current users status to the list of all operators locally\n var operatorToSingleUpdate = vm.operators.find(\n function (list) {\n var rowToUpdate = list.Id === vm.operator.Id;\n return rowToUpdate;\n });\n if (operatorToSingleUpdate) {\n operatorToSingleUpdate.Status = vm.operator.Status;\n }\n }\n\n reducecallfrequencyservice.call(constants.operatorGetAllOperators, function () {\n getAllOperators().then(function (operators) {\n vm.operators = buildOperators(operators);\n });\n }, vm.getOperatorDelay);\n }\n\n function configureAppSettings(userId) {\n appsettingsservice.getAppSetting(preferences.GetLoggedInInterpretersDelayMilliseconds, vm.getLoggedInInterpretersDelay, userId).then(function (data) {\n vm.getLoggedInInterpretersDelay = data;\n });\n\n appsettingsservice.getAppSetting(preferences.GetOperatorDelayMilliseconds, vm.getOperatorDelay, userId).then(function (data) {\n vm.getOperatorDelay = data;\n });\n }\n\n function changeActiveTable(tableName) {\n vm.activeTable = tableName;\n if (tableName === 'allOperators' && vm.allOperatorsTableNeedsRefresh) {\n setAllOperatorsTable();\n }\n }\n\n function showCallDetails() {\n if (!vm.currentCall) {\n vm.showCallDetails = false;\n vm.callType = 'Operator';\n }\n else {\n for (var i = 0; i < vm.currentCall.Participants.length; i++) {\n if (vm.currentCall.Participants[i].OperatorId === vm.operator.Id) {\n vm.showCallDetails = true;\n vm.callType = 'Operator';\n break;\n }\n else {\n vm.callType = 'Interpreter';\n }\n }\n // show the 3rd-party list when the number of participants is > 1\n // (i.e.an operator is in call with a 3rd-party or a language service_.\n vm.showThirdParty = (vm.currentCall.Participants.length >= 2);\n }\n }\n\n // Data retrieval\n function getCurrentCall() {\n var status = vm.operator ? vm.operator.Status : '';\n if (status === enums.PersonStatusNames.InCall) {\n operatorservice.getCurrentCall().then(function (data) {\n if (data !== '') {\n vm.currentCall = data.Call;\n vm.currentCustomer = data.Customer;\n vm.currentLanguages = data.Languages;\n vm.currentMetaData = data.Metadata;\n vm.currentSipCallData = data.SipCallData;\n vm.currentCase = data.Case;\n vm.currentCallLanguage = getCallLanguage(data.Call);\n vm.languageList = vm.showNonIVRLanguagesDropdown ? getNonIVRLanguages() : vm.languages;\n\n showCallDetails();\n\n if (enableCallDisposition === 'false') {\n vm.disconnectButtonDisabled = true;\n }\n\n usermessageservice.notify('notify', { eventName: 'operatorDetails', operatordata: vm.operator });\n // show metadata details\n usermessageservice.notify('notify', { eventName: 'metadataDetails', callId: vm.currentCall.CallId, metadata: vm.currentMetaData });\n\n if (vm.currentSipCallData) {\n usermessageservice.notify('notify', { eventName: 'sipCallDataDetails', callId: vm.currentCall.CallId, sipCallData: vm.currentSipCallData });\r\n }\n // show Customer details\n usermessageservice.notify('notify', { eventName: 'customerDetails', callId: vm.currentCall.CallId, customerdata: vm.currentCustomer });\n }\n else {\n accountservice.logMessage('vox-operatordirective.getCurrentCall Action Failed', vm.logLevel.Warn);\n }\n });\n }\n }\n\n function getOperator() {\n return operatorservice.get().then(function (operator) {\n if (operator !== '') {\n vm.operator = operator;\n vm.configureAppSettings(vm.operator.Id);\n return vm.operator;\n }\n else {\n accountservice.logMessage('vox-operatordirective.getOperator Action Failed', vm.logLevel.Warn);\n }\n });\n }\n\n function getCallLanguage(call) {\n var events = call.Events || [];\n\n for (var i = events.length - 1; i >= 0; i--) {\n var event = events[i];\n\n if (event.LanguageId && event.StatusEvent === enums.CallStatusNames.LanguageSelected) {\n return event.LanguageId;\n }\n }\n\n return call.LanguageId;\n }\n\n function getNonIVRLanguages() {\n var languagesCache = JSON.parse($cookies.get(constants.Languages));\n vm.languages = languagesCache ? languagesCache : utilities.buildLanguages(getLanguages());\n var filteredLanguages = vm.languages;\n\n for (var i = filteredLanguages.length - 1; i >= 0; i--) {\n\n for (var j = 0; j < vm.currentLanguages.length; j++) {\n\n if (filteredLanguages[i] && (filteredLanguages[i].value === vm.currentLanguages[j].Name)) {\n filteredLanguages.splice(i, 1);\n }\n }\n }\n return filteredLanguages;\n }\n\n function getAllOperators() {\n return operatorservice.getAll().then(function (operators) {\n return operators;\n });\n }\n\n function getAllInterpreters() {\n return operatorservice.getInterpreters().then(function (interpreters) {\n return interpreters;\n });\n }\n\n function getLoggedInInterpreters() {\n return operatorservice.getLoggedInInterpreters().then(function (loggedInInterpreters) {\n return loggedInInterpreters;\n });\n }\n\n function getLanguages() {\n return dataservice.getLanguages().then(function (languages) {\n return languages;\n });\n }\n\n function getPools() {\n return dataservice.getPools().then(function (pools) {\n return pools;\n });\n }\n\n function buildOperators(operators) {\n if (operators) {\n return operators.map(function (operator) {\n return {\n Id: operator.Id, FirstName: operator.FirstName, LastName: operator.LastName, Status: operator.Status,\n PhoneNumber: operator.TempPhoneNumber || operator.PhoneNumber, Pools: utilities.buildPoolsList(operator.Pools)\n };\n });\n }\n return [];\n }\n\n // Event Listeners\n\n function alertStart(event, data) {\n getCurrentCall();\n $scope.$apply(function () {\n vm.alert = data;\n });\n }\n\n function alertStop(event, desiredStatus) {\n $scope.$apply(function () {\n vm.alert = undefined;\n });\n }\n\n function callConnected(event, data) {\n $scope.$apply(function () {\n vm.currentCall = data.call;\n vm.currentCustomer = data.customer;\n vm.currentLanguages = data.languages;\n vm.currentMetaData = data.metadata;\n vm.currentCase = data.caseData;\n vm.disconnectButtonDisabled = false;\n vm.callId = data.call.CallId;\n vm.customerName = data.customer.Name;\n vm.currentSipCallData = data.SipCallData;\n vm.languageList = vm.showNonIVRLanguagesDropdown ? getNonIVRLanguages() : vm.languages;\n usermessageservice.notify('notify', { eventName: 'operatorDetails', operatordata: vm.operator });\n // show Customer details\n usermessageservice.notify('notify', { eventName: 'customerDetails', callId: vm.currentCall.CallId, customerdata: vm.currentCustomer });\n // show metadata details\n usermessageservice.notify('notify', { eventName: 'metadataDetails', callId: vm.currentCall.CallId, metadata: vm.currentMetaData });\n\n if (vm.currentSipCallData) {\n usermessageservice.notify('notify', { eventName: 'sipCallDataDetails', callId: vm.currentCall.CallId, sipCallData: vm.currentSipCallData });\r\n }\n $cookies.put(constants.referenceId, data.call.ReferenceId);\n $cookies.put(constants.userRole, constants.Operator);\n $cookies.put(constants.callId, data.call.CallId);\n $cookies.put(constants.customerName, data.customer.Name);\n $cookies.put(constants.profileName, data.customer.ProfileName);\n if (enableCallDisposition === 'false') {\n vm.disconnectButtonDisabled = true;\n }\n if (callservice.interpreterDropped(vm.currentCall.Events)) {\n var message = 'Interpreter was abruptly dropped from conference call with this customer. Please click the feedback button and collect details from customer.';\n usermessageservice.notify(enums.Events.ShowInstructionMessage, { message: message });\n }\n });\n showCallDetails();\n }\n\n function testCallConnected(event, data) {\n $scope.$apply(function () {\n $cookies.put(constants.callId, data.callId);\n });\n }\n\n function callEnded(event, data) {\n $scope.$apply(function () {\n if (vm.currentLanguages) {\n for (var i = 0; i < vm.currentLanguages.length; i++) {\n $cookies.put('SelectedLanguageServiceGroup_' + vm.currentLanguages[i].Id, undefined);\n }\n }\n\n vm.currentCall = undefined;\n vm.currentCustomer = undefined;\n vm.currentLanguages = undefined;\n vm.currentMetaData = undefined;\n vm.showThirdParty = false;\n vm.currentCase = undefined;\n\n // show metadata details\n usermessageservice.notify('notify', { eventName: 'metadataDetails', callId: undefined, metadata: undefined });\n usermessageservice.notify('notify', { eventName: 'sipCallDataDetails', callId: undefined, sipCallData: undefined });\n\n $cookies.put(callEvents.LSButtonVisible, undefined);\n $cookies.put(callEvents.ConnectInterpreterButtonVisible, undefined);\n $cookies.put(callEvents.ConnectMeButtonVisible, undefined);\n $cookies.put(callEvents.HangupButtonVisible, undefined);\n\n usermessageservice.notify(enums.Events.ShowInstructionMessage, { message: '' });\n });\n showCallDetails();\n }\n\n function missedCall(event, data) {\n $scope.$apply(function () {\n utilities.setRootScopeTitle('You missed a call');\n vm.currentCall = undefined;\n vm.currentCustomer = undefined;\n vm.currentLanguages = undefined;\n vm.currentMetaData = undefined;\n vm.currentCase = undefined;\n });\n showCallDetails();\n }\n\n function getLoggedInInterpretersCall() {\n reducecallfrequencyservice.call(constants.operatorGetLoggedInInterpreters, function () {\n getLoggedInInterpreters().then(function (loggedInInterpreters) {\n vm.loggedInInterpreters = utilities.buildLoggedInInterpreters(loggedInInterpreters);\n });\n }, vm.getLoggedInInterpretersDelay);\n }\n\n function refreshData(event, data) {\n $scope.$apply(function () {\n switch (data.property) {\n case 'InterpreterStatus':\n if (!data.interpreterEnvelope || !data.interpreterEnvelope.Interpreter) {\n getLoggedInInterpretersCall();\n } else {\n changeLoggedInInterpreterState(data.interpreterEnvelope);\n }\n break;\n case 'OperatorStatus':\n if (vm.activeTable === 'allOperators') {\n setAllOperatorsTable();\n } else {\n // since we are not actively looking at this table, mark it as needing a refresh\n vm.allOperatorsTableNeedsRefresh = true;\n }\n break;\n case 'RefreshData':\n getOperator();\n break;\n }\n });\n }\n\n function changeLoggedInInterpreterState(interpreterEnvelope) {\n switch (interpreterEnvelope.Action) {\n case 1:\n updateInterpreters(interpreterEnvelope.Interpreter);\n break;\n case 2:\n removeInterpreter(interpreterEnvelope.Interpreter.Id);\n break;\n }\n\n updateInterpreterStatusInfoInAllInterpretersTab(interpreterEnvelope.Interpreter);\n }\n\n function updateInterpreterStatusInfoInAllInterpretersTab(interpreter) {\n var indexInListOfAll = lodash.findIndex(vm.interpreters, function (i) {\n return i.Id === interpreter.Id;\n });\n if (vm.interpreters[indexInListOfAll]) {\n vm.interpreters[indexInListOfAll].Status = interpreter.Status;\n vm.interpreters[indexInListOfAll].LastLogin = interpreter.LastLogin;\n vm.interpreters[indexInListOfAll].LastLoginDisplay = $filter('date')(interpreter.LastLogin, 'medium');\r\n vm.interpreters[indexInListOfAll].IsLanguageService = utilities.getInterpreterLoginLogoutButtonState(interpreter);\r\n }\r\n }\n\n function updateInterpreters(interpreter) {\r\n if (!vm.loggedInInterpreters) {\r\n vm.loggedInInterpreters = utilities.buildLoggedInInterpreters([interpreter]);\r\n return;\r\n }\r\n\r\n var index = lodash.findIndex(vm.loggedInInterpreters, function (i) {\r\n return i.Id === interpreter.Id;\r\n });\r\n var loggedInInterpreter = utilities.buildLoggedInInterpreter(interpreter);\r\n if (index === -1) {\r\n vm.loggedInInterpreters.push(loggedInInterpreter);\r\n vm.loggedInInterpreters = lodash.orderBy(vm.loggedInInterpreters, ['LastName', 'FirstName']);\r\n } else {\r\n vm.loggedInInterpreters[index] = loggedInInterpreter;\r\n }\r\n }\n\n function removeInterpreter(id) {\n vm.loggedInInterpreters = lodash.filter(vm.loggedInInterpreters, function (i) {\n return i.Id !== id;\n });\n }\n\n function youHaveACall(event, data) {\n utilities.setRootScopeTitle('You have a call');\n // close any existing modals before opening a new one\n $uibModalStack.dismissAll('');\n vm.modalInstance = $uibModal.open({\n animation: true,\n backdrop: 'static',\n bindToController: true,\n templateUrl: 'app/widgets/modal-call.html',\n controller: 'ModalCallController',\n controllerAs: 'vm',\n resolve: {\n data: function () {\n return data;\n }\n }\n });\n }\n\n /* When Connect button displays on UI this method triggers*/\n function logButtonShowEvent(eventName) {\n if (eventName === 'ConnectButtonVisible') {\n utilities.logButtonShowEvent(eventName, vm.callId);\n return true;\n }\n\n return false;\n }\n }\n})();\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.operator')\r\n .directive('voxLoggedinInterpretersTable', voxLoggedinInterpretersTable);\r\n\r\n /* @ngInject */\r\n function voxLoggedinInterpretersTable() {\r\n var directive = {\r\n bindToController: true,\r\n controller: LoggedinInterpretersTableController,\r\n controllerAs: 'vm',\r\n replace: true,\r\n restrict: 'E',\r\n scope: {\r\n 'loggedInInterpreters': '=',\r\n 'loggedInInterpreterCount': '=?'\r\n },\r\n link: function postLink(scope, element, attrs, vm) {\r\n scope.$watch('vm.displayedCollection', function (val) {\r\n if (val) {\r\n vm.loggedInInterpreterCount = val.length;\r\n }\r\n });\r\n },\r\n templateUrl: 'app/operator/vox-loggedin-interpreters-table.html'\r\n };\r\n return directive;\r\n }\r\n\r\n LoggedinInterpretersTableController.$inject = ['$scope', 'enums', 'operatorservice', 'accountservice'];\r\n\r\n /* @ngInject */\r\n function LoggedinInterpretersTableController($scope, enums, operatorservice, accountservice) {\r\n var vm = this;\r\n\r\n vm.roles = $scope.$parent.vm.roles;\r\n vm.interpreterLoginStatusChange = interpreterLoginStatusChange;\r\n vm.statuses = enums.PersonStatus;\r\n vm.logLevel = enums.LogLevel;\r\n\r\n function interpreterLoginStatusChange(interpreterId, loginStatus) {\r\n var status = (loginStatus === 'Login') ? 6 : 5; //6 = AvailablePhone //5 = Offline\n var reason = status === 6 ? enums.PersonStatusReason.Login : enums.PersonStatusReason.Logout;\r\n return operatorservice.setLoginStatus(interpreterId, vm.statuses[status].name, reason).then(function (result) {\r\n if (result === false) {\r\n accountservice.logMessage('Interpreter login status change Action Failed|UserId: ' + interpreterId, vm.logLevel.Warn);\r\n }\r\n });\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.operator')\r\n .directive('voxInterpretersTable', voxInterpretersTable);\r\n\r\n /* @ngInject */\r\n function voxInterpretersTable() {\r\n var directive = {\r\n bindToController: true,\r\n controller: InterpretersTableController,\r\n controllerAs: 'vm',\r\n replace: true,\r\n restrict: 'E',\r\n scope: {\r\n 'interpreters': '=',\r\n 'interpreterCount': '='\r\n },\r\n link: function postLink(scope, element, attrs, vm) {\r\n scope.$watch('vm.displayedCollection', function (val) {\r\n if (val) {\r\n vm.interpreterCount = val.length;\r\n }\r\n });\r\n },\r\n templateUrl: 'app/operator/vox-interpreters-table.html'\r\n };\r\n return directive;\r\n }\r\n InterpretersTableController.$inject = ['$scope', 'enums', 'operatorservice', 'accountservice'];\r\n\r\n /* @ngInject */\r\n function InterpretersTableController($scope, enums, operatorservice, accountservice) {\r\n var vm = this;\r\n\r\n vm.roles = $scope.$parent.vm.roles;\r\n vm.interpreterLoginStatusChange = interpreterLoginStatusChange;\r\n vm.statuses = enums.PersonStatus;\r\n vm.logLevel = enums.LogLevel;\r\n\r\n function interpreterLoginStatusChange(interpreterId, loginStatus) {\r\n var status = (loginStatus === 'Login') ? 6 : 5; //6 = AvailablePhone //5 = Offline\n var reason = status === 6 ? enums.PersonStatusReason.Login : enums.PersonStatusReason.Logout;\r\n return operatorservice.setLoginStatus(interpreterId, vm.statuses[status].name, reason).then(function (result) {\r\n if (result === false) {\r\n accountservice.logMessage('Interpreter login status change Action Failed|UserId: ' + interpreterId, vm.logLevel.Warn);\r\n }\r\n });\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.operator')\r\n .factory('operatorsignalreceiver', operatorsignalreceiver);\r\n\r\n operatorsignalreceiver.$inject = ['$http', '$rootScope', '$window', 'accountservice', 'enums', 'Hub', 'logger', 'operatorservice', 'signalreceiversmonitorservice'];\r\n /* @ngInject */\r\n function operatorsignalreceiver($http, $rootScope, $window, accountservice, enums, Hub, logger, operatorservice, signalreceiversmonitorservice) {\r\n\r\n var urlsToCheck = {\r\n 'InterpreterStatus': '/api/Operator/Interpreters/LoggedIn',\r\n 'OperatorStatus': '/api/Operator/Interpreters',\r\n 'RefreshData': '/api/Operator/Operators',\r\n 'RecentCalls': '/api/Admin/Calls/'\r\n };\r\n\r\n var service = {\r\n key: 'vox.operator',\r\n alertStartEvent: 'vox.operator.alertStartEvent',\r\n alertStopEvent: 'vox.operator.alertStopEvent',\r\n callAnsweredEvent: 'vox.operator.callAnswered',\r\n callNotAnsweredEvent: 'vox.operator.callNotAnswered',\r\n callConnectedEvent: 'vox.operator.callConnected',\n testCallConnectedEvent: 'vox.operator.testCallConnected',\r\n callEndedEvent: 'vox.operator.callEnded',\r\n missedCallEvent: 'vox.operator.missedCall',\r\n operatorStatusEvent: 'vox.operator.operatorStatus',\r\n refreshDataEvent: 'vox.operator.refreshData',\r\n thirdPartyStatusEvent: 'vox.operator.thirdPartyStatus',\n callCenterStatusEvent: 'vox.operator.callCenterStatus',\r\n languageServiceCallEndedEvent: 'vox.operator.languageServiceCallEnded',\r\n youHaveACallEvent: 'vox.operator.youHaveACall',\r\n redirectToLoginEvent: 'vox.operator.redirectToLoginEvent',\r\n logOutUserEvent: 'vox.interpreter.logOutUser',\r\n interpreterLeftTheCallEvent: 'vox.interpreter.interpreterLeftTheCallEvent',\r\n findInterpreterTimeoutEvent: 'vox.operator.findInterpreterTimeout',\r\n disconnect: disconnect,\r\n connect: connect,\r\n checkConnection: checkConnection,\r\n getIsConnected: getIsConnected\r\n };\r\n\r\n //declaring the hub connection\r\n var hub = new Hub('operatorHub', {\r\n\r\n useSharedConnection: true,\r\n\r\n //client side methods\r\n listeners: {\r\n 'alertStart': alertStart,\r\n 'alertStop': alertStop,\r\n 'callAnswered': callAnswered,\r\n 'callNotAnswered': callNotAnswered,\r\n 'callConnected': callConnected,\n 'testCallConnected': testCallConnected,\r\n 'callEnded': callEnded,\r\n 'missedCall': missedCall,\r\n 'operatorStatus': operatorStatus,\r\n 'refreshData': refreshData,\r\n 'youHaveACall': youHaveACall,\r\n 'thirdPartyStatus': thirdPartyStatus,\n 'callCenterStatus': callCenterStatus,\r\n 'languageServiceCallEnded': languageServiceCallEnded,\r\n 'redirectToLogin': redirectToLogin,\r\n 'logOutUser': logOutUser,\r\n 'interpreterLeftTheCall': interpreterLeftTheCall,\r\n 'findInterpreterTimeout': findInterpreterTimeout,\r\n 'refreshBrowser': refreshBrowser,\n 'operatorPostServerMessage': operatorPostServerMessage\r\n },\r\n\r\n //server side methods\r\n methods: ['checkConnection'],\r\n \r\n logging: true,\r\n\r\n autoConnect: false,\r\n\r\n transport: ['webSockets', 'serverSentEvents', 'longPolling'],\r\n\r\n //query params sent on initial connection\r\n queryParams: {\r\n //'token': 'exampletoken'\r\n },\r\n\r\n //handle connection error\r\n errorHandler: function (error) {\r\n logger.info(error);\r\n },\r\n\r\n // This method is called whenever the SignalR state changes\r\n stateChanged: function (state) {\r\n // When SignalR reconnects we refersh client side data\r\n // 2. reconnecting 1. connected\r\n if (state.oldState === 2 && state.newState === 1) {\r\n operatorservice.get().then(function (operator) {\r\n if (operator !== '') {\r\n accountservice.logMessage('operatorsignalreceiver.stateChanged Reconnected|UserId: ' + operator.Id, enums.LogLevel.Debug);\r\n } else {\r\n accountservice.logMessage('operatorsignalreceiver.stateChanged getOperator Action Failed', enums.LogLevel.Warn);\r\n }\r\n });\r\n\r\n operatorRefreshAll();\r\n }\r\n\r\n if (state.newState === 4) {\r\n signalreceiversmonitorservice.unTrack(service.key);\r\n }\r\n\r\n logger.log('Operator: SignalR state changed from ' + state.oldState + ' to ' + state.newState);\r\n $rootScope.$broadcast(enums.Events.SignalRStateChanged, state.newState);\r\n }\r\n });\r\n\r\n return service;\r\n\r\n ////////////////\r\n\r\n function alertStart(operatorId, data) {\r\n $rootScope.$broadcast(service.alertStartEvent, data);\r\n\r\n if (data.DesiredStatus && data.DesiredStatus !== null) {\r\n $rootScope.$broadcast(service.operatorStatusEvent, { statusName: data.DesiredStatus });\r\n }\r\n \r\n var message = 'operatorsignalreceiver.alertStart|UserId: ' + operatorId + ', ResourceAlertId: ' + data.ResourceAlertId +\r\n ', ResourceRequestId: ' + data.ResourceRequestId + ', CallId: ' + data.CallId + ', DesiredStatus: ' + data.DesiredStatus;\r\n accountservice.logMessage(message, enums.LogLevel.Trace);\r\n }\r\n\r\n function alertStop(operatorId, desiredStatus) {\r\n $rootScope.$broadcast(service.alertStopEvent);\r\n\r\n if (desiredStatus && desiredStatus !== null) {\r\n $rootScope.$broadcast(service.operatorStatusEvent, { statusName: desiredStatus });\r\n }\r\n \r\n accountservice.logMessage('operatorsignalreceiver.alertStop|UserId: ' + operatorId + 'DesiredStatus: ' + desiredStatus, enums.LogLevel.Trace);\r\n }\r\n\r\n function callAnswered(operatorId, interpreterId) {\r\n $rootScope.$broadcast(service.callAnsweredEvent, { interpreterId: interpreterId });\r\n accountservice.logMessage('operatorsignalreceiver.callAnswered|UserId: ' + operatorId + ', InterpreterId: ' + interpreterId, enums.LogLevel.Trace);\r\n }\r\n\r\n function callNotAnswered(operatorId, interpreterId, callStatus) {\r\n $rootScope.$broadcast(service.callNotAnsweredEvent, { interpreterId: interpreterId, callStatus: callStatus });\r\n accountservice.logMessage('operatorsignalreceiver.callNotAnswered|UserId: ' + operatorId + ', InterpreterId: ' + interpreterId + ', CallStatus: ' + callStatus, enums.LogLevel.Warn);\r\n }\r\n\r\n function callConnected(call, customer, languages, metadata, caseData, isLanguageServiceTimeoutExpired, sipcalldata) {\r\n $rootScope.$broadcast(service.callConnectedEvent, {\r\n call: call,\r\n customer: customer,\r\n languages: languages,\r\n metadata: metadata,\r\n caseData: caseData,\r\n isLanguageServiceTimeoutExpired: isLanguageServiceTimeoutExpired,\n SipCallData: sipcalldata\r\n });\r\n accountservice.logMessage('operatorsignalreceiver.callConnected|CallId: ' + call.CallId, enums.LogLevel.Trace);\r\n }\n\n function testCallConnected(callId) {\n $rootScope.$broadcast(service.testCallConnectedEvent, { callId: callId });\n accountservice.logMessage('operatorsignalreceiver.testCallConnected|CallId: ' + callId, enums.LogLevel.Trace);\r\n }\r\n\r\n function callEnded(operatorId) {\r\n $rootScope.$broadcast(service.callEndedEvent);\r\n accountservice.logMessage('operatorsignalreceiver.callEnded|UserId: ' + operatorId, enums.LogLevel.Trace);\r\n }\r\n\r\n function missedCall(callSid, operatorId) {\r\n $rootScope.$broadcast(service.missedCallEvent, { callSid: callSid });\r\n accountservice.logMessage('operatorsignalreceiver.missedCall|UserId: ' + operatorId + ', CallSid: ' + callSid, enums.LogLevel.Warn);\r\n }\r\n\r\n function operatorStatus(statusName, operatorId, reason, time) {\r\n $rootScope.$broadcast(service.operatorStatusEvent, { statusName: statusName, reason: reason, time: time });\r\n accountservice.logMessage('operatorsignalreceiver.operatorStatus|UserId: ' + operatorId + ', Status: ' + statusName + ', Reason: ' + reason + ', Time: ' + time, enums.LogLevel.Trace);\r\n }\n\n function operatorPostServerMessage(operatorId, message) {\n var timeStarted = new Date().toISOString();\n $rootScope.$broadcast(service.operatorPostServerMessageEvent, { message: message });\n var logMessage = 'operatorsignalreceiver.PostServerMessage|UserId: ' + operatorId + ', Message: ' + message + ', Received: ' + timeStarted;\n accountservice.logMessage(logMessage, enums.LogLevel.Trace);\r\n }\r\n\r\n function refreshData(property, interpreterEnvelope) {\r\n var isPreReqPending = false;\r\n var httpPendingReqList = $http.pendingRequests;\r\n for (var req = 0; req < httpPendingReqList.length; req++) {\r\n if (httpPendingReqList[req].url.indexOf(urlsToCheck[property]) > -1) {\r\n isPreReqPending = true;\r\n break;\r\n }\r\n }\r\n\r\n if (!isPreReqPending) {\r\n $rootScope.$broadcast(service.refreshDataEvent, { property: property, interpreterEnvelope: interpreterEnvelope });\r\n }\r\n }\r\n\r\n function thirdPartyStatus(participantId, statusName) {\r\n $rootScope.$broadcast(service.thirdPartyStatusEvent, { participantId: participantId, statusName: statusName });\r\n accountservice.logMessage('operatorsignalreceiver.thirdPartyStatus|ParticipantId: ' + participantId + ', Status: ' + statusName, enums.LogLevel.Trace);\r\n }\n\n function callCenterStatus(participantId, statusName) {\n $rootScope.$broadcast(service.callCenterStatusEvent, { participantId: participantId, statusName: statusName });\n accountservice.logMessage('operatorsignalreceiver.callCenterStatus|ParticipantId: ' + participantId + ', Status: ' + statusName, enums.LogLevel.Trace);\r\n }\r\n\r\n function languageServiceCallEnded(operatorId, interpreterId) {\r\n $rootScope.$broadcast(service.languageServiceCallEndedEvent, { interpreterId: interpreterId, operatorId: operatorId });\r\n accountservice.logMessage('operatorsignalreceiver.languageServiceCallEnded|languageServiceStatusId: ' + interpreterId + ', OperatorId: ' + operatorId, enums.LogLevel.Trace);\r\n }\r\n\r\n function youHaveACall(data) {\r\n $rootScope.$broadcast(service.youHaveACallEvent, data);\r\n accountservice.logMessage('operatorsignalreceiver.youHaveACall|UserId: ' + data.OperatorId + ', CallId: ' + data.CallId, enums.LogLevel.Trace);\r\n }\r\n\r\n function redirectToLogin(operatorId) {\r\n $rootScope.$broadcast(service.redirectToLoginEvent);\r\n accountservice.logMessage('operatorsignalreceiver.redirectToLogin|UserId: ' + operatorId, enums.LogLevel.Debug);\r\n }\r\n\r\n function logOutUser(operatorId) {\r\n $rootScope.$broadcast(service.logOutUserEvent);\r\n accountservice.logMessage('operatorsignalreceiver.logOutUser|UserId: ' + operatorId, enums.LogLevel.Debug);\r\n }\r\n\r\n function interpreterLeftTheCall(operatorId, interpreterId) {\r\n $rootScope.$broadcast(service.interpreterLeftTheCallEvent, { interpreterId: interpreterId });\r\n accountservice.logMessage('operatorsignalreceiver.interpreterLeftTheCall|UserId: ' + operatorId + ', InterpreterId: ' + interpreterId, enums.LogLevel.Trace);\r\n }\r\n\r\n function findInterpreterTimeout(operatorId, interpreterId) {\r\n $rootScope.$broadcast(service.findInterpreterTimeoutEvent);\r\n accountservice.logMessage('operatorsignalreceiver.findInterpreterTimeout|UserId: ' + operatorId, enums.LogLevel.Debug);\r\n }\r\n\r\n function operatorRefreshAll() {\r\n refreshData('RefreshData'); // Get operator\r\n refreshData('OperatorStatus'); // Get All operators\r\n refreshData('InterpreterStatus'); // Get All Interpreters and Get Logged in interpreters\r\n }\r\n\r\n function refreshBrowser() {\r\n $window.location.reload(true);\r\n }\r\n\r\n // Disconnect SignalR\r\n function disconnect() {\r\n var result = hub.disconnect();\r\n signalreceiversmonitorservice.logSignalRTimeout(result, hub, 'operatorsignalreceiver.disconnect');\r\n return result;\r\n }\r\n\r\n // Connect SignalR\r\n function connect() {\r\n var result = hub.connect();\r\n signalreceiversmonitorservice.logSignalRTimeout(result, hub, '.operatorsignalreceiverconnect');\r\n return result;\r\n }\r\n \r\n function checkConnection() {\r\n var result = hub.checkConnection();\r\n signalreceiversmonitorservice.logSignalRTimeout(result, hub, 'operatorsignalreceiver.checkConnection');\r\n return result;\r\n }\r\n\r\n function getIsConnected() {\r\n return hub.connection.state === 1;\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.monitor', [\r\n 'vox-leonis.core'\r\n ]);\r\n})();\r\n\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.monitor')\r\n .directive('voxMonitor', voxMonitor);\r\n\r\n /* @ngInject */\r\n function voxMonitor() {\r\n var directive = {\r\n bindToController: true,\r\n controller: MonitorController,\r\n controllerAs: 'vm',\r\n replace: true,\r\n restrict: 'E',\r\n scope: {\r\n 'monitor': '='\r\n }\r\n };\r\n return directive;\r\n }\r\n\r\n MonitorController.$inject = ['$scope', '$cookies', 'monitorservice', 'monitorsignalreceiver', 'constants'];\r\n /* @ngInject */\r\n function MonitorController($scope, $cookies, monitorservice, monitorsignalreceiver, constants) {\r\n var vm = this;\r\n\r\n activate();\r\n\r\n function activate() {\r\n monitorservice.get().then(function (monitor) {\r\n if (monitor !== '') {\r\n vm.monitor = monitor;\n \r\n }\r\n });\r\n\r\n $scope.$on(monitorsignalreceiver.monitorCurrentCallIdEvent, monitorCurrentCallId);\r\n }\r\n\r\n function monitorCurrentCallId(event, data) {\r\n vm.monitor.CurrentCallId = data.currentCallId;\n $cookies.put(constants.callId, data.currentCallId);\r\n }\r\n }\r\n})();\r\n\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.monitor')\r\n .factory('monitorsignalreceiver', monitorsignalreceiver);\r\n\r\n monitorsignalreceiver.$inject = ['$rootScope', '$window', 'accountservice', 'enums', 'Hub', 'logger', 'monitorservice', 'signalreceiversmonitorservice'];\r\n /* @ngInject */\r\n function monitorsignalreceiver($rootScope, $window, accountservice, enums, Hub, logger, monitorservice, signalreceiversmonitorservice) {\r\n\r\n var service = {\r\n key: 'vox.monitor',\r\n monitorStatusEvent: 'vox.monitor.monitorStatus',\r\n monitorCurrentCallIdEvent: 'vox.monitor.monitorCurrentCallId',\r\n refreshDataEvent: 'vox.monitor.refreshData',\r\n redirectToLoginEvent: 'vox.monitor.redirectToLoginEvent',\r\n logOutUserEvent: 'vox.interpreter.logOutUser',\r\n disconnect: disconnect,\r\n connect: connect,\r\n checkConnection: checkConnection,\r\n getIsConnected: getIsConnected\r\n };\r\n\r\n //declaring the hub connection\r\n var hub = new Hub('monitorHub', {\r\n\r\n useSharedConnection: true,\r\n\r\n //client side methods\r\n listeners: {\r\n 'monitorStatus': monitorStatus,\r\n 'monitorCurrentCallId': monitorCurrentCallId,\r\n 'refreshData': refreshData,\r\n 'redirectToLogin': redirectToLogin,\r\n 'logOutUser': logOutUser,\r\n 'refreshBrowser': refreshBrowser\r\n },\r\n\r\n //server side methods\r\n methods: ['checkConnection'],\r\n \r\n logging: true,\r\n\r\n autoConnect: false,\r\n\r\n transport: ['webSockets', 'serverSentEvents', 'longPolling'],\r\n\r\n //query params sent on initial connection\r\n queryParams: {\r\n //'token': 'exampletoken'\r\n },\r\n\r\n //handle connection error\r\n errorHandler: function (error) {\r\n logger.info(error);\r\n },\r\n\r\n // This method is called whenever the SignalR state changes\r\n stateChanged: function (state) {\r\n // When SignalR reconnects we refersh client side data\r\n // 2. reconnecting 1. connected\r\n if (state.oldState === 2 && state.newState === 1) {\r\n monitorservice.get().then(function (monitor) {\r\n if (monitor !== '') {\r\n accountservice.logMessage('monitorsignalreceiver.stateChanged Reconnected|UserId: ' + monitor.Id, enums.LogLevel.Trace);\r\n } else {\r\n accountservice.logMessage('monitorsignalreceiver.stateChanged getMonitor Action Failed', enums.LogLevel.Warn);\r\n }\r\n });\r\n monitorRefreshAll();\r\n }\r\n\r\n if (state.newState === 4) {\r\n signalreceiversmonitorservice.unTrack(service.key);\r\n }\r\n\r\n logger.log('Monitor: SignalR state changed from ' + state.oldState + ' to ' + state.newState);\r\n $rootScope.$broadcast(enums.Events.SignalRStateChanged, state.newState);\r\n }\r\n });\r\n\r\n return service;\r\n\r\n ////////////////\r\n function monitorStatus(statusName, monitorId, reason, time) {\r\n $rootScope.$broadcast(service.monitorStatusEvent, { statusName: statusName, reason: reason, time: time });\r\n accountservice.logMessage('monitorsignalreceiver.monitorStatus|UserId:' + monitorId + '|Status: ' + statusName + '|Reason:' + reason + '|Time:' + time, enums.LogLevel.Trace);\r\n }\r\n\r\n function monitorCurrentCallId(currentCallId, monitorId) {\r\n $rootScope.$broadcast(service.monitorCurrentCallIdEvent, { currentCallId: currentCallId });\r\n accountservice.logMessage('monitorsignalreceiver.monitorCurrentCallId. UserId: ' + monitorId + ' CurrentCallId: ' + currentCallId, enums.LogLevel.Trace);\r\n }\r\n\r\n function refreshData(property) {\r\n $rootScope.$broadcast(service.refreshDataEvent, { property: property });\r\n }\r\n\r\n function monitorRefreshAll() {\r\n refreshData('RecentCalls');\r\n }\r\n\r\n function redirectToLogin(monitorId) {\r\n $rootScope.$broadcast(service.redirectToLoginEvent);\r\n accountservice.logMessage('monitorsignalreceiver.redirectToLogin|UserId:' + monitorId, enums.LogLevel.Debug);\r\n }\r\n\r\n function logOutUser(monitorId) {\r\n $rootScope.$broadcast(service.logOutUserEvent);\r\n accountservice.logMessage('monitorsignalreceiver.logOutUser|UserId:' + monitorId, enums.LogLevel.Debug);\r\n }\r\n\r\n function refreshBrowser() {\r\n $window.location.reload(true);\r\n }\r\n\r\n // Disconnect SignalR\r\n function disconnect() {\r\n return hub.disconnect();\r\n }\r\n\r\n // Connect SignalR\r\n function connect() {\r\n return hub.connect();\r\n }\r\n \r\n function checkConnection() {\r\n return hub.checkConnection();\r\n }\r\n\r\n function getIsConnected() {\r\n return hub.connection.state === 1;\r\n }\r\n }\r\n})();\r\n\n(function ()\r\n{\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.login', [\r\n 'vox-leonis.core'\r\n ]);\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.login')\r\n .run(appRun);\r\n\r\n appRun.$inject = ['routerHelper'];\r\n /* @ngInject */\r\n function appRun(routerHelper) {\r\n routerHelper.configureStates(getStates());\r\n }\r\n\r\n function getStates() {\r\n return [\r\n {\r\n state: 'login',\r\n config: {\r\n url: '/',\r\n templateUrl: 'app/login/login.html',\r\n controller: 'LoginController',\r\n controllerAs: 'vm',\r\n title: 'Login',\r\n resolve: {\r\n getRoles: getRoles\r\n }\r\n }\r\n }\r\n ];\r\n }\r\n\r\n getRoles.$inject = ['$cookies', 'accountservice', 'session', 'constants'];\r\n /* @ngInject */\r\n function getRoles($cookies, accountservice, session, constants) {\n var currentRole = $cookies.get(constants.userRole);\n session.roles = undefined;\n\n if (currentRole !== undefined) {\r\n return accountservice.getRoles(true).then(function (data) {\r\n session.roles = data.Roles;\r\n return session.roles;\r\n }).catch(function () {\r\n return session.roles;\r\n });\n }\n else {\r\n return session.roles;\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.login')\r\n .controller('LoginController', LoginController);\r\n\r\n LoginController.$inject = ['$cookies', '$q', '$state', 'accountservice', 'appsettingsservice', 'constants', 'enums', 'logger', 'session'];\r\n /* @ngInject */\r\n function LoginController($cookies, $q, $state, accountservice, appsettingsservice, constants, enums, logger, session) {\r\n var vm = this;\r\n\r\n vm.activated = false;\r\n vm.loginError = undefined;\r\n vm.loginWaiting = false;\r\n vm.username = '';\r\n vm.password = '';\r\n vm.roles = session.roles;\r\n vm.login = login;\n vm.loginADB2C = loginADB2C;\n vm.redirectToADB2C = redirectToADB2C;\n vm.version = undefined;\r\n vm.voicePortalLoginMode = 'AzureDisabled';\n vm.oldLoginVisible = false;\n vm.setOldLoginVisible = setOldLoginVisible;\n\r\n activate();\r\n\r\n function activate() {\r\n redirect();\r\n vm.activated = true;\r\n }\r\n\r\n function login() {\r\n vm.loginError = undefined;\r\n vm.loginWaiting = true;\n vm.voicePortalLoginMode = 'AzureEnabled';\n accountservice.voicePortalLoginMode().then(function (data) {\n vm.voicePortalLoginMode = data;\n if (data === 'AzureEnabled') {\n location.replace('/ADB2C/Login');\n return;\n }\r\n return accountservice.login(vm.username, vm.password).then(function (data) {\r\n if (data.Failure !== null) {\r\n vm.loginError = data.Failure;\r\n logger.error(data.Failure);\r\n }\r\n else if (data.Roles !== null) {\r\n vm.roles = data.Roles;\r\n accountservice.logMessage('Successful login ' + vm.username, enums.LogLevel.Info);\r\n redirect();\r\n }\r\n }).catch(function (e) {\r\n if (e.status === 400) {\r\n vm.loginError = e.status;\r\n }\r\n }).finally(function () {\r\n vm.loginWaiting = false;\r\n });\r\n }).catch(function (e) {\r\n if (e.status === 400) {\r\n vm.loginError = e.status;\r\n }\r\n }).finally(function () {\r\n vm.loginWaiting = false;\r\n });\r\n }\n function setOldLoginVisible() {\n vm.oldLoginVisible = !vm.oldLoginVisible;\r\n }\n \n function redirectToADB2C() {\n location.replace('/ADB2C/Login');\n }\n function loginADB2C() {\r\n vm.loginError = undefined;\r\n vm.loginWaiting = true;\r\n vm.voicePortalLoginMode = 'AzureEnabled';\n accountservice.voicePortalLoginMode().then(function (data) {\n vm.voicePortalLoginMode = data;\n if (data !== 'AzureDisabled') {\n if (data === 'AzureEnabled') {\n return accountservice.loginADB2CAzureOnly().then(function (data) {\r\n if (data.Failure !== null) {\r\n vm.loginError = data.Failure;\r\n logger.error(data.Failure);\r\n }\r\n else if (data.Roles !== null) {\r\n vm.roles = data.Roles;\r\n accountservice.logMessage('Successful login ' + vm.username, enums.LogLevel.Info);\r\n redirect();\r\n }\r\n }).catch(function (e) {\r\n if (e.status === 400) {\r\n vm.loginError = e.status;\r\n }\r\n }).finally(function () {\r\n vm.loginWaiting = false;\r\n });\r\n } else {\n return accountservice.loginADB2C().then(function (data) {\r\n if (data.Failure !== null) {\r\n vm.loginError = data.Failure;\r\n logger.error(data.Failure);\r\n }\r\n else if (data.Roles !== null) {\r\n vm.roles = data.Roles;\r\n accountservice.logMessage('Successful login ' + vm.username, enums.LogLevel.Info);\r\n redirect();\r\n }\r\n }).catch(function (e) {\r\n if (e.status === 400) {\r\n vm.loginError = e.status;\r\n }\r\n }).finally(function () {\r\n vm.loginWaiting = false;\r\n });\r\n }\n }\r\n }).catch(function (e) {\r\n if (e.status === 400) {\r\n vm.loginError = e.status;\r\n }\r\n }).finally(function () {\r\n vm.loginWaiting = false;\n });\r\n }\r\n\r\n function redirect() {\r\n appsettingsservice.getAppVersion().then(function (data) {\r\n vm.version = data;\r\n });\r\n\r\n if (vm.roles !== undefined && vm.roles !== null) {\r\n if (vm.roles.indexOf('Interpreter') >= 0) {\r\n $cookies.put(constants.userRole, constants.Interpreter);\r\n }\r\n if (vm.roles.indexOf('Operator') >= 0) {\r\n $cookies.put(constants.userRole, constants.Operator);\r\n }\r\n if (vm.roles.indexOf('Admin') >= 0 && vm.roles.indexOf('Interpreter') === -1 && vm.roles.indexOf('Operator') === -1) {\r\n $state.go('admin');\r\n }\r\n else {\r\n $state.go('console');\r\n }\r\n } else {\n loginADB2C();\r\n }\r\n }\r\n }\r\n})();\r\n\n(function ()\r\n{\r\n 'use strict';\n\n angular\r\n .module('vox-leonis.layout', [\r\n 'vox-leonis.core'\r\n ]);\r\n})();\n\n(function () {\n 'use strict';\n\n /*jshint -W072 */\n\n angular\n .module('vox-leonis.layout')\n .directive('voxTopNav', voxTopNav);\n\n /* @ngInject */\n function voxTopNav() {\n var directive = {\n bindToController: true,\n controller: TopNavController,\n controllerAs: 'vm',\n restrict: 'EA',\n scope: {\n 'user': '=',\n 'version': '='\n },\n templateUrl: 'app/layout/vox-top-nav.html'\n };\n\n return directive;\n }\n\n TopNavController.$inject = ['$cookies', '$scope', '$state', '$uibModal', '$timeout', '$uibModalStack', '$window',\n 'twiliowebrtcservice', 'accountservice', 'constants', 'enums', 'interpretersignalreceiver', 'monitorsignalreceiver', 'operatorsignalreceiver',\n 'session', 'signalservice', 'usermessageservice', 'appsettingsservice', 'preferences', 'userservice', 'utilities',\n 'interpreterservice'\n ];\n\n /* @ngInject */\n function TopNavController($cookies, $scope, $state, $uibModal, $timeout, $uibModalStack, $window,\n twiliowebrtcservice, accountservice, constants, enums, interpretersignalreceiver, monitorsignalreceiver, operatorsignalreceiver,\n session, signalservice, usermessageservice, appsettingsservice, preferences, userservice, utilities,\n interpreterservice\n ) {\n var vm = this;\n\n vm.roles = session.roles;\n vm.reload = reload;\n vm.signOut = signOut;\n vm.logOut = logOut;\n vm.feedback = feedback;\n\n vm.hasRequiredStatusToSwitchNewVoicePortal = false;\n\n vm.hasAccessToNewInterpreterVoicePortal = false;\n vm.switchToInterpreterVoicePortal = switchToInterpreterVoicePortal;\n\n var refreshing = false;\n var contactMethod = $cookies.get('UserlatestContactMethod');\n var refreshRetainsCall = false;\n\n var switchingPortalDelay = 0;\n var switchingPortalMaxAge = 3600;\n\n var isInterpreter = session.roles.indexOf('Interpreter') >= 0;\n var ivrNewVoicePortalUsedByInterpreter = null;\n var ivrNewVoicePortalUsedByInterpreterMaxAge = 0;\n var interpreterVoicePortalFrontEndUrl = null;\n var isOtherThanInterpreter = !isInterpreter && session.roles.length > 0;\n \n var callOperatorsVoicePortalFrontEndUrl = null;\n\n appsettingsservice.getAppSetting(preferences.RefreshRetainsCall, refreshRetainsCall).then(function (data) {\n refreshRetainsCall = (data === true);\n });\n\n initSwitching();\n initInterpreterSwitching();\n initOperatorMonitorSwitching();\n\n $scope.$on(interpretersignalreceiver.logOutUserEvent, logOut);\n $scope.$on(operatorsignalreceiver.logOutUserEvent, logOut);\n $scope.$on(monitorsignalreceiver.logOutUserEvent, logOut);\n $scope.$on(interpretersignalreceiver.redirectToLoginEvent, redirectToLogin);\n $scope.$on(operatorsignalreceiver.redirectToLoginEvent, redirectToLogin);\n $scope.$on(monitorsignalreceiver.redirectToLoginEvent, redirectToLogin);\n\n $cookies.put(constants.lastRefreshTime, Date.now());\n\n function initSwitching() {\n if (!isInterpreter && !isOtherThanInterpreter) {\n return;\n }\n\n appsettingsservice.getAppSetting(preferences.PortalSwitchingPortalsDelay, switchingPortalDelay).then(function (data) {\n switchingPortalDelay = data;\n });\n\n usermessageservice.subscribe($scope, 'notify', function (event, data) {\n if (data.eventName === 'currentStatus') {\n var acceptableStatuses = [\n enums.PersonStatusNames.NotAvailable,\n enums.PersonStatusNames.Available,\n enums.PersonStatusNames.Unavailable,\n enums.PersonStatusNames.Offline,\n enums.PersonStatusNames.Away,\n ];\n vm.hasRequiredStatusToSwitchNewVoicePortal = acceptableStatuses.some(function (status) { return status === data.statusName; });\n }\n });\n }\n\n function initInterpreterSwitching() {\n if (!isInterpreter) {\n return;\n }\n userservice.getUserFullSetting(preferences.IvrNewVoicePortalUsedByInterpreter, ivrNewVoicePortalUsedByInterpreter).then(function (data) {\n if (data != null && data !== '') {\n ivrNewVoicePortalUsedByInterpreter = data['Value'];\n ivrNewVoicePortalUsedByInterpreterMaxAge = timespanToTotalSeconds(data['MaxAge'] !== undefined ? data['MaxAge'] : '00:00:00');\n }\n updateInterpreterVoicePortalAccess();\n });\n\n appsettingsservice.getIVPFrontEndUrl().then(function (data) {\n interpreterVoicePortalFrontEndUrl = data;\n updateInterpreterVoicePortalAccess();\n });\n }\n\n function initOperatorMonitorSwitching() {\n console.log('step 1');\n\n if (!isOtherThanInterpreter) {\n return;\n }\n console.log('step 1.2');\n appsettingsservice.getOVPFrontEndUrl().then(function (data) {\n callOperatorsVoicePortalFrontEndUrl = data;\n updateOperatorVoicePortalAccess();\n });\n }\n\n function updateInterpreterVoicePortalAccess() {\n if (ivrNewVoicePortalUsedByInterpreter != null && interpreterVoicePortalFrontEndUrl != null) {\n if (utilities.isTrue(ivrNewVoicePortalUsedByInterpreter)) {\n if (ivrNewVoicePortalUsedByInterpreterMaxAge >= switchingPortalMaxAge) {\n redirectToInterpreterVoicePortal();\n return;\n } else {\n showModalSwitchingToNewInterpreterPortal();\n }\n }\n vm.hasAccessToNewInterpreterVoicePortal = true;\n }\n }\n\n function updateOperatorVoicePortalAccess() {\n console.log('step 2');\n if (callOperatorsVoicePortalFrontEndUrl != null) {\n redirectToCallOperatorsVoicePortal();\n }\n }\n\n function switchToInterpreterVoicePortal() {\n userservice.setUserSetting(preferences.IvrNewVoicePortalUsedByInterpreter, true).then(function () {\n setTimeout(function () {\n redirectToInterpreterVoicePortal();\n }, switchingPortalDelay);\n });\n }\n\n function redirectToInterpreterVoicePortal() {\n interpreterservice.setStatus(enums.PersonStatusNames.Unavailable, '0').then(function () {\n $window.location.href = interpreterVoicePortalFrontEndUrl;\n });\n }\n\n function redirectToCallOperatorsVoicePortal() {\n console.log('step 3');\n console.log('callOperatorsVoicePortalFrontEndUrl: ', callOperatorsVoicePortalFrontEndUrl);\n $window.location.href = callOperatorsVoicePortalFrontEndUrl;\n }\n\n function timespanToTotalSeconds(timespan) {\n return ((parseInt((timespan.slice(0,2))) * 3600) +\n (parseInt((timespan.slice(3,5))) * 60) +\n (parseInt((timespan.slice(6,8)))));\n }\n function reload() {\n var shouldReload = true;\n var warnStatus = isWarnStatus();\n if (warnStatus && contactMethod === '2') {\n if (!refreshRetainsCall) {\n shouldReload = $window.confirm('Your status is ' + vm.user.Status + '. Reloading might end the current call. Do you wish to continue?');\n }\n }\n\n if (shouldReload && !refreshing) {\n refreshing = true;\n $timeout(function () {\n refreshing = false;\n if (contactMethod === '2' && !refreshRetainsCall) {\n twiliowebrtcservice.disable(vm.user.Id);\n } else if (contactMethod === '2' && refreshRetainsCall) {\n if (warnStatus) {\n twiliowebrtcservice.setPortalRefresh(true, true);\n } else {\n twiliowebrtcservice.setPortalRefresh(true, false);\n }\n }\n\n $state.reload();\n signalservice.disconnect();\n signalservice.connect();\n }, 1000);\n }\n }\n\n function signOut() {\n var signOut = true;\n if (isWarnStatus()) {\n signOut = $window.confirm('Your status is ' + vm.user.Status + '. Are you sure you want to log out?');\n }\n\n if (signOut) {\n return vm.logOut();\n }\n }\n\n function logOut() {\n signalservice.disconnect();\n $cookies.remove('currentStatus', {path: '/'});\n usermessageservice.notify('notify', { eventName: 'currentStatus', statusName: null });\n $cookies.remove(constants.userRole, {path: '/'});\n //the logout event is also fired from signalR, that puts a user into offline state, disabling webRTC should also work here\n usermessageservice.notify('disableWebRTC', {message: vm.user.Id});\n return accountservice.logout().finally(function () {\n redirectToLogin();\n accountservice.voicePortalLoginMode().then(function (data) {\n vm.voicePortalLoginMode = data;\n if (data !== 'AzureDisabled') {\n location.replace('/ADB2C/Logout');\n }\n });\n });\n }\n\n function showModalSwitchingToNewInterpreterPortal() {\n // close any existing modals before opening a new one\n $uibModalStack.dismissAll('');\n vm.modalInstance = $uibModal.open({\n animation: true,\n backdrop: false,\n keyboard: false,\n bindToController: true,\n templateUrl: 'app/widgets/modal-new-interpreter-portal.html',\n controller: 'NewInterpreterPortalController',\n controllerAs: 'vm',\n resolve: {\n interpreterVoicePortalFrontEndUrl: function () {\n return interpreterVoicePortalFrontEndUrl;\n }\n }\n });\n }\n\n function showModalSwitchingToNewCallOperatorsPortal() {\n // close any existing modals before opening a new one\n $uibModalStack.dismissAll('');\n vm.modalInstance = $uibModal.open({\n animation: true,\n backdrop: false,\n keyboard: false,\n bindToController: true,\n templateUrl: 'app/widgets/modal-new-call-operators-portal.html',\n controller: 'NewCallOperatorsPortalController',\n controllerAs: 'vm',\n resolve: {\n callOperatorsVoicePortalFrontEndUrl: function () {\n return callOperatorsVoicePortalFrontEndUrl;\n }\n }\n });\n }\n\n function feedback() {\n // close any existing modals before opening a new one\n $uibModalStack.dismissAll('');\n vm.modalInstance = $uibModal.open({\n animation: true,\n backdrop: 'static',\n bindToController: true,\n templateUrl: 'app/widgets/modal-feedback.html',\n controller: 'ModalFeedbackController',\n controllerAs: 'vm',\n resolve: {\n user: function () {\n return vm.user;\n },\n roles: function () {\n return vm.roles;\n }\n }\n });\n }\n\n function redirectToLogin() {\n $state.go('login');\n }\n\n // Returns true if the user's status warrants a warning when logging out or navigating away; returns false otherwise.\n function isWarnStatus() {\n if (vm.user) {\n switch (vm.user.Status) {\n case enums.PersonStatusNames.InCall:\n case enums.PersonStatusNames.Alerting:\n case enums.PersonStatusNames.Ringing:\n case enums.PersonStatusNames.Reconnect:\n return true;\n }\n }\n return false;\n }\n\n // Warn the user if it's unwise to close the browser/tab and/or navigate away\n $window.onbeforeunload = function (e) {\n if (isWarnStatus()) {\n // Most browsers show a standard message for this event that does not include the returned text but\n // you never know so we return something meaningful.\n return 'Your status is ' + vm.user.Status + '. Are you sure you want to leave the page?';\n }\n\n // safe to leave\n return undefined;\n };\n }\n})();\n\n(function ()\r\n{\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.interpreter', [\r\n 'vox-leonis.core'\r\n ]);\r\n})();\r\n\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.interpreter')\r\n .directive('voxInterpreter', voxInterpreter);\r\n\r\n /* @ngInject */\r\n function voxInterpreter() {\r\n var directive = {\r\n bindToController: true,\r\n controller: InterpreterController,\r\n controllerAs: 'vm',\r\n replace: true,\r\n restrict: 'E',\r\n scope: {\r\n 'interpreter': '=',\r\n 'callType': '='\r\n },\r\n templateUrl: 'app/interpreter/vox-interpreter.html'\r\n };\r\n return directive;\r\n }\r\n\r\n InterpreterController.$inject = ['$scope', '$q', '$state', 'logger', '$uibModal', '$uibModalStack', 'enums',\r\n 'interpreterservice', 'interpretersignalreceiver', 'utilities', 'accountservice', '$cookies', 'constants', 'usermessageservice', 'callEvents'];\r\n /* @ngInject */\r\n function InterpreterController($scope, $q, $state, logger, $uibModal, $uibModalStack, enums,\r\n interpreterservice, interpretersignalreceiver, utilities, accountservice, $cookies, constants, usermessageservice, callEvents) {\r\n var vm = this;\r\n\r\n vm.currentCall = undefined;\r\n vm.currentCustomer = undefined;\r\n vm.currentLanguageName = undefined;\r\n vm.callCenterPhoneNumber = undefined;\r\n vm.showCallDetails = undefined;\r\n vm.logLevel = enums.LogLevel;\r\n\r\n activate();\r\n\r\n function activate() {\r\n listeners();\r\n\r\n var promises = [getInterpreter()];\r\n return $q.all(promises).then(function () {\r\n getCurrentCall();\r\n logger.info('Activated Interpreter View');\r\n }).catch(function (e) {\r\n if (e.status === 401) {\r\n $state.go('login');\r\n }\r\n });\r\n }\r\n\r\n function listeners() {\r\n $scope.$on(interpretersignalreceiver.alertStartEvent, alertStart);\r\n $scope.$on(interpretersignalreceiver.alertStopEvent, alertStop);\r\n $scope.$on(interpretersignalreceiver.callConnectedEvent, callConnected);\r\n $scope.$on(interpretersignalreceiver.testCallConnectedEvent, testCallConnected);\r\n $scope.$on(interpretersignalreceiver.callEndedEvent, callEnded);\r\n $scope.$on(interpretersignalreceiver.missedCallEvent, missedCall);\r\n $scope.$on(interpretersignalreceiver.refreshDataEvent, refreshData);\r\n $scope.$on(interpretersignalreceiver.youHaveACallEvent, youHaveACall);\r\n }\r\n\r\n function showCallDetails() {\r\n if (!vm.currentCall) {\r\n vm.showCallDetails = false;\r\n vm.callType = 'Operator';\r\n }\r\n else {\r\n for (var i = 0; i < vm.currentCall.Participants.length; i++) {\r\n if (vm.currentCall.Participants[i].InterpreterId === vm.interpreter.Id) {\r\n vm.showCallDetails = true;\r\n vm.callType = 'Interpreter';\r\n break;\r\n }\r\n }\r\n }\r\n }\r\n\r\n function getInterpreter() {\r\n return interpreterservice.get().then(function (data) {\r\n if (data !== '') {\r\n vm.interpreter = data;\r\n }\r\n else {\r\n accountservice.logMessage('vox-interpreter.directive.getInterpreter Action Failed.', vm.logLevel.Warn);\r\n }\r\n return vm.interpreter;\r\n });\r\n }\r\n\r\n function getCurrentCall() {\r\n var status = vm.interpreter ? vm.interpreter.Status : '';\r\n if (status === enums.PersonStatusNames.InCall) {\r\n interpreterservice.getCurrentCall().then(function (data) {\r\n if (data !== '') {\r\n vm.currentCall = data.Call;\r\n vm.currentCustomer = data.Customer;\r\n vm.currentLanguageName = data.LanguageName;\r\n vm.callCenterPhoneNumber = data.CallCenterPhoneNumber;\r\n vm.currentMetaData = data.Metadata;\n vm.currentSipCallData = data.SipCallData;\r\n\r\n usermessageservice.notify('notify', { eventName: 'interpreterDetails', interpreterdata: vm.interpreter });\r\n\r\n // show metadata details\r\n usermessageservice.notify('notify', { eventName: 'metadataDetails', callId: vm.currentCall.CallId, metadata: vm.currentMetaData });\r\n\n if (data.SipCallData) {\n usermessageservice.notify('notify', { eventName: 'sipCallDataDetails', callId: vm.currentCall.CallId, sipCallData: vm.currentSipCallData });\r\n }\n\r\n // show Customer details\r\n usermessageservice.notify('notify', { eventName: 'customerDetails', callId: vm.currentCall.CallId, customerdata: vm.currentCustomer, languageName: vm.currentLanguageName });\r\n\r\n showCallDetails();\r\n }\r\n else {\r\n accountservice.logMessage('vox-interpreter.directive.getCurrentCall Action Failed.', vm.logLevel.Warn);\r\n }\r\n });\r\n }\r\n }\r\n\r\n // Event Listeners\r\n\r\n function alertStart(event, data) {\r\n $scope.$apply(function () {\r\n vm.alert = data;\r\n });\r\n }\r\n\r\n function alertStop(event, desiredStatus) {\r\n $scope.$apply(function () {\r\n vm.alert = undefined;\r\n });\r\n }\r\n\r\n function refreshData(event, data) {\r\n $scope.$apply(function () {\r\n switch (data.property) {\r\n case 'RefreshData':\r\n accountservice.logMessage('vox-interpreter.directive.refreshData Action Enter.', vm.logLevel.Info);\r\n getInterpreter();\r\n }\r\n });\r\n }\r\n\r\n function callConnected(event, data) {\r\n $scope.$apply(function () {\r\n\r\n $cookies.put(constants.callId, data.call.CallId);\r\n vm.currentCall = data.call;\r\n vm.currentCustomer = data.customer;\r\n vm.currentLanguageName = data.languageName;\r\n vm.callCenterPhoneNumber = data.callCenterPhoneNumber;\r\n vm.currentMetaData = data.metadata;\n vm.currentSipCallData = data.SipCallData;\r\n\r\n usermessageservice.notify('notify', { eventName: 'interpreterDetails', interpreterdata: vm.interpreter });\r\n // show Customer details\r\n usermessageservice.notify('notify', { eventName: 'customerDetails', callId: vm.currentCall.CallId, customerdata: vm.currentCustomer, languageName: vm.currentLanguageName });\r\n\r\n // show metadata details\r\n usermessageservice.notify('notify', { eventName: 'metadataDetails', callId: vm.currentCall.CallId, metadata: vm.currentMetaData });\r\n\n if (data.SipCallData) {\n usermessageservice.notify('notify', { eventName: 'sipCallDataDetails', callId: vm.currentCall.CallId, sipCallData: vm.currentSipCallData });\r\n }\r\n $cookies.put(constants.referenceId, data.call.ReferenceId);\r\n $cookies.put(constants.userRole, constants.Interpreter);\r\n $cookies.put(constants.userId, vm.interpreter.Id);\r\n $cookies.put(constants.profileName, data.customer.ProfileName);\n\r\n if (data.interpreterDropAbruptly) {\r\n usermessageservice.notify('notify', { message: true, eventName: 'interpreterDropAbruptly' });\r\n }\r\n });\r\n showCallDetails();\r\n }\r\n\r\n function testCallConnected(event, data) {\r\n $scope.$apply(function () {\r\n $cookies.put(constants.callId, data.callId);\r\n });\r\n }\r\n\r\n function callEnded(event, data) {\r\n $scope.$apply(function () {\r\n vm.currentCall = undefined;\r\n vm.currentCustomer = undefined;\r\n vm.currentLanguageName = undefined;\r\n vm.currentMetaData = undefined;\r\n vm.callCenterPhoneNumber = undefined;\r\n\r\n // show metadata details\r\n usermessageservice.notify('notify', { eventName: 'metadataDetails', callId: undefined, metadata: undefined });\n usermessageservice.notify('notify', { eventName: 'sipCallDataDetails', callId: undefined, sipCallData: undefined });\r\n $cookies.put(callEvents.HangupButtonVisible, undefined);\r\n });\r\n showCallDetails();\r\n }\r\n\r\n function missedCall(event, data) {\r\n $scope.$apply(function () {\r\n utilities.setRootScopeTitle('vox-interpreter.directive.missedCall You missed a call');\r\n vm.currentCall = undefined;\r\n vm.currentCustomer = undefined;\r\n vm.currentLanguageName = undefined;\r\n vm.callCenterPhoneNumber = undefined;\r\n });\r\n showCallDetails();\r\n }\r\n\r\n function youHaveACall(event, data) {\r\n // close any existing modals before opening a new one\r\n $uibModalStack.dismissAll('');\r\n utilities.setRootScopeTitle('You have a call');\r\n vm.modalInstance = $uibModal.open({\r\n animation: true,\r\n backdrop: 'static',\r\n bindToController: true,\r\n templateUrl: 'app/widgets/modal-call.html',\r\n controller: 'ModalCallController',\r\n controllerAs: 'vm',\r\n resolve: {\r\n data: function () {\r\n return data;\r\n }\r\n }\r\n });\r\n }\r\n }\r\n})();\r\n\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.interpreter')\r\n .directive('voxInterpreterConference', voxInterpreterConference);\r\n\r\n function voxInterpreterConference() {\r\n var directive = {\r\n bindToController: true,\r\n controller: InterpreterConferenceController,\r\n controllerAs: 'vm',\r\n replace: true,\r\n restrict: 'E',\r\n scope: {\r\n 'currentCall': '=',\r\n 'currentCustomer': '=',\r\n 'currentLanguageName': '=',\r\n 'callCenterPhoneNumber': '=',\r\n 'interpreter': '=',\r\n 'currentMetaData': '='\r\n },\r\n templateUrl: 'app/interpreter/vox-interpreter-conference.html'\r\n };\r\n\r\n return directive;\r\n }\r\n\r\n InterpreterConferenceController.$inject = ['$scope', 'interpreterservice', '$timeout', 'usermessageservice', 'userservice', 'callEvents', 'enums', 'appsettingsservice', 'preferences'];\r\n /* @ngInject */\r\n function InterpreterConferenceController($scope, interpreterservice, $timeout, usermessageservice, userservice, callEvents, enums, appsettingsservice, preferences) {\r\n var vm = this;\r\n vm.phoneNumberError = false;\r\n\r\n vm.reconnectButton = false; //Hide or show Reconnect button\r\n vm.reconnectButtonDisabled = false;\r\n\r\n vm.reconnectInterpreter = reconnectInterpreter;\r\n\r\n vm.isC2C = vm.currentCall && vm.currentCall.IVRApplicationId === enums.IVRApplication.ClickToCall;\n vm.isHostedIVR = vm.currentCall && vm.currentCall.IVRApplicationId === enums.IVRApplication.HostedIVR;\n vm.showCallCenterNumber = vm.isC2C || vm.isHostedIVR;\r\n\r\n usermessageservice.subscribe($scope, 'notify', function (event, data) {\r\n if (data.eventName === 'AutoReconnect' && vm.interpreter.Status === enums.PersonStatusNames.InCall)\r\n {\r\n reconnectInterpreter(true);\r\n }\r\n });\r\n\r\n usermessageservice.subscribe($scope, 'notify', function (event, data) {\r\n if (data.eventName === 'reconnectWarning' && vm.interpreter.Status === enums.PersonStatusNames.InCall)\r\n {\r\n $timeout(showReconnectButton(data.message));\r\n }\r\n });\r\n\r\n var refreshReminder = false;\r\n appsettingsservice.getAppSetting(preferences.RefreshReminder, refreshReminder).then(function (data) {\r\n refreshReminder = (data === 'true');\r\n if (refreshReminder) {\r\n usermessageservice.notify('notify', { eventName: 'refreshCustomerDetails', callId: vm.currentCall.CallId, customerdata: vm.currentCustomer, languageName: vm.currentLanguageName });\r\n }\r\n });\r\n\r\n function reconnectInterpreter(isAutoReconnect) {\r\n interpreterservice.setStatusAtomic(enums.PersonStatusNames.InCall, enums.PersonStatusNames.Reconnect, 'Reconnect', new Date()).then(function (data) {\r\n if (data === true)\r\n {\r\n if (!isAutoReconnect) {\r\n userservice.addCallEvent(callEvents.ReconnectButtonClicked, vm.currentCall.CallId);\r\n }\r\n\r\n vm.reconnectButtonDisabled = true;\r\n interpreterservice.reconnectCall(vm.currentCall.CallId);\r\n usermessageservice.notify('notify', { eventName: 'Accept' });\r\n usermessageservice.notify('notify', { message: true, eventName: 'ReconnectInitialized' });\r\n }\r\n });\r\n }\r\n\r\n function showReconnectButton(showHideReconnect) {\r\n if (showHideReconnect && vm.currentCall)\r\n {\r\n userservice.addCallEvent(callEvents.ReconnectWarningButtonVisible, vm.currentCall.CallId);\r\n }\r\n vm.reconnectButton = showHideReconnect;\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.interpreter')\r\n .factory('interpretersignalreceiver', interpretersignalreceiver);\r\n\r\n interpretersignalreceiver.$inject = ['$rootScope', '$window', 'accountservice', 'enums', 'Hub', 'interpreterservice', 'logger', 'signalreceiversmonitorservice',\n '$cookies', 'appsettingsservice', 'preferences'];\r\n /* @ngInject */\r\n function interpretersignalreceiver($rootScope, $window, accountservice, enums, Hub, interpreterservice, logger, signalreceiversmonitorservice,\n $cookies, appsettingsservice, preferences) {\r\n\r\n var service = {\r\n key: 'vox.interpreter',\r\n alertStartEvent: 'vox.interpreter.alertStartEvent',\r\n alertStopEvent: 'vox.interpreter.alertStopEvent',\r\n callConnectedEvent: 'vox.interpreter.callConnected',\r\n testCallConnectedEvent: 'vox.interpreter.testCallConnected',\r\n callEndedEvent: 'vox.interpreter.callEnded',\r\n youHaveACallEvent: 'vox.interpreter.youHaveACall',\r\n thirdPartyStatusEvent: 'vox.interpreter.thirdPartyStatus',\n callCenterStatusEvent: 'vox.interpreter.callCenterStatus',\r\n logOutUserEvent: 'vox.interpreter.logOutUser',\r\n missedCallEvent: 'vox.interpreter.missedCall',\r\n redirectToLoginEvent: 'vox.interpreter.redirectToLoginEvent',\r\n refreshDataEvent: 'vox.interpreter.refreshData',\r\n interpreterPostServerMessageEvent: 'vox.interpreter.postServerMessage',\n interpreterNoTalkActivityEvent: 'vox.interpreter.noTalkActivity',\r\n disconnect: disconnect,\r\n connect: connect,\r\n checkConnection: checkConnection,\r\n getIsConnected: getIsConnected,\n getBrowserInfo: getBrowserInfo,\n GetDeviceInfo: GetDeviceInfo,\n identifyUserDevice: identifyUserDevice\r\n };\r\n\r\n //declaring the hub connection\r\n var hub = new Hub('interpreterHub', {\r\n\r\n useSharedConnection: true,\r\n\r\n //client side methods\r\n listeners: {\r\n 'alertStart': alertStart,\r\n 'alertStop': alertStop,\r\n 'callConnected': callConnected,\r\n 'testCallConnected': testCallConnected,\r\n 'callEnded': callEnded,\r\n 'interpreterStatus': interpreterStatus,\r\n 'missedCall': missedCall,\r\n 'redirectToLogin': redirectToLogin,\r\n 'refreshData': refreshData,\r\n 'thirdPartyStatus': thirdPartyStatus,\n 'callCenterStatus': callCenterStatus,\r\n 'logOutUser': logOutUser,\r\n 'youHaveACall': youHaveACall,\r\n 'refreshBrowser': refreshBrowser,\r\n 'interpreterPostServerMessage': interpreterPostServerMessage,\n 'interpreterNoTalkActivity': interpreterNoTalkActivity,\n 'GetDeviceInfo': GetDeviceInfo\r\n },\r\n\r\n //server side methods\r\n methods: ['checkConnection', 'pingComplete'],\r\n\r\n //query params sent on initial connection\r\n queryParams: {\r\n //'token': 'exampletoken'\r\n },\r\n\r\n //handle connection error\r\n errorHandler: function (error) {\r\n logger.info(error);\r\n },\r\n\r\n autoConnect: false,\r\n\r\n logging: true,\r\n\r\n transport: ['webSockets', 'serverSentEvents', 'longPolling'],\r\n\r\n // This method is called whenever the SignalR state changes\r\n stateChanged: function (state) {\r\n // When SignalR reconnects we refersh client side data\r\n //2. reconnecting 1. connected\r\n if (state.oldState === 2 && state.newState === 1) {\r\n interpreterservice.get().then(function (interpreter) {\r\n if (interpreter !== '') {\r\n accountservice.logMessage('interpretersignalreceiver.stateChanged Reconnected|UserId: ' + interpreter.Id, enums.LogLevel.Trace);\r\n } else {\r\n accountservice.logMessage('interpretersignalreceiver.stateChanged getInterpreter Action Failed', enums.LogLevel.Warn);\r\n }\r\n });\r\n interpreterRefreshAll();\r\n }\r\n\r\n if (state.newState === 4) {\r\n signalreceiversmonitorservice.unTrack(service.key);\r\n }\r\n\r\n logger.log('Interpreter: SignalR state changed from ' + state.oldState + ' to ' + state.newState);\r\n $rootScope.$broadcast(enums.Events.SignalRStateChanged, state.newState);\r\n }\r\n });\r\n\r\n var showAlert = false;\n\n activate();\n\n function activate() {\n appsettingsservice.getAppSetting(preferences.ShowScheduledCallAlert, showAlert).then(function (result) {\r\n showAlert = (result === 'true');\n });\n }\n\r\n return service;\r\n\r\n ////////////////\r\n\r\n function alertStart(interpreterId, data) {\r\n var timeStarted = new Date().toISOString();\r\n\r\n $rootScope.$broadcast(service.alertStartEvent, data);\r\n if (data.DesiredStatus && data.DesiredStatus !== null) {\r\n $rootScope.$broadcast(service.interpreterStatusEvent, { statusName: data.DesiredStatus });\r\n }\r\n var str = 'This is your ' + data.CaseId + ' Scheduled Call. Please answer promptly.';\r\n\r\n if (showAlert && data.IsScheduleCall) {\n interpreterPostServerMessage(interpreterId, str);\r\n }\r\n\r\n var message = 'interpretersignalreceiver.alertStart|UserId: ' + interpreterId + ', ResourceAlertId: ' + data.ResourceAlertId +\r\n ', ResourceRequestId: ' + data.ResourceRequestId + ', CallId: ' + data.CallId + ', DesiredStatus: ' + data.DesiredStatus + ', Received: ' + timeStarted;\r\n accountservice.logMessage(message, enums.LogLevel.Trace);\r\n }\r\n\r\n function alertStop(interpreterId, desiredStatus) {\r\n $rootScope.$broadcast(service.alertStopEvent);\r\n\r\n if (desiredStatus && desiredStatus !== null) {\r\n $rootScope.$broadcast(service.interpreterStatusEvent, { statusName: desiredStatus });\r\n }\r\n\r\n accountservice.logMessage('interpretersignalreceiver.alertStop|UserId: ' + interpreterId + ', DesiredStatus: ' + desiredStatus, enums.LogLevel.Trace);\r\n }\r\n\r\n function callConnected(call, customer, languageName, interpreterDropAbruptly, callCenterPhoneNumber, metadata, sipcalldata) {\r\n $rootScope.$broadcast(service.callConnectedEvent, {\n call: call, customer: customer, languageName: languageName, interpreterDropAbruptly: interpreterDropAbruptly,\r\n callCenterPhoneNumber: callCenterPhoneNumber, metadata: metadata, SipCallData: sipcalldata\n });\r\n accountservice.logMessage('interpretersignalreceiver.callConnected|CallId: ' + call.CallId, enums.LogLevel.Trace);\r\n }\r\n\r\n function testCallConnected(callId) {\r\n $rootScope.$broadcast(service.testCallConnectedEvent, { callId: callId });\r\n accountservice.logMessage('interpretersignalreceiver.testCallConnected|CallId: ' + callId, enums.LogLevel.Trace);\r\n }\r\n\r\n function callEnded(interpreterId) {\r\n $rootScope.$broadcast(service.callEndedEvent);\r\n accountservice.logMessage('interpretersignalreceiver.callEnded|UserId: ' + interpreterId, enums.LogLevel.Trace);\r\n }\r\n\r\n function interpreterStatus(statusName, interpreterId, reason, time) {\r\n var timeStarted = new Date().toISOString();\r\n $rootScope.$broadcast(service.interpreterStatusEvent, { statusName: statusName, reason: reason, time: time });\r\n var message = 'interpretersignalreceiver.interpreterStatus|UserId: ' + interpreterId + ', Status: ' + statusName + ', Reason: ' + reason + ', Time: ' + time + ', Received: ' + timeStarted;\r\n accountservice.logMessage(message, enums.LogLevel.Trace);\r\n }\r\n\r\n function interpreterPostServerMessage(interpreterId, message) {\r\n var timeStarted = new Date().toISOString();\r\n $rootScope.$broadcast(service.interpreterPostServerMessageEvent, { message: message });\r\n var logMessage = 'interpretersignalreceiver.postServerMessage|UserId: ' + interpreterId + ', Message: ' + message + ', Received: ' + timeStarted;\r\n accountservice.logMessage(logMessage, enums.LogLevel.Trace);\r\n }\n\n function interpreterNoTalkActivity(interpreterId, message) {\n var timeStarted = new Date().toISOString();\r\n $rootScope.$broadcast(service.interpreterNoTalkActivityEvent, { interpreterId: interpreterId, message: message });\r\n var logMessage = 'interpretersignalreceiver.interpreterNoTalkActivity|UserId: ' + interpreterId + ', Message: ' + message + ', Received: ' + timeStarted;\r\n accountservice.logMessage(logMessage, enums.LogLevel.Debug);\r\n }\r\n\r\n function missedCall(callSid, interpreterId) {\r\n $rootScope.$broadcast(service.missedCallEvent, { callSid: callSid });\r\n accountservice.logMessage('interpretersignalreceiver.missedCall|UserId: ' + interpreterId + ', CallSid: ' + callSid, enums.LogLevel.Warn);\r\n }\r\n\r\n function redirectToLogin(interpreterId) {\r\n $rootScope.$broadcast(service.redirectToLoginEvent);\r\n accountservice.logMessage('interpretersignalreceiver.redirectToLogin|UserId: ' + interpreterId, enums.LogLevel.Debug);\r\n }\r\n\r\n function refreshData(property) {\r\n $rootScope.$broadcast(service.refreshDataEvent, { property: property });\r\n }\r\n\r\n function thirdPartyStatus(participantId, statusName, interpreterId) {\r\n $rootScope.$broadcast(service.thirdPartyStatusEvent, { participantId: participantId, statusName: statusName });\r\n accountservice.logMessage('interpretersignalreceiver.thirdPartyStatus|UserId: ' + interpreterId + ', ParticipantId: ' + participantId + ', Status: ' + statusName, enums.LogLevel.Trace);\r\n }\n\n function callCenterStatus(participantId, statusName, userId) {\r\n $rootScope.$broadcast(service.callCenterStatusEvent, { participantId: participantId, statusName: statusName });\r\n accountservice.logMessage('interpretersignalreceiver.callCenterStatus|UserId: ' + userId + ', ParticipantId: ' + participantId + ', Status: ' + statusName, enums.LogLevel.Trace);\r\n\r\n }\r\n\r\n function logOutUser(interpreterId) {\r\n $rootScope.$broadcast(service.logOutUserEvent);\r\n accountservice.logMessage('interpretersignalreceiver.logOutUser|UserId: ' + interpreterId, enums.LogLevel.Debug);\r\n }\r\n\r\n function youHaveACall(data) {\r\n $rootScope.$broadcast(service.youHaveACallEvent, data);\r\n accountservice.logMessage('interpretersignalreceiver.youHaveACall|UserId: ' + data.InterpreterId + ', CallId: ' + data.CallId, enums.LogLevel.Trace);\r\n }\r\n\r\n function interpreterRefreshAll() {\r\n refreshData('RefreshData');\r\n }\r\n\r\n function refreshBrowser() {\r\n $window.location.reload(true);\r\n }\r\n\r\n // Disconnect SignalR\r\n function disconnect() {\r\n var result = hub.disconnect();\r\n signalreceiversmonitorservice.logSignalRTimeout(result, hub, 'interpretersignalreceiver.disconnect');\n $cookies.put('currentUserid', undefined);\n return result;\r\n }\r\n\r\n // Connect SignalR\r\n function connect() {\r\n var result = hub.connect();\r\n signalreceiversmonitorservice.logSignalRTimeout(result, hub, 'interpretersignalreceiver.connect');\r\n return result;\r\n }\r\n\r\n function checkConnection() {\r\n var result = hub.checkConnection();\r\n signalreceiversmonitorservice.logSignalRTimeout(result, hub, 'interpretersignalreceiver.checkConnection');\r\n return result;\r\n }\r\n\r\n function getIsConnected() {\r\n return hub.connection.state === 1;\r\n }\n\n function getBrowserInfo() {\r\n var userAgent = navigator.userAgent, tem,\r\n matchArray = userAgent.match(/(opera|chrome|safari|firefox|msie|trident(?=\\/))\\/?\\s*(\\d+)/i) || [];\r\n if (/trident/i.test(matchArray[1])) {\r\n tem = /\\brv[ :]+(\\d+)/g.exec(userAgent) || [];\r\n return 'IE ' + (tem[1] || '');\r\n }\r\n if (matchArray[1] === 'Chrome') {\r\n tem = userAgent.match(/\\b(OPR|Edge)\\/(\\d+)/);\r\n if (tem != null) {\r\n return tem.slice(1).join(' ').replace('OPR', 'Opera');\r\n }\r\n }\r\n matchArray = matchArray[2] ? [matchArray[1], matchArray[2]] : [navigator.appName, navigator.appVersion, '-?'];\r\n if ((tem = userAgent.match(/version\\/(\\d+)/i)) != null) {\r\n matchArray.splice(1, 1, tem[1]);\r\n }\r\n return matchArray.join(',');\r\n }\n\n function GetDeviceInfo(userId, deviceList, showAlert, alertMessage) {\n var deviceInfo = navigator.userAgent;\n var device;\n var os;\n var isMobile = false;\n $cookies.put('currentUserid', userId);\n\n if (deviceInfo.includes('Windows NT 6.1')) {\n os = 'Windows NT 6.1';\n device = 'Windows 7';\r\n }\n else if (deviceInfo.includes('iPad')) {\n os = 'iOS';\n device = 'iPad';\n isMobile = true;\r\n }\n else if (deviceInfo.includes('iPhone')) {\n os = 'iOS';\n device = 'iPhone';\n isMobile = true;\r\n }\n else if (deviceInfo.includes('Android')) {\n os = 'Android';\n device = 'Android';\n isMobile = true;\r\n }\n else if (deviceInfo.includes('Windows NT 6.2')) {\n os = 'Windows NT 6.2';\n device = 'Windows 8';\r\n }\n else if (deviceInfo.includes('Windows NT 6.3')) {\n os = 'Windows NT 6.3';\n device = 'Windows 8.1';\r\n }\n else if (deviceInfo.includes('Windows NT 5.1') || deviceInfo.includes('Windows NT 5.2')) {\n os = 'Windows NT 5.2';\n device = 'Windows XP';\r\n }\n else if (deviceInfo.includes('Linux') && deviceInfo.includes('KFAPWI')) {\n os = 'Linux';\n device = 'Kindle Fire';\n isMobile = true;\r\n }\n else if (deviceInfo.includes('Windows NT 6.0')) {\n os = 'Windows NT 6.0';\n device = 'Windows Vista';\r\n }\n else if (deviceInfo.includes('Windows NT 10')) {\n os = 'Windows NT 10';\n device = 'Windows 10';\r\n }\n else {\n device = deviceInfo;\n os = navigator.userAgentData.platform;\n isMobile = navigator.userAgentData.mobile;\n }\n\n identifyUserDevice(device, os, isMobile, deviceList, showAlert, alertMessage);\r\n }\n\n function identifyUserDevice(device, os, isMobile, deviceList, showAlert, alertMessage) {\n\n var userId = $cookies.get('currentUserid');\n var str = alertMessage + '. Current Device:' + device;\n var deviceArray = deviceList.split(',');\n if (showAlert) {\n for (var i = 0; i < deviceArray.length; i++) {\n if (deviceArray[i] === device || deviceArray[i] === os) {\n interpreterPostServerMessage(userId, str);\n accountservice.logMessage('interpretersignalreceiver.identifyUserDevice|UserId: ' + userId + ', device: ' + device + ', OS:' + os, enums.LogLevel.Debug);\r\n }\n else if (isMobile) {\n accountservice.logMessage('interpretersignalreceiver.identifyUserDevice|UserId: ' + userId + ', device: ' + device + ', OS:' + os, enums.LogLevel.Debug);\r\n }\n }\n }\r\n }\n }\r\n})();\r\n\n(function ()\r\n{\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.core')\r\n .value('session', {\r\n roles: undefined\r\n });\r\n})();\r\n\n/*jslint bitwise: true */\n/*jshint esversion: 6 */\n\n(function () {\n 'use strict';\n\n angular\n .module('vox-leonis.core')\n .factory('utilities', utilities);\n\n utilities.$inject = ['$rootScope', '$filter', 'interpreterservice', 'operatorservice', '$interval', '$injector', '$cookies', 'enums'];\n /* @ngInject */\n function utilities($rootScope, $filter, interpreterservice, operatorservice, $interval, $injector, $cookies, enums) {\n var service = {\n buildInterpreters: buildInterpreters,\n buildLanguagesList: buildLanguagesList,\n buildPoolsList: buildPoolsList,\n buildLanguages: buildLanguages,\n getInterpreterLoginLogoutButtonState: getInterpreterLoginLogoutButtonState,\n buildLoggedInInterpreters: buildLoggedInInterpreters,\n buildLoggedInInterpreter: buildLoggedInInterpreter,\n setRootScopeTitle: setRootScopeTitle,\n startKeepAliveInterval: startKeepAliveInterval,\n getLocalDate: getLocalDate,\n stringFormat: stringFormat,\n convertMinutesToSeconds: convertMinutesToSeconds,\n convertSecondsToMilliseconds: convertSecondsToMilliseconds,\n convertSecondsToDisplayString: convertSecondsToDisplayString,\n logButtonShowEvent: logButtonShowEvent,\n getClientAppJavaScriptFileName: getClientAppJavaScriptFileName,\n createGuid: createGuid,\n isTrue: isTrue\n };\n\n return service;\n\n // set keep alive and then continue to set it on an interval\n function startKeepAliveInterval(roles, setKeepAliveIntervalSeconds) {\n if (setKeepAliveIntervalSeconds <= 0 || setKeepAliveIntervalSeconds === 2147483 || !roles || (roles.indexOf('Interpreter') < 0 && roles.indexOf('Operator') < 0)) {\n return null;\n }\n\n setKeepAlive(roles);\n\n return $interval(function () {\n setKeepAlive(roles);\n }, setKeepAliveIntervalSeconds * 1000);\n\n function setKeepAlive(userRoles) {\n if (userRoles.indexOf('Interpreter') >= 0) {\n interpreterservice.setKeepAlive();\n } else {\n operatorservice.setKeepAlive();\n }\n }\n }\n\n //Set browser tab title\n function setRootScopeTitle(title) {\n $rootScope.title = title;\n }\n\n function buildInterpreters(interpreters, languages) {\n if (interpreters) {\n return interpreters.map(function (interpreter) {\n return {\n Id: interpreter.Id, FirstName: interpreter.FirstName, LastName: interpreter.LastName, Status: interpreter.Status,\n LanguagePayrates: interpreter.LanguagePayrates, PhoneNumber: interpreter.TempPhoneNumber || interpreter.PhoneNumber,\n LastLogin: interpreter.LastLogin, LastLoginDisplay: $filter('date')(interpreter.LastLogin, 'medium'),\n TimeZone: interpreter.TimeZone, GroupName: interpreter.GroupName, Pools: buildPoolsList(interpreter.Pools), Languages: buildLanguagesList(interpreter.LanguagePayrates),\n IsLanguageService: getInterpreterLoginLogoutButtonState(interpreter)\n };\n });\n }\n return [];\n }\n\n /* When connectMe, Language select and connect interpreter button display on UI this method triggers*/\n function logButtonShowEvent(eventName, callId) {\n var addEventFlag;\n\n switch (eventName) {\n case $injector.get('callEvents').LSButtonVisible:\n addEventFlag = $cookies.get(eventName);\n break;\n case $injector.get('callEvents').ConnectInterpreterButtonVisible:\n addEventFlag = $cookies.get(eventName);\n break;\n case $injector.get('callEvents').ConnectMeButtonVisible:\n addEventFlag = $cookies.get(eventName);\n break;\n case $injector.get('callEvents').HangupButtonVisible:\n addEventFlag = $cookies.get(eventName);\n break;\n case $injector.get('callEvents').ConnectButtonVisible:\n addEventFlag = $cookies.get(eventName);\n break;\n }\n\n // If addEventFlag is undefined or addEventFlag is false then add an event in to database\n if ((addEventFlag === undefined || !addEventFlag) && callId !== undefined) {\n $injector.get('userservice').addCallEvent(eventName, callId);\n $cookies.put(eventName, true);\n }\n\n return true;\n }\n\n //Convert dictionary to array and sort language alphabatically and set default value to the drop down.\n function buildLanguages(languages) {\n var arr = [];\n for (var key in languages) {\n if (languages.hasOwnProperty(key)) {\n arr.push({\n key: key, value: languages[key]\n });\n }\n }\n return arr.sort(function (a, b) {\n return (a.value > b.value) ? 1 : ((b.value > a.value) ? -1 : 0);\n });\n }\n\n // creates a dynamic string of languages so that sorting works on the console.\n function buildLanguagesList(languagePayrates) {\n var languages = '';\n for (var i = 0; i < languagePayrates.length; i++) {\n languages += (i > 0 ? ', ' : '') + languagePayrates[i].Language;\n }\n return languages;\n }\n\n // creates a dynamic string of pools so that sorting works on the console.\n function buildPoolsList(pools) {\n var poolList = '';\n for (var i = 0; i < pools.length; i++) {\n poolList += (i > 0 ? ', ' : '') + pools[i].Name;\n }\n return poolList;\n }\n\n function canLoginLogoutLSUsers(interpreter) {\n return interpreter.IsLSAllOther === false && interpreter.IsLanguageService === true;\n }\n\n // returns string that defines state of interpreter button:\n // 'Login' = only Login button will be displayed\n // 'Logout' - only Logout button will be displayed\n // '' - none of buttons will be displayed.\n function getInterpreterLoginLogoutButtonState(interpreter) {\n return canLoginLogoutLSUsers(interpreter) ? ((interpreter.Status === enums.PersonStatusNames.Unavailable ||\n interpreter.Status === enums.PersonStatusNames.Offline) ? 'Login' : 'Logout') : '';\r\n }\n\n function buildLoggedInInterpreters(loggedInInterpreters) {\n if (loggedInInterpreters) {\n return loggedInInterpreters.map(function (interpreter) {\n return {\n Id: interpreter.Id, Name: interpreter.Name, FirstName: interpreter.FirstName, LastName: interpreter.LastName, Status: interpreter.Status,\n PhoneNumber: interpreter.TempPhoneNumber || interpreter.PhoneNumber, LanguagePayrates: interpreter.LanguagePayrates,\n TimeZone: interpreter.TimeZone, WorkGroup: interpreter.WorkGroup, LastLogin: interpreter.LastLogin, LastCallEnded: interpreter.LastCallEnded,\n Pools: buildPoolsList(interpreter.Pools), Languages: buildLanguagesList(interpreter.LanguagePayrates), GroupName: interpreter.GroupName,\n IsLanguageService: getInterpreterLoginLogoutButtonState(interpreter)\n };\n });\n }\n return [];\n }\n\n function buildLoggedInInterpreter(interpreter) {\n if (!interpreter) {\n return null;\n }\n\n return {\n Id: interpreter.Id, Name: interpreter.Name, FirstName: interpreter.FirstName, LastName: interpreter.LastName, Status: interpreter.Status,\n PhoneNumber: interpreter.TempPhoneNumber || interpreter.PhoneNumber, LanguagePayrates: interpreter.LanguagePayrates,\n TimeZone: interpreter.TimeZone, WorkGroup: interpreter.WorkGroup, LastLogin: interpreter.LastLogin, LastCallEnded: interpreter.LastCallEnded,\n Pools: buildPoolsList(interpreter.Pools), Languages: buildLanguagesList(interpreter.LanguagePayrates), GroupName: interpreter.GroupName,\n IsLanguageService: getInterpreterLoginLogoutButtonState(interpreter)\n };\n }\n\n function getLocalDate(time) {\n var localDate = new Date(time).toLocaleString();\n return localDate.toLocaleString();\n }\n\n function stringFormat() {\n var s = arguments[0];\n for (var i = 0; i < arguments.length - 1; i++) {\n var reg = new RegExp('\\\\{' + i + '\\\\}', 'gm');\n s = s.replace(reg, arguments[i + 1]);\n }\n return s;\n }\n\n function convertMinutesToSeconds(minutes) {\n return minutes * 60;\n }\n\n function convertSecondsToMilliseconds(seconds) {\n return seconds * 1000;\n }\n\n function convertSecondsToDisplayString(seconds, hideDays) {\n // 86400 seconds in a day\n var days = Math.floor(seconds / 86400);\n seconds %= 86400;\n var hours = Math.floor(seconds / 3600);\n seconds %= 3600;\n var minutes = Math.floor(seconds / 60);\n seconds = Math.floor(seconds % 60);\n\n hideDays = hideDays === null ? days === 0 : hideDays;\n\n return (hideDays ? '' : days + ':') + padZeros(hours) + ':' + padZeros(minutes) + ':' + padZeros(seconds);\n }\n\n // ensure number has 2 digits\n function padZeros(number) {\n if (number === 0) {\n return '00';\n }\n else if (number < 10) {\n return '0' + number;\n }\n return number;\n }\n\n function getClientAppJavaScriptFileName() {\n var scripts = document.getElementsByTagName('script');\n if (scripts) {\n for (var i = 0; i < scripts.length; i++) {\n var src = scripts[i].getAttribute('src');\n if (src.startsWith('scripts/app-')) {\n return src.substring(8);\n }\n }\n }\n }\n\n // Generates RFC4122 random (\"version 4\") GUID. https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript\n function createGuid() {\n return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function (c) {\n var r = Math.random() * 16 | 0, v = c === 'x' ? r : (r & 0x3 | 0x8);\n return v.toString(16);\n });\n }\n\n function isTrue(value) {\n //if null or undefined or false\n if (!value) {\n return false;\n }\n //if value is true (boolean)\n if (typeof value === 'boolean') {\n return value;\n }\n if (typeof value === 'string') {\n return value.toLowerCase() === 'true';\n }\n else {\n return false;\n }\n }\n }\n})();\n\n(function () {\r\n 'use strict';\r\n\r\n /* jshint -W121 */\r\n if (!String.prototype.startsWith) {\r\n String.prototype.startsWith = function (search, pos) {\r\n return this.substr(!pos || pos < 0 ? 0 : +pos, search.length) === search;\r\n };\r\n }\r\n\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular.module('vox-leonis.core').config(['$provide', function ($provide) {\r\n $provide.factory('appHttpExceptionInterceptor', ['$q', 'internetConnectionChecker',\r\n function ($q, internetConnectionChecker) {\r\n return {\r\n response: handleResponse,\r\n responseError: handleResponseError\r\n };\r\n\n // on first successfull request we set that internet connection is working\r\n function handleResponse(response) {\r\n internetConnectionChecker.setInternetConnectionState(true);\r\n return $q.resolve(response);\r\n }\r\n\n //If request have failed we are checking if internet connection is up\r\n function handleResponseError(response) {\n //internet connection is not checked if it's already verified and it's not working\n //also we are skipping this check if interceptor have caught internetconnection request\r\n if (!internetConnectionChecker.getInternetConnectionState() || internetConnectionChecker.isInternetConnectionResponse(response)) {\r\n return $q.reject(response);\r\n }\n\r\n return internetConnectionChecker\r\n .checkConnection()\r\n .finally(function () {\r\n return $q.reject(response);\r\n });\r\n }\r\n }]);\r\n }]);\r\n\r\n angular.module('vox-leonis.core').config(['$httpProvider', function ($httpProvider) {\r\n $httpProvider.interceptors.push('appHttpExceptionInterceptor');\r\n }]);\r\n})();\r\n\n/* global toastr:false, moment:false, twilio:true */\n(function () {\n 'use strict';\n\n angular\n .module('vox-leonis.core')\n .constant('toastr', toastr)\n .constant('moment', moment)\n .constant('twilio', window.Twilio)\n .constant('enums', {\n PersonStatus: [\n { id: 0, name: 'Unavailable' },\n { id: 1, name: 'Available' },\n { id: 2, name: 'Ringing' },\n { id: 3, name: 'Alerting' },\n { id: 4, name: 'InCall' },\n { id: 5, name: 'Offline' },\n { id: 6, name: 'AvailablePhone' },\n { id: 7, name: 'Away' },\n { id: 8, name: 'NotAvailable' },\n { id: 9, name: 'Reconnect' },\n { id: 10, name: 'AfterCallWork' },\n { id: 11, name: 'Quarantine' },\n { id: 12, name: 'Monitoring' }\n ],\n\n //Note: When adding a value to this enum, make sure you also update the associated enum in the Enums.cs file\n PersonStatusReason: {\n None: 0,\n UnableToSendAlerts: 1,\n UnableToCall: 2,\n CallNotAccepted: 3,\n CallRejected: 4,\n CallNotAnswered: 5,\n InvalidPhoneNumber: 6,\n UnableToUpdateTheCall: 7,\n ExceededReconnectAttempts: 8,\n ExceededMissedAlerts: 9,\n PhoneBusy: 10,\n MissedAlert: 11,\n Reconnect: 12,\n Login: 13,\n Logout: 14,\n CustomerInitiatedReconnect: 15,\n UnableToCallVOIPOffline: 16,\n DropThresholdExceeded: 17,\n LoginViaApi: 18,\n LogoutViaApi: 19,\n ExceededUnableToSendAlerts: 20,\n LostConnectivity: 21,\n PoorLatency: 40,\n ImprovedLatency: 41\n },\n PersonStatusMessage: {\n 0: '',\n 1: 'we\\'re unable to send you alerts',\n 2: 'we\\'re unable to call you',\n 3: 'you didn\\'t accept the call',\n 4: 'you rejected an alert',\n 5: 'no one answered the phone when we called',\n 6: 'your phone number is invalid or not callable',\n 7: '',\n 8: 'you didn\\'t answer the phone during the reconnect process',\n 9: 'you missed too many consecutive alerts',\n 10: 'your phone was busy when we called',\n 11: 'you missed an alert',\n 15: 'the customer wishes to reconnect with you.',\n 16: 'we\\'re unable to call VOIP phone of offline user',\n 17: 'abrupt drops limitation is reached',\n 18: '',\n 19: '',\n 20: '',\n 21: 'we lost connectivity with your browser',\n 22: 'we detected an answering machine',\n 40: 'you are experiencing poor connectivity due to a degraded network performance',\n 41: 'your network performance has improved'\n },\n LogLevel:\n { Fatal: 0, Error: 1, Warn: 2, Info: 3, Debug: 4, Trace: 5 },\n Events:\n {\n ShowInstructionMessage: 'ShowInstructionMessage',\n SignalRStateChanged: 'SignalRStateChanged',\n InternetConnectionStateChanged: 'InternetConnectionStateChanged',\n ContactMethodChanged: 'ContactMethodChanged',\n WebRtcConnectionQualityChanged: 'WebRtcConnectionQualityChanged',\n SetTempPhoneNumber: 'SetTempPhoneNumber',\n PhoneErrorMessageChanged: 'PhoneErrorMessageChanged'\n },\n CallStatusNames: {\n LanguageSelected: 'LanguageSelected'\n },\n PersonStatusNames: {\n Unavailable: 'Unavailable',\n Available: 'Available',\n Ringing: 'Ringing',\n Alerting: 'Alerting',\n InCall: 'InCall',\n Offline: 'Offline',\n AvailablePhone: 'AvailablePhone',\n Away: 'Away',\n NotAvailable: 'NotAvailable',\n Reconnect: 'Reconnect',\n AfterCallWork: 'AfterCallWork',\n Quarantine: 'Quarantine',\n Monitoring: 'Monitoring'\n },\n WebRtcStatus: {\n Ready: 'ready',\n Offline: 'offline',\n Busy: 'busy',\n Registered: 'registered',\n Unregistered: 'unregistered'\n },\n DeviceStatus: {\n Incoming: 'incoming',\n Unregistered: 'unregistered',\n Registered: 'registered',\n Registering: 'registering',\n Destroyed: 'destroyed',\n TokenWillExpire: 'tokenWillExpire'\n },\n ContactMethod: {\n Phone: 1,\n WebRTC: 2\n },\n ContactMethodDesc: {\n ReceiveViaPhone: 'Receive call via phone',\n ReceiveViaComputer: 'Receive call via computer'\n },\n IVRApplication: {\n OPI: 1,\n ClickToCall: 2,\n HostedIVR: 3,\n EscalateToVoice: 4\n }\n })\n .constant('stringResources', {\n personStatusMessageFormat: 'Your status was changed to {0} because {1}. {2}',\n ThirdPartyEventMessages:\n {\n ThirdPartyFailed: 'The call could not be connected',\n ThirdPartyCanceled: 'The call was canceled while attempting to connect',\n ThirdPartyBusy: 'The call failed because the line was busy',\n ThirdPartyNoAnswer: 'The call failed because no one answered',\n AnsweringMachineDetected: 'The call failed because we detected an answering machine'\n },\n callCenterEventMessages: {\n CallCenterBusy: 'The call to call center failed because the line was busy',\n CallCenterNoAnswer: 'The call to call center failed because no one answered',\n CallCenterCanceled: 'The call to call center was canceled while attempting to connect',\n CallCenterFailed: 'The call to call center could not be connected'\n }\n })\n .constant('constants', {\n referenceCache: 'referenceCache',\n referenceId: 'referenceId',\n callId: 'callId',\n customerName: 'customerName',\n userRole: 'userRole',\n Operator: 'Operator',\n Interpreter: 'Interpreter',\n monitor: 'Monitor',\n dataCache: 'dataCache',\n operatorGetLoggedInInterpreters: 'operatorGetLoggedInInterpreters',\n adminGetLoggedInInterpreters: 'adminGetLoggedInInterpreters',\n operatorGetAllOperators: 'operatorGetAllOperators',\n phoneNumberInfo: 'phoneNumberInfo',\n lastRefreshTime: 'lastRefreshTime',\n userId: 'userId',\n Languages: 'languages',\n profileName: 'profileName'\n })\n .constant('preferences', {\n DataCacheExpirationTimeMilliseconds: 'Portal_DataCacheExpirationTimeMilliseconds',\n DispositionMaxAllowedChars: 'Portal_DispositionMaxAllowedChars',\n DisableTokenGenerationLocalHost: 'Portal_DisableTokenGenerationLocalHost',\n RecentCallsRefreshIntervalSeconds: 'Portal_RecentCallsRefreshIntervalSeconds',\n ReCreateTokens: 'Portal_ReCreateTokens',\n GetLoggedInInterpretersDelayMilliseconds: 'Portal_GetLoggedInInterpretersDelayMilliseconds',\n GetOperatorDelayMilliseconds: 'Portal_GetOperatorDelayMilliseconds',\n GetCallDispositionTimeoutMilliseconds: 'Portal_CallDispositionTimeout',\n GetCallDispositionMenuTimeOutSeconds: 'Portal_CallDispositionMenuTimeout',\n GetCallDispositionFlag: 'IVR_EnableCallDisposition', // This preference is also used in the IVR project\n SendCustomUITelemetry: 'Portal_SendCustomUITelemetry',\n UIRequestMinDuration: 'Portal_UIRequestMinDuration',\n LatencyMeasuringInterval: 'Portal_LatencyMeasuringInterval',\n IsInterpreterDispositionMenu: 'IVR_IsInterpreterDispositionMenu', // This preference is also used in the IVR project\n IsShowDefaultReminder: 'Portal_InterpreterCustomReminderText',\n DefaultShowReminderText: 'Portal_InterpreterCustomReminderText_Default',\n IsShowDefaultOperatorReminder: 'Portal_OperatorCustomReminderText',\n DefaultShowOperatorReminderText: 'Portal_OperatorCustomReminderText_Default',\n ShowNetworkQualityIndicator: 'Portal_ShowNetworkQualityIndicator',\n TestButtonDisabled: 'Portal_TestButtonDisabled',\n ShowWebRtcDialpad: 'Portal_ShowWebRtcDialpad',\n DisconnectWebRtcActiveConnection: 'Portal_DisconnectWebRtcActiveConnection',\n EnableStateMachine: 'Portal_EnableStateMachine',\n StateMachineStatusForAlerting: 'Portal_StateMachineStatusForAlerting',\n StateMachineStatusForInCall: 'Portal_StateMachineStatusForInCall',\n StateMachineStatusForRinging: 'Portal_StateMachineStatusForRinging',\n IsCustomerMonitorRefresh: 'Portal_IsCustomerMonitorRefresh',\n IsShowAppVersion: 'Portal_ShowAppVersionAfterLogin',\n TwilioErrorLimitToLog: 'Portal_TwilioErrorLimitToLog',\n ShowNonIVRLanguagesDropdown: 'Portal_ShowNonIVRLanguagesDropdown',\n FilterOverflowVendorsBasedOnLanguage: 'Portal_FilterOverflowVendorsBasedOnLanguage',\n ValidateMetadata: 'Portal_ValidateMetadata',\n ValidateSipdata: 'Portal_ValidateSipdata',\n EnableTwilioClientDebugging: 'Portal_EnableTwilioClientDebugging',\n CreateTokenOnError: 'Portal_CreateTokenOnError',\n RefreshReminder: 'Portal_RefreshReminder',\n preFlight: 'Portal_PreFlight',\n DisableStatusChange: 'Portal_DisableStatusChange',\n TokenRefreshMilliseconds: 'Portal_WebRTCTokenRefreshMilliseconds',\n ShowWebRTCReconnectionStatus: 'Portal_ShowWebRTCReconnectionStatus',\n WebRTCTokenAgeMinutes: 'IVR_TwilioWebRTC_TokenValidityInMinutes',\n WebRTCEdgeLocations: 'Portal_WebRTCEdgeLocations',\n CodecPreferences: 'Portal_CodecPreferences',\n LogTwilioErrorsOnConsole: 'Portal_LogTwilioErrorsOnConsole',\n TwilioSDKVersion: 'Portal_TwilioSDKVersion',\n RegisterDeviceWhenOffline: 'Portal_RegisterDeviceWhenOffline',\n RefreshRetainsCall: 'Portal_RefreshRetainsCall',\n ShowAdditionalStuckCalls: 'Portal_ShowAdditionalStuckCalls',\n NoTalkActionMessage1: 'Portal_NoTalkActionMessage_1',\n NoTalkActionMessage2: 'Portal_NoTalkActionMessage_2',\n PremiumRatePhoneNumberPrefix: 'IVR_PremiumRatePhoneNumberPrefix',\n ShowScheduledCallAlert: 'Portal_ScheduledCall_Alert',\n IvrNewVoicePortalUsedByInterpreter: 'IVR_NewVoicePortal_UsedByInterpreter',\n IvrNewVoicePortalUsedByOperator: 'IVR_NewVoicePortal_UsedByOperator',\n IvrNewVoicePortalUsedByOperatorByDefault: 'IVR_NewVoicePortal_UsedByOperatorByDefault',\n PortalSwitchingPortalsDelay: 'Portal_SwitchingPortalsDelay'\n })\n .constant('callEvents', {\n LSButtonVisible: 'LSButtonVisible',\n ConnectButtonVisible: 'ConnectButtonVisible',\n ConnectMeButtonVisible: 'ConnectMeButtonVisible',\n ConnectInterpreterButtonVisible: 'ConnectInterpreterButtonVisible',\n LSButtonClicked: 'LSButtonClicked',\n ConnectButtonClicked: 'ConnectButtonClicked',\n ConnectMeButtonClicked: 'ConnectMeButtonClicked',\n ConnectInterpreterButtonClicked: 'ConnectInterpreterButtonClicked',\n LSClickedFailed: 'LSClickedFailed',\n ConnectClickFailedNoInterpreters: 'ConnectClickFailedNoInterpreters',\n ConnectMeClickedFailed: 'ConnectMeClickedFailed',\n ConnectInterpreterClickedFailed: 'ConnectInterpreterClickedFailed',\n AlertButtonVisible: 'AlertButtonVisible',\n AlertSoundPlaying: 'AlertSoundPlaying',\n ReconnectWarningButtonVisible: 'ReconnectWarningButtonVisible',\n ReconnectButtonClicked: 'ReconnectButtonClicked',\n MetadataAnswerChanged: 'MetadataAnswerChanged',\n SipCallHeaderChanged: 'SipCallHeaderChanged',\n UserHangup: 'UserHangup',\n PhoneHangup: 'PhoneHangup',\n WebRTCHangup: 'WebRTCHangup',\n DispositionMenuCallWasSuccessfull: 'DispositionMenuCallWasSuccessfull',\n DispositionMenuWrongLanguageSelected: 'DispositionMenuWrongLanguageSelected',\n DispositionMenuAudioLossAndOrCantHear: 'DispositionMenuAudioLossAndOrCantHear',\n DispositionMenuNoCustomerAndOrOnlyLEP: 'DispositionMenuNoCustomerAndOrOnlyLEP',\n DispositionMenuInaudibleNonEnglishSpeaker: 'DispositionMenuInaudibleNonEnglishSpeaker',\n DispositionMenuCustomerDropCallQuality: 'DispositionMenuCustomerDropCallQuality',\n DispositionMenuCustomerDropAbruptly: 'DispositionMenuCustomerDropAbruptly',\n DispositionMenuCustomerDropWhileConferencing: 'DispositionMenuCustomerDropWhileConferencing',\n DispositionMenuInterpreterNolongerNeeded: 'DispositionMenuInterpreterNolongerNeeded',\n DispositionMenuOther: 'DispositionMenuOther',\n DispositionMenuCouldNotHearCustomerAndOrLEP: 'DispositionMenuCouldNotHearCustomerAndOrLEP',\n DispositionMenuPoorAudioQuality: 'DispositionMenuPoorAudioQuality',\n DispositionMenuCallDropped: 'DispositionMenuCallDropped',\n DispositionMenuTechnicalProblem: 'DispositionMenuTechnicalProblem',\n DispositionMenuCustomerDidNotReturnFromHold: 'DispositionMenuCustomerDidNotReturnFromHold',\n DispositionMenuCustomerHangupOrTransferContd: 'DispositionMenuCustomerHangupOrTransferContd',\n NoDispositionOptionSelected: 'NoDispositionOptionSelected',\n ShowedNoTalkDisposition: 'ShowedNoTalkDisposition',\n NoInterpreter: 'NoInterpreter',\n CancelledCall: 'CancelledCall',\n LowMosWebRTCError: 'LowMosWebRTCError',\n HighRttWebRTCError: 'HighRttWebRTCError',\n HighJitterWebRTCError: 'HighJitterWebRTCError',\n HighPacketLossWebRTCError: 'HighPacketLossWebRTCError',\n AudioDeviceChanged: 'AudioDeviceChanged',\n WebRTCErrorCleared: 'WebRTCErrorCleared',\n ConnectToMale: 'ConnectToMale',\n ConnectToFemale: 'ConnectToFemale',\n InterpreterOnAnotherCall: 'InterpreterOnAnotherCall',\n HangupButtonVisible: 'HangupButtonVisible',\n CustomerPutCallOnHold: 'CustomerPutCallOnHold',\n LEPPutCallOnHoldOrDelayedCall: 'LEPPutCallOnHoldOrDelayedCall',\n CustomerOrLEPNotJoinedCall: 'CustomerOrLEPNotJoinedCall',\n ActiveInterpretationGoingOn: 'ActiveInterpretationGoingOn',\n AudioOrTechnicalIssue: 'AudioOrTechnicalIssue',\n HighPacketsLossFractionWebRTCError: 'HighPacketsLossFractionWebRTCError',\n QualityMonitorOnCall: 'QualityMonitorOnCall'\n });\n})();\n\n(function () {\r\n 'use strict';\r\n\r\n var core = angular.module('vox-leonis.core');\r\n\r\n core.config(toastrConfig);\r\n\r\n toastrConfig.$inject = ['toastr'];\r\n /* @ngInject */\r\n function toastrConfig(toastr) {\r\n toastr.options.timeOut = 4000;\r\n toastr.options.positionClass = 'toast-bottom-right';\r\n }\r\n\r\n var config = {\r\n appErrorPrefix: '[portal Error] ',\r\n appTitle: 'Lionbridge Voice Portal'\r\n };\r\n\r\n core.value('config', config);\r\n\r\n core.config(configure);\r\n\r\n configure.$inject = ['$logProvider', '$httpProvider', 'routerHelperProvider', 'exceptionHandlerProvider', 'applicationInsightsServiceProvider'];\r\n /* @ngInject */\r\n function configure($logProvider, $httpProvider, routerHelperProvider, exceptionHandlerProvider, applicationInsightsServiceProvider) {\r\n if ($logProvider.debugEnabled)\r\n {\r\n $logProvider.debugEnabled(true);\r\n }\r\n exceptionHandlerProvider.configure(config.appErrorPrefix);\r\n routerHelperProvider.configure({ docTitle: config.appTitle + ' ' });\n\n $httpProvider.interceptors.push('httpInterceptor');\n\n //turn on all default telemetry\n var options = {\r\n // applicationName: used as a 'friendly name' prefix to url paths\r\n // ex: myAmazingapp/mainView\r\n applicationName: 'vox-leonis',\r\n // autoPageViewTracking: enables the sending a event to Application Insights when\r\n // ever the $locationChangeSuccess event is fired on the rootScope\r\n autoPageViewTracking: true,\r\n // autoStateChangeTracking: enables the sending a event to Application Insights when\r\n // ever the $stateChangeSuccess event is fired on the rootScope. To enable 'autoPageViewTracking' option should be set too.\r\n autoStateChangeTracking: true,\r\n // autoLogTracking: enables the interception of calls to the $log service and have the trace\r\n // data sent to Application Insights.\r\n autoLogTracking: true,\r\n // autoExceptionTracking: enables calls to the $exceptionHandler service, usually unhandled exceptions, to have the error and stack data sent to Application Insights.\r\n autoExceptionTracking: true,\r\n // sessionInactivityTimeout: The time (in milliseconds) that a user session can be inactive, before a new session will be created (on the next api call). Default is 30mins.\r\n sessionInactivityTimeout: 1800000,\r\n // developerMode: Makes the service not post anything to AI but print it to the console instead\r\n developerMode: false\r\n };\n\n var appInsightsInstrumentationKey /* @setApplicationInsightsKey */;\n\r\n applicationInsightsServiceProvider.configure(appInsightsInstrumentationKey, options);\n\n var enableCorsCorrelationFlag = false;\n\n // sepcify the domains that you want to allow to communicate with dc.services.visualstudio.com/v2/track\n // blank with allow all domains\n\n var correlationHeaderExcludedDomains = '';\n\n /*jshint immed: false */\n var appInsights = (function (config) {\r\n function i(config) { t[config] = function () { var i = arguments; t.queue.push(function () { t[config].apply(t, i); }); }; }\n var t = { config: config }, u = document, e = window, o = 'script', s = 'AuthenticatedUserContext';\n var h = 'start', c = 'stop', l = 'Track', a = l + 'Event', v = l + 'Page', y = u.createElement(o), r, f;\n y.src = config.url || 'https://az416426.vo.msecnd.net/scripts/a/ai.0.js';\n u.getElementsByTagName(o)[0].parentNode.appendChild(y);\n try { t.cookie = u.cookie; } catch (p) { } for (t.queue = [], t.version = '1.0',\n r = ['Event', 'Exception', 'Metric', 'PageView', 'Trace', 'Dependency']; r.length;) { i('track' + r.pop()); }\n return i('set' + s), i('clear' + s), i(h + a), i(c + a), i(h + v), i(c + v), i('flush'),\n config.disableExceptionTracking || (r = 'onerror', i('_' + r), f = e[r],\n e[r] = function (config, i, u, e, o) { var s = f && f(config, i, u, e, o); return (s !== true) && t['_' + r](config, i, u, e, o), s; }), t;\r\n }({\r\n instrumentationKey: appInsightsInstrumentationKey,\n enableCorsCorrelation: enableCorsCorrelationFlag,\n correlationHeaderExcludedDomains: [correlationHeaderExcludedDomains]\r\n }));\r\n\r\n window.appInsights = appInsights;\r\n appInsights.trackPageView();\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.console')\r\n .directive('voxUserInformation', voxUserInformation);\n\r\n function voxUserInformation() {\r\n var directive = {\r\n bindToController: true,\r\n controller: VoxUserInformationController,\r\n controllerAs: 'vm',\r\n replace: true,\r\n restrict: 'E',\r\n scope: {\n 'operatorPools': '=',\n 'interpreterLanguagePayrates': '=',\n 'isCustomerMonitor': '='\r\n },\r\n templateUrl: 'app/console/vox-user-information.html'\r\n };\n\r\n return directive;\n\r\n }\r\n\r\n /* @ngInject */\r\n function VoxUserInformationController() {\r\n\r\n var vm = this;\n\r\n }\r\n})(angular);\n\n(function () {\n 'use strict';\n\n angular\n .module('vox-leonis.console')\n .directive('voxConsoleStatus', voxConsoleStatus);\n\n voxConsoleStatus.$inject = ['enums', 'userservice', '$timeout'];\n\n /* @ngInject */\n function voxConsoleStatus(enums, userservice, $timeout) {\n var directive = {\n bindToController: true,\n controller: ConsoleStatusController,\n controllerAs: 'vm',\n replace: true,\n restrict: 'E',\n scope: {\n 'operator': '=',\n 'interpreter': '=',\n 'monitor': '='\n },\n link: function postLink(scope, element, args, vm) {\n var operatorWatch = scope.$watch('vm.operator', function (newVal, oldVal) {\n if (newVal !== undefined) {\n // only try getting the alert when the page initially loads (vm.person is undefined)\n\n vm.person = newVal;\n scope.vm.notify(vm.person);\n scope.vm.setStatusIntoCookie(vm.person.Status);\n\n if (!vm.person.TempPhoneNumber) {\n vm.person.TempPhoneNumber = vm.person.PhoneNumber;\n }\n handlePersonStatus();\n vm.logClientJavaScriptVersion(vm.person.Id);\n }\n });\n\n var interpreterWatch = scope.$watch('vm.interpreter', function (newVal, oldVal) {\n if (newVal !== undefined && vm.operator === undefined) {\n // only try getting the alert when the page initially loads (vm.person is undefined)\n\n vm.person = newVal;\n scope.vm.notify(vm.person);\n scope.vm.setStatusIntoCookie(vm.person.Status);\n\n if (!vm.person.TempPhoneNumber) {\n vm.person.TempPhoneNumber = vm.person.PhoneNumber;\n }\n handlePersonStatus();\n vm.logClientJavaScriptVersion(vm.person.Id);\n }\n });\n\n var monitorWatch = scope.$watch('vm.monitor', function (newVal, oldVal) {\n if (newVal !== undefined && vm.operator === undefined && vm.interpreter === undefined) {\n vm.person = newVal;\n\n if (!vm.person.TempPhoneNumber) {\n vm.person.TempPhoneNumber = vm.person.PhoneNumber;\n }\n handlePersonStatus();\n vm.logClientJavaScriptVersion(vm.person.Id);\n scope.vm.setStatusIntoCookie(vm.person.Status);\n }\n });\n\n function handlePersonStatus() {\n if (vm.person && isVisibleStatusReasonChangedMessage(vm.person.UserStatusReason)) {\n if (vm.person.Status === enums.PersonStatusNames.Unavailable) {\n //Adding a second delay to handle subscriber initialization delay on page refresh\n $timeout(showStatusChangeReason, 60000);\n }\n else {\n showStatusChangeReason();\n }\n }\n }\n\n function showStatusChangeReason() {\n userservice.showChangeStatusReason(vm.person.Status, vm.person.LastStatusChange, vm.person.UserStatusReason);\n }\n\n function isVisibleStatusReasonChangedMessage(userStatusReason) {\n var statusReasonsToHideInitially = [enums.PersonStatusReason.MissedAlert];\n\n return statusReasonsToHideInitially.indexOf(userStatusReason) < 0;\n }\n\n // change the user's status to Unavailable and back again based on the phone number validation\n var errorMessageWatch = scope.$watch('vm.phoneErrorMessage', function (newVal) {\n vm.phoneErrorMessageChanged(enums.Events.PhoneErrorMessageChanged, { message: newVal, setUserStatus: true });\n });\n\n scope.$on('$destroy', function () {\n operatorWatch();\n interpreterWatch();\n monitorWatch();\n errorMessageWatch();\n });\n },\n templateUrl: 'app/console/vox-console-status.html'\n };\n return directive;\n }\n\n ConsoleStatusController.$inject = ['$scope', '$cookies', '$uibModalStack', '$timeout', 'enums', 'interpreterservice', 'operatorservice', 'monitorservice',\n 'interpretersignalreceiver', 'operatorsignalreceiver', 'monitorsignalreceiver', 'session', 'accountservice', 'userservice', 'usermessageservice', 'twiliowebrtcservice', 'utilities',\n 'preferences', 'appsettingsservice', 'constants'];\n /* @ngInject */\n function ConsoleStatusController($scope, $cookies, $uibModalStack, $timeout, enums, interpreterservice, operatorservice, monitorservice,\n interpretersignalreceiver, operatorsignalreceiver, monitorsignalreceiver, session, accountservice, userservice, usermessageservice,\n twiliowebrtcservice, utilities, preferences, appsettingsservice, constants) {\n\n var vm = this;\n setupVars();\n setupMethods();\n activate();\n displayStatus();\n\n function setupVars() {\n vm.browserSupportsWebRTC = undefined;\n vm.invalidPhoneOriginalStatus = undefined;\n vm.statuses = enums.PersonStatus;\n vm.logLevel = enums.LogLevel;\n vm.person = undefined;\n vm.showContactMethods = false;\n vm.phoneErrorMessage = undefined;\n vm.roles = session.roles;\n vm.contactMethods = [];\n vm.interpreterData = undefined;\n vm.customerData = undefined;\n vm.language = undefined;\n vm.interpreterName = undefined;\n vm.customerDetails = undefined;\n vm.testButtonDisabledDefault = true;\n vm.currentRole = $cookies.get(constants.userRole);\n vm.showDefaultReminderText = undefined;\n vm.showDefaultOpertorReminderText = undefined;\n vm.panelClass = 'col-sm-5';\n vm.showWebRtcDialpad = 'false';\n vm.submitTimer = 0;\n vm.showWebRtcDialpad = 'false';\n vm.enableStateMachine = 'false';\n vm.stateMachineStatusForAlerting = '[Ringing, InCall, Available, Unavailable]';\n vm.stateMachineStatusForInCall = '[Reconnect, AfterCallWork, Available, Unavailable, Monitoring]';\n vm.stateMachineStatusForRinging = '[InCall, AfterCallWork, Available, Unavailable]';\n vm.isCustomerMonitor = true;\n vm.IsDisabledStatusChange = 'false';\n appsettingsservice.getAppSetting(preferences.IsShowDefaultReminder, vm.showDefaultReminderText).then(function (data) {\n if (vm.currentRole === constants.Interpreter) {\n vm.showDefaultReminderText = data;\n }\n });\n appsettingsservice.getAppSetting(preferences.IsShowDefaultOperatorReminder, vm.showDefaultOpertorReminderText).then(function (data) {\n if (vm.currentRole === constants.Operator) {\n vm.showDefaultOpertorReminderText = data;\n }\n });\n appsettingsservice.getAppSetting(preferences.ShowWebRtcDialpad, 'false').then(function (data) {\n vm.showWebRtcDialpad = data;\n });\n appsettingsservice.getAppSetting(preferences.EnableStateMachine, 'false').then(function (data) {\n vm.enableStateMachine = data;\n });\n appsettingsservice.getAppSetting(preferences.StateMachineStatusForAlerting, vm.stateMachineStatusForAlerting).then(function (data) {\n vm.stateMachineStatusForAlerting = data;\n });\n appsettingsservice.getAppSetting(preferences.StateMachineStatusForInCall, vm.stateMachineStatusForInCall).then(function (data) {\n vm.stateMachineStatusForInCall = data;\n });\n appsettingsservice.getAppSetting(preferences.StateMachineStatusForRinging, vm.stateMachineStatusForRinging).then(function (data) {\n vm.stateMachineStatusForRinging = data;\n });\n appsettingsservice.getAppSetting(preferences.DisableStatusChange, vm.IsDisabledStatusChange).then(function (data) {\n vm.IsDisabledStatusChange = data;\n });\n userservice.getUserSetting('Portal_CustomerMonitor', '').then(function (data) {\n vm.isCustomerMonitor = data !== undefined && data !== '';\n });\n }\n\n function setupMethods() {\n vm.enums = enums;\n vm.logClientJavaScriptVersion = logClientJavaScriptVersion;\n vm.phoneErrorMessageChanged = phoneErrorMessageChanged;\n vm.statusChanged = statusChanged;\n vm.statusDisabled = statusDisabled;\n vm.statusOptionHidden = statusOptionHidden;\n vm.setTempPhoneNumber = setTempPhoneNumber;\n vm.setStatusIntoCookie = setStatusIntoCookie;\n vm.notify = notify;\n }\n\n usermessageservice.subscribe($scope, 'notify', function (event, data) {\n\n if (data.eventName === 'interpreterDetails') {\n vm.interpreterDetails = data.interpreterdata;\n }\n if (data.eventName === 'operatorDetails') {\n vm.operatorDetails = data.operatordata;\n }\n if (data.eventName === 'customerDetails') {\n vm.customerDetails = data;\n }\n\n if (data.eventName === 'contactMethodChange') {\n vm.statusChanged();\n }\n });\n usermessageservice.subscribe($scope, 'disableWebRTC', function (event, data) {\n twiliowebrtcservice.disable(data.message);\n });\n function notify(person) {\n usermessageservice.notify('person', { data: person });\n }\n\n function displayStatus() {\n var status = enums.PersonStatus;\n var index = -1;\n\n if (vm.roles.indexOf('Monitor') === -1) {\n for (var i = 0; i < status.length; i++) {\n if (status[i].name === enums.PersonStatusNames.Monitoring) {\n index = i;\n break;\n }\n }\n if (index > -1) {\n status.splice(index, 1);\n }\n\n }\n vm.statuses = status;\n }\n\n function activate() {\n listeners();\n vm.browserSupportsWebRTC = twiliowebrtcservice.isWebRTCSupported();\n\n userservice.getUserSetting('IVR_ContactMethods', '').then(function (contactMethods) {\n vm.contactMethods = contactMethods.split(',');\n contactMethodSelectShown(vm.contactMethods);\n });\n //we will need this preference to check defaults while force notifying test directive when a call ends\n appsettingsservice.getAppSetting(preferences.TestButtonDisabled, vm.testButtonDisabledDefault).then(function (data) {\n vm.testButtonDisabledDefault = (data === 'true');\n });\n }\n\n function listeners() {\n $scope.$on(interpretersignalreceiver.interpreterStatusEvent, interpreterStatus);\n $scope.$on(operatorsignalreceiver.operatorStatusEvent, operatorStatus);\n $scope.$on(monitorsignalreceiver.monitorStatusEvent, monitorStatus);\n $scope.$on(enums.Events.SetTempPhoneNumber, setTempPhoneNumber);\n $scope.$on(enums.Events.PhoneErrorMessageChanged, phoneErrorMessageChanged);\n }\n\n function statusChanged(reason) {\n var statusChangeTime = new Date().toISOString();\n userservice.showChangeStatusReason(vm.person.Status, statusChangeTime, reason);\n setStatusIntoCookie(vm.person.Status);\n if (!vm.testButtonDisabledDefault) {\n notifyTestButtonDirective(vm.person.Status);\n }\n if (vm.person === vm.operator) {\n return operatorservice.setStatus(vm.person.Status, reason).then(function (result) {\n if (result === false) {\n accountservice.logMessage('Message: statusChanged - Operator setStatus action failed, UserId: ' + vm.person.Id, vm.logLevel.Warn);\n } else {\n if (vm.monitor) {\n vm.monitor.Status = vm.person.Status;\n }\n }\n });\n }\n else if (vm.person === vm.interpreter) {\n return interpreterservice.setStatus(vm.person.Status, reason).then(function (result) {\n if (result === false) {\n accountservice.logMessage('Message: statusChanged - Interpreter setStatus action failed, UserId: ' + vm.person.Id +\n ', Status: ' + vm.person.Status + ', Reason: ' + reason, vm.logLevel.Warn);\n } else {\n if (vm.monitor) {\n vm.monitor.Status = vm.person.Status;\n }\n }\n });\n }\n else if (vm.person === vm.monitor) {\n return monitorservice.setStatus(vm.person.Status, reason).then(function (result) {\n if (result === false) {\n accountservice.logMessage('Message: statusChanged - Monitor setStatus action failed, UserId: ' + vm.person.Id, vm.logLevel.Warn);\n }\n });\n }\n }\n\n // Event Handlers\n\n function interpreterStatus(event, data) {\n $scope.$apply(function () {\n if (checkAllowedStatusChanges(vm.interpreter.Status, data.statusName, vm.interpreter.Id)) {\n if (data.statusName !== undefined) {\n removeModal(data.statusName);\n vm.interpreter.Status = data.statusName;\n if (vm.showWebRtcDialpad === 'true' && vm.interpreter.ContactMethod === enums.ContactMethod.WebRTC && data.statusName === enums.PersonStatusNames.Available) {\n resetDialpad();\n }\n setStatusIntoCookie(vm.interpreter.Status);\n //If user has interpreter and operator role and user accept the call as interpreter then\n // vm.person not updated with updated status\n vm.person.Status = data.statusName;\n vm.person.UserStatusReason = data.reason;\n\n if (vm.monitor) {\n vm.monitor.Status = data.statusName;\n }\n\n if (vm.currentRole === constants.Interpreter && (data.statusName === enums.PersonStatusNames.InCall || data.statusName === enums.PersonStatusNames.Reconnect)) {\n appsettingsservice.getAppSetting(preferences.IsShowDefaultReminder, vm.showDefaultReminderText).then(function (data) {\n if (vm.currentRole === constants.Interpreter) {\n vm.showDefaultReminderText = data;\n }\n });\n }\n else {\n vm.showDefaultReminderText = 'false';\n }\n //If the reconnect time out elapses and customer dissconnect the call then hide the reconnect error message\n //Or if the interpreter clicked on reconnect button then do not hide the message.\n if (vm.person.Status !== enums.PersonStatusNames.Reconnect) {\n usermessageservice.notify(enums.Events.ShowInstructionMessage, { message: false });\n }\n if (!vm.testButtonDisabledDefault && (vm.person.Status === enums.PersonStatusNames.Available || vm.person.Status === enums.PersonStatusNames.Unavailable)) {\n //ending call should notify child directive\n notifyTestButtonDirective(vm.person.Status);\n }\n if (data.statusName === enums.PersonStatusNames.AfterCallWork) {\n usermessageservice.notify('notify', { eventName: 'disableHangupButton', message: true });\n }\n if (data.reason === enums.PersonStatusReason.PoorLatency) {\n userservice.showChangeStatusReason(data.statusName, data.time, data.reason);\n }\n\n userservice.showChangeStatusReason(data.statusName, data.time, data.reason);\n }\n }\n else {\n accountservice.logMessage('vox-console-status.interpreterStatus| Check allowed status failed' + vm.interpreter.Status + ' desired status: ' + data.statusName +\n ' userId:' + vm.interpreter.Id, vm.logLevel.Warn);\n }\n });\n }\n\n function monitorStatus(event, data) {\n $scope.$apply(function () {\n if (checkAllowedStatusChanges(vm.monitor.Status, data.statusName, vm.monitor.Id)) {\n removeModal(data.statusName);\n if (vm.showWebRtcDialpad === 'true' && vm.monitor.ContactMethod === enums.ContactMethod.WebRTC && data.statusName === enums.PersonStatusNames.Available) {\n resetDialpad();\n }\n vm.monitor.Status = data.statusName;\n vm.person.Status = data.statusName;\n setStatusIntoCookie(vm.person.Status);\n userservice.showChangeStatusReason(data.statusName, data.time, data.reason);\n }\n else {\n accountservice.logMessage('vox-console-status.monitorStatus| Check allowed status failed ' + vm.monitor.Status + ' desired status: ' + data.statusName +\n ' userId:' + vm.monitor.Id, vm.logLevel.Warn);\n }\n });\n }\n\n function operatorStatus(event, data) {\n $scope.$apply(function () {\n if (checkAllowedStatusChanges(vm.operator.Status, data.statusName, vm.operator.Id)) {\n removeModal(data.statusName);\n vm.operator.Status = data.statusName;\n if (vm.showWebRtcDialpad === 'true' && vm.operator.ContactMethod === enums.ContactMethod.WebRTC && data.statusName === enums.PersonStatusNames.Available) {\n resetDialpad();\n }\n setStatusIntoCookie(vm.operator.Status);\n\n if (vm.currentRole === constants.Operator && data.statusName === enums.PersonStatusNames.InCall) {\n appsettingsservice.getAppSetting(preferences.IsShowDefaultOperatorReminder, vm.showDefaultOpertorReminderText).then(function (data) {\n if (vm.currentRole === constants.Operator) {\n vm.showDefaultOpertorReminderText = data;\n }\n });\n }\n else {\n vm.showDefaultOpertorReminderText = 'false';\n }\n\n if (vm.monitor) {\n vm.monitor.Status = data.statusName;\n }\n\n if (data.statusName === enums.PersonStatusNames.AfterCallWork) {\n usermessageservice.notify('notify', { eventName: 'disableHangupButton', message: true });\n }\n if (!vm.testButtonDisabledDefault && (vm.person.Status === enums.PersonStatusNames.Available || vm.person.Status === enums.PersonStatusNames.Unavailable)) {\n //ending call should notify child directive\n notifyTestButtonDirective(vm.person.Status);\n }\n\n userservice.showChangeStatusReason(data.statusName, data.time, data.reason);\n }\n else {\n accountservice.logMessage('vox-console-status.operatorStatus| Check allowed status failed ' + vm.operator.Status + ' desired status: ' + data.statusName +\n ' userId: ' + vm.operator.Id, vm.logLevel.Warn);\n }\n });\n }\n\n //Check status wether it is allowed to be change\n function checkAllowedStatusChanges(currentStatus, desiredStatus, userId) {\n accountservice.logMessage('vox-console-status.checkAllowedStatusChanges Entered| current status:' + currentStatus + ' desired status: ' + desiredStatus +\n ' userId:' + userId, vm.logLevel.Info);\n\n var result = false;\n if (vm.enableStateMachine !== 'true') {\n accountservice.logMessage('vox-console-status.checkAllowedStatusChanges State Machine is disabled', vm.logLevel.Info);\n return true;\n }\n\n switch (currentStatus) {\n case enums.PersonStatusNames.Alerting:\n if (validateAllowedStatus(desiredStatus, vm.stateMachineStatusForAlerting)) {\n result = true;\n }\n break;\n case enums.PersonStatusNames.InCall:\n if (validateAllowedStatus(desiredStatus, vm.stateMachineStatusForInCall)) {\n result = true;\n }\n break;\n case enums.PersonStatusNames.Ringing:\n if (validateAllowedStatus(desiredStatus, vm.stateMachineStatusForRinging)) {\n result = true;\n }\n break;\n default:\n result = true;\n break;\n }\n\n return result;\n }\n\n function validateAllowedStatus(desiredStatus, allowedStatus) {\n if (allowedStatus.indexOf(desiredStatus) !== -1) {\n return true;\n }\n else {\n return false;\n }\n }\n\n // when a user misses a call, their status is changed to Unavailable and the modal is left open\n // their status has since changed, so close the modal if it is still open\n function removeModal(statusName) {\n if (statusName === enums.PersonStatusNames.Available || statusName === enums.PersonStatusNames.AvailablePhone || statusName === enums.PersonStatusNames.Monitoring) {\n $uibModalStack.dismissAll('');\n vm.showDefaultReminderText = 'false';\n vm.showDefaultOpertorReminderText = 'false';\n }\n }\n\n function getStatus() {\n var status = '';\n if (!vm.person) {\n return status;\n }\n\n if (vm.person === vm.operator) {\n status = vm.operator.Status;\n }\n else if (vm.person === vm.interpreter) {\n status = vm.interpreter.Status;\n }\n else if (vm.person === vm.monitor) {\n status = vm.monitor.Status;\n }\n return status;\n }\n\n // Don't let interpreters / operators manually change their status when they've been assigned a 'system' status\n function statusDisabled() {\n vm.testButtonDisabled = false;\n // SuperUsers have no restrictions\n if (vm.roles.indexOf('SuperUser') >= 0) {\n return false;\n }\n\n if (!vm.person) {\n return false;\n }\n\n if (vm.person.Status === enums.PersonStatusNames.Unavailable && vm.phoneErrorMessage) {\n return true;\n }\n\n if (vm.person.UserStatusReason === enums.PersonStatusReason.DropThresholdExceeded) {\n return true;\n }\n\n if (vm.IsDisabledStatusChange === 'true') {\n\n if (vm.person.UserStatusReason === enums.PersonStatusReason.PoorLatency) {\n return true;\n }\n\n if (vm.person.UserStatusReason === enums.PersonStatusReason.ImprovedLatency) {\n return false;\n }\n }\n\n var status = getStatus();\n switch (status) {\n case enums.PersonStatusNames.Alerting:\n case enums.PersonStatusNames.InCall:\n case enums.PersonStatusNames.Ringing:\n case enums.PersonStatusNames.Reconnect:\n case enums.PersonStatusNames.AfterCallWork:\n return true;\n case enums.PersonStatusNames.Quarantine:\n return true;\n }\n return false;\n }\n\n function chkStatusName(status, statusName) {\n var userIsOnlyMonitor = false;\n var isInterpreter = false;\n if (vm.roles) {\n if (vm.roles.length === 1 && vm.roles[0] === 'Monitor') {\n userIsOnlyMonitor = true;\n }\n if (vm.roles.indexOf('Interpreter') >= 0 && vm.roles.indexOf('Operator') < 0) {\n isInterpreter = true;\n }\n }\n\n var result = getResultByStatus(status, statusName, isInterpreter, userIsOnlyMonitor);\n return result;\n }\n\n function getResultByStatus(status, statusName, isInterpreter, userIsOnlyMonitor) {\n var result = false;\n switch (statusName) {\n case enums.PersonStatusNames.Alerting:\n case enums.PersonStatusNames.InCall:\n case enums.PersonStatusNames.AvailablePhone:\n case enums.PersonStatusNames.Ringing:\n case enums.PersonStatusNames.Reconnect:\n case enums.PersonStatusNames.AfterCallWork:\n case enums.PersonStatusNames.Quarantine:\n result = true;\n break;\n case enums.PersonStatusNames.Unavailable:\n result = (status !== enums.PersonStatusNames.Unavailable); // To hide Unavailable status If interpreter select the Away or Available status\n break;\n case enums.PersonStatusNames.NotAvailable: // Hide from interpreters and monitors but not opererators\n result = isInterpreter || userIsOnlyMonitor;\n break;\n case enums.PersonStatusNames.Away:\n result = userIsOnlyMonitor;\n break;\n case enums.PersonStatusNames.Offline:\n result = (status !== enums.PersonStatusNames.Offline);\n break;\n }\n return result;\n }\n\n // When an interpreter's / operator's status is a non-system status, hide the system statuses\n function statusOptionHidden(statusName) {\n\n // SuperUsers have no restrictions\n if (vm.roles.indexOf('SuperUser') >= 0) {\n return false;\n }\n\n if (!vm.person) {\n return false;\n }\n\n var status = getStatus();\n\n if ((status === enums.PersonStatusNames.Available) || (status === enums.PersonStatusNames.Away) || (status === enums.PersonStatusNames.Unavailable) ||\n (status === enums.PersonStatusNames.NotAvailable) || (status === enums.PersonStatusNames.Offline) || (status === enums.PersonStatusNames.Monitoring)) {\n return chkStatusName(status, statusName);\n }\n\n return false;\n }\n\n function setTempPhoneNumber() {\n if (vm.TempPhoneNumber) {\n vm.person.TempPhoneNumber = vm.TempPhoneNumber;\n }\n }\n\n function phoneErrorMessageChanged(data, event) {\n if (data !== undefined && event.message !== undefined) {\n if (event.setUserStatus) {\n if (vm.person.Status !== enums.PersonStatusNames.Unavailable) {\n vm.invalidPhoneOriginalStatus = vm.person.Status;\n vm.person.Status = enums.PersonStatusNames.Unavailable;\n vm.statusChanged(enums.PersonStatusReason.InvalidPhoneNumber);\n }\n }\n }\n else if (vm.invalidPhoneOriginalStatus) {\n vm.person.Status = vm.invalidPhoneOriginalStatus;\n vm.invalidPhoneOriginalStatus = undefined;\n vm.statusChanged();\n }\n }\n\n function logClientJavaScriptVersion(personId) {\n var fileName = utilities.getClientAppJavaScriptFileName();\n if (fileName && fileName.length > 0) {\n accountservice.logMessage('Message: JavaScript application, UserId: ' + personId + ', FileName: ' + fileName, vm.logLevel.Info);\n }\n }\n\n // Should we show the contact method selector?\n // this flag will hide/show contact methods directive\n function contactMethodSelectShown(contactMethods) {\n switch (contactMethods.length) {\n case 0:\n vm.showContactMethods = false;\n break;\n case 1:\n vm.showContactMethods = (+contactMethods[0] === +enums.ContactMethod.WebRTC);\n break;\n default:\n vm.showContactMethods = true;\n }\n }\n\n function notifyTestButtonDirective(status) {\n usermessageservice.notify('callStatus', { StatusName: status });\n }\n function setStatusIntoCookie(statusName) {\n $cookies.put('currentStatus', statusName);\n usermessageservice.notify('notify', { eventName: 'currentStatus', statusName: statusName });\n }\n\n function resetDialpad() {\n usermessageservice.notify('resetDialpad');\n }\n\n }\n})();\n\n(function (angular) {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.console')\r\n .directive('voxConsoleReminder', voxConsoleReminder);\r\n\r\n /* @ngInject */\r\n function voxConsoleReminder() {\r\n var directive = {\r\n bindToController: true,\r\n controller: ConsoleReminderController,\r\n controllerAs: 'vm',\r\n replace: true,\r\n restrict: 'E',\r\n scope: {\r\n 'interpreterDetails': '=',\r\n 'operatorDetails': '=',\n 'customerDetails': '='\r\n },\r\n templateUrl: 'app/console/vox-console-reminder.html'\r\n };\r\n return directive;\r\n }\r\n\r\n ConsoleReminderController.$inject = ['$scope', '$cookies', 'enums', 'constants', 'accountservice', 'appsettingsservice', 'preferences', 'usermessageservice'];\r\n\r\n /* @ngInject */\r\n function ConsoleReminderController($scope, $cookies, enums, constants, accountservice, appsettingsservice, preferences, usermessageservice) {\r\n\r\n var vm = this;\r\n\r\n vm.reminder = undefined;\n vm.greeting = undefined;\n vm.closing = undefined;\n vm.customReminderText = undefined;\n vm.customerGreetingText = undefined;\r\n vm.customerReminder = undefined;\r\n vm.customerGreeting = undefined;\r\n vm.language = undefined;\r\n vm.customerdata = undefined;\r\n vm.interpreterdata = undefined;\n vm.interpreterPin = vm.interpreterDetails !== undefined ? vm.interpreterDetails.Pin : undefined;\n vm.interpreterName = vm.interpreterDetails !== undefined ? vm.interpreterDetails.FirstName : undefined;\r\n vm.callId = undefined;\r\n var userId = vm.interpreterDetails !== undefined ? vm.interpreterDetails.Id : vm.operatorDetails.Id;\n usermessageservice.subscribe($scope, 'notify', function (event, data) {\n if (data.eventName === 'customerDetails') {\r\n vm.customerDetails = data;\n vm.customerdata = data.customerdata;\n getGreetingReminderText();\r\n }\n });\r\n\n //To get The Preference Value\r\n var getDefaultShowReminderText = '|';\r\n if (vm.interpreterDetails !== undefined) {\r\n appsettingsservice.getAppSetting(preferences.DefaultShowReminderText, getDefaultShowReminderText).then(function (data) {\r\n getDefaultShowReminderText = data;\r\n getGreetingReminderText();\r\n });\r\n }\r\n else {\r\n appsettingsservice.getAppSetting(preferences.DefaultShowOperatorReminderText, getDefaultShowReminderText).then(function (data) {\r\n getDefaultShowReminderText = data;\r\n getGreetingReminderText();\r\n });\r\n }\n\n usermessageservice.subscribe($scope, 'notify', function (event, data) {\n if (data.eventName === 'refreshCustomerDetails') {\n accountservice.logMessage('Message: vox-console-reminder| Message:Enter, CallId:' + data.callId + 'OldCallId:' + vm.customerDetails.callId, enums.LogLevel.Debug);\n if (vm.customerDetails.callId !== data.callId) {\r\n vm.customerDetails = data;\n if (vm.customerDetails.customerdata) {\n getGreetingReminderText();\n }\r\n }\r\n }\r\n });\r\n\r\n function getGreetingReminderText() {\n\n setValues();\n\r\n accountservice.logMessage('Message: vox-console-reminder| Message:Enter, CallId:' + vm.callId + 'UserId: ' + userId, enums.LogLevel.Debug);\n\r\n getReminderTextDatabase();\r\n getGreetingText();\n getClosingText();\r\n\n if (vm.interpreterDetails !== undefined && !vm.customerGreeting && !vm.customerReminder) {\r\n vm.customerReminder = 'Please use the following greeting and closing below';\r\n vm.customerGreeting = 'Hello, this is ' + vm.interpreterName + '; I am your Lionbridge ' + vm.language + ' interpreter. I am ready for your instructions.';\r\n }\r\n var displayedGreeting = (vm.customerGreeting === null || vm.customerGreeting === undefined) ? 'false' : 'true';\r\n var displayedReminder = (vm.customerReminder === null || vm.customerReminder === undefined) ? 'false' : 'true';\n\r\n accountservice.logMessage('Message: vox-console-reminder| Message:Exit, CallId: ' + vm.callId + ' userId: ' +\r\n userId + ' DisplayedGreeting? ' + displayedGreeting + ' DisplayedReminder? ' + displayedReminder, enums.LogLevel.Debug);\r\n }\r\n\r\n function getReminderTextDatabase() {\r\n if (vm.reminder === null) {\r\n var value = getDefaultShowReminderText.split('|');\r\n vm.reminder = value[0];\r\n vm.customerReminder = vm.reminder.replace('Reminder:', '');\r\n }\r\n else {\n var reminderHasData = true;\n if (vm.reminder && vm.reminder.match('Reminder:')) {\r\n vm.customerReminder = vm.reminder.replace('Reminder:', '');\r\n }\r\n else {\r\n vm.customerReminder = vm.reminder;\r\n }\n accountservice.logMessage('Message: vox-console-reminder| Message:Exit, CallId:' + vm.callId + ' reminderHasData: ' +\n reminderHasData + ' reminder: ' + vm.reminder, enums.LogLevel.Debug);\r\n }\r\n }\r\n\r\n function getGreetingText() {\r\n var usedDefaultGreeting = false;\n if (!vm.greeting) {\r\n vm.greeting = getDefaultShowReminderText.split('|')[1];\n usedDefaultGreeting = true;\n }\r\n vm.greeting = vm.greeting.replace('Greeting:', '');\n if (vm.interpreterName) {\n vm.greeting = vm.greeting.replace('[First Name]', vm.interpreterName);\r\n }\n if (vm.language) {\n vm.greeting = vm.greeting.replace('[language]', vm.language);\r\n }\n if (vm.interpreterPin) {\n vm.greeting = vm.greeting.replace('[PIN]', vm.interpreterPin);\r\n }\n\n vm.customerGreeting = vm.greeting;\n\n accountservice.logMessage('Message: vox-console-reminder| Message:Exit, CallId:' + vm.callId + ' usedDefaultGreeting: ' +\n usedDefaultGreeting + ' Greeting: ' + vm.greeting + ' UserId: ' + userId, enums.LogLevel.Debug);\r\n }\n\n function getClosingText() {\n if (vm.closing === null) {\r\n if (vm.interpreterDetails !== undefined) {\r\n vm.closing = '<div class=\"font-italic mb-1\">Is there anything else I can assist you with?</div><div><span><strong>If No</strong>' +\n '</span><i class=\"fas fa-long-arrow-alt-right\"></i><span class=\"font-italic\">Thank you for calling Lionbridge for your language needs.</span></div>';\r\n }\n else {\n vm.closing = '<span class=\"font-italic\">Standard Closing in the event of a no-show: Unfortunately, we do not have an interpreter available at this time.' +\n ' Thank you, good bye.</span><br />' +\r\n '<span class=\"font-italic\"><strong>No Show Closing with Option to Schedule a Call</strong>: Would you like to schedule an appointment for a future date time?' +\n ' If so, what is your PIN, contact information and preference for the new date / time.We will add this request to our system and provide a final status update' +\n ' as soon as possible.Thank you, good bye.</span><br /><span class=\"font-italic\"><strong>No Show for No Cleared Interpreters</strong>:' +\n ' Unfortunately, we do not have any cleared resources available for this language.' +\n ' Our recruitment efforts are ongoing and we apologize for the inconvenience. Thank you, good bye.</span><br />';\n }\r\n }\r\n }\n\n function setValues() {\n vm.language = vm.customerDetails.languageName;\n vm.callId = vm.customerDetails.callId;\n vm.reminder = vm.interpreterDetails !== undefined ? vm.customerDetails.customerdata.InterpreterReminder : vm.customerDetails.customerdata.OperatorReminder;\r\n vm.greeting = vm.interpreterDetails !== undefined ? vm.customerDetails.customerdata.InterpreterGreeting : vm.customerDetails.customerdata.OperatorGreeting;\n vm.closing = vm.interpreterDetails !== undefined ? null : vm.customerDetails.customerdata.OperatorClosing;\n accountservice.logMessage('Message: vox-console-reminder| Message:Set Values for reminder and greeting , CallId:' + vm.callId + 'Reminder : ' +\n vm.reminder + ' Greeting : ' + vm.greeting + ' UserId: ' + userId, enums.LogLevel.Debug);\n\r\n }\r\n }\r\n})(angular);\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.console')\r\n .directive('voxConsoleInstructionMessage', voxConsoleInstructionMessage);\n\r\n function voxConsoleInstructionMessage() {\r\n var directive = {\r\n bindToController: true,\r\n controller: ConsoleInstructionMessageController,\r\n controllerAs: 'vm',\r\n replace: true,\r\n restrict: 'E',\r\n scope: {\n 'userId': '=',\r\n },\r\n templateUrl: 'app/console/vox-console-instruction-message.html'\r\n };\r\n return directive;\r\n }\r\n\r\n ConsoleInstructionMessageController.$inject = ['$scope', '$timeout', 'enums', 'accountservice', 'usermessageservice', 'interpretersignalreceiver', 'operatorsignalreceiver'];\r\n\r\n /* @ngInject */\r\n function ConsoleInstructionMessageController($scope, $timeout, enums, accountservice, usermessageservice, interpretersignalreceiver, operatorsignalreceiver) {\r\n\r\n var vm = this;\r\n vm.userMessage = false;\r\n //To get The Preference Value\n setupSubscriptions();\n listeners();\n\n function setupSubscriptions() {\r\n usermessageservice.subscribe($scope, 'notify', function (event, data) {\r\n switch (data.eventName) {\r\n //reconnect instruction for interpreters\r\n case 'reconnectWarning':\r\n $timeout(showMessage(data.message, 'reconnectWarning'));\r\n break;\n\r\n case 'ReconnectInitialized':\r\n $timeout(showMessage(data.message, 'ReconnectInitialized'));\r\n break;\r\n\r\n case 'interpreterDropAbruptly':\r\n $timeout(showMessage(data.message, 'interpreterDropAbruptly'));\r\n break;\n\n case 'TwilioErrors':\r\n $timeout(showMessage(data.message, 'TwilioErrors'));\r\n break;\n }\r\n });\r\n\r\n usermessageservice.subscribe($scope, enums.Events.ShowInstructionMessage, function (event, data) {\n vm.userMessage = data.message;\n });\r\n }\n\n function listeners() {\r\n $scope.$on(interpretersignalreceiver.interpreterPostServerMessageEvent, PostServerMessage);\n $scope.$on(operatorsignalreceiver.operatorPostServerMessageEvent, PostServerMessage);\r\n\r\n }\n\n function showMessage(showInstructionalMessage, eventName) {\n if (showInstructionalMessage) {\n switch (eventName) {\r\n case 'reconnectWarning':\r\n vm.userMessage = 'Click on the Reconnect button to avoid any abrupt disruption between you and the customer.';\r\n break;\r\n case 'ReconnectInitialized':\r\n vm.userMessage = 'Please hang up your phone to re-establish the connection with the Customer.';\r\n break;\n case 'interpreterDropAbruptly':\r\n vm.userMessage = 'The customer is connecting with you because the previous interpreter disconnected. Please continue interpretating for this customer.';\r\n $timeout(hideInstructionMessage, 15000);\n break;\n case 'TwilioErrors':\r\n vm.userMessage = 'You are experiencing a poor network condition and your audio quality will be degraded.';\r\n break;\n case 'WebRTCReconnecting':\r\n vm.userMessage = 'Call connectivity lost! Trying to reconnect you automatically';\r\n break;\n case 'WebRTCReconnected':\r\n vm.userMessage = 'The call has regained connectivity.';\r\n break;\r\n default:\r\n vm.userMessage = false;\n break;\r\n }\r\n }\n else {\n vm.userMessage = false;\r\n }\r\n }\n\n function PostServerMessage(event, data) {\r\n $scope.$apply(function () {\r\n accountservice.logMessage('Message: vox-console-instruction-message.PostServerMessage, UserId: ' + vm.userId + ', Message: ' + data.message, enums.LogLevel.Debug);\n //temp bug fix for 1041120\n if (data.reason !== 40 && data.reason !== 41) {\n vm.userMessage = data.message;\r\n }\r\n $timeout(hideInstructionMessage, 15000);\r\n });\r\n }\r\n\r\n // hide user instruction from UI\r\n function hideInstructionMessage() {\r\n vm.userMessage = false;\r\n }\r\n }\r\n})(angular);\n\n(function (angular) {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.console')\r\n .directive('voxConsoleCallControlPanel', voxConsoleCallControlPanel);\r\n\r\n /* @ngInject */\r\n function voxConsoleCallControlPanel() {\r\n var directive = {\r\n bindToController: true,\r\n controller: ConsoleCallControlPanelController,\r\n controllerAs: 'vm',\r\n restrict: 'E',\r\n scope: { 'person': '=' },\r\n templateUrl: 'app/console/vox-console-call-control-panel.html'\r\n };\r\n return directive;\r\n }\r\n\r\n ConsoleCallControlPanelController.$inject = ['$timeout', 'enums', 'twiliowebrtcservice', 'usermessageservice', '$scope', 'constants', '$cookies', 'userservice', 'callEvents',\r\n 'interpreterservice', 'accountservice', 'appsettingsservice', 'preferences', 'operatorservice', 'utilities', 'interpretersignalreceiver'];\r\n /* @ngInject */\r\n function ConsoleCallControlPanelController($timeout, enums, twiliowebrtcservice, usermessageservice, $scope, constants, $cookies, userservice, callEvents, interpreterservice,\r\n accountservice, appsettingsservice, preferences, operatorservice, utilities, interpretersignalreceiver) {\r\n var vm = this;\r\n\r\n vm.hangUp = hangUp;\r\n vm.selectedContactMethod = undefined;\r\n vm.callId = $cookies.get(constants.callId);\n vm.currentRole = $cookies.get(constants.userRole);\r\n vm.personCurrentStatus = $cookies.get('currentStatus');\r\n vm.IsInterpreterDispositionMenu = 'true';\n vm.disconnectWebRtcActiveConnection = 'false';\n vm.isHangUpDisabled = true;\n vm.isApplicableforDisposition = false;\n vm.refreshRetainsCall = false;\n vm.showNoTalkPopup = false;\n vm.showing = false;\n appsettingsservice.getAppSetting(preferences.RefreshRetainsCall, vm.refreshRetainsCall).then(function (data) {\r\n vm.refreshRetainsCall = (data === 'true');\r\n });\n\n setupSubscriptions();\n setuplisteners();\n isInCall();\n if (vm.currentRole !== undefined) {\n if (vm.currentRole === constants.Interpreter || vm.currentRole === constants.Operator) {\r\n appsettingsservice.getAppSetting(preferences.IsInterpreterDispositionMenu, vm.dispositionMenuPrefFlag).then(function (data) {\r\n vm.dispositionMenuPrefFlag = (data === 'true');\n if (vm.dispositionMenuPrefFlag) {\n vm.isApplicableforDisposition = true;\r\n }\r\n });\n }\n\n appsettingsservice.getAppSetting(preferences.DisconnectWebRtcActiveConnection, vm.disconnectWebRtcActiveConnection).then(function (data) {\r\n vm.disconnectWebRtcActiveConnection = data;\r\n });\r\n }\n\n function enableHangupButton() {\r\n vm.isHangUpDisabled = false;\r\n vm.callId = $cookies.get(constants.callId);\n utilities.logButtonShowEvent(callEvents.HangupButtonVisible, vm.callId);\n }\n\n function setupSubscriptions() {\n usermessageservice.subscribe($scope, 'notify', function (event, data) {\r\n switch (data.eventName) {\r\n\r\n //subscribe 'contactMethod' event\r\n case 'contactMethod':\r\n vm.selectedContactMethod = data.message.id;\r\n break;\n //subscribe 'disableHangupButton' event\r\n case 'disableHangupButton':\r\n vm.personCurrentStatus = $cookies.get('currentStatus');\n if (data.message === true) {\r\n if (vm.personCurrentStatus === enums.PersonStatusNames.AfterCallWork) {\n vm.isHangUpDisabled = true;\n }\n }\n else {\n vm.isHangUpDisabled = false;\r\n }\r\n break;\r\n //subscribe 'hangUp' event\r\n case 'hangUp':\n hangUp();\r\n break;\r\n }\r\n });\n usermessageservice.subscribe($scope, 'notalksubmitted', function (event, data) {\r\n vm.showNoTalkPopup = false;\n vm.showing = false;\r\n });\n }\r\n function setuplisteners() {\r\n $scope.$on(interpretersignalreceiver.interpreterNoTalkActivityEvent, NoTalkActivity);\r\n }\n function NoTalkActivity(event, data) {\r\n $scope.$apply(function () {\r\n if (data) {\r\n if (!vm.showing && !vm.showNoTalkPopup && data.message === 'Show NoTalk Events') {\r\n vm.showing = true;\r\n vm.showNoTalkPopup = true;\n vm.callId = $cookies.get(constants.callId);\r\n userservice.addCallEvent(callEvents.ShowedNoTalkDisposition, vm.callId);\r\n setTimeout(function () { vm.showing = false; }, 2000);\r\n }\r\n else if (vm.showNoTalkPopup && data.message === 'Clear No Talk') {\r\n vm.showNoTalkPopup = false;\r\n }\r\n }\r\n });\r\n }\r\n function hangUp() {\n accountservice.logMessage('vox-console-call-control-panel.hangUp| Enter CallId: ' + vm.callId + ', CurrentRole: ' +\n vm.currentRole + ' DispositionPreference: ' + vm.dispositionMenuPrefFlag + 'ApplicableForDisposition: ' + vm.isApplicableforDisposition, enums.LogLevel.Debug);\n if (vm.selectedContactMethod === enums.ContactMethod.WebRTC) {\n usermessageservice.notify('resetDialpad');\n if (vm.refreshRetainsCall) {\n console.log('clearing device');\n twiliowebrtcservice.clearDevice(false);\n }\r\n }\r\n if (vm.currentRole === constants.Interpreter && vm.dispositionMenuPrefFlag) {\r\n interpreterservice.setStatus(enums.PersonStatusNames.AfterCallWork, '0').then(function (data) {\r\n if (data === true) {\n vm.isHangUpDisabled = true;\n dissconnectCallAndAddEvent();\n vm.isApplicableforDisposition = true;\n vm.person.Status = enums.PersonStatusNames.AfterCallWork;\r\n accountservice.logMessage('vox-console-call-control-panel.hangUp|CallId: ' + vm.callId + ', CurrentRole: ' +\n vm.currentRole, enums.LogLevel.Debug);\r\n }\n });\r\n }\r\n else if (vm.currentRole === constants.Operator && vm.dispositionMenuPrefFlag) {\r\n operatorservice.setStatus(enums.PersonStatusNames.AfterCallWork, '0').then(function (data) {\r\n if (data === true) {\n vm.isHangUpDisabled = true;\r\n dissconnectCallAndAddEvent();\n vm.isApplicableforDisposition = true;\n vm.person.Status = enums.PersonStatusNames.AfterCallWork;\r\n accountservice.logMessage('vox-console-call-control-panel.hangUp|CallId: ' + vm.callId + ', CurrentRole: ' +\n vm.currentRole, enums.LogLevel.Debug);\r\n }\r\n });\r\n }\r\n else {\r\n dissconnectCallAndAddEvent();\r\n }\r\n }\n\n function isInCall() {\n vm.personCurrentStatus = $cookies.get('currentStatus');\n\r\n if (vm.personCurrentStatus === enums.PersonStatusNames.InCall) {\r\n $timeout(enableHangupButton, 1500);\r\n }\r\n\r\n else if (vm.personCurrentStatus === enums.PersonStatusNames.AfterCallWork) {\n vm.isHangUpDisabled = true;\r\n }\r\n }\r\n\r\n function dissconnectCallAndAddEvent() {\r\n vm.callId = $cookies.get(constants.callId);\r\n if (vm.person.ContactMethod === enums.ContactMethod.WebRTC) {\n accountservice.logMessage('vox-console-call-control-panel.Hangup| Message: WebRTC Hangup Called, CallId: ' + vm.callId + ', UserId: ' + vm.person.Id, enums.LogLevel.Debug);\n userservice.addCallEvent(callEvents.WebRTCHangup, vm.callId);\n if (vm.disconnectWebRtcActiveConnection === 'true') {\n twiliowebrtcservice.disconnect();\r\n }\n else {\n twiliowebrtcservice.hangUp();\r\n }\r\n }\r\n else {\r\n if (vm.callId) {\n userservice.addCallEvent(callEvents.PhoneHangup, vm.callId);\r\n userservice.disconnectCall(vm.callId);\n accountservice.logMessage('vox-console-call-control-panel.Hangup| Message: Phone Hangup Called, CallId: ' + vm.callId + ', UserId: ' + vm.person.Id, enums.LogLevel.Debug);\r\n\n }\r\n }\r\n }\r\n }\r\n})(angular);\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.console')\r\n .directive('voxConsoleAlert', voxConsoleAlert);\r\n\r\n function voxConsoleAlert() {\r\n var directive = {\r\n bindToController: true,\r\n controller: ConsoleAlertController,\r\n controllerAs: 'vm',\r\n replace: true,\r\n restrict: 'E',\r\n scope: {\n 'operator': '=',\n 'interpreter': '=',\n 'monitor': '=',\n 'person': '=',\r\n },\r\n templateUrl: 'app/console/vox-console-alert.html'\r\n };\r\n return directive;\r\n }\r\n\r\n ConsoleAlertController.$inject = ['$scope', '$timeout', '$cookies', 'enums', 'accountservice', 'userservice', 'usermessageservice',\n 'interpretersignalreceiver', 'operatorsignalreceiver', 'appsettingsservice', 'preferences', 'callEvents', 'constants'];\r\n /* @ngInject */\r\n function ConsoleAlertController($scope, $timeout, $cookies, enums, accountservice, userservice, usermessageservice,\n interpretersignalreceiver, operatorsignalreceiver, appsettingsservice, preferences, callEvents, constants) {\r\n var vm = this;\n setupVars();\n setupUser();\n activate();\n \n function activate() {\n listeners();\n setupSubscriptions();\r\n }\n\n function setupVars() {\r\n vm.alert = undefined;\n vm.tryGettingAlert = undefined;\n vm.reCreateTokens = false;\n\n appsettingsservice.getAppSetting(preferences.ReCreateTokens, vm.reCreateTokens).then(function (data) {\r\n vm.reCreateTokens = (data === 'true');\r\n });\r\n }\n function setupUser() {\n if (vm.operator !== undefined) {\n vm.tryGettingAlert = vm.person === undefined;\n vm.person = vm.operator;\n if (vm.tryGettingAlert) {\r\n getCurrentAlert();\r\n }\r\n }\n\n if (vm.interpreter !== undefined && vm.operator === undefined) {\n vm.tryGettingAlert = vm.person === undefined;\n vm.person = vm.interpreter;\n if (vm.tryGettingAlert) {\r\n getCurrentAlert();\r\n }\r\n }\n if (vm.monitor !== undefined && vm.operator === undefined && vm.interpreter === undefined) {\n vm.person = vm.monitor;\r\n }\n \r\n }\n\n function setupSubscriptions() {\r\n usermessageservice.subscribe($scope, 'notify', function (event, data) {\r\n switch (data.eventName) {\r\n\r\n //displays message after accepting the call\r\n case 'Accept':\r\n setupAlertActionMessage('Accept','alert alert-warning', 'Get ready to answer your phone...');\n //When we know that an alert is successfully accepted and is a webRTC call, Regenerate the token\n\r\n break;\r\n\r\n //displays message when a alert is already accepted by some other person\r\n case 'AlreadyAccept':\r\n setupAlertActionMessage('AlreadyAccept', 'alert alert-info', 'We\\'ve assigned the call to another person.');\r\n break;\r\n\r\n //displays message after rejecting the alert\r\n case 'Reject':\r\n setupAlertActionMessage('Reject', 'alert alert-danger', 'You rejected the call.');\r\n break;\n\n case 'contactMethod':\r\n vm.person.ContactMethod = data.message.id;\r\n break;\r\n }\r\n });\r\n }\n\n function listeners() {\r\n $scope.$on(interpretersignalreceiver.alertStartEvent, alertStart);\r\n $scope.$on(interpretersignalreceiver.alertStopEvent, alertStop);\r\n $scope.$on(operatorsignalreceiver.alertStartEvent, alertStart);\r\n $scope.$on(operatorsignalreceiver.alertStopEvent, alertStop);\r\n }\r\n\r\n function hideAlertActionMessage() {\r\n vm.alertActionMessage = false;\r\n }\r\n\r\n function setupAlertActionMessage(action, alertType, alertActionMessage) {\n\n //change the action message if the call accepted is a webRTCCall,\n if (action === 'Accept' && +vm.person.ContactMethod === enums.ContactMethod.WebRTC)\n {\n alertActionMessage = 'You\\'ve accepted a browser call.';\r\n }\r\n vm.alertType = alertType;\r\n vm.alertActionMessage = alertActionMessage;\r\n $timeout(hideAlertActionMessage, 5000);\r\n }\r\n\r\n function getCurrentAlert() {\r\n var status = vm.person.Status;\r\n if (status === enums.PersonStatusNames.Alerting) {\r\n userservice.getCurrentAlert().then(function (data) {\r\n if (data !== '' && data.Id && data.ResourceRequestId) {\r\n vm.alert = { ResourceAlertId: data.Id, CallId: data.CallId, ResourceRequestId: data.ResourceRequestId };\r\n }\r\n });\r\n }\r\n }\n\n function alertStart(event, data) {\r\n $scope.$apply(function () {\n if (vm.person.Status !== enums.PersonStatusNames.Ringing || vm.person.Status !== enums.PersonStatusNames.InCall) {\r\n accountservice.logMessage('Message: vox-console-status.alertStart, UserId: ' + vm.person.Id + ', ResourceAlertId: ' + data.ResourceAlertId +\r\n ', ResourceRequestId: ' + data.ResourceRequestId + ', CallId: ' + data.CallId + ', IsTestCall: ' + data.IsTestCall + ',IsScheduleCall: ' +\n data.IsScheduleCall, enums.LogLevel.Debug);\r\n vm.alert = data;\r\n vm.alertActionMessage = false;\r\n }\n else {\n var currentCallId = $cookies.get(constants.callId);\n accountservice.logMessage('Message: vox-console-status.alertStart, Interpreter is on another call. UserId: ' + vm.person.Id + ', ResourceAlertId: ' + data.ResourceAlertId +\r\n ', ResourceRequestId: ' + data.ResourceRequestId + ', CallId: ' + data.CallId + ', CurrentOngoing CallId: ' + currentCallId + ', IsTestCall: ' +\n data.IsTestCall + ',IsScheduleCall: ' + data.IsScheduleCall, enums.LogLevel.Debug);\n userservice.addCallEvent(callEvents.InterpreterOnAnotherCall, data.CallId, currentCallId);\r\n }\r\n });\r\n }\r\n\r\n function alertStop(event) {\r\n $scope.$apply(function () {\r\n vm.alert = undefined;\r\n });\r\n }\r\n }\r\n})(angular);\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.console')\r\n .directive('voxCallEvents', voxCallEvents);\r\n\r\n /* @ngInject */\r\n function voxCallEvents() {\r\n var directive = {\r\n bindToController: true,\r\n controller: CallEventsController,\r\n controllerAs: 'vm',\r\n replace: true,\r\n restrict: 'E',\r\n scope: {\r\n 'callEvents': '=',\r\n 'callConnectedTime': '='\r\n },\r\n templateUrl: 'app/console/vox-call-events.html'\r\n };\r\n return directive;\r\n }\r\n\r\n CallEventsController.$inject = ['session'];\r\n /* @ngInject */\r\n function CallEventsController(session) {\r\n var vm = this;\r\n vm.getLocalDate = getLocalDate;\r\n vm.getAdditionalInfo = getAdditionalInfo;\r\n vm.callConnectedLocaleString = (new Date(vm.callConnectedTime)).toLocaleString();\r\n vm.roles = session.roles;\r\n\r\n function getLocalDate(callEvent) {\r\n var localDate = new Date(callEvent.EventTime);\r\n return localDate.toLocaleString();\r\n }\r\n\r\n function getAdditionalInfo(callEvent) {\r\n var additionalInfo = '';\r\n if (callEvent.StatusEvent === 'LanguageSelected') {\r\n additionalInfo = callEvent.LanguageName;\r\n } else {\r\n additionalInfo = getUserFullName(callEvent.UserFirstName, callEvent.UserLastName);\r\n }\r\n return additionalInfo;\r\n }\r\n\r\n function getUserFullName(firstName, lastName) {\r\n var name = '';\r\n if (firstName !== null) {\r\n name = firstName;\r\n }\r\n if (lastName !== null) {\r\n if (name === '') {\r\n name = lastName;\r\n } else {\r\n name = name + ' ' + lastName;\r\n }\r\n }\r\n return name;\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.console')\r\n .directive('voxCallDuration', voxCallDuration);\r\n\r\n /* @ngInject */\r\n function voxCallDuration() {\r\n var directive = {\r\n bindToController: true,\r\n controller: CallDurationController,\r\n controllerAs: 'vm',\r\n replace: true,\r\n restrict: 'E',\r\n scope: {\r\n 'callParticipants': '=',\r\n 'interpreterId': '=',\r\n 'operatorId': '=',\r\n 'callId': '=',\n 'betterVoiceCallId': '='\r\n },\r\n templateUrl: 'app/console/vox-call-duration.html'\r\n };\r\n return directive;\r\n }\r\n\r\n CallDurationController.$inject = ['appsettingsservice', 'utilities', 'usermessageservice', 'accountservice', 'enums'];\r\n /* @ngInject */\r\n function CallDurationController(appsettingsservice, utilities, usermessageservice, accountservice, enums) {\r\n var vm = this;\r\n vm.startTime = '';\n\r\n var reconnectWarningThreshold = getReconnectWarningThreshold();\r\n var autoReconnectThreshold = getAutoReconnectThreshold();\r\n\r\n vm.thresholds = [reconnectWarningThreshold, autoReconnectThreshold];\r\n\r\n // find the call participant of the supplied type\r\n if (vm.callParticipants) {\r\n for (var i = vm.callParticipants.length - 1; i >= 0; i--) {\r\n var callParticipant = vm.callParticipants[i];\n accountservice.logMessage('vox-call-duration|Message: Participants details., CallId: ' +\n vm.callId + ', ParticipantId: ' + callParticipant.ParticipantId + ', StartTime: ' + callParticipant.StartTime +\n ', ParticipantCallId: ' + callParticipant.CallId, enums.LogLevel.Debug);\n\r\n if (vm.interpreterId && (callParticipant.InterpreterId === vm.interpreterId)) {\r\n vm.startTime = callParticipant.StartTime;\n if (!vm.betterVoiceCallId) {\r\n vm.thresholds = null;\n accountservice.logMessage('vox-call-duration|Message: Reconnect and AutoReconnect is disabled., CallId: ' +\n vm.callId + ', InterpreterId: ' + vm.interpreterId, enums.LogLevel.Debug);\n }\n else {\n //TODO: Get this value only once\r\n appsettingsservice.getAppSetting('Portal_ReconnectWarningMessageMinutes', vm.reconnectWarningMinutes).then(function (data) {\r\n reconnectWarningThreshold.limitInSeconds = utilities.convertMinutesToSeconds(data);\r\n });\r\n\r\n //TODO: Get this value only once\r\n appsettingsservice.getAppSetting('Portal_AutoReconnectMinutes', vm.autoReconnectMinutes).then(function (data) {\r\n autoReconnectThreshold.limitInSeconds = utilities.convertMinutesToSeconds(data);\r\n });\r\n\n //TODO: What if there are more than one interpreter in the participants list?\n //TODO: Is it safe to stop looping once we've found a match?\n\n accountservice.logMessage('vox-call-duration|Message: Reconnect and AutoReconnect duration have been' +\n 'initialized to ' + reconnectWarningThreshold.limitInSeconds + ' and ' +\n autoReconnectThreshold.limitInSeconds + ' seconds respectively., ' +\n 'CallId: ' + vm.callId + ', InterpreterId: ' + vm.interpreterId + ', BetterVoiceCallId: ' + vm.betterVoiceCallId, enums.LogLevel.Debug);\r\n }\r\n break;\r\n }\r\n else if (vm.operatorId && (callParticipant.OperatorId === vm.operatorId)) {\r\n vm.startTime = callParticipant.StartTime;\r\n vm.thresholds = null;\r\n break;\r\n }\r\n }\r\n }\r\n\r\n function getReconnectWarningThreshold() {\r\n return {\r\n limitInSeconds: utilities.convertMinutesToSeconds(1380),\r\n description: 'Showing Reconnect Button and Warning Message',\r\n raise: function () {\r\n usermessageservice.notify('notify', { message: true, eventName: 'reconnectWarning' });\r\n vm.showWarning = true;\r\n }\r\n };\r\n }\r\n\r\n function getAutoReconnectThreshold() {\r\n return {\r\n limitInSeconds: utilities.convertMinutesToSeconds(1380),\r\n description: 'Auto-Reconnecting Interpreter',\r\n raise: function () {\r\n usermessageservice.notify('notify', { eventName: 'AutoReconnect' });\r\n }\r\n };\r\n }\r\n }\r\n})();\r\n\n(function ()\r\n{\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.console')\r\n .run(appRun);\r\n\r\n appRun.$inject = ['routerHelper'];\r\n /* @ngInject */\r\n function appRun(routerHelper)\r\n {\r\n routerHelper.configureStates(getStates());\r\n }\r\n\r\n function getStates()\r\n {\r\n return [\r\n {\r\n state: 'console',\r\n config: {\r\n url: '/console',\r\n templateUrl: 'app/console/console.html',\r\n controller: 'ConsoleController',\r\n controllerAs: 'vm',\r\n title: 'Console',\r\n resolve: {\r\n getRoles: getRoles\r\n }\r\n }\r\n }\r\n ];\r\n }\r\n\r\n getRoles.$inject = ['$state', '$cookies', 'accountservice', 'session', 'constants'];\r\n /* @ngInject */\r\n function getRoles($state, $cookies, accountservice, session, constants) {\n var currentRole = $cookies.get(constants.userRole);\r\n if (currentRole === undefined) {\n $state.go('login');\n return;\n }\n else if (session.roles === undefined) {\r\n return accountservice.getRoles().then(function (data) {\r\n session.roles = data.Roles;\r\n return session.roles;\r\n }).catch(function (e) {\r\n if (e.status === 401) {\r\n $state.go('login');\r\n }\r\n\r\n session.roles = undefined;\r\n return session.roles;\r\n });\r\n }\r\n else {\r\n return session.roles;\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.console')\r\n .controller('ConsoleController', ConsoleController);\r\n\r\n ConsoleController.$inject = ['$scope', '$q', '$state', '$interval', '$cookies', 'logger', 'enums',\r\n 'session', 'signalservice', 'appsettingsservice', 'utilities', 'usermessageservice', 'preferences', 'constants'];\r\n /* @ngInject */\r\n function ConsoleController($scope, $q, $state, $interval, $cookies, logger, enums,\r\n session, signalservice, appsettingsservice, utilities, usermessageservice, preferences, constants) {\r\n var vm = this;\r\n\r\n vm.identity = undefined;\r\n vm.interpreter = undefined;\r\n vm.operator = undefined;\r\n vm.monitor = undefined;\r\n vm.roles = session.roles;\r\n vm.callType = 'Operator';\r\n vm.beepSound = undefined;\r\n vm.logLevel = enums.LogLevel;\n vm.person = undefined;\r\n vm.maximised = true;\n vm.user = undefined;\r\n var keepAliveInterval;\n vm.showWebRtcDialpad = 'false';\r\n\r\n activate();\r\n\r\n function activate() {\n var currentRole = $cookies.get(constants.userRole);\r\n if (currentRole === undefined) {\n $state.go('login');\n return;\n }\r\n signalservice.connect();\r\n vm.user = vm.operator || vm.interpreter || vm.monitor;\r\n vm.beepSound = new Audio('assets/audio/Silence.mp3');\r\n vm.beepSound.autoplay = true;\r\n\r\n var setKeepAliveIntervalSeconds = 40;\r\n appsettingsservice.getAppSetting('Portal_SetKeepAliveIntervalSeconds', setKeepAliveIntervalSeconds).then(function (data) {\r\n setKeepAliveIntervalSeconds = data;\r\n }).finally(function () {\r\n keepAliveInterval = utilities.startKeepAliveInterval(vm.roles, setKeepAliveIntervalSeconds);\r\n });\n\r\n appsettingsservice.getAppSetting(preferences.ShowWebRtcDialpad, 'false').then(function (data) {\r\n vm.showWebRtcDialpad = data;\r\n });\n\n appsettingsservice.getAppSetting(preferences.IsShowAppVersion, vm.showAppVersionFlag).then(function (data) {\r\n vm.showAppVersionFlag = (data === 'true');\r\n if (vm.showAppVersionFlag) {\r\n getApplicationVersion();\r\n }\r\n });\n\r\n var promises = [];\r\n return $q.all(promises).then(function () {\r\n logger.info('Activated Console View');\r\n }).catch(function (e) {\r\n if (e.status === 401) {\r\n $state.go('login');\r\n }\r\n });\n }\r\n usermessageservice.subscribe($scope, 'person', function (event, data) {\r\n vm.person = data.data;\r\n });\n \n usermessageservice.subscribe($scope, 'notify', function (event, data) {\n switch (data.eventName) {\r\n\r\n //subscribe 'contactMethod' event\r\n case 'contactMethod':\r\n vm.person.ContactMethod = data.message.id;\r\n break;\r\n }\n });\n\n usermessageservice.subscribe($scope, 'dialpadMaximize', function (event, data) {\r\n if (data.message) {\n vm.maximised = true;\r\n }\n else {\n vm.maximised = false;\r\n }\r\n\r\n });\r\n $scope.$on('$destroy', function () {\r\n if (keepAliveInterval) {\r\n $interval.cancel(keepAliveInterval);\r\n }\r\n });\n function getApplicationVersion() {\r\n appsettingsservice.getAppVersion().then(function (data) {\r\n vm.version = data;\n vm.version = 'v' + data;\n });\r\n }\r\n }\r\n})();\r\n\r\n\n(function ()\r\n{\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.admin', [\r\n 'vox-leonis.core'\r\n ]);\r\n})();\r\n\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.admin')\r\n .directive('voxAdmin', voxAdmin);\r\n\r\n /* @ngInject */\r\n function voxAdmin() {\r\n var directive = {\r\n bindToController: true,\r\n controller: AdminLayoutController,\r\n controllerAs: 'vm',\r\n replace: true,\r\n restrict: 'E',\r\n scope: {\r\n 'roles': '=',\r\n },\r\n templateUrl: 'app/admin/vox-admin.html'\r\n };\r\n return directive;\r\n }\r\n\r\n AdminLayoutController.$inject = ['$scope', '$q', '$state', 'logger', 'operatorservice', 'operatorsignalreceiver',\r\n 'utilities', 'constants', 'reducecallfrequencyservice', 'appsettingsservice', 'preferences', 'userservice'];\r\n /* @ngInject */\r\n function AdminLayoutController($scope, $q, $state, logger,\r\n operatorservice, operatorsignalreceiver, utilities, constants, reducecallfrequencyservice, appsettingsservice, preferences) {\r\n var vm = this;\r\n vm.loggedInInterpreters = undefined;\r\n\r\n var getLoggedInInterpretersDelay = 1000;\r\n\r\n operatorservice.get().then(function (data) {\r\n if (data !== '') {\r\n var userId = data.Id;\r\n appsettingsservice.getAppSetting(preferences.GetLoggedInInterpretersDelayMilliseconds, getLoggedInInterpretersDelay, userId).then(function (data) {\r\n getLoggedInInterpretersDelay = data;\r\n });\r\n }\r\n });\r\n\r\n activate();\r\n\r\n function activate() {\r\n listeners();\r\n\r\n getLoggedInInterpretersCall();\r\n }\r\n\r\n function listeners() {\r\n $scope.$on(operatorsignalreceiver.refreshDataEvent, refreshData);\r\n }\r\n\r\n // Data retrieval\r\n function getLoggedInInterpreters() {\r\n return operatorservice.getLoggedInInterpreters().then(function (loggedInInterpreters) {\r\n return loggedInInterpreters;\r\n });\r\n }\r\n\r\n function getLoggedInInterpretersCall() {\r\n reducecallfrequencyservice.call(constants.operatorGetLoggedInInterpreters, function () {\r\n getLoggedInInterpreters().then(function (loggedInInterpreters) {\r\n vm.loggedInInterpreters = utilities.buildLoggedInInterpreters(loggedInInterpreters);\r\n }).catch(function (e) {\r\n if (e.status === 401) {\r\n $state.go('login');\r\n }\r\n });\r\n }, getLoggedInInterpretersDelay);\r\n }\r\n\r\n function refreshData(event, data) {\r\n $scope.$apply(function () {\r\n switch (data.property) {\r\n case 'InterpreterStatus':\r\n getLoggedInInterpretersCall();\r\n break;\r\n }\r\n });\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.admin')\r\n .directive('voxAdminCallsTable', voxAdminCallsTable);\r\n\r\n /* @ngInject */\r\n function voxAdminCallsTable() {\r\n var directive = {\r\n bindToController: true,\r\n controller: AdminCallsTableController,\r\n controllerAs: 'vm',\r\n replace: true,\r\n restrict: 'E',\r\n scope: {\r\n 'monitor': '=',\r\n 'roles': '='\r\n },\r\n templateUrl: 'app/admin/vox-admin-calls-table.html'\r\n };\r\n return directive;\r\n }\r\n\r\n AdminCallsTableController.$inject = ['$scope', '$cookies', '$rootScope', '$filter', '$interval', 'adminservice', 'session', 'operatorsignalreceiver',\r\n 'exception', 'monitorservice', 'monitorsignalreceiver', 'appsettingsservice', 'operatorservice', 'preferences', '$window', 'userservice', 'accountservice', 'enums', 'constants'];\r\n /* @ngInject */\r\n function AdminCallsTableController($scope, $cookies, $rootScope, $filter, $interval, adminservice, session, operatorsignalreceiver,\r\n exception, monitorservice, monitorsignalreceiver, appsettingsservice, operatorservice, preferences, $window, userservice, accountservice, enums, constants) {\r\n var vm = this;\r\n\r\n var userSpecRefreshRecentCallsInterval = null;\r\n vm.calls = [];\r\n vm.callsUpdating = false;\r\n vm.requestingToListen = null;\r\n vm.recentHours = 'No Interpreter:-1,Active:0,Calls with No Talk Activity:-3,1:1,2:2,3:3,6:6';\r\n vm.recentCallsRefreshIntervalSeconds = 15;\r\n vm.selectedHour = { id: '-1', name: 'Waiting for Interpreter' };\r\n vm.filterChange = filterChange;\r\n vm.monitorCall = monitorCall;\n vm.hasMonitoring = hasMonitoring;\r\n vm.hoursChanged = hoursChanged;\r\n vm.endConference = endConference;\n vm.customerMonitor = true;\n vm.isCustomerMonitorRefresh = false;\n vm.showTerminateButton = getTerminameButtonAdditionalCondition;\n vm.additionalStuckCallCondition = true;\r\n activate();\r\n\r\n function activate() {\r\n listeners();\n\r\n appsettingsservice.getAppSetting(preferences.isCustomerMonitorRefresh, vm.isCustomerMonitorRefresh).then(function (data) {\r\n vm.isCustomerMonitorRefresh = data !== undefined && data !== '';\n });\n\n appsettingsservice.getAppSetting(preferences.ShowAdditionalStuckCalls, vm.additionalStuckCallCondition).then(function (data) {\r\n vm.additionalStuckCallCondition = (data === 'true');\n });\n\r\n appsettingsservice.getAppSetting('Portal_RecentCallsTableHours', vm.recentHours).then(function (data) {\r\n vm.recentHours = recentCallCriteriaList(data);\r\n }).finally(function () {\r\n hoursChanged();\r\n });\n\n userservice.getUserSetting('Portal_CustomerMonitor', '').then(function (data) {\r\n vm.customerMonitor = data !== undefined && data !== '';\n if (vm.customerMonitor && vm.isCustomerMonitorRefresh) {\n userservice.getUserSetting(preferences.RecentCallsRefreshIntervalSeconds, vm.recentCallsRefreshIntervalSeconds).then(function (data) {\r\n vm.recentCallsRefreshIntervalSeconds = data;\r\n setTimerToRefreshRecentCalls();\r\n });\r\n }\r\n });\n\r\n if (session.roles.indexOf('Operator') >= 0) {\r\n operatorservice.get().then(function (data) {\r\n if (data !== '') {\r\n var userId = data.Id;\r\n appsettingsservice.getAppSetting(preferences.RecentCallsRefreshIntervalSeconds, vm.recentCallsRefreshIntervalSeconds, userId).then(function (data) {\r\n vm.recentCallsRefreshIntervalSeconds = data;\r\n setTimerToRefreshRecentCalls();\r\n });\r\n }\r\n });\r\n }\r\n }\r\n\r\n $scope.$on('$destroy', function () {\r\n $interval.cancel(userSpecRefreshRecentCallsInterval);\r\n });\r\n\r\n function listeners() {\r\n $scope.$on(operatorsignalreceiver.refreshDataEvent, refreshRecentCalls);\r\n $scope.$on(monitorsignalreceiver.refreshDataEvent, refreshRecentCallsForMonitor);\r\n }\r\n\r\n function hoursChanged() {\r\n getCalls(true).then(function (calls) {\r\n updateCalls(calls);\r\n });\r\n }\n \n function getTerminameButtonAdditionalCondition(callStatus) {\n var defaultCondition = (+vm.selectedHour.id === -2 || +vm.selectedHour.id === -3 || +vm.selectedHour.id === -4);\n var additionalCondition = false;\n if (vm.additionalStuckCallCondition) {\n switch (callStatus) {\r\n case 'CustomerConnected':\n case 'LanguageSelected':\n case 'InterpreterAlerting':\n case 'OperatorAlerting':\n case 'OperatorDisconnected':\n case 'InterpreterDisconnected':\n case 'InterpreterRinging':\n case 'OperatorRinging':\r\n additionalCondition = true;\n break;\r\n default:\r\n additionalCondition = false;\r\n break;\n }\n }\n return defaultCondition || additionalCondition;\r\n }\n\r\n function recentCallCriteriaList(list) {\r\n return list.split(',').map(function (attribute) {\r\n var dividedAttribute = attribute.split(':');\n var hours = dividedAttribute[0];\r\n return {\r\n id: dividedAttribute[1],\r\n name: dividedAttribute[1] > 0 ? 'Completed within ' + hours + ' hour' + (+hours === 1 ? '' : 's') : dividedAttribute[0]\r\n };\r\n });\r\n }\r\n\r\n // get the call data\r\n function getCalls(forceGet) {\r\n vm.callsUpdating = true;\r\n\r\n return adminservice.getCalls(vm.selectedHour.id, forceGet)\r\n .then(getCallsComplete, getCallsFailed);\r\n\r\n function getCallsComplete(response) {\r\n vm.callsUpdating = false;\r\n return response;\r\n }\r\n\r\n function getCallsFailed(e) {\r\n vm.callsUpdating = false;\r\n return exception.catcher('getCalls')(e);\r\n }\r\n }\r\n\r\n // refresh the data every 10 seconds\r\n function refreshRecentCalls(event, data) {\r\n $scope.$apply(function () {\r\n if (data.property === 'RecentCalls') {\r\n getCalls(false).then(function (calls) {\r\n updateCalls(calls);\r\n });\r\n }\r\n });\r\n }\r\n\r\n function refreshRecentCallsForMonitor(event, data) {\r\n if (!session.roles || session.roles.indexOf('Operator') >= 0 || session.roles.indexOf('Admin') >= 0 || session.roles.indexOf('SuperUser') >= 0) {\r\n // this user is a monitor and an operator and so received 2 refresh recent calls events. only need to refresh once, exit here\r\n return;\r\n }\r\n refreshRecentCalls(event, data);\r\n }\r\n\r\n function updateCalls(calls) {\r\n if (calls && calls !== 'NoUpdate') {\r\n for (var i = 0; i < calls.length; i++) {\r\n var call = calls[i];\r\n // calculate the display value here so that users can search on this value\r\n call.CallConnectedDisplay = $filter('date')(call.CallConnected, 'medium');\n call.CallConnectedDisplay = call.CallConnectedDisplay.replace(new Date().getFullYear(), '');\r\n }\r\n vm.calls = calls;\r\n }\r\n }\r\n\r\n function filterChange() {\r\n $rootScope.$broadcast('renderScrollableTable');\r\n }\r\n\r\n function monitorCall(callId) {\r\n vm.requestingToListen = callId;\n $cookies.put(constants.userRole, constants.monitor);\r\n monitorservice.listen(callId)\r\n .finally(function () {\r\n vm.requestingToListen = null;\r\n });\r\n }\r\n\n function hasMonitoring(monitoringRestricted) {\n var hasAccess = false;\n hasAccess = vm.monitor && (!monitoringRestricted || vm.roles.indexOf('SuperUser') >= 0);\n return hasAccess;\r\n }\n\r\n function setTimerToRefreshRecentCalls() {\r\n userSpecRefreshRecentCallsInterval = $interval(function () {\r\n //CustomerMonitor: refresh list of active calls.\n if (vm.customerMonitor && vm.isCustomerMonitorRefresh) {\n getCalls(false).then(function (calls) {\r\n updateCalls(calls);\r\n });\r\n }\n //actively refresh only when \"Show Calls - with No Interpreter\" or \"Abnormally Long\" is selected in the Recent Calls table\r\n else if (+vm.selectedHour.id === -1 || +vm.selectedHour.id === -2) {\r\n getCalls(false).then(function (calls) {\r\n updateCalls(calls);\r\n });\r\n }\r\n }, (vm.recentCallsRefreshIntervalSeconds * 1000));\r\n }\r\n\r\n function endConference(callId, referenceId) {\r\n var terminateCall = true;\r\n terminateCall = $window.confirm('Call with reference Id ' + referenceId + '. If you continue, call will be terminated. Are you sure you want to terminate the call?');\r\n\r\n if (terminateCall) {\r\n userservice.endConference(callId).then(function (data) {\r\n if (!data) {\r\n accountservice.logMessage('vox-admin-calls-table.endConference Action Failed, CallId: ' + callId + ',', enums.LogLevel.Warn);\r\n }\n else {\n hoursChanged();\r\n }\r\n });\r\n }\r\n }\r\n\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.admin')\r\n .run(appRun);\r\n\r\n appRun.$inject = ['routerHelper'];\r\n /* @ngInject */\r\n function appRun(routerHelper) {\r\n routerHelper.configureStates(getStates());\r\n }\r\n\r\n function getStates() {\r\n return [\r\n {\r\n state: 'admin',\r\n config: {\r\n url: '/admin',\r\n templateUrl: 'app/admin/admin.html',\r\n controller: 'AdminController',\r\n controllerAs: 'vm',\r\n title: 'Admin',\r\n resolve: {\r\n getRoles: getRoles\r\n }\r\n }\r\n }\r\n ];\r\n }\r\n\r\n getRoles.$inject = ['$state', '$cookies', 'accountservice', 'session', 'constants'];\r\n /* @ngInject */\r\n function getRoles($state, $cookies, accountservice, session, constants) {\n var currentRole = $cookies.get(constants.userRole);\r\n if (currentRole === undefined) {\n $state.go('login');\n return;\n }\r\n else if (session.roles === undefined) {\r\n return accountservice.getRoles().then(function (data) {\r\n session.roles = data.Roles;\r\n return session.roles;\r\n }).catch(function (e) {\r\n if (e.status === 401) {\r\n $state.go('login');\r\n }\r\n\r\n session.roles = undefined;\r\n return session.roles;\r\n });\r\n }\r\n else {\r\n return session.roles;\r\n }\r\n }\r\n})();\r\n\n(function () {\r\n 'use strict';\r\n\r\n angular\r\n .module('vox-leonis.admin')\r\n .controller('AdminController', AdminController);\r\n\r\n AdminController.$inject = ['$scope', '$q', '$state', '$cookies', 'session', 'signalservice', '$interval', 'utilities', 'appsettingsservice', 'constants'];\r\n /* @ngInject */\r\n function AdminController($scope, $q, $state, $cookies, session, signalservice, $interval, utilities, appsettingsservice, constants) {\r\n var vm = this;\r\n\r\n vm.identity = undefined;\r\n vm.interpreter = undefined;\r\n vm.roles = session.roles;\r\n var keepAliveInterval;\r\n\r\n activate();\r\n\r\n function activate() {\n var currentRole = $cookies.get(constants.userRole);\r\n if (currentRole === undefined) {\n $state.go('login');\n return;\n }\n\r\n signalservice.connect();\r\n\r\n var setKeepAliveIntervalSeconds = 40;\r\n appsettingsservice.getAppSetting('Portal_SetKeepAliveIntervalSeconds', setKeepAliveIntervalSeconds).then(function (data) {\r\n setKeepAliveIntervalSeconds = data;\r\n }).finally(function () {\r\n keepAliveInterval = utilities.startKeepAliveInterval(vm.roles, setKeepAliveIntervalSeconds);\r\n });\r\n\r\n var promises = [];\r\n return $q.all(promises).then(function () {\r\n }).catch(function (e) {\r\n if (e.status === 401) {\r\n $state.go('console');\r\n }\r\n });\r\n }\r\n\r\n $scope.$on('$destroy', function () {\r\n if (keepAliveInterval) {\r\n $interval.cancel(keepAliveInterval);\r\n }\r\n });\r\n }\r\n})();\r\n\r\n\n(function ()\r\n{\r\n 'use strict';\r\n\r\n angular.module('vox-leonis', [\r\n 'vox-leonis.admin',\r\n 'vox-leonis.core',\r\n 'vox-leonis.login',\r\n 'vox-leonis.operator',\r\n 'vox-leonis.monitor',\r\n 'vox-leonis.interpreter',\r\n 'vox-leonis.layout',\r\n 'vox-leonis.widgets',\r\n 'vox-leonis.console'\r\n ]);\r\n\r\n})();\r\n\nangular.module(\"vox-leonis\").run([\"$templateCache\", function($templateCache) {$templateCache.put(\"app/admin/admin.html\",\"<vox-top-nav user-name=\\\"vm.operator.Name || vm.interpreter.Name\\\"></vox-top-nav><div class=\\\"container-fluid vox-main\\\"><vox-admin roles=\\\"vm.roles\\\" ng-if=\\\"vm.roles.indexOf(\\'Admin\\') >= 0 || vm.roles.indexOf(\\'SuperUser\\') >= 0\\\"></vox-admin></div>\");\n$templateCache.put(\"app/admin/vox-admin-calls-table.html\",\"<div class=\\\"panel panel-default panel-vox animated fadeIn\\\"><div class=\\\"panel-heading\\\"><div class=\\\"row\\\"><div class=\\\"col-md-9\\\"><div class=\\\"admin-calls-title\\\"><span><strong><i class=\\\"fa fa-phone fa-lg fa-fw\\\"></i> Recent Calls <span class=\\\"badge\\\">{{vm.displayedCollection.length}}{{vm.displayedCollection.length != vm.calls.length ? \\'/\\'+ vm.calls.length : \\'\\' }}</span></strong></span> <i ng-show=\\\"vm.callsUpdating\\\" class=\\\"fa fa-refresh fa-spin fa-lg\\\"></i></div></div><div class=\\\"col-md-3\\\" ng-hide=\\\"vm.customerMonitor\\\"><div class=\\\"form-group\\\"><div class=\\\"input-group\\\"><div class=\\\"input-group-addon\\\"><strong>Show Calls</strong></div><select class=\\\"form-control recent-calls-select\\\" ng-model=\\\"vm.selectedHour\\\" ng-change=\\\"vm.hoursChanged()\\\" ng-options=\\\"recentHour.name for recentHour in vm.recentHours | orderBy:id track by recentHour.id\\\"></select></div></div></div></div></div><table st-table=\\\"vm.displayedCollection\\\" st-safe-src=\\\"vm.calls\\\" class=\\\"table smart-table freeze-header\\\"><thead><tr><th st-sort=\\\"CustomerOrganization\\\">Customer</th><th st-sort=\\\"CustomerProfile\\\">Site</th><th st-sort=\\\"InterpreterName\\\">Interpreter</th><th st-sort=\\\"Status\\\">Status</th><th st-sort=\\\"LanguageName\\\">Language</th><th st-sort=\\\"Duration\\\">Duration</th><th st-sort=\\\"ReferenceId\\\">Reference #</th><th st-sort=\\\"CallConnected\\\">Date/Time</th><th ng-if=\\\"vm.hasMonitoring(call.MonitoringRestricted) || +vm.selectedHour.id === -2\\\"></th><th ng-if=\\\"vm.roles.indexOf(\\'SuperUser\\') >= 0\\\"></th><th><button class=\\\"btn fa fa-filter fa-lg pull-right\\\" ng-click=\\\"showFilter = !showFilter\\\" st-reset=\\\"\\\"></button></th></tr><tr ng-show=\\\"showFilter\\\"><th><input st-search=\\\"CustomerOrganization\\\" placeholder=\\\"Customer\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th><input st-search=\\\"CustomerProfile\\\" placeholder=\\\"Site\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th><input st-search=\\\"InterpreterName\\\" placeholder=\\\"Interpreter\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th><input st-search=\\\"Status\\\" placeholder=\\\"Status\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th><input st-search=\\\"LanguageName\\\" placeholder=\\\"Language\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th></th><th><input st-search=\\\"ReferenceId\\\" placeholder=\\\"Reference #\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th><input st-search=\\\"CallConnectedDisplay\\\" placeholder=\\\"Date/Time\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th ng-if=\\\"vm.hasMonitoring(call.MonitoringRestricted) || +vm.selectedHour.id === -2\\\"></th><th ng-if=\\\"vm.roles.indexOf(\\'SuperUser\\') >= 0\\\"></th><th></th></tr></thead><tbody><tr ng-repeat=\\\"call in vm.displayedCollection\\\" ng-class=\\\"{success: call.CallId === vm.monitor.CurrentCallId}\\\"><td>{{call.CustomerOrganization}}</td><td>{{call.CustomerProfile}}</td><td>{{call.InterpreterName}}</td><td>{{call.Status}}</td><td>{{call.LanguageName}}</td><td ng-if=\\\"call.CallEnded\\\">{{call.CallConnected | elapsedTime : call.CallEnded}}</td><td ng-if=\\\"!call.CallEnded\\\"><vox-countup start-date-time=\\\"call.CallConnected\\\" hide-days=\\\"true\\\"></vox-countup></td><td>{{call.ReferenceId}}</td><td>{{call.CallConnectedDisplay}}</td><td ng-if=\\\"vm.hasMonitoring(call.MonitoringRestricted)\\\"><button type=\\\"button\\\" class=\\\"btn btn-primary\\\" ng-click=\\\"vm.monitorCall(call.CallId)\\\" ng-if=\\\"call.Status !== \\'Completed\\'\\\" ng-disabled=\\\"vm.monitor.Status !== \\'Monitoring\\'\\\" title=\\\"{{vm.monitor.Status === \\'Monitoring\\' ? \\'Receive a call on your phone to monitor this call\\' : \\'Your status must be Monitoring to monitor this call\\'}}\\\" ladda=\\\"vm.requestingToListen === call.CallId\\\">Listen</button></td><td><div ng-if=\\\"vm.roles.indexOf(\\'SuperUser\\') >= 0 && vm.showTerminateButton(call.Status)\\\"><button type=\\\"button\\\" class=\\\"btn btn-primary\\\" ng-click=\\\"vm.endConference(call.CallId, call.ReferenceId)\\\" ng-if=\\\"call.Status !== \\'Completed\\'\\\" title=\\\"End Conference\\\">Terminate call</button></div></td><td></td></tr></tbody></table></div>\");\n$templateCache.put(\"app/admin/vox-admin.html\",\"<div><div class=\\\"row\\\"><div class=\\\"col-md-12\\\"><vox-admin-calls-table roles=\\\"vm.roles\\\"></vox-admin-calls-table></div></div><div class=\\\"row\\\"><div class=\\\"col-md-12\\\"><div class=\\\"logged-in-interpreter-title\\\"><span><strong>Logged In Interpreters <span class=\\\"badge\\\">{{vm.loggedInInterpreterCount}}{{vm.loggedInInterpreterCount != vm.loggedInInterpreters.length ? \\'/\\'+ vm.loggedInInterpreters.length : \\'\\' }}</span></strong></span></div><vox-loggedin-interpreters-table logged-in-interpreters=\\\"vm.loggedInInterpreters\\\" logged-in-interpreter-count=\\\"vm.loggedInInterpreterCount\\\"></vox-loggedin-interpreters-table></div></div></div>\");\n$templateCache.put(\"app/console/console.html\",\"<style type=\\\"text/css\\\">\\r\\n .box {\\r\\n width: 150px;\\r\\n height: 150px;\\r\\n opacity: 0.9;\\r\\n position: absolute;\\r\\n top: 30px;\\r\\n left: 30px;\\r\\n }\\r\\n</style><vox-top-nav user=\\\"vm.operator || vm.interpreter || vm.monitor\\\" version=\\\"vm.version\\\"></vox-top-nav><div class=\\\"container-fluid vox-main\\\"><div class=\\\"row\\\"><div class=\\\"col-md-8\\\" ng-if=\\\"vm.interpreter || vm.operator || vm.monitor\\\"><div class=\\\"row col-md-12\\\"><vox-console-status operator=\\\"vm.operator\\\" interpreter=\\\"vm.interpreter\\\" monitor=\\\"vm.monitor\\\"></vox-console-status></div><div class=\\\"row col-md-12\\\"><vox-meta-data user-id=\\\"vm.interpreter.Id || vm.operator.Id\\\"></vox-meta-data></div><div class=\\\"row col-md-12\\\"><vox-sip-data user-id=\\\"vm.interpreter.Id || vm.operator.Id\\\"></vox-sip-data></div></div><div class=\\\"col-md-4\\\"><div class=\\\"col-md-12\\\" ng-if=\\\"vm.person.Status == \\'InCall\\' || vm.person.Status == \\'AfterCallWork\\'\\\"><vox-console-call-control-panel person=\\\"vm.person\\\"></vox-console-call-control-panel></div><div class=\\\"col-md-12\\\"><vox-interpreter call-type=\\\"vm.callType\\\" interpreter=\\\"vm.interpreter\\\" ng-if=\\\"vm.roles.indexOf(\\'Interpreter\\') >= 0\\\"></vox-interpreter></div></div></div><vox-operator operator=\\\"vm.operator\\\" call-type=\\\"vm.callType\\\" roles=\\\"vm.roles\\\" ng-if=\\\"vm.roles.indexOf(\\'Operator\\') >= 0 || vm.roles.indexOf(\\'SuperUser\\') >= 0\\\"></vox-operator><vox-monitor monitor=\\\"vm.monitor\\\" ng-if=\\\"vm.roles.indexOf(\\'Monitor\\') >= 0\\\"></vox-monitor><div ng-if=\\\"vm.roles.indexOf(\\'Operator\\') >= 0 || vm.roles.indexOf(\\'SuperUser\\') >= 0 || vm.roles.indexOf(\\'Monitor\\') >= 0\\\"><vox-admin-calls-table monitor=\\\"vm.monitor\\\" roles=\\\"vm.roles\\\"></vox-admin-calls-table></div></div><div class=\\\"dialpad-minimized-container clearfix\\\" ng-show=\\\"vm.showWebRtcDialpad == \\'true\\' &&vm.person.ContactMethod === 2 && vm.person.Status === \\'InCall\\' && !vm.maximised\\\"><vox-console-webrtc-dialpad-min></vox-console-webrtc-dialpad-min></div><div ng-show=\\\"vm.showWebRtcDialpad == \\'true\\' && vm.person.ContactMethod === 2 && vm.person.Status === \\'InCall\\' && vm.maximised\\\" class=\\\"shape\\\" ng-draggable=\\\"dragOptions\\\"><vox-console-webrtc-dialpad></vox-console-webrtc-dialpad></div>\");\n$templateCache.put(\"app/console/vox-call-duration.html\",\"<span ng-class=\\\"{\\'instruction-text Duration-Bold\\': vm.showWarning}\\\"><vox-countup start-date-time=\\\"vm.startTime\\\" hide-days=\\\"true\\\" thresholds=\\\"vm.thresholds\\\" call-id=\\\"vm.callId\\\" interpreter-id=\\\"vm.interpreterId\\\"></vox-countup></span>\");\n$templateCache.put(\"app/console/vox-call-events.html\",\"<table class=\\\"table\\\"><thead><tr><th ng-show=\\\"(vm.roles.indexOf(\\'Operator\\') >= 0 || vm.roles.indexOf(\\'Admin\\') >= 0)\\\">Timestamp</th><th>Call Event</th><th>Info</th></tr></thead><tbody><tr><td ng-show=\\\"(vm.roles.indexOf(\\'Operator\\') >= 0 || vm.roles.indexOf(\\'Admin\\') >= 0)\\\">{{vm.callConnectedLocaleString}}</td><td>Call Created</td><td></td></tr><tr ng-repeat=\\\"callEvent in vm.callEvents | orderBy:\\'EventTime\\'\\\" ng-show=\\\"callEvent.StatusEvent !== \\'MonitorConnected\\' && callEvent.StatusEvent !== \\'MonitorDisconnected\\'\\\"><td ng-show=\\\"(vm.roles.indexOf(\\'Operator\\') >= 0 || vm.roles.indexOf(\\'Admin\\') >= 0)\\\">{{vm.getLocalDate(callEvent)}}</td><td>{{callEvent.StatusEvent | camelcaseSpace}}</td><td>{{vm.getAdditionalInfo(callEvent)}}</td></tr></tbody></table>\");\n$templateCache.put(\"app/console/vox-console-alert.html\",\"<div><div><vox-alert ng-if=\\\"vm.alert\\\" alert=\\\"vm.alert\\\" contact-method=\\\"vm.person.ContactMethod\\\" re-create-tokens=\\\"vm.reCreateTokens\\\"></vox-alert></div><div ng-class=\\\"vm.alertType\\\" ng-if=\\\"vm.alertActionMessage\\\"><span>{{vm.alertActionMessage}}</span></div></div>\");\n$templateCache.put(\"app/console/vox-console-call-control-panel.html\",\"<div class=\\\"panel panel-default panel-vox animated fadeIn\\\"><div class=\\\"panel-heading\\\"><span class=\\\"fa-stack fa-lg\\\"><i class=\\\"fa fa-square-o fa-stack-2x\\\"></i> <i class=\\\"fa fa-headphones fa-stack-1x\\\"></i></span> <strong>{{vm.selectedContactMethod == 2 ? \\'Computer call\\' : \\'Telephonic Call\\' }}</strong></div><div class=\\\"panel-body\\\"><div class=\\\"row\\\"><div class=\\\"col-sm-6\\\"><h5><strong>{{vm.person.Status == \\'AfterCallWork\\' ? \\'Call Ended\\' : \\'Incoming call\\'}}</strong></h5></div><div class=\\\"col-sm-6\\\"><div class=\\\"form-group pull-right\\\"><button type=\\\"button\\\" class=\\\"btn btn-primary\\\" ng-click=\\\"vm.hangUp()\\\" ng-disabled=\\\"vm.isHangUpDisabled\\\">Hang Up</button></div></div><div ng-if=\\\"vm.currentRole == \\'Interpreter\\' || vm.currentRole == \\'Operator\\'\\\"><div class=\\\"col-sm-12\\\" ng-if=\\\"(vm.person.Status == \\'AfterCallWork\\' && vm.isApplicableforDisposition)\\\"><vox-disposition-menu person=\\\"vm.person\\\"></vox-disposition-menu></div></div><div ng-if=\\\"vm.currentRole == \\'Interpreter\\'\\\"><div class=\\\"col-sm-12\\\" ng-if=\\\"(vm.person.Status == \\'InCall\\' && vm.showNoTalkPopup)\\\"><vox-notalk-action-menu person=\\\"vm.person\\\"></vox-notalk-action-menu></div></div></div></div></div>\");\n$templateCache.put(\"app/console/vox-console-instruction-message.html\",\"<div class=\\\"alert alert-instruction\\\" role=\\\"alert\\\" ng-show=\\\"vm.userMessage\\\"><strong class=\\\"instruction-message\\\">{{ vm.userMessage }}</strong></div>\");\n$templateCache.put(\"app/console/vox-console-reminder.html\",\"<div class=\\\"greeting-container animate\\\"><div class=\\\"mb-2\\\"><strong>REMINDER:</strong> <span class=\\\"ml-2\\\">{{vm.customerReminder}}</span></div><div><strong>Greeting:</strong></div><div class=\\\"font-italic mb-2\\\">{{vm.customerGreeting}}</div><hr class=\\\"mb-2\\\" style=\\\"height: 1px; color: #DCDCDC; margin: 0\\\"><div><strong>Closing:</strong></div><div ng-bind-html=\\\"vm.closing\\\"></div></div>\");\n$templateCache.put(\"app/console/vox-console-status.html\",\"<div class=\\\"panel panel-default panel-vox panel-status animated fadeIn\\\"><div class=\\\"panel-heading\\\"><div class=\\\"row\\\"><div class=\\\"col-md-5 panel-heading-title-container\\\"><strong>Status - {{::vm.person.Name}}</strong></div><div class=\\\"col-md-7\\\"><vox-console-instruction-message user-id=\\\"vm.person.Id\\\"></vox-console-instruction-message></div></div></div><div class=\\\"panel-body\\\"><div class=\\\"row\\\"><div class=\\\"col-sm-5\\\"><vox-user-information operator-pools=\\\"vm.operator.Pools\\\" interpreter-language-payrates=\\\"vm.interpreter.LanguagePayrates\\\" is-customer-monitor=\\\"vm.isCustomerMonitor\\\"></vox-user-information></div><div class=\\\"col-sm-7\\\"><div class=\\\"form-group\\\"><div class=\\\"input-group\\\"><div class=\\\"input-group-addon\\\"><i class=\\\"fa fa-flag fa-lg fa-fw\\\" ng-class=\\\"{\\'blinking alertColor\\': vm.person.Status === \\'Unavailable\\'}\\\"></i></div><select class=\\\"form-control\\\" ng-model=\\\"vm.person.Status\\\" ng-change=\\\"vm.statusChanged()\\\" ng-disabled=\\\"vm.statusDisabled()\\\" style=\\\"height: 35px;\\\"><option ng-repeat=\\\"status in vm.statuses | orderBy:\\'id\\'\\\" value=\\\"{{status.name}}\\\" ng-if=\\\"!vm.statusOptionHidden(status.name)\\\">{{status.name}}</option></select><div class=\\\"input-group-addon\\\" style=\\\"padding: 0px 0px; margin-left: -1px;\\\"><vox-test-call-button person=\\\"vm.person\\\"></vox-test-call-button></div></div></div><div class=\\\"form-group\\\"><vox-console-contact-methods person=\\\"vm.person\\\" ng-if=\\\"vm.showContactMethods\\\"></vox-console-contact-methods></div><div class=\\\"form-group\\\" ng-if=\\\"+vm.person.ContactMethod === vm.enums.ContactMethod.Phone\\\"><vox-phone-number phone-number=\\\"vm.person.TempPhoneNumber\\\" default-number=\\\"vm.person.PhoneNumber\\\" phone-error-message=\\\"vm.phoneErrorMessage\\\" user-country-name=\\\"vm.person.Country\\\" person-status=\\\"vm.person.Status\\\" allow-blank-numbers=\\\"false\\\" allow-mobile-numbers=\\\"false\\\" set-user-status=\\\"true\\\" user-id=\\\"vm.person.Id\\\" third-party=\\\"false\\\"></vox-phone-number><div class=\\\"vox-interpreter-phone-number-error\\\"><span>{{vm.phoneErrorMessage}}</span></div></div></div></div><div class=\\\"row col-sm-7 col-sm-offset-5\\\"><vox-console-alert person=\\\"vm.person\\\" operator=\\\"vm.operator\\\" interpreter=\\\"vm.interpreter\\\" monitor=\\\"vm.monitor\\\"></vox-console-alert></div><div class=\\\"row col-sm-7 col-sm-offset-5\\\" ng-if=\\\"((vm.showDefaultReminderText === \\'true\\' && vm.interpreterDetails) || (vm.showDefaultOpertorReminderText === \\'true\\' && vm.operatorDetails)) && vm.customerDetails\\\"><vox-console-reminder interpreter-details=\\\"vm.interpreterDetails\\\" operator-details=\\\"vm.operatorDetails\\\" customer-details=\\\"vm.customerDetails\\\"></vox-console-reminder></div></div></div>\");\n$templateCache.put(\"app/console/vox-user-information.html\",\"<div><p class=\\\"form-control-static\\\" ng-if=\\\"vm.operatorPools\\\"><strong>Operator Pools</strong> <span ng-repeat=\\\"pool in ::vm.operatorPools\\\">{{::pool.Name}}{{$last ? \\'\\' : \\', \\'}}</span></p><div ng-hide=\\\"!vm.interpreterLanguagePayrates || vm.isCustomerMonitor\\\"><p class=\\\"form-control-static\\\"><strong><u>Interpreter Languages</u></strong></p><p class=\\\"form-control-static\\\" ng-repeat=\\\"languagePayrate in ::vm.interpreterLanguagePayrates\\\"><i class=\\\"fa fa-language fa-lg fa-fw\\\"></i>{{::languagePayrate.Language}}</p></div></div>\");\n$templateCache.put(\"app/interpreter/vox-interpreter-conference.html\",\"<div class=\\\"panel panel-default panel-vox animated fadeIn\\\"><div class=\\\"panel-heading\\\"><div class=\\\"row\\\"><div class=\\\"panel-heading-title col-md-6\\\"><span class=\\\"fa-stack fa-lg\\\"><i class=\\\"fa fa-square-o fa-stack-2x\\\"></i> <i class=\\\"fa fa-headphones fa-stack-1x\\\"></i></span> <strong>Your Conference Details</strong></div><div class=\\\"panel-heading-actions col-md-6\\\" ng-if=\\\"vm.reconnectButton\\\"><button type=\\\"button\\\" class=\\\"btn btn-priority ng-binding ladda-button\\\" ng-click=\\\"vm.reconnectInterpreter(false)\\\" ng-disabled=\\\"vm.reconnectButtonDisabled\\\" data-style=\\\"expand-right\\\"><i class=\\\"fa fa-phone-square fa-lg fa-fw\\\"></i> Reconnect</button></div></div></div><div class=\\\"panel-body\\\"><div class=\\\"table-responsive\\\"><table class=\\\"table\\\"><tbody><tr ng-show=\\\"vm.isC2C\\\"><td><strong>Call Type:</strong></td><td>ClickToCall</td></tr><tr ng-show=\\\"vm.isHostedIVR\\\"><td><strong>Call Type:</strong></td><td>Hosted IVR</td></tr><tr><td><strong>Customer Name:</strong></td><td>{{vm.currentCustomer.OrganizationName}}</td></tr><tr><td><strong>Site Name:</strong></td><td>{{vm.currentCustomer.ProfileName}}</td></tr><tr ng-show=\\\"(vm.roles.indexOf(\\'Operator\\') >= 0 || vm.roles.indexOf(\\'Admin\\') >= 0)\\\"><td><strong>Phone Number:</strong></td><td>{{vm.currentCall.FromPhoneNumber}}</td></tr><tr><td><strong>Language:</strong></td><td>{{vm.currentLanguageName}}</td></tr><tr><td><strong>Reference ID:</strong></td><td>{{vm.currentCall.ReferenceId}}</td></tr><tr ng-show=\\\"vm.showCallCenterNumber\\\"><td><strong>Call Center Number:</strong></td><td>{{vm.callCenterPhoneNumber}}</td></tr><tr><td><strong>Call Duration:</strong></td><td><vox-call-duration call-participants=\\\"vm.currentCall.Participants\\\" interpreter-id=\\\"vm.interpreter.Id\\\" call-id=\\\"vm.currentCall.CallId\\\" better-voice-call-id=\\\"vm.currentCall.BetterVoiceCallId\\\"></vox-call-duration></td></tr></tbody></table></div><div class=\\\"row\\\"><div class=\\\"col-sm-12 form-control-static\\\" ng-show=\\\"vm.roles.indexOf(\\'Operator\\') >= 0\\\"><vox-call-events call-events=\\\"vm.currentCall.Events\\\" call-connected-time=\\\"vm.currentCall.CallConnected\\\"></vox-call-events></div></div><div class=\\\"col-sm-12 form-control-static\\\"><vox-participants ng-if=\\\"vm.currentCall\\\" current-call=\\\"vm.currentCall\\\" interpreter=\\\"vm.interpreter\\\" customer=\\\"vm.currentCustomer\\\"></vox-participants></div></div></div>\");\n$templateCache.put(\"app/interpreter/vox-interpreter.html\",\"<div class=\\\"vox-interpreter\\\"><vox-interpreter-conference ng-if=\\\"vm.showCallDetails\\\" current-call=\\\"vm.currentCall\\\" current-customer=\\\"vm.currentCustomer\\\" current-language-name=\\\"vm.currentLanguageName\\\" interpreter=\\\"vm.interpreter\\\" call-center-phone-number=\\\"vm.callCenterPhoneNumber\\\" current-meta-data=\\\"vm.currentMetaData\\\"></vox-interpreter-conference></div>\");\n$templateCache.put(\"app/layout/vox-top-nav.html\",\"<nav class=\\\"navbar navbar-fixed-top navbar-inverse animated fadeInDown\\\" role=\\\"navigation\\\"><div class=\\\"container-fluid\\\"><div class=\\\"navbar-header\\\"><a ng-href=\\\"/\\\" class=\\\"navbar-brand\\\"><span class=\\\"brand-title\\\">Lionbridge Voice Portal</span> <span class=\\\"h6\\\">{{vm.version}}</span></a> <span ng-if=\\\"vm.hasAccessToNewInterpreterVoicePortal && vm.hasRequiredStatusToSwitchNewVoicePortal\\\"><a href=\\\"#\\\" ng-click=\\\"vm.switchToInterpreterVoicePortal()\\\" class=\\\"navbar-text align-text-bottom\\\"><span class=\\\"\\\">Switch to New Voice Portal</span></a></span> <button class=\\\"navbar-toggle\\\" ng-init=\\\"vm.navCollapsed = true\\\" ng-click=\\\"vm.navCollapsed = !vm.navCollapsed\\\"><span class=\\\"icon-bar\\\"></span> <span class=\\\"icon-bar\\\"></span> <span class=\\\"icon-bar\\\"></span></button></div><div class=\\\"navbar-collapse\\\" uib-collapse=\\\"vm.navCollapsed\\\"><ul class=\\\"nav navbar-nav navbar-right\\\"><li><vox-signal-r-status></vox-signal-r-status></li><li ng-if=\\\"vm.roles.indexOf(\\'Admin\\') >= 0 || vm.roles.indexOf(\\'SuperUser\\') >= 0\\\"><a ng-href=\\\"admin\\\"><i class=\\\"fa fa-gears fa-fw\\\"></i> Admin</a></li><li><a ng-href=\\\"\\\" ng-click=\\\"vm.reload()\\\" title=\\\"Refresh the page\\\"><i class=\\\"fa fa-refresh fa-fw refresh-icon\\\"></i></a></li><li><a ng-href=\\\"\\\" ng-click=\\\"vm.feedback()\\\" title=\\\"Give feedback\\\"><i class=\\\"fa fa-commenting-o fa-lg fa-fw\\\"></i></a></li><li class=\\\"dropdown\\\" uib-dropdown=\\\"\\\"><a href=\\\"\\\" class=\\\"dropdown-toggle\\\" role=\\\"button\\\" aria-haspopup=\\\"true\\\" aria-expanded=\\\"false\\\" uib-dropdown-toggle=\\\"\\\" id=\\\"vox-user-dropdown\\\"><i class=\\\"fa fa-user\\\"></i> {{vm.user.Name}} <span class=\\\"caret\\\"></span></a><ul class=\\\"dropdown-menu\\\" uib-dropdown-menu=\\\"\\\" aria-labelledby=\\\"vox-user-dropdown\\\"><li><a href=\\\"\\\" ng-click=\\\"vm.signOut()\\\"><i class=\\\"fa fa-sign-out fa-fw\\\"></i> Sign Out</a></li></ul></li></ul></div></div></nav>\");\n$templateCache.put(\"app/login/login.html\",\"<div class=\\\"top-content login animated\\\" ng-class=\\\"{fadeInDown: vm.activated}\\\"><div class=\\\"inner-bg\\\"><div class=\\\"container\\\"><div class=\\\"row\\\"><div class=\\\"col-sm-8 col-sm-offset-2 text\\\" ng-if=\\\"(vm.voicePortalLoginMode != \\'AzureEnabled\\')\\\"><h1><strong>Lionbridge Voice</strong> Portal</h1><div class=\\\"description\\\"><p></p></div></div></div><div class=\\\"row\\\"><div class=\\\"col-sm-6 col-sm-offset-3 form-box\\\"><div ng-if=\\\"vm.oldLoginVisible\\\"><div class=\\\"form-top\\\"><div class=\\\"form-top-left\\\"><h3>Login to our site</h3><p>Enter your username and password to log on:</p></div><div class=\\\"form-top-right\\\"><i class=\\\"fa fa-lock\\\"></i></div></div><div class=\\\"form-bottom well\\\"><form name=\\\"login\\\" role=\\\"form\\\" class=\\\"login-form\\\" novalidate=\\\"\\\"><div ng-show=\\\"vm.loginError !== undefined\\\"><div class=\\\"alert alert-danger\\\">Invalid Username or Password. Try again.</div></div><div class=\\\"form-group\\\"><label class=\\\"sr-only\\\" for=\\\"form-username\\\">Username</label> <input type=\\\"text\\\" name=\\\"form-username\\\" placeholder=\\\"Username...\\\" class=\\\"form-username form-control\\\" ng-focus=\\\"vm.loginError = undefined\\\" ng-model=\\\"vm.username\\\" required=\\\"\\\"></div><div class=\\\"form-group\\\"><label class=\\\"sr-only\\\" for=\\\"form-password\\\">Password</label> <input type=\\\"password\\\" name=\\\"form-password\\\" placeholder=\\\"Password...\\\" class=\\\"form-password form-control\\\" ng-focus=\\\"vm.loginError = undefined\\\" ng-model=\\\"vm.password\\\" required=\\\"\\\"></div><button type=\\\"submit\\\" class=\\\"btn\\\" ladda=\\\"vm.loginWaiting\\\" ng-disabled=\\\"login.$invalid\\\" ng-click=\\\"vm.login()\\\">Sign in!</button></form></div></div><div class=\\\"form-bottom well\\\" ng-if=\\\"vm.voicePortalLoginMode === \\'Dual\\'\\\"><div class=\\\"form-group\\\"><div><p>Lionbridge has completed migration to the \\\"New Login\\\" mechanism. You are now required to use your new credentials (email and password) to log into the Voice Portal.</p><p>Please contact <a href=\\\"mailto: GEOFLUENT.SUPPORT@lionbridge.com\\\">GEOFLUENT.SUPPORT@lionbridge.com</a> with questions.</p><p>If you have issues using your new credentials, click \\\"Old Login\\\" and then scroll down. This feature will be deactivated by May 19th, 2021.</p><span style=\\\"text-align: left;display: inline-block;width: 50%;\\\"><a style=\\\"display: inline-block;color: #f68306;text-decoration: none;\\\" href=\\\"https://interpretation.lionbridge.com/Help/Index\\\" target=\\\"_blank\\\">Learn More</a></span><a style=\\\"text-align: right;display: inline-block;width: 50%;text-decoration: none;color: #f68306;\\\" href=\\\"javascript:void(0);\\\" ng-click=\\\"vm.setOldLoginVisible();\\\">Old Login</a></div></div><button style=\\\"width:100%\\\" type=\\\"submit\\\" class=\\\"btn\\\" ladda=\\\"vm.loginWaiting\\\" ng-click=\\\"vm.redirectToADB2C()\\\">New Login</button></div><div ng-if=\\\"vm.voicePortalLoginMode === \\'AzureDisabled\\'\\\"><div class=\\\"form-top\\\"><div class=\\\"form-top-left\\\"><h3>Login to our site</h3><p>Enter your username and password to log on:</p></div><div class=\\\"form-top-right\\\"><i class=\\\"fa fa-lock\\\"></i></div></div><div class=\\\"form-bottom well\\\"><form name=\\\"login\\\" role=\\\"form\\\" class=\\\"login-form\\\" novalidate=\\\"\\\"><div ng-show=\\\"vm.loginError !== undefined\\\"><div class=\\\"alert alert-danger\\\">Invalid Username or Password. Try again.</div></div><div class=\\\"form-group\\\"><label class=\\\"sr-only\\\" for=\\\"form-username\\\">Username</label> <input type=\\\"text\\\" name=\\\"form-username\\\" placeholder=\\\"Username...\\\" class=\\\"form-username form-control\\\" ng-focus=\\\"vm.loginError = undefined\\\" ng-model=\\\"vm.username\\\" required=\\\"\\\"></div><div class=\\\"form-group\\\"><label class=\\\"sr-only\\\" for=\\\"form-password\\\">Password</label> <input type=\\\"password\\\" name=\\\"form-password\\\" placeholder=\\\"Password...\\\" class=\\\"form-password form-control\\\" ng-focus=\\\"vm.loginError = undefined\\\" ng-model=\\\"vm.password\\\" required=\\\"\\\"></div><button type=\\\"submit\\\" class=\\\"btn\\\" ladda=\\\"vm.loginWaiting\\\" ng-disabled=\\\"login.$invalid\\\" ng-click=\\\"vm.login()\\\">Sign in!</button></form></div></div></div></div></div></div><div class=\\\"footer version-footer\\\">{{vm.version}}</div></div>\");\n$templateCache.put(\"app/operator/vox-interpreters-table.html\",\"<div class=\\\"panel panel-default panel-vox fadeIn\\\"><table st-table=\\\"vm.displayedCollection\\\" st-safe-src=\\\"vm.interpreters\\\" class=\\\"table smart-table freeze-header\\\"><thead><tr><th st-sort=\\\"FirstName\\\">First Name</th><th st-sort=\\\"LastName\\\">Last Name</th><th st-sort=\\\"Status\\\">Status</th><th st-sort=\\\"Languages\\\">Languages</th><th st-sort=\\\"PhoneNumber\\\">Phone #</th><th st-sort=\\\"Pools\\\">Pools</th><th st-sort=\\\"LastLogin\\\">Last Login</th><th st-sort=\\\"TimeZone\\\">Time Zone</th><th st-sort=\\\"GroupName\\\">Group Name</th><th ng-if=\\\"vm.roles.indexOf(\\'Operator\\') >= 0 || vm.roles.indexOf(\\'SuperUser\\') >= 0\\\" st-sort=\\\"IsLanguageService\\\">Action</th><th><button class=\\\"btn fa fa-filter fa-lg pull-right\\\" ng-click=\\\"showFilter = !showFilter\\\" st-reset=\\\"\\\"></button></th></tr><tr ng-show=\\\"showFilter\\\"><th><input st-search=\\\"FirstName\\\" placeholder=\\\"First Name\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th><input st-search=\\\"LastName\\\" placeholder=\\\"Last Name\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th><input st-search=\\\"Status\\\" placeholder=\\\"Status\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th><input st-search=\\\"Languages\\\" placeholder=\\\"Languages\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th><input st-search=\\\"PhoneNumber\\\" placeholder=\\\"Phone #\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th><input st-search=\\\"Pools\\\" placeholder=\\\"Pools\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th><input st-search=\\\"LastLoginDisplay\\\" placeholder=\\\"Last Login\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th><input st-search=\\\"TimeZone\\\" placeholder=\\\"Time Zone\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th><input st-search=\\\"GroupName\\\" placeholder=\\\"Group Name\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th ng-if=\\\"vm.roles.indexOf(\\'Operator\\') >= 0 || vm.roles.indexOf(\\'SuperUser\\') >= 0\\\"><input st-search=\\\"IsLanguageService\\\" placeholder=\\\"Action\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th></th></tr></thead><tbody><tr ng-repeat=\\\"interpreter in vm.displayedCollection\\\"><td>{{interpreter.FirstName}}</td><td>{{interpreter.LastName}}</td><td>{{interpreter.Status}}</td><td>{{interpreter.Languages}}</td><td>{{interpreter.PhoneNumber}}</td><td>{{interpreter.Pools}}</td><td>{{interpreter.LastLoginDisplay}}</td><td>{{interpreter.TimeZone}}</td><td>{{interpreter.GroupName}}</td><td ng-if=\\\"vm.roles.indexOf(\\'Operator\\') >= 0 || vm.roles.indexOf(\\'SuperUser\\') >= 0\\\"><a class=\\\"btn\\\" ng-click=\\\"vm.interpreterLoginStatusChange(interpreter.Id, interpreter.IsLanguageService)\\\"><i class=\\\"fa fa-sign-out\\\" aria-hidden=\\\"true\\\" ng-show=\\\"interpreter.IsLanguageService == \\'Logout\\'\\\">{{interpreter.IsLanguageService}}</i> <i class=\\\"fa fa-sign-in\\\" aria-hidden=\\\"true\\\" ng-show=\\\"interpreter.IsLanguageService == \\'Login\\'\\\">{{interpreter.IsLanguageService}}</i></a></td><td></td></tr></tbody></table></div>\");\n$templateCache.put(\"app/operator/vox-loggedin-interpreters-table.html\",\"<div class=\\\"panel panel-default panel-vox fadeIn\\\"><table st-table=\\\"vm.displayedCollection\\\" st-safe-src=\\\"vm.loggedInInterpreters\\\" class=\\\"table smart-table freeze-header\\\"><thead><tr><th st-sort=\\\"Name\\\">Name</th><th st-sort=\\\"Languages\\\">Languages</th><th st-sort=\\\"PhoneNumber\\\">Phone Number</th><th st-sort=\\\"Pools\\\">Pools</th><th>Waiting Duration</th><th st-sort=\\\"TimeZone\\\">Time Zone</th><th st-sort=\\\"GroupName\\\">Group Name</th><th ng-if=\\\"vm.roles.indexOf(\\'Operator\\') >= 0 || vm.roles.indexOf(\\'SuperUser\\') >= 0\\\" st-sort=\\\"IsLanguageService\\\">Action</th><th><button class=\\\"btn fa fa-filter fa-lg pull-right\\\" ng-click=\\\"showFilter = !showFilter\\\" st-reset=\\\"\\\"></button></th></tr><tr ng-show=\\\"showFilter\\\"><th><input st-search=\\\"Name\\\" placeholder=\\\"Name\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th><input st-search=\\\"Languages\\\" placeholder=\\\"Languages\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th><input st-search=\\\"PhoneNumber\\\" placeholder=\\\"PhoneNumber\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th><input st-search=\\\"Pools\\\" placeholder=\\\"Pools\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th></th><th><input st-search=\\\"TimeZone\\\" placeholder=\\\"TimeZone\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th><input st-search=\\\"GroupName\\\" placeholder=\\\"GroupName\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th ng-if=\\\"vm.roles.indexOf(\\'Operator\\') >= 0 || vm.roles.indexOf(\\'SuperUser\\') >= 0\\\"><input st-search=\\\"IsLanguageService\\\" placeholder=\\\"Action\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th></th></tr></thead><tbody><tr ng-repeat=\\\"interpreter in vm.displayedCollection\\\"><td>{{interpreter.Name}}</td><td>{{interpreter.Languages}}</td><td>{{interpreter.PhoneNumber}}</td><td>{{interpreter.Pools}}</td><td><vox-countup start-date-time=\\\"interpreter.LastLogin\\\" alternate-date-time=\\\"interpreter.LastCallEnded\\\"></vox-countup></td><td>{{interpreter.TimeZone}}</td><td>{{interpreter.GroupName}}</td><td ng-if=\\\"vm.roles.indexOf(\\'Operator\\') >= 0 || vm.roles.indexOf(\\'SuperUser\\') >= 0\\\"><a class=\\\"btn\\\" ng-click=\\\"vm.interpreterLoginStatusChange(interpreter.Id, interpreter.IsLanguageService)\\\"><i class=\\\"fa fa-sign-out\\\" aria-hidden=\\\"true\\\" ng-show=\\\"interpreter.IsLanguageService == \\'Logout\\'\\\">{{interpreter.IsLanguageService}}</i> <i class=\\\"fa fa-sign-in\\\" aria-hidden=\\\"true\\\" ng-show=\\\"interpreter.IsLanguageService == \\'Login\\'\\\">{{interpreter.IsLanguageService}}</i></a></td><th></th></tr></tbody></table></div>\");\n$templateCache.put(\"app/operator/vox-operator.html\",\"<div class=\\\"vox-operator\\\"><div class=\\\"row\\\" ng-if=\\\"vm.showCallDetails\\\"><div class=\\\"col-md-6\\\" ng-if=\\\"!vm.currentCase.RelayLanguageId\\\"><div class=\\\"panel panel-default panel-vox\\\" ng-if=\\\"vm.showCallDetails\\\"><div class=\\\"panel-heading\\\" ng-if=\\\"vm.showCallDetails\\\"><h4>Call From: {{vm.currentCustomer.Name}} - {{vm.currentCustomer.ProfileName}} ({{vm.currentCall.FromPhoneNumber}})</h4><br><p>Reference Id: {{vm.currentCall.ReferenceId}}</p><p>Call Duration:<vox-call-duration call-participants=\\\"vm.currentCall.Participants\\\" operator-id=\\\"vm.operator.Id\\\"></vox-call-duration></p></div><div class=\\\"panel-body\\\"><vox-reconnect-interpreter call-id=\\\"vm.currentCall.CallId\\\" call-events=\\\"vm.currentCall.Events\\\" interpreters=\\\"vm.interpreters\\\" call-participants=\\\"vm.currentCall.Participants\\\" language-id=\\\"vm.currentCall.LanguageId\\\"></vox-reconnect-interpreter><table class=\\\"table\\\" ng-show=\\\"vm.logButtonShowEvent(\\'ConnectButtonVisible\\')\\\"><tr ng-repeat=\\\"language in vm.currentLanguages\\\"><td><div class=\\\"language-container\\\"><p class=\\\"form-control-static\\\">{{language.Name}}</p></div><div class=\\\"vox-connect-interpreter\\\"><vox-connect-interpreter call-id=\\\"vm.currentCall.CallId\\\" language-id=\\\"language.Id\\\" language-service=\\\"vm.currentCustomer.LanguageService\\\" customer-id=\\\"vm.currentCall.CustomerId\\\" call-participants=\\\"vm.currentCall.Participants\\\" call-language=\\\"vm.currentCallLanguage\\\" interpreter-pool-id=\\\"vm.currentCustomer.InterpreterPoolId\\\" secondary-interpreter-pool-id=\\\"vm.currentCustomer.SecondaryInterpreterPoolId\\\" third-interpreter-pool-id=\\\"vm.currentCustomer.ThirdInterpreterPoolId\\\" fourth-interpreter-pool-id=\\\"vm.currentCustomer.FourthInterpreterPoolId\\\" disable-all-language-select=\\\"vm.disableAllLanguageSelect\\\" case=\\\"vm.currentCase\\\" filter-overflow=\\\"vm.filterOverflowVendorsBasedOnLanguage\\\"></vox-connect-interpreter></div></td></tr><tr><td><div class=\\\"language-container\\\">Select Language:<select class=\\\"form-control\\\" data-ng-model=\\\"vm.selectedLanguage\\\" data-ng-options=\\\"language.key as language.value for language in vm.languageList | orderBy:\\'value\\'\\\" style=\\\"width:auto;display:inline-block\\\"></select></div><div class=\\\"vox-connect-interpreter\\\"><vox-connect-interpreter call-id=\\\"vm.currentCall.CallId\\\" language-id=\\\"vm.selectedLanguage\\\" language-service=\\\"vm.currentCustomer.LanguageService\\\" customer-id=\\\"vm.currentCall.CustomerId\\\" call-participants=\\\"vm.currentCall.Participants\\\" call-language=\\\"vm.currentCallLanguage\\\" current-languages=\\\"vm.currentLanguages\\\" interpreter-pool-id=\\\"vm.currentCustomer.InterpreterPoolId\\\" secondary-interpreter-pool-id=\\\"vm.currentCustomer.SecondaryInterpreterPoolId\\\" third-interpreter-pool-id=\\\"vm.currentCustomer.ThirdInterpreterPoolId\\\" fourth-interpreter-pool-id=\\\"vm.currentCustomer.FourthInterpreterPoolId\\\" disable-all-language-select=\\\"vm.disableAllLanguageSelect\\\" case=\\\"vm.currentCase\\\" disable-if-not-selected=\\\"!vm.selectedLanguage || vm.selectedLanguage.length == 0\\\" filter-overflow=\\\"false\\\"></vox-connect-interpreter></div></td></tr></table></div></div></div><div class=\\\"col-md-6\\\"><vox-case ng-if=\\\"vm.currentCase\\\" current-call=\\\"vm.currentCall\\\" current-case=\\\"vm.currentCase\\\" interpreters=\\\"vm.interpreters\\\" operator=\\\"vm.operator\\\" customer=\\\"vm.currentCustomer\\\" language-service=\\\"vm.currentCustomer.LanguageService\\\"></vox-case><div class=\\\"panel panel-default panel-vox\\\"><div class=\\\"panel-heading\\\"><strong>Call Events</strong></div><div class=\\\"panel-body\\\"><vox-call-events call-events=\\\"vm.currentCall.Events\\\" call-connected-time=\\\"vm.currentCall.CallConnected\\\"></vox-call-events></div></div><div class=\\\"panel panel-default panel-vox\\\" ng-show=\\\"vm.showThirdParty\\\"><vox-participants ng-if=\\\"vm.currentCall\\\" current-call=\\\"vm.currentCall\\\" operator=\\\"vm.operator\\\" customer=\\\"vm.currentCustomer\\\"></vox-participants></div></div></div><div class=\\\"row\\\" ng-if=\\\"vm.callType === \\'Operator\\'\\\"><div class=\\\"col-md-12\\\"><ul class=\\\"nav nav-tabs\\\"><li ng-click=\\\"vm.changeActiveTable(\\'loggedInInterpreters\\')\\\" ng-class=\\\"{\\'active\\': vm.activeTable === \\'loggedInInterpreters\\'}\\\"><a>Logged In Interpreters <span class=\\\"badge\\\">{{vm.loggedInInterpreterCount}}{{vm.loggedInInterpreterCount != vm.loggedInInterpreters.length ? \\'/\\'+ vm.loggedInInterpreters.length : \\'\\' }}</span></a></li><li ng-click=\\\"vm.changeActiveTable(\\'allInterpreters\\')\\\" ng-class=\\\"{\\'active\\': vm.activeTable === \\'allInterpreters\\'}\\\"><a>All Interpreters <span class=\\\"badge\\\">{{vm.interpreterCount}}{{vm.interpreterCount != vm.interpreters.length ? \\'/\\'+ vm.interpreters.length : \\'\\' }}</span></a></li><li ng-click=\\\"vm.changeActiveTable(\\'allOperators\\')\\\" ng-class=\\\"{\\'active\\': vm.activeTable === \\'allOperators\\'}\\\"><a>All Operators <span class=\\\"badge\\\">{{vm.operatorCount}}{{vm.operatorCount != vm.operators.length ? \\'/\\'+ vm.operators.length : \\'\\' }}</span></a></li></ul><div class=\\\"tab-content\\\"><vox-loggedin-interpreters-table class=\\\"tab-pane\\\" ng-class=\\\"{\\'active\\': vm.activeTable === \\'loggedInInterpreters\\'}\\\" logged-in-interpreters=\\\"vm.loggedInInterpreters\\\" logged-in-interpreter-count=\\\"vm.loggedInInterpreterCount\\\"></vox-loggedin-interpreters-table><vox-interpreters-table class=\\\"tab-pane\\\" ng-class=\\\"{\\'active\\': vm.activeTable === \\'allInterpreters\\'}\\\" interpreters=\\\"vm.interpreters\\\" interpreter-count=\\\"vm.interpreterCount\\\"></vox-interpreters-table><vox-operators-table class=\\\"tab-pane\\\" ng-class=\\\"{\\'active\\': vm.activeTable === \\'allOperators\\'}\\\" operators=\\\"vm.operators\\\" operator-count=\\\"vm.operatorCount\\\"></vox-operators-table></div></div></div></div>\");\n$templateCache.put(\"app/operator/vox-operators-table.html\",\"<div class=\\\"panel panel-default panel-vox fadeIn\\\"><table st-table=\\\"vm.displayedCollection\\\" st-safe-src=\\\"vm.operators\\\" class=\\\"table smart-table freeze-header\\\"><thead><tr><th st-sort=\\\"FirstName\\\">First Name</th><th st-sort=\\\"LastName\\\">Last Name</th><th st-sort=\\\"Status\\\">Status</th><th st-sort=\\\"PhoneNumber\\\">Phone #</th><th st-sort=\\\"Pools\\\">Pools</th><th><button class=\\\"btn fa fa-filter fa-lg pull-right\\\" ng-click=\\\"showFilter = !showFilter\\\" st-reset=\\\"\\\"></button></th></tr><tr ng-show=\\\"showFilter\\\"><th><input st-search=\\\"FirstName\\\" placeholder=\\\"First Name\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th><input st-search=\\\"LastName\\\" placeholder=\\\"Last Name\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th><input st-search=\\\"Status\\\" placeholder=\\\"Status\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th><input st-search=\\\"PhoneNumber\\\" placeholder=\\\"Phone #\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th><input st-search=\\\"Pools\\\" placeholder=\\\"Pools\\\" class=\\\"input-sm form-control\\\" type=\\\"search\\\"></th><th></th></tr></thead><tbody><tr ng-repeat=\\\"operator in vm.displayedCollection\\\"><td>{{operator.FirstName}}</td><td>{{operator.LastName}}</td><td>{{operator.Status}}</td><td>{{operator.PhoneNumber}}</td><td>{{operator.Pools}}</td><td></td></tr></tbody></table></div>\");\n$templateCache.put(\"app/operator/vox-reconnect-interpreter.html\",\"<div ng-show=\\\"vm.callId && vm.interpreterId\\\" style=\\\"font-size: 15px;\\\"><span class=\\\"label label-default\\\">{{vm.disconnectMessage}}</span><div style=\\\"float:right;\\\"><span class=\\\"btn btn-danger\\\" ng-show=\\\"vm.isInterpreterUnavailable\\\">Interpreter is not available.</span> <button class=\\\"btn btn-default\\\" ng-click=\\\"vm.callInterpreter()\\\" ng-disabled=\\\"vm.callInterpreterDisabled\\\" title=\\\"Put the customer on hold and call the interpreter\\\" ladda=\\\"vm.connectingInterpreter\\\" data-style=\\\"expand-right\\\" data-spinner-color=\\\"#000000\\\"><i class=\\\"fa fa-phone fa-lg fa-fw\\\"></i> Call Interpreter</button> <button class=\\\"btn btn-default\\\" ng-click=\\\"vm.connectInterpreter()\\\" ng-disabled=\\\"vm.isReconnectInterpreterDisabled\\\" title=\\\"Reconnect the interpreter with the customer\\\"><i class=\\\"fa fa-phone-square fa-lg fa-fw\\\"></i> Reconnect Interpreter</button></div></div>\");\n$templateCache.put(\"app/operator/vox-reconnect-specific-interpreter.html\",\"<div ng-show=\\\"vm.callId && vm.interpreterId\\\" style=\\\"font-size: 15px;\\\"><div><button class=\\\"btn btn-default\\\" ng-click=\\\"vm.callInterpreter()\\\" ng-disabled=\\\"vm.callDisabled\\\" ng-attr-title=\\\"{{vm.callTitle}}\\\" ladda=\\\"vm.callingInterpreter\\\" data-style=\\\"expand-right\\\" data-spinner-color=\\\"#000000\\\"><i class=\\\"fa fa-phone fa-lg fa-fw\\\"></i> Call {{vm.interpreterName}}</button> <span class=\\\"btn btn-danger\\\" ng-show=\\\"vm.interpreterUnavailable\\\">{{vm.interpreterName}} is not available.</span> <button class=\\\"btn btn-default\\\" ng-click=\\\"vm.connectInterpreter()\\\" ng-disabled=\\\"vm.connectDisabled\\\" ng-attr-title=\\\"{{vm.connectTitle}}\\\" ladda=\\\"vm.connectingInterpreter\\\" data-style=\\\"expand-right\\\" data-spinner-color=\\\"#000000\\\"><i class=\\\"fa fa-phone-square fa-lg fa-fw\\\"></i> Connect {{vm.interpreterName}}</button> <span class=\\\"btn btn-danger\\\" ng-show=\\\"vm.cantConnectInterpreter\\\">Can\\'t connect {{vm.interpreterName}}.</span></div></div>\");\n$templateCache.put(\"app/operator/vox-scheduled-relay-interpretation.html\",\"<div class=\\\"panel panel-default panel-vox\\\"><div class=\\\"panel-heading\\\"><div class=\\\"row\\\"><div class=\\\"panel-heading-title col-md-5\\\"><span class=\\\"fa-stack fa-lg\\\"><i class=\\\"fa fa-square-o fa-stack-2x\\\"></i> <i class=\\\"fa fa-clock-o fa-stack-1x\\\"></i></span> <strong>Scheduled Relay Interpretation Call</strong></div><div class=\\\"panel-heading-actions col-md-7\\\"><button class=\\\"btn btn-priority ladda-button\\\" ng-if=\\\"!vm.isRareLanguageInterpreterConnected\\\" type=\\\"button\\\" ng-disabled=\\\"vm.areControlsDisabled()\\\" ladda=\\\"vm.connectingRareLanguageInterpreter\\\" data-style=\\\"expand-right\\\" data-spinner-color=\\\"#000000\\\" title=\\\"Put the customer on hold and call the interpreter\\\" ng-click=\\\"vm.connectRareLanguageInterpreter()\\\"><span class=\\\"ladda-label\\\">Connect Rare Language Interpreter</span></button><div class=\\\"btn-group\\\" ng-if=\\\"vm.isRareLanguageInterpreterConnected && !vm.isRelayInterpreterConnected && vm.relayInterpreterConnectFailed && vm.logButtonShowEvent(\\'LSButtonVisible\\')\\\" data-style=\\\"expand-right\\\" uib-dropdown=\\\"\\\"><button id=\\\"split-button\\\" type=\\\"button\\\" class=\\\"btn btn-default\\\" ng-disabled=\\\"vm.areControlsDisabled()\\\" ng-click=\\\"vm.callLanguageService(vm.LanguageSelect)\\\">{{vm.LanguageSelect.Name}}</button> <button type=\\\"button\\\" class=\\\"btn btn-default\\\" uib-dropdown-toggle=\\\"\\\"><span class=\\\"caret\\\"></span></button><ul class=\\\"dropdown-menu\\\" uib-dropdown-menu=\\\"\\\" role=\\\"menu\\\" aria-labelledby=\\\"split-button\\\"><li role=\\\"menuitem\\\" ng-click=\\\"vm.changeLanguageServiceSelection({ GroupId: 0, Name: \\'Language Service\\' })\\\"><a href=\\\"#\\\">Language Service</a></li><li role=\\\"menuitem\\\" ng-repeat=\\\"languageService in vm.languageService | unique: \\'Name\\'\\\" ng-click=\\\"vm.changeLanguageServiceSelection(languageService)\\\"><a href=\\\"#\\\">{{languageService.Name}}</a></li></ul></div><button class=\\\"btn btn-priority ladda-button\\\" ng-if=\\\"vm.isRareLanguageInterpreterConnected && !vm.isRelayInterpreterConnected && !vm.languageServiceIsTimeouted\\\" type=\\\"button\\\" ng-disabled=\\\"vm.areControlsDisabled() || vm.isConnectRelayInterpreterButtonDisabled()\\\" ladda=\\\"vm.connectingRelayInterpreter\\\" data-style=\\\"expand-right\\\" title=\\\"Call the interpreter\\\" ng-click=\\\"vm.connectRelayInterpreter()\\\"><span class=\\\"ladda-label\\\">Connect Relay Interpreter</span></button> <button class=\\\"btn btn-priority ladda-button\\\" ng-if=\\\"vm.isRareLanguageInterpreterConnected && vm.isRelayInterpreterConnected && !vm.arePartiesConnected\\\" type=\\\"button\\\" ng-disabled=\\\"vm.areControlsDisabled()\\\" ladda=\\\"vm.connectingParties\\\" data-style=\\\"expand-right\\\" title=\\\"Connect all 3 parties\\\" ng-click=\\\"vm.conferenceAllParties()\\\"><span class=\\\"ladda-label\\\">Conference All Parties</span></button></div></div></div><div class=\\\"panel-body\\\"><div class=\\\"row\\\"><div class=\\\"col-md-2\\\">COI Number</div><div class=\\\"col-md-3\\\">{{vm.caseDisplay.Id}}</div></div><div class=\\\"row\\\"><div class=\\\"col-md-2\\\">Scheduled Start</div><div class=\\\"col-md-4\\\">{{vm.caseDisplay.ScheduledStartTime | date:\\'medium\\'}}</div></div><div class=\\\"row row-call-id\\\"><div class=\\\"col-md-2\\\">Call Id</div><div class=\\\"col-md-4\\\">{{vm.currentCall.CallId | limitTo : 8}}</div></div><div class=\\\"row row-call-duration\\\"><div class=\\\"col-md-2\\\">Call Duration:</div><div class=\\\"col-md-4\\\"><vox-call-duration call-participants=\\\"vm.currentCall.Participants\\\" operator-id=\\\"vm.operator.Id\\\"></vox-call-duration></div></div><div class=\\\"row\\\"><div class=\\\"col-md-12\\\"><div class=\\\"table-responsive over-flow-auto-false\\\"><table class=\\\"table\\\"><thead><th>Name</th><th>Role</th><th>Language</th><th>Number</th><th>Status</th><th></th></thead><tbody><tr><td>{{ vm.operator.Name }}</td><td>Operator</td><td></td><td>{{ vm.operator.TempPhoneNumber || vm.operator.PhoneNumber }}</td><td>Connected</td></tr><tr></tr><tr><td>{{ vm.customer.Name }}</td><td>Customer</td><td>{{ vm.caseDisplay.LanguageName }}</td><td>{{ vm.customer.PhoneNumber }}</td><td>{{ vm.isCustomerOnHold ? \\'OnHold\\' : \\'Connected\\' }}</td><td><div><button class=\\\"btn btn-default ladda-button\\\" ng-click=\\\"vm.switchParticipant(!vm.isCustomerOnHold, true, true)\\\" ng-disabled=\\\"vm.areControlsDisabled()\\\">{{ vm.isCustomerOnHold ? \\'unmute\\' : \\'mute\\' }}</button></div></td></tr><tr><td>{{ vm.caseDisplay.InterpreterName }}</td><td>Interpreter</td><td>{{ vm.caseDisplay.LanguageName }}/{{ vm.caseDisplay.RelayLanguageName }}</td><td>{{ vm.getRareInterpreterPhone() }}</td><td>{{ vm.isRareLanguageInterpreterConnected ? (vm.isRareLanguageInterpreterOnHold ? \\'OnHold\\' : \\'Connected\\' ) : \\'Not Connected\\' }}</td><td><div ng-if=\\\"vm.isRareLanguageInterpreterConnected\\\"><button class=\\\"btn btn-default ladda-button\\\" ng-click=\\\"vm.switchParticipant(true, !vm.isRareLanguageInterpreterOnHold, true)\\\" ng-disabled=\\\"vm.areControlsDisabled()\\\">{{ vm.isRareLanguageInterpreterOnHold ? \\'unmute\\' : \\'mute\\' }}</button></div></td></tr><tr><td>Relay Interpreter</td><td>Relay Interpreter</td><td>{{ vm.caseDisplay.RelayLanguageName }}/English</td><td>{{ vm.relayInterpreterPhoneNumber }}</td><td>{{ vm.isRelayInterpreterConnected ? (vm.isRelayInterpreterOnHold ? \\'OnHold\\' : \\'Connected\\' ) : \\'Not Connected\\' }}</td><td><div ng-if=\\\"vm.isRelayInterpreterConnected\\\"><button class=\\\"btn btn-default ladda-button\\\" ng-click=\\\"vm.switchParticipant(true, true, !vm.isRelayInterpreterOnHold)\\\" ng-disabled=\\\"vm.areControlsDisabled()\\\">{{ vm.isRelayInterpreterOnHold ? \\'unmute\\' : \\'mute\\' }}</button></div></td></tr></tbody></table></div></div></div></div></div>\");\n$templateCache.put(\"app/widgets/modal-call.html\",\"<div class=\\\"modal-header\\\"><h3 class=\\\"modal-title\\\" ng-if=\\\"vm.interpreterid\\\">Incoming Interpretation Call</h3><h3 class=\\\"modal-title\\\" ng-if=\\\"vm.operatorid\\\">Incoming Operator Call</h3></div><div class=\\\"modal-body\\\"><div ng-if=\\\"!vm.callRejectedMessage\\\"><p>Customer: <span>{{vm.organizationName}}</span></p><p ng-show=\\\"(vm.roles.indexOf(\\'Operator\\') >= 0 || vm.roles.indexOf(\\'Admin\\') >= 0)\\\">From: <span>{{vm.from}}</span></p><p ng-if=\\\"vm.language\\\">Language: <span>{{vm.language}}</span></p><p ng-show=\\\"(vm.roles.indexOf(\\'Operator\\') >= 0 || vm.roles.indexOf(\\'Admin\\') >= 0) && vm.scheduledCase\\\">Scheduled Interpretation Call</p></div><p>{{vm.callRejectedMessage}}</p></div><div class=\\\"modal-footer\\\"><vox-countdown seconds=\\\"vm.responseTimeout\\\" started=\\\"vm.timerStarted\\\" class=\\\"pull-left\\\"></vox-countdown><div ng-if=\\\"!vm.callRejectedMessage\\\"><button type=\\\"button\\\" class=\\\"btn btn-default\\\" ladda=\\\"vm.waitingForResponse\\\" ng-click=\\\"vm.reject(\\'Reject\\')\\\">Reject</button> <button type=\\\"button\\\" class=\\\"btn btn-primary\\\" ladda=\\\"vm.waitingForResponse\\\" id=\\\"accept\\\" ng-click=\\\"vm.accept()\\\">Accept</button></div><button ng-if=\\\"vm.callRejectedMessage\\\" type=\\\"button\\\" class=\\\"btn btn-primary\\\" ng-click=\\\"vm.close()\\\">Close</button></div>\");\n$templateCache.put(\"app/widgets/modal-feedback.html\",\"<div class=\\\"modal-header\\\"><h3 class=\\\"modal-title\\\">Submit Feedback</h3></div><form name=\\\"feedbackForm\\\" data-toggle=\\\"validator\\\" role=\\\"form\\\" ng-submit=\\\"vm.submitFeedback()\\\"><div class=\\\"modal-body form-group\\\"><p><select class=\\\"form-control\\\" ng-model=\\\"vm.feedbackType\\\" required=\\\"\\\" ng-options=\\\"item.name for item in vm.feedbackTypes | orderBy:\\'id\\' track by item.id\\\"><option value=\\\"\\\" hidden=\\\"\\\" disabled=\\\"\\\">Please select an issue type...</option></select></p><p><textarea placeholder=\\\"Please enter a description\\\" class=\\\"form-control\\\" ng-model=\\\"vm.feedbackDescription\\\" required=\\\"\\\"></textarea></p></div><div class=\\\"modal-footer form-group\\\"><button type=\\\"submit\\\" class=\\\"btn btn-primary\\\" ng-disabled=\\\"feedbackForm.$invalid || vm.submitting\\\">Submit</button> <button type=\\\"button\\\" class=\\\"btn\\\" ng-click=\\\"vm.cancel()\\\">Cancel</button></div></form>\");\n$templateCache.put(\"app/widgets/modal-new-call-operators-portal.html\",\"<div class=\\\"modal-header\\\"><h3 class=\\\"modal-title\\\">Voice Portal Redirection</h3></div><div class=\\\"modal-body form-group\\\" style=\\\"text-align: center\\\"><p><span>Please use the most recent version of the Call Operators Voice Portal website. <a ng-href=\\\"{{vm.callOperatorsVoicePortalFrontEndUrl}}\\\"><strong>Click here</strong></a> to open or you will be automatically redirected in a few seconds.</span></p><p><span>If you want to enter the legacy version of the Voice Portal website <a href=\\\"#\\\" ng-click=\\\"vm.stayInOldVoicePortal()\\\"><strong>click here</strong></a></span></p></div>\");\n$templateCache.put(\"app/widgets/modal-new-interpreter-portal.html\",\"<div class=\\\"modal-header\\\"><h3 class=\\\"modal-title\\\">Voice Portal Redirection</h3></div><div class=\\\"modal-body form-group\\\" style=\\\"text-align: center\\\"><p><span>Please use the most recent version of the Voice Portal website. <a ng-href=\\\"{{vm.interpreterVoicePortalFrontEndUrl}}\\\"><strong>Click here</strong></a> to open or you will be automatically redirected in a few seconds.</span></p><p><span ng-if=\\\"vm.hasRequiredStatusToStayInOldVoicePortal\\\">If you want to enter the legacy version of the Voice Portal website <a href=\\\"#\\\" ng-click=\\\"vm.stayInOldVoicePortal()\\\"><strong>click here</strong></a></span></p></div>\");\n$templateCache.put(\"app/widgets/vox-alert.html\",\"<div ng-class=\\\"vm.alertType\\\" role=\\\"alert\\\" key-capture=\\\"\\\"><div ng-if=\\\"!vm.alertMessage\\\"><button type=\\\"button\\\" class=\\\"btn btn-primary\\\" accesskey=\\\"a\\\" ng-click=\\\"vm.alertResponse(\\'Accept\\', false)\\\" ladda=\\\"vm.waitingForAcceptResponse\\\" ng-disabled=\\\"vm.waitingForRejectResponse\\\">Accept</button> <button type=\\\"button\\\" class=\\\"btn btn-default\\\" accesskey=\\\"r\\\" ng-click=\\\"vm.alertResponse(\\'Reject\\', false)\\\" ladda=\\\"vm.waitingForRejectResponse\\\" ng-disabled=\\\"vm.waitingForAcceptResponse\\\">Reject</button></div></div>\");\n$templateCache.put(\"app/widgets/vox-case.html\",\"<div ng-if=\\\"!vm.currentCase.RelayLanguageId\\\" class=\\\"panel panel-default panel-vox\\\"><div class=\\\"panel-heading\\\"><span class=\\\"fa-stack fa-lg\\\"><i class=\\\"fa fa-square-o fa-stack-2x\\\"></i> <i class=\\\"fa fa-clock-o fa-stack-1x\\\"></i></span> <strong>Scheduled Interpretation Call</strong></div><div class=\\\"panel-body\\\"><div class=\\\"row\\\"><div class=\\\"col-md-2\\\">COI Number</div><div class=\\\"col-md-3\\\">{{vm.caseDisplay.Id}}</div></div><div class=\\\"row\\\"><div class=\\\"col-md-2\\\">Scheduled Start</div><div class=\\\"col-md-4\\\">{{vm.caseDisplay.ScheduledStartTime | date:\\'medium\\'}}</div></div><div class=\\\"row\\\"><div class=\\\"col-md-2\\\">Language</div><div class=\\\"col-md-3\\\">{{vm.caseDisplay.LanguageName}}</div></div><div class=\\\"row\\\"><div class=\\\"col-md-2\\\">Interpreter</div><div class=\\\"col-md-3\\\">{{vm.caseDisplay.InterpreterName}}</div></div></div><div class=\\\"panel-footer\\\"><div class=\\\"row\\\"><div class=\\\"col-md-12\\\"><vox-reconnect-specific-interpreter call-id=\\\"vm.currentCall.CallId\\\" call-participants=\\\"vm.currentCall.Participants\\\" interpreter-name=\\\"vm.caseDisplay.InterpreterName\\\" interpreter-id=\\\"vm.currentCase.InterpreterId\\\"></vox-reconnect-specific-interpreter></div></div></div></div><div ng-if=\\\"vm.currentCase.RelayLanguageId\\\"><vox-scheduled-relay-interpretation current-call=\\\"vm.currentCall\\\" current-case=\\\"vm.currentCase\\\" case-display=\\\"vm.caseDisplay\\\" operator=\\\"vm.operator\\\" customer=\\\"vm.customer\\\" interpreters=\\\"vm.interpreters\\\" language-service=\\\"vm.customer.LanguageService\\\"></vox-scheduled-relay-interpretation></div>\");\n$templateCache.put(\"app/widgets/vox-connect-interpreter.html\",\"<div><div class=\\\"row\\\"><div class=\\\"col-md-12\\\"><div style=\\\"float:right;\\\"><button type=\\\"button\\\" class=\\\"btn btn-default\\\" ng-show=\\\"vm.inCall && vm.logButtonShowEvent(\\'ConnectMeButtonVisible\\')\\\" ng-click=\\\"vm.connectMe()\\\" ladda=\\\"vm.connectingMe\\\" data-style=\\\"expand-right\\\" data-spinner-color=\\\"#000000\\\"><i class=\\\"fa fa-arrow-left fa-lg fa-fw\\\"></i> Connect Me</button> <button type=\\\"button\\\" class=\\\"btn btn-default\\\" ng-show=\\\"vm.inCall && !vm.connectInterpreterDisabled && vm.logButtonShowEvent(\\'ConnectInterpreterButtonVisible\\')\\\" ng-click=\\\"vm.connectInterpreter()\\\" ladda=\\\"vm.connectingInterpreter\\\" data-style=\\\"expand-right\\\" data-spinner-color=\\\"#000000\\\"><i class=\\\"fa fa-user-plus fa-lg fa-fw\\\"></i> Connect Interpreter</button><div class=\\\"btn-group\\\" ng-if=\\\"vm.showLanguageSelectForScheduled && vm.showLanguageSelect && vm.logButtonShowEvent(\\'LSButtonVisible\\')\\\" data-style=\\\"expand-right\\\" uib-dropdown=\\\"\\\" style=\\\"padding-right:3px\\\"><button id=\\\"split-button\\\" type=\\\"button\\\" class=\\\"btn btn-default\\\" ng-click=\\\"vm.callLanguageSelect(vm.LanguageSelect)\\\" ng-disabled=\\\"vm.disableLanguageSelect\\\" ladda=\\\"vm.callingLanguageSelect\\\" data-style=\\\"expand-right\\\" data-spinner-color=\\\"#000000\\\"><i class=\\\"fa fa-users fa-lg fa-fw\\\"></i> {{vm.LanguageSelect.Name}}</button> <button type=\\\"button\\\" class=\\\"btn btn-default\\\" ng-disabled=\\\"vm.disableLanguageSelect || vm.disableIfNotSelected\\\" uib-dropdown-toggle=\\\"\\\"><span class=\\\"caret\\\"></span></button><ul class=\\\"dropdown-menu\\\" uib-dropdown-menu=\\\"\\\" role=\\\"menu\\\" aria-labelledby=\\\"split-button\\\" ng-disabled=\\\"vm.disableLanguageSelect\\\"><li role=\\\"menuitem\\\" ng-click=\\\"vm.changeLanguageServiceSelection({ GroupId: 0, Name: \\'Language Service\\' })\\\"><a href=\\\"#\\\">Language Service</a></li><li role=\\\"menuitem\\\" ng-repeat=\\\"languageService in vm.languageServiceList | unique: \\'Name\\' | orderBy: \\'Name\\'\\\" ng-click=\\\"vm.changeLanguageServiceSelection(languageService)\\\"><a href=\\\"#\\\">{{languageService.Name}}</a></li></ul></div><div class=\\\"btn-group\\\" ng-disabled=\\\"vm.showNoInterpsFoundError || vm.inCall || vm.findingInterpreter || vm.disableAllConnect || vm.disableIfNotSelected\\\" data-style=\\\"expand-right\\\" uib-dropdown=\\\"\\\" style=\\\"padding-right:3px\\\"><button id=\\\"split-button\\\" type=\\\"button\\\" class=\\\"btn btn-default\\\" ng-disabled=\\\"vm.showNoInterpsFoundError || vm.inCall || vm.findingInterpreter || vm.disableAllConnect || vm.disableIfNotSelected\\\" ng-click=\\\"vm.findInterpreter(vm.genderSelect)\\\" data-style=\\\"expand-right\\\" data-spinner-color=\\\"#000000\\\"><i class=\\\"fa fa-phone-square fa-lg fa-fw\\\"></i> {{vm.genderSelect.Name}}</button> <button type=\\\"button\\\" class=\\\"btn btn-default\\\" ng-disabled=\\\"vm.showNoInterpsFoundError || vm.inCall || vm.findingInterpreter || vm.disableAllConnect || vm.disableIfNotSelected\\\" uib-dropdown-toggle=\\\"\\\"><span class=\\\"caret\\\"></span></button><ul class=\\\"dropdown-menu\\\" uib-dropdown-menu=\\\"\\\" role=\\\"menu\\\" aria-labelledby=\\\"split-button\\\"><li role=\\\"menuitem\\\" ng-repeat=\\\"gender in vm.genderOptions\\\" ng-click=\\\"vm.changeGenderInterpreterSelection(gender)\\\"><a href=\\\"#\\\">{{gender.Name}}</a></li></ul></div><button type=\\\"button\\\" class=\\\"btn btn-default\\\" ng-hide=\\\"vm.interpreterStatisticsShown\\\" ng-click=\\\"vm.showInterpreterStatistics()\\\" ng-disabled=\\\"vm.disableIfNotSelected\\\"><i class=\\\"fa fa-chevron-down fa-fw\\\"></i></button> <button type=\\\"button\\\" class=\\\"btn btn-default\\\" ng-show=\\\"vm.interpreterStatisticsShown\\\" ng-click=\\\"vm.loadStatistics()\\\" ng-disabled=\\\"vm.statisticsLoading || vm.disableIfNotSelected\\\"><i class=\\\"fa fa-refresh fa-fw\\\"></i></button><div ng-show=\\\"!vm.hasInterpreters && vm.showNoInterpsFoundError\\\" class=\\\"alert alert-danger vox-no-interpreter\\\" role=\\\"alert\\\" style=\\\"margin-right:3px\\\"><button type=\\\"button\\\" class=\\\"close\\\" ng-click=\\\"vm.close()\\\" aria-label=\\\"Close\\\"><span aria-hidden=\\\"true\\\">×</span></button> <strong>No interpreters available!</strong></div><div ng-show=\\\"vm.showErrorMessage\\\" class=\\\"alert alert-danger vox-no-interpreter\\\" role=\\\"alert\\\" style=\\\"margin-right:3px\\\"><button type=\\\"button\\\" class=\\\"close\\\" ng-click=\\\"vm.close()\\\" aria-label=\\\"Close\\\"><span aria-hidden=\\\"true\\\">×</span></button> <strong>{{vm.errorMessage}}</strong></div></div></div></div><div class=\\\"row\\\" ng-if=\\\"vm.interpreterStatisticsShown\\\"><div class=\\\"col-md-12\\\"><div class=\\\"interpreters-statistic-container\\\"><div ng-if=\\\"vm.statistics && !vm.statisticsLoading\\\"><ul class=\\\"nav nav-pills interpreters-statistic\\\"><li class=\\\"status-statistic\\\"><span>Available Portal:</span><span class=\\\"status-statistic-value\\\">{{ vm.statistics.AvailablePortal }}</span></li><li class=\\\"status-statistic\\\"><span>Available Phone:</span><span class=\\\"status-statistic-value\\\">{{ vm.statistics.AvailablePhone }}</span></li><li class=\\\"status-statistic\\\"><span>Offline:</span><span class=\\\"status-statistic-value\\\">{{ vm.statistics.Offline }}</span></li><li class=\\\"status-statistic\\\"><span>In Call:</span><span class=\\\"status-statistic-value\\\">{{ vm.statistics.InCall }}</span></li><li class=\\\"status-statistic\\\"><span>Connecting:</span><span class=\\\"status-statistic-value\\\">{{ vm.statistics.Connecting }}</span></li><li class=\\\"status-statistic\\\"><span>Away:</span><span class=\\\"status-statistic-value\\\">{{ vm.statistics.Away }}</span></li><li class=\\\"status-statistic\\\"><span>Unavailable:</span><span class=\\\"status-statistic-value\\\">{{ vm.statistics.Unavailable }}</span></li><li class=\\\"status-statistic\\\"><span>Off-hours:</span><span class=\\\"status-statistic-value\\\">{{ vm.statistics.OffHours }}</span></li><li class=\\\"status-statistic\\\"><span>Total:</span><span class=\\\"status-statistic-value\\\">{{ vm.statistics.Total }}</span></li></ul></div><div ng-if=\\\"vm.statisticsLoading\\\" class=\\\"loader-container\\\"><i class=\\\"fa fa-refresh fa-fw fa-spin\\\"></i></div></div></div></div></div>\");\n$templateCache.put(\"app/widgets/vox-console-contact-methods.html\",\"<div><div class=\\\"form-group\\\"><div class=\\\"input-group\\\"><div class=\\\"input-group-addon\\\"><i class=\\\"fa fa-lg fa-fw\\\" ng-class=\\\"vm.selectedContactMethod.faClass\\\"></i></div><select class=\\\"form-control\\\" ng-model=\\\"vm.selectedContactMethod\\\" ng-change=\\\"vm.contactMethodChanged()\\\" ng-options=\\\"contactMethod.name for contactMethod in vm.contactMethods | orderBy:id track by contactMethod.id\\\" ng-disabled=\\\"vm.contactMethodSelectDisabled()\\\"></select><div class=\\\"input-group-addon\\\" ng-show=\\\"vm.person.ContactMethod == vm.enums.ContactMethod.WebRTC\\\"><vox-web-rtc-connection-quality></vox-web-rtc-connection-quality></div></div></div></div>\");\n$templateCache.put(\"app/widgets/vox-console-webrtc-dialpad-min.html\",\"<div><div class=\\\"dialpad-minimized-left\\\"><span class=\\\"m-active-phone-icon\\\"><i class=\\\"fas fa-phone-volume\\\"></i></span> <span class=\\\"\\\">{{vm.enteredDigits}}</span></div><div class=\\\"dialpad-minimized-right\\\"><button class=\\\"btn btn-default m-end-call-btn mr-1\\\" type=\\\"button\\\" ng-click=\\\"vm.muted = !vm.muted; vm.muteUnmute(vm.muted);\\\" title=\\\"Toggle Mute\\\"><span class=\\\"m-mute-icon\\\" ng-class=\\\"{ \\'active\\': vm.muted }\\\"><i class=\\\"fas fa-microphone-slash\\\"></i></span></button> <button class=\\\"btn btn-default m-end-call-btn mr-2\\\" type=\\\"button\\\" title=\\\"End Call\\\" ng-click=\\\"vm.hangUp()\\\"><span class=\\\"m-end-call-icon\\\"><i class=\\\"fas fa-phone fa-flip-horizontal\\\"></i></span> <span class=\\\"m-end-call-letters\\\">End Call</span></button> <span class=\\\"m-expand-icon\\\" title=\\\"Maximize\\\" ng-click=\\\"vm.maximize()\\\"><i class=\\\"fas fa-expand\\\"></i></span></div></div>\");\n$templateCache.put(\"app/widgets/vox-console-webrtc-dialpad.html\",\"<div><div class=\\\"dialpad-outer-container\\\"><div class=\\\"dialpad-container-options\\\"></div><div class=\\\"dialpad-container\\\"><div class=\\\"\\\"><input class=\\\"form-control form-control-lg input-digits\\\" type=\\\"tel\\\" ng-model=\\\"vm.enteredDigits\\\"></div><div class=\\\"digit-row\\\"><button class=\\\"btn btn-default digit-button\\\" type=\\\"button\\\" ng-click=\\\"vm.sendDigit(\\'1\\')\\\"><div class=\\\"digit-char\\\">1</div><div> </div></button> <button class=\\\"btn btn-default digit-button\\\" type=\\\"button\\\" ng-click=\\\"vm.sendDigit(\\'2\\')\\\"><div class=\\\"digit-char\\\">2</div><div class=\\\"digit-letters\\\">ABC</div></button> <button class=\\\"btn btn-default digit-button\\\" type=\\\"button\\\" ng-click=\\\"vm.sendDigit(\\'3\\')\\\"><div class=\\\"digit-char\\\">3</div><div class=\\\"digit-letters\\\">DEF</div></button></div><div class=\\\"digit-row\\\"><button class=\\\"btn btn-default digit-button\\\" type=\\\"button\\\" ng-click=\\\"vm.sendDigit(\\'4\\')\\\"><div class=\\\"digit-char\\\">4</div><div class=\\\"digit-letters\\\">GHI</div></button> <button class=\\\"btn btn-default digit-button\\\" type=\\\"button\\\" ng-click=\\\"vm.sendDigit(\\'5\\')\\\"><div class=\\\"digit-char\\\">5</div><div class=\\\"digit-letters\\\">JKL</div></button> <button class=\\\"btn btn-default digit-button\\\" type=\\\"button\\\" ng-click=\\\"vm.sendDigit(\\'6\\')\\\"><div class=\\\"digit-char\\\">6</div><div class=\\\"digit-letters\\\">MNO</div></button></div><div class=\\\"digit-row\\\"><button class=\\\"btn btn-default digit-button\\\" type=\\\"button\\\" ng-click=\\\"vm.sendDigit(\\'7\\')\\\"><div class=\\\"digit-char\\\">7</div><div class=\\\"digit-letters\\\">PQRS</div></button> <button class=\\\"btn btn-default digit-button\\\" type=\\\"button\\\" ng-click=\\\"vm.sendDigit(\\'8\\')\\\"><div class=\\\"digit-char\\\">8</div><div class=\\\"digit-letters\\\">TUV</div></button> <button class=\\\"btn btn-default digit-button\\\" type=\\\"button\\\" ng-click=\\\"vm.sendDigit(\\'9\\')\\\"><div class=\\\"digit-char\\\">9</div><div class=\\\"digit-letters\\\">WXYZ</div></button></div><div class=\\\"digit-row\\\"><button class=\\\"btn btn-default digit-button\\\" type=\\\"button\\\" ng-click=\\\"vm.sendDigit(\\'*\\')\\\"><div class=\\\"digit-char-asterisk\\\"><i class=\\\"fas fa-asterisk\\\"></i></div></button> <button class=\\\"btn btn-default digit-button\\\" type=\\\"button\\\" ng-click=\\\"vm.sendDigit(\\'0\\')\\\"><div class=\\\"digit-char\\\">0</div></button> <button class=\\\"btn btn-default digit-button\\\" type=\\\"button\\\" ng-click=\\\"vm.sendDigit(\\'#\\')\\\"><div class=\\\"digit-char\\\">#</div></button></div><div class=\\\"other-buttons-row\\\"><button class=\\\"btn btn-default dialpad-button\\\" type=\\\"button\\\" ng-click=\\\"vm.muted = !vm.muted; vm.muteUnmute(vm.muted);\\\"><div class=\\\"dialpad-button-icon icon-mute\\\" ng-class=\\\"{ \\'active\\': vm.muted }\\\"><i class=\\\"fas fa-microphone-slash\\\"></i></div><div class=\\\"dialpad-button-letters\\\" ng-class=\\\"{ \\'active\\': vm.muted }\\\">Mute</div></button> <button class=\\\"btn btn-default dialpad-button\\\" type=\\\"button\\\" ng-click=\\\"vm.hangUp()\\\"><div class=\\\"dialpad-button-icon icon-end-call\\\"><i class=\\\"fas fa-phone fa-flip-horizontal\\\"></i></div><div class=\\\"dialpad-button-letters\\\">End Call</div></button> <button class=\\\"btn btn-default dialpad-button\\\" type=\\\"button\\\" ng-click=\\\"vm.minimize()\\\"><div class=\\\"dialpad-button-icon\\\"><i class=\\\"fas fa-compress\\\"></i></div><div class=\\\"dialpad-button-letters\\\">Minimize</div></button></div></div></div></div>\");\n$templateCache.put(\"app/widgets/vox-countdown.html\",\"<progress-arc class=\\\"vox-countdown\\\" size=\\\"20\\\" stroke-width=\\\"5\\\" complete=\\\"vm.progress\\\"></progress-arc>\");\n$templateCache.put(\"app/widgets/vox-countup.html\",\"<span>{{vm.timeDisplay}}</span>\");\n$templateCache.put(\"app/widgets/vox-disposition-menu.html\",\"<div class=\\\"panel-body customPadding\\\"><hr class=\\\"customHeading\\\"><div class=\\\"disp-message\\\"><span class=\\\"palette-color-primary-lighter\\\"><i class=\\\"fa fa-exclamation-triangle\\\"></i></span> Select an after-call disposition.</div><div class=\\\"form-group row\\\"><div class=\\\"col-sm-12\\\"><div><label><strong>Dispositions</strong></label></div><div class=\\\"\\\" style=\\\"height: auto\\\"><div class=\\\"form-check\\\" ng-repeat=\\\"item in vm.dispositionOptions\\\"><input class=\\\"form-check-input\\\" type=\\\"radio\\\" name=\\\"{{item.value}}\\\" ng-value=\\\"{{item.key}}\\\" ng-model=\\\"vm.dispositionSelected\\\" style=\\\"float:left;\\\"> <label class=\\\"form-check-label wordwrap\\\" for=\\\"{{item.key}}\\\">{{item.value}}</label></div></div></div></div><div class=\\\"form-group row\\\"><div class=\\\"col-sm-12\\\"><div><label><strong>Comments</strong></label></div><textarea class=\\\"form-control\\\" id=\\\"comment\\\" row=\\\"2\\\" ng-focus=\\\"vm.stopTimer()\\\" ng-blur=\\\"vm.startTimer()\\\" ng-model=\\\"vm.comment\\\" maxlength=\\\"{{vm.maxLength}}\\\"></textarea></div></div><div class=\\\"form-group row\\\"><div class=\\\"col-sm-12\\\"><div class=\\\"clearfix\\\"><div class=\\\"float-left\\\"><div class=\\\"lds-body-lg\\\">Automatically dismissed in <strong>{{vm.countDown}}</strong> seconds...</div></div><div class=\\\"float-right\\\"><button class=\\\"btn btn-primary\\\" ng-disabled=\\\"!vm.dispositionSelected\\\" ng-click=\\\"vm.submitDisposition()\\\">Submit</button></div></div></div></div></div>\");\n$templateCache.put(\"app/widgets/vox-meta-data.html\",\"<div class=\\\"panel panel-default panel-vox\\\" ng-show=\\\"vm.showMetadata()\\\"><div class=\\\"panel panel-default panel-vox\\\"><div class=\\\"panel-heading\\\"><div class=\\\"row\\\"><div class=\\\"panel-heading-title col-md-6\\\"><strong>Caller Supplied Information</strong></div><div ng-if=\\\"vm.showUpdateMessage && form.$valid\\\" class=\\\"message update\\\">Data updated. Please save changes.</div><div ng-if=\\\"vm.showSaveMessage\\\" class=\\\"message save\\\">Data saved.</div></div></div><div class=\\\"panel-body\\\"><div><form name=\\\"form\\\" class=\\\"form-horizontal\\\"><div class=\\\"form-group\\\" ng-repeat=\\\"metadatum in vm.metadata track by $index\\\"><label class=\\\"col-sm-2 control-label\\\" style=\\\"text-align: left;\\\">{{metadatum.Label}}</label><div class=\\\"col-sm-10\\\"><input type=\\\"text\\\" class=\\\"form-control\\\" ng-model=\\\"metadatum.AnswerText\\\" id=\\\"metadata{{$index}}\\\" ng-change=\\\"vm.metadataChanged($index)\\\" ng-disabled=\\\"!vm.editMetadataItem(metadatum)\\\" ng-pattern=\\\"vm.handlePattern($index)\\\" name=\\\"metadata{{$index}}\\\" required=\\\"\\\"><div ng-if=\\\"!form[\\'metadata\\' + ($index)].$valid\\\" class=\\\"messageError message update\\\">Invalid Data.</div><div class=\\\"buttons-right-row\\\"><button type=\\\"button\\\" class=\\\"btn btn-default\\\" ng-disabled=\\\"!vm.editMetadataItem(metadatum)\\\" ng-click=\\\"vm.reset($index)\\\">Reset</button> <button type=\\\"button\\\" class=\\\"btn btn-primary\\\" ng-disabled=\\\"!form[\\'metadata\\' + ($index)].$valid || !vm.editMetadataItem(metadatum)\\\" ng-click=\\\"vm.save($index)\\\">Save</button></div></div></div></form></div></div></div></div>\");\n$templateCache.put(\"app/widgets/vox-notalk-action-menu.html\",\"<div class=\\\"panel-body customPadding\\\" ng-if=\\\"!vm.submitted\\\"><hr class=\\\"customHeading\\\"><div class=\\\"disp-message\\\"><span class=\\\"palette-color-primary-lighter\\\"><i class=\\\"fa fa-exclamation-triangle\\\"></i></span> Select an action.</div><div>{{vm.message}}</div><div class=\\\"form-group row\\\"><div class=\\\"col-sm-12\\\"><div><label><strong>Reason for No-Talk Activity</strong></label></div><div class=\\\"\\\" style=\\\"height: auto\\\"><div class=\\\"form-check\\\" ng-repeat=\\\"item in vm.notalkOptions\\\"><input class=\\\"form-check-input\\\" type=\\\"radio\\\" name=\\\"{{item.value}}\\\" ng-value=\\\"{{item.key}}\\\" ng-model=\\\"vm.notalkActionSelected\\\" ng-change=\\\"vm.displaymessage()\\\" style=\\\"float:left;\\\"> <label class=\\\"form-check-label wordwrap\\\" for=\\\"{{item.key}}\\\">{{item.value}}</label></div></div></div></div><div class=\\\"form-group row\\\"><div class=\\\"col-sm-12\\\"><div class=\\\"clearfix\\\"><div class=\\\"float-right\\\"><button class=\\\"btn btn-primary\\\" ng-click=\\\"vm.submitNotalkAction()\\\">Submit</button></div></div></div></div></div>\");\n$templateCache.put(\"app/widgets/vox-participants.html\",\"<div><hr><div class=\\\"panel-heading\\\"><span class=\\\"fa-stack fa-lg\\\"><i class=\\\"fa fa-square-o fa-stack-2x\\\"></i> <i class=\\\"fa fa-group fa-stack-1x\\\"></i></span> <strong>Participants</strong></div><div class=\\\"row\\\"><div class=\\\"col-sm-12\\\"><div class=\\\"table-responsive over-flow-auto-false\\\"><table class=\\\"table\\\"><tbody><tr><td><strong>Name</strong></td><td><strong>Status</strong></td><td></td></tr></tbody><tr ng-repeat=\\\"participant in vm.participants\\\" ng-if=\\\"participant.PhoneNumber\\\"><td title=\\\"{{participant.PhoneNumber}}\\\">{{participant.Name || participant.PhoneNumber}}</td><td>{{participant.Status}}</td><td><i class=\\\"fa fa-times pull-right\\\" ng-hide=\\\"participant.InterpreterId || participant.OperatorId || participant.CustomerId\\\" ng-click=\\\"vm.removeParticipant(participant)\\\" style=\\\"cursor:pointer;\\\"></i></td></tr></table></div></div></div><div class=\\\"row\\\"><hr class=\\\"short-hr\\\"><div class=\\\"col-sm-12\\\"><div class=\\\"form-group\\\"><div class=\\\"input-group\\\"><vox-phone-number phone-number=\\\"vm.newParticipantPhoneNumber\\\" phone-error-message=\\\"vm.phoneErrorMessage\\\" validating=\\\"vm.phoneIsValidating\\\" allow-blank-numbers=\\\"true\\\" allow-mobile-numbers=\\\"true\\\" set-user-status=\\\"false\\\" third-party=\\\"true\\\"></vox-phone-number><div class=\\\"input-group-addon\\\"><button class=\\\"fa fa-user-plus\\\" ng-click=\\\"vm.addParticipant()\\\" ng-disabled=\\\"vm.isDisabled()\\\" style=\\\"cursor:pointer;\\\"></button></div></div><div class=\\\"vox-interpreter-phone-number-error\\\"><span>{{vm.phoneErrorMessage}}</span></div></div></div></div><div class=\\\"row\\\" ng-show=\\\"vm.thirdPartyMessage\\\"><div class=\\\"col-sm-12\\\"><div class=\\\"alert alert-instruction\\\" role=\\\"alert\\\"><strong class=\\\"instruction-message\\\">{{ vm.thirdPartyMessage }}</strong></div></div></div><div class=\\\"row\\\" ng-show=\\\"vm.callCenterMessage\\\"><div class=\\\"col-sm-12\\\"><div class=\\\"alert alert-instruction\\\" role=\\\"alert\\\"><strong class=\\\"instruction-message\\\">{{ vm.callCenterMessage }}</strong></div></div></div></div>\");\n$templateCache.put(\"app/widgets/vox-phone-number.html\",\"<div class=\\\"input-group\\\"><div class=\\\"input-group-addon\\\"><i class=\\\"fa fa-phone fa-lg fa-fw\\\"></i></div><select class=\\\"form-control vox-phone-country\\\" ng-disabled=\\\"vm.countryDisabled()\\\" ng-model=\\\"vm.country\\\" ng-change=\\\"vm.phoneChanged(\\'vox-phone-number_select_ng-change_event\\')\\\"><option value=\\\"\\\"></option><option data-countrycode=\\\"US\\\" value=\\\"1\\\">USA (+1)</option><option data-countrycode=\\\"DZ\\\" value=\\\"213\\\">Algeria (+213)</option><option data-countrycode=\\\"AD\\\" value=\\\"376\\\">Andorra (+376)</option><option data-countrycode=\\\"AO\\\" value=\\\"244\\\">Angola (+244)</option><option data-countrycode=\\\"AI\\\" value=\\\"1264\\\">Anguilla (+1264)</option><option data-countrycode=\\\"AG\\\" value=\\\"1268\\\">Antigua & Barbuda (+1268)</option><option data-countrycode=\\\"AR\\\" value=\\\"54\\\">Argentina (+54)</option><option data-countrycode=\\\"AM\\\" value=\\\"374\\\">Armenia (+374)</option><option data-countrycode=\\\"AW\\\" value=\\\"297\\\">Aruba (+297)</option><option data-countrycode=\\\"AU\\\" value=\\\"61\\\">Australia (+61)</option><option data-countrycode=\\\"AT\\\" value=\\\"43\\\">Austria (+43)</option><option data-countrycode=\\\"AZ\\\" value=\\\"994\\\">Azerbaijan (+994)</option><option data-countrycode=\\\"BS\\\" value=\\\"1242\\\">Bahamas (+1242)</option><option data-countrycode=\\\"BH\\\" value=\\\"973\\\">Bahrain (+973)</option><option data-countrycode=\\\"BD\\\" value=\\\"880\\\">Bangladesh (+880)</option><option data-countrycode=\\\"BB\\\" value=\\\"1246\\\">Barbados (+1246)</option><option data-countrycode=\\\"BY\\\" value=\\\"375\\\">Belarus (+375)</option><option data-countrycode=\\\"BE\\\" value=\\\"32\\\">Belgium (+32)</option><option data-countrycode=\\\"BZ\\\" value=\\\"501\\\">Belize (+501)</option><option data-countrycode=\\\"BJ\\\" value=\\\"229\\\">Benin (+229)</option><option data-countrycode=\\\"BM\\\" value=\\\"1441\\\">Bermuda (+1441)</option><option data-countrycode=\\\"BT\\\" value=\\\"975\\\">Bhutan (+975)</option><option data-countrycode=\\\"BO\\\" value=\\\"591\\\">Bolivia (+591)</option><option data-countrycode=\\\"BA\\\" value=\\\"387\\\">Bosnia Herzegovina (+387)</option><option data-countrycode=\\\"BW\\\" value=\\\"267\\\">Botswana (+267)</option><option data-countrycode=\\\"BR\\\" value=\\\"55\\\">Brazil (+55)</option><option data-countrycode=\\\"BN\\\" value=\\\"673\\\">Brunei (+673)</option><option data-countrycode=\\\"BG\\\" value=\\\"359\\\">Bulgaria (+359)</option><option data-countrycode=\\\"BF\\\" value=\\\"226\\\">Burkina Faso (+226)</option><option data-countrycode=\\\"BI\\\" value=\\\"257\\\">Burundi (+257)</option><option data-countrycode=\\\"KH\\\" value=\\\"855\\\">Cambodia (+855)</option><option data-countrycode=\\\"CM\\\" value=\\\"237\\\">Cameroon (+237)</option><option data-countrycode=\\\"CV\\\" value=\\\"238\\\">Cape Verde Islands (+238)</option><option data-countrycode=\\\"KY\\\" value=\\\"1345\\\">Cayman Islands (+1345)</option><option data-countrycode=\\\"CF\\\" value=\\\"236\\\">Central African Republic (+236)</option><option data-countrycode=\\\"CL\\\" value=\\\"56\\\">Chile (+56)</option><option data-countrycode=\\\"CN\\\" value=\\\"86\\\">China (+86)</option><option data-countrycode=\\\"CO\\\" value=\\\"57\\\">Colombia (+57)</option><option data-countrycode=\\\"KM\\\" value=\\\"269\\\">Comoros (+269)</option><option data-countrycode=\\\"CG\\\" value=\\\"242\\\">Congo (+242)</option><option data-countrycode=\\\"CK\\\" value=\\\"682\\\">Cook Islands (+682)</option><option data-countrycode=\\\"CR\\\" value=\\\"506\\\">Costa Rica (+506)</option><option data-countrycode=\\\"HR\\\" value=\\\"385\\\">Croatia (+385)</option><option data-countrycode=\\\"CU\\\" value=\\\"53\\\">Cuba (+53)</option><option data-countrycode=\\\"CY\\\" value=\\\"90392\\\">Cyprus North (+90392)</option><option data-countrycode=\\\"CY\\\" value=\\\"357\\\">Cyprus South (+357)</option><option data-countrycode=\\\"CZ\\\" value=\\\"42\\\">Czech Republic (+42)</option><option data-countrycode=\\\"DK\\\" value=\\\"45\\\">Denmark (+45)</option><option data-countrycode=\\\"DJ\\\" value=\\\"253\\\">Djibouti (+253)</option><option data-countrycode=\\\"DO\\\" value=\\\"1809\\\">Dominican Republic (+1809)</option><option data-countrycode=\\\"EC\\\" value=\\\"593\\\">Ecuador (+593)</option><option data-countrycode=\\\"EG\\\" value=\\\"20\\\">Egypt (+20)</option><option data-countrycode=\\\"SV\\\" value=\\\"503\\\">El Salvador (+503)</option><option data-countrycode=\\\"GQ\\\" value=\\\"240\\\">Equatorial Guinea (+240)</option><option data-countrycode=\\\"ER\\\" value=\\\"291\\\">Eritrea (+291)</option><option data-countrycode=\\\"EE\\\" value=\\\"372\\\">Estonia (+372)</option><option data-countrycode=\\\"ET\\\" value=\\\"251\\\">Ethiopia (+251)</option><option data-countrycode=\\\"FK\\\" value=\\\"500\\\">Falkland Islands (+500)</option><option data-countrycode=\\\"FO\\\" value=\\\"298\\\">Faroe Islands (+298)</option><option data-countrycode=\\\"FJ\\\" value=\\\"679\\\">Fiji (+679)</option><option data-countrycode=\\\"FI\\\" value=\\\"358\\\">Finland (+358)</option><option data-countrycode=\\\"FR\\\" value=\\\"33\\\">France (+33)</option><option data-countrycode=\\\"GF\\\" value=\\\"594\\\">French Guiana (+594)</option><option data-countrycode=\\\"PF\\\" value=\\\"689\\\">French Polynesia (+689)</option><option data-countrycode=\\\"GA\\\" value=\\\"241\\\">Gabon (+241)</option><option data-countrycode=\\\"GM\\\" value=\\\"220\\\">Gambia (+220)</option><option data-countrycode=\\\"GE\\\" value=\\\"7880\\\">Georgia (+7880)</option><option data-countrycode=\\\"DE\\\" value=\\\"49\\\">Germany (+49)</option><option data-countrycode=\\\"GH\\\" value=\\\"233\\\">Ghana (+233)</option><option data-countrycode=\\\"GI\\\" value=\\\"350\\\">Gibraltar (+350)</option><option data-countrycode=\\\"GR\\\" value=\\\"30\\\">Greece (+30)</option><option data-countrycode=\\\"GL\\\" value=\\\"299\\\">Greenland (+299)</option><option data-countrycode=\\\"GD\\\" value=\\\"1473\\\">Grenada (+1473)</option><option data-countrycode=\\\"GP\\\" value=\\\"590\\\">Guadeloupe (+590)</option><option data-countrycode=\\\"GU\\\" value=\\\"671\\\">Guam (+671)</option><option data-countrycode=\\\"GT\\\" value=\\\"502\\\">Guatemala (+502)</option><option data-countrycode=\\\"GN\\\" value=\\\"224\\\">Guinea (+224)</option><option data-countrycode=\\\"GW\\\" value=\\\"245\\\">Guinea - Bissau (+245)</option><option data-countrycode=\\\"GY\\\" value=\\\"592\\\">Guyana (+592)</option><option data-countrycode=\\\"HT\\\" value=\\\"509\\\">Haiti (+509)</option><option data-countrycode=\\\"HN\\\" value=\\\"504\\\">Honduras (+504)</option><option data-countrycode=\\\"HK\\\" value=\\\"852\\\">Hong Kong (+852)</option><option data-countrycode=\\\"HU\\\" value=\\\"36\\\">Hungary (+36)</option><option data-countrycode=\\\"IS\\\" value=\\\"354\\\">Iceland (+354)</option><option data-countrycode=\\\"IN\\\" value=\\\"91\\\">India (+91)</option><option data-countrycode=\\\"ID\\\" value=\\\"62\\\">Indonesia (+62)</option><option data-countrycode=\\\"IR\\\" value=\\\"98\\\">Iran (+98)</option><option data-countrycode=\\\"IQ\\\" value=\\\"964\\\">Iraq (+964)</option><option data-countrycode=\\\"IE\\\" value=\\\"353\\\">Ireland (+353)</option><option data-countrycode=\\\"IL\\\" value=\\\"972\\\">Israel (+972)</option><option data-countrycode=\\\"IT\\\" value=\\\"39\\\">Italy (+39)</option><option data-countrycode=\\\"JM\\\" value=\\\"1876\\\">Jamaica (+1876)</option><option data-countrycode=\\\"JP\\\" value=\\\"81\\\">Japan (+81)</option><option data-countrycode=\\\"JO\\\" value=\\\"962\\\">Jordan (+962)</option><option data-countrycode=\\\"KZ\\\" value=\\\"7\\\">Kazakhstan (+7)</option><option data-countrycode=\\\"KE\\\" value=\\\"254\\\">Kenya (+254)</option><option data-countrycode=\\\"KI\\\" value=\\\"686\\\">Kiribati (+686)</option><option data-countrycode=\\\"KP\\\" value=\\\"850\\\">Korea North (+850)</option><option data-countrycode=\\\"KR\\\" value=\\\"82\\\">Korea South (+82)</option><option data-countrycode=\\\"KW\\\" value=\\\"965\\\">Kuwait (+965)</option><option data-countrycode=\\\"KG\\\" value=\\\"996\\\">Kyrgyzstan (+996)</option><option data-countrycode=\\\"LA\\\" value=\\\"856\\\">Laos (+856)</option><option data-countrycode=\\\"LV\\\" value=\\\"371\\\">Latvia (+371)</option><option data-countrycode=\\\"LB\\\" value=\\\"961\\\">Lebanon (+961)</option><option data-countrycode=\\\"LS\\\" value=\\\"266\\\">Lesotho (+266)</option><option data-countrycode=\\\"LR\\\" value=\\\"231\\\">Liberia (+231)</option><option data-countrycode=\\\"LY\\\" value=\\\"218\\\">Libya (+218)</option><option data-countrycode=\\\"LI\\\" value=\\\"417\\\">Liechtenstein (+417)</option><option data-countrycode=\\\"LT\\\" value=\\\"370\\\">Lithuania (+370)</option><option data-countrycode=\\\"LU\\\" value=\\\"352\\\">Luxembourg (+352)</option><option data-countrycode=\\\"MO\\\" value=\\\"853\\\">Macao (+853)</option><option data-countrycode=\\\"MK\\\" value=\\\"389\\\">Macedonia (+389)</option><option data-countrycode=\\\"MG\\\" value=\\\"261\\\">Madagascar (+261)</option><option data-countrycode=\\\"MW\\\" value=\\\"265\\\">Malawi (+265)</option><option data-countrycode=\\\"MY\\\" value=\\\"60\\\">Malaysia (+60)</option><option data-countrycode=\\\"MV\\\" value=\\\"960\\\">Maldives (+960)</option><option data-countrycode=\\\"ML\\\" value=\\\"223\\\">Mali (+223)</option><option data-countrycode=\\\"MT\\\" value=\\\"356\\\">Malta (+356)</option><option data-countrycode=\\\"MH\\\" value=\\\"692\\\">Marshall Islands (+692)</option><option data-countrycode=\\\"MQ\\\" value=\\\"596\\\">Martinique (+596)</option><option data-countrycode=\\\"MR\\\" value=\\\"222\\\">Mauritania (+222)</option><option data-countrycode=\\\"MX\\\" value=\\\"52\\\">Mexico (+52)</option><option data-countrycode=\\\"FM\\\" value=\\\"691\\\">Micronesia (+691)</option><option data-countrycode=\\\"MD\\\" value=\\\"373\\\">Moldova (+373)</option><option data-countrycode=\\\"MC\\\" value=\\\"377\\\">Monaco (+377)</option><option data-countrycode=\\\"MN\\\" value=\\\"976\\\">Mongolia (+976)</option><option data-countrycode=\\\"MS\\\" value=\\\"1664\\\">Montserrat (+1664)</option><option data-countrycode=\\\"MA\\\" value=\\\"212\\\">Morocco (+212)</option><option data-countrycode=\\\"MZ\\\" value=\\\"258\\\">Mozambique (+258)</option><option data-countrycode=\\\"MN\\\" value=\\\"95\\\">Myanmar (+95)</option><option data-countrycode=\\\"NA\\\" value=\\\"264\\\">Namibia (+264)</option><option data-countrycode=\\\"NR\\\" value=\\\"674\\\">Nauru (+674)</option><option data-countrycode=\\\"NP\\\" value=\\\"977\\\">Nepal (+977)</option><option data-countrycode=\\\"NL\\\" value=\\\"31\\\">Netherlands (+31)</option><option data-countrycode=\\\"NC\\\" value=\\\"687\\\">New Caledonia (+687)</option><option data-countrycode=\\\"NZ\\\" value=\\\"64\\\">New Zealand (+64)</option><option data-countrycode=\\\"NI\\\" value=\\\"505\\\">Nicaragua (+505)</option><option data-countrycode=\\\"NE\\\" value=\\\"227\\\">Niger (+227)</option><option data-countrycode=\\\"NG\\\" value=\\\"234\\\">Nigeria (+234)</option><option data-countrycode=\\\"NU\\\" value=\\\"683\\\">Niue (+683)</option><option data-countrycode=\\\"NF\\\" value=\\\"672\\\">Norfolk Islands (+672)</option><option data-countrycode=\\\"NP\\\" value=\\\"670\\\">Northern Marianas (+670)</option><option data-countrycode=\\\"NO\\\" value=\\\"47\\\">Norway (+47)</option><option data-countrycode=\\\"OM\\\" value=\\\"968\\\">Oman (+968)</option><option data-countrycode=\\\"PW\\\" value=\\\"680\\\">Palau (+680)</option><option data-countrycode=\\\"PA\\\" value=\\\"507\\\">Panama (+507)</option><option data-countrycode=\\\"PG\\\" value=\\\"675\\\">Papua New Guinea (+675)</option><option data-countrycode=\\\"PY\\\" value=\\\"595\\\">Paraguay (+595)</option><option data-countrycode=\\\"PE\\\" value=\\\"51\\\">Peru (+51)</option><option data-countrycode=\\\"PH\\\" value=\\\"63\\\">Philippines (+63)</option><option data-countrycode=\\\"PL\\\" value=\\\"48\\\">Poland (+48)</option><option data-countrycode=\\\"PT\\\" value=\\\"351\\\">Portugal (+351)</option><option data-countrycode=\\\"QA\\\" value=\\\"974\\\">Qatar (+974)</option><option data-countrycode=\\\"RE\\\" value=\\\"262\\\">Reunion (+262)</option><option data-countrycode=\\\"RO\\\" value=\\\"40\\\">Romania (+40)</option><option data-countrycode=\\\"RU\\\" value=\\\"7\\\">Russia (+7)</option><option data-countrycode=\\\"RW\\\" value=\\\"250\\\">Rwanda (+250)</option><option data-countrycode=\\\"SM\\\" value=\\\"378\\\">San Marino (+378)</option><option data-countrycode=\\\"ST\\\" value=\\\"239\\\">Sao Tome & Principe (+239)</option><option data-countrycode=\\\"SA\\\" value=\\\"966\\\">Saudi Arabia (+966)</option><option data-countrycode=\\\"SN\\\" value=\\\"221\\\">Senegal (+221)</option><option data-countrycode=\\\"CS\\\" value=\\\"381\\\">Serbia (+381)</option><option data-countrycode=\\\"SC\\\" value=\\\"248\\\">Seychelles (+248)</option><option data-countrycode=\\\"SL\\\" value=\\\"232\\\">Sierra Leone (+232)</option><option data-countrycode=\\\"SG\\\" value=\\\"65\\\">Singapore (+65)</option><option data-countrycode=\\\"SK\\\" value=\\\"421\\\">Slovak Republic (+421)</option><option data-countrycode=\\\"SI\\\" value=\\\"386\\\">Slovenia (+386)</option><option data-countrycode=\\\"SB\\\" value=\\\"677\\\">Solomon Islands (+677)</option><option data-countrycode=\\\"SO\\\" value=\\\"252\\\">Somalia (+252)</option><option data-countrycode=\\\"ZA\\\" value=\\\"27\\\">South Africa (+27)</option><option data-countrycode=\\\"ES\\\" value=\\\"34\\\">Spain (+34)</option><option data-countrycode=\\\"LK\\\" value=\\\"94\\\">Sri Lanka (+94)</option><option data-countrycode=\\\"SH\\\" value=\\\"290\\\">St. Helena (+290)</option><option data-countrycode=\\\"KN\\\" value=\\\"1869\\\">St. Kitts (+1869)</option><option data-countrycode=\\\"SC\\\" value=\\\"1758\\\">St. Lucia (+1758)</option><option data-countrycode=\\\"SD\\\" value=\\\"249\\\">Sudan (+249)</option><option data-countrycode=\\\"SR\\\" value=\\\"597\\\">Suriname (+597)</option><option data-countrycode=\\\"SZ\\\" value=\\\"268\\\">Swaziland (+268)</option><option data-countrycode=\\\"SE\\\" value=\\\"46\\\">Sweden (+46)</option><option data-countrycode=\\\"CH\\\" value=\\\"41\\\">Switzerland (+41)</option><option data-countrycode=\\\"SI\\\" value=\\\"963\\\">Syria (+963)</option><option data-countrycode=\\\"TW\\\" value=\\\"886\\\">Taiwan (+886)</option><option data-countrycode=\\\"TH\\\" value=\\\"66\\\">Thailand (+66)</option><option data-countrycode=\\\"TG\\\" value=\\\"228\\\">Togo (+228)</option><option data-countrycode=\\\"TO\\\" value=\\\"676\\\">Tonga (+676)</option><option data-countrycode=\\\"TT\\\" value=\\\"1868\\\">Trinidad & Tobago (+1868)</option><option data-countrycode=\\\"TN\\\" value=\\\"216\\\">Tunisia (+216)</option><option data-countrycode=\\\"TR\\\" value=\\\"90\\\">Turkey (+90)</option><option data-countrycode=\\\"TM\\\" value=\\\"993\\\">Turkmenistan (+993)</option><option data-countrycode=\\\"TC\\\" value=\\\"1649\\\">Turks & Caicos Islands (+1649)</option><option data-countrycode=\\\"TV\\\" value=\\\"688\\\">Tuvalu (+688)</option><option data-countrycode=\\\"UG\\\" value=\\\"256\\\">Uganda (+256)</option><option data-countrycode=\\\"GB\\\" value=\\\"44\\\">UK (+44)</option><option data-countrycode=\\\"UA\\\" value=\\\"380\\\">Ukraine (+380)</option><option data-countrycode=\\\"AE\\\" value=\\\"971\\\">United Arab Emirates (+971)</option><option data-countrycode=\\\"UY\\\" value=\\\"598\\\">Uruguay (+598)</option><option data-countrycode=\\\"VU\\\" value=\\\"678\\\">Vanuatu (+678)</option><option data-countrycode=\\\"VA\\\" value=\\\"379\\\">Vatican City (+379)</option><option data-countrycode=\\\"VE\\\" value=\\\"58\\\">Venezuela (+58)</option><option data-countrycode=\\\"VN\\\" value=\\\"84\\\">Vietnam (+84)</option><option data-countrycode=\\\"VG\\\" value=\\\"1284\\\">Virgin Islands - British (+1284)</option><option data-countrycode=\\\"VI\\\" value=\\\"1340\\\">Virgin Islands - US (+1340)</option><option data-countrycode=\\\"WF\\\" value=\\\"681\\\">Wallis & Futuna (+681)</option><option data-countrycode=\\\"YE\\\" value=\\\"969\\\">Yemen (North)(+969)</option><option data-countrycode=\\\"YE\\\" value=\\\"967\\\">Yemen (South)(+967)</option><option data-countrycode=\\\"ZM\\\" value=\\\"260\\\">Zambia (+260)</option><option data-countrycode=\\\"ZW\\\" value=\\\"263\\\">Zimbabwe (+263)</option></select><input class=\\\"form-control vox-phone-number\\\" type=\\\"tel\\\" ng-model=\\\"vm.number\\\" ng-style=\\\"vm.color\\\" ng-change=\\\"vm.phoneChanged(\\'vox-phone-number_input_ng-change_event\\')\\\" ng-model-options=\\\"{ debounce: vm.validationTimeoutDuration }\\\" ng-disabled=\\\"vm.personStatus == \\'InCall\\' || vm.personStatus == \\'Reconnect\\'\\\"><div ng-show=\\\"vm.validating\\\"><i class=\\\"fa fa-refresh fa-spin vox-phone-number-spinner\\\"></i></div><div class=\\\"input-group-addon\\\" ng-if=\\\"vm.isTemporaryPhonenumber\\\" ng-click=\\\"vm.resetClicked()\\\" title=\\\"Reset\\\"><i class=\\\"fa fa-undo\\\"></i></div></div>\");\n$templateCache.put(\"app/widgets/vox-signal-r-status.html\",\"<a href=\\\"\\\" ng-show=\\\"vm.showWarning===true;\\\"><i ng-class=\\\"vm.statusClass\\\" ng-attr-title=\\\"{{vm.statusTitle}}\\\"></i></a>\");\n$templateCache.put(\"app/widgets/vox-sip-data.html\",\"<div class=\\\"panel panel-default panel-vox\\\" ng-show=\\\"vm.showSipdata()\\\"><div class=\\\"panel panel-default panel-vox\\\"><div class=\\\"panel-heading\\\"><div class=\\\"row\\\"><div class=\\\"panel-heading-title col-md-6\\\"><strong>Caller Supplied Headers</strong></div><div ng-if=\\\"vm.showUpdateMessage && form.$valid\\\" class=\\\"message update\\\">Data updated. Please save changes.</div><div ng-if=\\\"vm.showSaveMessage\\\" class=\\\"message save\\\">Data saved.</div></div></div><div class=\\\"panel-body\\\"><div><form name=\\\"form\\\" class=\\\"form-horizontal\\\"><div class=\\\"form-group\\\" ng-repeat=\\\"sipdatum in vm.sipdata track by $index\\\"><label class=\\\"col-sm-2 control-label\\\" style=\\\"text-align: left;\\\">{{sipdatum.HeaderText}}</label><div class=\\\"col-sm-10\\\"><input type=\\\"text\\\" class=\\\"form-control\\\" ng-model=\\\"sipdatum.ValueText\\\" id=\\\"sipdata{{$index}}\\\" ng-change=\\\"vm.sipdataChanged($index)\\\" ng-disabled=\\\"!vm.editSipdataItem(sipdatum)\\\" ng-pattern=\\\"vm.handlePattern($index)\\\" name=\\\"sipdata{{$index}}\\\"></div><div ng-if=\\\"!form[\\'sipdata\\' + ($index)].$valid\\\" class=\\\"messageError message update\\\">Invalid Data.</div><div class=\\\"buttons-right-row\\\"><button type=\\\"button\\\" class=\\\"btn btn-default\\\" ng-disabled=\\\"!vm.editSipdataItem(sipdatum)\\\" ng-click=\\\"vm.reset($index)\\\">Reset</button> <button type=\\\"button\\\" class=\\\"btn btn-primary\\\" ng-disabled=\\\"!form[\\'sipdata\\' + ($index)].$valid || !vm.editSipdataItem(sipdatum)\\\" ng-click=\\\"vm.save($index)\\\">Save</button></div></div></form></div></div></div></div>\");\n$templateCache.put(\"app/widgets/vox-test-call-button.html\",\"<div><button type=\\\"button\\\" ng-class=\\\"{true : \\'btn btn-default\\' , false : \\'btn btn-primary\\'}[!vm.enableTestButton || vm.forceButtonToDisable]\\\" ladda=\\\"vm.waiting\\\" style=\\\"border-top-left-radius: 0; border-bottom-left-radius: 0; border-radius: .25rem;\\\" title=\\\"Test Connection\\\" ng-click=\\\"vm.test(); vm.forceButtonToDisable=true\\\" ng-disabled=\\\"(!vm.enableTestButton || vm.forceButtonToDisable)\\\"><span style=\\\"font-size: 12px\\\">TEST</span></button></div>\");\n$templateCache.put(\"app/widgets/vox-web-rtc-connection-quality.html\",\"<a href=\\\"\\\" ng-show=\\\"vm.errorLevel > -1;\\\"><i ng-class=\\\"vm.statusClass\\\" ng-attr-title=\\\"{{vm.statusTitle}}\\\"></i></a>\");}]);"],"sourceRoot":"/source/"}