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EAAgBC,EAAgB,EAGrF,IAAIC,EAAuB,SAASC,EAA4B7N,GAC/D,IAKI0M,EAAUiB,EALVZ,EAAW/M,EAAK,GAChB8N,EAAc9N,EAAK,GACnB+N,EAAU/N,EAAK,GAGI7a,EAAI,EAC3B,GAAG4nB,EAAShvB,MAAK,SAASjJ,GAAM,OAA+B,IAAxB44B,EAAgB54B,EAAW,IAAI,CACrE,IAAI43B,KAAYoB,EACZrB,EAAoB7jB,EAAEklB,EAAapB,KACrCD,EAAoB7zB,EAAE8zB,GAAYoB,EAAYpB,IAGhD,GAAGqB,EAAS,IAAI3vB,EAAS2vB,EAAQtB,EAClC,CAEA,IADGoB,GAA4BA,EAA2B7N,GACrD7a,EAAI4nB,EAASt9B,OAAQ0V,IACzBwoB,EAAUZ,EAAS5nB,GAChBsnB,EAAoB7jB,EAAE8kB,EAAiBC,IAAYD,EAAgBC,IACrED,EAAgBC,GAAS,KAE1BD,EAAgBC,GAAW,EAE5B,OAAOlB,EAAoBK,EAAE1uB,EAC9B,EAEI4vB,EAAqBC,KAAoC,8BAAIA,KAAoC,+BAAK,GAC1GD,EAAmBl7B,QAAQ86B,EAAqBM,KAAK,KAAM,IAC3DF,EAAmB/6B,KAAO26B,EAAqBM,KAAK,KAAMF,EAAmB/6B,KAAKi7B,KAAKF,G,IC/CvF,IAAIG,EAAsB1B,EAAoBK,OAAEl8B,EAAW,CAAC,IAAI,IAAI,IAAI,MAAM,WAAa,OAAO67B,EAAoB,MAAQ,IAC9H0B,EAAsB1B,EAAoBK,EAAEqB,E","sources":["webpack://addon-stakeholder/webpack/runtime/chunk loaded","webpack://addon-stakeholder/./projects/common/src/app/app.ts","webpack://addon-stakeholder/./projects/common/src/app/autosave.ts","webpack://addon-stakeholder/./projects/common/src/app/contacts.ts","webpack://addon-stakeholder/./projects/common/src/app/errorHandler.ts","webpack://addon-stakeholder/./projects/common/src/app/item-properties.ts","webpack://addon-stakeholder/./projects/common/src/app/options.ts","webpack://addon-stakeholder/./projects/common/src/app/save.ts","webpack://addon-stakeholder/./projects/common/src/exceptions/application/ApiException.ts","webpack://addon-stakeholder/./projects/common/src/exceptions/application/ApplicationException.ts","webpack://addon-stakeholder/./projects/common/src/exceptions/application/ItemIsNotSavedException.ts","webpack://addon-stakeholder/./projects/common/src/exceptions/application/MeetingAlreadySavedException.ts","webpack://addon-stakeholder/./projects/common/src/exceptions/http/AuthException.ts","webpack://addon-stakeholder/./projects/common/src/exceptions/http/AuthInvalidGrantException.ts","webpack://addon-stakeholder/./projects/common/src/exceptions/http/ConnectionException.ts","webpack://addon-stakeholder/./projects/common/src/exceptions/http/ForbiddenException.ts","webpack://addon-stakeholder/./projects/common/src/exceptions/http/InternalServerException.ts","webpack://addon-stakeholder/./projects/common/src/exceptions/http/UnknownHttpException.ts","webpack://addon-stakeholder/./projects/common/src/exceptions/outlook/OutlookApiException.ts","webpack://addon-stakeholder/./projects/common/src/exceptions/outlook/OutlookException.ts","webpack://addon-stakeholder/./projects/common/src/exceptions/outlook/OutlookItemNotSupported.ts","webpack://addon-stakeholder/./projects/common/src/exceptions/outlook/OutlookWrongItemSelectedException.ts","webpack://addon-stakeholder/./projects/common/src/index.ts","webpack://addon-stakeholder/./projects/common/src/models/CommunicationTemplate.ts","webpack://addon-stakeholder/./projects/common/src/models/ContactCustomFields.ts","webpack://addon-stakeholder/./projects/common/src/utils/api.ts","webpack://addon-stakeholder/./projects/common/src/utils/authUtils.ts","webpack://addon-stakeholder/./projects/common/src/utils/contactUtils.ts","webpack://addon-stakeholder/./projects/common/src/utils/dateUtils.ts","webpack://addon-stakeholder/./projects/common/src/utils/graphApi.ts","webpack://addon-stakeholder/./projects/common/src/utils/graphItemUtils.ts","webpack://addon-stakeholder/./projects/common/src/utils/http.ts","webpack://addon-stakeholder/./projects/common/src/utils/loaderUtil.ts","webpack://addon-stakeholder/./projects/common/src/utils/logUtils.ts","webpack://addon-stakeholder/./projects/common/src/utils/office-js-helpers/Authenticator.ts","webpack://addon-stakeholder/./projects/common/src/utils/office-js-helpers/endpoint.ts","webpack://addon-stakeholder/./projects/common/src/utils/office-js-helpers/generateCryptoSafeRandom.ts","webpack://addon-stakeholder/./projects/common/src/utils/outlookAsyncUtils.ts","webpack://addon-stakeholder/./projects/common/src/utils/outlookItemUtils.ts","webpack://addon-stakeholder/./projects/common/src/utils/sleep.ts","webpack://addon-stakeholder/./projects/common/src/utils/uiUtils.ts","webpack://addon-stakeholder/./projects/common/src/utils/user-settings.ts","webpack://addon-stakeholder/./projects/sstk/src/index.ts","webpack://addon-stakeholder/webpack/bootstrap","webpack://addon-stakeholder/webpack/runtime/define property getters","webpack://addon-stakeholder/webpack/runtime/global","webpack://addon-stakeholder/webpack/runtime/hasOwnProperty shorthand","webpack://addon-stakeholder/webpack/runtime/make namespace object","webpack://addon-stakeholder/webpack/runtime/jsonp chunk loading","webpack://addon-stakeholder/webpack/startup"],"sourcesContent":["var deferred = [];\n__webpack_require__.O = function(result, chunkIds, fn, priority) {\n\tif(chunkIds) {\n\t\tpriority = priority || 0;\n\t\tfor(var i = deferred.length; i > 0 && deferred[i - 1][2] > priority; i--) deferred[i] = deferred[i - 1];\n\t\tdeferred[i] = [chunkIds, fn, priority];\n\t\treturn;\n\t}\n\tvar notFulfilled = Infinity;\n\tfor (var i = 0; i < deferred.length; i++) {\n\t\tvar chunkIds = deferred[i][0];\n\t\tvar fn = deferred[i][1];\n\t\tvar priority = deferred[i][2];\n\t\tvar fulfilled = true;\n\t\tfor (var j = 0; j < chunkIds.length; j++) {\n\t\t\tif ((priority & 1 === 0 || notFulfilled >= priority) && Object.keys(__webpack_require__.O).every(function(key) { return __webpack_require__.O[key](chunkIds[j]); })) {\n\t\t\t\tchunkIds.splice(j--, 1);\n\t\t\t} else {\n\t\t\t\tfulfilled = false;\n\t\t\t\tif(priority < notFulfilled) notFulfilled = priority;\n\t\t\t}\n\t\t}\n\t\tif(fulfilled) {\n\t\t\tdeferred.splice(i--, 1)\n\t\t\tvar r = fn();\n\t\t\tif (r !== undefined) result = r;\n\t\t}\n\t}\n\treturn result;\n};","import { OutlookApiException } from 'common/exceptions/outlook/OutlookApiException';\nimport { OutlookWrongItemSelectedException } from 'common/exceptions/outlook/OutlookWrongItemSelectedException';\nimport { ClientListItem } from 'common/models/ClientListItem';\nimport { SupportedOfficeItem } from 'common/utils/SupportedOfficeItem';\nimport * as OutlookItemUtils from 'common/utils/outlookItemUtils';\nimport { sleep } from 'common/utils/sleep';\nimport CONFIG from 'config';\nimport $ from 'jquery';\nimport { DomainDetails } from '../models/DomainDetails';\nimport { GetDomainListResponse } from '../models/GetDomainListResponse';\nimport { ProjectInfo } from '../models/ProjectInfo';\nimport * as Api from '../utils/api';\nimport * as Auth from '../utils/authUtils';\nimport {\n getAdditionalStakeholders,\n getPrimaryStakeholders,\n} from '../utils/contactUtils';\nimport * as OutlookAsyncUtils from '../utils/outlookAsyncUtils';\nimport * as Ui from '../utils/uiUtils';\nimport * as UserSettings from '../utils/user-settings';\nimport { getDiffInMinutes } from './../utils/dateUtils';\nimport * as AppAutosave from './autosave';\nimport { errorHandler } from './errorHandler';\nimport * as ItemProperties from './item-properties';\nimport * as AppSave from './save';\n\nexport let clients: ClientListItem[] = [];\nexport let domains: DomainDetails[] = [];\nexport let projectGroupAvailable = false;\nlet savingMessage: boolean;\nlet autosavingMessages: boolean;\nlet lastAutosave: Date;\nlet autosaveTimerId: number;\nlet startingApp: boolean;\nlet currentItem: SupportedOfficeItem;\nconst TAG = 'APP1: ';\n\nexport async function tryStart(item: SupportedOfficeItem) {\n currentItem = item;\n\n if (!currentItem) {\n return;\n }\n\n console.log(TAG, new Date(), 'Start tryStart');\n await waitForAllTasks();\n\n if (currentItem != item) {\n console.log(TAG, 'tryStart: cancelling because selected item has changed');\n return;\n }\n\n startingApp = true;\n try {\n console.log(TAG, new Date(), 'Starting app');\n await start(item);\n } catch (error) {\n // do not show this kind of errors because they occur often on the web\n if (error instanceof OutlookWrongItemSelectedException) {\n console.log(\n TAG,\n 'OutlookWrongItemSelectedException has occurred when trying to start the application',\n error\n );\n Ui.showItemNotSupportedPage();\n } else if (currentItem != item) {\n console.log(\n TAG,\n 'Failed to start the application for previous office item',\n error\n );\n } else {\n errorHandler(error, 'Failed to start the application');\n }\n }\n startingApp = false;\n console.log(TAG, new Date(), 'End tryStart');\n}\n\nexport async function startAutosaveTimer(item: SupportedOfficeItem) {\n if (!CONFIG.isGraphApiEnabled) {\n console.log(\n TAG,\n 'Graph API is disabled. Autosave timer will not be started.'\n );\n return;\n }\n\n if (autosaveTimerId) {\n console.log(TAG, 'Clearing existing autosave timer:', autosaveTimerId);\n clearInterval(autosaveTimerId);\n autosaveTimerId = undefined;\n }\n\n const sharedProperties = await OutlookAsyncUtils.getSharedProperties(item);\n\n if (sharedProperties) {\n console.log(TAG, 'Item is shared. Autosave timer will not be started.');\n return;\n }\n\n console.log(TAG, 'Invoking tryAutosaveIfDue...');\n await tryAutosaveIfDue();\n\n // tryAutosaveIfDue will be called frequently, but the autosave will still only happen every CONFIG.autosaveIntervalInMinutes minutes\n console.log(TAG, 'Setting interval for autosave.');\n autosaveTimerId = window.setInterval(() => {\n console.log(\n TAG,\n 'Timer triggered (5 minute interval). Invoking tryAutosaveIfDue...'\n );\n tryAutosaveIfDue();\n }, 5 * 60 * 1000);\n\n console.log(TAG, 'Autosave timer started with ID:', autosaveTimerId);\n}\n\nexport async function tryAutosaveIfDue() {\n if (autosavingMessages) {\n console.log(TAG, 'Already autosaving');\n return;\n }\n\n if (!isDueToAutosave()) {\n console.log(TAG, 'Not due to autosave. Last autosave:', lastAutosave);\n return;\n }\n\n console.log(TAG, new Date(), 'Start tryAutosaveIfDue:');\n\n await waitForAllTasks();\n\n // Check again after waiting for pending tasks as another autosave may have been started in the interim\n if (autosavingMessages) {\n console.log(TAG, 'Already autosaving');\n return;\n }\n\n autosavingMessages = true;\n\n try {\n console.log(TAG, new Date(), 'Autosave new messages:');\n await AppAutosave.autosaveNewMessages();\n } catch (error) {\n errorHandler(error, 'Failed to autosave new messages');\n }\n\n autosavingMessages = false;\n\n console.log(TAG, new Date(), 'End tryAutosaveIfDue:');\n}\n\nexport async function trySaveMessage(item: SupportedOfficeItem) {\n console.log(TAG, new Date(), 'Start trySaveMessage');\n\n await waitForAllTasks();\n\n savingMessage = true;\n try {\n console.log(TAG, new Date(), 'Saving message');\n await AppSave.saveMessage(item);\n } catch (error) {\n const message = 'Failed to save the document';\n if (error instanceof OutlookApiException) {\n errorHandler(error, undefined);\n } else {\n errorHandler(error, message);\n }\n }\n\n if (UserSettings.getAutosave()) {\n resetAutosavePeriod();\n }\n\n savingMessage = false;\n\n console.log(TAG, new Date(), 'End trySaveMessage');\n}\n\nexport async function start(item: SupportedOfficeItem) {\n console.log(TAG, `Starting processing for item: ${item.subject}`);\n\n const sharedProperties = await OutlookAsyncUtils.getSharedProperties(item);\n console.log(\n TAG,\n `Retrieved shared properties for item: ${item.subject}`,\n sharedProperties\n );\n\n if (await OutlookItemUtils.isReadOnlySharedItem(item, sharedProperties)) {\n console.log(\n TAG,\n `Item is a read-only shared item. Showing not supported message for item: ${item.subject}`\n );\n Ui.showReadOnlySharedItemNotSupported();\n } else if (await ItemProperties.isItemSavedThroughApi(item)) {\n console.log(\n TAG,\n `Item is already saved through API. Showing saved message for item: ${item.subject}`\n );\n Ui.showMessageSaved();\n } else if (await AppAutosave.isAutosaved(item)) {\n console.log(\n TAG,\n `Item is already autosaved. Showing autosaved message for item: ${item.subject}`\n );\n Ui.showMessageAutosaved();\n } else if (await OutlookAsyncUtils.isRecurringMaster(item)) {\n console.log(\n TAG,\n `Item is a recurring master. Showing series event not supported message for item: ${item.subject}`\n );\n Ui.showSeriesEventNotSupported();\n } else if (await OutlookItemUtils.isSavedMeeting(item, sharedProperties)) {\n console.log(\n TAG,\n `Item is a saved meeting. Showing saved message for item: ${item.subject}`\n );\n Ui.showMessageSaved();\n } else {\n console.log(\n TAG,\n `None of the conditions met. Showing primary stakeholders info for item: ${item.subject}`\n );\n await Ui.showPrimaryStakeholdersInfo(item);\n }\n\n console.log(TAG, `Finished processing for item: ${item.subject}`);\n}\n\nexport async function showStakeholdersForm(item: SupportedOfficeItem) {\n const allRadio = $('input[name=\"save-all-future-email\"]');\n\n allRadio.each(function () {\n if ($(this).val() == 'one') {\n $(this).prop('checked', true);\n }\n $(this).prop('disabled', UserSettings.getAutosave());\n });\n\n const sharedProperties = await OutlookAsyncUtils.getSharedProperties(item);\n\n const [primaryStakeholders, additionalStakeholders] = await Promise.all([\n getPrimaryStakeholders(item, sharedProperties),\n getAdditionalStakeholders(item, sharedProperties),\n ]);\n\n Ui.showStakeholdersForm(\n primaryStakeholders,\n additionalStakeholders,\n item.itemType,\n item.attachments\n );\n}\n\nexport async function getClientList() {\n clients = (await Api.getClientList()).Clients;\n if (clients.length > 1) {\n console.log(TAG, 'GET Client List -> Form Client Show');\n $('#form-client').show();\n } else {\n console.log(TAG, 'GET Client List -> Form Client Hide');\n $('#form-client').hide();\n }\n}\n\nexport async function refreshClients() {\n Ui.refreshClients(clients);\n}\n\nexport async function refreshDomains(clientID: number) {\n const domainsInfo = await Api.getDomainList(clientID);\n domains = domainsInfo.DomainDetails;\n projectGroupAvailable = domainsInfo.ProjectGroupAvailable;\n const favouriteDomainAndGroup = getFavDomainAndGroup(domainsInfo);\n Ui.refreshDomains(\n domainsInfo.DomainDetails,\n favouriteDomainAndGroup,\n domainsInfo.ProjectGroupAvailable\n );\n}\n\n/** Returns ID of first available project */\nexport async function selectClientAnyProjectId(\n clientID: number\n): Promise {\n const domainsInfo = await Api.getDomainList(clientID);\n domains = domainsInfo.DomainDetails;\n projectGroupAvailable = domainsInfo.ProjectGroupAvailable;\n\n for (const domain of domains) {\n for (const project of domain.Projects) {\n return project.ID;\n }\n for (const group of domain.ProjectGroups) {\n for (const project of group.Projects) {\n return project.ID;\n }\n }\n\n for (const project of domain.Projects) {\n return project.ID;\n }\n }\n}\n\nexport async function switchClient(client: ClientListItem): Promise {\n UserSettings.setClientCode(client.Name);\n\n // because token can't be refreshed if project isn't selected,\n // we'll select first available project and refresh token for it\n const projectId = await selectClientAnyProjectId(client.ClientID);\n if (projectId) {\n UserSettings.setProject(projectId);\n await Auth.refreshToken();\n }\n return projectId;\n}\n\n/** Returns ID of first available project */\nexport async function selectAnyProjectId(): Promise {\n const pID = await selectClientAnyProjectId(0);\n return pID;\n}\n\nexport function logout() {\n localStorage.clear();\n Ui.showLogoutSuccessDialog();\n}\n\nfunction getFavDomainAndGroup(domainList: GetDomainListResponse) {\n if (!domainList.FavouriteProjectDetails) return null;\n\n const favProjectName = domainList.FavouriteProjectDetails.ProjectName;\n const projectGroupAvailable = domainList.ProjectGroupAvailable;\n const domains = domainList.DomainDetails;\n\n let favouriteProject: ProjectInfo = null;\n\n const projectInfos: ProjectInfo[] = [];\n\n domains.forEach(function (domain) {\n if (projectGroupAvailable) {\n domain.ProjectGroups.forEach(function (projectGroup) {\n projectGroup.Projects.forEach(function (project) {\n projectInfos.push({\n domainId: domain.ID,\n projectGroupId: projectGroup.ID,\n projectId: project.ID,\n project: project,\n });\n });\n });\n } else {\n domain.Projects.forEach(function (project) {\n projectInfos.push({\n domainId: domain.ID,\n projectGroupId: '-1',\n projectId: project.ID,\n project: project,\n });\n });\n }\n });\n\n projectInfos.find(function (projectInfo) {\n if (projectInfo.project.ProjectName == favProjectName) {\n favouriteProject = {\n domainId: projectInfo.domainId,\n projectGroupId: projectInfo.projectGroupId,\n projectId: projectInfo.project.ID,\n project: projectInfo.project,\n };\n }\n });\n return favouriteProject;\n}\n\nfunction isDueToAutosave() {\n const diffMinutes = getDiffInMinutes(new Date(), lastAutosave || new Date(0));\n\n const isDue = diffMinutes > CONFIG.autosaveIntervalInMinutes;\n return isDue;\n}\n\n/** Resets the time of last autosave to trigger it on the next app start */\nfunction resetAutosavePeriod() {\n lastAutosave = undefined;\n}\n\nasync function waitForAllTasks() {\n while (savingMessage || autosavingMessages || startingApp) {\n console.log(\n TAG,\n new Date(),\n 'Waiting for:',\n 'savingMessage:',\n savingMessage,\n 'autosavingMessages:',\n autosavingMessages,\n 'startingApp:',\n startingApp\n );\n await sleep(50);\n }\n}\n","import * as MicrosoftGraph from '@microsoft/microsoft-graph-types';\nimport { ApplicationException } from 'common/exceptions/application/ApplicationException';\nimport { ProcessedMessages } from 'common/models/ProcessedMessage';\nimport { addToLoaderDetails } from 'common/utils/loaderUtil';\nimport CONFIG from 'config';\nimport { Complaint } from '../models/Complaint';\nimport { Interaction } from '../models/Interaction';\nimport { SupportedOfficeItem } from '../utils/SupportedOfficeItem';\nimport * as Api from '../utils/api';\nimport * as Auth from '../utils/authUtils';\nimport { getAllStakeholders } from '../utils/contactUtils';\nimport { toIsoWithTimeZone } from '../utils/dateUtils';\nimport * as GraphApi from '../utils/graphApi';\nimport { getDirectionForGraphItem } from '../utils/graphItemUtils';\nimport { getDateFromOutlookItem } from '../utils/outlookItemUtils';\nimport * as UserSettings from '../utils/user-settings';\nimport { ContactCustomFields } from './../models/ContactCustomFields';\nimport * as App from './app';\nimport * as AppContacts from './contacts';\nimport { errorHandler } from './errorHandler';\nimport * as ItemProperties from './item-properties';\nimport * as AppSave from './save';\n\nconst TAG = 'ATS3: ';\n\nexport async function isAutosaved(item: SupportedOfficeItem) {\n if (!CONFIG.isGraphApiEnabled) return false;\n\n if (item.itemType === 'appointment') return false;\n\n console.log(TAG, 'Checking if item was autosaved');\n const messageDate = await getDateFromOutlookItem(item);\n // message date will be compared to last sync date, which doesn't include milliseconds,\n // because REST API doesn't include them in date-time fields\n // to make the comparison \"fair\", messageDate should be stripped of milliseconds\n messageDate.setMilliseconds(0);\n const contacts = await getAutosaveContacts();\n\n // Get all the email addresses from the email, but:\n // Exclude the user's email address\n // Exclude CC-ed email addresses [includeCc = false]\n const stakeholders = await getAllStakeholders(item, undefined, false);\n\n // find all autosave contacts for this item\n const itemContacts: MicrosoftGraph.Contact[] = [];\n for (const stakeholder of stakeholders) {\n const contact = contacts.find(\n (c) =>\n c.emailAddresses?.[0]?.address?.toLowerCase() ===\n stakeholder.email?.toLowerCase()\n );\n if (contact) {\n itemContacts.push(contact);\n }\n }\n\n // if no autosave contacts for this item, then item is not autosaved\n if (itemContacts.length === 0) {\n console.log(TAG, 'Contacts on SSTKAutoSave', contacts);\n console.log(\n TAG,\n 'The contact is checking -> Message is not supposed to be autosaved'\n );\n return false;\n }\n\n // check last sync dates for all contacts\n const autosavedForAllContacts = itemContacts.every((c) => {\n console.log(TAG, `Checking if item was autosaved for ${c.givenName}`);\n const customFields = AppContacts.getCustomFields(c);\n console.log(\n TAG,\n `Last sync date for contact ${customFields.lastSyncDate}`,\n Number(customFields.lastSyncDate)\n );\n console.log(TAG, `Message date is ${messageDate}`, Number(messageDate));\n\n return (\n customFields.lastSyncDate >= messageDate &&\n customFields.startAutosaveDate <= messageDate\n );\n });\n\n console.log(TAG, 'Autosaved for all contacts ', autosavedForAllContacts);\n return autosavedForAllContacts;\n}\n\nexport async function autosaveNewMessages() {\n console.log(TAG, 'Getting contacts to auto save new messages');\n const contacts = await getAutosaveContacts();\n\n await prepareMessages(contacts);\n\n // Filter contacts to include only those with messages\n const contactsWithMessages = contacts.filter((contact) => {\n const address = contact.emailAddresses[0].address;\n const hasMsg = hasMessages(address);\n\n if (!hasMsg) {\n console.log(TAG, `Contact with no messages to sync: ${address}`);\n }\n\n return hasMsg;\n });\n\n let messageSaved = false;\n let totalMessages = 0;\n const errorContacts = [];\n const processedMessages: ProcessedMessages = { count: 0 };\n\n // Calculate the total number of messages\n for (const contact of contactsWithMessages) {\n const customFields = AppContacts.getCustomFields(contact);\n const messages = getMessages(\n contact.emailAddresses[0].address,\n new Date(customFields.lastSyncDate)\n );\n totalMessages += messages.length;\n }\n\n if (totalMessages > 0) {\n const loaderDetails = 'Autosaving Started';\n addToLoaderDetails({\n text: loaderDetails,\n secondaryText:\n 'Please avoid any interruptions, such as changing or opening emails, while autosaving is active.',\n });\n console.log(TAG, loaderDetails);\n }\n\n for (const contact of contactsWithMessages) {\n try {\n const result = await autosaveMessagesForContact(\n contact,\n processedMessages,\n totalMessages\n );\n\n // Update messageSaved if the result is true\n if (result) {\n messageSaved = true;\n console.log(\n TAG,\n 'Completed processing new messages for contact with new messages:',\n contact.emailAddresses[0].address,\n 'result:',\n result\n );\n }\n } catch (error) {\n // Collect error email addresses\n const contactEmail =\n contact.emailAddresses[0]?.address || '(No Email Address)';\n errorContacts.push(contactEmail);\n\n console.error(\n TAG,\n `Error processing contact with new messages: ${contactEmail}`,\n error\n );\n }\n }\n\n if (totalMessages > 0) {\n const loaderDetails = 'Autosaving Completed';\n addToLoaderDetails(loaderDetails);\n console.log(TAG, loaderDetails);\n }\n\n if (messageSaved) {\n await Api.trackVitallyEvent({ eventName: 'used_email_plugin' });\n }\n\n if (errorContacts.length > 0) {\n // Show error popup with collected error contacts\n const errorMessage = `Error while autosaving messages for the following contacts:

${errorContacts.join(\n '
'\n )}

Please contact support.`;\n errorHandler(null, errorMessage);\n }\n\n // Reset the loader to \"Loading\"\n addToLoaderDetails(null);\n}\n\nexport async function getAutosaveContacts() {\n const group = await GraphApi.getOrCreateContactGroup(CONFIG.contactGroupName);\n const contacts = await GraphApi.getContacts(group.id);\n console.log(TAG, 'Found contacts ', contacts.length);\n return contacts;\n}\n\nasync function autosaveMessagesForContact(\n contact: MicrosoftGraph.Contact,\n processedMessages: ProcessedMessages,\n totalMessages: number\n) {\n if (!contact.emailAddresses[0] || !contact.emailAddresses[0].address) {\n throw new ApplicationException(\n 'One of the contacts in autosave contact group is corrupt: ' +\n JSON.stringify(contact)\n );\n }\n\n console.log(\n TAG,\n 'Processing autosave contact for:',\n contact.emailAddresses[0].address\n );\n\n const customFields = AppContacts.getCustomFields(contact);\n\n if (!isCorrectClientCode(customFields)) {\n return false;\n }\n\n // previous version didn't set customFields.lastSyncDate\n // in this case, use LastModifiedDateTime instead\n // can be removed later\n const lastSyncDate = !isNaN(Number(customFields.lastSyncDate))\n ? customFields.lastSyncDate\n : new Date(contact.lastModifiedDateTime);\n\n console.log(\n TAG,\n `Searching for new messages from ${contact.emailAddresses[0].address} since ${lastSyncDate}. Custom fields:`,\n customFields\n );\n\n const messages = getMessages(contact.emailAddresses[0].address, lastSyncDate);\n\n console.log(\n TAG,\n `Found ${messages.length} messages for ${contact.emailAddresses[0].address}.`\n );\n\n if (messages.length === 0) {\n return false;\n }\n\n UserSettings.setProject(customFields.projectId);\n await Auth.refreshToken();\n\n const stakeholderId = await Api.findStakeholder(customFields.stakeholder);\n\n if (!stakeholderId) {\n console.log(\n TAG,\n `${customFields.stakeholder.Email} was deleted in ${CONFIG.appName}`\n );\n await GraphApi.deleteContact(contact.id);\n throw new ApplicationException(\n `Stakeholder ${customFields.stakeholder.Email} was deleted in ${CONFIG.appName}. ` +\n 'Add-in will stop auto-saving messages from this stakeholder'\n );\n }\n\n let messageSaved = false;\n\n console.log(TAG, 'messages: ', messages);\n\n for (const message of messages) {\n console.log(TAG, 'Process Message: ', message.subject);\n const shouldSave = await shouldSaveMessage(message);\n if (shouldSave) {\n await autosaveMessage(message, customFields, stakeholderId);\n await ItemProperties.markItemAsSavedThroughGraph(message);\n\n messageSaved = true;\n console.log(TAG, 'Saved as Interaction: ', message.subject);\n }\n\n // even if message was skipped because it's already saved,\n // we'll need to update last sync date so message would be marked as Autosaved in UI\n await AppContacts.setLastSyncDate(\n contact,\n new Date(message.receivedDateTime)\n );\n\n // Update the progress percentage\n processedMessages.count++;\n\n const loaderDetails = `Autosaving In Progress (${processedMessages.count} / ${totalMessages})`;\n addToLoaderDetails({\n text: loaderDetails,\n secondaryText:\n 'Please avoid any interruptions, such as changing or opening emails, while autosaving is active.',\n });\n console.log(TAG, loaderDetails);\n\n // Check if token still valid, if not then refresh the token.\n // This will prevent the subsequent endpoints from failing.\n if (!Auth.isTokenValid()) {\n await Auth.refreshToken();\n }\n }\n\n return messageSaved;\n}\n\nlet allNewMessages: MicrosoftGraph.Message[];\n/** Retrieves and saved messages for all contacts in one go\n * Because requesting them for individual contacts is costly\n */\nasync function prepareMessages(contacts: MicrosoftGraph.Contact[]) {\n const addressesToDates = new Map();\n for (const contact of contacts) {\n const fields = AppContacts.getCustomFields(contact);\n const lastSyncDate = fields.lastSyncDate;\n\n if (\n contact.emailAddresses &&\n contact.emailAddresses[0] &&\n contact.emailAddresses[0].address\n ) {\n const address = contact.emailAddresses[0].address;\n addressesToDates.set(address, lastSyncDate);\n }\n }\n\n console.log(TAG, 'Getting messages no older than:');\n addressesToDates.forEach((date, address) => {\n console.log(TAG, `${address}: ${date}`);\n });\n const allMessages = await GraphApi.getMessages(addressesToDates);\n\n const contactMessagesAscending = allMessages.sort((a, b) => {\n const aDate = new Date(a.receivedDateTime);\n const bDate = new Date(b.receivedDateTime);\n\n if (aDate > bDate) return 1;\n else if (bDate > aDate) return -1;\n return 0;\n });\n\n allNewMessages = contactMessagesAscending;\n}\n\n/**\n * Filters previously retrieved messages\n */\nfunction getMessages(email: string, lastSyncDate: Date) {\n email = email.toLowerCase();\n\n const contactMessages = allNewMessages.filter((m) => {\n // REST API might round up time (e.g. 9:00:00 900ms -> 9:00:01)\n // we're adding a second to lastSyncDate to catch messages with round up seconds\n const clone = new Date(lastSyncDate);\n const adjustedLastSyncDate = new Date(\n clone.setSeconds(clone.getSeconds() + 1)\n );\n\n if (new Date(m.receivedDateTime) <= adjustedLastSyncDate) {\n return false;\n }\n\n if (\n m.from.emailAddress &&\n m.from.emailAddress.address?.toLowerCase() === email\n ) {\n return true;\n }\n\n if (!m.toRecipients) return false;\n\n const recipient = m.toRecipients.find(\n (r) => r.emailAddress.address?.toLowerCase() === email\n );\n\n if (recipient) return true;\n else return false;\n });\n\n return contactMessages;\n}\n\nfunction hasMessages(email: string): boolean {\n email = email.toLowerCase();\n\n const hasMessage = allNewMessages.some((m) => {\n if (\n m.from.emailAddress &&\n m.from.emailAddress.address?.toLowerCase() === email\n ) {\n return true;\n }\n\n if (!m.toRecipients) return false;\n\n const recipient = m.toRecipients.find(\n (r) => r.emailAddress.address?.toLowerCase() === email\n );\n\n return recipient ? true : false;\n });\n\n return hasMessage;\n}\n\n/** Returns false if current domain/client doesn't match the one assigned for this contact */\nfunction isCorrectClientCode(customFields: ContactCustomFields) {\n // if it's not saved, we'll just try to save the message with current domain/client and assign it to this contact later\n\n const client = App.clients.find((c) => c.Name == customFields.clientId);\n\n if (UserSettings.getDomain()) {\n if (customFields.clientId && customFields.domainUrl) {\n if (!client || customFields.domainUrl !== UserSettings.getDomain()) {\n console.log(\n TAG,\n 'Signed in with different domain or client code, skipping this contact'\n );\n return false;\n } else {\n console.log(TAG, 'Signed in correct domain/client, continuing');\n }\n } else {\n console.log(TAG, 'Domain/client not set for this contact');\n }\n }\n\n if (client && client.Name != UserSettings.getClientCode()) {\n UserSettings.setClientCode(client.Name);\n }\n\n return true;\n}\n\nasync function shouldSaveMessage(message: MicrosoftGraph.Message) {\n const isMarkedAsSaved = await ItemProperties.isItemSavedThroughGraph(message);\n if (isMarkedAsSaved) {\n console.log(TAG, 'Message already saved, skipping', message.subject);\n return false;\n }\n\n const isExcludedPromise = Api.ensureEmailSubjectIsNotExcluded({\n Subject: message.subject,\n });\n const isSavedPromise = isEmailADuplicate(message);\n const isExcluded = await isExcludedPromise;\n const isSavedOnServer = await isSavedPromise;\n\n if (isExcluded) {\n console.log(\n TAG,\n 'Email subject contains words that are in the exclusion list'\n );\n return false;\n }\n if (isSavedOnServer) {\n console.log(TAG, 'Email was already saved on the server');\n return false;\n }\n\n return true;\n}\n\nasync function isEmailADuplicate(message: MicrosoftGraph.Message) {\n if (CONFIG.allowToSaveMessageAgain) return false;\n\n const response = await Api.findDuplicateEmail({\n Subject: message.subject,\n EmailAddresses: [\n message.from.emailAddress.address,\n ...message.toRecipients.map((to) => to.emailAddress.address),\n ],\n Message: message.body.content,\n DateTime: toIsoWithTimeZone(new Date(message.receivedDateTime)),\n });\n console.log(TAG, `is Email Duplicate: `, response.IsMatchFound);\n return response.IsMatchFound;\n}\n\nasync function autosaveMessage(\n message: MicrosoftGraph.Message,\n customFields: ContactCustomFields,\n stakeholderId: string\n) {\n console.log(TAG, 'message is now saving... StakeholderID: ', stakeholderId);\n console.log(\n TAG,\n 'message is now saving... from Email address: ',\n message?.from?.emailAddress?.address\n );\n\n if (customFields.emailType == 'Communication' || !customFields.emailType) {\n await saveInteraction(message, customFields, stakeholderId);\n } else if (customFields.emailType == 'Complaint') {\n await saveComplaint(message, customFields, stakeholderId);\n } else {\n throw new ApplicationException(\n 'Unexpected email type for auto saving ' + customFields.emailType\n );\n }\n}\n\nasync function saveInteraction(\n message: MicrosoftGraph.Message,\n customFields: ContactCustomFields,\n stakeholderId: string\n) {\n console.log(TAG, 'Saving interaction ', message.subject, customFields);\n\n const attachmentsIds = await AppSave.uploadAttachmentsForItemId(\n message.id,\n 'message',\n undefined\n );\n\n const interaction = await getInteractionForAutosave(message, customFields);\n const interactionId = await Api.saveInteraction(interaction);\n await Api.linkInteractionToStakeholders(interactionId, [stakeholderId]);\n if (attachmentsIds.length > 0) {\n await Api.linkInteractionToAttachments(interactionId, attachmentsIds);\n }\n\n await Api.trackVitallyEvent({ eventName: 'new_interaction_saved' });\n}\n\nasync function saveComplaint(\n message: MicrosoftGraph.Message,\n customFields: ContactCustomFields,\n stakeholderId: string\n) {\n console.log(TAG, 'Saving complaint ', message.subject);\n\n const attachmentsIds = await AppSave.uploadAttachmentsForItemId(\n message.id,\n 'message',\n undefined\n );\n\n const complaint = await getComplaintForAutosave(message, customFields);\n const complaintId = await Api.saveComplaint(complaint);\n await Api.linkComplaintToStakeholders(complaintId, [stakeholderId]);\n if (attachmentsIds.length > 0) {\n await Api.linkComplaintToAttachments(complaintId, attachmentsIds);\n }\n\n await Api.trackVitallyEvent({ eventName: 'new_complaint_saved' });\n}\n\nasync function getInteractionForAutosave(\n item: MicrosoftGraph.Message,\n customFields: ContactCustomFields\n) {\n const subject = item.subject;\n const direction = getDirectionForGraphItem(item);\n const dateTime = new Date(item.receivedDateTime);\n const body = item.body.content;\n const template = customFields.communicationTemplate;\n\n const communicationDirection = await Api.getDirectionFromServer(direction);\n\n const interaction: Interaction = {\n Subject: subject,\n Location: null,\n CommunicationDate: toIsoWithTimeZone(dateTime),\n Method: {\n Text: 'Email',\n },\n Direction: communicationDirection,\n Message: body,\n Confidential: template.Confidential,\n Duration: null, // there is no autosave for meetings\n InteractionType: template.InteractionType,\n SentimentPhrases: template.SentimentPhrases,\n AdditionalSharedProjectIDs: template.AdditionalSharedProjectIDs,\n };\n\n return interaction;\n}\n\nasync function getComplaintForAutosave(\n item: MicrosoftGraph.Message,\n customFields: ContactCustomFields\n) {\n const subject = item.subject;\n const direction = getDirectionForGraphItem(item);\n const dateTime = new Date(item.receivedDateTime);\n const body = item.body.content;\n const template = customFields.communicationTemplate;\n\n const communicationDirection = await Api.getDirectionFromServer(direction);\n\n const complaint: Complaint = {\n Subject: subject,\n AssignedTo: template.AssignedTo,\n DateOpened: toIsoWithTimeZone(dateTime),\n Method: {\n Text: 'Email',\n },\n Direction: communicationDirection,\n Message: body,\n Priority: template.Priority,\n Confidential: template.Confidential,\n Status: template.Status,\n InteractionType: template.InteractionType,\n SentimentPhrases: template.SentimentPhrases,\n };\n\n return complaint;\n}\n","import * as MicrosoftGraph from '@microsoft/microsoft-graph-types';\nimport { ApplicationException } from 'common/exceptions/application/ApplicationException';\nimport CONFIG from 'config';\nimport { CommunicationTemplate } from '../models/CommunicationTemplate';\nimport { Stakeholder } from '../models/Stakeholder';\nimport * as GraphApi from '../utils/graphApi';\nimport * as UserSettings from '../utils/user-settings';\nimport { ContactCustomFields } from './../models/ContactCustomFields';\n\nconst TAG = 'OCT3: ';\n\nexport async function createAutosaveContact(\n projectId: string,\n emailType: string,\n stakeholder: Stakeholder,\n communicationTemplate: CommunicationTemplate,\n firstSaveDate: Date\n) {\n console.log(TAG, 'Saving contact ', stakeholder.Email);\n\n const existingContact = await GraphApi.getContact(\n stakeholder.Email,\n CONFIG.contactGroupName\n );\n\n const contact: MicrosoftGraph.Contact = {\n givenName: stakeholder.FirstName,\n surname: stakeholder.LastName,\n emailAddresses: [\n {\n address: stakeholder.Email,\n name: stakeholder.FirstName + ' ' + stakeholder.LastName,\n },\n ],\n children: [],\n };\n\n // preserve ID of existing contact\n if (existingContact) contact.id = existingContact.id;\n\n const customFields = new ContactCustomFields();\n customFields.domainUrl = UserSettings.getDomain();\n customFields.clientId = UserSettings.getClientCode();\n customFields.projectId = projectId;\n customFields.emailType = emailType;\n customFields.stakeholder = stakeholder;\n customFields.communicationTemplate = communicationTemplate;\n customFields.lastSyncDate = firstSaveDate;\n customFields.startAutosaveDate = firstSaveDate;\n\n console.log(\n TAG,\n 'Domain and client for the contact ',\n customFields.domainUrl,\n customFields.clientId\n );\n\n // preserve startAutosaveDate of existing contact\n if (existingContact) {\n const existingCustomFields = getCustomFields(existingContact);\n customFields.startAutosaveDate = existingCustomFields.startAutosaveDate;\n }\n\n setCustomFields(contact, customFields);\n\n // TODO: do not update start save date!\n await GraphApi.createOrUpdateContact(contact, CONFIG.contactGroupName);\n console.log(TAG, 'Done saving contact');\n}\n\nexport function setCustomFields(\n contact: MicrosoftGraph.Contact,\n customFields: ContactCustomFields\n) {\n console.log(\n TAG,\n 'Setting contact fields ',\n contact.emailAddresses[0].address,\n customFields\n );\n\n contact.personalNotes = JSON.stringify(customFields);\n}\n\nexport function getCustomFields(\n contact: MicrosoftGraph.Contact\n): ContactCustomFields {\n const emailAddress = contact.emailAddresses[0].address;\n\n try {\n // deserialize to specific type\n const parsed = Object.assign(\n new ContactCustomFields(),\n JSON.parse(contact.personalNotes)\n ) as ContactCustomFields;\n\n if (!parsed.updateDate) {\n throw new ApplicationException('updateDate property not set');\n }\n\n console.log(TAG, 'Read contact fields for:', emailAddress, parsed);\n\n return parsed;\n } catch (error) {\n throw new ApplicationException(\n `Failed to parse custom fields for contact ${emailAddress}. Data: '${contact.personalNotes}'`,\n error\n );\n }\n}\n\nexport async function setLastSyncDate(\n contact: MicrosoftGraph.Contact,\n date: Date\n) {\n console.log(TAG, 'Setting last sync date to ', date);\n const customFields = getCustomFields(contact);\n if (customFields && customFields.lastSyncDate > date) {\n console.log(TAG, 'Setting last sync date: already greater than ', date);\n return;\n }\n customFields.lastSyncDate = date;\n setCustomFields(contact, customFields);\n await GraphApi.updateContact(contact);\n}\n","import { AddInFeatureNotSupportedException } from 'common/exceptions/application/AddInFeatureNotSupportedException';\nimport { ApiException } from 'common/exceptions/application/ApiException';\nimport { ApplicationException } from 'common/exceptions/application/ApplicationException';\nimport { ItemIsNotSavedException } from 'common/exceptions/application/ItemIsNotSavedException';\nimport { MeetingAlreadySavedException } from 'common/exceptions/application/MeetingAlreadySavedException';\nimport { Exception } from 'common/exceptions/Exception';\nimport { AuthException } from 'common/exceptions/http/AuthException';\nimport AuthInvalidGrantException from 'common/exceptions/http/AuthInvalidGrantException';\nimport { ConnectionException } from 'common/exceptions/http/ConnectionException';\nimport { ForbiddenException } from 'common/exceptions/http/ForbiddenException';\nimport { OutlookApiException } from 'common/exceptions/outlook/OutlookApiException';\nimport { OutlookException } from 'common/exceptions/outlook/OutlookException';\nimport { OutlookItemNotSupported } from 'common/exceptions/outlook/OutlookItemNotSupported';\nimport { OutlookWrongItemSelectedException } from 'common/exceptions/outlook/OutlookWrongItemSelectedException';\nimport * as Ui from '../utils/uiUtils';\n\nexport function errorHandler(error: Exception, friendlyMessage?: string) {\n console.log('Handling error ', friendlyMessage, error);\n\n friendlyMessage = friendlyMessage || '';\n const errorMessage = error && error.message ? error.message : '';\n const friendlyMessageWithColon = friendlyMessage\n ? friendlyMessage + ': '\n : '';\n const friendlyMessageWithErrorMessage =\n friendlyMessage && errorMessage\n ? friendlyMessageWithColon + errorMessage\n : friendlyMessage + errorMessage;\n\n // app exceptions that can occur during manual saving\n if (error instanceof ItemIsNotSavedException) {\n Ui.showInfoDialog(\n 'Please save this item in Outlook by either selecting File -> Save, or, for meetings, by sending invitations to attendees.' +\n ' If this item is already saved, please try again shortly.'\n );\n } else if (error instanceof MeetingAlreadySavedException) {\n Ui.showInfoDialog(\n 'The meeting has already been saved in the selected project.'\n );\n } else if (error instanceof OutlookItemNotSupported) {\n Ui.showInfoDialog('This outlook item is not supported');\n }\n // app exceptions that can occur during manual saving or autosaving\n else if (\n error instanceof AddInFeatureNotSupportedException ||\n error instanceof ApiException ||\n error instanceof ApplicationException\n ) {\n Ui.showErrorInForm(friendlyMessageWithErrorMessage, error);\n }\n\n // http exceptions\n else if (error instanceof ConnectionException) {\n Ui.showErrorInForm(\n 'Internet connection was interrupted. Please try again.',\n error\n );\n } else if (\n error instanceof AuthInvalidGrantException ||\n error instanceof AuthException\n ) {\n Ui.showAuthErrorDialog('Your session has expired please login again.');\n localStorage.clear();\n } else if (error instanceof ForbiddenException) {\n Ui.showErrorInForm(\n friendlyMessageWithColon +\n 'You do not have permission to perform this action',\n error\n );\n }\n\n // unknown Outlook exceptions\n else if (error instanceof OutlookApiException) {\n Ui.showErrorInForm(\n friendlyMessageWithColon +\n 'Outlook API error has occurred: ' +\n error.message,\n error\n );\n } else if (error instanceof OutlookException) {\n Ui.showErrorInForm(\n friendlyMessageWithColon + 'Outlook error has occurred: ' + error.message,\n error\n );\n } else if (error instanceof OutlookWrongItemSelectedException) {\n // see JSDoc for this class\n Ui.showErrorInForm(friendlyMessageWithColon + error.message, error);\n }\n\n // unexpected\n else {\n Ui.showErrorInForm(\n friendlyMessageWithColon +\n 'An unexpected error occurred. Please contact support.',\n error\n );\n }\n}\n","import * as MicrosoftGraph from '@microsoft/microsoft-graph-types';\nimport { SupportedOfficeItem } from 'common/utils/SupportedOfficeItem';\nimport { getAsyncCustomProperties } from 'common/utils/outlookAsyncUtils';\nimport CONFIG from 'config';\nimport * as GraphApi from '../utils/graphApi';\nimport * as OutlookAsyncUtils from '../utils/outlookAsyncUtils';\n\nconst TAG = 'ITP3: ';\n\nexport async function isItemSavedThroughApi(\n item: SupportedOfficeItem\n): Promise {\n if (CONFIG.allowToSaveMessageAgain) {\n return false;\n }\n\n console.log(TAG, `Checking if item \"${item.subject}\" is saved through API.`);\n\n const properties = await getAsyncCustomProperties(item);\n const isSaved = properties.get(`saved_in_${CONFIG.appPrefix}`);\n\n console.log(\n TAG,\n `Result of API save check for item \"${item.subject}\": ${isSaved}`\n );\n\n return isSaved === '1';\n}\n\nexport async function isItemSavedThroughGraph(message: MicrosoftGraph.Message) {\n if (CONFIG.allowToSaveMessageAgain) {\n return false;\n }\n\n console.log(TAG, 'Checking if item was saved through Graph API');\n\n const property = await GraphApi.getExtendedProperty(\n message,\n `saved_in_${CONFIG.appPrefix}`\n );\n\n console.log(\n TAG,\n 'Checking if item was saved through Graph API result',\n property\n );\n\n return property === '1';\n}\n\nexport async function markItemAsSavedThroughApi(item: SupportedOfficeItem) {\n if (CONFIG.allowToSaveMessageAgain) {\n return;\n }\n\n console.log(TAG, 'Marking item as saved through API');\n\n const properties = await OutlookAsyncUtils.getAsyncCustomProperties(item);\n properties.set(`saved_in_${CONFIG.appPrefix}`, '1');\n await OutlookAsyncUtils.saveAsyncCustomProperties(properties);\n}\n\nexport async function markItemAsSavedThroughGraph(\n message: MicrosoftGraph.Message\n) {\n if (CONFIG.allowToSaveMessageAgain) {\n return;\n }\n\n console.log(TAG, 'Marking item as saved through Graph API');\n\n await GraphApi.setExtendedProperty(\n message,\n `saved_in_${CONFIG.appPrefix}`,\n '1'\n );\n}\n","import $ from 'jquery';\nimport * as Api from '../utils/api';\nimport * as Ui from '../utils/uiUtils';\n\nexport async function refreshContactGroups() {\n $('#item-contact-group').val(null).trigger('change');\n const contactGroups = await Api.getContactGroups();\n Ui.renderOptions(contactGroups, '#item-contact-group', false);\n $('#selectBox').show();\n}\n\nexport async function refreshConfidentialities() {\n const confidentialities = await Api.getConfidentialities();\n Ui.renderOptions(confidentialities, '#item-confidential', true);\n}\n\nexport async function refreshUsers() {\n const users = await Api.getUsers();\n Ui.renderOptions(users, '#item-assigned-to', true);\n\n $('#item-communication').trigger('change');\n}\n\nexport async function refreshPriorities() {\n const priorities = await Api.getPriorities();\n Ui.renderOptions(priorities, '#complaint-priorities', true);\n\n $('#item-communication').trigger('change');\n}\n\nexport async function refreshComplaintStatuses() {\n const statuses = await Api.getStatuses();\n Ui.renderOptions(statuses, '#item-complaint-status', false);\n\n $('#item-communication').trigger('change');\n}\n\nexport async function refreshInteractionTypes() {\n const interactionTypes = await Api.getInteractionTypes();\n Ui.renderOptions(interactionTypes, '#item-interaction-type', false);\n}\n\nexport async function refreshInteractionTags() {\n const tags = await Api.getInteractionTags();\n Ui.renderOptions(tags, '#item-tag', false);\n}\n","import { ApplicationException } from 'common/exceptions/application/ApplicationException';\nimport { Attachment } from 'common/models/Attachment';\nimport { SentimentPhraseDTO } from 'common/models/SentimentPhraseDTO';\nimport { ValidateFileRequest } from 'common/models/ValidateFileRequest';\nimport CONFIG from 'config';\nimport $ from 'jquery';\nimport { AddInFeatureNotSupportedException } from '../exceptions/application/AddInFeatureNotSupportedException';\nimport { CommunicationTemplate } from '../models/CommunicationTemplate';\nimport { Complaint } from '../models/Complaint';\nimport { Interaction } from '../models/Interaction';\nimport { OutlookAttachmentResponseDTO } from '../models/OutlookAttachmentResponseDTO';\nimport { SupportedOfficeItem } from '../utils/SupportedOfficeItem';\nimport * as Api from '../utils/api';\nimport { getDiffInHours, toIsoWithTimeZone } from '../utils/dateUtils';\nimport * as OutlookAsyncUtils from '../utils/outlookAsyncUtils';\nimport { getAsyncBody } from '../utils/outlookAsyncUtils';\nimport * as OutlookItemUtils from '../utils/outlookItemUtils';\nimport * as Ui from '../utils/uiUtils';\nimport { getStringValueOrNull } from '../utils/uiUtils';\nimport * as UserSettings from '../utils/user-settings';\nimport { Stakeholder } from './../models/Stakeholder';\nimport * as AppContacts from './contacts';\nimport * as ItemProperties from './item-properties';\n\nconst TAG = 'APS3: ';\n\nexport async function saveMessage(item: SupportedOfficeItem) {\n console.log(TAG, new Date(), 'Start saveMessage');\n const checks = [ensureEmailSubjectIsNotExcluded(item)];\n // don't check appointments because they will be checked by UID while saving\n if (item.itemType !== 'appointment') {\n checks.push(ensureEmailIsNotDuplicate(item));\n }\n\n console.log(TAG, new Date(), 'Execute message checks');\n await Promise.all(checks);\n\n console.log(TAG, new Date(), 'Get shared properties');\n const sharedProperties = await OutlookAsyncUtils.getSharedProperties(item);\n\n console.log(TAG, new Date(), 'Get stakeholders from ui');\n const stakeholders = Ui.getStakeholdersFromUi();\n\n console.log(TAG, new Date(), 'Save stakeholders');\n const stakeholdersIds = await saveStakeholders(stakeholders);\n\n const emailType = $('#item-communication').val();\n\n let communication: Interaction | Complaint;\n if (emailType == 'Communication' || !emailType) {\n console.log(TAG, new Date(), 'Save interaction');\n communication = await saveInteraction(\n item,\n sharedProperties,\n stakeholdersIds\n );\n } else {\n console.log(TAG, new Date(), 'Save complaint');\n communication = await saveComplaint(\n item,\n sharedProperties,\n stakeholdersIds\n );\n\n $('#save-project').prop('selectedIndex', 0);\n }\n\n console.log(TAG, new Date(), 'Mark item as saved');\n await ItemProperties.markItemAsSavedThroughApi(item);\n\n console.log(TAG, new Date(), 'Track vitally Event');\n await Api.trackVitallyEvent({ eventName: 'used_email_plugin' });\n\n Ui.showSaveSuccessfulDialog();\n $('#selectBox').hide();\n\n if (UserSettings.getAutosave()) {\n console.log(TAG, new Date(), 'Get date from outlook item');\n const firstSaveDate = await OutlookItemUtils.getDateFromOutlookItem(item);\n\n console.log(TAG, new Date(), 'Save autosave contact');\n saveAutosaveContact(\n firstSaveDate,\n communication,\n emailType,\n stakeholders[0]\n );\n }\n\n console.log(TAG, new Date(), 'End saveMessage');\n}\n\nasync function ensureEmailIsNotDuplicate(item: SupportedOfficeItem) {\n if (CONFIG.allowToSaveMessageAgain) return;\n\n const response = await Api.findDuplicateEmail({\n Subject: await OutlookItemUtils.getSubjectFromOutlookItem(item),\n EmailAddresses: [\n item.from.emailAddress,\n ...item.to.map((to) => to.emailAddress),\n ],\n Message: await getAsyncBody(item.body),\n DateTime: toIsoWithTimeZone(\n await OutlookItemUtils.getDateFromOutlookItem(item)\n ),\n });\n\n if (response.IsMatchFound) {\n throw new ApplicationException(\n `Email was already saved in ${CONFIG.appName} as ${response.DocumentType}${response.DocumentID}`\n );\n }\n}\n\nasync function ensureEmailSubjectIsNotExcluded(item: SupportedOfficeItem) {\n const isExcluded = await Api.ensureEmailSubjectIsNotExcluded({\n Subject: await OutlookItemUtils.getSubjectFromOutlookItem(item),\n });\n if (isExcluded) {\n throw new ApplicationException(\n 'Email subject contains words that are in the exclusion list'\n );\n }\n}\n\nasync function saveStakeholders(stakeholders: Stakeholder[]) {\n const savingStakeholders = [];\n stakeholders.forEach(function (stakeholder) {\n savingStakeholders.push(createOrUpdateStakeholder(stakeholder));\n });\n\n const stakeholdersIds = await Promise.all(savingStakeholders);\n return stakeholdersIds;\n}\n\nexport async function saveInteraction(\n item: SupportedOfficeItem,\n sharedProperties: Office.SharedProperties | undefined,\n stakeholderIds: string[]\n) {\n console.log(TAG, 'Saving interaction', sharedProperties);\n\n // first, check if attachments are available and saved\n // so function would throw 'attachments not saved' error\n const attachmentsIds = await uploadAttachmentsIfSupported(\n item,\n sharedProperties\n );\n\n const interaction = await getInteractionFromUi(item, sharedProperties);\n\n if (CONFIG.isGraphApiEnabled && item.itemType === 'appointment') {\n const id = await OutlookItemUtils.getItemId(item, sharedProperties);\n\n const uids = await OutlookItemUtils.getAppointmentUids(\n id,\n sharedProperties\n );\n\n if (uids.itemType === 'seriesMaster') {\n throw new ApplicationException(\n 'Saving series of events is not supported. Please select a single event in series.'\n );\n }\n\n console.log(TAG, 'Retrieved Appointment UID: ', uids.uid);\n interaction.MeetingUID = uids.uid;\n interaction.MeetingRecurrenceID = uids.recurrenceId;\n }\n\n const interactionId = await Api.saveInteraction(interaction);\n\n await Api.linkInteractionToStakeholders(interactionId, stakeholderIds);\n if (attachmentsIds.length > 0) {\n await Api.linkInteractionToAttachments(interactionId, attachmentsIds);\n }\n\n await Api.trackVitallyEvent({ eventName: 'new_interaction_saved' });\n\n return interaction;\n}\n\nexport async function saveComplaint(\n item: SupportedOfficeItem,\n sharedProperties: Office.SharedProperties | undefined,\n stakeholderIds: string[]\n) {\n console.log(TAG, 'Saving complaint', sharedProperties);\n\n // first, check if attachments are available and saved\n // so function would throw 'attachments not saved' error\n const attachmentsIds = await uploadAttachmentsIfSupported(\n item,\n sharedProperties\n );\n\n const complaint = await getComplaintFromUi(item, sharedProperties);\n const interactionId = await Api.saveComplaint(complaint);\n\n await Api.linkComplaintToStakeholders(interactionId, stakeholderIds);\n if (attachmentsIds.length > 0) {\n await Api.linkComplaintToAttachments(interactionId, attachmentsIds);\n }\n\n await Api.trackVitallyEvent({ eventName: 'new_complaint_saved' });\n\n return complaint;\n}\n\nasync function saveAutosaveContact(\n firstSaveDate: Date,\n communication: Interaction | Complaint,\n emailType: string | number | string[],\n stakeholder: Stakeholder\n) {\n await AppContacts.createAutosaveContact(\n UserSettings.getProject(),\n emailType as string,\n stakeholder,\n communication as CommunicationTemplate,\n firstSaveDate\n );\n}\n\nasync function getInteractionFromUi(\n item: SupportedOfficeItem,\n sharedProperties: Office.SharedProperties | undefined\n) {\n const subject = await OutlookItemUtils.getSubjectFromOutlookItem(item);\n const location = await OutlookItemUtils.getLocationFromOutlookItem(item);\n const direction = OutlookItemUtils.getDirectionFromOutlookItem(\n item,\n sharedProperties\n );\n const dateTime = await OutlookItemUtils.getDateFromOutlookItem(item);\n const endDateTime = await OutlookItemUtils.getEndDateFromOutlookItem(item);\n const duration = getDiffInHours(endDateTime, dateTime);\n const body = await getAsyncBody(item.body);\n const confidentialValue = $('#item-confidential').val();\n\n let confidential = null;\n if (CONFIG.isConfidentialOptionsEnabled && confidentialValue) {\n confidential = { Value: confidentialValue };\n }\n\n let interactionType = null;\n const interactionTypeID = parseInt(\n getStringValueOrNull('#item-interaction-type')\n );\n if (interactionTypeID > 0) {\n interactionType = { Value: interactionTypeID };\n }\n\n const communicationDirection = await Api.getDirectionFromServer(direction);\n\n const interaction: Interaction = {\n Subject: subject,\n CommunicationDate: toIsoWithTimeZone(dateTime),\n Method: {\n Text: OutlookItemUtils.getInteractionMethodFromOutlookItem(item),\n },\n Direction: communicationDirection,\n Location: location,\n Message: body,\n Confidential: confidential || null,\n Duration: duration,\n InteractionType: interactionType,\n SentimentPhrases: $('#item-tag')\n .select2('data')\n ?.map((i) => {\n return {\n SentimentPhraseID: i.id,\n Phrase: i.text,\n } as SentimentPhraseDTO;\n }),\n AdditionalSharedProjectIDs: $('#save-project')\n .select2('data')\n ?.map((i) => i.id),\n };\n return interaction;\n}\n\nasync function getComplaintFromUi(\n item: SupportedOfficeItem,\n sharedProperties: Office.SharedProperties | undefined\n) {\n const subject = await OutlookItemUtils.getSubjectFromOutlookItem(item);\n const direction = OutlookItemUtils.getDirectionFromOutlookItem(\n item,\n sharedProperties\n );\n const dateTime = await OutlookItemUtils.getDateFromOutlookItem(item);\n const body = await getAsyncBody(item.body);\n\n const communicationDirection = await Api.getDirectionFromServer(direction);\n\n const confidentialValue = $('#item-confidential').val();\n const priorityValue = $('#complaint-priorities').val()\n ? $('#complaint-priorities').val()\n : '';\n const assignedTo = $('#item-assigned-to').val()\n ? $('#item-assigned-to').val()\n : '';\n const statusValue = $('#item-complaint-status').val()\n ? $('#item-complaint-status').val()\n : '';\n\n let confidential = null;\n if (CONFIG.isConfidentialOptionsEnabled && confidentialValue) {\n confidential = { Value: confidentialValue };\n }\n let priority = null;\n if (priorityValue) {\n priority = { Value: priorityValue.toString() };\n }\n let status = null;\n if (statusValue) {\n status = { Value: statusValue.toString() };\n }\n\n const complaint: Complaint = {\n Subject: subject,\n AssignedTo: {\n Value: assignedTo.toString(),\n },\n DateOpened: toIsoWithTimeZone(dateTime),\n Method: {\n Text: OutlookItemUtils.getInteractionMethodFromOutlookItem(item),\n },\n Direction: communicationDirection,\n Message: body,\n Priority: priority,\n Confidential: confidential,\n Status: status,\n InteractionType: null,\n SentimentPhrases: null,\n };\n\n return complaint;\n}\n\nasync function uploadAttachmentsIfSupported(\n item: SupportedOfficeItem,\n sharedProperties: Office.SharedProperties | undefined\n) {\n try {\n return await uploadAttachmentsForItem(item, sharedProperties);\n } catch (error) {\n if (error instanceof AddInFeatureNotSupportedException) {\n return [];\n } else {\n throw error;\n }\n }\n}\n\nexport async function uploadAttachmentsForItem(\n item: SupportedOfficeItem,\n sharedProperties: Office.SharedProperties | undefined\n) {\n if (!CONFIG.isAttachmentsEnabled) {\n console.log(TAG, 'Attachments are not enabled, skipping');\n return [];\n } else if (!OutlookItemUtils.canSaveAttachments()) {\n console.log(TAG, 'Attachments are not supported, skipping');\n return [];\n } else {\n console.log(TAG, 'Uploading attachments');\n }\n\n const attachments = await OutlookItemUtils.getSupportedAttachmentsForItem(\n item,\n sharedProperties\n );\n\n return await uploadAttachmentContent(attachments);\n}\n\nexport async function uploadAttachmentsForItemId(\n itemId: string,\n itemType: string,\n sharedProperties: Office.SharedProperties | undefined\n) {\n if (!CONFIG.isAttachmentsEnabled) {\n console.log(TAG, 'Attachments are not enabled, skipping');\n return [];\n } else {\n console.log(TAG, 'Uploading attachments');\n }\n\n const attachments = await OutlookItemUtils.getSupportedAttachmentsForItemId(\n itemId,\n itemType,\n sharedProperties\n );\n\n return await uploadAttachmentContent(attachments);\n}\n\nasync function uploadAttachmentContent(attachments: Attachment[]) {\n if (attachments.length === 0) {\n return [];\n }\n\n for (const attachment of [...attachments]) {\n const attachmentSize = attachment.size > 0 ? attachment.size / 1024 : 0;\n const request: ValidateFileRequest = {\n FileName: attachment.name,\n SizeKb: attachmentSize,\n };\n\n console.log(\n TAG,\n 'Validating attachment with Darzin API',\n attachment.name,\n attachment.size\n );\n\n const isValid = await Api.validateAttachment(request);\n if (!isValid) {\n const index = attachments.indexOf(attachment);\n attachments.splice(index, 1);\n console.log(TAG, 'Attachment is invalid');\n } else {\n console.log(TAG, 'Attachment is valid');\n }\n }\n\n const response = await Api.uploadOutlookAttachments({\n attachments: attachments.filter((a) => !a.isInline),\n });\n\n const responsesByAttachment: OutlookAttachmentResponseDTO[] =\n response.ResponsesByAttachment || [];\n\n const attachmentIds = responsesByAttachment\n .filter((a) => a.IsSuccess)\n .map((a) => a.FileID);\n\n return attachmentIds;\n}\n\nexport async function createOrUpdateStakeholder(stakeholder: Stakeholder) {\n let stakeholderId = await Api.findStakeholder(stakeholder);\n\n // if stakeholder already exists, assign his ID to request\n // so stakeholder with this ID will be updated\n if (stakeholderId != '0') {\n // eslint-disable-next-line require-atomic-updates\n stakeholder.ID = stakeholderId;\n await Api.mergeStakeholderInfo(stakeholder);\n } else {\n stakeholderId = await Api.saveStakeholder(stakeholder);\n }\n\n return stakeholderId;\n}\n","import { Exception } from '../Exception';\n\nexport class ApiException extends Exception {\n constructor(message: string) {\n super(message);\n }\n}\n","import { Exception } from '../Exception';\n\nexport class ApplicationException extends Exception {\n originalException: unknown;\n constructor(message: string, originalException?: unknown) {\n super(message, originalException);\n }\n}\n","import { Exception } from '../Exception';\nexport class ItemIsNotSavedException extends Exception {\n constructor() {\n super();\n }\n}\n","import { Exception } from '../Exception';\n\nexport class MeetingAlreadySavedException extends Exception {\n constructor() {\n super();\n }\n}\n","import { Exception } from '../Exception';\nexport class AuthException extends Exception {\n constructor(message: string) {\n super(message);\n }\n}\n","import { Exception } from '../Exception';\n\nexport default class AuthInvalidGrantException extends Exception {\n constructor(originalException: unknown) {\n const message = `OAuth invalid_grant: refresh token is probably expired`;\n super(message, originalException);\n }\n}\n","import { Exception } from '../Exception';\nexport class ConnectionException extends Exception {\n constructor(message: string) {\n super(message);\n }\n}\n","import { Exception } from '../Exception';\n\nexport class ForbiddenException extends Exception {\n constructor(message: string) {\n super(message);\n }\n}\n","import { Exception } from '../Exception';\n\nexport class InternalServerException extends Exception {\n constructor(originalException: unknown) {\n super(undefined, originalException);\n }\n}\n","import { Exception } from '../Exception';\n\nexport class UnknownHttpException extends Exception {\n constructor(originalException: unknown) {\n super(undefined, originalException);\n }\n}\n","import { Exception } from 'common/exceptions/Exception';\n\nexport class OutlookApiException extends Exception {\n apiResponse: unknown;\n constructor(message: string, apiResponse: unknown) {\n // Check if apiResponse is an object, has a statusCode property, and statusCode is -1\n if (\n apiResponse &&\n typeof apiResponse === 'object' &&\n 'statusCode' in apiResponse &&\n apiResponse.statusCode === -1\n ) {\n message = `${message}. This could be an issue with your network or with the Microsoft Graph API server.`;\n }\n\n super(message);\n this.apiResponse = apiResponse;\n }\n}\n","import { Exception } from '../Exception';\n\nexport class OutlookException extends Exception {\n constructor(message: string, error: Office.Error) {\n super(message, error);\n }\n}\n","import { Exception } from '../Exception';\nexport class OutlookItemNotSupported extends Exception {\n constructor() {\n super();\n }\n}\n","import { Exception } from '../Exception';\n\n/** An existing bug in Outlook Web can cause the Outlook server to respond with \"GenericResponseError\"\n * when user selects an appointment in his inbox after he selects a message,\n * and our app tries to perform any operation on the selected item\n * REF: https://github.com/OfficeDev/office-js/issues/1869 */\nexport class OutlookWrongItemSelectedException extends Exception {\n constructor(error: Office.Error) {\n const message =\n \"This error might occur when selected outlook item has changed to an item that isn't supported.\" +\n 'Please try to select a different item. If the issue persist, contact our support.';\n super(message, error);\n }\n}\n","/*\n * Copyright (c) Microsoft Corporation. All rights reserved. Licensed under the MIT license.\n * See LICENSE in the project root for license information.\n */\n\nimport CONFIG from 'config';\nimport 'core-js/stable';\nimport $ from 'jquery';\nimport { BehaviorSubject, Observable, from, merge, of } from 'rxjs';\nimport {\n catchError,\n concatMap,\n debounceTime,\n delay,\n filter,\n tap,\n} from 'rxjs/operators';\nimport 'select2';\nimport 'whatwg-fetch';\nimport * as Api from '../src/utils/api';\nimport * as App from './app/app';\nimport { errorHandler } from './app/errorHandler';\nimport * as AppOptions from './app/options';\nimport { ApplicationException } from './exceptions/application/ApplicationException';\nimport { LogRequest } from './models/LogsRequest';\nimport { MessageDetails } from './models/MessageDetails';\nimport { PermissionDialogResult } from './models/PermissionDialogResult';\nimport './scss/main.scss';\nimport * as Auth from './utils/authUtils';\nimport { loaderDetails$ } from './utils/loaderUtil';\nimport {\n addToExistingErrorLogs,\n addToExistingInfoLogs,\n clearErrorLogs,\n clearInfoLogs,\n errorLogsChange$,\n infoLogsChange$,\n} from './utils/logUtils';\nimport { Authenticator } from './utils/office-js-helpers/Authenticator';\nimport { sleep } from './utils/sleep';\nimport * as Ui from './utils/uiUtils';\nimport * as UserSettings from './utils/user-settings';\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\n(window as any).$ = (window as any).jQuery = $;\n\nconst TAG = 'IDX3: ';\n\nlet selectProjectIds = [];\nlet selectDomain = '';\nlet selectProject = '';\n/** handleProjectChanged is triggered by refreshDomains() in showStakeholdersForm().\n * because handleProjectChanged can take longer than showStakeholdersForm(),\n * showStakeholdersForm() might hide the loader before handleProjectChanged is finished.\n * this flag is to fix this\n */\nlet processingProjectChange = false;\nlet isProjectOptionsUpdated = false;\n\nOffice.initialize = handleOfficeInitialize;\nconst _triggerProjectChangeSubject = new BehaviorSubject(false);\n_triggerProjectChangeSubject.pipe(debounceTime(200)).subscribe((v) => {\n if (v) {\n $('#save-project').trigger('change');\n }\n});\n\nasync function handleOfficeInitialize() {\n registerLogSubscription();\n console.log(TAG, 'SSTK Outlook initializing...');\n if (Authenticator.isAuthDialog()) return;\n\n console.log(TAG, 'SSTK Outlook initializing authentication...');\n\n const version = 'Version 2022-05-10 13:41';\n\n console.log(TAG, `Version: ${version}`);\n\n if (CONFIG.enableDemoAPIRegion) {\n $('#version').html(version);\n $('#version').show();\n }\n\n $('#app-body').show();\n Ui.setAppName(CONFIG.appName);\n Ui.setFreeTrialUrl(CONFIG.freeTrialUrl);\n Ui.setIcon(CONFIG.appIcon, CONFIG.appIconWidth);\n Ui.setOptions(\n CONFIG.isComplaintsEnabled,\n CONFIG.isConfidentialOptionsEnabled\n );\n UserSettings.setAutosave(true);\n Ui.showRegions(CONFIG.regions);\n selectDomain = UserSettings.getDomain();\n\n $('#open-login-pg').click(handleSignInClick);\n\n // NOTE: asynchronous token checks should be performed after all events are hooked,\n // otherwise UI can be unresponsive and Permission Dialog can be messed up\n if (Auth.isTokenExpired()) {\n try {\n await Auth.refreshToken();\n } catch (error) {\n // no need to process this error because we'll check if token is valid in next function\n console.log(TAG, 'error refreshing token ', JSON.stringify(error));\n }\n }\n\n console.log(TAG, `Selected Outlook Item Changed initializing...`);\n\n await handleSelectedOutlookItemChanged();\n}\n\nOffice.onReady(function () {\n // Office is ready\n $(document).ready(function () {\n handleDocumentReady();\n });\n});\n\nfunction handleDocumentReady() {\n Office.context.mailbox.addHandlerAsync(\n Office.EventType.ItemChanged,\n handleSelectedOutlookItemChanged\n );\n\n $('#item-contact-group').select2({ width: 'style' });\n $('#item-interaction-type').select2({ width: 'style' });\n $('#item-tag').select2({ width: 'style' });\n $('#save-project').select2({\n multiple: true,\n placeholder: 'Select Project',\n width: 'style',\n });\n\n $('#logout').on('click', handleLogoutClick);\n $('#login-pop-close').click(handleLoginConfirmClick);\n $('#detail-pop-close, #detail-pop-close2').click(handleSaveCancelClick);\n // Detail Page Scripts\n $(document).on(\n 'change',\n '#select-individual-main',\n handleStakeholderTypeChange\n );\n $(document).on(\n 'change',\n '.cc-bcc-single-details select',\n handleAdditionalStakeholderTypeChanged\n );\n $('#save-email-detail').click(handleSaveClick);\n $('#save-email-detail2').click(handleSaveClick);\n $('#detail-save-pop-close').click(handleSavedDialogCloseClick);\n $('#detail-save-error-close').click(handleSessionExpiredDialogOkClick);\n $('#error__btn-ok').click(handleErrorDialogCloseClick);\n $('#error__btn-details').click(handleErrorDialogDetailsClick);\n $('#dialog-info-btn-ok').click(handleInfoDialogOkClick);\n $('#dialog-logout-success-btn-ok').click(handleLogoutSuccessDialogOkClick);\n $('#save-proj-group').on('change', handleProjectGroupChange);\n $('#save-domain').on('change', handleDomainChange);\n $('#save-project').on('change', handleProjectChanged);\n $('#item-assigned-to').on('change', handleItemAssignedToChange);\n $('#complaint-priorities').on('change', handleComplaintPriorityChange);\n $('input[name=\"AutoSave\"]').on('click', handleAutosaveOptionClick);\n $('#add-to-darzin').on('click', handleAutosaveOptionChosen);\n $('#item-communication').on('change', handleEmailTypeChange);\n $('#save-client').on('change', handleClientChange);\n $('#futureAllTooltip').on('click', handleFutureAllTooltipClick);\n}\n\nasync function handleSelectedOutlookItemChanged() {\n $('#loader').show();\n\n console.log(\n TAG,\n 'Selected Outlook Item Changed: ',\n Office.context.mailbox.item\n ? Office.context.mailbox.item.subject\n : 'undefined'\n );\n\n // Check if token still valid, if not then refresh the token.\n // This will prevent the subsequent endpoints from failing.\n // When the add-in is first initialising, the refresh is expected to fail because authentication will happen on the login page.\n if (!Auth.isTokenValid()) {\n try {\n await Auth.refreshToken();\n } catch (error) {\n console.log(TAG, 'error refreshing token ', JSON.stringify(error));\n }\n if (!Auth.isTokenValid()) {\n $('#loader').hide();\n Ui.hidePages();\n $('#welcome-pg').show();\n return;\n }\n }\n\n const item = Office.context.mailbox.item;\n $('#loader').show();\n Ui.hideSaveSuccessfulDialog();\n Ui.hidePages();\n console.log(TAG, 'Getting all the client list');\n await App.getClientList();\n console.log(TAG, 'Preparing for auto-sync of contacts');\n await App.startAutosaveTimer(item);\n console.log(TAG, 'Auto-sync of contacts has been completed');\n await App.tryStart(item);\n $('#loader').hide();\n}\n\nlet permissionDialog: Office.Dialog;\nfunction handleSignInClick() {\n const domainElement = $('#select-domain-login').val();\n\n if (!domainElement || !domainElement.toString()) return;\n\n console.log(TAG, 'Displaying permission dialog', domainElement);\n Office.context.ui.displayDialogAsync(\n CONFIG.urls.origin + 'permission-dialog.html',\n { height: 60, width: 40, promptBeforeOpen: false },\n onPermissionDialogLoad\n );\n}\n\nfunction onPermissionDialogLoad(\n asyncResult: Office.AsyncResult\n) {\n console.log(TAG, 'Permission dialog has loaded');\n try {\n if (asyncResult.error) {\n throw new ApplicationException(\n 'An error occurred in Permission Dialog',\n asyncResult.error\n );\n } else if (!asyncResult.value) {\n throw new ApplicationException(\n 'An error occurred in Permission Dialog: invalid reference to the dialog',\n asyncResult.error\n );\n } else {\n permissionDialog = asyncResult.value;\n permissionDialog.addEventHandler(\n Office.EventType.DialogMessageReceived,\n onPermissionDialogResult\n );\n }\n } catch (error) {\n errorHandler(error, 'Failed to load permission dialog');\n }\n}\n\nasync function onPermissionDialogResult(arg) {\n console.log(TAG, 'Processing Permission Dialog result', arg);\n try {\n permissionDialog.close();\n // wait for dialog.close to be processed, otherwise sign-in dialog wouldn't open\n await sleep(500);\n const permissionDialogResult = JSON.parse(\n arg.message\n ) as PermissionDialogResult;\n\n if (permissionDialogResult.permissionGranted) {\n handleSignInPermissionAllowedClick();\n }\n } catch (error) {\n errorHandler(error, 'Failed to process permission dialog result');\n }\n}\n\nasync function handleSignInPermissionAllowedClick() {\n console.log(TAG, 'Permissions were granted to the app, signing in...');\n $('#loader').show();\n try {\n $('#open-login-pg-error').html('');\n\n selectDomain = $('#select-domain-login').val().toString();\n // remove extra '/': it might cause request errors in some browsers? not confirmed\n selectDomain += '/';\n if (selectDomain.endsWith('/')) {\n selectDomain = selectDomain.slice(0, selectDomain.length - 1);\n }\n console.log(TAG, 'Setting domain ', selectDomain);\n UserSettings.setDomain(selectDomain);\n\n if (!selectDomain) {\n $('#select-domain-login-error').html('Please Select Region');\n $('#select-domain-login').focus();\n return;\n }\n\n // REF: https://github.com/OfficeDev/office-js-helpers#authentication\n const authenticator = new Authenticator({\n baseUrl: selectDomain,\n authorizeUrl: '/authorize',\n clientId: CONFIG.auth.client_id,\n redirectUrl: CONFIG.urls.form,\n scope: 'openid',\n responseType: 'code',\n extraQueryParameters: {\n login_hint: Office.context.mailbox.userProfile.emailAddress,\n },\n });\n\n const response = await authenticator.authenticate();\n await Auth.getToken(selectDomain, response.code);\n\n await Auth.refreshClientCode();\n\n // because token can't be refreshed if project isn't selected,\n // we'll select first available project and refresh token for it\n const projectId = await App.selectAnyProjectId();\n if (projectId) {\n UserSettings.setProject(projectId);\n await Auth.refreshToken();\n }\n } catch (error) {\n if (error.innerError == '12006') {\n console.log(TAG, 'Dialog was closed');\n } else {\n errorHandler(error, 'Authorization failed');\n }\n $('#loader').hide();\n return;\n }\n\n await handleSelectedOutlookItemChanged();\n $('#loader').hide();\n}\n\nfunction handleLoginConfirmClick() {\n $('#login-pop').hide();\n $('#login-page').hide();\n $('#detail-page').show();\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nasync function handleAutosaveOptionClick(e: any) {\n UserSettings.setAutosave(e.target.value === 'auto_save');\n await handleAutosaveOptionChosen();\n}\n\nasync function handleAutosaveOptionChosen() {\n $('#detail-page').hide();\n $('#detail-final').show();\n\n $('#loader').show();\n\n // Check if token still valid, if not then refresh the token.\n // This will prevent the subsequent endpoints from failing.\n if (!Auth.isTokenValid()) {\n await Auth.refreshToken();\n }\n\n // this will trigger handleProjectChanged,\n // which will refresh project options\n try {\n await App.refreshClients();\n } catch (error) {\n errorHandler(error, `Failed to refresh client's domain list`);\n }\n\n // if domains or project groups are disabled, handleProjectChanged() will not be triggered by refreshDomains()\n // trigger it here so project options and token will be updated\n if (!isProjectOptionsUpdated) {\n _triggerProjectChangeSubject.next(true);\n }\n const item = Office.context.mailbox.item;\n if (item) {\n await App.showStakeholdersForm(item);\n }\n if (!processingProjectChange) {\n $('#loader').hide();\n }\n}\n\nasync function handleClientChange(event) {\n // deselect because otherwise will interfere with mouse wheel scroll\n $('#save-client').blur();\n\n const clientId = event.target.value;\n\n $('#loader').show();\n\n try {\n UserSettings.setClientCode(\n App.clients.find((c) => c.ClientID == clientId)?.Name\n );\n\n // Check if token still valid, if not then refresh the token.\n // This will prevent the subsequent endpoints from failing.\n if (!Auth.isTokenValid()) {\n await Auth.refreshToken();\n }\n\n await App.refreshDomains(clientId);\n } catch (error) {\n errorHandler(error, 'Failed to get domain options');\n }\n\n $('#loader').hide();\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction handleDomainChange(event: any) {\n const domainId = event.target.value;\n const selectedDomain = App.domains.find(function (domain) {\n return domain.ID == domainId;\n });\n if (selectedDomain) {\n $('#save-proj-group').html('');\n $('#save-project').html('');\n if (App.projectGroupAvailable) {\n $('#ProjectGroupContainer').show();\n let projectGroupOption = '';\n const singleProjectGroup = selectedDomain.ProjectGroups.length === 1;\n\n for (let j = 0; j < selectedDomain.ProjectGroups.length; j++) {\n const group = selectedDomain.ProjectGroups[j];\n // skip groups without accessible projects\n if (!group.Projects || !group.Projects.length) continue;\n projectGroupOption +=\n '';\n }\n $('#save-proj-group')\n .select2({\n multiple: true,\n placeholder: 'Select Project Group',\n })\n .html(projectGroupOption);\n // if there is only one group, select it.\n if (singleProjectGroup) {\n $('#save-proj-group').trigger('change');\n } else {\n // if there are multiple groups, prompt user to select project\n const emptyProjectOption =\n '';\n $('#save-project').html(emptyProjectOption);\n }\n } else {\n $('#ProjectGroupContainer').hide();\n let projectOption = '';\n const singleProject = selectedDomain.Projects.length === 1;\n for (let j = 0; j < selectedDomain.Projects.length; j++) {\n const dataProject = selectedDomain.Projects[j];\n projectOption +=\n '';\n }\n $('#save-project').html(projectOption);\n if (singleProject) {\n _triggerProjectChangeSubject.next(true);\n }\n }\n }\n}\n\nasync function handleProjectChanged(event) {\n // deselect because otherwise will interfere with mouse wheel scroll\n $('#save-project').blur();\n\n const formSelectedProjectIds = $(event.target)\n .select2('data')\n ?.map((i) => i.id);\n\n formSelectedProjectIds.forEach((id) => {\n if (id && !selectProjectIds.includes(id)) {\n selectProjectIds.push(id);\n }\n });\n\n selectProjectIds = selectProjectIds.filter((id) =>\n formSelectedProjectIds.includes(id)\n );\n\n // if no project is selected, we can't refresh tokens\n // if (CONFIG.appName === 'Darzin')\n if (!selectProjectIds || selectProjectIds.length == 0) return;\n\n processingProjectChange = true;\n\n $('#loader').show();\n\n const firstProject = selectProjectIds[0];\n if (selectProject != firstProject) {\n selectProject = firstProject;\n\n UserSettings.setProject(firstProject);\n\n try {\n await Auth.refreshToken();\n\n const optionPromises = [AppOptions.refreshContactGroups()];\n if (CONFIG.isConfidentialOptionsEnabled) {\n optionPromises.push(AppOptions.refreshConfidentialities());\n optionPromises.push(AppOptions.refreshUsers());\n optionPromises.push(AppOptions.refreshPriorities());\n optionPromises.push(AppOptions.refreshComplaintStatuses());\n }\n optionPromises.push(AppOptions.refreshInteractionTypes());\n optionPromises.push(AppOptions.refreshInteractionTags());\n await Promise.all(optionPromises);\n $('#item-interaction-type').val('1').trigger('change');\n } catch (error) {\n errorHandler(error, 'Failed to get project options');\n }\n }\n $('#project-error').html('');\n $('#loader').hide();\n processingProjectChange = false;\n isProjectOptionsUpdated = true;\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction handleProjectGroupChange(event: any) {\n $('#loader').show();\n $('#project-group-error').html('');\n let projectOption = '';\n const values = $(event.target)\n .select2('data')\n .map((i) => i.id);\n let defaultProject = null;\n App.domains.forEach(function (domain) {\n const selectedProjectGroups = domain.ProjectGroups.filter(function (\n projectGroup\n ) {\n return values.includes(projectGroup.ID);\n });\n if (selectedProjectGroups) {\n if (\n selectedProjectGroups.length == 1 &&\n selectedProjectGroups[0].Projects.length === 1\n ) {\n defaultProject = selectedProjectGroups[0].Projects[0].ID;\n }\n selectedProjectGroups.forEach(function (pg) {\n pg.Projects.forEach(function (project) {\n projectOption +=\n '';\n });\n });\n }\n });\n $('#loader').hide();\n $('#save-project').html(projectOption);\n $('#save-project').val(defaultProject);\n if (defaultProject) {\n _triggerProjectChangeSubject.next(true);\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction handleEmailTypeChange(e: any) {\n if (e.target.value == 'Communication') {\n $('.communication-method').show();\n $('.item-assigned-to-main').hide();\n $('.complaint-priorities-main').hide();\n $('.complaint-statuses-main').hide();\n } else {\n // $('.communication-method').hide()\n $('.item-assigned-to-main').show();\n $('#item-assigned-to-error').html('');\n $('#complaint-priorities-error').html('');\n if ($('#complaint-priorities').html()) {\n $('.complaint-priorities-main').show();\n $('.complaint-statuses-main').show();\n } else {\n $('.complaint-priorities-main').hide();\n $('.complaint-statuses-main').hide();\n }\n }\n}\n\nfunction handleItemAssignedToChange() {\n $('#item-assigned-to-error').html('');\n}\n\nfunction handleComplaintPriorityChange() {\n $('#complaint-priorities-error').html('');\n}\n\nfunction handleStakeholderTypeChange() {\n if ($(this).find(':selected').val() == 'Individual') {\n $('#select-individual-main-detail').show();\n $('#item-org2').parent().parent('.form-group').hide();\n } else {\n $('#select-individual-main-detail').hide();\n $('#item-org2').parent().parent('.form-group').show();\n }\n}\n\nfunction handleAdditionalStakeholderTypeChanged() {\n const pTable = $(this).parent().parent().parent().parent(); // prettier-ignore\n if ($(this).find(':selected').val() == 'Individual') {\n pTable.find('.table-indi-fields').show();\n pTable.find('.table-org-fields').hide();\n } else {\n pTable.find('.table-indi-fields').hide();\n pTable.find('.table-org-fields').show();\n }\n}\n\nasync function handleSaveClick() {\n if (!Ui.checkSaveForm()) {\n return;\n }\n\n const item = Office.context.mailbox.item;\n if (item) {\n $('#loader').show();\n\n // Check if token still valid, if not then refresh the token.\n // This will prevent the subsequent endpoints from failing.\n if (!Auth.isTokenValid()) {\n await Auth.refreshToken();\n }\n\n await App.trySaveMessage(item);\n $('#loader').hide();\n }\n}\n\nfunction handleSaveCancelClick() {\n $('#detail-final').hide();\n $('#detail-page').show();\n}\n\nfunction handleLogoutClick() {\n App.logout();\n}\n\nfunction handleErrorDialogCloseClick() {\n $('#error-dialog').hide();\n}\n\nfunction handleErrorDialogDetailsClick() {\n $('#error__message-details').show();\n $('#error__btn-details').hide();\n}\n\nfunction handleInfoDialogOkClick() {\n Ui.hideInfoDialog();\n}\n\nfunction handleLogoutSuccessDialogOkClick() {\n $('#loader').show(); // will be reset to hidden after window reloaded\n $('#dialog-logout-success').hide();\n window.location.reload();\n}\n\nasync function handleSavedDialogCloseClick() {\n Ui.hideSaveSuccessfulDialog();\n Ui.hideDocumentDetailsPage();\n\n await handleSelectedOutlookItemChanged();\n}\n\nfunction handleSessionExpiredDialogOkClick() {\n $('#loader').show(); // will be reset to hidden after window reloaded\n $('#detail-save-error').hide();\n window.location.reload();\n}\n\nfunction handleFutureAllTooltipClick() {\n Ui.showInfoDialog($(this).attr('title'));\n}\n\nfunction registerLogSubscription(): void {\n const handleLogs = (\n logChange$: Observable,\n saveLogs: (request: LogRequest) => Promise,\n clearLogs: () => void,\n addToExistingLogs: (logs: string[]) => void\n ) => {\n return logChange$.pipe(\n debounceTime(2000),\n filter((request) => !!request),\n tap(() => clearLogs()),\n concatMap((request) => {\n return from(saveLogs(request)).pipe(\n catchError(() => {\n addToExistingLogs(request.Logs);\n return of('error');\n })\n );\n }),\n catchError(() => of('error'))\n );\n };\n\n const infoLogs$ = handleLogs(\n infoLogsChange$,\n Api.LogInfo,\n clearInfoLogs,\n addToExistingInfoLogs\n );\n\n const errorLogs$ = handleLogs(\n errorLogsChange$,\n Api.LogError,\n clearErrorLogs,\n addToExistingErrorLogs\n );\n\n const showInfoInLoader$ = loaderDetails$.pipe(\n concatMap((log) => {\n // Return a new Observable that delays updating the loaderDetails\n return of(log).pipe(\n delay(25), // Adjust delay as needed\n tap((log) => {\n const loaderDetails = $('#loader .loader-details');\n const loaderReminder = $('#loader .loader-reminder');\n if (typeof log === 'string' || !log) {\n loaderDetails.html((log as string) || 'Loading');\n loaderReminder.html('');\n } else if (typeof log === 'object') {\n const msg = log as MessageDetails;\n loaderDetails.html(msg.text);\n loaderReminder.html(msg.secondaryText);\n }\n })\n );\n })\n );\n\n merge(infoLogs$, errorLogs$, showInfoInLoader$).subscribe();\n}\n","import { SelectListItem } from './SelectListItem';\nimport { SentimentPhraseDTO } from './SentimentPhraseDTO';\n\nexport class CommunicationTemplate {\n Confidential: { Value: string } = null;\n AssignedTo: { Value: string } = null;\n Priority: { Value: string } = null;\n Status: { Value: string } = null;\n InteractionType: SelectListItem = null;\n SentimentPhrases: SentimentPhraseDTO[] = null;\n AdditionalSharedProjectIDs?: string[] = null;\n}\n","import { toIsoWithTimeZone } from './../utils/dateUtils';\nimport { CommunicationTemplate } from './CommunicationTemplate';\nimport { Stakeholder } from './Stakeholder';\nexport class ContactCustomFields {\n private template: CommunicationTemplate;\n\n clientId: string;\n domainUrl: string;\n projectId: string;\n emailType: string;\n stakeholder: Stakeholder;\n startDate: string;\n updateDate: string;\n\n get startAutosaveDate() {\n return this.startDate ? new Date(this.startDate) : new Date('2000-01-01');\n }\n\n set startAutosaveDate(value: Date) {\n this.startDate = toIsoWithTimeZone(value);\n }\n\n get lastSyncDate() {\n return new Date(this.updateDate);\n }\n\n set lastSyncDate(value: Date) {\n this.updateDate = toIsoWithTimeZone(value);\n }\n\n get communicationTemplate() {\n return this.template;\n }\n\n set communicationTemplate(template: CommunicationTemplate) {\n const cleanTemplate = new CommunicationTemplate();\n\n for (const key in cleanTemplate) {\n // eslint-disable-next-line no-prototype-builtins\n if (!cleanTemplate.hasOwnProperty(key) || !template[key]) continue;\n cleanTemplate[key] = template[key];\n }\n\n this.template = cleanTemplate;\n }\n}\n","import { ApiException } from 'common/exceptions/application/ApiException';\nimport { MeetingAlreadySavedException } from 'common/exceptions/application/MeetingAlreadySavedException';\nimport { EnsureEmailSubjectIsNotExcludedRequest } from 'common/models/EnsureEmailSubjectIsNotExcludedRequest';\nimport { EnsureEmailSubjectIsNotExcludedResponse } from 'common/models/EnsureEmailSubjectIsNotExcludedResponse';\nimport { FindDuplicateEmailOrMeetingResponse } from 'common/models/FindDuplicateEmailOrMeetingResponse';\nimport { FindDuplicateEmailRequest } from 'common/models/FindDuplicateEmailRequest';\nimport { FindDuplicateMeetingRequest } from 'common/models/FindDuplicateMeetingRequest';\nimport { GetClientCodeResponse } from 'common/models/GetClientCodeResponse';\nimport { GetClientListResponse } from 'common/models/GetClientListResponse';\nimport { GetLookupResponse } from 'common/models/GetLookupResponse';\nimport { LogRequest } from 'common/models/LogsRequest';\nimport { UploadOutlookAttachmentResponse } from 'common/models/UploadOutlookAttachmentResponse';\nimport { ValidateFileRequest } from 'common/models/ValidateFileRequest';\nimport { VitallyTrackDTO } from 'common/models/VitallyTrackDTO';\nimport { Complaint } from '../models/Complaint';\nimport { GetDomainListResponse } from '../models/GetDomainListResponse';\nimport { Interaction } from '../models/Interaction';\nimport { LinkEntitiesRequest } from '../models/LinkEntitiesRequest';\nimport { Option } from '../models/Option';\nimport { SaveCommunicationResponse } from '../models/SaveInteractionResponse';\nimport { Stakeholder } from '../models/Stakeholder';\nimport { UploadOutlookAttachmentRequest } from '../models/UploadOutlookAttachmentRequest';\nimport { ApiResponse } from './../models/ApiResponse';\nimport { SaveEntityApiResponse } from './../models/SaveEntityApiResponse';\nimport * as Http from './http';\nimport * as UserSettings from './user-settings';\n\nconst TAG = 'API3: ';\n\nexport async function getDirectionFromServer(outlookItemDirection: string) {\n const response = await Http.get(\n UserSettings.getDomain() + '/common/directions'\n );\n\n const localizedDirections = response as [];\n\n const serverDirection = localizedDirections.find(\n (d: Option) => d.Text === outlookItemDirection\n );\n\n const direction = serverDirection || {\n Value: outlookItemDirection,\n };\n\n return direction;\n}\n\nexport async function ensureEmailSubjectIsNotExcluded(\n request: EnsureEmailSubjectIsNotExcludedRequest\n) {\n console.log(TAG, 'Checking if subject is in exclusion list', request);\n const response = (await Http.post(\n UserSettings.getDomain() +\n '/email-plugin-exclusion/ensure-email-subject-is-not-excluded',\n request\n )) as EnsureEmailSubjectIsNotExcludedResponse;\n\n if (!response.Success) {\n throw new ApiException(\n 'Failed to check if subject is in exclusion list: ' + response.Message\n );\n }\n\n return response.IsSubjectExcluded;\n}\n\nexport async function findDuplicateEmail(request: FindDuplicateEmailRequest) {\n console.log(TAG, 'Searching for duplicate email', request);\n const response = (await Http.post(\n UserSettings.getDomain() + '/email-duplicate-check/find-duplicate-email',\n request\n )) as FindDuplicateEmailOrMeetingResponse;\n\n if (!response.Success) {\n throw new ApiException(\n 'Failed to search for duplicate email: ' + response.Message\n );\n }\n\n return response;\n}\n\nexport async function findDuplicateMeeting(\n request: FindDuplicateMeetingRequest\n) {\n console.log(TAG, 'Searching for duplicate meeting', request);\n const response = (await Http.post(\n UserSettings.getDomain() +\n '/meeting-duplicate-check/find-duplicate-meeting',\n request\n )) as FindDuplicateEmailOrMeetingResponse;\n\n if (!response.Success) {\n throw new ApiException(\n 'Failed to search for duplicate meeting: ' + response.Message\n );\n }\n\n return response;\n}\n\nexport async function saveInteraction(interaction: Interaction) {\n console.log(TAG, 'Saving interaction ', interaction);\n const response = await Http.post(\n UserSettings.getDomain() + '/interaction/save',\n interaction\n );\n\n if (!response.Success) {\n if (response.ErrorCode === 'MeetingWithSameUidsAlreadyExists') {\n throw new MeetingAlreadySavedException();\n }\n throw new ApiException('Failed to save interaction: ' + response.Message);\n }\n\n return response.EntityID;\n}\n\nexport async function saveComplaint(complaint: Complaint) {\n console.log(TAG, 'Saving complaint ', complaint);\n const response = await Http.post(\n UserSettings.getDomain() + '/complaint/save',\n complaint\n );\n\n if (!response.Success)\n throw new ApiException('Failed to save complaint: ' + response.Message);\n\n return response.EntityID;\n}\n\nexport async function linkInteractionToStakeholders(\n interactionId: string,\n stackHolderIds: string[]\n) {\n const request: LinkEntitiesRequest = {\n LinkEntityType: 'InteractionToStakeholder',\n LinkID: interactionId,\n ToIDs: stackHolderIds,\n LinkPropertyAndStakholder: true,\n };\n await linkEntities(request);\n}\n\nexport async function linkComplaintToStakeholders(\n complaintId: string,\n stackHolderIds: string[]\n) {\n const request: LinkEntitiesRequest = {\n LinkEntityType: 'ComplaintToStakeholder',\n LinkID: complaintId,\n ToIDs: stackHolderIds,\n LinkPropertyAndStakholder: true,\n };\n await linkEntities(request);\n}\n\nexport async function linkInteractionToAttachments(\n interactionId: string,\n attachmentIds: string[]\n) {\n const request: LinkEntitiesRequest = {\n LinkEntityType: 'InteractionToFile',\n LinkID: interactionId,\n ToIDs: attachmentIds,\n LinkPropertyAndStakholder: true,\n };\n await linkEntities(request);\n}\n\nexport async function linkComplaintToAttachments(\n interactionId: string,\n attachmentIds: string[]\n) {\n const request: LinkEntitiesRequest = {\n LinkEntityType: 'ComplaintToFile',\n LinkID: interactionId,\n ToIDs: attachmentIds,\n LinkPropertyAndStakholder: true,\n };\n await linkEntities(request);\n}\n\nexport async function linkEntities(request: LinkEntitiesRequest) {\n const response = await Http.post(\n UserSettings.getDomain() + '/link/linkentity',\n request\n );\n if (!response.Success)\n throw new ApiException(\n `Failed to link entities of type ${request.LinkEntityType}: ` +\n response.Message\n );\n}\n\nexport async function validateAttachment(request: ValidateFileRequest) {\n const response = await Http.post(\n UserSettings.getDomain() + '/file-v2/validate-file',\n request\n );\n\n if (!response.Success) {\n const fileInvalid =\n (response.Message as string).toLowerCase().indexOf('file is invalid') !==\n -1;\n if (fileInvalid) {\n return false;\n } else {\n throw new ApiException(\n 'Failed to validate attachment: ' + response.Message\n );\n }\n }\n\n return true;\n}\n\nexport async function uploadOutlookAttachments(\n request: UploadOutlookAttachmentRequest\n) {\n const response = await Http.post(\n UserSettings.getDomain() + '/file-v2/upload-outlook-attachment',\n request\n );\n\n if (!response.Success) {\n throw new ApiException(\n 'Failed to process upload attachment response: ' + response.Message\n );\n }\n const responsesByAttachment = response.ResponsesByAttachment || [];\n const failedAttachments = responsesByAttachment\n .filter((a) => !a.IsSuccess)\n .map((a) => a.FileName);\n\n if (failedAttachments.length > 0) {\n const message =\n 'Failed to upload File(s): ' + failedAttachments.join(', ') + +' \\r\\n';\n JSON.stringify(response);\n throw new ApiException(message);\n }\n\n return response;\n}\n\nexport async function getContactGroups() {\n return await getOptions('/common/contactgroups');\n}\n\nexport async function getConfidentialities() {\n return await getOptions('/common/confidentialities');\n}\n\nexport async function getStatuses() {\n return await getOptions('/common/actionandcomplaintstatus');\n}\n\nexport async function getUsers() {\n return await getOptions('/common/users');\n}\n\nexport async function getInteractionTypes() {\n return await getOptions('/common/interaction-types');\n}\n\nexport async function getInteractionTags() {\n const response = await Http.get(\n UserSettings.getDomain() + '/tags/Interaction',\n true\n );\n\n if (!response.Success) {\n return [];\n }\n return response.Values.map((i) => {\n return { Text: i.Text, Value: i.Id.toString() } as Option;\n });\n}\n\nexport async function getPriorities() {\n return await getOptions('/common/priorities');\n}\n\nasync function getOptions(url: string) {\n const response = await Http.get(UserSettings.getDomain() + url, true);\n if (!Array.isArray(response)) {\n return [];\n }\n return response as Option[];\n}\n\nexport async function getClientCode() {\n const response = await Http.get(\n UserSettings.getDomain() + '/Domain/ClientCode',\n false\n );\n if (!response.Success || !response.ClientCode) {\n throw new ApiException('Failed to get client code: ' + response.Message);\n }\n return response.ClientCode;\n}\n\nexport async function getDomainList(clientID: number) {\n console.log(\n TAG,\n 'Requesting domain list ',\n UserSettings.getDomain(),\n UserSettings.getDomain() + `/domain/list/${clientID}`\n );\n const response = await Http.get(\n UserSettings.getDomain() + `/domain/list/${clientID}`,\n true\n );\n\n return response;\n}\n\nexport async function getClientList() {\n console.log(\n TAG,\n 'Requesting client list ',\n UserSettings.getDomain(),\n UserSettings.getDomain() + '/client/list'\n );\n const response = await Http.get(\n UserSettings.getDomain() + '/client/list',\n true\n );\n\n return response;\n}\n\nexport async function findStakeholder(stakeholder: Stakeholder) {\n let checkUrl = UserSettings.getDomain() + '/stakeholder/find?';\n if (stakeholder.FirstName != '') {\n checkUrl = checkUrl + 'firstName=' + stakeholder.FirstName + '&';\n }\n if (stakeholder.LastName != '') {\n checkUrl = checkUrl + 'lastName=' + stakeholder.LastName + '&';\n }\n checkUrl = checkUrl + 'email=' + stakeholder.Email;\n checkUrl = checkUrl + '&stakeholderType=' + stakeholder.StakeholderType;\n\n const response = await Http.get(checkUrl);\n\n if (response instanceof Object) {\n throw new ApiException(\n `Failed to search for stakeholder ${stakeholder.Email}: ` +\n response.Message\n );\n }\n\n return response as string;\n}\n\nexport async function saveStakeholder(stakeholder: Stakeholder) {\n const response = await Http.post(\n UserSettings.getDomain() + '/stakeholder/save',\n stakeholder\n );\n\n if (!response.Success) {\n throw new ApiException(\n `Failed to save stakeholder ${stakeholder.Email}: ` + response.Message\n );\n }\n\n return response.EntityID;\n}\n\nexport async function mergeStakeholderInfo(stakeholder: Stakeholder) {\n const response = await Http.post(\n UserSettings.getDomain() + '/stakeholder/mergeInfo',\n stakeholder\n );\n\n if (!response.Success) {\n throw new ApiException(\n `Failed to save stakeholder ${stakeholder.Email}: ` + response.Message\n );\n }\n return response.EntityID;\n}\n\nexport async function trackVitallyEvent(dto: VitallyTrackDTO) {\n // Placeholder function as Vitally is no longer used in SSTK.\n // Can be updated later to use Mixpanel or Amplitude.\n return Promise.resolve(true);\n}\n\nexport async function LogInfo(dto: LogRequest) {\n const success = await Http.post(UserSettings.getDomain() + '/log/info', dto);\n\n return success;\n}\n\nexport async function LogError(dto: LogRequest) {\n const success = await Http.post(UserSettings.getDomain() + '/log/error', dto);\n\n return success;\n}\n","import CONFIG from 'config';\nimport * as Api from './api';\nimport * as Http from './http';\nimport { sleep } from './sleep';\nimport * as UserSettings from './user-settings';\n\nconst TAG = 'AUT3: ';\n\nlet isRefreshingToken = false;\n\nexport function isTokenValid(): boolean {\n return UserSettings.getToken() && !isTokenExpired();\n}\n\nexport function isTokenExpired(): boolean {\n if (!UserSettings.getToken()) {\n return false;\n }\n\n const currentTime = new Date();\n const tokenExpiry = new Date(UserSettings.getTokenExpire());\n const isExpired = !(currentTime < tokenExpiry);\n console.log(\n TAG,\n `Current Time: ${JSON.stringify(\n currentTime\n )}, Token Expiry Date: ${JSON.stringify(\n tokenExpiry\n )}, Token Expired: ${isExpired}`\n );\n\n return isExpired;\n}\n\nexport async function getToken(domain: string, code: string) {\n console.log(TAG, 'Retrieving token');\n\n const payload = {\n grant_type: 'authorization_code',\n client_id: CONFIG.auth.client_id,\n client_secret: CONFIG.auth.client_secret,\n code: code,\n redirect_uri: CONFIG.urls.form,\n };\n\n const response = await Http.postForm(domain + '/token', payload);\n\n console.log(TAG, 'Token retrieved ');\n\n UserSettings.setTokenExpire(response['.expires']);\n UserSettings.setToken(response['access_token']);\n UserSettings.setRefreshToken(response['refresh_token']);\n}\n\nexport async function refreshToken() {\n console.log(TAG, 'Refreshing token for project ', UserSettings.getProject());\n\n while (isRefreshingToken) {\n console.log(TAG, 'Token refresh is in progress, waiting');\n await sleep(100);\n }\n\n isRefreshingToken = true;\n try {\n const payload = {\n grant_type: 'refresh_token',\n client_id: CONFIG.auth.client_id,\n client_secret: CONFIG.auth.client_secret,\n refresh_token: UserSettings.getRefreshToken(),\n redirect_uri: CONFIG.urls.form,\n };\n\n if (UserSettings.getProject()) {\n payload['ProjectIDs'] = UserSettings.getProject();\n }\n\n const response = await Http.postForm(\n UserSettings.getDomain() + '/token',\n payload\n );\n\n console.log(TAG, 'Token refreshed ');\n\n UserSettings.setTokenExpire(response['.expires']);\n UserSettings.setToken(response['access_token']);\n UserSettings.setRefreshToken(response['refresh_token']);\n } finally {\n isRefreshingToken = false;\n }\n}\n\n/** Retrieves client code and saves it to UserSettings */\nexport async function refreshClientCode() {\n try {\n const clientCode = await Api.getClientCode();\n console.log(TAG, 'Client code ', clientCode);\n UserSettings.setClientCode(clientCode);\n } catch (error) {\n console.log(TAG, 'Failed to retrieve client code. Not supported?', error);\n }\n}\n","/* global Office */\nimport { OutlookItemNotSupported } from 'common/exceptions/outlook/OutlookItemNotSupported';\nimport { AddInStakeholder } from '../models/AddInStakeholder';\nimport { SupportedOfficeItem } from './SupportedOfficeItem';\nimport { getAsyncOrganizer, getAsyncRecipients } from './outlookAsyncUtils';\nimport { getUserEmail, isAppointmentReadMode } from './outlookItemUtils';\n\nexport function getAllPartiesFromMessage(\n outlookItem: Office.MessageRead,\n includeCc = true\n) {\n let addresses: Office.EmailAddressDetails[] = [];\n\n const message = outlookItem as Office.MessageRead;\n if (outlookItem.from.emailAddress) {\n addresses.push(outlookItem.from);\n }\n addresses.push(...message.to);\n\n if (includeCc) {\n addresses.push(...message.cc);\n }\n\n // TODO: in read mode there is no bcc?\n //if (outlookItem.bcc) {\n //addresses.push(...await getRecipients(outlookItem.bcc));\n //}\n\n addresses = removeDuplicatesByEmail(addresses);\n return addresses;\n}\n\nexport async function getAllPartiesFromAppointment(\n appointment: Office.AppointmentRead & Office.AppointmentCompose\n) {\n let addresses: Office.EmailAddressDetails[] = [];\n\n if (isAppointmentReadMode(appointment)) {\n const appointmentRead = appointment as Office.AppointmentRead;\n\n addresses.push(...appointmentRead.requiredAttendees);\n addresses.push(...appointmentRead.optionalAttendees);\n } else {\n const appointmentCompose = appointment as Office.AppointmentCompose;\n\n addresses.push(\n ...(await getAsyncRecipients(appointmentCompose.requiredAttendees))\n );\n addresses.push(\n ...(await getAsyncRecipients(appointmentCompose.optionalAttendees))\n );\n\n // On Outlook desktop, all Appointments to which user didn't add any attendees,\n // will still have appointment organizer in required attendees list.\n // On Outlook Online it isn't the case, and newly created Appointment will not have any attendees.\n // We'll solve this by adding the organizer ourselves.\n if (addresses.length === 0 && appointmentCompose.organizer) {\n const organizer = await getAsyncOrganizer(appointmentCompose.organizer);\n addresses.push(organizer);\n }\n }\n\n addresses = removeDuplicatesByEmail(addresses);\n return addresses;\n}\n\nexport async function getPrimaryStakeholders(\n item: SupportedOfficeItem,\n sharedProperties: Office.SharedProperties | undefined\n): Promise {\n const primaryStakeholders: AddInStakeholder[] = [];\n\n if (item.itemType === 'message') {\n const all = await getAllStakeholders(item, sharedProperties);\n if (all) primaryStakeholders.push(all[0]);\n } else if (item.itemType === 'appointment') {\n const all = await getAllParties(item);\n primaryStakeholders.push(...all);\n } else {\n throw new OutlookItemNotSupported();\n }\n\n if (!primaryStakeholders) {\n primaryStakeholders.push({\n email: 'No stakeholders',\n fullName: 'No stakeholders',\n ...getFirstAndLastName(''),\n });\n }\n\n return primaryStakeholders;\n}\n\nexport async function getAdditionalStakeholders(\n officeItem: Office.MessageRead &\n Office.AppointmentRead &\n Office.AppointmentCompose,\n sharedProperties: Office.SharedProperties | undefined\n) {\n if (officeItem.itemType === 'appointment') {\n return [];\n }\n const stakeholders = await getAllStakeholders(officeItem, sharedProperties);\n return stakeholders.slice(1);\n}\n\nexport async function getAllStakeholders(\n officeItem: Office.MessageRead &\n Office.AppointmentRead &\n Office.AppointmentCompose,\n sharedProperties: Office.SharedProperties | undefined,\n includeCc = true\n) {\n const userEmail = getUserEmail(sharedProperties);\n\n let parties = await getAllParties(officeItem, includeCc);\n if (parties.length > 1) {\n parties = parties.filter(\n (a) => a.email?.toLowerCase() !== userEmail?.toLowerCase()\n );\n }\n return parties;\n}\n\nasync function getAllParties(\n officeItem: Office.MessageRead &\n Office.AppointmentRead &\n Office.AppointmentCompose,\n includeCc = true\n) {\n let addresses: Office.EmailAddressDetails[];\n if (officeItem.itemType === 'message')\n addresses = getAllPartiesFromMessage(\n officeItem as Office.MessageRead,\n includeCc\n );\n else if (officeItem.itemType === 'appointment')\n addresses = await getAllPartiesFromAppointment(\n officeItem as Office.AppointmentRead & Office.AppointmentCompose\n );\n else {\n throw new OutlookItemNotSupported();\n }\n\n const parties = addresses.map((a) => {\n return {\n email: a.emailAddress,\n fullName: a.displayName,\n ...getFirstAndLastName(a.displayName),\n };\n });\n return parties;\n}\n\nfunction getFirstAndLastName(displayName: string) {\n //display name split code\n // var str=item.from.displayName\n let firstName = '';\n let lastName = '';\n if (displayName.split(' ').length > 1) {\n const index = displayName.indexOf(' '); // Gets the first index where a space occurs\n firstName = displayName.substr(0, index); // Gets the first part\n lastName = displayName.substr(index + 1); // Gets the text part\n } else {\n firstName = displayName;\n lastName = '';\n }\n return { firstName: firstName, lastName: lastName };\n}\n\nfunction removeDuplicatesByEmail(addresses: Office.EmailAddressDetails[]) {\n addresses.forEach((a, i) => {\n const duplicates = addresses.filter(\n (d) => d.emailAddress === a.emailAddress && d != a\n );\n if (duplicates.length > 0) addresses.splice(i, 1);\n });\n return addresses;\n}\n","export function toIsoWithTimeZone(date: Date) {\n const tzo = -date.getTimezoneOffset(),\n dif = tzo >= 0 ? '+' : '-',\n pad = function (num: number) {\n const norm = Math.floor(Math.abs(num));\n return (norm < 10 ? '0' : '') + norm;\n };\n return (\n date.getFullYear() +\n '-' +\n pad(date.getMonth() + 1) +\n '-' +\n pad(date.getDate()) +\n 'T' +\n pad(date.getHours()) +\n ':' +\n pad(date.getMinutes()) +\n ':' +\n pad(date.getSeconds()) +\n dif +\n pad(tzo / 60) +\n ':' +\n pad(tzo % 60)\n );\n}\n\nexport function getDiffInHours(dateA: Date, dateB: Date) {\n if (!dateA || !dateB) return null;\n const diffInMs = Math.abs(\n (dateA as unknown as number) - (dateB as unknown as number)\n );\n\n const diffInHours = diffInMs / 1000 / 60 / 60;\n\n return diffInHours;\n}\n\nexport function getDiffInMinutes(dateA: Date, dateB: Date) {\n if (!dateA || !dateB) return null;\n const diffInMs = Math.abs(\n (dateA as unknown as number) - (dateB as unknown as number)\n );\n\n const diffInHours = diffInMs / 1000 / 60;\n\n return diffInHours;\n}\n","import {\r\n Client,\r\n ClientOptions,\r\n GraphError,\r\n GraphRequest,\r\n PageIterator,\r\n} from '@microsoft/microsoft-graph-client';\r\nimport * as MicrosoftGraph from '@microsoft/microsoft-graph-types';\r\nimport { ItemIsNotSavedException } from 'common/exceptions/application/ItemIsNotSavedException';\r\nimport { OutlookApiException } from 'common/exceptions/outlook/OutlookApiException';\r\nimport { OutlookItemNotSupported } from 'common/exceptions/outlook/OutlookItemNotSupported';\r\nimport { AppointmentUids } from 'common/models/AppointmentUids';\r\nimport { GraphCollection } from 'common/models/graph/GraphCollection';\r\nimport CONFIG from 'config';\r\nimport { StatusCodes } from 'http-status-codes';\r\nimport { GraphAuthenticationProvider } from './graphAuthUtils';\r\nimport { getItemRestId } from './outlookItemUtils';\r\n\r\nconst TAG = 'GRA1: ';\r\n\r\nconst extendedPropertiesPropertyId = `String {00020329-0000-0000-C000-000000000046} Name cecp-${CONFIG.appId}`;\r\n\r\nconst expandExtendedProperties = `singleValueExtendedProperties($filter=id eq '${extendedPropertiesPropertyId}')`;\r\n\r\nconst contactFoldersCache = new Map();\r\n\r\nfunction filterExtendedProperties(propertyValue?: string): string {\r\n return (\r\n `singleValueExtendedProperties/Any(` +\r\n `ep: ep/id eq '${extendedPropertiesPropertyId}'` +\r\n (propertyValue !== undefined\r\n ? ` and contains(ep/value, '${propertyValue}')`\r\n : '') +\r\n `)`\r\n );\r\n}\r\n\r\nconst client = Client.initWithMiddleware({\r\n authProvider: new GraphAuthenticationProvider(),\r\n});\r\n\r\nexport async function getOrCreateContactGroup(name: string) {\r\n let group = await getContactGroup(name);\r\n if (!group) {\r\n if (contactFoldersCache.has(name)) {\r\n group = contactFoldersCache.get(name);\r\n } else {\r\n group = await createContactGroup(name);\r\n if (group) {\r\n contactFoldersCache.set(name, group);\r\n }\r\n }\r\n }\r\n return group;\r\n}\r\n\r\nasync function createContactGroup(name: string) {\r\n console.log(TAG, 'Creating contact group ', name);\r\n\r\n try {\r\n const response: MicrosoftGraph.ContactFolder = await client\r\n .api('/me/contactFolders')\r\n .post({ displayName: name });\r\n\r\n console.log(TAG, 'Created contact group ', response);\r\n\r\n return response;\r\n } catch (error) {\r\n throw new OutlookApiException(\r\n 'Failed to create contact group with Graph API ',\r\n error\r\n );\r\n }\r\n}\r\n\r\nasync function getContactGroup(name: string) {\r\n console.log(TAG, 'Getting contact group ', name);\r\n try {\r\n const response: GraphCollection = await client\r\n .api('/me/contactFolders')\r\n .get();\r\n\r\n const groups: MicrosoftGraph.ContactFolder[] = [];\r\n\r\n const iterator = new PageIterator(\r\n client,\r\n response,\r\n (group: MicrosoftGraph.ContactFolder) => {\r\n groups.push(group);\r\n return true;\r\n }\r\n );\r\n\r\n await iterator.iterate();\r\n\r\n console.log(TAG, 'Contact groups ', groups);\r\n\r\n const group = groups.find((g) => g.displayName === name);\r\n console.log(TAG, 'Contact group is ', group);\r\n return group;\r\n } catch (error) {\r\n throw new OutlookApiException(\r\n 'Failed to get contact groups from Graph API ',\r\n error\r\n );\r\n }\r\n}\r\n\r\nexport async function getContacts(groupId: string) {\r\n try {\r\n const response: GraphCollection = await client\r\n .api(`/me/contactFolders/${groupId}/contacts`)\r\n .get();\r\n\r\n const contacts: MicrosoftGraph.Contact[] = [];\r\n\r\n const iterator = new PageIterator(\r\n client,\r\n response,\r\n (contact: MicrosoftGraph.Contact) => {\r\n contacts.push(contact);\r\n return true;\r\n }\r\n );\r\n\r\n await iterator.iterate();\r\n\r\n return contacts;\r\n } catch (error) {\r\n throw new OutlookApiException(\r\n 'Failed to get contacts from Graph API ',\r\n error\r\n );\r\n }\r\n}\r\n\r\nexport async function getContact(email: string, contactGroupName: string) {\r\n const group = await getOrCreateContactGroup(contactGroupName);\r\n const contacts = await getContacts(group.id);\r\n\r\n email = email.toLowerCase();\r\n\r\n const existingContact = contacts.find(\r\n (c) => c.emailAddresses?.[0]?.address?.toLowerCase() === email\r\n );\r\n\r\n return existingContact;\r\n}\r\n\r\nexport async function createOrUpdateContact(\r\n contact: MicrosoftGraph.Contact,\r\n contactGroupName: string\r\n) {\r\n const group = await getOrCreateContactGroup(contactGroupName);\r\n const existingContact = await getContact(\r\n contact.emailAddresses[0].address,\r\n contactGroupName\r\n );\r\n\r\n if (!existingContact) {\r\n await createContact(group.id, contact);\r\n } else {\r\n contact.id = existingContact.id;\r\n await updateContact(contact);\r\n }\r\n}\r\n\r\nexport async function updateContact(contact: MicrosoftGraph.Contact) {\r\n console.log(TAG, 'Updating contact ', contact.emailAddresses[0].address);\r\n\r\n try {\r\n await client.api(`/me/contacts/${contact.id}`).patch(contact);\r\n } catch (error) {\r\n throw new OutlookApiException(\r\n 'Failed to update contact with Graph API ',\r\n error\r\n );\r\n }\r\n}\r\n\r\nasync function createContact(\r\n contactGroupId: string,\r\n contact: MicrosoftGraph.Contact\r\n) {\r\n console.log(TAG, 'Creating contact ', contact.emailAddresses[0].address);\r\n\r\n try {\r\n await client\r\n .api(`/me/contactFolders/${contactGroupId}/contacts`)\r\n .post(contact);\r\n } catch (error) {\r\n throw new OutlookApiException(\r\n 'Failed to create contact with Graph API ',\r\n error\r\n );\r\n }\r\n}\r\n\r\nexport async function deleteContactGroup(contactGroupName: string) {\r\n console.log(TAG, 'Deleting contacts from ', contactGroupName);\r\n const group = await getContactGroup(contactGroupName);\r\n if (!group) return;\r\n\r\n const contacts = await getContacts(group.id);\r\n for (const c of contacts) {\r\n await deleteContact(c.id);\r\n }\r\n}\r\n\r\nexport async function deleteContact(contactId: string) {\r\n console.log(TAG, 'Deleting contact ', contactId);\r\n\r\n try {\r\n await client.api(`/me/contacts/${contactId}`).delete();\r\n } catch (error) {\r\n throw new OutlookApiException(\r\n 'Failed to delete contact with Graph API ',\r\n error\r\n );\r\n }\r\n}\r\n\r\nexport async function getMessages(addressesToDates: Map) {\r\n if (!addressesToDates.size) return [];\r\n const inbox = await getMessagesFromFolder('inbox', addressesToDates);\r\n const sent = await getMessagesFromFolder('sentItems', addressesToDates);\r\n\r\n let allMessages = [...inbox, ...sent];\r\n\r\n allMessages = allMessages.filter((m, i) => {\r\n return allMessages.findIndex((m2) => m2.id === m.id) === i;\r\n });\r\n\r\n return allMessages;\r\n}\r\n\r\nasync function getMessagesFromFolder(\r\n folder: 'inbox' | 'sentItems',\r\n addressesToDates: Map\r\n) {\r\n const requests: GraphRequest[] = [];\r\n\r\n const path = `/me/mailFolders/${folder}/messages`;\r\n\r\n const extrasLength =\r\n (client['config'] as ClientOptions).baseUrl.length +\r\n path.length +\r\n '?search=\"\"'.length +\r\n '&$top=200'.length +\r\n 134;\r\n\r\n let fullSearchExpression = '';\r\n addressesToDates.forEach((lastSyncDate: Date, address: string) => {\r\n const currentExpression =\r\n `((from:${address} OR to:${address}) AND ` +\r\n `(received>=${lastSyncDate.toISOString()} OR sent>=${lastSyncDate.toISOString()}))`;\r\n\r\n const combinedExpression = encodeURIComponent(\r\n `\"${fullSearchExpression}${currentExpression}\"`\r\n );\r\n\r\n // if full length of URL exceeds OData request length the limit\r\n // (with subtracted length for $skipToken for next page requests),\r\n // then add the URL without that expression to the request queue\r\n // and reset the current expression\r\n if (combinedExpression.length >= 2047 - extrasLength) {\r\n const request = client\r\n .api(path)\r\n .search(`\"${fullSearchExpression}\"`)\r\n .top(200);\r\n\r\n requests.push(request);\r\n fullSearchExpression = currentExpression;\r\n } else {\r\n // if there is already something in the search expression, add 'OR'\r\n if (fullSearchExpression) {\r\n fullSearchExpression += ' OR ' + currentExpression;\r\n } else {\r\n fullSearchExpression = currentExpression;\r\n }\r\n }\r\n });\r\n\r\n const request = client.api(path).search(`\"${fullSearchExpression}\"`).top(200);\r\n\r\n requests.push(request);\r\n\r\n const allMessages: MicrosoftGraph.Message[] = [];\r\n for (const request of requests) {\r\n const messages = await getAllPagedMessages(request);\r\n allMessages.push(...messages);\r\n }\r\n\r\n return allMessages;\r\n}\r\n\r\n/**\r\n * Makes requests for all pages and combines them into one array\r\n */\r\nasync function getAllPagedMessages(\r\n request: GraphRequest\r\n): Promise {\r\n const messages: MicrosoftGraph.Message[] = [];\r\n console.log(TAG, 'Making request for messages: ', request);\r\n\r\n const response: GraphCollection = await request.get();\r\n\r\n const iterator = new PageIterator(\r\n client,\r\n response,\r\n (message: MicrosoftGraph.Message) => {\r\n messages.push(message);\r\n return true;\r\n }\r\n );\r\n\r\n try {\r\n await iterator.iterate();\r\n } catch (error: unknown) {\r\n throw new OutlookApiException(\r\n 'Failed to get messages from Graph API',\r\n error\r\n );\r\n }\r\n\r\n return messages;\r\n}\r\n\r\nexport async function getEvent(\r\n itemId: string,\r\n sharedProperties: Office.SharedProperties | undefined\r\n): Promise {\r\n try {\r\n const response: MicrosoftGraph.Event = await client\r\n .api(\r\n `/${getUserGraphUrlSegment(sharedProperties)}/events/${getItemRestId(\r\n itemId\r\n )}`\r\n )\r\n .get();\r\n\r\n return response;\r\n } catch (error) {\r\n throw new OutlookApiException('Failed to get event from Graph API', error);\r\n }\r\n}\r\n\r\n/**\r\n * Note: The returned {@link AppointmentUids.recurrenceId} property will be different between this method and any legacy EWS ID\r\n * for the same event.\r\n */\r\nexport async function getAppointmentUids(\r\n itemId: string,\r\n sharedProperties: Office.SharedProperties | undefined\r\n): Promise {\r\n try {\r\n const event = await getEvent(itemId, sharedProperties);\r\n\r\n if (event.type === 'occurrence') {\r\n const seriesMaster = await getEvent(\r\n event.seriesMasterId,\r\n sharedProperties\r\n );\r\n\r\n return {\r\n uid: seriesMaster.iCalUId,\r\n recurrenceId: event.iCalUId,\r\n itemType: event.type,\r\n };\r\n }\r\n\r\n return {\r\n uid: event.iCalUId,\r\n recurrenceId: null,\r\n itemType: event.type,\r\n };\r\n } catch (error: unknown) {\r\n if (\r\n error instanceof OutlookApiException &&\r\n (error.apiResponse as GraphError).statusCode === StatusCodes.NOT_FOUND\r\n ) {\r\n console.log(TAG, 'Appointment not found: not saved?');\r\n // this occurs when we were able get item id from the Exchange Server,\r\n // but the since user hasn't yet saved the draft item,\r\n // Exchange Server is still refusing to acknowledge existence of the item with this id\r\n throw new ItemIsNotSavedException();\r\n }\r\n\r\n throw new OutlookApiException(\r\n 'Failed to get appointment Uid from Graph API',\r\n error\r\n );\r\n }\r\n}\r\n\r\n/** Searches all Appointments by custom property value. Returns ID of first Appointment with this property */\r\nexport async function getFirstEventIdByCustomProperty(\r\n propertyValue: string,\r\n sharedProperties: Office.SharedProperties | undefined\r\n) {\r\n try {\r\n const response: GraphCollection = await client\r\n .api(`${getUserGraphUrlSegment(sharedProperties)}/events`)\r\n .filter(filterExtendedProperties(propertyValue))\r\n .expand(expandExtendedProperties)\r\n .get();\r\n\r\n const events = response.value;\r\n\r\n if (!events || events.length === 0) {\r\n return null;\r\n }\r\n\r\n return events[0].id;\r\n } catch (error) {\r\n throw new OutlookApiException(\r\n 'Failed to get events by custom property from Graph API',\r\n error\r\n );\r\n }\r\n}\r\n\r\nexport async function getAttachments(\r\n itemId: string,\r\n itemType: string,\r\n sharedProperties: Office.SharedProperties | undefined\r\n) {\r\n const restItemId = getItemRestId(itemId);\r\n\r\n const userSegment = getUserGraphUrlSegment(sharedProperties);\r\n\r\n let request: GraphRequest;\r\n if (itemType === 'message') {\r\n request = client.api(`/${userSegment}/messages/${restItemId}/attachments`);\r\n } else if (itemType === 'appointment') {\r\n request = client.api(`/${userSegment}/events/${restItemId}/attachments`);\r\n } else {\r\n throw new OutlookItemNotSupported();\r\n }\r\n\r\n console.log(TAG, 'Getting attachments from', request);\r\n\r\n const response: GraphCollection =\r\n await request.get();\r\n\r\n return response.value;\r\n}\r\n\r\nexport async function getExtendedProperty(\r\n message: MicrosoftGraph.Message,\r\n propertyName: string\r\n) {\r\n const appExtendedProperties = await getAppExtendedProperties(message);\r\n if (!appExtendedProperties) return undefined;\r\n const propertyValue = appExtendedProperties[propertyName];\r\n return propertyValue;\r\n}\r\n\r\nasync function getAppExtendedProperties(message: MicrosoftGraph.Message) {\r\n try {\r\n const response: MicrosoftGraph.Message = await client\r\n .api(`/me/messages/${message.id}`)\r\n .expand(expandExtendedProperties)\r\n .get();\r\n\r\n const appExtendedProperties = response.singleValueExtendedProperties?.find(\r\n (prop) => prop.id === extendedPropertiesPropertyId\r\n );\r\n\r\n if (appExtendedProperties) {\r\n return >JSON.parse(appExtendedProperties.value);\r\n }\r\n\r\n return undefined;\r\n } catch (error) {\r\n throw new OutlookApiException(\r\n 'Failed to get extended properties from Graph API: ' + error.message,\r\n error\r\n );\r\n }\r\n}\r\n\r\nexport async function setExtendedProperty(\r\n message: MicrosoftGraph.Message,\r\n propertyName: string,\r\n propertyValue: string\r\n) {\r\n try {\r\n let currentProperties = await getAppExtendedProperties(message);\r\n\r\n if (!currentProperties) currentProperties = {};\r\n currentProperties[propertyName] = propertyValue;\r\n\r\n const json = JSON.stringify(currentProperties);\r\n\r\n const newMessage: MicrosoftGraph.Message = {\r\n singleValueExtendedProperties: [\r\n {\r\n id: extendedPropertiesPropertyId,\r\n value: json,\r\n },\r\n ],\r\n };\r\n\r\n await client.api(`/me/messages/${message.id}`).patch(newMessage);\r\n } catch (error) {\r\n throw new OutlookApiException(\r\n 'Failed to set extended property with Graph API: ' + error.message,\r\n error\r\n );\r\n }\r\n}\r\n\r\nexport function getUserGraphUrlSegment(\r\n sharedProperties: Office.SharedProperties | undefined\r\n) {\r\n return sharedProperties ? `/users/${sharedProperties.targetMailbox}` : '/me';\r\n}\r\n","import * as MicrosoftGraph from '@microsoft/microsoft-graph-types';\r\nimport { getUserEmail } from './outlookItemUtils';\r\n\r\nexport function getDirectionForGraphItem(item: MicrosoftGraph.Message) {\r\n const userEmail = getUserEmail(undefined);\r\n const senderEmail = item.from.emailAddress.address;\r\n\r\n return senderEmail?.toLowerCase() === userEmail?.toLowerCase() ? 'OUT' : 'IN';\r\n}\r\n","import { AuthException } from 'common/exceptions/http/AuthException';\nimport AuthInvalidGrantException from 'common/exceptions/http/AuthInvalidGrantException';\nimport { ConnectionException } from 'common/exceptions/http/ConnectionException';\nimport { ForbiddenException } from 'common/exceptions/http/ForbiddenException';\nimport { InternalServerException } from 'common/exceptions/http/InternalServerException';\nimport { UnknownHttpException } from 'common/exceptions/http/UnknownHttpException';\nimport { StatusCodes } from 'http-status-codes';\nimport $ from 'jquery';\nimport * as UserSettings from './user-settings';\n\nexport function post(url: string, body: unknown, cache = false) {\n return new Promise(function (resolve, reject) {\n $.ajax({\n url: url,\n cache: cache,\n type: 'post',\n headers: {\n Authorization: 'bearer ' + UserSettings.getToken(),\n 'Content-Type': 'application/json',\n },\n data: JSON.stringify(body),\n\n success: function (response) {\n resolve(response as T);\n },\n error: function (err) {\n const processedError = processError(err);\n reject(processedError);\n },\n });\n });\n}\n\nexport function postForm(url: string, body: unknown) {\n return new Promise(function (resolve, reject) {\n $.ajax({\n url: url,\n type: 'post',\n headers: { 'Content-Type': 'application/x-www-form-urlencoded' },\n data: body,\n\n success: function (response) {\n resolve(response as T);\n },\n error: function (err) {\n const processedError = processError(err);\n reject(processedError);\n },\n });\n });\n}\n\nexport function get(url: string, cache = false) {\n return new Promise(function (resolve, reject) {\n $.ajax({\n url: url,\n type: 'get',\n cache: cache,\n headers: {\n Authorization: 'bearer ' + UserSettings.getToken(),\n },\n success: function (response) {\n resolve(response as T);\n },\n error: function (err) {\n const processedError = processError(err);\n reject(processedError);\n },\n });\n });\n}\n\nfunction processError(httpError: JQuery.jqXHR) {\n if (httpError.status === 0) {\n return new ConnectionException(httpError.responseJSON);\n }\n if (httpError.status === StatusCodes.UNAUTHORIZED) {\n return new AuthException(httpError.responseJSON);\n }\n if (httpError.status === StatusCodes.FORBIDDEN) {\n return new ForbiddenException(httpError.responseJSON);\n }\n if (httpError.status === StatusCodes.INTERNAL_SERVER_ERROR) {\n return new InternalServerException(httpError);\n }\n if (\n httpError.status == StatusCodes.BAD_REQUEST &&\n httpError.responseText &&\n httpError.responseText.includes('invalid_grant')\n ) {\n return new AuthInvalidGrantException(httpError);\n }\n\n return new UnknownHttpException(httpError);\n}\n","import { MessageDetails } from 'common/models/MessageDetails';\r\nimport { BehaviorSubject } from 'rxjs';\r\n\r\nexport const loaderDetails$ = new BehaviorSubject(\r\n null\r\n);\r\n\r\nexport function addToLoaderDetails(log: MessageDetails | string) {\r\n loaderDetails$.next(log);\r\n}\r\n","import { LogRequest } from 'common/models/LogsRequest';\r\nimport { BehaviorSubject } from 'rxjs';\r\n\r\n// Arrays to store logs\r\nlet infoLogs: string[] = [];\r\nlet errorLogs: string[] = [];\r\n\r\nexport const infoLogsChange$ = new BehaviorSubject(null);\r\nexport const errorLogsChange$ = new BehaviorSubject(null);\r\n\r\n// Save the original functions\r\nconst originalLog = console.log;\r\nconst originalInfo = console.info;\r\nconst originalError = console.error;\r\n\r\ntype LogFunction = typeof console.log;\r\n\r\n// Override console.info with a custom function\r\nconsole.info = function (...args: unknown[]) {\r\n const logs = getLogsByArguments(args, originalInfo);\r\n\r\n infoLogs.push(logs.join(' '));\r\n infoLogsChange$.next(createLogRequest(infoLogs));\r\n};\r\n\r\n// Override console.log with a custom function\r\nconsole.log = function (...args: unknown[]) {\r\n const logs = getLogsByArguments(args, originalLog);\r\n\r\n infoLogs.push(logs.join(' '));\r\n infoLogsChange$.next(createLogRequest(infoLogs));\r\n};\r\n\r\n// Override console.log with a custom function\r\nconsole.error = function (...args: unknown[]) {\r\n const logs = getLogsByArguments(args, originalError);\r\n\r\n errorLogs.push(logs.join(' '));\r\n errorLogsChange$.next(createLogRequest(errorLogs));\r\n};\r\n\r\nfunction getLogsByArguments(\r\n argumentsParam: unknown[],\r\n originalConsole: LogFunction\r\n): unknown[] {\r\n const logArguments = Array.from(argumentsParam);\r\n\r\n // Call the original function to output to console\r\n originalConsole.apply(console, logArguments);\r\n\r\n return logArguments.map((arg) =>\r\n typeof arg === 'object' ? JSON.stringify(arg) : arg\r\n );\r\n}\r\n\r\nexport function createLogRequest(logs: string[]): LogRequest {\r\n return {\r\n Logs: logs,\r\n };\r\n}\r\n\r\nexport function clearInfoLogs(): void {\r\n infoLogs = [];\r\n}\r\n\r\nexport function clearErrorLogs(): void {\r\n errorLogs = [];\r\n}\r\n\r\nexport function addToExistingInfoLogs(logs: string[]): void {\r\n infoLogs = [...logs, ...infoLogs];\r\n}\r\n\r\nexport function addToExistingErrorLogs(logs: string[]): void {\r\n errorLogs = [...logs, ...errorLogs];\r\n}\r\n","// Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.\n\nimport { Exception } from 'common/exceptions/Exception';\nimport { Dialog } from './dialog';\nimport { getLoginParams, IEndpointConfiguration } from './endpoint';\nimport { ICode, IError, IToken } from './token';\n\n/**\n * Custom error type to handle OAuth specific errors.\n */\nexport class AuthError extends Exception {\n constructor(message: string, public innerError?: Error) {\n super(message, innerError);\n }\n}\n\n/**\n * Helper for performing Implicit OAuth Authentication with registered endpoints.\n */\nexport class Authenticator {\n constructor(private endpoint: IEndpointConfiguration) {}\n\n authenticate(): Promise {\n return this._openAuthDialog();\n }\n\n /**\n * Check if the current url is running inside of a Dialog that contains an access_token, code, or error.\n * If true then it calls messageParent by extracting the token information, thereby closing the dialog.\n * Otherwise, the caller should proceed with normal initialization of their application.\n *\n * This logic assumes that the redirect url is your application and hence when your code runs again in\n * the dialog, this logic takes over and closes it for you.\n *\n * @return Returns false if the code is running inside of a dialog without the required information\n * or is not running inside of a dialog at all.\n */\n static isAuthDialog(): boolean {\n // If the url doesn't contain an access_token, code, or error then return false.\n // This is in scenarios where we don't want to automatically control what happens to the dialog.\n if (!/(access_token|code|error|state)/gi.test(location.href)) {\n return false;\n }\n\n Dialog.close(location.href);\n return true;\n }\n\n /**\n * Extract the token from the URL\n *\n * @param url The url to extract the token from.\n * @param exclude Exclude a particular string from the url, such as a query param or specific substring.\n * @param delimiter[optional] Delimiter used by OAuth provider to mark the beginning of token response. Defaults to #.\n * @return Returns the extracted token.\n */\n private static getUrlParams(\n url: string = location.href,\n exclude: string = location.origin,\n delimiter = '#'\n ): ICode | IToken | IError {\n if (exclude) {\n url = url.replace(exclude, '');\n }\n\n const [left, right] = url.split(delimiter);\n let tokenString = right == null ? left : right;\n\n if (tokenString.indexOf('?') !== -1) {\n tokenString = tokenString.split('?')[1];\n }\n\n return Authenticator.extractParams(tokenString);\n }\n\n private static extractParams(segment: string): ICode | IToken | IError {\n if (segment == null || segment.trim() === '') {\n return null;\n }\n\n const params: Partial = {};\n const regex = /([^&=]+)=([^&]*)/g;\n let matchParts;\n\n while ((matchParts = regex.exec(segment)) !== null) {\n // Fixes bugs when the state parameters contains a / before them\n if (matchParts[1] === '/state') {\n matchParts[1] = matchParts[1].replace('/', '');\n }\n params[decodeURIComponent(matchParts[1])] = decodeURIComponent(\n matchParts[2]\n );\n }\n\n return params as ICode | IToken | IError;\n }\n\n private async _openAuthDialog(): Promise {\n // Set the authentication state to redirect and begin the auth flow.\n const { state, url } = getLoginParams(this.endpoint);\n\n // Launch the dialog and perform the OAuth flow. We launch the dialog at the redirect\n // url where we expect the call to isAuthDialog to be available.\n const redirectUrl = await new Dialog(url, 1024, 768).result;\n\n // Try and extract the result and pass it along.\n return this._handleTokenResult(redirectUrl, this.endpoint, state);\n }\n\n private _handleTokenResult(\n redirectUrl: string,\n endpoint: IEndpointConfiguration,\n state: number\n ) {\n const result = Authenticator.getUrlParams(\n redirectUrl,\n endpoint.redirectUrl\n );\n if (result == null) {\n throw new AuthError('No access_token or code could be parsed.');\n } else if (endpoint.state && +result.state !== state) {\n throw new AuthError(\"State couldn't be verified\");\n } else if ('code' in result) {\n return result;\n } else {\n throw new AuthError((result as IError).error);\n }\n }\n}\n","// Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.\nimport { generateCryptoSafeRandom } from './generateCryptoSafeRandom';\n\nexport interface IEndpointConfiguration {\n // Registered OAuth ClientID\n clientId?: string;\n\n // Base URL of the endpoint\n baseUrl?: string;\n\n // URL segment for OAuth authorize endpoint.\n // The final authorize url is constructed as (baseUrl + '/' + authorizeUrl).\n authorizeUrl?: string;\n\n // Registered OAuth redirect url.\n // Defaults to window.location.origin\n redirectUrl?: string;\n\n // Registered OAuth scope.\n scope?: string;\n\n // Resource parameter for the OAuth provider.\n resource?: string;\n\n // Automatically generate a state? defaults to false.\n state?: boolean;\n\n // Automatically generate a nonce? defaults to false.\n nonce?: boolean;\n\n // OAuth responseType.\n responseType?: string;\n\n // Additional object for query parameters.\n // Will be appending them after encoding the values.\n extraQueryParameters?: { [index: string]: string };\n}\n\n/**\n * Helper to generate the OAuth login url.\n * @param endpointConfig Valid Endpoint configuration.\n * @return Returns the added endpoint.\n */\nexport function getLoginParams(endpointConfig: IEndpointConfiguration): {\n url: string;\n state: number;\n} {\n const scope = endpointConfig.scope\n ? encodeURIComponent(endpointConfig.scope)\n : null;\n const resource = endpointConfig.resource\n ? encodeURIComponent(endpointConfig.resource)\n : null;\n const state = endpointConfig.state && generateCryptoSafeRandom();\n const nonce = endpointConfig.nonce && generateCryptoSafeRandom();\n\n const urlSegments = [\n `response_type=${endpointConfig.responseType}`,\n `client_id=${encodeURIComponent(endpointConfig.clientId)}`,\n `redirect_uri=${encodeURIComponent(endpointConfig.redirectUrl)}`,\n ];\n\n if (scope) {\n urlSegments.push(`scope=${scope}`);\n }\n if (resource) {\n urlSegments.push(`resource=${resource}`);\n }\n if (state) {\n urlSegments.push(`state=${state}`);\n }\n if (nonce) {\n urlSegments.push(`nonce=${nonce}`);\n }\n if (endpointConfig.extraQueryParameters) {\n for (const param of Object.keys(endpointConfig.extraQueryParameters)) {\n urlSegments.push(\n `${param}=${encodeURIComponent(\n endpointConfig.extraQueryParameters[param]\n )}`\n );\n }\n }\n\n return {\n url: `${endpointConfig.baseUrl}${\n endpointConfig.authorizeUrl\n }?${urlSegments.join('&')}`,\n state: state,\n };\n}\n","/**\n * Utility to generate crypto safe random numbers\n */\nexport function generateCryptoSafeRandom() {\n const random = new Uint32Array(1);\n if ('msCrypto' in window) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (window).msCrypto.getRandomValues(random);\n } else if ('crypto' in window) {\n window.crypto.getRandomValues(random);\n } else {\n throw new Error(\n \"The platform doesn't support generation of cryptographically safe randoms. Please disable the state flag and try again.\"\n );\n }\n return random[0];\n}\n","/* global Office */\nimport { OutlookException } from 'common/exceptions/outlook/OutlookException';\nimport { OutlookWrongItemSelectedException } from 'common/exceptions/outlook/OutlookWrongItemSelectedException';\nimport { AddInFeatureNotSupportedException } from '../exceptions/application/AddInFeatureNotSupportedException';\nimport { SupportedOfficeItem } from './SupportedOfficeItem';\n\nexport function getAsyncBody(body: Office.Body) {\n return new Promise((resolve, reject) => {\n body.getAsync('html', (bodyResult) => {\n if (bodyResult.status === Office.AsyncResultStatus.Succeeded)\n resolve(bodyResult.value);\n else\n reject(\n processError('Failed to get outlook item body', bodyResult.error)\n );\n });\n });\n}\n\nexport function getAsyncRecipients(recipients: Office.Recipients) {\n const promise = new Promise(function (\n resolve,\n reject\n ) {\n recipients.getAsync((recipientsResult) => {\n if (recipientsResult.status === Office.AsyncResultStatus.Succeeded)\n resolve(recipientsResult.value);\n else\n reject(\n processError(\n 'Failed to get outlook item recipients',\n recipientsResult.error\n )\n );\n });\n });\n\n return promise;\n}\n\nexport function getAsyncOrganizer(organizer: Office.Organizer) {\n const promise = new Promise(function (\n resolve,\n reject\n ) {\n organizer.getAsync((organizerResult) => {\n if (organizerResult.status === Office.AsyncResultStatus.Succeeded)\n resolve(organizerResult.value);\n else\n reject(\n processError(\n 'Failed to get outlook item organizer',\n organizerResult.error\n )\n );\n });\n });\n return promise;\n}\n\nexport function getAsyncSubject(subject: Office.Subject) {\n const promise = new Promise(function (resolve, reject) {\n subject.getAsync((recipientsResult) => {\n if (recipientsResult.status === Office.AsyncResultStatus.Succeeded)\n resolve(recipientsResult.value);\n else\n reject(\n processError(\n 'Failed to get outlook item subject',\n recipientsResult.error\n )\n );\n });\n });\n return promise;\n}\n\nexport function getAsyncTime(time: Office.Time) {\n const promise = new Promise(function (resolve, reject) {\n time.getAsync((recipientsResult) => {\n if (recipientsResult.status === Office.AsyncResultStatus.Succeeded)\n resolve(recipientsResult.value);\n else\n reject(\n processError(\n 'Failed to get outlook item time',\n recipientsResult.error\n )\n );\n });\n });\n return promise;\n}\n\nexport function saveAsync(appointment: Office.AppointmentCompose) {\n // if API < 1.3\n if (!appointment.saveAsync) {\n throw new AddInFeatureNotSupportedException(\n 'Failed to get outlook item id: saving item is not supported in this version of outlook'\n );\n }\n\n const promise = new Promise(function (resolve, reject) {\n appointment.saveAsync((saveResult) => {\n if (saveResult.status === Office.AsyncResultStatus.Succeeded) {\n resolve(saveResult.value);\n } else {\n // on macOS \"Internal Error\" will be returned with code 5001\n if (saveResult.error.code == 5001) {\n reject(\n new AddInFeatureNotSupportedException(\n 'Failed to get item id: saving item is not supported in MacOS version of outlook'\n )\n );\n }\n reject(processError('Failed to save outlook item', saveResult.error));\n }\n });\n });\n return promise;\n}\n\nexport function getAsyncId(appointment: Office.AppointmentCompose) {\n // if API < 1.8\n if (!appointment.getItemIdAsync) {\n throw new AddInFeatureNotSupportedException(\n 'Failed to get outlook item id: not supported in this version of outlook'\n );\n }\n\n const promise = new Promise(function (resolve, reject) {\n appointment.getItemIdAsync((getIdResult) => {\n if (getIdResult.status === Office.AsyncResultStatus.Succeeded) {\n resolve(getIdResult.value);\n } else {\n // on macOS \"Internal Error\" will be returned with code 5001\n // I assume that getItemIdAsync is not supported on Mac, just like the saveAsync\n // although I didn't find any mention of this\n if (getIdResult.error.code == 5001) {\n reject(\n new AddInFeatureNotSupportedException(\n 'Failed to get item id: getting item is not supported in MacOS version of outlook'\n )\n );\n }\n reject(\n processError('Failed to get outlook item id', getIdResult.error)\n );\n }\n });\n });\n return promise;\n}\n\nexport function getAsyncCustomProperties(\n item: SupportedOfficeItem\n): Promise {\n return new Promise((resolve, reject) => {\n item.loadCustomPropertiesAsync((asyncResult) => {\n if (asyncResult.status == Office.AsyncResultStatus.Succeeded)\n resolve(asyncResult.value);\n else\n reject(\n processError(\n 'Failed to get outlook item custom properties',\n asyncResult.error\n )\n );\n });\n });\n}\n\nexport function saveAsyncCustomProperties(\n properties: Office.CustomProperties\n): Promise {\n return new Promise(function (resolve, reject) {\n properties.saveAsync((asyncResult) => {\n if (asyncResult.status === Office.AsyncResultStatus.Succeeded) resolve();\n else\n reject(\n processError(\n 'Failed to save outlook item custom properties',\n asyncResult.error\n )\n );\n });\n });\n}\n\n/**\n * Checks if item is a recurring appointment's master item\n * NOTE: this check is supported only on API >= 1.7. On lower versions always returns false\n * Add-in must check this again later using Graph API. This can't be done here because\n * if item wasn't saved yet, we can't retrieve item's ID for Graph API requests\n */\nexport function isRecurringMaster(item: SupportedOfficeItem): Promise {\n return new Promise((resolve, reject) => {\n // if NOT appointment OR API < 1.7, return false\n if (!item.recurrence) {\n resolve(false);\n } else if (item.recurrence.recurrenceType && !item.seriesId) {\n resolve(true);\n } else if (!item.recurrence.getAsync) {\n resolve(false);\n } else {\n item.recurrence.getAsync((asyncResult) => {\n if (asyncResult.status == Office.AsyncResultStatus.Succeeded) {\n if (\n asyncResult.value &&\n asyncResult.value.recurrenceType &&\n !item.seriesId\n ) {\n resolve(true);\n } else {\n resolve(false);\n }\n } else {\n reject(\n processError(\n 'Failed to check if outlook item is recurring master',\n asyncResult.error\n )\n );\n }\n });\n }\n });\n}\n\nexport function getSharedProperties(\n item: SupportedOfficeItem\n): Promise {\n return new Promise((resolve, reject) => {\n if (!item.getSharedPropertiesAsync) {\n return resolve(undefined);\n }\n\n item.getSharedPropertiesAsync((asyncResult) => {\n if (asyncResult.status == Office.AsyncResultStatus.Succeeded) {\n resolve(asyncResult.value);\n } else {\n reject(\n processError(\n 'Failed to get outlook item shared properties',\n asyncResult.error\n )\n );\n }\n });\n });\n}\n\nexport function getAttachments(\n item: SupportedOfficeItem\n): Promise {\n return new Promise((resolve, reject) => {\n if (item.attachments) {\n resolve(item.attachments);\n } else if (item.getAttachmentsAsync) {\n item.getAttachmentsAsync((asyncResult) => {\n if (asyncResult.status == Office.AsyncResultStatus.Succeeded) {\n resolve(asyncResult.value);\n } else {\n reject(\n processError(\n 'Failed to get outlook item attachments',\n asyncResult.error\n )\n );\n }\n });\n } else {\n reject(\n new AddInFeatureNotSupportedException(\n 'Failed to get outlook item attachments: not supported in this version of outlook'\n )\n );\n }\n });\n}\n\nexport function getAttachmentContent(\n item: SupportedOfficeItem,\n attachmentId: string\n): Promise {\n return new Promise((resolve, reject) => {\n if (item.getAttachmentContentAsync) {\n item.getAttachmentContentAsync(attachmentId, (asyncResult) => {\n if (asyncResult.status == Office.AsyncResultStatus.Succeeded) {\n resolve(asyncResult.value);\n } else {\n reject(\n processError(\n 'Failed to get outlook item attachment content',\n asyncResult.error\n )\n );\n }\n });\n } else {\n reject(\n new AddInFeatureNotSupportedException(\n 'Failed to get outlook item attachment content: not supported in this version of outlook'\n )\n );\n }\n });\n}\n\nfunction processError(message: string, error: Office.Error) {\n if (error && error.name === 'GenericResponseError' && error.code === 9020) {\n // see JSDoc for this class\n return new OutlookWrongItemSelectedException(error);\n }\n return new OutlookException(message, error);\n}\n","import * as MicrosoftGraph from '@microsoft/microsoft-graph-types';\nimport { ApplicationException } from 'common/exceptions/application/ApplicationException';\nimport { ItemIsNotSavedException } from 'common/exceptions/application/ItemIsNotSavedException';\nimport { OutlookApiException } from 'common/exceptions/outlook/OutlookApiException';\nimport { OutlookException } from 'common/exceptions/outlook/OutlookException';\nimport { OutlookItemNotSupported } from 'common/exceptions/outlook/OutlookItemNotSupported';\nimport { AppointmentUids } from 'common/models/AppointmentUids';\nimport CONFIG from 'config';\nimport { Attachment } from '../models/Attachment';\nimport { SupportedOfficeItem } from './SupportedOfficeItem';\nimport { findDuplicateMeeting } from './api';\nimport { assertHasGraphApi } from './assertHasGraphApi';\nimport { toIsoWithTimeZone } from './dateUtils';\nimport * as GraphApi from './graphApi';\nimport * as OutlookAsyncUtils from './outlookAsyncUtils';\n\nconst TAG = 'OIU3: ';\n\nexport function getUserEmail(\n sharedProperties: Office.SharedProperties | undefined\n) {\n return sharedProperties\n ? sharedProperties.owner\n : Office.context.mailbox.userProfile.emailAddress;\n}\n\nexport function getAsyncLocation(location: Office.Location) {\n const promise = new Promise(function (resolve, reject) {\n location.getAsync((recipientsResult) => {\n if (recipientsResult.status === Office.AsyncResultStatus.Succeeded)\n resolve(recipientsResult.value);\n else reject(recipientsResult.error);\n });\n });\n return promise;\n}\n\nexport function getDirectionFromOutlookItem(\n item: SupportedOfficeItem,\n sharedProperties: Office.SharedProperties | undefined\n) {\n const userEmail = getUserEmail(sharedProperties);\n\n let senderEmail = '';\n\n if (item.itemType === 'message') {\n const message = item as Office.MessageRead;\n senderEmail = message.from.emailAddress;\n } else if (item.itemType === 'appointment') {\n if (isAppointmentReadMode(item)) {\n const appointmentRead = item as Office.AppointmentRead;\n senderEmail = appointmentRead.organizer.emailAddress;\n } else {\n senderEmail = userEmail;\n }\n } else {\n throw new OutlookItemNotSupported();\n }\n\n return senderEmail === userEmail ? 'OUT' : 'IN';\n}\n\nexport async function getLocationFromOutlookItem(\n item: SupportedOfficeItem\n): Promise {\n if (item.itemType === 'message') {\n return null;\n } else if (item.itemType === 'appointment') {\n if (isAppointmentReadMode(item)) {\n const appointment = item as Office.AppointmentRead;\n return appointment.location;\n } else {\n const appointment = item as Office.AppointmentCompose;\n return await getAsyncLocation(appointment.location);\n }\n } else {\n throw new OutlookItemNotSupported();\n }\n}\n\nexport async function getSubjectFromOutlookItem(\n item: Office.MessageRead & Office.AppointmentCompose & Office.AppointmentRead\n) {\n if (item.itemType === 'message') {\n const message = item as Office.MessageRead;\n return message.subject || 'No subject';\n } else if (item.itemType === 'appointment') {\n if (isAppointmentReadMode(item)) {\n const appointment = item as Office.AppointmentRead;\n return appointment.subject || 'No subject';\n } else {\n const appointment = item as Office.AppointmentCompose;\n return (\n (await OutlookAsyncUtils.getAsyncSubject(appointment.subject)) ||\n 'No subject'\n );\n }\n } else {\n throw new OutlookItemNotSupported();\n }\n}\n\nexport function getInteractionMethodFromOutlookItem(\n item: Office.MessageRead & Office.AppointmentCompose & Office.AppointmentRead\n) {\n if (item.itemType === 'message') return 'Email';\n else if (item.itemType === 'appointment') return 'Meeting';\n else throw new OutlookItemNotSupported();\n}\n\nexport async function getDateFromOutlookItem(\n item: Office.MessageRead & Office.AppointmentRead & Office.AppointmentCompose\n): Promise {\n if (item.itemType === 'message') {\n const message = item as Office.MessageRead;\n return message.dateTimeCreated;\n } else if (item.itemType === 'appointment') {\n if (isAppointmentReadMode(item)) {\n const appointment = item as Office.AppointmentRead;\n return appointment.start;\n } else {\n const appointment = item as Office.AppointmentCompose;\n const date = await OutlookAsyncUtils.getAsyncTime(appointment.start);\n return date || new Date();\n }\n }\n}\n\nexport async function getEndDateFromOutlookItem(\n item: Office.MessageRead & Office.AppointmentRead & Office.AppointmentCompose\n): Promise {\n if (item.itemType === 'message') {\n return null;\n } else if (item.itemType === 'appointment') {\n if (isAppointmentReadMode(item)) {\n const appointment = item as Office.AppointmentRead;\n return appointment.end;\n } else {\n const appointment = item as Office.AppointmentCompose;\n const date = await OutlookAsyncUtils.getAsyncTime(appointment.end);\n return date || new Date();\n }\n }\n}\n\nexport function isAppointmentReadMode(outlookItem: Office.AppointmentRead) {\n return outlookItem.itemType === 'appointment' && outlookItem.itemId;\n}\n\n/** Tries to retrieve item ID using a few different methods */\nexport async function getItemId(\n outlookItem: SupportedOfficeItem,\n sharedProperties: Office.SharedProperties | undefined\n): Promise {\n // if it's not a Compose mode, simply return the ID\n if (outlookItem.itemId) return outlookItem.itemId;\n\n // if it's Compose mode, itemId property is not available\n\n // first, try getting id with getAsyncId\n // which doesn't work if:\n // 0. API version < 1.8\n // 1. It's MacOS, in which case: getIdError instanceof AddInFeatureNotSupportedException\n // 2. id can't be retrieved because item is new and wasn't saved, in which case: getIdError.code === 9046\n // 3. It's Internet Explorer, in which case error message or description will be \"Permission denied\"\n // then, try getting id with saveAsync\n // which doesn't work if:\n // 1. It's MacOS, , in which case: getIdError instanceof AddInFeatureNotSupportedException\n // 2. Not sure if will work on IE\n // then, try the workaround with saving custom properties\n // which doesn't work if:\n // 1. custom properties are not saved yet, in which case: getItemIdBySearchOnCustomPropertiesError instanceof ItemIsNotSavedException\n // if nothing worked, combine all errors and rethrow\n\n try {\n return await OutlookAsyncUtils.getAsyncId(outlookItem);\n } catch (getIdError) {\n // if not supported, or any other error, try saveAsync\n try {\n return await OutlookAsyncUtils.saveAsync(outlookItem);\n } catch (saveError) {\n // if save function is not supported, try the workaround\n try {\n return await getItemIdBySearchOnCustomProperties(\n outlookItem,\n sharedProperties\n );\n } catch (getItemIdBySearchOnCustomPropertiesError) {\n // if item is not saved, UI should inform user\n if (\n getItemIdBySearchOnCustomPropertiesError instanceof\n ItemIsNotSavedException\n ) {\n throw getItemIdBySearchOnCustomPropertiesError;\n }\n // if problem is somewhere else, rethrow everything\n else {\n const errorsDescription = {\n getIdError: getIdError,\n saveError: saveError,\n getItemIdBySearchOnCustomPropertiesError:\n getItemIdBySearchOnCustomPropertiesError,\n };\n throw new ApplicationException(\n 'Failed to get id for outlook item',\n errorsDescription\n );\n }\n }\n }\n }\n}\n\n/** This workaround is for MacOS, where save() function is not supported, and it's impossible to get item ID for items in Compose mode.\n * https://docs.microsoft.com/en-US/outlook/troubleshoot/calendars/cannot-save-meeting-as-draft-in-outlook-for-mac\n * Original workaround described in the article doesn't work: REST and Graph methods require back-end,\n * and EWS method throws errors when trying to sync items.\n * This method works differently: instead of using EWS syncing, it searches through all Appointments using a flag\n * saved in item's custom properties.\n * If flag wasn't yet set, then user must manually save the item.\n * @throws ItemIsNotSavedException\n */\nasync function getItemIdBySearchOnCustomProperties(\n outlookItem: SupportedOfficeItem,\n sharedProperties: Office.SharedProperties | undefined\n): Promise {\n assertHasGraphApi();\n\n const properties = await OutlookAsyncUtils.getAsyncCustomProperties(\n outlookItem\n );\n console.log(TAG, 'Retrieving item ID by search on custom properties');\n\n let searchFlagValue: string = properties.get('flag_for_mac_save_workaround');\n // if flag was set, search all Appointments by it's value\n if (searchFlagValue) {\n console.log(\n TAG,\n 'Found flag_for_mac_save_workaround flag: ',\n searchFlagValue\n );\n\n const id = await GraphApi.getFirstEventIdByCustomProperty(\n searchFlagValue,\n sharedProperties\n );\n\n if (id) {\n console.log(TAG, 'Item Id found by the flag: ', id);\n return id;\n } else {\n // if flag is set, but not found in EWS, that means that flag wasn't yet saved to the server\n console.log(TAG, 'Item Id was not found by the flag');\n throw new ItemIsNotSavedException();\n }\n }\n // if flag wasn't set, then set the flag to any unique string\n // and ask user to save the item, so the flag could be read when this function runs again\n else {\n console.log(TAG, 'Flag was not set, setting the flag');\n searchFlagValue = new Date().valueOf().toString();\n properties.set('flag_for_mac_save_workaround', searchFlagValue);\n await OutlookAsyncUtils.saveAsyncCustomProperties(properties);\n throw new ItemIsNotSavedException();\n }\n}\n\nexport function canSaveAttachments(): boolean {\n return (\n Office.context.requirements.isSetSupported('Mailbox', '1.8') ||\n CONFIG.isGraphApiEnabled\n );\n}\n\nexport async function getSupportedAttachmentsForItem(\n item: SupportedOfficeItem,\n sharedProperties: Office.SharedProperties | undefined\n) {\n // If the client doesn't support getAttachmentContentAsync (requirement set 1.8), fall back to the REST API\n if (!Office.context.requirements.isSetSupported('Mailbox', '1.8')) {\n const itemId = await getItemId(item, sharedProperties);\n\n return await getSupportedAttachmentsForItemId(\n itemId,\n item.itemType,\n sharedProperties\n );\n }\n\n const attachments = await OutlookAsyncUtils.getAttachments(item);\n\n const attachmentsWithContent = await Promise.all(\n attachments\n .filter(\n (attachment) =>\n attachment.attachmentType ===\n Office.MailboxEnums.AttachmentType.File ||\n attachment.attachmentType === Office.MailboxEnums.AttachmentType.Item\n )\n .map(async (attachment) => {\n try {\n const content = await OutlookAsyncUtils.getAttachmentContent(\n item,\n attachment.id\n );\n\n return { attachment, content };\n } catch (error: unknown) {\n if (\n error instanceof OutlookException &&\n (error.originalException as Office.Error)?.name ===\n 'AttachmentTypeNotSupported'\n ) {\n console.log(TAG, 'Skipping unsupported attachment', attachment);\n\n return undefined;\n }\n\n if (error instanceof Error) {\n if (\n error.name === 'Sys.ArgumentNullException' &&\n error.message.includes('Parameter name: attachmentId')\n ) {\n const itemTypeText =\n item.itemType === 'appointment' ? 'event' : 'message';\n\n throw new OutlookApiException(\n `The ${itemTypeText} could not be saved because Outlook did not provide an ID for the attachment '${attachment.name}'.`,\n error\n );\n }\n }\n throw error;\n }\n })\n );\n\n const convertedAttachments = attachmentsWithContent\n .filter((pair) => pair?.content.content)\n .map((pair): Attachment => {\n const base64Content: string =\n pair.content.format ===\n Office.MailboxEnums.AttachmentContentFormat.Eml ||\n pair.content.format ===\n Office.MailboxEnums.AttachmentContentFormat.ICalendar\n ? btoa(pair.content.content)\n : pair.content.content;\n\n return {\n id: pair.attachment.id,\n name: pair.attachment.name,\n contentType: undefined,\n contentBytes: base64Content,\n size: pair.attachment.size,\n attachmentType: 0,\n isInline: pair.attachment.isInline,\n DataType:\n pair.attachment.attachmentType ===\n Office.MailboxEnums.AttachmentType.File\n ? 'FileAttachment'\n : 'ItemAttachment',\n };\n });\n\n return convertedAttachments;\n}\n\nexport async function getSupportedAttachmentsForItemId(\n itemId: string,\n itemType: string,\n sharedProperties: Office.SharedProperties | undefined\n): Promise {\n try {\n const attachments = await GraphApi.getAttachments(\n itemId,\n itemType,\n sharedProperties\n );\n\n const convertedAttachments = attachments\n .filter(\n (attachment): attachment is MicrosoftGraph.FileAttachment =>\n !!(attachment as MicrosoftGraph.FileAttachment).contentBytes\n )\n .map(\n (attachment): Attachment => ({\n id: attachment.id,\n name: attachment.name,\n contentType: attachment.contentType,\n contentBytes: attachment.contentBytes,\n size: attachment.size,\n attachmentType: 0,\n isInline: attachment.isInline,\n DataType:\n attachment['@odata.type'] === '#microsoft.graph.fileAttachment'\n ? 'FileAttachment'\n : attachment['@odata.type'],\n })\n );\n\n const supportedAttachments = convertedAttachments.filter(\n (a) => !a.isInline\n );\n\n return supportedAttachments;\n } catch (error) {\n if (error.status === 404) {\n // this occurs when we were able get item id from the Exchange Server,\n // but the since user hasn't yet saved the draft item,\n // Exchange Server is still refusing to acknowledge existence of the item with this id\n throw new ItemIsNotSavedException();\n }\n throw error;\n }\n}\n\nexport async function getAppointmentUids(\n itemId: string,\n sharedProperties: Office.SharedProperties | undefined\n): Promise {\n return await GraphApi.getAppointmentUids(itemId, sharedProperties);\n}\n\nexport async function isReadOnlySharedItem(\n item: SupportedOfficeItem,\n sharedProperties: Office.SharedProperties | undefined\n): Promise {\n if (!sharedProperties) {\n return false;\n }\n\n if (\n (sharedProperties.delegatePermissions &\n Office.MailboxEnums.DelegatePermissions.EditOwn) ===\n 0 &&\n (sharedProperties.delegatePermissions &\n Office.MailboxEnums.DelegatePermissions.EditAll) ===\n 0\n ) {\n return true;\n }\n\n try {\n console.log(TAG, 'Checking if shared item is read-only');\n\n const propertyName = 'read_only_permission_test';\n const properties = await OutlookAsyncUtils.getAsyncCustomProperties(item);\n\n properties.set(propertyName, '1');\n await OutlookAsyncUtils.saveAsyncCustomProperties(properties);\n\n properties.remove(propertyName);\n await OutlookAsyncUtils.saveAsyncCustomProperties(properties);\n\n console.log(\n TAG,\n 'Checking if shared item is read-only: ',\n 'Able to save custom properties, not read-only'\n );\n\n return false;\n } catch (error: unknown) {\n console.log(\n TAG,\n 'Checking if shared item is read-only: ',\n 'Received error saving custom properties, assuming read-only',\n error\n );\n\n return true;\n }\n}\n\nexport async function isSavedMeeting(\n item: SupportedOfficeItem,\n sharedProperties: Office.SharedProperties\n) {\n if (!CONFIG.isGraphApiEnabled) {\n return false;\n }\n\n if (item.itemType !== Office.MailboxEnums.ItemType.Appointment) {\n return false;\n }\n\n const itemId = await getItemId(item, sharedProperties);\n\n const [uids, startDate] = await Promise.all([\n getAppointmentUids(itemId, sharedProperties),\n getDateFromOutlookItem(item),\n ]);\n\n const response = await findDuplicateMeeting({\n MeetingUID: uids.uid,\n MeetingRecurrenceID: uids.recurrenceId,\n StartDate: toIsoWithTimeZone(startDate),\n });\n\n return response.IsMatchFound;\n}\n\nexport function getItemRestId(itemId: string) {\n const hostName = Office.context.mailbox.diagnostics.hostName;\n if (hostName === 'OutlookIOS' || hostName === 'OutlookAndroid') {\n // itemId is already REST-formatted.\n return itemId;\n } else {\n // Convert to an item ID for API v2.0.\n return Office.context.mailbox.convertToRestId(\n itemId,\n Office.MailboxEnums.RestVersion.v2_0\n );\n }\n}\n","export function sleep(ms: number) {\n return new Promise((resolve) => {\n setTimeout(() => {\n resolve();\n }, ms);\n });\n}\n","import { Exception } from 'common/exceptions/Exception';\nimport { ClientListItem } from 'common/models/ClientListItem';\nimport { SupportedOfficeItem } from 'common/utils/SupportedOfficeItem';\nimport CONFIG from 'config';\nimport $ from 'jquery';\nimport * as App from '../app/app';\nimport { AddInStakeholder } from '../models/AddInStakeholder';\nimport { DomainDetails } from '../models/DomainDetails';\nimport { Option } from '../models/Option';\nimport { ProjectInfo } from '../models/ProjectInfo';\nimport { Region } from '../models/Region';\nimport { Stakeholder } from './../models/Stakeholder';\nimport { getPrimaryStakeholders } from './contactUtils';\nimport * as OutlookAsyncUtils from './outlookAsyncUtils';\nimport * as OutlookItemUtils from './outlookItemUtils';\nimport * as UserSettings from './user-settings';\n\nconst TAG = 'AUI3: ';\nexport function showMessageAutosaved() {\n $('#was-autosaved-page').show();\n}\n\nexport function showMessageSaved() {\n $('#was-saved-page').show();\n}\n\nexport function showSeriesEventNotSupported() {\n $('#series-event-not-supported-page').show();\n}\n\nexport function showReadOnlySharedItemNotSupported() {\n $('#read-only-shared-item-not-supported-page').show();\n}\n\nexport async function showPrimaryStakeholdersInfo(item: SupportedOfficeItem) {\n const sharedProperties = await OutlookAsyncUtils.getSharedProperties(item);\n const primaryStakeholders = await getPrimaryStakeholders(\n item,\n sharedProperties\n );\n\n const names = primaryStakeholders.map((s) => s.fullName).join('
');\n const emails = primaryStakeholders.map((s) => s.email).join('
');\n\n changeLabelsByItemType(item);\n\n if (\n !CONFIG.isGraphApiEnabled ||\n item.itemType === 'appointment' ||\n sharedProperties\n ) {\n $('#autoSaveAll').hide();\n $('#autoSaveAllLabel').hide();\n $('#autoSaveAll').removeAttr('checked');\n\n $('#autoSaveOne').attr('checked', 'checked');\n UserSettings.setAutosave(false);\n }\n\n $('#detail-page').show();\n\n $('#user-id').html(names);\n $('#user-sub-text').html(emails);\n}\n\nexport function showStakeholdersForm(\n primaryStakeholders: AddInStakeholder[],\n additionalStakeholders: AddInStakeholder[],\n itemType: string,\n readModeAttachments: Office.AttachmentDetails[] | undefined\n) {\n if (itemType === 'appointment') {\n $('#primary-stakeholder-detail').hide();\n $('#save-all-or-primary').hide();\n $('#save-or-cancel-buttons-1').hide();\n $('#cc-bcc-email-main').show();\n $('#cc-bcc-email-main').html('Stakeholders:');\n showAllStakeholders(primaryStakeholders);\n $('input[name=\"save-all-future-email\"]:checked').val('all');\n } else {\n const primaryStakeholder = primaryStakeholders[0];\n $('#item-from').val(primaryStakeholder.email);\n $('#item-org2').val(primaryStakeholder.fullName);\n $('#item-from-fname').val(primaryStakeholder.firstName);\n $('#item-from-lname').val(primaryStakeholder.lastName);\n\n showAdditionalStakeholders(additionalStakeholders);\n }\n\n if (\n readModeAttachments &&\n readModeAttachments.length > 0 &&\n !OutlookItemUtils.canSaveAttachments()\n ) {\n $('#attachments-warning').show();\n } else {\n $('#attachments-warning').hide();\n }\n}\n\nexport function showAdditionalStakeholders(stakeholders: AddInStakeholder[]) {\n let additionalStakeholdersHtml = '';\n\n let index = 0;\n stakeholders.forEach((stakeholder) => {\n additionalStakeholdersHtml += getStkFormAdd(index++, stakeholder, false);\n });\n\n $('#cc-bcc-emails').html(additionalStakeholdersHtml);\n\n if (stakeholders.length > 0) {\n $('#cc-bcc-email-main').show();\n $('#secondSubmit').show();\n } else {\n $('#cc-bcc-email-main').hide();\n $('#secondSubmit').hide();\n }\n}\n\nexport function showAllStakeholders(stakeholders: AddInStakeholder[]) {\n let additionalStakeholdersHtml = '';\n\n let index = 0;\n stakeholders.forEach((stakeholder) => {\n additionalStakeholdersHtml += getStkFormAdd(index++, stakeholder, true);\n });\n\n $('#cc-bcc-emails').html(additionalStakeholdersHtml);\n\n if (stakeholders.length > 0) {\n $('#secondSubmit').show();\n } else {\n $('#secondSubmit').hide();\n }\n}\n\nfunction getStkFormAdd(\n index: number,\n stakeholder: AddInStakeholder,\n showCheckboxes: boolean\n) {\n let html =\n '
\\\n ';\n\n if (showCheckboxes) {\n html +=\n '\\\n \\\n \\\n ';\n }\n html +=\n '\\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n \\\n
Save this stakeholder
Individual/Organisation\\\n
\\\n \\\n \\\n
\\\n
Email' +\n stakeholder.email +\n '
First Name\\\n
\\\n \\\n
\\\n
Last Name\\\n
\\\n \\\n
\\\n
Organisation\\\n
\\\n \\\n
\\\n
Organisation\\\n
\\\n \\\n
\\\n
Position\\\n
\\\n \\\n
\\\n
Phone\\\n
\\\n \\\n
\\\n
\\\n
';\n\n return html;\n}\n\nexport function getStakeholdersFromUi() {\n const stakeholders = Array();\n const itemEmail = getStringValueOrNull('#item-from');\n const itemPos = getStringValueOrNull('#item-pos');\n const contactGroupsArray = getMultiSelectValues('#item-contact-group');\n const stakeholderType = getStringValueOrNull('#select-individual-main');\n let itemOrg = getStringValueOrNull('#item-org');\n if (stakeholderType != 'Individual') {\n itemOrg = getStringValueOrNull('#item-org2');\n }\n const fname = getStringValueOrNull('#item-from-fname');\n const lname = getStringValueOrNull('#item-from-lname');\n const itemMobile = getStringValueOrNull('#item-mobile');\n\n const primaryStakeholder: Stakeholder = {\n ID: undefined,\n StakeholderType: stakeholderType,\n FirstName: stakeholderType === 'Individual' ? fname : itemOrg,\n LastName: stakeholderType === 'Individual' ? lname : undefined,\n Email: itemEmail,\n ContactGroupIDs: contactGroupsArray,\n Organisations: [\n {\n Name: stakeholderType != 'Individual' ? '' : itemOrg,\n Position: stakeholderType != 'Individual' ? '' : itemPos,\n IsFavourite: stakeholderType == 'Individual' ? true : null,\n },\n ],\n MobileNumber: undefined,\n WorkPhoneNumber: undefined,\n };\n if (stakeholderType != 'Individual') {\n primaryStakeholder.WorkPhoneNumber = itemMobile;\n } else {\n primaryStakeholder.MobileNumber = itemMobile;\n }\n\n if (primaryStakeholder.Email) {\n stakeholders.push(primaryStakeholder);\n }\n\n if ($('input[name=\"save-all-future-email\"]:checked').val() == 'all') {\n $('.cc-bcc-single-details').each(function () {\n const saveCheckbox = $(this).find('.cc-check');\n if (saveCheckbox.length > 0 && !saveCheckbox.prop('checked')) {\n return;\n }\n\n const itemEmailTo = $(this).find('.emailaddress').html();\n let itemOrgTo = '';\n if ($(this).find('.cc_stakeholder_type').val() == 'Individual') {\n itemOrgTo = $(this).find('.cc-bcc-org').val().toString();\n } else {\n itemOrgTo = $(this).find('.cc-bcc-org2').val().toString();\n }\n const itemPosTo = $(this).find('.cc-bcc-pos').val().toString();\n const itemMobileTo = $(this).find('.cc-bcc-mobile').val().toString();\n const StakeholderTypeTo = $(this)\n .find('.cc_stakeholder_type')\n .val()\n .toString();\n const fnameTo = $(this).find('.cc-bcc-fname').val().toString();\n const lnameTo = $(this).find('.cc-bcc-lname').val().toString();\n const additionalStakeholder: Stakeholder = {\n ID: undefined,\n StakeholderType: StakeholderTypeTo,\n FirstName: StakeholderTypeTo != 'Individual' ? itemOrgTo : fnameTo,\n LastName: lnameTo,\n Email: itemEmailTo,\n ContactGroupIDs: contactGroupsArray,\n Organisations: [\n {\n Name: StakeholderTypeTo != 'Individual' ? '' : itemOrgTo,\n Position: StakeholderTypeTo != 'Individual' ? '' : itemPosTo,\n IsFavourite: stakeholderType == 'Individual' ? true : null,\n },\n ],\n MobileNumber: undefined,\n WorkPhoneNumber: undefined,\n };\n if (StakeholderTypeTo != 'Individual') {\n additionalStakeholder.WorkPhoneNumber = itemMobileTo;\n } else {\n additionalStakeholder.MobileNumber = itemMobileTo;\n }\n stakeholders.push(additionalStakeholder);\n });\n }\n return stakeholders;\n}\n\nfunction changeLabelsByItemType(item: SupportedOfficeItem) {\n if (item.itemType === 'appointment') {\n const labels = [\n '#login-text',\n\n '#autoSaveAllLabel',\n '#autoSaveOneLabel',\n\n '#save-email-detail',\n '#save-email-detail2',\n\n '#item-saved-successfully',\n ];\n\n let tooltip = $('#futureAllTooltip').attr('title');\n if (tooltip) {\n tooltip = tooltip.replace('email', 'event');\n }\n $('#futureAllTooltip').attr('title', tooltip);\n\n $('#div-interaction-method').hide();\n\n labels.forEach((l) => changeLabelByItemType(l));\n }\n}\n\nfunction changeLabelByItemType(id: string) {\n let currentLabel = $(id).html();\n if (currentLabel) {\n currentLabel = currentLabel.replace('email', 'event');\n currentLabel = currentLabel.replace('Email', 'Event');\n }\n $(id).html(currentLabel);\n}\n\nexport function setIcon(path: string, width: number) {\n $('#header-logo').attr('width', width);\n $('#header-logo').attr('src', path);\n}\n\nexport function setAppName(name: string) {\n const elements = ['#login-text', '#item-saved-successfully'];\n for (const el of elements) {\n setAppNameInElement(el, name);\n }\n}\n\nexport function setFreeTrialUrl(url: string) {\n const id = '#login-text__free-trial';\n $(id).attr('href', url);\n}\n\nexport function setOptions(\n isComplaintsEnabled: boolean,\n isConfidentialOptionsEnabled: boolean\n) {\n if (isComplaintsEnabled) $('#div-interaction-method').show();\n else $('#div-interaction-method').hide();\n\n if (isConfidentialOptionsEnabled) $('#form-confidentiality').show();\n else {\n $('#form-confidentiality').hide();\n }\n}\n\nfunction setAppNameInElement(id: string, name: string) {\n let html = $(id).html();\n html = html.replace(/APP_NAME/g, name);\n $(id).html(html);\n}\n\nexport function renderOptions(\n options: Option[],\n selector: string,\n addEmptyOption = false\n) {\n let html = '';\n if (addEmptyOption) {\n html = '';\n }\n\n options.forEach(function (item) {\n html += '';\n });\n\n $(selector).html(html);\n\n if (html == '') {\n $(selector.replace('#', '.') + '-main').hide();\n } else {\n $(selector.replace('#', '.') + '-main').show();\n }\n}\n\nexport function showRegions(regions: Region[]) {\n const regionSelect = $('#select-domain-login');\n\n const domain = UserSettings.getDomain();\n\n let selected = false;\n let options = '';\n regions.forEach(function (item) {\n if (domain == item.api_url) {\n selected = true;\n options +=\n '';\n } else {\n options +=\n '';\n }\n });\n\n if (!selected) {\n options =\n '' + options;\n }\n\n regionSelect.html(options);\n}\n\nexport function showErrorInForm(message: string, error?: Exception) {\n $('#loader').hide();\n\n $('#error__message-details').hide();\n\n if (error) {\n let errorDetails: string;\n if (error instanceof Error) {\n // instance of \"Error\" cannot be stringified, just show the stack. it will include the error message.\n errorDetails = error.stack;\n } else {\n errorDetails = JSON.stringify(error);\n }\n\n $('#error__message-details').html('
' + errorDetails);\n\n $('#error__btn-details').show();\n } else {\n $('#error__btn-details').hide();\n }\n $('#error__message').html(message);\n\n $('#error-dialog').show();\n}\n\nexport function showInfoDialog(message: string) {\n $('#loader').hide();\n $('#dialog-info p').html(message);\n $('#dialog-info').show();\n}\n\nexport function hideInfoDialog() {\n $('#dialog-info').hide();\n}\n\nexport function showAuthErrorDialog(message: string | null) {\n $('#loader').hide();\n $('#detail-save-error p').html(message);\n $('#detail-save-error').show();\n}\n\nexport function showLogoutSuccessDialog() {\n $('#loader').hide();\n $('#dialog-logout-success').show();\n}\n\nexport function refreshClients(clients: ClientListItem[]) {\n const clientOption = [];\n let hasDefault = false;\n\n for (let index = 0; index < clients.length; index++) {\n if (clients[index].IsCurrent) {\n hasDefault = true;\n clientOption.push(\n ``\n );\n } else {\n clientOption.push(\n ``\n );\n }\n }\n\n if (clients.length > 1 && !hasDefault) {\n clientOption.unshift(\n ''\n );\n }\n $('#save-client').html(clientOption.join(''));\n\n if (!hasDefault) {\n const clientOptions = $('#save-client').find('option');\n const defaultOption =\n clientOptions.length > 1 ? clientOptions[1] : clientOptions[0];\n\n defaultOption.setAttribute('selected', 'true');\n }\n $('#save-client').trigger('change');\n}\n\nexport function refreshDomains(\n domains: DomainDetails[],\n favouriteDomainAndGroup: ProjectInfo,\n projectGroupAvailable: boolean\n) {\n let domainOption = '';\n if (domains.length > 1) {\n domainOption = '';\n }\n if (favouriteDomainAndGroup) {\n domainOption = '';\n }\n for (let index = 0; index < domains.length; index++) {\n domainOption +=\n '';\n }\n $('#save-domain').html(domainOption);\n if (favouriteDomainAndGroup) {\n $('#save-domain').val(favouriteDomainAndGroup.domainId).trigger('change');\n if (projectGroupAvailable) {\n $('#save-proj-group')\n .val(favouriteDomainAndGroup.projectGroupId)\n .trigger('change');\n }\n $('#save-project').val(favouriteDomainAndGroup.projectId).trigger('change');\n } else {\n const domainOptions = $('#save-domain').find('option');\n // select the first domain OR the placeholder option\n const defaultOption =\n domainOptions.length > 1 ? domainOptions[1] : domainOptions[0];\n\n defaultOption.setAttribute('selected', 'true');\n $('#save-domain').trigger('change');\n }\n\n $('#form-domain').show();\n $('#ProjectGroupContainer').show();\n $('#form-project').show();\n\n // if there is only one domain, hide the dropdown\n if (domains.length == 1) {\n $('#form-domain').hide();\n const domain = domains[0];\n\n if (projectGroupAvailable) {\n const groupsWithAccessibleProjects = domain.ProjectGroups.filter(\n (g) => g.Projects && g.Projects.length\n );\n // if there is only one project group, select it and hide the dropdown\n if (groupsWithAccessibleProjects.length == 1) {\n const group = groupsWithAccessibleProjects[0];\n if (!favouriteDomainAndGroup) {\n $('#save-proj-group').val(group.ID).trigger('change');\n }\n $('#ProjectGroupContainer').hide();\n\n // if there is only one project within the only one project group, hide the dropdown and select the project\n if (group.Projects.length == 1 && !favouriteDomainAndGroup) {\n $('#form-project').hide();\n $('#save-project').val(group.Projects[0].ID).trigger('change');\n }\n }\n } else {\n $('#ProjectGroupContainer').hide();\n // if no project groups and there is only one project, hide the dropdown and select the project\n if (domain.Projects.length == 1 && !favouriteDomainAndGroup) {\n $('#form-project').hide();\n $('#save-project').val(domain.Projects[0].ID).trigger('change');\n }\n }\n }\n}\n\nexport function checkSaveForm(): boolean {\n console.log(TAG, 'Validating the form');\n const projectGroup = $('#save-proj-group').val();\n const project = $('#save-project').val();\n let priorities = false;\n let assignedTo = false;\n if ($('#item-communication').val() == 'Complaint') {\n priorities = $('#complaint-priorities').val() ? false : true;\n assignedTo = $('#item-assigned-to').val() ? false : true;\n }\n\n if (\n (projectGroup == null || projectGroup == '') &&\n App.projectGroupAvailable\n ) {\n $('#project-group-error').html('Please select Project Group');\n $('#save-proj-group').focus();\n console.log(TAG, 'Validation not passed: project group');\n return false;\n } else if (project == null || project == '') {\n $('#project-group-error').html('');\n $('#project-error').html('Please select Project');\n $('#save-project').focus();\n console.log(TAG, 'Validation not passed: project');\n return false;\n } else if (CONFIG.isComplaintsEnabled && assignedTo) {\n $('#item-assigned-to-error').html('Please select Assign To');\n $('#item-assigned-to').focus();\n console.log(TAG, 'Validation not passed: item assigned to');\n return false;\n } else if (CONFIG.isComplaintsEnabled && priorities) {\n $('#complaint-priorities-error').html('Please select Complaint Priorities');\n $('#complaint-priorities').focus();\n console.log(TAG, 'Validation not passed: complaint priorities');\n return false;\n } else {\n $('#project-group-error').html('');\n $('#project-error').html('');\n $('#item-assigned-to-error').html('');\n $('#complaint-priorities-error').html('');\n console.log(TAG, 'Validation passed');\n return true;\n }\n}\n\nexport function hidePages() {\n $('#welcome-pg').hide();\n\n $('#series-event-not-supported-page').hide();\n $('#was-saved-page').hide();\n $('#was-autosaved-page').hide();\n\n $('#login-page').hide();\n $('#detail-page').hide();\n hideDocumentDetailsPage();\n $('#detail-final').hide();\n $('#item-not-supported-page').hide();\n}\n\nexport function getStringValueOrNull(id: string) {\n const value = $(id).val();\n if (value) {\n return value.toString();\n } else {\n return null;\n }\n}\n\nexport function getMultiSelectValues(id: string): string[] {\n const data = $(id).select2('data');\n\n return data.map((value) => value.id);\n}\n\nexport function hideDocumentDetailsPage() {\n $('#detail-final').hide();\n}\n\nexport function showSaveSuccessfulDialog() {\n $('#detail-save-pop').show();\n}\n\nexport function hideSaveSuccessfulDialog() {\n $('#detail-save-pop').hide();\n}\n\nexport function showItemNotSupportedPage() {\n $('#item-not-supported-page').show();\n}\n","import CONFIG from 'config';\n\nexport function getDomain(): string {\n return localStorage.getItem(CONFIG.appPrefix + '_' + 'selectDomainDarzin');\n}\n\nexport function setDomain(value: string) {\n localStorage.setItem(CONFIG.appPrefix + '_' + 'selectDomainDarzin', value);\n}\n\nexport function setClientCode(value: string) {\n localStorage.setItem(CONFIG.appPrefix + '_' + 'clientCode', value);\n}\n\nexport function getClientCode(): string {\n return localStorage.getItem(CONFIG.appPrefix + '_' + 'clientCode');\n}\n\nexport function setProject(value: string | null) {\n if (!value) {\n localStorage.removeItem(CONFIG.appPrefix + '_' + 'project_id');\n } else {\n localStorage.setItem(CONFIG.appPrefix + '_' + 'project_id', value);\n }\n}\n\nexport function getProject(): string | null {\n return localStorage.getItem(CONFIG.appPrefix + '_' + 'project_id');\n}\n\nexport function setToken(value: string) {\n localStorage.setItem(CONFIG.appPrefix + '_' + 'token', value);\n}\n\nexport function getToken(): string {\n return localStorage.getItem(CONFIG.appPrefix + '_' + 'token');\n}\n\nexport function setTokenExpire(value: string) {\n localStorage.setItem(CONFIG.appPrefix + '_' + 'token_expire', value);\n}\n\nexport function getTokenExpire(): string {\n return localStorage.getItem(CONFIG.appPrefix + '_' + 'token_expire');\n}\n\nexport function setRefreshToken(value: string) {\n localStorage.setItem(CONFIG.appPrefix + '_' + 'refresh_token', value);\n}\n\nexport function getRefreshToken(): string {\n return localStorage.getItem(CONFIG.appPrefix + '_' + 'refresh_token');\n}\n\nexport function setAutosave(value: boolean) {\n localStorage.setItem(CONFIG.appPrefix + '_' + 'autosave', String(value));\n}\n\nexport function getAutosave(): boolean {\n const value = localStorage.getItem(CONFIG.appPrefix + '_' + 'autosave');\n return value === 'true';\n}\n","import 'common/index';\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n// expose the modules object (__webpack_modules__)\n__webpack_require__.m = __webpack_modules__;\n\n","// define getter functions for harmony exports\n__webpack_require__.d = function(exports, definition) {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.g = (function() {\n\tif (typeof globalThis === 'object') return globalThis;\n\ttry {\n\t\treturn this || new Function('return this')();\n\t} catch (e) {\n\t\tif (typeof window === 'object') return window;\n\t}\n})();","__webpack_require__.o = function(obj, prop) { return Object.prototype.hasOwnProperty.call(obj, prop); }","// define __esModule on exports\n__webpack_require__.r = function(exports) {\n\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n\t}\n\tObject.defineProperty(exports, '__esModule', { value: true });\n};","// no baseURI\n\n// object to store loaded and loading chunks\n// undefined = chunk not loaded, null = chunk preloaded/prefetched\n// [resolve, reject, Promise] = chunk loading, 0 = chunk loaded\nvar installedChunks = {\n\t792: 0\n};\n\n// no chunk on demand loading\n\n// no prefetching\n\n// no preloaded\n\n// no HMR\n\n// no HMR manifest\n\n__webpack_require__.O.j = function(chunkId) { return installedChunks[chunkId] === 0; };\n\n// install a JSONP callback for chunk loading\nvar webpackJsonpCallback = function(parentChunkLoadingFunction, data) {\n\tvar chunkIds = data[0];\n\tvar moreModules = data[1];\n\tvar runtime = data[2];\n\t// add \"moreModules\" to the modules object,\n\t// then flag all \"chunkIds\" as loaded and fire callback\n\tvar moduleId, chunkId, i = 0;\n\tif(chunkIds.some(function(id) { return installedChunks[id] !== 0; })) {\n\t\tfor(moduleId in moreModules) {\n\t\t\tif(__webpack_require__.o(moreModules, moduleId)) {\n\t\t\t\t__webpack_require__.m[moduleId] = moreModules[moduleId];\n\t\t\t}\n\t\t}\n\t\tif(runtime) var result = runtime(__webpack_require__);\n\t}\n\tif(parentChunkLoadingFunction) parentChunkLoadingFunction(data);\n\tfor(;i < chunkIds.length; i++) {\n\t\tchunkId = chunkIds[i];\n\t\tif(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {\n\t\t\tinstalledChunks[chunkId][0]();\n\t\t}\n\t\tinstalledChunks[chunkId] = 0;\n\t}\n\treturn __webpack_require__.O(result);\n}\n\nvar chunkLoadingGlobal = self[\"webpackChunkaddon_stakeholder\"] = self[\"webpackChunkaddon_stakeholder\"] || [];\nchunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));\nchunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));","// startup\n// Load entry module and return exports\n// This entry module depends on other loaded chunks and execution need to be delayed\nvar __webpack_exports__ = __webpack_require__.O(undefined, [696,303,298,633], function() { return __webpack_require__(30018); })\n__webpack_exports__ = __webpack_require__.O(__webpack_exports__);\n"],"names":["deferred","savingMessage","autosavingMessages","lastAutosave","autosaveTimerId","startingApp","currentItem","OutlookApiException_1","require","OutlookWrongItemSelectedException_1","OutlookItemUtils","__importStar","sleep_1","config_1","__importDefault","jquery_1","Api","Auth","contactUtils_1","OutlookAsyncUtils","Ui","UserSettings","dateUtils_1","AppAutosave","errorHandler_1","ItemProperties","AppSave","exports","TAG","tryAutosaveIfDue","console","log","getDiffInMinutes","Date","default","autosaveIntervalInMinutes","waitForAllTasks","_a","sent","autosaveNewMessages","errorHandler","error_2","start","item","concat","subject","getSharedProperties","sharedProperties","isReadOnlySharedItem","showReadOnlySharedItemNotSupported","isItemSavedThroughApi","showMessageSaved","isAutosaved","showMessageAutosaved","isRecurringMaster","showSeriesEventNotSupported","isSavedMeeting","showPrimaryStakeholdersInfo","selectClientAnyProjectId","clientID","getDomainList","domainsInfo","_j","DomainDetails","ProjectGroupAvailable","_i","domains_1","domains","length","domain","_b","Projects","ID","_c","_d","ProjectGroups","group","_e","_f","_g","_h","sleep","OutlookWrongItemSelectedException","error_1","showItemNotSupportedPage","isGraphApiEnabled","clearInterval","undefined","window","setInterval","saveMessage","OutlookApiException","error_3","getAutosave","each","this","val","prop","Promise","all","getPrimaryStakeholders","getAdditionalStakeholders","primaryStakeholders","additionalStakeholders","showStakeholdersForm","itemType","attachments","getClientList","Clients","clients","show","hide","refreshClients","favouriteDomainAndGroup","domainList","FavouriteProjectDetails","favProjectName","ProjectName","projectGroupAvailable","favouriteProject","projectInfos","forEach","projectGroup","project","push","domainId","projectGroupId","projectId","find","projectInfo","getFavDomainAndGroup","refreshDomains","client","setClientCode","Name","ClientID","setProject","refreshToken","localStorage","clear","showLogoutSuccessDialog","allNewMessages","ApplicationException_1","loaderUtil_1","GraphApi","graphItemUtils_1","outlookItemUtils_1","App","AppContacts","getAutosaveContacts","getOrCreateContactGroup","contactGroupName","getContacts","id","contacts","autosaveMessagesForContact","contact","processedMessages","totalMessages","emailAddresses","address","ApplicationException","JSON","stringify","customFields","c","clientId","getDomain","domainUrl","getClientCode","isCorrectClientCode","getCustomFields","lastSyncDate","isNaN","Number","lastModifiedDateTime","messages","getMessages","findStakeholder","stakeholder","stakeholderId","Email","appName","deleteContact","messageSaved","messages_1","message","shouldSaveMessage","autosaveMessage","markItemAsSavedThroughGraph","setLastSyncDate","receivedDateTime","count","loaderDetails","addToLoaderDetails","text","secondaryText","isTokenValid","prepareMessages","addressesToDates","Map","contacts_1","fields","set","date","allMessages","contactMessagesAscending","sort","a","b","aDate","bDate","email","toLowerCase","filter","m","clone","adjustedLastSyncDate","setSeconds","getSeconds","from","emailAddress","toRecipients","recipient","r","isItemSavedThroughGraph","isExcludedPromise","ensureEmailSubjectIsNotExcluded","Subject","isSavedPromise","allowToSaveMessageAgain","findDuplicateEmail","EmailAddresses","__spreadArray","map","to","Message","body","content","DateTime","toIsoWithTimeZone","response","IsMatchFound","isEmailADuplicate","isExcluded","isSavedOnServer","emailType","saveInteraction","saveComplaint","uploadAttachmentsForItemId","attachmentsIds","getInteractionForAutosave","interaction","interactionId","linkInteractionToStakeholders","linkInteractionToAttachments","trackVitallyEvent","eventName","getComplaintForAutosave","complaint","complaintId","linkComplaintToStakeholders","linkComplaintToAttachments","direction","getDirectionForGraphItem","dateTime","template","communicationTemplate","getDirectionFromServer","communicationDirection","Location","CommunicationDate","Method","Text","Direction","Confidential","Duration","InteractionType","SentimentPhrases","AdditionalSharedProjectIDs","AssignedTo","DateOpened","Priority","Status","getDateFromOutlookItem","messageDate","setMilliseconds","getAllStakeholders","stakeholders","itemContacts","stakeholders_1","autosavedForAllContacts","every","givenName","startAutosaveDate","contactsWithMessages","hasMsg","hasMessage","some","hasMessages","errorContacts","contactsWithMessages_1","contactsWithMessages_2","result","contactEmail","error","errorMessage","join","ContactCustomFields_1","setCustomFields","personalNotes","parsed","Object","assign","ContactCustomFields","parse","updateDate","firstSaveDate","getContact","existingContact","FirstName","surname","LastName","name","children","existingCustomFields","createOrUpdateContact","updateContact","AddInFeatureNotSupportedException_1","ApiException_1","ItemIsNotSavedException_1","MeetingAlreadySavedException_1","AuthException_1","AuthInvalidGrantException_1","ConnectionException_1","ForbiddenException_1","OutlookException_1","OutlookItemNotSupported_1","friendlyMessage","friendlyMessageWithColon","friendlyMessageWithErrorMessage","ItemIsNotSavedException","showInfoDialog","MeetingAlreadySavedException","OutlookItemNotSupported","AddInFeatureNotSupportedException","ApiException","showErrorInForm","ConnectionException","AuthException","showAuthErrorDialog","ForbiddenException","OutlookException","outlookAsyncUtils_1","getAsyncCustomProperties","properties","isSaved","get","appPrefix","getExtendedProperty","property","saveAsyncCustomProperties","setExtendedProperty","trigger","getContactGroups","contactGroups","renderOptions","getConfidentialities","confidentialities","getUsers","users","getPriorities","priorities","getStatuses","statuses","getInteractionTypes","interactionTypes","getInteractionTags","tags","uiUtils_1","getSubjectFromOutlookItem","apply","saveStakeholders","savingStakeholders","createOrUpdateStakeholder","stakeholderIds","uploadAttachmentsIfSupported","getInteractionFromUi","getItemId","getAppointmentUids","uids","uid","MeetingUID","MeetingRecurrenceID","recurrenceId","getComplaintFromUi","getLocationFromOutlookItem","location","getDirectionFromOutlookItem","getEndDateFromOutlookItem","endDateTime","duration","getDiffInHours","getAsyncBody","confidentialValue","confidential","isConfidentialOptionsEnabled","Value","interactionType","interactionTypeID","parseInt","getStringValueOrNull","getInteractionMethodFromOutlookItem","select2","i","SentimentPhraseID","Phrase","priorityValue","assignedTo","statusValue","priority","toString","status","uploadAttachmentsForItem","isAttachmentsEnabled","canSaveAttachments","getSupportedAttachmentsForItem","uploadAttachmentContent","attachment","attachmentSize","size","request","FileName","SizeKb","validateAttachment","index","indexOf","splice","uploadOutlookAttachments","isInline","ResponsesByAttachment","IsSuccess","FileID","mergeStakeholderInfo","saveStakeholder","checks","DocumentType","DocumentID","ensureEmailIsNotDuplicate","getStakeholdersFromUi","stakeholdersIds","communication","markItemAsSavedThroughApi","showSaveSuccessfulDialog","createAutosaveContact","getProject","saveAutosaveContact","itemId","getSupportedAttachmentsForItemId","_super","call","__extends","Exception","originalException","AuthInvalidGrantException","InternalServerException","UnknownHttpException","apiResponse","_this","_typeof","statusCode","o","Symbol","iterator","constructor","prototype","rxjs_1","operators_1","AppOptions","logUtils_1","Authenticator_1","$","jQuery","selectProjectIds","selectDomain","selectProject","processingProjectChange","isProjectOptionsUpdated","Office","initialize","infoLogs$","handleLogs","logChange$","saveLogs","clearLogs","addToExistingLogs","pipe","debounceTime","tap","concatMap","catchError","Logs","of","infoLogsChange$","LogInfo","clearInfoLogs","addToExistingInfoLogs","errorLogs$","errorLogsChange$","LogError","clearErrorLogs","addToExistingErrorLogs","showInfoInLoader$","loaderDetails$","delay","loaderReminder","msg","html","merge","subscribe","Authenticator","isAuthDialog","version","enableDemoAPIRegion","setAppName","setFreeTrialUrl","freeTrialUrl","setIcon","appIcon","appIconWidth","setOptions","isComplaintsEnabled","setAutosave","showRegions","regions","click","handleSignInClick","isTokenExpired","handleSelectedOutlookItemChanged","permissionDialog","_triggerProjectChangeSubject","BehaviorSubject","context","mailbox","hidePages","hideSaveSuccessfulDialog","startAutosaveTimer","tryStart","domainElement","ui","displayDialogAsync","urls","origin","height","width","promptBeforeOpen","onPermissionDialogLoad","asyncResult","value","addEventHandler","EventType","DialogMessageReceived","onPermissionDialogResult","arg","close","permissionGranted","endsWith","slice","setDomain","baseUrl","authorizeUrl","auth","client_id","redirectUrl","form","scope","responseType","extraQueryParameters","login_hint","userProfile","authenticate","focus","getToken","code","refreshClientCode","selectAnyProjectId","innerError","error_4","handleSignInPermissionAllowedClick","handleLoginConfirmClick","handleAutosaveOptionClick","e","target","handleAutosaveOptionChosen","error_5","next","handleClientChange","event","blur","error_6","handleDomainChange","selectedDomain","projectGroupOption","singleProjectGroup","j","ProjectGroupName","multiple","placeholder","projectOption","singleProject","dataProject","handleProjectChanged","formSelectedProjectIds","includes","firstProject","optionPromises","refreshContactGroups","refreshConfidentialities","refreshUsers","refreshPriorities","refreshComplaintStatuses","refreshInteractionTypes","refreshInteractionTags","error_7","handleProjectGroupChange","values","defaultProject","selectedProjectGroups","pg","handleEmailTypeChange","handleItemAssignedToChange","handleComplaintPriorityChange","handleStakeholderTypeChange","parent","handleAdditionalStakeholderTypeChanged","pTable","handleSaveClick","checkSaveForm","trySaveMessage","handleSaveCancelClick","handleLogoutClick","logout","handleErrorDialogCloseClick","handleErrorDialogDetailsClick","handleInfoDialogOkClick","hideInfoDialog","handleLogoutSuccessDialogOkClick","reload","handleSavedDialogCloseClick","hideDocumentDetailsPage","handleSessionExpiredDialogOkClick","handleFutureAllTooltipClick","attr","v","onReady","document","ready","addHandlerAsync","ItemChanged","on","CommunicationTemplate_1","defineProperty","startDate","cleanTemplate","CommunicationTemplate","key","hasOwnProperty","Http","linkEntities","post","Success","LinkEntityType","getOptions","url","Array","isArray","outlookItemDirection","d","IsSubjectExcluded","ErrorCode","EntityID","stackHolderIds","LinkID","ToIDs","LinkPropertyAndStakholder","attachmentIds","responsesByAttachment","failedAttachments","Values","Id","ClientCode","checkUrl","StakeholderType","dto","resolve","isRefreshingToken","currentTime","tokenExpiry","getTokenExpire","isExpired","payload","grant_type","client_secret","redirect_uri","postForm","setTokenExpire","setToken","setRefreshToken","refresh_token","getRefreshToken","clientCode","getAllPartiesFromMessage","outlookItem","includeCc","addresses","cc","removeDuplicatesByEmail","getAllPartiesFromAppointment","appointment","isAppointmentReadMode","appointmentRead","requiredAttendees","optionalAttendees","appointmentCompose","getAsyncRecipients","organizer","getAsyncOrganizer","officeItem","userEmail","getUserEmail","getAllParties","parties","__assign","fullName","displayName","getFirstAndLastName","firstName","lastName","split","substr","tzo","getTimezoneOffset","dif","pad","num","norm","Math","floor","abs","getFullYear","getMonth","getDate","getHours","getMinutes","dateA","dateB","microsoft_graph_client_1","http_status_codes_1","graphAuthUtils_1","extendedPropertiesPropertyId","appId","expandExtendedProperties","contactFoldersCache","filterExtendedProperties","propertyValue","Client","initWithMiddleware","authProvider","GraphAuthenticationProvider","getContactGroup","has","createContactGroup","api","groups_1","PageIterator","iterate","g","groupId","patch","createContact","contactGroupId","contactId","delete","getMessagesFromFolder","folder","requests","path","extrasLength","fullSearchExpression","currentExpression","toISOString","encodeURIComponent","request_2","search","top","requests_1","getAllPagedMessages","getEvent","getUserGraphUrlSegment","getItemRestId","error_8","getAppExtendedProperties","expand","appExtendedProperties","singleValueExtendedProperties","error_11","targetMailbox","contacts_2","inbox","findIndex","m2","event_1","type","seriesMasterId","iCalUId","error_9","StatusCodes","NOT_FOUND","events","error_10","restItemId","userSegment","propertyName","currentProperties","json","newMessage","error_12","senderEmail","InternalServerException_1","UnknownHttpException_1","processError","httpError","responseJSON","UNAUTHORIZED","FORBIDDEN","INTERNAL_SERVER_ERROR","BAD_REQUEST","responseText","cache","reject","ajax","headers","Authorization","data","success","err","processedError","infoLogs","errorLogs","originalLog","originalInfo","info","originalError","getLogsByArguments","argumentsParam","originalConsole","logArguments","createLogRequest","logs","args","arguments","Exception_1","dialog_1","endpoint_1","AuthError","endpoint","_openAuthDialog","test","href","Dialog","getUrlParams","exclude","delimiter","replace","left","right","tokenString","extractParams","segment","trim","matchParts","params","regex","exec","decodeURIComponent","getLoginParams","state","_handleTokenResult","generateCryptoSafeRandom_1","endpointConfig","resource","generateCryptoSafeRandom","nonce","urlSegments","keys","param","random","Uint32Array","msCrypto","getRandomValues","Error","crypto","getAsync","bodyResult","AsyncResultStatus","Succeeded","recipients","recipientsResult","organizerResult","time","saveAsync","saveResult","getItemIdAsync","getIdResult","loadCustomPropertiesAsync","recurrence","recurrenceType","seriesId","getSharedPropertiesAsync","getAttachmentsAsync","attachmentId","getAttachmentContentAsync","api_1","assertHasGraphApi_1","owner","getAsyncLocation","dateTimeCreated","getAsyncTime","getAsyncId","getItemIdBySearchOnCustomProperties","getItemIdBySearchOnCustomPropertiesError_1","errorsDescription","getIdError","getIdError_1","saveError","saveError_1","getItemIdBySearchOnCustomPropertiesError","assertHasGraphApi","searchFlagValue","getFirstEventIdByCustomProperty","valueOf","getAttachments","contentBytes","contentType","attachmentType","DataType","getAsyncSubject","end","requirements","isSetSupported","MailboxEnums","AttachmentType","File","Item","__awaiter","getAttachmentContent","itemTypeText","pair","base64Content","format","AttachmentContentFormat","Eml","ICalendar","btoa","delegatePermissions","DelegatePermissions","EditOwn","EditAll","remove","ItemType","Appointment","findDuplicateMeeting","StartDate","hostName","diagnostics","convertToRestId","RestVersion","v2_0","ms","setTimeout","showAdditionalStakeholders","additionalStakeholdersHtml","getStkFormAdd","showAllStakeholders","showCheckboxes","setAppNameInElement","getMultiSelectValues","names","s","emails","tooltip","l","currentLabel","changeLabelsByItemType","removeAttr","readModeAttachments","primaryStakeholder","itemEmail","itemPos","contactGroupsArray","stakeholderType","itemOrg","fname","lname","itemMobile","ContactGroupIDs","Organisations","Position","IsFavourite","MobileNumber","WorkPhoneNumber","saveCheckbox","itemOrgTo","itemEmailTo","itemPosTo","itemMobileTo","StakeholderTypeTo","fnameTo","additionalStakeholder","elements_1","options","selector","addEmptyOption","regionSelect","selected","api_url","label","errorDetails","stack","clientOption","hasDefault","IsCurrent","unshift","clientOptions","setAttribute","domainOption","DomainName","domainOptions","groupsWithAccessibleProjects","getItem","setItem","removeItem","String","__webpack_module_cache__","__webpack_require__","moduleId","cachedModule","module","__webpack_modules__","O","chunkIds","fn","notFulfilled","Infinity","fulfilled","definition","enumerable","globalThis","Function","obj","toStringTag","installedChunks","chunkId","webpackJsonpCallback","parentChunkLoadingFunction","moreModules","runtime","chunkLoadingGlobal","self","bind","__webpack_exports__"],"sourceRoot":""}